@import url('https://fonts.googleapis.com/css2?family=Chivo+Mono:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-alt: #efece5;
  --ink: #111827;
  --muted: #4b5563;
  --subtle: #6b7280;
  --border: #111827;
  --border-soft: #d6d3cb;
  --border-strong: #111827;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #dbeafe;
  --success: #047857;
  --success-hover: #065f46;
  --success-soft: #d1fae5;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --header-bg: #111827;
  --header-ink: #f9fafb;
  --shadow: 3px 3px 0 #111827;
  --shadow-lg: 5px 5px 0 #111827;
  --radius: 4px;
  --radius-sm: 3px;
  --mono: 'Chivo Mono', ui-monospace, SFMono-Regular, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
[data-theme="dark"] {
  --bg: #0f1419;
  --surface: #171e26;
  --surface-alt: #202a36;
  --ink: #f3f4f6;
  --muted: #cbd5e1;
  --subtle: #94a3b8;
  --border: #e5e7eb;
  --border-soft: #334155;
  --border-strong: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: #1e3a5f;
  --success: #10b981;
  --success-hover: #059669;
  --success-soft: #064e3b;
  --amber-soft: #451a03;
  --warn-soft: #451a03;
  --danger-soft: #450a0a;
  --header-bg: #090d11;
  --header-ink: #f9fafb;
  --shadow: 3px 3px 0 #000000;
  --shadow-lg: 5px 5px 0 #000000;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1220px; margin: 0 auto; padding: 0 20px; }

/* Hallmark Ink Header Bar */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--header-bg); color: var(--header-ink); border-bottom: 3px solid var(--amber); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; font-size: 16px; color: #fff; letter-spacing: -0.02em; text-transform: uppercase; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; background: var(--amber); color: #111827; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; border: 2px solid #fff; }
.nav-links { display: flex; align-items: center; gap: 20px; font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.nav-links a { color: #d1d5db; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quota-pill { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: #111827; background: var(--amber); border: 2px solid #111827; padding: 4px 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 16px; border-radius: var(--radius-sm); border: 2px solid var(--border); cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease; white-space: nowrap; }
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--border); }
.btn:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--border); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; border-color: var(--border); }
.btn-success:hover:not(:disabled) { background: var(--success-hover); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--surface-alt); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); color: var(--ink); box-shadow: none; transform: none; }
.topbar .btn-outline { background: transparent; color: #fff; border-color: #6b7280; }
.topbar .btn-outline:hover { background: #1f2937; border-color: #fff; box-shadow: none; transform: none; }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }

/* Hero */
.hero { padding: 38px 0 24px; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--amber-soft); color: #92400e; border: 2px solid var(--border); font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 4px 12px; margin-bottom: 14px; }
[data-theme="dark"] .hero-badge { color: #fcd34d; }
.hero h1 { margin: 0 auto 12px; max-width: 820px; font-family: var(--mono); font-size: clamp(26px, 3.8vw, 42px); line-height: 1.15; letter-spacing: -0.03em; color: var(--ink); }
.hero p { margin: 0 auto; max-width: 640px; color: var(--muted); font-size: 16px; }

/* Workspace */
.workspace { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 24px; margin-bottom: 40px; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg); padding: 38px 20px; text-align: center; transition: background 0.15s ease; cursor: pointer; }
.dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-icon { width: 50px; height: 50px; margin: 0 auto 12px; background: var(--primary); color: #fff; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 3px 3px 0 var(--border); }
.dropzone h2 { margin: 0 0 6px; font-family: var(--mono); font-size: 19px; font-weight: 700; }
.dropzone p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.dropzone-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.trust-strip { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Banners & Queue */
.banner { display: none; margin-top: 16px; padding: 12px 14px; border: 2px solid var(--border); font-size: 14px; font-weight: 500; }
.banner.show { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.banner.info { background: var(--primary-soft); color: var(--ink); }
.banner.warn { background: var(--warn-soft); color: var(--ink); }
.banner.error { background: var(--danger-soft); color: var(--danger); }
.banner.success { background: var(--success-soft); color: var(--success); }
.queue-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.queue-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 2px solid var(--border-soft); background: var(--bg); font-size: 13.5px; }
.queue-name { font-family: var(--mono); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-tag { font-family: var(--mono); font-size: 11.5px; font-weight: 700; text-transform: uppercase; padding: 3px 9px; border: 1.5px solid var(--border); }
.status-tag.working { background: var(--primary-soft); color: var(--primary); }
.status-tag.done { background: var(--success-soft); color: var(--success); }
.status-tag.failed { background: var(--danger-soft); color: var(--danger); }

/* Results & Tables */
.results-section { display: none; margin-top: 24px; padding-top: 24px; border-top: 2px solid var(--border); }
.results-section.show { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-card { background: var(--bg); border: 2px solid var(--border); padding: 12px 14px; }
.kpi-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--subtle); font-weight: 700; }
.kpi-value { font-family: var(--mono); font-size: 21px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.tabs { display: inline-flex; background: var(--surface-alt); border: 2px solid var(--border); padding: 3px; gap: 3px; }
.tab-btn { border: none; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 7px 12px; cursor: pointer; }
.tab-btn.active { background: var(--ink); color: var(--surface); }
.export-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.table-wrap { overflow-x: auto; border: 2px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; background: var(--header-bg); color: #fff; font-family: var(--mono); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.cell-input { width: 100%; min-width: 90px; border: 1.5px solid transparent; background: transparent; font-family: var(--mono); font-size: 13px; color: var(--ink); padding: 4px 6px; font-variant-numeric: tabular-nums; }
.cell-input:hover { border-color: var(--border-soft); background: var(--surface); }
.cell-input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.cell-num { text-align: right; min-width: 74px; }
.delete-row-btn { border: none; background: transparent; color: var(--subtle); cursor: pointer; padding: 4px 8px; font-size: 14px; }
.delete-row-btn:hover { background: var(--danger-soft); color: var(--danger); }

/* Sections & Cards */
.section { padding: 44px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 28px; }
.section-head h2 { margin: 0 0 8px; font-family: var(--mono); font-size: 26px; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--muted); }
.features-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature-card { background: var(--surface); border: 2px solid var(--border); box-shadow: var(--shadow); padding: 20px; }
.feature-card h3 { margin: 0 0 6px; font-family: var(--mono); font-size: 15.5px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.price-card { background: var(--surface); border: 2px solid var(--border); box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; position: relative; }
.price-card.featured { border-color: var(--primary); box-shadow: 5px 5px 0 var(--primary); }
.popular-tag { position: absolute; top: -13px; right: 14px; background: var(--amber); color: #111827; border: 2px solid var(--border); font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 10px; }
.price-name { font-family: var(--mono); font-weight: 700; font-size: 16px; text-transform: uppercase; }
.price-amount { font-family: var(--mono); font-size: 32px; font-weight: 700; margin: 10px 0 4px; letter-spacing: -0.03em; }
.price-amount span { font-size: 13px; font-weight: 500; color: var(--subtle); }
.price-desc { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.price-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--muted); flex: 1; }
.price-list li::before { content: "✓ "; color: var(--success); font-weight: 700; }

/* FAQ & Footer */
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.faq-item { background: var(--surface); border: 2px solid var(--border); padding: 18px 20px; }
.faq-item h3 { margin: 0 0 6px; font-family: var(--mono); font-size: 14.5px; }
.faq-item p { margin: 0; font-size: 14px; color: var(--muted); }
.footer { border-top: 3px solid var(--amber); background: var(--header-bg); color: #d1d5db; padding: 28px 0; margin-top: 28px; font-size: 13.5px; }
.footer a { color: #f3f4f6; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; }

/* Modals & Feedback Stars */
.modal-backdrop { display: none; position: fixed; inset: 0; z-index: 60; background: rgba(17, 24, 39, 0.7); align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border: 2px solid var(--border); box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 24px; }
.modal h3 { margin: 0 0 6px; font-family: var(--mono); font-size: 18px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; margin-bottom: 5px; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 2px solid var(--border); background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 15px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); }
.star-row { display: flex; gap: 6px; }
.star-btn { border: 2px solid var(--border); background: var(--surface-alt); color: var(--subtle); font-size: 18px; width: 38px; height: 38px; cursor: pointer; }
.star-btn.active { background: var(--amber); color: #111827; }

@media (max-width: 960px) {
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features-grid, .faq-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .workspace { padding: 16px; }
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 1120px; }
.cell-wide { min-width: 210px; }
.cell-med { min-width: 155px; }
.cell-date { min-width: 115px; }
.cell-cat { min-width: 175px; }
.expand-btn { border: 1.5px solid var(--border-soft); background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 7px; cursor: pointer; }
.expand-btn:hover { background: var(--amber-soft); border-color: var(--border); }
.detail-row td { background: var(--bg); padding: 14px 16px; border-bottom: 2px solid var(--border); }
/* Mobile Polish Layer */
@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .features-grid { grid-template-columns: 1fr !important; }
  .hero { padding: 24px 0 16px; }
  .hero h1 { font-size: 26px; line-height: 1.18; }
  .hero p { font-size: 14.5px; }
  .section { padding: 30px 0; }
  .section-head h2 { font-size: 22px; }
  .tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex-shrink: 0; padding: 8px 11px; font-size: 11.5px; }
  .field input, .field textarea, .field select, .cell-input { font-size: 16px; }
  .modal { padding: 18px; max-height: 92vh; overflow-y: auto; }
}
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .brand { font-size: 14.5px; }
  .nav-actions { width: 100%; justify-content: space-between; gap: 6px; padding-top: 6px; border-top: 1px solid #1f2937; }
  .quota-pill { font-size: 11px; padding: 4px 8px; }
  .btn-sm { padding: 8px 10px; min-height: 38px; }
  .workspace { padding: 14px; box-shadow: 3px 3px 0 var(--border); }
  .dropzone { padding: 24px 14px; }
  .dropzone h2 { font-size: 16.5px; }
  .dropzone p { font-size: 13px; }
  #chooseFilesBtn { width: 100%; min-height: 46px; font-size: 14px; }
  .trust-strip { flex-direction: column; gap: 6px; font-size: 11.5px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-value { font-size: 17px; }
  .results-toolbar { flex-direction: column; align-items: stretch; }
  .export-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .export-bar #exportXlsxBtn { grid-column: span 2; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-links { gap: 12px; }
}