*, *::before, *::after { box-sizing: border-box; }
:root {
  --ink: #16231f; --muted: #596660; --paper: #f5f2e9; --surface: #fffdf7;
  --line: #d8d5ca; --green: #12624f; --green-dark: #0a4639; --mint: #dcebe3;
  --rust: #9f4525; --danger: #9b2c2c; --radius: 3px;
  --serif: Georgia, 'Times New Roman', serif; --sans: Inter, ui-sans-serif, system-ui, sans-serif;
  --color-bg: var(--paper); --color-surface: var(--surface); --color-border: var(--line);
  --color-text: var(--ink); --color-text-muted: var(--muted); --color-primary: var(--green);
  --color-primary-hover: var(--green-dark); --color-danger: var(--danger); --color-warning: #9a6500;
  --shadow: 0 1px 3px rgba(22,35,31,.08); --shadow-lg: 0 12px 30px rgba(22,35,31,.15);
}
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.5; }
button, select, input, textarea { font: inherit; }
a { color: inherit; }
.container { width: min(960px, calc(100% - 32px)); margin: 0 auto; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 24px; box-shadow: var(--shadow); }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 1000; background: var(--ink); color: white; padding: 10px 16px; }
.skip-link:focus { top: 12px; }
.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.app-header { min-height: 88px; border-bottom: 1px solid var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { text-decoration: none; font: 700 25px/1 var(--serif); letter-spacing: -1px; }
.brand span { color: var(--rust); font-style: italic; }
.account-bar { display: flex; align-items: center; gap: 18px; text-align: right; font-size: 13px; }
.billing-inline { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 3px; color: var(--muted); }
.welcome-row { display: grid; grid-template-columns: 1.5fr 0.8fr; gap: clamp(32px, 8vw, 110px); padding: 76px 0 62px; align-items: end; }
.eyebrow, .step-label { margin: 0 0 10px; color: var(--rust); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.welcome-row h1 { max-width: 720px; margin: 0; font: 400 clamp(48px, 6vw, 78px)/.98 var(--serif); letter-spacing: -.045em; }
.welcome-row h1 em { color: var(--green); font-weight: 400; }
.welcome-row > div > p:last-child { max-width: 650px; margin: 24px 0 0; color: var(--muted); font-size: 17px; }
.usage-card { padding: 24px 0 5px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-heading.compact { align-items: center; margin-bottom: 15px; }
.section-heading h2, .process-card h2 { margin: 0; font: 400 27px/1.1 var(--serif); }
.section-heading span, .supporting-text, .limit-note { color: var(--muted); font-size: 12px; }
.usage-bar { height: 8px; background: #dedbd1; overflow: hidden; }
.usage-bar-fill { width: 0; height: 100%; background: var(--green); transition: width .25s ease; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.upload-panel { min-width: 0; padding: 38px 48px 38px 0; border-right: 1px solid var(--line); }
.process-card { padding: 38px 0 38px 42px; }
.drop-zone { min-height: 175px; border: 1px dashed #969e99; background: rgba(255,255,255,.32); display: flex; align-items: center; justify-content: center; gap: 20px; padding: 28px; cursor: pointer; text-align: left; transition: background .15s, border-color .15s; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragover { background: var(--mint); border-color: var(--green); outline: 2px solid transparent; }
.upload-mark { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid var(--green); border-radius: 50%; color: var(--green); font: 30px/1 var(--serif); }
.drop-zone strong { display: block; font: 400 22px/1.2 var(--serif); }
.drop-zone small { display: block; margin-top: 7px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.inline-status { min-height: 22px; margin: 8px 0 0; color: var(--danger); font-size: 13px; }
.upload-progress { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; }
.upload-progress[hidden] { display: none; }
.upload-progress progress { flex: 1 1 auto; min-width: 0; height: 10px; appearance: none; }
.upload-progress progress::-webkit-progress-bar { background: #dedbd1; border-radius: 0; }
.upload-progress progress::-webkit-progress-value { background: var(--green); }
.upload-progress progress::-moz-progress-bar { background: var(--green); }
.selected-files { display: grid; gap: 6px; margin: 10px 0 0; padding-left: 28px; color: var(--ink); font-size: 13px; }
.selected-files:empty { display: none; }
.selected-files li { display: flex; align-items: center; gap: 8px; cursor: grab; user-select: none; }
.selected-files li.dragging { opacity: .5; }
.selected-files li.drag-over { outline: 2px dashed var(--green); outline-offset: 2px; }
.file-details { display: flex; min-width: 0; flex: 1; gap: 6px; align-items: baseline; }
.file-name { overflow-wrap: anywhere; }
.file-size { color: var(--muted); white-space: nowrap; }
.file-actions { display: flex; flex-shrink: 0; gap: 4px; }
.file-actions button { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border: 1px solid #aeb4b0; border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.file-actions button:hover:not(:disabled), .file-actions button:focus-visible { background: var(--mint); border-color: var(--green); }
.file-actions button:disabled { opacity: .35; cursor: default; }
.file-remove { color: var(--danger); }
.simple-options { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin-top: 12px; }
.form-group { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.form-group label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.form-group select, .form-group input { width: 100%; min-width: 0; border: 1px solid #aeb4b0; border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 11px 35px 11px 12px; }
.form-group textarea { width: 100%; resize: vertical; border: 1px solid #aeb4b0; border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 11px 12px; }
.form-group select:focus-visible, .form-group input:focus-visible, .form-group textarea:focus-visible { border-color: var(--green); outline: 3px solid rgba(18,98,79,.2); }
.form-group textarea:disabled { background: #ebe8df; cursor: not-allowed; }
.btn { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--radius); padding: 10px 18px; cursor: pointer; font-weight: 750; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.btn[hidden] { display: none; }
.btn-primary { background: var(--green-dark); color: white; }
.btn-primary:hover { background: #06362d; }
.btn-quiet { min-height: 36px; border-color: var(--line); background: transparent; padding: 7px 13px; }
.btn-secondary { min-height: 34px; border-color: var(--line); background: var(--surface); padding: 6px 10px; font-size: 12px; }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(18,98,79,.3); outline-offset: 2px; }
.advanced-options { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.summary-options { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 22px; }
.summary-options h3 { margin: 0; font: 400 22px/1.1 var(--serif); }
.summary-options-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.pro-label { color: var(--rust); font-size: 9px; }
.advanced-options summary { display: flex; justify-content: space-between; cursor: pointer; color: var(--ink); font-weight: 700; }
.advanced-options summary span { color: var(--muted); font-size: 12px; font-weight: 400; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.privacy-note, .privacy-callout { margin: 16px 0 0; border-left: 2px solid var(--green); padding-left: 12px; color: var(--muted); font-size: 12px; }
.process-list { list-style: none; margin: 28px 0; padding: 0; }
.process-list li { display: grid; grid-template-columns: 35px 1fr; gap: 12px; padding: 17px 0; border-top: 1px solid var(--line); }
.process-list li > span { color: var(--rust); font: italic 16px var(--serif); }
.process-list strong { font-family: var(--serif); font-size: 17px; }
.process-list p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.history-section { padding: 58px 0 75px; }
.job-list { display: grid; gap: 12px; }
.history-controls { display: flex; min-height: 43px; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.history-controls .supporting-text { margin: 0; }
.job-item { border: 1px solid var(--line); background: rgba(255,255,255,.24); }
.job-skeleton { border: 1px solid var(--line); background: rgba(255,255,255,.24); padding: 18px 20px; display: grid; gap: 10px; }
.skeleton-line { border-radius: var(--radius); background: linear-gradient(90deg, #e6e2d5 25%, #f3efe4 50%, #e6e2d5 75%); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton-title { height: 20px; width: 55%; }
.skeleton-meta { height: 12px; width: 75%; }
.skeleton-actions { height: 34px; width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.job-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 18px 20px; }
.job-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 18px; }
.job-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.job-error { margin: 7px 0 0; color: var(--danger); font-size: 12px; }
.job-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.job-deliverables { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); border-top: 1px solid var(--line); }
.job-deliverable { display: flex; min-width: 0; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 18px; padding: 14px 20px; }
.job-deliverable + .job-deliverable { border-left: 1px solid var(--line); }
.speech-slot { flex: 1 0 100%; min-width: 0; width: 100%; }
.deliverable-heading { display: flex; min-width: 0; align-items: center; gap: 12px; }
.deliverable-title { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.deliverable-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.deliverable-note { color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; }
.badge-free { background: #e6e2d5; color: #514d43; }.badge-pro, .badge-completed { background: var(--mint); color: var(--green-dark); }
.badge-enterprise { background: #f2e5c7; color: #72500c; }
.badge-failed { background: #f5deda; color: var(--danger); }.badge-processing { background: #f2e5c7; color: #72500c; }.badge-queued { background: #dce5e8; color: #294f5a; }
.empty-state { padding: 44px 10px; color: var(--muted); text-align: center; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 1000; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { max-width: 380px; padding: 12px 16px; background: var(--ink); color: white; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 13px; }
.toast-error { background: var(--danger); }
.preview-dialog { width: min(900px, calc(100% - 32px)); height: min(85vh, 900px); border: 1px solid var(--ink); padding: 0; background: var(--surface); box-shadow: var(--shadow-lg); }
.preview-dialog::backdrop { background: rgba(22,35,31,.52); }
.preview-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 13px 16px; }
.preview-dialog-header h2 { margin: 0; font: 400 22px/1.1 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-dialog iframe { display: block; width: 100%; height: calc(100% - 70px); border: 0; background: white; }
.regenerate-dialog { width: min(560px, calc(100% - 32px)); border: 1px solid var(--ink); padding: 0; background: var(--surface); box-shadow: var(--shadow-lg); }
.regenerate-dialog::backdrop { background: rgba(22,35,31,.52); }
.pro-request-dialog { width: min(520px, calc(100% - 32px)); border: 1px solid var(--ink); padding: 0; background: var(--surface); box-shadow: var(--shadow-lg); }
.pro-request-dialog::backdrop { background: rgba(22,35,31,.52); }
.pro-request-dialog p { margin: 0; }
.regenerate-body { display: grid; gap: 18px; padding: 22px; }
.document-version-select { min-height: 34px; border: 1px solid var(--line); background: var(--surface); padding: 5px 8px; font-size: 12px; }
.document-actions { display: contents; }
.speech-panel { flex: 1 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 0 2px; border-top: 1px dashed var(--line); }
.speech-panel audio { width: min(100%, 420px); height: 40px; }
.speech-creator { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; width: 100%; }
.speech-voice, .speech-provider, .speech-speed { min-height: 36px; border: 1px solid var(--line); background: var(--surface); padding: 5px 8px; }
.speech-speed { width: 76px; }
.speech-note { color: var(--muted); font-size: 12px; margin-left: auto; text-align: right; }
.speech-panel > .speech-note:first-child { margin-left: 0; text-align: left; }
.speech-advanced { position: relative; font-size: 12px; }
.speech-advanced summary { cursor: pointer; color: var(--muted); }
.speech-advanced[open] { display: flex; align-items: center; gap: 6px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--ink); padding: 24px 0 40px; color: var(--muted); font-size: 12px; }
@media (max-width: 800px) {
  .app-shell { width: min(100% - 28px, 680px); }.app-header { min-height: 76px; }
  .welcome-row { grid-template-columns: 1fr; gap: 38px; padding: 48px 0; }.welcome-row h1 { font-size: clamp(43px, 13vw, 66px); }
  .workspace-grid { grid-template-columns: 1fr; }.upload-panel { padding: 32px 0; border-right: 0; }.process-card { padding: 32px 0; border-top: 1px solid var(--line); }
  .job-deliverables { grid-template-columns: 1fr; }.job-deliverable + .job-deliverable { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .app-header { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px 0; }
  .account-bar { min-width: 0; width: 100%; justify-content: space-between; gap: 8px; flex-wrap: wrap; }.account-bar > div { min-width: 0; flex: 1 1 auto; }.account-bar strong { display: block; max-width: 55vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }.billing-inline { min-width: 0; margin: 0; justify-content: flex-start; flex-wrap: wrap; row-gap: 2px; }.billing-inline > span:not(.badge) { display: block; max-width: 55vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.billing-inline .badge, .account-bar .btn { flex-shrink: 0; white-space: nowrap; }
  .welcome-row { padding-top: 38px; }.welcome-row h1 br { display: none; }
  .section-heading { align-items: flex-start; }.simple-options, .advanced-grid, .summary-options-grid { grid-template-columns: 1fr; }.simple-options .btn { width: 100%; }
  .drop-zone { min-height: 155px; flex-direction: column; text-align: center; }.drop-zone strong { font-size: 19px; }
  .job-header, .job-deliverable { align-items: flex-start; flex-direction: column; }.job-actions { justify-content: flex-start; width: 100%; }.job-actions .btn { flex: 1 1 auto; min-height: 44px; }.document-version-select { min-height: 44px; font-size: 14px; }.deliverable-heading { align-items: flex-start; flex-direction: column; }.speech-slot { flex: 0 0 auto; width: 100%; }.speech-panel { justify-content: flex-start; }.speech-note { margin-left: 0; text-align: left; }.app-footer { flex-direction: column; }
  .toast-region { left: 14px; right: 14px; bottom: 14px; }.toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
