@font-face {
  font-family: Noto;
  src: url('/fonts/NotoSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fafaf9;
  --ink: #292a28;
  --muted: #70746b;
  --line: #e1e2dd;
  font-family: Noto, Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid #777d74;
  outline-offset: 5px;
}
[hidden] { display: none !important; }
::selection { background: #e0e5dc; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.page {
  width: min(720px, calc(100% - 48px));
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 11vh;
}
.heading { margin-bottom: 30px; }
h1 span { white-space: nowrap; }
h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(28px, 3vw, 39px);
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: -1.4px;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 15px 13px 15px 20px;
  box-shadow: 0 3px 16px #23282004;
  transition: border-color .15s;
}
.composer:focus-within { border-color: #a9afa4; }
.composer textarea {
  flex: 1;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  max-height: 200px;
  border: 0;
  resize: none;
  outline: none;
  padding: 3px 0;
  line-height: 24px;
  color: var(--ink);
  background: transparent;
  scrollbar-width: thin;
}
.composer textarea::placeholder { color: #72766d; }
.composer-actions { display: flex; align-items: center; gap: 6px; }
.icon-button {
  width: 32px;
  height: 32px;
  padding: 7px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #92968d;
  flex-shrink: 0;
}
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { color: var(--ink); background: #f2f3ef; }
.send { background: var(--ink); color: #fff; }
.send:hover { background: #444840; color: #fff; }
.send:disabled { background: #eeefeb; color: #b4b6af; }
.suggestions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding-top: 22px; }
.suggestions button { border: 1px solid #dcded6; padding: 10px 15px; border-radius: 18px 18px 18px 5px; background: #f0f1ec; font-size: 14px; color: #53594d; line-height: 1.6; text-align: start; }
.suggestions button:hover { color: var(--ink); background: #e7eae1; border-color: #b8beaf; }
.suggestions button:disabled { opacity: .6; text-decoration: none; }
.request-status, .input-notice { font-size: 14px; color: var(--muted); line-height: 1.8; margin: 12px 4px 0; }
.request-status { text-align: center; }
.input-notice.error, .request-status.error { color: #8c4437; }
.attachment { display: flex; align-items: center; gap: 9px; width: fit-content; max-width: 100%; margin-top: 10px; padding: 5px 9px; border-radius: 7px; background: #eeefea; font-size: 14px; color: #666c60; }
.attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment button { background: transparent; border: 0; padding: 0 3px; font-size: 17px; line-height: 1.1; }

.page.has-conversation { justify-content: flex-start; padding: 0 0 16px; }
.has-conversation .heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px 0 22px; margin: 0; }
.has-conversation h1 { text-align: start; font-size: 20px; letter-spacing: -.6px; }
.new-conversation { font-size: 14px; color: var(--muted); border: 0; padding: 5px 0; background: transparent; white-space: nowrap; }
.new-conversation:hover { color: var(--ink); }
.new-conversation:disabled { opacity: .5; }
.conversation { flex: 1; padding: 20px 0 40px; min-width: 0; }
.message { margin-bottom: 36px; line-height: 1.85; overflow-wrap: anywhere; }
.message.user { display: flex; justify-content: flex-end; margin-bottom: 27px; }
.message.user p { max-width: 85%; margin: 0; padding: 12px 18px; border-radius: 16px 16px 4px 16px; background: #edeee9; font-size: 16px; white-space: pre-wrap; }
.message p { margin: 0 0 16px; }
.message p:last-child { margin-bottom: 0; }
.message .limitations { color: var(--muted); font-size: 14px; line-height: 1.8; }
.sources { margin: 20px 0 16px; color: var(--muted); font-size: 14px; }
.sources > summary { cursor: pointer; width: fit-content; }
.source { padding: 15px 0; border-bottom: 1px solid var(--line); }
.source h3 { color: #444940; font-size: 14px; font-weight: 400; margin: 0 0 5px; }
.source p { font-size: 14px; line-height: 1.8; margin: 0 0 6px; }
.source .source-meta { color: var(--muted); font-size: 14px; }
.save-pdf { display: inline-flex; align-items: center; gap: 7px; margin-top: 3px; border: 0; border-bottom: 1px solid #bfc4b6; background: transparent; padding: 3px 0; font-size: 14px; color: #686f5f; }
.save-pdf:hover { color: var(--ink); border-color: var(--ink); }
.has-conversation .composer-area { position: sticky; bottom: 0; padding: 12px 0 0; background: var(--paper); }
.conversation-footer { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted); padding: 10px 4px 0; }
.conversation-footer button { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.conversation-footer button:hover { color: var(--ink); }
.pending { font-size: 14px; color: var(--muted); }

.comparison { border-top: 1px solid var(--line); padding: 16px 0; }
.comparison h3 { font-size: 14px; font-weight: 400; margin: 0 0 5px; }
.comparison p { font-size: 14px; margin: 0 0 9px; color: #5e6557; }
.assessment { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.error-message { color: #8c4437; font-size: 14px; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; color: #fff; background: #373c31; border-radius: 8px; font-size: 14px; z-index: 4; }
dialog { max-width: 500px; width: calc(100% - 40px); padding: 34px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.8; }
dialog::backdrop { background: #262b2259; }
dialog h2 { margin-top: 0; font-size: 23px; font-weight: 400; }
dialog a { color: inherit; text-underline-offset: 4px; }
.close-dialog { position: absolute; right: 14px; top: 9px; border: 0; background: none; color: var(--muted); font-size: 24px; }

@media (max-width: 600px) {
  .page { width: calc(100% - 36px); padding-bottom: 13vh; }
  h1 { font-size: 30px; letter-spacing: -1px; }
  .heading { margin-bottom: 25px; }
  .composer { padding: 13px 10px 13px 16px; gap: 6px; border-radius: 16px; }
  .composer textarea { font-size: 16px; }
  .composer-actions { gap: 2px; }
  .suggestions { flex-direction: column; gap: 9px; align-items: center; padding-top: 21px; }
  .suggestions button { font-size: 14px; }
  .has-conversation .heading { padding: 24px 0 18px; gap: 12px; }
  .has-conversation h1 { font-size: 17px; letter-spacing: -.5px; }
  .new-conversation { font-size: 14px; }
  .message { font-size: 16px; }
  .message.user p { max-width: 94%; font-size: 16px; }
  .conversation { padding-top: 16px; padding-bottom: 22px; }
  .conversation-footer { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.followup-suggestions { justify-content: flex-start; padding-top: 22px; }
@media (max-width: 600px) { .conversation-footer { flex-wrap: wrap; gap: 8px; } .followup-suggestions { align-items: flex-start; } }

.project-media { display: grid; gap: 22px; margin: 24px 0; }
.video-card { margin: 0; }
.video-player { aspect-ratio: 16 / 9; background: #eeefe9; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.video-player iframe { width: 100%; height: 100%; border: 0; }
.load-video { display: flex; width: 100%; height: 100%; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 24px; border: 0; background: transparent; font-size: 18px; text-align: center; }
.load-video:hover { background: #e6e9df; }
.load-video span, .video-card figcaption { font-size: 14px; color: var(--muted); }
.video-card figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 10px; line-height: 1.7; }
.project-media a { color: #555e4a; text-underline-offset: 4px; font-size: 14px; }
.project-link { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.project-link p { margin: 0 0 10px; }
.project-link a + a { margin-left: 20px; }

.more-projects > summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.more-projects .video-card + .video-card { margin-top: 22px; }

.project-context { font-size: 14px; color: var(--muted); line-height: 1.8; }
.project-context > summary { cursor: pointer; width: fit-content; }
.project-context p { margin: 12px 0; }
.project-context a { display: block; }

.locale-controls { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 36px); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; font-size: 14px; color: var(--muted); }
.locale-controls select { font: inherit; max-width: 180px; min-height: 34px; color: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 4px 8px; }
.locale-controls a { color: inherit; text-underline-offset: 3px; }
body:has(.has-conversation) .locale-controls { position: static; transform: none; margin: 0 auto; padding: 16px 0; }

.pdf-toolbar { display: flex; justify-content: flex-end; padding: 10px 4px 4px; }
.pdf-toolbar .save-pdf { margin: 0; font-size: 16px; }
.pdf-formats { border: 0; padding: 0; margin: 0 0 20px; }
.pdf-formats legend, .pdf-scope { font-size: 16px; margin-bottom: 8px; }
.pdf-formats label { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; cursor: pointer; }
.pdf-formats label:has(input:checked) { border-color: #777d74; background: #f0f2ec; }
.pdf-formats input { margin-top: 6px; accent-color: #555e4a; }
.pdf-formats strong { display: block; font-size: 16px; font-weight: 400; }
.pdf-formats small, .pdf-note { display: block; font-size: 14px; color: var(--muted); line-height: 1.6; }
.pdf-scope { display: block; }
#pdf-scope { width: 100%; padding: 10px; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: white; }
.pdf-download { width: 100%; padding: 12px 18px; font-size: 16px; border: 1px solid #555e4a; border-radius: 10px; color: white; background: #555e4a; }
#pdf-dialog { max-height: calc(100svh - 32px); overflow-y: auto; }

.retention-notice { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 10px 4px 0; }
.retention-notice button { font: inherit; color: inherit; background: none; border: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.document-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.7; }
.document-consent input { margin-top: 6px; flex-shrink: 0; }
#submission-reference { overflow-wrap: anywhere; }
