:root {
  --accent: #00AE42;
  --accent-2: #00C853;
  --accent-press: #008F36;
  --accent-soft: rgba(0, 174, 66, 0.14);
  --accent-grad: linear-gradient(135deg, #00C853 0%, #00AE42 55%, #00963A 100%);
  --bg: #F2F3F5;
  --card: #FFFFFF;
  --text: #1C1E21;
  --muted: #6A7078;
  --line: #E3E5E8;
  --shadow: 0 1px 2px rgba(20, 24, 28, 0.04), 0 10px 28px rgba(20, 24, 28, 0.07);
  --shadow-press: 0 1px 2px rgba(20, 24, 28, 0.05), 0 4px 14px rgba(20, 24, 28, 0.06);
  --ok-bg: #E7F6EE;
  --ok: #067A32;
  --wait-bg: #FFF4D8;
  --wait: #8A5A00;
  --err-bg: #FDECEC;
  --err: #B42318;
  --muted-bg: #ECEEEF;
  --run-bg: #E7F6EE;
  --run: #067A32;
  --input: #F7F8F9;
  --danger: #B42318;
  --radius: 22px;
  --radius-s: 16px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 0.9, 0.28, 1);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

html.theme-dark {
  --bg: #101214;
  --card: #1A1D21;
  --text: #F3F4F6;
  --muted: #98A0A8;
  --line: #2A2F34;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 30px rgba(0, 0, 0, 0.32);
  --shadow-press: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.28);
  --ok-bg: #143224;
  --ok: #3DDC84;
  --wait-bg: #3A3016;
  --wait: #F5C451;
  --err-bg: #3A1E1E;
  --err: #FF8D85;
  --muted-bg: #24282D;
  --run-bg: #143224;
  --run: #3DDC84;
  --input: #14181B;
  --danger: #FF8D85;
  --accent-soft: rgba(61, 220, 132, 0.16);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 2px 8px;
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.mark {
  width: 42px; height: 42px; border-radius: 15px; background: var(--accent-grad);
  color: #fff; font-weight: 800; font-size: 22px; line-height: 1;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 6px 14px rgba(0, 174, 66, 0.32);
}
.eyebrow { margin: 0; font-size: 12px; letter-spacing: 0.02em; color: var(--muted); font-weight: 600; }
.topbar h1 { margin: 0; font-size: 18px; line-height: 1.2; font-weight: 800; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); display: grid; place-items: center; color: var(--text);
}
.icon-btn svg { width: 20px; height: 20px; }

.banner {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--wait-bg);
  color: var(--wait);
  font-size: 14px;
  font-weight: 600;
}
.banner.err { background: var(--err-bg); color: var(--err); }
.banner.demo { background: var(--accent-soft); color: var(--ok); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 12px 0;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.hero { position: relative; overflow: hidden; padding-left: 18px; }
.hero[data-job] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hero[data-job]:active { transform: scale(0.985); }
.hero::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--rail, var(--accent));
}
.tone-run { --rail: var(--accent); }
.tone-wait { --rail: #E2A100; }
.tone-error { --rail: var(--danger); }
.tone-ok { --rail: var(--accent); }
.tone-muted { --rail: #C5C8CC; }
html.theme-dark .tone-muted { --rail: #4A5056; }

.kicker {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
h2 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px 4px 8px;
  font-size: 12px; font-weight: 700; background: var(--muted-bg); color: var(--muted);
}
.chip i { width: 7px; height: 7px; border-radius: 99px; background: currentColor; display: block; }
.chip.run { background: var(--run-bg); color: var(--run); }
.chip.run i { animation: pulse-dot 1.6s ease-in-out infinite; }
.chip.wait { background: var(--wait-bg); color: var(--wait); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.error { background: var(--err-bg); color: var(--err); }
.chip.muted { background: var(--muted-bg); color: var(--muted); }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  55% { box-shadow: 0 0 0 5px transparent; }
}

.bar-meta { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; font-weight: 700; }
.bar-meta span { color: var(--muted); font-weight: 600; }
.bar-meta b { color: var(--accent); font-variant-numeric: tabular-nums; }
.bar {
  margin-top: 8px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden;
}
.bar > span {
  display: block; height: 100%; border-radius: inherit;
  background: var(--accent-grad);
  background-size: 200% 100%;
  width: 0; transition: width 0.45s var(--ease);
  position: relative; overflow: hidden;
}
.bar > span::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: translateX(-100%); animation: bar-shine 2.2s var(--ease) infinite;
}
@keyframes bar-shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 13px; min-height: 86px; box-shadow: var(--shadow-press);
  transition: transform 0.18s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tile:active { transform: scale(0.98); }
.tile svg { width: 18px; height: 18px; color: var(--muted); }
.tile p { margin: 8px 0 2px; font-size: 12px; color: var(--muted); font-weight: 700; }
.tile b { font-size: 15px; font-weight: 800; }
.tile.bad b { color: var(--err); }
.tile.good b { color: var(--ok); }

label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.4; }
input[type="text"], input[type="url"], input[type="number"], input[type="password"], textarea {
  width: 100%; border: 1px solid var(--line); background: var(--input);
  border-radius: var(--radius-s); padding: 13px 14px; font-size: 16px; outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--card); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; border-radius: var(--radius-s); border: 0;
  background: var(--accent-grad); color: #fff; font-weight: 800; font-size: 15px;
  margin-top: 10px;
  box-shadow: 0 6px 16px rgba(0, 174, 66, 0.28);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.975); box-shadow: 0 3px 10px rgba(0, 174, 66, 0.22); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.secondary:active { background: var(--input); }
.btn.quiet { background: var(--input); color: var(--text); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid transparent; min-height: 40px; box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; filter: none; transform: none; box-shadow: none; }
.btn.sent, .btn.sent:disabled, .btn.sent[aria-disabled="true"] {
  background: #e91e63; color: #fff; border-color: #e91e63;
  opacity: 1; cursor: default; filter: none; transform: none; box-shadow: none;
}
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row .btn { margin-top: 8px; }

.section { margin: 18px 2px 8px; font-size: 18px; font-weight: 800; }

.job {
  display: flex; gap: 12px; align-items: center; text-align: left;
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 13px; margin: 8px 0; box-shadow: var(--shadow-press);
  transition: transform 0.18s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.job:active { transform: scale(0.985); border-color: var(--accent); }
.job .grow { flex: 1; min-width: 0; }
.job strong { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job em { display: block; margin-top: 3px; font-style: normal; color: var(--muted); font-size: 12px; font-weight: 600; }
.chev { color: var(--muted); flex: none; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px; white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.filters button:active { transform: scale(0.95); }
.filters button.on { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(0, 174, 66, 0.25); }

.gallery { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin: 0 -2px; }
.shot {
  flex: none; width: 148px; height: 196px; border-radius: var(--radius-s); overflow: hidden;
  border: 1px solid var(--line); background: var(--input); position: relative;
  box-shadow: var(--shadow-press);
  transition: transform 0.18s var(--ease), box-shadow 0.2s var(--ease);
}
.shot:active { transform: scale(0.97); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-view { display: block; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; }
.image-viewer { margin: 0; padding: 16px; padding-top: max(16px, env(safe-area-inset-top));
  inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  border: 0; background: var(--bg); color: var(--text); }
.image-viewer[open] { display: flex; flex-direction: column; gap: 12px; }
.image-viewer header, .image-viewer footer { flex: none; }
.image-viewer img { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.image-viewer .btn { margin: 0; text-decoration: none; }
.image-viewer #image-viewer-status { font-size: 14px; line-height: 1.45; margin: 0; }
.shot span {
  position: absolute; left: 8px; bottom: 8px; background: rgba(20,22,24,0.72); color: #fff;
  border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700;
}

.facts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.fact { background: var(--input); border-radius: 14px; padding: 10px; }
.fact span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.fact b { display: block; margin-top: 4px; font-size: 13px; font-weight: 800; }

.ledger { list-style: none; margin: 8px 0 0; padding: 0; }
.ledger li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.ledger li span { color: var(--muted); }
.ledger li b { font-variant-numeric: tabular-nums; font-weight: 800; }
.ledger li.net { border-bottom: 0; padding-top: 12px; }
.ledger li.net span, .ledger li.net b { color: var(--text); font-size: 16px; }
.pos { color: var(--ok) !important; }
.neg { color: var(--err) !important; }

.back {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: 0;
  color: var(--accent); font-weight: 800; padding: 8px 0; font-size: 14px;
}

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  z-index: 5;
}
.tabs button {
  background: none; border: 0; color: var(--muted);
  display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; padding: 4px 0;
  border-radius: 12px;
  transition: color 0.2s var(--ease), transform 0.15s var(--ease);
}
.tabs button:active { transform: scale(0.92); }
.tabs button svg { width: 22px; height: 22px; }
.tabs button.on { color: var(--accent); }
.tabs button.on svg { filter: drop-shadow(0 2px 6px rgba(0, 174, 66, 0.4)); }

.gate { padding-top: 28px; max-width: 440px; margin: 0 auto; }
.gate label, .gate .hint { font-size: 14px; }
.gate a.btn { text-decoration: none; }
.gate h2 { font-size: 28px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }

.skel { height: 92px; border-radius: var(--radius); margin: 12px 0; background: linear-gradient(90deg, var(--line), var(--card) 40%, var(--line)); background-size: 200% 100%; animation: shine 1.4s infinite; }
@keyframes shine { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  background: var(--text); color: var(--bg); border-radius: var(--radius-s); padding: 13px 16px;
  font-weight: 700; font-size: 14px; z-index: 6; max-width: 488px; margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.3s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hidden { display: none; }
@media (prefers-reduced-motion: reduce) {
  .bar > span, .bar > span::after, .skel, .chip.run i, .toast { transition: none; animation: none; }
}

/* ярлык на главном экране */
.home-icon { border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 174, 66, 0.28); }
.home-card .btn { margin-top: 12px; }
.home-ok { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-weight: 700; color: var(--accent); }
.home-ok svg { width: 20px; height: 20px; }
.home-hint { display: grid; grid-template-columns: 44px 1fr; gap: 10px 12px; align-items: center; }
.home-hint img { border-radius: 11px; }
.home-hint-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.home-hint-actions .btn { margin-top: 0; }

/* загрузка инфографики и фото */
.upload-card { margin-top: 14px; }
.upload-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; cursor: pointer; }
.upload-btn svg { flex: none; }
.upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Local design choices and manual AI handoff. */
#design-palette { width: 100%; padding: 12px; background: var(--input); border: 1px solid var(--line); border-radius: 12px; }
.design-sources { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; }
.design-source { flex: 0 0 88px; border: 2px solid var(--line); border-radius: 12px; padding: 4px; background: var(--input); }
.design-source[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.design-source img { width: 76px; height: 90px; object-fit: contain; border-radius: 8px; }
.design-source span { display: block; font-size: 12px; padding: 4px 0; }
#design-ai-prompt { width: 100%; resize: vertical; font-size: 13px; }
#studio-design .design-controls { flex-wrap: wrap; }
#studio-design .design-controls button { border: 1px solid var(--line); border-radius: 8px; background: var(--input); padding: 8px; font-size: 12px; }

/* сохранение картинок в галерею */
.shot { position: relative; }
.shot-save { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0;
  display: flex; align-items: center; justify-content: center; background: rgba(0, 174, 66, 0.92); color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); cursor: pointer; padding: 0; }
.shot-save:active { background: var(--accent-press, #00963a); }
.shot-save { width: 48px; height: 48px; z-index: 3; touch-action: manipulation; }
.shot-save svg { pointer-events: none; }
.shot-save:disabled { opacity: .6; }
.download-status { position: fixed; z-index: 20; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px);
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; box-shadow: 0 4px 20px #0002; font-size: 14px; }
.download-status[hidden] { display: none; }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.save-row .hint { font-size: 14px; }
.save-all { display: flex; align-items: center; gap: 6px; width: auto; min-height: 38px; padding: 0 14px; margin-top: 0; flex: none; }

/* несколько фото: место в карточке и удаление */
.shot.in-card { border-color: var(--accent); }
.shot-order { position: absolute; top: 8px; left: 8px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.shot-order.local { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.shot-remove { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(20, 22, 24, 0.78); color: #fff; font-size: 14px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }

/* категория WB: автоподбор и смена */
.cat-toggle { margin-top: 4px; min-height: 40px; }
.cat-list { display: grid; gap: 6px; margin-top: 8px; }
.cat-item { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 8px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--input); color: var(--text); cursor: pointer; }
.cat-item b { font-size: 14px; }
.cat-item span { grid-column: 1; font-size: 12px; color: var(--muted); }
.cat-item svg { grid-column: 2; grid-row: 1 / span 2; width: 20px; height: 20px; align-self: center; color: var(--accent); }
.cat-item.on { border-color: var(--accent); }

/* своя инфографика: запрос для ChatGPT и ручная загрузка */
.own-toggle { margin-top: 12px; min-height: 44px; }
.own-hint { margin: 6px 0 0; }
.own-menu { display: grid; gap: 12px; margin-top: 10px; padding-left: 10px; border-left: 3px solid var(--line); }

.design-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.design-item { min-width: 0; display: grid; gap: 5px; }
.design-item img { width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; background: var(--input); object-fit: contain; }
.design-item strong { font-size: 13px; color: var(--text); }
.design-controls { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; font-size: 13px; }
.design-controls a { display: inline-flex; align-items: center; min-height: 40px; color: var(--accent); }
.design-replace { position: relative; display: flex; align-items: center; min-height: 40px; margin: 0; color: var(--accent); cursor: pointer; }
.design-replace input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.design-replace:focus-within { outline: 2px solid var(--accent); border-radius: 6px; }

.published-picture { width: 100%; max-height: 340px; object-fit: contain; border-radius: 12px; background: var(--bg); }
.published-model h3 { margin: 12px 0 4px; }
.published-model input { font-size: 12px; }
.source-file { margin: 12px 0; overflow-wrap: anywhere; }
.published-model summary { cursor: pointer; margin-top: 14px; }

.model-path { display: block; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: normal; padding: 10px; background: var(--bg); border-radius: 8px; user-select: text; -webkit-user-select: text; }
.model-link { display: block; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: normal; padding: 10px; background: var(--bg); border-radius: 8px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.published-model .model-link { margin-top: 10px; }
.source-file b { display: block; margin-bottom: 4px; }

/* === UI v30: слой полировки === */
.icon-btn { transition: transform 0.15s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease); }
.icon-btn:active { transform: scale(0.92); background: var(--input); }

.banner {
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  backdrop-filter: blur(6px);
}
.banner.demo { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

.hero { border-left: 0; padding-left: 18px; }
.hero::before { width: 5px; border-radius: 0 4px 4px 0; }

.fact { transition: transform 0.15s var(--ease); }
.fact:active { transform: scale(0.97); }

.ledger li { transition: background 0.15s var(--ease); border-radius: 8px; padding-left: 6px; padding-right: 6px; }
.ledger li.net { background: var(--accent-soft); }

.cat-item { transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease); }
.cat-item:active { transform: scale(0.98); }
.cat-item.on { background: var(--accent-soft); }

.design-item img { transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.design-item:active img { transform: scale(0.98); }

.empty b { letter-spacing: -0.01em; }
.gate h2 { letter-spacing: -0.03em; }

@media (min-width: 521px) {
  .app { padding-top: 8px; }
  .card, .job, .tile { border-radius: var(--radius); }
}

/* нумерация сгенерированных карточек: места 1–4 в карточке WB */
.design-gallery { margin-top: 12px; }
.design-shot .place-row { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 4px; }
.design-shot > span { bottom: 44px; }
.place-btn {
  flex: 1; min-height: 30px; padding: 0; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92); color: var(--text); font-size: 13px; font-weight: 800;
  cursor: pointer; line-height: 1;
}
.place-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.place-btn:disabled { opacity: 0.45; cursor: default; }

/* выбор количества GPT-карточек: 1, 2, 3 или 4 */
.gen-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.gen-counts .count-btn { margin: 0; }
.color-pick { margin: 6px 0 10px; }
.color-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.color-chips .color-chip { margin: 0; min-height: 40px; }
.color-chips .color-chip.active { outline: 2px solid var(--accent, currentColor); outline-offset: -2px; }
.color-custom { display: flex; gap: 8px; margin-top: 8px; }
.color-custom input { flex: 1; min-width: 0; }

/* кольцо прогресса GPT-генерации */
.gen-ring { position: relative; width: 64px; margin: 12px auto 4px; }
.gen-ring svg { display: block; }
.gen-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.gen-ring-bg { fill: none; stroke: var(--line); stroke-width: 6; }
.gen-ring-fg { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.7s var(--ease); }

/* перетаскивание блоков экрана заявки */
.sect { position: relative; }
.sect-handle {
  position: absolute; top: 6px; right: 6px; z-index: 3; width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--input); color: var(--muted);
  font-size: 15px; line-height: 1; cursor: grab; opacity: 0.45; touch-action: none; padding: 0;
}
.sect-handle:active { cursor: grabbing; opacity: 0.9; }
.sect.dragging { opacity: 0.55; }
.sect.drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.sect.drop-after { box-shadow: 0 3px 0 0 var(--accent); }
.tile { position: relative; }
.tile-hide { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%; background: rgba(127,127,127,.18); color: inherit; font-size: 14px; line-height: 22px; cursor: pointer; opacity: .55; }
.tile-hide:active { opacity: 1; }
.tile-restore { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tile-chip { border: 1px dashed rgba(127,127,127,.45); background: transparent; color: inherit; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.status-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 34px 0 0; border: none; background: transparent; color: inherit; cursor: pointer; font-family: inherit; text-align: left; }
.status-head .kicker { margin: 0; }
.status-caret { font-size: 14px; opacity: .6; }
.status-body { margin-top: 10px; }
.sect-strip { display: flex; align-items: center; justify-content: center; height: 26px; margin: -2px 0 6px; border-radius: 8px; background: rgba(127,127,127,.14); color: inherit; opacity: .65; font-size: 15px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
/* own20: лист «Проверьте тексты перед генерацией» */
/* own22: высота по видимой области (клавиатура iOS), тело скроллится, кнопки остаются внизу */
.brief-sheet { margin: auto 0 0; width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh; max-height: var(--brief-sheet-max, 90dvh); padding: 16px 16px max(16px, env(safe-area-inset-bottom)); border: none; border-radius: 22px 22px 0 0; background: var(--card); color: var(--text); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; }
.brief-sheet[open] { display: flex; flex-direction: column; }
@media (min-width: 640px) { .brief-sheet { margin: auto; border-radius: 22px; } }
.brief-sheet::backdrop { background: rgba(0, 0, 0, 0.5); }
.brief-sheet header { flex: none; }
.brief-sheet header h3 { margin: 0; font-size: 17px; }
.brief-body { flex: 1 1 auto; min-height: 120px; overflow-x: hidden; overflow-y: auto; margin: 10px 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.brief-list { margin: 0; }
.brief-list dt { margin: 10px 0 2px; color: var(--muted); font-size: 12px; font-weight: 700; }
.brief-list dd { margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.brief-list ul { margin: 0; padding-left: 18px; }
.brief-desc { max-height: 120px; overflow-y: auto; white-space: pre-wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--input); }
.brief-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.brief-actions .btn { margin: 0; width: 100%; }

/* own21: поля правки всех текстов в листе одобрения */
.brief-sheet textarea { width: 100%; min-height: 110px; resize: vertical; box-sizing: border-box; }
.brief-card { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.brief-sheet input[type="text"] { width: 100%; box-sizing: border-box; }
.brief-actions { position: sticky; bottom: 0; z-index: 1; background: var(--card); padding-top: 8px; }

/* own23: ошибка названия — подсветка поля; тап по названию открывает правку */
.brief-sheet input.brief-invalid,
.brief-sheet textarea.brief-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px var(--err-bg); }
.brief-jump { cursor: pointer; }

/* own28: несколько цветов — число карточек на цвет и галерея по цветам */
.plan-colors { display: grid; gap: 8px; margin: 8px 0; }
.plan-color { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 12px; }
.plan-color .hint { margin: 0; }
.plan-go { width: 100%; margin-top: 4px; }
.variant-group { margin-top: 14px; }
.variant-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.variant-head .kicker { margin: 0; }
