/* Not A Link — один стиль на сайт и записи. Светлая/тёмная тема: prefers-color-scheme + переключатель (html[data-theme]).
   Палитра — SPEC §8. Системные шрифты, без внешних ресурсов. */
:root {
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f1f5f9; --text: #0f172a; --text-2: #475569; --border: #e2e8f0;
  --accent: #0f766e; --accent-hover: #115e59; --accent-ink: #ffffff; --mark: #14b8a6; --accent-soft: #ccfbf1;
  --danger: #b91c1c; --danger-bg: #fef2f2; --code-bg: #ffffff; --ln: #94a3b8; --hl-line: #fef9c3;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  --r: 12px; --r-sm: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --surface: #161b22; --surface-2: #1c232c; --text: #e6edf3; --text-2: #9aa7b4; --border: #30363d;
    --accent: #14b8a6; --accent-hover: #2dd4bf; --accent-ink: #04201d; --mark: #14b8a6; --accent-soft: #0f2f2c;
    --danger: #f87171; --danger-bg: #2a1215; --code-bg: #0d1117; --ln: #6e7681; --hl-line: #3a3212;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #161b22; --surface-2: #1c232c; --text: #e6edf3; --text-2: #9aa7b4; --border: #30363d;
  --accent: #14b8a6; --accent-hover: #2dd4bf; --accent-ink: #04201d; --mark: #14b8a6; --accent-soft: #0f2f2c;
  --danger: #f87171; --danger-bg: #2a1215; --code-bg: #0d1117; --ln: #6e7681; --hl-line: #3a3212;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; margin-top: 1.3em; }
p { margin: 0 0 1em; }
code, pre, kbd, samp, textarea.pf__text { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--text-2); }
.small { font-size: .875rem; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap--wide { max-width: 1280px; }
.wrap--text { max-width: 800px; }
.wrap--narrow { max-width: 620px; }
.ico { flex: none; vertical-align: middle; }

/* шапка */
.hdr { background: var(--surface); border-bottom: 1px solid var(--border); }
.hdr__in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.logo:hover { color: var(--text); }
.mark { display: block; border-radius: 8px; }
.hdr__nav { display: flex; gap: 4px 18px; margin-left: auto; flex-wrap: wrap; }
.hdr__nav a { color: var(--text-2); text-decoration: none; font-size: .95rem; }
.hdr__nav a:hover { color: var(--text); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.iconbtn:hover { color: var(--text); border-color: var(--text-2); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: inline; }
}

/* кнопки и поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--text-2); color: var(--text); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: .9rem; font-weight: 500; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--mark); }
.btn:disabled, .btn.is-busy { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 12px; width: 100%; min-height: 44px; }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { border-color: var(--mark); outline: 2px solid color-mix(in srgb, var(--mark) 35%, transparent); outline-offset: 0; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld > label { font-size: .85rem; color: var(--text-2); font-weight: 500; }
.pw { position: relative; }
.pw input { padding-right: 44px; }
.pw__eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--text-2); cursor: pointer; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.pw__eye[aria-pressed="true"] { color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }

/* главная и форма */
.hero { padding: 28px 0 8px; }
.hero--plain { padding-bottom: 0; }
.hero h1 { margin-bottom: .3em; }
.lead { color: var(--text-2); font-size: 1.08rem; max-width: 720px; }
.hero__cta { margin-top: 20px; }
.pf { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); margin-top: 16px; }
.pf__text { display: block; width: 100%; min-height: 320px; resize: vertical; tab-size: 4; -moz-tab-size: 4; font-size: 14px; line-height: 1.55;
  padding: 12px 14px; white-space: pre; overflow-wrap: normal; overflow-x: auto; background: var(--code-bg); }
.pf__meta { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; color: var(--text-2); padding: 6px 2px 10px; flex-wrap: wrap; }
.pf__meta .is-over { color: var(--danger); font-weight: 600; }
.pf__row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: start; }
.fld--go { padding-top: 24px; }
.pf__auto { margin: 4px 0 0; font-size: .82rem; color: var(--text-2); }
.pf__pwhint { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-2); margin: 10px 0 0; }
.pf__pwhint.is-hidden { display: none; }
.fld--pw.is-open input { border-color: var(--mark); }
.pf__err { color: var(--danger); background: var(--danger-bg); border-radius: 8px; padding: 8px 12px; margin: 12px 0 0; font-size: .92rem; }
@media (max-width: 860px) {
  .pf__row { grid-template-columns: 1fr 1fr; }
  .fld--pw { grid-column: 1 / -1; }
  .fld--go { grid-column: 1 / -1; padding-top: 0; }
  .fld--go .btn { width: 100%; }
}
@media (max-width: 520px) {
  .hide-xs { display: none !important; }
  .pf { padding: 10px; margin-left: -6px; margin-right: -6px; }
  .pf__text { min-height: 260px; font-size: 13px; }
  .pf__row { grid-template-columns: 1fr; }
  .hdr__nav { gap: 4px 12px; }
  .hdr__nav a { font-size: .9rem; }
  .logo__t { font-size: 1.05rem; }
}

/* текст страниц */
.content { padding: 24px 0 48px; }
.prose { font-size: 1.02rem; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; font-size: .9em; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.crumbs { font-size: .85rem; color: var(--text-2); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--text-2); }
.faq { margin-top: 32px; }
.faq__i { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); margin: 0 0 8px; }
.faq__i summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; position: relative; padding-right: 40px; }
.faq__i summary::-webkit-details-marker { display: none; }
.faq__i summary::after { content: "+"; position: absolute; right: 16px; top: 10px; font-size: 1.3rem; color: var(--text-2); }
.faq__i[open] summary::after { content: "−"; }
.faq__a { padding: 0 16px 6px; color: var(--text-2); }
.snip { margin: 0 0 24px; }
.snip figcaption { font-size: .85rem; color: var(--text-2); margin-bottom: 6px; }
.code-snip { margin: 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.55; tab-size: 4; }
.related { margin-top: 32px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--text); font-size: .92rem; }
.chip:hover { border-color: var(--mark); color: var(--text); }
.chip--all { color: var(--accent); }
.langgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 20px; }
.langgrid__i { display: flex; flex-direction: column; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); text-decoration: none; color: var(--text); }
.langgrid__i:hover { border-color: var(--mark); color: var(--text); }
.langgrid__n { font-weight: 700; font-family: var(--mono); }
.langgrid__s { font-size: .8rem; color: var(--text-2); }
.cta { margin-top: 28px; }
.sf { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.sf textarea { min-height: 160px; resize: vertical; }
.sup-done h2 { margin-top: 0; display: flex; gap: 8px; align-items: center; color: var(--accent); }

/* запись */
.paste { padding: 18px 0 40px; }
.ready { background: var(--accent-soft); border: 1px solid var(--mark); border-radius: var(--r); padding: 14px; margin-bottom: 16px; }
.ready__t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; color: var(--text); }
.ready__t .ico { color: var(--accent); }
.ready__row { display: flex; gap: 8px; }
.ready__row input { font-family: var(--mono); font-size: .95rem; }
@media (max-width: 520px) { .ready__row { flex-direction: column; } }
.phead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 20px; margin-bottom: 12px; }
.phead__t { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; margin: 0 0 4px; }
.phead__t .ico { color: var(--mark); }
.phead__meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: .88rem; color: var(--text-2); }
.phead__tools { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) {
  .phead__tools .btn span { display: none; }
  .phead__tools .btn { padding: 0 10px; }
  .phead__tools #p-copy span { display: inline; }
}
.codebox { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.code { margin: 0; padding: 12px 0; overflow-x: auto; font-size: 13.5px; line-height: 1.6; tab-size: 4; -moz-tab-size: 4; }
.code > code { display: block; padding: 0 16px; white-space: pre; }
.code.is-rows > code { padding: 0; min-width: max-content; }
.code .l { display: flex; }
.code .n { flex: none; width: calc(var(--lnw, 3) * 1ch + 24px); padding: 0 12px 0 0; text-align: right; color: var(--ln); text-decoration: none;
  user-select: none; -webkit-user-select: none; position: sticky; left: 0; background: var(--code-bg); border-right: 1px solid var(--border); margin-right: 14px; }
.code .n::before { content: attr(data-n); }
.code .n:hover { color: var(--text); }
.code .c { flex: 1 1 auto; white-space: pre; padding-right: 16px; min-height: 1.6em; }
.code .l.is-hl, .code .l.is-hl .n { background: var(--hl-line); }
.codebox.is-wrap .code.is-rows > code { min-width: 0; }
.codebox.is-wrap .code .c { white-space: pre-wrap; overflow-wrap: anywhere; }
.codebox.is-wrap .code > code { white-space: pre-wrap; overflow-wrap: anywhere; }
.pwbox { max-width: 480px; margin: 24px auto; text-align: center; }
.pwbox__ico { color: var(--mark); margin-bottom: 8px; }
.pwbox h1 { font-size: 1.4rem; }
.pwform { display: flex; gap: 8px; margin: 16px 0; text-align: left; }
.pwform .pw { flex: 1; }
@media (max-width: 520px) { .pwform { flex-direction: column; } }

/* пустые состояния: 404, капча */
.empty { padding: 56px 0; text-align: center; }
.empty__mark { display: flex; justify-content: center; margin-bottom: 16px; color: var(--mark); }
.empty h1 { font-size: 1.5rem; }
.robot { margin: 20px 0; }
.note { background: var(--surface-2); border-radius: 8px; padding: 10px 14px; }

/* подвал */
.ftr { background: var(--surface); border-top: 1px solid var(--border); margin-top: 24px; padding: 28px 0 20px; font-size: .9rem; }
.ftr__grid { display: grid; grid-template-columns: 1.1fr 1fr 1.6fr; gap: 24px; }
.ftr__brand p { color: var(--text-2); margin-top: 10px; }
.ftr__col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 0 0 8px; }
.ftr__col > a { display: block; color: var(--text); text-decoration: none; padding: 2px 0; }
.ftr__col a:hover { color: var(--accent); }
.ftr__langs div { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ftr__langs a { color: var(--text); text-decoration: none; }
.ftr__bottom { display: flex; flex-wrap: wrap; gap: 6px 18px; border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px; color: var(--text-2); }
.ftr__bottom a { color: var(--text-2); }
@media (max-width: 760px) { .ftr__grid { grid-template-columns: 1fr; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .92rem; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity .2s; } }
