:root {
  --paper: #faf9f9;
  --pearl: #f4f3f3;
  --white: #ffffff;
  --ink: #1a1c1c;
  --muted: #4c4546;
  --line: rgba(207, 196, 197, 0.62);
  --soft-line: rgba(207, 196, 197, 0.36);
  --moss: #000000;
  --moss-soft: #d4e6e5;
  --wine: #833143;
  --gold: #516161;
  --blue: #576867;
  --surface: #faf9f9;
  --surface-bright: #faf9f9;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f4f3f3;
  --surface-container: #efeeed;
  --secondary-container: #d4e6e5;
  --shadow: 0 40px 100px rgba(212, 230, 229, 0.22), 0 18px 52px rgba(26, 28, 28, 0.08);
  /* note to piper: app page - color - background depth behind the comparison area */
  --app-page-background: #f0eceb;
  /* note to piper: app ring cards - layout - width of one full-size comparison card */
  --ring-card-reference-width: 554px;
  /* note to piper: app ring cards - layout - two-card row width at full size */
  --ring-card-grid-full-width: 1132px;
  /* note to piper: app ring cards - layout - shrinks the whole two-card row when the browser is not tall enough */
  --ring-card-grid-fit-width: clamp(620px, calc(156.5svh - 458px), var(--ring-card-grid-full-width));
  /* note to piper: app ring cards - layout - full card proportions from the prior app screenshot */
  --ring-card-reference-ratio: 554 / 708;
  /* note to piper: app ring cards - layout - space between the two full-size comparison cards */
  --ring-card-grid-gap: 24px;
  /* note to piper: app ring cards - depth - default shadow behind comparison cards */
  --ring-card-shadow: 0 32px 86px rgba(26, 28, 28, 0.14), 0 12px 32px rgba(26, 28, 28, 0.08);
  --ring-card-hover-shadow: 0 48px 120px rgba(26, 28, 28, 0.17), 0 22px 54px rgba(26, 28, 28, 0.11);
  /* note to piper: info card - layout - popup card width on desktop */
  --info-card-width: 920px;
  /* note to piper: info card - layout - breathing room between viewport edge and popup */
  --info-card-gutter: 20px;
  /* note to piper: info card - layout - maximum popup height before internal scroll */
  --info-card-max-height: 74dvh;
  /* note to piper: info card - image - height of the ring photo inside the popup */
  --info-card-image-height: 300px;
  /* note to piper: thumbs-down card - layout - caps the floating feedback card width on larger ring cards */
  --dislike-card-width: 286px;
  /* note to piper: thumbs-down card - depth - changes the floating feedback card shadow */
  --dislike-card-shadow: 0 28px 68px rgba(26, 28, 28, 0.15), 0 10px 28px rgba(26, 28, 28, 0.09);
  /* note to piper: thumbs-down card - color - changes the translucent feedback card wash */
  --dislike-card-wash: rgba(250, 249, 249, 0.78);
  /* note to piper: guided tour - layout - maximum width of the entry workflow card */
  --tour-card-width: 1120px;
  /* note to piper: guided tour - layout - minimum card height before mobile stacking */
  --tour-card-min-height: 650px;
  /* note to piper: guided tour - color - warm glass wash over the entry workflow */
  --tour-card-wash: rgba(250, 249, 249, 0.92);
  /* note to piper: guided tour - color - whisper mint selection/accent strength */
  --tour-mint-accent: rgba(212, 230, 229, 0.55);
  /* note to piper: guided tour brief - color - strength of the blue/green dossier accents */
  --tour-brief-accent: rgba(87, 104, 103, 0.9);
  /* note to piper: guided tour brief - color - soft green glow behind the example brief */
  --tour-brief-glow: rgba(212, 230, 229, 0.62);
  /* note to piper: guided tour - buttons - height of the sidebar-style pill choices */
  --tour-pill-min-height: 54px;
  /* note to piper: guided tour - buttons - translucent wash for unselected pill buttons */
  --tour-pill-wash: rgba(255, 255, 255, 0.58);
  /* note to piper: guided tour - buttons - minimum width for bottom action pills */
  --tour-action-pill-width: 148px;
  /* note to piper: guided tour - photo - max width of the demo ring image on the welcome step */
  --tour-demo-photo-width: 280px;
  /* note to piper: loading screen - logo - controls the first-screen Loupe.Love mark size */
  --entry-loading-logo-width: clamp(260px, 58vw, 520px);
  /* note to piper: saved rings page - layout - caps the gallery width inside the full-screen view */
  --saved-page-width: 1180px;
  /* note to piper: saved rings page - layout - smallest saved-ring tile before the grid wraps */
  --saved-ring-tile-min: 238px;
  /* note to piper: saved rings page - layout - largest saved-ring tile in the gallery */
  --saved-ring-tile-max: 292px;
  /* note to piper: saved rings page - depth - shadow on saved-ring tiles */
  --saved-ring-tile-shadow: 0 30px 76px rgba(26, 28, 28, 0.12), 0 12px 30px rgba(26, 28, 28, 0.07);
  /* note to piper: saved rings page - layering - keeps the full-page gallery above the right sidebar */
  --saved-page-z-index: 60;
  /* note to piper: right sidebar - layout - width of the taste profile rail on desktop */
  --sidebar-width: 352px;
  /* note to piper: right sidebar - color - matches the app header glass for a seamless edge */
  --sidebar-surface: rgba(250, 249, 249, 0.6);
  /* note to piper: right sidebar - depth - shadow strength behind the profile rail */
  --sidebar-shadow: 0 34px 92px rgba(80, 71, 62, 0.13), 0 12px 30px rgba(26, 28, 28, 0.08);
  /* note to piper: dislike menu - layout - width of the thumbs-down option popover */
  --dislike-popover-width: 328px;
  /* note to piper: right sidebar - type - main sidebar section title size */
  --sidebar-heading-size: 28px;
  /* note to piper: right sidebar - type - centered divider label size */
  --sidebar-kicker-size: 17px;
  /* note to piper: right sidebar - spacing - vertical rhythm inside each rail section */
  --sidebar-section-gap: 16px;
  /* note to piper: right sidebar - spacing - breathing room between rail sections */
  --sidebar-section-padding: 22px;
}

@font-face {
  font-family: "Lavishly Yours";
  src: url("assets/fonts/LavishlyYours-Regular.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
.source-link {
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(24, 58, 51, 0.08),
    0 10px 26px rgba(22, 31, 27, 0.11);
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  background: var(--app-page-background);
}

/* note to piper: app copyright - position - sits in normal flow at the very bottom of the page, so it only shows when you scroll to the bottom (was pinned/fixed, always on screen) */
.app-copyright {
  padding: 28px 18px 18px;
  color: rgba(76, 69, 70, 0.72);
}

.entry-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background:
    linear-gradient(90deg, rgba(250, 249, 247, 0.78), rgba(250, 249, 247, 0.5)),
    linear-gradient(0deg, rgba(244, 241, 234, 0.78), rgba(244, 241, 234, 0.18)),
    url("assets/loupe-landing-hero.jpg") 55% 48% / cover;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 260ms ease;
}

body.entry-loading .entry-loading-screen {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.entry-loading-logo {
  display: block;
  width: min(var(--entry-loading-logo-width), calc(100vw - 44px));
  height: auto;
}

.entry-loading-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.site-footer {
  padding: 0 18px 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
  width: min(1760px, 100%);
  margin: 0 auto;
  padding-top: 0;
  border-top: 0;
}

.footer-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--moss);
  text-decoration: underline;
}

.copyright,
.app-copyright {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-align: right;
  text-transform: uppercase;
}

.policy-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.6), rgba(232, 238, 229, 0) 320px),
    var(--paper);
}

.policy-page.has-shared-header {
  padding-top: var(--shared-header-height);
  background: var(--app-page-background);
}

.policy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(232, 238, 229, 0.9);
}

.policy-brand {
  color: var(--moss);
  font-size: 34px;
  font-weight: 400;
  text-decoration: none;
}

.brand-mark {
  font-family: "Lavishly Yours", Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

.policy-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
}

.policy-nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
  text-decoration: none;
}

.policy-nav a:hover,
.policy-main a:hover {
  color: var(--moss);
  text-decoration: underline;
}

.policy-main {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.policy-page.has-shared-header .policy-main {
  /* note to piper: policy pages - type - keeps shared-header legal pages matched to the header label */
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.policy-main h1 {
  margin: 0;
  color: var(--moss);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(42px, 8vw, 68px);
  font-weight: 700;
  line-height: 1;
}

.policy-page.has-shared-header .policy-main h1 {
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0;
}

.policy-main .policy-updated.policy-footer-updated {
  margin: 32px 0 0;
  text-align: center;
}

.policy-main section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.policy-intro {
  margin-bottom: 24px;
}

.policy-main h2 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 680;
}

.policy-main h3 {
  margin: 22px 0 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 760;
}

.policy-main p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.policy-main .policy-updated {
  margin: 22px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

.policy-main ul {
  margin: 0 0 18px 20px;
  padding: 0;
  color: var(--muted);
}

.policy-main li {
  margin: 0 0 8px;
  padding-left: 4px;
  font-size: 16px;
  line-height: 1.6;
}

.policy-main p:last-child {
  margin-bottom: 0;
}

.policy-main a {
  color: var(--moss);
  font-weight: 740;
}

.topbar {
  position: fixed;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(250, 249, 249, 0.6);
  box-shadow: 0 40px 100px rgba(212, 230, 229, 0.1);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  transition: all 500ms ease-in-out;
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(1440px, 100%);
  height: 80px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-heading h2,
.choice-prompt,
.dialog-header h2 {
  margin: 0;
}

.topbar-brand {
  justify-self: start;
  font-family: "Lavishly Yours", Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 3.9vw, 58px);
  font-weight: 400;
  line-height: 1;
  color: #000;
  text-decoration: none;
  transform: translateY(-7px);
}

.topbar-phase {
  display: flex;
  align-items: center;
  justify-self: center;
}

.topbar-phase .stage-kicker {
  color: rgba(76, 69, 70, 0.86);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 16px;
  color: #000;
}

.topbar-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  box-shadow: none;
  transition: color 300ms ease;
}

.topbar-actions button:hover,
.topbar-actions button:focus-visible {
  color: var(--secondary-container);
}

.topbar-actions .sidebar-toggle {
  min-width: 118px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 34px rgba(26, 28, 28, 0.12);
}

.topbar-actions .sidebar-toggle:hover,
.topbar-actions .sidebar-toggle:focus-visible {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

body:not(.sidebar-collapsed) .topbar-actions .sidebar-toggle {
  display: none;
}

.material-symbols-outlined {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-family: Manrope, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  margin: 0 auto;
  padding: 120px calc(var(--sidebar-width) + 48px) 128px 24px;
  transition: grid-template-columns 200ms ease;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 55;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  width: var(--sidebar-width);
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: 20px 0 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-right: 0;
  border-radius: 0;
  background: var(--sidebar-surface);
  box-shadow: var(--sidebar-shadow);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
  backdrop-filter: blur(28px) saturate(135%);
}

.sidebar-close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(207, 196, 197, 0.44);
  border-radius: 50%;
  background: rgba(250, 249, 249, 0.66);
  color: rgba(26, 28, 28, 0.88);
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 30px rgba(26, 28, 28, 0.08);
}

.sidebar-close-button .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

.sidebar-close-button:hover,
.sidebar-close-button:focus-visible {
  background: rgba(255, 255, 255, 0.74);
}

.sidebar-toggle {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.app-quick-actions {
  position: fixed;
  top: 96px;
  right: 16px;
  z-index: 54;
  display: grid;
  gap: 8px;
  width: 132px;
}

.app-shortcut-button {
  display: inline-grid;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  place-items: center;
}

.app-shortcut-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

body:not(.sidebar-collapsed) .app-quick-actions {
  display: none;
}

@media (min-width: 861px) and (max-width: 1120px) {
  /* note to piper: app intro copy - responsive width - wraps the note before it reaches the quick-action buttons. */
  body.sidebar-collapsed .stage-note {
    max-width: clamp(500px, calc(100vw - 360px), 720px);
  }
}

body.saved-page-open .side-panel,
body.saved-page-open .app-sidebar-toggle {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sidebar-content {
  display: grid;
  gap: 0;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 69, 70, 0.12) transparent;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(76, 69, 70, 0.12);
}

body.sidebar-collapsed .workspace {
  grid-template-columns: minmax(0, 1fr);
  padding-right: 24px;
}

body.sidebar-collapsed .sidebar-content {
  display: none;
}

body.sidebar-collapsed .sidebar-bottom {
  display: none;
}

body.sidebar-collapsed .side-panel {
  display: none;
  max-height: none;
  height: auto;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  transform: none;
}

.rail-section {
  display: grid;
  gap: var(--sidebar-section-gap);
  padding: var(--sidebar-section-padding) 0;
  border-top: 0;
}

.rail-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.section-heading {
  margin: 0;
}

.section-heading h2 {
  color: #000;
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: var(--sidebar-heading-size);
  font-weight: 400;
  line-height: 1.25;
}

.profile-journey {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-journey .eyebrow {
  margin: 0;
}

.rail-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  color: rgba(76, 69, 70, 0.92);
  font-size: var(--sidebar-kicker-size);
  font-weight: 700;
}

.rail-kicker::before,
.rail-kicker::after {
  width: 34px;
  height: 1px;
  background: var(--blue);
  content: "";
}

.profile-journey .rail-kicker {
  gap: 8px;
  white-space: nowrap;
}

.profile-journey .rail-kicker::before,
.profile-journey .rail-kicker::after {
  flex: 1 1 20px;
  width: auto;
  min-width: 18px;
}

.rail-section > .rail-kicker {
  margin: 0;
}

.profile-journey p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.stats-heading {
  margin: 0;
}

.sidebar-copy {
  margin: 0;
}

.ruleout-copy {
  margin: 0;
}

.ruleout-toggle-button {
  margin-top: 0;
}

.ruleout-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.ruleout-panel[hidden] {
  display: none;
}

.quiet-copy {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.ruleout-groups {
  display: grid;
  gap: 18px;
}

.ruleout-group h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 760;
}

details {
  display: grid;
  gap: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0;
}

.filter-chip,
.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.58);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.filter-chip {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--wine);
  background: rgba(242, 220, 227, 0.68);
  color: var(--wine);
}

.session-preferences {
  display: grid;
  gap: 10px;
}

.session-preference-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--ink);
  font-size: 13px; /* note to piper: session preference labels - typography - size of the setting label text */
  line-height: 1.4;
}

.session-preference-field input {
  width: 64px; /* note to piper: session preference inputs - sizing - width of the number boxes */
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.58);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: center;
}

.profile-import {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.profile-import[hidden] {
  display: none;
}

.profile-import .quiet-copy {
  margin: 0;
}

.profile-import-input {
  font-size: 12px;
  color: var(--muted);
}

.compare-stage {
  display: grid;
  align-content: start;
  gap: 24px;
  min-width: 0;
}

.stage-status {
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 720px;
  margin: 0 auto -6px;
  text-align: center;
}

.stage-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.stage-kicker::before,
.stage-kicker::after {
  width: 32px;
  height: 1px;
  background: var(--blue);
  content: "";
}

.stage-note {
  order: 3;
  max-width: 720px;
  margin: -10px auto 8px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.6;
  text-align: center;
}

.choice-prompt {
  order: 2;
  max-width: 780px;
  margin: 0 auto 0;
  color: #000;
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
}

.comparison-wrap {
  order: 4;
  position: relative;
  display: grid;
  gap: 26px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ring-card-grid-gap);
  justify-self: center;
  width: 100%;
  max-width: var(--ring-card-grid-fit-width);
  min-height: 0;
}

.ring-card {
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  aspect-ratio: var(--ring-card-reference-ratio);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(207, 196, 197, 0.68);
  border-radius: 18px;
  background: var(--surface-container-lowest);
  box-shadow: var(--ring-card-shadow);
  transition: border-color 700ms ease, box-shadow 700ms ease;
}

.ring-card:hover {
  border-color: rgba(212, 230, 229, 0.72);
  box-shadow: var(--ring-card-hover-shadow);
}

.ring-card-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(244, 243, 243, 0.5));
  opacity: 0;
  transition: opacity 700ms ease;
}

.ring-card:hover .ring-card-glow {
  opacity: 1;
}

.ring-image-shell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-bright);
}

.ring-image-button {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--surface-bright);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ring-image-button:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.choice-button:focus-visible,
.icon-button:focus-visible,
.mini-icon-button:focus-visible,
.tour-arrow:focus-visible,
.tour-transition-button:focus-visible,
.dislike-popover-option:focus-visible,
.dislike-popover-chip:focus-visible,
.filter-chip:focus-visible,
.profile-match:focus-visible,
.sidebar-saved-thumb:focus-visible {
  outline: 3px solid rgba(43, 76, 102, 0.35);
  outline-offset: 2px;
}

.ring-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  transform: rotate(var(--ring-image-rotation, 0deg)) scale(var(--ring-image-zoom, 1));
  transform-origin: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  filter: brightness(var(--ring-image-brightness, 1));
  mix-blend-mode: normal;
}

.fallback-image {
  mix-blend-mode: normal;
}

.ring-actions {
  position: absolute;
  /* note to piper: app ring cards - layout - keeps the info/save/dislike action cluster centered horizontally on the card */
  left: 50%;
  right: auto;
  top: auto;
  bottom: clamp(14px, 4.34cqw, 24px);
  z-index: 3;
  display: flex;
  gap: clamp(8px, 1.81cqw, 10px);
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transform: translateX(-50%);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(207, 196, 197, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.icon-button[aria-pressed="true"] {
  border-color: var(--wine);
  background: rgba(242, 220, 227, 0.72);
  color: var(--wine);
}

.save-action,
.dislike-action {
  width: clamp(40px, 8.66cqw, 48px);
  height: clamp(40px, 8.66cqw, 48px);
  pointer-events: auto;
}

.save-action .material-symbols-outlined,
.dislike-action .material-symbols-outlined,
.info-action .material-symbols-outlined {
  font-size: 22px;
}

.save-action[aria-pressed="true"] .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

.info-action {
  width: clamp(40px, 8.66cqw, 48px);
  height: clamp(40px, 8.66cqw, 48px);
  font-size: 18px;
  pointer-events: auto;
}

.ring-select-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  margin-top: auto;
  padding: 14px 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #000;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: background 300ms ease, border-color 300ms ease, color 300ms ease, box-shadow 300ms ease;
}

.ring-select-button .material-symbols-outlined {
  font-size: 16px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.ring-select-button:hover {
  border-color: var(--secondary-container);
  background: var(--secondary-container);
}

.ring-select-button:hover .material-symbols-outlined {
  opacity: 1;
  transform: translateX(0);
}

.ring-dislike-popover {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  gap: 10px;
  width: min(var(--dislike-card-width), 100%);
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(244, 243, 243, 0.66)),
    var(--dislike-card-wash);
  color: var(--ink);
  box-shadow: var(--dislike-card-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
}

.ring-dislike-popover::after {
  display: none;
  content: none;
}

.dislike-popover-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.dislike-popover-copy {
  display: grid;
  gap: 3px;
}

.dislike-popover-title {
  margin: 0;
  color: #000;
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.12;
}

.mini-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(207, 196, 197, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  line-height: 1;
  box-shadow: none;
}

.mini-icon-button .material-symbols-outlined {
  font-size: 18px;
}

.dislike-popover-options {
  display: grid;
  gap: 8px;
}

.dislike-popover-option,
.dislike-popover-detail-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  gap: 10px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(207, 196, 197, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--ink);
  text-align: left;
  transition: background 240ms ease, border-color 240ms ease, transform 240ms ease;
}

.dislike-popover-option {
  min-height: 54px;
}

.dislike-popover-option > span:first-child {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(207, 196, 197, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #000;
}

.dislike-popover-option .material-symbols-outlined,
.dislike-popover-detail-button .material-symbols-outlined {
  font-size: 18px;
}

.dislike-popover-option div,
.dislike-popover-detail-button div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dislike-popover-option strong,
.dislike-popover-detail-button strong {
  color: #000;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
}

.dislike-popover-option small,
.dislike-popover-detail-button small {
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: uppercase;
  white-space: normal;
}

.dislike-popover-one-line {
  white-space: nowrap;
}

.dislike-popover-option:hover,
.dislike-popover-detail-button:hover,
.mini-icon-button:hover {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.72);
}

.dislike-popover-option:hover,
.dislike-popover-detail-button:hover {
  transform: translateY(-1px);
}

.dislike-popover-detail-button {
  min-height: 52px;
}

.dislike-popover-detail-button > span:first-child {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(207, 196, 197, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #000;
}

.choice-controls {
  position: static;
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  justify-self: center;
  max-width: 760px;
  width: 100%;
  margin: 0;
  transform: none;
}

/* note to piper: warm-up deck - layout - tunable sizes for the calibration card and controls */
:root {
  --calibration-card-max-width: 420px; /* note to piper: warm-up card - layout - width of the single warm-up ring card */
  --calibration-controls-max-width: 760px; /* note to piper: warm-up controls - layout - width of the warm-up button row */
  --calibration-controls-gap: 12px; /* note to piper: warm-up controls - spacing - gap between warm-up buttons */
}

.calibration-controls {
  display: grid;
  gap: var(--calibration-controls-gap);
  justify-self: center;
  justify-items: center;
  max-width: var(--calibration-controls-max-width);
  width: 100%;
}

.calibration-controls[hidden] {
  display: none;
}

.calibration-choice-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--calibration-controls-gap);
  width: 100%;
}

body.is-calibrating .compare-stage .choice-controls {
  display: none;
}

body.is-calibrating .compare-stage .comparison-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(var(--calibration-card-max-width), 100%);
}

.calibration-skip-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue); /* note to piper: warm-up skip link - color - quiet skip link text color */
  font-size: 12px; /* note to piper: warm-up skip link - typography - skip link size */
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-underline-offset: 4px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.calibration-skip-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* note to piper: taste check-in - layout - tunable sizes for the check-in interstitial */
:root {
  --checkin-moment-card-max-width: 560px; /* note to piper: check-in card - layout - width of the taste check interstitial */
  --checkin-moment-thumb-size: 84px; /* note to piper: check-in evidence - layout - evidence thumbnail size */
  --checkin-moment-gap: 14px; /* note to piper: check-in card - spacing - gap between kicker, thumbnails, and buttons */
}

body.is-checkin-moment .compare-stage .choice-controls {
  display: none;
}

body.is-checkin-moment .compare-stage .comparison-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(var(--checkin-moment-card-max-width), 100%);
}

.checkin-moment-card {
  display: grid;
  gap: var(--checkin-moment-gap);
  justify-items: center;
  text-align: center;
  padding: 26px 22px; /* note to piper: check-in card - spacing - inner padding of the interstitial */
  border: 1px solid rgba(207, 196, 197, 0.68);
  border-radius: 18px;
  background: var(--surface-container-lowest);
  box-shadow: var(--ring-card-shadow);
}

.checkin-moment-kicker {
  margin: 0;
}

.checkin-moment-evidence {
  display: flex;
  justify-content: center;
  gap: var(--checkin-moment-gap);
}

.checkin-moment-thumb {
  width: var(--checkin-moment-thumb-size);
  height: var(--checkin-moment-thumb-size);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(207, 196, 197, 0.68);
  border-radius: 14px; /* note to piper: check-in evidence - shape - thumbnail corner radius */
  background: var(--surface-container-lowest);
  cursor: pointer;
}

.checkin-moment-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkin-moment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--checkin-moment-gap);
}

/* note to piper: taste read button + ring brief dot - calm, static notification look (no motion, no red) */
:root {
  --brief-dot-size: 7px; /* note to piper: ring brief dot - layout - size of the little notification circle */
  --brief-dot-color: var(--blue); /* note to piper: ring brief dot - color - the dot colour (calm slate, not alarming) */
}

/* note to piper: shortcut buttons - ready cue - Ring brief & Taste read stay greyed/muted (disabled) until ready,
   then become a normal active button (same level as "More detail" — NOT darker) and hop once. */
:root {
  --shortcut-pop-distance: 4px; /* note to piper: shortcut buttons - motion - how far the button hops the one time it turns ready */
}

/* Ready = the normal enabled button look (matches "More detail"); the muted/greyed look comes from :disabled.
   No extra fill here on purpose — the only "on" cue is full opacity + the one-time hop. */

/* one-time gentle jump + breathe the moment a button becomes ready — no looping/pulsing afterward */
@keyframes shortcutReadyPop {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(calc(-1 * var(--shortcut-pop-distance))) scale(1.04); }
  55% { transform: translateY(0) scale(0.99); }
  78% { transform: translateY(calc(-0.32 * var(--shortcut-pop-distance))) scale(1.012); }
  100% { transform: translateY(0) scale(1); }
}

.app-shortcut-button--pop {
  animation: shortcutReadyPop 640ms cubic-bezier(0.34, 1.4, 0.64, 1) 1;
}

@media (prefers-reduced-motion: reduce) {
  .app-shortcut-button--pop {
    animation: none;
  }
}

/* note to piper: ring brief dot - layout - small static dot on the Ring brief button when the brief has a fresh read */
.has-brief-dot {
  position: relative;
}

.brief-dot {
  position: absolute;
  top: 50%;
  right: 12px;
  width: var(--brief-dot-size);
  height: var(--brief-dot-size);
  border-radius: 50%;
  background: var(--brief-dot-color);
  transform: translateY(-50%);
}

.brief-dot[hidden] {
  display: none;
}

/* note to piper: taste check dialog - layout - tunable sizes for the on-demand taste-read card */
:root {
  --checkin-dialog-width: 560px; /* note to piper: taste check dialog - layout - card width (narrower than before, less letterboxed) */
  --checkin-dialog-pad-x: 40px; /* note to piper: taste check dialog - spacing - left/right inner padding */
  --checkin-dialog-pad-top: 40px; /* note to piper: taste check dialog - spacing - space above the kicker */
  --checkin-dialog-pad-bottom: 38px; /* note to piper: taste check dialog - spacing - space below the answer buttons */
  --checkin-evidence-size: 104px; /* note to piper: taste check evidence - layout - size of each ring preview */
}

/* note to piper: taste check dialog - shell - frosted warm card so it matches the guided tour.
   `dialog.checkin-dialog` outranks the shared `.brief-dialog` base rule that sits later in this file. */
dialog.checkin-dialog {
  width: min(var(--checkin-dialog-width), calc(100vw - 32px));
  border-color: rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  background:
    linear-gradient(90deg, var(--tour-card-wash), rgba(250, 249, 249, 0.74)),
    linear-gradient(135deg, rgba(212, 230, 229, 0.22), rgba(250, 249, 249, 0) 46%),
    var(--surface-container-lowest);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  backdrop-filter: blur(24px) saturate(130%);
}

dialog.checkin-dialog::backdrop {
  background:
    linear-gradient(90deg, rgba(250, 249, 247, 0.38), rgba(26, 28, 28, 0.26)),
    rgba(26, 28, 28, 0.26);
  -webkit-backdrop-filter: grayscale(1) blur(8px);
  backdrop-filter: grayscale(1) blur(8px);
}

.checkin-dialog form {
  position: relative;
  margin: 0;
}

/* centered header, no hard divider — calm like the tour cards */
.checkin-dialog .dialog-header {
  display: block;
  padding: var(--checkin-dialog-pad-top) var(--checkin-dialog-pad-x) 0;
  border-bottom: 0;
  text-align: center;
}

.checkin-dialog .dialog-header > div {
  width: 100%;
}

.checkin-dialog .dialog-header .icon-button {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* note to piper: taste check dialog - the on-demand card that opens when the pill or dot is tapped */
.checkin-dialog .checkin-headline {
  margin: 8px auto 0;
  max-width: 24ch;
  color: var(--moss);
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 25px; /* note to piper: taste check headline - type - size of the question */
  line-height: 1.22;
}

.checkin-dialog-content {
  display: grid;
  gap: 20px;
  justify-items: center;
  margin-top: 0;
  padding: 22px var(--checkin-dialog-pad-x) var(--checkin-dialog-pad-bottom);
  text-align: center;
}

.checkin-dialog-sub {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ring previews as soft cards, echoing the tour's ring cards */
.checkin-dialog .checkin-moment-evidence {
  gap: 16px;
}

.checkin-dialog .checkin-moment-thumb {
  width: var(--checkin-evidence-size);
  height: var(--checkin-evidence-size);
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(135deg, rgba(212, 230, 229, 0.28), rgba(250, 249, 249, 0) 60%),
    var(--surface-container-lowest);
  box-shadow: var(--ring-card-shadow);
}

.checkin-answer-row {
  margin-top: 4px;
  gap: 10px;
}

/* note to piper: taste check answers - color - strong (I do) = soft mint affirmative (NOT black), mid = mint, neg = wine, skip = muted.
   The doubled class keeps these ahead of the generic .choice-button glass defined later in this file. */
.checkin-answer.checkin-answer--strong {
  border-color: rgba(135, 164, 163, 0.7);
  background: rgba(196, 221, 219, 0.78);
  color: #243f3c;
}

.checkin-answer.checkin-answer--strong:hover {
  background: rgba(184, 213, 211, 0.9);
}

.checkin-answer.checkin-answer--mid {
  border-color: rgba(135, 164, 163, 0.55);
  background: rgba(212, 230, 229, 0.5);
  color: #2c4140;
}

.checkin-answer.checkin-answer--neg {
  border-color: rgba(131, 49, 67, 0.45);
  background: rgba(131, 49, 67, 0.06);
  color: var(--wine);
}

.checkin-answer.checkin-answer--skip {
  color: var(--muted);
}

/* note to piper: pool exhausted - layout - tunable sizes for the everything-seen empty state */
:root {
  --pool-exhausted-card-max-width: 560px; /* note to piper: pool exhausted card - layout - width of the empty-state card */
  --pool-exhausted-gap: 14px; /* note to piper: pool exhausted card - spacing - gap between kicker and buttons */
}

body.is-pool-exhausted .compare-stage .choice-controls {
  display: none;
}

body.is-pool-exhausted .compare-stage .comparison-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(var(--pool-exhausted-card-max-width), 100%);
}

.pool-exhausted-card {
  display: grid;
  gap: var(--pool-exhausted-gap);
  justify-items: center;
  text-align: center;
  padding: 26px 22px; /* note to piper: pool exhausted card - spacing - inner padding of the empty-state card */
  border: 1px solid rgba(207, 196, 197, 0.68);
  border-radius: 18px;
  background: var(--surface-container-lowest);
  box-shadow: var(--ring-card-shadow);
}

.pool-exhausted-kicker {
  margin: 0;
}

.pool-exhausted-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--pool-exhausted-gap);
}

/* note to piper: ending moment - layout - tunable sizes for the "We've got it" results dialog */
:root {
  --ending-dialog-max-width: 680px; /* note to piper: ending dialog - layout - width of the results dialog */
  --ending-dialog-max-height: min(760px, calc(100dvh - 32px)); /* note to piper: ending dialog - layout - height cap before internal scroll */
  --ending-content-gap: 18px; /* note to piper: ending dialog - spacing - gap between results sections */
  --ending-headline-size: 21px; /* note to piper: ending headline - type - size of the brief summary headline */
  --ending-actions-gap: 12px; /* note to piper: ending actions - spacing - gap between the results buttons */
}

.brief-dialog.ending-dialog {
  width: min(var(--ending-dialog-max-width), calc(100vw - 32px));
  max-height: var(--ending-dialog-max-height);
}

.ending-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--ending-dialog-max-height) - 2px);
}

.ending-dialog .dialog-header {
  flex: none;
}

.ending-headline {
  margin: 6px 0 0;
  font-size: var(--ending-headline-size);
  line-height: 1.32;
}

.ending-content {
  display: grid;
  flex: 1;
  gap: var(--ending-content-gap);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ending-section {
  display: grid;
  gap: 10px;
}

.ending-still-settling {
  margin: 0;
  color: var(--muted);
  font-size: 14px; /* note to piper: ending still-settling line - type - size of the open-categories note */
  line-height: 1.45;
}

.ending-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ending-actions-gap);
}

.ending-complete-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue); /* note to piper: ending complete link - color - quiet mark-complete link text color */
  font-size: 12px; /* note to piper: ending complete link - typography - mark-complete link size */
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-underline-offset: 4px;
  cursor: pointer;
}

.ending-complete-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.choice-button,
.ghost-button,
.primary-button,
.ghost-link {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.choice-button[hidden],
.ghost-button[hidden],
.ghost-link[hidden] {
  display: none;
}

.choice-button,
.ghost-button,
.ghost-link {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(24, 58, 51, 0.08),
    0 18px 44px rgba(26, 28, 28, 0.13),
    0 6px 18px rgba(26, 28, 28, 0.08);
}

.choice-button:hover,
.ghost-button:hover,
.ghost-link:hover,
.filter-chip:hover,
.source-link:hover {
  border-color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.76);
}

.primary-button {
  border: 1px solid rgba(26, 28, 28, 0.82);
  background: rgba(26, 28, 28, 0.9);
  color: var(--white);
}

.primary-button:hover {
  background: #102d27;
}

.full-width {
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 0;
}

.stats-grid div {
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

.sidebar-bottom {
  display: grid;
  gap: var(--sidebar-section-gap);
  margin-top: 0;
  padding: var(--sidebar-section-padding) 0 0;
  background: transparent;
}

.sidebar-bottom .ghost-button {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(26, 28, 28, 0.09);
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid strong {
  font-size: 22px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
}

.signal-list {
  display: grid;
  gap: 10px;
}

.profile-section .signal-list {
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.profile-matches {
  display: grid;
  gap: var(--sidebar-section-gap);
  margin-top: 4px;
  padding-top: 0;
  border-top: 0;
}

.profile-matches-heading {
  display: grid;
  gap: 6px;
}

.profile-matches-heading .rail-kicker {
  width: 100%;
}

.profile-matches-heading span {
  display: none;
}

.profile-match-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 9px;
}

.profile-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(207, 196, 197, 0.46);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.profile-match:hover {
  border-color: rgba(24, 58, 51, 0.24);
  background: rgba(255, 253, 248, 0.72);
}

.profile-match-image {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-match-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  transform: rotate(var(--ring-image-rotation, 0deg)) scale(var(--ring-image-zoom, 1));
  transform-origin: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  filter: brightness(var(--ring-image-brightness, 1));
  mix-blend-mode: multiply;
}

.sidebar-saved-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.sidebar-saved-list[data-layout="grid"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sidebar-saved-list[data-layout="empty"] {
  margin-bottom: 0;
}

.sidebar-saved-list .empty-state {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.sidebar-saved-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(207, 196, 197, 0.46);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

.sidebar-saved-list[data-layout="list"] .sidebar-saved-thumb {
  aspect-ratio: 16 / 10;
}

.sidebar-saved-thumb:hover {
  border-color: rgba(26, 28, 28, 0.2);
}

.sidebar-saved-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  transform: rotate(var(--ring-image-rotation, 0deg)) scale(var(--ring-image-zoom, 1));
  transform-origin: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  filter: brightness(var(--ring-image-brightness, 1));
}

.signal-item {
  display: grid;
  gap: 7px;
  padding: 11px 0;
  border-bottom: 1px solid var(--soft-line);
}

.signal-item strong {
  font-size: 14px;
}

.signal-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--pearl);
}

.signal-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.saved-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--saved-ring-tile-min)), var(--saved-ring-tile-max)));
  gap: 22px;
  justify-content: start;
}

.saved-thumb {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(207, 196, 197, 0.58);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-align: left;
  box-shadow: var(--saved-ring-tile-shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.saved-page {
  position: fixed;
  top: var(--shared-header-height);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--saved-page-z-index);
  overflow: auto;
  padding: 42px 32px;
  background:
    linear-gradient(180deg, rgba(250, 249, 249, 0.76), rgba(240, 236, 235, 0.92) 320px),
    var(--app-page-background);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(16px);
}

.saved-page[hidden] {
  display: none;
}

.saved-page-inner {
  width: min(var(--saved-page-width), 100%);
  margin: 0 auto;
  padding: 0;
}

.saved-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.saved-page-header h2 {
  margin: 0;
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 500;
  line-height: 0.96;
  color: var(--moss);
}

.saved-page-back-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 154px;
}

.saved-page-back-button .material-symbols-outlined {
  font-size: 18px;
}

.saved-thumb:hover,
.saved-thumb:focus-visible {
  border-color: rgba(81, 97, 97, 0.42);
  box-shadow: 0 40px 96px rgba(26, 28, 28, 0.15), 0 18px 42px rgba(26, 28, 28, 0.09);
  transform: translateY(-2px);
}

.saved-thumb-image {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
}

.saved-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  transform: rotate(var(--ring-image-rotation, 0deg)) scale(var(--ring-image-zoom, 1));
  transform-origin: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  filter: brightness(var(--ring-image-brightness, 1));
  mix-blend-mode: normal;
}

.saved-empty-state {
  grid-column: 1 / -1;
  padding: 0;
}

.checkin-section {
  display: grid;
  gap: var(--sidebar-section-gap);
  padding: var(--sidebar-section-padding) 0;
  border-top: 1px solid rgba(207, 196, 197, 0.42);
  border-bottom: 1px solid rgba(207, 196, 197, 0.42);
}

.checkin-section[hidden] {
  display: none;
}

.checkin-list {
  display: grid;
  gap: 10px;
}

.checkin-empty-state {
  margin: 0;
}

.checkin-suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(207, 196, 197, 0.46);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

/* note to piper: checkin rule-out card - color - subtle muted left accent (NOT red) that sets a
   "rule this out" card apart from a positive "focus on this" card. Bump the slate or the border width
   here if you want it more visible; keep it calm. */
.checkin-suggestion--negative {
  border-left: 3px solid rgba(120, 122, 134, 0.5);
}

.checkin-suggestion-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.checkin-suggestion-copy strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.checkin-suggestion-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.checkin-apply {
  min-height: 38px;
  padding-inline: 12px;
  white-space: nowrap;
}

.checkin-actions[hidden] {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(26, 28, 28, 0.28);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.info-drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 80;
  width: min(var(--info-card-width), calc(100vw - (var(--info-card-gutter) * 2)));
  max-height: min(620px, var(--info-card-max-height), calc(100dvh - (var(--info-card-gutter) * 2)));
  padding: 28px;
  overflow-x: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms ease;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  box-shadow: 0 38px 110px rgba(26, 28, 28, 0.22), 0 16px 48px rgba(26, 28, 28, 0.12);
}

.info-drawer::-webkit-scrollbar {
  display: none;
}

.info-drawer.is-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
}

.drawer-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1.1fr);
  gap: 26px;
  align-items: start;
}

.drawer-media,
.drawer-copy {
  display: grid;
  gap: 14px;
}

.drawer-hero {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: var(--info-card-image-height);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow:
    0 24px 62px rgba(26, 28, 28, 0.13),
    0 8px 22px rgba(26, 28, 28, 0.08);
}

.drawer-hero img {
  width: 100%;
  height: var(--info-card-image-height);
  object-fit: contain;
  object-position: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  transform: rotate(var(--ring-image-rotation, 0deg)) scale(var(--ring-image-zoom, 1));
  transform-origin: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  filter: brightness(var(--ring-image-brightness, 1));
  mix-blend-mode: darken;
}

.drawer-image-actions {
  display: grid;
  gap: 10px;
}

.drawer-image-actions > .ghost-button,
.drawer-image-actions > .source-link,
.hide-action-wrap,
.hide-action-wrap .ghost-button {
  width: 100%;
}

.drawer-image-actions > .ghost-button,
.drawer-image-actions > .source-link,
.hide-action-wrap .ghost-button {
  display: inline-grid;
  place-items: center;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(24, 58, 51, 0.08),
    0 18px 44px rgba(26, 28, 28, 0.13),
    0 6px 18px rgba(26, 28, 28, 0.08);
}

.drawer-image-actions > .ghost-button:hover,
.drawer-image-actions > .source-link:hover,
.hide-action-wrap .ghost-button:hover {
  border-color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.76);
}

.hide-action-wrap {
  position: relative;
  display: block;
}

.hide-action-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 4;
  width: min(320px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 18px 48px rgba(26, 28, 28, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.hide-action-wrap:hover .hide-action-tooltip,
.hide-action-wrap:focus-within .hide-action-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}


.drawer-catalog-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: -2px 0 4px;
  padding: 6px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
}

.drawer-catalog-number span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-catalog-number strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.detail-grid {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.detail-grid.is-highlighted {
  border-color: rgba(87, 104, 103, 0.26);
  background: rgba(255, 255, 255, 0.44);
  box-shadow: 0 16px 36px rgba(26, 28, 28, 0.08);
}

.detail-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--soft-line);
}

.detail-row span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.detail-row span:last-child {
  font-size: 14px;
  line-height: 1.45;
}

.attribute-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attribute-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.1;
  box-shadow: none;
}

.attribute-pill.is-included {
  border-color: rgba(56, 116, 75, 0.46);
  background: rgba(56, 116, 75, 0.16);
  color: #2d5b3d;
}

.attribute-pill.is-excluded {
  border-color: rgba(160, 72, 79, 0.46);
  background: rgba(160, 72, 79, 0.15);
  color: #74343b;
}

.attribute-pill:focus-visible {
  outline: 3px solid rgba(87, 104, 103, 0.26);
  outline-offset: 2px;
}

.drawer-provenance {
  /* note to piper: drawer provenance row - typography - size/color of the image-source line under ring details */
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.drawer-provenance span:first-child {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-provenance-link {
  /* note to piper: drawer provenance link - color - retailer link tint in the source row */
  color: var(--moss);
  font-weight: 700;
}

.drawer-provenance-label {
  color: var(--muted);
}

.drawer-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.source-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.outbound-context-note,
.product-data-note,
.affiliate-note,
.drawer-save-status {
  margin: 20px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 249, 249, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.outbound-context-note {
  margin-top: -2px;
}

.drawer-save-status {
  margin-top: 0;
  background: rgba(212, 230, 229, 0.42);
  color: var(--ink);
}

.drawer-save-status[hidden] {
  display: none;
}

.product-data-note,
.drawer-disclosure-note {
  margin-top: 14px;
}

.drawer-disclosure-note {
  /* note to piper: drawer disclosure - layout - keeps the legal note as a full-width panel across the drawer bottom */
  grid-column: 1 / -1;
  margin-top: 4px;
  text-align: left;
}

.privacy-mini-note a,
.affiliate-note a {
  color: var(--moss);
  font-weight: 760;
}

.brief-dialog,
.attribute-dialog,
.onboarding-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.brief-dialog::backdrop,
.attribute-dialog::backdrop,
.onboarding-dialog::backdrop {
  background: rgba(24, 22, 20, 0.32);
}

.brief-dialog form,
.attribute-dialog form {
  margin: 0;
}

.onboarding-dialog {
  position: relative;
  width: min(var(--tour-card-width), calc(100vw - 40px));
  max-height: min(820px, calc(100dvh - 40px));
  overflow: auto;
  border-color: rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(90deg, var(--tour-card-wash), rgba(250, 249, 249, 0.74)),
    linear-gradient(135deg, rgba(212, 230, 229, 0.22), rgba(250, 249, 249, 0) 46%),
    var(--surface-container-lowest);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  backdrop-filter: blur(24px) saturate(130%);
}

.onboarding-dialog::backdrop {
  background:
    linear-gradient(90deg, rgba(250, 249, 247, 0.38), rgba(26, 28, 28, 0.26)),
    rgba(26, 28, 28, 0.26);
  -webkit-backdrop-filter: grayscale(1) blur(8px);
  backdrop-filter: grayscale(1) blur(8px);
}

.onboarding-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(34px, 5.2vw, 72px);
  min-height: min(var(--tour-card-min-height), calc(100dvh - 40px));
  padding: clamp(42px, 6.2vw, 88px);
}

.onboarding-progress-slot {
  position: absolute;
  top: clamp(66px, 8.8vw, 118px);
  right: clamp(42px, 6.2vw, 88px);
  left: clamp(42px, 6.2vw, 88px);
  z-index: 2;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.onboarding-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.onboarding-copy h2 {
  margin: 0;
  color: var(--moss);
  font-family: "Noto Serif", Didot, "Bodoni 72", Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 6vw, 76px);
  font-weight: 400;
  line-height: 0.95;
}

.onboarding-copy p:last-child {
  max-width: 420px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.45vw, 19px);
  font-weight: 300;
  line-height: 1.55;
}

.onboarding-content {
  display: grid;
  align-content: center;
  gap: 24px;
}

.onboarding-dialog[data-entry-context="filter"] .onboarding-content {
  align-content: center;
  min-height: min(470px, calc(100dvh - 190px));
  padding-top: clamp(52px, 6vw, 72px);
}

.guided-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: auto;
  margin: 0 auto;
}

.guided-progress span {
  width: clamp(34px, 3.8vw, 48px);
  height: 3px;
  border-radius: 999px;
  background: rgba(207, 196, 197, 0.8);
}

.guided-progress span.is-active {
  background: #000;
}

.guided-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.onboarding-dialog[data-entry-filter-index="3"] .guided-choice-grid {
  gap: 8px;
}

.guided-choice-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.guided-choice-column {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.guided-choice-column-title {
  margin: 0 0 2px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guided-choice-columns .onboarding-choice {
  min-height: 48px;
  padding: 8px 14px;
}

.filter-step-inline-copy {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.5;
}

.onboarding-choice {
  position: relative;
  min-height: var(--tour-pill-min-height);
  padding: 10px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--tour-pill-wash);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(24, 58, 51, 0.08),
    0 18px 44px rgba(26, 28, 28, 0.1),
    0 6px 18px rgba(26, 28, 28, 0.06);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.onboarding-dialog[data-entry-filter-index="3"] .onboarding-choice {
  min-height: 48px;
  padding-block: 8px;
}

.onboarding-choice::after {
  position: absolute;
  inset: auto 18px 13px 18px;
  height: 1px;
  background: rgba(212, 230, 229, 0.72);
  content: "";
  opacity: 0;
}

.onboarding-choice:hover {
  border-color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(24, 58, 51, 0.08),
    0 22px 48px rgba(26, 28, 28, 0.12),
    0 8px 20px rgba(26, 28, 28, 0.07);
  transform: translateY(-1px);
}

.onboarding-choice:focus-visible {
  outline: 3px solid rgba(87, 104, 103, 0.35);
  outline-offset: 3px;
}

.onboarding-choice span {
  position: relative;
  z-index: 1;
}

.onboarding-choice[aria-pressed="true"] {
  border-color: rgba(24, 58, 51, 0.22);
  background:
    linear-gradient(135deg, var(--tour-mint-accent), rgba(255, 255, 255, 0.74)),
    rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.onboarding-choice.is-keep-open {
  border-color: rgba(24, 58, 51, 0.18);
  background:
    linear-gradient(135deg, rgba(212, 230, 229, 0.36), rgba(255, 255, 255, 0.74)),
    rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(24, 58, 51, 0.08),
    0 22px 54px rgba(26, 28, 28, 0.13),
    0 8px 22px rgba(26, 28, 28, 0.07);
}

.onboarding-choice.is-keep-open span {
  display: grid;
  gap: 4px;
}

.onboarding-choice.is-keep-open span::after {
  display: block;
  margin-left: 0;
  color: var(--muted);
  content: "Recommended if unsure";
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.onboarding-choice[aria-pressed="true"]::after {
  opacity: 1;
}

.guided-note {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 12px 0 4px;
}

.guided-note span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.guided-note p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------- *
 * Guided tour content — educational steps
 * Editorial-magazine layout: copy column on the left, content column on
 * the right. Every block here lives inside .onboarding-content and is
 * designed to be quiet, not cards-on-cards. Style guide:
 *   docs/loupe-love-style-guide.md  (Tour surface)
 * --------------------------------------------------------------------- */

/* Educational/transition/ready steps use longer titles (4-7 words) than the
   filter steps (2 words). Scale the headline down so it doesn't wrap one word
   per line, and let the copy breathe a bit. */
.onboarding-dialog[data-entry-context="tour"] .onboarding-card {
  grid-template-columns: minmax(340px, 0.92fr) minmax(460px, 1.08fr);
}

.onboarding-dialog[data-entry-context="tour"] .onboarding-copy h2 {
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.05;
}

.onboarding-dialog[data-entry-context="tour"] .onboarding-copy p:last-of-type,
#onboardingCopy {
  font-size: clamp(15px, 1.2vw, 17px);
  font-weight: 400;
}

.onboarding-dialog[data-entry-context="tour"] .onboarding-copy > .eyebrow {
  margin-bottom: 14px;
  letter-spacing: 0.14em;
}

.tour-skip-link {
  align-self: flex-start;
  margin-top: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-underline-offset: 4px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.tour-skip-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.tour-skip-link[hidden] {
  display: none;
}

/* ---- Welcome step ---- */

/* ---- Pairwise step ---- */

.tour-pairwise {
  display: grid;
  gap: 24px;
  align-content: center;
}

.tour-pairwise-rings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tour-pairwise-rings.comparison-grid {
  width: 100%;
  max-width: none;
}

.tour-demo-card {
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  aspect-ratio: var(--ring-card-reference-ratio);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(26, 28, 28, 0.13), 0 8px 20px rgba(26, 28, 28, 0.07);
}

.tour-demo-card.is-leaning {
  border-color: rgba(24, 58, 51, 0.24);
  box-shadow: 0 34px 76px rgba(26, 28, 28, 0.16), 0 12px 28px rgba(26, 28, 28, 0.09);
  transform: translateY(-3px);
}

.tour-demo-card button:disabled {
  cursor: default;
  opacity: 1;
}

.tour-demo-card .ring-actions {
  left: 50%;
  right: auto;
  bottom: 10px;
  gap: 6px;
  transform: translateX(-50%);
}

.tour-demo-card .icon-button {
  width: 34px;
  height: 34px;
}

.tour-demo-card .material-symbols-outlined {
  font-size: 18px;
}

.tour-pick-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tour-choice-controls {
  max-width: none;
  width: 100%;
}

.tour-choice-controls .choice-button:disabled {
  cursor: default;
  opacity: 0.86;
}

.tour-pairwise-ring {
  display: grid;
  gap: 10px;
  margin: 0;
}

.tour-pairwise-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 24px 60px rgba(26, 28, 28, 0.13),
    0 8px 20px rgba(26, 28, 28, 0.07);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.tour-pairwise-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tour-pairwise-ring.is-leaning .tour-pairwise-photo {
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 36px 78px rgba(26, 28, 28, 0.17),
    0 14px 30px rgba(26, 28, 28, 0.09);
}

.tour-pairwise-ring.is-leaning .tour-pairwise-photo::after {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  height: 2px;
  border-radius: 999px;
  background: rgba(24, 58, 51, 0.42);
  content: "";
}

.tour-pairwise-ring figcaption {
  display: grid;
  gap: 4px;
}

.tour-pairwise-title {
  margin: 0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 16px;
  line-height: 1.25;
}

.tour-pairwise-caption {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tour-pairwise-actions {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(207, 196, 197, 0.7);
  color: var(--ink);
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

/* ---- Algorithm graphic (step 2) ---- */

.tour-algo-panel {
  display: grid;
  gap: 18px;
  align-content: center;
}

.tour-algo-loop {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tour-algo-step {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  align-items: center;
}

.tour-algo-step::before {
  position: absolute;
  top: 50%;
  left: 17px;
  width: 1px;
  height: calc(100% + 2px);
  background: rgba(24, 58, 51, 0.28);
  content: "";
  transform: translateY(0);
}

.tour-algo-step:last-of-type::before {
  display: none;
}

.tour-algo-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 14px;
  height: 14px;
  margin-left: 11px;
  border-radius: 999px;
  background: var(--moss-soft);
  box-shadow: 0 0 0 5px rgba(212, 230, 229, 0.32), inset 0 0 0 1px rgba(24, 58, 51, 0.18);
}

.tour-algo-step.is-final .tour-algo-dot {
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(212, 230, 229, 0.42), inset 0 0 0 1px rgba(24, 58, 51, 0.4);
}

.tour-algo-body {
  display: grid;
  gap: 2px;
}

.tour-algo-label {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif", Georgia, serif;
  font-size: 17px;
  line-height: 1.2;
}

.tour-algo-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tour-algo-loop-note {
  margin: -2px 0 0 54px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tour-algo-checkin {
  display: grid;
  gap: 8px;
  margin-left: 54px;
  padding: 14px 16px;
  border: 1px solid rgba(207, 196, 197, 0.56);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.tour-algo-checkin p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tour-algo-checkin .eyebrow {
  color: var(--blue);
}

.tour-checkin-card {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(207, 196, 197, 0.58);
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 12%, rgba(212, 230, 229, 0.58), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(250, 249, 249, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 28px 70px rgba(26, 28, 28, 0.12);
}

.tour-checkin-card h3 {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 400;
  line-height: 1.08;
}

.tour-checkin-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.tour-checkin-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(24, 58, 51, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.tour-checkin-example span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.tour-checkin-example strong {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(212, 230, 229, 0.52);
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Brief step ---- */

.tour-brief {
  display: grid;
  gap: 18px;
  align-content: center;
}

.onboarding-dialog[data-entry-stage="brief"] .onboarding-content {
  align-content: start;
  padding-top: clamp(66px, 8vw, 86px);
}

.tour-brief-excerpt {
  position: relative;
  display: grid;
  gap: clamp(12px, 1.7vw, 16px);
  overflow: hidden;
  min-height: 0;
  padding: clamp(22px, 3.4vw, 34px);
  border: 1px solid rgba(87, 104, 103, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(87, 104, 103, 0.92) 0 4px, transparent 4px),
    radial-gradient(circle at 14% 14%, var(--tour-brief-glow), transparent 32%),
    radial-gradient(circle at 92% 12%, rgba(87, 104, 103, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 245, 0.68) 48%, rgba(250, 249, 249, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 34px 82px rgba(26, 28, 28, 0.13),
    0 0 0 8px rgba(212, 230, 229, 0.12);
}

.tour-brief-excerpt::before {
  position: absolute;
  top: 16px;
  right: 24px;
  color: rgba(87, 104, 103, 0.12);
  content: "\201C";
  font-family: "Noto Serif", Georgia, serif;
  font-size: 112px;
  line-height: 0.7;
}

.tour-brief-excerpt::after {
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(87, 104, 103, 0.16);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 230, 229, 0.34), transparent 62%);
  content: "";
}

.tour-brief-excerpt > * {
  position: relative;
  z-index: 1;
}

.tour-brief-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tour-brief-head p {
  margin: 0;
  color: var(--tour-brief-accent);
}

.tour-brief-head span {
  padding: 7px 10px;
  border: 1px solid rgba(87, 104, 103, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tour-brief-excerpt blockquote {
  margin: 0;
  color: #213337;
  font-size: clamp(22px, 2.28vw, 29px);
  font-family: "Noto Serif", Georgia, serif;
  line-height: 1.18;
}

.tour-brief-excerpt-prominent {
  padding: clamp(23px, 3.4vw, 34px) clamp(26px, 4vw, 38px);
}

.tour-brief-excerpt em {
  font-style: italic;
  font-family: "Noto Serif", Georgia, serif;
  color: var(--tour-brief-accent);
}

.tour-brief-signals {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tour-brief-signals span {
  padding: 8px 11px;
  border: 1px solid rgba(87, 104, 103, 0.18);
  border-radius: 999px;
  background: rgba(212, 230, 229, 0.36);
  color: #263e42;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.tour-brief-meter-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.tour-brief-meter-list div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.tour-brief-meter-list span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tour-brief-meter-list strong {
  position: relative;
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(207, 196, 197, 0.38);
}

.tour-brief-meter-list strong::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--meter-strength);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tour-brief-accent), rgba(212, 230, 229, 0.9));
  content: "";
}

.tour-brief-meta {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--tour-brief-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tour-brief-checkin {
  display: grid;
  gap: 8px;
  padding: 16px 20px;
  border-left: 2px solid var(--moss-soft);
}

.tour-brief-checkin p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.tour-brief-checkin-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.tour-brief-checkin-actions span {
  padding: 6px 12px;
  border: 1px solid rgba(207, 196, 197, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- Transition step ---- */

.tour-transition {
  display: grid;
  gap: 18px;
  align-content: center;
}

.tour-transition-card {
  min-height: 150px;
  padding: clamp(24px, 4vw, 34px);
  border-left: 3px solid var(--ink);
}

.tour-transition-button {
  display: grid;
  gap: 8px;
  width: 100%;
  border-top: 1px solid rgba(207, 196, 197, 0.56);
  border-right: 1px solid rgba(207, 196, 197, 0.56);
  border-bottom: 1px solid rgba(207, 196, 197, 0.56);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 24px 58px rgba(26, 28, 28, 0.09);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.tour-transition-button:hover {
  border-color: rgba(24, 58, 51, 0.24);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 30px 64px rgba(26, 28, 28, 0.12);
  transform: translateY(-1px);
}

.tour-transition-button > span:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.48;
}

.tour-transition-card.is-quiet {
  border-left-color: rgba(207, 196, 197, 0.7);
}

.tour-transition-card .eyebrow {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.tour-transition-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Selected-state polish for filter-step pills inside the tour */
.onboarding-dialog[data-entry-stage="filter"] .onboarding-choice[aria-pressed="true"] {
  border-color: rgba(24, 58, 51, 0.3);
}

/* Hidden secondary button (step 1 has only Next) must not claim layout. */
.onboarding-actions button[hidden] {
  display: none;
}

.onboarding-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 18px;
  background: linear-gradient(180deg, rgba(250, 249, 249, 0), rgba(250, 249, 249, 0.94) 34%);
}

.onboarding-actions .primary-button,
.onboarding-actions .ghost-button {
  min-width: var(--tour-action-pill-width);
  min-height: 48px;
  border-radius: 999px;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(24, 58, 51, 0.08),
    0 18px 44px rgba(26, 28, 28, 0.13),
    0 6px 18px rgba(26, 28, 28, 0.08);
}

.onboarding-actions .primary-button {
  border-color: rgba(24, 58, 51, 0.22);
  background:
    linear-gradient(135deg, rgba(212, 230, 229, 0.72), rgba(255, 255, 255, 0.76)),
    rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.onboarding-actions .primary-button:hover {
  background:
    linear-gradient(135deg, rgba(212, 230, 229, 0.86), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.76);
}

.onboarding-actions .ghost-button {
  border-color: var(--line);
  background: var(--tour-pill-wash);
  color: var(--ink);
}

.onboarding-actions {
  position: static;
  display: contents;
}

.tour-arrow {
  position: absolute;
  bottom: clamp(22px, 3.2vw, 36px);
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 18px 44px rgba(26, 28, 28, 0.14),
    0 6px 18px rgba(26, 28, 28, 0.08);
}

.tour-arrow:hover,
.tour-arrow:focus-visible {
  background: rgba(255, 255, 255, 0.88);
}

.tour-arrow[hidden] {
  display: none;
}

.tour-arrow-back {
  left: 22px;
}

.tour-arrow-next {
  right: 22px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.brief-content {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.attribute-dialog {
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
}

.attribute-dialog-copy {
  margin: 0;
  padding: 20px 24px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.attribute-dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 20px 24px 12px;
}

.attribute-dialog .full-width {
  width: calc(100% - 48px);
  margin: 0 24px 24px;
}

.attribute-dialog .full-width[hidden] {
  display: none;
}

.include-choice {
  background: rgba(77, 132, 94, 0.14);
}

.exclude-choice {
  background: rgba(160, 72, 79, 0.14);
}

.brief-block {
  display: grid;
  gap: 8px;
}

.brief-block h3 {
  margin: 0;
  font-size: 15px;
}

.brief-block p,
.brief-block ul {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.brief-block ul {
  padding-left: 20px;
}

.decision-log {
  display: grid;
  gap: 8px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding: 0 4px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.decision-log strong {
  color: var(--ink);
}

.decision-log span {
  display: inline-block;
  margin-left: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 740;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 24px;
  }

  .side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    width: min(370px, calc(100vw - 36px));
    max-height: none;
    height: auto;
    padding: 18px 0 18px 18px;
    border-left: 1px solid var(--line);
    border-right: 0;
    border-radius: 0;
    background: var(--sidebar-surface);
    box-shadow: -18px 0 54px rgba(22, 31, 27, 0.18);
    transform: translateX(0);
    transition: transform 200ms ease;
  }

  body.sidebar-collapsed .side-panel {
    top: 96px;
    right: 16px;
    bottom: auto;
    z-index: 30;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    transform: none;
  }
}

@media (max-width: 860px) {
  .topbar-inner {
    height: 72px;
    padding: 0 18px;
  }

  .topbar-brand {
    font-size: 42px;
  }

  .topbar-phase .stage-kicker {
    gap: 8px;
    font-size: 11px;
  }

  .topbar-phase .stage-kicker::before,
  .topbar-phase .stage-kicker::after {
    width: 18px;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 108px 16px 64px;
  }

  .app-quick-actions {
    position: relative;
    top: auto;
    right: auto;
    /* note to piper: app shortcuts (mobile) - layout - 2x2 grid now that Taste read is always shown alongside Go back / More detail / Ring brief */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    margin: 84px 16px 0;
  }

  body.sidebar-collapsed .workspace {
    padding-top: 24px;
  }

  .info-drawer {
    width: calc(100vw - 24px);
    max-height: min(610px, 74dvh);
    padding: 18px;
  }

  .drawer-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .drawer-hero,
  .drawer-hero img {
    min-height: 220px;
    height: 220px;
  }

  .detail-row {
    grid-template-columns: 112px 1fr;
  }

  .choice-controls {
    grid-template-columns: 1fr;
    max-width: 100%;
    margin: 12px 0;
  }

  .calibration-controls {
    max-width: 100%;
    margin: 12px 0;
  }

  .calibration-choice-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkin-moment-actions {
    flex-direction: column;
    width: 100%;
  }

  /* note to piper: taste check dialog (mobile) - spacing - tighter padding + smaller ring previews so nothing spills off the narrow card */
  dialog.checkin-dialog {
    --checkin-dialog-pad-x: 20px;
    --checkin-dialog-pad-top: 30px;
    --checkin-dialog-pad-bottom: 28px;
    --checkin-evidence-size: 80px;
  }

  .checkin-dialog .checkin-headline {
    font-size: 24px;
  }

  .pool-exhausted-actions {
    flex-direction: column;
    width: 100%;
  }

  .ending-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .site-footer {
    padding: 0 16px 24px;
  }

  .footer-links {
    justify-content: flex-end;
  }

  .onboarding-card,
  .onboarding-dialog[data-entry-context="tour"] .onboarding-card {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: 96px;
  }

  .onboarding-copy {
    justify-content: flex-start;
  }

  .onboarding-copy h2 {
    font-size: clamp(42px, 11vw, 58px);
  }

  .guided-choice-grid {
    grid-template-columns: 1fr;
  }

  .guided-choice-columns {
    grid-template-columns: 1fr;
  }

  .onboarding-actions {
    grid-column: auto;
    flex-direction: column-reverse;
  }

  .tour-arrow {
    bottom: 18px;
  }

  .tour-arrow-back {
    left: 18px;
  }

  .tour-arrow-next {
    right: 18px;
  }

  .tour-algo-checkin,
  .tour-algo-loop-note {
    margin-left: 0;
  }

  .checkin-suggestion {
    grid-template-columns: 1fr;
  }

  .saved-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .policy-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 16px;
  }

  .policy-nav {
    justify-content: flex-start;
  }

  .policy-main {
    padding: 38px 0 56px;
  }

  .saved-page {
    padding: 32px 18px 30px;
  }

  .saved-page-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .saved-page-header h2 {
    font-size: 44px;
  }

  .saved-strip {
    gap: 16px;
  }
}

@media (max-width: 680px) {
  .comparison-grid {
    --ring-card-grid-gap: 12px;
  }
}

@media (max-width: 520px) {
  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
  }

  .topbar-brand {
    min-width: 0;
    overflow: hidden;
    font-size: 38px;
    text-overflow: clip;
  }

  .topbar-phase {
    display: none;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .tour-pairwise-rings.comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .tour-demo-card .ring-actions {
    left: 50%;
    right: auto;
    bottom: 8px;
    gap: 5px;
    transform: translateX(-50%);
  }

  .tour-demo-card .icon-button {
    width: 28px;
    height: 28px;
  }

  .tour-demo-card .material-symbols-outlined {
    font-size: 16px;
  }

  .choice-prompt {
    font-size: 40px;
  }

  .saved-page {
    padding: 28px 14px 24px;
  }

  .saved-page-header h2 {
    font-size: 38px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .ring-dislike-popover {
    width: min(326px, 100%);
  }
}

/* ===== Ring Brief v2 ===========================================================
   Scoped to .brief-dialog--v2 so the shared .brief-dialog base rules keep styling
   .attribute-dialog and .onboarding-dialog untouched. */

.brief-dialog--v2 {
  /* note to piper: ring brief - layout - dialog width on desktop */
  --brief-width: 880px;
  /* note to piper: ring brief - layout - dialog height cap before internal scroll */
  --brief-max-height: min(860px, calc(100dvh - 32px));
  /* note to piper: ring brief - layout - picks grid column count on desktop */
  --brief-picks-columns: 5;
  /* note to piper: ring brief - image - corner rounding on pick thumbnails */
  --brief-pick-radius: 10px;
  /* note to piper: ring brief - color - evidence bar fill */
  --brief-bar-fill: var(--blue);
  /* note to piper: ring brief - color - evidence bar track behind the fill */
  --brief-bar-track: var(--surface-container);
  /* note to piper: ring brief - color - soft wash behind the snapshot tiles */
  --brief-tile-wash: var(--surface-container-low);
  /* note to piper: ring brief - type - section heading size */
  --brief-heading-size: 15px;
  width: min(var(--brief-width), calc(100vw - 32px));
  max-height: var(--brief-max-height);
}

.brief-dialog--v2 form {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--brief-max-height) - 2px);
}

.brief-dialog--v2 .dialog-header {
  flex: none;
}

.brief-dialog--v2 .brief-content {
  flex: 1;
  gap: 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brief-v2-section {
  display: grid;
  gap: 10px;
}

.brief-v2-section + .brief-v2-section {
  padding-top: 22px;
  border-top: 1px solid var(--soft-line);
}

.brief-v2-heading {
  margin: 0;
  font-size: var(--brief-heading-size);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brief-v2-subcopy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.brief-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  list-style: none;
}

/* --- Narrative lede --- */

.brief-narrative {
  gap: 12px;
}

/* note to piper: ring brief - type - the prose lede at the top of the brief */
.brief-narrative p {
  margin: 0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
}

.brief-narrative p:first-child {
  font-size: 17px;
}

.brief-narrative p + p {
  color: var(--muted);
}

/* --- Profile snapshot --- */

.brief-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.brief-snapshot-tile {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--brief-tile-wash);
}

.brief-snapshot-tile strong {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 26px;
  line-height: 1.1;
}

.brief-snapshot-tile span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brief-snapshot-tile p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.brief-snapshot-counts {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* --- Your picks --- */

.brief-family-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brief-family-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-container-lowest);
  font-size: 12.5px;
}

.brief-family-pill em {
  color: var(--muted);
  font-style: normal;
  font-size: 11.5px;
}

.brief-picks-grid {
  display: grid;
  grid-template-columns: repeat(var(--brief-picks-columns), minmax(0, 1fr));
  gap: 12px;
}

.brief-pick {
  display: grid;
  gap: 6px;
  margin: 0;
}

.brief-pick-image {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--soft-line);
  border-radius: var(--brief-pick-radius);
  background: var(--surface-container-low);
  overflow: hidden;
}

.brief-pick-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  transform: rotate(var(--ring-image-rotation, 0deg)) scale(var(--ring-image-zoom, 1));
  transform-origin: var(--ring-image-x, 50%) var(--ring-image-y, 50%);
  filter: brightness(var(--ring-image-brightness, 1));
}

/* --- Strongest signals --- */

.brief-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.brief-signal-row {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
}

.brief-signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brief-signal-label {
  font-size: 13.5px;
  font-weight: 600;
}

.brief-status-chip {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 640;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--surface-container);
  color: var(--muted);
}

/* note to piper: ring brief - color - status chip tints per signal state */
/* note to piper: brief settled chip - color - settled = a category you narrowed to one value yourself; mirrors clear (confident positive) */
.brief-status-chip[data-status="settled"] {
  background: var(--moss-soft);
  color: var(--ink);
}

.brief-status-chip[data-status="clear"] {
  background: var(--moss-soft);
  color: var(--ink);
}

.brief-status-chip[data-status="leaning"] {
  background: rgba(87, 104, 103, 0.14);
  color: var(--blue);
}

.brief-status-chip[data-status="mixed"] {
  background: rgba(131, 49, 67, 0.12);
  color: var(--wine);
}

.brief-status-chip[data-status="ruled-out"] {
  background: var(--ink);
  color: var(--paper);
}

.brief-signal-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--brief-bar-track);
  overflow: hidden;
}

.brief-signal-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brief-bar-fill);
}

.brief-signal-copy,
.brief-signal-ruled {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.brief-signal-ruled {
  color: var(--wine);
}

/* --- Ask / Avoid --- */

.brief-askavoid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.brief-askavoid-col {
  display: grid;
  gap: 10px;
  align-content: start;
}

.brief-line-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief-line-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 14px;
  line-height: 1.45;
}

.brief-line-main em {
  color: var(--muted);
  font-style: normal;
  font-size: 12.5px;
}

.brief-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(81, 97, 97, 0.12);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.brief-tag-hard {
  background: var(--ink);
  color: var(--paper);
}

/* note to piper: brief settled tag - color - "Settled" ask pill; confident positive, mirrors the clear chip */
.brief-tag-settled {
  background: var(--moss-soft);
  color: var(--ink);
}

.brief-evidence-chip {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-container-lowest);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.brief-evidence-chip[aria-expanded="true"] {
  background: var(--secondary-container);
  color: var(--ink);
}

.brief-evidence-rounds {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
}

.brief-historical {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

@media (max-width: 640px) {
  .brief-dialog--v2 .brief-snapshot-grid,
  .brief-dialog--v2 .brief-signal-grid,
  .brief-dialog--v2 .brief-askavoid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* note to piper: ring brief - layout - picks grid drops to 2 columns on phones */
  .brief-dialog--v2 .brief-picks-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brief-dialog--v2 .brief-content {
    padding: 18px 16px;
  }
}
