/* mortgagetape — dark gray on warm cream, Times New Roman */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: #F7F4EB;
  color: #1a1a1a;
  font-family: 'Times New Roman', Times, serif;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}

body {
  padding: 48px 24px 80px;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
}

/* ---------- Hamburger menu (shared across all pages) ---------- */

.site-nav {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Sign in / signed-in area to the LEFT of the hamburger. Tucked into the
 * existing site-nav flex row so it lives in the same visual band. */
.auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
  order: -1;
  margin-right: 4px;
}
.auth-signin {
  font-size: 13px;
  color: #1a1a1a;
  background: none;
  border: 1px solid #c8c2b0;
  border-radius: 3px;
  padding: 5px 12px;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.auth-signin:hover {
  background: #efeadb;
}
.auth-signed-in {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* The HTML `hidden` attribute is supposed to set display:none, but the
 * `.auth-signed-in { display: flex }` rule above has higher specificity and
 * wins by default — making both Sign in AND the signed-in block render at
 * the same time. Re-assert `hidden` here so they're properly mutex. */
.auth-area [hidden] { display: none !important; }
.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #d0cab8;
  display: block;
}
.user-email {
  font-size: 12px;
  opacity: 0.75;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-signout {
  font-size: 12px;
  opacity: 0.6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: #1a1a1a;
}
.auth-signout:hover { opacity: 1; }

/* Sign-in picker: small popover below the "Sign in" button with one row
 * per enabled provider (Google, Microsoft). Shown only when more than one
 * provider is configured. */
.signin-picker {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #F7F4EB;
  border: 1px solid #c8c2b0;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  min-width: 260px;
  z-index: 200;
  padding: 4px;
  /* Flex column with a small gap so the GSI-rendered Google button (an
   * iframe in .signin-picker-gsi-slot) and the styled Microsoft button
   * (.signin-picker-option) sit at a consistent vertical rhythm. */
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.signin-picker.hidden { display: none; }
/* Slot the GSI iframe-backed Google button is rendered into. GSI controls
 * the iframe's dimensions (width: 320, height: ~40); we just make sure the
 * slot doesn't add extra margin and centers the button if the picker is
 * wider than the iframe. */
.signin-picker-gsi-slot {
  display: flex;
  justify-content: center;
}

/* Value-prop header above the provider buttons inside the picker dropdown.
 * Anchors the dropdown with a clear sentence of why the user is about to
 * sign in. */
.signin-picker-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid #e3dcc6;
  margin-bottom: 4px;
}
.signin-picker-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.signin-picker-sub {
  font-size: 11.5px;
  color: #6b6a62;
  line-height: 1.4;
}
/* Mirror Google's outline-theme rendered button: white background, light
 * gray border, 4px radius, ~40px tall, system font in Google's text color.
 * Keeps the two providers visually consistent inside the cream picker. */
.signin-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;          /* Google's Roboto button text color */
  background: #fff;
  border: 1px solid #dadce0; /* Google's outline button border */
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.01em;
  transition: background 120ms ease, border-color 120ms ease;
}
.signin-picker-option:hover {
  background: #f8f9fa;     /* Google's hover state */
  border-color: #c6c8ca;
}
.signin-picker-option:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
}
.signin-picker-option svg {
  flex-shrink: 0;
}

/* Inline replacement for the GSI button slot when the Google Identity
 * Services library is blocked by content blockers / strict tracking
 * protection. Kept visually calm (no red warning styling) so a user who
 * only wants Microsoft isn't alarmed. */
.signin-picker-notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e6e5df;
  border-radius: 6px;
  background: #faf9f4;
  margin: 4px 0 2px;
}
.signin-picker-notice-body {
  font-size: 12px;
  line-height: 1.45;
  color: #4a4a44;
}
.signin-picker-fallback {
  text-decoration: none;   /* it's rendered as an <a>, not a <button> */
  color: #202124;
}

/* The auth-area needs `position: relative` so the picker positions
 * relative to it instead of jumping to the document root. */
.auth-area {
  position: relative;
}

.hamburger {
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #1a1a1a;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.hamburger:hover span { opacity: 1; }

.hamburger-menu {
  position: absolute;
  top: 38px;
  right: 0;
  min-width: 220px;
  background: #efeadb;
  border: 1px solid #c8c2b0;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
}
.hamburger-menu a {
  color: #1a1a1a;
  text-decoration: none;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 15px;
}
.hamburger-menu a:hover {
  background: #e3dcc6;
}

.brand-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.brand-link:hover {
  text-decoration: none;
}
.brand-logo {
  height: 56px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}

/* ---------- About page ---------- */

.about-page {
  max-width: 680px;
  margin: 20px auto 60px;
  padding: 0 8px;
}

.about-headline {
  font-size: 28px;
  font-weight: normal;
  margin-bottom: 28px;
  border-bottom: 1px solid #b8b2a0;
  padding-bottom: 14px;
}

.about-lead {
  font-size: 22px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.about-body {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 20px;
  opacity: 0.85;
}

/* ---------- Legal pages (Terms, Privacy) ---------- */
/* Denser than .about-page since these documents are long and reference-
 * style. Same editorial cream feel as the rest of the site. */

.legal-page {
  max-width: 760px;
  margin: 20px auto 60px;
  padding: 0 8px;
}

.legal-headline {
  font-size: 28px;
  font-weight: normal;
  margin-bottom: 4px;
}

.legal-effective {
  font-size: 13px;
  font-style: italic;
  opacity: 0.6;
  margin-bottom: 28px;
  border-bottom: 1px solid #b8b2a0;
  padding-bottom: 14px;
}

.legal-h3 {
  font-size: 17px;
  font-weight: normal;
  margin-top: 32px;
  margin-bottom: 10px;
  border-bottom: 1px solid #d0cab8;
  padding-bottom: 4px;
}

.legal-h4 {
  font-size: 14px;
  font-weight: normal;
  font-style: italic;
  margin-top: 18px;
  margin-bottom: 6px;
  opacity: 0.75;
}

.legal-body {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 14px;
  opacity: 0.88;
}

.legal-list {
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 14px 22px;
  padding: 0;
  opacity: 0.88;
}
.legal-list li {
  margin-bottom: 6px;
}

.legal-footnote {
  font-size: 13px;
  font-style: italic;
  opacity: 0.6;
  margin-top: 40px;
  border-top: 1px solid #d0cab8;
  padding-top: 14px;
}

/* ---------- Insights (long-form research posts) ---------- */

.insights-hub,
.insight-post {
  max-width: 820px;
  margin: 20px auto 60px;
  padding: 0 8px;
}

.insight-card {
  background: #efeadb;
  border: 1px solid #d0cab8;
  padding: 20px 24px;
  margin-bottom: 18px;
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

/* Thumbnail block on the index card — fixed-width on desktop, full-width on
 * mobile (stacked layout via the @media block below). Sized to roughly the
 * chart's aspect ratio (the source PNG is ~1758×1205, so width-driven height
 * lands around 165–180px at the 240px width below). */
.insight-thumb {
  flex: 0 0 240px;
  display: block;
  border: 1px solid #d0cab8;
  background: #FBF8EE;
  overflow: hidden;
  line-height: 0;
}
.insight-thumb img {
  display: block;
  width: 100%;
  height: auto;
}
.insight-thumb:hover {
  border-color: #8c887e;
}

/* Card text column — flex:1 so it absorbs the remaining row width, plus
 * min-width:0 so long words / inline links don't push the column past the
 * thumb's flex-basis on narrow screens. */
.insight-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 640px) {
  .insight-card {
    flex-direction: column;
  }
  .insight-thumb {
    flex: 0 0 auto;
    width: 100%;
  }
}

.insight-date {
  font-size: 12px;
  font-style: italic;
  opacity: 0.6;
  letter-spacing: 0.04em;
  margin: 0 0 6px 0;
}

.insight-title {
  font-size: 18px;
  font-weight: normal;
  margin: 0 0 10px 0;
  line-height: 1.35;
}
.insight-title a {
  color: #1a1a1a;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.insight-title a:hover {
  border-bottom-color: #1a1a1a;
}

.insight-summary {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px 0;
  opacity: 0.85;
}

.insight-body {
  font-size: 16px;
  line-height: 1.7;
}
.insight-body h2 {
  font-size: 20px;
  font-weight: normal;
  margin-top: 36px;
  margin-bottom: 12px;
  border-bottom: 1px solid #d0cab8;
  padding-bottom: 6px;
}
.insight-body h3 {
  font-size: 17px;
  font-weight: normal;
  font-style: italic;
  margin-top: 24px;
  margin-bottom: 8px;
}
.insight-body p {
  margin-bottom: 18px;
  opacity: 0.92;
}
.insight-body ul, .insight-body ol {
  margin: 0 0 18px 22px;
}
.insight-body li { margin: 4px 0; }
.insight-body a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-style: dotted;
}
.insight-body code {
  background: #ece6d3;
  border: 1px solid #d0cab8;
  padding: 1px 5px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
}
.insight-body hr {
  border: 0;
  border-top: 1px solid #d0cab8;
  margin: 36px 0;
}

/* Blockquote rendered as a "callout card" so quick-takeaways, executive
 * summaries, and editor's notes visually separate from the body prose.
 * Markdown blockquotes (lines starting with ">") in article bodies render
 * here. Distinct background + left accent rail + tighter typography so the
 * card reads as a separate object, not just an indent. Bullets inside the
 * blockquote stay normal-bulleted. */
.insight-body blockquote {
  margin: 22px 0;
  padding: 16px 20px;
  background: #f3eedf;
  border-left: 4px solid #2a8a85;
  border-radius: 6px;
  color: #1a1a1a;
}
.insight-body blockquote > p {
  margin: 0 0 12px;
  opacity: 1;
}
.insight-body blockquote > p:first-child {
  font-size: 15px;
  font-weight: 600;
}
.insight-body blockquote > p:last-child {
  margin-bottom: 0;
}
.insight-body blockquote ul,
.insight-body blockquote ol {
  margin: 8px 0 0 22px;
}
.insight-body blockquote li {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.55;
}
.insight-body blockquote a {
  color: #1a1a1a;
}

/* Methodology / footnote — last italicized paragraph of the body */
.insight-body p:last-child em,
.insight-body em:last-child {
  font-size: 13px;
  opacity: 0.7;
  line-height: 1.6;
}

/* Inline interactive chart iframe — embedded via insights.py */
.insight-chart {
  margin: 28px 0;
  padding: 0;
}
.insight-chart iframe {
  width: 100%;
  height: 860px;
  border: 1px solid #d0cab8;
  background: #FBF8EE;
  display: block;
}

@media (max-width: 900px) {
  .insight-chart iframe { height: 640px; }
}
@media (max-width: 640px) {
  .insight-chart iframe { height: 520px; }
}

/* ---------- User Guide page ---------- */

.userguide-container {
  max-width: 1080px;
}

.userguide-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  margin-top: 16px;
  align-items: start;
}

.userguide-sidebar {
  position: sticky;
  top: 24px;
  border-right: 1px solid #c8c2b0;
  padding-right: 18px;
  /* Let the sidebar scroll independently of the main pane when its
     contents exceed the viewport (e.g. Scoring Models expanded). Without
     max-height + overflow-y, the sticky sidebar just extends past the
     viewport and the user has to scroll the whole page to reach items
     below the fold. */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.ug-section {
  margin-bottom: 22px;
}

.ug-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 18px;
}
.ug-section-title::after {
  content: "\25B8";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transition: transform 0.15s ease;
  font-size: 10px;
  opacity: 0.8;
}
.ug-section-title:hover {
  opacity: 0.85;
}
.ug-section.collapsed .ug-section-title {
  margin-bottom: 0;
}
.ug-section.collapsed .ug-section-title::after {
  transform: translateY(-50%) rotate(0deg);
}
.ug-section.collapsed .ug-list {
  display: none;
}

.ug-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ug-item {
  font-size: 14px;
  padding: 4px 0;
  line-height: 1.4;
}

.ug-item a {
  color: #1a1a1a;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.ug-item a:hover {
  border-bottom: 1px dotted #1a1a1a;
}

.ug-item.disabled {
  color: #a8a39a;
  cursor: default;
}

/* Sub-headings inside a sidebar section (e.g., "Origination" / "Performance"
 * groupings under "Scoring Models"). Not links — just visual grouping. */
.ug-subhead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  padding: 8px 0 2px 0;
  list-style: none;
  font-style: italic;
}
.ug-subhead:first-child {
  padding-top: 0;
}

.userguide-content {
  max-width: 700px;
}

.ug-h {
  font-weight: normal;
  margin-top: 24px;
}

h2.ug-h { font-size: 26px; margin-top: 0; margin-bottom: 12px; }
h3.ug-h { font-size: 18px; margin-top: 32px; margin-bottom: 6px; opacity: 0.85; }

.ug-lead {
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.ug-meta {
  font-size: 13px;
  font-style: italic;
  opacity: 0.6;
  margin-bottom: 18px;
}

.ug-card {
  background: #efeadb;
  border: 1px solid #d0cab8;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.ug-card h4 {
  font-size: 15px;
  font-weight: normal;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #d0cab8;
  padding-bottom: 8px;
}

.ug-card-date {
  font-size: 12px;
  font-style: italic;
  opacity: 0.55;
  margin: -4px 0 10px 0;
  letter-spacing: 0.04em;
}

.ug-card p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
  opacity: 0.85;
}

/* In-content lists inside article cards.
 * The .ug-list class is shared with the sidebar where `list-style: none`
 * (set in the base rule) is correct, so we re-add disc bullets and proper
 * padding only inside .ug-card. We also pin the <li> font-size and
 * line-height to match the surrounding <p> so the content reads as one
 * typographic stream rather than mixing browser-default 16px <li> text
 * with the 14px paragraph text. */
.ug-card .ug-list {
  list-style: disc;
  padding-left: 22px;
  margin: 8px 0 12px;
}
.ug-card .ug-list li {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 6px;
  opacity: 0.85;
}
.ug-card .ug-list li:last-child {
  margin-bottom: 0;
}

.ug-link {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.ug-code {
  background: #ece6d3;
  border: 1px solid #d0cab8;
  padding: 10px 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  margin: 8px 0;
}

/* ----- Use-case landing + prompt response pages ------------------------- */
.ug-prompt-text {
  font-style: italic;
  font-size: 14px;
  color: #2a2a2a;
  margin-bottom: 6px;
}
.ug-prompt-preview {
  font-size: 13px;
  opacity: 0.78;
  line-height: 1.55;
}
.ug-prompt-block {
  background: #efeadb;
  border-left: 3px solid #b8a86b;
  padding: 14px 18px;
  margin: 12px 0 28px 0;
}
.ug-prompt-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: 6px;
}
.ug-prompt-quote {
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
  margin: 0 0 10px 0;
}
.ug-response {
  margin: 24px 0;
}
.ug-response p,
.ug-response ul,
.ug-response ol {
  font-size: 14px;
  line-height: 1.65;
}
.ug-response ul, .ug-response ol { padding-left: 22px; margin: 10px 0; }
.ug-response li { margin: 4px 0; }
.ug-response code {
  background: #ece6d3;
  border: 1px solid #d0cab8;
  padding: 1px 5px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
}
.ug-data-table {
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
  width: 100%;
}
.ug-data-table th, .ug-data-table td {
  border: 1px solid #d0cab8;
  padding: 6px 10px;
  text-align: left;
}
.ug-data-table th {
  background: #ece6d3;
  font-weight: normal;
  letter-spacing: 0.02em;
}
.ug-followups {
  background: #f4f0e3;
  border: 1px solid #d8d2bd;
  padding: 14px 20px;
  margin-top: 28px;
}
.ug-followups h3 { margin-top: 0; }
.ug-followups .ug-list { padding-left: 18px; list-style: disc; }
.ug-followups .ug-item { font-size: 14px; padding: 5px 0; }

header h1 {
  font-size: 32px;
  font-weight: normal;
  letter-spacing: -0.01em;
}

header h1 .tm {
  font-size: 0.4em;
  vertical-align: super;
  margin-left: 3px;
  opacity: 0.7;
  letter-spacing: 0;
}

header .subtitle {
  font-style: italic;
  opacity: 0.65;
  margin-top: 4px;
}

/* ---------- Prompt input (rounded-rect notebook with send-button
 *            overlapping the right edge) ---------- */

.prompt-area {
  margin: 48px auto 8px;
  max-width: 880px;
  width: 100%;
  /* 36px side padding leaves room for the overhanging send button */
  padding: 0 36px;
  position: relative;
  box-sizing: border-box;
}

.prompt {
  position: relative;
  background: #FBF8EE;
  border: 1px solid #d0cab8;
  border-radius: 30px;
  padding: 22px 78px 22px 38px;       /* right padding leaves room for send button overlap */
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prompt:focus-within {
  border-color: #8c887e;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.08);
}

#question {
  width: 100%;
  background: transparent;
  color: #1a1a1a;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.55;
  resize: none;
  min-height: 56px;
  max-height: 260px;
  padding: 0;
  overflow-y: auto;
  box-sizing: border-box;
  display: block;
}

#question::placeholder {
  color: #9e9a8e;
  font-style: normal;
}

/* Send button — solid dark circle overlapping the right edge of the input,
 * vertically centered. The arrow points right (chevron) per the OE pattern. */
#submit-btn {
  position: absolute;
  top: 50%;
  right: -24px;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: #1a1a1a;
  color: #F7F4EB;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  transition: background 0.15s ease, transform 0.05s ease;
  padding: 0;
  z-index: 2;
}

#submit-btn:hover {
  background: #2a2a2a;
}

#submit-btn:active {
  transform: translateY(-50%) translateY(1px);
}

#submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#submit-btn svg {
  display: block;
}

.hint {
  font-size: 12px;
  opacity: 0.55;
  font-style: italic;
  margin-top: 10px;
  text-align: center;
}

.hint kbd {
  border: 1px solid #8c887e;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 13px;
  font-style: normal;
}

.hint-arrow {
  font-style: normal;
  display: inline-block;
  border: 1px solid #8c887e;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  font-size: 13px;
  vertical-align: -3px;
}

.hint-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  font-style: italic;
}

.hint-link:hover {
  opacity: 0.85;
}

/* ---------- Quick-start chips (OpenEvidence-style discovery row) ---------
 * Sits below the prompt rectangle's .hint line. Each chip toggles a panel
 * of 2-3 suggested prompts; clicking a suggestion auto-fills the textarea
 * and runs it (wired in app.js). The expansion panel is a sibling sitting
 * directly below the chip row so its visual anchor reads cleanly. */

.quick-starts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #efeadb;
  border: 1px solid #d0cab8;
  border-radius: 999px;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.quick-chip:hover {
  background: #e3dcc6;
  border-color: #8c887e;
}

.quick-chip:active {
  transform: translateY(1px);
}

.quick-chip[aria-expanded="true"] {
  background: #1a1a1a;
  color: #FBF8EE;
  border-color: #1a1a1a;
}

.quick-chip .qs-icon {
  flex: 0 0 auto;
  color: currentColor;
}

.quick-start-panel {
  margin-top: 14px;
  background: #FBF8EE;
  border: 1px solid #d0cab8;
  border-radius: 14px;
  padding: 10px 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-start-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 4px;
  font-size: 13px;
  font-style: italic;
  opacity: 0.7;
}

.quick-start-panel-close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.6;
}

.quick-start-panel-close:hover {
  opacity: 1;
}

.qs-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.qs-suggestion:hover {
  background: #efeadb;
  border-color: #d0cab8;
}

.qs-suggestion-arrow {
  flex: 0 0 auto;
  opacity: 0.55;
}

.qs-suggestion:hover .qs-suggestion-arrow {
  opacity: 1;
}

@media (max-width: 640px) {
  .quick-starts {
    gap: 8px;
  }
  .quick-chip {
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* ===== Explore-additional-capabilities disclosure ===========================
   A <details>/<summary> below the quick-start chips. Click the summary to
   reveal a grid of capability cards, each with 2-3 clickable query buttons.
   Uses the same palette + button styling as .qs-suggestion for consistency.
   The trigger is centered horizontally below the chips; the panel below
   resets to left-aligned text so card contents read normally.
   ============================================================================ */

/* ============================================================================
   Rate-limit modal — shown to anonymous users when they exhaust their daily
   cap on /api/query. Replaces the older always-visible "Why sign in?"
   callout so the value-prop messaging only appears when actually relevant.
   app.js triggers it via showRateLimitModal({title, body}) on a 429
   response from an anonymous user.
   ============================================================================ */
.rate-limit-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.rate-limit-modal[hidden],
.rate-limit-modal.hidden { display: none; }

.rate-limit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 12, 0.55);
}

.rate-limit-modal-card {
  position: relative;
  background: #FBF8EE;
  border: 1px solid #d0cab8;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 460px;
  padding: 28px 28px 22px;
  text-align: center;
}

.rate-limit-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #6b6a62;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}
.rate-limit-modal-close:hover {
  background: #efeadb;
  color: #1a1a1a;
}

.rate-limit-modal-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 12px;
}

.rate-limit-modal-title {
  font-size: 19px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 12px;
  line-height: 1.3;
}

.rate-limit-modal-body {
  font-size: 14px;
  line-height: 1.55;
  color: #2a2a2a;
  margin: 0 0 20px;
}
.rate-limit-modal-body strong {
  color: #1a1a1a;
  font-weight: 600;
}

.rate-limit-modal-cta {
  display: block;
  width: 100%;
  background: #1a1a1a;
  color: #FBF8EE;
  border: none;
  border-radius: 6px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
  margin-bottom: 8px;
}
.rate-limit-modal-cta:hover { background: #2a2a2a; }

.rate-limit-modal-secondary {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #6b6a62;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
}
.rate-limit-modal-secondary:hover { background: #efeadb; color: #1a1a1a; }

.explore-more {
  margin-top: 18px;
  text-align: center;
}

.explore-more-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: inherit;
  color: #4a4538;
  background: transparent;
  border-radius: 8px;
  user-select: none;
  list-style: none;        /* hide the native triangle marker (Chrome / Safari) */
  transition: background 0.12s ease, color 0.12s ease;
}
.explore-more-trigger::-webkit-details-marker { display: none; }
.explore-more-trigger::marker                  { display: none; }

.explore-more-trigger:hover {
  background: #efeadb;
  color: #1a1a1a;
}

.explore-more-label {
  font-weight: 500;
}

.explore-more-chevron {
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}

.explore-more[open] .explore-more-chevron {
  transform: rotate(180deg);
}

.explore-more-panel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Parent <details>.explore-more is text-align: center to center the
     trigger; reset to left here so card contents read normally. */
  text-align: left;
}

.explore-more-card {
  background: #FBF8EE;
  border: 1px solid #d0cab8;
  border-radius: 14px;
  padding: 12px 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.explore-more-card-title {
  margin: 0 0 6px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.explore-more-card-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #6b6656;
}

.explore-more-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  width: 100%;
  transition: background 0.12s ease, border-color 0.12s ease;
}

/* Force the label span to take the remaining space and wrap cleanly on
   narrow viewports. Without `min-width: 0`, long single-word lines (or
   non-breaking strings) can blow out the flex layout and push the arrow
   off-screen on mobile. */
.explore-more-suggestion > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.explore-more-suggestion:hover {
  background: #efeadb;
  border-color: #d0cab8;
}

.explore-more-suggestion .qs-suggestion-arrow {
  flex: 0 0 auto;
  opacity: 0.55;
}

.explore-more-suggestion:hover .qs-suggestion-arrow {
  opacity: 1;
}

/* Mobile tier 1 (phones in landscape, small tablets) — tighten typography
   and padding to reclaim horizontal space for the long query text. */
@media (max-width: 640px) {
  .explore-more-card-title { font-size: 13px; padding: 0 12px; }
  .explore-more-suggestion { font-size: 13px; padding: 10px 12px; gap: 8px; }
  .explore-more-trigger    { font-size: 13px; padding: 6px 8px; }
}

/* Mobile tier 2 (narrow phones, <=380px) — reduce card padding further so
   the cards don't feel cramped, and let the trigger label wrap if needed. */
@media (max-width: 380px) {
  .explore-more-card       { padding: 10px 4px; border-radius: 12px; }
  .explore-more-card-title { font-size: 12.5px; padding: 0 10px; }
  .explore-more-suggestion { padding: 9px 10px; }
  .explore-more-trigger    {
    /* Allow the chevron to drop below the label if a very narrow viewport
       can't fit both on one line. Avoids horizontal scroll. */
    flex-wrap: wrap;
    justify-content: center;
  }
}

.conv-indicator {
  font-style: normal;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid #8c887e;
  border-radius: 10px;
  font-size: 11px;
  opacity: 0.75;
}

/* When the indicator carries an actual context state, give it more weight
 * so users can see at a glance "I am in a conversation" rather than "fresh
 * start". The base style (above) handles the empty / hidden state. */
.conv-indicator.has-context {
  border-color: #4a6b7a;
  background: #e8eff2;
  color: #1f3a44;
  opacity: 1;
  font-weight: 500;
}

/* "Click again to confirm" inline confirmation state on the new-conversation
 * link. The link text gets swapped from "new conversation" to a confirm
 * prompt for ~3s, with a distinct color so the change is obvious. */
.hint-link.confirm-pending {
  color: #a14b1c;
  font-weight: 600;
}

/* ---------- Conversation thread — prior turns ---------- */

/* Container for the stack of collapsed prior-turn cards. Sits between the
 * question input and the active results section. */
.prior-turns {
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: #F7F4EB;
  border: 1px solid #d0cab8;
  border-radius: 8px;
}
.prior-turns.hidden { display: none; }

.prior-turns-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b6a62;
  margin-bottom: 8px;
  font-weight: 600;
}

/* One card per prior turn. Click to expand the summary. */
.prior-turn {
  background: #FBF8EE;
  border: 1px solid #e3dcc6;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.prior-turn:last-child { margin-bottom: 0; }
.prior-turn:hover {
  border-color: #b8b09a;
  background: #fdfaf2;
}

/* The prior turn's question text — always visible, never clipped. */
.prior-turn-question {
  font-size: 13.5px;
  line-height: 1.4;
  color: #1a1a1a;
  font-weight: 500;
  margin-bottom: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.prior-turn-question::before {
  content: "↳";
  color: #8c887e;
  font-weight: 400;
  flex-shrink: 0;
}

/* The summary excerpt — clipped to a couple of lines by default, expands
 * to the full summary text when the card is in .expanded state. */
.prior-turn-summary {
  font-size: 13px;
  line-height: 1.5;
  color: #4a4a4a;
  margin-left: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prior-turn.expanded .prior-turn-summary {
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* Subtle "click to expand / collapse" affordance in the corner. */
.prior-turn-toggle {
  font-size: 10px;
  color: #8c887e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
  margin-left: 18px;
  font-weight: 600;
}

/* ---------- Repurchase-risk scoring panel ---------- */

.scoring-panel { margin-top: 18px; }

.meta-tag {
  font-size: 12px;
  opacity: 0.55;
  font-style: italic;
  margin-left: 8px;
}

.scoring-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #c8c2b0;
}

.scoring-blurb {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 10px;
  line-height: 1.5;
}

#scoring-input {
  width: 100%;
  background: #ece6d3;
  color: #1a1a1a;
  border: 1px solid #b8b2a0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  padding: 8px;
  resize: vertical;
}

.scoring-model-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px 0;
  font-size: 14px;
}

.scoring-model-row select {
  background: #ece6d3;
  color: #1a1a1a;
  border: 1px solid #8c887e;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 14px;
}

.scoring-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#scoring-submit {
  background: #1a1a1a;
  color: #F7F4EB;
  border: none;
  padding: 6px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}

#scoring-submit:hover { opacity: 0.85; }
#scoring-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.scoring-status {
  font-style: italic;
  opacity: 0.7;
  font-size: 13px;
}

.scoring-result {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #b8b2a0;
  background: #efeadb;
}

.score-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.score-headline-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-value {
  font-size: 28px;
  font-weight: bold;
}

.score-headline-label {
  font-size: 12px;
  opacity: 0.65;
  font-style: italic;
}

.score-band {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid;
}

/* Risk-band colors darkened for readability on the cream background. */
.band-p99  { color: #b03a3a; border-color: #b03a3a; background: rgba(176, 58, 58, 0.10); }
.band-p95  { color: #b06820; border-color: #b06820; background: rgba(176, 104, 32, 0.10); }
.band-p90  { color: #8a6a10; border-color: #8a6a10; background: rgba(138, 106, 16, 0.10); }
.band-base { color: #2f7a3a; border-color: #2f7a3a; background: rgba(47, 122, 58, 0.10); }

.score-recommendation {
  font-size: 14px;
  margin-bottom: 8px;
}

.score-meta {
  font-size: 12px;
  opacity: 0.6;
  line-height: 1.5;
}

/* ---------- Reliability diagram ---------- */

.reliability-block {
  margin-top: 18px;
  border-top: 1px solid #c8c2b0;
  padding-top: 10px;
}

.reliability-canvas-wrap {
  position: relative;
  height: 400px;
  margin: 10px 0 16px;
  background: #ffffff;
  border: 1px solid #d0cab8;
  padding: 8px;
}

.reliability-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}

.reliability-table th, .reliability-table td {
  border-bottom: 1px solid #d0cab8;
  padding: 6px 10px;
  text-align: right;
}

.reliability-table th:first-child, .reliability-table td:first-child {
  text-align: left;
}

.reliability-table thead th {
  background: #efeadb;
  font-weight: normal;
  font-style: italic;
  opacity: 0.85;
}

.status {
  font-style: italic;
  opacity: 0.7;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #1a1a1a;
  border-radius: 50%;
  animation: status-pulse 1.4s ease-in-out infinite;
  opacity: 0.6;
}
@keyframes status-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.9); }
  50%      { opacity: 1.0;  transform: scale(1.1); }
}

/* ---------- Tabbed result panel ---------- */

.tab-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid #b8b2a0;
  margin-top: 10px;
}

.tab-strip {
  display: flex;
  gap: 0;
}

.tab {
  background: transparent;
  color: #6e6a62;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: #1a1a1a; }
.tab.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

.tab-meta {
  opacity: 0.55;
  font-size: 12px;
  font-style: italic;
  margin-left: 4px;
}

.tab-actions {
  padding-bottom: 6px;
}

.csv-btn {
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #8c887e;
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.csv-btn:hover {
  border-color: #1a1a1a;
  background: #e3dcc6;
}

.tab-panel {
  padding-top: 14px;
}

/* ---------- Copy-summary button ---------- */

#panel-summary {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 14px;
  right: 0;
  background: transparent;
  color: #6e6a62;
  border: 1px solid transparent;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.copy-btn:hover {
  color: #1a1a1a;
  border-color: #8c887e;
  background: #e3dcc6;
}

.copy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.copy-btn.copied {
  color: #2f7a3a;
  border-color: transparent;
}

.copy-btn svg { display: block; }

/* Push the summary text away from the button so they don't overlap. */
#panel-summary .explanation {
  padding-right: 40px;
}

.table-meta {
  font-size: 13px;
  font-style: italic;
  opacity: 0.6;
  margin-bottom: 10px;
}

.status::after {
  content: '';
  display: inline-block;
  width: 6px;
  margin-left: 4px;
  animation: dots 1.4s infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

.error {
  color: #b03a3a;
  border: 1px solid #b03a3a;
  padding: 12px 16px;
  font-style: italic;
  background: rgba(176, 58, 58, 0.06);
}

.hidden { display: none !important; }

.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.55;
}

.result-block {
  border-top: 1px solid #d0cab8;
  padding-top: 18px;
}

.result-block .section-label { margin-bottom: 10px; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.explanation {
  font-size: 17px;
  line-height: 1.6;
}
.explanation p {
  margin: 0 0 12px 0;
}
.explanation p:last-child {
  margin-bottom: 0;
}
.explanation ul {
  margin: 4px 0 12px 0;
  padding-left: 24px;
}
.explanation li {
  margin: 2px 0;
}
.explanation strong {
  font-weight: 600;
}
.explanation em {
  font-style: italic;
}
.explanation hr {
  border: 0;
  border-top: 1px solid #d0cab8;
  margin: 16px 0;
}

/* Markdown pipe-tables rendered inline in the summary explanation
 * (e.g., the Fannie-vs-Freddie channel-choice comparison). */
.explanation-table {
  border-collapse: collapse;
  margin: 8px 0 14px 0;
  font-size: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}
.explanation-table th,
.explanation-table td {
  border: 1px solid #d0cab8;
  padding: 7px 11px;
  text-align: left;
  white-space: nowrap;
}
.explanation-table th {
  background: #ece6d3;
  font-weight: 600;
}
.explanation-table tbody tr:nth-child(even) td {
  background: #fbf8ee;
}

.validation-badge {
  margin-top: 12px;
  font-size: 13px;
  font-style: italic;
}

.validation-badge .badge-ok {
  color: #2f7a3a;
  opacity: 0.95;
}

.validation-badge .badge-warn {
  color: #b06820;
  opacity: 0.95;
}

.validation-issues {
  list-style: disc;
  padding-left: 20px;
  margin: 6px 0 0 0;
  font-size: 12px;
  font-style: normal;
  opacity: 0.75;
  color: #1a1a1a;
}

.validation-issues li {
  margin-bottom: 4px;
  line-height: 1.45;
}

#sql {
  background: #ece6d3;
  border: 1px solid #d0cab8;
  padding: 12px 14px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-x: auto;
  line-height: 1.45;
}

.result-actions { display: flex; gap: 6px; }

.result-actions button,
.link-btn {
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #8c887e;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.result-actions button:hover,
.link-btn:hover { background: #e3dcc6; }

.result-actions button.active {
  background: #1a1a1a;
  color: #F7F4EB;
  border-color: #1a1a1a;
}

.link-btn {
  border: none;
  font-style: italic;
  opacity: 0.55;
  font-size: 13px;
  padding: 0;
}

.link-btn:hover { background: transparent; opacity: 0.9; }

#table-container { overflow-x: auto; max-width: 100%; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  border: 1px solid #d0cab8;
  padding: 7px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #efeadb;
  font-weight: bold;
  white-space: nowrap;
}

tbody tr:nth-child(even) { background: #efeadb; }

td .null { opacity: 0.4; font-style: italic; }

#chart-wrap {
  background: #FBF8EE;
  padding: 16px;
  margin-top: 8px;
  border: 1px solid #d0cab8;
}

#chart-wrap canvas {
  max-height: 480px;
}

#follow-ups {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
}

.follow-up-chip {
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #8c887e;
  padding: 8px 16px;
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  font-style: italic;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  opacity: 0.85;
  transition: background 0.1s, color 0.1s, opacity 0.1s, border-color 0.1s;
}

.follow-up-chip:hover {
  background: #1a1a1a;
  color: #F7F4EB;
  border-color: #1a1a1a;
  opacity: 1;
}

/* Multi-select picker returned with result_type=score_clarification.
   Occupies the follow-ups strip and provides checkboxes + a submit button
   so the user can pick one or more scoring models rather than us guessing. */
.score-picker { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.score-picker-list { display: flex; flex-direction: column; gap: 6px; }
.score-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.score-choice:hover { background: rgba(26,26,26,0.04); border-color: #d0cab8; }
.score-choice input[type=checkbox] {
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: 4px;
  cursor: pointer;
}
.score-choice-label { font-weight: 600; font-size: 15px; color: #1a1a1a; }
.score-choice-desc { font-size: 13px; opacity: 0.7; line-height: 1.4; }
.score-picker-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid #e3dcc6;
}
.score-picker-submit {
  background: #1a1a1a;
  color: #F7F4EB;
  border: 1px solid #1a1a1a;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.1s;
}
.score-picker-submit:disabled { opacity: 0.35; cursor: not-allowed; }
.score-picker-count { font-size: 13px; opacity: 0.65; }

.history-panel {
  border-top: 1px solid #d0cab8;
  padding-top: 18px;
  margin-top: 8px;
}

#history-list { list-style: none; margin-top: 8px; }

#history-list li {
  padding: 6px 0;
  border-bottom: 1px solid #e3dcc6;
  cursor: pointer;
  opacity: 0.75;
  font-size: 15px;
}

#history-list li:hover { opacity: 1; }

#history-list li.empty {
  cursor: default;
  opacity: 0.4;
  font-style: italic;
}

#history-list li.history-toggle {
  cursor: pointer;
  font-style: italic;
  opacity: 0.55;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 10px 0 4px;
  border-bottom: none;
  border-top: 1px solid #d8d3c4;
  margin-top: 4px;
}

#history-list li.history-toggle:hover {
  opacity: 0.9;
}

.site-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid #d0cab8;
  text-align: center;
  font-size: 12px;
  opacity: 0.5;
  font-style: italic;
}

.site-footer p {
  margin: 0;
}

/* Wayfinding row in the site footer — sits above the legal/copyright line
   and mirrors the hamburger nav so users landing on a deep page (e.g. an
   Insights article via a shared link) can jump anywhere without hunting
   for the top-right hamburger. Same muted italic tone as the legal row. */
.site-footer-nav {
  margin-bottom: 6px;
  line-height: 1.8;
}

/* Legacy footer styles below (kept in case any other page references them). */
footer {
  margin-top: 32px;
  font-size: 12px;
  opacity: 0.5;
  font-style: italic;
}

footer p {
  margin-top: 4px;
}

footer a {
  color: inherit;
  text-decoration: underline;
}

footer a:hover {
  opacity: 0.8;
}

.brand {
  text-align: left;
  margin-top: 24px;
  font-style: normal;
}

.brand-line {
  font-size: 13px;
  opacity: 0.85;
}

.brand-copyright {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
}

@media (max-width: 600px) {
  body { padding: 24px 16px 60px; }
  header h1 { font-size: 26px; }
  /* Tighten the prompt box on mobile — the desktop 22px vertical padding
     and 56px min-height eat too much of the viewport, especially when the
     user's text wraps to a second line (2026-08-01 iOS Safari feedback).
     Trim vertical padding + line-height + min-height for a snugger box
     that fits more visible content in the same real estate. */
  .prompt-area { padding: 0 20px; margin: 28px auto 8px; }
  .prompt { padding: 12px 60px 12px 20px; border-radius: 22px; }
  #question {
    font-size: 17px;
    line-height: 1.35;
    min-height: 40px;
  }
  #submit-btn {
    right: -18px;
    width: 44px;
    height: 44px;
  }
  /* Hide the "Enter to run · Shift+Enter for new line" hint on mobile —
     Shift+Enter isn't a real chord on touch keyboards, so the hint just
     wastes vertical space next to the prompt without offering usable
     guidance. Desktop keeps it. */
  .hint { display: none; }
}


/* =========================================================================
   Mobile responsiveness — applies to ALL pages, not just the home page.
   Layered into three breakpoints:
     - 900px : User Guide sidebar+content collapses to single column. The
               240px sticky sidebar otherwise squeezes the content area too
               narrow on tablets / landscape phones.
     - 640px : Data tables in Use Guide prompt responses, scoring panel
               form, and tab-strip get scroll/wrap treatment so wide content
               doesn't overflow the viewport.
     - 480px : Phone-portrait sizing — tighter page padding, smaller brand
               logo and headlines, narrower body padding.
   These compose with the existing 640/600px blocks above (insight-card,
   insight-chart, quick-chips, body padding on the home page).
   ========================================================================= */

@media (max-width: 900px) {
  /* User Guide grid → single column. Sidebar floats above content with a
   * horizontal divider instead of the desktop right-border separator. The
   * sticky-top behavior is dropped — on mobile the sidebar scrolls with
   * the page. */
  .userguide-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .userguide-sidebar {
    position: static;
    top: auto;
    border-right: none;
    border-bottom: 1px solid #c8c2b0;
    padding-right: 0;
    padding-bottom: 18px;
    /* Reset the desktop internal-scroll trick — on mobile the sidebar
       stacks above the content and scrolls with the page naturally, so
       we don't want a capped-height scrollable box. */
    max-height: none;
    overflow-y: visible;
  }
  .userguide-content {
    max-width: 100%;
  }
}

/* Desktop default: the mobile-only expand toggle is invisible. On mobile
 * viewports the max-width: 640px block below overrides this to display:block.
 * initMobileTabCollapse() in app.js is the JS half; it only injects the
 * button at page load when the viewport matches. */
.mobile-detail-toggle {
  display: none;
}

@media (max-width: 640px) {
  /* Mobile: one-button expand for Table / Chart / SQL panels. On desktop the
   * button is hidden (see the desktop rule above). See initMobileTabCollapse
   * in app.js for the JS side; on mobile the tab strip is hidden and this
   * button gates all three secondary panels together. */
  .mobile-detail-toggle {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin: 16px 0 4px;
    background: #f4f2e8;
    border: 1px solid #d0cab8;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    color: #333;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-detail-toggle:active {
    background: #ece9d8;
  }

  /* Use Guide prompt-response data tables — convert to horizontal-scroll
   * blocks. Without this, tables wider than the viewport overflow the
   * .userguide-content column and break the page. white-space: nowrap on
   * cells keeps row-data readable rather than wrapping inside cramped cells. */
  .ug-data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Scoring panel: form rows wrap, action buttons wrap below input. */
  .scoring-model-row,
  .scoring-actions {
    flex-wrap: wrap;
  }
  .scoring-model-row select {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Tab strip at the top of the results panel — allow it to scroll if the
   * tab labels don't all fit on one row. Tab actions (Download CSV) wrap
   * below the tab strip rather than spilling off-screen. */
  .tab-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tab-strip {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 100%;
  }

  /* Insights post body — tighter inner padding. */
  .insight-post {
    padding: 0 6px;
  }

  /* About / Terms / Privacy pages — same. */
  .about-page,
  .legal-page {
    padding: 0 6px;
  }
}

@media (max-width: 480px) {
  /* Phone-portrait tightening. Shrinks the page padding, brand logo, and
   * the headline sizes that would otherwise dominate a 375px viewport. */
  body {
    padding: 18px 12px 50px;
  }
  .brand-logo {
    height: 40px;
  }
  header h1 {
    font-size: 22px;
  }
  .about-headline,
  .legal-headline {
    font-size: 22px;
  }
  .about-lead {
    font-size: 18px;
  }
  .about-body {
    font-size: 16px;
  }
  h2.ug-h {
    font-size: 22px;
  }
  h3.ug-h {
    font-size: 16px;
  }
  /* Insights post H1 + body */
  .insight-body {
    font-size: 15px;
  }
  .insight-body h2 {
    font-size: 18px;
  }
  /* Quick-chip chips on the home page already wrap (rule in earlier block);
   * further tighten label font + padding for very narrow viewports. */
  .quick-chip {
    font-size: 12px;
    padding: 7px 12px;
  }
}

/* ============================================================================
   Chat history sidebar — Phase B.
   Fixed-position left panel listing the signed-in user's prior conversations.
   The .auth-signed-only class (toggled by site.js) keeps anonymous users
   from ever seeing it; the sidebar is hidden by default for everyone and
   site.js sets [hidden] = false only when authenticated.

   Layout pattern: when shown on wide screens, body.has-sidebar adds left
   padding so the centered .container shifts right to make room. On narrow
   screens (<= 900px), the sidebar becomes an overlay above content with a
   click-to-dismiss backdrop.
   ============================================================================ */

.chat-history-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #F0EBD7;
  border-right: 1px solid #d0cab8;
  display: flex;
  flex-direction: column;
  z-index: 150;
  transition: transform 220ms ease;
}
.chat-history-sidebar[hidden],
.chat-history-sidebar.collapsed { transform: translateX(-100%); }

/* When sidebar is shown on a wide screen, push body content right.
 * .has-sidebar is toggled on <body> by chat_history.js. */
body.has-sidebar {
  padding-left: 284px;   /* 260 sidebar + 24 breathing room */
  transition: padding-left 220ms ease;
}

/* Sidebar header — "New chat" CTA + close button */
.chat-history-header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e0d9c0;
  flex-shrink: 0;
}
.chat-history-new {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #1a1a1a;
  color: #FBF8EE;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.chat-history-new:hover { background: #2a2a2a; }
.chat-history-new svg { flex-shrink: 0; }
.chat-history-close {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #6b6a62;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 120ms ease, color 120ms ease;
}
.chat-history-close:hover { background: #e0d9c0; color: #1a1a1a; }

/* Scrollable conversation list */
.chat-history-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 8px 14px;
}
.chat-history-list::-webkit-scrollbar { width: 6px; }
.chat-history-list::-webkit-scrollbar-thumb { background: #d0cab8; border-radius: 3px; }

/* Date-group heading (Today / Yesterday / This week / etc.) */
.chat-history-group {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8c887e;
  padding: 14px 8px 4px;
  font-weight: 600;
}
.chat-history-group:first-child { padding-top: 8px; }

/* One row per conversation */
.chat-history-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease;
  position: relative;
}
.chat-history-item:hover { background: #e0d9c0; }
.chat-history-item.active { background: #d8d0b4; }
.chat-history-item.active .chat-history-item-title { font-weight: 600; }

.chat-history-item-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Title-edit inline input (replaces .chat-history-item-title when renaming) */
.chat-history-item-edit {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #1a1a1a;
  background: #FBF8EE;
  border: 1px solid #b8b09a;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
}

/* Hover-revealed action menu — rename, delete */
.chat-history-item-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}
.chat-history-item:hover .chat-history-item-actions,
.chat-history-item.menu-open .chat-history-item-actions {
  display: flex;
}
.chat-history-item-action {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6b6a62;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}
.chat-history-item-action:hover { background: #c9c2a8; color: #1a1a1a; }
.chat-history-item-action.confirm-pending {
  color: #a14b1c;
  font-weight: 600;
}

/* Empty state when the user has no saved conversations yet */
.chat-history-empty {
  padding: 14px 14px;
  font-size: 12.5px;
  color: #6b6a62;
  font-style: italic;
  line-height: 1.5;
}
.chat-history-empty.hidden { display: none; }

/* Mobile sidebar backdrop — semi-transparent overlay click-to-dismiss */
.chat-history-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 140;
  opacity: 1;
  transition: opacity 200ms ease;
}
.chat-history-backdrop.hidden { display: none; }

/* Sidebar-toggle button in the top nav — only visible when signed in.
 * Sits at the same vertical level as the hamburger. */
.chat-history-open {
  background: none;
  border: 1px solid #c8c2b0;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  transition: background 120ms ease;
}
.chat-history-open:hover { background: #efeadb; }
.chat-history-open[hidden] { display: none; }

/* Narrow viewport: sidebar becomes a full overlay, body doesn't shift */
@media (max-width: 900px) {
  body.has-sidebar { padding-left: 24px; }
  .chat-history-sidebar { width: 280px; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18); }
}

/* =========================================================================
 * App sidebar (Gemini-style) — vertical left rail, signed-in users only.
 * Three navigation items + a collapse/expand toggle. State persisted in
 * localStorage under 'mortgage-llm-sidebar-collapsed'. Coexists with the
 * legacy chat-history-sidebar (slated for removal in step 4).
 * ========================================================================= */

#app-sidebar.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: #efeadb;
  border-right: 1px solid #e3dcc6;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  transition: width 180ms ease;
  overflow: hidden;
}
#app-sidebar.app-sidebar[hidden] { display: none; }

/* Collapsed: 56px wide, icon-only. The labels stay in DOM (a11y) but
 * become visually hidden so the icon centers in the rail. */
#app-sidebar.app-sidebar.collapsed {
  width: 56px;
}

/* Top row: just the collapse toggle, right-aligned when expanded so the
 * label-area lines up below. Centered when collapsed. */
.app-sidebar-top {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 10px;
}
#app-sidebar.collapsed .app-sidebar-top {
  justify-content: center;
  padding: 0 0 10px;
}
.app-sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #1a1a1a;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
}
.app-sidebar-toggle:hover { background: #e3dcc6; }

/* Menu */
.app-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}
.app-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  padding: 10px 12px;
  border-radius: 6px;
  transition: background 120ms ease;
  /* In collapsed mode the icon centers; the label is hidden but kept
   * in the DOM so screen readers still announce it. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-sidebar-item:hover { background: #e3dcc6; }
.app-sidebar-item.active {
  background: #d8cfb0;
  font-weight: 600;
}
.app-sidebar-icon {
  flex-shrink: 0;
}
.app-sidebar-label {
  flex: 1;
  /* Fade label out smoothly when sidebar collapses. */
  transition: opacity 120ms ease;
}
#app-sidebar.collapsed .app-sidebar-label {
  opacity: 0;
  /* Width:0 so the item itself shrinks and the icon centers in the 56px rail. */
  width: 0;
  height: 0;
  overflow: hidden;
  position: absolute;
  left: -9999px;
}
#app-sidebar.collapsed .app-sidebar-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}

/* When the sidebar is visible the body shifts right so the centered
 * .container doesn't sit under the rail. Two body classes drive the
 * shift width so the transition stays in sync with the sidebar's. */
body.has-app-sidebar { padding-left: 264px; transition: padding-left 180ms ease; }
body.has-app-sidebar-collapsed { padding-left: 80px; transition: padding-left 180ms ease; }

/* Mobile: sidebar becomes an off-canvas overlay; defaults to collapsed
 * (slid off-screen) on narrow viewports so the main content gets full
 * width. The collapse toggle button repositions to sit just outside the
 * slid-off sidebar's right edge so the user can tap it to re-open.
 *
 * Desktop body-shift padding is suppressed at this breakpoint — the
 * sidebar floats over content rather than reflowing it. */
@media (max-width: 900px) {
  body.has-app-sidebar,
  body.has-app-sidebar-collapsed { padding-left: 24px; }
  #app-sidebar.app-sidebar {
    width: 280px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    transition: transform 200ms ease, width 180ms ease;
  }
  /* When collapsed on mobile: slide off-screen entirely. */
  #app-sidebar.app-sidebar.collapsed {
    width: 280px;
    transform: translateX(-100%);
    box-shadow: none;
  }
  /* Edge handle: a thin tab that stays visible at the left screen edge
   * even when the sidebar is slid off, so the user can re-open. The
   * collapse toggle button gets repositioned outside the sidebar's right
   * edge when collapsed, making it the persistent re-open affordance. */
  #app-sidebar.app-sidebar.collapsed .app-sidebar-top {
    position: absolute;
    top: 14px;
    right: -44px;
    padding: 0;
  }
  #app-sidebar.app-sidebar.collapsed .app-sidebar-toggle {
    background: #efeadb;
    border: 1px solid #e3dcc6;
    border-left: none;
    border-radius: 0 6px 6px 0;
    width: 38px;
    height: 38px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.08);
  }
}

/* =========================================================================
 * View router — the main pane shows one of three views (default / search-chats
 * / scoring). Default is shown initially; sidebar items toggle the others.
 * Only one view is visible at a time.
 * ========================================================================= */
.view { display: block; }
.view-hidden { display: none; }

.view-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

/* --- Search Chats view --- */
.search-chats-header {
  margin-bottom: 14px;
}
.search-chats-search {
  position: relative;
  margin-bottom: 24px;
}
.search-chats-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b6a62;
  pointer-events: none;
}
#search-chats-input {
  width: 100%;
  background: #fff;
  border: 1px solid #e3dcc6;
  border-radius: 8px;
  padding: 12px 14px 12px 42px;
  font-family: inherit;
  font-size: 15px;
  color: #1a1a1a;
  transition: border-color 120ms ease;
}
#search-chats-input:focus {
  outline: none;
  border-color: #2a8a85;
}
.search-chats-recent-label {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b6a62;
  margin-bottom: 10px;
}
.search-chats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-chats-empty {
  color: #6b6a62;
  padding: 14px;
  text-align: center;
  background: #efeadb;
  border-radius: 8px;
}

/* ===========================================================================
 * Gemini-style prompt flow (Session 3)
 *
 * view-default starts in the initial state with prompt at top followed by
 * chips + Additional Capabilities. After the first successful query the
 * .has-prompted class is added (see setPromptedState in app.js) and the
 * layout flips: chips + Additional Capabilities hide, the response renders
 * in the natural flow, and the prompt-area is pushed to the bottom of the
 * view via flex order.
 * =========================================================================== */

#view-default {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* When the sidebar switches to Search Chats / Loan-level scoring, view-default
 * is given .view-hidden. Without this rule, the ID-level specificity of
 * #view-default above would beat the class-level .view-hidden { display: none }
 * and the default view's chat + chips + Additional Capabilities would render
 * underneath the other views. Use a matching ID selector so specificity ties
 * cleanly resolve in favor of "hidden". */
#view-default.view-hidden {
  display: none;
}

/* Default order — matches the source order so the initial layout is
 * unchanged. Explicit values let .has-prompted reorder cleanly below.
 * The chat-transcript sits between explore-more and the status/error
 * messages, immediately above the active #results. */
#view-default > .prompt-area      { order: 1; }
#view-default > .quick-starts     { order: 2; }
#view-default > #quick-start-panel { order: 3; }
#view-default > .explore-more     { order: 4; }
#view-default > #chat-transcript  { order: 5; }
#view-default > #status           { order: 6; }
#view-default > #error            { order: 7; }
#view-default > #results          { order: 8; }

/* Prompted state: hide the discovery affordances and push the prompt to
 * the bottom of the view. Results sit above; the user's next question still
 * lands in the same input, just lower on the page.
 *
 * !important guards against any future per-element display rule that might
 * sneak in with higher specificity — these are layout-defining, not stylistic
 * tweaks, so they must win unconditionally. */
#view-default.has-prompted > .quick-starts,
#view-default.has-prompted > #quick-start-panel,
#view-default.has-prompted > .explore-more {
  display: none !important;
}
#view-default.has-prompted > .prompt-area {
  order: 100 !important;
}
#view-default.has-prompted {
  /* Reserve enough height so the prompt sits near the bottom of the viewport
   * even when the response is short. calc subtracts the header + nav stack
   * roughly. */
  min-height: calc(100vh - 200px);
}

/* ---------------------------------------------------------------------------
 * Chat transcript — scrollback of prior Q/A pairs above the active result.
 * Built client-side by snapshotCurrentTurnToTranscript() each time a new
 * query lands; cleared by chatThread.reset(). Hydrated from saved turns
 * when a user opens a chat from Search Chats.
 * --------------------------------------------------------------------------- */

.chat-transcript {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.transcript-turn {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid #d0cab8;
}

.transcript-turn:last-child {
  border-bottom: none;
}

.transcript-question,
.current-question {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: #1a1a1a;
  background: #efeadb;
  border-radius: 12px;
  padding: 12px 16px;
  align-self: flex-end;
  max-width: 80%;
  white-space: pre-wrap;
  word-break: break-word;
}

/* The current-question lives inside #results which isn't flex, so use
 * margin-left:auto instead of flex's align-self to right-align the bubble.
 * The bottom margin gives it breathing room above the tab bar. */
.current-question {
  margin-left: auto;
  margin-bottom: 14px;
  display: block;
  width: max-content;
  max-width: 80%;
}

@media (max-width: 900px) {
  .current-question {
    max-width: 92%;
    font-size: 15px;
    padding: 10px 14px;
  }
}

.transcript-summary.explanation {
  /* Inherit the .explanation styling (font-size, line-height, link/list
   * formatting) so the summary in a transcript entry reads identically to
   * the active summary panel. */
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
}

.transcript-disclosure {
  border: 1px solid #d0cab8;
  border-radius: 8px;
  background: #FBF8EE;
}

.transcript-disclosure > summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  color: #4a4a44;
  list-style: none;
  user-select: none;
}

.transcript-disclosure > summary::-webkit-details-marker {
  display: none;
}

.transcript-disclosure > summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.12s ease;
}

.transcript-disclosure[open] > summary::before {
  content: "▾ ";
}

.transcript-disclosure > summary:hover {
  background: #efeadb;
}

.transcript-data-wrap {
  padding: 0 12px 12px 12px;
  overflow-x: auto;
}

.transcript-data-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.transcript-data-wrap th,
.transcript-data-wrap td {
  padding: 6px 10px;
  border-bottom: 1px solid #efeadb;
  text-align: left;
}

.transcript-data-wrap th {
  background: #efeadb;
  font-weight: 500;
  font-size: 12px;
  color: #4a4a44;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.transcript-sql {
  margin: 0;
  padding: 12px;
  background: #f4f1e6;
  border-top: 1px solid #d0cab8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #1a1a1a;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .transcript-question {
    max-width: 92%;
    font-size: 15px;
    padding: 10px 14px;
  }
  .transcript-summary.explanation {
    font-size: 14px;
  }
}

/* ===========================================================================
 * Loan-Level Scoring page UX rebuild (Session 5a + 5b)
 *
 * The page now opens with an intro + Step 1 (pick a model with optgrouped
 * dropdown) + Step 2 (structured form for the schema the model expects) +
 * Step 3 (score button). Below: result card, "Why trust this?" disclosure,
 * "About these models" disclosure. The original JSON textarea is preserved
 * inside an Advanced disclosure for power users who want to paste a payload
 * directly.
 * =========================================================================== */

.scoring-intro {
  margin-bottom: 20px;
}
.scoring-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #1a1a1a;
}
.scoring-lede {
  font-size: 14px;
  line-height: 1.55;
  color: #4a4a44;
  margin: 0;
}

.scoring-step {
  margin-bottom: 20px;
}
.scoring-step-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6a62;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.scoring-select {
  width: 100%;
  max-width: 480px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #b8b2a0;
  border-radius: 6px;
  background: #FBF8EE;
}

/* Most browsers ignore styling on <optgroup> (color, font-weight don't
 * apply), so we use disabled <option> as fake section headers instead. The
 * .model-section-header class is on those headers; force them dark + bold so
 * they stand out from the real options when the dropdown is open. The
 * unicode "━━" rules in the option text are visible cues in browsers that
 * also flatten the CSS (Chrome on Mac in particular). */
.scoring-select option.model-section-header {
  color: #1a1a1a;
  font-weight: 700;
  background: #efeadb;
}
.scoring-select option {
  color: #1a1a1a;
  font-weight: 400;
  background: #FBF8EE;
  padding: 4px 8px;
}

.model-hint {
  margin-top: 8px;
  padding: 10px 12px;
  background: #efeadb;
  border-left: 3px solid #b8b2a0;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #1a1a1a;
}
.model-hint:empty {
  display: none;
}
.model-hint strong {
  font-weight: 600;
}

/* Structured form grid — responsive 2-column on desktop, 1-column on mobile. */
.scoring-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: #4a4a44;
}
.form-field .form-hint {
  font-weight: 400;
  color: #8c887e;
  font-size: 11px;
}
.form-field input,
.form-field select {
  padding: 6px 10px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #b8b2a0;
  border-radius: 4px;
  background: #FBF8EE;
}
.form-field input:focus,
.form-field select:focus {
  outline: 2px solid #1a1a1a;
  outline-offset: -1px;
}

/* Schema toggling: by default the form is in GSE mode. Hide fields not
 * applicable to the active schema. */
.scoring-form[data-schema="gse"]  .field-gse  { display: flex; }
.scoring-form[data-schema="gse"]  .field-hmda { display: none; }
.scoring-form[data-schema="gse"]  .field-gnma:not(.field-gse) { display: none; }
.scoring-form[data-schema="gnma"] .field-gnma { display: flex; }
.scoring-form[data-schema="gnma"] .field-gse:not(.field-gnma) { display: none; }
.scoring-form[data-schema="gnma"] .field-hmda { display: none; }
/* HMDA schema: show the 8-field HMDA subset; everything else stays hidden.
 * The full 25-field HMDA payload is reconstructed at submit time by merging
 * form values with sensible defaults. */
.scoring-form[data-schema="hmda"] .field-hmda { display: flex; }
.scoring-form[data-schema="hmda"] .field-gse:not(.field-hmda)  { display: none; }
.scoring-form[data-schema="hmda"] .field-gnma:not(.field-hmda) { display: none; }

.scoring-hmda-notice {
  padding: 14px;
  background: #efeadb;
  border-left: 3px solid #b8b2a0;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.55;
  color: #1a1a1a;
}

.scoring-advanced {
  margin-top: 14px;
  border: 1px solid #d0cab8;
  border-radius: 6px;
  background: #FBF8EE;
}
.scoring-advanced > summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  color: #4a4a44;
  list-style: none;
  user-select: none;
}
.scoring-advanced > summary::-webkit-details-marker { display: none; }
.scoring-advanced > summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 4px;
}
.scoring-advanced[open] > summary::before { content: "▾ "; }
.scoring-advanced > summary:hover { background: #efeadb; }
.scoring-advanced > #scoring-input {
  width: calc(100% - 24px);
  margin: 0 12px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid #d0cab8;
  border-radius: 4px;
  background: #f7f3e6;
  resize: vertical;
}
.scoring-advanced > .form-hint {
  display: block;
  padding: 6px 12px 10px;
  color: #6b6a62;
}

/* "Why trust this" + "About these models" — both render as <details>.
 * Style them with a clean disclosure look matching the Advanced block. */
.reliability-block,
.scoring-about {
  margin-top: 20px;
  border: 1px solid #d0cab8;
  border-radius: 6px;
  background: #FBF8EE;
}
.reliability-block > summary,
.scoring-about > summary,
.reliability-summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  list-style: none;
  user-select: none;
}
.reliability-block > summary::-webkit-details-marker,
.scoring-about > summary::-webkit-details-marker { display: none; }
.reliability-block > summary::before,
.scoring-about > summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 6px;
  font-weight: 400;
}
.reliability-block[open] > summary::before,
.scoring-about[open] > summary::before { content: "▾ "; }
.reliability-block > summary:hover,
.scoring-about > summary:hover { background: #efeadb; }
.reliability-block > #reliability-body,
.scoring-about > .scoring-about-list {
  padding: 0 14px 14px;
}
.scoring-about-list {
  margin: 0;
  padding-left: 22px !important;
  font-size: 13px;
  line-height: 1.55;
}
.scoring-about-list li {
  margin-bottom: 8px;
}

/* Score-loan button — make it more prominent than the link-btn next to it. */
#scoring-submit {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  background: #1a1a1a;
  color: #FBF8EE;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#scoring-submit:hover { background: #333; }
#scoring-submit:disabled { background: #8c887e; cursor: not-allowed; }

@media (max-width: 640px) {
  .scoring-form {
    grid-template-columns: 1fr;
  }
}

/* Multi-model scorecard table (Session 5b). Same loan scored against
 * every pipeline / post-funding model in parallel and surfaced as a
 * compact comparison grid. */
.scorecard-heading {
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.scorecard-heading strong {
  font-size: 15px;
  color: #1a1a1a;
}
.scorecard-meta {
  font-size: 12px;
  color: #6b6a62;
}
.scorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}
.scorecard-table th {
  background: #efeadb;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a4a44;
  border-bottom: 1px solid #d0cab8;
}
.scorecard-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #efeadb;
  vertical-align: middle;
}
.scorecard-label { font-weight: 500; color: #1a1a1a; }
.scorecard-prob  { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.scorecard-lift  { color: #4a4a44; }
.scorecard-baseline { color: #8c887e; font-size: 11px; }
.scorecard-err   { color: #b03a3a; font-size: 12px; font-style: italic; }
.scorecard-foot  {
  font-size: 12px;
  color: #6b6a62;
  margin-top: 8px;
  line-height: 1.5;
}

/* "Score another loan" + multi-model link buttons: less prominent than
 * the primary Score loan button, but still tappable. */
#scoring-multi,
#scoring-reset {
  font-size: 13px;
  color: #4a4a44;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#scoring-multi:hover,
#scoring-reset:hover { color: #1a1a1a; }
#scoring-multi:disabled { color: #b8b2a0; cursor: not-allowed; }

/* Field-level tooltip glyph. We render our own popup via ::after rather
 * than rely on the native browser title= tooltip — native tooltips are
 * slow (1-2s delay), can show on the wrong element if hover state lingers,
 * and aren't stylable. A CSS popup is instant, scoped to the exact glyph,
 * and consistent across browsers. */
.form-tip {
  position: relative;
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  color: #8c887e;
  cursor: help;
}
.form-tip:hover,
.form-tip:focus { color: #1a1a1a; outline: none; }
.form-tip[data-tip]:hover::after,
.form-tip[data-tip]:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #FBF8EE;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  width: 280px;
  white-space: normal;
  text-align: left;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
/* Little arrow pointing down to the glyph. */
.form-tip[data-tip]:hover::before,
.form-tip[data-tip]:focus::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
  z-index: 1001;
  pointer-events: none;
}

/* Schema link in the model-hint banner. */
.model-hint-link {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.model-hint-link:hover { color: #4a4a44; }

/* ===========================================================================
 * Scoring Models overview page (/userguide/scoring)
 *
 * Frames the model portfolio for first-time visitors before they hit any
 * individual model card. Big-number hero, methodology blocks, categorized
 * card grid with per-model AUC badges.
 * =========================================================================== */

.scoring-overview-hero {
  background: linear-gradient(180deg, #efeadb 0%, #FBF8EE 100%);
}
.scoring-overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.scoring-overview-stat {
  text-align: center;
  padding: 12px 8px;
}
.scoring-overview-stat-num {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.scoring-overview-stat-lbl {
  margin-top: 6px;
  font-size: 12px;
  color: #4a4a44;
  line-height: 1.35;
}
.scoring-overview-stat-lbl span {
  color: #8c887e;
  font-size: 11px;
}

.scoring-overview-group {
  margin-top: 24px;
}
.scoring-overview-group-title {
  font-size: 18px;
  margin-bottom: 4px;
}
.scoring-overview-group-blurb {
  font-size: 13px;
  color: #6b6a62;
  margin: 0 0 12px 0;
  line-height: 1.55;
}
.scoring-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.scoring-overview-card {
  padding: 12px 14px;
  background: #FBF8EE;
  border: 1px solid #d0cab8;
  border-radius: 6px;
}
.scoring-overview-card-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.scoring-overview-card-blurb {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #4a4a44;
}
.scoring-overview-auc {
  font-size: 11px;
  font-weight: 600;
  background: #1a1a1a;
  color: #FBF8EE;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .scoring-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scoring-overview-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .scoring-overview-stats { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Market Snapshot page — /market-snapshot
   Six-section layout showing live OB rate-lock aggregates. Palette matches
   the platform's cream/rust identity used across insights + user guide.
   -------------------------------------------------------------------------- */

.snap-page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }

.snap-hero {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; padding-bottom: 20px; border-bottom: 1px solid #d9d3bf; margin-bottom: 32px;
}
.snap-title { font-family: Georgia, 'Times New Roman', serif; font-size: 34px; margin: 0 0 6px; color: #1a1a1a; }
.snap-lead { color: #4a4a44; max-width: 640px; margin: 0; line-height: 1.5; }
.snap-freshness {
  background: #f5f1e1; border: 1px solid #d9d3bf; border-radius: 8px;
  padding: 10px 16px; text-align: right; min-width: 160px;
}
.snap-freshness-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #6a6a5c; }
.snap-freshness-date  { font-size: 18px; font-weight: 600; color: #a64942; }
.snap-freshness-prior { font-size: 12px; color: #6a6a5c; margin-top: 2px; }

.snap-section { margin: 40px 0; }
.snap-section-title { font-family: Georgia, serif; font-size: 22px; margin: 0 0 4px; color: #1a1a1a; }
.snap-section-note  { color: #6a6a5c; font-size: 13px; margin: 0 0 16px; }

.snap-headline-row {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
}
.snap-headline-card {
  background: #fff; border: 1px solid #d9d3bf; border-radius: 8px;
  padding: 14px 16px;
}
.snap-hc-label { font-size: 12px; color: #6a6a5c; text-transform: uppercase; letter-spacing: 0.04em; }
.snap-hc-rate  { font-family: Georgia, serif; font-size: 28px; font-weight: 600; color: #1a1a1a; margin: 4px 0 2px; }
.snap-hc-delta { font-size: 13px; font-weight: 600; }
.snap-hc-delta-up   { color: #a64942; }  /* rate up = worse for borrower */
.snap-hc-delta-down { color: #2a8a85; }  /* rate down = better for borrower */
.snap-hc-delta-flat { color: #6a6a5c; }
.snap-hc-vol   { font-size: 12px; color: #6a6a5c; margin-top: 6px; }

.snap-grid {
  border-collapse: collapse; width: 100%; font-size: 12px; background: #fff;
  border: 1px solid #d9d3bf;
}
.snap-grid th, .snap-grid td { border: 1px solid #ebe5cf; padding: 6px 8px; text-align: center; }
.snap-grid th { background: #f5f1e1; font-weight: 600; color: #4a4a44; }
.snap-grid-cell { background: #fff; }
.snap-grid-empty { background: #fafaf5; color: #b6b09e; }
.snap-grid-rate { font-weight: 600; color: #1a1a1a; }
.snap-grid-llpa { font-size: 11px; color: #6a6a5c; margin-top: 2px; }

.snap-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.snap-two-col h3 { font-family: Georgia, serif; font-size: 16px; margin: 0 0 8px; color: #1a1a1a; }

.snap-table {
  border-collapse: collapse; width: 100%; font-size: 13px; background: #fff;
  border: 1px solid #d9d3bf;
}
.snap-table th, .snap-table td { border: 1px solid #ebe5cf; padding: 8px 10px; text-align: left; }
.snap-table th { background: #f5f1e1; font-weight: 600; color: #4a4a44; }
.snap-num { text-align: right; font-variant-numeric: tabular-nums; }

.snap-caption { color: #6a6a5c; font-size: 12px; margin: 6px 0 0; }
.snap-empty   { color: #6a6a5c; font-style: italic; }

.snap-attribution {
  margin-top: 40px; padding-top: 16px; border-top: 1px solid #d9d3bf;
  color: #4a4a44; font-size: 13px;
}

@media (max-width: 900px) {
  .snap-hero { flex-direction: column; align-items: flex-start; }
  .snap-freshness { text-align: left; }
  .snap-headline-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .snap-two-col { grid-template-columns: 1fr; }
  .snap-grid { font-size: 10px; }
  .snap-grid th, .snap-grid td { padding: 4px 4px; }
}
@media (max-width: 480px) {
  .snap-headline-row { grid-template-columns: 1fr; }
  .snap-title { font-size: 28px; }
}

/* Market Snapshot — Phase 4 additions: sparklines, pulse animation, LLPA
   reality-check heat cells. */

.snap-hc-spark {
  display: block; width: 100%; height: 22px; margin: 6px 0 4px;
  color: #a64942;
}
.snap-hc-delta-down + .snap-hc-spark { color: #2a8a85; }
.snap-hc-delta-flat + .snap-hc-spark { color: #8a8778; }

/* "Since last release" pulse — only fires on headline cards whose rate moved
   >= 5 bps between the previous and current release. Subtle rust glow. */
@keyframes snap-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(166, 73, 66, 0.35); }
  60%  { box-shadow: 0 0 0 6px rgba(166, 73, 66, 0.05); }
  100% { box-shadow: 0 0 0 0 rgba(166, 73, 66, 0);    }
}
.snap-headline-pulse { animation: snap-pulse 1.2s ease-out; }

/* LLPA reality-check heat cells. Rust for market-above-grid, teal for
   market-below. Three intensities keep the eye anchored on the meaningful
   moves without shouting on every cell. */
.snap-real-cell { text-align: center; vertical-align: middle; }
.snap-real-diff { font-weight: 600; font-size: 13px; color: #1a1a1a; }
.snap-real-vs   { font-size: 10px; color: #6a6a5c; margin-top: 2px; }
.snap-real-over.snap-real-hi  { background: #f4d5d3; }
.snap-real-over.snap-real-mid { background: #f9e5e3; }
.snap-real-over.snap-real-lo  { background: #fbf1ef; }
.snap-real-under.snap-real-hi  { background: #cde4e2; }
.snap-real-under.snap-real-mid { background: #dfeceb; }
.snap-real-under.snap-real-lo  { background: #eaf2f1; }
.snap-real-flat, .snap-real-lo { background: #fff; }

/* Wide-table wrapper — keeps the page from horizontally scrolling on mobile
   when the FICO×LTV grids (9 LTV columns) exceed viewport width. */
.snap-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

/* Rental Signal section — two-column layout for leaders/laggards bar rows.
   Sparkline caption sits below the headline card's SVG.
   Bar rows: MSA name (fixed left), horizontal proportional bar (flex fill),
   YoY value (fixed right). Colored green/red on direction. */
.snap-hc-spark-caption { font-size: 11px; color: #6a6a5c; margin-top: 4px; }
.snap-rent-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px;
}
@media (max-width: 720px) {
  .snap-rent-two-col { grid-template-columns: 1fr; gap: 16px; }
}
.snap-rent-col { min-width: 0; }
.snap-rent-subtitle {
  font-family: Georgia, serif; font-size: 15px; font-weight: 600;
  color: #4a4a44; margin: 0 0 10px 0; letter-spacing: 0.01em;
}
.snap-rent-row {
  display: grid; grid-template-columns: 140px 1fr 64px;
  gap: 10px; align-items: center; padding: 4px 0;
  font-size: 13px;
}
.snap-rent-name { color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snap-rent-bar-track {
  background: #f5f1e1; border-radius: 3px; height: 12px; overflow: hidden;
}
.snap-rent-bar { height: 100%; border-radius: 3px; }
.snap-rent-bar-up   { background: linear-gradient(90deg, #2a8a85, #4ba59e); }
.snap-rent-bar-down { background: linear-gradient(90deg, #a64942, #c46760); }
.snap-rent-value { text-align: right; font-variant-numeric: tabular-nums; color: #4a4a44; font-weight: 600; }
@media (max-width: 720px) {
  .snap-rent-row { grid-template-columns: 100px 1fr 56px; gap: 8px; font-size: 12px; }
}

/* Homepage Market Snapshot discovery link (below quick-chips row).
   Distinct visual from the chat chips because it navigates, not prompts. */
.quick-starts-extra { margin-top: 14px; }
.market-snapshot-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #fef4e5 0%, #fbf8ee 100%);
  border: 1px solid #d9b880; border-radius: 10px;
  text-decoration: none; color: #1a1a1a;
  transition: transform 0.12s, box-shadow 0.12s;
}
.market-snapshot-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(166, 73, 66, 0.15);
}
.ms-badge {
  background: #a64942; color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 999px;
  flex-shrink: 0;
}
.ms-label { font-weight: 600; font-family: Georgia, serif; font-size: 15px; flex-shrink: 0; }
.ms-desc  { color: #6a6a5c; font-size: 13px; flex: 1; }
.ms-arrow { color: #a64942; font-size: 20px; flex-shrink: 0; }
@media (max-width: 640px) {
  .market-snapshot-link { flex-wrap: wrap; }
  .ms-desc { flex-basis: 100%; margin-top: 4px; }
}

/* LLPA overlay band pill inside each rate-grid cell. Four bands with a
   sequential color ramp — cream / mustard / rust / dark rust — so the eye
   flows from low residual risk to high. */
.snap-grid-band {
  display: inline-block; margin-top: 4px;
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 1px 6px; border-radius: 999px;
}
.snap-grid-band-low       { background: #e8f0e8; color: #2a6a55; }
.snap-grid-band-baseline  { background: #f2e5b8; color: #7a5a1a; }
.snap-grid-band-elevated  { background: #f4c8b5; color: #a64942; }
.snap-grid-band-high      { background: #d97260; color: #ffffff; }

/* 3-column composition layout on desktop, stacks on mobile. */
.snap-three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.snap-three-col h3 { font-family: Georgia, serif; font-size: 16px; margin: 0 0 8px; color: #1a1a1a; }
.snap-panel-source { font-size: 11px; font-weight: normal; color: #6a6a5c; }
@media (max-width: 900px) { .snap-three-col { grid-template-columns: 1fr; } }

/* Section-group headers for the two-funnel pull-through table. */
.snap-th-group { background: #ebe5cf !important; font-weight: 700; text-align: center; letter-spacing: 0.03em; }
.snap-th-group-alt { background: #dfeceb !important; }

/* Sidebar items rendered as <a> (Market Snapshot link) inherit the browser
   default anchor underline. Strip it — buttons don't have this problem. */
a.app-sidebar-item, a.app-sidebar-item:hover, a.app-sidebar-item:visited {
  text-decoration: none;
}


/* Eligibility-response <details> disclosures. Styled to match the cream
 * paper aesthetic — a subtle inline expander that reads as "there's more
 * detail if you want it" without competing with the surrounding text. */
details.elig-details {
  margin: 6px 0 10px;
  padding: 4px 0;
}
details.elig-details > summary {
  cursor: pointer;
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
  color: #6b675c;
  padding: 4px 0;
  list-style: none;
  user-select: none;
}
details.elig-details > summary::-webkit-details-marker { display: none; }
details.elig-details > summary::before {
  content: "▸ ";
  display: inline-block;
  color: #8f2727;
  transition: transform 120ms ease;
}
details.elig-details[open] > summary::before {
  content: "▾ ";
}
details.elig-details > summary:hover {
  color: #1a1a1a;
}
details.elig-details > *:not(summary) {
  margin-top: 4px;
}


/* ==========================================================================
   Homepage remodel (OpenEvidence-inspired) — 2026-08-03
   Section tokens live at the top of the block so the rest of the file's
   variables aren't disturbed. Everything is prefixed .hp- to make it easy
   to grep + eventually pull into its own stylesheet when the app grows.
   ========================================================================== */

/* Slightly darker cream for the marketing panels so they read as a
   distinct band from the hero. Keeps the warm-paper vibe. */
:root {
  --hp-band-bg: #F1EDDE;
  --hp-band-bg-alt: #EDE7D2;
  --hp-ink: #1a1a1a;
  --hp-muted: #6b675c;
  --hp-rule: #d9d3bd;
  --hp-accent: #7a1f1f;   /* tree-red for CTAs / hover / eyebrow */
  --hp-sans: 'Helvetica Neue', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Utility */
.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;
}

/* Kill any italic inherited from an ancestor across ALL homepage marketing
 * elements — the existing page CSS has several `header .subtitle` and
 * `.ug-*` rules that slip in italic; explicit reset keeps our new sections
 * upright regardless of what wraps them. */
.hp-tagline, .hp-tagline *,
.hp-data-breadth, .hp-data-breadth *,
.hp-insights, .hp-insights *,
.hp-footer, .hp-footer *,
.hp-sticky-header, .hp-sticky-header *,
.hp-try-free-bar, .hp-try-free-bar * {
  font-style: normal;
}

/* Marketing sections live at the bottom of the flex column so they
   sit BELOW the prompt hero. The existing .prompt-area is already
   assigned order:1 (see the has-prompted block earlier in this file);
   we use 20/21/22 to guarantee we render after chips, results, etc.,
   regardless of any future order tweaks to those siblings. */
#view-default > .hp-tagline      { order: 20; }
#view-default > .hp-data-breadth { order: 21; }
#view-default > .hp-insights     { order: 22; }
/* Cancel the parent .container's 28px flex gap between tagline+tiles so
 * they read as one band. Negative margin composes with flex gap. */
#view-default > .hp-tagline      { margin-bottom: -28px; }
/* Also collapse the gap ABOVE the tagline so the marketing band starts
 * cleanly right after "Explore additional capabilities" without a
 * huge cream void. */
#view-default > .hp-tagline      { margin-top: -8px; }

/* Hide new marketing sections once the user submits a chat query —
   matches the pattern already used for .quick-starts / .explore-more. */
#view-default.has-prompted > .hp-tagline,
#view-default.has-prompted > .hp-data-breadth,
#view-default.has-prompted > .hp-insights,
#view-default.has-prompted > .hp-partners {
  display: none !important;
}

/* ---------- Sticky top-left brand ---------- */
/* Hidden by default via opacity + off-screen transform. We do NOT
 * rely on the `hidden` HTML attribute because setAuthUI (site.js)
 * clears it on all .auth-anon-only elements at page load, which
 * would flash the sticky brand into view before JS could re-hide.
 * The `.hp-sticky-visible` class (toggled by initStickyHeader on
 * scroll past THRESHOLD) fades + slides it in. */

.hp-sticky-header {
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  padding: 12px 20px;
  /* No background/border — the brand mark reads directly on whatever
   * section the visitor is scrolled to. Matches how a persistent
   * masthead sits on a research-shop site without visually competing
   * with the section it's overlaid on. */
  background: transparent;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
  pointer-events: none;
}
.hp-sticky-header.hp-sticky-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.hp-sticky-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hp-ink);
  text-decoration: none;
}
.hp-sticky-logo {
  height: 26px;
  width: auto;
}
.hp-sticky-name {
  font-family: 'Times New Roman', Times, serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
}
/* Sidebar-open case: shift the sticky brand so it doesn't sit under
   the collapsed rail. Only matters if we ever show it to signed-in
   users; safe no-op today because .auth-anon-only hides it. */
body.has-sidebar .hp-sticky-header { left: 68px; }

/* ---------- Tagline banner ---------- */
/* The tagline lives on the same darker-cream band as the tile grid
 * so the two read as one section. It's full-bleed (breaks out of the
 * .container max-width) and sits directly above the tiles with a
 * flush transition (see .hp-data-breadth margin-top override below). */

.hp-tagline {
  padding: 48px 24px 18px;
  text-align: center;
  background: var(--hp-band-bg);
  margin: 0 calc(50% - 50vw);
  /* Bottom margin collapses into the tile band so they visually merge. */
  margin-bottom: 0;
}
.hp-tagline + .hp-data-breadth {
  padding-top: 6px;
}
/* Shared heading treatment across the three top-level anon homepage
   section headings (America's Housing Finance... / Deep Research /
   Official AI Partners) so they read as visually equal peers. Overrides
   for hp-tagline-text stay below so its original selector wins. */
.hp-tagline-text, .hp-section-title, .hp-partners-heading {
  font-family: 'Times New Roman', Times, serif;
  font-size: 32px;
  line-height: 1.22;
  font-weight: normal;
  color: var(--hp-ink);
  letter-spacing: -0.005em;
  margin: 0 auto;
  max-width: 780px;
  font-style: normal;
  text-align: center;
}
.hp-tagline-text {
  font-family: 'Times New Roman', Times, serif;
  font-size: 32px;
  line-height: 1.22;
  color: var(--hp-ink);
  letter-spacing: -0.005em;
  margin: 0 auto;
  max-width: 780px;
  font-style: normal;
}
@media (max-width: 640px) {
  .hp-tagline { padding: 32px 20px 12px; }
  /* Shared mobile size so all three top-level section headings shrink
     together (see the shared desktop rule ~30 lines above). */
  .hp-tagline-text, .hp-section-title, .hp-partners-heading { font-size: 24px; }
  .hp-tagline-text br { display: none; }
}

/* ---------- Data-breadth tile grid ---------- */

.hp-data-breadth {
  padding: 22px 0 44px;
  background: var(--hp-band-bg);
  /* Break out of the container's max-width for a full-bleed band feel. */
  margin: 0 calc(50% - 50vw);
  padding-left: calc(50vw - 50% + 24px);
  padding-right: calc(50vw - 50% + 24px);
}
.hp-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .hp-tile-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hp-tile-grid { grid-template-columns: 1fr; }
}
.hp-tile {
  background: #FFFDF6;
  border: 1px solid var(--hp-rule);
  border-radius: 8px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.hp-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(122, 31, 31, 0.08);
}
.hp-tile-num {
  font-family: 'Times New Roman', Times, serif;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  color: var(--hp-accent);
  letter-spacing: -0.01em;
}
.hp-tile-num sup {
  font-size: 0.55em;
  vertical-align: super;
  color: var(--hp-accent);
  margin-left: 1px;
}
.hp-tile-lbl {
  font-family: 'Times New Roman', Times, serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--hp-ink);
  margin-top: 2px;
}
.hp-tile-sub {
  font-family: var(--hp-sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--hp-muted);
  margin-top: 2px;
}

/* Featured tile — spans the full 3-col grid row so a newly-added data
   source doesn't leave a lonely 10th tile on the last row. Two-column
   internal layout on desktop (big number on the left, title + prose on
   the right); collapses to stacked on mobile. */
.hp-tile-featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #FFFDF6 0%, #FBF6E8 100%);
  border: 1px solid var(--hp-accent);
  gap: 10px;
}
.hp-tile-featured-eyebrow {
  font-family: var(--hp-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hp-accent);
}
.hp-tile-featured-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 22px;
  align-items: center;
}
.hp-tile-featured-num {
  font-family: 'Times New Roman', Times, serif;
  font-size: 52px;
  line-height: 1;
  font-weight: 700;
  color: var(--hp-accent);
  letter-spacing: -0.02em;
}
.hp-tile-featured-num sup {
  font-size: 0.5em;
  vertical-align: super;
  margin-left: 2px;
}
.hp-tile-featured-lbl {
  font-family: 'Times New Roman', Times, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--hp-ink);
  margin-bottom: 6px;
}
.hp-tile-featured-sub {
  font-family: var(--hp-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--hp-muted);
}
.hp-tile-featured-sub strong {
  color: var(--hp-ink);
}
@media (max-width: 720px) {
  .hp-tile-featured-body {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .hp-tile-featured-num { font-size: 42px; }
  .hp-tile-featured-lbl { font-size: 17px; }
}

/* ---------- Official AI Partners strip ---------- */

.hp-partners {
  /* Mirror hp-tagline: full-bleed alternating band background so the
     partners strip visually separates from the surrounding content
     the same way the tagline does at the top. Section-level padding
     provides the internal breathing room; the inner max-width bound
     is applied per-child (.hp-partners-header, .hp-partner-grid). */
  background: var(--hp-band-bg);
  margin: 0 calc(50% - 50vw);
  padding: 48px 24px 44px;
  /* #view-default is a flexbox column; other sections carry explicit
     order values (hp-tagline=20, hp-data-breadth=21, hp-insights=22).
     Without this, default order:0 puts the partners strip at the top
     of the flex order regardless of DOM position. */
  order: 23;
}
.hp-partners-header {
  text-align: center;
  margin-bottom: 22px;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.hp-partner-grid {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.hp-partners-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--hp-ink);
  margin: 0 0 8px;
  line-height: 1.25;
}
.hp-partners-sub {
  font-family: var(--hp-sans);
  font-size: 13.5px;
  color: var(--hp-muted);
  margin: 0 auto;
  max-width: 640px;
  line-height: 1.5;
}
.hp-partner-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 720px) {
  .hp-partner-grid { grid-template-columns: 1fr; }
  .hp-partners-title { font-size: 19px; }
}
.hp-partner-card {
  background: #FFFDF6;
  border: 1px solid var(--hp-rule);
  border-radius: 8px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.hp-partner-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(122, 31, 31, 0.08);
  border-color: var(--hp-accent);
}
.hp-partner-logo-wrap {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.hp-partner-logo {
  max-height: 40px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* Mobile: center the logo in its wrap and let it breathe — the desktop
   caps (40px tall × 200px wide) leave Beekin (127×32 native) stranded
   against a ~300px card. Bumping the caps + centering gives both logos
   proportional presence without upscaling artifacts (both are vector or
   high-res raster). */
@media (max-width: 640px) {
  .hp-partner-logo-wrap {
    justify-content: center;
    min-height: 60px;
  }
  .hp-partner-logo {
    /* Force height so SVGs with intrinsic width/height attrs
       (e.g. Beekin: 127x32) scale up to fill the card;
       max-width still applies + object-fit:contain preserves aspect
       ratio for wider rasters (OB: 2982x510 stays capped at 260px wide). */
    height: 56px;
    width: auto;
    max-height: 56px;
    max-width: 260px;
  }
  .hp-partner-wordmark {
    text-align: center;
    width: 100%;
  }
  .hp-partner-role,
  .hp-partner-desc {
    text-align: center;
  }
}
.hp-partner-wordmark {
  font-family: 'Times New Roman', Times, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--hp-ink);
  letter-spacing: -0.01em;
}
.hp-partner-role {
  font-family: var(--hp-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hp-accent);
}
.hp-partner-desc {
  font-family: var(--hp-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--hp-muted);
  margin: 0;
}

/* ---------- Deep Research section ---------- */

.hp-insights {
  padding: 40px 0 28px;
}
/* .hp-section-title font-family/size/weight/color inherited from the
   shared .hp-tagline-text/.hp-section-title/.hp-partners-heading rule
   above; only spacing overrides live here. */
.hp-section-title {
  margin: 0 auto 22px;
}
.hp-partners-heading {
  margin: 0 auto 12px;
}
/* Mobile size sync is handled by the shared @media block near .hp-tagline
   above; no per-selector override needed here. */

.hp-carousel {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.hp-carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 320px;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 4px 14px;
  flex: 1;
  scrollbar-width: thin;
}
.hp-carousel-track::-webkit-scrollbar { height: 8px; }
.hp-carousel-track::-webkit-scrollbar-thumb {
  background: var(--hp-rule);
  border-radius: 4px;
}
.hp-insight-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 16px;
  background: #FFFDF6;
  border: 1px solid var(--hp-rule);
  border-radius: 8px;
  color: var(--hp-ink);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  min-height: 200px;
  overflow: hidden;
}
.hp-insight-card > *:not(.hp-insight-thumb) {
  padding-left: 18px;
  padding-right: 18px;
}
.hp-insight-card > *:not(.hp-insight-thumb):first-of-type {
  padding-top: 14px;
}
.hp-insight-thumb {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  object-position: center top;
  background: var(--hp-band-bg);
  border-bottom: 1px solid var(--hp-rule);
}
.hp-insight-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(122, 31, 31, 0.08);
  border-color: var(--hp-accent);
}
.hp-insight-eyebrow {
  font-family: var(--hp-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hp-accent);
}
.hp-insight-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
}
.hp-insight-blurb {
  font-family: var(--hp-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--hp-muted);
  flex: 1;
}
.hp-insight-cta {
  font-family: var(--hp-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--hp-accent);
}

.hp-carousel-btn {
  flex: 0 0 auto;
  width: 36px;
  align-self: center;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hp-rule);
  background: #FFFDF6;
  color: var(--hp-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 120ms ease, border-color 120ms ease;
}
.hp-carousel-btn:hover {
  background: var(--hp-accent);
  border-color: var(--hp-accent);
  color: #FFFDF6;
}
.hp-carousel-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
@media (max-width: 640px) {
  .hp-carousel-btn { display: none; }
  .hp-carousel-track { grid-auto-columns: 260px; }
}

.hp-insights-cta-row {
  text-align: center;
  margin-top: 8px;
}
.hp-insights-all {
  font-family: var(--hp-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--hp-accent);
  text-decoration: none;
}
.hp-insights-all:hover { text-decoration: underline; }

/* ---------- OpenEvidence-style footer ---------- */

.hp-footer {
  background: var(--hp-band-bg-alt);
  border-top: 1px solid var(--hp-rule);
  /* Full-bleed across container */
  margin: 40px calc(50% - 50vw) 0;
  padding: 32px calc(50vw - 50% + 24px) 24px;
}
.hp-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
}
.hp-footer-top {
  display: grid;
  /* Brand column: fixed narrow width for the wordmark. Surfaces column
   * needs enough room to fit "Capital Markets / Secondary Marketing" on
   * 2 lines — 1.9fr accomplishes that on desktop. Newsletter still wide
   * enough for the email input + Subscribe button. */
  grid-template-columns: 200px 1.9fr 1fr 1fr 1.7fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .hp-footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .hp-footer-brand { grid-column: 1 / -1; }
  .hp-footer-newsletter { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .hp-footer-top { grid-template-columns: 1fr; }
}
.hp-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hp-ink);
  text-decoration: none;
}
.hp-footer-logo {
  height: 34px;
  width: auto;
}
.hp-footer-brand-name {
  font-family: 'Times New Roman', Times, serif;
  font-size: 20px;
  font-weight: 400;
  white-space: nowrap;
  font-style: normal;
}
.hp-footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hp-footer-col-title {
  font-family: var(--hp-sans);
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
  color: var(--hp-ink);
  margin-bottom: 2px;
}
.hp-footer-link {
  font-family: var(--hp-sans);
  font-size: 13px;
  font-style: normal;
  color: var(--hp-muted);
  text-decoration: none;
  line-height: 1.5;
}
.hp-footer-link:hover {
  color: var(--hp-accent);
  text-decoration: underline;
}
.hp-footer-link-disabled {
  cursor: default;
  color: var(--hp-muted);
  opacity: 0.75;
}
.hp-footer-link-disabled:hover {
  color: var(--hp-muted);
  text-decoration: none;
}

.hp-footer-newsletter-text {
  font-family: var(--hp-sans);
  font-size: 13px;
  color: var(--hp-ink);
  margin: 0 0 10px;
  line-height: 1.5;
}
.hp-footer-newsletter-form {
  display: flex;
  gap: 6px;
}
.hp-footer-newsletter-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--hp-rule);
  border-radius: 6px;
  background: #FFFDF6;
  font-family: var(--hp-sans);
  font-size: 13px;
  color: var(--hp-ink);
}
.hp-footer-newsletter-input:focus {
  outline: none;
  border-color: var(--hp-accent);
}
.hp-footer-newsletter-btn {
  padding: 8px 14px;
  border: 1px solid var(--hp-ink);
  background: transparent;
  color: var(--hp-ink);
  font-family: var(--hp-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
}
.hp-footer-newsletter-btn:hover {
  background: var(--hp-ink);
  color: #FFFDF6;
}
.hp-footer-newsletter-status {
  font-family: var(--hp-sans);
  font-size: 12px;
  color: var(--hp-muted);
  margin: 8px 0 0;
  min-height: 1em;
}

.hp-footer-bottom {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--hp-rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.hp-footer-copy {
  font-family: var(--hp-sans);
  font-size: 12px;
  color: var(--hp-muted);
  margin: 0;
}
.hp-footer-legal {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.hp-footer-legal-link {
  font-family: var(--hp-sans);
  font-size: 12px;
  color: var(--hp-muted);
  text-decoration: none;
}
.hp-footer-legal-link:hover {
  color: var(--hp-accent);
  text-decoration: underline;
}

/* Suppress the legacy .site-footer that other pages still use if it
   somehow appears on the homepage (defensive — HTML changes removed it). */

/* ---------- Persistent "Try for Free" bar ---------- */
/* Hidden by default via opacity + off-viewport translate. Same
 * reason as .hp-sticky-header — setAuthUI clears the `hidden`
 * attribute at load and would flash the bar in. JS adds the
 * `.hp-try-free-armed` class ~1.2s after paint to fade it in;
 * dismiss handler adds `.hp-try-free-dismissed` (removed again
 * only on next visit if localStorage cleared). */

.hp-try-free-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 16px);
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  background: var(--hp-ink);
  color: #FFFDF6;
  border-radius: 999px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
  font-family: var(--hp-sans);
  max-width: calc(100vw - 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease, transform 320ms ease;
}
.hp-try-free-bar.hp-try-free-armed {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.hp-try-free-bar.hp-try-free-dismissed {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate(-50%, 16px) !important;
}
/* site.js's setAuthUI toggles the `hidden` attribute on every
 * .auth-anon-only element when the user signs in / out. The pill has
 * display: flex which normally beats the UA `[hidden]{display:none}`
 * rule, so hidden=true wouldn't visually hide the pill without an
 * explicit override. Same problem applies to the sticky header. */
.hp-try-free-bar[hidden],
.hp-sticky-header[hidden] {
  display: none !important;
}
.hp-try-free-text {
  font-size: 14px;
  font-weight: 500;
  color: #FFFDF6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-try-free-btn {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--hp-accent);
  color: #FFFDF6;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
}
.hp-try-free-btn:hover { background: #8f2727; }
.hp-try-free-dismiss {
  background: transparent;
  color: rgba(255, 253, 246, 0.7);
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.hp-try-free-dismiss:hover { color: #FFFDF6; }

@media (max-width: 560px) {
  .hp-try-free-bar {
    padding: 9px 10px 9px 14px;
    gap: 8px;
  }
  .hp-try-free-text { font-size: 13px; }
  .hp-try-free-btn { padding: 6px 12px; font-size: 12px; }
}
