:root {
    --background: #fcf9f5;
    --surface: #ffffff;
    --surface-low: #f6f3ef;
    --surface-high: #ebe8e4;
    --text: #1c1c19;
    --text-muted: #444840;
    --outline: #c4c8bd;
    --primary: #1a2e12;
    --primary-container: #2f4426;
    --primary-soft: #d0eac0;
    --secondary: #7b5644;
    --secondary-soft: #ffdbcb;
    --error: #8a2d24;
    --error-soft: #fff0ed;
    --focus: #4e6544;
    --shadow: 0 12px 32px rgba(28, 28, 25, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--background); font-family: "Hanken Grotesk", sans-serif; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
a { color: var(--primary-container); }
button, a, input, summary, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); }
.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; }

.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--outline); background: rgba(252, 249, 245, 0.97); }
.header-inner { width: min(100% - 48px, 1200px); min-height: 72px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: block; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--outline); border-radius: 50%; background: var(--surface); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-name, .brand-community, .brand-label { display: block; }
.brand-name { font-family: "Source Serif 4", serif; font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.brand-community { color: var(--secondary); font-size: 0.7rem; font-weight: 700; line-height: 1.25; }
.brand-label { margin-top: 1px; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; line-height: 1.2; }

.page-shell { width: min(100% - 48px, 1200px); margin: 0 auto; padding: 44px 0 56px; display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 48px; }
.content-column { min-width: 0; }
.intro { padding: 20px 0 32px; text-align: center; }
.eyebrow, .assistant-label, .message-label { margin: 0 0 7px; color: var(--focus); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; }
h1 { margin: 0; color: var(--primary); font-family: "Source Serif 4", serif; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.15; }
.intro-copy { max-width: 560px; margin: 12px auto 0; color: var(--text-muted); font-size: 1.06rem; }

.conversation { display: grid; gap: 34px; }
.exchange { display: grid; gap: 14px; scroll-margin-top: 92px; }
.question-wrap { display: grid; justify-items: end; }
.question { max-width: 78%; margin: 0; padding: 13px 16px; border-radius: 4px 4px 0 4px; color: #fff; background: var(--primary-container); font-weight: 500; overflow-wrap: anywhere; }
.answer { padding: 24px; border: 1px solid var(--outline); border-left: 4px solid var(--focus); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow); }
.answer-error { border-left-color: var(--error); background: var(--error-soft); }
.answer-clarification { border-left-color: var(--secondary); }
.answer-no_information, .answer-calendar_unavailable { border-left-color: #8a681f; }
.answer-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.answer-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.state-badge { padding: 2px 7px; border: 1px solid var(--outline); color: var(--text-muted); background: var(--surface-low); font-size: 0.72rem; font-weight: 700; }
.sequence { color: var(--text-muted); font-size: 0.78rem; }
.answer-content > :first-child, .general-info > div > :first-child { margin-top: 0; }
.answer-content > :last-child, .general-info > div > :last-child { margin-bottom: 0; }
.answer-content a { overflow-wrap: anywhere; }
.general-info, .sources, .related-actions, .follow-ups, .feedback { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--surface-high); }
.general-info { padding: 16px; border: 1px solid var(--outline); background: var(--surface-low); }
.general-info h2, .sources h2, .related-actions h2, .follow-ups h2 { margin: 0 0 10px; font-size: 0.9rem; }
.general-info h2 { display: flex; align-items: center; gap: 7px; }
.general-info h2 svg { width: 17px; }
.verification-note { margin: 18px 0 0; padding: 12px; display: flex; gap: 9px; align-items: flex-start; color: #5d3c2e; background: #fff4eb; border-left: 3px solid var(--secondary); font-size: 0.88rem; }
.verification-note svg { width: 18px; flex: 0 0 auto; margin-top: 2px; }

.sources ul { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.source-link { min-height: 44px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--surface-high); color: var(--text); background: var(--surface-low); text-decoration: none; }
a.source-link:hover { border-color: var(--focus); }
.source-link > svg { width: 18px; flex: 0 0 auto; }
.source-label { min-width: 0; flex: 1; }
.source-label strong, .source-label small { display: block; overflow-wrap: anywhere; }
.source-label small { color: var(--text-muted); }
.freshness { margin: 8px 0 0; color: var(--text-muted); font-size: 0.78rem; }
.link-row, .question-options { display: flex; flex-wrap: wrap; gap: 8px; }
.text-action { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.text-action svg { width: 15px; }
.question-option { min-height: 44px; padding: 9px 12px; border: 1px solid var(--outline); border-radius: 4px; color: var(--primary); background: var(--surface); text-align: left; cursor: pointer; }
.question-option:hover { border-color: var(--focus); background: var(--surface-low); }

.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.86rem; }
.feedback-btn, .secondary-btn, .icon-text-btn, .clear-btn, .submit-btn { min-height: 44px; padding: 8px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 4px; font-weight: 600; cursor: pointer; }
.feedback-btn, .secondary-btn, .icon-text-btn { border: 1px solid var(--outline); color: var(--primary); background: var(--surface); }
.feedback-btn:hover, .secondary-btn:hover, .icon-text-btn:hover, .feedback-btn[aria-pressed="true"] { border-color: var(--focus); background: var(--primary-soft); }
.feedback-btn svg, .secondary-btn svg, .icon-text-btn svg, .clear-btn svg, .submit-btn svg { width: 17px; height: 17px; }
.feedback-reasons { flex-basis: 100%; padding: 12px; display: flex; flex-wrap: wrap; align-items: end; gap: 10px; background: var(--surface-low); }
.feedback-reasons[hidden] { display: none; }
.feedback-reasons label { display: grid; gap: 4px; }
.feedback-reason { min-height: 44px; padding: 7px; border: 1px solid var(--outline); background: var(--surface); }
.feedback-status { flex-basis: 100%; margin: 0; color: var(--primary-container); }

.answer-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--surface-high); display: flex; flex-wrap: wrap; gap: 8px; }
.include-history { flex-basis: 100%; display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.82rem; }
.include-history input { width: 18px; height: 18px; }

.composer-section { margin-top: 34px; }
.composer-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.composer-heading h2, .examples h2 { margin: 0; font-family: "Source Serif 4", serif; font-size: 1.2rem; }
.composer-heading span { color: var(--text-muted); font-size: 0.82rem; }
.composer { margin-top: 9px; padding: 16px; border: 1px solid var(--outline); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(78, 101, 68, 0.15), var(--shadow); }
textarea { width: 100%; min-height: 104px; max-height: 280px; padding: 4px 2px; resize: vertical; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 1.03rem; line-height: 1.5; }
textarea::placeholder { color: #74796f; }
.composer-footer { padding-top: 12px; border-top: 1px solid var(--surface-high); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.input-hint { margin: 0; color: var(--text-muted); font-size: 0.78rem; }
.composer-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.thinking-indicator { width: 96px; height: 54px; display: block; object-fit: contain; background: #fff; }
.thinking-indicator[hidden] { display: none; }
.submit-btn { border: 1px solid var(--primary); color: #fff; background: var(--primary); }
.submit-btn:hover { background: var(--primary-container); }
.clear-btn { border: 1px solid var(--outline); color: var(--secondary); background: transparent; }
.clear-btn:hover:not(:disabled) { border-color: var(--secondary); background: var(--secondary-soft); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.form-error { margin: 8px 0 0; color: var(--error); font-weight: 600; }
.examples { margin-top: 24px; }
.examples .question-options { margin-top: 10px; }

.loading { margin-top: 24px; padding: 14px 18px; align-items: center; justify-content: center; gap: 14px; border: 1px solid var(--outline); color: var(--primary); background: var(--surface-low); font-weight: 600; }
.loading:not([hidden]) { display: flex; }
.limit-state { margin-top: 34px; padding: 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; border: 1px solid var(--outline); background: var(--surface); }
.limit-state > svg { width: 28px; color: var(--primary-container); }
.limit-state h2, .limit-state p { margin: 0; }
.limit-state h2 { font-family: "Source Serif 4", serif; font-size: 1.2rem; }

.trust-notices { margin-top: 24px; padding: 16px; border-top: 1px solid var(--outline); color: var(--text-muted); font-size: 0.8rem; }
.trust-notices > p { margin: 0 0 10px; display: flex; align-items: flex-start; gap: 9px; }
.trust-notices svg { width: 17px; flex: 0 0 auto; margin-top: 2px; }
.trust-notices summary { color: var(--secondary); cursor: pointer; font-weight: 600; }
.trust-notices details p { margin-bottom: 0; }

.resources { position: sticky; top: 102px; padding-left: 24px; border-left: 1px solid var(--outline); }
.resources h2 { margin: 0 0 12px; font-family: "Source Serif 4", serif; font-size: 1.15rem; }
.resources nav { display: grid; }
.resources a { min-height: 44px; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--surface-high); color: var(--text-muted); font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.resources a:hover { color: var(--primary); }
.resources a svg { width: 15px; flex: 0 0 auto; }
.resources .directory-resource { margin-top: 14px; padding: 11px; justify-content: flex-start; border: 1px solid var(--focus); color: var(--primary); background: var(--primary-soft); }

.directory-shell { width: min(100% - 48px, 1080px); margin: 0 auto; padding: 52px 0 64px; }
.directory-intro { max-width: 680px; }
.directory-intro > p:last-child { color: var(--text-muted); font-size: 1.05rem; }
.submission-action { min-height: 44px; margin-top: 16px; padding: 9px 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--primary); border-radius: 4px; color: #fff; background: var(--primary); text-decoration: none; font-weight: 700; }
.submission-action:hover { background: var(--primary-container); }
.submission-action svg { width: 18px; }
.directory-filters { margin: 30px 0; padding: 18px; display: grid; grid-template-columns: minmax(220px, 1fr) 180px 180px auto; align-items: end; gap: 12px; border: 1px solid var(--outline); background: var(--surface); }
.directory-filters label, .authorization-form { display: grid; gap: 6px; font-weight: 600; }
.directory-filters input, .directory-filters select, .authorization-form input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--outline); border-radius: 3px; color: var(--text); background: var(--surface); }
.directory-disclaimer { margin: 24px 0; padding: 14px 16px; display: flex; align-items: flex-start; gap: 10px; border-left: 4px solid var(--secondary); background: var(--secondary-soft); font-weight: 600; }
.directory-disclaimer svg { width: 19px; flex: 0 0 auto; margin-top: 2px; }
.provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.provider-card { padding: 20px; border: 1px solid var(--outline); border-radius: 4px; background: var(--surface); }
.provider-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.provider-heading h3 { margin: 2px 0 0; font-family: "Source Serif 4", serif; font-size: 1.3rem; }
.provider-type { margin: 0; color: var(--text-muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; }
.category-label { padding: 3px 7px; border: 1px solid var(--outline); background: var(--surface-low); font-size: 0.75rem; font-weight: 700; }
.provider-details { margin: 14px 0; padding-top: 12px; border-top: 1px solid var(--surface-high); }
.provider-details summary { color: var(--primary); cursor: pointer; font-weight: 700; }
.provider-about { margin-bottom: 0; color: var(--text-muted); }
.provider-contacts { display: flex; flex-wrap: wrap; gap: 8px; }
.directory-contact { min-height: 44px; padding: 8px 11px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--outline); color: var(--primary); text-decoration: none; font-weight: 600; }
.directory-contact:hover { border-color: var(--focus); background: var(--primary-soft); }
.directory-contact svg { width: 16px; }
.directory-empty { padding: 40px 20px; display: grid; justify-items: center; border: 1px solid var(--outline); color: var(--text-muted); background: var(--surface); text-align: center; }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; padding: 24px; display: grid; place-items: center; overflow-y: auto; background: rgba(28, 28, 25, 0.72); }
.authorization-dialog { width: min(100%, 520px); padding: 28px; border: 1px solid var(--outline); border-radius: 4px; background: var(--surface); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); }
.authorization-dialog h2 { margin: 0; color: var(--primary); font-family: "Source Serif 4", serif; font-size: 2rem; line-height: 1.15; }
.authorization-dialog .submission-action { width: 100%; justify-content: center; margin: 4px 0 14px; }
.dialog-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.dialog-icon svg { width: 24px; }
.authorization-form { margin: 22px 0 12px; }
.authorization-form small, .dialog-privacy { color: var(--text-muted); font-size: 0.82rem; }
.account-help { color: var(--text-muted); font-size: 0.9rem; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: min(360px, calc(100% - 40px)); padding: 12px 16px; color: #fff; background: var(--primary); box-shadow: var(--shadow); }
.toast.error { background: var(--error); }

@media (max-width: 860px) {
    .page-shell { grid-template-columns: 1fr; gap: 36px; }
    .resources { position: static; padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--outline); }
    .directory-filters { grid-template-columns: 1fr 1fr; }
    .directory-filters label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .header-inner, .page-shell { width: min(100% - 28px, 1200px); }
    .header-inner { min-height: 64px; }
    .brand-label, .clear-btn span, .input-hint { display: none; }
    .brand-mark { width: 40px; height: 40px; }
    .clear-btn { width: 44px; padding: 8px; }
    .page-shell { padding: 24px 0 36px; }
    .intro { padding: 14px 0 28px; }
    .question { max-width: 92%; }
    .answer { padding: 18px; }
    .answer-heading { align-items: flex-start; }
    .answer-meta { justify-content: flex-end; }
    .answer-actions > button { flex: 1 1 100%; }
    .feedback { align-items: stretch; }
    .feedback > span { flex-basis: 100%; }
    .feedback-btn { flex: 1; }
    .feedback-reasons { align-items: stretch; }
    .feedback-reasons label, .feedback-reasons .secondary-btn { width: 100%; }
    .limit-state { grid-template-columns: auto 1fr; }
    .limit-state form { grid-column: 1 / -1; }
    .limit-state .submit-btn { width: 100%; }
    .composer-actions { flex-direction: row-reverse; gap: 8px; }
    .thinking-indicator { width: 72px; height: 41px; }
    .directory-shell { width: min(100% - 28px, 1080px); padding: 30px 0 44px; }
    .directory-filters, .provider-grid { grid-template-columns: 1fr; }
    .directory-filters label:first-child { grid-column: auto; }
    .directory-filters .submit-btn { width: 100%; }
    .provider-heading { display: grid; }
    .authorization-dialog { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .thinking-indicator { display: none; }
}