:root {
  --paper: #f3f0e8;
  --card: #faf8f2;
  --ink: #11120f;
  --muted: #67685f;
  --line: #c9c4b8;
  --signal: #d9f45a;
  --blue: #173f4b;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Arial, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--paper); }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 12px; padding: 12px 15px; color: #fff; background: var(--ink); transform: translateY(-170%); }
.skip-link:focus { transform: none; }
.site-header { position: sticky; z-index: 20; top: 0; min-height: 78px; padding: 12px clamp(18px, 4vw, 64px); display: flex; align-items: center; gap: clamp(22px, 4vw, 58px); border-bottom: 1px solid var(--line); background: #f3f0e8ed; backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-size: 10px; letter-spacing: .24em; }
.brand span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid currentColor; font: 650 15px Georgia, serif; }
.header-context { display: flex; align-items: center; gap: 14px; color: var(--muted); font: 750 8px ui-monospace, monospace; letter-spacing: .13em; }
.header-context i { width: clamp(35px, 6vw, 95px); height: 1px; background: var(--line); }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.site-header nav a { padding: 10px 12px; color: var(--muted); text-decoration: none; font-size: 9px; font-weight: 750; }
.site-header nav a:hover { color: var(--ink); }
.page-shell { width: min(1500px, calc(100% - clamp(36px, 7vw, 120px))); margin-inline: auto; }
.eyebrow { margin: 0; color: var(--muted); font: 780 9px ui-monospace, monospace; letter-spacing: .17em; }
.intro { min-height: 510px; padding-block: clamp(75px, 9vw, 135px); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .65fr); align-items: end; gap: clamp(55px, 10vw, 170px); }
.intro h1 { margin: 22px 0 0; font-size: clamp(62px, 8vw, 126px); font-weight: 450; line-height: .84; letter-spacing: -.07em; }
.intro-copy > p { margin: 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 21px); line-height: 1.62; }
.trust-line { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.trust-line span { position: relative; padding-left: 13px; color: var(--ink); font: 720 8px ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.trust-line span::before { content: ""; position: absolute; left: 0; top: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px #d9f45a48; }
.builder-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(35px, 6vw, 95px); padding-bottom: clamp(100px, 12vw, 180px); }
.steps { position: sticky; top: 115px; align-self: start; border-top: 1px solid var(--ink); }
.step { min-height: 72px; padding: 18px 4px; display: grid; grid-template-columns: 33px 1fr; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.45; }
.step b { font: 760 8px ui-monospace, monospace; }
.step.active { color: var(--ink); border-bottom-color: var(--ink); }
.work-area { min-width: 0; display: grid; gap: 28px; }
.panel { padding: clamp(25px, 4vw, 55px); border: 1px solid var(--ink); background: var(--card); }
.panel-heading { margin-bottom: 38px; display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.panel h2 { margin: 10px 0 0; max-width: 760px; font-size: clamp(30px, 3.4vw, 53px); font-weight: 480; line-height: 1; letter-spacing: -.05em; }
.permission-note, .queue-count { padding: 8px 10px; border: 1px solid var(--line); color: var(--muted); font: 720 8px ui-monospace, monospace; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.permission-note.ready { color: var(--ink); border-color: var(--signal); background: var(--signal); }
.field-label { display: block; margin-bottom: 9px; color: var(--muted); font: 750 8px ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
select { width: 100%; min-height: 56px; padding: 0 45px 0 16px; border: 1px solid var(--ink); border-radius: 0; background: #fff; }
.field-help { margin: 12px 0 0; max-width: 780px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.drop-zone { min-height: 175px; padding: 28px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; border: 1px dashed #77786f; background: var(--paper); transition: border-color .2s, background .2s; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging { outline: none; border-style: solid; border-color: var(--ink); background: #eff4dc; }
.drop-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-size: 29px; font-weight: 300; }
.drop-zone strong, .drop-zone small { display: block; }
.drop-zone strong { font-size: 16px; font-weight: 570; }
.drop-zone small { margin-top: 7px; color: var(--muted); font-size: 10px; }
.text-button, .quiet-button { min-height: 42px; padding: 0 14px; border: 1px solid var(--ink); background: transparent; font-size: 9px; font-weight: 780; text-transform: uppercase; }
.file-queue, .source-library { margin-top: 24px; border-top: 1px solid var(--ink); }
.empty-state { min-height: 100px; padding: 23px 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 16px; color: var(--muted); }
.empty-state span { font: 760 8px ui-monospace, monospace; }
.empty-state p { margin: 0; max-width: 620px; font-size: 11px; line-height: 1.65; }
.file-row, .source-row { min-width: 0; padding: 18px 0; display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.file-name { min-width: 0; }
.file-name strong, .source-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 620; }
.file-name small, .source-row small { display: block; margin-top: 6px; color: var(--muted); font: 700 8px ui-monospace, monospace; letter-spacing: .04em; }
.file-row select { min-height: 42px; font-size: 10px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); background: transparent; font-size: 16px; }
.file-row.uploading { opacity: .65; }
.file-row.complete { color: #405327; }
.file-row.failed { color: #8c2e25; }
.upload-actions { margin-top: 28px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; }
.upload-actions p { margin: 0; max-width: 530px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.primary-button { min-height: 56px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: space-between; gap: 50px; border: 1px solid var(--ink); color: #fff; background: var(--ink); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.primary-button:hover:not(:disabled) { background: var(--blue); }
.primary-button:disabled { cursor: not-allowed; opacity: .35; }
.library-panel { color: #f4f2eb; background: var(--blue); }
.library-panel .eyebrow, .library-panel .empty-state, .library-panel .source-row small { color: #c4d0cd; }
.library-panel .quiet-button { color: #fff; border-color: #809491; }
.library-panel .source-library, .library-panel .source-row { border-color: #607874; }
.memory-flow { padding: 20px 0 25px; display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 12px; border-block: 1px solid #607874; color: #d9e3df; font: 720 7px ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.memory-flow i { height: 1px; background: #7d9692; }
.source-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.source-badge { padding: 7px 9px; border: 1px solid #7d9692; color: #d9e3df; font: 720 7px ui-monospace, monospace; text-transform: uppercase; }
.download-link { color: var(--signal); font: 760 8px ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }
.next-step { margin-bottom: clamp(80px, 10vw, 145px); padding: clamp(45px, 6vw, 85px); display: grid; grid-template-columns: 220px 1fr; gap: clamp(35px, 6vw, 95px); color: #fff; background: var(--ink); }
.next-step .eyebrow { color: var(--signal); }
.next-step h2 { margin: 0; font-size: clamp(38px, 5vw, 73px); font-weight: 450; line-height: .98; letter-spacing: -.055em; }
.next-step div p { margin: 30px 0 0; max-width: 760px; color: #bfc0ba; font-size: 13px; line-height: 1.75; }
.auth-state { min-height: calc(100vh - 78px); display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); font-size: 11px; }
.loader { width: 30px; height: 30px; border: 1px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
.notice { position: fixed; z-index: 40; right: 22px; bottom: 22px; max-width: min(390px, calc(100% - 44px)); padding: 14px 16px; color: #fff; background: var(--ink); box-shadow: 0 18px 45px #0003; font-size: 11px; transform: translateY(160%); transition: transform .25s; }
.notice.show { transform: none; }
.notice.error { background: #8c2e25; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; min-height: 0; }
  .intro-copy { max-width: 650px; }
  .builder-grid { grid-template-columns: 1fr; }
  .steps { position: static; display: grid; grid-template-columns: repeat(3, 1fr); border-left: 1px solid var(--line); }
  .step { min-height: 64px; padding: 14px; border-right: 1px solid var(--line); }
  .next-step { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-header { min-height: 68px; }
  .header-context { display: none; }
  .site-header nav a:not(:last-child) { display: none; }
  .page-shell { width: calc(100% - 28px); }
  .intro { padding-block: 62px 70px; gap: 38px; }
  .intro h1 { font-size: clamp(53px, 17vw, 76px); }
  .panel { padding: 24px 18px; }
  .panel-heading { margin-bottom: 28px; display: block; }
  .permission-note, .queue-count { display: inline-block; margin-top: 16px; }
  .drop-zone { min-height: 190px; padding: 24px 18px; grid-template-columns: auto 1fr; }
  .drop-zone .text-button { grid-column: 1 / -1; width: 100%; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; }
  .file-row select { grid-column: 1 / -1; grid-row: 2; }
  .upload-actions { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .memory-flow { grid-template-columns: 1fr; gap: 8px; white-space: normal; }
  .memory-flow i { width: 1px; height: 14px; margin-left: 3px; }
  .source-row { grid-template-columns: minmax(0, 1fr) auto; }
  .source-row .download-link { grid-column: 1 / -1; }
  .next-step { padding: 38px 24px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .site-header { position: relative; }
  .steps { position: static; }
  .intro { min-height: 0; padding-block: 55px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
