/* ICT Spec Checker — Tech minimal Thai */
:root {
  --bg: #fafaf7;
  --bg-2: #f4f3ee;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #2a2a2a;
  --ink-soft: #4a4a4a;
  --muted: #8a8a85;
  --line: #e6e5df;
  --line-strong: #d4d3cc;

  --yellow: #FFD400;
  --yellow-soft: #FFF4B0;
  --yellow-ink: #5a4500;

  --pass: #28a745;
  --pass-bg: #e6f7eb;
  --over: #155724;
  --over-bg: #d4edda;
  --fail: #dc3545;
  --fail-bg: #f8d7da;
  --info: #007bff;
  --info-bg: #cce5ff;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --warn-ink: #92400e;
  --incomplete: #64748b;
  --incomplete-bg: #f1f5f9;
  --incomplete-ink: #334155;

  --radius: 8px;
  --radius-lg: 16px;

  --shadow: 0 4px 20px -4px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.1);

  --font-display: "Outfit", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "Inter", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* Layout shell */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Top bar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 22px;
  height: 22px;
  background: var(--yellow);
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 700;
  font-size: 11px;
  font-family: var(--font-mono);
}
.brand-sub {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.tabs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  background: var(--bg-2);
  border-radius: 8px;
  padding: 3px;
}
.tab {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  border-radius: 6px;
  font-weight: 500;
  transition: all .15s;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px var(--line);
}

.lang-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
}
.lang-toggle button {
  background: transparent;
  border: none;
  padding: 6px 10px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.lang-toggle button.active {
  background: var(--ink);
  color: var(--paper);
}

/* Main */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px;
  width: 100%;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.1;
}
.hero h1 .hl {
  background: linear-gradient(180deg, transparent 60%, var(--yellow) 60%);
  padding: 0 2px;
}
.hero p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
  max-width: 540px;
}
.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.hero-meta .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--pass);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.card-h h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card-h .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.card-b { padding: 18px; }

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
}
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* Form controls */
.field { margin-bottom: 14px; }
.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.field-label .req { color: var(--fail); }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--yellow-soft);
}
.textarea { resize: vertical; min-height: 70px; font-family: inherit; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.input-modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--bg-2);
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.input-modes button {
  border: none;
  background: transparent;
  padding: 7px 6px;
  font-size: 12px;
  color: var(--ink-soft);
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.input-modes button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px var(--line);
}
.input-modes button svg { width: 13px; height: 13px; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  transition: all .15s;
  cursor: pointer;
  background: var(--bg-2);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--ink);
  background: var(--yellow-soft);
  color: var(--ink);
}
.dropzone .big {
  display: block;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 4px;
}

/* Buttons */
.btn {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .15s;
}
.btn:hover { background: var(--ink-2); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
  width: 100%;
}
.btn-primary:hover { background: #ffd900; border-color: #ffd900; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-2); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* Status banner */
.banner {
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.banner.pass { background: var(--pass-bg); border: 1px solid #b8d9c2; color: #155724; }
.banner.over { background: var(--over-bg); border: 1px solid #e8c84a; color: #0b2e13; }
.banner.fail { background: var(--fail-bg); border: 1px solid #e0b8b8; color: #721c24; }
.banner.incomplete { background: var(--incomplete-bg); border: 1px solid #cbd5e1; color: var(--incomplete-ink); }

.banner-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--paper);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.banner.pass .banner-icon { color: var(--pass); }
.banner.over .banner-icon { color: var(--over); background: var(--yellow); }
.banner.fail .banner-icon { color: var(--fail); }
.banner.incomplete .banner-icon { color: var(--incomplete); }

.banner-text { flex: 1; }
.banner-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.6;
  font-weight: 700;
}
.banner-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.1;
}
.banner-sub {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
  font-weight: 500;
}

.passed-specs-box {
  margin-top: 16px;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.05);
}
.passed-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: inherit;
}
.passed-title svg { width: 14px; height: 14px; stroke-width: 3; }
.passed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.passed-item {
  background: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.03);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.passed-item.warn {
  background: rgba(255, 243, 205, 0.7);
  border-color: rgba(255, 193, 7, 0.3);
}


.banner-stat {
  display: flex;
  gap: 20px;
  margin-left: auto;
  text-align: right;
  padding: 0 10px;
}
.banner-stat-item {
  font-family: var(--font-mono);
}
.banner-stat-item .v {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  display: block;
  line-height: 1;
}
.banner-stat-item .l {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 6px;
  display: block;
  font-weight: 600;
}

/* Enhanced Comparison Table */
.table-card { overflow: hidden; }
.card-h-main { display: flex; align-items: center; gap: 12px; }
.card-icon { 
  width: 32px; height: 32px; background: var(--bg-2); border-radius: 8px;
  display: grid; place-items: center; color: var(--muted);
}
.card-sub { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.badge-id { 
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  background: var(--ink); color: var(--paper); padding: 2px 8px; border-radius: 4px;
}

.compare { width: 100%; border-collapse: collapse; }
.compare th {
  background: var(--bg-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-strong);
}
.compare-row { transition: background 0.2s; }
.compare-row:hover { background: rgba(0,0,0,0.015); }
.compare td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }

.spec-label { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.spec-key { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.spec-key .opt { background: var(--bg-2); padding: 1px 4px; border-radius: 3px; font-size: 9px; font-weight: 700; }

.spec-req .req-val { font-size: 14px; font-weight: 700; color: var(--ink-soft); font-family: var(--font-mono); }

.input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.input-table {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
  font-family: var(--font-display);
}
.input-focus-line {
  position: absolute; bottom: 4px; left: 0; width: 0%; height: 2px;
  background: var(--yellow); transition: width 0.3s ease;
}
.input-table:focus + .input-focus-line { width: 100%; }
.unit-tag {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  background: var(--bg-2); padding: 2px 6px; border-radius: 4px; margin-left: 8px;
}
.edit-hint { position: absolute; right: 0; color: var(--line-strong); transition: color 0.2s; pointer-events: none; }
.input-wrapper:hover .edit-hint { color: var(--muted); }

.compare-row.row-over { background: rgba(212, 237, 218, 0.2); }
.compare-row.row-fail { background: rgba(248, 215, 218, 0.2); }
.compare-row.row-warn { background: rgba(255, 243, 205, 0.2); }

.pill {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.pill.pass { background: var(--pass-bg); color: var(--pass); }
.pill.over { background: var(--yellow); color: var(--yellow-ink); }
.pill.fail { background: var(--fail-bg); color: var(--fail); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.na { background: var(--bg-2); color: var(--muted); }

/* Empty state */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.empty-icon {
  width: 56px; height: 56px;
  background: var(--bg-2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 4px;
  font-weight: 600;
}
.empty p { font-size: 13px; margin: 0 auto; max-width: 360px; }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: var(--bg-2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.log {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line);
  margin-top: 10px;
  max-height: 120px;
  overflow: auto;
}
.log .step { padding: 2px 0; }
.log .step.done { color: var(--ink-soft); }
.log .step.done::before { content: "✓ "; color: var(--pass); }
.log .step.active::before { content: "→ "; color: var(--ink); }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 16px 28px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
}
.footer a { color: var(--ink-soft); text-decoration: none; }

/* Compare 2 view */
.compare-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.spec-mini {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--bg-2);
}
.spec-mini h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}
.spec-mini .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Batch list */
.batch-list { display: flex; flex-direction: column; gap: 8px; }
.batch-item {
  display: grid;
  grid-template-columns: 1fr 200px 100px 36px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 13px;
}
.batch-item .b-name { font-weight: 500; }
.batch-item .b-cat { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.batch-add {
  display: grid;
  grid-template-columns: 1fr 1fr 200px auto;
  gap: 8px;
  margin-bottom: 14px;
}
.icon-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.icon-btn:hover { color: var(--fail); border-color: var(--fail); }

/* ICT spec excerpt */
.ict-quote {
  background: var(--bg-2);
  border-left: 3px solid var(--yellow);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
  margin-top: 12px;
}
.ict-quote .head {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.ict-quote .body {
  color: var(--ink-soft);
  line-height: 1.55;
}
.ict-quote .ict-id {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
}

/* Budget recommender */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.rec-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--paper);
  position: relative;
  transition: all .15s;
}
.rec-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.rec-card .rec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.rec-card .rec-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  margin: 0;
  line-height: 1.2;
}
.rec-card .rec-brand {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rec-card .rec-price {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.rec-card .rec-price .baht {
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
  margin-right: 2px;
}
.rec-card .rec-spec {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 8px 0;
  line-height: 1.5;
}
.rec-card .rec-spec span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: inline-block;
  margin-right: 6px;
}
.rec-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--yellow);
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-top: 6px;
}

/* Result wrapper */
.result-stack { display: flex; flex-direction: column; gap: 16px; }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-2);
  color: var(--ink-soft);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* Compare diff arrows */
.diff {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.diff.up { color: var(--over); font-weight: 600; }
.diff.down { color: var(--fail); font-weight: 600; }

.scroll-x { overflow-x: auto; }

.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
}

/* ============== Responsive — Tablet ============== */
@media (max-width: 900px) {
  .topbar-inner {
    padding: 10px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .brand-sub { display: none; }
  .tabs { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .tab { white-space: nowrap; padding: 6px 10px; font-size: 12px; }
  .main { padding: 18px 16px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero h1 { font-size: 26px; }
  .hero-meta { align-items: flex-start; }
  .grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .compare-2 { grid-template-columns: 1fr; }
  .banner { flex-wrap: wrap; padding: 18px; gap: 14px; }
  .banner-stat { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ============== Responsive — Mobile ============== */
@media (max-width: 600px) {
  body { font-size: 13px; }
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .brand { font-size: 14px; flex: 1; min-width: 0; }
  .lang-toggle button { padding: 5px 8px; }

  .main { padding: 14px 12px; }
  .hero { padding-bottom: 14px; margin-bottom: 16px; }
  .hero h1 { font-size: 22px; letter-spacing: -0.02em; }
  .hero p { font-size: 12px; }
  .hero-meta { font-size: 10px; flex-direction: row; flex-wrap: wrap; gap: 10px; }

  .card-h { padding: 12px 14px; }
  .card-b { padding: 14px; }
  .card-h h3 { font-size: 12px; }

  /* Form rows collapse */
  .row { grid-template-columns: 1fr; gap: 0; }
  .input-modes { grid-template-columns: repeat(2, 1fr); }
  .input-modes button { font-size: 11px; padding: 8px 4px; }

  .input, .select, .textarea { font-size: 14px; padding: 10px 12px; } /* 14px to prevent iOS zoom */
  .btn { padding: 11px 14px; font-size: 13px; }
  .btn .kbd { display: none; }

  /* Banner stacks */
  .banner { padding: 16px; gap: 12px; }
  .banner-icon { width: 40px; height: 40px; }
  .banner-icon svg { width: 18px; height: 18px; }
  .banner-title { font-size: 18px; }
  .banner-sub { font-size: 12px; }
  .banner-status { font-size: 10px; }
  .banner-stat-item .v { font-size: 18px; }
  .banner-stat-item .l { font-size: 9px; }

  /* Comparison table → card list on mobile */
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100%; }
  .compare tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: var(--paper);
  }
  .compare tr.row-over { background: linear-gradient(180deg, var(--paper), var(--yellow-soft)); border-color: #e8c84a; }
  .compare tr.row-fail { background: var(--fail-bg); border-color: #e0b8b8; }
  .compare td {
    border: none !important;
    padding: 4px 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    width: auto !important;
  }
  .compare td:first-child {
    font-size: 13px;
    font-weight: 600;
    padding-bottom: 6px !important;
    border-bottom: 1px dashed var(--line) !important;
    margin-bottom: 4px;
  }
  .compare td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .compare td:first-child::before { display: none; }

  /* Batch list */
  .batch-add {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .batch-add .select { grid-column: 1 / -1; }
  .batch-add .btn { grid-column: 1 / -1; }
  .batch-item {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 12px;
  }
  .batch-item > div:nth-child(2) { grid-column: 1 / 2; font-size: 10px; }
  .batch-item > div:nth-child(3) { grid-column: 2 / 3; grid-row: 1 / 2; justify-self: end; }
  .batch-item .icon-btn { grid-column: 2 / 3; grid-row: 2 / 3; justify-self: end; }

  /* Budget grid */
  .budget-grid { grid-template-columns: 1fr; gap: 10px; }
  .rec-card { padding: 14px; }

  /* Footer */
  .footer { flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px 16px; font-size: 10px; }

  /* Spec mini cards */
  .spec-mini { padding: 12px; }

  /* Dropzone */
  .dropzone { padding: 22px 12px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .hero h1 { font-size: 20px; }
  .tabs { padding: 2px; }
  .tab { padding: 5px 8px; font-size: 11px; }
}

/* Datatable Specific */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}
.pill.pass { background: #e6f7eb; color: #28a745; }
.pill.over { background: #d4edda; color: #155724; }
.pill.fail { background: #f8d7da; color: #dc3545; }
.pill.na { background: #f4f3ee; color: #8a8a85; }
.pill.info { background: #cce5ff; color: #007bff; }
.pill.warn { background: #fff3cd; color: #856404; }

.compare-row {
  transition: background 0.2s;
}
.compare-row:hover {
  background: var(--bg-2);
}

.edit-trigger {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--muted);
  pointer-events: none;
}
.compare-row:hover .edit-trigger {
  opacity: 1;
}

.input-table {
  cursor: pointer;
}
.input-table:hover {
  background-color: rgba(0,0,0,0.02) !important;
}
