/* КАРБ — design tokens
   Палітра: графіт / криця / порцеляна / латунь
   Шрифти: Unbounded (display) · IBM Plex Sans (текст) · IBM Plex Mono (службовий) */

:root {
  --ink: #23262B;
  --ink-2: #2E3238;
  --steel: #6E7681;
  --steel-lt: #9AA1AB;
  --line: #DEDCD4;
  --porcelain: #FAFAF8;
  --paper: #F1F0EA;
  --brass: #A8813A;
  --brass-deep: #7E6128;
  --white: #FFFFFF;
  --danger: #A8483A;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35,38,43,.05), 0 8px 24px rgba(35,38,43,.06);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--porcelain);
}
img { max-width: 100%; display: block; }
a { color: var(--brass-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.center { text-align: center; }
.inline { display: inline; }
.mt { margin-top: 40px; }
.mt-s { margin-top: 16px; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

/* Типографіка */
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 4.5vw, 3rem); letter-spacing: -.01em; }
.h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.25rem, 2.6vw, 1.7rem); }
.h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.muted { color: var(--steel); }
.small { font-size: .92rem; }
.tiny { font-size: .8rem; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brass); margin-bottom: 14px;
}

/* Сигнатура: карб-лінія — гравійована риска з зарубкою */
.karbline { position: relative; height: 1px; background: var(--line); margin: 0 0 22px; max-width: 96px; }
.karbline::before {
  content: ''; position: absolute; left: 34px; top: -4px; width: 9px; height: 9px;
  background: var(--brass); transform: rotate(45deg);
}
.center .karbline, .form-card .karbline, .capsule .karbline { margin-left: auto; margin-right: auto; }

/* Шапка */
.topbar { background: var(--ink); color: var(--porcelain); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; gap: 16px; }
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .08em;
  color: var(--porcelain); text-decoration: none;
}
.brand::after { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--brass); transform: rotate(45deg) translateY(-6px); margin-left: 8px; }
.brand:hover { text-decoration: none; }

/* Знак «К-зарубка» — лок-ап */
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; vertical-align: middle; }
a.brand-link, a .brand-lockup { text-decoration: none; }
a.brand-link:hover { text-decoration: none; }
.kmark {
  position: relative; font-family: var(--font-display); font-weight: 700; line-height: 1;
  display: inline-block;
}
.kmark.on-dark { color: var(--porcelain); }
.kmark.on-light { color: var(--ink); }
.kmark-notch {
  position: absolute; left: -.125em; top: 44%; width: .25em; height: .25em;
  transform: rotate(45deg);
}
.kmark.on-dark .kmark-notch { background: var(--ink); }
.kmark.on-light .kmark-notch { background: var(--porcelain); }
.kmark-inlay {
  position: absolute; left: -.06em; top: 45.5%; width: .146em; height: .146em;
  background: var(--brass); transform: rotate(45deg);
}
.brand-word {
  font-family: var(--font-display); font-weight: 700; font-size: .68em; letter-spacing: .1em;
}
.topbar .brand-word, .footer .brand-word { color: var(--porcelain); font-size: 16px; }
.kmark.on-light + .brand-word { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--steel-lt); font-size: .92rem; }
.nav a:hover { color: var(--porcelain); text-decoration: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--steel-lt); cursor: pointer; font-size: .92rem; }
.linklike:hover { color: var(--porcelain); }
.linklike.danger { color: var(--danger); }

.flash {
  margin: 14px 0 0; padding: 10px 14px; border: 1px solid var(--brass);
  background: #FBF6EC; border-radius: 10px; font-size: .92rem;
}
.error {
  margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--danger);
  background: #FBF0EE; border-radius: 10px; font-size: .92rem; color: var(--danger);
}

/* Кнопки */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px; border: 1px solid var(--ink);
  background: var(--white); color: var(--ink); font: 500 .95rem var(--font-body);
  cursor: pointer; text-decoration: none; transition: transform .06s ease, background .15s ease;
}
.btn:hover { text-decoration: none; background: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn-brass { background: var(--brass); border-color: var(--brass); color: var(--white); }
.btn-brass:hover { background: var(--brass-deep); border-color: var(--brass-deep); }
.btn-ghost { background: transparent; border-color: var(--line); color: inherit; }
.btn-small { padding: 7px 12px; font-size: .84rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* Чипи та статуси */
.chip {
  display: inline-block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--steel); background: var(--white);
}
.chip-brass { border-color: var(--brass); color: var(--brass-deep); background: #FBF6EC; }
.chip-new { border-color: var(--brass); color: var(--brass-deep); }
.chip-confirmed, .chip-production { border-color: var(--brass); color: var(--brass-deep); }
.chip-shipped, .chip-done { border-color: #4C7A57; color: #3D6446; background: #EFF5F0; }
.chip-canceled { border-color: var(--danger); color: var(--danger); }

/* Картки й сітки */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.cases { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.steps { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.materials { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.feats { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 28px; }
.feat { padding: 10px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.step-n { color: var(--brass); font-size: .85rem; letter-spacing: .12em; margin-bottom: 8px; }
.section-alt { background: var(--paper); }
.price { color: var(--brass-deep); margin-top: 8px; font-size: .9rem; }

/* Секція «Що таке карб» */
.word-grid { display: grid; grid-template-columns: minmax(240px, .9fr) 1.4fr; gap: 48px; align-items: center; }
.word-headline { font-family: var(--font-display); font-weight: 700; font-size: clamp(3rem, 7vw, 4.6rem); line-height: 1; letter-spacing: -.01em; }
.word-gram { margin-top: 12px; }
.word-defs { display: grid; gap: 14px; max-width: 56ch; }
.word-def { display: flex; gap: 14px; }
.word-num { color: var(--brass); font-size: .85rem; padding-top: 3px; }
.word-def p { margin: 0; font-size: 1.05rem; line-height: 1.65; }
.word-def-ours { border-left: 2px solid var(--brass); background: #FBF6EC; border-radius: 0 10px 10px 0; padding: 14px 18px; margin-top: 6px; }
.word-def-ours p { margin: 0; font-size: 1rem; line-height: 1.65; }

/* Секція «Сторінка, що вміє більше» (темна) */
.section-dark { background: var(--ink); color: var(--porcelain); }
.section-dark .h2 { color: var(--porcelain); }
.karbline-dark { background: #3A3E44; }
.new-sub { color: var(--steel-lt); max-width: 60ch; }
.new-cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 26px; }
.new-card { background: #2A2D33; border: 1px solid #3A3E44; border-radius: 14px; padding: 22px; }
.new-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.new-card-head .h3 { color: var(--porcelain); margin: 0; }
.new-card p { color: var(--steel-lt); margin: 10px 0 0; }
.chip-new-dark { border-color: var(--brass); color: #E9C97F; background: transparent; }
.chip-soon-dark { border-color: var(--steel); color: var(--steel-lt); background: transparent; }
.new-link { display: inline-block; margin-top: 12px; color: #E9C97F; font-size: .9rem; }
.new-plans { color: var(--steel); margin-top: 22px; letter-spacing: .08em; }

.material-swatch { display: inline-block; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); margin-bottom: 12px; vertical-align: middle; }
.sw-steel { background: repeating-linear-gradient(90deg, #C9CDD2 0 2px, #B7BCC2 2px 4px); }
.sw-alu { background: linear-gradient(135deg, #3A3E44, #23262B); }
.sw-ceramic { background: linear-gradient(160deg, #FFFFFF 30%, #E8E9EB); }
.sw-oak { background: repeating-linear-gradient(95deg, #B98A54 0 6px, #A97B47 6px 9px, #8F6337 9px 11px); }
.sw-vinyl { background: #FFFFFF; }

/* Герой */
.hero { background: var(--ink); color: var(--porcelain); overflow: hidden; }
.hero-in {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
  padding-top: 72px; padding-bottom: 72px;
  background: repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
}
.hero h1 { color: var(--porcelain); margin-bottom: 18px; }
.hero .lead { color: var(--steel-lt); max-width: 46ch; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 14px; }
.hero .btn-ghost { color: var(--porcelain); border-color: var(--steel); }
.hero .btn-ghost:hover { background: var(--ink-2); }
.hero-note { color: var(--steel); }

/* Металева табличка */
.hero-tag { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tag {
  position: relative; width: 268px; padding: 30px 24px 22px; border-radius: 16px;
  background:
    radial-gradient(120% 90% at 30% 12%, rgba(255,255,255,.5), rgba(255,255,255,0) 55%),
    repeating-linear-gradient(90deg, #C9CDD2 0 2px, #BFC4CA 2px 3px, #B7BCC2 3px 5px);
  box-shadow: 0 24px 48px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.65), inset 0 -2px 6px rgba(0,0,0,.18);
  transform: rotate(-3.5deg);
  text-align: center;
  overflow: hidden;
}
.tag::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: sheen 2.2s ease .5s 1 forwards;
}
@keyframes sheen { to { transform: translateX(120%); } }
.screw { position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #E7EAEE, #8B929B 70%);
  box-shadow: inset 0 -1px 2px rgba(0,0,0,.4); }
.screw::after { content: ''; position: absolute; left: 1px; right: 1px; top: 3.5px; height: 1.5px; background: rgba(35,38,43,.55); transform: rotate(38deg); }
.s1 { top: 9px; left: 9px; } .s2 { top: 9px; right: 9px; } .s3 { bottom: 9px; left: 9px; } .s4 { bottom: 9px; right: 9px; }
.tag-qr { width: 150px; height: 150px; margin: 0 auto 14px; }
.tag-qr img { width: 100%; height: 100%; filter: drop-shadow(0 1px 0 rgba(255,255,255,.5)); }
.tag-name, .tag-years, .tag-brand {
  font-family: var(--font-mono); color: #3A3E44; letter-spacing: .12em;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
}
.tag-name { font-size: .82rem; font-weight: 500; }
.tag-years { font-size: .72rem; margin-top: 3px; }
.tag-brand { font-size: .6rem; margin-top: 12px; opacity: .55; }
.tag-hint { color: var(--steel); }

/* Форми */
label { display: block; margin: 0 0 14px; font-size: .92rem; font-weight: 500; }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white);
  font: 400 .98rem var(--font-body); color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brass); outline-offset: 0; border-color: var(--brass); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
.check input { width: auto; margin: 0; }
.form-card { max-width: 460px; margin: 24px auto; }
.form-card.wide { max-width: 720px; }
.form-wide { margin-top: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.pin-input { text-align: center; font-family: var(--font-mono); font-size: 1.3rem; letter-spacing: .3em; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 18px; }
.type-opt { position: relative; margin: 0; }
.type-opt input { position: absolute; opacity: 0; }
.type-opt span {
  display: block; text-align: center; padding: 12px 8px; border: 1px solid var(--line);
  border-radius: 10px; font-size: .9rem; cursor: pointer; background: var(--white);
}
.type-opt input:checked + span { border-color: var(--brass); background: #FBF6EC; color: var(--brass-deep); font-weight: 600; }
.type-opt input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }

/* Кабінет */
.page-list { display: grid; gap: 12px; margin-top: 20px; }
.page-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; padding: 18px 22px; }
.page-row-main h3 { margin: 4px 0 2px; font-family: var(--font-body); font-weight: 600; font-size: 1.08rem; }
.page-row-main h3 a { color: var(--ink); }
.page-row-stats { display: flex; gap: 14px; color: var(--steel); grid-column: 1; }
.pending-dot { color: var(--brass-deep); font-weight: 500; }
.page-row-actions { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.empty { max-width: 560px; margin: 32px auto; }
.stats-row { display: flex; gap: 18px; flex-wrap: wrap; color: var(--steel); margin: 6px 0 20px; }

/* Таблиці */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--steel); }
.table tr:last-child td { border-bottom: 0; }
.status-form { display: flex; gap: 6px; align-items: center; }
.status-form select { margin: 0; width: auto; padding: 6px 8px; font-size: .84rem; }

/* Редактор */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.photo-cell { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-del {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: rgba(35,38,43,.75); color: #fff; font-size: 1rem; cursor: pointer; line-height: 1;
}
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-row input { width: auto; margin: 0; }
.tl-edit-row { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.tl-add { display: grid; grid-template-columns: 90px 1fr 1.4fr auto; gap: 8px; align-items: end; margin-top: 14px; }
.tl-add input { margin: 0; }
.gb-mod { border-top: 1px solid var(--line); padding: 12px 0; }
.gb-mod p { margin: 6px 0 10px; }

/* АІ-панель у редакторі */
.story-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 6px; }
.story-label { font-size: .92rem; font-weight: 500; }
.story-field { position: relative; margin: 0 0 14px; }
.ai-applied-badge { position: absolute; top: 8px; right: 10px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; color: var(--brass-deep); background: #FBF6EC; border: 1px solid var(--brass); border-radius: 999px; padding: 2px 9px; }
.ai-overlay { position: fixed; inset: 0; background: rgba(35,38,43,.4); z-index: 50; display: flex; justify-content: flex-end; }
.ai-drawer { width: 420px; max-width: 92vw; height: 100%; background: var(--white); box-shadow: -8px 0 32px rgba(35,38,43,.25); display: flex; flex-direction: column; }
.ai-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.ai-drawer-head .linklike { color: var(--steel); font-size: 1.1rem; }
.ai-drawer-body { padding: 20px; overflow-y: auto; }
.ai-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.ai-plans { display: grid; gap: 8px; margin: 12px 0 14px; }
.ai-plan { text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 10px; font: inherit; border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.ai-plan.active { border: 1.5px solid var(--brass); background: #FBF6EC; }
.ai-plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ai-plan-name { font-weight: 600; font-size: .95rem; }
.ai-plan-price { font-size: .9rem; color: var(--brass-deep); }
.ai-plan-desc { display: block; font-size: .78rem; color: var(--steel); margin-top: 4px; line-height: 1.5; }
.ai-seg { display: flex; gap: 4px; background: var(--paper); padding: 4px; border-radius: 10px; margin: 12px 0 16px; }
.ai-seg-btn { flex: 1; padding: 9px 8px; border-radius: 8px; cursor: pointer; font-size: .86rem; font-weight: 500; font-family: var(--font-body); border: 1px solid transparent; background: transparent; color: var(--steel); }
.ai-seg-btn.active { background: var(--white); border-color: var(--line); color: var(--ink); box-shadow: 0 1px 2px rgba(35,38,43,.06); }
.ai-chat { max-height: 280px; overflow: auto; display: grid; gap: 8px; margin-top: 16px; padding-right: 4px; }
.ai-msg { max-width: 88%; padding: 9px 14px; font-size: .9rem; line-height: 1.55; }
.ai-msg-a { justify-self: start; background: var(--paper); border-radius: 12px 12px 12px 4px; color: var(--ink-2); }
.ai-msg-u { justify-self: end; background: #FBF6EC; border: 1px solid #EAD9B0; border-radius: 12px 12px 4px 12px; color: var(--ink); }
.ai-chat-input { display: flex; gap: 8px; margin-top: 12px; }
.ai-chat-input input { margin: 0; }
.ai-pulse { animation: aiPulse 1.1s ease infinite; }
@keyframes aiPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.ai-spark { font-size: 26px; color: var(--brass); }
.ai-skeleton { display: grid; gap: 8px; margin-top: 16px; }
.ai-skeleton span { height: 10px; border-radius: 5px; background: #EDEBE4; animation: aiPulse 1.2s ease infinite; }
.ai-skeleton span:nth-child(2) { width: 86%; animation-delay: .15s; }
.ai-skeleton span:nth-child(3) { width: 72%; animation-delay: .3s; }
.ai-proposal { border: 1px solid var(--brass); background: #FBF6EC; border-radius: 10px; padding: 14px 16px; max-height: 300px; overflow: auto; font-size: .93rem; line-height: 1.65; white-space: pre-wrap; }
.ai-drawer .btn-block { margin-top: 12px; }

/* Публічна сторінка */
body.view { background: var(--porcelain); }

/* ===== Теми оформлення (використовують --pv-* з інлайн-стилю body) ===== */
body.view[style*="--pv-bg"] { background: var(--pv-bg); color: var(--pv-ink); font-family: var(--pv-body, var(--font-body)); }
body.view[style*="--pv-bg"] .story-head h1,
body.view[style*="--pv-bg"] .h3 { font-family: var(--pv-display, var(--font-display)); }
body.view[style*="--pv-bg"] .chip-brass { color: var(--pv-accent); border-color: var(--pv-accent); background: transparent; }
body.view[style*="--pv-bg"] .years,
body.view[style*="--pv-bg"] .tl-date { color: var(--pv-accent); }
body.view[style*="--pv-bg"] .subtitle,
body.view[style*="--pv-bg"] .muted,
body.view[style*="--pv-bg"] .gb-meta { color: var(--pv-muted); }
body.view[style*="--pv-bg"] .quote p,
body.view[style*="--pv-bg"] .story-text,
body.view[style*="--pv-bg"] .tl-body p { color: var(--pv-ink); }
body.view[style*="--pv-bg"] .karbline { background: var(--pv-line); }
body.view[style*="--pv-bg"] .karbline::before,
body.view[style*="--pv-bg"] .tl li::before { background: var(--pv-accent); }
body.view[style*="--pv-bg"] .tl li { border-left-color: var(--pv-line); }
body.view[style*="--pv-bg"] .gb-entry,
body.view[style*="--pv-bg"] .feat { border-top-color: var(--pv-line); }
body.view[style*="--pv-bg"] input,
body.view[style*="--pv-bg"] textarea { background: var(--pv-surface); border-color: var(--pv-line); color: var(--pv-ink); }

/* Вирівнювання */
body.align-center .story-head,
body.align-center .quote,
body.align-center .react { text-align: center; }
body.align-center .story-head .chip { margin-left: auto; margin-right: auto; }
body.align-center .react { justify-content: center; }
body.align-center .quote p { font-style: italic; }

/* CAPS для назви (Криця) */
body.theme-krytsia .story-head h1 { text-transform: uppercase; letter-spacing: .02em; }

/* Курсивний підзаголовок (Альбом) */
body.theme-albom .subtitle { font-style: italic; }

/* Фото-хіро: рамка (Латунь) */
body.hero-framed .story-photo { border: 1px solid var(--pv-accent); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
/* Паспарту (Музей) */
body.hero-museum .story-photo { background: var(--pv-surface); border: 1px solid var(--pv-line); padding: 12px; box-shadow: 0 1px 2px rgba(35,38,43,.05); }
/* Полароїд (Альбом) */
body.hero-polaroid .story-hero { display: flex; justify-content: center; }
body.hero-polaroid .story-photo { background: var(--pv-surface); padding: 10px 10px 34px; transform: rotate(-2deg); box-shadow: 0 3px 10px rgba(35,38,43,.18); border-radius: 2px; max-width: 92%; }
/* Пластина (Криця) */
body.hero-plate .story-photo { background: var(--pv-surface); border: 1px solid var(--pv-line); padding: 14px; border-radius: 12px; box-shadow: inset 0 2px 8px rgba(0,0,0,.28); filter: grayscale(.15) contrast(1.02); }
/* Full-bleed хіро (Часопис) */
body.hero-fullbleed .story-wrap { max-width: 760px; }
body.hero-fullbleed .story-photo { max-height: 60vh; border-radius: 0; }

/* Кнопка реакції за темою */
body.btn-pill-solid .btn-react { background: var(--pv-accent); border-color: var(--pv-accent); color: #FFFDF6; }
body.btn-outline-square .btn-react { background: transparent; border: 1px solid var(--pv-ink); color: var(--pv-ink); border-radius: 2px; }
body.btn-glow .btn-react { background: radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--pv-accent) 30%, transparent), transparent 70%), var(--pv-surface); color: var(--pv-accent); border: 1px solid var(--pv-accent); box-shadow: 0 0 26px color-mix(in srgb, var(--pv-accent) 25%, transparent); }
body.btn-solid-ink .btn-react { background: var(--pv-ink); color: var(--pv-bg); border: 1px solid var(--pv-ink); border-radius: 10px; }
body.btn-outline-upper .btn-react { background: transparent; color: var(--pv-ink); border: 1px solid var(--pv-ink); border-radius: 0; text-transform: uppercase; letter-spacing: .08em; }

/* Секції-картки (Система) */
body.theme-systema .story-text,
body.theme-systema .timeline,
body.theme-systema .gallery,
body.theme-systema .guestbook { background: var(--pv-surface); border: 1px solid var(--pv-line); border-radius: 12px; padding: 18px 20px; }

.story { padding: 40px 0 24px; }
.story-wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.story-hero { margin-bottom: 26px; }
.story-photo { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.story-mono {
  aspect-ratio: 16/9; border-radius: var(--radius); display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 30% 12%, rgba(255,255,255,.4), rgba(255,255,255,0) 55%),
    repeating-linear-gradient(90deg, #C9CDD2 0 2px, #BFC4CA 2px 3px, #B7BCC2 3px 5px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
}
.story-mono span {
  font-family: var(--font-display); font-weight: 700; font-size: 4rem; color: #3A3E44;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.story-head h1 { margin-bottom: 6px; }
.years { color: var(--brass-deep); letter-spacing: .18em; font-size: .95rem; }
.subtitle { color: var(--steel); margin: 10px 0 0; font-size: 1.05rem; }
.story-head { margin-bottom: 22px; }
.story-head .chip { margin-bottom: 14px; }

.quote { margin: 30px 0; padding: 0; }
.quote p { font-size: 1.25rem; line-height: 1.5; font-style: italic; color: var(--ink-2); margin: 0; }

.react { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 26px 0; }
.btn-react {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px;
  border-radius: 999px; border: 1px solid var(--brass); background: #FBF6EC; color: var(--brass-deep);
  font: 500 .98rem var(--font-body); cursor: pointer;
}
.btn-react:hover { background: #F5EBD6; }
.btn-react.done { opacity: .75; cursor: default; }
.btn-react .count { font-size: .85rem; opacity: .8; }

.story-text { font-size: 1.05rem; }
.story-text p { margin: 0 0 1.1em; }

.video-box { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 26px 0; }
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.gallery, .timeline, .guestbook, .capsule { margin: 40px 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 22px 26px; border-left: 1px solid var(--line); margin-left: 4px; }
.tl li:last-child { padding-bottom: 4px; }
.tl li::before {
  content: ''; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px;
  background: var(--brass); transform: rotate(45deg);
}
.tl-date { color: var(--brass-deep); font-size: .8rem; letter-spacing: .1em; margin-bottom: 2px; }
.tl-body p { margin: 4px 0 0; color: var(--ink-2); font-size: .96rem; }

.capsule { border: 1px solid var(--brass); border-radius: var(--radius); padding: 22px 24px; background: #FBF6EC; }
.capsule.locked { background: var(--paper); border-color: var(--line); }
.capsule-head { display: flex; align-items: center; gap: 8px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass-deep); margin-bottom: 10px; }
.capsule.locked .capsule-head { color: var(--steel); }
.capsule p, .capsule-text p { margin: 0 0 .8em; }

.gb-entry { border-top: 1px solid var(--line); padding: 14px 0; }
.gb-entry p { margin: 6px 0 0; }
.gb-meta { color: var(--steel); }
.gb-form { margin-top: 20px; }
.made-on { margin: 48px 0 20px; text-align: center; }
.made-on .karbline { margin-left: auto; margin-right: auto; }
.made-on a { color: var(--steel); }

/* Редактор оформлення */
.appearance-grid { display: grid; grid-template-columns: minmax(380px, 1fr) 400px; gap: 36px; align-items: start; margin-top: 24px; }
.appearance-controls { display: grid; gap: 26px; }
.appearance-controls section h3 { margin-bottom: 2px; }
.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.theme-card { text-align: left; cursor: pointer; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); font: inherit; color: var(--ink); }
.theme-card.active { border: 1.5px solid var(--brass); background: #FBF6EC; }
.theme-card-name { display: block; font-weight: 600; font-size: .92rem; }
.theme-card-desc { display: block; font-size: .76rem; color: var(--steel); margin-top: 4px; line-height: 1.45; }
.chip-lock { padding: 1px 6px; font-size: .62rem; }
.accent-swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.accent-sw { width: 38px; height: 38px; border-radius: 50%; cursor: pointer; padding: 3px; border: 1px solid var(--line); background: #fff; }
.accent-sw.active { border: 2px solid var(--ink); }
.accent-sw span { display: block; width: 100%; height: 100%; border-radius: 50%; }
.accent-name { align-self: center; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.opt-chip { padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-family: var(--font-body); border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.opt-chip.active { border: 1.5px solid var(--brass); background: #FBF6EC; color: var(--brass-deep); }
.appearance-preview { position: sticky; top: 20px; }
.preview-label { margin-bottom: 10px; }
.preview-frame { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--paper); }
.preview-frame iframe { width: 100%; height: 640px; border: 0; display: block; }
@media (max-width: 900px) { .appearance-grid { grid-template-columns: 1fr; } .appearance-preview { position: static; } }

/* Замовлення */
.order-mat { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.order-mat legend { font-weight: 600; font-size: .95rem; padding: 0 6px; }
.order-mat .material-swatch { width: 18px; height: 18px; border-radius: 5px; margin: 0 4px -4px 0; }
.order-sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.size-opt { position: relative; margin: 0; flex: 1 1 140px; }
.size-opt input { position: absolute; opacity: 0; }
.size-opt span { display: block; }
.size-opt > span:first-of-type { font-weight: 500; }
.size-opt input + span { padding: 10px 12px 0; border: 1px solid var(--line); border-radius: 10px 10px 0 0; border-bottom: 0; cursor: pointer; }
.size-opt input ~ span.mono { padding: 0 12px 10px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; border-top: 0; cursor: pointer; font-size: .85rem; color: var(--steel); }
.size-opt input:checked + span, .size-opt input:checked ~ span.mono { border-color: var(--brass); background: #FBF6EC; color: var(--brass-deep); }
.size-opt input:focus-visible + span { outline: 2px solid var(--brass); }
.order-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.15rem; margin: 18px 0 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.order-summary { text-align: left; margin: 20px 0; }
.order-summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }

/* Брендбук */
.bb-cover { background: var(--ink); color: var(--porcelain); }
.bb-cover-in { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; padding: 64px 20px 56px; }
.bb-cover-mark { font-size: 130px; }
.bb-cover-eyebrow { font-size: 12px; letter-spacing: .3em; color: var(--brass); text-transform: uppercase; }
.bb-cover-title { font-family: var(--font-display); font-weight: 700; font-size: 46px; letter-spacing: .06em; margin-top: 16px; }
.bb-cover-lead { font-size: 17px; color: var(--steel-lt); margin-top: 12px; max-width: 44ch; line-height: 1.6; }
.bb-body { padding-bottom: 72px; }
.bb-sec { margin-top: 56px; }
.bb-sec-head { display: flex; align-items: baseline; gap: 14px; }
.bb-num { font-size: 12px; color: var(--brass); letter-spacing: .2em; }
.bb-grid { display: grid; gap: 14px; margin-top: 6px; }
.bb-grid-mark { grid-template-columns: 1.2fr 1fr 1fr; }
.bb-grid-locks { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.bb-grid-dont { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.bb-mark-plate { display: grid; place-items: center; background-image: repeating-linear-gradient(0deg, rgba(35,38,43,.045) 0 1px, transparent 1px 12px), repeating-linear-gradient(90deg, rgba(35,38,43,.045) 0 1px, transparent 1px 12px); }
.bb-label { font-size: 10px; letter-spacing: .18em; color: var(--steel); text-transform: uppercase; margin-bottom: 12px; }
.bb-list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.bb-scales { display: flex; align-items: baseline; gap: 16px; margin-top: 16px; }
.bb-lock { display: grid; place-items: center; gap: 16px; }
.bb-lock-dark { background: var(--ink); }
.bb-cap { font-size: 10px; letter-spacing: .16em; color: var(--steel); }
.bb-note { margin-top: 14px; max-width: 86ch; line-height: 1.6; }
.bb-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 6px; }
.bb-color { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.bb-sw { height: 88px; }
.bb-color-t { padding: 12px 14px; display: grid; gap: 2px; }
.bb-color-t strong { font-size: 13.5px; }
.bb-color-t .mono { font-size: 11px; color: var(--steel); }
.bb-dont { text-align: center; display: grid; gap: 8px; place-items: center; }
.bb-dont-t { font-size: 11.5px; color: var(--danger); }
.bb-dont-stretch { transform: scaleX(1.5); }
.bb-dont-rotate { transform: rotate(14deg); }
.bb-dont-shadow { filter: drop-shadow(3px 4px 3px rgba(35,38,43,.45)); }
.bb-foot { margin-top: 64px; }
@media (max-width: 860px) {
  .bb-cover-in { grid-template-columns: 1fr; gap: 24px; }
  .bb-cover-mark { font-size: 90px; }
  .bb-grid-mark { grid-template-columns: 1fr; }
  .bb-colors { grid-template-columns: repeat(2, 1fr); }
}

/* Підвал */
.footer { background: var(--ink); color: var(--steel-lt); margin-top: 56px; }
.footer-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 36px 20px; }
.footer a { color: var(--steel-lt); }
.brand-foot { margin-bottom: 8px; }
.footer-min { margin-top: 24px; padding: 18px 0; background: transparent; color: var(--steel); }

/* Адаптив і доступність */
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 48px; }
  .hero-tag { order: -1; }
  .tag { transform: rotate(-2deg) scale(.92); }
  .two-col { grid-template-columns: 1fr; }
  .page-row { grid-template-columns: 1fr; }
  .page-row-actions { grid-column: 1; grid-row: auto; }
  .tl-add { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tag::after { animation: none; display: none; }
  .btn { transition: none; }
}
