/* GyanGuru documents portal. Phone first: everything is designed at 360px wide and widened from there. */
:root {
  --brand: #1a4f9c; --brand-ink: #123a75; --brand-soft: #e8f0fb; --sky: #2aa8e0;
  --orange: #f39320; --orange-soft: #fff3e0;
  --bg: #f2f5fa; --surface: #ffffff; --ink: #14213a; --muted: #5d6b85; --line: #dbe2ee;
  --ok: #12805c; --ok-soft: #e2f5ed; --warn: #a85d00; --warn-soft: #fdf0d6;
  --danger: #c0362c; --danger-soft: #fde8e6; --info: #1c5dbd; --info-soft: #e2edfc;
  --radius: 14px; --tap: 50px; --col: 560px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
a { color: var(--brand); }
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
body.no-scroll { overflow: hidden; }

/* ---------- top bar ---------- */
.appbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0); }
.appbar-in { max-width: var(--col); margin: 0 auto; min-height: 58px; padding: 0 12px; display: flex; align-items: center; gap: 10px; }
.wide .appbar-in { max-width: 1080px; }
.appbar img.logo { width: 38px; height: 38px; flex: none; }
.appbar .titles { min-width: 0; flex: 1; }
.appbar .t1 { font-weight: 700; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .t2 { font-size: 12.5px; color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--ink); flex: none; text-decoration: none; }
.iconbtn:active, .iconbtn:hover { background: var(--bg); }
.iconbtn svg { width: 22px; height: 22px; }
.navtabs { display: flex; gap: 4px; }
.navtabs a { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; }
.navtabs a.on { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- page ---------- */
.page { max-width: var(--col); margin: 0 auto; padding: 16px 16px 28px; display: flex; flex-direction: column; gap: 16px; }
.page.has-bar { padding-bottom: 116px; }
.wide .page { max-width: 1080px; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 2px -6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--tap);
  padding: 10px 18px; border-radius: 12px; border: 1.5px solid transparent; font-weight: 650; font-size: 16px; cursor: pointer;
  text-decoration: none; background: var(--brand); color: #fff; transition: transform .05s ease, background .15s ease; text-align: center; }
.btn:active { transform: scale(.985); }
.btn:hover { background: var(--brand-ink); }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--brand-ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.quiet { background: transparent; color: var(--brand-ink); min-height: 44px; }
.btn.quiet:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #a22c23; }
.btn.danger-ghost { background: var(--surface); color: var(--danger); border-color: #f2c4bf; }
.btn.ok { background: var(--ok); }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14.5px; border-radius: 10px; width: auto; }
.btn.auto { width: auto; }
.btn svg { width: 20px; height: 20px; flex: none; }
.linkbtn { background: none; border: 0; padding: 8px 4px; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: none; font-size: 15px; }
.linkbtn[disabled] { color: var(--muted); cursor: default; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 650; color: var(--ink); }
.req { color: var(--danger); margin-left: 2px; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: var(--tap); padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; background: var(--surface); font-size: 16px; appearance: none; -webkit-appearance: none; }
.field textarea { min-height: 96px; resize: vertical; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26, 79, 156, .14); }
.field input[readonly], .field input:disabled, .field select:disabled, .field textarea:disabled { background: #f6f8fc; color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.hint { font-size: 13.5px; color: var(--muted); }
.err { font-size: 14px; color: var(--danger); font-weight: 600; }
.saved { font-size: 12.5px; color: var(--ok); font-weight: 650; opacity: 0; transition: opacity .2s; }
.saved.on { opacity: 1; }
.copied { font-size: 12.5px; color: var(--info); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pin { text-align: center; letter-spacing: .45em; font-size: 24px !important; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: calc(14px + .45em) !important; }
.prefix-wrap { position: relative; }
.prefix-wrap .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.prefix-wrap input { padding-left: 52px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); appearance: auto; -webkit-appearance: auto; }

/* ---------- banners ---------- */
.banner { border-radius: 14px; padding: 12px 14px; font-size: 15px; border: 1px solid transparent; }
.banner b { display: block; margin-bottom: 2px; }
.banner.warn { background: var(--warn-soft); border-color: #f1d49a; color: #5c3600; }
.banner.info { background: var(--info-soft); border-color: #bcd4f6; color: #123c7a; }
.banner.ok { background: var(--ok-soft); border-color: #b5e2cf; color: #0b5a40; }
.banner.danger { background: var(--danger-soft); border-color: #f2c4bf; color: #7d1f18; }
.banner pre { margin: 0; white-space: pre-wrap; font: inherit; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.st-not_started { background: #eef1f6; color: #55617a; }
.st-draft { background: var(--orange-soft); color: #9a5700; }
.st-submitted { background: var(--info-soft); color: var(--info); }
.st-action_required { background: var(--danger-soft); color: var(--danger); }
.st-verified { background: var(--ok-soft); color: var(--ok); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.tag.req { background: var(--danger-soft); color: var(--danger); margin: 0; }
.tag.opt { background: #eef1f6; color: #55617a; }

/* ---------- auth: deep-blue page, white card with a curved brand header ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(18px + env(safe-area-inset-top, 0)) 14px 18px; gap: 16px;
  background:
    radial-gradient(520px 320px at 12% 0%, rgba(42, 168, 224, .28), transparent 70%),
    radial-gradient(460px 300px at 100% 100%, rgba(243, 147, 32, .16), transparent 70%),
    linear-gradient(160deg, #0a1730 0%, #10306a 55%, #0a1730 100%); }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border-radius: 24px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(3, 10, 28, .5), 0 2px 0 rgba(255, 255, 255, .06) inset; }
.auth-head { position: relative; overflow: hidden; text-align: center; color: #fff; padding: 22px 18px 20px;
  background: linear-gradient(135deg, #153f86 0%, #1d63b8 55%, #2aa8e0 100%); border-radius: 0 0 28px 28px; }
.auth-head::before { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; right: -60px; top: -90px; background: rgba(255, 255, 255, .09); }
.auth-head::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; left: -50px; bottom: -80px; background: rgba(255, 255, 255, .06); }
.auth-head .sq { position: absolute; border-radius: 3px; transform: rotate(18deg); }
.auth-head .sq.a { width: 14px; height: 14px; background: var(--orange); left: 26px; top: 26px; opacity: .95; }
.auth-head .sq.b { width: 9px; height: 9px; background: #7fd4f7; left: 50px; top: 50px; opacity: .9; }
.auth-head .sq.c { width: 11px; height: 11px; background: var(--orange); right: 34px; bottom: 30px; opacity: .85; }
.auth-head .sq.d { width: 7px; height: 7px; background: #fff; right: 58px; bottom: 54px; opacity: .7; }
.auth-logo { position: relative; z-index: 1; width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%; background: #fff; padding: 3px;
  box-shadow: 0 8px 22px rgba(3, 10, 28, .35), 0 0 0 4px rgba(255, 255, 255, .22); }
.auth-logo img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.auth-head .b1 { position: relative; z-index: 1; font-weight: 800; font-size: 20px; letter-spacing: -.01em; line-height: 1.2; }
.auth-head .b2 { position: relative; z-index: 1; font-size: 13.5px; color: rgba(255, 255, 255, .88); margin-top: 3px; }
.auth-head .b2 b { color: #ffd08a; font-weight: 700; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 18px 0; padding: 4px; background: var(--bg); border-radius: 14px; }
.seg a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 11px; text-decoration: none; font-weight: 700;
  font-size: 15px; color: var(--muted); }
.seg a.on { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(26, 79, 156, .35); }
.auth-body { padding: 18px 18px 6px; }
.auth h1 { font-size: 21px; line-height: 1.25; }
.auth .lead { color: var(--muted); font-size: 15px; margin-top: 3px; }
.auth .btn { box-shadow: 0 8px 18px rgba(26, 79, 156, .28); }
.auth .links { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 18px 14px; }
.auth .links:empty { padding: 0 0 12px; }
.how { margin: 0 18px 18px; padding: 12px 14px; border-radius: 14px; background: var(--brand-soft); border: 1px solid #cfe0f7; }
.how-t { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 8px; }
.how ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.how li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #1d3360; line-height: 1.35; }
.how li span { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 800; font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center; margin-top: -1px; }
.auth .foot { font-size: 12.5px; color: rgba(255, 255, 255, .72); text-align: center; }
.steps { display: flex; gap: 6px; margin-bottom: 12px; }
.steps i { height: 5px; flex: 1; border-radius: 5px; background: var(--line); }
.steps i.on { background: linear-gradient(90deg, var(--brand), var(--sky)); }
.pw-wrap { position: relative; }
.pw-wrap .toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
@media (max-height: 700px) { .auth { justify-content: flex-start; } }

/* ---------- state list (looks like a chat list) ---------- */
.hello { display: flex; flex-direction: column; gap: 12px; }
.hello .name { font-size: 20px; font-weight: 750; line-height: 1.25; }
.hello .serial { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 750;
  padding: 5px 10px; border-radius: 8px; font-size: 14px; letter-spacing: .02em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--bg); border-radius: 12px; padding: 10px 8px; text-align: center; min-width: 0; }
.stats.roll-first { grid-template-columns: 1fr 1fr; }
.stats.roll-first .stat:first-child { grid-column: 1 / -1; }
.found .stat { background: rgba(255, 255, 255, .7); }
.stat .n { font-weight: 750; font-size: 16.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.stat .l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.list a.item { display: flex; align-items: center; gap: 12px; padding: 14px 14px; min-height: 72px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.list a.item:last-child { border-bottom: 0; }
.list a.item:active, .list a.item:hover { background: #f7f9fd; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.item .n { font-weight: 700; font-size: 16px; line-height: 1.25; }
.item .s { font-size: 13.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.chev { width: 18px; height: 18px; color: #a4afc4; flex: none; }
.empty { text-align: center; padding: 28px 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty .ico { width: 54px; height: 54px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.empty .ico svg { width: 26px; height: 26px; }

/* ---------- profile block and summaries ---------- */
.kv { display: grid; grid-template-columns: minmax(92px, 34%) 1fr; }
.kv > div { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--muted); background: #f8fafd; font-size: 14px; }
.kv .v { font-weight: 650; }
.kv .v.missing { color: var(--danger); font-weight: 600; }
.lock-note { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 8px 14px; background: #f8fafd; border-top: 1px solid var(--line); }
.lock-note svg { width: 15px; height: 15px; flex: none; }

/* ---------- documents ---------- */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.doc.done { border-color: #b5e2cf; }
.doc.flag { border-color: #f2c4bf; background: #fffafa; }
.doc.drag { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26, 79, 156, .16); }
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.doc-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.doc-file { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--bg); border: 0; width: 100%; text-align: left; cursor: pointer; }
.doc-file .thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #dfe6f1; flex: none; }
.doc-file .pdf { width: 56px; height: 56px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.doc-file .fn { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-file .fs { font-size: 13px; color: var(--muted); }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-actions .btn { flex: 1 1 130px; min-height: 46px; font-size: 15px; }
.only-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .only-touch { display: inline-flex; } .only-mouse { display: none !important; } }
.bar { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 8px; transition: width .15s linear; }
.uploading { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }

/* ---------- bottom action bar ---------- */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0)); }
.bottombar-in { max-width: var(--col); margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.bottombar .prog { font-size: 13.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

/* ---------- sheets (pop-ups): slide up on a phone, centred on a laptop ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(13, 24, 46, .55);
  opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.sheet-wrap.open { opacity: 1; pointer-events: auto; }
.sheet { background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh; overflow: auto; border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0)); transform: translateY(24px); transition: transform .18s ease; display: flex; flex-direction: column; gap: 14px; }
.sheet-wrap.open .sheet { transform: none; }
.sheet > * { flex-shrink: 0; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 2px; flex: none; }
.sheet h2 { font-size: 19px; line-height: 1.3; }
.sheet .sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.sheet.tall { max-width: 640px; }
.sheet .viewer { background: #0e1a30; border-radius: 12px; overflow: auto; max-height: 68vh; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; }
.sheet .viewer img, .sheet .viewer canvas { max-width: 100%; height: auto; border-radius: 6px; background: #fff; }
.sheet .viewer iframe { width: 100%; height: 64vh; border: 0; background: #fff; border-radius: 6px; }
.sheet .viewer .msg { color: #d6deee; padding: 24px 12px; text-align: center; font-size: 15px; }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; padding: 20px; }
  .sheet { border-radius: 20px; padding: 20px 22px 22px; }
  .sheet > * { flex-shrink: 0; }
.sheet .grab { display: none; }
  .sheet .sheet-actions.inline { flex-direction: row-reverse; }
  .sheet .sheet-actions.inline .btn { width: auto; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-wrap, .btn, .bar > i { transition: none; } }

/* ---------- "please wait" pop-up ---------- */
.wait-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(13, 24, 46, .55); opacity: 0; transition: opacity .15s ease; }
.wait-wrap.open { opacity: 1; }
.wait-card { background: var(--surface); border-radius: 20px; padding: 26px 22px; width: 100%; max-width: 340px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 18px 50px rgba(13, 24, 46, .35); }
.wait-card h2 { font-size: 18px; line-height: 1.3; }
.wait-card p { color: var(--muted); font-size: 14.5px; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; top: calc(66px + env(safe-area-inset-top, 0)); z-index: 80; display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: #17233f; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 600; max-width: 440px;
  box-shadow: 0 8px 24px rgba(13, 24, 46, .25); opacity: 0; transform: translateY(-8px); transition: opacity .18s, transform .18s; }
.toast.on { opacity: 1; transform: none; }
.toast.ok { background: #0f6d4e; }
.toast.warn { background: #8a4b00; }
.toast.danger { background: #a22c23; }

/* ---------- contacts ---------- */
.contacts { display: flex; flex-direction: column; gap: 8px; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg); text-decoration: none; color: inherit; }
.contact .cn { font-weight: 700; }
.contact .cp { font-variant-numeric: tabular-nums; color: var(--brand-ink); font-weight: 750; font-size: 16.5px; }
.found { background: var(--ok-soft); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- admin ---------- */
.filters { display: grid; grid-template-columns: 1fr; gap: 10px; }
.filters .field input, .filters .field select { min-height: 46px; }
.tiles { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tiles::-webkit-scrollbar { display: none; }
.tile { flex: none; min-width: 112px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; text-decoration: none; color: inherit; }
.tile.on { border-color: var(--brand); background: var(--brand-soft); }
.tile .n { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .l { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.cand { display: flex; gap: 12px; align-items: center; padding: 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.cand:last-child { border-bottom: 0; }
.cand:hover, .cand:active { background: #f7f9fd; }
.cand .n { font-weight: 700; line-height: 1.25; }
.cand .s { font-size: 13.5px; color: var(--muted); }
.cand .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stateblock > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px; }
.stateblock > summary::-webkit-details-marker { display: none; }
.stateblock > summary .n { font-weight: 750; font-size: 16.5px; }
.stateblock[open] > summary { border-bottom: 1px solid var(--line); }
.stateblock .inner { padding: 14px; display: flex; flex-direction: column; gap: 16px; }
.sub-title { font-size: 12.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.setup-row { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.setup-row > .grow { flex: 1 1 100%; }
.setup-row.fixed > .grow { flex: 1 1 0; }
.setup-row:last-child { border-bottom: 0; }
.setup-row .n { font-weight: 650; line-height: 1.3; }
.setup-row .s { font-size: 13px; color: var(--muted); }
.setup-row.fixed { background: #f8fafd; }
.history { font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.history b { color: var(--ink); font-weight: 650; }
.wide .appbar-in { flex-wrap: wrap; row-gap: 0; }
.wide .navtabs { order: 5; flex: 1 1 100%; padding-bottom: 8px; }
.wide .navtabs a { flex: 1; text-align: center; }
@media (min-width: 760px) {
  .wide .appbar-in { flex-wrap: nowrap; }
  .wide .navtabs { order: 0; flex: none; padding-bottom: 0; }
  .wide .navtabs a { flex: none; }
  .setup-row { flex-wrap: nowrap; }
  .setup-row > .grow { flex: 1 1 0; }
  .filters { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}
.doc-grid, .field-grid { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 760px) { .doc-grid, .field-grid { display: grid; } }

/* ---------- team page: candidate rows and the floating remarks card ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.trow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 14px; border-bottom: 1px solid var(--line); align-items: center; }
.trow:last-child { border-bottom: 0; }
.trow.thead { display: none; }
.trow.is-open { background: var(--brand-soft); }
.trow .c-name { grid-column: 1 / -1; min-width: 0; }
.trow .n { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.trow .s { font-size: 13px; color: var(--muted); }
.trow .lab { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; margin-right: 6px; }
.trow .c-phone { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trow .c-phone a { font-weight: 700; text-decoration: none; }
.trow .c-phone a.wa { font-size: 12.5px; color: #0b6b4f; background: var(--ok-soft); padding: 3px 9px; border-radius: 999px; }
.trow .c-num b { font-size: 16px; }
.trow .c-last { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.trow .lt { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.trow .ld { font-size: 12.5px; color: var(--muted); }
.trow .c-act { grid-column: 1 / -1; }
.trow .c-act .btn { width: 100%; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--orange); color: #fff; font-size: 12.5px; font-weight: 800; }
@media (min-width: 860px) {
  .trow { grid-template-columns: minmax(180px, 1.5fr) minmax(170px, 1.1fr) 80px 70px minmax(200px, 2fr) auto; gap: 14px; }
  .trow.thead { display: grid; background: #f8fafd; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-block: 10px; }
  .trow .c-name, .trow .c-phone, .trow .c-last, .trow .c-act { grid-column: auto; }
  .trow .lab { display: none; }
  .trow .c-act .btn { width: auto; }
  .team-filters { grid-template-columns: 2fr 1fr auto; align-items: end; }
}
.float { position: fixed; z-index: 40; left: 8px; top: 80px; width: min(420px, calc(100vw - 16px)); max-height: min(72vh, 560px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid #b9c7df; border-radius: 16px; box-shadow: 0 22px 60px rgba(13, 24, 46, .38); overflow: hidden; }
.float.dragging { box-shadow: 0 30px 70px rgba(13, 24, 46, .5); user-select: none; }
.float-head { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; background: var(--brand); color: #fff; cursor: grab; touch-action: none; flex: none; }
.float.dragging .float-head { cursor: grabbing; }
.float-head .n { font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; }
.float-head .s { font-size: 12.5px; color: rgba(255, 255, 255, .85); }
.float-head .iconbtn { color: #fff; font-size: 17px; }
.float-head .iconbtn:hover, .float-head .iconbtn:active { background: rgba(255, 255, 255, .16); }
.grip { flex: none; width: 14px; height: 22px; opacity: .75; background-image: radial-gradient(circle, #fff 1.4px, transparent 1.6px); background-size: 7px 7px; }
.float-body { padding: 12px 14px; overflow: auto; flex: 1; min-height: 70px; }
.remarks { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.remarks li { font-size: 15px; line-height: 1.4; }
.remarks li::marker { font-weight: 750; color: var(--brand-ink); }
.remarks .rt { display: block; overflow-wrap: anywhere; }
.remarks .rd { display: block; font-size: 12.5px; color: var(--muted); }
.float-foot { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); background: #f8fafd; flex: none; }
.float-foot textarea { flex: 1; min-height: 46px; max-height: 120px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 16px; resize: none; background: #fff; }
.float-foot textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26, 79, 156, .14); }
.float-foot .btn { min-height: 46px; flex: none; }
.remark-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.remark-row:last-child { border-bottom: 0; }

/* ---------- error page ---------- */
.plain-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.plain-page .card { max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
