:root {
  --page: #111214; --card: #1B1D21; --card2: #26292F; --bar: #15171A; --text: #F3F3F1; --hint: #A2A5AB;
  --sep: #2D3036; --accent: #FF8A3D; --accent-ink: #FF8A3D; --on-accent: #141414; --green: #5EE6B0; --on-green: #0E2A1F;
  --paper: #F4F4F2; --shadow: rgba(0, 0, 0, .4);
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --display: 'Geologica', 'Manrope', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --r: 16px; --rs: 12px;
  --bar-h: 76px;
  color-scheme: dark;
}
/* светлая тема: заливки тем же оранжевым, текст акцента — тёмно-оранжевый ради контраста */
html[data-theme="light"] {
  --page: #F4F4F1; --card: #FFFFFF; --card2: #EBEBE6; --bar: #FFFFFF; --text: #141414; --hint: #5E6167;
  --sep: #E1E1DB; --accent-ink: #B54A07; --green: #1E8449; --on-green: #FFFFFF; --paper: #FFFFFF;
  --shadow: rgba(20, 20, 20, .15);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--page); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; }
#view { max-width: 560px; margin: 0 auto; padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 16px); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; }

.pad { padding: 0 16px; }
.stack { display: flex; flex-direction: column; }
.gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap14 { gap: 14px; } .gap24 { gap: 24px; }
.hint { color: var(--hint); }
.mono { font-family: var(--mono); font-weight: 700; }
.accent { color: var(--accent-ink); }
.section-title { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--hint); }

/* главная */
.hero { padding: 24px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .05em; }
.lead { font-size: 15px; line-height: 1.45; color: var(--hint); margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { text-align: left; border: 0; background: var(--card); border-radius: 18px; padding: 16px; min-height: 156px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.tile-name { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.15; }
.list { background: var(--card); border-radius: 18px; overflow: hidden; }
.list > * + * { border-top: 1px solid var(--sep); }
.row-btn { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; }
.row-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-title { font-size: 15px; font-weight: 600; }
.row-sub { font-size: 13px; color: var(--hint); }
.step { display: flex; gap: 14px; align-items: baseline; padding: 11px 16px; }
.step .mono { color: var(--accent-ink); font-size: 15px; }

/* верхняя панель */
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.icon-btn { width: 44px; height: 44px; flex: none; border: 0; padding: 0; border-radius: var(--rs); background: var(--card); display: flex; align-items: center; justify-content: center; }
.topbar-title { font-family: var(--display); font-weight: 700; font-size: 18px; }

/* предмет */
.chips { display: flex; gap: 8px; padding: 6px 16px 14px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--sep); background: var(--card); font-weight: 600; font-size: 14px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.head-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.var { height: 58px; padding: 0; border-radius: var(--rs); border: 1px solid var(--sep); background: var(--card); font-family: var(--mono); font-weight: 700; font-size: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.var.off { color: var(--hint); }
.var.off span:first-child { text-decoration: line-through; }
.var small { font-family: var(--font); font-size: 10px; font-weight: 600; }
.custom-card { width: 100%; border: 0; text-align: left; background: var(--card); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.thumbs img { width: 100%; height: 210px; object-fit: cover; object-position: top; border-radius: 8px; background: var(--paper); }
.thumbs img:only-child { grid-column: 1 / -1; height: 240px; }

/* карточка */
.shot { margin: 4px 16px 0; border-radius: var(--r); overflow: hidden; background: var(--paper); display: flex; align-items: center; justify-content: center; }
.shot.wide { height: 270px; }
.shot.tall { height: 440px; }
.row-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.hero + .pad { margin-top: 24px; }
.shot img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 10px; }
.pager .icon-btn { height: 36px; }
.pill { padding: 5px 10px; border-radius: 999px; background: var(--card2); font-size: 13px; font-weight: 600; }
.pill.out { background: transparent; border: 1px solid var(--hint); color: var(--hint); }
.card-title { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.25; margin: 0; }
.price-big { font-family: var(--mono); font-weight: 700; font-size: 26px; color: var(--accent-ink); }
.desc { font-size: 15px; line-height: 1.55; margin: 0; }
.facts { background: var(--card); border-radius: var(--r); padding: 2px 14px; }
.fact { display: flex; gap: 12px; padding: 11px 0; font-size: 14px; line-height: 1.4; }
.fact + .fact { border-top: 1px solid var(--sep); }
.fact span:first-child { width: 92px; flex: none; color: var(--hint); }

#card-body { margin-top: 14px; }
.choice-label { font-size: 13px; font-weight: 600; color: var(--hint); }

/* форма */
.summary { background: var(--card); border-radius: var(--r); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--hint); }
.field input, .field textarea { height: 48px; border-radius: var(--rs); border: 1px solid var(--sep); background: var(--card); color: var(--text); padding: 0 14px; font: 400 16px var(--font); outline: none; }
.field textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: none; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field.err input { border-color: #FF6B6B; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg button { height: 44px; border-radius: var(--rs); border: 1px solid var(--sep); background: var(--card); font-weight: 600; font-size: 15px; }
.seg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg3 button { font-size: 13px; padding: 0 4px; }
.seg button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* готово / пусто */
.center { padding: 72px 24px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.big-check { width: 72px; height: 72px; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.h1 { font-family: var(--display); font-weight: 800; font-size: 24px; margin: 0; }

/* заявки, друзья, помощь */
.page { padding: 24px 16px; display: flex; flex-direction: column; gap: 12px; }
.box { background: var(--card); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card2); }
.badge.in_work, .badge.paid { background: var(--accent); color: var(--on-accent); }
.badge.issued, .badge.closed { background: var(--green); color: var(--on-green); }
.badge.cancelled { background: transparent; color: var(--hint); border: 1px solid var(--sep); }
.link-box { font-family: var(--mono); font-size: 14px; word-break: break-all; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* кнопки */
.btn { height: 52px; border: 0; border-radius: var(--rs); background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; width: 100%; }
.btn:disabled { background: var(--card2); color: var(--hint); }
.btn-2 { height: 48px; border-radius: var(--rs); border: 1px solid var(--sep); background: transparent; font-weight: 600; font-size: 15px; width: 100%; }

/* нижняя панель */
#bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bar); border-top: 1px solid var(--sep); padding-bottom: env(safe-area-inset-bottom); }
#bar:empty { display: none; }
.bar-inner { max-width: 560px; margin: 0 auto; }
.actions { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 4px 8px; }
.tab { height: 54px; border: 0; background: transparent; color: var(--hint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; }
.tab.on { color: var(--accent-ink); }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--bar-h) + 70px + env(safe-area-inset-bottom)); max-width: 528px; margin: 0 auto; padding: 12px 14px; border-radius: var(--rs); background: var(--card2); font-size: 14px; line-height: 1.4; box-shadow: 0 6px 24px var(--shadow); z-index: 5; }
.skeleton { margin: 24px 16px; height: 120px; border-radius: var(--r); background: var(--card); }

/* этап 2: бонусы, файлы, оплата и правки */
.bonus-chip { align-self: flex-start; margin-top: 4px; border: 1px solid var(--accent); background: transparent; color: var(--accent-ink); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }
.bonus-toggle { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--sep); background: var(--card); }
.bonus-toggle.on { border-color: var(--accent); }
.box-check { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--hint); display: flex; align-items: center; justify-content: center; }
.bonus-toggle.on .box-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.box-check svg { width: 16px; height: 16px; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--rs); background: var(--card); font-size: 14px; word-break: break-all; }
button.link { border: 0; background: transparent; color: var(--accent-ink); font-weight: 600; padding: 4px; flex: none; }
.file-pick { display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.btn.small, .btn-2.small { height: 44px; font-size: 15px; }
.right { align-items: flex-end; text-align: right; }
.strike { text-decoration: line-through; font-size: 13px; }
.icon-btn.share { width: 44px; height: 44px; color: var(--text); }
.balance .price-big { font-size: 30px; }
.badge.new, .badge.payment_check { background: var(--accent); color: var(--on-accent); }
.badge.awaiting_payment { background: transparent; border: 1px solid var(--accent); color: var(--accent-ink); }
.badge.paid { background: var(--accent); color: var(--on-accent); }
