
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #e9decf; color: var(--text); font-family: var(--font); }
body { -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
img[hidden], [hidden] { display: none !important; }
svg { display: block; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 28px; height: 28px; }

.app-stage { min-height: 100dvh; display: grid; place-items: start center; padding: 0; }
.app-shell { width: min(100%, 430px); min-height: 100dvh; background: var(--bg); position: relative; overflow: hidden; box-shadow: 0 18px 60px rgba(55, 38, 22, .12); }
.app-shell::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .34; background: radial-gradient(circle at 12% 7%, rgba(255,255,255,.74), transparent 22%), radial-gradient(circle at 88% 18%, rgba(255,255,255,.38), transparent 26%), repeating-linear-gradient(0deg, rgba(107,80,52,.018) 0 1px, transparent 1px 4px); }
.app-screen { position: relative; z-index: 1; width: 100%; min-width: 0; min-height: 100dvh; padding: calc(16px + var(--safe-top)) 16px calc(92px + var(--safe-bottom)); display: none; overflow-x: hidden; }
.app-screen.is-active { display: block; }
.screen-stack { display: grid; gap: 12px; min-width: 0; max-width: 100%; }
.screen-stack > * { min-width: 0; max-width: 100%; }

.app-header { min-height: 46px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.brand-kicker { margin: 0 0 2px; color: var(--terracotta); font-size: 8.5px; line-height: 1; font-weight: 820; letter-spacing: .055em; text-transform: uppercase; }
.app-header__title { margin: 0; font-size: 1.375rem; line-height: 1.08; font-weight: 880; letter-spacing: -.035em; overflow-wrap: break-word; hyphens: auto; }
.app-header__meta { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.app-header__center { align-self: center; text-align: center; flex: 1; }
.app-header__center .app-header__title { font-size: 1rem; }
.header-actions { display: flex; gap: 8px; }
.icon-button { border: 1px solid var(--line); background: rgba(251,246,238,.82); color: var(--text); width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 10px rgba(72,50,28,.04); text-decoration: none; }
.icon-button.is-active { color: var(--terracotta); border-color: rgba(185,112,84,.35); background: #fff7ef; }
.icon-button--ghost { background: transparent; border-color: transparent; box-shadow: none; }

.card { background: rgba(251,246,238,.96); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.section-title { margin: 0; font-size: 15px; line-height: 1.2; font-weight: 820; letter-spacing: -.018em; }
.section-copy { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

.hero-card { display: grid; grid-template-columns: minmax(92px,118px) minmax(0, 1fr); gap: 14px; min-height: 254px; padding: 14px; border-radius: var(--radius-xl); background: linear-gradient(140deg, rgba(251,246,238,.98), rgba(247,234,219,.96)); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; right: -22px; bottom: -35px; width: 120px; height: 120px; border: 1px solid rgba(185,112,84,.09); border-radius: 50%; box-shadow: 0 0 0 18px rgba(185,112,84,.025), 0 0 0 36px rgba(185,112,84,.018); }
.mood-frame { height: 154px; align-self: start; display: grid; place-items: center; border-radius: 20px; background: #efe2d0; padding: 6px; overflow: hidden; box-shadow: 0 10px 18px rgba(72,50,28,.09); }
.mood-frame img:not([src]) { visibility: hidden; }
.mood-frame img { width: 100%; height: 100%; object-fit: contain; border-radius: 15px; }
.hero-copy { min-width: 0; position: relative; z-index: 1; }
.state-chip, .chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 760; line-height: 1; border: 1px solid rgba(185,112,84,.15); background: #f2dfcd; color: var(--text); }
.hero-title { margin: 10px 0 7px; font-size: 1.25rem; line-height: 1.16; font-weight: 860; letter-spacing: -.035em; overflow-wrap: break-word; hyphens: auto; }
.hero-summary { margin: 0; color: #52627d; font-size: .8125rem; line-height: 1.42; overflow-wrap: break-word; hyphens: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { border: 0; border-radius: 14px; min-height: 38px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-weight: 800; font-size: 12px; text-decoration: none; }
.btn--primary { background: var(--terracotta); color: white; box-shadow: 0 7px 15px rgba(185,112,84,.24); }
.btn--secondary { background: rgba(255,255,255,.54); border: 1px solid var(--line); color: var(--text); }
.btn--text { background: transparent; color: var(--text); padding-inline: 4px; }

.indicator-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.indicator-card { min-height: 88px; min-width: 0; padding: 12px; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: center; }
.indicator-card > div:last-child { min-width: 0; }
.indicator-icon { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; align-self: center; justify-self: center; }
.indicator-card[data-tone="sage"] .indicator-icon { color: #6f8664; background: #dbe2d5; }
.indicator-card[data-tone="gold"] .indicator-icon { color: #bd8f43; background: #f2e3c6; }
.indicator-card[data-tone="blush"] .indicator-icon { color: #b9796b; background: #edd6d0; }
.indicator-card[data-tone="blue"] .indicator-icon { color: #6d8797; background: #dce5e9; }
.indicator-label { color: var(--muted); font-size: 10px; line-height: 1.1; font-weight: 700; }
.indicator-state { margin-top: 3px; font-size: 1rem; line-height: 1.12; font-weight: 850; letter-spacing: -.02em; overflow-wrap: break-word; hyphens: auto; }
.indicator-delta { margin-top: 4px; color: #5f6c82; font-size: 9.7px; line-height: 1.25; }

.state-card { padding: 14px; }
.state-wave-layout { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center; }
.state-wave-visual { display: none; }
.state-flower { width: 88px; height: 88px; position: relative; margin: 2px auto; filter: drop-shadow(0 7px 12px rgba(86,62,38,.09)); }
.state-flower .petal--pulse { --petal-color: rgba(215,140,130,.75); transform: rotate(0.00deg) scale(var(--pulse-petal,.82)); }
.state-flower .petal--breath { --petal-color: rgba(150,178,190,.75); transform: rotate(51.43deg) scale(var(--breath-petal,.82)); }
.state-flower .petal--skin { --petal-color: rgba(214,186,150,.75); transform: rotate(102.86deg) scale(var(--skin-petal,.82)); }
.state-flower .petal--voice { --petal-color: rgba(168,158,196,.75); transform: rotate(154.29deg) scale(var(--voice-petal,.82)); }
.state-flower .petal--tempo { --petal-color: rgba(150,175,140,.75); transform: rotate(205.71deg) scale(var(--tempo-petal,.82)); }
.state-flower .petal--pauses { --petal-color: rgba(196,170,160,.75); transform: rotate(257.14deg) scale(var(--pauses-petal,.82)); }
.state-flower .petal--expression { --petal-color: rgba(186,166,140,.75); transform: rotate(308.57deg) scale(var(--expression-petal,.82)); }
.state-flower .petal { position: absolute; left: 34px; top: 7px; width: 22px; height: 36px; border-radius: 75% 75% 62% 62%; transform-origin: 11px 37px; opacity: var(--petal-opacity,.72); background: var(--petal-color,#d8c7b6); border: 1px solid rgba(255,255,255,.56); }
.state-flower b { position: absolute; left: 35px; top: 35px; width: 19px; height: 19px; border-radius: 50%; background: #f7ead8; border: 1px solid rgba(185,112,84,.22); box-shadow: 0 2px 8px rgba(74,51,30,.09); }
.wave-legend { display: flex; flex-wrap: wrap; gap: 7px 10px; margin-bottom: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.wave-svg { width: 100%; height: auto; overflow: visible; }
.chart-shell .wave-svg > path:nth-of-type(1) { fill: rgba(215,180,122,.30); stroke: none; }
.chart-shell .wave-svg > path:nth-of-type(2) { fill: rgba(135,153,119,.24); stroke: none; }
.chart-shell .wave-svg > path:nth-of-type(3) { fill: rgba(215,167,155,.22); stroke: none; }
.chart-shell .wave-svg > path:nth-of-type(4) { fill: rgba(142,164,178,.20); stroke: none; }
.chart-shell .wave-svg > path:nth-of-type(5) { fill: none; stroke: #c8984b; stroke-width: 2; }
.chart-shell .wave-svg > path:nth-of-type(6) { fill: none; stroke: #7f9574; stroke-width: 2; }
.chart-shell .wave-svg > path:nth-of-type(7) { fill: none; stroke: #c78375; stroke-width: 2; }
.chart-shell .wave-svg > path:nth-of-type(8) { fill: none; stroke: #7893a3; stroke-width: 2; }
.state-summary { padding-left: 10px; border-left: 1px solid var(--line); color: #52627d; font-size: 10.5px; line-height: 1.42; }
.state-summary strong { display: block; color: var(--text); font-size: 12px; line-height: 1.2; margin-bottom: 4px; }

.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%,430px); min-height: calc(68px + var(--safe-bottom)); padding: 8px 14px calc(8px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(4,1fr); background: rgba(251,246,238,.96); border-top: 1px solid var(--line); backdrop-filter: blur(18px); z-index: 20; }
.nav-link { border: 0; background: transparent; color: var(--muted); display: grid; justify-items: center; gap: 4px; font-size: 9px; line-height: 1; cursor: pointer; text-decoration: none; }
.nav-link .icon { width: 21px; height: 21px; }
.nav-link.is-active { color: var(--navy); font-weight: 820; }
.nav-link.is-active::after { content: ""; width: 20px; height: 2px; background: var(--navy); border-radius: 4px; margin-top: -1px; }

.summary-card { padding: 14px; }
.summary-row { display: flex; align-items: flex-start; gap: 12px; }
.summary-icon { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: #e4eadf; color: #6f8664; flex: 0 0 auto; }
.summary-title { margin: 0; font-size: 15px; line-height: 1.2; font-weight: 850; }
.summary-text { margin: 5px 0 0; color: #58667d; font-size: 11px; line-height: 1.4; }

.accordion { overflow: hidden; }
.accordion + .accordion { margin-top: 9px; }
.accordion-trigger { width: 100%; min-height: 56px; padding: 12px 14px; border: 0; background: transparent; color: var(--text); display: grid; grid-template-columns: 36px 1fr 20px; gap: 10px; text-align: left; align-items: center; cursor: pointer; }
.accordion-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #efe5d8; color: var(--terracotta); }
.accordion-title { display: block; font-size: 13px; line-height: 1.1; font-weight: 830; }
.accordion-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 9.6px; line-height: 1.25; }
.accordion-chevron { transition: transform .2s ease; }
.accordion.is-open .accordion-chevron { transform: rotate(90deg); }
.accordion-body { display: none; padding: 0 14px 14px 60px; }
.accordion.is-open .accordion-body { display: block; }
.metric-line { display: grid; grid-template-columns: 1fr 74px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid rgba(228,214,197,.75); }
.metric-line:first-child { border-top: 0; }
.metric-line__label { font-size: 10px; line-height: 1.25; color: #56657d; }
.mini-track { height: 7px; border-radius: 99px; background: #e9dfd2; overflow: hidden; }
.mini-track > span { display: block; height: 100%; border-radius: inherit; background: var(--terracotta); }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-flex; min-height: 30px; padding: 0 10px; align-items: center; border-radius: 999px; border: 1px solid var(--line); background: #faf3e9; color: #55657d; font-size: 10px; font-weight: 720; }
.audio-row { display: grid; grid-template-columns: 36px 1fr 32px; gap: 9px; align-items: center; padding: 10px; border-radius: 14px; background: #f4eadf; }
.waveform { height: 30px; display: flex; align-items: center; gap: 2px; }
.waveform i { width: 2px; border-radius: 2px; background: #9a806e; display: block; }
.quality-note { padding: 11px; border-radius: 14px; background: #eef1eb; color: #5c695b; font-size: 10px; line-height: 1.4; }
.disclaimer { color: var(--muted); font-size: 9px; line-height: 1.35; text-align: center; padding: 4px 12px; }

.segmented { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); padding: 4px; border-radius: 14px; background: #eee3d5; gap: 4px; }
.segmented button { border: 0; min-height: 30px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.segmented button.is-active { background: var(--card); color: var(--text); box-shadow: 0 3px 8px rgba(68,48,28,.06); }
.chart-card { padding: 14px; }
.chart-card .wave-legend { margin-bottom: 10px; }
.chart-shell { position: relative; padding: 4px 0 0; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; margin-top: 4px; }
.context-row { display: flex; flex-wrap: wrap; width: 100%; min-width: 0; max-width: 100%; gap: 8px; overflow: visible; padding: 0 1px 4px; }
.context-chip { border: 1px solid var(--line); background: #f9f1e7; color: #59677d; min-height: 34px; padding: 0 10px; border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 9.5px; font-weight: 720; cursor: pointer; }
.context-chip.is-active { background: var(--navy); color: white; border-color: var(--navy); }
.context-card { padding: 14px; }
.context-card .context-row { margin-top: 10px; }
.context-status { min-height: 1.3em; margin: 7px 1px 0; color: var(--muted); font-size: 9.5px; line-height: 1.3; }
.timeline-list { display: grid; gap: 9px; }
.timeline-card { min-width: 0; padding: 10px; display: grid; grid-template-columns: 62px minmax(0,1fr) auto; gap: 10px; align-items: center; }
.timeline-thumb { width: 62px; height: 72px; border-radius: 13px; padding: 3px; background: #eadcc9; overflow: hidden; }
.timeline-thumb img { width: 100%; height: 100%; object-fit: contain; }
.timeline-title { margin: 0; font-size: 12px; line-height: 1.2; font-weight: 820; }
.timeline-meta { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.2; }
.dot-scale { display: flex; gap: 3px; }
.dot-scale i { width: 6px; height: 6px; border-radius: 50%; background: #d7cdc0; }
.dot-scale i.on { background: var(--sage); }

.month-title { margin: 2px 0 9px; font-size: 14px; font-weight: 850; }
.history-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.history-card { padding: 8px; text-decoration: none; min-width: 0; }
.history-image { height: 150px; border-radius: 16px; background: #eadcc9; overflow: hidden; display: grid; place-items: center; padding: 4px; }
.history-image img { width: 100%; height: 100%; object-fit: contain; }
.history-date { color: var(--muted); font-size: 8.6px; margin-top: 8px; }
.history-title { margin-top: 3px; font-size: 11px; line-height: 1.2; font-weight: 820; }
.history-tags { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.history-tags span { font-size: 7.5px; color: #657083; padding: 3px 5px; border-radius: 8px; background: #f0e5d7; }

.baseline-hero { padding: 14px; }
.baseline-title { margin: 0; font-size: 16px; line-height: 1.2; font-weight: 850; }
.baseline-copy { margin: 5px 0 0; color: #59677d; font-size: 10.5px; line-height: 1.4; }
.baseline-wave { margin-top: 12px; padding: 12px; border-radius: 18px; background: linear-gradient(180deg,#f6ebdc,#faf3e9); border: 1px solid var(--line); }
.baseline-row { display: grid; grid-template-columns: 72px 1fr 38px; gap: 9px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(228,214,197,.75); }
.baseline-row:first-child { border-top: 0; }
.baseline-label { font-size: 10px; font-weight: 760; }
.range-track { position: relative; height: 8px; border-radius: 99px; background: #e9dfd2; }
.range-band { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: #cdd7c8; }
.range-dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--terracotta); border: 3px solid var(--card); box-shadow: 0 1px 4px rgba(80,50,30,.16); transform: translate(-50%,-50%); }
.baseline-state { font-size: 9px; color: var(--muted); text-align: right; }
.info-card { padding: 13px; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.info-card .info-icon { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; background: #e5ebdf; color: #6e8664; }
.info-title { font-size: 12px; line-height: 1.2; font-weight: 820; }
.info-text { margin-top: 4px; color: #5d697d; font-size: 9.8px; line-height: 1.38; }

.first-journey { position: relative; overflow: hidden; padding: 18px; background: linear-gradient(145deg,rgba(251,246,238,.98),rgba(239,235,222,.96)); }
.first-journey::before, .first-journey::after { content: ""; position: absolute; width: 64px; height: 92px; border-radius: 80% 20% 75% 25%; background: rgba(215,167,155,.15); transform: rotate(32deg); pointer-events: none; }
.first-journey::before { right: -18px; top: -28px; }
.first-journey::after { right: 26px; top: -48px; background: rgba(135,153,119,.12); transform: rotate(-28deg); }
.first-journey__eyebrow { color: var(--terracotta); font-size: 9px; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.first-journey h2 { position: relative; margin: 6px 0 8px; max-width: 280px; font-size: 18px; line-height: 1.16; letter-spacing: -.025em; }
.first-journey p { position: relative; margin: 0; color: #52627d; font-size: 11.5px; line-height: 1.5; }
.first-journey__facts { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.first-journey__facts span { padding: 7px 9px; border-radius: 999px; background: rgba(255,255,255,.58); border: 1px solid var(--line); color: var(--navy); font-size: 9.5px; font-weight: 760; }
.first-journey .first-journey__note { color: #6d725f; }
.first-journey__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.first-journey .first-journey__privacy { margin-top: 12px; font-size: 9.5px; color: var(--muted); }

/* Слои зеркала — показ по галочкам, данные в истории уже есть */
.layers-card .section-copy { max-width: 320px; }
.layer-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.layer-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.62);
  font-size: 10px; font-weight: 740; color: var(--navy); cursor: pointer;
}
.layer-toggle input { accent-color: var(--navy); width: 14px; height: 14px; }
.layer-toggle:has(input:not(:checked)) { opacity: .55; }
.indicator-card.is-layer-hidden,
.petal.is-layer-hidden { display: none !important; }
.baseline-row.is-layer-hidden { display: none; }

.component-board { max-width: 1180px; margin: 0 auto; padding: 28px; }
.board-title { margin: 0; font-size: 28px; font-weight: 860; letter-spacing: -.03em; }
.board-copy { margin: 6px 0 20px; color: var(--muted); }
.board-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 18px; }
.component-panel { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-soft); }
.component-panel h2 { margin: 0 0 12px; font-size: 15px; }

.preview-board { min-height: 100vh; background: var(--bg); padding: 28px; }
.preview-header { max-width: 2000px; margin: 0 auto 20px; }
.preview-title { margin: 0; font-size: 28px; font-weight: 860; }
.preview-copy { margin: 5px 0 0; color: var(--muted); }
.preview-grid { max-width: 2100px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 390px); gap: 22px; align-items: start; }
.preview-phone { width: 390px; height: 844px; border-radius: 34px; overflow: hidden; background: var(--bg); box-shadow: 0 18px 44px rgba(60,40,20,.12); position: relative; }
.preview-phone .app-screen { display: block; height: 844px; min-height: 844px; overflow: hidden; }
.preview-phone .bottom-nav { position: absolute; left: 0; bottom: 0; transform: none; width: 100%; }
.preview-label { text-align: center; margin-bottom: 8px; font-size: 13px; font-weight: 820; }

body[data-export="true"] .bottom-nav,
body[data-export="true"] .header-actions,
body[data-export="true"] [data-interactive="true"] { display: none !important; }
body[data-export="true"] .app-screen { padding-bottom: 18px; }
body[data-export="true"] .app-shell { width: 390px; min-height: 844px; height: 844px; }

@media (min-width: 700px) {
  .app-stage { padding: 24px; }
  .app-shell { min-height: calc(100dvh - 48px); border-radius: 34px; }
  .app-screen { min-height: calc(100dvh - 48px); }
  .bottom-nav { bottom: 24px; border-radius: 0 0 34px 34px; }
}
@media (max-width: 350px) {
  .hero-card { grid-template-columns: minmax(0,1fr); gap: 12px; padding: 12px; }
  .hero-card--empty { grid-template-columns: 1fr; }
  .mood-frame { width: 140px; height: 160px; justify-self: center; }
  .hero-title { font-size: 1.1875rem; }
  .hero-summary { font-size: .75rem; }
  .indicator-grid { grid-template-columns: minmax(0,1fr); }
  .indicator-card { grid-template-columns: 30px minmax(0,1fr); padding: 10px; }
  .indicator-icon { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: no-preference) {
  .state-flower { animation: senti-breathe 5.5s ease-in-out infinite; }
  @keyframes senti-breathe { 0%,100% { transform: scale(.98) rotate(-1deg); } 50% { transform: scale(1.025) rotate(1deg); } }
}

/* Пустой hero без сцены (P0 slice) */
.hero-card--empty { grid-template-columns: 1fr; min-height: 0; }
.hero-card--empty .hero-summary { display: block; }

/* Демо-бейдж: пример, не реальный замер */
.demo-banner { margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(215,167,155,.25); border: 1px solid rgba(199,146,134,.5); font-size: 11px; font-weight: 700; color: #7a4f43; text-align: center; }

/* Честные метрики: нет данных */
.metric-line.is-unavailable { grid-template-columns: 1fr auto; opacity: .7; }
.metric-line__hint { font-size: 10px; color: var(--muted); text-align: right; line-height: 1.25; }
.metric-line.is-unavailable .mini-track { display: none; }

/* Trial / paywall */
.entitlement-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: rgba(255,255,255,.55); border: 1px solid rgba(184,140,98,.28); }
.entitlement-card--paywall { flex-direction: column; align-items: stretch; background: rgba(215,167,155,.18); border-color: rgba(199,146,134,.45); }
.entitlement-card--ok { background: rgba(135,153,119,.14); border-color: rgba(135,153,119,.35); }
.entitlement-copy { display: grid; gap: 2px; min-width: 0; }
.entitlement-copy strong { font-size: 12px; font-weight: 820; letter-spacing: -.01em; }
.entitlement-copy span { font-size: 10px; color: var(--muted); line-height: 1.35; }
.entitlement-card .btn { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; font-size: 11px; }
.payment-qr { flex: 0 0 auto; width: min(190px, 68vw); align-self: center; padding: 6px; border-radius: 10px; background: #fff; border: 1px solid rgba(184,140,98,.28); box-shadow: 0 6px 14px rgba(72,50,28,.07); }
.payment-qr img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }
.entitlement-actions { display: flex; flex-direction: column; gap: 7px; flex: 0 0 auto; width: 100%; }
.payment-status { max-width: 180px; font-size: 10px; line-height: 1.35; color: var(--muted); text-align: center; }
@media (max-width: 430px) {
  .entitlement-card--paywall .btn { width: 100%; justify-content: center; }
  .payment-status { max-width: none; }
}

.web-upload { padding: 14px 16px; }
.web-upload form { display: grid; gap: 10px; }
.web-upload p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.file-picker { display: flex; align-items: center; gap: 9px; min-width: 0; }
.file-picker__button {
  position: relative;
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.05);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.file-picker__button:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.file-picker__input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.file-picker__name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-source-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.upload-source-button {
  position: relative;
  width: 100%;
  cursor: pointer;
}
.upload-source-button:focus-within {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.web-upload .btn { width: 100%; }
.web-upload .upload-privacy { color: #5f6b7c; font-size: 10px; line-height: 1.45; }
.upload-privacy a { color: var(--navy); font-weight: 780; text-underline-offset: 2px; }
.web-upload-status { min-height: 1.2em; }
.history-delete-card { display: grid; gap: 10px; align-items: start; }
.history-delete-card h2 { margin: 0 0 4px; font-size: 14px; }
.history-delete-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.history-delete-card .btn { justify-self: start; }
.history-delete-status { min-height: 1.2em; }
@media (max-width: 360px) {
  .upload-source-actions { grid-template-columns: 1fr; }
}
