/* Groove desktop web shell + shared component styles.
   Colors mirror lib/utils/groove_colors.dart's dark-navy theme. */

:root {
  color-scheme: dark;
  --navy-start: #1D3355;
  --navy-mid: #16294A;
  --navy-end: #101F38;
  --navy-card: #203658;
  --navy-card-secondary: #2B4468;
  --navy-border: #3D5678;
  /* Edge of form controls (inputs, selects, checkboxes): 3:1 or better against
     the card and the field fill (WCAG 1.4.11). Card/divider borders keep
     --navy-border. */
  --control-border: #7693B9;
  --gold: #E3AD45;
  --light-gray: #A3B3C8;
  --green: #119D5C;
  --figma-green: #12A566;
  /* --figma-green darkened for white text on green (4.67:1, WCAG 1.4.3).
     --figma-green itself stays: it's also used as a text color on navy. */
  --green-strong: #0E8552;
  /* Green for text on navy surfaces (4.68:1 or better, WCAG 1.4.3). */
  --green-light: #16CC7E;
  --link-green: #71C59E;
  /* Required-field asterisk: 4.66:1 or better on every navy surface. */
  --required-red: #FF9494;
  --white: #FFFFFF;
}

* {
  box-sizing: border-box;
}

/* Keyboard focus scrolls controls clear of the fixed Blobby launcher in the
   bottom-right corner (WCAG 2.4.11). */
html {
  scroll-padding-bottom: 112px;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--navy-end);
  color: var(--white);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Accessibility --- */

/* Keyboard focus ring for every control (WCAG 2.4.7). Feature sheets that
   remove an input's own outline show focus on its wrapper instead, below. */
:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.groove-calc-input:focus-within,
.goals-input:focus-within,
.cfr-mr-input:focus-within,
.gl-search:focus-within,
.blobby-input:focus-within,
.cft-search:focus-within {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Bare inputs whose feature sheet strips the outline (and loads after this
   sheet) — the extra class beats that rule's specificity. */
.settings-input:focus-visible,
.pz-input:focus-visible,
.signup-field input:focus-visible,
.cft-input:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Containers focused by script (route change, skip link) aren't controls. */
[tabindex="-1"]:focus {
  outline: none;
}

/* Read by screen readers, not shown. */
/* --- Loading skeletons (see groove_skeleton.dart) --- */

.groove-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Fill the slot the content will take, even in start/center-aligned parents. */
  align-self: stretch;
  width: 100%;
  min-width: 0;
}

/* Visible "Loading …" caption; --light-gray is 4.62:1+ on every navy surface. */
.groove-skeleton-label {
  margin: 0;
  font-size: 14px;
  color: var(--light-gray);
}

.groove-skel {
  display: block;
  max-width: 100%;
  flex-shrink: 0;
  background: linear-gradient(
    90deg,
    var(--navy-card-secondary) 0%,
    var(--navy-border) 50%,
    var(--navy-card-secondary) 100%
  );
  background-size: 200% 100%;
  animation: groove-skel-shimmer 1.4s ease-in-out infinite;
}

.groove-skel-line {
  border-radius: 6px;
}

.groove-skel-circle {
  border-radius: 50%;
}

@keyframes groove-skel-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* Red asterisk after a required field's label (WCAG 3.3.2). Hidden from
   screen readers via the empty alt text, since the field's aria-required
   already announces it. */
.groove-required::after {
  content: " *";
  content: " *" / "";
  color: var(--required-red);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.groove-skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--white);
  color: var(--navy-end);
  font-weight: 600;
  transform: translateY(-200%);
}

.groove-skip-link:focus {
  transform: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* --- Icon sprite --- */

.gi {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: inherit;
}

.gi path {
  fill: currentColor;
}

/* --- Shell layout ---
   Exact measurements from the Figma "home" frame (node 18474:330838). */

.groove-shell {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(130deg, var(--navy-start) 3.2%, var(--navy-mid) 47.2%, var(--navy-end) 108.9%);
}

.groove-sidebar {
  width: 241px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 48px 0;
  background: var(--navy-card);
  border-right: 1px solid var(--navy-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.groove-sidebar-logo-row {
  padding: 0 24px;
}

.groove-sidebar-logo {
  display: block;
}

.groove-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.groove-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  font-family: "Geist", sans-serif;
}

.groove-nav-item > span:first-of-type {
  white-space: nowrap;
}

.groove-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.groove-nav-item.active {
  background: var(--green-strong);
}

.groove-nav-icon {
  flex-shrink: 0;
}

.groove-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 40px;
  background: var(--navy-mid);
  flex-shrink: 0;
}

.groove-sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.groove-content {
  flex: 1;
  min-width: 0;
  max-width: 1200px;
  padding: 48px 120px;
}

/* --- NFCC badge (GrooveNfccBadge) ---
   Bottom of the sidebar (and of the small-screen drawer). Opens a modal with
   the badge at full size. */

.groove-sidebar-nfcc {
  padding: 0 24px;
}

/* Signed out there's no footer above it to push it down. */
.groove-nav + .groove-sidebar-nfcc {
  margin-top: auto;
}

.groove-nfcc-badge {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  transition: transform 0.15s ease;
}

.groove-nfcc-badge img {
  display: block;
  width: 72px;
  height: 72px;
}

.groove-nfcc-badge:hover {
  transform: scale(1.05);
}

/* The sidebar's view-transition-name makes it a stacking context, capping this
   overlay's z-index at the sidebar's level (positioned page content such as
   the featured carousel painted over it). Lift the sidebar while it's open. */
.groove-sidebar:has(.groove-nfcc-overlay) {
  z-index: 1200;
}

.groove-nfcc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(1.5px);
  animation: groove-fade-in 160ms ease-out both;
}

.groove-nfcc-modal {
  position: relative;
  display: flex;
  justify-content: center;
  width: 520px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 48px 40px 40px;
  border: 2px solid var(--navy-border);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.groove-nfcc-modal-img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
}

.groove-nfcc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 40px;
  background: transparent;
  color: var(--navy-end);
}

@media (max-width: 767.98px) {
  .groove-nfcc-modal {
    padding: 48px 16px 24px;
  }
}

/* --- Small screens (WCAG 1.4.10 reflow) ---
   Below 768px the sidebar becomes a drawer opened from a top bar's menu
   button (GrooveWebShell), so content reflows down to 320px wide. */

.groove-topbar,
.groove-drawer-close,
.groove-drawer-scrim {
  display: none;
}

@media (max-width: 767.98px) {
  .groove-shell {
    flex-direction: column;
  }

  .groove-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--navy-card);
    border-bottom: 1px solid var(--navy-border);
  }

  .groove-topbar-logo {
    display: block;
  }

  .groove-menu-button {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    color: var(--white);
  }

  /* Three-bar "hamburger" drawn from one bar plus its two shadows. */
  .groove-menu-bars {
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
  }

  .groove-sidebar {
    display: none;
  }

  .groove-sidebar.open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1100;
    width: min(241px, 85vw);
    height: 100%;
    padding: 16px 0 24px;
  }

  .groove-sidebar-logo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px 0 24px;
  }

  .groove-drawer-close {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    color: var(--white);
  }

  .groove-drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(16, 31, 56, 0.7);
  }

  .groove-content {
    max-width: 100%;
    padding: 24px 16px;
  }
}

/* --- Back link --- */

.groove-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
  font-weight: 500;
}

/* Same pill when it's a <button> (e.g. login "Resend Code"). */
button.groove-back-link {
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.groove-back-link .gi {
  width: 16px;
  height: 16px;
}

/* --- Pill buttons --- */

.groove-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 40px;
  border-radius: 40px;
  border: 1px solid var(--white);
  background: transparent;
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  font-family: "Geist", sans-serif;
}

.groove-pill.filled {
  background: var(--white);
  border-color: var(--navy-border);
  color: var(--navy-mid);
}

/* --- Featured content card ---
   Figma "featured" block: prev/next arrows, a 12px-rounded image with a
   "Featured" tag and bottom gradient title, and a 3-dot slide indicator. */

.groove-featured {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  margin-bottom: 40px;
}

.groove-featured-arrows {
  display: flex;
  gap: 8px;
}

.groove-featured-arrow {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--navy-card-secondary);
  border: 1px solid var(--navy-border);
  padding: 0;
}

.groove-featured-arrow:not(.disabled) {
  cursor: pointer;
}

.groove-featured-arrow.disabled {
  opacity: 0.4;
}

.groove-featured-image {
  position: relative;
  width: 100%;
  height: 327px;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--navy-card) center / cover no-repeat;
}

.groove-featured-tag {
  position: absolute;
  top: 19px;
  left: 19px;
  background: var(--navy-mid);
  border-radius: 2px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 600;
}

.groove-featured-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(22, 41, 74, 0.8) 56.6%, rgba(36, 57, 94, 0) 100%);
}

.groove-featured-overlay p {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.groove-featured-dots {
  display: flex;
  gap: 4px;
  justify-content: center;
  width: 100%;
}

.groove-featured-dot {
  width: 26px;
  height: 8px;
  padding: 0;
  border-radius: 2px;
  border: 1px solid var(--navy-border);
  background: transparent;
  cursor: pointer;
}

.groove-featured-dot.active {
  background: var(--white);
  border-color: var(--white);
}

/* --- Cards --- */

.groove-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.groove-card-grid.unlock {
  grid-template-columns: repeat(3, 1fr);
}

/* Each card sits in an <li>; stretch the card itself, not just its <li>/<a>,
   to the row height. */
.groove-card-grid > li,
.groove-card-grid > li > a {
  display: flex;
}

.groove-card-grid > li > a,
.groove-card-grid > li > .groove-feature-card,
.groove-card-grid > li > a > .groove-feature-card {
  flex: 1;
}

.groove-feature-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  border-radius: 8px;
  background: var(--navy-card-secondary);
  box-shadow: 0px 4px 12px 0px rgba(2, 9, 22, 0.35);
}

.groove-feature-card-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.groove-feature-card-icon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.groove-feature-card-tag {
  font-size: 12px;
  font-weight: 700;
  background: var(--gold);
  color: var(--navy-mid);
  padding: 1px 8px;
  border-radius: 8px;
}

.groove-feature-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.groove-feature-card-desc-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.groove-feature-card-desc {
  flex: 1;
  font-size: 14px;
  color: var(--white);
}

.groove-feature-card.locked .groove-feature-card-desc {
  color: var(--light-gray);
}

.groove-explore-heading {
  font-size: 18px;
  font-weight: 500;
  color: var(--gold);
  padding: 16px 0;
}

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.groove-unlock-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: 12px;
  background: var(--navy-card);
}

.groove-unlock-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.groove-unlock-heading-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 40px;
}

.groove-unlock-heading {
  margin: 0;
  color: var(--gold);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.groove-join-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 24px;
  border-radius: 40px;
  background: var(--white);
  color: var(--navy-mid);
  font-weight: 500;
  font-size: 16px;
}

/* --- Login --- */

.groove-login-card {
  max-width: 420px;
  margin: 64px auto;
  padding: 32px;
  border-radius: 16px;
  background: var(--navy-card);
}

.groove-login-card h1 {
  margin: 0 0 24px;
  font-size: 28px;
}

.groove-field {
  margin-bottom: 16px;
}

.groove-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.groove-field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--navy-card-secondary);
  color: var(--white);
  font-size: 15px;
}

.groove-field input::placeholder {
  color: var(--light-gray);
}

.groove-login-submit {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: #101F38;
  font-weight: 600;
  font-size: 16px;
}

.groove-login-submit.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--light-gray);
  cursor: progress;
}

.groove-spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid rgba(16, 31, 56, 0.25);
  border-top-color: #101F38;
  animation: groove-spin 0.7s linear infinite;
}

@keyframes groove-spin {
  to {
    transform: rotate(360deg);
  }
}

.groove-login-error {
  color: #FF8A8A;
  font-size: 13px;
  margin: -8px 0 16px;
}

.groove-login-divider {
  text-align: center;
  color: var(--light-gray);
  font-size: 14px;
  margin: 16px 0;
}

.groove-sso-button {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--navy-border);
  background: var(--navy-card-secondary);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
}

.groove-sso-button.is-loading {
  cursor: progress;
}

.groove-sso-button .groove-spinner {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
}

.groove-sso-button + .groove-sso-button {
  margin-top: 12px;
}

.groove-login-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

/* --- Calculators hub/category grids ---
   Measurements from the Figma "calculators" hub frame (node 18848:162366)
   and category frames (e.g. 18848:162589, 18848:162963): back button, 40px
   gap, title, 40px gap, then a 16/32px-padded 2-column grid of bordered
   tiles with a bare 40px Figma icon. */

.groove-page-title.groove-calc-heading,
.groove-calc-title.groove-calc-heading {
  margin: 0 0 40px;
  line-height: 1.2;
}

.groove-calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 32px 16px;
}

.groove-calc-tile {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  box-shadow: 0px 4px 12px 0px rgba(2, 9, 22, 0.35);
}

.groove-calc-tile-icon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.groove-calc-tile-icon-row img {
  display: block;
  width: 40px;
  height: 40px;
}

.groove-calc-tile-lock-tag {
  padding: 1px 8px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy-mid);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.groove-calc-tile-title-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.groove-calc-tile-title-row span {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.groove-calc-tile-title-row img {
  display: block;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

/* --- Calculators ---
   Measurements from the Figma "Auto Lease" / "Car Loan" form and result
   frames (nodes 18848:169845, 18868:170514, 18868:171275, 18868:170821):
   40px between back button, title block, tabs and card group; result
   cards stack 8px apart; 40px before the action button. */

.groove-calc-back {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.groove-calc-back-circle {
  width: 40px;
  height: 40px;
  border-radius: 40px;
  background: var(--navy-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.groove-calc-back-circle img {
  display: block;
}

.groove-calc-title-block {
  margin-bottom: 40px;
}

.groove-calc-title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.groove-calc-subtitle {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--light-gray);
}

.groove-calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}

.groove-calc-card .groove-calc-tabs {
  margin-bottom: 0;
}

.groove-calc-tab {
  padding: 6px 16px;
  border-radius: 24px;
  border: none;
  background: var(--navy-card);
  color: var(--white);
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
}

.groove-calc-card .groove-calc-tab {
  background: var(--navy-card-secondary);
}

.groove-calc-tab.active {
  background: var(--white);
  color: var(--navy-mid);
  font-weight: 500;
}

.groove-calc-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--navy-card);
  margin-bottom: 8px;
}

.groove-calc-card.result {
  gap: 24px;
}

.groove-calc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.groove-calc-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
}

.groove-calc-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--navy-card-secondary);
  border: 1px solid var(--control-border);
}

.groove-calc-input input {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 16px;
  font-weight: 400;
  line-height: 25px;
  font-family: "Geist", sans-serif;
}

.groove-calc-input img {
  display: block;
  flex-shrink: 0;
}

.groove-calc-input .gi {
  flex-shrink: 0;
}

.groove-calc-unit {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--white);
}

.groove-calc-terms {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.groove-calc-terms-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.groove-calc-term {
  height: 40px;
  padding: 0 16px;
  border-radius: 40px;
  border: 1px solid var(--navy-border);
  background: var(--navy-card-secondary);
  color: var(--white);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}

.groove-calc-term.active {
  background: var(--gold);
  color: var(--navy-mid);
}

.groove-calc-result-highlight {
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: #53dda2;
}

.groove-calc-result-headline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  line-height: 1.2;
}

.groove-calc-result-headline p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.groove-calc-result-headline p.value {
  font-size: 24px;
  color: var(--gold);
}

.groove-calc-result-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.4;
}

.groove-calc-result-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.groove-calc-result-row span {
  font-size: 14px;
  color: var(--light-gray);
}

.groove-calc-result-row span.value {
  font-size: 16px;
  color: var(--white);
  text-align: right;
}

.groove-calc-chart-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.groove-calc-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.groove-calc-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.groove-calc-legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Figma "Primary/Secondary No Icon" buttons: 358px filled, 375px outlined. */
.groove-calc-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 375px;
  max-width: 100%;
  min-height: 40px;
  margin-top: 32px;
  padding: 6px 24px;
  border-radius: 40px;
  border: 1px solid var(--white);
  background: transparent;
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  line-height: 25px;
  font-family: "Geist", sans-serif;
}

.groove-calc-button.filled {
  width: 358px;
  background: var(--white);
  border-color: var(--navy-border);
  color: var(--navy-mid);
}

/* --- Financial Emergency ---
   Measurements from the Figma "emergency" (categories, node 18956:429926)
   and "financial aid" (detail, node 18961:431928) frames. */

.groove-page-title {
  margin: 0 0 24px;
  font-size: 40px;
  font-weight: 500;
}

.groove-emergency-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Grid lists: each <li> stretches its tile/card to the row height. */
.groove-emergency-grid > li,
.groove-emergency-resource-grid > li {
  display: flex;
}

.groove-emergency-grid > li > *,
.groove-emergency-resource-grid > li > * {
  flex: 1;
}

.groove-emergency-tile {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 8px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  box-shadow: 0px 4px 12px 0px rgba(2, 9, 22, 0.35);
}

.groove-emergency-tile-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.groove-emergency-tile-title-row span {
  font-size: 18px;
  font-weight: 500;
}

.groove-emergency-detail-title {
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 500;
}

.groove-zip-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 8px 16px;
  margin-bottom: 24px;
  border-radius: 40px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
}

.groove-emergency-section {
  margin-bottom: 24px;
}

.groove-emergency-section-heading {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 500;
  color: var(--gold);
}

.groove-emergency-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.groove-emergency-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: 12px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  box-shadow: 0px 4px 12px 0px rgba(2, 9, 22, 0.35);
}

.groove-emergency-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.groove-emergency-card-top .name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.groove-emergency-card-top .distance {
  font-size: 14px;
  font-weight: 400;
  flex-shrink: 0;
}

.groove-emergency-card-links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.groove-emergency-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--link-green);
  font-size: 14px;
}

.groove-emergency-card-desc {
  font-size: 12px;
  color: var(--light-gray);
}

.groove-emergency-visit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 24px;
  border-radius: 40px;
  border: 1px solid var(--navy-border);
  background: transparent;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  font-family: "Geist", sans-serif;
}

.groove-emergency-empty {
  padding: 16px;
  border-radius: 12px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  color: var(--light-gray);
  font-size: 13px;
  text-align: center;
}

/* --- Toast (SnackbarService web impl) --- */

.groove-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  padding-right: 40px;
}

.groove-toast-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
}

/* --- Transitions ---
   Mobile fades between screens (fadeGoRoute). On web: the content pane fades
   up on every navigation (the shell keys it by URL; the sidebar stays put),
   full page loads crossfade via cross-document view transitions, and modals
   and calculator results ease in when they appear. */

@keyframes groove-page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes groove-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes groove-dialog-enter {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.groove-content {
  /* No fill mode: a filling transform animation would keep this element the
     containing block for position: fixed modals inside it. */
  animation: groove-page-enter 240ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

@view-transition {
  navigation: auto;
}

.groove-sidebar {
  view-transition-name: groove-sidebar;
}

::view-transition-group(groove-sidebar) {
  animation: none;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 160ms;
}

.cf-modal-backdrop,
.cfr-modal-backdrop,
.split-overlay,
.cft-overlay,
.gh-overlay,
.gl-overlay,
.mp-modal-backdrop,
.mp-busy,
.settings-overlay,
.cfo-wizard {
  animation: groove-fade-in 160ms ease-out both;
}

.cf-modal-backdrop > *,
.cfr-modal-backdrop > *,
.split-overlay > *,
.cft-overlay > *,
.gh-overlay > *,
.gl-overlay > *,
.mp-modal-backdrop > *,
.settings-overlay > *,
[role="dialog"] {
  animation: groove-dialog-enter 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.groove-calc-card {
  animation: groove-page-enter 240ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Premium upsell (learn_premium_web_view.dart) ---
   The benefits are a <ul>; lay it out as the rows were in .premium-benefits. */

.premium-benefit-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Reflow (WCAG 1.4.10) ---
   Kept last so these override the base rules above. */

/* Tablet widths: the sidebar stays, so tighten the content gutters. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .groove-content {
    padding: 48px 40px;
  }
}

/* Multi-column grids drop columns as the content area narrows. */
@media (max-width: 1023.98px) {
  .groove-card-grid,
  .groove-card-grid.unlock,
  .groove-emergency-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479.98px) {
  .groove-card-grid,
  .groove-card-grid.unlock,
  .groove-emergency-grid,
  .groove-emergency-resource-grid,
  .groove-calc-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .groove-page-title {
    font-size: 32px;
  }
}
