/* ============================================================
   SaveUp AI — Material Design 3 (Material You) Design System
   Color scheme: M3 Green "Savings" Dynamic Color
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Google+Sans+Display:wght@400;500;700&family=Roboto:wght@300;400;500;700&display=swap');

/* Modal default display when visible (not hidden) */
#pdf-modal:not(.hidden) {
  display: flex;
}

#impulse-check-modal:not(.hidden) {
  display: flex;
}

#ai-chat-window.flex {
  display: flex !important;
}

#impulse-loading:not(.hidden) {
  display: flex;
}

#impulse-result-section:not(.hidden) {
  display: flex;
}

#search-status-bar:not(.hidden) {
  display: flex;
}

#scanner-status:not(.hidden) {
  display: flex;
}

#genz-easter-egg:not(.hidden) {
  display: flex;
}

#preset-reset-btn:not(.hidden) {
  display: inline-flex;
}

#home-reset-btn:not(.hidden) {
  display: inline-flex;
}

/* ============================================================
   M3 Color Tokens — Light Scheme (Purple)
   ============================================================ */
:root {
  /* Primary */
  --md-sys-color-primary: #6750A4;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #EADDFF;
  --md-sys-color-on-primary-container: #21005D;

  /* Secondary */
  --md-sys-color-secondary: #625B71;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #E8DEF8;
  --md-sys-color-on-secondary-container: #1D192B;

  /* Tertiary */
  --md-sys-color-tertiary: #7D5260;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #FFD8E4;
  --md-sys-color-on-tertiary-container: #31111D;

  /* Error */
  --md-sys-color-error: #B3261E;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-error-container: #F9DEDC;
  --md-sys-color-on-error-container: #410E0B;

  /* Neutral / Surface */
  --md-sys-color-background: #FFFBFE;
  --md-sys-color-on-background: #1C1B1F;
  --md-sys-color-surface: #FFFBFE;
  --md-sys-color-on-surface: #1C1B1F;
  --md-sys-color-surface-variant: #E7E0EC;
  --md-sys-color-on-surface-variant: #49454F;

  --md-sys-color-surface-container-lowest: #FFFFFF;
  --md-sys-color-surface-container-low: #F7F2F9;
  --md-sys-color-surface-container: #F3EDF7;
  --md-sys-color-surface-container-high: #ECE6F0;
  --md-sys-color-surface-container-highest: #E6E0E9;

  /* Outline */
  --md-sys-color-outline: #79747E;
  --md-sys-color-outline-variant: #CAC4D0;

  /* Inverse */
  --md-sys-color-inverse-surface: #313033;
  --md-sys-color-inverse-on-surface: #F4EFF4;
  --md-sys-color-inverse-primary: #D0BCFF;

  /* Scrim */
  --md-sys-color-scrim: #000000;

  /* Warning */
  --md-sys-color-warning: #7C5800;
  --md-sys-color-warning-container: #FFDEA9;
  --md-sys-color-on-warning-container: #271900;

  /* ============================================================
     M3 Shape (Corner Radii)
     ============================================================ */
  --md-sys-shape-none: 0px;
  --md-sys-shape-extra-small: 4px;
  --md-sys-shape-small: 8px;
  --md-sys-shape-medium: 12px;
  --md-sys-shape-large: 16px;
  --md-sys-shape-extra-large: 28px;
  --md-sys-shape-full: 9999px;

  /* ============================================================
     M3 Elevation (shadow layers)
     ============================================================ */
  --md-sys-elevation-0: none;
  --md-sys-elevation-1: 0px 1px 2px rgba(0, 0, 0, .14), 0px 1px 3px 1px rgba(0, 0, 0, .12);
  --md-sys-elevation-2: 0px 1px 2px rgba(0, 0, 0, .14), 0px 2px 6px 2px rgba(0, 0, 0, .12);
  --md-sys-elevation-3: 0px 1px 3px rgba(0, 0, 0, .14), 0px 4px 8px 3px rgba(0, 0, 0, .12);
  --md-sys-elevation-4: 0px 2px 3px rgba(0, 0, 0, .14), 0px 6px 10px 4px rgba(0, 0, 0, .12);
  --md-sys-elevation-5: 0px 4px 4px rgba(0, 0, 0, .14), 0px 8px 12px 6px rgba(0, 0, 0, .12);

  /* ============================================================
     M3 Motion
     ============================================================ */
  --md-sys-motion-duration-short1: 50ms;
  --md-sys-motion-duration-short2: 100ms;
  --md-sys-motion-duration-short3: 150ms;
  --md-sys-motion-duration-short4: 200ms;
  --md-sys-motion-duration-medium1: 250ms;
  --md-sys-motion-duration-medium2: 300ms;
  --md-sys-motion-duration-medium3: 350ms;
  --md-sys-motion-duration-medium4: 400ms;
  --md-sys-motion-duration-long1: 450ms;
  --md-sys-motion-duration-long2: 500ms;

  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
  --md-sys-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized-decel: cubic-bezier(0.05, 0.7, 0.1, 1);
  --md-sys-motion-easing-emphasized-accel: cubic-bezier(0.3, 0, 0.8, 0.15);
}

/* ============================================================
   M3 Color Tokens — Dark Scheme (Purple)
   ============================================================ */
.dark {
  --md-sys-color-primary: #D0BCFF;
  --md-sys-color-on-primary: #381E72;
  --md-sys-color-primary-container: #4F378B;
  --md-sys-color-on-primary-container: #EADDFF;

  --md-sys-color-secondary: #CCC2DC;
  --md-sys-color-on-secondary: #332D41;
  --md-sys-color-secondary-container: #4A4458;
  --md-sys-color-on-secondary-container: #E8DEF8;

  --md-sys-color-tertiary: #EFB8C8;
  --md-sys-color-on-tertiary: #492532;
  --md-sys-color-tertiary-container: #633B48;
  --md-sys-color-on-tertiary-container: #FFD8E4;

  --md-sys-color-error: #F2B8B5;
  --md-sys-color-on-error: #601410;
  --md-sys-color-error-container: #8C1D18;
  --md-sys-color-on-error-container: #F9DEDC;

  --md-sys-color-background: #1C1B1F;
  --md-sys-color-on-background: #E6E1E5;
  --md-sys-color-surface: #1C1B1F;
  --md-sys-color-on-surface: #E6E1E5;
  --md-sys-color-surface-variant: #49454F;
  --md-sys-color-on-surface-variant: #CAC4D0;

  --md-sys-color-surface-container-lowest: #0F0D13;
  --md-sys-color-surface-container-low: #1D1B20;
  --md-sys-color-surface-container: #211F26;
  --md-sys-color-surface-container-high: #2B2930;
  --md-sys-color-surface-container-highest: #36343B;

  --md-sys-color-outline: #938F99;
  --md-sys-color-outline-variant: #49454F;

  --md-sys-color-inverse-surface: #E6E1E5;
  --md-sys-color-inverse-on-surface: #313033;
  --md-sys-color-inverse-primary: #6750A4;

  --md-sys-color-warning: #F9BC18;
  --md-sys-color-warning-container: #5C4000;
  --md-sys-color-on-warning-container: #FFDEA9;
}

/* ============================================================
   Base Reset & Typography
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  height: 100%;
}

/* =========================================================
   CLEAN MATERIAL YOU BACKGROUND CANVAS
   ========================================================= */

/* Dark Mode Default Canvas */
body {
  background-color: #131118;
  background-image: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  margin: 0;
  padding-bottom: 120px;
  position: relative;
  font-family: 'Google Sans', 'Roboto', system-ui, sans-serif;
  color: var(--md-sys-color-on-background);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Light Mode Canvas */
body.light-theme,
html.light body,
[data-theme="light"] body {
  background-color: #F7F6FB !important;
  background-image: radial-gradient(circle at 50% 0%, rgba(192, 132, 252, 0.12) 0%, transparent 60%) !important;
  color: #1E1B24 !important;
}

/* Subtle architectural micro-grid on the container level */
.grid-canvas-overlay {
  background-size: 32px 32px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}

body.light-theme .grid-canvas-overlay,
html.light .grid-canvas-overlay,
[data-theme="light"] .grid-canvas-overlay {
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.025) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
}

/* M3 Type Scale */
.md3-display-large {
  font-size: 3.5625rem;
  font-weight: 400;
  line-height: 4rem;
  letter-spacing: -0.016em;
  font-family: 'Google Sans Display', 'Google Sans', 'Roboto', sans-serif;
}

.md3-display-medium {
  font-size: 2.8125rem;
  font-weight: 400;
  line-height: 3.25rem;
  letter-spacing: 0;
  font-family: 'Google Sans Display', 'Google Sans', 'Roboto', sans-serif;
}

.md3-display-small {
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 2.75rem;
  letter-spacing: 0;
  font-family: 'Google Sans Display', 'Google Sans', 'Roboto', sans-serif;
}

.md3-headline-large {
  font-size: 2rem;
  font-weight: 400;
  line-height: 2.5rem;
  letter-spacing: 0;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.md3-headline-medium {
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 2.25rem;
  letter-spacing: 0;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.md3-headline-small {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 2rem;
  letter-spacing: 0;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.md3-title-large {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.75rem;
  letter-spacing: 0;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.md3-title-medium {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  letter-spacing: 0.009em;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.md3-title-small {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  letter-spacing: 0.006em;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.md3-body-large {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5rem;
  letter-spacing: 0.031em;
}

.md3-body-medium {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  letter-spacing: 0.016em;
}

.md3-body-small {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1rem;
  letter-spacing: 0.025em;
}

.md3-label-large {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  letter-spacing: 0.006em;
}

.md3-label-medium {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1rem;
  letter-spacing: 0.031em;
}

.md3-label-small {
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1rem;
  letter-spacing: 0.031em;
}

/* ============================================================
   M3 Custom Scrollbar
   ============================================================ */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--md-sys-color-outline);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ============================================================
   M3 Layout Utilities
   ============================================================ */
.md3-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 600px) {
  .md3-container {
    padding: 0 1.5rem;
  }
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

/* ============================================================
   M3 Top App Bar
   ============================================================ */
.md3-top-app-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  padding: 0 1rem 0 0.5rem;
  /* M3 elevation via tonal surface — no hard shadow by default */
  box-shadow: var(--md-sys-elevation-1);
  transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md3-top-app-bar .md3-top-app-bar__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo / Brand */
.md3-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.md3-brand__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--md-sys-shape-medium);
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.md3-brand__name {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--md-sys-color-on-surface);
}

.md3-brand__name span {
  color: var(--md-sys-color-primary);
}

.md3-brand__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-extra-small);
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   M3 Stepper Navigation (Segmented Button style)
   ============================================================ */
.md3-stepper-nav {
  display: flex;
  align-items: center;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-full);
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.step-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-full);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  background: transparent;
  border: none;
  cursor: pointer;
  transition:
    background-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  overflow: hidden;
  white-space: nowrap;
}

.step-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.step-nav-btn:hover::before {
  opacity: 0.08;
}

.step-nav-btn:active::before {
  opacity: 0.12;
}

.step-nav-btn:hover {
  color: var(--md-sys-color-on-surface);
}

.step-nav-btn.active {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.step-nav-btn.active::before {
  background-color: var(--md-sys-color-on-secondary-container);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: var(--md-sys-shape-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  background-color: var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  transition: background-color var(--md-sys-motion-duration-short4), color var(--md-sys-motion-duration-short4);
}

.step-nav-btn.active .step-num {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

/* ============================================================
   M3 Header Action Buttons (icon-button + tonal-button)
   ============================================================ */
.md3-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-full);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.006em;
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    background-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md3-icon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md3-icon-btn:hover::before {
  opacity: 0.08;
}

.md3-icon-btn:active::before {
  opacity: 0.12;
}

.md3-icon-btn:active {
  transform: scale(0.97);
}

.md3-btn-ai {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.md3-btn-ai::before {
  background-color: var(--md-sys-color-on-primary-container);
}

/* Status dot */
.status-dot {
  animation: statusPulse 2.5s ease-in-out infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

/* ============================================================
   M3 Filled Button
   ============================================================ */
.md3-btn-filled {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border-radius: var(--md-sys-shape-full);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.006em;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-0);
  text-decoration: none;
  transition:
    background-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  white-space: nowrap;
}

.md3-btn-filled::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-on-primary);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.md3-btn-filled:hover {
  box-shadow: var(--md-sys-elevation-1);
}

.md3-btn-filled:hover::before {
  opacity: 0.08;
}

.md3-btn-filled:active::before {
  opacity: 0.12;
}

.md3-btn-filled:active {
  transform: scale(0.97);
}

.md3-btn-filled:disabled {
  background-color: rgba(var(--md-sys-color-on-surface-rgb, 23, 29, 26), 0.12);
  color: rgba(var(--md-sys-color-on-surface-rgb, 23, 29, 26), 0.38);
  box-shadow: none;
  cursor: not-allowed;
}

/* ============================================================
   M3 Tonal Button (FilledTonal)
   ============================================================ */
.md3-btn-tonal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border-radius: var(--md-sys-shape-full);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.006em;
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: none;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  transition:
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  white-space: nowrap;
}

.md3-btn-tonal::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-on-secondary-container);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.md3-btn-tonal:hover {
  box-shadow: var(--md-sys-elevation-1);
}

.md3-btn-tonal:hover::before {
  opacity: 0.08;
}

.md3-btn-tonal:active::before {
  opacity: 0.12;
}

.md3-btn-tonal:active {
  transform: scale(0.97);
}

/* ============================================================
   M3 Outlined Button
   ============================================================ */
.md3-btn-outlined {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border-radius: var(--md-sys-shape-full);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.006em;
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow var(--md-sys-motion-duration-short4), transform var(--md-sys-motion-duration-short3);
  white-space: nowrap;
}

.md3-btn-outlined::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-primary);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.md3-btn-outlined:hover::before {
  opacity: 0.08;
}

.md3-btn-outlined:active::before {
  opacity: 0.12;
}

.md3-btn-outlined:active {
  transform: scale(0.97);
}

/* ============================================================
   M3 Text Button
   ============================================================ */
.md3-btn-text {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--md-sys-shape-full);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.006em;
  background: transparent;
  color: var(--md-sys-color-primary);
  border: none;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--md-sys-motion-duration-short3);
  white-space: nowrap;
}

.md3-btn-text::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-primary);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.md3-btn-text:hover::before {
  opacity: 0.08;
}

.md3-btn-text:active::before {
  opacity: 0.12;
}

.md3-btn-text:active {
  transform: scale(0.97);
}

/* Small variant */
.md3-btn-text-sm {
  height: 32px;
  padding: 0 10px;
  font-size: 0.8125rem;
}

/* ============================================================
   M3 Extended FAB (Floating Action Button)
   ============================================================ */
.md3-fab-extended {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px;
  border-radius: var(--md-sys-shape-large);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.006em;
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: none;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-3);
  transition:
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  white-space: nowrap;
}

.md3-fab-extended::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-on-primary-container);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.md3-fab-extended:hover {
  box-shadow: var(--md-sys-elevation-4);
}

.md3-fab-extended:hover::before {
  opacity: 0.08;
}

.md3-fab-extended:active {
  box-shadow: var(--md-sys-elevation-3);
}

.md3-fab-extended:active::before {
  opacity: 0.12;
}

.md3-fab-extended:active {
  transform: scale(0.97);
}

/* ============================================================
   M3 Cards
   ============================================================ */
/* Elevated Card */
.md3-card-elevated {
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-medium);
  box-shadow: var(--md-sys-elevation-1);
  transition:
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md3-card-elevated:hover {
  box-shadow: var(--md-sys-elevation-2);
}

/* Filled Card */
.md3-card-filled {
  background-color: var(--md-sys-color-surface-container-highest);
  border-radius: var(--md-sys-shape-medium);
  transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

/* Outlined Card */
.md3-card-outlined {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-medium);
  transition:
    border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md3-card-outlined:hover {
  box-shadow: var(--md-sys-elevation-1);
}

/* ============================================================
   M3 Preset Goal Cards
   ============================================================ */
.preset-card {
  position: relative;
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-medium);
  padding: 20px;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preset-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.preset-card:hover {
  box-shadow: var(--md-sys-elevation-2);
  transform: translateY(-2px);
  border-color: var(--md-sys-color-primary);
}

.preset-card:hover::before {
  opacity: 0.04;
}

.preset-card:active::before {
  opacity: 0.1;
}

.preset-card.selected {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  background-color: var(--md-sys-color-primary-container);
  box-shadow: var(--md-sys-elevation-1);
}

.preset-card.selected .preset-card-name {
  color: var(--md-sys-color-on-primary-container);
}

.preset-card.selected .preset-card-desc {
  color: var(--md-sys-color-on-primary-container);
  opacity: 0.8;
}

/* Preset card inner classes referenced from app.js innerHTML */
.preset-card .preset-card-name,
.preset-card h4 {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  transition: color var(--md-sys-motion-duration-short4);
}

.preset-card p,
.preset-card .preset-card-desc {
  font-size: 0.8125rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.4;
}

.preset-card .text-brand-400 {
  color: var(--md-sys-color-primary);
  font-weight: 600;
}

/* ============================================================
   M3 Outlined Text Field
   ============================================================ */
.md3-text-field {
  position: relative;
  width: 100%;
}

.md3-text-field label {
  display: block;
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.031em;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 6px;
}

.md3-text-field input[type="text"],
.md3-text-field select,
.md3-text-field input[type="number"] {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-extra-small);
  border: 1px solid var(--md-sys-color-outline);
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: 'Roboto', 'Google Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  transition:
    border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  -webkit-appearance: none;
  appearance: none;
}

.md3-text-field input[type="text"]::placeholder,
.md3-text-field input[type="number"]::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.6;
}

.md3-text-field input[type="text"]:hover,
.md3-text-field select:hover {
  border-color: var(--md-sys-color-on-surface);
}

.md3-text-field input[type="text"]:focus,
.md3-text-field select:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  box-shadow: none;
  padding: 0 15px;
  /* compensate for border width increase */
}

/* Material You Form Overrides */
input[type="text"],
input[type="number"],
input[type="search"],
textarea,
.md3-select-trigger {
  font-family: 'Google Sans', 'Roboto', system-ui, sans-serif;
  color: var(--md-sys-color-on-surface);
}

/* ============================================================
   Custom Material 3 Select Menu
   ============================================================ */
.md3-custom-select-container {
  position: relative;
  width: 100%;
}

.md3-select-trigger {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 16px;
  border-radius: var(--md-sys-shape-extra-small) var(--md-sys-shape-extra-small) 0 0;
  border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface);
  font-size: 0.9375rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  outline: none;
  transition: border-bottom-color 0.2s, background-color 0.2s;
  user-select: none;
}

.md3-select-trigger:hover {
  background-color: var(--md-sys-color-surface-container-highest);
}

.md3-select-trigger:focus,
.md3-custom-select-container.open .md3-select-trigger {
  border-bottom: 2px solid var(--md-sys-color-primary);
}

.md3-select-trigger .lucide-chevron-down {
  position: absolute;
  right: 16px;
  color: var(--md-sys-color-on-surface-variant);
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.md3-custom-select-container.open .md3-select-trigger .lucide-chevron-down {
  transform: rotate(180deg);
  color: var(--md-sys-color-primary);
}

.md3-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background-color: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-small);
  box-shadow: var(--md-sys-elevation-2);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.2, 0, 0, 1), visibility 0.2s;
}

.md3-custom-select-container.open .md3-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.md3-select-dropdown::-webkit-scrollbar {
  width: 8px;
}

.md3-select-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.md3-select-dropdown::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-full);
}

.md3-select-option {
  padding: 12px 16px;
  font-size: 0.9375rem;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.15s;
}

.md3-select-option:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.md3-select-option.selected {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 500;
}

.md3-select-option.selected .lucide-check {
  display: block;
}

.md3-select-option .lucide-check {
  display: none;
  width: 18px;
  height: 18px;
  color: var(--md-sys-color-primary);
}

/* Global input overrides (for inline inputs in the HTML) */
input[type="text"],
input[type="number"] {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-extra-small);
  border: 1px solid var(--md-sys-color-outline);
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--md-sys-color-primary);
}

/* ============================================================
   Segmented Buttons (Mode Toggle)
   ============================================================ */
.md3-seg-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--md-sys-shape-extra-large);
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.md3-seg-btn-active {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  box-shadow: var(--md-sys-elevation-1);
}

.md3-seg-btn-inactive {
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.8;
}

.md3-seg-btn-inactive:hover {
  background-color: var(--md-sys-color-surface-variant);
  opacity: 1;
}

input[type="text"]::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.6;
}

input[type="text"]:hover {
  border-color: var(--md-sys-color-on-surface);
}

input[type="text"]:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  padding: 9px 13px;
}

/* Select dropdown */
select {
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-extra-small);
  font-family: 'Roboto', 'Google Sans', sans-serif;
  font-size: 0.9375rem;
  outline: none;
  padding: 10px 40px 10px 14px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236F7972' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.15s;
  cursor: pointer;
}

.dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A9389' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

select:hover {
  border-color: var(--md-sys-color-on-surface);
}

select:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  outline: none;
}

/* ============================================================
   M3 Slider
   ============================================================ */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--md-sys-shape-full);
  background: var(--md-sys-color-secondary-container);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: var(--md-sys-shape-full);
  background: var(--md-sys-color-primary);
  border: none;
  box-shadow: var(--md-sys-elevation-1);
  cursor: pointer;
  transition: box-shadow var(--md-sys-motion-duration-short4);
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--md-sys-color-primary) 16%, transparent);
}

input[type="range"]::-webkit-slider-thumb:active {
  box-shadow: 0 0 0 12px color-mix(in srgb, var(--md-sys-color-primary) 24%, transparent);
}

input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--md-sys-color-primary) 24%, transparent);
}

/* ============================================================
   M3 Chip (Assist / Suggestion / Filter)
   ============================================================ */
.md3-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--md-sys-shape-small);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.006em;
  border: 1px solid var(--md-sys-color-outline);
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: box-shadow var(--md-sys-motion-duration-short4);
}

.md3-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.md3-chip:hover {
  box-shadow: var(--md-sys-elevation-1);
}

.md3-chip:hover::before {
  opacity: 0.08;
}

.md3-chip:active::before {
  opacity: 0.12;
}

/* Assist chip with tonal fill */
.md3-chip-tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: none;
}

.md3-chip-tonal::before {
  background-color: var(--md-sys-color-on-secondary-container);
}

/* ============================================================
   M3 Badge (small label pill)
   ============================================================ */
.md3-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-full);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.md3-badge-primary {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: none;
}

.md3-badge-secondary {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: none;
}

.md3-badge-tertiary {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border: none;
}

.md3-badge-warning {
  background-color: var(--md-sys-color-warning-container);
  color: var(--md-sys-color-on-warning-container);
  border: none;
}

.md3-badge-error {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border: none;
}

/* ============================================================
   M3 Dialog (Modal)
   ============================================================ */
.md3-dialog-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.md3-dialog {
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-extra-large);
  box-shadow: var(--md-sys-elevation-3);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  animation: dialogEnter var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decel) forwards;
}

.md3-dialog-full {
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

@keyframes dialogEnter {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.md3-dialog-header {
  padding: 24px 24px 0;
}

.md3-dialog-header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-full);
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.md3-dialog-title {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  line-height: 1.333;
}

.md3-dialog-subhead {
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 4px;
}

.md3-dialog-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

.md3-dialog-actions {
  padding: 8px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.md3-dialog-top-bar {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  flex-shrink: 0;
}

/* ============================================================
   M3 Linear Progress Indicator
   ============================================================ */
.md3-progress-bar-track {
  width: 100%;
  height: 4px;
  background-color: var(--md-sys-color-secondary-container);
  border-radius: var(--md-sys-shape-full);
  overflow: hidden;
}

.md3-progress-bar-indicator {
  height: 100%;
  background-color: var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-full);
  transition: width var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
}

/* ============================================================
   M3 Divider
   ============================================================ */
.md3-divider {
  width: 100%;
  height: 1px;
  background-color: var(--md-sys-color-outline-variant);
}

/* ============================================================
   M3 List Item
   ============================================================ */
.md3-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  transition: background-color var(--md-sys-motion-duration-short4);
}

.md3-list-item:hover {
  background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

/* ============================================================
   Step Content Animation
   ============================================================ */
@keyframes md3PageEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-content:not(.hidden) {
  animation: md3PageEnter var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decel) forwards;
}

/* ============================================================
   M3 Surface Icon Container (for icons in cards)
   ============================================================ */
.md3-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--md-sys-shape-medium);
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  flex-shrink: 0;
}

.md3-icon-container-primary {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.md3-icon-container-tertiary {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.md3-icon-container-warning {
  background-color: var(--md-sys-color-warning-container);
  color: var(--md-sys-color-on-warning-container);
}

.md3-icon-container-error {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

/* ============================================================
   M3 Scenario Buttons (Step 4)
   ============================================================ */
.md3-scenario-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--md-sys-shape-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-low);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition:
    border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    background-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md3-scenario-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.md3-scenario-btn:hover {
  box-shadow: var(--md-sys-elevation-1);
}

.md3-scenario-btn:hover::before {
  opacity: 0.06;
}

.md3-scenario-btn:active::before {
  opacity: 0.1;
}

/* These classes are set dynamically by app.js setScenario() — keep them */
.md3-scenario-btn.bg-emerald-500\/10,
[id="scenario-fast-btn"].active-scenario {
  border-color: #2d6a4f;
  background-color: rgba(45, 106, 79, 0.12);
  border-width: 2px;
}

[id="scenario-std-btn"] {
  border-color: var(--md-sys-color-primary);
  background-color: color-mix(in srgb, var(--md-sys-color-primary-container) 30%, var(--md-sys-color-surface-container-low));
  border-width: 2px;
}

[id="scenario-relax-btn"]:not([class*="border-2"]) {
  border-width: 1px;
}

/* ============================================================
   M3 Financial Mode Toggle (Segmented Button)
   ============================================================ */
.md3-seg-btn-group {
  display: flex;
  align-items: center;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-full);
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

/* Mode buttons use inline classes set by app.js — alias important ones */
/* JS sets className with rounded-xl bg-brand-500 or text-slate-400 */
/* We apply these through the bg-brand-500 and text-slate-400 compatibility layer below */

/* ============================================================
   Tailwind Compatibility Layer
   (These are the specific utility classes used in JS innerHTML)
   ============================================================ */
.bg-brand-500 {
  background-color: var(--md-sys-color-primary) !important;
}

.bg-brand-600 {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 85%, black) !important;
}

.bg-brand-500\/10 {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent) !important;
}

.bg-brand-500\/15 {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent) !important;
}

.bg-brand-500\/20 {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent) !important;
}

.bg-brand-500\/30 {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent) !important;
}

.text-brand-400 {
  color: var(--md-sys-color-primary) !important;
}

.text-white {
  color: #ffffff !important;
}

.text-slate-200 {
  color: var(--md-sys-color-on-surface) !important;
}

.text-slate-300 {
  color: var(--md-sys-color-on-surface) !important;
  opacity: 0.87;
}

.text-slate-400 {
  color: var(--md-sys-color-on-surface-variant) !important;
}

.text-slate-500 {
  color: var(--md-sys-color-on-surface-variant) !important;
  opacity: 0.7;
}

.text-slate-600 {
  color: var(--md-sys-color-on-surface-variant) !important;
  opacity: 0.6;
}

.bg-slate-800 {
  background-color: var(--md-sys-color-surface-container-high) !important;
}

.bg-slate-900 {
  background-color: var(--md-sys-color-surface-container) !important;
}

.bg-slate-950 {
  background-color: var(--md-sys-color-surface-container-low) !important;
}

.border-slate-700 {
  border-color: var(--md-sys-color-outline-variant) !important;
}

.border-slate-800 {
  border-color: var(--md-sys-color-outline-variant) !important;
}

.border-glassBorder {
  border-color: var(--md-sys-color-outline-variant) !important;
}

.border-brand-500 {
  border-color: var(--md-sys-color-primary) !important;
}

.border-brand-500\/30 {
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 40%, transparent) !important;
}

.border-brand-500\/20 {
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent) !important;
}

/* Color classes used in JS-rendered HTML */
.text-cyanBrand-400 {
  color: var(--md-sys-color-tertiary) !important;
}

.text-emerald-400 {
  color: #2d6a4f !important;
}

.dark .text-emerald-400 {
  color: #52b788 !important;
}

.text-amber-400 {
  color: var(--md-sys-color-warning) !important;
}

.dark .text-amber-400 {
  color: var(--md-sys-color-warning) !important;
}

.text-rose-400 {
  color: var(--md-sys-color-error) !important;
}

.text-rose-500 {
  color: var(--md-sys-color-error) !important;
}

.text-purple-400 {
  color: #7b2d8b !important;
}

.dark .text-purple-400 {
  color: #cf9fff !important;
}

.text-orange-400 {
  color: #bf5700 !important;
}

.dark .text-orange-400 {
  color: #ffb74d !important;
}

.bg-emerald-500\/20 {
  background-color: rgba(45, 106, 79, 0.15) !important;
}

.border-emerald-500\/60 {
  border-color: rgba(45, 106, 79, 0.6) !important;
}

.bg-amber-500\/20 {
  background-color: rgba(191, 87, 0, 0.12) !important;
}

.border-amber-500\/60 {
  border-color: rgba(191, 87, 0, 0.5) !important;
}

.bg-rose-500\/20 {
  background-color: rgba(186, 26, 26, 0.12) !important;
}

.border-rose-500\/50 {
  border-color: rgba(186, 26, 26, 0.5) !important;
}

.bg-orange-500\/10 {
  background-color: rgba(191, 87, 0, 0.1) !important;
}

.border-orange-500\/30 {
  border-color: rgba(191, 87, 0, 0.3) !important;
}

.bg-cyanBrand-500\/20 {
  background-color: color-mix(in srgb, var(--md-sys-color-tertiary-container) 30%, transparent) !important;
}

.border-cyanBrand-500\/60 {
  border-color: color-mix(in srgb, var(--md-sys-color-tertiary) 60%, transparent) !important;
}

.border-emerald-500\/30 {
  border-color: rgba(45, 106, 79, 0.3) !important;
}

.bg-amber-950\/40 {
  background-color: rgba(92, 64, 0, 0.2) !important;
}

.border-amber-500\/30 {
  border-color: rgba(191, 87, 0, 0.3) !important;
}

.text-amber-300 {
  color: var(--md-sys-color-warning) !important;
}

/* Tailwind layout shims used inside JS innerHTML */
.flex-grow {
  flex-grow: 1;
}

.flex-1 {
  flex: 1;
}

.shrink-0 {
  flex-shrink: 0;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

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

.inline-flex {
  display: inline-flex;
}

.gap-1 {
  gap: 4px;
}

.gap-1\.5 {
  gap: 6px;
}

.gap-2 {
  gap: 8px;
}

.gap-2\.5 {
  gap: 10px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-5 {
  gap: 20px;
}

.gap-6 {
  gap: 24px;
}

.p-3 {
  padding: 12px;
}

.p-4 {
  padding: 16px;
}

.p-5 {
  padding: 20px;
}

.p-0\.5 {
  padding: 2px;
}

.px-2 {
  padding-left: 8px;
  padding-right: 8px;
}

.px-2\.5 {
  padding-left: 10px;
  padding-right: 10px;
}

.px-3 {
  padding-left: 12px;
  padding-right: 12px;
}

.px-3\.5 {
  padding-left: 14px;
  padding-right: 14px;
}

.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

.py-0\.5 {
  padding-top: 2px;
  padding-bottom: 2px;
}

.py-1 {
  padding-top: 4px;
  padding-bottom: 4px;
}

.py-1\.5 {
  padding-top: 6px;
  padding-bottom: 6px;
}

.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.py-2\.5 {
  padding-top: 10px;
  padding-bottom: 10px;
}

.py-3 {
  padding-top: 12px;
  padding-bottom: 12px;
}

.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}

.space-y-1>*+* {
  margin-top: 4px;
}

.space-y-2>*+* {
  margin-top: 8px;
}

.space-y-3>*+* {
  margin-top: 12px;
}

.space-y-4>*+* {
  margin-top: 16px;
}

.space-y-5>*+* {
  margin-top: 20px;
}

.mt-0\.5 {
  margin-top: 2px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mb-2 {
  margin-bottom: 8px;
}

.w-full {
  width: 100%;
}

.w-2 {
  width: 8px;
}

.w-3 {
  width: 12px;
}

.w-3\.5 {
  width: 14px;
}

.w-4 {
  width: 16px;
}

.w-5 {
  width: 20px;
}

.w-7 {
  width: 28px;
}

.w-10 {
  width: 40px;
}

.w-2\.5 {
  width: 10px;
}

.h-2 {
  height: 8px;
}

.h-3 {
  height: 12px;
}

.h-3\.5 {
  height: 14px;
}

.h-4 {
  height: 16px;
}

.h-5 {
  height: 20px;
}

.h-7 {
  height: 28px;
}

.h-10 {
  height: 40px;
}

.h-full {
  height: 100%;
}

.h-0\.5 {
  height: 2px;
}

.h-2\.5 {
  height: 10px;
}

.rounded-full {
  border-radius: 9999px;
}

.rounded {
  border-radius: var(--md-sys-shape-extra-small);
}

.rounded-lg {
  border-radius: var(--md-sys-shape-small);
}

.rounded-xl {
  border-radius: var(--md-sys-shape-medium);
}

.rounded-2xl {
  border-radius: var(--md-sys-shape-large);
}

.rounded-tl-none {
  border-top-left-radius: 0;
}

.rounded-tr-none {
  border-top-right-radius: 0;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-y-auto {
  overflow-y: auto;
}

.overflow-auto {
  overflow: auto;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.inset-0 {
  inset: 0;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

.top-0 {
  top: 0;
}

.z-40 {
  z-index: 40;
}

.z-50 {
  z-index: 50;
}

.border {
  border-width: 1px;
  border-style: solid;
}

.border-2 {
  border-width: 2px;
  border-style: solid;
}

.border-t {
  border-top: 1px solid;
}

.border-b {
  border-bottom: 1px solid;
}

.border-l {
  border-left: 1px solid;
}

.border-r {
  border-right: 1px solid;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-wide {
  letter-spacing: 0.025em;
}

.tracking-wider {
  letter-spacing: 0.05em;
}

.tracking-widest {
  letter-spacing: 0.1em;
}

.leading-relaxed {
  line-height: 1.625;
}

.italic {
  font-style: italic;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.opacity-0 {
  opacity: 0;
}

.opacity-40 {
  opacity: 0.4;
}

.grayscale {
  filter: grayscale(100%);
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-ping {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.transition-all {
  transition: all 0.15s;
}

.transition-colors {
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.transition-opacity {
  transition: opacity 0.15s;
}

.duration-500 {
  transition-duration: 500ms;
}

.duration-700 {
  transition-duration: 700ms;
}

.last\:border-0:last-child {
  border-bottom-width: 0;
}

.group:hover .group-hover\:opacity-100 {
  opacity: 1 !important;
}

.group:hover .group-hover\:text-brand-400 {
  color: var(--md-sys-color-primary) !important;
}

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

@keyframes ping {

  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* JS-injected scenario button classes (app.js setScenario) */
.p-4.rounded-2xl.border.border-glassBorder {
  border-radius: var(--md-sys-shape-large);
  border-color: var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-low);
}

.p-4.rounded-2xl.border-2.border-emerald-500 {
  border-radius: var(--md-sys-shape-large);
  border-color: #2d6a4f;
  background-color: rgba(45, 106, 79, 0.1);
}

.p-4.rounded-2xl.border-2.border-brand-500 {
  border-radius: var(--md-sys-shape-large);
  border-color: var(--md-sys-color-primary);
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 10%, var(--md-sys-color-surface-container-low));
}

.p-4.rounded-2xl.border-2.border-purple-500 {
  border-radius: var(--md-sys-shape-large);
  border-color: #7b2d8b;
  background-color: rgba(123, 45, 139, 0.1);
}

/* JS-injected mode button classes (app.js setFinancialMode) */
.flex-1.py-3.px-4.rounded-xl {
  background: transparent;
  border: none;
  cursor: pointer;
}

.md3-seg-btn-group {
  display: flex;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-full);
  padding: 4px;
  gap: 4px;
}

.md3-seg-btn-group button {
  border-radius: var(--md-sys-shape-full) !important;
}

.md3-seg-btn-active {
  background-color: var(--md-sys-color-secondary-container) !important;
  color: var(--md-sys-color-on-secondary-container) !important;
}

.md3-seg-btn-inactive {
  background-color: transparent !important;
  color: var(--md-sys-color-on-surface) !important;
}

/* Material You Form Overrides */
.md3-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-extra-small);
  padding: 0 40px 0 16px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.md3-select:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 1px var(--md-sys-color-primary);
  outline: none;
}

.md3-radio-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 16px;
  border-radius: var(--md-sys-shape-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface);
  transition: background-color 0.2s, border-color 0.2s;
}

.md3-radio-label:has(input:checked) {
  background-color: var(--md-sys-color-secondary-container);
  border-color: var(--md-sys-color-secondary-container);
}

.md3-radio-label input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
}


/* ============================================================
   Grid Layout Overrides
   ============================================================ */
@media(min-width:640px) {
  #preset-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #custom-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #custom-grid-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #scenario-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  #milestone-badges-container {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media(min-width:768px) {
  #detailed-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #stat-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media(min-width:1024px) {
  #preset-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ============================================================
   M3 PDF Preview Canvas
   ============================================================ */
#pdf-preview-canvas {
  color-scheme: light !important;
  background: #ffffff !important;
  box-sizing: border-box;
}

#pdf-preview-canvas th,
#pdf-preview-canvas td {
  border-color: #e0e0e0;
}

/* ============================================================
   M3 Chat Window (AI Drawer)
   ============================================================ */
#ai-chat-window {
  background-color: var(--md-sys-color-surface-container) !important;
  border: 1px solid var(--md-sys-color-outline-variant) !important;
  border-radius: var(--md-sys-shape-large) !important;
  box-shadow: var(--md-sys-elevation-4) !important;
}

/* ============================================================
   M3 Footer
   ============================================================ */
.md3-footer {
  background-color: var(--md-sys-color-surface-container-low);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding: 20px 0;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
}

/* ============================================================
   M3 Hero Section Layout
   ============================================================ */
.md3-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
  padding: 40px 0;
}

@media (min-width: 1024px) {
  .md3-hero {
    grid-template-columns: 7fr 5fr;
  }
}

.md3-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--md-sys-shape-full);
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.006em;
}

.md3-hero__headline {
  font-family: 'Google Sans Display', 'Google Sans', 'Roboto', sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--md-sys-color-on-background);
}

.md3-hero__headline em {
  font-style: normal;
  color: var(--md-sys-color-primary);
}

.md3-hero__sub {
  font-size: 1rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.6;
  max-width: 520px;
}

.md3-feature-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

@media (min-width: 1024px) {
  .md3-feature-chip-group {
    justify-content: flex-start;
  }
}

.md3-hero-btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  .md3-hero-btn-group {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .md3-hero-btn-group {
    justify-content: flex-start;
  }
}

.md3-hero-btn-group .md3-btn-filled {
  height: 48px;
  padding: 0 28px;
  font-size: 0.9375rem;
  width: 100%;
}

.md3-hero-btn-group .md3-btn-tonal {
  height: 48px;
  padding: 0 28px;
  font-size: 0.9375rem;
  width: 100%;
}

@media (min-width: 640px) {

  .md3-hero-btn-group .md3-btn-filled,
  .md3-hero-btn-group .md3-btn-tonal {
    width: auto;
  }
}

.md3-hero__text {
  text-align: center;
}

@media (min-width: 1024px) {
  .md3-hero__text {
    text-align: left;
  }
}

.md3-hero__text .md3-feature-chip-group {
  justify-content: center;
}

@media (min-width: 1024px) {
  .md3-hero__text .md3-feature-chip-group {
    justify-content: flex-start;
  }
}

/* ============================================================
   M3 Step Section Layout
   ============================================================ */
.md3-section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.md3-section-header__eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--md-sys-color-primary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.md3-section-header__title {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--md-sys-color-on-background);
}

.md3-section-header__sub {
  font-size: 0.9375rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.5;
}

/* ============================================================
   M3 Home Preview Card
   ============================================================ */
.md3-home-preview {
  background-color: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-large);
  padding: 24px;
  box-shadow: var(--md-sys-elevation-2);
  position: relative;
  overflow: hidden;
}

.md3-home-preview::after {
  content: '';
  position: absolute;
  bottom: -32px;
  right: -32px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid var(--md-sys-color-primary-container);
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================
   M3 Stat Cards (Step 4)
   ============================================================ */
.md3-stat-card {
  background-color: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-medium);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================================
   M3 Radio Button (impulse check)
   ============================================================ */
input[type="radio"] {
  accent-color: var(--md-sys-color-primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ============================================================
   M3 Upload Zone (dashed border)
   ============================================================ */
.md3-upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border-radius: var(--md-sys-shape-small);
  border: 1.5px dashed var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    background-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md3-upload-zone:hover {
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-primary);
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent);
}

/* ============================================================
   M3 Separator / Divider with label
   ============================================================ */
.md3-separator {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md3-separator::before,
.md3-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--md-sys-color-outline-variant);
}

/* ============================================================
   M3 Back Button (Step navigation)
   ============================================================ */
.md3-back-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 12px;
  border-radius: var(--md-sys-shape-full);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--md-sys-motion-duration-short4), color var(--md-sys-motion-duration-short4);
}

.md3-back-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4);
}

.md3-back-btn:hover {
  border-color: var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
}

.md3-back-btn:hover::before {
  opacity: 0.06;
}

.md3-back-btn:active::before {
  opacity: 0.1;
}

.md3-back-btn:active {
  transform: scale(0.97);
}

/* ============================================================
   PDF Modal overrides
   ============================================================ */
#pdf-modal>div {
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-extra-large);
}

#pdf-modal>div>div:first-child {
  background-color: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

/* ============================================================
   Impulse Modal overrides
   ============================================================ */
#impulse-check-modal>div {
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-extra-large);
}

/* ============================================================
   @media print — Preserved exactly
   ============================================================ */
@media print {

  html,
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  header,
  footer,
  #ai-chat-widget,
  nav,
  .back-btn,
  .fixed.inset-0,
  #step-1,
  #step-2,
  #step-3,
  #step-4,
  #impulse-check-modal,
  #pdf-modal .flex.items-center.justify-between,
  #pdf-modal>div>div:first-child {
    display: none !important;
  }

  #pdf-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  #pdf-modal>div {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
  }

  #pdf-modal .overflow-y-auto {
    overflow: visible !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
  }

  #pdf-preview-canvas {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 12mm 10mm !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
  }

  .print-avoid-break {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .grid-cell {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}

/* Tailwind shims for app.js injected elements (e.g., Deposit Logger Trash Button) */
.opacity-0 {
  opacity: 0;
}

.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

.text-rose-500 {
  color: var(--md-sys-color-error) !important;
}

.hover\:text-rose-400:hover {
  color: color-mix(in srgb, var(--md-sys-color-error) 80%, white) !important;
}

.transition-opacity {
  transition-property: opacity;
  transition-duration: 150ms;
}

button.opacity-0.text-rose-500 {
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  padding: 4px;
}

.text-slate-900 {
  color: var(--md-sys-color-on-primary-container) !important;
}