/* Drake + Scout app design system. Shared by drakescout.app (/app) and Design Scout.
   The same file lives in both repositories (pricing-desk: app/static/app/ds-ui.css,
   Design-Scout: app/ds-ui.css); change both together. Phone first, then desktop. */

:root {
  --ds-ivory: #f8f5ee;
  --ds-ivory-2: #f1ece1;
  --ds-card: #ffffff;
  --ds-navy: #0c233c;
  --ds-navy-900: #061a2d;
  --ds-navy-700: #173a5c;
  --ds-ink: #142739;
  --ds-muted: #5b6d7e;
  --ds-line: #e5ded0;
  --ds-line-strong: #d6ccb9;
  --ds-gold: #b8903f;          /* gold for text/icons on ivory (AA on white) */
  --ds-gold-bright: #dfb35a;   /* gold for fills on navy */
  --ds-gold-soft: #f6ead0;
  --ds-success: #2f7d57;
  --ds-success-soft: #e5f3eb;
  --ds-warn: #9a5b0b;
  --ds-warn-soft: #fcf1de;
  --ds-danger: #a8382f;
  --ds-danger-soft: #fbe9e7;
  --ds-info-soft: #e8eff6;
  --ds-radius: 18px;
  --ds-radius-sm: 12px;
  --ds-shadow: 0 1px 2px rgba(12, 35, 60, .05), 0 8px 24px rgba(12, 35, 60, .07);
  --ds-shadow-lg: 0 18px 44px rgba(12, 35, 60, .16);
  --ds-serif: Georgia, 'Times New Roman', serif;
  --ds-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --ds-tabbar-h: 64px;
  --ds-sidebar-w: 248px;
  --ds-safe-bottom: env(safe-area-inset-bottom, 0px);
}

.ds-root, .ds-root * { box-sizing: border-box; }
.ds-root {
  margin: 0; min-height: 100vh; background: var(--ds-ivory); color: var(--ds-ink);
  font: 16px/1.5 var(--ds-sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
:where(.ds-root) :is(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.ds-root) a { color: var(--ds-navy-700); }
.ds-root main:focus, .ds-root main:focus-visible { outline: none; }
.ds-root h1, .ds-root h2, .ds-root h3 { font-family: var(--ds-serif); color: var(--ds-navy); letter-spacing: -.01em; margin: 0; }
.ds-root h1 { font-size: clamp(28px, 6.4vw, 38px); line-height: 1.12; }
.ds-root h2 { font-size: clamp(21px, 4.6vw, 26px); line-height: 1.2; }
.ds-root h3 { font-size: 18px; line-height: 1.3; }
.ds-root p { margin: 0; }
.ds-root :focus-visible { outline: 3px solid var(--ds-gold-bright); outline-offset: 2px; border-radius: 6px; }
.ds-hidden, [hidden] { display: none !important; }
.ds-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App frame: sidebar on desktop, tab bar on phones ---------- */
.ds-app { min-height: 100vh; }
.ds-main { padding: 0 0 calc(var(--ds-tabbar-h) + var(--ds-safe-bottom) + 24px); min-width: 0; }
.ds-topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: rgba(248, 245, 238, .94); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--ds-line);
}
.ds-topbar-title { flex: 1; min-width: 0; font: 700 17px/1.2 var(--ds-sans); color: var(--ds-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 4px; margin-left: -6px;
  border: 0; border-radius: 10px; background: none; color: var(--ds-navy-700); font-weight: 650; text-decoration: none; cursor: pointer;
}
.ds-back svg { width: 22px; height: 22px; }
.ds-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.ds-brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: var(--ds-navy); color: var(--ds-gold-bright);
}
.ds-brand-mark svg { width: 20px; height: 20px; }
.ds-brand-name { font: 700 15px/1.1 var(--ds-serif); letter-spacing: .06em; color: var(--ds-navy); white-space: nowrap; }
.ds-brand-name small { display: block; font: 700 9.5px/1.4 var(--ds-sans); letter-spacing: .16em; color: var(--ds-gold); }
.ds-page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px 32px; }
.ds-page-narrow { max-width: 760px; }

.ds-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--ds-tabbar-h) + var(--ds-safe-bottom)); padding-bottom: var(--ds-safe-bottom);
  background: var(--ds-navy-900); border-top: 1px solid rgba(223, 179, 90, .25);
}
.ds-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0;
  color: #9fb1c2; text-decoration: none; font: 650 10.5px/1 var(--ds-sans); letter-spacing: .06em; text-transform: uppercase;
  border: 0; background: none; cursor: pointer; position: relative;
}
.ds-tab svg { width: 24px; height: 24px; }
.ds-tab[aria-current="page"] { color: var(--ds-gold-bright); }
.ds-tab[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--ds-gold-bright);
}
.ds-sidebar { display: none; }

@media (min-width: 900px) {
  .ds-app { display: grid; grid-template-columns: var(--ds-sidebar-w) minmax(0, 1fr); }
  .ds-tabbar { display: none; }
  .ds-main { padding-bottom: 40px; }
  .ds-sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
    padding: 20px 14px; background: var(--ds-navy-900); color: #dfe7ee; overflow-y: auto;
  }
  .ds-sidebar .ds-brand { padding: 4px 8px 22px; }
  .ds-topbar-brand { visibility: hidden; }
  .ds-sidebar .ds-brand-name { color: #fff; }
  .ds-sidebar .ds-brand-mark { background: rgba(223, 179, 90, .14); }
  .ds-side-link {
    display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 12px;
    color: #c6d3de; text-decoration: none; font-weight: 650; border: 0; background: none; cursor: pointer; text-align: left; width: 100%;
  }
  .ds-side-link svg { width: 22px; height: 22px; flex: none; }
  .ds-side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .ds-side-link[aria-current="page"] { background: rgba(223, 179, 90, .14); color: var(--ds-gold-bright); box-shadow: inset 3px 0 0 var(--ds-gold-bright); }
  .ds-side-spacer { flex: 1; }
  .ds-topbar { padding: 12px 28px; }
  .ds-page { padding: 28px 28px 40px; }
}

/* ---------- Account menu ---------- */
.ds-account { position: relative; margin-left: auto; }
.ds-account-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--ds-line-strong); background: var(--ds-card); cursor: pointer; max-width: 46vw;
}
.ds-avatar {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--ds-navy); color: var(--ds-gold-bright); font: 800 12px/1 var(--ds-sans);
}
.ds-account-name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-menu {
  position: fixed; z-index: 60; width: min(280px, calc(100vw - 24px)); padding: 8px; border-radius: 16px;
  background: var(--ds-card); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-lg);
}
/* Floating layers rendered on <body> by Design Scout keep the app's type without taking space. */
.ds-root.ds-portal { min-height: 0; background: none; }
.ds-menu-who { padding: 10px 12px 12px; border-bottom: 1px solid var(--ds-line); margin-bottom: 6px; }
.ds-menu-who strong { display: block; color: var(--ds-navy); }
.ds-menu-who span { font-size: 13px; color: var(--ds-muted); word-break: break-all; }
.ds-menu a, .ds-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px;
  border: 0; background: none; text-align: left; text-decoration: none; color: var(--ds-ink); font-weight: 600; cursor: pointer;
}
.ds-menu a:hover, .ds-menu button:hover, .ds-menu a:focus-visible, .ds-menu button:focus-visible { background: var(--ds-ivory); }
.ds-menu .ds-danger-text, .ds-danger-text { color: var(--ds-danger); }

/* ---------- Surfaces ---------- */
.ds-card { background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-radius); box-shadow: var(--ds-shadow); padding: 20px; }
.ds-card-flat { box-shadow: none; }
.ds-card-link { display: block; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.ds-card-link:hover { transform: translateY(-2px); box-shadow: var(--ds-shadow-lg); }
.ds-section { margin-top: 28px; }
.ds-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ds-section-head a, .ds-section-head button { font-weight: 650; font-size: 14px; white-space: nowrap; }
.ds-eyebrow { font: 800 11.5px/1.2 var(--ds-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ds-gold); }
.ds-lede { color: var(--ds-muted); font-size: 16.5px; margin-top: 8px; }
.ds-muted { color: var(--ds-muted); }
.ds-small { font-size: 13.5px; }
.ds-grid { display: grid; gap: 14px; }
.ds-grid-2 { display: grid; gap: 14px; }
.ds-grid-3 { display: grid; gap: 14px; }
@media (min-width: 700px) { .ds-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ds-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .ds-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ds-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* The two equal workspace cards (Home). */
.ds-workspaces { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 700px) { .ds-workspaces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.ds-workspace {
  position: relative; display: flex; flex-direction: column; min-height: 220px; padding: 24px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(160deg, #123356 0%, var(--ds-navy) 55%, var(--ds-navy-900) 100%); color: #fff;
  text-decoration: none; border: 1px solid rgba(223, 179, 90, .4); box-shadow: 0 16px 36px rgba(6, 26, 45, .25); cursor: pointer; text-align: left;
}
.ds-workspace::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 180px at 100% 0, rgba(223, 179, 90, .16), transparent 70%); pointer-events: none; }
.ds-workspace-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: rgba(223, 179, 90, .14); color: var(--ds-gold-bright); margin-bottom: 18px; }
.ds-workspace-icon svg { width: 26px; height: 26px; }
.ds-workspace h2 { color: #fff; font-size: clamp(26px, 6vw, 32px); }
.ds-workspace p { color: #c3d1dd; margin-top: 6px; flex: 1; }
.ds-workspace-go {
  display: flex; align-items: center; justify-content: space-between; margin-top: 20px; min-height: 52px; padding: 0 20px; border-radius: 14px;
  background: linear-gradient(180deg, #f3d18d, var(--ds-gold-bright)); color: var(--ds-navy-900); font-weight: 800;
}
.ds-workspace-go::after { content: "→"; font-size: 20px; }
.ds-workspace[aria-disabled="true"] .ds-workspace-go { background: rgba(255, 255, 255, .1); color: #e6edf3; box-shadow: inset 0 0 0 1px rgba(223, 179, 90, .5); }
.ds-workspace[aria-disabled="true"] .ds-workspace-go::after { content: ""; }
.ds-workspace-status { margin-top: 12px; font-size: 14px; color: var(--ds-gold-bright); }
.ds-workspace:hover { box-shadow: 0 22px 48px rgba(6, 26, 45, .32); }

/* ---------- Buttons, chips, tags ---------- */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 750; text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--ds-navy); color: #fff;
}
.ds-btn:hover { background: var(--ds-navy-700); }
.ds-btn:disabled, .ds-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.ds-btn-gold { background: linear-gradient(180deg, #f3d18d, var(--ds-gold-bright)); color: var(--ds-navy-900); }
.ds-btn-gold:hover { background: var(--ds-gold-bright); }
.ds-btn-ghost { background: var(--ds-card); color: var(--ds-navy); border-color: var(--ds-line-strong); }
.ds-btn-ghost:hover { background: var(--ds-ivory-2); }
.ds-btn-quiet { background: none; color: var(--ds-navy-700); padding: 0 10px; min-height: 40px; }
.ds-btn-quiet:hover { background: var(--ds-ivory-2); }
.ds-btn-danger { background: var(--ds-card); color: var(--ds-danger); border-color: #ecc9c4; }
.ds-btn-block { width: 100%; }
.ds-btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.ds-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.ds-chips::-webkit-scrollbar { display: none; }
.ds-chips-wrap { flex-wrap: wrap; overflow: visible; }
.ds-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; flex: none;
  border: 1px solid var(--ds-line-strong); background: var(--ds-card); color: var(--ds-ink); font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: none;
}
.ds-chip[aria-pressed="true"], .ds-chip[aria-current="true"] { background: var(--ds-navy); border-color: var(--ds-navy); color: #fff; }
.ds-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.4; background: var(--ds-ivory-2); color: var(--ds-navy); }
.ds-tag-gold { background: var(--ds-gold-soft); color: #6d5317; }
.ds-tag-green { background: var(--ds-success-soft); color: var(--ds-success); }
.ds-tag-warn { background: var(--ds-warn-soft); color: var(--ds-warn); }
.ds-tag-red { background: var(--ds-danger-soft); color: var(--ds-danger); }
.ds-tag-navy { background: var(--ds-navy); color: #fff; }
.ds-product { font: 800 10.5px/1 var(--ds-sans); letter-spacing: .12em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; }
.ds-product-scout { background: #e9f0ea; color: #2f6547; }
.ds-product-pricing { background: #e8eef6; color: #1f4a73; }
.ds-demo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--ds-warn-soft); color: var(--ds-warn); font: 800 11.5px/1.3 var(--ds-sans); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Lists (continue working, saved) ---------- */
.ds-list { display: grid; gap: 10px; }
.ds-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--ds-card);
  border: 1px solid var(--ds-line); text-decoration: none; color: inherit; min-width: 0;
}
a.ds-item:hover, button.ds-item:hover { border-color: var(--ds-line-strong); box-shadow: var(--ds-shadow); }
button.ds-item { width: 100%; text-align: left; cursor: pointer; }
.ds-thumb { width: 64px; height: 64px; flex: none; border-radius: 12px; background: var(--ds-ivory-2) center/cover no-repeat; display: grid; place-items: center; color: var(--ds-gold); overflow: hidden; }
.ds-thumb svg { width: 26px; height: 26px; }
.ds-item-body { flex: 1; min-width: 0; }
.ds-item-title { font-weight: 750; color: var(--ds-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-item-meta { font-size: 13.5px; color: var(--ds-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-item > svg { width: 20px; height: 20px; flex: none; color: var(--ds-muted); }
.ds-item-end { flex: none; display: flex; align-items: center; gap: 8px; color: var(--ds-muted); }
.ds-chevron { width: 20px; height: 20px; color: #9aa9b7; flex: none; }

/* ---------- Progress, steps ---------- */
.ds-progress { height: 6px; border-radius: 999px; background: var(--ds-ivory-2); overflow: hidden; }
.ds-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--ds-gold-bright), #c89a3c); border-radius: inherit; transition: width .3s ease; }
.ds-steps { display: flex; gap: 6px; margin: 4px 0 22px; }
.ds-step { flex: 1; min-width: 0; }
.ds-step-bar { height: 5px; border-radius: 999px; background: var(--ds-line); }
.ds-step[data-state="done"] .ds-step-bar, .ds-step[data-state="current"] .ds-step-bar { background: var(--ds-gold-bright); }
.ds-step-label { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--ds-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-step[data-state="current"] .ds-step-label { color: var(--ds-navy); }
.ds-choice-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .ds-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ds-choice {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 16px; border: 2px solid var(--ds-line);
  background: var(--ds-card); cursor: pointer; text-align: left; width: 100%;
}
.ds-choice[aria-checked="true"], .ds-choice[aria-pressed="true"] { border-color: var(--ds-gold-bright); background: #fffaf0; box-shadow: 0 0 0 3px rgba(223, 179, 90, .2); }
.ds-choice-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--ds-ivory-2); color: var(--ds-navy); }
.ds-choice strong { display: block; color: var(--ds-navy); font-size: 17px; }
.ds-choice span { color: var(--ds-muted); font-size: 14.5px; }
.ds-actionbar {
  position: sticky; bottom: calc(var(--ds-tabbar-h) + var(--ds-safe-bottom)); z-index: 20; display: flex; gap: 10px; justify-content: space-between;
  margin: 24px -16px 0; padding: 12px 16px; background: rgba(248, 245, 238, .96); border-top: 1px solid var(--ds-line); backdrop-filter: blur(8px);
}
@media (min-width: 900px) { .ds-actionbar { bottom: 0; margin: 28px 0 0; border-radius: 16px; border: 1px solid var(--ds-line); } }

/* ---------- Forms ---------- */
.ds-form { display: grid; gap: 14px; }
.ds-fields { display: grid; gap: 14px; }
@media (min-width: 600px) { .ds-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ds-fields .ds-wide { grid-column: 1 / -1; } }
@media (min-width: 900px) { .ds-fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ds-field { display: grid; gap: 6px; min-width: 0; }
.ds-field > span { font-size: 13px; font-weight: 750; color: var(--ds-navy); }
.ds-field > span em { font-style: normal; font-weight: 500; color: var(--ds-muted); }
.ds-input, .ds-field input, .ds-field select, .ds-field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--ds-line-strong);
  background: var(--ds-card); font-size: 16px; color: var(--ds-ink);
}
.ds-field textarea { min-height: 96px; resize: vertical; }
.ds-field input:focus, .ds-field select:focus, .ds-field textarea:focus, .ds-input:focus { outline: none; border-color: var(--ds-gold-bright); box-shadow: 0 0 0 4px rgba(223, 179, 90, .22); }
.ds-field small { color: var(--ds-muted); font-size: 12.5px; }
.ds-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.ds-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ds-navy); flex: none; }
.ds-drop {
  display: grid; place-items: center; gap: 6px; padding: 26px 16px; border-radius: 16px; border: 2px dashed var(--ds-line-strong);
  background: var(--ds-card); text-align: center; cursor: pointer; color: var(--ds-muted);
}
.ds-drop strong { color: var(--ds-navy); }
.ds-drop.is-drag { border-color: var(--ds-gold-bright); background: #fffaf0; }

/* ---------- Status: loading, empty, alerts ---------- */
.ds-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--ds-info-soft); color: var(--ds-navy); font-size: 15px; }
.ds-alert-warn { background: var(--ds-warn-soft); color: #6a3f06; }
.ds-alert-error { background: var(--ds-danger-soft); color: #7a2a23; }
.ds-alert-success { background: var(--ds-success-soft); color: #1f5a3d; }
.ds-alert strong { display: block; }
.ds-alert > svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.ds-empty { padding: 30px 20px; text-align: center; border-radius: var(--ds-radius); border: 1px dashed var(--ds-line-strong); background: rgba(255, 255, 255, .6); }
.ds-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; background: var(--ds-ivory-2); color: var(--ds-gold); }
.ds-empty h3 { margin-bottom: 6px; }
.ds-empty p { color: var(--ds-muted); max-width: 42ch; margin: 0 auto 16px; }
.ds-skeleton { border-radius: 14px; background: linear-gradient(90deg, var(--ds-ivory-2) 25%, #faf6ec 50%, var(--ds-ivory-2) 75%); background-size: 200% 100%; animation: ds-shimmer 1.2s infinite; }
@keyframes ds-shimmer { to { background-position: -200% 0; } }
.ds-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(12, 35, 60, .18); border-top-color: var(--ds-navy); animation: ds-spin .8s linear infinite; flex: none; }
.ds-spinner-light { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
@keyframes ds-spin { to { transform: rotate(360deg); } }
.ds-toast {
  position: fixed; left: 50%; bottom: calc(var(--ds-tabbar-h) + var(--ds-safe-bottom) + 16px); transform: translateX(-50%); z-index: 80;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ds-navy); color: #fff; font-weight: 600; box-shadow: var(--ds-shadow-lg);
}
@media (min-width: 900px) { .ds-toast { bottom: 24px; } }

/* ---------- Segmented tabs inside a workspace ---------- */
.ds-segments {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 14px; background: var(--ds-ivory-2);
  position: sticky; top: 60px; z-index: 15;
}
.ds-segments::-webkit-scrollbar { display: none; }
.ds-segment {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: none; font-weight: 700; font-size: 14px;
  color: var(--ds-muted); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center;
}
.ds-segment[aria-selected="true"], .ds-segment[aria-current="page"] { background: var(--ds-card); color: var(--ds-navy); box-shadow: var(--ds-shadow); }

/* ---------- Property header (subject / listing) ---------- */
.ds-prop-head { display: grid; gap: 16px; }
@media (min-width: 800px) { .ds-prop-head { grid-template-columns: 300px minmax(0, 1fr); align-items: center; } }
.ds-prop-photo { aspect-ratio: 4 / 3; border-radius: 18px; background: var(--ds-ivory-2) center/cover no-repeat; display: grid; place-items: center; color: var(--ds-muted); text-align: center; font-size: 13px; overflow: hidden; }
.ds-prop-photo svg { width: 40px; height: 40px; color: var(--ds-gold); }
.ds-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ds-muted); font-size: 15px; margin-top: 8px; }
.ds-facts b { color: var(--ds-ink); }
.ds-prop-price { margin-top: 6px; font: 700 clamp(26px, 6vw, 32px)/1.1 var(--ds-serif); color: var(--ds-navy); }
.ds-prop-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Numbers ---------- */
.ds-kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .ds-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ds-kpi { padding: 16px; border-radius: 16px; background: var(--ds-card); border: 1px solid var(--ds-line); }
.ds-kpi span { display: block; font-size: 12.5px; font-weight: 750; color: var(--ds-muted); text-transform: uppercase; letter-spacing: .06em; }
.ds-kpi strong { display: block; margin-top: 6px; font: 700 clamp(20px, 5vw, 26px)/1.1 var(--ds-serif); color: var(--ds-navy); }
.ds-kpi small { display: block; margin-top: 4px; color: var(--ds-muted); font-size: 12.5px; }
.ds-hero-number {
  padding: 22px; border-radius: 20px; color: #fff; background: linear-gradient(160deg, #123356, var(--ds-navy-900));
  border: 1px solid rgba(223, 179, 90, .4);
}
.ds-hero-number .ds-eyebrow { color: var(--ds-gold-bright); }
.ds-hero-number strong { display: block; margin: 8px 0 4px; font: 700 clamp(34px, 9vw, 48px)/1 var(--ds-serif); color: #fff; }
.ds-hero-number p { color: #c3d1dd; }

/* ---------- Tables that become cards on phones ---------- */
.ds-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--ds-line); background: var(--ds-card); }
.ds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ds-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ds-muted); padding: 10px 12px; background: var(--ds-ivory); white-space: nowrap; }
.ds-table td { padding: 11px 12px; border-top: 1px solid var(--ds-line); vertical-align: top; }
.ds-table td.num, .ds-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 699px) {
  .ds-table-stack thead { display: none; }
  .ds-table-stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px; border-top: 1px solid var(--ds-line); }
  .ds-table-stack td { border: 0; padding: 0; text-align: left !important; }
  .ds-table-stack td::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ds-muted); font-weight: 700; }
  .ds-table-stack td:first-child { grid-column: 1 / -1; }
}

/* ---------- Property / comp cards ---------- */
.ds-prop-card { display: flex; flex-direction: column; background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit; }
.ds-prop-card-photo { aspect-ratio: 16 / 10; background: var(--ds-ivory-2) center/cover no-repeat; display: grid; place-items: center; color: var(--ds-muted); font-size: 13px; position: relative; }
.ds-prop-card-photo svg { width: 34px; height: 34px; color: var(--ds-gold); }
.ds-prop-card-photo .ds-tag { position: absolute; top: 10px; left: 10px; }
.ds-prop-card-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.ds-prop-card-price { font: 700 22px/1.1 var(--ds-serif); color: var(--ds-navy); }
.ds-prop-card-addr { font-weight: 700; }
.ds-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-prop-card-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.ds-prop-card-link:hover .ds-prop-card-addr { text-decoration: underline; }
.ds-prop-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.ds-prop-card-nophoto { display: grid; justify-items: center; gap: 6px; }
.ds-prop-card-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ds-prop-card-badges .ds-tag, .ds-prop-card-photo .ds-prop-card-badges .ds-tag { position: static; }
.ds-prop-card-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 16px 16px; }
.ds-prop-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.ds-tag svg { width: 13px; height: 13px; flex: none; }
.ds-tag-muted { background: transparent; border: 1px dashed var(--ds-line-strong); color: var(--ds-muted); font-weight: 600; }
.ds-tag-navy { background: var(--ds-navy); color: #fff; }
/* Category cards (Design Scout search) */
.ds-cat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .ds-cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ds-cat { position: relative; display: grid; gap: 6px; align-content: start; padding: 16px; min-height: 128px; border-radius: 18px; border: 1px solid var(--ds-line); background: var(--ds-card); color: inherit; text-decoration: none; text-align: left; cursor: pointer; font: inherit; }
.ds-cat:hover { border-color: var(--ds-gold-bright); }
.ds-cat[aria-pressed="true"], .ds-cat[aria-current="step"] { border-color: var(--ds-gold-bright); background: #fffaf0; box-shadow: 0 0 0 3px rgba(223, 179, 90, .2); }
.ds-cat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ds-navy); color: var(--ds-gold-bright); }
.ds-cat-icon svg { width: 22px; height: 22px; }
.ds-cat strong { color: var(--ds-navy); font-size: 15.5px; line-height: 1.25; }
.ds-cat span { font-size: 13px; color: var(--ds-muted); line-height: 1.35; }
.ds-cat-count { position: absolute; top: 12px; right: 12px; }
/* Feature chips with a must / prefer / avoid state */
.ds-feature { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ds-line-strong); background: var(--ds-card); color: var(--ds-navy); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.ds-feature svg { width: 15px; height: 15px; }
.ds-feature[data-req="PREFER"] { background: var(--ds-gold-soft); border-color: #e5c880; color: #5e4712; }
.ds-feature[data-req="MUST"] { background: var(--ds-navy); border-color: var(--ds-navy); color: #fff; }
.ds-feature[data-req="AVOID"] { background: var(--ds-danger-soft); border-color: #e7b7b1; color: #7a2a23; text-decoration: line-through; }
/* Photo gallery */
.ds-gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.ds-gallery figure { margin: 0; border-radius: 14px; overflow: hidden; background: var(--ds-card); border: 1px solid var(--ds-line); }
.ds-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ds-gallery figcaption { padding: 8px 12px; font-size: 13px; color: var(--ds-muted); }
/* Compare */
.ds-compare th[scope="row"] { text-align: left; color: var(--ds-muted); font-weight: 650; white-space: nowrap; }
.ds-compare td { vertical-align: top; }
.ds-compare svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Sheet (Ask Scout / Ask Drake, menus on phones) ---------- */
.ds-sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(6, 26, 45, .45); }
.ds-sheet {
  position: fixed; z-index: 71; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; padding: 18px 16px calc(18px + var(--ds-safe-bottom));
  background: var(--ds-ivory); border-radius: 22px 22px 0 0; box-shadow: var(--ds-shadow-lg);
}
@media (min-width: 900px) { .ds-sheet { left: auto; right: 24px; bottom: 24px; width: 420px; border-radius: 22px; max-height: 80vh; } }
.ds-sheet-handle { width: 44px; height: 5px; border-radius: 999px; background: var(--ds-line-strong); margin: 0 auto 14px; }
.ds-bubble { padding: 12px 14px; border-radius: 14px; background: var(--ds-card); border: 1px solid var(--ds-line); white-space: pre-line; }
.ds-bubble-me { background: var(--ds-navy); color: #fff; border-color: var(--ds-navy); margin-left: 30px; }
.ds-ask-fab {
  position: fixed; z-index: 35; right: 16px; bottom: calc(var(--ds-tabbar-h) + var(--ds-safe-bottom) + 16px);
  display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ds-navy); color: #fff; font-weight: 750; box-shadow: var(--ds-shadow-lg);
}
.ds-ask-fab svg { width: 20px; height: 20px; color: var(--ds-gold-bright); }
@media (min-width: 900px) { .ds-ask-fab { bottom: 24px; right: 24px; } }

/* ---------- Intro (skippable) ---------- */
.ds-intro { position: relative; padding: 20px; border-radius: 20px; background: var(--ds-gold-soft); border: 1px solid #ecd7a6; }
.ds-intro h3 { margin-bottom: 6px; }
.ds-intro ol { margin: 10px 0 14px; padding-left: 20px; color: #4a3d1f; }
.ds-intro ol li { margin: 4px 0; }
.ds-intro-skip { position: absolute; top: 10px; right: 10px; }

@media (prefers-reduced-motion: reduce) {
  .ds-root *, .ds-root *::before, .ds-root *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
