/* Liventory — Apple-style (iOS / macOS) light design.
   System font, grouped backgrounds, white rounded cards, hairline separators, frosted bars, one blue accent. */
:root {
  --blue: #007aff; --blue-press: #0062cc; --green: #34c759; --red: #ff3b30; --orange: #ff9500; --pink: #ff2d55; --indigo: #5856d6;
  --label: #1c1c1e; --label2: #3c3c4399; --label3: #3c3c434d; --label2-solid: #6e6e73;
  --sep: #3c3c4329; --fill: #7878801f; --fill2: #78788014;
  --bg: #f2f2f7; --card: #ffffff; --bar: rgba(249, 249, 251, .78); --side: rgba(242, 242, 247, .72);
  --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: #e9e9eb; --chip-on: #ffffff; --hover: #f7f7fa; --press: #ececf1;
  --drop-bg: #fbfbfd; --good-text: #248a3d; --warn-text: #c46a00; --modal-shade: rgba(0, 0, 0, .28);
  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); }
.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; max-width: 1180px; }
.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: #0a84ff; --blue-press: #409cff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --pink: #ff375f; --indigo: #5e5ce6;
  --label: #ffffff; --label2: #ebebf599; --label3: #ebebf54d; --label2-solid: #98989f;
  --sep: #54545899; --fill: #7878805c; --fill2: #7676803d;
  --bg: #000000; --card: #1c1c1e; --bar: rgba(22, 22, 24, .75); --side: rgba(28, 28, 30, .72);
  --shadow: none; --elevated: #2c2c2e; --field-focus: #2c2c2e; --switch-off: #39393d; --chip-on: #636366; --hover: #2c2c2e; --press: #3a3a3c;
  --drop-bg: #1c1c1e; --good-text: #30d158; --warn-text: #ffb340; --modal-shade: rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #0a84ff; --blue-press: #409cff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --pink: #ff375f; --indigo: #5e5ce6;
    --label: #ffffff; --label2: #ebebf599; --label3: #ebebf54d; --label2-solid: #98989f;
    --sep: #54545899; --fill: #7878805c; --fill2: #7676803d;
    --bg: #000000; --card: #1c1c1e; --bar: rgba(22, 22, 24, .75); --side: rgba(28, 28, 30, .72);
    --shadow: none; --elevated: #2c2c2e; --field-focus: #2c2c2e; --switch-off: #39393d; --chip-on: #636366; --hover: #2c2c2e; --press: #3a3a3c;
    --drop-bg: #1c1c1e; --good-text: #30d158; --warn-text: #ffb340; --modal-shade: rgba(0, 0, 0, .55);
    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; }
  .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: #8e8e93; 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 { 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.pay td.chev { width: 28px; color: var(--label3); }
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) { 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; }
