:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0d1526;
  background: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(1280px, calc(100% - 48px)); margin: 32px auto 24px; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid #dbe1ed; border-radius: 8px; padding: 10px 15px; background: #fff; color: #0d1526; cursor: pointer; }
button:hover:not(:disabled) { border-color: #2455ff; color: #2455ff; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #bdcaff; outline-offset: 3px; }
.primary { background: #2455ff; color: #fff; border-color: #2455ff; }
.primary:hover:not(:disabled) { background: #1945e1; color: #fff; }
.page-header { display: flex; align-items: flex-start; gap: 24px; justify-content: space-between; margin-bottom: 20px; }
.eyebrow { color: #74819a; font-size: 11px; font-weight: 600; letter-spacing: .09em; margin: 0 0 8px; }
h1 { font-size: 32px; font-weight: 650; letter-spacing: -.035em; margin: 0; }
h2 { font-size: 19px; font-weight: 600; margin: 0; }
p { line-height: 1.5; }
.subtitle { margin: 8px 0 0; color: #66728a; font-size: 15px; }
.service-status { flex-shrink: 0; margin: 4px 0 0; border-radius: 6px; background: #f4f6fa; padding: 7px 10px; font-size: 12px; color: #66728a; }
.service-status[data-state="ready"] { color: #17734f; background: #eef8f3; }
.service-status[data-state="waiting"] { color: #87611a; background: #fbf6e9; }
.panel { border: 1px solid #dbe1ed; border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.records-workspace { min-width: 0; }
.prompt-panel { position: sticky; top: 24px; min-width: 0; }
.prompt-heading, .prompt-editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.prompt-heading { margin-bottom: 18px; }
.prompt-heading h2 { font-size: 17px; }
.prompt-heading .muted { white-space: nowrap; }
.prompt-panel label { display: block; margin: 12px 0 7px; color: #66728a; font-size: 12px; }
.prompt-panel input, .prompt-panel select { display: block; width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #e2e6ee; border-radius: 8px; color: #0d1526; background: #fff; font-size: 13px; }
.prompt-panel input:disabled, .prompt-panel select:disabled, .prompt-panel textarea:disabled { color: #66728a; background: #f8f9fc; }
.prompt-panel textarea { min-height: 300px; max-height: 48vh; font-size: 13px; line-height: 1.55; }
.prompt-state { color: #17734f; font-size: 11px; white-space: nowrap; }
.prompt-state[data-state="draft"] { color: #87611a; }
.prompt-actions { display: flex; gap: 7px; margin-top: 12px; }
.prompt-actions button { flex: 1; padding: 8px 9px; font-size: 12px; }
.prompt-panel > p { margin: 12px 0 0; font-size: 12px; }
.prompt-panel > #prompt-retry { margin-top: 12px; font-size: 12px; }
.upload-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quiet-button { border: none; padding: 4px 6px; font-size: 12px; color: #74819a; }
.upload-toolbar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.upload-toolbar > button { flex-shrink: 0; }
.drop-zone { position: relative; flex: 1; min-width: 0; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px dashed #bdc6d8; border-radius: 8px; color: #74819a; cursor: pointer; }
.drop-zone svg { flex-shrink: 0; }
.drop-caption { display: flex; flex-direction: column; gap: 3px; }
.drop-caption .muted { font-size: 12px; }
.drop-zone:hover, .drop-zone.is-dragging, .drop-zone:focus-within { border-color: #2455ff; background: #f7f9ff; }
.drop-zone.is-disabled { cursor: default; opacity: .6; }
.drop-zone input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: inherit; }
.drop-title { color: #0d1526; font-size: 14px; }
.muted { color: #74819a; font-size: 13px; }
.file-details { font-size: 13px; color: #66728a; margin: 10px 0 0; overflow-wrap: anywhere; }
.file-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.file-entry { display: flex; gap: 6px; }
.file-remove { flex-shrink: 0; padding: 6px 12px; font-size: 18px; color: #74819a; }
.file-row { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; font-size: 13px; }
.file-row[aria-pressed="true"] { border-color: #2455ff; background: #f7f9ff; }
.file-name { overflow-wrap: anywhere; }
.file-state { flex-shrink: 0; color: #74819a; font-size: 12px; }
.file-row[data-state="error"] .file-state { color: #b13636; }
.file-row[data-state="done"] .file-state { color: #17734f; }
.result-panel > .result-file { margin: -6px 0 16px; overflow-wrap: anywhere; }
.request-progress { margin-top: 12px; }
.request-progress p { font-size: 13px; margin: 0 0 8px; }
progress { appearance: none; width: 100%; height: 6px; border: none; border-radius: 3px; background: #ecf0f7; overflow: hidden; accent-color: #2455ff; }
progress::-webkit-progress-bar { background: #ecf0f7; }
progress::-webkit-progress-value { background: #2455ff; }
progress::-moz-progress-bar { background: #2455ff; }
progress:indeterminate { background: linear-gradient(90deg, #ecf0f7 25%, #2455ff 50%, #ecf0f7 75%); background-size: 200% 100%; animation: progress-slide 1.5s ease-in-out infinite; }
progress:indeterminate::-webkit-progress-bar { background: transparent; }
progress:indeterminate::-moz-progress-bar { background: transparent; }
.summary-progress { margin: 0 0 16px; }
@keyframes progress-slide { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { progress:indeterminate { animation: none; } }
.error { margin: 16px 0 0; color: #b13636; font-size: 14px; overflow-wrap: anywhere; }
.result-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-actions button { font-size: 13px; padding: 8px 11px; }
textarea { display: block; width: 100%; min-height: 180px; resize: vertical; border: 1px solid #e2e6ee; border-radius: 8px; padding: 12px; line-height: 1.65; font-size: 15px; color: #0d1526; background: #fff; }
textarea::placeholder { color: #9aa4b7; }
.result-panel > p { margin: 12px 0 0; min-height: 20px; }
.result-panel[aria-busy="true"] #summary-note { color: #2455ff; }
footer { text-align: center; color: #97a0b2; font-size: 12px; margin: 24px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 1000px) {
  main { max-width: 860px; }
  .workspace { grid-template-columns: 1fr; gap: 0; }
  .prompt-panel { position: static; }
  .prompt-panel textarea { min-height: 220px; max-height: none; }
}

@media (max-width: 600px) {
  main { width: calc(100% - 32px); margin-top: 24px; }
  .page-header { flex-direction: column; gap: 10px; margin-bottom: 16px; }
  h1 { font-size: 30px; }
  .panel { padding: 16px; }
  .upload-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .drop-zone { padding: 10px 12px; }
  .file-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .result-header { flex-direction: column; align-items: flex-start; gap: 14px; }
}
