:root {
  color-scheme: light;
  --ink: #111315;
  --muted: #69707a;
  --line: #e5e7eb;
  --panel: #ffffff;
  --soft: #f6f7f8;
  --cream: #fff8ec;
  --mint: #0fb981;
  --cyan: #11a8c7;
  --rose: #ef476f;
  --amber: #f59f24;
  --violet: #7c3aed;
  --shadow: 0 18px 50px rgba(17, 19, 21, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fbfbfa;
  color: var(--ink);
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 36px;
  background: rgba(251, 251, 250, .88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(17, 19, 21, .08);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  font-size: 20px;
}
.brand.compact { font-size: 18px; margin-bottom: 22px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #111315, #0fb981 58%, #11a8c7);
}
nav { display: flex; align-items: center; gap: 6px; }
nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #30343a;
  font-weight: 650;
  font-size: 14px;
}
nav a:hover, .nav-cta {
  background: #111315;
  color: #fff;
}

.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  max-height: 860px;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 70px 7vw 110px;
  border-bottom: 1px solid var(--line);
}
.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(251,251,250,.96) 0%, rgba(251,251,250,.86) 36%, rgba(251,251,250,.25) 74%),
    linear-gradient(180deg, rgba(251,251,250,0) 68%, #fbfbfa 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  font-size: clamp(46px, 7vw, 92px);
  line-height: .95;
  letter-spacing: 0;
}
.lead {
  margin: 24px 0 0;
  width: min(610px, 100%);
  color: #41464d;
  font-size: 20px;
  line-height: 1.6;
}
.hero-actions, .inline-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.button, button {
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.button.primary {
  color: #fff;
  background: #111315;
  box-shadow: 0 10px 28px rgba(17, 19, 21, .20);
}
.button.ghost {
  background: #fff;
  border: 1px solid var(--line);
}
.button.icon-only { background: var(--mint); color: #fff; }
.mini {
  padding: 8px 10px;
  background: #111315;
  color: #fff;
  border-radius: 7px;
  font-size: 12px;
}

.metric-strip {
  width: min(1120px, calc(100% - 32px));
  margin: -62px auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}
.metric-strip div {
  background: #fff;
  padding: 28px;
}
.metric-strip strong {
  display: block;
  font-size: 32px;
}
.metric-strip span { color: var(--muted); font-weight: 700; }

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 80px auto;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.grid-3 article, .panel-card, .auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(17, 19, 21, .06);
}
.grid-3 article {
  padding: 28px;
  min-height: 220px;
}
.grid-3 h2, .panel-card h2 {
  margin: 0 0 12px;
  font-size: 21px;
}
.grid-3 p, .page-hero p, .split p, .muted {
  color: var(--muted);
  line-height: 1.65;
}
.icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border-radius: 8px;
  background: #e9faf4;
  color: #087b57;
  font-weight: 900;
}
.split {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 36px;
  align-items: center;
  padding: 42px;
  background: #111315;
  color: #fff;
  border-radius: 8px;
}
.split p { color: #d8dcdf; }
.split h2 { font-size: clamp(32px, 4vw, 54px); margin: 0; }
.quality-list {
  display: grid;
  gap: 12px;
}
.quality-list span {
  padding: 18px;
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  font-weight: 800;
}

.page, .auth-wrap {
  min-height: calc(100vh - 150px);
}
.page-hero {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0 36px;
}
.page-hero h1 { font-size: clamp(42px, 6vw, 76px); }
.page-hero p { font-size: 20px; width: min(720px, 100%); }

.auth-wrap {
  display: grid;
  place-items: center;
  padding: 48px 16px;
  background:
    radial-gradient(circle at 14% 10%, rgba(17,168,199,.13), transparent 28%),
    radial-gradient(circle at 85% 80%, rgba(15,185,129,.16), transparent 30%),
    #fbfbfa;
}
.auth-card {
  width: min(460px, 100%);
  padding: 34px;
}
.auth-card h1 { font-size: 32px; line-height: 1.1; margin-bottom: 24px; }

label {
  display: grid;
  gap: 8px;
  color: #363b42;
  font-size: 13px;
  font-weight: 800;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  font: inherit;
  min-width: 0;
}
textarea { resize: vertical; }
.auth-card label + label, .auth-card button { margin-top: 14px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input { width: auto; }

.panel .topbar, .panel .footer { display: none; }
.panel-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  background: #f3f4f2;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #111315;
  color: #fff;
}
.sidebar a:not(.brand) {
  display: block;
  padding: 12px 13px;
  border-radius: 8px;
  color: #d9dee2;
  font-weight: 750;
}
.sidebar a.active, .sidebar a:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.panel-main {
  min-width: 0;
  padding: 30px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.panel-head h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}
.status, .pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.status.good, .pill.valid { background: #e7faf3; color: #087b57; }
.status.danger, .pill.invalid { background: #ffe9ee; color: #b42345; }
.warning {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff0d7;
  color: #7a4a00;
  font-weight: 800;
}
.smartlink-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(17,19,21,.06);
}
.smartlink-box span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.smartlink-box strong { display: block; margin-top: 6px; font-size: clamp(14px, 2vw, 20px); overflow-wrap: anywhere; }
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.cards article {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cards span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.cards strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 34px);
}
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 18px;
  margin-top: 18px;
}
.panel-card {
  min-width: 0;
  padding: 22px;
}
.stack-form {
  display: grid;
  gap: 12px;
}
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-grid .full { grid-column: 1 / -1; }
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  margin-top: 14px;
}
th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}
th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
td small { color: var(--muted); }
.alert-list {
  display: grid;
  gap: 10px;
}
.alert {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--cyan);
  border-radius: 8px;
  background: #fff;
}
.alert.danger { border-left-color: var(--rose); }
.alert.warning { border-left-color: var(--amber); }
.alert.success { border-left-color: var(--mint); }
.alert small, .alert span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.flash {
  position: fixed;
  top: 86px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(520px, calc(100% - 32px));
  padding: 14px 16px;
  border-radius: 8px;
  background: #e7faf3;
  color: #087b57;
  box-shadow: var(--shadow);
  font-weight: 800;
}
.flash.error { background: #ffe9ee; color: #b42345; }
#toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
}
.toast {
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #111315;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}
.toast.error { background: #b42345; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.footer a { margin-left: 12px; color: var(--ink); font-weight: 750; }

@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  nav { gap: 0; }
  nav a { padding: 8px; font-size: 13px; }
  .hero { min-height: 760px; padding: 54px 16px 120px; }
  .hero-overlay { background: linear-gradient(180deg, rgba(251,251,250,.95), rgba(251,251,250,.82) 64%, #fbfbfa); }
  .lead { font-size: 17px; }
  .metric-strip, .grid-3, .split, .cards, .two-col, .settings-grid, .panel-shell {
    grid-template-columns: 1fr;
  }
  .metric-strip { margin-top: -42px; }
  .split { padding: 26px; }
  .sidebar {
    position: relative;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .sidebar .brand { flex-basis: 100%; }
  .sidebar a:not(.brand) { padding: 10px; }
  .panel-main { padding: 18px 14px; }
  .panel-head, .smartlink-box, .footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .inline-form { align-items: stretch; }
  .inline-form label, .inline-form button { width: 100%; }
}

@media (max-width: 560px) {
  .brand span:last-child { display: none; }
  h1 { font-size: 42px; }
  .hero-actions .button { width: 100%; text-align: center; }
  .metric-strip div { padding: 20px; }
  .auth-card { padding: 24px; }
  table { min-width: 620px; }
}
