:root {
  color-scheme: light;
  font: 16px/1.45 system-ui, sans-serif;
  color: #172b2e;
  background: #edf3f1;
  --accent: #12614f;
  --line: #c7d8d4;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1380px; padding: 32px clamp(16px, 4vw, 56px); margin: auto; }
header { margin-bottom: 24px; }
.brand { font-weight: 750; color: var(--accent); }
h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); letter-spacing: -.035em; margin: 3px 0 12px; }
h2 { font-size: 1.2rem; margin: 0 0 16px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.status { color: #315651; }
.desk { align-items: start; display: grid; grid-template-columns: 1.12fr 1fr; gap: 18px; }
section { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
label { display: block; font-size: .91rem; font-weight: 650; }
.optional { font-size: .75rem; font-weight: 400; color: #536561; }
input, textarea { display: block; width: 100%; border: 1px solid #aebfba; border-radius: 6px; font: inherit; color: inherit; background: #fbfdfc; padding: 9px; margin: 4px 0 12px; }
textarea { resize: vertical; }
[hidden] { display: none !important; }
button { font: 650 .88rem/1.2 system-ui, sans-serif; padding: 10px 13px; cursor: pointer; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: white; }
button:hover { filter: brightness(.9); }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { color: var(--accent); background: white; }
:focus-visible { outline: 3px solid #64a5db; outline-offset: 2px; }
.actions, .api-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.error { color: #9d2828; background: #fff1ef; padding: 9px; white-space: pre-wrap; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { color: #365350; font-size: .88rem; overflow-wrap: anywhere; }
.api { margin-top: 18px; }
.api-heading { justify-content: space-between; margin-bottom: 10px; }
.api-heading h2 { margin: 0; }
a { color: var(--accent); }
iframe { width: 100%; height: 680px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 860px) { .desk { grid-template-columns: 1fr; } }
.import-status, .error, .export, #search-status { margin-top: 14px; }
.import-status, .error { padding: 10px 12px; border-radius: 6px; }
.import-status { background: #edf6f2; }
.results { padding-left: 24px; }
.results:empty { margin: 0; }
.results li { padding: 12px 0 8px 4px; border-top: 1px solid var(--line); }
.results li::marker { font-weight: 750; color: var(--accent); }

.answer { background: #edf6f2; border-left: 3px solid var(--accent); border-radius: 6px; margin: 14px 0 18px; padding: 14px; }
.answer p { margin-bottom: 0; }
#context .results { margin-top: 6px; }

.export .meta { margin: 7px 0 0; }

.import-progress { align-items: center; background: #edf6f2; border-radius: 6px; display: flex; gap: 10px; margin-top: 14px; padding: 10px 12px; }
.import-progress p { margin: 0; }
.upload-spinner { width: 16px; height: 16px; flex: none; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: upload-spin .8s linear infinite; }
@keyframes upload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upload-spinner { animation: none; } }

#import-status { white-space: pre-line; }
.upload-notice { background: #fff5df; border-left: 3px solid #b68636; border-radius: 6px; color: #5c400e; padding: 10px 12px; }

.sign-in { max-width: 460px; }
.account-bar { gap: 12px; margin-bottom: 10px; }
#session-error { max-width: 460px; }
