/* «Погоди» — static mockups. Tokens mirror design-system/tokens.json (formatVersion 1). */

@font-face {
  font-family: "Onest";
  src: url("fonts/Onest-variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: block;
}

:root {
  --canvas: #fafafa;
  --surface: #ffffff;
  --surface-muted: #f5f5f5;
  --surface-active: #eeeeee;
  --ink: #171717;
  --ink-muted: #666666;
  --ink-subtle: #737373;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --primary: #171717;
  --primary-hover: #343434;
  --on-primary: #ffffff;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --focus: #2563eb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #1d4ed8;
  --success-soft: #dbeafe;
  --warning: #475569;
  --warning-soft: #f1f5f9;

  --font: Onest, system-ui, sans-serif;
  --fs-body: 14px;
  --fs-small: 12px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;
  --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-pill: 9999px;

  --phone-w: 390px;
  --phone-h: 844px;
  --safe-bottom: 34px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--ink-muted); }
.subtle { color: var(--ink-subtle); }
.small { font-size: var(--fs-small); line-height: 16px; }

/* ---------- Stage (a page holding one or more phones) ---------- */

.stage {
  display: flex;
  gap: var(--s6);
  align-items: flex-start;
  padding: var(--s6);
  width: max-content;
}

.frame-col { display: flex; flex-direction: column; gap: var(--s2); }
.frame-label { font-size: var(--fs-small); color: var(--ink-subtle); line-height: 16px; }

/* ---------- Phone frame ---------- */

.phone {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone--long { height: auto; min-height: var(--phone-h); }

.statusbar {
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s6);
  font-size: var(--fs-small);
  font-weight: 600;
  background: var(--surface);
}
.statusbar .sb-right { display: flex; gap: 6px; align-items: center; }
.sb-glyph { width: 16px; height: 10px; border: 1px solid var(--ink); border-radius: 2px; }
.sb-glyph.bars { border: 0; background: linear-gradient(to right, var(--ink) 0 3px, transparent 3px 5px, var(--ink) 5px 8px, transparent 8px 10px, var(--ink) 10px 13px, transparent 13px); }

/* Telegram Mini App header */
.tg-header {
  height: 48px;
  flex: none;
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  padding: 0 var(--s3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tg-header .tg-left { display: flex; align-items: center; gap: var(--s1); color: var(--link); font-size: var(--fs-body); }
.tg-header .tg-title { text-align: center; font-weight: 600; line-height: 18px; }
.tg-header .tg-title .tg-sub { display: block; font-weight: 400; font-size: 11px; color: var(--ink-subtle); line-height: 14px; }
.tg-header .tg-right { display: flex; justify-content: flex-end; }
.tg-menu {
  height: 28px; padding: 0 var(--s2);
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
}
.tg-menu i { width: 3px; height: 3px; border-radius: 50%; background: var(--ink); display: block; }
.ico { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; }

.screen {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone--long .screen { overflow: visible; }

/* Telegram MainButton */
.main-button-wrap {
  flex: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--s2) var(--s3) var(--safe-bottom);
}
.main-button {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-md);
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
}
.main-button:hover { background: var(--primary-hover); }
.main-button[disabled] { background: var(--surface-active); color: var(--ink-subtle); }
.safe-area { height: var(--safe-bottom); flex: none; background: var(--surface); }
.home-indicator {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 134px; height: 5px; border-radius: var(--r-pill); background: var(--ink);
}

/* ---------- Layout primitives ---------- */

.section { padding: var(--s4); }
.section + .section { padding-top: 0; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap1 { gap: var(--s1); } .gap2 { gap: var(--s2); } .gap3 { gap: var(--s3); } .gap4 { gap: var(--s4); }

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.divider { height: 1px; background: var(--border); }

.eyebrow {
  font-size: var(--fs-small);
  color: var(--ink-subtle);
  line-height: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.h1 { font-size: 20px; line-height: 26px; font-weight: 500; }
.h2 { font-size: 16px; line-height: 22px; font-weight: 500; }
.price { font-size: 28px; line-height: 32px; font-weight: 500; letter-spacing: -0.01em; }
.price--card { font-size: 20px; line-height: 24px; font-weight: 500; }

/* ---------- Controls ---------- */

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 2px;
}
.segmented button {
  height: 28px;
  border-radius: var(--r-sm);
  color: var(--ink-muted);
  font-size: var(--fs-small);
  font-weight: 500;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--border);
}

.tabs { display: flex; gap: var(--s4); border-bottom: 1px solid var(--border); padding: 0 var(--s4); background: var(--surface); }
.tabs button { height: 40px; color: var(--ink-muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .count { color: var(--ink-subtle); font-weight: 400; margin-left: 2px; }

.search {
  height: 32px;
  display: flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink-subtle);
  font-size: var(--fs-small);
}
.icon-btn {
  width: 32px; height: 32px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink);
}

.btn {
  height: 36px; padding: 0 var(--s3);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  border-radius: var(--r-md);
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-sm { height: 28px; padding: 0 var(--s2); font-size: var(--fs-small); }

/* Verdict buttons */
.vote-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.vote {
  height: 56px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 16px;
  font-weight: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.vote small { font-size: 11px; font-weight: 400; color: var(--ink-subtle); line-height: 14px; }
.vote--approve { color: var(--success); }
.vote--reject { color: var(--danger); }
.vote--approve[aria-pressed="true"] { background: var(--success-soft); border-color: var(--success); }
.vote--reject[aria-pressed="true"] { background: var(--danger-soft); border-color: var(--danger); }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: var(--fs-small); color: var(--ink-muted); line-height: 16px; display: flex; justify-content: space-between; }
.field-label .req { color: var(--ink-subtle); }
.field-control {
  width: 100%;
  min-height: 40px;
  padding: 10px var(--s3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  line-height: 20px;
  color: var(--ink);
}
.field-control.placeholder { color: var(--ink-subtle); }
.field-control.is-focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.field-control.is-error { border-color: var(--danger); }
textarea.field-control, .field-control.area { min-height: 72px; resize: none; display: block; }
.field-hint { font-size: var(--fs-small); color: var(--ink-subtle); line-height: 16px; display: flex; justify-content: space-between; }
.field-hint.error { color: var(--danger); }
.affix { position: relative; }
.affix .field-control { padding-right: 36px; }
.affix .suffix { position: absolute; right: var(--s3); top: 10px; color: var(--ink-subtle); }

.dropzone {
  height: 96px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-muted);
  font-size: var(--fs-small);
}

/* Radio cards for "Куда отправить" */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.choice label {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s3);
  display: flex; flex-direction: column; gap: 4px;
}
.choice label b { font-weight: 500; }
.choice label span { font-size: var(--fs-small); color: var(--ink-subtle); line-height: 16px; }
.choice label.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.radio-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); display: inline-block; flex: none; }
.on .radio-dot { border: 4px solid var(--ink); }

.toggle { width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--border-strong); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); }
.toggle.on { background: var(--ink); }
.toggle.on::after { left: 18px; }

/* ---------- Status pills ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 var(--s2);
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}
.pill--approved { background: var(--success-soft); color: var(--success); }
.pill--rejected { background: var(--danger-soft); color: var(--danger); }
.pill--pending { background: var(--warning-soft); color: var(--warning); }
.pill--neutral { background: var(--surface-muted); color: var(--ink-muted); border: 1px solid var(--border); }

.v-approve { color: var(--success); }
.v-reject { color: var(--danger); }

/* ---------- Thumbnails (wireframe placeholders) ---------- */

.thumb {
  flex: none;
  width: 64px; height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-muted);
  color: var(--ink-subtle);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.thumb svg { width: 60%; height: 60%; }
.thumb--lg { width: 100%; height: 200px; border-radius: var(--r-lg); }
.thumb--lg svg { width: 120px; height: 120px; }

/* ---------- Feed card ---------- */

.feed { display: flex; flex-direction: column; gap: var(--s2); padding: 0 var(--s4) var(--s4); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s3);
  display: flex; flex-direction: column; gap: var(--s2);
}
.card-top { display: flex; gap: var(--s3); }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink-muted);
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fs-small); line-height: 16px; color: var(--ink-subtle);
  padding-top: var(--s2);
  border-top: 1px solid var(--border);
}
.tally { display: flex; align-items: center; gap: var(--s2); }
.tally-bar { width: 56px; height: 4px; border-radius: var(--r-pill); background: var(--danger-soft); overflow: hidden; display: flex; }
.tally-bar i { display: block; height: 100%; background: var(--success); }
.tally-bar b { display: block; height: 100%; background: var(--danger); flex: 1; }

/* ---------- Key/value table ---------- */

.kv { display: grid; grid-template-columns: 112px 1fr; }
.kv > div { padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--ink-subtle); font-size: var(--fs-small); line-height: 20px; }
.kv .v { color: var(--ink); }

/* ---------- Verdict list ---------- */

.verdicts { display: flex; flex-direction: column; }
.verdict { padding: var(--s3) 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; column-gap: var(--s3); row-gap: 4px; }
.verdict:last-child { border-bottom: 0; }
.verdict-head { grid-column: 1 / -1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict-head .sep { color: var(--ink-subtle); font-weight: 400; margin: 0 4px; }
.verdict-head .nick { color: var(--ink); }
.verdict-text { grid-column: 1 / -1; }
.verdict-time { grid-column: 1; font-size: var(--fs-small); color: var(--ink-subtle); line-height: 16px; }
.tip {
  grid-column: 2; grid-row: 3; align-self: center; margin-top: -4px;
  height: 28px; padding: 0 var(--s2);
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--fs-small);
  color: var(--ink-muted);
}
.tip.on { border-color: var(--success); color: var(--success); background: var(--success-soft); }

/* ---------- Toast ---------- */

.toast {
  position: absolute; left: var(--s3); right: var(--s3);
  display: flex; align-items: flex-start; gap: var(--s2);
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--danger);
  border-radius: var(--r-lg);
  color: var(--ink);
}
.toast .t-ico { color: var(--danger); margin-top: 2px; }
.toast b { color: var(--danger); font-weight: 500; display: block; }
.toast .t-action { margin-left: auto; color: var(--link); white-space: nowrap; font-size: var(--fs-small); }

/* ---------- Skeleton ---------- */

.sk { background: var(--surface-active); border-radius: var(--r-sm); }
.sk-line { height: 10px; }

/* ---------- Empty state ---------- */

.empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: var(--s2);
  padding: var(--s8) var(--s6);
}
.empty-mark {
  width: 56px; height: 56px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: var(--ink-subtle);
  margin-bottom: var(--s2);
}

/* ---------- Result screen ---------- */

.verdict-hero { padding: var(--s6) var(--s4) var(--s4); text-align: left; }
.verdict-word { font-size: 40px; line-height: 44px; font-weight: 500; letter-spacing: -0.02em; }
.score { display: flex; align-items: baseline; gap: var(--s2); font-size: 20px; font-weight: 500; }
.score .colon { color: var(--ink-subtle); }
.bigbar { height: 8px; border-radius: var(--r-pill); overflow: hidden; display: flex; background: var(--surface-active); }
.bigbar i { background: var(--danger); }
.bigbar b { background: var(--success); }
.saved {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s3) var(--s4);
  background: var(--success-soft);
  border-radius: var(--r-lg);
  color: var(--success);
}
.saved .amt { font-size: 20px; font-weight: 500; }

.quiet-link { color: var(--ink-subtle); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); font-size: var(--fs-small); }

/* ---------- Telegram chat (share screen) ---------- */

.chat { flex: 1; background: #eef1f4; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); justify-content: flex-end; }
.bubble {
  max-width: 300px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s2) var(--s3);
  border: 1px solid var(--border);
}
.bubble.out { align-self: flex-end; background: #e3f0ff; border-color: #cfe2fb; }
.bubble .b-time { float: right; margin: 6px 0 -4px 8px; font-size: 11px; color: var(--ink-subtle); line-height: 14px; }
.lp { border-left: 2px solid var(--link); padding-left: var(--s2); margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.lp .lp-site { color: var(--link); font-weight: 500; font-size: var(--fs-small); line-height: 16px; }
.lp .lp-title { font-weight: 500; line-height: 18px; }
.lp .lp-desc { color: var(--ink-muted); font-size: var(--fs-small); line-height: 16px; }
.lp .og-mini { margin-top: 6px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.inline-kb { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px; max-width: 300px; align-self: flex-end; width: 100%; }
.inline-kb span { height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-md); background: rgba(23,23,23,0.06); font-size: var(--fs-small); font-weight: 500; color: var(--ink); }
.composer { flex: none; display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); background: var(--surface); border-top: 1px solid var(--border); }
.composer .c-field { flex: 1; height: 36px; border: 1px solid var(--border); border-radius: var(--r-pill); padding: 0 var(--s3); display: flex; align-items: center; color: var(--ink-subtle); }

/* OG card: authored at 1200×630, shown at half size (600×315) */
.og {
  width: 600px; height: 315px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  display: grid;
  grid-template-columns: 1fr 200px;
  overflow: hidden;
}
.og-main { padding: 28px 32px; display: flex; flex-direction: column; }
.og-brand { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-small); color: var(--ink-subtle); }
.og-brand .mark { width: 20px; height: 20px; border-radius: var(--r-sm); background: var(--ink); color: var(--on-primary); font-weight: 600; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.og-title { font-size: 24px; line-height: 30px; font-weight: 500; margin-top: 20px; letter-spacing: -0.01em; }
.og-price { font-size: 44px; line-height: 48px; font-weight: 500; margin-top: 8px; letter-spacing: -0.02em; }
.og-ask { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border); }
.og-ask b { font-weight: 500; font-size: 16px; white-space: nowrap; }
.og-ask span { white-space: nowrap; }
.og-side { background: var(--surface-muted); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.og-side .thumb { flex: 1; width: auto; height: auto; border: 0; border-radius: 0; }
.og-side .thumb svg { width: 110px; height: 110px; }
.og-votes { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.og-votes div { padding: 12px; text-align: center; font-weight: 500; }
.og-votes div + div { border-left: 1px solid var(--border); }

/* mini scale of OG inside a bubble */
.og--mini { transform: scale(0.43); transform-origin: top left; }
.og-mini-box { width: 258px; height: 136px; overflow: hidden; }
