/* Не больно brand tokens v2.0. Blue-gray / slate / pale blue / white. Full color in light and dark contexts. */
:root {
  --viora-brand-field: #94ADB8;
  --viora-brand-light: #FFFFFF;
  --viora-brand-accent: #94ADB8;
  --viora-text-primary: #29383F;
  --viora-text-secondary: #536269;
  --viora-surface: #FFFFFF;
  --viora-surface-subtle: #EAF0F2;
  --viora-border: #D7E0E3;
  --viora-dark-background: #536269;
  --viora-dark-surface: #65757C;
  --viora-dark-text: #FFFFFF;
  --viora-dark-text-secondary: #EAF0F2;
  --viora-focus: #29383F;
  --viora-slate: #536269;
  --viora-error: #9D3E3E;
  --viora-warning: #765517;
  --viora-font: "Noto Sans", Arial, sans-serif;
  --viora-radius-input: 12px;
  --viora-radius-card: 20px;
  --viora-radius-large: 24px;
  --viora-space: 4px;
  --viora-motion: 240ms;
}
.viora-primary-button { background: var(--viora-slate); color: var(--viora-brand-light); min-height: 44px; border-radius: 12px; }
:focus-visible { outline: 3px solid var(--viora-focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

[data-theme="dark"] { --viora-surface: #536269; --viora-surface-subtle: #65757C; --viora-text-primary: #FFFFFF; --viora-text-secondary: #EAF0F2; --viora-focus: #FFFFFF; }
[data-theme="dark"] .viora-primary-button { background: #FFFFFF; color: #536269; }

/* Brandbook v2, pp.14–22: the light diary palette. Clinical states remain explicit in text. */
:root {
 --ink:#29383F; --muted:#536269; --paper:#FFFFFF; --line:#D7E0E3;
 --purple:#536269; --purple-dark:#29383F; --lavender:#EAF0F2;
 --pink:#EAF0F2; --green:#EAF0F2; --white:#FFFFFF;
 --shadow:0 8px 30px #29383f05;
 color-scheme:light;
}
body,.main,.login-form,.loading { background:#FFFFFF; color:#29383F; }
h1,h2,h3,.brand,.phone-brand b,.eyebrow { color:#536269; }
.brand small,.phone-brand small,.nav-label,.footer,.crumb,.sub,.stat-title,.stat-note,.profile small { color:#536269; }
.hero,.login-story,.sidebar-note,.app-status,.report-mini,.insight-icon,.day-date,.install-instructions,.install-instructions.recommended { background:#EAF0F2; border-color:#D7E0E3; color:#29383F; }
.hero p,.login-story p,.insight small,.install-instructions ol,.install-note,.chart-foot { color:#536269; }
.hero-art .orb { background:linear-gradient(135deg,#94ADB8,#EAF0F2 55%,#536269); box-shadow:12px 14px 28px #53626918; }
.hero-art:before,.hero-art:after { border-color:#94ADB8; }
.button { background:#536269; color:#FFFFFF; }
.button:hover { background:#29383F; }
.button.secondary { background:#FFFFFF; color:#536269; border-color:#D7E0E3; }
.button.soft,.badge,.badge.green,.badge.pink,.nav button.active,.mobile-nav button.active,.segmented button.selected { background:#EAF0F2; color:#29383F; border-color:#536269; }
.badge.green,.badge.pink { color:#536269; }
.nav button:hover { background:#EAF0F2; }
.avatar,.phone-account { background:#EAF0F2; border-color:#D7E0E3; color:#536269; }
.mobile-nav { background:#FFFFFF; border-color:#D7E0E3; box-shadow:0 -4px 22px #29383f05; }
.mobile-nav button { color:#536269; }
.card,.stat,.app-install-link,dialog { background:#FFFFFF; border-color:#D7E0E3; }
.empty,pre,th { background:#EAF0F2; border-color:#D7E0E3; color:#536269; }
input,select,textarea { background:#FFFFFF; border-color:#94ADB8; color:#29383F; }
.check,input[type=checkbox],input[type=radio],input[type=range] { accent-color:#536269; }
input::placeholder,textarea::placeholder { color:#536269; opacity:.8; }
.text-button,a,.mark,.app-install-link { color:#536269; }
.status-note,.install-success { background:#EAF0F2; color:#29383F; border:1px solid #D7E0E3; }
.dot { background:#536269; }
.dot.pink { background:#FFFFFF; border:1.5px solid #536269; }
.chart line { stroke:#D7E0E3; }
.chart text { fill:#536269; }
.chart polyline { stroke:#536269; }
.chart polyline.pink { stroke:#536269; stroke-dasharray:5 4; }
.chart circle { fill:#536269; stroke:#FFFFFF; }
.chart circle.pink { fill:#FFFFFF; stroke:#536269; stroke-width:1.5; }
.notice,.connection-banner { background:#FFFFFF; color:#765517; border-color:#D7E0E3; }
.warning,.button.danger { background:#FFFFFF; color:#9D3E3E; border:1px solid #9D3E3E; }
.warning h2,.error { color:#9D3E3E; }
.app-update,#toast { background:#536269; color:#FFFFFF; }
.app-update button { color:#FFFFFF; }
#pwa-dialog .install-instructions.recommended { border-color:#94ADB8; }
button:focus-visible,a:focus-visible,:focus-visible { outline-color:#29383F; }
@media(max-width:700px) {
 .phone-account,.mobile-nav button.active { background:#EAF0F2; color:#536269; }
 .patient-app .stat,.patient-app .card { border-color:#D7E0E3; }
}

/* Strict application of VIORA v2: original outlined logo, Noto Sans, flat surfaces. */
:root { --radius:20px; --shadow:none; }
body { font:400 16px/24px 'Noto Sans',Arial,sans-serif; }
body,button,input,select,textarea,h1,h2,h3,.brand,.loading,.install-head h2 { font-family:'Noto Sans',Arial,sans-serif; }
h1,.heading h1,.patient-app .heading h1,.login-story h1,.install-page h1,.offline-panel h1 { font-size:28px; line-height:36px; font-weight:700; letter-spacing:0; }
h2,.hero h2,.patient-app .hero h2,.patient-app .card-head h2,.install-head h2 { font-size:20px; line-height:28px; font-weight:700; letter-spacing:0; }
h3 { font-size:18px; line-height:24px; font-weight:700; }
p,.sub,.patient-app .sub,.hero p,.patient-app .hero p,.day-content,.patient-app .day-content,.insight { font-size:16px; line-height:24px; }
small,.field>label,.field>span,.stat-title,.patient-app .stat-title,.stat-note,.patient-app .stat-note,.legend,.patient-app .legend,.eyebrow,.patient-app .heading .eyebrow,.day-content small,.insight small,.install-note { font-size:14px; line-height:20px; letter-spacing:0; }
.button,.patient-app .hero .button,.segmented button,.patient-app .text-button,.text-button { font-size:16px; line-height:24px; min-height:44px; font-weight:700; border-radius:12px; }
input,select,textarea { font-size:16px; line-height:24px; border-radius:12px; min-height:44px; }
.card,.stat,.patient-app .stat,.app-status,.install-instructions { border-radius:20px; box-shadow:none; }
.hero,.patient-app .hero { border-radius:24px; box-shadow:none; }
.brand,.phone-brand { display:block; font-size:0; line-height:0; padding:0; }
.brand-logo,.brand .brand-logo,.phone-brand>.brand-logo,.offline-panel>.brand-logo,.loading .brand-logo { display:block; width:260px; height:auto; max-width:100%; border-radius:0; margin:0; box-shadow:none; }
.phone-header { background:#EAF0F2; border-radius:20px; padding:8px; gap:8px; margin-bottom:24px; }
.phone-account { flex-shrink:0; background:#FFFFFF; border-color:#94ADB8; }
.phone-brand { flex:1; min-width:0; }
.hero-art,.orb { display:none; }
.app-update,.mobile-nav,.install-page .install-mark,.app-install-link,.button,.phone-account { box-shadow:none; }
.mobile-nav button.active { position:relative; }
.mobile-nav button.active:after { content:''; position:absolute; bottom:4px; width:16px; height:3px; background:#536269; border-radius:2px; }
.mobile-nav button { font-size:12px; line-height:16px; }
.mobile-nav .record-icon { box-shadow:none; }
.segmented button.selected:before { content:'✓ '; }
.chart polyline { stroke:#94ADB8; }
.chart circle { fill:#94ADB8; }
.chart polyline.pink { stroke:#94ADB8; }
.chart circle.pink { stroke:#94ADB8; fill:#FFFFFF; }
.chart text { fill:#29383F; font-size:12px; }
.dot { background:#94ADB8; }
.dot.pink { background:#FFFFFF; border-color:#94ADB8; }
.stat-value,.patient-app .stat-value { font-weight:700; letter-spacing:0; }
.footer,.patient-app .footer { font-size:12px; line-height:20px; }
.offline-panel>.brand-logo,.loading .brand-logo { margin-bottom:24px; }
.install-page>.brand-logo { margin-bottom:24px; }
@media(min-width:701px) {
 .layout { grid-template-columns:280px 1fr; }
 .sidebar { width:280px; padding:24px 16px; }
 .login-story h1 { margin-top:24px; }
}
@media(max-width:700px) {
 .patient-app .stat { padding:16px; }
 .patient-app .stat-title { min-height:40px; }
 .patient-app .day-content { min-width:0; }
 .patient-app .card { padding:24px 16px; }
 .patient-app .card-head { flex-wrap:wrap; }
 .patient-app .legend { flex-wrap:wrap; }
 .login-inner .brand { display:block; }
 .phone-header { padding-bottom:8px; }
 .phone-brand>.brand-logo { width:260px; }
}

.hero h2,.patient-app .hero h2,.install-head h2 { font-family:'Noto Sans',Arial,sans-serif; }
.heading .eyebrow:empty { display:none; }
.badge,.patient-app .card-head .badge,.check,.question legend,.app-install-link small,.install-instructions ol,.install-note,.chart text { font-size:14px; line-height:20px; }
.nav button,.app-status b,.report-block p,.install-page>p,.offline-panel p { font-size:16px; line-height:24px; }
.nav button { min-height:44px; }

/* Let long Russian labels wrap within their own card at phone text sizes. */
.main,.stat,.hero>div,.insight>div,.profile>div { min-width:0; }
.heading,.card,.stat,.segmented button,dialog,.profile { overflow-wrap:anywhere; }
@media(max-width:700px) {
 .patient-app .segmented,.stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .mobile-nav { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .mobile-nav button { min-width:0; padding-inline:0; }
 input:not([type=checkbox]):not([type=radio]),select,textarea { max-width:100%; min-width:0; }
}
@media(max-width:359px) {
 .stats,.patient-app .segmented { grid-template-columns:minmax(0,1fr); }
 .patient-app .stat-title { min-height:0; }
}

.viora-signature {
  display:block; width:320px; max-width:100%; text-align:left;
}
.viora-signature .brand-logo {
  display:block; width:100%; max-width:100%; height:auto; margin:0; border-radius:0;
}
.viora-signature .signature-copy {
  display:block; margin:-8.5% 0 0 27.4%; position:relative;
  font:400 14px/1.35 'Noto Sans',sans-serif; color:#536269;
  letter-spacing:0; text-transform:none; overflow-wrap:anywhere;
}
.signature-copy > span { display:block; }
.signature-copy .signature-credit { margin-top:3px; font-size:12px; }
.offline-panel > .viora-signature,.install-page > .viora-signature { margin-bottom:20px; }

/* Patient workspace: one daily action, followed by surveys and the chart. */
.today-entry {margin:0 0 16px;padding:18px 20px 12px;background:var(--viora-surface-subtle);border-radius:20px}
.today-entry h2 {margin:0;color:var(--ink)}
.today-entry p {margin:2px 0 12px;color:var(--muted)}
.today-entry>.text-button {margin:2px 0 0}
.diary-screening {padding:12px 0;border-bottom:1px solid var(--line)}
.diary-screening h3 {margin:0 0 6px;font-size:15px;line-height:22px;color:var(--muted)}
.diary-screening .button {text-align:left}
.patient-app .heading h1 {color:var(--ink)}
body:has(.patient-app) dialog .question legend,body:has(.patient-app) dialog .check {font-size:16px;line-height:24px}
body:has(.patient-app) dialog .check {min-height:44px}
body:has(.patient-app) dialog .check:has(:checked) {color:var(--ink);background:var(--lavender);border-radius:8px}
body:has(.patient-app) dialog fieldset {min-width:0}
.patient-app .chart-foot,.patient-app .day-date small {color:var(--muted)}
@media(max-width:700px){
 .patient-app .heading {flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:16px}
 .patient-app .heading>.button {display:inline-flex}
 .patient-app .phone-header {margin-bottom:16px}
 .patient-app .phone-brand .viora-signature {width:250px}
 .patient-app .card {padding:16px}
 .today-entry {padding:16px 16px 8px}
 .patient-app .segmented button,.patient-app .range-form .text-button {font-size:15px;line-height:21px;min-height:44px}
 .patient-app #report-form .segmented {grid-template-columns:repeat(3,minmax(0,1fr))}
 .patient-app .range-form {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .patient-app .range-form .field,.patient-app .range-form input {width:100%;min-width:0;max-width:100%}
 .patient-app .range-form button {white-space:normal}
 .patient-app .chart-foot {display:flex;flex-wrap:wrap;gap:4px 12px}
 .patient-app .text-button {text-align:start}
}
.survey-heading {display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:start;gap:8px}
.survey-heading h2 {margin:0}
.survey-close {width:44px;height:44px;border:1px solid var(--line);border-radius:12px;background:white;color:var(--ink);font:400 24px/1 var(--viora-font)}
#questionnaire-form {counter-reset:survey-item}
#questionnaire-form .question {counter-increment:survey-item}
#questionnaire-form legend::before {content:counter(survey-item) ". ";color:var(--muted)}
#questionnaire-form .check {margin:4px 0;padding:2px 4px}
@media(max-width:700px){
 .patient-app .heading>.button {font:700 15px/22px var(--viora-font);padding:9px 14px}
 .patient-app .chart text {font-size:19px}
}
/* Patient journey: keep survey navigation within reach and radio controls compact. */
#native-questionnaire .native-option input[type=radio] { width:20px; height:20px; min-height:20px; margin:0; padding:0; }
#native-questionnaire .native-option { min-height:50px; }
.report-answer { padding:10px 0; border-bottom:1px solid var(--line); }
.report-answer dt { font-weight:600; }
.report-answer dd { margin:5px 0 0; }
@media(max-width:700px) {
 #modal:has(#native-questionnaire) { max-height:calc(100dvh - 24px); }
 #native-questionnaire .native-actions { position:sticky; bottom:-18px; z-index:2; margin:12px -18px -18px; padding:12px 18px calc(12px + env(safe-area-inset-bottom,0px)); background:#fff; border-top:1px solid var(--line); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
 #native-questionnaire .native-actions .text-button { grid-column:1/-1; min-height:44px; text-align:center; }
 #native-questionnaire .native-actions .button { min-height:48px; white-space:normal; padding:9px 10px; font-size:15px; }
 #native-questionnaire .native-actions .button:first-child:nth-last-child(2) { grid-column:1/-1; }
 #back-fields .card-head .text-button { min-height:44px; }
 .report-scale-answers { overflow-wrap:anywhere; }
}
@media(max-width:700px) {
 #modal:has(#native-questionnaire) { overflow:hidden; }
 #native-questionnaire { height:calc(100dvh - 60px); display:flex; flex-direction:column; min-height:0; }
 #native-questionnaire>h2,#native-questionnaire>p,#native-questionnaire>details { flex-shrink:0; }
 #native-questionnaire-form { display:flex; flex-direction:column; flex:1; min-height:0; }
 #native-questionnaire .native-body { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding-right:2px; }
 #native-questionnaire .native-actions { position:static; flex-shrink:0; margin-top:8px; }
 #native-questionnaire #form-error { flex-shrink:0; margin:4px 0; }
}
.dialog-close { position:sticky; top:0; float:right; z-index:4; width:44px; height:44px; min-height:44px; margin:-6px -6px 6px 10px; padding:0; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--ink); font-size:26px; line-height:40px; }

/* The diary pairs a quiet background with a single prominent daily action. */
.patient-app {
 --patient-canvas:#F4F7F8;
 --patient-card:#FFFFFF;
 --patient-accent:#354F60;
 --patient-tint:#E6EEF1;
 --patient-type:-apple-system,BlinkMacSystemFont,system-ui,'Noto Sans',sans-serif;
 font-family:var(--patient-type);
}
.patient-app .main {background:var(--patient-canvas)}
.patient-app :is(button,input,select,textarea,h1,h2,h3) {font-family:var(--patient-type)}
.patient-app :is(h1,h2,h3) {color:var(--ink)}
.patient-app .heading h1 {font-size:2.125rem;line-height:1.15;letter-spacing:-.032em}
.patient-app .heading .sub {margin-top:4px}
.patient-app .button:not(.secondary):not(.soft):not(.danger) {background:var(--patient-accent);color:#fff}
.patient-app .button {white-space:normal}
.patient-app .card {background:var(--patient-card)}
.patient-app .text-button {font-weight:600}
.patient-app :is(button,a,input,select,textarea,summary):focus-visible {outline:2px solid var(--patient-accent);outline-offset:3px}
.patient-app .check {min-height:44px}
.today-entry {
 background:var(--patient-tint);
 border:1px solid #D7E3E8;
 padding:20px;
}
.today-entry h2 {font-size:1.375rem;line-height:1.24;letter-spacing:-.018em}
.today-entry p {margin:7px 0 15px}
.today-actions {display:grid;grid-template-columns:minmax(0,1fr);gap:8px;max-width:480px}
.today-actions .button {display:flex;align-items:center;justify-content:center;gap:8px;min-height:50px}
.today-actions svg {width:21px;height:21px;flex:none}
.today-tracking {display:flex;gap:12px;align-items:center;justify-content:space-between}
.today-tracking h2 {margin:0;font-size:1.0625rem;line-height:1.35}
.today-tracking p {margin:2px 0 0;color:var(--muted);font-size:.875rem;line-height:1.45}
.today-tracking .text-button {flex:none}
.patient-links {
 list-style:none;margin:0 0 16px;padding:0 14px;
 background:var(--patient-card);border:1px solid var(--line);border-radius:18px;
}
.patient-links li + li {border-top:1px solid var(--line)}
.patient-links button {
 display:grid;grid-template-columns:34px minmax(0,1fr) 10px;align-items:center;gap:11px;
 min-height:62px;width:100%;padding:9px 2px;
 background:transparent;color:var(--ink);text-align:start;border-radius:8px;
}
.patient-links button:active {background:var(--patient-tint)}
.patient-links b,.patient-links small {display:block;line-height:1.35;overflow-wrap:anywhere}
.patient-links b {font-size:1rem;font-weight:620}
.patient-links small {font-size:.875rem;color:var(--muted);margin-top:3px}
.patient-link-icon {display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--patient-tint);color:var(--patient-accent)}
.patient-link-icon svg {width:20px;height:20px}
.patient-link-chevron {width:7px;height:7px;border-right:1.5px solid var(--muted);border-top:1.5px solid var(--muted);transform:rotate(45deg)}
.symptom-options {display:grid;gap:6px;margin:10px 0 18px}
.symptom-options button {
 display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:start;
 min-height:48px;padding:9px 12px;border:1px solid var(--line);border-radius:12px;
 background:var(--patient-card);color:var(--ink);font-size:1rem;line-height:1.35;
}
.symptom-options button[aria-pressed="true"] {background:var(--patient-tint);border-color:#7993A0;font-weight:650}
.symptom-indicator {flex:none;width:20px;height:20px;border:1.5px solid #5C717C;border-radius:50%;display:grid;place-items:center}
[aria-pressed="true"] > .symptom-indicator {background:var(--patient-accent);border-color:var(--patient-accent);color:white}
[aria-pressed="true"] > .symptom-indicator::after {content:"";width:8px;height:4px;border:solid currentColor;border-width:0 0 2px 2px;transform:translateY(-1px) rotate(-45deg)}
#diary-form summary {min-height:44px;align-content:center}
@media(max-width:700px) {
 .patient-app .main {padding-top:calc(9px + var(--safe-top));padding-bottom:calc(92px + var(--safe-bottom))}
 .patient-app .phone-header {min-height:52px;margin:0 0 14px;padding:0;background:transparent}
 .patient-app .phone-brand {display:flex;align-items:center;gap:8px}
 .patient-app .phone-brand > img {width:28px;height:28px}
 .patient-app .phone-brand b {font:650 1rem/1.25 var(--patient-type);letter-spacing:0;color:var(--ink)}
 .patient-app .phone-account {width:44px;height:44px;background:var(--patient-card);border-color:var(--line);color:var(--patient-accent)}
 .patient-app .mobile-nav {
  min-height:64px;padding-top:5px;padding-bottom:calc(5px + var(--safe-bottom));
  background:#FAFCFD;border-top:1px solid var(--line);box-shadow:none;
 }
 .mobile-nav button {width:100%;min-height:50px;padding:4px 2px;gap:3px;font-size:.75rem;line-height:1.15;overflow-wrap:anywhere}
 .mobile-nav button.active {background:transparent;color:var(--patient-accent);font-weight:700}
 .mobile-nav button.active svg {stroke-width:2.4}
 .mobile-nav button svg {flex:none}
 .patient-app .field > label {font-size:.9375rem;line-height:1.35}
 .patient-app :is(input,select,textarea) {font-size:1rem}
 .patient-app .day-row .text-button {min-height:44px}
 .today-entry {padding:17px}
 .today-actions .button {width:100%}
 .today-tracking {padding:14px 16px}
 .today-tracking .text-button {position:static;margin:0}
 .diary-actions {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,auto);gap:8px}
 .diary-actions .text-button {grid-column:1/-1}
}

.consent-fields { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.consent-fields summary, .consent-fields .check { min-height: 44px; align-content: center; font-size: 16px; line-height: 1.4; }
.consent-fields summary { cursor: pointer; }
.consent-fields p { font-size: 15px; line-height: 1.5; }
