:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #203047; background: #f5f6f8; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #245b9a; text-decoration: none; }
button { font: inherit; color: #fff; background: #245b9a; border: 0; border-radius: 10px; padding: 12px 16px; min-height: 44px; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid #df8700; outline-offset: 3px; }
h1 { font-size: 28px; font-weight: 650; margin: 28px 0 20px; }
p { line-height: 1.5; }
.workspace { padding: 20px 16px calc(100px + env(safe-area-inset-bottom)); max-width: 1200px; margin: auto; }
.header { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.freshness, .time { font-size: 13px; margin: 2px 0; color: #596778; }
.controls { display: flex; gap: 8px; }
.controls button { font-size: 13px; padding: 10px 12px; }
.controls form:last-child button { background: #e8edf4; color: #203047; }
.navigation { position: fixed; z-index: 1; bottom: 0; width: 100%; display: flex; justify-content: space-around; background: #fff; border-top: 1px solid #dce2eb; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
.navigation a { text-align: center; min-height: 48px; padding: 14px 16px; border-radius: 10px; color: #596778; }
.navigation a[aria-current] { background: #e8f0fa; color: #245b9a; font-weight: 600; }
.brand { display: none; }
.panel { border: 1px solid #dce2eb; border-radius: 16px; padding: 24px; background: #fff; }
.placeholder { min-height: 180px; color: #596778; }
.notice { padding: 12px 16px; background: #fff1df; border-radius: 10px; color: #814800; }
.login { max-width: 440px; margin: 12vh auto; width: calc(100% - 32px); }
.login button { width: 100%; }
.eyebrow { font-size: 13px; color: #596778; }
@media (min-width: 1024px) {
  .navigation { top: 0; bottom: 0; left: 0; width: 220px; flex-direction: column; justify-content: flex-start; gap: 12px; border-top: 0; border-right: 1px solid #dce2eb; padding: 32px 16px; }
  .navigation a { text-align: left; }
  .brand { display: block; font-size: 24px; font-weight: 700; margin: 0 16px 24px; }
  .workspace { margin-left: 220px; padding: 32px 40px; }
}
/* Today keeps the action queue ahead of diagnostics on a phone. */
.today-grid { display: grid; gap: 10px; }
.today-grid .panel { padding: 14px 16px; }
.today-grid h2 { font-size: 15px; margin: 0 0 8px; font-weight: 650; }
.today-grid h3 { font-size: 14px; margin: 12px 0 5px; }
.today-grid p { margin: 5px 0; font-size: 13px; }
.muted { color: #667386; font-size: 12px; }
.money { display: flex; align-items: baseline; gap: 10px; }
.money strong, .lead-number strong { font-size: 27px; letter-spacing: -.5px; }
.money span { font-size: 12px; color: #667386; }
.lead-number { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.compact { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.compact li { margin: 4px 0; overflow-wrap: anywhere; }
.queue li + li { border-top: 1px solid #eef1f5; padding-top: 6px; }
.queue-link { display: inline-block; padding-top: 6px; font-size: 13px; }
.channels { line-height: 1.7; }
.machine summary { cursor: pointer; font-size: 14px; }
.machine ul { padding-left: 18px; font-size: 12px; }
.better { background: #edf5ff; color: #175baf; }
.worse { background: #fff3e4; color: #95520b; border-color: #edc99d; }
.failure { overflow-wrap: anywhere; }
.matrix { display: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e7ebf0; }
@media (min-width: 1024px) {
  .today-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .today-grid .panel { padding: 20px; }
  .machine, .loss, .matrix { grid-column: 1 / -1; }
  .matrix { display: block; }
}
/* People and card share generous tap targets at 390px. */
.filter-chips, .stage-chips, .button-row, .contact-others { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chips { margin: 0 0 16px; }
.filter-chips a, .stage-chip { border-radius: 20px; padding: 10px 14px; background: #e8edf4; font-size: 13px; }
.filter-chips a[aria-current] { background: #245b9a; color: white; }
.people-list, .card-grid { display: grid; gap: 12px; }
.people-group, .card-grid .panel { padding: 18px 16px; min-width: 0; }
.people-group h2, .card-grid h2 { font-size: 18px; margin: 0 0 12px; }
.person-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 10px; border-radius: 12px; color: #203047; }
.person-row + .person-row { border-top: 1px solid #eef1f5; }
.person-row:hover { background: #edf5ff; }
.avatar { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 50%; background: #e8edf4; }
.person-body { display: grid; gap: 5px; font-size: 14px; overflow-wrap: anywhere; }
.person-body small { color: #667386; font-size: 12px; }
.card-grid p { margin: 8px 0; overflow-wrap: anywhere; }
.contact-main, .contact-other { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; padding: 12px 16px; }
.contact-main { color: white; background: #245b9a; margin: 0 0 12px; }
.contact-other, button.secondary { background: #e8edf4; color: #203047; }
[data-reveal] { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
[data-reveal] output { overflow-wrap: anywhere; max-width: 100%; }
textarea, select { display: block; width: 100%; max-width: 100%; font: inherit; font-size: 16px; padding: 12px; border: 1px solid #c1ccd9; border-radius: 10px; color: #203047; background: white; }
textarea { resize: vertical; line-height: 1.5; margin: 8px 0 12px; }
textarea:focus-visible, select:focus-visible { outline: 3px solid #df8700; outline-offset: 2px; }
.actions-grid { display: grid; gap: 16px; }
.action-form label { font-size: 13px; }
.action-form select { margin: 6px 0 10px; }
button:disabled { cursor: default; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 14px 0; border-top: 1px solid #eef1f5; overflow-wrap: anywhere; }
.timeline blockquote { white-space: pre-wrap; margin: 10px 0; border-left: 3px solid #dce2eb; padding-left: 12px; font-size: 14px; }
.back-link { display: inline-block; padding: 0 0 16px; min-height: 44px; }
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .card-header, .card-timeline { grid-column: 1 / -1; }
  .card-actions { grid-row: span 2; }
  .person-row { padding: 16px; }
}
/* Funnel is server-rendered: native links work with JavaScript disabled. */
.funnel-list { display: grid; gap: 12px; }
.funnel-list .panel { padding: 18px 16px; min-width: 0; }
.funnel-list h2, .funnel-list h3 { font-size: 18px; margin: 0 0 12px; }
.funnel-list p { overflow-wrap: anywhere; }
.funnel-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.funnel-step { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; border: 1px solid #e7ebf0; }
.funnel-step span { font-size: 13px; }
.funnel-step strong { font-size: 24px; }
.funnel-step a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: inherit; text-decoration: underline; text-underline-offset: 4px; }
.funnel-step small { font-size: 12px; overflow-wrap: anywhere; }
.journal { font-size: 13px; }
.retention svg { display: block; width: 100%; max-width: 680px; height: auto; margin: auto; overflow: visible; }
.retention svg text { font: 12px -apple-system, BlinkMacSystemFont, sans-serif; fill: #596778; }
.curve-grid { stroke: #e7ebf0; stroke-width: 1; }
.retention-path { stroke: #245b9a; stroke-width: 2.5; fill: none; }
.offer-mark { stroke: #95520b; stroke-width: 1; stroke-dasharray: 4 3; }
.retention svg .offer-mark-label { fill: #95520b; font-size: 11px; }
.curve-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; list-style: none; margin: 12px 0; padding: 0; }
.changes ul, .stuck-list { list-style: none; margin: 0; padding: 0; }
.changes li { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid #e7ebf0; overflow-wrap: anywhere; }
.changes time { color: #596778; font-size: 12px; }
.stuck-list li { padding: 12px 0; border-top: 1px solid #e7ebf0; overflow-wrap: anywhere; }
.stuck-list a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 1024px) {
  .funnel-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* «Открыть»: a person without a card key; the press creates the key (owner action). */
.open-form { display: inline-block; margin: 0 0 0 6px; vertical-align: middle; }
.open-button { font-size: 13px; padding: 6px 12px; min-height: 36px; }
.person-row .open-form { align-self: center; margin-left: auto; }
