:root {
  color-scheme: dark;
  --ink: #f1f3ec;
  --muted: #9aa69b;
  --soft: #c8d2c9;
  --background: #0d120f;
  --surface: #151d18;
  --surface-raised: #1b251f;
  --line: rgba(220, 239, 224, 0.12);
  --mint: #b8f36a;
  --mint-strong: #9bdd46;
  --orange: #ff9b5d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 0%, rgba(135, 202, 104, 0.13), transparent 31rem),
    linear-gradient(140deg, #0d120f 0%, #101812 55%, #0d120f 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--mint); color: #15200f; font-size: 11px; letter-spacing: -0.05em; }
.local-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(184, 243, 106, 0.08); }

.hero { padding: 86px 0 58px; max-width: 760px; }
.eyebrow, .section-label { margin: 0 0 18px; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(42px, 6vw, 78px); line-height: 0.99; letter-spacing: -0.065em; font-weight: 750; }
.hero h1 span { color: var(--mint); }
.hero-copy { max-width: 540px; margin: 29px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }

.workspace-card { display: grid; grid-template-columns: 1.16fr 0.84fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--line); box-shadow: var(--shadow); }
.import-column, .settings-column { background: var(--surface); padding: 34px; }
.settings-column { background: var(--surface-raised); }
.dropzone { min-height: 292px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; border: 1px dashed rgba(184, 243, 106, 0.42); border-radius: 16px; background: rgba(184, 243, 106, 0.035); text-align: center; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.dropzone:hover, .dropzone.is-dragging, .dropzone:focus-visible { border-color: var(--mint); background: rgba(184, 243, 106, 0.08); outline: none; transform: translateY(-2px); }
.upload-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 19px; border-radius: 14px; background: rgba(184, 243, 106, 0.12); color: var(--mint); font-size: 25px; }
.dropzone h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.dropzone p { margin: 9px 0 21px; color: var(--muted); font-size: 13px; }
.secondary-button, .download-button { border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink); padding: 10px 15px; font-size: 12px; font-weight: 700; transition: border-color 160ms ease, color 160ms ease, background 160ms ease; }
.secondary-button:hover, .download-button:hover { border-color: var(--mint); color: var(--mint); }
.file-chip { display: flex; align-items: center; gap: 13px; margin-top: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.file-chip-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--orange); color: #24150e; font-size: 9px; font-weight: 900; }
.file-details { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.file-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-details small { color: var(--muted); font-size: 11px; }
.icon-button { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.icon-button:hover { color: var(--ink); }

.setting-group { padding: 19px 0 24px; border-bottom: 1px solid var(--line); }
.setting-group + .setting-group { padding-top: 25px; }
.setting-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-heading label { font-size: 15px; font-weight: 700; }
.setting-heading output { color: var(--mint); font-size: 14px; font-weight: 800; }
.setting-group p { margin: 9px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
input[type="range"] { width: 100%; height: 4px; appearance: none; border-radius: 99px; background: linear-gradient(90deg, var(--mint) 0%, var(--mint) 30%, rgba(255, 255, 255, 0.12) 30%, rgba(255, 255, 255, 0.12) 100%); outline: none; }
input[type="range"]::-webkit-slider-thumb { width: 17px; height: 17px; appearance: none; border: 3px solid var(--surface-raised); border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 1px var(--mint); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid var(--surface-raised); border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 1px var(--mint); }
.range-labels { display: flex; justify-content: space-between; margin-top: 10px; color: #718078; font-size: 10px; }
.primary-button { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 28px; padding: 15px 17px; border: 0; border-radius: 11px; background: var(--mint); color: #15200f; font-size: 14px; font-weight: 850; transition: background 160ms ease, transform 160ms ease, opacity 160ms ease; }
.primary-button span { font-size: 20px; line-height: 0; }
.primary-button:hover:not(:disabled) { background: #d0ff8f; transform: translateY(-2px); }
.primary-button:disabled { cursor: not-allowed; opacity: 0.42; }
.form-status { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.form-status.is-error { color: #ffad8c; }

.results { padding: 110px 0 50px; }
.result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.result-heading .eyebrow { margin-bottom: 11px; }
.result-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 46px); letter-spacing: -0.055em; line-height: 1.05; }
.text-button { border: 0; background: transparent; color: var(--mint); padding: 8px 0; font-size: 13px; font-weight: 800; }
.text-button span { margin-left: 6px; }
.summary-grid { display: grid; grid-template-columns: 0.7fr 0.7fr 1.6fr; gap: 12px; }
.summary-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.summary-card span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.summary-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; letter-spacing: -0.04em; }
.warning-box { display: flex; gap: 12px; margin-top: 14px; padding: 15px 17px; border: 1px solid rgba(255, 155, 93, 0.28); border-radius: 13px; background: rgba(255, 155, 93, 0.08); color: #ffd0b7; }
.warning-icon { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #27170e; font-size: 12px; font-weight: 900; }
.warning-box strong { font-size: 12px; }
.warning-box p { margin: 4px 0 0; color: #d8a990; font-size: 12px; line-height: 1.5; }
.preview-card { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #0a0f0c; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tabs { display: flex; gap: 5px; }
.tab { border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 8px 11px; font-size: 12px; font-weight: 700; }
.tab.is-active { background: rgba(184, 243, 106, 0.12); color: var(--mint); }
.download-actions { display: flex; gap: 8px; }
.download-button { padding: 8px 11px; color: var(--soft); font-size: 11px; }
.download-button.accent { border-color: rgba(184, 243, 106, 0.38); color: var(--mint); }
.preview-content { overflow: auto; max-height: 560px; min-height: 280px; margin: 0; padding: 23px; color: #c7d5c8; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.65; white-space: pre-wrap; tab-size: 2; }
.footer { display: flex; justify-content: space-between; padding: 34px 0 40px; color: #637268; font-size: 11px; }

.is-hidden { display: none !important; }

.auth-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(5, 9, 7, 0.82); backdrop-filter: blur(14px); }
.auth-card { width: min(100%, 390px); padding: 34px; border: 1px solid rgba(184, 243, 106, 0.28); border-radius: 20px; background: var(--surface-raised); box-shadow: var(--shadow); }
.auth-card .eyebrow { margin-bottom: 16px; }
.auth-card h1 { margin: 0; font-size: 30px; letter-spacing: -0.055em; }
.auth-card > p:not(.eyebrow):not(.auth-status) { margin: 12px 0 26px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-label { display: block; margin-bottom: 9px; color: var(--soft); font-size: 12px; font-weight: 700; }
.auth-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.18); color: var(--ink); padding: 13px 14px; outline: none; }
.auth-input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(184, 243, 106, 0.1); }
.auth-submit { margin-top: 17px; }
.auth-status { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.auth-status.is-error { color: #ffad8c; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 30px, 560px); }
  .topbar { height: 72px; }
  .hero { padding: 65px 0 40px; }
  .hero-copy { font-size: 15px; }
  .workspace-card { grid-template-columns: 1fr; }
  .import-column, .settings-column { padding: 25px 21px; }
  .dropzone { min-height: 250px; }
  .results { padding-top: 75px; }
  .result-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-file { grid-column: 1 / -1; }
  .preview-toolbar { align-items: flex-start; flex-direction: column; }
  .download-actions { width: 100%; }
  .download-button { flex: 1; }
  .footer { gap: 10px; flex-direction: column; }
}

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