/* ---------- Design tokens ---------- */
:root {
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-border: rgba(15, 15, 25, 0.08);
  --surface-2: #F1F1F7;
  --text: #12121A;
  --text-muted: rgba(18, 18, 26, 0.6);
  --primary: #4F46E5;
  --primary-2: #7C3AED;
  --accent: #C026D3;
  --green: #059669;
  --green-bg: rgba(5, 150, 105, 0.12);
  --red: #DC2626;
  --red-bg: rgba(220, 38, 38, 0.1);
  --orange: #D97706;
  --orange-bg: rgba(217, 119, 6, 0.12);
  --shadow: 0 1px 2px rgba(15,15,25,0.04), 0 12px 32px rgba(15,15,25,0.08);
  --shadow-sm: 0 1px 3px rgba(15,15,25,0.06);
  --radius: 20px;
  --radius-sm: 12px;

  /* Fixed (not theme-adaptive) gradient used behind white button/tab/chip text.
     --primary/--primary-2 are intentionally brightened in dark mode for legibility
     as plain text/icon color against a dark background -- but that same bright
     color used as a solid fill under WHITE text fails contrast (2.98:1, needs 4.5:1).
     This pair stays fixed at the light-mode values (6.29:1 with white) in both themes. */
  --btn-gradient-from: #4F46E5;
  --btn-gradient-to: #7C3AED;

  /* Typography */
  --font-heading: "PP Editorial New", "Instrument Serif", "Cormorant Garamond", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0E14;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-border: rgba(255, 255, 255, 0.09);
    --surface-2: rgba(255, 255, 255, 0.07);
    --text: #EDEDF2;
    --text-muted: rgba(237, 237, 242, 0.6);
    --primary: #818CF8;
    --primary-2: #A78BFA;
    --accent: #E879F9;
    --green: #34D399;
    --green-bg: rgba(52, 211, 153, 0.14);
    --red: #F87171;
    --red-bg: rgba(248, 113, 113, 0.14);
    --orange: #FBBF24;
    --orange-bg: rgba(251, 191, 36, 0.14);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 20px 50px rgba(0,0,0,0.45);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  }
}

:root[data-theme="light"] {
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-border: rgba(15, 15, 25, 0.08);
  --surface-2: #F1F1F7;
  --text: #12121A;
  --text-muted: rgba(18, 18, 26, 0.6);
  --primary: #4F46E5;
  --primary-2: #7C3AED;
  --accent: #C026D3;
  --green: #059669;
  --green-bg: rgba(5, 150, 105, 0.12);
  --red: #DC2626;
  --red-bg: rgba(220, 38, 38, 0.1);
  --orange: #D97706;
  --orange-bg: rgba(217, 119, 6, 0.12);
  --shadow: 0 1px 2px rgba(15,15,25,0.04), 0 12px 32px rgba(15,15,25,0.08);
}

:root[data-theme="dark"] {
  --bg: #0B0E14;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-border: rgba(255, 255, 255, 0.09);
  --surface-2: rgba(255, 255, 255, 0.07);
  --text: #EDEDF2;
  --text-muted: rgba(237, 237, 242, 0.6);
  --primary: #818CF8;
  --primary-2: #A78BFA;
  --accent: #E879F9;
  --green: #34D399;
  --green-bg: rgba(52, 211, 153, 0.14);
  --red: #F87171;
  --red-bg: rgba(248, 113, 113, 0.14);
  --orange: #FBBF24;
  --orange-bg: rgba(251, 191, 36, 0.14);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 20px 50px rgba(0,0,0,0.45);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

p {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
}

.muted { color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Icons (Lucide) ---------- */
svg.lucide {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  stroke-width: 2.1;
}
.hero-title svg.lucide {
  width: 0.72em;
  height: 0.72em;
  stroke-width: 1.6;
}
.dropzone-icon svg.lucide {
  width: 2rem;
  height: 2rem;
  color: var(--text-muted);
}
.theme-toggle svg.lucide {
  width: 1.15rem;
  height: 1.15rem;
}
.toast svg.lucide {
  width: 1.1em;
  height: 1.1em;
}

/* ---------- Background mesh ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: drift 20s ease-in-out infinite alternate;
}
.blob-1 {
  width: 420px; height: 420px;
  background: var(--primary);
  top: -120px; left: -80px;
}
.blob-2 {
  width: 380px; height: 380px;
  background: var(--accent);
  top: 30%; right: -120px;
  animation-delay: -6s;
}
.blob-3 {
  width: 340px; height: 340px;
  background: var(--primary-2);
  bottom: -140px; left: 30%;
  animation-delay: -12s;
}
@media (prefers-color-scheme: light) {
  .blob { opacity: 0.18; }
}
:root[data-theme="light"] .blob { opacity: 0.18; }
:root[data-theme="dark"] .blob { opacity: 0.35; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}

/* ---------- Layout ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 20;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.08); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 1rem 0 2rem;
  animation: fadeInUp 0.6s ease both;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(2.75rem, 2rem + 4vw, 4.75rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-style: normal;
}
.hero-title .accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem);
  font-weight: 400;
  line-height: 1.6;
  margin-top: 0.9rem;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  padding: 5px;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.7s ease both;
}
.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ---------- Panels & cards ---------- */
.panel { display: none; animation: fadeInUp 0.4s ease both; }
.panel.active { display: flex; flex-direction: column; gap: 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.card h2 { font-size: 1.35rem; }

/* ---------- Segmented control ---------- */
.segmented {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.segment {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.segment.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.input-mode { display: none; }
.input-mode.active { display: block; }

/* ---------- Inputs ---------- */
.textarea, .text-input {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}
.textarea:focus, .text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.input-row {
  display: flex;
  gap: 0.6rem;
}
.input-row .text-input { flex: 1; }

/* ---------- Dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 2rem 1rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--surface-2);
}
.dropzone-icon { display: flex; justify-content: center; }
.dropzone-text { color: var(--text-muted); font-size: 0.9rem; }
.dropzone-filename { font-weight: 600; font-size: 0.9rem; color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.94rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 45%, transparent);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--surface-border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); }

/* ---------- Progress ---------- */
.progress-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.25s ease;
}
.progress-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Summary stats ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
}
.stat-value { font-family: var(--font-heading); font-size: 1.7rem; font-weight: 400; letter-spacing: -0.02em; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.stat-green .stat-value { color: var(--green); }
.stat-red .stat-value { color: var(--red); }
.stat-orange .stat-value { color: var(--orange); }

/* ---------- Results table ---------- */
.table-wrap {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  max-height: 360px;
  overflow-y: auto;
  overflow-x: auto; /* safety net; the domain column truncates before this is normally needed */
}
.results-table {
  width: 100%;
  table-layout: fixed; /* so the Status/action columns stay a fixed size and the
                           Domain column reliably takes (and truncates within)
                           whatever's left, instead of forcing the row to widen */
  border-collapse: collapse;
  font-size: 0.9rem;
}
.results-table th:nth-child(2), .results-table td:nth-child(2) { width: 40%; }
.results-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.results-table thead th {
  position: sticky; top: 0;
  background: var(--surface-2);
  text-align: left;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.results-table td {
  padding: 0.55rem 0.9rem;
  border-top: 1px solid var(--surface-border);
}
.results-table tbody tr:hover { background: var(--surface-2); }

.skeleton-bar {
  height: 14px;
  border-radius: 4px;
  width: 70%;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
@keyframes skeletonShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Result card (single check) ---------- */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.result-card {
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: fadeInUp 0.3s ease both;
}
.result-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.result-card.result-green { background: var(--green-bg); color: var(--green); }
.result-card.result-red { background: var(--red-bg); color: var(--red); }
.result-card.result-orange { background: var(--orange-bg); color: var(--orange); }

/* ---------- WHOIS detail ---------- */
.whois-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--surface-border);
}
.whois-detail-label { font-weight: 600; }
.whois-detail-value { color: var(--text); }
tr.row-expandable { cursor: pointer; }
tr.row-expandable:hover { background: var(--surface-2); }
tr.detail-row td {
  padding: 0.75rem 0.9rem;
  background: var(--surface-2);
}
tr.detail-row .whois-detail {
  border-top: none;
  padding-top: 0;
  color: var(--text-muted);
}

/* ---------- TLD selector ---------- */
.tld-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tld-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.tld-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tld-chip {
  border: 1px solid var(--surface-border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tld-chip:hover { border-color: var(--primary); }
.tld-chip.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  border-color: transparent;
}

/* ---------- Slider ---------- */
.slider-row { display: flex; flex-direction: column; gap: 0.5rem; }
.slider-row > label { font-size: 0.9rem; font-weight: 600; }
.slider-control { display: flex; align-items: center; gap: 0.8rem; }
.slider-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--primary);
  min-width: 1.5rem;
  text-align: center;
}

.slider-number {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--primary);
  width: 3.2rem;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.2rem;
  flex-shrink: 0;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.slider-number:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
/* hide native spinner arrows for a cleaner look; the range slider is the primary control */
.slider-number::-webkit-outer-spin-button,
.slider-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.slider-number[type="number"] { -moz-appearance: textfield; }
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  cursor: pointer;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 45%, transparent);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  cursor: pointer;
}

/* ---------- Tried log ---------- */
.tried-log summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tried-log[open] summary { color: var(--text); }
.tried-log .chip-grid { margin-top: 0.75rem; }

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(420px, calc(100vw - 2rem));
}
.toast {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  font-size: 0.88rem;
  font-weight: 500;
  animation: toastIn 0.25s ease both;
}
.toast-error { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--orange); }
.toast-success { border-left: 3px solid var(--green); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Footer ---------- */
.app-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--surface-border);
  text-align: center;
  animation: fadeInUp 0.8s ease both;
}
.app-footer .social-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}
.app-footer .social-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9rem;
}
.app-footer .social-links svg.lucide { width: 0.95em; height: 0.95em; }
.app-footer p {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.heart-icon {
  color: var(--red);
  fill: var(--red);
  width: 0.85em;
  height: 0.85em;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Focus-visible (keyboard navigation) ---------- */
button:focus-visible,
.tab:focus-visible,
.segment:focus-visible,
.tld-chip:focus-visible,
tr.row-expandable:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */

/* Below this width, the 4 full-text tab labels don't reliably fit in one row --
   verified visually (Playwright screenshots at 320/375px): labels wrapped to two
   lines and the last tab was clipped by the page's overflow-x:hidden safety net.
   That clipping isn't just cosmetic -- a browser's focus/click scroll-into-view
   on the clipped tab shifts the whole page horizontally, since the tab bar is a
   real (hidden) overflow container even though the document itself doesn't
   report overflow. Icon-only tabs remove the overflow at its source instead of
   trying to patch the symptom. */
@media (max-width: 600px) {
  .tab-label { display: none; }
  .tab {
    flex: 0 1 auto;
    padding: 10px 14px;
  }
  .tabs { justify-content: center; }
  svg.lucide { width: 1.15em; height: 1.15em; }
}

@media (max-width: 520px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 1.25rem; }
}

@media (max-width: 420px) {
  .page { padding-left: 1rem; padding-right: 1rem; }
  .card { padding: 1rem; }
  .theme-toggle { width: 38px; height: 38px; top: 1rem; right: 1rem; }
}
