/* LEGEND HQ — the SiteLegend language: near-black, one gold accent, weight
   and placement for importance instead of colour. Light mode follows the
   device. No emoji, no gradients. */

@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-ExtraBold.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #08090a; --surface: #111214; --surface-2: #17181b; --line: #24262b; --line-2: #34373e;
  --text: #ecebe8; --muted: #9a9890; --gold: #d4af37; --gold-ink: #e3c35f; --on-gold: #14110a;
  --hot: #f0857a; --hot-bg: #3a1714; --warm: #f2b45f; --warm-bg: #3a2810; --cold: #9aa3b2; --cold-bg: #1d2129;
  --ok: #7cc49a; --ok-bg: #12291c; --late: #f0857a; --radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5f1; --surface: #ffffff; --surface-2: #fbfaf7; --line: #e6e3db; --line-2: #d6d2c6;
    --text: #18171a; --muted: #6c6a64; --gold: #b8942a; --gold-ink: #7a5f12; --on-gold: #ffffff;
    --hot: #b42318; --hot-bg: #fdecea; --warm: #93510a; --warm-bg: #fdf2e1; --cold: #4a5568; --cold-bg: #eef0f4;
    --ok: #1f7a46; --ok-bg: #e7f5ec; --late: #b42318;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.8 Vazirmatn, system-ui, sans-serif; }
a { color: inherit; }
h1 { font-size: 1.45rem; font-weight: 800; margin: 1.2rem 0 1rem; }
h2 { font-size: 1.02rem; font-weight: 700; margin: 0 0 .7rem; }
small { font-size: .8em; font-weight: 400; }
code, bdi, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
section { margin: 1.6rem 0; }

/* ── frame ── */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1100px; margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: .8rem; }
.brand { font-weight: 800; letter-spacing: .12em; text-decoration: none; font-size: .95rem; direction: ltr; }
.brand span { color: var(--gold); }
.brand.big { font-size: 1.6rem; }
.switch { position: relative; margin-inline-start: auto; }
.switch summary { list-style: none; cursor: pointer; border: 1px solid var(--line-2); border-radius: 999px; padding: .15rem .9rem; font-weight: 700; font-size: .9rem; }
.switch summary::-webkit-details-marker { display: none; }
.switch summary::after { content: " ▾"; color: var(--muted); }
.switch-menu { position: absolute; inset-inline-end: 0; top: 2.3rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); min-width: 11rem; padding: .3rem; }
.switch-menu a { display: block; padding: .45rem .7rem; border-radius: 6px; text-decoration: none; }
.switch-menu a:hover, .switch-menu a.on { background: var(--surface-2); color: var(--gold-ink); }
.logout { margin: 0; }
.tabs { max-width: 1100px; margin: 0 auto; padding: 0 .6rem; display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { white-space: nowrap; padding: .45rem .75rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 700; font-size: .9rem; }
.tabs a.on { color: var(--text); border-bottom-color: var(--gold); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1rem 3rem; }
.foot { max-width: 1100px; margin: 0 auto; padding: 1rem; color: var(--muted); font-size: .75rem; border-top: 1px solid var(--line); }

/* ── controls ── */
.btn, button { font: inherit; font-weight: 700; font-size: .9rem; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 8px; padding: .45rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover, button:hover { border-color: var(--gold); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn-gold:hover { filter: brightness(1.06); }
button[disabled] { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; color: var(--muted); padding: 0; font-weight: 400; }
.wide { width: 100%; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: .5rem .7rem; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
label { display: block; font-weight: 700; font-size: .88rem; }
label > input, label > select, label > textarea { margin-top: .25rem; font-weight: 400; }
/* A long label wraps instead of widening the page: «nowrap» here pushed the settings form past a phone's edge. */
.check { display: inline-flex; align-items: center; gap: .35rem; font-weight: 400; }
.check input { width: auto; flex: none; }
.stack { display: grid; gap: .7rem; }
.stack > * { min-width: 0; }
.narrow { max-width: 34rem; }
.inline { margin-top: .8rem; }
.row-btns { display: flex; gap: .5rem; }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.seg label { font-weight: 400; }
.seg input { position: absolute; opacity: 0; width: 1px; }
.seg span { display: inline-block; border: 1px solid var(--line-2); border-radius: 999px; padding: .2rem .8rem; cursor: pointer; font-size: .88rem; }
.seg input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }

/* ── pieces ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.grid.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ws-card { text-decoration: none; display: block; }
.ws-card:hover { border-color: var(--gold); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .4rem 0 0; }
.kpis-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .kpis-4 { grid-template-columns: repeat(4, 1fr); } }
.kpis > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; }
.ws-card .kpis > div { background: var(--surface-2); }
.kpis b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.3; }
.kpis span { color: var(--muted); font-size: .8rem; }
.kpis .attn { border-color: var(--gold); }
.kpis .attn b { color: var(--gold-ink); }
.flash { border-radius: var(--radius); padding: .6rem .9rem; margin: .8rem 0; font-size: .92rem; border: 1px solid var(--line-2); background: var(--surface); }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: var(--ok-bg); color: var(--ok); }
.flash.err { border-color: color-mix(in srgb, var(--hot) 50%, transparent); background: var(--hot-bg); color: var(--hot); }
.flash.nudge { border-color: var(--gold); }
.empty { color: var(--muted); font-size: .92rem; }

.pill { display: inline-block; border-radius: 999px; padding: .05rem .6rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill-hot { background: var(--hot-bg); color: var(--hot); }
.pill-warm { background: var(--warm-bg); color: var(--warm); }
.pill-cold, .pill-none { background: var(--cold-bg); color: var(--cold); }
.pill-running { background: var(--warm-bg); color: var(--warm); }
.pill-done { background: var(--ok-bg); color: var(--ok); }
.pill-failed { background: var(--hot-bg); color: var(--hot); }
.stage { font-size: .75rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: .02rem .55rem; white-space: nowrap; }
.stage-won { color: var(--ok); border-color: var(--ok); }
.stage-talking, .stage-proposal { color: var(--gold-ink); border-color: var(--gold); }

.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.row { display: flex; align-items: center; gap: .6rem; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; padding: .6rem .9rem; text-decoration: none; display: block; }
.row-main:hover { background: var(--surface-2); }
.row-title { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.late { color: var(--late) !important; }
.row-side { padding-inline-end: .9rem; display: flex; gap: .35rem; align-items: center; flex-shrink: 0; }

.filters { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; margin-bottom: 1rem; align-items: center; }
.filters input[type=search] { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr 1fr 1fr 1.3fr auto auto auto; } .filters input[type=search] { grid-column: auto; } }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }

.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .9rem; }
.tbl th, .tbl td { padding: .5rem .8rem; text-align: start; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 700; font-size: .8rem; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: center; }
/* Five columns of padding alone took 128px: on the smallest phones the table pushed the page sideways. */
@media (max-width: 380px) { .tbl th, .tbl td { padding: .45rem .35rem; } }

.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; }
.funnel-step { text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; }
.funnel-step:hover { border-color: var(--gold); }
.funnel-step b { display: block; font-size: 1.3rem; font-weight: 800; }
.funnel-step span { color: var(--muted); font-size: .8rem; }

/* ── one prospect ── */
.p-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.p-head h1 { margin-bottom: .1rem; }
.p-head p { margin: 0; }
.p-score { display: flex; gap: .4rem; align-items: center; margin-top: 1.3rem; }
.p-actions { margin: .8rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.contact { display: contents; }
.chip { display: inline-block; text-decoration: none; border: 1px solid var(--gold); color: var(--gold-ink); border-radius: 999px; padding: .2rem .85rem; font-weight: 700; font-size: .88rem; }
.chip:hover { background: var(--gold); color: var(--on-gold); }
.chip-quiet { border-color: var(--line-2); color: var(--text); }
.chip bdi { font-weight: 400; }
.p-grid { display: grid; gap: 0 1.6rem; }
@media (min-width: 900px) { .p-grid { grid-template-columns: 1.25fr 1fr; } }
.pitch { background: var(--surface); border: 1px solid var(--gold); border-radius: var(--radius); padding: 1rem 1.1rem; }
.pitch-text { font-size: 1.08rem; font-weight: 700; margin: 0 0 .5rem; }
.reasons { list-style: none; padding: 0; margin: 0; }
.reasons li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.reasons b { color: var(--gold-ink); display: inline-block; min-width: 2.6rem; }
.findings { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .45rem; }
.finding { background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--line-2); border-radius: 8px; padding: .5rem .75rem; }
.finding.sev-critical { border-inline-start-color: var(--hot); }
.finding.sev-major { border-inline-start-color: var(--warm); }
.finding.sev-ok { border-inline-start-color: var(--ok); }
.finding-head { font-weight: 700; font-size: .92rem; }
.sev { font-size: .72rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 .45rem; margin-inline-end: .3rem; font-weight: 400; }
.evidence { color: var(--muted); font-size: .78rem; direction: ltr; text-align: left; overflow-wrap: anywhere; margin-top: .15rem; }
.passed summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.next { font-weight: 700; }
.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--line); }
.timeline li { padding: .35rem .9rem .6rem; position: relative; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: .75rem; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.timeline li.t-call::before, .timeline li.t-message::before, .timeline li.t-visit::before { background: var(--gold); }
.timeline time { display: block; color: var(--muted); font-size: .75rem; }
.t-kind { font-weight: 700; color: var(--gold-ink); margin-inline-end: .25rem; }

/* ── pipeline board ── */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .6rem; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; margin: 0; }
.col-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.col-list a { display: block; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; }
.col-list a:hover { border-color: var(--gold); }

/* ── jobs, brief ── */
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; margin-bottom: .5rem; }
.job summary { cursor: pointer; }
.log, .brief { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; font-size: .82rem; line-height: 1.7; max-height: 26rem; overflow: auto; }
.brief { font-family: Vazirmatn, system-ui, sans-serif; font-size: .95rem; max-height: none; }

/* ── login ── */
.bare .login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 22rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 2rem 1.5rem; text-align: center; }
.login-card form { text-align: start; display: grid; gap: .8rem; margin-top: 1rem; }

/* ── the sales coach ──
   During a call the line to say is the biggest thing on the screen, and the
   other person's likely answers are full-width buttons a thumb can hit. */
.coach { display: grid; gap: .9rem; margin-top: 0; }
.coach-head .coach-headline { font-size: 1.12rem; font-weight: 800; margin: .35rem 0 .1rem; }
.pill-play { background: var(--surface-2); color: var(--gold-ink); border: 1px solid var(--gold); }
.pill-phase { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); margin-inline-start: .3rem; }
.coach-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.btn.big { font-size: 1rem; padding: .65rem 1.2rem; }
.inline-form { display: inline; margin: 0; }
.facts { display: grid; gap: .35rem; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; }
.facts div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .5rem; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 0; }
.block h3, .block > summary { font-size: .95rem; font-weight: 800; margin: 0 0 .5rem; cursor: pointer; }
.goal-line { color: var(--muted); font-size: .88rem; margin: .1rem 0 .6rem; }
.checklist, .qs { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .35rem; }
.qs { list-style-type: persian; }
.said { margin: .35rem 0; }
.said.big { font-size: 1.18rem; font-weight: 700; line-height: 1.9; }
.said.inline { margin: 0; }
.said.q { font-weight: 700; color: var(--gold-ink); }
.said.q::before { content: "؟ "; color: var(--muted); }
.hole { background: color-mix(in srgb, var(--gold) 22%, transparent); border-bottom: 2px dashed var(--gold); padding: 0 .3rem; border-radius: 4px; font-weight: 400; font-style: normal; }
.alts summary, .obj summary, .heard summary, .reveal summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.obj { border-top: 1px dashed var(--line); padding: .45rem 0; }
.obj .means { color: var(--muted); font-size: .85rem; margin: .3rem 0; }
.tip { background: var(--surface-2); border-inline-start: 3px solid var(--gold); padding: .5rem .8rem; border-radius: 6px; font-size: .88rem; margin: .7rem 0; }
.when { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; }
.when .slots { margin-bottom: .5rem; }
.when legend, fieldset legend { font-size: .82rem; color: var(--muted); padding: 0 .3rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.dnc { margin-top: .6rem; }

.call { max-width: 44rem; margin: 0 auto; }
.call-top { display: flex; align-items: center; gap: .6rem; margin: .8rem 0; flex-wrap: wrap; }
.call-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-back { color: var(--muted); text-decoration: none; font-size: .9rem; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem 1.2rem; }
.step.is-obj { border-color: var(--warm); }
.step-title { font-size: 1.05rem; margin: 0 0 .2rem; color: var(--gold-ink); }
.ask { margin: .6rem 0; padding: .5rem .8rem; background: var(--surface-2); border-radius: 8px; }
.branches-h { font-size: .85rem; color: var(--muted); margin: 1rem 0 .4rem; }
.branches { display: grid; gap: .45rem; }
.btn.wide { display: block; width: 100%; text-align: start; padding: .7rem 1rem; }
.btn.end { border-color: var(--line-2); color: var(--muted); }
.heard { margin: .8rem 0; }
.heard summary { font-weight: 700; color: var(--warm); padding: .5rem 0; }
.end-call { text-align: center; margin: 1rem 0 2rem; }
.end-call .link { color: var(--muted); }
.outcomes { display: grid; gap: .35rem; }
.out { display: flex; gap: .5rem; align-items: center; font-weight: 400; border: 1px solid var(--line-2); border-radius: 8px; padding: .5rem .7rem; cursor: pointer; }
.out input { width: auto; }
.out:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }

.msgs { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.msg.hl { border-color: var(--gold); }
.msg-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.msg textarea { font-size: .95rem; line-height: 1.8; }
.msg-meta { margin: .2rem 0 .4rem; }
.msg-actions { display: flex; flex-wrap: wrap; gap: .4rem; }

.queue h2 small { font-weight: 400; }
/* Drawn by hand: with a light accent-color, Chromium paints the empty track dark, and «۰ از ۱۰» looked full. */
.progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: .6rem; margin: 0 0 .7rem; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--gold); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--gold); border-radius: 999px; }

.personas { margin: .5rem 0 1rem; }
.personas a { text-decoration: none; border: 1px solid var(--line-2); border-radius: 999px; padding: .2rem .8rem; font-size: .88rem; }
.personas a.on { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 700; }
.practice .cue { font-size: 1.35rem; font-weight: 800; margin: .6rem 0; }
.reveal { margin: .8rem 0; }
.grade { display: grid; gap: .45rem; margin-top: 1rem; }
.pb-step { margin-bottom: .8rem; }

/* ── the printable report ── */
.report { max-width: 46rem; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.report header { border-bottom: 2px solid var(--line-2); margin-bottom: 1rem; }
.report-brand { font-weight: 800; letter-spacing: .02em; color: var(--gold-ink); margin: 0; }
.report h1 { margin: .2rem 0; }
.report-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.r-item { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.r-item h2 { font-size: 1rem; }
.sev-tag { color: var(--muted); font-weight: 400; }
.report footer { margin-top: 1.5rem; font-size: .9rem; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .report { max-width: none; padding: 0; }
  .evidence { color: #555; }
}
