/* Purrfect: warm editorial surfaces, quiet graphite, one orange accent.
   Shared by every role; state colours carry meaning, never primary actions. */
:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --paper: #fffdf7;
  --surface: #fffdf7;
  --ink: #29352c;
  --muted: #626b60;
  --accent: #ee6238;
  --accent-ink: #973718;
  --onaccent: #231d15;
  --soft: #ede9df;
  --line: #dcded0;
  --track: #dedfd3;
  --green: #356344;
  --greenbg: #e5eddf;
  --amber: #805027;
  --amberbg: #f5e9d5;
  --red: #a13b30;
  --redbg: #f9e8e0;
  --blue: #5b5778;
  --bluebg: #eeebf5;
  --focus: #ac3f20;
  --radius: 8px;
  --border: 1px solid #818976;
  --font: 'Golos Text', sans-serif;
}
* { box-sizing: border-box }
html { scroll-padding-top: 24px }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased }
a { color: inherit; text-decoration: none; text-underline-offset: 3px }
a:hover { text-decoration: underline }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(30px, 3vw, 42px); font-weight: 500; letter-spacing: -1.6px; line-height: 1.16; overflow-wrap: anywhere }
h2 { font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.3px }
h3 { font-size: 14px; font-weight: 600; line-height: 1.5 }
p + p { margin-top: 8px }
small, .small { font-size: 12px }
.muted, .note, .subtitle, .footnote { color: var(--muted) }
.note { font-size: 12px; line-height: 1.65 }
.subtitle { font-size: 13px; margin-top: 10px }
.footnote { font-size: 12px; margin-top: 22px }
.footnote a, .note a, .help a:not(.btn) { text-decoration: underline }
.eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted) }
.mt { margin-top: 14px }
.wide { width: 100% }
.pad { padding: 22px }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0 }
.row, .between { display: flex; align-items: center; gap: 12px }
.between { justify-content: space-between; flex-wrap: wrap }
.wrap { flex-wrap: wrap }
:where(.row, .between, .pagehead, .card-head) > * { min-width: 0 }
:where(.card, .pad, .listitem) { overflow-wrap: anywhere }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px }
main:focus { outline: none }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 100; padding: 12px 18px; color: var(--ink); background: var(--paper); transform: translateY(-180%); border: var(--border); border-radius: var(--radius) }
.skip-link:focus { transform: none }

/* Frame and role navigation. The rail becomes a scrollable nav on small screens. */
.top { min-height: 88px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 36px; border-bottom: 1px solid var(--line) }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 27px/1 'Manrope', sans-serif; letter-spacing: -1.2px; flex-shrink: 0 }
.brand:hover { text-decoration: none }
.brand svg { width: 42px; height: 42px; color: var(--accent) }
.top-right { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 18px; min-width: 0 }
.top-right form { margin: 0 }
.profile { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; max-width: 260px }
.profile > span:last-child { overflow-wrap: anywhere }
.avatar { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--soft); width: 36px; height: 36px; flex: 0 0 36px; font-weight: 700 }
.shell { display: grid; grid-template-columns: 205px minmax(0, 1fr); min-height: calc(100svh - 88px) }
.shell.single { grid-template-columns: minmax(0, 1fr) }
.side { padding: 30px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; min-width: 0 }
.side > .eyebrow { padding: 0 12px }
.role-nav { display: grid; gap: 4px }
.nav { display: block; padding: 10px 12px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; color: var(--muted); font-size: 12px; line-height: 1.55; min-height: 44px; align-content: center }
.nav:hover { background: var(--soft); color: var(--ink); text-decoration: none }
.nav.active { border-left-color: var(--accent); background: var(--soft); color: var(--ink); font-weight: 600 }
.side-bottom { margin-top: auto; padding: 26px 12px 0; color: var(--muted); font-size: 11px }
main { min-width: 0; width: 100%; max-width: 1480px; margin: 0 auto; padding: 30px 36px 20px }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 28px; flex-wrap: wrap }
.pagehead .eyebrow { margin-bottom: 8px }
.pagehead .row { flex-wrap: wrap }
.pagefooter { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 30px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 38px; color: var(--muted); font-size: 11px }

/* Shared cards, data layouts and tables. */
.card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius) }
.card + .card { margin-top: 18px }
:where(.stack, .grid, .grid-2, .settings-stack) > .card + .card { margin-top: 0 }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line) }
.card-head > .note { max-width: 100% }
.card > .tablewrap:first-child { border-radius: var(--radius) var(--radius) 0 0 }
.card > .tablewrap:last-child { border-radius: 0 0 var(--radius) var(--radius) }
.standalone-card { padding: 26px }
.standalone-card > * + * { margin-top: 18px }
.standalone-card h1 { font-size: clamp(27px, 3vw, 36px) }
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); align-items: start }
.grid-2, .fields, .econ { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)) }
.stack, .settings-stack { display: grid; gap: 22px; align-content: start; min-width: 0 }
.operator-grid, .review-grid, .manager-grid, .owner-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .85fr); gap: 26px; align-items: start }
.fields { gap: 18px }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.fields > *, .grid-2 > *, .econ > * { min-width: 0 }
.fields p { overflow-wrap: anywhere }
.tablewrap { overflow: auto; max-width: 100%; scrollbar-color: #a6ab9c var(--soft) }
table, .table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top }
th { color: var(--muted); background: var(--soft); font-size: 10px; text-transform: uppercase; letter-spacing: .7px; font-weight: 600; white-space: nowrap }
tbody tr:last-child td { border-bottom: 0 }
tbody tr:hover td { background: #f2eee4 }
td strong { font-weight: 600 }
td .muted { font-size: 11px; margin-top: 4px }
td a:not(.btn):not(.btn-quiet) { text-decoration: underline }
tfoot td { border-top: 1px solid var(--line); background: var(--soft) }
.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums }

/* Forms: actual borders, touch targets and keyboard-visible controls. */
button, input, select, textarea { font: inherit }
.btn, button, .button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: var(--border); border-radius: 6px; background: var(--paper); color: var(--ink); font-weight: 600; font-size: 12px; line-height: 1.5; text-align: center; cursor: pointer; transition: background .16s ease, border-color .16s ease }
.btn:hover, button:hover, .button:hover { background: var(--soft); text-decoration: none }
.btn-primary, button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--onaccent) }
.btn-primary:hover, button.primary:hover, .button.primary:hover { background: #f77850; border-color: #f77850 }
.btn-danger, button.danger, .button.danger { color: var(--red); background: var(--paper); border-color: #bc8072 }
.btn-danger:hover, button.danger:hover { background: var(--redbg) }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted) }
.btn-quiet:hover { color: var(--ink); background: var(--soft) }
a.btn-quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 8px }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 46px; padding: 11px 12px; border: var(--border); border-radius: 6px; color: var(--ink); background: var(--paper) }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1 }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent-ink) }
input[type=hidden] { display: none }
textarea { resize: vertical; min-height: 90px }
label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 6px }
label > input, label > select { margin-top: 6px }
.check { display: flex; gap: 10px; align-items: center; margin: 0; font-weight: 400; min-height: 44px }
.check input { margin: 0 }
input[type=file] { font-size: 12px }
input::file-selector-button { border: 0; padding: 6px 8px; border-radius: 4px; background: var(--soft); color: var(--ink); margin-right: 8px; cursor: pointer }
.filters { align-items: flex-end; margin-bottom: 20px; gap: 14px }
.filters > div { flex: 0 1 180px; min-width: 0 }
.upload-row { margin-top: 14px; flex-wrap: wrap }
.upload-row input[type=file] { max-width: 280px }
.upload-row .note { margin: 0 }

/* Semantic states keep their names and server-provided meanings. */
.badge, .status { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 10px; background: var(--soft); color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.5; max-width: 100% }
.dot, .status::before { width: 6px; height: 6px; flex: 0 0 6px; display: inline-block; border-radius: 50%; background: currentColor }
.status::before { content: '' }
:is(.badge, .status):is(.green, .handed_over, .ordered, .first) { background: var(--greenbg); color: var(--green) }
:is(.badge, .status):is(.amber, .on_review, .not_reached) { background: var(--amberbg); color: var(--amber) }
:is(.badge, .status):is(.red, .rejected, .declined) { background: var(--redbg); color: var(--red) }
:is(.badge, .status):is(.blue, .contacted, .repeat) { background: var(--bluebg); color: var(--blue) }
.flash-list { display: grid; gap: 10px; margin-bottom: 22px }
.flash { padding: 14px 18px; border-left: 3px solid var(--green); border-radius: 6px; background: var(--greenbg); color: var(--green); font-size: 13px; margin-bottom: 14px }
.flash-list .flash { margin-bottom: 0 }
.flash.danger, .flash.error { color: var(--red); background: var(--redbg); border-color: var(--red) }
.flash.warning { color: var(--amber); background: var(--amberbg); border-color: var(--amber) }
.callout, .timer, .money-example { padding: 15px 18px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 6px }
.callout.warn, .timer, .second-opinion.warn { background: var(--amberbg); border-left-color: var(--amber) }
.timer.red { background: var(--redbg); border-left-color: var(--red) }
.note.danger { color: var(--red) }

/* Editorial stats and lists, used across all dashboards. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); padding: 18px 0; margin-bottom: 24px }
.stat { position: relative; min-width: 0; padding: 4px 22px; border-right: 1px solid var(--line) }
.stat:first-child { padding-left: 0 }
.stat:last-child { border-right: 0 }
.stat strong { display: block; font-size: 36px; font-weight: 500; line-height: 1.3; letter-spacing: -1.2px; margin: 6px 0; font-variant-numeric: tabular-nums }
.stat .small { color: var(--muted); display: block }
a.stat:hover { text-decoration: none; background: var(--soft) }
.listitem { display: block; padding: 17px 22px; border-bottom: 1px solid var(--line) }
.listitem:last-child { border-bottom: 0 }
a.listitem:hover { background: var(--soft); text-decoration: none }
.listitem .between + .note { margin-top: 6px }
.meta { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 12px; margin-top: 10px }
.tabs { display: flex; flex-wrap: wrap; gap: 22px; border-bottom: 1px solid var(--line); margin: 22px 0 }
.tab { padding: 10px 0; color: var(--muted); border-bottom: 2px solid transparent }
.tab.active { color: var(--ink); border-color: var(--accent); font-weight: 600 }
details { border-top: 1px solid var(--line); padding-top: 12px }
summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: 600 }
details p { margin-top: 8px }

/* Operator: next contact, coaching and the conversation route. */
.shift-controls { margin-bottom: 20px }
.shift-controls form { margin: 0 }
.shift-controls .note { flex: 1 1 240px }
.earnings-card { margin: 0 0 26px; background: transparent; border-width: 0 0 1px; border-radius: 0 }
.earnings-card .pad { padding: 0 0 22px }
.earnings-card h2 { font-size: 13px; font-weight: 500; color: var(--muted) }
.earnings-total { display: block; font-size: 42px; font-weight: 500; line-height: 1.3; letter-spacing: -1.5px; color: var(--accent-ink); margin: 6px 0; font-variant-numeric: tabular-nums }
.company-card { background: transparent; border: 0; border-top: 3px solid var(--ink); border-radius: 0 }
.company-card .card-head { padding-inline: 0 }
.company-card .listitem { padding-inline: 0 }
.company-card .listitem > .between > strong { font-size: 25px; font-weight: 500; letter-spacing: -.6px; line-height: 1.3 }
.company-card .listitem ~ .listitem > .between > strong { font-size: 19px }
.quote { font-size: 18px; line-height: 1.65 }
ul.signals { margin: 12px 0 0; padding-left: 20px }
ul.signals li + li { margin-top: 4px }
.tips-card { background: #efeddf; border: 0 }
.tips-card .card-head { border-bottom: 0; padding-bottom: 0 }
.tip { background: #efeddf; border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0; padding: 14px 16px; font-size: 13px }
.tip + .tip { margin-top: 14px }
.tip-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px }
.tip-meta { font-size: 11px; color: var(--muted); margin-top: 10px }
.script-card { background: #eae8db; border-color: transparent }
.script-step { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line) }
.script-step:last-child { border-bottom: 0 }
.script-step p { margin-top: 6px; font-size: 12px; color: var(--muted) }
.num { width: 24px; flex-shrink: 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums }

/* Game components are data-driven. An unassigned goal has no percentage arc. */
.activity-stats .stat:has(.activity-ring) { padding-right: 78px }
.activity-stats .stat > .activity-ring { position: absolute; top: 24px; right: 12px; width: 54px; height: 54px }
.activity-ring { width: 64px; height: 64px; flex: 0 0 64px; overflow: visible }
.activity-ring circle { fill: none; stroke-width: 5 }
.ring-track { stroke: var(--track) }
.ring-value { stroke: var(--accent); stroke-dasharray: var(--progress) 100; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 32px 32px }
.activity-ring text { fill: var(--ink); font: 500 12px var(--font); text-anchor: middle }
.no-target .ring-track { stroke-dasharray: 2 5 }
.no-target.has-activity .ring-track { stroke: var(--accent-ink) }
.level-card { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; max-width: 100% }
.level-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; background: var(--accent); color: var(--onaccent); border-radius: 50%; font: 700 21px 'Manrope', sans-serif }
.level-info { min-width: 0 }
.level-info strong { font-size: 12px }
progress { display: block; width: 100%; min-width: 130px; height: 6px; border: 0; border-radius: 99px; overflow: hidden; background: var(--track); accent-color: var(--accent); margin: 8px 0 }
progress::-webkit-progress-bar { background: var(--track) }
progress::-webkit-progress-value { background: var(--accent) }
progress::-moz-progress-bar { background: var(--accent) }
.daily-goals { margin-bottom: 26px }
.section-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px }
.goal-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); min-width: 0; overflow-wrap: anywhere }
.goal-card p { margin-top: 4px; font-variant-numeric: tabular-nums }
.days { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px }
.day { width: 33px; height: 42px; display: grid; place-items: center; text-align: center; background: var(--soft); border-radius: 18px; color: var(--muted); font-size: 10px }
.day small { display: block; font-size: 9px; line-height: 1 }
.day.done { background: var(--accent); color: var(--onaccent) }
.achievement { display: flex; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line) }
.achievement:last-child { border-bottom: 0 }
.achievement-icon { font-size: 30px; color: var(--muted); line-height: 1.2 }
.earned .achievement-icon { color: var(--accent-ink) }
.achievement-state { font-size: 10px; color: var(--muted); font-weight: 600; display: block; margin-top: 6px }

/* Lead review, transcripts and checklist. */
.review-page .review-grid > .stack:first-child > .card:first-child { background: transparent; border-width: 1px 0; border-radius: 0 }
.review-page .review-grid > .stack:first-child > .card:first-child > :is(.card-head, .pad) { padding-inline: 0 }
.transcript-card { background: transparent; border: 0 }
.transcript-card > :is(.card-head, .pad) { padding-inline: 0 }
.player { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px }
.player audio { width: 100%; min-width: 0; flex: 1 1 220px }
.transcript { display: grid; gap: 0 }
.tr-line { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 16px 12px; border-top: 1px solid var(--line); font-size: 13px }
.tr-line:nth-child(even) { background: var(--soft); border-radius: 6px; border-top-color: transparent }
.tr-line time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums }
.tr-line strong { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px }
.stage-list { display: grid; gap: 14px }
.stage { padding-bottom: 14px; border-bottom: 1px solid var(--line) }
.stage:last-child { border: 0; padding-bottom: 0 }
.stage p { margin-top: 6px }
.qa-list { display: grid; gap: 8px; margin-bottom: 16px }
.qa-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px }
.qa-item { flex: 1 1 150px }
.score-pick { display: flex; gap: 5px }
.score { position: relative; margin: 0; cursor: pointer }
.score input { position: absolute; opacity: 0; width: 1px; height: 1px }
.score span { display: grid; place-items: center; width: 44px; height: 44px; border: var(--border); border-radius: 6px; background: var(--paper); font-size: 12px }
.score:hover span { background: var(--soft) }
.score input:checked + span { color: var(--onaccent); background: var(--accent); border-color: var(--accent) }
.score input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px }
.consent-list { display: grid; gap: 6px }
.consent-list .check { padding: 12px 0; border-bottom: 1px solid var(--line) }
.decision { background: #2e3b30; color: #fff7e6; --ink: #fff7e6; --muted: #ccd5c8; --line: #63705f; --paper: #3b493b; --soft: #3b493b; --red: #ffb799; --redbg: #534037; --border: 1px solid #8d9986; --focus: #ffb799 }
.decision .callout { background: transparent; padding: 0; border: 0 }
.decision .btn-primary { color: var(--onaccent) }
.proposal .diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px }
.proposal .before, .proposal .after { padding: 16px; border-radius: 6px; font-size: 13px; border-left: 3px solid var(--red); background: var(--redbg) }
.proposal .after { border-color: var(--green); background: var(--greenbg) }
.proposal .diff p { margin-top: 8px }
.proposal-actions, .second-opinion { margin-top: 16px }
.stage-edit { padding-top: 16px; border-top: 1px solid var(--line) }
.stage-edit:first-of-type { padding-top: 0; border: 0 }
.stage-edit input { margin-bottom: 8px }

/* Bureau, owner, settings and reference pages. */
.kv { display: grid; gap: 12px }
.kv-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: baseline }
.kv-row > span:first-child { color: var(--muted); font-size: 12px }
.code { font-size: 25px; font-weight: 600; letter-spacing: 1px; font-variant-numeric: tabular-nums }
.letter { min-height: 150px; font-size: 13px; line-height: 1.65 }
.receipt-line { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px }
.total { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line) }
.total strong { font-size: 30px; font-weight: 500; letter-spacing: -.7px }
.receipt-line strong, .total strong { font-variant-numeric: tabular-nums }
.month-nav, .month-nav form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0 }
.month-nav select { width: auto }
.month-nav label { margin: 0 }
.month-name { min-width: 150px; text-align: center; font-weight: 600 }
.econ > div { display: grid; gap: 5px }
.econ strong { font-size: 23px; font-weight: 500; letter-spacing: -.5px }
.settings-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px }
.settings-nav a { padding: 10px 14px; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; background: var(--paper) }
.settings-nav a:hover { background: var(--soft) }
.settings-section { scroll-margin-top: 22px; min-width: 0 }
.settings-pair { align-items: start }
.settings-save { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 22px }
.settings-section .fields .note { margin-top: 6px }
.terms-summary { font-size: 22px; font-weight: 500; letter-spacing: -.5px; font-variant-numeric: tabular-nums }
.money-example p { margin-top: 8px }
.terms-history th { white-space: normal }
.terms-current td { background: var(--soft) }
.terms-current td:first-child { box-shadow: inset 3px 0 var(--accent); font-weight: 600 }
.email-preview { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 150px; padding: 16px; margin-top: 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; font-size: 13px }
.card.help { padding: 28px 32px; margin-bottom: 22px; max-width: 920px; line-height: 1.8 }
.help h1 { margin-bottom: 12px }
.help h2 { font-size: 23px; font-weight: 500; margin: 20px 0 10px }
.help h2:first-child { margin-top: 0 }
.help h3 { margin: 22px 0 8px }
.help p, .help ul, .help ol { margin-bottom: 12px }
.help ul, .help ol { padding-left: 24px }
.help li { margin-bottom: 8px }
code, pre { font-family: ui-monospace, monospace; overflow-wrap: anywhere }
pre { white-space: pre-wrap }

/* Login: the B brand moment, with the original working authentication form. */
.login-page { background: #f4efe3 }
.login-page .top { border-bottom: 0 }
.login-page main { max-width: 1380px; padding-top: 0 }
.login-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 7vw; align-items: center; min-height: calc(100svh - 180px); padding: 16px 4vw 36px }
.login-art { min-width: 0 }
.hero-art { width: 85%; height: 260px; margin: 0 auto 4px }
.hero-art svg { width: 100%; height: 100% }
.login-art h2 { font-size: clamp(44px, 5.8vw, 80px); line-height: 1.05; letter-spacing: -3.5px; font-weight: 500 }
.login-art h2 em { color: var(--accent-ink); font-style: italic }
.login-art > p { color: var(--muted); max-width: 355px; margin-top: 24px; font-size: 14px }
.login-card { border-left: 1px solid var(--line); padding-left: 40px; width: 100%; max-width: 430px; margin-inline: auto; min-width: 0 }
.login-card h1 { margin-top: 15px; font-size: 35px; letter-spacing: -1px }
.login-card .subtitle { margin: 10px 0 28px }
.login-card label { margin-top: 18px }
.login-card .btn { min-height: 50px; margin-top: 24px }
.login-seal { display: flex; gap: 14px; align-items: center; padding-top: 22px; border-top: 1px solid var(--line); margin-top: 28px; color: var(--muted); font-size: 11px; font-style: italic }
.login-seal > span { font-size: 30px; color: var(--ink) }

@media (min-width: 1550px) {
  main { padding-top: 40px }
}
@media (max-width: 1250px) {
  .shell { grid-template-columns: 180px minmax(0, 1fr) }
  main { padding-inline: 24px }
  .operator-grid, .review-grid, .manager-grid, .owner-grid { grid-template-columns: minmax(0, 1fr); gap: 22px }
  .activity-stats .stat:has(.activity-ring) { padding-right: 22px }
  .activity-stats .stat > .activity-ring { position: static; margin: 5px 0 }
  .fields.three { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 900px) {
  .top { padding: 18px 24px; gap: 18px }
  .top-right { gap: 10px }
  .shell { grid-template-columns: minmax(0, 1fr) }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 24px; gap: 8px }
  .side > .eyebrow { padding: 0 }
  .role-nav { display: flex; overflow-x: auto; gap: 6px; padding: 4px; margin: -4px; scrollbar-width: thin }
  .nav { flex-shrink: 0; border-left: 0; border-bottom: 2px solid transparent; border-radius: 4px 4px 0 0 }
  .nav.active { border-bottom-color: var(--accent) }
  .side-bottom { display: none }
  .grid-2 { grid-template-columns: minmax(0, 1fr) }
  .login-wrap { gap: 5vw; padding-inline: 0 }
  .login-card { padding-left: 24px }
  .login-art h2 { font-size: 55px; letter-spacing: -2.5px }
  .hero-art { height: 230px; width: 100% }
}
@media (max-width: 650px) {
  .top { flex-wrap: wrap; padding: 16px 18px; gap: 14px }
  .brand { font-size: 25px }
  .brand svg { width: 36px; height: 36px }
  .top-right { width: 100%; justify-content: space-between; gap: 8px }
  .profile { max-width: 45%; font-size: 11px }
  .avatar { width: 30px; height: 30px; flex-basis: 30px }
  main { padding: 24px 18px 18px }
  .side { padding-inline: 18px }
  .pagehead { gap: 16px; margin-bottom: 22px }
  .pagehead .row { width: 100% }
  .row { flex-wrap: wrap }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0 }
  .stat { padding: 4px 16px }
  .stat:nth-child(odd) { padding-left: 0 }
  .stat:nth-child(even) { border-right: 0 }
  .stat strong { font-size: 30px }
  .activity-stats .stat:has(.activity-ring) { padding-right: 16px }
  .pad, .card-head, .listitem, .standalone-card { padding: 18px }
  .fields, .fields.three, .proposal .diff { grid-template-columns: minmax(0, 1fr) }
  .kv-row { grid-template-columns: minmax(0, 1fr); gap: 3px }
  .filters > div { flex: 1 1 140px }
  .filters > button { width: 100% }
  .settings-save { flex-direction: column; align-items: stretch }
  .settings-nav a { flex: 1 1 auto; text-align: center }
  .terms-summary { font-size: 19px }
  .month-name { min-width: 0 }
  th, td { padding: 12px }
  .tablewrap table { min-width: 550px }
  .standalone-card table { table-layout: fixed }
  .standalone-card th { white-space: normal }
  .standalone-card .btn + .btn { margin-top: 8px }
  .card.help { padding: 22px 18px }
  .login-wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 10px 0 24px; min-height: auto }
  .login-art, .login-card { max-width: 480px; margin-inline: auto; width: 100% }
  .login-art h2 { font-size: 52px; letter-spacing: -2.5px }
  .hero-art { height: 205px; width: 85%; margin-block: 10px }
  .login-card { padding: 26px 0 0; border-left: 0; border-top: 1px solid var(--line) }
  .login-card h1 { font-size: 32px }
  .login-page .top { min-height: 70px }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px }
  .pagefooter { margin-top: 28px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important }
}
@media print {
  .side, .top, .skip-link, .btn, button, .pagefooter { display: none }
  body { background: white; color: black }
  .shell { display: block }
  main { padding: 0; max-width: none }
  .card { break-inside: avoid }
  .tablewrap { overflow: visible }
  .tablewrap table { min-width: 0 }
  .decision { background: white; color: black; --ink: black; --muted: #444; --paper: white }
}

/* Праздник подтверждённого лида */
.lead-toast { position: fixed; left: 50%; top: 24px; transform: translateX(-50%); z-index: 1000;
  background: #2b2a28; color: #fff8f0; padding: 14px 22px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 12px 30px rgba(43, 42, 40, .25); }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; border-radius: 2px; z-index: 999;
  pointer-events: none; animation: confetti-fall 3s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes confetti-fall { to { top: 105vh; transform: translateX(40px) rotate(720deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* Shared inbound form, also used in the partner cabinet. */
.inbound-form .consent-list { border: 0; padding: 0; margin: 20px 0 }
.inbound-form legend { font-size: 13px; margin-bottom: 10px }
.inbound-form > label { margin-top: 16px }
.form-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
#partner-link { flex: 1 1 280px; min-width: 0 }

/* Академия Purrfect: спокойная практика, заметный прогресс. */
.training-section { margin-top: 30px }
.training-notice { padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--amberbg); border-radius: 0 8px 8px 0; margin-bottom: 24px }
.training-notice .btn { margin-left: 12px }
.training-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px }
.training-metric { display: flex; align-items: center; gap: 16px; padding: 20px 0 }
.training-metric h2 { font-size: 15px }
.training-ring { flex: 0 0 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) var(--progress), var(--track) 0); position: relative }
.training-ring::before { content: ''; position: absolute; inset: 7px; background: var(--bg); border-radius: 50% }
.training-ring strong { position: relative; font: 700 22px 'Manrope', sans-serif }
.training-lessons { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px }
.training-lessons > .card { margin: 0 }
.training-lesson { display: flex; align-items: flex-start; flex-direction: column; padding: 22px; gap: 18px; transition: border-color .15s, transform .15s }
.training-lesson:hover { border-color: var(--accent); transform: translateY(-3px); text-decoration: none }
.training-lesson h3 { flex: 1; font-size: 16px }
.training-step { font: 600 28px 'Manrope', sans-serif; color: var(--accent-ink) }
.training-scenarios { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 30px }
.training-scenarios .btn { white-space: normal; text-align: left }
.training-history-item { padding: 16px 0; border-bottom: 1px solid var(--line) }
.training-history-item:last-child { border-bottom: 0 }
.training-example + .training-example { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px }
.training-example audio { width: 100%; max-width: 520px; display: block; margin: 16px 0 }
.training-example summary, .training-editor summary { cursor: pointer; font-weight: 600 }
.training-transcript { margin-top: 12px; white-space: pre-wrap }
.training-reading { max-width: 850px; margin-inline: auto }
.training-prose { font-size: 16px; line-height: 1.85 }
.training-prose p + p { margin-top: 18px }
.training-prose li { margin-bottom: 12px }
.training-prose ul, .training-prose ol { padding-left: 24px }
.training-questions { margin-top: 28px }
.training-questions fieldset { margin: 0 0 24px; min-width: 0 }
.training-questions legend { font-size: 16px; font-weight: 600; padding: 0 8px; max-width: 100% }
.training-option { display: flex; align-items: baseline; gap: 12px; padding: 12px; margin: 6px 0; background: var(--bg); border: 1px solid transparent; border-radius: 6px; cursor: pointer }
.training-option:has(input:checked) { border-color: var(--accent); background: var(--amberbg) }
.training-option input { accent-color: var(--accent-ink); flex-shrink: 0 }
.training-question-error { border-color: var(--red) }
.training-score { font: 700 clamp(64px, 12vw, 100px)/1.2 'Manrope', sans-serif; letter-spacing: -5px; margin: 18px 0; color: var(--accent-ink) }
.training-score small { font-size: .4em; letter-spacing: -1px }
.training-result { padding: 30px }
.training-result li { margin: 10px 0 }
.training-messages { display: flex; flex-direction: column; align-items: flex-start; gap: 16px }
.training-message { max-width: 85%; padding: 16px 20px; border-radius: 16px 16px 16px 3px; background: var(--soft); overflow-wrap: anywhere }
.training-message strong { font-size: 11px; color: var(--muted) }
.training-message p { white-space: pre-wrap; margin-top: 5px }
.training-message-own { align-self: flex-end; background: var(--greenbg); border-radius: 16px 16px 3px 16px }
.training-error { color: var(--red) }
.training-stage { padding: 18px 0; border-bottom: 1px solid var(--line) }
.training-stage .badge { margin-left: 12px }
.training-stage blockquote { margin: 12px 0; padding-left: 15px; border-left: 2px solid var(--accent); color: var(--muted) }
.training-editor summary { padding: 20px 22px }
@media (max-width: 900px) {
  .training-metrics { grid-template-columns: 1fr; gap: 0 }
  .training-metric { padding: 12px 0 }
}
@media (max-width: 650px) {
  .training-message { max-width: 95%; padding: 12px 15px }
  .training-result { padding: 22px }
  .training-scenarios, .training-scenarios form, .training-scenarios .btn { width: 100% }
  .training-notice .btn { margin: 12px 0 0 }
}

.training-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
