:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f5f4f1;
  --ink: #141414;
  --ink-soft: #3a3a37;
  --muted: #787774;
  --faint: #a3a29c;
  --line: #eaeaea;
  --line-soft: #f1f0ec;
  --pastel-red: #fdebec;
  --red-text: #9f2f2d;
  --pastel-blue: #e1f3fe;
  --blue-text: #1f6c9f;
  --pastel-green: #edf3ec;
  --green-text: #346538;
  --pastel-yellow: #fbf3db;
  --yellow-text: #956400;
  --radius: 14px;
  --radius-sm: 9px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: "Space Grotesk", "SF Pro Display", -apple-system, "Helvetica Neue", sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--ink); text-decoration: none; }
button { font-family: inherit; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.14); border-radius: 6px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 28px; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 2147480000;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: inline-flex; align-items: baseline; gap: 8px; flex: none; }
.brand-mono { font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; letter-spacing: 0.02em; }
.brand-serif { font-family: var(--font-serif); font-style: italic; font-size: 19px; color: var(--muted); }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav-link {
  font-size: 13.5px;
  color: var(--muted);
  padding: 8px 15px;
  border-radius: 8px;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.nav-link:hover { color: var(--ink); background: var(--line-soft); }
.nav-link.is-active { color: var(--ink); background: var(--surface-2); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-user { font-size: 12px; color: var(--muted); display: none; }
.topbar-right form { margin: 0; }

.flash-wrap { max-width: 1120px; margin: 20px auto -14px; padding: 0 28px; width: 100%; }
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  animation: flashIn 0.5s var(--ease) both;
}
.flash-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; }
.flash-success { background: var(--pastel-green); color: var(--green-text); }
.flash-success .flash-dot { background: var(--green-text); }
.flash-error { background: var(--pastel-red); color: var(--red-text); }
.flash-error .flash-dot { background: var(--red-text); }
.flash-info { background: var(--pastel-blue); color: var(--blue-text); }
.flash-info .flash-dot { background: var(--blue-text); }
.flash-list { display: flex; flex-direction: column; gap: 2px; }
.flash-list span + span::before { content: ""; }
.flash-success, .flash-error, .flash-info { margin: 0; }

.page { padding: 52px 28px 110px; flex: 1 0 auto; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--faint);
  margin: 0 0 10px;
}
.serif-h {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
.serif-h-sm { font-size: 26px; }
.page-sub { color: var(--muted); margin: 12px 0 0; font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  align-items: start;
}
.bento + .bento,
form + .bento { margin-top: 20px; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  transition: box-shadow 0.35s var(--ease);
}
.card:hover { box-shadow: 0 2px 12px rgba(20, 20, 20, 0.04); }
.card-sticky { position: sticky; top: 92px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.card-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0;
}

.stat-number {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 6px 0 10px;
}
.stat-number-sm { font-size: 27px; letter-spacing: -0.01em; margin: 4px 0 14px; line-height: 1.2; }
.stat-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
  margin-top: 10px;
}
.stat-foot:first-of-type { margin-top: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--pastel-green); color: var(--green-text); }
.badge-red { background: var(--pastel-red); color: var(--red-text); }
.badge-blue { background: var(--pastel-blue); color: var(--blue-text); }
.badge-yellow { background: var(--pastel-yellow); color: var(--yellow-text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: #ffffff; }
.btn-primary:hover { background: #333330; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--line-soft); }
.btn-danger { background: var(--pastel-red); color: var(--red-text); }
.btn-danger:hover { background: #f9dddf; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: 11.5px; border-radius: 7px; font-weight: 500; }
.btn-block { width: 100%; }
.btn-block + .btn-block { margin-top: 8px; }

.text-link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.text-link:hover { text-decoration-color: var(--ink); }

.codeblock {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink-soft);
}
.codeblock code { font-family: inherit; }
.codeblock-xs { font-size: 12px; padding: 12px 14px; }

.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-align: left;
  padding: 0 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 14px 10px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color 0.25s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.td-num { text-align: right; font-variant-numeric: tabular-nums; }
.td-name { font-weight: 500; max-width: 260px; }
.td-ts { font-size: 11.5px; white-space: nowrap; }
.td-actions, .th-actions { text-align: right; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }

.chip {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--line-soft);
  border-radius: 6px;
  padding: 3px 9px;
  color: var(--ink-soft);
}

.row-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tag-mini {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--muted);
}
.tag-mini-more { border-style: dashed; }

.tone-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.tone-green { background: #16a34a; }
.tone-teal { background: #0d9488; }
.tone-amber { background: #d97706; }
.tone-blue { background: #2563eb; }
.tone-violet { background: #7c3aed; }
.tone-red { background: #dc2626; }
.tone-slate { background: #475569; }
.tone-pink { background: #db2777; }

.feats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.featpick { position: relative; display: block; cursor: pointer; }
.featpick input { position: absolute; opacity: 0; pointer-events: none; }
.featpick span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-soft);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.featpick svg { width: 13px; height: 13px; flex: none; opacity: 0.8; }
.featpick:hover span { border-color: #d4d4cf; }
.featpick input:checked + span { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.featpick input:checked + span svg { opacity: 1; }
.featpick input:focus-visible + span { box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.18); }

@media (max-width: 560px) {
  .feats { grid-template-columns: 1fr; }
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 44px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty p { margin: 0; }

.field { margin-bottom: 20px; }
.label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 8px;
}
.input, .select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  appearance: none;
}
.inputmono, .input.mono, input.mono.input { font-family: var(--font-mono); font-size: 13px; }
.input:hover { border-color: #dcdcd8; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.08); outline: none; }
.input::placeholder { color: var(--faint); }
.hint { color: var(--faint); font-size: 12px; margin: 7px 0 0; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

#modal-colors, #content-cta, #security { scroll-margin-top: 96px; }

.cond-inline { transition: opacity 0.3s var(--ease); }
.is-hidden { display: none !important; }

.checkbox-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 22px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }
.checkbox-row label { font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  background: var(--surface);
}
.seg-item { position: relative; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  user-select: none;
  white-space: nowrap;
}
.seg-item input:checked + span { background: var(--ink); color: #ffffff; }
.seg-item input:focus-visible + span { box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.18); }
.seg-item span:hover { color: var(--ink); }
.seg-item input:checked:hover + span { color: #ffffff; }

.switch-row { display: flex; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: #d8d8d3;
  padding: 3px;
  display: inline-flex;
  transition: background-color 0.3s var(--ease);
  flex: none;
}
.switch-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.35s var(--ease);
}
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.18); }
.switch-text { font-size: 13px; color: var(--ink-soft); }

.colorpair { display: flex; align-items: center; gap: 10px; }
.colorpair .input { min-width: 0; }
.colorpair input[type="color"] {
  width: 46px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  flex: none;
}

.steps { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.steps li { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.steps li:first-child { border-top: none; }
.step-num { font-size: 11px; color: var(--faint); padding-top: 3px; letter-spacing: 0.1em; flex: none; }
.step-title { font-weight: 500; margin: 0 0 3px; }
.steps p { font-size: 13px; }
.steps-compact li { padding: 13px 0; }

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  position: relative;
  padding: 32px 20px;
}
.auth-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 420px at 24% 12%, rgba(150, 120, 70, 0.05), transparent 70%),
    radial-gradient(640px 480px at 82% 86%, rgba(70, 110, 150, 0.05), transparent 70%);
}
.auth-shell { width: 100%; max-width: 460px; animation: shellIn 0.8s var(--ease) both; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px 34px;
  box-shadow:
    0 0 0 8px rgba(20, 20, 20, 0.03),
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    0 30px 70px -42px rgba(20, 20, 20, 0.35);
}
.auth-brand { display: flex; align-items: baseline; gap: 8px; margin-bottom: 28px; }
.auth-title { font-family: var(--font-serif); font-weight: 400; font-size: 32px; letter-spacing: -0.015em; line-height: 1.12; margin: 8px 0 10px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 26px; }
.auth-note {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 20px;
}
.auth-note p { margin: 0 0 6px; font-size: 12.5px; }
.auth-note p:last-child { margin-bottom: 0; }
.auth-foot { text-align: center; font-size: 11.5px; margin-top: 18px; color: var(--faint); }

.footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 26px;
  padding-bottom: 26px;
  flex-wrap: wrap;
}
.footer-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--muted); }
.footer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); display: inline-block; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }
.reveal.in:not([style*="--i"]) { transition-delay: 0ms; }

@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes shellIn { from { opacity: 0; transform: translateY(18px) scale(0.995); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .card-sticky { position: static; }
  .topbar-user { display: inline; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .page { padding: 34px 18px 90px; }
  .topbar-inner { padding: 0 18px; height: 60px; gap: 10px; }
  .nav { margin-left: 0; overflow-x: auto; }
  .nav-link { padding: 7px 11px; font-size: 12.5px; }
  .topbar-user { display: none; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .page-head { margin-bottom: 28px; }
  .card { padding: 22px; }
  .stat-number { font-size: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
