/* ============ Opusmed — дизайн-система ============ */
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('/fonts/Lora-Variable.woff') format('woff'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('/fonts/Lora-Italic-Variable.woff') format('woff'); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --bg: #F3F0E8; --bg-2: #ECE8DD; --surface: #FFFFFF; --surface-2: #FAF8F3;
  --ink: #14211D; --ink-2: #4A5752; --ink-3: #8A948F; --line: #E4DFD3; --line-2: #D6D0C1;
  --forest: #163A31; --forest-2: #1F4D41; --forest-3: #2B6455; --sage: #A9C5B0; --mint: #E2EEE5;
  --lime: #D4F26A; --lime-2: #E9F9B4; --coral: #E36F55; --coral-bg: #FBE6E0; --amber: #D99A2B; --amber-bg: #FBF0D9;
  --sky: #5F93BF; --sky-bg: #E3EEF7; --violet: #7C6BC4; --violet-bg: #ECE8F8;
  --r-lg: 24px; --r: 16px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(20,33,29,.04), 0 8px 24px -12px rgba(20,33,29,.12);
  --shadow-lg: 0 24px 60px -24px rgba(20,33,29,.28);
  --serif: 'Lora', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar: 264px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'tnum' 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 18px; line-height: 1.3; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.hidden { display: none !important; }
::selection { background: var(--lime); color: var(--ink); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s, border-color .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-2); box-shadow: 0 8px 20px -10px rgba(22,58,49,.6); }
.btn-lime { background: var(--lime); color: var(--forest); }
.btn-lime:hover { background: #c9ea54; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-3); }
.btn-soft { background: var(--mint); color: var(--forest); }
.btn-soft:hover { background: #d3e6d9; }
.btn-danger { background: var(--coral-bg); color: #A33B23; }
.btn-danger:hover { background: #f8d6cd; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 15px; }
.btn-icon { width: 40px; padding: 0; }
.btn-block { width: 100%; }
.link { color: var(--forest-3); font-weight: 600; text-decoration: none; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 48px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 110px; padding: 14px 16px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--forest-3); box-shadow: 0 0 0 4px rgba(43,100,85,.12); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%234A5752' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--forest); margin-top: 2px; flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.form-error { background: var(--coral-bg); color: #9b3520; padding: 12px 16px; border-radius: 12px; font-size: 14px; }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow); border: 1px solid rgba(228,223,211,.6); }
.card-flat { background: var(--surface-2); border-radius: var(--r); padding: 18px; border: 1px solid var(--line); }
.card-dark { background: var(--forest); color: #EAF2EC; border-radius: var(--r-lg); padding: 28px; position: relative; overflow: hidden; }
.card-dark .muted { color: #A9C5B0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.divider { height: 1px; background: var(--line); margin: 8px 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--mint); color: var(--forest-2); }
.badge-sky { background: var(--sky-bg); color: #2F5F86; }
.badge-amber { background: var(--amber-bg); color: #8A5A0B; }
.badge-coral { background: var(--coral-bg); color: #A33B23; }
.badge-violet { background: var(--violet-bg); color: #4D3E96; }
.badge-lime { background: var(--lime-2); color: var(--forest); }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; color: var(--forest); background: var(--mint); }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; font-family: var(--serif); }

/* ---------- Публичная часть ---------- */
.pub-nav { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); background: rgba(243,240,232,.82); border-bottom: 1px solid rgba(214,208,193,.5); }
.pub-nav .inner { max-width: 1240px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 28px; }
.pub-nav nav { display: flex; gap: 24px; flex: 1; }
.pub-nav nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.pub-nav nav a:hover { color: var(--ink); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .16em; font-size: 15px; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--forest); display: grid; place-items: center; }
.logo-mark svg { width: 18px; height: 18px; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 72px 0 40px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.02; letter-spacing: -.025em; }
.hero h1 em { font-style: italic; color: var(--forest-3); }
.hero p.lead { font-size: 19px; color: var(--ink-2); max-width: 560px; margin: 22px 0 32px; }
.hero-visual { position: relative; aspect-ratio: 1/1.05; }
.orb-card { position: absolute; inset: 0; background: radial-gradient(120% 90% at 20% 10%, #2B6455 0%, #163A31 55%, #0E2620 100%); border-radius: 36px; overflow: hidden; box-shadow: var(--shadow-lg); }
.orb-card::after { content: ''; position: absolute; inset: 0; background: radial-gradient(40% 30% at 70% 80%, rgba(212,242,106,.35), transparent 70%); }
.float-chip { position: absolute; background: var(--surface); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-lg); font-size: 13px; z-index: 2; }
.section { padding: 80px 0; }
.section-title { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-title h2 { font-size: clamp(30px, 3.4vw, 46px); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 28px; }
.feature .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--mint); color: var(--forest); margin-bottom: 18px; }
.feature .ic svg { width: 22px; height: 22px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 18px; }
.plan.featured { background: var(--forest); color: #EAF2EC; }
.plan.featured .muted { color: var(--sage); }
.plan .price { font-family: var(--serif); font-size: 46px; line-height: 1; }
.plan ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 10px; font-size: 14px; }
.plan li svg { width: 18px; height: 18px; flex: none; color: var(--forest-3); margin-top: 2px; }
.plan.featured li svg { color: var(--lime); }
.toggle { display: inline-flex; padding: 4px; background: var(--bg-2); border-radius: 999px; }
.toggle button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 4px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--ink-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 12px 0 0; }
.footer { background: var(--forest); color: #CFDFD4; padding: 56px 0 28px; margin-top: 40px; }
.footer a { color: #CFDFD4; text-decoration: none; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer .bottom { border-top: 1px solid rgba(169,197,176,.2); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; font-size: 13px; flex-wrap: wrap; gap: 12px; }

/* ---------- Авторизация ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(100% 80% at 0% 0%, #2B6455 0%, #163A31 50%, #0E2620 100%); color: #EAF2EC; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side blockquote { font-family: var(--serif); font-size: 28px; line-height: 1.3; margin: 0; font-style: italic; max-width: 480px; position: relative; z-index: 1; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 440px; }
.google-btn { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); }
.google-btn:hover { border-color: var(--ink-3); }
.or { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.seg-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px; background: var(--bg-2); border-radius: 14px; }
.seg-switch label { text-align: center; padding: 10px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg-switch input { display: none; }
.seg-switch label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.code-inputs { display: flex; gap: 10px; }
.code-inputs input { width: 100%; height: 60px; text-align: center; font-size: 26px; font-weight: 600; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.code-inputs input:focus { border-color: var(--forest-3); box-shadow: 0 0 0 4px rgba(43,100,85,.12); }

/* ---------- Приложение: каркас ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--forest); color: #CFDFD4; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; }
.sidebar .logo { color: #fff; padding: 4px 10px 22px; }
.sidebar .logo-mark { background: var(--lime); }
.sidebar .logo-mark svg { color: var(--forest); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; font-weight: 500; font-size: 14px; color: #BCD0C3; transition: background .15s, color .15s; position: relative; }
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(212,242,106,.12); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); }
.nav-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #7FA08C; padding: 16px 12px 6px; font-weight: 600; }
.sidebar .cta { margin: 10px 0 6px; }
.sidebar .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); text-decoration: none; }
.sidebar .me .avatar { background: var(--lime); }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 16px 36px; background: rgba(243,240,232,.86); backdrop-filter: blur(14px); }
.topbar .search { flex: 1; max-width: 460px; position: relative; }
.topbar .search input { padding-left: 44px; height: 44px; border-radius: 999px; background: var(--surface); }
.topbar .search svg { position: absolute; left: 16px; top: 13px; width: 18px; height: 18px; color: var(--ink-3); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; position: relative; color: var(--ink-2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .pip { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); border: 2px solid var(--surface); }
.page { padding: 8px 36px 56px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 12px 0 28px; flex-wrap: wrap; }
.page-head p { margin: 8px 0 0; color: var(--ink-2); }
.mobile-nav { display: none; }
.demo-banner { background: var(--lime-2); color: var(--forest); font-size: 13px; padding: 8px 36px; display: flex; gap: 8px; align-items: center; }

/* ---------- Статистика ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 20px 22px; }
.stat .label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.stat .label svg { width: 16px; height: 16px; }
.stat .value { font-family: var(--serif); font-size: 38px; line-height: 1.1; margin-top: 10px; }
.stat .delta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.chart { width: 100%; height: 240px; }
.chart text { font-size: 11px; fill: var(--ink-3); font-family: var(--sans); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* ---------- Таблицы и списки ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--surface-2); }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; text-decoration: none; transition: background .12s; cursor: pointer; }
.list-item:hover { background: var(--surface-2); }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty .ic { width: 64px; height: 64px; border-radius: 20px; background: var(--mint); color: var(--forest); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .ic svg { width: 28px; height: 28px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 12px 16px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--forest); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--forest); color: #fff; border-color: var(--forest); }

/* ---------- Пациенты ---------- */
.layout-side { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 92px; }
.patient-hero { display: flex; gap: 20px; align-items: center; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.file-tile { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.file-tile .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--sky-bg); color: #2F5F86; display: grid; place-items: center; flex: none; }
.file-tile .ic svg { width: 20px; height: 20px; }
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ''; position: absolute; left: -22px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--forest-3); }

/* ---------- Новая консультация ---------- */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.type-card { padding: 32px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .15s; text-align: left; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.type-card:hover { transform: translateY(-2px); border-color: var(--sage); }
.type-card.on { border-color: var(--forest); }
.type-card .ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 22px; }
.type-card .ic svg { width: 30px; height: 30px; }
.steps { display: flex; gap: 8px; align-items: center; margin-bottom: 28px; }
.steps .s { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.steps .s b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-size: 12px; }
.steps .s.on { color: var(--ink); } .steps .s.on b { background: var(--forest); color: #fff; }
.steps .line { width: 32px; height: 1px; background: var(--line-2); }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); max-height: 300px; overflow: auto; padding: 6px; }
.tpl-option { padding: 16px; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; background: var(--surface); transition: border-color .15s; }
.tpl-option.on { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(22,58,49,.1); }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 18px; text-align: center; color: var(--ink-2); cursor: pointer; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--forest-3); background: var(--mint); }

/* ---------- Запись ---------- */
.rec-stage { background: radial-gradient(90% 80% at 50% 0%, #245748 0%, #163A31 55%, #0D241E 100%); border-radius: 36px; color: #EAF2EC; padding: 48px 32px 40px; text-align: center; position: relative; overflow: hidden; min-height: 560px; display: flex; flex-direction: column; align-items: center; }
.rec-status { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.08); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.rec-status .live { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 rgba(227,111,85,.7); animation: pulse 1.6s infinite; }
.rec-status.paused .live { background: var(--amber); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(227,111,85,.6); } 70% { box-shadow: 0 0 0 14px rgba(227,111,85,0); } 100% { box-shadow: 0 0 0 0 rgba(227,111,85,0); } }
.orb-wrap { position: relative; width: 260px; height: 260px; margin: 36px auto 28px; display: grid; place-items: center; }
.orb { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #F2FFC4, var(--lime) 40%, #8DB33A 100%); box-shadow: 0 0 60px rgba(212,242,106,.45), inset 0 -10px 30px rgba(0,0,0,.15); transition: transform .08s linear; }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(212,242,106,.25); transition: transform .12s linear; }
.orb-ring.r2 { inset: 30px; border-color: rgba(212,242,106,.35); }
.paused .orb { filter: grayscale(.7) brightness(.85); box-shadow: none; }
.rec-time { font-family: var(--serif); font-size: clamp(48px, 7vw, 76px); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.rec-meta { display: flex; gap: 24px; justify-content: center; margin: 18px 0 32px; color: var(--sage); font-size: 14px; flex-wrap: wrap; }
.rec-meta b { color: #fff; font-weight: 600; }
.rec-controls { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.rec-controls .btn { height: 56px; padding: 0 28px; font-size: 15px; }
.btn-glass { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.15); }
.btn-glass:hover { background: rgba(255,255,255,.16); }
.btn-stop { background: var(--coral); color: #fff; }
.btn-stop:hover { background: #d65f45; }
.bars { display: flex; gap: 4px; align-items: center; height: 46px; justify-content: center; margin-top: 30px; }
.bars i { width: 4px; border-radius: 4px; background: rgba(212,242,106,.75); height: 6px; transition: height .08s; }
.upload-state { font-size: 12px; color: var(--sage); margin-top: 18px; }

/* ---------- Анализ ---------- */
.analyzing { text-align: center; padding: 64px 24px; }
.loader-orb { width: 120px; height: 120px; margin: 0 auto 32px; position: relative; }
.loader-orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--forest-3); animation: spin 1.4s linear infinite; }
.loader-orb span:nth-child(2) { inset: 14px; border-top-color: var(--lime); animation-duration: 1.9s; animation-direction: reverse; }
.loader-orb span:nth-child(3) { inset: 28px; border-top-color: var(--sage); animation-duration: 2.6s; }
@keyframes spin { to { transform: rotate(360deg); } }
.pipeline { display: flex; flex-direction: column; gap: 12px; max-width: 440px; margin: 32px auto 0; text-align: left; }
.pipeline .p { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface); border-radius: 14px; font-weight: 500; }
.pipeline .p .st { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); flex: none; }
.pipeline .p.done .st { background: var(--forest); color: var(--lime); }
.pipeline .p.now .st { background: var(--lime); }
.pipeline .p .st svg { width: 14px; height: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(0,0,0,.12); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }

/* ---------- Результат ---------- */
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.report-section { padding: 0; overflow: hidden; }
.report-section > header { padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.report-section > header h3 { font-size: 17px; }
.report-section .fields { padding: 8px 24px 16px; }
.rf { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.rf:last-child { border-bottom: 0; }
.rf .lbl { font-size: 13px; color: var(--ink-2); font-weight: 500; padding-top: 6px; }
.rf textarea { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 6px 10px; resize: none; overflow: hidden; min-height: 34px; line-height: 1.5; outline: none; transition: background .12s, border-color .12s; }
.rf textarea:hover { background: var(--surface-2); }
.rf textarea:focus { background: var(--surface); border-color: var(--forest-3); box-shadow: 0 0 0 3px rgba(43,100,85,.1); }
.rf.missing textarea::placeholder { color: #B98226; }
.rf.missing .lbl::after { content: ' • не прозвучало'; color: var(--amber); font-size: 11px; font-weight: 600; }
.rf.inferred .lbl::after { content: ' • вывод ИИ'; color: var(--violet); font-size: 11px; font-weight: 600; }
.player { background: var(--forest); color: #EAF2EC; border-radius: var(--r-lg); padding: 20px; }
.player .controls { display: flex; align-items: center; gap: 14px; }
.play-btn { width: 52px; height: 52px; border-radius: 50%; background: var(--lime); color: var(--forest); border: 0; cursor: pointer; display: grid; place-items: center; flex: none; }
.play-btn svg { width: 22px; height: 22px; }
.scrub { position: relative; height: 40px; flex: 1; cursor: pointer; overflow: hidden; }
.scrub canvas { width: 100%; height: 40px; display: block; }
.scrub .mark { position: absolute; top: -4px; width: 3px; height: 48px; border-radius: 2px; background: var(--coral); transform: translateX(-1px); pointer-events: none; }
.player .times { display: flex; justify-content: space-between; font-size: 12px; color: var(--sage); margin-top: 6px; }
.speed { background: rgba(255,255,255,.1); border: 0; color: #fff; border-radius: 999px; height: 30px; padding: 0 10px; cursor: pointer; font-weight: 600; font-size: 12px; }
.moment { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); text-align: left; width: 100%; transition: border-color .12s, background .12s; }
.moment > svg { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.moment:hover { border-color: var(--forest-3); background: var(--mint); }
.moment .t { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--forest); background: var(--mint); padding: 4px 8px; border-radius: 8px; }
.moment .k { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.moment .k svg { width: 16px; height: 16px; }
.missed-box { background: var(--amber-bg); border-radius: var(--r-lg); padding: 22px; }
.missed-box h3 { color: #6E4708; }
.missed-item { background: rgba(255,255,255,.65); border-radius: 12px; padding: 12px 14px; margin-top: 8px; }
.missed-item b { display: block; font-size: 14px; }
.missed-item span { font-size: 13px; color: #7A5613; }
.dialog { display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow: auto; padding-right: 6px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; cursor: pointer; transition: box-shadow .15s; }
.msg .who { font-size: 11px; font-weight: 700; letter-spacing: .04em; margin-bottom: 4px; display: flex; gap: 8px; color: var(--ink-3); }
.msg.patient { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.doctor { background: var(--mint); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.playing { box-shadow: 0 0 0 2px var(--forest-3); }
.msg .ev { color: var(--coral); font-style: italic; }
.summary-card { background: linear-gradient(135deg, var(--forest) 0%, var(--forest-2) 100%); color: #EAF2EC; }
.summary-card p { font-family: var(--serif); font-size: 18px; line-height: 1.5; margin: 10px 0 0; }

/* ---------- Заметка ---------- */
.letter { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.letter .lh { background: var(--forest); color: #fff; padding: 22px 32px; letter-spacing: .16em; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.letter .lb { padding: 32px; }
.letter input.subject { border: 0; font-family: var(--serif); font-size: 26px; width: 100%; outline: none; padding: 0; margin-bottom: 18px; background: transparent; }
.letter textarea { border: 0; width: 100%; min-height: 420px; resize: vertical; outline: none; font-size: 16px; line-height: 1.7; padding: 0; background: transparent; }

/* ---------- Шаблоны ---------- */
.tpl-section { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: var(--surface-2); }
.tpl-field { display: grid; grid-template-columns: 1fr 150px 40px; gap: 10px; align-items: center; margin-top: 8px; }

/* ---------- Модальные окна, тосты ---------- */
.overlay { position: fixed; inset: 0; background: rgba(14,38,32,.45); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 28px; padding: 28px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: rise .2s; }
.modal-wide { max-width: 760px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; max-width: 380px; animation: rise .2s; display: flex; gap: 10px; align-items: center; }
.toast.err { background: #8E2F1B; }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--lime); }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 8px; z-index: 40; max-height: 420px; overflow: auto; }
.notif { padding: 12px; border-radius: 12px; display: block; text-decoration: none; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--mint); }
.skeleton { background: linear-gradient(90deg, var(--bg-2), #f5f2ea, var(--bg-2)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 12px; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .result-grid, .layout-side { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; }
  .page { padding: 8px 16px 110px; }
  .mobile-nav { display: flex; position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 50; background: var(--forest); border-radius: 22px; padding: 8px; justify-content: space-around; box-shadow: var(--shadow-lg); }
  .mobile-nav a { color: #BCD0C3; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; text-decoration: none; padding: 6px 10px; border-radius: 14px; }
  .mobile-nav a.active { color: #fff; background: rgba(212,242,106,.14); }
  .mobile-nav a.rec { background: var(--lime); color: var(--forest); }
  .mobile-nav svg { width: 22px; height: 22px; }
  .hero, .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .features, .plans, .footer .cols, .type-cards, .grid-3 { grid-template-columns: 1fr; }
  .pub-nav nav { display: none; }
  .rf { grid-template-columns: 1fr; gap: 4px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; }
  .demo-banner { padding: 8px 16px; }
}
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat .value { font-size: 30px; } .tpl-field { grid-template-columns: 1fr 40px; } .tpl-field select { grid-column: 1; } }

/* ---------- Печать (PDF отчёта и заметки) ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .mobile-nav, .no-print, .toasts, .side-col, .demo-banner { display: none !important; }
  .shell, .result-grid { display: block; }
  .page { padding: 0; }
  .card, .letter { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .rf textarea { border: 0; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

.demo-banner svg { width: 16px; height: 16px; flex: none; }
.main { overflow-x: clip; }
.summary-card .row-between input { max-width: 100%; }

/* ============ Карта лечения (страница пациента) ============ */
body.pc-body { background: #EEF1EC; }
.pc { --brand: #163A31; max-width: 520px; margin: 0 auto; padding-bottom: 32px; font-size: 15px; color: var(--ink); }
.pc-hero { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--brand) 70%, #4a8a74) 0%, var(--brand) 55%, color-mix(in srgb, var(--brand) 75%, #000) 100%); color: #fff; padding: 22px 22px 34px; border-radius: 0 0 32px 32px; position: relative; overflow: hidden; }
.pc-hero::after { content: ''; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(212,242,106,.35), transparent 65%); }
.pc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; opacity: .9; }
.pc-logo { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .16em; font-weight: 700; }
.pc-logo .logo-mark { width: 24px; height: 24px; border-radius: 8px; background: var(--lime); color: var(--forest); }
.pc-logo .logo-mark svg { width: 14px; height: 14px; }
.pc-date { background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 999px; }
.pc-doc { display: flex; align-items: center; gap: 12px; margin-top: 24px; position: relative; z-index: 1; }
.pc-ava { width: 48px; height: 48px; border-radius: 50%; background: var(--lime); color: var(--forest); display: grid; place-items: center; font-weight: 700; font-family: var(--serif); font-size: 18px; }
.pc-docname { font-weight: 700; } .pc-doctitle { font-size: 13px; opacity: .8; }
.pc-title { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.15; margin: 22px 0 8px; position: relative; z-index: 1; color: #fff; }
.pc-greet { margin: 0; opacity: .9; line-height: 1.55; position: relative; z-index: 1; }
.pc-section { padding: 0 16px; margin-top: 22px; }
.pc-section h2 { font-family: var(--serif); font-size: 20px; font-weight: 500; margin: 0 4px 10px; }
.pc-row { display: flex; justify-content: space-between; align-items: center; }
.pc-card { background: #fff; border-radius: 20px; padding: 16px; box-shadow: 0 1px 2px rgba(20,33,29,.05), 0 10px 26px -16px rgba(20,33,29,.22); }
.pc-visit { margin: -22px 16px 0; position: relative; z-index: 2; display: flex; gap: 14px; align-items: flex-start; }
.pc-visit-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--lime-2); color: var(--brand); display: grid; place-items: center; flex: none; }
.pc-visit-ic svg { width: 22px; height: 22px; }
.pc-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.pc-visit-date { font-family: var(--serif); font-size: 19px; margin: 2px 0 4px; }
.pc-muted { color: var(--ink-2); font-size: 14px; margin: 4px 0 0; }
.pc-chip { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); font-weight: 600; font-size: 13px; margin-top: 6px; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pc-remedy + .pc-remedy { margin-top: 10px; }
.pc-remedy-name { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 17px; }
.pc-remedy-name svg { width: 20px; height: 20px; color: var(--brand); flex: none; }
.pc-progress { font-weight: 700; color: var(--brand); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.pc-list { padding: 6px; }
.pc-check { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; cursor: pointer; }
.pc-check + .pc-check { border-top: 1px dashed var(--line); }
.pc-check input { display: none; }
.pc-box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; transition: all .15s; }
.pc-box svg { width: 16px; height: 16px; }
.pc-check.on .pc-box { background: var(--brand); border-color: var(--brand); color: var(--lime); }
.pc-check.on .grow { text-decoration: line-through; color: var(--ink-3); }
.pc-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand); font-size: 13px; }
.pc-bullets { display: flex; flex-direction: column; gap: 12px; }
.pc-bullet { display: flex; gap: 10px; line-height: 1.5; }
.pc-bullet svg { width: 18px; height: 18px; flex: none; color: var(--brand); margin-top: 2px; }
.pc-watch .pc-bullet svg { color: var(--amber); }
.pc-contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 14px; border-radius: 16px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; margin-top: 10px; }
.pc-contacts .pc-btn { margin-top: 0; }
.pc-contacts .pc-btn-ghost { grid-column: 1 / -1; }
.pc-btn svg { width: 18px; height: 18px; }
.pc-btn-ghost { background: #fff; color: var(--brand); border: 1.5px solid color-mix(in srgb, var(--brand) 25%, #fff); }
.pc-wa { background: #1FA855; } .pc-tg { background: #2A9BD6; }
.pc-wa-btn { background: #1FA855; color: #fff; } .pc-tg-btn { background: #2A9BD6; color: #fff; }
.pc-foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 24px 24px 0; }
.pc-foot p { margin: 4px 0; }
.pc-brand { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px !important; letter-spacing: .1em; font-weight: 700; }
.pc-brand .logo-mark { width: 20px; height: 20px; border-radius: 6px; } .pc-brand .logo-mark svg { width: 12px; height: 12px; color: var(--lime); }

/* Редактор врача: телефон-превью */
.card-editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.phone { background: #10201B; border-radius: 44px; padding: 12px; box-shadow: var(--shadow-lg); }
.phone-screen { background: #EEF1EC; border-radius: 34px; height: 640px; overflow-y: auto; scrollbar-width: none; }
.phone-screen .pc-title { font-size: 25px; }
@media (max-width: 1180px) { .card-editor { grid-template-columns: minmax(0, 1fr); } .phone-screen { height: 560px; } }
@media print { body.pc-body { background: #fff; } .pc-contacts, .pc-btn { display: none !important; } .pc-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
