/* ============================================================
   Pull WHOIS — design tokens
   ============================================================ */
:root {
  color-scheme: dark;
  --bg: #07080a;
  --bg-soft: #0b0d11;
  --panel: rgba(16, 18, 23, 0.82);
  --panel-solid: #111319;
  --panel-sunken: rgba(0, 0, 0, 0.22);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f6;
  --muted: #8b93a6;
  --muted-2: #626a7c;
  --accent: #c8f564;
  --accent-2: #8be9c3;
  --accent-bg: #c8f564;
  --accent-ink: #0d1104;
  --accent-soft: rgba(200, 245, 100, 0.11);
  --blue: #8fa9ff;
  --blue-soft: rgba(143, 169, 255, 0.12);
  --ok: #5ee0a0;
  --ok-soft: rgba(94, 224, 160, 0.12);
  --warn: #ffc46b;
  --warn-soft: rgba(255, 196, 107, 0.12);
  --danger: #ff7d7d;
  --danger-soft: rgba(255, 125, 125, 0.12);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.22);
  --radius: 18px;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas,
    "Liberation Mono", monospace;
  --sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5ef;
  --bg-soft: #eceee4;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --panel-sunken: rgba(20, 30, 5, 0.035);
  --border: rgba(18, 24, 8, 0.1);
  --border-strong: rgba(18, 24, 8, 0.2);
  --text: #121608;
  --muted: #5f6652;
  --muted-2: #79816c;
  --accent: #4f6b05;
  --accent-2: #7d9a12;
  --accent-bg: #5d7d06;
  --accent-ink: #ffffff;
  --accent-soft: rgba(93, 125, 6, 0.09);
  --blue: #3355cc;
  --blue-soft: rgba(51, 85, 204, 0.09);
  --ok: #08794a;
  --ok-soft: rgba(8, 121, 74, 0.1);
  --warn: #8a5a08;
  --warn-soft: rgba(138, 90, 8, 0.1);
  --danger: #b93434;
  --danger-soft: rgba(185, 52, 52, 0.08);
  --shadow: 0 24px 70px rgba(25, 32, 10, 0.13);
  --shadow-soft: 0 10px 26px rgba(25, 32, 10, 0.08);
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(58rem 38rem at 12% -8%, rgba(200, 245, 100, 0.1), transparent 62%),
    radial-gradient(48rem 34rem at 92% 2%, rgba(120, 150, 255, 0.09), transparent 60%),
    radial-gradient(40rem 30rem at 50% 110%, rgba(139, 233, 195, 0.05), transparent 65%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(70% 55% at 50% 0%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 55% at 50% 0%, #000 0%, transparent 100%);
  opacity: 0.5;
  pointer-events: none;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(58rem 38rem at 12% -8%, rgba(125, 154, 18, 0.14), transparent 62%),
    radial-gradient(48rem 34rem at 92% 2%, rgba(70, 105, 220, 0.08), transparent 60%);
}

[data-theme="light"] body::after {
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #0c1103;
  font-size: 17px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-text {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-text em {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav > a {
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.18s ease, background 0.18s ease;
}

.nav > a:hover {
  color: var(--text);
  background: var(--panel-sunken);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: rotate(-8deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.icon-sun,
[data-theme="light"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: block;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: clamp(32px, 5vw, 76px);
  align-items: center;
  padding-top: clamp(48px, 8vw, 96px);
  padding-bottom: clamp(28px, 4vw, 44px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bg);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: pulse 2.6s ease-out infinite;
}

.hero h1 {
  margin: 0 0 20px;
  max-width: 13em;
  font-size: clamp(2.55rem, 5.4vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 750;
}

.hero h1 .accent {
  display: inline-block;
  background: linear-gradient(100deg, var(--accent) 5%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 46ch;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.72;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 620px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow:
    0 0 0 4px var(--accent-soft),
    var(--shadow-soft);
}

.search-icon {
  display: grid;
  place-items: center;
  color: var(--muted-2);
}

.search-icon svg {
  width: 19px;
  height: 19px;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.search input::placeholder {
  color: var(--muted-2);
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  font-weight: 650;
  font-size: 14.5px;
  white-space: nowrap;
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.search-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.search-btn:active {
  transform: translateY(0);
}

.search-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.search-btn kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(13, 17, 4, 0.14);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.chips-label {
  font-size: 12px;
  color: var(--muted-2);
  margin-right: 2px;
}

.chip {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.chip:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
}

/* Hero code window */
.hero-code {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.code-window {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.code-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-sunken);
}

.window-dots {
  display: inline-flex;
  gap: 5px;
}

.window-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.window-dots i:first-child {
  background: color-mix(in srgb, var(--danger) 70%, transparent);
}

.window-dots i:nth-child(2) {
  background: color-mix(in srgb, var(--warn) 70%, transparent);
}

.window-dots i:nth-child(3) {
  background: color-mix(in srgb, var(--ok) 70%, transparent);
}

.code-path {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-soft);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.code-body {
  margin: 0;
  padding: 18px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text);
  tab-size: 2;
}

.tok-cmd {
  color: var(--accent);
}

.tok-url {
  color: var(--blue);
  word-break: break-all;
}

.tok-flag {
  color: var(--warn);
}

.tok-str {
  color: var(--accent-2);
}

.code-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel-sunken);
  font-size: 11.5px;
  color: var(--muted);
}

.code-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-code-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding-left: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}

.hero-code-note span::before {
  content: "·";
  margin-right: 6px;
  color: var(--accent);
}

.hero-code-note span:first-child::before {
  content: none;
  margin: 0;
}

/* ============================================================
   Idle / skeleton
   ============================================================ */
.result-section {
  padding-bottom: clamp(36px, 5vw, 60px);
}

.idle-card {
  padding: 20px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}

.idle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.idle-grid p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.idle-grid code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.mini-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.skeleton-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.sk-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.sk-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--border);
  animation: shimmer 1.4s ease-in-out infinite;
}

.sk-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sk-line {
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(
    90deg,
    var(--border) 20%,
    var(--border-strong) 38%,
    var(--border) 56%
  );
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.sk-line.w-40 {
  width: 40%;
}

.sk-line.w-70 {
  width: 70%;
}

.sk-line.w-25 {
  width: 25%;
}

.sk-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}

.sk-stat {
  height: 88px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-sunken);
  animation: shimmer 1.4s ease-in-out infinite;
}

.sk-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.sk-block {
  height: 120px;
  border-radius: 14px;
  background: var(--panel-sunken);
  animation: shimmer 1.4s ease-in-out infinite;
}

/* ============================================================
   Result card
   ============================================================ */
.result-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--border);
}

.identity {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  min-width: 0;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #0b1003;
  font-size: 23px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.result-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  word-break: break-all;
}

.subline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.subline .sep {
  color: var(--muted-2);
}

.subline code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}

.src-badge {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-sunken);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.src-note {
  font-size: 10.5px;
  color: var(--muted-2);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill.muted {
  background: var(--panel-sunken);
  color: var(--muted);
}

.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}

.stat {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-sunken);
}

.stat-label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stat-value {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value.mono {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.stat-value.muted {
  color: var(--muted-2);
  font-weight: 500;
}

.stat-sub {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.45;
}

.stat-sub.warn {
  color: var(--warn);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 36px;
  padding: 26px;
}

.detail {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.section-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 19px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--panel-sunken);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  vertical-align: middle;
}

.mini-btn {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  font-size: 10.5px;
  color: var(--muted);
  transition: color 0.16s ease, border-color 0.16s ease;
}

.mini-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-sunken);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

.tag.is-neutral::before {
  background: var(--muted-2);
}

.tag.is-warn::before {
  background: var(--warn);
}

.empty-line {
  margin: 0;
  color: var(--muted-2);
  font-size: 12.5px;
}

.ns-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ns-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
}

.ns-item:last-child {
  border-bottom: 0;
}

.ns-index {
  flex: none;
  width: 18px;
  color: var(--muted-2);
  font-size: 10px;
}

.ns-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-row {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
}

.person-label {
  flex: none;
  width: 62px;
  color: var(--muted-2);
  font-size: 12px;
}

.person-value {
  min-width: 0;
  word-break: break-word;
}

.person-value a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.muted-text {
  color: var(--muted-2);
}

.redaction-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-sunken);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

.redaction-note svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--muted-2);
}

/* Available result */
.available-banner {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 30px 28px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(36rem 16rem at 0% 0%, var(--accent-soft), transparent 65%),
    transparent;
}

.check-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}

.available-banner h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.03em;
  word-break: break-all;
}

.available-banner p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.available-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}

.fact {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-sunken);
}

.fact span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.fact strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

/* Output */
.output {
  border-top: 1px solid var(--border);
  background: var(--panel-sunken);
}

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--border);
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
}

.tab {
  padding: 6px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  transition: color 0.16s ease, background 0.16s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.output-actions {
  display: flex;
  gap: 7px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--panel-sunken);
}

.output-panel {
  display: none;
}

.output-panel.is-active {
  display: block;
}

.output pre {
  max-height: 380px;
  margin: 0;
  padding: 20px 26px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre;
}

.output pre::-webkit-scrollbar,
.code-block::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.output pre::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--border-strong);
  background-clip: padding-box;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 13px 26px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
}

.result-meta strong {
  color: var(--muted);
  font-weight: 600;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-item::before {
  content: "·";
  color: var(--muted-2);
}

.meta-item:first-child::before {
  content: none;
}

.cache-pill {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
}

/* Error */
.error-card {
  padding: 26px 28px;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--border));
  border-radius: var(--radius);
  background:
    radial-gradient(30rem 14rem at 0% 0%, var(--danger-soft), transparent 70%),
    var(--panel);
  box-shadow: var(--shadow-soft);
  animation: rise 0.35s ease;
}

.error-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
}

.error-icon svg {
  width: 19px;
  height: 19px;
}

.error-head h2 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.error-code {
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border));
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--danger);
}

.error-message {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.error-hint {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}

.error-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.btn-primary,
.btn-secondary {
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  transition: filter 0.16s ease, border-color 0.16s ease;
}

.btn-primary {
  border: 0;
  background: var(--accent-bg);
  color: var(--accent-ink);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* ============================================================
   Features
   ============================================================ */
.features {
  padding-top: clamp(30px, 5vw, 54px);
  padding-bottom: clamp(50px, 7vw, 90px);
}

.section-title {
  margin-bottom: 26px;
}

.section-title .eyebrow {
  margin-bottom: 10px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.035em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature {
  position: relative;
  padding: 24px 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.feature-index {
  position: absolute;
  top: 18px;
  right: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -0.015em;
}

.feature p {
  margin: 0 0 14px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.feature code {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-sunken);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 22px;
  padding-bottom: 34px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12px;
}

.footer-left {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
}

.footer-brand {
  color: var(--muted);
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  transition: color 0.16s ease;
}

.footer-links a:hover {
  color: var(--text);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12.5px;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   Docs
   ============================================================ */
.docs-main {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  padding-top: 44px;
  padding-bottom: 80px;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: 92px;
  padding: 16px 0;
}

.docs-nav-title {
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.docs-nav nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav a {
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 7px 7px 0;
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  word-break: break-all;
}

.docs-nav a:hover {
  color: var(--text);
  background: var(--panel-sunken);
}

.docs-nav a.active {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.docs-nav a.nav-model {
  color: var(--muted-2);
}

.docs-hero {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}

.docs-hero .eyebrow {
  margin-bottom: 10px;
}

.docs-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.04em;
}

.docs-hero p {
  margin: 0 0 16px;
  max-width: 66ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.72;
}

.docs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
}

.docs-meta span,
.docs-meta a {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.docs-meta a {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.auth-note {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 26px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--panel);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.auth-note strong {
  color: var(--text);
}

.auth-note code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
}

.endpoint-card {
  padding: 24px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  scroll-margin-top: 90px;
}

.endpoint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.method {
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.method.get {
  background: var(--ok-soft);
  color: var(--ok);
}

.method.post {
  background: var(--blue-soft);
  color: var(--blue);
}

.endpoint-path {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  text-overflow: ellipsis;
  word-break: break-all;
}

.endpoint-head .ghost-btn {
  margin-left: auto;
}

.endpoint-card h2 {
  margin: 0 0 7px;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.endpoint-desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.endpoint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 4px;
}

.docs-subhead {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.param-table th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.param-table td {
  padding: 8px;
  border-bottom: 1px dashed var(--border);
  vertical-align: top;
  color: var(--muted);
  line-height: 1.55;
}

.param-table tr:last-child td {
  border-bottom: 0;
}

.param-table code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}

.param-table .type-cell {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--blue);
  white-space: nowrap;
}

.req {
  display: inline-block;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--danger-soft);
  color: var(--danger);
  font-family: var(--mono);
  font-size: 9px;
}

.code-block {
  max-height: 380px;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-sunken);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre;
}

.response-block {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.response-block summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.response-block summary::-webkit-details-marker {
  display: none;
}

.response-block summary::before {
  content: "›";
  display: inline-block;
  color: var(--muted-2);
  transition: transform 0.16s ease;
}

.response-block[open] summary::before {
  transform: rotate(90deg);
}

.status-code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 9.5px;
}

.docs-section-title {
  margin: 42px 0 18px;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
  scroll-margin-top: 90px;
}

.schema-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.schema-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  scroll-margin-top: 90px;
}

.schema-card h3 {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
}

.schema-card p {
  margin: 0 0 10px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.6;
}

.schema-card .param-table td {
  padding: 6px 4px;
  font-size: 11.5px;
}

.schema-card .param-table th {
  padding: 4px;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.6;
    transform: scale(0.7);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1020px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 48px;
  }

  .hero-code {
    max-width: 640px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-main {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    position: static;
    display: none;
  }

  .endpoint-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: calc(100% - 32px);
  }

  .topbar-inner {
    height: 60px;
  }

  .nav > a {
    display: none;
  }

  .nav > a:first-child {
    display: inline-block;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 9vw, 3.1rem);
  }

  .lede {
    font-size: 15px;
  }

  .search {
    flex-wrap: wrap;
    padding: 8px;
  }

  .search-icon {
    margin-left: 6px;
  }

  .search input {
    flex: 1 1 calc(100% - 48px);
    height: 40px;
    font-size: 15px;
  }

  .search-btn {
    width: 100%;
    justify-content: center;
  }

  .result-head {
    flex-direction: column;
    gap: 12px;
    padding: 20px;
  }

  .head-side {
    flex-direction: row;
    align-items: center;
  }

  .avatar {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 20px;
  }

  .stat-grid,
  .detail-grid,
  .available-body,
  .idle-grid,
  .feature-grid,
  .schema-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid,
  .detail-grid,
  .available-body {
    padding: 18px 20px;
  }

  .output-head {
    flex-wrap: wrap;
    padding: 12px 20px;
  }

  .output pre,
  .result-meta {
    padding-left: 20px;
    padding-right: 20px;
  }

  .available-banner {
    flex-direction: column;
    padding: 22px 20px;
  }

  .sk-stats,
  .sk-body {
    grid-template-columns: 1fr;
  }

  .features {
    padding-bottom: 56px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .docs-main {
    padding-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
