:root {
  --paper: #eef0ea;
  --card: #fbfcf9;
  --ink: #17211d;
  --muted: #5b6761;
  --line: #d3d8cf;
  --route: #2b3fd8;
  --route-deep: #1f2fae;
  --route-pale: #d4daf7;
  --spark: #f4c430;
  --ok: #1d7a4a;
  --ok-bg: #e2f0e7;
  --bad: #b03a26;
  --bad-bg: #f7e4df;
  --wait: #866400;
  --display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --text: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--route); text-underline-offset: 3px; }
a:hover { color: var(--route-deep); }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.15; }
h1 { font: 700 clamp(2rem, 4.6vw, 3.25rem)/1.08 var(--display); letter-spacing: -.015em; }
h2 { font: 500 1.4rem/1.2 var(--display); letter-spacing: -.01em; }
h3 { font-weight: 600; font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.skip:hover, .skip:focus { color: #fff; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* шапка */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 700 1.35rem/1 var(--display); letter-spacing: -.02em; }
.logo svg { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.logo svg rect { fill: var(--spark); }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-weight: 500; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--route); text-decoration-thickness: 2px; }
.nav form { margin: 0; }
.nav .btn { color: #fff; }
.lang { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang a { font-size: .8rem; padding: 2px 8px; border-radius: 999px; color: var(--muted); }
.lang a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--route); color: #fff; border: 2px solid var(--route);
  font: 600 1rem/1.2 var(--text); padding: .8rem 1.25rem; border-radius: 10px;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--route-deep); border-color: var(--route-deep); color: #fff; }
.btn:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-small { padding: .45rem .85rem; font-size: .92rem; border-radius: 8px; }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #8e2d1c; border-color: #8e2d1c; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.linkish:hover { text-decoration-color: currentColor; }
.linkish.danger { color: var(--bad); }

/* главная */
.hero { display: grid; gap: 32px; align-items: center; padding-top: 48px; padding-bottom: 56px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr 1fr; padding-top: 80px; padding-bottom: 88px; } }
.hero h1 { max-width: 15ch; }
.lead { font-size: 1.15rem; max-width: 34em; color: #2c3833; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 18px; }
.note { font-size: .95rem; color: var(--muted); max-width: 34em; }
.routes { margin: 0; }
.routes svg { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.frame-bg { fill: var(--route-pale); }
.frame-band { fill: #b9c3ef; }
.frame-sun { fill: var(--spark); }
.frame-hill { fill: #2f4a3e; }
.frame { fill: none; stroke: var(--ink); stroke-width: 3; }
.play { fill: #fff; }
.frame-meta { font: 500 13px var(--text); fill: #fff; }
.route { fill: none; stroke: var(--route); stroke-width: 3.5; stroke-linecap: round; }
.route.soon { stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 2 9; opacity: .55; }
.end circle { fill: var(--spark); stroke: var(--ink); stroke-width: 2.5; }
.end text { font: 600 20px var(--text); fill: var(--ink); }
.end text.sub { font: 400 15px var(--text); fill: var(--muted); }
.end.soon circle { fill: var(--paper); stroke: var(--muted); }
.end.soon text { fill: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .route.r1 { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s .35s cubic-bezier(.65, 0, .35, 1) forwards; }
  .end.e1 circle { transform-origin: 392px 96px; transform: scale(0); animation: pop .4s 1.35s cubic-bezier(.22, 1, .36, 1) forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { transform: scale(1); } }

.how { padding-top: 24px; padding-bottom: 56px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: step; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 18px; }
.steps li::before { content: counter(step); display: block; font: 700 2.2rem/1 var(--display); color: var(--route); margin-bottom: 14px; }
.steps p { color: #2c3833; max-width: 32em; }

.api { display: grid; gap: 24px; padding-top: 40px; padding-bottom: 56px; align-items: start; }
@media (min-width: 900px) { .api { grid-template-columns: 1fr 1.2fr; gap: 48px; } }
.api-copy p { max-width: 30em; }
.code { margin: 0; background: var(--ink); color: #e9ece6; padding: 18px 20px; border-radius: 12px; overflow-x: auto; font: 400 .88rem/1.6 var(--mono); }
.code code { font-size: inherit; }

.closer { padding-top: 40px; padding-bottom: 72px; border-top: 1px solid var(--line); }
.closer p { color: var(--muted); }

/* формы */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; padding: 0; }
.field small, .drop small { color: var(--muted); font-size: .88rem; }
input[type=email], input[type=password], input[type=text], input[type=datetime-local], textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; padding: .7rem .85rem;
}
textarea { resize: vertical; min-height: 120px; }
select {
  width: 100%; max-width: 360px; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; padding: .65rem .85rem;
}
input:focus, textarea:focus, select:focus { border-color: var(--route); outline: none; box-shadow: 0 0 0 3px rgba(43, 63, 216, .18); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--route); flex: none; }
.check small { display: block; color: var(--muted); font-size: .86rem; font-weight: 400; }
.check:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
.flash { padding: .75rem 1rem; border-radius: 10px; border: 1.5px solid; margin: 0 0 18px; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok); color: #124d2f; }
.flash-err { background: var(--bad-bg); border-color: var(--bad); color: #7a2414; }
.form .flash { margin: 0; }

.auth { max-width: 460px; padding-top: 56px; padding-bottom: 72px; }
.auth h1 { font-size: 2rem; }
.switch { color: var(--muted); margin: 4px 0 0; }

/* кабинет */
.app { max-width: 860px; padding-top: 32px; padding-bottom: 64px; }
.app.narrow { max-width: 720px; }
.app h1 { font-size: 2rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 20px; }
@media (min-width: 720px) { .panel { padding: 28px 32px; } }
.panel h2 { font-size: 1.2rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.empty { color: var(--muted); }

.acc-list { list-style: none; margin: 0 0 12px; padding: 0; }
.acc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.acc:first-child { border-top: 0; }
.acc form { margin: 0 0 0 auto; }
.acc .btn { margin-left: auto; }
.acc .btn + form { margin-left: 0; }
.acc-off { opacity: .8; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-empty { display: grid; place-items: center; background: var(--route-pale); color: var(--route-deep); font-weight: 600; }
.acc-body { display: grid; line-height: 1.3; }
.acc-meta { color: var(--muted); font-size: .9rem; }
.connect-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }

.drop {
  position: relative; display: grid; gap: 6px; padding: 22px; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--route); background: #f5f7ff; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop:focus-within { border-color: var(--route); box-shadow: 0 0 0 3px rgba(43, 63, 216, .18); }
.drop-cta { font-weight: 600; color: var(--route); }
.drop.has-file .drop-cta { color: var(--ink); }

.target { padding: 6px 0; }

.preview { margin: 10px 0 0; display: grid; gap: 6px; justify-items: start; }
.preview-media video, .preview-media img { display: block; max-height: 340px; max-width: 100%; width: auto; border-radius: 10px; background: var(--ink); }

/* настройки площадок в форме публикации */
.pf { border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 16px; margin: 0; display: grid; gap: 14px; min-width: 0; }
.pf-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.pf-head .avatar { width: 36px; height: 36px; }
.pf-head > span[data-tt="avatar"] { display: flex; }
.pf-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; overflow-wrap: anywhere; }
.pf-tag { align-self: start; font-size: .8rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; }
.pf-body { display: grid; gap: 14px; }
.pf-row { display: grid; gap: 14px; }
@media (min-width: 640px) { .pf-row { grid-template-columns: 1fr 1fr; } }
.pf-note { margin: 0; font-size: .88rem; color: var(--muted); }
.pf-problem { margin: 0; font-size: .92rem; color: var(--bad); }
.pf-label { margin: 0; font-size: .92rem; font-weight: 600; }
.checks-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.sub { display: grid; gap: 10px; padding: 6px 0 0 30px; }
.consent { margin: 0; font-size: .9rem; color: #2c3833; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; width: fit-content; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: .4rem .9rem; border-radius: 7px; font-weight: 500; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 3px solid var(--spark); outline-offset: 1px; }
.later { display: grid; gap: 6px; max-width: 320px; margin-top: 10px; }
.later[hidden] { display: none; }

.submit-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.progress { flex: 1; min-width: 200px; display: grid; gap: 6px; }
.progress[hidden] { display: none; }
.progress::before { content: ""; height: 6px; border-radius: 3px; background: var(--line); grid-area: 1 / 1; }
.progress .bar { grid-area: 1 / 1; height: 6px; width: 100%; border-radius: 3px; background: var(--route); transform: scaleX(0); transform-origin: left center; transition: transform .2s ease-out; }
.progress-text { font-size: .9rem; color: var(--muted); }
.submit-hint { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; min-width: 200px; }

.posts { list-style: none; margin: 0; padding: 0; }
.post { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.post:first-child { border-top: 0; padding-top: 4px; }
.thumb { position: relative; width: 64px; height: 114px; flex: none; border-radius: 8px; overflow: hidden; background: var(--route-pale); }
.thumb-photo { height: 80px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .kind { position: absolute; left: 4px; bottom: 4px; font-size: .7rem; background: rgba(23, 33, 29, .78); color: #fff; padding: 1px 6px; border-radius: 999px; }
.post-body { min-width: 0; flex: 1; }
.caption { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.tlist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.tg { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: .95rem; }
.tg .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; transform: translateY(-1px); }
.tg-acc { font-weight: 600; }
.tg-pf { color: var(--muted); font-size: .85rem; }
.tg-queued .dot { background: var(--wait); }
.tg-processing .dot { background: var(--route); }
.tg-published .dot { background: var(--ok); }
.tg-failed .dot { background: var(--bad); }
.tg-failed .tg-st { color: var(--bad); }
.tg-err { flex-basis: 100%; color: var(--muted); font-size: .88rem; padding-left: 17px; }
@media (prefers-reduced-motion: no-preference) {
  .tg-processing .dot { animation: blink 1.2s ease-in-out infinite; }
}
@keyframes blink { 50% { opacity: .3; } }
.post-foot { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.post-foot form { margin: 0; }
.post-foot .linkish { color: var(--muted); }

.keybox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.keybox code { background: var(--ink); color: #e9ece6; padding: .55rem .8rem; border-radius: 8px; overflow-wrap: anywhere; }
.panel h3 { margin-top: 24px; }
.danger-zone { border-color: #e5c2ba; }

/* документы */
.doc { max-width: 760px; padding-top: 48px; padding-bottom: 72px; }
.doc h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.doc h2 { font-size: 1.15rem; margin-top: 2em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: .5em; }

/* подвал */
.foot { border-top: 1px solid var(--line); padding: 22px 0 28px; font-size: .9rem; }
.foot-row { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--muted); }
.foot-brand { font: 700 1rem var(--display); margin-right: 8px; }
