:root {
  color-scheme: light;
  --forest: #203f37;
  --forest-deep: #15352d;
  --forest-soft: #eaf0e9;
  --sage: #e4ebe3;
  --sage-strong: #cfdccf;
  --cream: #f6f4ee;
  --paper: #fffefa;
  --ink: #1d2924;
  --muted: #58675f;
  --line: #d9e0d8;
  --gold: #c08b3a;
  --amber: #f6ecd7;
  --amber-ink: #604514;
  --rose: #8f3d35;
  --shadow: 0 12px 32px rgba(24, 45, 37, .065);
  --radius-card: 17px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--cream);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--cream); }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: inherit; }
:focus-visible { outline: 3px solid #a96f18; outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(217, 224, 216, .9);
  background: rgba(255, 254, 250, .96);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; min-width: 0; align-items: center; gap: 9px; color: var(--forest); text-decoration: none; }
.brand-mark { display: block; width: 39px; height: 39px; flex: none; border-radius: 12px; box-shadow: 0 4px 11px rgba(32, 63, 55, .14); }
.brand-text { display: grid; min-width: 0; line-height: 1.22; }
.brand-text strong { overflow: hidden; font-size: 14px; font-weight: 750; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .045em; }
.header-actions { display: flex; flex: none; align-items: center; gap: 9px; }
.header-actions .button { min-height: 44px; padding: 7px 10px; font-size: 12px; }
#account-label { color: inherit; }

.review-banner {
  display: flex;
  min-height: 40px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 7px 14px;
  border-bottom: 1px solid #eadcc0;
  background: #f7efdf;
  color: var(--amber-ink);
  font-size: 11px;
  line-height: 1.4;
}
.review-banner strong { font-weight: 800; }

.app-shell { width: min(100%, 1440px); margin: 0 auto; padding: 22px 14px 106px; }
.workspace-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(213, 222, 213, .95);
  background: rgba(255, 254, 250, .97);
  box-shadow: 0 -8px 25px rgba(24, 45, 37, .08);
  backdrop-filter: blur(16px);
}
.workspace-nav-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #5b6a61;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.workspace-nav-button:hover { background: #f2f5ef; color: var(--forest); }
.workspace-nav-button[aria-pressed="true"] { border-color: #cfdacf; background: var(--forest-soft); color: var(--forest-deep); }
.workspace-nav-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nav-count { display: inline-grid; min-width: 22px; height: 22px; place-items: center; padding: 0 5px; border-radius: 99px; background: #d7e2d7; color: #304c3d; font-size: 10px; font-weight: 800; }
.app-view { min-width: 0; }

.eyebrow { margin: 0 0 6px; color: #58675f; font-size: 10px; line-height: 1.4; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { max-width: 780px; margin-bottom: 9px; color: var(--forest-deep); font-size: clamp(30px, 7vw, 43px); line-height: 1.1; letter-spacing: -.045em; }
h2 { color: var(--forest-deep); font-size: 20px; line-height: 1.25; letter-spacing: -.025em; margin-bottom: 0; }
h3 { color: var(--forest-deep); font-size: 17px; line-height: 1.3; margin-bottom: 7px; }
.intro-copy { max-width: 680px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

.dog-select-group { display: grid; gap: 5px; min-width: 0; }
.dog-select-group label, .session-fields label, .library-search-group label, .dog-form label, .auth-form label { color: #46554d; font-size: 12px; font-weight: 750; }
.dog-context { align-self: center; margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

.assistant-pane { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--paper); box-shadow: var(--shadow); }
.side-section { padding: 15px; }
.session-section { padding: 15px; border-color: #d3dfd2; background: #eef2eb; }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading-row h2 { font-size: 19px; }
.count-pill { flex: none; padding: 4px 9px; border-radius: 99px; background: var(--sage); color: #405549; font-size: 11px; font-weight: 750; }
.field { width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; border: 1px solid #bfcac0; border-radius: 9px; background: #fff; color: var(--ink); }
.field:focus, textarea:focus { border-color: #52786a; outline: 3px solid rgba(82, 120, 106, .19); outline-offset: 1px; }
.empty-note { padding: 12px; color: var(--muted); font-size: 13px; }
.session-fields { display: grid; gap: 10px; }
.session-fields > div { display: grid; gap: 5px; }
.fine-print { margin: 9px 0 0; color: #657169; font-size: 11px; line-height: 1.5; }

.question-form { padding: 14px; border: 1px solid #dce5da; border-radius: 13px; background: #f1f4ed; }
.question-label { display: block; margin-bottom: 9px; color: var(--forest-deep); font-size: 17px; line-height: 1.3; font-weight: 800; }
.question-form textarea { display: block; width: 100%; min-height: 100px; resize: vertical; padding: 12px 13px; border: 1px solid #bdcbbf; border-radius: 10px; background: #fff; color: var(--ink); line-height: 1.55; }
.question-form textarea::placeholder { color: #748179; }
.cloud-consent-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px; margin-top: 11px; color: #46554d; font-size: 12px; line-height: 1.5; }
.cloud-consent-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--forest); }
.composer-footer { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 11px; }
.composer-footer p { max-width: 440px; margin: 0; color: #5d6b62; font-size: 12px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 750; line-height: 1.25; text-align: center; text-decoration: none; transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button-primary { background: var(--forest); color: #fff; box-shadow: 0 3px 8px rgba(23, 55, 44, .14); }
.button-primary:hover:not(:disabled) { background: var(--forest-deep); box-shadow: 0 5px 12px rgba(23, 55, 44, .2); }
.button-secondary { border-color: #d2ddd2; background: #e8eee7; color: #244339; }
.button-secondary:hover:not(:disabled) { border-color: #bdcdbd; background: #dbe6dc; }
.button-quiet { border-color: #cdd8ce; background: transparent; color: var(--forest); }
.button-quiet:hover:not(:disabled) { background: #edf2ed; }
.answer-region { display: grid; min-width: 0; gap: 14px; padding-top: 17px; }
.answer-card { padding: 15px; border: 1px solid #d7e0d5; border-radius: 13px; background: #fbfcf8; }
.answer-safety, .answer-safety-escalation { border-color: #e5c4bd; background: #fff8f5; }
.answer-topper { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 10px; margin-bottom: 7px; }
.answer-kind { color: #58695e; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.safety-kind { color: #8c3d34; }
.answer-title { margin: 0 0 11px; color: var(--forest-deep); font-size: clamp(20px, 4vw, 24px); line-height: 1.24; letter-spacing: -.025em; }
.answer-message { margin-bottom: 12px; color: #283a31; }
.profile-context-note { padding: 11px 13px; margin: 0 0 13px; border-left: 3px solid #8b9d86; border-radius: 0 9px 9px 0; background: #f0f4ec; }
.profile-context-note strong { color: #334d3e; font-size: 13px; }
.profile-context-note p { margin: 4px 0 0; color: #536258; font-size: 13px; }
.session-context-note { padding: 12px 14px; margin: 0 0 12px; border: 1px solid #d7e0d5; border-radius: 10px; background: #f4f6f0; }
.session-context-note h3 { margin: 0 0 4px; font-size: 16px; }
.session-context-note p { margin: 0; color: #45564b; font-size: 13px; }
.session-context-note .session-context-caveat { margin-top: 4px; color: #68746c; font-size: 12px; }
.answer-section { padding: 12px 0; border-top: 1px solid #e3e8e0; }
.answer-section h3 { margin-bottom: 5px; font-size: 17px; }
.answer-section-copy { margin: 0; color: #2b3a32; white-space: pre-line; overflow-wrap: anywhere; }
.answer-note, .safety-footnote { padding: 10px 12px; margin: 11px 0 0; border-radius: 9px; background: #f3eddf; color: #59491f; font-size: 12px; }
.safety-footnote { background: #f9e8e5; color: #74332d; }
.citation-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.citation-label { color: #647168; font-size: 11px; font-weight: 700; }
.citation-chip { max-width: 100%; min-height: 44px; padding: 7px 10px; border: 1px solid #cbd8cb; border-radius: 7px; background: #fff; color: #294c3f; font-size: 12px; text-align: left; overflow-wrap: anywhere; }
.citation-chip:hover { background: #eaf1e9; }
.answer-privacy { margin: 12px 0 0; color: #6b766e; font-size: 11px; }
.inline-notice { padding: 12px 14px; margin: 0; border-radius: 9px; background: #f4f1e7; color: #5b573f; font-size: 13px; }
.inline-error, .error-card { padding: 13px 15px; margin-top: 11px; border: 1px solid #e1b8b1; border-radius: 9px; background: #fff4f1; color: #793b34; }
.error-card h2 { margin-bottom: 6px; color: #793b34; }
.error-card p:last-child { margin: 0; }
.loading-card { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.loading-title { margin: 0 0 14px; color: var(--forest); font-size: 14px; font-weight: 750; }
.loading-lines { display: grid; gap: 9px; }
.loading-line { display: block; width: 100%; height: 11px; border-radius: 99px; background: linear-gradient(90deg, #edf1ea 20%, #f8f9f5 45%, #edf1ea 70%); background-size: 220% 100%; animation: loading-shimmer 1.4s ease-in-out infinite; }
.loading-line-short { width: 62%; }
@keyframes loading-shimmer { to { background-position: -220% 0; } }

.matches-section { padding-top: 7px; }
.matches-section .section-heading-row { align-items: center; margin-bottom: 10px; }
.matches-section .section-heading-row h2 { font-size: 18px; }
.match-list { display: grid; gap: 9px; }
.match-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.match-card h3 { margin: 7px 0 4px; font-size: 16px; }
.draft-badge { display: inline-block; max-width: 100%; padding: 3px 8px; border-radius: 99px; background: var(--amber); color: #684e1b; font-size: 10px; font-weight: 800; line-height: 1.4; }
.match-summary { margin: 0 0 8px; color: #506057; font-size: 13px; }

.library-heading { margin: 1px 0 17px; }
.library-heading h1 { margin-bottom: 8px; }
.library-toolbar { display: grid; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 4px 16px rgba(24, 45, 37, .035); }
.library-search-group { display: grid; gap: 6px; min-width: 0; }
.search-control { position: relative; min-width: 0; }
.search-control svg { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: #68766c; stroke-linecap: round; stroke-width: 1.8; pointer-events: none; }
.search-control .field { padding-left: 39px; }
.library-filter-group { display: grid; gap: 6px; }
.filter-label { color: #46554d; font-size: 12px; font-weight: 750; }
.library-filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.filter-button { min-height: 44px; flex: 0 0 auto; padding: 8px 12px; border: 1px solid #d5ded5; border-radius: 9px; background: #fff; color: #45574c; font-size: 12px; font-weight: 700; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.filter-button:hover { border-color: #b8c8b9; background: #f4f7f1; }
.filter-button[aria-pressed="true"] { border-color: var(--forest); background: var(--forest); color: #fff; }
.clear-filters { min-height: 44px; justify-self: start; }
.library-results-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 16px 1px 10px; }
.library-results-header p { margin: 0; }
#library-count { color: var(--forest-deep); font-size: 13px; font-weight: 750; }
.library-review-note { color: var(--muted); font-size: 11px; }
.library-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 11px; }
.library-card { display: flex; min-width: 0; min-height: 230px; flex-direction: column; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 5px 16px rgba(24, 45, 37, .035); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.library-card:hover { transform: translateY(-2px); border-color: #c3d1c3; box-shadow: 0 12px 26px rgba(24, 45, 37, .09); }
.library-card-header { display: flex; align-items: start; justify-content: space-between; gap: 7px; }
.record-type { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 8px; border-radius: 7px; background: #e9efe7; color: #375141; font-size: 10px; font-weight: 800; letter-spacing: .025em; }
.record-type-triage { background: #f9e9e3; color: #823f33; }
.library-card-title { margin: 13px 0 7px; color: var(--forest-deep); font-size: 18px; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.library-card-summary { display: -webkit-box; overflow: hidden; margin: 0 0 12px; color: #526158; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.topic-list { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: auto 0 12px; list-style: none; }
.topic-chip { padding: 3px 7px; border-radius: 99px; background: #f1f3ee; color: #59665f; font-size: 10px; }
.library-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid #edf0e9; }
.record-id { color: #6b776f; font-size: 10px; letter-spacing: .03em; }
.library-open { min-height: 44px; padding: 5px 2px 5px 8px; }
.library-empty { max-width: 520px; padding: 35px 20px; margin: 20px auto; border: 1px dashed #bdcbbf; border-radius: 16px; background: rgba(255, 254, 250, .78); text-align: center; }
.library-empty h2 { margin: 8px 0 5px; }
.library-empty p { margin: 0 auto 15px; color: var(--muted); font-size: 14px; }
.empty-mark { display: inline-grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #e9efe7; color: var(--forest); font-size: 26px; }

.privacy-footer { display: flex; flex-direction: column; align-items: start; gap: 8px; padding: 14px 2px 2px; margin-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.55; }
.privacy-footer strong { color: var(--forest); }
.text-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: flex-start; padding: 5px 0; border: 0; background: transparent; color: #315c4d; font-size: 12px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: #122f27; }
.text-danger { color: #883b32; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }

.dialog { width: min(620px, calc(100vw - 24px)); max-height: min(88dvh, 850px); overflow: auto; padding: 0; border: 1px solid #cbd5cb; border-radius: 17px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgba(12, 30, 22, .3); }
.dialog::backdrop { background: rgba(20, 39, 31, .54); backdrop-filter: blur(3px); }
.dialog-header { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); background: rgba(255, 254, 250, .97); backdrop-filter: blur(10px); }
.dialog-header .eyebrow { margin-bottom: 4px; }
.dialog-header h2 { font-size: 21px; }
.icon-button { min-width: 44px; min-height: 44px; padding: 8px 10px; border: 1px solid #cad5ca; border-radius: 9px; background: transparent; color: #45594c; font-size: 12px; font-weight: 750; }
.icon-button:hover { background: #edf2ed; }
.dialog-copy, .policy-copy { padding: 14px 17px 0; margin-bottom: 0; color: #526158; font-size: 13px; }
.saved-dogs { display: grid; gap: 8px; padding: 12px 17px 4px; }
.saved-dog-row { display: flex; align-items: start; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf7; }
.saved-dog-name { color: var(--forest); }
.saved-dog-facts { max-width: 420px; margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.saved-dog-actions { display: flex; width: 100%; align-items: center; flex-wrap: wrap; justify-content: start; gap: 4px 14px; }
.dog-form { display: grid; gap: 7px; padding: 14px 17px 18px; border-top: 1px solid var(--line); }
.dog-form h3 { margin: 0 0 3px; }
.dog-form textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.form-grid > div { display: grid; gap: 6px; }
.dialog-actions { display: flex; flex-direction: column-reverse; gap: 8px; margin-top: 7px; }
.dialog-actions .button { width: 100%; }
.source-dialog { width: min(900px, calc(100vw - 24px)); }
.source-meta { display: inline-flex; max-width: calc(100% - 32px); padding: 5px 9px; margin: 16px 16px 3px; border-radius: 7px; background: #f4f1e7; color: #66552c; font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.source-record-title { margin: 4px 16px 8px; color: var(--forest-deep); font-size: 23px; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
.source-summary { margin: 0 16px 15px; color: #48594e; font-size: 14px; line-height: 1.6; }
.source-reading { padding: 14px 16px 20px; border-top: 1px solid var(--line); background: #f7f8f3; color: #2e3932; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.source-reading > h4 { padding-bottom: 6px; margin: 16px 0 7px; border-bottom: 1px solid #dfe5dc; color: var(--forest); font-size: 15px; line-height: 1.35; }
.source-reading > h4:first-child { margin-top: 0; }
.source-reading p { margin: 0 0 11px; }
.source-reading ul, .source-reading ol { padding-left: 23px; margin: 4px 0 13px; }
.source-reading li { padding-left: 3px; margin: 4px 0; }
.source-callout { padding: 11px 13px; border-left: 3px solid var(--gold); border-radius: 0 9px 9px 0; background: #f4eddd; color: #514722; }
.source-step { padding: 13px 14px 3px; margin: 10px 0; border: 1px solid #dfe5dc; border-left: 3px solid #6d8b70; border-radius: 11px; background: #fffefa; }
.source-step-title { margin: 0 0 8px; color: var(--forest); font-size: 14px; }
.source-step-detail { padding-left: 11px; border-left: 2px solid #edf0e9; }
.source-detail-label { margin: 10px 0 2px; color: #63736a; font-size: 10px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.source-detail-value { margin-bottom: 8px !important; }
.source-step .source-detail-label:first-of-type { margin-top: 0; }
.source-actions { display: flex; flex-direction: column; align-items: stretch; gap: 7px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--paper); }
.source-actions .fine-print { margin: 0; }
.source-actions .button { width: 100%; }
.account-dialog { width: min(520px, calc(100vw - 24px)); }
.auth-form { display: grid; gap: 7px; padding: 15px 17px 10px; }
.auth-form [hidden], [hidden] { display: none !important; }
.auth-mode { display: flex; gap: 8px; margin-bottom: 5px; }
.auth-mode [aria-pressed="true"] { border-color: var(--forest); background: var(--forest); color: #fff; }
.auth-mode button { flex: 1; }
.auth-status { padding: 10px 12px; margin: 4px 17px 12px; border-radius: 8px; background: #eef3eb; color: #43584a; font-size: 12px; }
.account-dialog .fine-print { padding: 0 17px 17px; }
.policy-copy { padding-bottom: 18px; }
.policy-copy h3 { margin: 16px 0 4px; font-size: 16px; }
.policy-copy p { margin: 0; }

@media (min-width: 560px) {
  .site-header { min-height: 74px; padding: 11px 22px; }
  .brand { gap: 11px; }
  .brand-mark { width: 43px; height: 43px; }
  .brand-text strong { font-size: 16px; }
  .brand-text small { font-size: 11px; }
  .header-actions { gap: 13px; }
  .review-banner { justify-content: center; gap: 6px 12px; padding-inline: 20px; font-size: 12px; }
  .dog-context { font-size: 13px; }
  .question-form { padding: 17px; }
  .composer-footer { flex-direction: row; align-items: center; justify-content: space-between; }
  .composer-footer .button { min-width: 185px; }
  .answer-card { padding: 18px; }
  .library-toolbar { padding: 16px; }
  .library-card { padding: 17px; }
  .source-meta { margin-right: 22px; margin-left: 22px; }
  .source-record-title { margin-right: 22px; margin-left: 22px; }
  .source-summary { margin-right: 22px; margin-left: 22px; }
  .source-reading { padding: 18px 22px 24px; }
  .source-actions { flex-direction: row; align-items: center; justify-content: space-between; padding: 14px 22px; }
  .source-actions .button { width: auto; min-width: 190px; }
}

@media (min-width: 700px) {
  .app-shell { padding: 28px 24px 34px; }
  .workspace-nav { position: static; display: inline-flex; width: max-content; gap: 5px; padding: 4px; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 4px 14px rgba(24, 45, 37, .035); }
  .workspace-nav-button { min-width: 160px; }
  .session-fields { gap: 11px; }
  .question-form { padding: 19px; }
  .question-label { font-size: 19px; }
  .answer-region { gap: 16px; padding-top: 19px; }
  .library-heading { margin-bottom: 21px; }
  .library-toolbar { grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 14px 20px; padding: 17px; }
  .library-filter-group { min-width: 0; }
  .clear-filters { grid-column: 2; justify-self: end; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .privacy-footer { flex-direction: row; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 15px; font-size: 12px; }
  .dialog-copy, .policy-copy { padding-right: 21px; padding-left: 21px; font-size: 14px; }
  .saved-dogs { padding-right: 21px; padding-left: 21px; }
  .saved-dog-row { flex-direction: row; justify-content: space-between; }
  .saved-dog-actions { width: auto; justify-content: end; }
  .dog-form, .auth-form { padding-right: 21px; padding-left: 21px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-actions { flex-direction: row; justify-content: flex-end; }
  .dialog-actions .button { width: auto; min-width: 120px; }
  .auth-status { margin-right: 21px; margin-left: 21px; }
  .account-dialog .fine-print { padding-right: 21px; padding-left: 21px; }
}

@media (min-width: 960px) {
  .app-shell { padding-top: 31px; }
  .library-toolbar { grid-template-columns: minmax(300px, 1fr) auto auto; }
  .clear-filters { grid-column: auto; align-self: end; }
  .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 359px) {
  .site-header { gap: 7px; padding-inline: 10px; }
  .brand { gap: 7px; }
  .brand-mark { width: 35px; height: 35px; }
  .brand-text strong { font-size: 12px; }
  .header-actions { gap: 5px; }
  .header-actions .button { min-height: 44px; padding: 6px 8px; font-size: 11px; }
  #account-label { display: none; }
  .review-banner { padding-inline: 11px; }
  .app-shell { padding-inline: 11px; }
  .workspace-nav { gap: 5px; padding-inline: 9px; }
  .workspace-nav-button { gap: 5px; padding-inline: 6px; font-size: 12px; }
  .nav-count { min-width: 19px; height: 19px; }
}

/* The primary workflow: a question, optional context, then clear source guidance. */
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 12px 16px; border-radius: 8px; background: var(--forest); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header { min-height: 66px; }
.brand { min-height: 44px; }
.review-banner { min-height: 44px; flex-wrap: nowrap; justify-content: space-between; padding: 0 14px; gap: 8px; }
.review-banner-copy { display: none; }
.banner-link { flex: none; min-height: 44px; padding: 8px 0 8px 8px; border: 0; background: transparent; color: #604514; font-size: 11px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.app-shell { max-width: 1240px; padding-top: 22px; }
#ask-view { max-width: 940px; margin: 0 auto; }
.simple-intro { display: block; margin: 0 0 20px; }
.simple-intro h1 { max-width: 740px; font-size: clamp(29px, 6.4vw, 43px); line-height: 1.13; margin-bottom: 10px; }
.simple-intro .intro-copy { max-width: 580px; font-size: 15px; }
.home-stack { display: grid; min-width: 0; gap: 18px; }
.composer-pane { padding: 0; overflow: hidden; border-radius: 18px; }
.composer-pane .question-form { padding: 18px; border: 0; border-radius: 0; background: var(--paper); scroll-margin-top: 84px; }
.question-label { margin-bottom: 9px; font-size: 14px; font-weight: 700; }
.question-form textarea { min-height: 90px; padding: 12px 14px; border-radius: 11px; background: #f8faf6; font-size: 16px; }
.question-form textarea::placeholder { color: #627367; opacity: 1; }
.composer-footer { gap: 10px; margin-top: 12px; }
.composer-footer .button { width: 100%; min-height: 48px; justify-content: space-between; padding-inline: 17px; font-size: 14px; }
.composer-footer p { font-size: 11px; }
.session-options { border-top: 1px solid var(--line); }
.session-options > summary { display: flex; min-height: 56px; align-items: center; gap: 10px; padding: 13px 18px; list-style: none; color: var(--forest); font-size: 13px; font-weight: 700; cursor: pointer; }
.session-options > summary::-webkit-details-marker { display: none; }
.session-options > summary::after { width: 7px; height: 7px; flex: none; margin: -4px 2px 0 1px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; content: ""; transform: rotate(45deg); }
.session-options[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
.session-summary { min-width: 0; margin-left: auto; color: #607265; font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.session-options[open] > summary { background: #f4f7f0; }
.session-options-body { display: grid; gap: 16px; padding: 18px; background: #f8faf5; }
.session-options-body .dog-context { margin: 3px 0 0; }
.session-options-body .fine-print { margin: 0; }
.profile-feedback { max-width: 940px; padding: 11px 14px; margin: 0 auto 18px; border: 1px solid #ccdccc; border-radius: 11px; background: #ecf3e9; color: var(--forest); font-size: 13px; overflow-wrap: anywhere; }
.quick-starts { margin: 6px 0 4px; }
.quick-starts .section-heading-row { margin-bottom: 10px; }
.quick-starts h2 { font-size: 19px; }
.quick-starts .text-button { gap: 7px; }
.starter-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.starter-card { display: flex; min-width: 0; min-height: 86px; width: 100%; align-items: center; gap: 12px; padding: 14px; border: 1px solid #d6dfd3; border-radius: 14px; background: var(--paper); color: var(--forest); text-align: left; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.starter-card:hover { border-color: #9cb29f; background: #f9fcf6; box-shadow: 0 6px 18px rgba(24,45,37,.06); }
.starter-icon { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border-radius: 12px; background: #eaf0e6; color: #446c54; }
.starter-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.starter-card strong { display: block; font-size: 15px; line-height: 1.35; }
.starter-card small { display: block; margin-top: 4px; color: #5e7063; font-size: 12px; line-height: 1.4; }
.starter-arrow { flex: none; margin-left: auto; font-size: 20px; }
.answer-region { padding-top: 0; }
.answer-card { padding: 20px; border-radius: 17px; background: var(--paper); scroll-margin-top: 82px; }
.answer-title { font-size: clamp(23px, 5vw, 29px); }
.answer-section { padding: 17px 0; }
.answer-section h3 { font-size: 16px; margin-bottom: 8px; }
.answer-section-copy, .answer-message { font-size: 15px; line-height: 1.7; }
.answer-steps { padding-left: 22px; margin: 0; font-size: 15px; line-height: 1.7; }
.answer-steps li { padding-left: 7px; margin-bottom: 14px; }
.answer-steps li:last-child { margin-bottom: 0; }
.answer-steps li::marker { color: var(--forest); font-weight: 800; }
.safety-check { padding: 14px; margin: 8px 0 12px; border: 1px solid #e8d4c1; border-left: 3px solid #b7833a; border-radius: 9px; background: #fbf5e9; }
.safety-check h3 { color: #654c23; }
.answer-details { padding-top: 7px; margin-top: 18px; border-top: 1px solid var(--line); }
.answer-details > summary, .related-guides > summary { min-height: 44px; padding: 10px 0; color: #4a6454; font-size: 13px; font-weight: 700; cursor: pointer; }
.answer-details .answer-note { margin: 5px 0 12px; }
.answer-details .profile-context-note { margin-top: 12px; }
.answer-details .session-context-note { margin-top: 12px; }
.ask-another { margin-top: 8px; }
.related-guides { padding: 3px 17px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcf8; }
.related-guides .match-list { padding-bottom: 12px; }
.citation-row { gap: 10px; }
.citation-chip { min-height: 46px; padding: 10px 14px; font-size: 13px; font-weight: 700; }
.library-card-title { font-size: 19px; }
.library-card-summary { font-size: 14px; }
.topic-chip { text-transform: capitalize; }
.library-card-footer { margin-top: auto; }
.library-open { min-height: 46px; width: 100%; justify-content: flex-start; padding: 8px 0; font-size: 13px; text-decoration: none; }
.optional-profile { margin-top: 5px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.optional-profile > summary { min-height: 48px; padding: 12px 0; color: var(--forest); font-size: 13px; font-weight: 700; cursor: pointer; }
.optional-profile > summary span { float: right; color: var(--muted); font-size: 11px; font-weight: 500; }
.optional-profile-fields { display: grid; gap: 7px; padding: 4px 0 16px; }
.optional-profile-fields label { margin-top: 3px; }
.source-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.source-dialog .dialog-header { flex: none; }
.source-toolbar { display: flex; flex: none; align-items: center; gap: 8px; padding: 7px 16px; border-bottom: 1px solid var(--line); background: #f9faf5; }
.source-nav-button { min-height: 44px; padding: 9px 12px; border: 1px solid #d8e2d4; border-radius: 8px; background: var(--paper); color: var(--forest); font-size: 12px; font-weight: 700; cursor: pointer; }
.source-nav-button:hover { background: #eaf1e6; border-color: #a9bca9; }
#source-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.source-dialog .source-actions { flex: none; }
.source-reading, .source-step { scroll-margin-top: 12px; }
.source-step { padding: 16px; }
.source-step-title { font-size: 17px; }
.source-detail-label { font-size: 11px; letter-spacing: .035em; }
.source-actions .fine-print { max-width: 350px; }
.error-card > details { margin-top: 14px; }
.error-card > details summary { min-height: 44px; padding: 10px 0; cursor: pointer; }

@media (min-width: 560px) {
  .review-banner { padding-inline: 22px; }
  .review-banner-copy { display: inline; }
  .composer-pane .question-form { padding: 24px; }
  .composer-footer .button { width: auto; min-width: 190px; }
  .session-options > summary { padding-inline: 24px; }
  .session-options-body { padding: 20px 24px; }
  .session-options-body .session-fields { grid-template-columns: 1fr 1fr; }
  .session-options-body .session-fields > div:last-child { grid-column: 1 / -1; }
  .answer-card { padding: 26px; }
}

@media (min-width: 700px) {
  .workspace-nav-button { min-width: 120px; }
  .simple-intro { margin-bottom: 24px; }
  .home-stack { gap: 21px; }
  .starter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .starter-card { min-height: 140px; flex-wrap: wrap; align-content: start; gap: 11px; padding: 16px; }
  .starter-card > span:nth-child(2) { order: 2; width: 100%; }
  .starter-arrow { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
