/* StyleDNA — токены и компоненты. Источник: design/mockups (согласовано). */
:root {
  --ground: #EDEEF0; --surface: #FFFFFF; --surface-2: #E3E5E9; --ink: #121419; --muted: #5B616C;
  --line: #CDD1D7; --accent: #7A1F33; --accent-ink: #FFFFFF; --chalk: #E3C35A; --good: #2F6B4F;
  --invert-bg: #121419; --invert-ink: #EDEEF0; --invert-muted: #9AA0AA;
  --shadow: 0 1px 2px rgba(18,20,25,.06), 0 12px 32px -12px rgba(18,20,25,.18);
  --serif: "Prata", "Didot", "Bodoni 72", "Times New Roman", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --e: cubic-bezier(.32,.72,0,1);
  --r1: 6px; --r2: 14px; --r3: 22px;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #101114; --surface: #191B1F; --surface-2: #23262B; --ink: #ECEDEF; --muted: #9AA0AA;
    --line: #2E3238; --accent: #D46A7E; --accent-ink: #16080C; --good: #6FBF95;
    --invert-bg: #ECEDEF; --invert-ink: #121419; --invert-muted: #5B616C;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.7);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: -.01em; line-height: 1.08; hyphens: auto; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── buttons & chips ─────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; padding: 14px 22px; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; transition: transform .5s var(--e), background .3s, opacity .3s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--ink); color: var(--ground); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover:not(:disabled) { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-chalk { background: var(--chalk); color: #121419; }
.btn-block { width: 100%; }
.btn .arr { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, currentColor 16%, transparent); font-size: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.link.danger { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); color: var(--ink); border: 0; text-decoration: none; transition: background .2s, color .2s; }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); box-shadow: none; }
.chip .sw { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
label.chip { cursor: pointer; }
label.chip:has(input:checked) { background: var(--ink); color: var(--ground); box-shadow: none; }
label.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
label.chip input { position: absolute; opacity: 0; pointer-events: none; }

/* ── bars, meters ────────────────────────────────────────────────────────── */
.bar { height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .6s var(--e); }
.num { font-family: var(--mono); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.meter { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.meter i { width: 12px; height: 4px; border-radius: 2px; background: var(--surface-2); }
.meter i.on { background: var(--accent); }
.rows { display: grid; gap: 8px; }
.rows .row { display: grid; grid-template-columns: 96px 1fr 38px; gap: 10px; align-items: center; font-size: 13px; }
.tape-rule { height: 12px; background:
  repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 10px) bottom/100% 6px no-repeat,
  repeating-linear-gradient(90deg, var(--muted) 0 1px, transparent 1px 50px) bottom/100% 12px no-repeat; }

/* ── look card & swipe stack ─────────────────────────────────────────────── */
.stack { position: relative; width: min(340px, 100%); aspect-ratio: 3/4; }
.look { position: absolute; inset: 0; border-radius: var(--r3); overflow: hidden; box-shadow: var(--shadow); touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform .45s var(--e), opacity .45s; background: var(--surface-2); }
.look > svg.fl, .look > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.look .cap { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; justify-content: space-between; align-items: end; gap: 8px; padding: 12px 14px; border-radius: var(--r2); background: rgba(255,255,255,.84); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #121419; }
.look .cap b { font-family: var(--serif); font-weight: 400; font-size: 19px; display: block; line-height: 1.15; }
.look .cap span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #5B616C; }
.stamp { position: absolute; top: 22px; padding: 6px 12px; border: 2px solid; border-radius: 8px; font-family: var(--mono); font-weight: 500; font-size: 14px; letter-spacing: .14em; opacity: 0; background: rgba(255,255,255,.75); pointer-events: none; }
.stamp.yes { left: 18px; color: #2F6B4F; transform: rotate(-10deg); }
.stamp.no { right: 18px; color: #7A1F33; transform: rotate(10deg); }
.ctrl { display: flex; gap: 16px; align-items: center; justify-content: center; }
.round { width: 58px; height: 58px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); transition: transform .4s var(--e); }
.round:hover { transform: translateY(-2px); }
.round:active { transform: scale(.94); }
.round svg { width: 22px; height: 22px; }
.round.like { background: var(--accent); color: var(--accent-ink); }

/* ── item tag (бирка) ────────────────────────────────────────────────────── */
.tag { border-radius: var(--r2); background: var(--surface); padding: 8px; display: grid; gap: 6px; border: 0; text-align: left; color: var(--ink); }
.tag .img { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.tag .img img { width: 100%; height: 100%; object-fit: cover; }
.tag .img svg { width: 70%; height: 70%; }
.tag .t { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 600; padding-inline: 2px; }
.tag .t i { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.label-card { border: 1px dashed var(--line); border-radius: var(--r1); padding: 10px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; font-size: 13px; }
.label-card small { display: block; color: var(--muted); font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.label-card select { width: 100%; border: 0; background: transparent; padding: 0; font-weight: 600; font-size: 14px; appearance: none; -webkit-appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: right 6px center, right 2px center; background-size: 4px 4px; background-repeat: no-repeat; padding-right: 14px; }
.label-card option { color: #121419; background: #fff; }
.thumb { width: 64px; height: 64px; border-radius: var(--r1); display: grid; place-items: center; background: var(--surface-2); flex: none; }
.thumb svg { width: 75%; height: 75%; }

/* ── fields ──────────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r2); background: var(--surface); }
.field .k { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.field .k b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.field input[type="text"], .field input[type="number"], .field input[type="tel"], .field textarea { width: 100%; border: 0; background: transparent; padding: 0; font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; outline: none; }
.field textarea { font-family: var(--sans); resize: vertical; min-height: 64px; }
.field:focus-within { box-shadow: inset 0 0 0 1px var(--ink); }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
input[type="range"].tape { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; border-radius: 4px; margin: 4px 0 0; cursor: ew-resize;
  background: repeating-linear-gradient(90deg, #121419 0 1px, transparent 1px 6px) 0 0/100% 7px no-repeat,
              repeating-linear-gradient(90deg, #121419 0 1px, transparent 1px 30px) 0 0/100% 13px no-repeat, var(--chalk); }
input[type="range"].tape::-webkit-slider-thumb { -webkit-appearance: none; width: 4px; height: 38px; border-radius: 2px; background: var(--accent); border: 0; }
input[type="range"].tape::-moz-range-thumb { width: 4px; height: 38px; border-radius: 2px; background: var(--accent); border: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); }
.seg label { position: relative; text-align: center; padding: 9px 6px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg label:has(input:checked) { background: var(--ink); color: var(--ground); }
.seg input { position: absolute; opacity: 0; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ── sheet, toast ────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(10,12,15,.45); z-index: 50; animation: fade .3s var(--e); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 40px -10px rgba(0,0,0,.3); display: grid; gap: 14px; animation: up .45s var(--e); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); justify-self: center; }
.sheet h3 { font-size: 26px; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(460px, calc(100vw - 32px)); transform: translate(-50%, -50%); border-radius: var(--r3); padding: 22px 24px 24px; animation: pop .4s var(--e); }
  .sheet .grab { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -46%); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 20px; background: var(--invert-bg); color: var(--invert-ink); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: up .4s var(--e); display: flex; gap: 12px; align-items: center; }
.toast { pointer-events: none; width: max-content; }
.toast a { color: var(--chalk); pointer-events: auto; }
.rec { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.rec .img { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.rec .img img { width: 100%; height: 100%; object-fit: cover; }
.conf { display: grid; gap: 6px; }
.conf div { display: grid; grid-template-columns: 76px 1fr 32px; gap: 8px; align-items: center; font-size: 13px; }
.conf div:not(:first-child) { color: var(--muted); }
.conf div:not(:first-child) .bar i { background: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.status { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
