:root {
  color-scheme: light;
  --ink: #17221e;
  --muted: #68756f;
  --line: #dce5e0;
  --paper: #fff;
  --wash: #f3f7f5;
  --accent: #176b55;
  --accent-dark: #0f503f;
  --accent-soft: #e3f2ec;
  --shadow: 0 14px 40px rgba(25, 55, 44, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--wash); color: var(--ink); line-height: 1.65; }
a { color: var(--accent); }
.site-header {
  align-items: center; backdrop-filter: blur(14px); background: rgba(255,255,255,.88);
  border-bottom: 1px solid rgba(220,229,224,.9); display: flex; justify-content: space-between;
  min-height: 68px; padding: 0 max(20px, calc((100vw - 1040px) / 2)); position: sticky; top: 0; z-index: 5;
}
.brand { align-items: center; color: var(--ink); display: flex; font-weight: 780; gap: 10px; text-decoration: none; }
.brand-mark { align-items: center; background: var(--ink); border-radius: 9px; color: #fff; display: inline-flex; height: 30px; justify-content: center; width: 30px; }
.header-actions { align-items: center; display: flex; gap: 16px; }
.header-actions a { font-size: 14px; font-weight: 720; text-decoration: none; }
.logout-form { margin: 0; }
.logout-form button { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 14px; font-weight: 720; padding: 0; }
.private-badge { background: var(--accent-soft); border-radius: 999px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 9px; }
.page-shell { margin: 0 auto; max-width: 1040px; min-height: calc(100vh - 130px); padding: 48px 20px 80px; }
.site-footer { color: #87928d; font-size: 12px; padding: 0 20px 34px; text-align: center; }

.hero { align-items: end; display: flex; justify-content: space-between; margin: 12px 0 38px; gap: 28px; }
.hero h1 { font-size: clamp(38px, 7vw, 64px); letter-spacing: -.055em; line-height: 1.02; margin: 7px 0 18px; }
.hero-copy { color: var(--muted); font-size: 17px; margin: 0; max-width: 590px; }
.eyebrow { color: var(--accent) !important; font-size: 11px !important; font-weight: 820; letter-spacing: .15em; margin: 0; text-transform: uppercase; }
.primary-action { align-items: center; background: var(--accent); border: 0; border-radius: 13px; color: #fff; display: inline-flex; flex: 0 0 auto; font: inherit; font-size: 14px; font-weight: 760; gap: 22px; justify-content: space-between; padding: 13px 16px; text-decoration: none; transition: background .15s, transform .15s; }
.primary-action:hover { background: var(--accent-dark); transform: translateY(-1px); }

.section-jumps { background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 14px; display: flex; gap: 5px; margin-bottom: 50px; overflow-x: auto; padding: 5px; }
.section-jumps a { border-radius: 9px; color: var(--ink); flex: 0 0 auto; font-size: 14px; font-weight: 680; padding: 9px 13px; text-decoration: none; }
.section-jumps a:hover { background: var(--accent-soft); }
.section-jumps span { color: var(--muted); font-size: 11px; margin-left: 3px; }
.content-section { margin-top: 50px; scroll-margin-top: 90px; }
.section-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 17px; }
.section-heading h2 { font-size: 27px; letter-spacing: -.03em; line-height: 1.2; margin: 4px 0 0; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.item-list { display: grid; gap: 9px; }
.card-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.item-card { align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); display: grid; gap: 15px; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 112px; padding: 18px; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.item-card:hover { border-color: #9fbfb3; box-shadow: var(--shadow); transform: translateY(-1px); }
.item-card.compact { min-height: 82px; padding: 14px 17px; }
.file-badge { align-items: center; background: #edf1ef; border-radius: 10px; color: #50615a; display: flex; flex: 0 0 auto; font-size: 10px; font-weight: 850; height: 42px; justify-content: center; letter-spacing: .03em; width: 42px; }
.document-badge { background: var(--accent-soft); color: var(--accent); }
.file-badge.large { border-radius: 14px; font-size: 12px; height: 58px; width: 58px; }
.item-copy { display: flex; min-width: 0; flex-direction: column; }
.item-copy strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-copy small { color: var(--muted); display: -webkit-box; font-size: 12px; line-height: 1.45; margin-top: 3px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item-meta { color: #8b9691; font-size: 11px; margin-top: 8px; }
.item-arrow { color: #9aa59f; font-size: 27px; font-weight: 300; }
.empty { color: var(--muted); }

.back-nav { margin: -10px 0 19px; }
.back-nav a { font-size: 14px; font-weight: 680; text-decoration: none; }
.document-actions { align-items: center; display: flex; justify-content: space-between; margin: -10px 0 19px; }
.document-actions .back-link { font-size: 14px; font-weight: 680; text-decoration: none; }
.markdown-body { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 5vw, 58px); box-shadow: 0 8px 35px rgba(25,55,44,.04); }
.markdown-body h1 { font-size: clamp(31px, 6vw, 48px); letter-spacing: -.04em; line-height: 1.12; margin-top: 0; }
.markdown-body h2 { border-top: 1px solid var(--line); font-size: 27px; margin-top: 50px; padding-top: 31px; }
.markdown-body h3 { font-size: 20px; margin-top: 32px; }
.markdown-body img { height: auto; max-width: 100%; }
.markdown-body table { border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); min-width: 120px; padding: 9px 12px; text-align: left; }
.markdown-body th { background: var(--wash); }
.markdown-body pre, .text-preview { background: #17231f; border-radius: 12px; color: #e8f1ed; overflow-x: auto; padding: 18px; white-space: pre-wrap; word-break: break-word; }
.markdown-body code { background: var(--wash); border-radius: 4px; font-size: .92em; padding: .12em .35em; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 4px solid #8bb9aa; color: var(--muted); margin-left: 0; padding-left: 18px; }
.document-footer { color: var(--muted); font-size: 12px; padding: 18px 4px; text-align: right; }

.file-hero { align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; display: grid; gap: 18px; grid-template-columns: auto minmax(0,1fr) auto; margin-bottom: 17px; padding: 20px; }
.file-hero h1 { font-size: clamp(22px, 4vw, 31px); letter-spacing: -.025em; line-height: 1.2; margin: 4px 0; overflow-wrap: anywhere; }
.file-hero p { color: var(--muted); font-size: 13px; margin: 0; }
.preview-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.image-preview { padding: 18px; text-align: center; }
.image-preview img { border-radius: 10px; height: auto; max-height: 75vh; max-width: 100%; }
.pdf-preview iframe { border: 0; height: 75vh; width: 100%; }
.no-preview { color: var(--muted); padding: 60px 24px; text-align: center; }
.no-preview strong { color: var(--ink); }
.text-preview { margin: 0; min-height: 240px; }

.upload-card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; margin: 0 auto; max-width: 650px; padding: clamp(25px, 5vw, 48px); }
.upload-card h1 { font-size: clamp(32px, 7vw, 48px); letter-spacing: -.045em; line-height: 1.08; margin: 6px 0 12px; }
.upload-card > p:not(.eyebrow) { color: var(--muted); margin: 0 0 26px; }
.file-picker { align-items: center; background: var(--wash); border: 1.5px dashed #a8beb5; border-radius: 16px; cursor: pointer; display: flex; flex-direction: column; padding: 37px 20px; text-align: center; }
.file-picker:hover { border-color: var(--accent); }
.file-picker.paste-ready { background: var(--accent-soft); border-color: var(--accent); }
.picker-icon { align-items: center; background: var(--accent-soft); border-radius: 50%; color: var(--accent); display: flex; font-size: 25px; height: 46px; justify-content: center; margin-bottom: 12px; width: 46px; }
.file-picker small { color: var(--muted); margin-top: 3px; }
.file-picker input { margin-top: 18px; max-width: 100%; }
.submit-action { cursor: pointer; margin-top: 14px; width: 100%; }
.notice { border-radius: 11px; font-size: 14px; margin-bottom: 17px; padding: 11px 14px; }
.notice.success { background: var(--accent-soft); color: var(--accent-dark); }
.notice.error { background: #fff0ed; color: #9a3525; }
.privacy-note { border-top: 1px solid var(--line); display: flex; flex-direction: column; font-size: 12px; margin-top: 24px; padding-top: 18px; }
.privacy-note span { color: var(--muted); }

.login-page { min-height: 100vh; }
.login-shell { align-items: center; display: flex; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); max-width: 420px; padding: 38px; width: 100%; }
.login-card .brand-mark { margin-bottom: 26px; }
.login-card h1 { font-size: 34px; letter-spacing: -.04em; margin: 5px 0 8px; }
.login-card > p:not(.eyebrow) { color: var(--muted); margin: 0 0 24px; }
.password-field { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; gap: 7px; }
.password-field input { border: 1px solid #aebdb7; border-radius: 11px; font: inherit; font-size: 16px; padding: 12px 13px; width: 100%; }
.password-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }
.login-action { cursor: pointer; margin-top: 15px; width: 100%; }

.survey-header {
  align-items: center; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line);
  display: flex; font-size: 14px; font-weight: 760; gap: 10px; min-height: 60px;
  padding: 0 max(20px, calc((100vw - 720px) / 2)); position: sticky; top: 0; z-index: 5;
}
.survey-shell { margin: 0 auto; max-width: 720px; padding: 38px 20px 70px; }
.survey-intro { margin-bottom: 27px; }
.survey-intro h1, .results-heading h1 {
  font-size: clamp(31px, 7vw, 48px); letter-spacing: -.045em; line-height: 1.08; margin: 6px 0 12px;
}
.survey-intro > p:not(.eyebrow) { color: var(--muted); margin: 7px 0; }
.survey-intro .survey-privacy {
  background: var(--accent-soft); border-radius: 12px; color: var(--accent-dark) !important;
  font-size: 13px; margin-top: 18px !important; padding: 13px 15px;
}
.survey-error { position: sticky; top: 72px; z-index: 4; }
.survey-form { display: grid; gap: 14px; }
.survey-question {
  background: var(--paper); border: 1px solid var(--line); border-radius: 17px;
  margin: 0; padding: 21px;
}
.survey-question legend {
  align-items: flex-start; display: flex; font-size: 17px; font-weight: 760;
  gap: 10px; line-height: 1.45; padding: 0 4px;
}
.question-number {
  align-items: center; background: var(--ink); border-radius: 7px; color: white; display: inline-flex;
  flex: 0 0 auto; font-size: 11px; height: 25px; justify-content: center; margin-top: 1px; width: 25px;
}
.question-hint { color: var(--muted); font-size: 12px; margin: 3px 0 12px 39px; }
.survey-choices { display: grid; gap: 8px; }
.survey-choice {
  align-items: center; background: var(--wash); border: 1px solid transparent; border-radius: 11px;
  cursor: pointer; display: grid; gap: 10px; grid-template-columns: auto auto 1fr; min-height: 48px;
  padding: 9px 11px; transition: border-color .15s, background .15s;
}
.survey-choice:hover { border-color: #a8beb5; }
.survey-choice:has(input:checked) { background: var(--accent-soft); border-color: #74aa97; }
.survey-choice input { accent-color: var(--accent); height: 18px; margin: 0; width: 18px; }
.choice-code {
  align-items: center; border: 1px solid #bdcbc5; border-radius: 6px; color: var(--muted);
  display: inline-flex; font-size: 11px; font-weight: 820; height: 25px; justify-content: center; width: 25px;
}
.survey-choice:has(input:checked) .choice-code { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice-label { font-size: 14px; }
.field-error { color: #a63c2d; font-size: 12px; margin: 8px 0 0 39px; }
.field-error:empty { display: none; }
.survey-notes {
  background: var(--paper); border: 1px solid var(--line); border-radius: 17px; padding: 23px;
}
.survey-notes h2 { font-size: 20px; margin: 0 0 17px; }
.survey-notes label { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; gap: 7px; margin-top: 15px; }
.survey-notes textarea {
  border: 1px solid #aebdb7; border-radius: 11px; font: inherit; font-size: 15px; line-height: 1.5;
  padding: 11px 12px; resize: vertical; width: 100%;
}
.survey-notes textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }
.survey-submit { cursor: pointer; font-size: 16px; justify-content: center; min-height: 52px; width: 100%; }
.survey-thanks-shell { align-items: center; display: flex; justify-content: center; min-height: 100vh; padding: 20px; }
.survey-thanks-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  max-width: 470px; padding: 42px 30px; text-align: center; width: 100%;
}
.thanks-mark {
  align-items: center; background: var(--accent); border-radius: 50%; color: white; display: inline-flex;
  font-size: 28px; height: 62px; justify-content: center; margin-bottom: 20px; width: 62px;
}
.survey-thanks-card h1 { font-size: 32px; letter-spacing: -.04em; margin: 6px 0 8px; }
.survey-thanks-card > p:not(.eyebrow) { color: var(--muted); }
.results-heading { margin-bottom: 26px; }
.results-heading > p:last-child { color: var(--muted); }
.response-card { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; margin: 14px 0; padding: 21px; }
.response-card header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding-bottom: 12px; }
.response-card header span { color: var(--muted); font-size: 12px; }
.response-answers { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 15px 0; }
.response-answers > div { align-items: baseline; display: grid; gap: 7px; grid-template-columns: auto 1fr; }
.response-answers > div > span:first-child, .response-answers small { color: var(--muted); }
.response-answer-copy { display: flex; flex-direction: column; }
.response-answer-copy strong { display: flex; flex-direction: column; font-size: 13px; }
.response-card > p { background: var(--wash); border-radius: 9px; font-size: 13px; padding: 10px 12px; }

@media (max-width: 680px) {
  body { font-size: 13px; line-height: 1.5; }
  .site-header { min-height: 52px; padding-left: 12px; padding-right: 12px; }
  .brand { font-size: 13px; gap: 7px; }
  .brand-mark { border-radius: 7px; height: 25px; width: 25px; }
  .header-actions { gap: 9px; }
  .header-actions a { font-size: 12px; }
  .logout-form button { font-size: 12px; }
  .private-badge { font-size: 9px; padding: 3px 7px; }
  .page-shell { padding: 19px 12px 48px; }
  .hero { align-items: stretch; flex-direction: column; margin-top: 4px; }
  .hero .primary-action { width: 100%; }
  .hero h1 { font-size: 27px; margin-bottom: 10px; }
  .hero-copy { font-size: 13px; }
  .primary-action { font-size: 12px; padding: 10px 13px; }
  .section-jumps { margin-bottom: 30px; }
  .section-jumps a { font-size: 12px; padding: 7px 10px; }
  .content-section { margin-top: 32px; }
  .section-heading h2 { font-size: 19px; }
  .card-grid { grid-template-columns: 1fr; }
  .item-card { border-radius: 12px; gap: 11px; min-height: 78px; padding: 12px; }
  .item-card.compact { min-height: 66px; padding: 10px 12px; }
  .file-badge { border-radius: 8px; font-size: 9px; height: 34px; width: 34px; }
  .item-copy strong { font-size: 13px; }
  .item-copy small { font-size: 11px; }
  .item-meta { font-size: 10px; margin-top: 5px; }
  .item-arrow { font-size: 21px; }
  .item-card.compact .item-copy small { display: none; }
  .back-nav a { font-size: 12px; }
  .document-actions { margin-top: -4px; }
  .document-actions .back-link { font-size: 12px; }
  .markdown-body { border-radius: 12px; font-size: 13px; padding: 17px 14px; }
  .markdown-body h1 { font-size: 23px; }
  .markdown-body h2 { font-size: 18px; margin-top: 31px; padding-top: 19px; }
  .markdown-body h3 { font-size: 15px; margin-top: 25px; }
  .markdown-body th, .markdown-body td { min-width: 90px; padding: 6px 8px; }
  .markdown-body pre, .text-preview { font-size: 12px; padding: 12px; }
  .file-hero { align-items: start; grid-template-columns: auto minmax(0,1fr); }
  .file-hero h1 { font-size: 17px; }
  .file-hero .primary-action { grid-column: 1 / -1; width: 100%; }
  .pdf-preview iframe { height: 68vh; }
  .upload-card { border-radius: 16px; }
  .upload-card h1 { font-size: 24px; }
  .login-shell { padding: 12px; }
  .login-card { border-radius: 16px; padding: 26px 20px; }
  .survey-header { min-height: 52px; padding: 0 12px; }
  .survey-shell { padding: 23px 12px 48px; }
  .survey-intro h1 { font-size: 28px; }
  .survey-question { border-radius: 13px; padding: 17px 12px; }
  .survey-question legend { font-size: 15px; padding: 0; }
  .question-hint { margin-left: 35px; }
  .survey-choice { grid-template-columns: auto auto 1fr; min-height: 51px; padding: 9px; }
  .choice-label { font-size: 13px; }
  .survey-notes { border-radius: 13px; padding: 18px 14px; }
  .response-answers { grid-template-columns: 1fr; }
}
