/* ============ БАЗА ============ */
*{box-sizing:border-box; margin:0; padding:0}
body{
  min-width:320px;
  background:var(--page); color:var(--ink);
  font-family:"Golos Text", Arial, sans-serif;
  font-size:16px; line-height:1.5;
  transition:background-color var(--t-theme) ease, color var(--t-theme) ease;
}
button,input,select{color:inherit; font:inherit}
button{border:0; cursor:pointer}
button,summary,a{-webkit-tap-highlight-color:transparent}
a{color:inherit; text-decoration:none}
::selection{background:var(--yellow); color:#08050e}
code{font-family:"JetBrains Mono",monospace; font-size:.85em}
h1,h2,h3{font-family:"Unbounded",sans-serif; letter-spacing:-0.045em; text-wrap:balance}
.icon{display:inline-block; width:1.15em; height:1.15em; flex:0 0 auto; vertical-align:-0.12em}
.eyebrow{
  margin-bottom:14px; color:var(--aqua);
  font-family:"JetBrains Mono",monospace; font-size:.76rem; font-weight:750;
  letter-spacing:.09em; text-transform:uppercase;
}

/* ============ ТЕНЬ ПО ПРАВИЛУ: внешний радиус тени = радиус объекта + сдвиг ============
   Слои: ::before — жёсткая тень (z-index:-1), ::after — лицо с фоном и обводкой
   (тоже z-index:-1, позже в дереве → рисуется над тенью), текст — выше обоих.
   Цвет тени — var(--shadow-color), пары задаются утилитами .pair-*. */

/* ============ КНОПКИ — канон .button, обводка 2px как .plan-button/.header-cta ============ */
.btn{
  position:relative; isolation:isolate;
  display:inline-flex; align-items:center; justify-content:center;
  gap:13px; min-height:54px; padding:0 22px;
  border:0; border-radius:var(--radius-control);
  white-space:nowrap; /* кнопка всегда в одну строку */
  background:transparent; color:var(--ink);
  font-weight:750;
  transition:transform var(--t-fast) ease;
  --r:var(--radius-control); --shift:4px;
  --face-bg:var(--surface); --face-border:#08050e;
}
.btn::before{ /* тень */
  content:""; position:absolute; inset:0; z-index:-1;
  border-radius:var(--r) var(--r) calc(var(--r) + var(--shift)) var(--r);
  background:var(--shadow-color, var(--button-shadow));
  translate:0 0; opacity:0;
  transition:translate var(--t-fast) ease, opacity var(--t-fast) ease;
}
.btn::after{ /* лицо */
  content:""; position:absolute; inset:0; z-index:-1;
  border-radius:var(--r);
  background:var(--face-bg);
  border:2px solid var(--face-border);
  transition:background-color var(--t-fast) ease;
}
.btn:hover,.btn:focus-visible{transform:translate(-2px,-2px)}
.btn:hover::before,.btn:focus-visible::before{translate:var(--shift) var(--shift); opacity:1}
.btn:active{transform:none}
.btn:active::before{translate:0 0; opacity:0}
.btn:focus-visible{outline:3px solid var(--focus-ring); outline-offset:2px}
.btn:disabled{opacity:.45; cursor:not-allowed; transform:none}
.btn:disabled::before{opacity:0 !important; translate:0 0 !important}
.btn-primary{--face-bg:var(--red); color:var(--on-color)}
.btn-light{--face-bg:#f2efe9; color:#08050e}
.btn-surface{--face-bg:var(--surface); color:var(--ink)}
/* цветные варианты для пар */
.btn-blue{--face-bg:var(--blue); color:#fff9ef}
.btn-yellow{--face-bg:var(--yellow); color:#08050e}
.btn-aqua{--face-bg:var(--aqua); color:#fff9ef}
[data-theme="night"] .btn-aqua{color:#08050e}
/* размеры */
.btn-sm{min-height:44px; padding:0 18px; --r:var(--radius-toggle); font-size:.84rem}
.btn-lg{min-height:60px; padding:0 28px; --r:18px; font-size:1.05rem}
.btn-block{width:100%}
.btn-icon{width:54px; padding:0}
/* иконки-кнопки в таблицах и тулбарах: без слоя тени, ховер красит саму иконку */
.btn-icon-sm{width:44px; min-height:44px; padding:0}
.btn-icon-sm::before{content:none}
.btn-icon-sm::after{border-width:0; background:transparent}
.btn-icon-sm:hover,.btn-icon-sm:focus-visible{transform:none; color:var(--red)}
.btn-icon-sm:active{transform:scale(.97)}
.btn.is-loading{pointer-events:none; opacity:.85}
.btn .spin{
  width:16px; height:16px; border-radius:50%;
  border:2.5px solid currentColor; border-top-color:transparent;
  animation:spin 700ms linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ============ ЦВЕТОВЫЕ ПАРЫ кнопка+тень / карточка+тень ============ */
.pair-ink{--shadow-color:var(--ink)}
.pair-red{--shadow-color:var(--red)}
.pair-blue{--shadow-color:var(--blue)}
.pair-yellow{--shadow-color:var(--yellow)}
.pair-aqua{--shadow-color:var(--aqua)}

/* ============ КНОПКА-ТОГГЛ — канон .theme-toggle, радиус как у кнопок ============ */
.toggle{
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px; padding:0 14px;
  border:1px solid var(--line); border-radius:var(--radius-control);
  background:var(--surface); color:var(--ink);
  font-size:.82rem; font-weight:700;
  transition:border-color var(--t-fast) ease;
}
.toggle:hover{border:2px solid var(--ink); padding:0 13px}
.toggle.icon-only:hover{width:46px; padding:0}
.toggle:active{border:2px solid var(--ink); padding:0 13px}
.toggle.icon-only:active{padding:0}
.toggle.icon-only{width:46px; flex:0 0 46px; padding:0; font-size:0}
.toggle .icon{width:22px; height:22px; color:var(--yellow)}

/* ============ ТЕКСТОВАЯ ССЫЛКА — канон .text-link ============ */
.text-link{
  display:inline-flex; align-items:center; gap:10px;
  color:var(--link-idle); font-weight:750; font-size:1.05rem;
  transition:color var(--t-fast) ease;
}
.text-link:hover,.text-link:focus-visible{color:var(--link-hover)}
.text-link .icon{transition:transform var(--t-fast) ease}
.text-link:hover .icon{transform:translate(2px,-2px)}

/* ============ НАВ-ССЫЛКА — канон .desktop-nav ============ */
.nav-link{
  position:relative; padding:12px 2px; border-radius:8px;
  font-weight:600; white-space:nowrap; cursor:pointer;
}
.nav-link::before{
  position:absolute; right:0; bottom:6px; left:0; height:2px;
  background:var(--aqua); content:"";
  transform:scaleX(0); transform-origin:right;
  transition:transform var(--t-nav) ease;
}
.nav-link:hover::before,.nav-link:focus-visible::before,.nav-link[aria-current="page"]::before{
  transform:scaleX(1); transform-origin:left;
}

/* ============ ПОЛЯ — канон .domain-input-row ============ */
.field{display:grid; gap:12px}
.label{
  color:var(--muted); font-size:.82rem; font-weight:750;
  letter-spacing:.04em; text-transform:uppercase;
}
.input,.select,.textarea{
  width:100%; min-width:0; min-height:56px;
  border:2px solid var(--ink); border-radius:var(--radius-control);
  background:var(--surface); padding:0 18px; outline:0;
  transition:border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.textarea{min-height:110px; padding:14px 18px; resize:vertical}
.input::placeholder,.textarea::placeholder{color:var(--muted)}
.input:focus,.select:focus,.textarea:focus{
  border-color:var(--aqua);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--aqua) 24%, transparent);
}
.input:disabled{opacity:.5; cursor:not-allowed}
.select{
  appearance:none; font-family:"JetBrains Mono",monospace; font-weight:750;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2308050e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; padding-right:44px;
}
[data-theme="night"] .select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f7f4ec' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.hint{font-size:.88rem; color:var(--muted)}
.field.is-error .input{border-color:var(--red)}
.field.is-error .hint{color:var(--red)}

/* ============ ЧЕКБОКС / РАДИО ============ */
.check{display:inline-flex; align-items:center; gap:10px; cursor:pointer; font-size:15px; user-select:none}
.check input{position:absolute; opacity:0; pointer-events:none}
.check .box{
  width:22px; height:22px; flex:none;
  border:2px solid var(--ink); border-radius:8px; background:var(--surface);
  display:inline-flex; align-items:center; justify-content:center;
  transition:background var(--t-fast) ease, transform var(--t-fast) ease;
}
.check .box svg{opacity:0; transform:scale(.5); transition:opacity var(--t-fast) ease, transform var(--t-fast) ease}
.check input:checked + .box{background:var(--red); border-color:#08050e}
.check input:checked + .box svg{opacity:1; transform:scale(1)}
.check input:focus-visible + .box{outline:3px solid var(--focus-ring); outline-offset:2px}
.check:active .box{transform:scale(.92)}
.check .dot{border-radius:50%}
.check .dot::after{
  content:""; width:8px; height:8px; border-radius:50%; background:var(--surface);
  opacity:0; transition:opacity var(--t-fast) ease;
}
.check input:checked + .dot{background:var(--red)}
.check input:checked + .dot::after{opacity:1}

/* ============ ЧИПЫ — канон .migration-states span ============ */
.chip{white-space:nowrap; 
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 11px; border:1px solid #08050e; border-radius:999px;
  background:var(--surface); color:var(--ink);
  font-family:"JetBrains Mono",monospace; font-size:.7rem; font-weight:750;
  letter-spacing:.04em; text-transform:uppercase;
}
.chip .dotmark{width:7px; height:7px; border-radius:50%; background:currentColor}
.chip-ok{background:var(--aqua); color:#fff}
.chip-warn{background:var(--yellow); color:#08050e}
.chip-err{background:var(--red); color:var(--on-color)}
.chip-info{background:var(--blue); color:#fff9ef}
/* ночь: aqua/yellow светлеют — текст на них тёмный */
[data-theme="night"] .chip-ok{color:#08050e}
[data-theme="night"] .chip-ok .dotmark{background:#08050e}

/* ============ КАРТОЧКА — канон .plan-card; тень 12px, внешний радиус 25+12=37 ============ */
.card{
  position:relative; isolation:isolate;
  display:flex; flex-direction:column;
  padding:clamp(24px,2.2vw,34px);
  border:0; border-radius:var(--radius-card);
  background:transparent;
  transition:transform var(--t-fast) ease;
  --r:var(--radius-card); --shift:10px; /* −20%: широкая тень только у больших карточек (сайт) */
  --shadow-color:var(--accent,var(--aqua));
}
.card::before{ /* тень в цвет tone-акцента */
  content:""; position:absolute; inset:0; z-index:-1;
  border-radius:var(--r) var(--r) calc(var(--r) + var(--shift)) var(--r);
  background:var(--shadow-color);
  translate:0 0; opacity:0;
  transition:translate var(--t-fast) ease, opacity var(--t-fast) ease;
}
.card::after{ /* лицо */
  content:""; position:absolute; inset:0; z-index:-1;
  border-radius:var(--r);
  background:var(--surface);
  border:2px solid var(--ink);
}
.card-hover:hover,.card-hover:focus-within{transform:translate(-4px,-4px)}
.card-hover:hover::before,.card-hover:focus-within::before{
  translate:var(--shift) var(--shift); opacity:1;
}
.card h3{font-size:clamp(1.15rem,1.6vw,1.7rem); font-weight:650; line-height:1.08; margin-bottom:10px}
.card p{color:var(--muted); font-size:.95rem; line-height:1.5}
.card.tone-yellow{--accent:var(--yellow)}
.card.tone-red{--accent:var(--red)}
.card.tone-blue{--accent:var(--blue)}
/* tone влияет только на тень, цвет текста не наследуется */
.card h3,.card p{color:inherit}
.card h3{color:var(--ink)}
.card p{color:var(--muted)}

/* ============ СПИСОК С ТОЧКАМИ — канон .plan-card li ============ */
.dotted-list{display:grid; gap:12px; margin:0; padding:0; list-style:none}
.dotted-list li{position:relative; padding-left:18px}
.dotted-list li::before{
  position:absolute; top:.62em; left:0;
  width:7px; height:7px; border-radius:50%;
  background:var(--ink); content:"";
}

/* ============ АЛЕРТЫ ============ */
.alert{
  display:flex; gap:12px; align-items:flex-start;
  border:2px solid var(--ink); border-radius:var(--radius-alert);
  padding:16px 18px; background:var(--surface); font-size:15px;
}
.alert .ico{flex:none; width:22px; height:22px; margin-top:1px}
.alert-ok{background:color-mix(in srgb, var(--aqua) 14%, var(--surface))}
.alert-warn{background:color-mix(in srgb, var(--yellow) 22%, var(--surface))}
.alert-err{background:color-mix(in srgb, var(--red) 12%, var(--surface))}
.alert strong{display:block; margin-bottom:2px; font-weight:750}

/* ============ ТАБЫ ============ */
.tabs{
  display:inline-flex; gap:4px; max-width:100%; overflow-x:auto;
  border:2px solid var(--ink); border-radius:999px; padding:4px; background:var(--surface);
}
.tab{
  font:inherit; font-weight:750; font-size:14px; white-space:nowrap;
  border:0; background:transparent; color:var(--ink);
  border-radius:999px; padding:8px 16px;
  transition:background var(--t-fast) ease, transform var(--t-fast) ease;
}
.tab:hover{background:var(--surface-soft)}
.tab:active{transform:scale(.97)}
.tab[aria-selected="true"]{background:var(--red); color:var(--on-color)}

/* малая текстовая ссылка — внутри алертов и журнала */
.text-link-sm{font-size:.92rem}


/* ============ ПИЛЮЛЬНАЯ CTA — radius 999px ============ */
.btn-pill{border-radius:999px; --r:999px}
.btn-pill::after{border-radius:999px}
.btn-pill::before{border-radius:999px 999px calc(999px + var(--shift)) 999px}

/* ============ КНОПКИ НА МОБИЛЕ — во всю ширину ============ */
@media(max-width:759px){
  .btn{width:100%}
  .btn-icon{width:54px}
  .btn-icon.btn-sm{width:44px}
}

/* ============ АЛЕРТЫ: ico красится тоном, без инлайна ============ */
.alert .ico{stroke:var(--ink)}
.alert-ok .ico{stroke:var(--aqua)}
.alert-warn .ico{stroke:var(--ink)}
.alert-err .ico{stroke:var(--red)}
