/* ==========================================================
   HackWHOIS — Ollama Design System
   Pure black on white. Pill everything. No shadows. No gradients.
   ========================================================== */

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Tokens ── */
:root {
  /* brand */
  --c-primary:        #000000;
  --c-ink-deep:       #090909;
  --c-on-primary:     #ffffff;

  /* surface */
  --c-canvas:         #ffffff;
  --c-surface-soft:   #fafafa;
  --c-surface-dark:   #171717;

  /* hairline */
  --c-hairline:       #e5e5e5;
  --c-hairline-strong:#d4d4d4;

  /* text */
  --c-ink:            #000000;
  --c-charcoal:       #525252;
  --c-body:           #737373;
  --c-mute:           #a3a3a3;
  --c-on-dark:        #ffffff;
  --c-on-dark-mute:   rgba(255,255,255,0.7);

  /* semantic */
  --c-positive:       #22c55e;
  --c-negative:       #ef4444;
  --c-warning:        #f59e0b;

  /* terminal */
  --c-terminal-red:    #ff5f56;
  --c-terminal-yellow: #ffbd2e;
  --c-terminal-green:  #27c93f;

  /* focus */
  --c-focus:          rgba(59,130,246,0.5);

  /* spacing (8px base) */
  --s-xxs: 2px;
  --s-xs:  4px;
  --s-sm:  8px;
  --s-md:  12px;
  --s-lg:  16px;
  --s-xl:  24px;
  --s-xxl: 32px;
  --s-section: 88px;

  /* radius */
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-full: 9999px;

  /* font */
  --ff: 'SF Pro Rounded', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ── Base ── */
html { font-size: 16px; }

body {
  background: var(--c-canvas);
  color: var(--c-ink);
  font-family: var(--ff-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding-left: var(--s-xl);
  padding-right: var(--s-xl);
}

/* ════════════════════════════════════════════
   Top Navigation — flat white bar, 56px
   ════════════════════════════════════════════ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-canvas);
  border-bottom: 1px solid var(--c-hairline);
  height: 56px;
}
.top-nav .container {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav-brand {
  font-family: var(--ff);
  font-size: 16px;
  font-weight: 600;
  color: var(--c-ink);
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  text-decoration: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-xl);
}
.nav-link {
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-body);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--c-ink); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
}

/* ════════════════════════════════════════════
   Hero — white canvas, centered, Ollama-style
   ════════════════════════════════════════════ */
.hero-band {
  background: var(--c-canvas);
  color: var(--c-ink);
  padding: var(--s-section) 0;
  text-align: center;
}

.hero-headline {
  font-family: var(--ff);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.11;
  color: var(--c-ink);
  margin-bottom: var(--s-md);
}

.hero-sub {
  font-family: var(--ff-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-body);
  margin-bottom: var(--s-xxl);
}

/* ── Search Pill (install-snippet style) ── */
.search-card {
  max-width: 560px;
  margin: 0 auto;
}

.search-row {
  display: flex;
  gap: var(--s-sm);
  align-items: center;
  background: var(--c-surface-soft);
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-full);
  padding: 6px 6px 6px 20px;
  height: 48px;
  transition: border-color 0.15s, background 0.15s;
}
.search-row:focus-within {
  background: var(--c-canvas);
  border-color: var(--c-ink);
}

.search-input-wrap { flex: 1; min-width: 0; }

.search-input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  font-family: var(--ff-mono);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-ink);
  outline: none;
}
.search-input-wrap input::placeholder { color: var(--c-mute); }

.search-hint {
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--c-mute);
  margin-top: var(--s-sm);
}

/* ════════════════════════════════════════════
   Buttons — all pills (rounded.full)
   ════════════════════════════════════════════ */

/* button-primary: black pill */
.btn-primary {
  background: var(--c-primary);
  color: var(--c-on-primary);
  border: none;
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 20px;
  height: 36px;
  border-radius: var(--r-full);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover  { background: var(--c-ink-deep); }
.btn-primary:active { background: var(--c-ink-deep); transform: scale(0.97); }
.btn-primary:disabled { background: var(--c-surface-soft); color: var(--c-mute); cursor: not-allowed; }

/* button-on-dark: white pill on dark surface */
.btn-on-dark {
  background: var(--c-on-primary);
  color: var(--c-primary);
  border: none;
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 20px;
  height: 36px;
  border-radius: var(--r-full);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.btn-on-dark:active { transform: scale(0.97); }

/* button-secondary: outline pill */
.btn-secondary {
  background: var(--c-canvas);
  color: var(--c-ink);
  border: 1px solid var(--c-hairline-strong);
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 20px;
  height: 36px;
  border-radius: var(--r-full);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { border-color: var(--c-ink); }

/* button-ghost: no border pill */
.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border: none;
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 16px;
  height: 36px;
  border-radius: var(--r-full);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-ghost:hover { background: var(--c-surface-soft); }

/* button-link */
.btn-link {
  background: transparent;
  color: var(--c-ink);
  border: none;
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════════
   Content Band — white canvas
   ════════════════════════════════════════════ */
.content-band {
  background: var(--c-canvas);
  padding: var(--s-xl) 0 var(--s-section);
}

/* ── Tabs (pill-tab group) ── */
.tabs {
  display: inline-flex;
  gap: var(--s-xs);
  background: var(--c-surface-soft);
  border-radius: var(--r-full);
  padding: 3px;
  margin-bottom: var(--s-xxl);
  border: 1px solid var(--c-hairline);
}

.tab {
  background: none;
  border: none;
  color: var(--c-body);
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 16px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all 0.15s;
}
.tab:hover  { color: var(--c-ink); }
.tab.active {
  color: var(--c-on-primary);
  background: var(--c-ink);
}

/* ── Panels ── */
.panel        { display: none; }
.panel.active { display: block; }

/* ── Loading ── */
.loading {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: var(--s-lg);
  color: var(--c-body);
  font-family: var(--ff-body);
  font-size: 14px;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--c-hairline);
  border-top-color: var(--c-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ── */
.error-box {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: var(--s-md) var(--s-lg);
  background: #fef2f2;
  border: 1px solid var(--c-negative);
  border-radius: var(--r-lg);
  color: var(--c-negative);
  margin-bottom: var(--s-lg);
  font-family: var(--ff-body);
  font-size: 14px;
}
.error-icon { font-weight: 700; }

/* ── Results ── */
.results { animation: fadeUp 0.2s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-xl);
  flex-wrap: wrap;
  gap: var(--s-sm);
}
.result-header h2 {
  font-family: var(--ff);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.33;
  color: var(--c-ink);
}
.result-actions { display: flex; gap: var(--s-xs); flex-wrap: wrap; }

/* ── Section label ── */
.section { margin-bottom: var(--s-xl); }
.section-label {
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.33;
  color: var(--c-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--s-sm);
}

/* ── Status Badges ── */
.badge-row {
  display: flex;
  gap: var(--s-xs);
  flex-wrap: wrap;
}
.badge-positive {
  background: var(--c-surface-soft);
  color: var(--c-ink);
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-hairline);
}

/* ── DNS Grid ── */
.dns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-sm);
}
.dns-record {
  background: var(--c-surface-soft);
  border-radius: var(--r-full);
  padding: var(--s-sm) var(--s-lg);
  border: 1px solid var(--c-hairline);
  font-family: var(--ff-mono);
  font-size: 13px;
}
.dns-type {
  color: var(--c-ink);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: var(--s-sm);
  font-family: var(--ff-body);
}
.dns-value {
  color: var(--c-body);
  font-size: 13px;
  word-break: break-all;
}

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-md);
}
.info-card {
  background: var(--c-canvas);
  border-radius: var(--r-lg);
  padding: var(--s-xl);
  border: 1px solid var(--c-hairline);
}
.info-card-label {
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.33;
  color: var(--c-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--s-xxs);
}
.info-card-value {
  font-family: var(--ff-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-ink);
  word-break: break-word;
}
.info-card-value a {
  color: var(--c-ink);
  text-decoration: underline;
}

/* ── Terminal Card (raw output) ── */
.terminal-card {
  background: var(--c-canvas);
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
  margin-top: var(--s-sm);
}
.terminal-header {
  display: flex;
  gap: var(--s-xs);
  margin-bottom: var(--s-md);
}
.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--r-full);
}
.terminal-dot--red    { background: var(--c-terminal-red); }
.terminal-dot--yellow { background: var(--c-terminal-yellow); }
.terminal-dot--green  { background: var(--c-terminal-green); }

.raw-details summary {
  cursor: pointer;
  user-select: none;
}
.raw-output {
  background: var(--c-surface-soft);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
  font-family: var(--ff-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-ink);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
}

/* ════════════════════════════════════════════
   Batch Panel
   ════════════════════════════════════════════ */
.card-feature-sage {
  background: var(--c-canvas);
  border-radius: var(--r-lg);
  padding: var(--s-xxl);
  border: 1px solid var(--c-hairline);
}

.card-feature-sage textarea {
  width: 100%;
  background: var(--c-surface-soft);
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-lg);
  padding: var(--s-md) var(--s-lg);
  font-family: var(--ff-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.card-feature-sage textarea::placeholder { color: var(--c-mute); }
.card-feature-sage textarea:focus { border-color: var(--c-ink); }

.batch-controls {
  display: flex;
  gap: var(--s-sm);
  margin-top: var(--s-md);
  align-items: center;
  flex-wrap: wrap;
}
.file-upload { cursor: pointer; }
.file-upload input[type="file"] { display: none; }

/* ── Progress ── */
.progress-bar {
  margin: var(--s-xl) 0;
  display: flex;
  align-items: center;
  gap: var(--s-sm);
}
.progress-track {
  flex: 1;
  height: 4px;
  background: var(--c-hairline);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--c-ink);
  border-radius: var(--r-full);
  width: 0%;
  transition: width 0.3s ease;
}
#progress-text {
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-body);
  min-width: 60px;
  text-align: right;
}

/* ── Batch Table ── */
.table-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-hairline);
}
.batch-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-canvas);
}
.batch-table th {
  background: var(--c-surface-soft);
  text-align: left;
  padding: var(--s-md) var(--s-lg);
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.33;
  color: var(--c-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--c-hairline);
}
.batch-table td {
  padding: var(--s-md) var(--s-lg);
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  color: var(--c-ink);
  border-bottom: 1px solid var(--c-hairline);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.batch-table tr:hover td { background: var(--c-surface-soft); }
.batch-table .status-ok  { color: var(--c-positive); font-weight: 500; }
.batch-table .status-err { color: var(--c-negative); font-weight: 500; }
.batch-table .btn-link {
  background: none;
  border: none;
  color: var(--c-ink);
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ════════════════════════════════════════════
   History Panel
   ════════════════════════════════════════════ */
.history-controls { margin-bottom: var(--s-lg); }

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-xs);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-canvas);
  border-radius: var(--r-lg);
  padding: var(--s-md) var(--s-lg);
  cursor: pointer;
  border: 1px solid var(--c-hairline);
  transition: background 0.15s;
}
.history-item:hover { background: var(--c-surface-soft); }

.history-query {
  font-family: var(--ff-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-ink);
}
.history-meta {
  font-family: var(--ff-body);
  font-size: 12px;
  color: var(--c-mute);
}

.history-type {
  background: var(--c-surface-soft);
  color: var(--c-body);
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-full);
  margin-left: var(--s-xs);
  border: 1px solid var(--c-hairline);
}

.empty-state-wrap {
  background: var(--c-surface-soft);
  border-radius: var(--r-lg);
  padding: var(--s-xxl);
  text-align: center;
  border: 1px solid var(--c-hairline);
}
.empty-state {
  font-family: var(--ff-body);
  font-size: 14px;
  color: var(--c-mute);
}

/* ════════════════════════════════════════════
   Footer — white, hairline top border
   ════════════════════════════════════════════ */
.footer {
  background: var(--c-canvas);
  border-top: 1px solid var(--c-hairline);
  color: var(--c-body);
  padding: var(--s-xxl) var(--s-xl);
}
.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--s-sm);
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.43;
  color: var(--c-mute);
}
.footer-sep {
  width: 4px; height: 4px;
  background: var(--c-hairline);
  border-radius: 50%;
}

/* ════════════════════════════════════════════
   Theme Toggle
   ════════════════════════════════════════════ */
.theme-toggle {
  background: none;
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-full);
  padding: 6px 12px;
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-body);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  white-space: nowrap;
  height: 32px;
}
.theme-toggle:hover { border-color: var(--c-ink); color: var(--c-ink); }
.theme-toggle-icon { font-size: 14px; line-height: 1; }

/* ── Language Toggle ── */
.lang-toggle {
  background: none;
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-full);
  padding: 6px 10px;
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-body);
  cursor: pointer;
  transition: all 0.15s;
  height: 32px;
}
.lang-toggle:hover { border-color: var(--c-ink); color: var(--c-ink); }

/* ════════════════════════════════════════════
   Mobile Nav — hamburger menu
   ════════════════════════════════════════════ */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.nav-hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--c-ink);
  border-radius: 1px;
  position: absolute;
  left: 13px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger-line:nth-child(1) { top: 14px; }
.nav-hamburger-line:nth-child(2) { top: 21px; }
.nav-hamburger-line:nth-child(3) { top: 28px; }
.nav-hamburger.open .nav-hamburger-line:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-hamburger.open .nav-hamburger-line:nth-child(2) { opacity: 0; }
.nav-hamburger.open .nav-hamburger-line:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* Mobile nav overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.nav-mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile nav drawer */
.nav-mobile-drawer {
  display: none;
  position: fixed;
  top: 56px;
  right: 0;
  width: 280px;
  max-width: 80vw;
  height: calc(100vh - 56px);
  z-index: 101;
  background: var(--c-canvas);
  border-left: 1px solid var(--c-hairline);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-mobile-drawer.open {
  transform: translateX(0);
}
.nav-mobile-links {
  display: flex;
  flex-direction: column;
  padding: var(--s-md) 0;
}
.nav-mobile-link {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 var(--s-xl);
  font-family: var(--ff-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-body);
  text-decoration: none;
  border-bottom: 1px solid var(--c-hairline);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-mobile-link:active { background: var(--c-surface-soft); }
.nav-mobile-link.active {
  color: var(--c-ink);
  font-weight: 600;
}

/* ════════════════════════════════════════════
   DNS Type Tabs
   ════════════════════════════════════════════ */
.dns-type-tabs {
  display: flex;
  gap: var(--s-xxs);
  background: var(--c-surface-soft);
  border-radius: var(--r-full);
  padding: 3px;
  margin-bottom: var(--s-sm);
  border: 1px solid var(--c-hairline);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dns-type-tabs::-webkit-scrollbar { display: none; }

.dns-type-tab {
  background: none;
  border: none;
  color: var(--c-body);
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 12px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.dns-type-tab:hover { color: var(--c-ink); }
.dns-type-tab.active {
  background: var(--c-ink);
  color: var(--c-on-primary);
}
.dns-type-count {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.5;
  margin-left: 2px;
}

.dns-grid-group { display: none; }
.dns-grid-group.active { display: grid; }

/* ════════════════════════════════════════════
   Responsive — Tablet (< 1024px)
   ════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ════════════════════════════════════════════
   Responsive — Mobile (< 768px)
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* iOS safe area */
  body { padding-bottom: env(safe-area-inset-bottom, 0); }

  /* Nav: show hamburger, hide desktop links */
  .nav-hamburger { display: block; }
  .nav-links { display: none; }
  .nav-mobile-overlay,
  .nav-mobile-drawer { display: block; }

  /* Hero */
  .hero-band {
    padding: 48px 0 64px;
  }
  .hero-headline {
    font-size: 28px;
    line-height: 1.15;
  }
  .hero-sub {
    font-size: 15px;
    margin-bottom: var(--s-xl);
  }
  .search-row {
    height: 44px;
    padding: 4px 4px 4px 16px;
  }
  .search-input-wrap input {
    font-size: 14px;
  }
  .search-hint {
    font-size: 12px;
  }

  /* Content */
  .content-band { padding: var(--s-lg) 0 48px; }
  .container {
    padding-left: var(--s-lg);
    padding-right: var(--s-lg);
  }

  /* Tabs: scrollable on mobile */
  .tabs {
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    padding: 10px var(--s-sm);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Result header: stack */
  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-sm);
  }
  .result-header h2 { font-size: 20px; }
  .result-actions {
    width: 100%;
    display: flex;
    gap: var(--s-xs);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--s-xxs);
  }
  .result-actions::-webkit-scrollbar { display: none; }
  .result-actions .btn-secondary {
    flex-shrink: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Cards: single column */
  .cards-grid,
  .dns-grid {
    grid-template-columns: 1fr;
    gap: var(--s-xs);
  }

  /* Info cards: compact padding */
  .info-card { padding: var(--s-lg); }

  /* DNS records: full width */
  .dns-record { padding: var(--s-sm) var(--s-md); }

  /* Badge row: horizontal scroll */
  .badge-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--s-xxs);
  }
  .badge-row::-webkit-scrollbar { display: none; }
  .badge-positive {
    flex-shrink: 0;
    min-height: 32px;
    display: flex;
    align-items: center;
  }

  /* Batch controls: stack */
  .batch-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .batch-controls .btn-primary,
  .batch-controls .btn-secondary,
  .batch-controls .btn-ghost {
    width: 100%;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .file-upload { width: 100%; }
  .file-upload .btn-secondary { width: 100%; text-align: center; justify-content: center; }

  /* Batch table: horizontal scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .batch-table { min-width: 560px; }
  .batch-table th,
  .batch-table td {
    padding: var(--s-sm) var(--s-md);
  }

  /* History: compact items */
  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-xs);
    padding: var(--s-sm) var(--s-md);
    min-height: 48px;
  }
  .history-item > div {
    display: flex;
    align-items: center;
    gap: var(--s-xs);
    flex-wrap: wrap;
  }
  .history-meta { font-size: 11px; }

  /* Progress */
  .progress-bar { gap: var(--s-xs); }

  /* Buttons: all 44px min touch targets */
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .btn-link { min-height: 44px; }
  .btn-primary { padding: 10px 20px; }
  .btn-secondary { padding: 10px 18px; }

  /* Raw output */
  .raw-output {
    font-size: 12px;
    max-height: 320px;
  }

  /* Footer */
  .footer { padding: var(--s-xl); }
  .footer-inner { font-size: 12px; }
}

/* ════════════════════════════════════════════
   Responsive — Small Mobile (< 480px)
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .hero-band { padding: 32px 0 48px; }
  .hero-headline { font-size: 24px; }
  .hero-sub { font-size: 14px; }
  .result-header h2 { font-size: 18px; }
  .batch-table { min-width: 480px; }
  .section-label { font-size: 11px; }
}

/* ════════════════════════════════════════════
   iOS / Mobile-specific fixes
   ════════════════════════════════════════════ */

/* Prevent iOS zoom on input focus */
@supports (-webkit-touch-callout: none) {
  input[type="text"],
  textarea {
    font-size: 16px !important;
  }
}

/* Smooth momentum scrolling */
.scrollable-x {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  scrollbar-width: none;
}
.scrollable-x::-webkit-scrollbar { display: none; }

/* Remove tap highlight on mobile */
@media (hover: none) and (pointer: coarse) {
  .tab,
  .btn-primary,
  .btn-on-dark,
  .btn-secondary,
  .btn-ghost,
  .btn-link,
  .nav-link,
  .history-item,
  .nav-mobile-link,
  .nav-hamburger {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ════════════════════════════════════════════
   Dark Mode — html[data-theme="dark"]
   Ollama-style: surface-dark #171717
   ════════════════════════════════════════════ */
html[data-theme="dark"] {
  --c-primary:        #ffffff;
  --c-ink-deep:       #e5e5e5;
  --c-on-primary:     #000000;

  --c-canvas:         #0a0a0a;
  --c-surface-soft:   #171717;
  --c-surface-dark:   #171717;

  --c-hairline:       #262626;
  --c-hairline-strong:#404040;

  --c-ink:            #ffffff;
  --c-charcoal:       #d4d4d4;
  --c-body:           #a3a3a3;
  --c-mute:           #737373;
  --c-on-dark:        #ffffff;
  --c-on-dark-mute:   rgba(255,255,255,0.6);

  --c-positive:       #4ade80;
  --c-negative:       #f87171;
  --c-warning:        #fbbf24;

  --c-focus:          rgba(96,165,250,0.5);
}

/* Dark mode: top nav */
html[data-theme="dark"] .top-nav {
  background: var(--c-canvas);
  border-bottom-color: var(--c-hairline);
}

/* Dark mode: nav hamburger */
html[data-theme="dark"] .nav-hamburger-line {
  background: var(--c-ink);
}

/* Dark mode: search row */
html[data-theme="dark"] .search-row {
  background: var(--c-surface-soft);
  border-color: var(--c-hairline);
}
html[data-theme="dark"] .search-row:focus-within {
  background: var(--c-canvas);
  border-color: var(--c-ink);
}

/* Dark mode: error box */
html[data-theme="dark"] .error-box {
  background: #2a1010;
  border-color: var(--c-negative);
}

/* Dark mode: raw output */
html[data-theme="dark"] .raw-output {
  background: #0a0a0a;
}

/* Dark mode: terminal card */
html[data-theme="dark"] .terminal-card {
  background: var(--c-canvas);
  border-color: var(--c-hairline);
}

/* Dark mode: theme/lang toggle */
html[data-theme="dark"] .theme-toggle {
  border-color: var(--c-hairline);
  color: var(--c-body);
}
html[data-theme="dark"] .theme-toggle:hover {
  border-color: var(--c-ink);
  color: var(--c-ink);
}
html[data-theme="dark"] .lang-toggle {
  border-color: var(--c-hairline);
  color: var(--c-body);
}
html[data-theme="dark"] .lang-toggle:hover {
  border-color: var(--c-ink);
  color: var(--c-ink);
}

/* Dark mode: mobile drawer */
html[data-theme="dark"] .nav-mobile-drawer {
  background: var(--c-canvas);
  border-left-color: var(--c-hairline);
}
html[data-theme="dark"] .nav-mobile-link {
  color: var(--c-body);
  border-bottom-color: var(--c-hairline);
}
html[data-theme="dark"] .nav-mobile-overlay {
  background: rgba(0, 0, 0, 0.6);
}

/* Dark mode: DNS type tabs */
html[data-theme="dark"] .dns-type-tab.active {
  background: var(--c-ink);
  color: var(--c-on-primary);
}

/* Dark mode: badge */
html[data-theme="dark"] .badge-positive {
  background: var(--c-surface-soft);
  border-color: var(--c-hairline);
  color: var(--c-ink);
}

/* Dark mode: history type */
html[data-theme="dark"] .history-type {
  background: var(--c-surface-soft);
  border-color: var(--c-hairline);
  color: var(--c-body);
}

/* Auto dark mode via system preference */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --c-primary:        #ffffff;
    --c-ink-deep:       #e5e5e5;
    --c-on-primary:     #000000;

    --c-canvas:         #0a0a0a;
    --c-surface-soft:   #171717;
    --c-surface-dark:   #171717;

    --c-hairline:       #262626;
    --c-hairline-strong:#404040;

    --c-ink:            #ffffff;
    --c-charcoal:       #d4d4d4;
    --c-body:           #a3a3a3;
    --c-mute:           #737373;
    --c-on-dark:        #ffffff;
    --c-on-dark-mute:   rgba(255,255,255,0.6);

    --c-positive:       #4ade80;
    --c-negative:       #f87171;
    --c-warning:        #fbbf24;

    --c-focus:          rgba(96,165,250,0.5);
  }

  html[data-theme="auto"] .top-nav { background: var(--c-canvas); }
  html[data-theme="auto"] .nav-hamburger-line { background: var(--c-ink); }
  html[data-theme="auto"] .search-row { background: var(--c-surface-soft); border-color: var(--c-hairline); }
  html[data-theme="auto"] .search-row:focus-within { background: var(--c-canvas); border-color: var(--c-ink); }
  html[data-theme="auto"] .error-box { background: #2a1010; border-color: var(--c-negative); }
  html[data-theme="auto"] .raw-output { background: #0a0a0a; }
  html[data-theme="auto"] .terminal-card { background: var(--c-canvas); border-color: var(--c-hairline); }
  html[data-theme="auto"] .theme-toggle { border-color: var(--c-hairline); color: var(--c-body); }
  html[data-theme="auto"] .theme-toggle:hover { border-color: var(--c-ink); color: var(--c-ink); }
  html[data-theme="auto"] .lang-toggle { border-color: var(--c-hairline); color: var(--c-body); }
  html[data-theme="auto"] .lang-toggle:hover { border-color: var(--c-ink); color: var(--c-ink); }
  html[data-theme="auto"] .nav-mobile-drawer { background: var(--c-canvas); border-left-color: var(--c-hairline); }
  html[data-theme="auto"] .nav-mobile-link { color: var(--c-body); border-bottom-color: var(--c-hairline); }
  html[data-theme="auto"] .nav-mobile-overlay { background: rgba(0, 0, 0, 0.6); }
  html[data-theme="auto"] .dns-type-tab.active { background: var(--c-ink); color: var(--c-on-primary); }
  html[data-theme="auto"] .badge-positive { background: var(--c-surface-soft); border-color: var(--c-hairline); color: var(--c-ink); }
  html[data-theme="auto"] .history-type { background: var(--c-surface-soft); border-color: var(--c-hairline); color: var(--c-body); }
}

/* ════════════════════════════════════════════
   Utilities
   ════════════════════════════════════════════ */
.hidden { display: none !important; }

::selection {
  background: var(--c-ink);
  color: var(--c-on-primary);
}

::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-hairline); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-mute); }
