:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #251e16;
  background: #f6f5f0;
  --line: #e2ded2;
  --muted: #655c52;
  --accent: #452e20;
  --paper: #fffefa;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(20px, env(safe-area-inset-left)); max-width: 760px; }
.masthead { height: 70px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 1.27rem; color: inherit; text-decoration: none; }
.brand img { border-radius: 7px; }
main { padding: clamp(28px, 7vw, 58px) 0 40px; }
.welcome { padding: clamp(28px, 9vw, 80px) 8px; text-align: center; }
.avatar { border-radius: 50%; object-fit: cover; background: #eadccd; }
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -.045em; font-size: clamp(2rem, 8vw, 3.5rem); line-height: 1.04; }
.welcome h1 { margin-top: 20px; }
.welcome p { color: var(--muted); margin: 13px 0 24px; line-height: 1.5; }
.primary, .quiet { min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.primary { background: var(--accent); color: white; }
.quiet { background: transparent; color: var(--accent); }
.quiet:hover { background: #eee9de; }
button:disabled { opacity: .6; cursor: wait; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #856543; outline-offset: 3px; }
.title-row, .actions { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.title-row { align-items: end; margin-bottom: 24px; }
.eyebrow { color: var(--muted); font-size: .9rem; margin-bottom: 7px; }
.search, .notes { display: grid; gap: 12px; }
.search { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 20px; }
input, textarea { width: 100%; min-height: 44px; padding: 11px 12px; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 1rem; }
textarea { resize: vertical; line-height: 1.5; }
#editor, article { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 16px; margin-bottom: 12px; }
#editor form { display: grid; gap: 10px; margin-top: 16px; }
#empty, .meta, .status { color: var(--muted); line-height: 1.5; }
.status:not(:empty) { margin-top: 18px; }
article h2 { font-size: 1.08rem; overflow-wrap: anywhere; }
article p { overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.5; margin-top: 9px; }
article .meta { font-size: .84rem; margin: 6px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.workspace-nav { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.workspace-nav [aria-pressed="true"] { background: #eae4d9; }
.assistant-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.assistant-heading h1 { font-size: clamp(2rem, 7vw, 3.35rem); }
#conversation { display: grid; gap: 12px; margin-bottom: 20px; }
.message { max-width: 90%; margin: 0; padding: 12px 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); min-width: 0; }
.message-user { justify-self: end; background: #f0e8db; }
.message p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.message strong { display: block; margin-bottom: 3px; font-size: .84rem; color: var(--muted); }
#chat-form { display: grid; gap: 10px; }
#chat-form .meta { font-size: .82rem; }
