/* Liventory — Apple-style (iOS / macOS) light design.
   System font, grouped backgrounds, white rounded cards, hairline separators, frosted bars, one blue accent. */
:root {
  /* palette "Cosmic Artistry": 212A31 · 2E3944 · 124E66 · 748D92 · D3D9D4 (owner, 28 Nov 2026) */
  --blue: #124e66; --blue-press: #0c3a4d; --green: #2e9e5b; --red: #d93a2f; --orange: #d9822b; --pink: #d6456b; --indigo: #3d5a80;
  --label: #212a31; --label2: #2e394499; --label3: #2e39444d; --label2-solid: #56676d;
  --sep: #2e394426; --fill: #748d9233; --fill2: #748d921f;
  --bg: #e6eae7; --card: #ffffff; --bar: rgba(240, 243, 241, .82); --side: rgba(230, 234, 231, .78);
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --elevated: #ffffff; --field-focus: #ffffff; --switch-off: #d3d9d4; --chip-on: #ffffff; --hover: #f1f4f2; --press: #e4e9e6;
  --drop-bg: #f6f8f7; --good-text: #23784a; --warn-text: #a85a12; --modal-shade: rgba(33, 42, 49, .35);
  color-scheme: light;
  --ease: cubic-bezier(.25, .1, .25, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  color: var(--label); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font-size: 16px; line-height: 1.45; letter-spacing: -0.01em; }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; margin: 0; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h3 { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; color: var(--label2-solid); margin: 22px 0 8px 2px; }
.muted { color: var(--label2-solid); }
.small { font-size: 13px; }
.err { color: var(--red); }
.warn { color: var(--warn-text); }
.good { color: var(--good-text); }
.bad { color: var(--red); }
.boot { padding: 60px; text-align: center; color: var(--label2-solid); }
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; background: var(--fill2);
  color: var(--blue); border-radius: 999px; padding: 8px 18px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .2s var(--ease), transform .1s var(--ease), opacity .2s; }
.btn:hover { background: var(--fill); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-press); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--fill2); }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 14px; }
.btn.big { min-height: 50px; padding: 12px 28px; font-size: 17px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn .icon { width: 18px; height: 18px; }

/* ---------- inputs ---------- */
input, select, textarea { font: inherit; font-size: 16px; border: 0; border-radius: var(--r-sm); padding: 10px 12px; min-height: 44px;
  background: var(--fill2); color: var(--label); width: 100%; transition: background .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
input::placeholder, textarea::placeholder { color: var(--label3); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--field-focus); box-shadow: 0 0 0 1px var(--sep), 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
input:disabled, select:disabled, textarea:disabled { color: var(--label); opacity: 1; background: transparent; padding-left: 0; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 34px; cursor: pointer; }
select:disabled { background-image: none; }
textarea { resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; min-height: 120px; }
input[type="search"] { padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 18px; }
/* iOS switch for every checkbox */
input[type="checkbox"] { width: 51px; min-width: 51px; height: 31px; min-height: 31px; padding: 0; border-radius: 999px; background: var(--switch-off); position: relative; cursor: pointer;
  transition: background .25s var(--ease); flex: none; }
input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .06); transition: transform .25s var(--ease); }
input[type="checkbox"]:checked { background: var(--green); }
input[type="checkbox"]:checked::after { transform: translateX(20px); }
input[type="checkbox"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
input[type="checkbox"]:disabled { opacity: .5; cursor: default; padding: 0; background: var(--switch-off); }
input[type="checkbox"]:disabled:checked { background: var(--green); }

/* segmented control (language) */
.lang-switch { display: inline-flex; background: var(--fill2); border-radius: 9px; padding: 2px; gap: 0; }
.chip { border: 0; background: transparent; border-radius: 7px; padding: 5px 14px; min-height: 30px; font: inherit; font-size: 13px; font-weight: 500; color: var(--label); cursor: pointer; transition: background .2s, box-shadow .2s; }
.chip.on { background: var(--chip-on); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }

.tag { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--blue) 16%, var(--card)); color: var(--blue); font-weight: 600; }
.tag.grey { background: var(--fill2); color: var(--label2-solid); }
.tag.green { background: color-mix(in srgb, var(--green) 18%, var(--card)); color: var(--good-text); }

/* ---------- layout ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep); z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand small { font-weight: 400; color: var(--label2-solid); font-size: 15px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.me { font-size: 14px; color: var(--label2-solid); padding-left: 14px; border-left: 1px solid var(--sep); }
/* round icon buttons (language, appearance) with a small menu */
.tmenu { position: relative; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--fill2); color: var(--label); display: inline-grid; place-items: center;
  cursor: pointer; transition: background .2s var(--ease), transform .1s var(--ease); }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--fill); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .icon { width: 20px; height: 20px; }
.top-right { gap: 8px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; background: var(--elevated); border-radius: 14px; z-index: 60;
  box-shadow: 0 0 0 .5px var(--sep), 0 12px 32px rgba(0, 0, 0, .18); animation: menuIn .16s var(--ease); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 8px 12px 8px 8px; border: 0; border-radius: 9px;
  background: none; color: var(--label); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline: none; }
.menu button .icon { width: 18px; height: 18px; color: var(--label2-solid); }
.menu button .icon.ck { color: var(--blue); visibility: hidden; }
.menu button[aria-checked="true"] { font-weight: 600; }
.menu button[aria-checked="true"] .icon.ck { visibility: visible; }
.menu-btn { display: none; }
.side { position: fixed; top: 52px; bottom: 0; left: 0; width: 232px; padding: 14px 10px; background: var(--side);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-right: .5px solid var(--sep); overflow-y: auto; z-index: 15; }
.side a { display: flex; gap: 10px; align-items: center; min-height: 38px; padding: 7px 12px; border-radius: 9px; color: var(--label); font-size: 15px; font-weight: 500; margin-bottom: 2px; transition: background .15s; }
.side a .icon { color: var(--blue); width: 20px; height: 20px; }
.side a:hover { background: var(--fill2); }
.side a.on { background: var(--blue); color: #fff; }
.side a.on .icon { color: #fff; }
main { margin: 52px 0 0 232px; padding: 28px 36px 80px; transition: margin-right .22s var(--ease); }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }
.page-head .back { width: 100%; font-size: 17px; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }
.page-head .back .icon { width: 20px; height: 20px; }
.lead { color: var(--label2-solid); margin: -6px 0 20px; max-width: 720px; }
.card { background: var(--card); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card > h3:first-child, .card > .team-head:first-child h3 { margin-top: 0; }
.empty { text-align: center; padding: 56px 16px; color: var(--label2-solid); }
.empty > .icon { width: 48px; height: 48px; color: var(--label3); margin-bottom: 8px; }
.empty p { margin: 6px 0; }
.empty .actions { justify-content: center; }

/* ---------- lists ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { flex: 1 1 280px; background-color: var(--card); box-shadow: var(--shadow); }
.filters select { width: auto; flex: 0 1 190px; background-color: var(--card); box-shadow: var(--shadow); }
.count { font-size: 13px; color: var(--label2-solid); margin: 0 0 8px 4px; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th { text-align: left; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; color: var(--label2-solid); padding: 10px 12px; border-bottom: .5px solid var(--sep); }
table.list td { padding: 11px 12px; border-bottom: .5px solid var(--sep); vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list.small td { padding: 8px 10px; font-size: 14px; }
.list-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
table.list.people tbody tr { cursor: pointer; transition: background .12s; }
table.list.people tbody tr:hover { background: var(--hover); }
table.list.people tbody tr:active { background: var(--press); }
table.list.people td.chev { width: 28px; color: var(--label3); padding-left: 0; }
table.list.people td.chev .icon { width: 18px; height: 18px; }
td.fp { color: var(--label2-solid); font-variant-numeric: tabular-nums; width: 64px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #fff; flex: none; }
.who { display: flex; align-items: center; gap: 12px; }
.who b { font-weight: 600; }
.who .sub { display: block; font-size: 13px; color: var(--label2-solid); font-weight: 400; }
tr.off, li.off, .card.off { opacity: .5; }

/* ---------- forms (iOS grouped) ---------- */
.form .grid, .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 18px; }
.f { display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.f > span { color: var(--label2-solid); font-weight: 500; font-size: 13px; padding-left: 2px; }
.f small { font-size: 12px; color: var(--label2-solid); padding-left: 2px; }
.f small.good { color: var(--good-text); } .f small.bad { color: var(--red); }
.f.check { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; align-self: end; min-height: 44px;
  background: var(--fill2); border-radius: var(--r-sm); padding: 6px 8px 6px 12px; }
.f.check span { color: var(--label); font-weight: 400; font-size: 15px; padding: 0; order: -1; }
.f.inline { flex-direction: row; align-items: center; gap: 10px; }
.f.inline > span { white-space: nowrap; }
.f.inline input, .f.inline select { width: auto; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.actions .f.inline { margin-right: auto; }
.form-sticky { position: sticky; bottom: 0; z-index: 5; margin: 0 -20px -18px; padding: 12px 20px; background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); border-radius: 0 0 var(--r) var(--r); }

/* ---------- groups ---------- */
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; align-items: start; }
.team-head { display: flex; align-items: center; gap: 10px; }
.team-head h3 { margin: 0 auto 0 0; font-size: 20px; font-weight: 600; text-transform: none; letter-spacing: -0.02em; color: var(--label); }
.team .card-body { margin: 12px -20px -18px; }
ul.groups { list-style: none; padding: 0; margin: 0; }
ul.groups li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px 6px 20px; border-top: .5px solid var(--sep); }
ul.groups li > .gname { margin-right: auto; font-weight: 500; display: flex; align-items: center; gap: 10px; }
ul.groups li .gname .icon { width: 18px; height: 18px; color: var(--indigo); }

/* ---------- schemes ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card.scheme { color: var(--label); display: block; transition: transform .2s var(--ease), box-shadow .2s var(--ease); margin: 0; position: relative; }
.card.scheme:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 12px 28px rgba(0,0,0,.08); }
.card.scheme h2 { margin: 6px 0 4px; }
.card.scheme .icon.badge { position: absolute; right: 18px; top: 18px; width: 36px; height: 36px; padding: 7px; border-radius: 10px; color: #fff; }
.scheme-type { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--label2-solid); font-weight: 600; }
.ver-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.edit-table { max-width: 560px; background: var(--fill2); border-radius: var(--r-sm); }
.edit-table td { padding: 4px 6px; }
.edit-table input { min-height: 36px; padding: 6px 10px; background: var(--elevated); }
.edit-table input:disabled { background: transparent; }
.above { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.above input { width: 140px; }
table.sim td, table.sim th { text-align: right; font-variant-numeric: tabular-nums; }
table.sim td:first-child, table.sim th:first-child { text-align: left; }
table.breakdown { max-width: 440px; }
table.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; font-size: 17px; border-top: 1px solid var(--label); }
td.neg { color: var(--red); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grid.try { max-width: 920px; }

/* ---------- import wizard ---------- */
.steps { display: grid; gap: 14px; }
.steps > .card, #fpcard { margin: 0; }
.step > div { min-width: 0; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 4px 16px; }
.step .num { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px; margin-top: 2px; }
.step.done .num { background: var(--green); }
.step .num .icon { width: 18px; height: 18px; color: #fff; }
#fpcard .num { background: var(--indigo); }
.step.wait .num { background: var(--fill); color: var(--label2-solid); }
.step h2 { margin: 4px 0 6px; font-size: 19px; }
.step p { margin: 4px 0; }
.step ol { margin: 6px 0; padding-left: 20px; }
.step ol li { margin: 4px 0; }
.kbd { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--fill2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 10px; border: 2px dashed var(--label3); border-radius: var(--r); padding: 30px 16px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; background: var(--drop-bg); }
.drop:hover, .drop.over { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--card)); }
.drop .icon { width: 40px; height: 40px; color: var(--blue); }
.drop b { display: block; font-size: 17px; margin: 6px 0 2px; word-break: break-word; }
.drop.has { border-style: solid; border-color: var(--green); background: color-mix(in srgb, var(--green) 9%, var(--card)); }
.drop.has .icon { color: var(--good-text); }
details.alt { margin-top: 12px; }
details.alt summary { cursor: pointer; color: var(--blue); font-size: 15px; min-height: 32px; display: flex; align-items: center; }
.result { margin-top: 12px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--fill2); }
.result.done { background: color-mix(in srgb, var(--green) 14%, var(--card)); }
.result p { margin: 4px 0; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.stat { background: var(--elevated); border-radius: var(--r-sm); padding: 8px 14px; min-width: 110px; }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--label2-solid); }

/* ---------- dialog, toast, login ---------- */
.modal { position: fixed; inset: 0; background: var(--modal-shade); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
  animation: fade .2s var(--ease); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dialog { background: var(--elevated); width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; border-radius: 18px; padding: 22px; animation: pop .25s var(--ease);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2); margin: 0; }
.dialog .actions { justify-content: flex-end; margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: rgba(30, 30, 32, .92); color: #fff; padding: 11px 20px; border-radius: 999px;
  z-index: 60; max-width: 90vw; font-size: 15px; font-weight: 500; box-shadow: 0 8px 30px rgba(0,0,0,.2); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: pop .25s var(--ease); }
.toast.bad { background: rgba(215, 0, 21, .94); }
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card { background: var(--card); border-radius: 22px; padding: 44px 36px 32px; text-align: center; width: 100%; max-width: 390px; box-shadow: 0 8px 40px rgba(0, 0, 0, .08);
  display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-logo { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 8px 24px rgba(88, 86, 214, .3); }
.login-card h1 { font-size: 30px; }
.login-card p { margin: 0; }
.login-card .btn { width: 100%; }

:root[data-theme="dark"] {
  --blue: #6bb4d0; --blue-press: #8cc6dc; --green: #4cc38a; --red: #ff8075; --orange: #f0a24a; --pink: #f06a8f; --indigo: #7f9cc9;
  --label: #eef1ee; --label2: #d3d9d499; --label3: #d3d9d44d; --label2-solid: #a3b3b7;
  --sep: #748d9247; --fill: #748d9252; --fill2: #748d922e;
  --bg: #212a31; --card: #2e3944; --bar: rgba(33, 42, 49, .82); --side: rgba(33, 42, 49, .78);
  --shadow: none; --elevated: #36434f; --field-focus: #36434f; --switch-off: #46545f; --chip-on: #4b5a66; --hover: #36434f; --press: #3e4c58;
  --drop-bg: #2a343e; --good-text: #5fd39a; --warn-text: #f3b467; --modal-shade: rgba(10, 14, 17, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #6bb4d0; --blue-press: #8cc6dc; --green: #4cc38a; --red: #ff8075; --orange: #f0a24a; --pink: #f06a8f; --indigo: #7f9cc9;
    --label: #eef1ee; --label2: #d3d9d499; --label3: #d3d9d44d; --label2-solid: #a3b3b7;
    --sep: #748d9247; --fill: #748d9252; --fill2: #748d922e;
    --bg: #212a31; --card: #2e3944; --bar: rgba(33, 42, 49, .82); --side: rgba(33, 42, 49, .78);
    --shadow: none; --elevated: #36434f; --field-focus: #36434f; --switch-off: #46545f; --chip-on: #4b5a66; --hover: #36434f; --press: #3e4c58;
    --drop-bg: #2a343e; --good-text: #5fd39a; --warn-text: #f3b467; --modal-shade: rgba(10, 14, 17, .6);
    color-scheme: dark;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- phone: bottom tab bar, large titles ---------- */
@media (max-width: 760px) {
  .top { height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; }
  .me, .top .lang-switch, .brand small, #logout { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .side { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: calc(56px + env(safe-area-inset-bottom)); padding: 4px 4px env(safe-area-inset-bottom);
    display: flex; justify-content: space-around; border-right: 0; border-top: .5px solid var(--sep); background: var(--bar); overflow: visible; z-index: 30; }
  .side a { flex: 1; flex-direction: column; gap: 2px; padding: 4px 2px; margin: 0; font-size: 10px; font-weight: 500; color: var(--label2-solid); min-height: 48px; justify-content: center; border-radius: 0; }
  .side a .icon { color: inherit; width: 24px; height: 24px; }
  .side a:hover { background: transparent; }
  .side a.on { background: transparent; color: var(--blue); }
  .side a.on .icon { color: var(--blue); }
  main { margin: calc(48px + env(safe-area-inset-top)) 0 0; padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); }
  h1 { font-size: 30px; }
  .card { padding: 16px; }
  .form-sticky { margin: 0 -16px -16px; padding: 12px 16px; }
  .team .card-body { margin: 12px -16px -16px; }
  /* people: iOS list rows */
  table.list.people thead { display: none; }
  table.list.people, table.list.people tbody { display: block; }
  table.list.people tr { display: flex; align-items: center; gap: 0 10px; padding: 10px 14px; border-bottom: .5px solid var(--sep); }
  table.list.people tbody tr:last-child { border-bottom: 0; }
  table.list.people td { display: none; border: 0; padding: 0; }
  table.list.people td.nm, table.list.people td.chev, table.list.people td.st { display: block; }
  table.list.people td.nm { flex: 1; min-width: 0; }
  table.list.people td.nm .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .filters select { flex: 1 1 30%; min-width: 0; }
  .teams, .cards { grid-template-columns: 1fr; }
  .step { grid-template-columns: 32px 1fr; gap: 4px 12px; }
  .step .num { width: 28px; height: 28px; font-size: 14px; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .dialog { align-self: flex-end; border-radius: 18px 18px 0 0; max-width: none; margin: 0 -16px -16px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

.f > .lang-switch { align-self: flex-start; }

/* ---------- Phase 2: daily report, month grids, attendance ---------- */
.r { text-align: right; }
.tabs { margin-left: auto; }
.tabs .chip { display: inline-flex; align-items: center; min-height: 32px; color: var(--label); text-decoration: none; }
.datebar { display: flex; align-items: center; gap: 6px; }
.datebar input { width: auto; background-color: var(--card); box-shadow: var(--shadow); }
.datebar .btn { min-width: 40px; padding: 4px 8px; }
.filters .datebar { flex: 0 1 auto; }
.entry { display: grid; grid-template-columns: minmax(160px, 1fr) 150px auto; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: .5px solid var(--sep); }
.entry:last-child { border-bottom: 0; }
.entry .dia { text-align: right; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.status .chip { padding: 5px 10px; }
.status .chip.on.st-live { background: var(--green); color: #fff; }
.status .chip.on.st-off { background: var(--label2-solid); color: #fff; }
.status .chip.on.st-sick { background: var(--orange); color: #fff; }
.status .chip.on.st-permit { background: var(--blue); color: #fff; }
.status .chip.on.st-absent { background: var(--red); color: #fff; }
.add-row { margin: 12px 0; max-width: 420px; }
.add-row select { background-color: var(--card); box-shadow: var(--shadow); }
.savebar { position: sticky; bottom: 12px; z-index: 6; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 18px; border-radius: 999px; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12); border: .5px solid var(--sep); }
.savebar b { font-size: 20px; font-variant-numeric: tabular-nums; }
.savebar .tag { margin-left: 6px; }
table.grid-month { font-size: 13px; font-variant-numeric: tabular-nums; }
table.grid-month th, table.grid-month td { padding: 7px 6px; text-align: center; white-space: nowrap; }
table.grid-month th a { color: inherit; display: block; min-width: 22px; }
table.grid-month .sticky { position: sticky; left: 0; background: var(--card); text-align: left; z-index: 1; min-width: 130px; box-shadow: .5px 0 0 var(--sep); }
table.grid-month td.st-live { color: var(--label); }
table.grid-month td.st-off { color: var(--label2-solid); }
table.grid-month td.st-sick { color: var(--orange); font-weight: 700; }
table.grid-month td.st-permit { color: var(--blue); font-weight: 700; }
table.grid-month td.st-absent { color: var(--red); font-weight: 700; }
table.grid-month .sun, table.grid-month .hol { background: var(--fill2); }
table.grid-month tr.total td { font-size: 13px; }
table.att td { min-width: 34px; }
table.att .dot { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin: 0 auto 2px; }
table.att .tm { font-size: 10px; color: var(--label2-solid); }
.stats.big { margin-bottom: 14px; }
.stats.big .stat { background: var(--card); box-shadow: var(--shadow); min-width: 150px; padding: 12px 18px; }
.stats.big .stat b { font-size: 28px; }
a.who { color: var(--label); }
.list-card.more { margin-bottom: 18px; }
.list-card.more a { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; color: var(--label); border-bottom: .5px solid var(--sep); }
.list-card.more a:last-child { border-bottom: 0; }
.list-card.more a > span { flex: 1; }
.list-card.more .icon { color: var(--blue); }
.list-card.more .icon.chev { color: var(--label3); width: 18px; height: 18px; }
@media (max-width: 760px) {
  .side a.notab { display: none; }
  .tabs { margin-left: 0; width: 100%; }
  .tabs .chip { flex: 1; justify-content: center; }
  .entry { grid-template-columns: 1fr 120px; gap: 8px 10px; padding: 10px 14px; }
  .entry .status { grid-column: 1 / -1; display: flex; }
  .entry .status .chip { flex: 1; padding: 6px 2px; font-size: 12px; }
  .savebar { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .datebar { flex: 1 1 100%; }
  .datebar input { flex: 1; }
  .stats.big .stat { min-width: 0; flex: 1; padding: 10px 12px; }
  .stats.big .stat b { font-size: 22px; }
}
@media (min-width: 761px) { .list-card.more a.phone { display: none; } }
table.sum th, table.sum td { white-space: nowrap; }

/* ---------- Phase 3: payroll ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--blue) 10%, var(--card)); margin-bottom: 14px; }
.banner > .icon { color: var(--blue); }
.banner > div { flex: 1; }
.banner.locked { background: color-mix(in srgb, var(--green) 12%, var(--card)); }
.banner.locked > .icon { color: var(--good-text); }
table.pay tbody tr { cursor: pointer; }
table.pay tbody tr:hover { background: var(--hover); }
table.list th.r, table.list td.r { text-align: right; font-variant-numeric: tabular-nums; }
table.pay td.chev { width: 28px; color: var(--label3); white-space: nowrap; text-align: right; }
table.pay td.chev .warn-dot, table.pay td.chev .tag { margin-right: 6px; vertical-align: middle; }
/* every team's table gets the same columns, so the numbers line up from team to team */
@media (min-width: 761px) {
  table.pay { table-layout: fixed; }
  table.pay th:nth-child(1) { width: 21%; } table.pay th:nth-child(2) { width: 12%; } table.pay th:nth-child(3) { width: 23%; }
  table.pay th:nth-child(4) { width: 12%; } table.pay th:nth-child(5) { width: 9%; } table.pay th:nth-child(6) { width: 14%; } table.pay th:nth-child(7) { width: 9%; }
  table.pay td { overflow: hidden; text-overflow: ellipsis; }
}
table.pay tr.grp td { padding: 14px 16px 6px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--label2-solid);
  background: var(--fill2); border-top: .5px solid var(--sep); cursor: default; }
table.pay tr.grp:hover td { background: var(--fill2); }
table.pay td.chev .icon { width: 18px; height: 18px; }
.warn-dot { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; margin-left: 6px; vertical-align: middle; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; }
.sub { display: block; }
table.breakdown .sub { display: inline; }
.dialog { max-height: 90vh; overflow-y: auto; }
.slip { max-width: 720px; padding: 28px 30px; }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--sep); margin-bottom: 14px; }
.slip-head img { width: 34px; height: 34px; border-radius: 8px; vertical-align: middle; margin-right: 8px; }
.slip-head b { font-size: 18px; }
.slip-head .r b { display: block; letter-spacing: .08em; }
.slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 12px 0; }
.slip-grid span { display: block; font-size: 12px; color: var(--label2-solid); text-transform: uppercase; letter-spacing: .03em; }
.slip-table { max-width: none; margin: 8px 0 14px; }
@media print {
  .top, .side, .no-print, .toast, .savebar { display: none !important; }
  main { margin: 0 !important; padding: 0 !important; max-width: none; }
  body, html { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
  :root { --label: #000; --card: #fff; --bg: #fff; }
}
@media (max-width: 760px) { table.pay th:nth-child(2), table.pay td:nth-child(2), table.pay th:nth-child(3), table.pay td:nth-child(3), table.pay th:nth-child(4), table.pay td:nth-child(4) { display: none; } table.pay td .who .sub { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* ---------- Phase 4: diamond board ---------- */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.board-head .bmonth { font-size: 20px; min-width: 170px; text-align: center; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--label2-solid); }
.live .ldot { width: 9px; height: 9px; border-radius: 50%; background: var(--label3); }
.live.on { color: var(--good-text); }
.live.on .ldot { background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.kpis .stat b.ellip { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; display: block; }
.board-tabs { margin: 4px 0 18px; flex-wrap: wrap; }
.board-tabs .chip { min-height: 32px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 18px; }
.pod { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.pod.p1 { padding-top: 26px; padding-bottom: 24px; }
.pod .medal { position: absolute; top: -12px; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.pod.p1 .medal { background: #e3a008; } .pod.p2 .medal { background: #8e8e93; } .pod.p3 .medal { background: #b06a3b; }
.pod .pav { width: 52px; height: 52px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.pod.p1 .pav { width: 64px; height: 64px; font-size: 20px; background: var(--indigo); }
.pod b { font-size: 17px; }
.pod .pdia { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.pod.p1 .pdia { font-size: 30px; }
.board-charts { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.board-charts .card { margin-bottom: 18px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .gl { stroke: var(--sep); stroke-width: 1; }
svg.chart .axis { fill: var(--label2-solid); font-size: 11px; }
svg.chart .axis.strong { fill: var(--label); font-weight: 700; }
svg.chart .axis.lbl { fill: var(--label); font-size: 12px; }
svg.chart .axis.val { fill: var(--label); font-weight: 600; }
svg.chart .bar { fill: color-mix(in srgb, var(--blue) 45%, var(--card)); }
svg.chart .bar.cur { fill: var(--blue); }
svg.chart .proj { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 4 3; }
svg.chart .tick { stroke: var(--label); stroke-width: 2; }
svg.chart rect[data-tip] { cursor: pointer; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--label2-solid); margin: -4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg-bar { width: 14px; height: 10px; border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--blue) 45%, var(--card)); }
.legend .lg-tick { width: 2px; height: 14px; background: var(--label); }
.talents { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tcard { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 4px 10px; }
.trank { font-weight: 700; color: var(--label2-solid); font-variant-numeric: tabular-nums; min-width: 30px; }
.lvdot { width: 10px; height: 10px; border-radius: 50%; }
.lvdot.lv1 { background: color-mix(in srgb, var(--blue) 18%, var(--card)); border: 1px solid color-mix(in srgb, var(--blue) 40%, var(--card)); }
.lvdot.lv2 { background: color-mix(in srgb, var(--blue) 40%, var(--card)); }
.lvdot.lv3 { background: color-mix(in srgb, var(--blue) 65%, var(--card)); }
.lvdot.lv4 { background: var(--blue); }
.lvdot.lv5 { background: var(--indigo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 25%, transparent); }
.tname { min-width: 0; }
.tname b { display: block; }
.tname .small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdia { text-align: right; font-variant-numeric: tabular-nums; }
.tdia b { display: block; font-size: 17px; }
.tbar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--fill2); position: relative; overflow: visible; margin-top: 4px; }
.tbar span { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.tbar i { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--label); border-radius: 1px; }
.board-note { margin-top: 14px; }
.tip { position: fixed; z-index: 70; background: rgba(30, 30, 32, .92); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 13px; pointer-events: none; white-space: nowrap; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox input { flex: 1 1 260px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
body.public-board main { margin-left: 0; max-width: 1280px; margin-right: auto; margin-left: auto; }
body.public-board .top .lang-switch { display: inline-flex !important; }
@media (max-width: 900px) { .board-charts { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .podium { gap: 8px; }
  .pod { padding: 14px 6px; }
  .pod .pav { width: 40px; height: 40px; font-size: 13px; }
  .pod.p1 .pav { width: 48px; height: 48px; }
  .pod b { font-size: 14px; }
  .pod .pdia { font-size: 17px; }
  .pod.p1 .pdia { font-size: 20px; }
  .talents { grid-template-columns: 1fr; }
  body.public-board main { margin-top: calc(48px + env(safe-area-inset-top)); padding-bottom: 30px; }
}
svg.chart .axis { font-size: 12px; }
svg.chart .axis.lbl { font-size: 13px; }
@media (max-width: 760px) {
  .kpis { gap: 8px; }
  .stats.big.kpis .stat { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .kpis .stat b.ellip { max-width: 100%; }
  .board-head .bmonth { min-width: 0; font-size: 18px; }
}

/* ---------- Phase 5: talents, registration ---------- */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; margin-left: 4px; }
.mrow { display: grid; grid-template-columns: 70px 1fr 64px 90px; align-items: center; gap: 10px; padding: 6px 0; }
.mrow .tbar { margin: 0; grid-column: auto; }
.mrow b { text-align: right; font-variant-numeric: tabular-nums; }
.dayrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 16px; border-bottom: .5px solid var(--sep); }
.dayrow:last-child { border-bottom: 0; }
.dayrow .r b { font-size: 17px; font-variant-numeric: tabular-nums; }
.card.next .stats { margin: 0 0 12px; }
.tbar.big { height: 10px; margin: 4px 0 8px; }
.banner.warnb { background: color-mix(in srgb, var(--orange) 14%, var(--card)); }
.banner.warnb > .icon { color: var(--orange); }
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.photos.small { grid-template-columns: repeat(auto-fill, minmax(140px, 180px)); margin-bottom: 8px; }
.photos.small a { display: flex; flex-direction: column; gap: 4px; color: var(--label); }
.photos.small img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); background: var(--fill2); }
.photo-box { display: flex; flex-direction: column; gap: 6px; }
.photo-box .plabel { font-size: 13px; font-weight: 500; color: var(--label2-solid); }
.drop.photo { margin-top: 0; min-height: 190px; justify-content: center; padding: 12px; overflow: hidden; }
.drop.photo img { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--r-sm); }
.drop.busy { opacity: .5; pointer-events: none; }
.regcard .slip-grid { margin-top: 8px; }
.linkrow { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: .5px solid var(--sep); }
.linkrow:first-of-type { border-top: 0; }
@media (max-width: 760px) {
  .photos { grid-template-columns: 1fr; }
  .mrow { grid-template-columns: 56px 1fr 56px; }
  .mrow > span:last-child { display: none; }
  .slip-grid { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
}
.linkrow > .btn { align-self: flex-start; }
#app.nonav main { margin-left: auto; margin-right: auto; max-width: 1180px; }
#gbtn { min-height: 44px; }
/* Google draws its button in an iframe; a dark page makes the browser paint a white box behind it unless the iframe is "light" too. */
#gbtn, #gbtn iframe { color-scheme: light !important; background: transparent !important; }

/* Anything marked hidden stays hidden, even if a component sets its own display. */
[hidden] { display: none !important; }
.empty h2 { margin: 4px 0 2px; }
.empty .actions { gap: 10px; margin-top: 16px; }

/* ---------- payroll summary: one card per team ---------- */
.tcards { columns: 2 420px; column-gap: 14px; }
.tcards .card.tcard { break-inside: avoid; margin-bottom: 14px; }
.card.tcard { display: block; padding: 18px 20px; }
.tcard .thead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tcard .thead h2 { margin-bottom: 2px; }
.tcard .tval { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.tcard .tval b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tcard.total .tval b { font-size: 32px; }
.tcard.total { margin-bottom: 14px; }
.delta { font-size: 13px; color: var(--label2-solid); white-space: nowrap; }
.delta.up { color: var(--warn-text); }
.delta.down { color: var(--good-text); }
.tcard .split { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 8px; font-size: 14px; color: var(--label2-solid); }
.tcard .split b { color: var(--label); font-variant-numeric: tabular-nums; margin-left: 2px; }
.tcard .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.tcard .bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--fill2); }
.tcard .bar i { display: block; height: 100%; }
.tcard .sal { background: var(--blue); }
.tcard .bon { background: var(--orange); }
.tcard .oth { background: var(--label3); }
.tcard .glist { margin-top: 12px; }
.tcard .gline { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: .5px solid var(--sep); }
.tcard .gname { display: flex; flex-direction: column; min-width: 0; }
.tcard .gval { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.tcard .gval b { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .tcards { columns: 1; } .tcard .tval b { font-size: 22px; } .tcard.total .tval b { font-size: 26px; } }
@media print { .tcards { columns: 2; } .tcard { break-inside: avoid; } .tcard .bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- transfer slip ---------- */
.card.slip { max-width: 760px; padding: 0; overflow: hidden; }
.slip-band { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 28px;
  background: linear-gradient(135deg, #1d1d1f, #0a0a0b); color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sb-brand { display: flex; align-items: center; gap: 12px; }
.sb-brand img { width: 40px; height: 40px; border-radius: 10px; }
.sb-brand b { font-size: 19px; letter-spacing: -0.01em; }
.sb-title { text-align: right; display: flex; flex-direction: column; }
.sb-title b { font-size: 15px; letter-spacing: .14em; color: #d4af37; }
.sb-title span { font-size: 15px; color: rgba(255, 255, 255, .72); }
.slip-body { padding: 24px 28px 22px; }
.sl-label { display: block; font-size: 12px; font-weight: 500; color: var(--label2-solid); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.sl-who { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sl-who h2 { font-size: 26px; letter-spacing: -0.02em; }
.sl-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 18px 0 6px; background: var(--sep); border-radius: 12px; overflow: hidden; }
.sl-facts > div { background: var(--fill2); padding: 10px 14px; background-color: color-mix(in srgb, var(--card) 92%, var(--label) 8%); }
.sl-facts b { font-variant-numeric: tabular-nums; }
.sl-lines { margin-top: 14px; }
.sl-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 2px; border-bottom: .5px solid var(--sep); }
.sl-line > div { display: flex; flex-direction: column; }
.sl-line b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sl-line b.neg { color: var(--red); }
.sl-total { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 16px 0 20px; padding: 16px 18px; border-radius: 14px;
  background: color-mix(in srgb, #d4af37 14%, var(--card)); border: 1px solid color-mix(in srgb, #d4af37 45%, transparent); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sl-total span { font-weight: 600; }
.sl-total b { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sl-bank { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.sl-bank .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.sl-foot { margin: 18px 0 0; padding-top: 12px; border-top: .5px solid var(--sep); }
@media (max-width: 760px) {
  .slip-band { padding: 18px; } .slip-body { padding: 18px; }
  .sl-facts { grid-template-columns: 1fr 1fr; } .sl-total b { font-size: 22px; } .sb-brand b { font-size: 16px; }
}
@media print { .card.slip { max-width: none; border: 1px solid #ccc; } .sl-facts > div { background: #f5f5f7; } }


/* dark mode: primary buttons keep the brand teal as fill (white text stays readable); links use the lighter teal */
:root[data-theme="dark"] .btn.primary { background: #1b6a89; } :root[data-theme="dark"] .btn.primary:hover { background: #22809f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: #1b6a89; } :root:not([data-theme="light"]) .btn.primary:hover { background: #22809f; } }

/* ---------- sidebar (desktop): dark slate in both modes, owner 28 Nov 2026 ---------- */
@media (min-width: 761px) {
  .side { background: #212a31; border-right: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .side a { color: #d3d9d4; }
  .side a .icon { color: #8fa9ae; }
  .side a:hover { background: rgba(211, 217, 212, .08); }
  .side a.on { background: #124e66; color: #fff; box-shadow: inset 3px 0 0 #6bb4d0; }
  .side a.on .icon { color: #fff; }
  :root[data-theme="dark"] .side { background: #1a2127; border-right: .5px solid var(--sep); }
}
@media (min-width: 761px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side { background: #1a2127; border-right: .5px solid var(--sep); } }

/* ---------- phone tab bar: see-through, frosted ---------- */
@media (max-width: 760px) {
  .side { background: rgba(246, 248, 247, .3); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); } /* more see-through (owner, 29 Nov 2026) */
  :root[data-theme="dark"] .side { background: rgba(33, 42, 49, .32); }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side { background: rgba(33, 42, 49, .32); } }

/* ---------- payroll bonus tab ---------- */
table.bonus-t td.how { font-size: 14px; color: var(--label2-solid); }
table.bonus-t td.how b { color: var(--label); }
table.bonus-t tr.zero td { opacity: .7; }
@media (min-width: 761px) { table.bonus-t { table-layout: fixed; } table.bonus-t th:nth-child(1) { width: 22%; } table.bonus-t th:nth-child(2) { width: 20%; }
  table.bonus-t th:nth-child(3) { width: 28%; } table.bonus-t th:nth-child(4) { width: 18%; } table.bonus-t th:nth-child(5) { width: 12%; } }
@media (max-width: 760px) { table.bonus-t th:nth-child(2), table.bonus-t td:nth-child(2) { display: none; } }

/* ---------- payroll person panel (wide screens): full height on the right, the list stays usable ---------- */
.ppanel { position: fixed; top: 52px; right: 0; bottom: 0; width: 460px; z-index: 40; background: var(--elevated);
  border-left: .5px solid var(--sep); box-shadow: -16px 0 40px rgba(0, 0, 0, .10); animation: sheetIn .22s var(--ease); }
.ppanel .pp { height: 100%; display: flex; flex-direction: column; margin: 0; }
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: .5px solid var(--sep); }
.pp-nav { display: flex; align-items: center; gap: 6px; }
.pp-nav .muted { margin-left: 6px; }
.ppanel .icon-btn { width: 34px; height: 34px; }
.ppanel .icon-btn:disabled { opacity: .35; cursor: default; }
.pp-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.pp-body section h3, .pp-body section > .grid { margin-top: 0; }
.pp-body h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--label2-solid); }
.pp-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pp-sec-head h3 { margin: 0; }
.pp-who { display: flex; align-items: center; gap: 14px; }
.pp-who .avatar { width: 52px; height: 52px; font-size: 19px; flex: none; }
.pp-who h2 { margin: 0 0 2px; font-size: 22px; }
.pp-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 14px;
  background: #212a31; color: #fff; }
.pp-total .sl-label { color: #a9bcc0; }
.pp-total b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; color: #e8c872; }
.pp-total .muted { color: #a9bcc0; }
.pp-state { text-align: right; }
.pp-total .tag.grey { background: rgba(255, 255, 255, .14); color: #d3d9d4; }
.pp-state .small { margin-top: 4px; }
.pp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.pp-facts > div { min-width: 0; }
.pp-facts b { display: block; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.pp-body .sl-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--label2-solid); }
.pp-pays { display: flex; flex-direction: column; border-radius: 12px; background: var(--fill2); }
.pp-pay { padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.pp-pay + .pp-pay { border-top: .5px solid var(--sep); }
.pp-pay-top { display: flex; justify-content: space-between; gap: 10px; }
.pp-body .grid { grid-template-columns: 1fr 1fr; }
.pp-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: .5px solid var(--sep); background: var(--elevated); }
.pp-foot .btn.ghost { margin-left: auto; }
table.pay tr.sel td { background: var(--fill2); }
table.pay tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
@media (min-width: 1100px) { body.panel-open main { margin-right: 460px; } }
@media (max-width: 1099px) { .ppanel { display: none; } }
@keyframes sheetIn { from { transform: translateX(40px); opacity: 0; } }

/* ---------- transfers ---------- */
.tfilters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 6px; }
.tfilters .actions { margin: 0; }
table.tr-t td { vertical-align: top; }
table.tr-t th.ck, table.tr-t td.ck { width: 64px; }
table.tr-t .pay-line { min-height: 24px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
table.tr-t .pay-line + .pay-line { margin-top: 4px; }
table.tr-t .tag { margin-top: 4px; }
table.tr-t tr.st-done td { opacity: .92; }
.tag.orange { background: color-mix(in srgb, var(--orange) 18%, var(--card)); color: var(--warn-text); }
.tag.red { background: color-mix(in srgb, var(--red) 16%, var(--card)); color: var(--red); }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }
@media (min-width: 761px) { table.tr-t { table-layout: fixed; } table.tr-t th:nth-child(2) { width: 15%; } table.tr-t th:nth-child(3) { width: 19%; } table.tr-t th:nth-child(4) { width: 12%; }
  table.tr-t th:nth-child(5) { width: 13%; } table.tr-t th:nth-child(6) { width: 12%; } table.tr-t th:nth-child(7) { width: 13%; } table.tr-t th:nth-child(8) { width: 9%; } }
@media (max-width: 760px) { table.tr-t th:nth-child(3), table.tr-t td:nth-child(3), table.tr-t th:nth-child(6), table.tr-t td:nth-child(6), table.tr-t th:nth-child(7), table.tr-t td:nth-child(7) { display: none; } }
/* payroll list: role is its own column on desktop, under the name on phones */
.m-only { display: none; }
@media (max-width: 760px) { .m-only { display: inline; } }
.dialog .dlg-sub { margin: -10px 0 0; }


/* ---------- payroll year view (29 Nov 2026) ---------- */
.yearbox { display: inline-flex; align-items: center; padding: 0 16px; height: 40px; border-radius: 12px; background: var(--card); font-weight: 600; font-variant-numeric: tabular-nums; }
.filters > .lang-switch.tabs { margin: 0 4px 0 0; align-self: center; }
.ychart { margin: 14px 0 4px; }
.ybars { width: 100%; height: auto; display: block; }
.ybars .sal { fill: var(--blue); }
.ybars .bon { fill: var(--orange); }
.ybars .yb:hover rect { opacity: .82; }
.ybars .yb-m { font-size: 11px; fill: var(--label2-solid); }
.ybars .yb-v { font-size: 10.5px; fill: var(--label); font-weight: 600; }
.ybars .yb-d { font-size: 10px; fill: var(--label3); font-style: italic; }
.ybars .yb-axis { stroke: var(--sep); stroke-width: 1; }
table.ytable th, table.ytable td { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.ytable td.r .sub { display: block; font-size: 11px; }
table.ytable tr.ysum td { border-top: 1px solid var(--sep); background: var(--fill2); }
table.ypeople tbody tr[data-yp] { cursor: pointer; }
table.ypeople tbody tr[data-yp]:hover, table.ypeople tbody tr.open { background: var(--hover); }
table.ypeople tr.ydetail > td { background: var(--fill2); padding: 10px 16px 14px; white-space: normal; }
table.ypeople tr.ydetail .ychart { max-width: 820px; margin: 0; }
table.ydia { margin-top: 4px; max-width: 820px; }
.yfilters { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
@media (max-width: 760px) { .filters > .lang-switch.tabs { margin: 0 6px 8px 0; } }
.ysubs { margin: 4px 0 14px; }
.ysubs .tabs { margin-left: 0; }
@media (max-width: 760px) { .filters > .lang-switch.tabs { width: auto; } }
/* Move people dialog */
.movelist { max-height: 46vh; overflow-y: auto; border-radius: 12px; background: var(--fill2); padding: 6px 12px; }
.movelist .mhead { margin: 8px 0 2px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.movelist .mvrow { padding: 4px 0; }
.side a .navbadge { margin-left: auto; }
@media (max-width: 760px) { .side a { position: relative; } .side a .navbadge { position: absolute; top: 2px; left: 55%; margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; } }
/* Settings: access levels */
table.perms th.c, table.perms td.c { text-align: center; }
table.perms th .sub { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; }
table.perms td:first-child { white-space: normal; min-width: 200px; }
table.perms td.c .icon { width: 18px; height: 18px; color: var(--green); }
.photos.small .pslot { display: flex; flex-direction: column; gap: 6px; }
.photos.small .pslot a { gap: 0; }
.photos.small .pslot .btn { align-self: flex-start; cursor: pointer; }
.photos.small .pslot.busy { opacity: .5; pointer-events: none; }
.photos.small .pempty { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: var(--fill2); color: var(--label3); }
.photos.small .pempty .icon { width: 36px; height: 36px; }
.list-card.more a > span small { display: block; font-size: 13px; line-height: 1.3; margin-bottom: 2px; }
.list-card.more a:has(small) { padding-top: 8px; padding-bottom: 8px; }
/* menu headings (Daily · Money · Setup), computer only */
.side .navhead { padding: 14px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8fa9ae; }
.side .navhead:first-child { padding-top: 2px; }
@media (max-width: 760px) { .side .navhead { display: none; } }
/* Access Level: one block per menu page */
table.perms tr.pgroup th { text-align: left; padding: 18px 12px 6px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--label2-solid, var(--label)); border-bottom: .5px solid var(--sep); }
table.perms tr.pgroup th .icon { width: 17px; height: 17px; color: var(--blue); vertical-align: -3px; margin-right: 8px; }
table.perms tbody:first-of-type tr.pgroup th { padding-top: 8px; }
table.perms td:first-child { padding-left: 37px; }
table.perms .own { font-size: 12px; font-weight: 600; color: var(--blue); }
table.perms select.psel { width: auto; min-width: 84px; padding: 5px 26px 5px 10px; font-size: 13px; min-height: 32px; }
/* Daily Report: Late status, permit letters (owner, 29 Nov 2026) */
.status .chip.on.st-late { background: var(--orange); color: #fff; }
table.grid-month td.st-late { color: var(--orange); font-weight: 700; }
.entry .permitbox { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.entry .permitbox a { display: inline-flex; align-items: center; gap: 6px; }
.entry .permitbox .icon { width: 16px; height: 16px; }
.entry.busy { opacity: .5; pointer-events: none; }
.permitrow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: .5px solid var(--sep); }
.permitrow:last-child { border-bottom: 0; }
.permitrow .actions { margin: 0; }
img.letterthumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--fill2); display: block; }
@media (max-width: 760px) { .permitrow { grid-template-columns: 1fr auto; } }
