/* igrocatalog admin. Same tokens as the site (Onest, ink buttons, the logo gradient as the only accent),
   tuned for work: dark rail, quiet content surface, tabular numbers. */
:root {
  --bg: #f4f5fa; --surface: #ffffff; --ink: #0d0f1c; --muted: #5b627c; --line: #e5e8f1; --field: #f2f3f9; --hover: #f6f7fc;
  --on-ink: #ffffff; --ink-hover: #262a40;
  --b1: #12bff5; --b2: #2588f5; --b3: #6637ed; --b4: #d218ce;
  --focus: #2588f5; --ok: #138a5a; --bad: #c4352c; --warn: #a76a00;
  --ok-soft: #e3f5ec; --bad-soft: #fbe9e7; --sel: #eaf2ff; --mine: #e6efff; --theirs: #f1f2f8;
  --rail: #0d0f1c; --rail-ink: #b9bfd6; --rail-line: #232842;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --grad: linear-gradient(90deg, var(--b1), var(--b3));
  color-scheme: light;
  font: 400 14px/1.5 var(--font);
}
:root[data-theme="dark"] {
  --bg: #0a0c15; --surface: #131726; --ink: #eef0fa; --muted: #9aa2bd; --line: #252b42; --field: #1a1f32; --hover: #171c2e;
  --on-ink: #0b0d17; --ink-hover: #cfd4ea; --focus: #5aa8ff; --ok: #3ccf91; --bad: #ff7b72; --warn: #e3b25c;
  --ok-soft: #10302a; --bad-soft: #3a1d1c; --sel: #16264a; --mine: #1a2c52; --theirs: #1b2033;
  --rail: #080a12; --rail-line: #1c2036; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c15; --surface: #131726; --ink: #eef0fa; --muted: #9aa2bd; --line: #252b42; --field: #1a1f32; --hover: #171c2e;
    --on-ink: #0b0d17; --ink-hover: #cfd4ea; --focus: #5aa8ff; --ok: #3ccf91; --bad: #ff7b72; --warn: #e3b25c;
    --ok-soft: #10302a; --bad-soft: #3a1d1c; --sel: #16264a; --mine: #1a2c52; --theirs: #1b2033;
    --rail: #080a12; --rail-line: #1c2036; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; caret-color: var(--b2); scrollbar-color: var(--line) transparent; }
::selection { background: color-mix(in srgb, var(--b2) 28%, var(--surface)); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.num, td.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 10px; background: var(--ink); color: var(--on-ink); font-weight: 500; white-space: nowrap; transition: background-color .15s, box-shadow .15s, transform .15s, opacity .15s; }
.btn:hover { background: var(--ink-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--hover); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 22%, var(--line)); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger.armed { background: var(--bad); color: #fff; box-shadow: none; }
.btn.sm { min-height: 30px; padding: 0 11px; border-radius: 8px; font-size: 13px; }
.btn .i { width: 16px; height: 16px; }
.ibtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); transition: background-color .15s, color .15s; }
.ibtn:hover { background: var(--field); color: var(--ink); }

.fld { display: grid; gap: 6px; min-width: 0; }
.fld > span.l { font-size: 13px; font-weight: 500; color: var(--muted); }
.fld .hint { font-size: 12px; color: var(--muted); }
.inp, .fld input, .fld select, .fld textarea, .search input { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background-color: var(--field); outline: 0; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.fld textarea { padding: 10px 12px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .search input:focus { background: var(--surface); border-color: var(--b2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--b2) 16%, transparent); }
.fld[data-bad] input, .fld[data-bad] select { border-color: var(--bad); }
.fld[data-bad] > span.l { color: var(--bad); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
select { appearance: none; padding-right: 34px !important; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238a91ab' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search input { padding-left: 36px; }

.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--field); }
.seg button { flex: 1; min-height: 30px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 13px; transition: background-color .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(8 10 20 / .1), 0 0 0 1px var(--line); }

.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { width: 32px; height: 18px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 35%, var(--field)); position: relative; transition: background-color .2s; flex: none; }
.switch .tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .2s var(--ease); }
.switch input:checked + .tr { background: var(--b2); }
.switch input:checked + .tr::after { transform: translateX(14px); }
.switch input:focus-visible + .tr { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: var(--rail); position: relative; overflow: hidden; }
.login::before, .login::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; pointer-events: none; }
.login::before { width: 520px; height: 520px; left: -140px; top: -160px; background: radial-gradient(circle, var(--b3), transparent 68%); }
.login::after { width: 460px; height: 460px; right: -120px; bottom: -140px; background: radial-gradient(circle, var(--b1), transparent 68%); }
.login form { position: relative; z-index: 1; width: min(380px, 100%); display: grid; gap: 16px; padding: 28px; border-radius: 20px; background: var(--surface); box-shadow: 0 30px 60px -24px rgb(0 0 0 / .5), 0 0 0 1px var(--line); }
.login .logo { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.login .logo img { width: 34px; height: auto; }
.login .logo small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.err { color: var(--bad); font-size: 13px; }
.err:empty { display: none; }

/* ---------- shell ---------- */
.app { height: 100%; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; color: var(--rail-ink); background: radial-gradient(200px 260px at 0% 100%, color-mix(in srgb, var(--b3) 30%, transparent), transparent), var(--rail); }
.rail .brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; color: #fff; font-weight: 600; letter-spacing: -.01em; }
.rail .brand img { width: 30px; height: auto; }
.rail .brand small { display: block; font-weight: 400; font-size: 12px; color: var(--rail-ink); letter-spacing: 0; }
.rail nav { display: grid; gap: 2px; }
.rail nav a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 11px; border-radius: 10px; font-weight: 500; transition: background-color .15s, color .15s; }
.rail nav a:hover { background: rgb(255 255 255 / .06); color: #fff; }
.rail nav a[aria-current="page"] { background: rgb(255 255 255 / .1); color: #fff; }
.rail nav a[aria-current="page"] .i { color: var(--b1); }
.rail nav .n { margin-left: auto; font-size: 12px; color: var(--rail-ink); font-variant-numeric: tabular-nums; }
.rail .sp { flex: 1; }
.rail .foot { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--rail-line); }
.rail .foot button { display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 0 11px; border-radius: 10px; color: var(--rail-ink); font-weight: 500; text-align: left; transition: background-color .15s, color .15s; }
.rail .foot button:hover { background: rgb(255 255 255 / .06); color: #fff; }
main { min-width: 0; min-height: 0; overflow: hidden; }
.page { height: 100%; overflow: auto; padding: 28px 32px; }
.page-in { max-width: 1180px; display: grid; gap: 18px; }
.page h1, .dhead h2 { font: 600 22px/1.25 var(--font); letter-spacing: -.015em; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .search { width: min(340px, 100%); }
.filters select { width: auto; min-width: 160px; background-color: var(--surface); border-color: var(--line); }

/* ---------- people ---------- */
.people { height: 100%; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.plist { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.plist-head { display: grid; gap: 10px; padding: 16px 14px 12px; }
.plist-head .count { font-size: 12px; color: var(--muted); }
.plist-items { flex: 1; overflow: auto; padding: 0 8px 12px; }
.grp { padding: 14px 8px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.prow { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; transition: background-color .15s; }
.prow:hover { background: var(--hover); }
.prow[aria-current="true"] { background: var(--sel); }
.prow .t { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .s { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ava { position: relative; display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; font-weight: 600; background: color-mix(in srgb, var(--b2) 14%, var(--surface)); color: color-mix(in srgb, var(--b2) 80%, var(--ink)); }
.ava.bot { background: var(--field); color: var(--muted); }
.ava.op { background: var(--grad); color: #fff; }
.ava.lg { width: 56px; height: 56px; font-size: 22px; }
.ava .on { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--surface); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--grad); color: #fff; font-size: 12px; font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; background: var(--field); color: var(--muted); font-size: 12px; font-weight: 500; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.op { background: color-mix(in srgb, var(--b3) 14%, var(--surface)); color: color-mix(in srgb, var(--b3) 80%, var(--ink)); }
.tag .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.detail { min-width: 0; min-height: 0; overflow: auto; padding: 24px 32px 28px; display: flex; flex-direction: column; gap: 20px; }
.dhead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dhead .meta { margin-top: 2px; color: var(--muted); font-size: 13px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.dstats { margin-left: auto; display: flex; gap: 28px; }
.dstats > div { display: grid; gap: 1px; }
.dstats small { font-size: 12px; color: var(--muted); }
.dstats b { font-size: 18px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.back { display: none; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; transition: color .15s; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="true"] { color: var(--ink); border-color: var(--b2); }
.tabs .c { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.panel { background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.empty { display: grid; justify-items: center; gap: 6px; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty b { color: var(--ink); font-weight: 600; font-size: 15px; }
.empty .i { width: 28px; height: 28px; color: var(--muted); margin-bottom: 4px; }
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--field) 30%, var(--line) 50%, var(--field) 70%); background-size: 300% 100%; animation: sk 1.3s linear infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- chats ---------- */
.chats { flex: 1; min-height: 440px; display: grid; grid-template-columns: 290px minmax(0, 1fr); overflow: hidden; }
.convos { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.newchat { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); }
.newchat input { flex: 1; min-width: 0; min-height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: var(--field); outline: 0; }
.newchat input:focus { background: var(--surface); border-color: var(--b2); }
.convos .items { flex: 1; overflow: auto; padding: 6px; }
.convo { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border-radius: 10px; transition: background-color .15s; }
.convo:hover { background: var(--hover); }
.convo[aria-current="true"] { background: var(--sel); }
.convo .ava { width: 34px; height: 34px; font-size: 13px; }
.convo .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; }
.convo .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo .t small { font-weight: 400; font-size: 12px; color: var(--muted); flex: none; }
.convo .s { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thead { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.thead .sw { color: var(--muted); width: 16px; height: 16px; }
.thead small { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); }
.tlog { flex: 1; min-height: 220px; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.bub { max-width: min(560px, 78%); align-self: flex-start; padding: 8px 12px 6px; border-radius: 16px 16px 16px 4px; background: var(--theirs); }
.bub.right { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--mine); }
.bub p { white-space: pre-wrap; overflow-wrap: anywhere; }
.bub .meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 2px; font-size: 11px; color: var(--muted); }
.bub .meta .i { width: 12px; height: 12px; }
.composer { display: grid; gap: 10px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.composer .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.composer .seg { min-width: 0; }
.composer .seg button { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbox { display: flex; align-items: flex-end; gap: 8px; }
.cbox textarea { flex: 1; min-height: 44px; max-height: 140px; padding: 11px 14px; resize: none; border: 1px solid transparent; border-radius: 12px; background: var(--field); outline: 0; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.cbox textarea:focus { background: var(--surface); border-color: var(--b2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--b2) 16%, transparent); }
.composer[data-as="trader"] .cbox textarea:focus { border-color: var(--b3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--b3) 18%, transparent); }
.cbox .btn { width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
.composer .note { font-size: 12px; color: var(--muted); }

/* ---------- tables ---------- */
.tablewrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0 16px; height: 56px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; height: 40px; background: var(--surface); font-size: 12px; font-weight: 500; color: var(--muted); z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .15s; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--hover); }
td.r, th.r { text-align: right; }
td.wrap { white-space: normal; min-width: 260px; }
.sum { display: grid; justify-items: end; line-height: 1.3; }
.sum b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sum small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.idbtn { font-weight: 500; font-variant-numeric: tabular-nums; border-radius: 6px; }
.idbtn:hover { color: var(--b2); }
.lnk { color: var(--b2); font-weight: 500; }
.lnk:hover { text-decoration: underline; text-underline-offset: 3px; }
.who { display: grid; line-height: 1.3; }
.who small { font-size: 12px; color: var(--muted); }
.trk { display: grid; gap: 5px; }
.trk .bars { display: flex; gap: 3px; width: 66px; }
.trk .bars i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.trk .bars i.on { background: var(--grad); }
.trk .lbl { font-size: 13px; }
.trk.ok .bars i.on { background: var(--ok); }
.trk.ok .lbl { color: var(--ok); }
.trk.bad .lbl { color: var(--bad); }
.trk.bad .bars i { background: color-mix(in srgb, var(--bad) 28%, var(--line)); }
.act { display: flex; justify-content: flex-end; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgb(8 10 20 / .42); opacity: 0; transition: opacity .2s; }
.scrim.in { opacity: 1; }
.drawer { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(520px, 100%); display: flex; flex-direction: column; background: var(--surface); box-shadow: -28px 0 56px -20px rgb(8 10 20 / .35); transform: translateX(24px); opacity: 0; transition: transform .28s var(--ease), opacity .2s; }
.drawer.in { transform: none; opacity: 1; }
.drawer > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer > header h2 { font: 600 17px/1.3 var(--font); letter-spacing: -.01em; }
.drawer > header p { font-size: 13px; color: var(--muted); }
.drawer .body { flex: 1; overflow: auto; padding: 20px; display: grid; gap: 22px; align-content: start; }
.drawer .foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.drawer .foot .sp { flex: 1; }
.fgroup { display: grid; gap: 12px; }
.fgroup > h3 { font-size: 13px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stp { display: grid; gap: 4px; justify-items: start; padding: 10px 12px; border-radius: 10px; text-align: left; background: var(--field); box-shadow: inset 0 0 0 1px transparent; transition: background-color .15s, box-shadow .15s; }
.stp b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; background: var(--line); color: var(--muted); }
.stp span { font-size: 13px; line-height: 1.3; color: var(--muted); }
.stp:hover { background: var(--hover); }
.stp[aria-checked="true"] { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--b2); }
.stp[aria-checked="true"] b { background: var(--grad); color: #fff; }
.stp[aria-checked="true"] span { color: var(--ink); font-weight: 500; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--field); color: var(--muted); font-size: 13px; }

#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--on-ink); font-weight: 500; box-shadow: 0 12px 28px -8px rgb(8 10 20 / .45); animation: toast .3s var(--ease) both; }
.toast.bad { background: var(--bad); color: #fff; }
.toast .i { width: 16px; height: 16px; }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rail { flex-direction: row; align-items: center; padding: 8px 10px; gap: 4px; background: var(--rail); }
  .rail .brand { padding: 0 6px 0 2px; }
  .rail .brand div { display: none; }
  .rail nav { display: flex; }
  .rail nav a { padding: 0 12px; }
  .rail nav .n { display: none; }
  .rail .foot { display: flex; padding: 0; border: 0; }
  .rail .foot button span, .rail nav a span.tx { display: none; }
  .rail .foot button { padding: 0 10px; }
  .page { padding: 18px 16px; }
  .people { grid-template-columns: 1fr; }
  .people[data-pane="list"] .detail, .people[data-pane="detail"] .plist { display: none; }
  .back { display: inline-flex; }
  .detail { padding: 16px; }
  .dstats { margin-left: 0; width: 100%; }
  .chats { grid-template-columns: 1fr; min-height: 0; }
  .chats[data-pane="list"] .thread, .chats[data-pane="thread"] .convos { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  th, td { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* layout helpers */
.flat { display: contents; }
.stack { display: grid; gap: 14px; }
.pform { display: grid; gap: 24px; padding: 24px; max-width: 640px; }
.skwrap { display: grid; gap: 14px; align-content: start; }
.sk.w1 { width: 36%; height: 30px; }
.sk.w2 { width: 64%; height: 18px; }
.sk.w3 { height: 320px; border-radius: 14px; }
.tag .tg { width: 14px; height: 14px; }
.drawer .fld > .l { font-size: 13px; }

/* xlsx import */
.pagebtns { display: flex; flex-wrap: wrap; gap: 8px; }
.drop { display: grid; justify-items: center; gap: 6px; padding: 28px 20px; text-align: center; border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; color: var(--muted); font-size: 13px; transition: background-color .2s, box-shadow .2s; }
.drop:hover, .drop.over { background: var(--hover); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, var(--line)); }
.drop:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.drop .i { width: 22px; height: 22px; color: var(--ink); }
.drop b { color: var(--ink); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.drawer .body .note { display: grid; gap: 6px; line-height: 1.5; }
.drawer .body .note b { color: var(--ink); font-weight: 600; }
.imp-result { display: grid; gap: 12px; }
.imp-result:empty { display: none; }
.imp-table { max-height: 320px; overflow: auto; }
.imp-table table { font-size: 13px; }
.imp-err h3 { font-size: 13px; font-weight: 600; color: var(--bad); margin-bottom: 6px; }
.imp-err ul { list-style: none; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.imp-err b { color: var(--ink); font-weight: 500; }

/* paged deals */
.stack.busy > .panel { opacity: .6; transition: opacity .2s; }
.apager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; font-size: 13px; }
.pgs { display: flex; align-items: center; gap: 3px; }
.pgb { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); transition: background-color .15s, color .15s; }
.pgb:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.pgb[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
.pgb:disabled { opacity: .35; pointer-events: none; }
.pgb .i { width: 14px; height: 14px; }
.pgs .gap { min-width: 20px; text-align: center; color: var(--muted); }
