/* Фирменный стиль «Спутник Медиа»: фиолетовая гамма #533489 → #7B4191, тема космоса и орбит */
:root {
  color-scheme: light;
  --paper: #f6f4fa;
  --surface: #ffffff;
  --ink: #1e1530;
  --muted: #6a6080;
  --line: #e3ddee;
  --brand: #533489;
  --brand-2: #7b4191;
  --accent: #533489;
  --accent-ink: #ffffff;
  --accent-soft: #ece6f6;
  --good: #1f8a5b;
  --warn: #b26e12;
  --bad: #c8372d;
  --none: #e6e1ef;
  --radius: 10px;
  --display: "Unbounded", "Golos Text", "Segoe UI", sans-serif;
  font-family: "Golos Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #110c1c;
  --surface: #1a1329;
  --ink: #ede8f6;
  --muted: #a79bc0;
  --line: #2f2546;
  --accent: #b096e0;
  --accent-ink: #160f24;
  --accent-soft: #2a1f40;
  --good: #3cc487;
  --warn: #e8a93e;
  --bad: #f06d62;
  --none: #2a2140;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #110c1c;
    --surface: #1a1329;
    --ink: #ede8f6;
    --muted: #a79bc0;
    --line: #2f2546;
    --accent: #b096e0;
    --accent-ink: #160f24;
    --accent-soft: #2a1f40;
    --good: #3cc487;
    --warn: #e8a93e;
    --bad: #f06d62;
    --none: #2a2140;
  }
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink);
  font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  width: 100%; max-width: 1120px; margin: 0 auto; padding: 1.25rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .9rem; color: var(--ink); text-decoration: none; }
.logo { height: 34px; width: auto; display: block; }
.product { font-family: var(--display); font-weight: 500; font-size: .8rem; color: var(--accent);
  padding-left: .9rem; border-left: 1px solid var(--line); line-height: 1.6; }
.top-right { display: flex; align-items: center; gap: 1.5rem; }
nav { display: flex; align-items: center; gap: 1.25rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a[aria-current="page"], nav a:hover { color: var(--ink); }
nav form { margin: 0; }

.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.theme-switch button { width: 32px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); }
.theme-switch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch svg .fill { fill: currentColor; stroke: none; }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.foot { width: 100%; max-width: 1120px; margin: 0 auto; padding: 1.5rem; display: flex; justify-content: space-between;
  gap: 1rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }

h1 { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; font-weight: 700;
  letter-spacing: -0.01em; margin: 1.5rem 0 .6rem; max-width: 24ch; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 1rem; }
.lead { color: var(--muted); margin: 0 0 1.5rem; max-width: 60ch; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .875rem; margin: 0; }
.is-bad { color: var(--bad); }
.is-warn { color: var(--warn); }

.flash { padding: .75rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.flash-error { border-color: var(--bad); color: var(--bad); }
.flash-ok { border-color: var(--good); }
.flash-info { border-color: var(--accent); }

.btn { display: inline-block; font: inherit; font-weight: 500; padding: .7rem 1.3rem; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.1); }
.btn-quiet { background: transparent; color: var(--accent); }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad); }
button.link { font: inherit; background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
button.link:hover { color: var(--ink); }

input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .75rem; width: 100%; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: grid; gap: .35rem; font-size: .9rem; color: var(--muted); }
label.check { display: flex; align-items: center; gap: .5rem; color: var(--ink); }
label.check input { width: auto; accent-color: var(--accent); }
.stack { display: grid; gap: .75rem; max-width: 26rem; }

/* вход */
.auth { padding-top: 7vh; position: relative; isolation: isolate; min-height: 32rem; }
.auth::after { content: ""; position: absolute; z-index: -1; right: 4rem; top: 3rem; width: 22rem; height: 22rem;
  border-radius: 50%; border: 1px solid var(--line);
  box-shadow: 0 0 0 4.5rem var(--paper), 0 0 0 calc(4.5rem + 1px) var(--line); pointer-events: none; }
.code-input { font-family: var(--display); font-size: 1.6rem; letter-spacing: .35em; max-width: 13rem; }

/* статусные точки */
.dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--none); flex: none; display: inline-block; }
.state-up .dot { background: var(--good); }
.state-down .dot { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 22%, transparent); }
.state-paused .dot { background: var(--muted); }

/* список сайтов */
.sites { border-top: 1px solid var(--line); margin-bottom: 2rem; }
.site-row { display: grid; grid-template-columns: minmax(12rem, 1.6fr) 4rem minmax(10rem, 2fr) 5.5rem 5rem 4.5rem;
  gap: 1rem; align-items: center; padding: .9rem .75rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
a.site-row:hover { background: var(--surface); }
.site-row.head { font-size: .8rem; color: var(--muted); padding-block: .6rem; }
.site-name { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.site-name strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-name small { display: block; color: var(--muted); font-size: .85rem; }
.state-down .site-name small { color: var(--bad); }
.num { text-align: right; }
.index { font-family: var(--display); font-size: 1.2rem; font-weight: 700; }
.level-good { color: var(--good); }
.level-warn { color: var(--warn); }
.level-bad { color: var(--bad); }
.level-none { color: var(--muted); }

/* полоса доступности: 24 часовых отрезка */
.strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 1.6rem; }
.strip-big { height: 3rem; gap: 3px; margin-bottom: 1.25rem; }
.cell { border-radius: 3px; background: var(--none); }
.cell-up { background: var(--good); }
.cell-partial { background: var(--warn); }
.cell-down { background: var(--bad); }

.add { margin: 1.5rem 0; }
.add summary { cursor: pointer; font-weight: 500; color: var(--accent); padding: .5rem 0; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: end;
  padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: .5rem; }
.danger-zone { margin-top: 1rem; }

/* страница сайта */
.crumbs { margin: 0; padding-top: .5rem; }
.crumbs a { color: var(--muted); }
.site-head { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
.site-head .lead { margin-bottom: .75rem; word-break: break-all; }
.status-line { display: flex; align-items: center; gap: .6rem; margin: 0; flex-wrap: wrap; }

/* индекс на орбите: спутник показывает, сколько из 100 набрал сайт */
.orbit { position: relative; width: 190px; height: 190px; flex: none; }
.orbit svg { width: 100%; height: 100%; overflow: visible; }
.orbit-track { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 2 5; }
.orbit-progress { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.orbit-sat { fill: currentColor; stroke: var(--paper); stroke-width: 4; }
.orbit-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.index-num { font-family: var(--display); font-size: 3.4rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.index-label { font-size: .85rem; font-weight: 500; margin-top: .35rem; }
@media (prefers-reduced-motion: no-preference) {
  .orbit-progress { transition: stroke-dasharray .8s ease-out; }
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; margin: 0; }
.figures dt, .facts dt { color: var(--muted); font-size: .85rem; }
.figures dd { margin: .15rem 0 0; font-family: var(--display); font-size: 1.25rem; font-weight: 500; }
.chart { margin: 1.5rem 0 0; }
.chart svg { width: 100%; height: 130px; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart figcaption { color: var(--muted); font-size: .85rem; margin-top: .5rem; }

.parts { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .75rem; }
.parts li { display: grid; grid-template-columns: 13rem 1fr; gap: .25rem 1rem; align-items: center; }
.part-bar { height: .5rem; background: var(--none); border-radius: 4px; overflow: hidden; }
.part-bar span { display: block; height: 100%; }
.part-bar .good { background: var(--good); }
.part-bar .warn { background: var(--warn); }
.part-bar .bad { background: var(--bad); }
.part-hint { grid-column: 2; color: var(--muted); font-size: .85rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.facts dd { margin: .15rem 0 0; word-break: break-word; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; }
.two-col .panel { margin-bottom: 0; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.log li { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; font-size: .925rem; }
.log time { color: var(--muted); }

@media (max-width: 760px) {
  .top-right { width: 100%; justify-content: space-between; }
  .product { display: none; }
  .site-row { grid-template-columns: 1fr auto; gap: .5rem 1rem; }
  .site-row.head { display: none; }
  .site-row > :nth-child(3) { grid-column: 1 / -1; }
  .site-row > :nth-child(4), .site-row > :nth-child(5), .site-row > :nth-child(6) { display: none; }
  .parts li { grid-template-columns: 1fr; }
  .part-hint { grid-column: 1; }
  .orbit { width: 160px; height: 160px; }
  .auth::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* отчёты и статус-страница в кабинете */
.report-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.share { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; }
.share input { flex: 1; min-width: 0; color: var(--muted); }
.inline-actions { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.inline-actions .link { color: var(--accent); }

/* публичная статус-страница */
.status-hero { margin: 1rem 0 2rem; }
.status-hero > .muted { margin: 0; }
.status-title { display: flex; align-items: center; gap: 1rem; max-width: none; margin-top: .5rem; }
.status-title .dot { width: 1.1rem; height: 1.1rem; }
.state-down .status-title { color: var(--bad); }
.days { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 3rem; }
.day { border-radius: 2px; background: var(--none); }
.day-up { background: var(--good); }
.day-partial { background: var(--warn); }
.day-down { background: var(--bad); }
.days-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin: .5rem 0 1.5rem; }
@media (max-width: 760px) {
  .days { grid-template-columns: repeat(45, 1fr); height: auto; row-gap: 4px; }
  .day { height: 1.4rem; }
}

/* SEO */
.seo-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.seo-head h2 { margin-bottom: .35rem; }
.seo-head p { margin: 0; }
.seo-score { font-family: var(--display); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.sev-counts { list-style: none; padding: 0; margin: 1.25rem 0; display: flex; gap: 2rem; flex-wrap: wrap; }
.sev-counts strong { font-family: var(--display); font-size: 1.4rem; margin-right: .35rem; }
.sev-critical strong, .sev-title.sev-critical { color: var(--bad); }
.sev-important strong, .sev-title.sev-important { color: var(--warn); }
.sev-minor strong, .sev-title.sev-minor { color: var(--muted); }
.panel .inline-actions { align-items: center; margin: 0; }
.panel .inline-actions form { margin: 0; }
.issue { border-top: 1px solid var(--line); }
.issue:last-child { border-bottom: 1px solid var(--line); }
.issue summary { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; cursor: pointer; list-style: none; }
.issue summary::-webkit-details-marker { display: none; }
.issue summary::before { content: "›"; color: var(--accent); font-weight: 600; width: 1rem; transition: transform .15s; display: inline-block; }
.issue[open] summary::before { transform: rotate(90deg); }
.issue-title { flex: 1; font-weight: 500; }
.issue-count { font-family: var(--display); color: var(--muted); }
.issue-advice { margin: 0 0 .75rem 1rem; max-width: 70ch; color: var(--muted); }
.issue-pages { margin: 0 0 1rem 1rem; padding: 0; list-style: none; display: grid; gap: .35rem; font-size: .9rem; word-break: break-all; }
.index-big { display: grid; justify-items: end; text-align: right; }
.index-big .index-num { font-size: clamp(3.5rem, 8vw, 5.5rem); }

/* 152-ФЗ */
.audits { margin-bottom: 1.25rem; }
.disclaimer { padding: .9rem 1.1rem; border-left: 3px solid var(--accent); border-radius: 0; background: var(--accent-soft);
  color: var(--ink); max-width: 75ch; margin: 0 0 1.5rem; }
.manual { margin: 0; padding-left: 1.2rem; display: grid; gap: .6rem; max-width: 80ch; }
.services dd { margin-top: .2rem; }
.nowrap { white-space: nowrap; }

/* тарифы и оплата */
.banner { padding: .7rem 1rem; border-radius: var(--radius); background: var(--accent-soft); margin: 0 0 1rem; }
.banner-bad { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--ink); }
.impersonation { display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 1rem; background: var(--warn); color: #1e1530; }
.impersonation form { margin: 0; }
.btn-small { padding: .35rem .9rem; font-size: .9rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; margin-bottom: 1rem; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem; }
.plan-card.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-card h2 { font-family: var(--display); font-size: 1.15rem; margin: 0; }
.plan-price { font-family: var(--display); font-size: 1.6rem; font-weight: 700; margin: 0; }
.plan-price s { color: var(--muted); font-size: 1rem; font-weight: 500; }
.plan-price .muted { font-family: inherit; font-size: .9rem; font-weight: 400; }
.plan-features { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; align-content: start; flex: 1; }
.plan-card form { display: grid; gap: .6rem; }
.billing-extra { margin: 1.5rem 0 1.25rem; }
.locked { border-style: dashed; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .85rem; }
.table th, .table td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.num, .table th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.pay-succeeded { color: var(--good); }
.pay-canceled { color: var(--bad); }

/* админка */
.admin-nav { display: flex; gap: .25rem; flex-wrap: wrap; margin: .5rem 0 1rem; padding: .3rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); width: fit-content; }
.admin-nav a { padding: .4rem .9rem; border-radius: 999px; color: var(--muted); text-decoration: none; }
.admin-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.admin-figures { margin: 1rem 0 1.5rem; }
.admin-figures > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.search { max-width: 30rem; }
.grid-form.plain { padding: 0; border: 0; background: none; margin: 0; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
tr.muted td { color: var(--muted); }
.two-col + .panel, .panel + .two-col { margin-top: 1.25rem; }
