:root {
  color-scheme: dark;
  --ink: #131925;        /* фон */
  --panel: #1A2230;      /* панели */
  --panel-2: #212B3B;    /* вложенные блоки, поля */
  --line: #2D3849;       /* границы */
  --text: #E7EAF0;
  --muted: #8E98AA;
  --lamp: #F2B33D;       /* «сигнальная лампа»: следующий ключ, главные действия */
  --ok: #5CC48A;
  --warn: #E8A14A;
  --bad: #E5676B;
  --info: #8EA2FF;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Segoe UI Variable", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--info); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-num); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .25rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; font-weight: 620; }
h3 { font-size: .98rem; margin: 0 0 .5rem; font-weight: 600; }
p { margin: 0 0 .75rem; max-width: 72ch; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* каркас */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; padding: 0 8px; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-s); }
.nav a:hover { background: var(--panel-2); }
.nav a[aria-current="page"] { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--lamp); }
.side .who { margin-top: auto; padding: 0 8px; font-size: .9rem; }
.main { padding: 28px clamp(16px, 4vw, 44px) 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* блоки */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; margin-bottom: 18px; }
.panel.flat { background: transparent; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: .86rem; }
.facts dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 600; }
.facts dd small { font-size: .82rem; font-weight: 400; color: var(--muted); }

/* кнопки и поля */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); padding: 7px 14px; border-radius: var(--radius-s); cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: #3d4b61; }
.btn.primary { background: var(--lamp); border-color: var(--lamp); color: #1b1404; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 3px 9px; font-size: .86rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=text], input:not([type]), textarea, select { background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; width: 100%; }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88rem; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }

/* таблицы */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; background: var(--panel); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--panel); }
td.actions { white-space: nowrap; }
td.actions .btn { margin: 0 2px 4px 0; }

/* состояние */
.st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.st.available::before, .st.ok::before, .st.member::before { background: var(--ok); }
.st.rate_limited::before, .st.checking::before, .st.unknown::before, .st.in_progress::before { background: var(--warn); }
.st.quota_exhausted::before { background: var(--warn); box-shadow: 0 0 0 2px rgba(232,161,74,.25); }
.st.invalid::before, .st.error::before, .st.not_member::before, .st.network_error::before { background: var(--bad); }
.st.disabled::before, .st.cancelled::before, .st.interrupted::before { background: transparent; border: 1.5px solid var(--muted); }

/* маршрут ключей — главный визуальный элемент */
.route { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 14px 4px 8px; }
.route .stop { display: flex; flex-direction: column; align-items: center; min-width: 108px; position: relative; text-align: center; }
.route .stop + .stop::before { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.route .lamp { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--ink); position: relative; z-index: 1; display: grid; place-items: center; font-size: .78rem; color: var(--muted); }
.route .lamp.available { border-color: var(--ok); color: var(--ok); }
.route .lamp.rate_limited, .route .lamp.quota_exhausted, .route .lamp.checking, .route .lamp.unknown { border-color: var(--warn); color: var(--warn); }
.route .lamp.invalid, .route .lamp.network_error { border-color: var(--bad); color: var(--bad); }
.route .lamp.disabled { border-style: dashed; }
.route .stop.next .lamp { background: var(--lamp); border-color: var(--lamp); color: #1b1404; box-shadow: 0 0 0 6px rgba(242,179,61,.16); }
@media (prefers-reduced-motion: no-preference) {
  .route .stop.next .lamp { animation: glow 2.4s ease-in-out infinite; }
  @keyframes glow { 50% { box-shadow: 0 0 0 10px rgba(242,179,61,.06); } }
}
.route .label { margin-top: 8px; font-size: .84rem; max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route .tag { font-size: .74rem; color: var(--muted); min-height: 1.2em; }
.route .stop.next .tag { color: var(--lamp); }

/* уведомления */
.notice { border: 1px solid var(--line); border-left: 4px solid var(--info); background: var(--panel); border-radius: var(--radius-s); padding: 12px 16px; margin-bottom: 18px; }
.notice.warn { border-left-color: var(--warn); }
.notice.bad { border-left-color: var(--bad); }
.notice.lamp { border-left-color: var(--lamp); }
.notice p:last-child { margin-bottom: 0; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: var(--radius-s); max-width: 420px; z-index: 50; }
.toast.bad { border-color: var(--bad); }

/* шаги подключения */
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 0 0 18px 46px; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--lamp); color: var(--lamp); display: grid; place-items: center; font-weight: 650; }
ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.ui { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.copy { display: flex; gap: 8px; align-items: center; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 6px 6px 12px; margin: 6px 0; }
.copy code { flex: 1; overflow-x: auto; white-space: nowrap; font-size: .9rem; }
.secret { border: 2px solid var(--lamp); border-radius: var(--radius-m); padding: 16px; margin: 12px 0; background: rgba(242,179,61,.06); }

/* результаты добавления */
.results { list-style: none; padding: 0; margin: 10px 0 0; font-size: .9rem; }
.results li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--text); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.skeleton { color: var(--muted); padding: 30px 0; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { max-width: 460px; }
.login h1 { font-size: 2.2rem; margin-bottom: 12px; }
.login .btn.primary { padding: 11px 20px; font-size: 1.02rem; margin-top: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 8px; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  .nav a { white-space: nowrap; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--lamp); }
  .side .who { margin: 0 0 0 auto; }
  .main { padding-top: 18px; }
}

/* дополнения */
.login-card { max-width: 420px; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; display: grid; gap: 14px; }
.login-card h1 { margin: 0; }
.btn.wide { width: 100%; justify-content: center; }
.notice.ok { border-left-color: var(--ok); }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
tr.details td { background: var(--panel-2); }
ol.attempts { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.side .who { display: flex; gap: 8px; align-items: center; }
.side .who img { border-radius: 50%; }
.brand img { display: block; }
select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; max-width: 100%; }

/* ===== правки 2026-11-13 ===== */
.main { min-width: 0; }
.brand { color: var(--text); text-decoration: none; }
.side .who > div { min-width: 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
.btn.xs { padding: 0 6px; font-size: .7rem; line-height: 1.6; }

/* таблица ключей */
.keys-table td { vertical-align: middle; }
.keys-table tr.off td { opacity: .55; }
.keys-table tr.off td.actions { opacity: 1; }
td.prio { white-space: nowrap; width: 1%; }
.prio-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); font-weight: 650; margin-right: 6px; vertical-align: middle; }
.prio-btns { display: inline-flex; flex-direction: column; gap: 2px; vertical-align: middle; }
.key-name { font-weight: 560; }
.key-mask { white-space: nowrap; }
.budget { min-width: 150px; }
.budget-nums b { font-weight: 650; }
.bar { height: 6px; border-radius: 3px; background: var(--panel-2); margin: 5px 0 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.bar.mid i { background: var(--lamp); }
.bar.low i { background: var(--bad); }
td.actions { width: 1%; }
td.actions .btn { margin: 0; }
td.actions { display: table-cell; }
td.actions > * { vertical-align: middle; }
td.actions > .btn + .menu { margin-left: 6px; }

/* выпадающее меню «Ещё» */
details.menu { display: inline-block; position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: ""; width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; margin: 4px 0 0 2px; }
details.menu[open] > summary { border-color: var(--lamp); }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 170px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 4px; box-shadow: 0 10px 28px rgba(5, 8, 14, .5); display: grid; }
.menu-item { background: none; border: 0; text-align: left; padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--panel); }
.menu-item.danger { color: var(--bad); }
.table-wrap:has(details.menu[open]) { overflow: visible; }

/* блок кода */
.codeblock { position: relative; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); margin: 8px 0; }
.codeblock pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: .88rem; }
.codeblock .btn { position: absolute; top: 6px; right: 6px; }

/* ===== приветственная страница: ключница ===== */
.landing { max-width: 1080px; margin: 0 auto; padding: 22px clamp(18px, 4vw, 40px) 64px; }
.land-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; }
.land-top .brand { padding: 0; }
.hero { padding: clamp(36px, 7vw, 76px) 0 28px; max-width: 680px; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); line-height: 1.04; letter-spacing: -.025em; font-weight: 750; margin: 0 0 18px; }
.hero .lead { font-size: 1.12rem; line-height: 1.55; color: #C9D0DC; max-width: 58ch; margin-bottom: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.hero-cta p { margin: 0; max-width: 36ch; }
.btn.big { padding: 13px 24px; font-size: 1.05rem; border-radius: 8px; }

.rack { margin-top: 28px; }
.rack-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 24px; }
.rack-head h2 { font-size: 1.25rem; margin: 0; }
.rack-head p { margin: 0; max-width: 52ch; }
.rack-body { position: relative; padding-top: 30px; }
.rack-wait { padding: 30px 0; }
/* перекладина ключницы */
.hooks { list-style: none; margin: 0; padding: 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); gap: 30px 14px; position: relative; }
.hooks::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 8px; border-radius: 4px; background: linear-gradient(#5A4A2A, #3B3220); box-shadow: 0 2px 0 #1d1810; }
.hook { position: relative; display: flex; justify-content: center; padding-top: 22px; }
.hook::before { content: ""; position: absolute; top: -14px; left: 50%; width: 3px; height: 30px; margin-left: -1.5px; background: #8B7A55; border-radius: 2px; }
.fob { --c: #263042; position: relative; width: 124px; min-height: 168px; padding: 34px 6px 14px; border: 1px solid #34405A; border-radius: 18px 18px 56px 56px; background: linear-gradient(170deg, #2B3649, #1D2534); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; transform: rotate(var(--tilt)); transform-origin: 50% -16px; transition: transform .25s ease, border-color .2s; font: inherit; }
.fob::before { content: ""; position: absolute; top: 10px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 3px #8B7A55; }
.fob:hover, .fob:focus-visible { transform: rotate(0deg); border-color: var(--lamp); }
.fob-ver { font-size: 2.3rem; font-weight: 760; line-height: 1; letter-spacing: -.03em; }
.fob-fam { font-size: 1.02rem; font-weight: 600; margin-top: 4px; }
.fob-id { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .6rem; color: var(--muted); margin-top: auto; padding-top: 12px; white-space: nowrap; text-align: center; }
.fob-new { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--lamp); border: 1px solid var(--lamp); font-size: .72rem; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.fob.fresh { background: linear-gradient(170deg, #F6C25A, #E3A12E); border-color: #F6C25A; color: #1b1404; }
.fob.fresh .fob-id { color: #4a3610; }
@media (prefers-reduced-motion: no-preference) {
  .fob { animation: swing 1.5s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i) * 70ms); }
  @keyframes swing { 0% { transform: rotate(calc(var(--tilt) * -5)); } 100% { transform: rotate(var(--tilt)); } }
}
.others { margin-top: 30px; font-size: .92rem; line-height: 1.7; max-width: 80ch; }
.others .other { color: var(--text); white-space: nowrap; }

.how { margin-top: 56px; max-width: 680px; }
.how h2 { font-size: 1.25rem; margin-bottom: 16px; }
@media (max-width: 520px) {
  .hooks { grid-template-columns: repeat(2, 1fr); }
  .hero-cta .btn.big { width: 100%; justify-content: center; }
}

/* ---------- тарифы ---------- */
.plan-card { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 18px; margin: 0 0 16px; }
.plan-card > div:first-child { min-width: 200px; }
.plan-card .bar { width: 200px; }
.plan-name { font-weight: 650; font-size: 1.02rem; }
.plan-card.unlimited { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.plan-card.unlimited .plan-name { color: var(--ok); }
.plan-card.unlimited.soon { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.plan-card.free.full { border-color: color-mix(in srgb, var(--lamp) 55%, var(--line)); }
.plan-pay { flex: 1 1 280px; max-width: 520px; }
.plan-offer { margin-bottom: 2px; }
.plan-offer b { color: var(--lamp); }
tr.off .muted.small { color: var(--muted); }
.pay-row { gap: 8px; margin: 6px 0 4px; flex-wrap: wrap; }
.pay-row select { width: auto; flex: 0 1 260px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 10px; }
.test-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.test-bar p { margin: 0; flex: 1 1 320px; }
.old-price { color: var(--muted); text-decoration-thickness: 2px; }
.new-price { color: var(--lamp); font-size: 1.15em; }
.promo-badge { display: inline-block; margin: 6px 0 2px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--bad) 18%, transparent); color: #ff9b8f; font-size: 13px; font-weight: 600; }
.plan-hook { font-size: 17px; font-weight: 700; margin-bottom: 4px; }

/* Подключение Claude: переключатель Mac / Windows и перевод пунктов меню */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn { background: transparent; border: 0; padding: 6px 14px; font: inherit; color: inherit; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn[aria-pressed="true"] { background: var(--panel-2); font-weight: 600; }
.ui-ru { color: var(--muted); font-size: .9em; }
