:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fd;
  --ink: #182033;
  --muted: #6d7588;
  --line: #e2e6f0;
  --primary: #5046e5;
  --primary-dark: #3e35c7;
  --green: #07845c;
  --red: #c92a2a;
  --orange: #ee8b2d;
  --shadow: 0 22px 60px rgba(38, 45, 86, .11);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(80, 70, 229, .12), transparent 28rem),
    radial-gradient(circle at 94% 8%, rgba(14, 165, 233, .1), transparent 27rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.topbar {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 9px 22px rgba(80, 70, 229, .24);
}
.brand-mark svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.top-link { color: var(--muted); font-size: 14px; font-weight: 750; text-decoration: none; }
.top-link:hover { color: var(--primary); }
.auth-shell {
  display: grid;
  width: min(980px, calc(100% - 40px));
  min-height: calc(100vh - 108px);
  grid-template-columns: 1fr 440px;
  gap: 72px;
  align-items: center;
  margin: 0 auto;
  padding: 42px 0 72px;
}
.auth-copy small {
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-copy h1 {
  max-width: 540px;
  margin: 16px 0 20px;
  font-size: clamp(44px, 6vw, 68px);
  line-height: 1;
  letter-spacing: -.055em;
}
.auth-copy h1 span { color: var(--primary); }
.auth-copy p { max-width: 540px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.feature-list { display: grid; gap: 13px; margin-top: 28px; }
.feature-list span { display: flex; align-items: center; gap: 11px; color: #4f586d; font-size: 14px; font-weight: 700; }
.feature-list i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: #e5f8f1;
  font-style: normal;
}
.auth-card {
  padding: 30px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 26px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 13px; background: #f0f2f8; }
.tab {
  height: 42px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 5px 14px rgba(27, 34, 63, .08); }
.form-title { margin: 25px 0 6px; font-size: 24px; letter-spacing: -.025em; }
.form-subtitle { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.field + .field { margin-top: 16px; }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; }
input, select {
  width: 100%;
  height: 49px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(80,70,229,.1); }
.form-message {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--red);
  background: #fff0f0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
.primary-button {
  width: 100%;
  height: 51px;
  margin-top: 20px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 12px 25px rgba(80,70,229,.23);
  cursor: pointer;
  font-weight: 850;
}
.primary-button:hover { background: var(--primary-dark); }
.primary-button:disabled { cursor: wait; opacity: .68; }
.privacy-note { margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; text-align: center; }

.dashboard-layout { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 26px 20px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(15px);
}
.sidebar .brand { padding: 0 9px 24px; }
.side-nav { display: grid; gap: 7px; margin-top: 16px; }
.side-nav a, .side-nav button {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 12px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
}
.side-nav a.active { color: var(--primary); background: #eeecff; }
.side-nav svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.user-mini { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); }
.user-mini strong, .user-mini small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini strong { font-size: 13px; }
.user-mini small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.dashboard-main { min-width: 0; padding: 32px clamp(20px, 4vw, 54px) 60px; }
.dashboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dashboard-head small { color: var(--primary); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-head h1 { margin: 7px 0 5px; font-size: 34px; letter-spacing: -.04em; }
.dashboard-head p { margin: 0; color: var(--muted); font-size: 14px; }
.head-actions { display: flex; gap: 10px; }
.secondary-button, .scope-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 15px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}
.secondary-button:hover { border-color: var(--primary); color: var(--primary); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-top: 27px; }
.metric-card { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 9px 30px rgba(32,40,75,.05); }
.metric-card span { display: block; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.metric-card strong { display: block; overflow: hidden; margin-top: 9px; font-size: 26px; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(280px,.8fr); gap: 16px; margin-top: 16px; }
.panel { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 9px 30px rgba(32,40,75,.05); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-head select { width: auto; height: 38px; padding-right: 34px; font-size: 12px; }
.chart-wrap { min-height: 248px; }
.chart-wrap svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-empty { display: grid; min-height: 220px; place-items: center; color: var(--muted); font-size: 13px; }
.breakdown { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(75px,110px) 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.bar-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; overflow: hidden; border-radius: 999px; background: #eef0f5; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--primary),#7c74ff); }
.bar-row strong { min-width: 28px; text-align: right; }
.links-panel { margin-top: 16px; }
.domain-panel { margin-top: 16px; scroll-margin-top: 24px; }
.domain-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #f0f2f8;
  font-size: 11px;
  font-weight: 850;
}
.domain-badge.ready { color: var(--green); background: #e5f8f1; }
.domain-badge.pending { color: #a45508; background: #fff3df; }
.domain-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.domain-form .secondary-button { height: 49px; }
.domain-help { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.domain-detail { display: grid; gap: 16px; }
.domain-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.domain-summary > div { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.domain-summary small, .domain-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-summary small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.domain-summary strong { margin-top: 6px; font-size: 13px; }
.dns-guide { display: grid; gap: 9px; }
.dns-title { margin: 0 0 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dns-row { display: grid; grid-template-columns: minmax(110px,.55fr) minmax(0,1.45fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; }
.dns-row small { color: var(--muted); font-size: 10px; font-weight: 750; }
.dns-row code { overflow: hidden; color: #384057; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.copy-dns { border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 10px; font-weight: 850; }
.domain-actions { display: flex; gap: 9px; }
.danger-button { min-height: 42px; border: 1px solid #f3caca; border-radius: 11px; padding: 0 15px; color: var(--red); background: #fff8f8; cursor: pointer; font-weight: 800; }
.danger-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .6; }
.scope-switch { display: flex; gap: 5px; padding: 4px; border-radius: 10px; background: #f0f2f8; }
.scope-button { min-height: 32px; border: 0; padding: 0 11px; color: var(--muted); background: transparent; font-size: 11px; }
.scope-button.active { color: var(--ink); background: #fff; box-shadow: 0 3px 9px rgba(25,33,60,.08); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 0 12px 10px; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 13px 12px; border-top: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
tr[data-slug] { cursor: pointer; }
tr[data-slug]:hover, tr.selected { background: #f8f8ff; }
.link-cell strong, .link-cell small { display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-cell strong { color: var(--primary); }
.link-cell small { margin-top: 4px; color: var(--muted); }
.owner-cell small { color: var(--muted); }
.empty-state { padding: 38px 15px; color: var(--muted); font-size: 13px; text-align: center; }
.loading { opacity: .56; pointer-events: none; }
.dashboard-message { margin-top: 18px; padding: 12px 14px; border-radius: 12px; color: var(--red); background: #fff0f0; font-size: 13px; font-weight: 700; }
.mobile-nav { display: none; }
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; gap: 36px; }
  .auth-copy { text-align: center; }
  .auth-copy p { margin-inline: auto; }
  .feature-list { width: fit-content; margin-inline: auto; text-align: left; }
  .auth-card { width: min(100%, 480px); margin: 0 auto; }
  .dashboard-layout { display: block; }
  .sidebar { display: none; }
  .dashboard-main { padding-top: 84px; }
  .mobile-nav {
    position: fixed;
    z-index: 20;
    top: 0;
    display: flex;
    width: 100%;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 0 17px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
  }
  .mobile-nav .brand span:last-child { display: none; }
}
@media (max-width: 560px) {
  .topbar, .auth-shell { width: min(100% - 24px, 980px); }
  .topbar { min-height: 65px; }
  .auth-shell { padding-top: 28px; }
  .auth-copy h1 { font-size: 42px; }
  .auth-copy p { font-size: 15px; }
  .auth-card { padding: 23px 18px; border-radius: 21px; }
  .dashboard-main { padding-inline: 13px; }
  .dashboard-head { display: block; }
  .head-actions { margin-top: 16px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 15px 13px; }
  .metric-card strong { font-size: 21px; }
  .panel { padding: 16px 13px; }
  .panel-head { align-items: flex-start; }
  .domain-form { grid-template-columns: 1fr; }
  .domain-form .secondary-button { width: 100%; }
  .domain-summary { grid-template-columns: 1fr; }
  .dns-row { grid-template-columns: 1fr auto; }
  .dns-row small { grid-column: 1 / -1; }
  .dns-row code { white-space: normal; word-break: break-all; }
  .bar-row { grid-template-columns: 78px 1fr auto; }
  th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
