/* Final audit hardening layer: layout stability, readable Cyrillic, progressive forms, accessibility. */

:root {
  --audit-focus: rgba(244,202,112,.96);
  --audit-warning-bg: rgba(230,165,59,.075);
  --audit-danger: #ef8c82;
}

html { overflow-x: hidden; }
body, .app-root, .main, .page, .card, .rich-tab-panel, .rich-level-layout, .level-page-layout,
.settings-layout, .settings-left, .settings-right, .chart-grid, .dossier-main { min-width: 0; }

h1,h2,h3,h4,p,li,dd,dt,strong,span,label,button,a,td,th {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

button, input, textarea, select { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
[role="tab"]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--audit-focus);
  outline-offset: 2px;
}

/* Level stepper: locked states must not look clickable. */
.content-stepper .step { min-width: 0; line-height: 1.25; padding: 0 8px; }
.content-stepper .step span:last-child { min-width: 0; }
.content-stepper .step.locked-step,
.content-stepper .step:disabled {
  cursor: not-allowed;
  opacity: .46;
  color: var(--text-muted);
  background: rgba(255,255,255,.008);
}
.content-stepper .step.locked-step:hover,
.content-stepper .step:disabled:hover { color: var(--text-muted); background: rgba(255,255,255,.008); }
.content-stepper .step.locked-step svg,
.content-stepper .step:disabled svg { width: 13px; height: 13px; flex: 0 0 13px; }

/* Long practice forms: progressive disclosure rather than a 40–50 field wall. */
fieldset.rich-field { margin: 0; min-inline-size: 0; }
fieldset.rich-field > legend { width: 100%; padding: 0; }
.practice-total { margin: 4px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.practice-section {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: linear-gradient(145deg,rgba(12,18,23,.74),rgba(6,10,13,.72));
  overflow: clip;
}
.practice-section + .practice-section { margin-top: 10px; }
.practice-section > summary {
  min-height: 58px;
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 15px;
  user-select: none;
}
.practice-section > summary::-webkit-details-marker { display: none; }
.practice-section > summary::after { content: '+'; color: var(--gold-300); font: 500 22px/1 var(--serif); grid-column: 3; }
.practice-section[open] > summary::after { content: '−'; }
.practice-section > summary > span:first-child { min-width: 0; }
.practice-section > summary strong { display: block; color: var(--text-primary); font: 500 17px/1.24 var(--serif); }
.practice-section > summary small { display: block; color: var(--text-muted); font-size: 10px; margin-top: 3px; }
.practice-section-progress { color: var(--gold-300); font-size: 11px; white-space: nowrap; }
.practice-section[open] > summary { border-bottom: 1px solid var(--border-subtle); background: rgba(216,163,67,.025); }
.practice-section .rich-practice-grid { margin: 0; padding: 14px; }
.practice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.practice-head > * { min-width: 0; }

/* User input readability and validation. */
.rich-field label { font-size: 12px; line-height: 1.45; }
.rich-field textarea,.rich-field input,.rich-field select { font-size: 13px; line-height: 1.45; }
.rich-field textarea { min-height: 108px; }
.form-hint { display: block; color: var(--text-muted); font-size: 11px; line-height: 1.5; margin-top: 7px; }
.rich-field [aria-invalid="true"] { border-color: rgba(217,90,80,.88); box-shadow: 0 0 0 2px rgba(217,90,80,.08); }

/* Structured source data: readable instead of raw JSON. */
.structured-value { margin: 0; display: grid; gap: 8px; }
.structured-value > div {
  display: grid;
  grid-template-columns: minmax(130px,.36fr) minmax(0,1fr);
  gap: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.structured-value > div:last-child { border-bottom: 0; }
.structured-value dt { color: var(--gold-300); font-size: 10px; letter-spacing: .025em; }
.structured-value dd { margin: 0; min-width: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.structured-value .structured-value { margin-top: 4px; }
.structured-template { display: grid; gap: 8px; }

/* Local-analysis truthfulness and hierarchy. */
.analysis-mode-note {
  border: 1px solid rgba(230,165,59,.28);
  background: var(--audit-warning-bg);
  border-radius: 8px;
  padding: 10px 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #c9c4ba;
  font-size: 11px;
  line-height: 1.55;
}
.page-analysis-note { margin-bottom: 14px; }
.criterion-checklist { display: grid; gap: 8px; margin-top: 14px; }
.criterion-row { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 9px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.criterion-row:last-child { border-bottom: 0; }
.criterion-row svg { width: 17px; height: 17px; color: var(--gold-300); margin-top: 1px; }

/* Artifact rows: one semantic primary opener, action buttons remain independent. */
.artifact-row-open {
  width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit;
  text-align: left; display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; align-items: center; cursor: pointer;
}
.artifact-row-open:hover strong { color: var(--gold-300); }
.artifact-row-open strong, .artifact-row-open span { min-width: 0; }

/* Materials: source package remains in archive but is intentionally not learner-facing. */
.package-preservation-note,
.local-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 13px 15px;
  background: rgba(255,255,255,.012);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

/* Settings: local vs server capabilities are visibly separated. */
.settings-status-list { display: grid; }
.settings-status-list .select-row:last-child { border-bottom: 0; }
.local-data-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.local-data-card > div { min-width: 0; }
.btn-danger-outline { color: var(--audit-danger); border-color: rgba(217,90,80,.48); background: rgba(217,90,80,.025); }
.btn-danger-outline:hover { color: #ffc0ba; border-color: rgba(217,90,80,.78); background: rgba(217,90,80,.07); }

/* Analytics with 11 columns must remain legible without columns collapsing into each other. */
.analytics-bars { gap: 6px; justify-content: stretch; overflow: hidden; }
.analytics-bars .bar-col { width: auto; min-width: 0; flex: 1 1 0; }
.analytics-bars .bar { min-width: 8px; }
.analytics-bars .bar span { font-size: 9px; }
.analytics-bars .bar-label { font-size: 9px; }

/* Dense copy receives a predictable reading measure. */
.text-card p,.text-card li,.lead-copy,.analysis-block p,.diagnosis-block,.media-card-rich > p,.priority-copy { max-width: 78ch; }
.text-card p { font-size: 13px; }
.text-card ul,.lesson-extra ul { font-size: 12px; }

/* Explicit disabled state; no false affordance. */
.btn:disabled,.icon-btn:disabled,[role="tab"]:disabled { opacity: .42; cursor: not-allowed; transform: none!important; box-shadow: none; }
.btn:disabled:hover,.icon-btn:disabled:hover { transform: none; }

/* User motion preference in addition to OS reduced-motion. */
.reduce-motion-user *,
.reduce-motion-user *::before,
.reduce-motion-user *::after {
  scroll-behavior: auto!important;
  animation-duration: .001ms!important;
  animation-iteration-count: 1!important;
  transition-duration: .001ms!important;
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto!important; animation-duration: .001ms!important; animation-iteration-count: 1!important; transition-duration: .001ms!important; }
}

@media (max-width: 1180px) {
  .content-stepper { grid-template-columns: repeat(4,minmax(145px,1fr)); overflow-x: auto; scrollbar-width: thin; }
  .content-stepper .step { min-width: 145px; min-height: 62px; }
  .settings-layout { grid-template-columns: minmax(0,1fr) minmax(300px,.72fr); }
}

@media (max-width: 980px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-right { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-right > *:first-child { grid-column: 1/-1; }
  .practice-head { display: grid; }
}

@media (max-width: 680px) {
  .main { padding-left: max(14px,env(safe-area-inset-left)); padding-right: max(14px,env(safe-area-inset-right)); padding-bottom: max(18px,env(safe-area-inset-bottom)); }
  .page-title h1 { font-size: clamp(28px,9vw,36px); line-height: 1.06; }
  .page-title p,.page-subtitle,.lead-copy { font-size: 15px; line-height: 1.62; }
  .source-scene-card h2,.lesson-overview h2,.rich-practice-card h2,.materials-intro h2,.ai-level-card h2,.artifact-builder h2,.case-card h2,.quiz-card h2,.simulation-card h2 { font-size: clamp(23px,7vw,29px); }
  .text-card h3 { padding-right: 36px; font-size: 21px; }
  .text-card p,.text-card li,.lesson-extra ul,.analysis-block p,.diagnosis-block,.criterion-row,.priority-copy { font-size: 14px; line-height: 1.62; }
  .rich-field label { font-size: 14px; }
  .rich-field textarea,.rich-field input,.rich-field select { font-size: 16px; min-height: 46px; }
  .rich-field textarea { min-height: 120px; }
  .check-choice { min-height: 44px; font-size: 14px; }
  .btn,.icon-btn,.filter-chip,.export-option,.toggle { min-height: 44px; }
  .btn { height: auto; padding-top: 10px; padding-bottom: 10px; white-space: normal; text-align: center; line-height: 1.25; }
  .content-stepper { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 3px; }
  .content-stepper .step { min-width: 126px; min-height: 58px; scroll-snap-align: start; padding: 0 9px; }
  .practice-section > summary { grid-template-columns: minmax(0,1fr) auto; gap: 9px; padding: 12px; }
  .practice-section > summary::after { display: none; }
  .practice-section-progress { font-size: 10px; }
  .practice-section .rich-practice-grid { padding: 10px; }
  .structured-value > div { grid-template-columns: 1fr; gap: 4px; }
  .structured-value dt { font-size: 11px; }
  .structured-value dd { font-size: 14px; }
  .analysis-mode-note { display: grid; font-size: 13px; }
  .settings-right { grid-template-columns: 1fr; }
  .settings-right > *:first-child { grid-column: auto; }
  .local-data-card { display: grid; }
  .local-data-card .btn { width: 100%; }
  .setting-row { grid-template-columns: minmax(0,1fr) auto; row-gap: 7px; padding: 10px 0; }
  .setting-label { min-width: 0; font-size: 13px; }
  .setting-value { grid-column: 1/-1; font-size: 14px; line-height: 1.45; }
  .select-row { gap: 12px; min-height: 52px; font-size: 13px; }
  .select-row > * { min-width: 0; }
  .select-row strong { text-align: right; overflow-wrap: anywhere; }
  .analytics-bars { gap: 3px; padding-left: 2px; padding-right: 2px; }
  .analytics-bars .bar span { display: none; }
  .analytics-bars .bar-label { font-size: 8px; }
}

@media (max-width: 390px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .card { padding-left: 14px; padding-right: 14px; }
  .content-stepper .step { min-width: 116px; }
  .practice-section > summary strong { font-size: 16px; }
  .settings-avatar .btn,.header-actions .btn { width: 100%; }
}

/* Standard desktop / laptop: keep level names readable before the tablet breakpoint. */
@media (max-width: 1500px) and (min-width: 981px) {
  .levels-layout { grid-template-columns: minmax(0,1fr) 300px; }
  .level-row { grid-template-columns: 50px minmax(220px,1fr) 122px 94px 30px; }
  .level-row .row-artifact { display: none; }
  .level-row-title { font-size: 18px; line-height: 1.16; }
  .row-status,.row-time { padding-left: 14px; }
}
.rich-field.has-error { border-color: rgba(217,90,80,.52); background: rgba(217,90,80,.025); }
.field-error { margin: 7px 0 0; color: #f1a099; font-size: 11px; line-height: 1.45; }
@media (max-width:680px){ .field-error { font-size: 13px; } }

/* Dynamic user content must be allowed to grow beyond the fixed-height reference demo. */
@media (min-width: 1281px) {
  .dashboard-bottom > .card { height: auto; min-height: 282px; }
  .dashboard-bottom .analysis-body { height: auto; min-height: 195px; }
  .dashboard-bottom .diagnosis-block { font-size: 11.5px; line-height: 1.52; }
  .dashboard-bottom .diagnosis-block h4 { font-size: 16px; line-height: 1.25; }
}

/* --------------------------------------------------------------------------
   Readability + icon-system + route-slider refinement · 2026-08-07
   Goal: slightly larger type, stronger professional iconography, and a real
   horizontal 11-level carousel without changing the Premium Noir identity.
   -------------------------------------------------------------------------- */

/* A modest readability lift across the main product surfaces. */
.nav-item { min-height: 52px; gap: 13px; }
.nav-label { font-size: 15px; line-height: 1.25; letter-spacing: .005em; }
.page-title p { font-size: 14px; line-height: 1.58; }
.card-title { font-size: 23px; line-height: 1.17; }
.card-subtitle { font-size: 13px; line-height: 1.5; }
.eyebrow { font-size: 13px; line-height: 1.35; }
.route-copy h2 { font-size: 30px; line-height: 1.08; }
.chip { font-size: 12px; line-height: 1.25; }
.progress-meta { font-size: 14px; }
.progress-note { font-size: 12px; line-height: 1.58; max-width: 265px; }
.legend { font-size: 12px; line-height: 1.4; }
.link-gold { font-size: 13px; }
.btn { font-size: 14px; }
.btn-sm { font-size: 13px; }
.artifact-small strong { font-size: 12px; line-height: 1.3; }
.artifact-small span { font-size: 10px; line-height: 1.3; }
.dossier-card p { font-size: 12.5px; line-height: 1.62; }
.metric-label { font-size: 13px; }
.metric-change { font-size: 12px; }
.current-level-card p,
.analysis-block p,
.detail-section p,
.detail-section li,
.mentor-section p,
.mentor-section li { font-size: 12.5px; line-height: 1.62; }
.level-main h3 { font-size: 20px; line-height: 1.14; }
.row-status,.row-time,.row-artifact { font-size: 12px; }
.level-meta-block span { font-size: 11px; }
.level-meta-block strong { font-size: 14px; }

/* One coherent icon language: larger optical size, rounded strokes, subtle
   containing surfaces instead of thin glyphs floating in empty space. */
svg:not(.radar):not(.chart-svg) { stroke-width: 1.75; }
.nav-icon {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255,255,255,.008);
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.nav-icon svg { width: 23px; height: 23px; stroke-width: 1.75; }
.nav-item:hover .nav-icon { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.025); transform: translateY(-1px); }
.nav-item.active .nav-icon {
  color: var(--gold-300);
  border-color: rgba(216,163,67,.28);
  background: linear-gradient(145deg,rgba(216,163,67,.12),rgba(216,163,67,.025));
  box-shadow: inset 0 1px 0 rgba(255,232,168,.08);
}
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.8; }
.btn svg { width: 19px; height: 19px; stroke-width: 1.8; }
.metric-icon { width: 54px; height: 54px; }
.metric-icon svg { width: 28px; height: 28px; stroke-width: 1.65; }
.doc-icon { width: 35px; height: 35px; border-radius: 8px; }
.doc-icon svg { width: 20px; height: 20px; }
.level-main .level-symbol { width: 50px; height: 50px; border-radius: 9px; }
.level-main .level-symbol svg { width: 29px; height: 29px; }

/* Real horizontal 11-level slider on the dashboard. */
.level-carousel { padding: 20px 20px 17px; }
.level-carousel-head { align-items: center; margin-bottom: 14px; }
.level-carousel-head > div:first-child { min-width: 0; }
.level-carousel-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.slider-controls { display: flex; gap: 7px; }
.slider-control { width: 38px; height: 38px; min-height: 38px; border-color: rgba(216,163,67,.24); }
.slider-control:hover { background: rgba(216,163,67,.055); }
.slider-control:disabled { opacity: .3; border-color: var(--border); }
.level-slider-shell { min-width: 0; }
.level-cards {
  display: flex;
  grid-template-columns: none;
  gap: 13px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  padding: 2px 2px 9px;
  outline: none;
}
.level-cards::-webkit-scrollbar { display: none; }
.level-cards:focus-visible { box-shadow: 0 0 0 2px rgba(244,202,112,.28); border-radius: 8px; }
.level-mini {
  flex: 0 0 clamp(172px,15.2vw,196px);
  min-width: 172px;
  min-height: 174px;
  padding: 12px 12px 11px;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}
.level-mini .num { font-size: 16px; }
.level-mini .level-symbol {
  width: 49px;
  height: 49px;
  margin: 7px 0 8px;
  border: 1px solid rgba(216,163,67,.22);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 35%,rgba(216,163,67,.08),rgba(216,163,67,.018) 66%,transparent);
  box-shadow: inset 0 1px 0 rgba(255,232,168,.05);
}
.level-mini .level-symbol svg { width: 30px; height: 30px; stroke-width: 1.65; }
.level-mini h4 { min-height: 39px; font-size: 16.5px; line-height: 1.14; }
.level-mini .status-text { font-size: 11.5px; line-height: 1.3; }
.level-mini .status-text svg { width: 14px; height: 14px; }
.level-mini .mini-action { min-height: 30px; height: 30px; font-size: 11.5px; border-radius: 6px; }
.level-mini.current .level-symbol {
  border-color: rgba(244,202,112,.62);
  background: radial-gradient(circle at 50% 32%,rgba(244,202,112,.16),rgba(216,163,67,.035) 70%);
}
.level-mini.locked .level-symbol { color: #767b7e; border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.012); }
.route-slider-track {
  position: relative;
  height: 3px;
  margin: 2px 4px 0;
  border-radius: 99px;
  background: rgba(255,255,255,.065);
  overflow: hidden;
}
.route-slider-track > span {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 14%;
  border-radius: inherit;
  background: linear-gradient(90deg,var(--gold-700),var(--gold-300));
  box-shadow: 0 0 14px rgba(216,163,67,.18);
  transition: width .18s ease, transform .12s linear;
}

@media (min-width:1281px) {
  .level-carousel { padding: 18px 20px 17px; }
  .level-mini { min-height: 168px; padding: 11px 12px; }
  .level-mini .level-symbol { margin: 6px 0 7px; }
  .level-mini h4 { min-height: 38px; }
}

@media (max-width:1280px) {
  .nav-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .nav-icon svg { width: 24px; height: 24px; }
  .level-mini { flex-basis: 184px; }
}

@media (max-width:680px) {
  .page-title p { font-size: 15.5px; }
  .card-title { font-size: 24px; }
  .card-subtitle { font-size: 14px; }
  .route-copy h2 { font-size: 30px; }
  .chip { font-size: 12.5px; }
  .progress-note,.legend { font-size: 13px; }
  .level-carousel-head { display: grid; gap: 12px; }
  .level-carousel-actions { width: 100%; justify-content: space-between; }
  .slider-control { width: 44px; height: 44px; min-height: 44px; }
  .level-mini { flex-basis: 184px; min-width: 184px; min-height: 180px; }
  .level-mini h4 { font-size: 17px; }
  .level-mini .status-text,.level-mini .mini-action { font-size: 12px; }
  .nav-label { font-size: 15.5px; }
}

/* --------------------------------------------------------------------------
   Final dashboard readability calibration · 10 levels + prologue
   Slightly larger upper-block typography without changing the reference grid.
   -------------------------------------------------------------------------- */
.page-title p { font-size: 15px; line-height: 1.62; }
.dashboard-top .eyebrow { font-size: 14px; line-height: 1.4; margin-bottom: 13px; }
.dashboard-top .route-copy h2 { font-size: 32px; line-height: 1.08; margin-bottom: 16px; }
.dashboard-top .chip { font-size: 13px; line-height: 1.3; padding: 8px 12px; }
.dashboard-top .link-gold { font-size: 14px; line-height: 1.35; }
.dashboard-top .progress-copy > .gold { font-size: 15px; line-height: 1.35; font-weight: 600; }
.dashboard-top .progress-meta { font-size: 15px; line-height: 1.45; margin-top: 17px; }
.dashboard-top .progress-note { font-size: 13px; line-height: 1.6; max-width: 290px; }
.dashboard-top .legend { font-size: 13px; line-height: 1.45; }
.level-carousel .card-subtitle { font-size: 14px; line-height: 1.5; }
.level-mini.prologue-mini .num { color: var(--gold-300); font-size: 12px; letter-spacing: .02em; }

@media (max-width: 1280px) and (min-width: 981px) {
  .dashboard-top .route-copy h2 { font-size: 30px; }
  .dashboard-top .chip { font-size: 12.5px; }
  .dashboard-top .progress-note { font-size: 12.5px; }
}

@media (max-width: 680px) {
  .page-title p { font-size: 16px; }
  .dashboard-top .eyebrow { font-size: 14px; }
  .dashboard-top .route-copy h2 { font-size: 31px; }
  .dashboard-top .progress-meta { font-size: 15.5px; }
  .dashboard-top .progress-note,.dashboard-top .legend { font-size: 13.5px; }
  .level-carousel .card-subtitle { font-size: 14.5px; }
}

/* --------------------------------------------------------------------------
   Brand lockup + sidebar readability refinement · 2026-08-07
   Uses the supplied LWay monogram as the visual mark while keeping the
   application name "СИСТЕМА ВЛИЯНИЯ" and a readable simulation descriptor.
   -------------------------------------------------------------------------- */
.logo.brand-lockup {
  min-height: 76px;
  padding: 0 6px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: visible;
}
.brand-mark {
  width: 55px;
  height: 55px;
  flex: 0 0 55px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 2px 8px rgba(216,163,67,.09));
}
.brand-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: center;
}
.brand-title {
  color: var(--text-primary);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: .025em;
  white-space: nowrap;
}
.brand-subtitle {
  color: #9b9b97;
  font-family: var(--sans);
  font-size: 10.5px;
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: normal;
  max-width: 174px;
}

/* Sidebar menu: larger optical size while keeping information density stable. */
.nav { gap: 6px; }
.nav-item {
  min-height: 55px;
  height: 55px;
  gap: 14px;
  padding-inline: 13px;
}
.nav-label {
  font-size: 16.5px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: .004em;
}
.nav-icon {
  width: 35px;
  height: 35px;
  flex-basis: 35px;
  border-radius: 9px;
}
.nav-icon svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.8;
}

.mobile-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.mobile-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.mobile-brand span {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Collapsed laptop sidebar keeps only the mark; full lockup returns in drawer. */
@media (max-width:1280px) and (min-width:981px) {
  .logo.brand-lockup {
    min-height: 72px;
    padding-inline: 4px;
    justify-content: center;
  }
  .brand-mark { width: 54px; height: 54px; flex-basis: 54px; }
  .brand-copy { display: none; }
  .nav-item { min-height: 55px; height: 55px; padding: 0; justify-content: center; }
}

@media (max-width:980px) {
  .logo.brand-lockup {
    min-height: 78px;
    padding: 0 6px 18px;
    justify-content: flex-start;
  }
  .brand-copy { display: grid; }
  .brand-mark { width: 55px; height: 55px; flex-basis: 55px; }
  .nav-item { min-height: 56px; height: 56px; padding: 0 14px; justify-content: flex-start; }
  .nav-label { font-size: 17px; }
}

@media (max-width:680px) {
  .mobile-brand span { font-size: 18px; }
  .brand-title { font-size: 18.5px; }
  .brand-subtitle { font-size: 10.5px; line-height: 1.3; }
}

/* --------------------------------------------------------------------------
   Settings readability + brand containment refinement · 2026-08-10
   Addresses the real Settings screen: body copy was too small (9–11px) and
   the sidebar brand lockup could exceed its available width on desktop.
   -------------------------------------------------------------------------- */

/* Give the full desktop lockup enough measured space without affecting the
   compact laptop rail that activates at 1280px and below. */
@media (min-width:1281px) {
  :root { --sidebar: 300px; }
}

.logo.brand-lockup {
  width: 100%;
  max-width: 100%;
  min-height: 78px;
  padding: 0 2px 18px;
  gap: 9px;
  overflow: hidden;
}
.brand-mark {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
}
.brand-copy {
  flex: 1 1 auto;
  width: auto;
  max-width: calc(100% - 59px);
  overflow: hidden;
}
.brand-title {
  width: 100%;
  max-width: 100%;
  font-size: 17px;
  line-height: 1.08;
  letter-spacing: .012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.brand-subtitle {
  width: 100%;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.32;
  letter-spacing: .035em;
  overflow-wrap: anywhere;
}

/* Settings is an information-heavy control surface. The original reference
   density used 9–11px UI labels; this pass raises the reading floor while
   preserving the Premium Noir hierarchy and keeping secondary text secondary. */
.settings-layout {
  font-size: 14px;
  line-height: 1.5;
}
.settings-layout .card {
  padding: 22px;
}
.settings-layout .card-title {
  font-size: 24px;
  line-height: 1.16;
}
.profile-settings {
  grid-template-columns: minmax(0,1fr) 180px;
  gap: 24px;
}
.setting-row {
  min-height: 52px;
  grid-template-columns: minmax(150px,190px) minmax(0,1fr) auto;
  gap: 16px;
  padding: 8px 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.setting-label {
  gap: 11px;
  font-size: 13.5px;
  line-height: 1.4;
}
.setting-label svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}
.setting-value {
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.settings-avatar .form-hint {
  max-width: 180px;
  text-align: center;
}
.select-row {
  min-height: 50px;
  gap: 18px;
  padding: 10px 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.select-row > span,
.select-row > strong {
  min-width: 0;
}
.select-row strong {
  font-size: 13.5px;
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
}
.settings-layout .form-hint {
  font-size: 12.5px;
  line-height: 1.55;
}
.settings-status-copy,
.local-data-card .secondary {
  font-size: 13.5px;
  line-height: 1.62;
}
.plan-current {
  font-size: 12.5px;
  line-height: 1.4;
}
.plan-name {
  font-size: 29px;
  line-height: 1.1;
}
.plan-list {
  gap: 12px;
}
.plan-list div {
  font-size: 12.75px;
  line-height: 1.5;
}
.security-row {
  min-height: 58px;
  padding: 12px 0;
  gap: 16px;
  font-size: 13px;
  line-height: 1.4;
}
.security-row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.security-row svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}
.security-row > span:last-child {
  max-width: 180px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.settings-layout .integration-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}
.settings-layout .integration {
  min-height: 94px;
  height: auto;
  padding: 13px;
  font-size: 13px;
  line-height: 1.35;
}
.settings-layout .integration strong {
  margin-bottom: 12px;
  font-size: 13.5px;
  line-height: 1.35;
}
.settings-layout .integration span {
  font-size: 11.5px;
  line-height: 1.35;
}
.settings-layout .link-gold {
  font-size: 13.5px;
}
.settings-layout .btn-sm {
  min-height: 38px;
  font-size: 13px;
}

@media (max-width:1280px) and (min-width:981px) {
  .brand-mark { width: 54px; height: 54px; flex-basis: 54px; }
}

@media (max-width:980px) {
  .logo.brand-lockup {
    padding-inline: 2px;
    gap: 9px;
  }
  .brand-mark { width: 50px; height: 50px; flex-basis: 50px; }
  .brand-copy { max-width: calc(100% - 59px); }
  .brand-title { font-size: 17px; }
  .brand-subtitle { font-size: 11px; }
  .settings-layout .card { padding: 20px; }
}

@media (max-width:680px) {
  .brand-mark { width: 48px; height: 48px; flex-basis: 48px; }
  .brand-copy { max-width: calc(100% - 57px); }
  .brand-title { font-size: 16.5px; letter-spacing: .008em; }
  .brand-subtitle { font-size: 10.8px; line-height: 1.3; }

  .settings-layout { font-size: 15px; }
  .settings-layout .card { padding: 18px; }
  .settings-layout .card-title { font-size: 23px; }
  .setting-row {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "label action" "value value";
    gap: 8px 12px;
    padding: 12px 0;
    font-size: 14px;
  }
  .setting-row .setting-label { grid-area: label; font-size: 14px; }
  .setting-row .setting-value { grid-area: value; font-size: 15px; }
  .setting-row .btn { grid-area: action; }
  .select-row { min-height: 56px; font-size: 14px; }
  .select-row strong { font-size: 14px; }
  .settings-layout .form-hint { font-size: 13px; }
  .settings-status-copy,
  .local-data-card .secondary { font-size: 14px; }
  .plan-list div { font-size: 13.5px; }
  .security-row { font-size: 13.5px; }
  .security-row > span:last-child { font-size: 13px; max-width: 48%; }
  .settings-layout .integration strong { font-size: 14px; }
  .settings-layout .integration span { font-size: 12px; }
}

@media (max-width:390px) {
  .settings-layout .integration-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Settings profile overflow + brand containment hotfix · 2026-08-10
   Fixes the observed 1365px laptop/desktop case where "Не указано" collapsed
   into one character per line and the sidebar brand title was clipped.
   -------------------------------------------------------------------------- */

/* Brand lockup: keep both product names contained inside the sidebar. */
.logo.brand-lockup {
  box-sizing: border-box;
  padding-inline: 0;
  gap: 8px;
}
.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}
.brand-copy {
  min-width: 0;
  max-width: calc(100% - 54px);
  overflow: visible;
}
.brand-title {
  font-size: 15.5px;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
}
.brand-subtitle {
  max-width: 100%;
  font-size: 10.5px;
  line-height: 1.28;
  letter-spacing: .025em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

/* Settings values must never collapse into a one-character column. */
.setting-value {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

/* At the real Windows/Edge viewport seen in the audit (roughly 1281–1600px),
   the outer settings split leaves too little room for a three-column profile
   row plus avatar. Reflow each row into a deliberate two-line grid instead. */
@media (min-width:1281px) and (max-width:1600px) {
  .settings-layout {
    grid-template-columns: minmax(0,1.16fr) minmax(360px,.84fr);
  }
  .profile-settings {
    grid-template-columns: minmax(0,1fr) 138px;
    gap: 18px;
  }
  .settings-avatar .avatar {
    width: 92px;
    height: 92px;
    flex-basis: 92px;
  }
  .settings-avatar .btn {
    width: 100%;
    max-width: 138px;
    white-space: normal;
    line-height: 1.2;
  }
  .settings-avatar .form-hint {
    max-width: 138px;
    font-size: 11.5px;
    line-height: 1.45;
  }
  .setting-row {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas:
      "label action"
      "value value";
    gap: 7px 12px;
    align-items: center;
    padding: 10px 0 12px;
  }
  .setting-row .setting-label {
    grid-area: label;
    min-width: 0;
  }
  .setting-row .setting-value {
    grid-area: value;
    width: 100%;
    min-width: 100px;
    padding-left: 30px;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: break-word;
  }
  .setting-row .btn {
    grid-area: action;
    min-width: 88px;
  }
}

/* Full desktop still uses one-row profile fields, but protects the value cell. */
@media (min-width:1601px) {
  .setting-row {
    grid-template-columns: minmax(135px,165px) minmax(120px,1fr) auto;
  }
  .setting-value { min-width: 120px; }
}

/* Drawer/mobile brand: allow a graceful two-line fallback instead of clipping. */
@media (max-width:980px) {
  .brand-title {
    font-size: 15.5px;
    white-space: normal;
    overflow-wrap: normal;
    line-height: 1.05;
  }
}

