/* ==========================================================================
   Design Specification — Hydration Companion PWA
   Atmospheric Themes, Bottle-First Tactile Architecture
   ========================================================================== */

/* --------------------------------------------------------------------------
   THEME 1 — Ocean Mist (Default)
   -------------------------------------------------------------------------- */
:root, [data-theme="ocean_mist"] {
  --color-bg: #D9E7E8;
  --color-bg-deep: #C5D9DC;
  --color-surface: #E5EFEE;
  --color-surface-raised: #EDF3F0;
  --color-surface-card: #E5EFEE;
  --color-surface-border: #C4D4D6;
  --color-surface-subtle: #D2E3E5;

  --color-primary: #67AFC4;
  --color-primary-hover: #3E8198;
  --color-primary-light: #8ACFDF;
  --color-primary-subtle: #C0E2EB;
  --color-deep-water: #3E8198;
  --color-soft-water: #B9DDE5;

  --color-accent: #7EAE91;
  --color-text-main: #263B42;
  --color-text-muted: #5D737A;
  --color-text-subtle: #809298;
  --color-border: #C4D4D6;
  --color-success: #7EAE91;
  --color-warning: #DDA35D;

  --bottle-grad-start: #8ACFDF;
  --bottle-grad-end: #4C98B1;
  --bottle-wave: rgba(138, 207, 223, 0.55);
  --ambient-glow: rgba(103, 175, 196, 0.25);
  --modal-backdrop-bg: rgba(38, 59, 66, 0.42);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-subtle: 0 2px 8px rgba(38, 59, 66, 0.04);
  --shadow-card: 0 4px 18px rgba(38, 59, 66, 0.06);

  --font-family: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "DM Sans", "Nunito Sans", system-ui, Roboto, sans-serif;
}

/* --------------------------------------------------------------------------
   THEME 2 — Sage Morning
   -------------------------------------------------------------------------- */
[data-theme="sage_morning"] {
  --color-bg: #DDE4DA;
  --color-bg-deep: #CBD6C8;
  --color-surface: #E8ECE2;
  --color-surface-raised: #F0F1E8;
  --color-surface-card: #E8ECE2;
  --color-surface-border: #C8D2C8;
  --color-surface-subtle: #D6DFD3;

  --color-primary: #70A99A;
  --color-primary-hover: #4D8175;
  --color-primary-light: #A4D1C0;
  --color-primary-subtle: #C6E2D8;
  --color-deep-water: #4D8175;
  --color-soft-water: #B8D5CA;

  --color-accent: #729D7F;
  --color-text-main: #293B36;
  --color-text-muted: #60736C;
  --color-text-subtle: #84918C;
  --color-border: #C8D2C8;
  --color-success: #729D7F;

  --bottle-grad-start: #A4D1C0;
  --bottle-grad-end: #5E9B89;
  --bottle-wave: rgba(164, 209, 192, 0.55);
  --ambient-glow: rgba(112, 169, 154, 0.25);
  --modal-backdrop-bg: rgba(41, 59, 54, 0.42);
}

/* --------------------------------------------------------------------------
   THEME 3 — Rose Water
   -------------------------------------------------------------------------- */
[data-theme="rose_water"] {
  --color-bg: #E7DCDD;
  --color-bg-deep: #D9CBCD;
  --color-surface: #EEE6E3;
  --color-surface-raised: #F4ECE8;
  --color-surface-card: #EEE6E3;
  --color-surface-border: #D8C9C9;
  --color-surface-subtle: #E0D3D5;

  --color-primary: #C88994;
  --color-primary-hover: #9D626F;
  --color-primary-light: #E7B9BF;
  --color-primary-subtle: #F1D4D8;
  --color-deep-water: #9D626F;
  --color-soft-water: #E2B8BD;

  --color-accent: #7FA18B;
  --color-text-main: #443238;
  --color-text-muted: #79636A;
  --color-text-subtle: #99858A;
  --color-border: #D8C9C9;
  --color-success: #7FA18B;

  --bottle-grad-start: #E7B9BF;
  --bottle-grad-end: #B87380;
  --bottle-wave: rgba(231, 185, 191, 0.55);
  --ambient-glow: rgba(200, 137, 148, 0.25);
  --modal-backdrop-bg: rgba(68, 50, 56, 0.42);
}

/* --------------------------------------------------------------------------
   THEME 4 — Warm Sand
   -------------------------------------------------------------------------- */
[data-theme="warm_sand"] {
  --color-bg: #E5DED0;
  --color-bg-deep: #D5CBBB;
  --color-surface: #EEE8DC;
  --color-surface-raised: #F3EDE2;
  --color-surface-card: #EEE8DC;
  --color-surface-border: #D2C9B9;
  --color-surface-subtle: #DED6C7;

  --color-primary: #6797A0;
  --color-primary-hover: #476F77;
  --color-primary-light: #9BC6CC;
  --color-primary-subtle: #C8DFE2;
  --color-deep-water: #476F77;
  --color-soft-water: #B5D0D0;

  --color-accent: #78997D;
  --color-text-main: #3E3930;
  --color-text-muted: #706A5E;
  --color-text-subtle: #918A7C;
  --color-border: #D2C9B9;
  --color-success: #78997D;

  --bottle-grad-start: #9BC6CC;
  --bottle-grad-end: #578B96;
  --bottle-wave: rgba(155, 198, 204, 0.55);
  --ambient-glow: rgba(103, 151, 160, 0.25);
  --modal-backdrop-bg: rgba(62, 57, 48, 0.42);
}

/* --------------------------------------------------------------------------
   THEME 5 — Midnight Pool (Atmospheric Dark)
   -------------------------------------------------------------------------- */
[data-theme="midnight_pool"] {
  --color-bg: #172A30;
  --color-bg-deep: #102126;
  --color-surface: #20383F;
  --color-surface-raised: #28434A;
  --color-surface-card: #20383F;
  --color-surface-border: #355158;
  --color-surface-subtle: #243D45;

  --color-primary: #76BFD0;
  --color-primary-hover: #4A94A7;
  --color-primary-light: #82C7D6;
  --color-primary-subtle: #294D56;
  --color-deep-water: #4A94A7;
  --color-soft-water: #315F6A;

  --color-accent: #8BB79A;
  --color-text-main: #E3ECEB;
  --color-text-muted: #AFC0C2;
  --color-text-subtle: #81979B;
  --color-border: #355158;
  --color-success: #8BB79A;

  --bottle-grad-start: #82C7D6;
  --bottle-grad-end: #438A9F;
  --bottle-wave: rgba(130, 199, 214, 0.55);
  --ambient-glow: rgba(118, 191, 208, 0.2);
  --modal-backdrop-bg: rgba(12, 23, 27, 0.72);

  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   BASE STYLES & ATMOSPHERIC CANVAS
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at 50% 10%, var(--color-surface-raised) 0%, var(--color-bg) 75%);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Application Mobile Container Shell */
.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at 50% 15%, var(--color-surface-raised) 0%, var(--color-bg) 80%);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: background-color 0.3s ease;
}

main.app-content {
  flex: 1;
  padding: 24px 20px 96px 20px;
  overflow-y: auto;
}

main.app-content:has(#screen-auth.active) {
  padding: 0 20px 20px 20px;
  display: flex;
  flex-direction: column;
}

/* Screen visibility */
.screen {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Screen Headers */
.screen-header {
  margin-bottom: 20px;
}

.screen-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
}

.screen-subtitle {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* --- Today Screen Hero Bottle Section --- */
.hero-bottle-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2px, 1vh, 8px) 0 clamp(6px, 1.5vh, 14px) 0;
}

/* Atmospheric Ambient Shape behind bottle (Section 15) */
.bottle-ambient-backdrop {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -45%);
  width: clamp(180px, 48vw, 240px);
  height: clamp(180px, 48vw, 240px);
  background: radial-gradient(circle, var(--ambient-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.daily-summary-header {
  text-align: center;
  margin-bottom: clamp(6px, 1.5vh, 10px);
  position: relative;
  z-index: 1;
}

.greeting-text {
  font-size: clamp(0.82rem, 2.4vw, 0.98rem);
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
}

.consumed-amount-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 8px);
  white-space: nowrap;
  flex-wrap: nowrap;
}

.consumed-amount {
  font-size: clamp(1.75rem, 7.5vw, 2.75rem);
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.target-amount-sub {
  font-size: clamp(0.75rem, 2.2vw, 0.92rem);
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.linear-progress-track {
  width: clamp(130px, 42vw, 200px);
  height: 5px;
  background: var(--color-surface-border);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px auto 0 auto;
}

.linear-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

/* Bottle Visualization Container */
.bottle-container-widget {
  position: relative;
  width: min(180px, 48vw);
  height: clamp(200px, 30vh, 275px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  margin: 0 auto;
}

.bottle-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.bottle-wrapper:active {
  transform: scale(0.97);
}

.bottle-wrapper.empty-bottle {
  animation: gentlePulse 2.5s infinite ease-in-out;
}

@keyframes gentlePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.bottle-svg {
  width: 100%;
  height: 100%;
  max-height: clamp(180px, 26vh, 240px);
  overflow: visible;
}

.liquid-rect {
  transition: y 0.6s cubic-bezier(0.4, 0, 0.2, 1), height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.wave-animation {
  animation: waveMotion 4s infinite linear;
}

@keyframes waveMotion {
  0% { transform: translateX(0); }
  50% { transform: translateX(-12px); }
  100% { transform: translateX(0); }
}

.bottle-status-badge {
  text-align: center;
  margin-top: -4px;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  padding: clamp(5px, 1.4vw, 8px) clamp(10px, 2.8vw, 16px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.2s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.bottle-volume-value {
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  font-weight: 800;
  color: var(--color-text-main);
  white-space: nowrap;
}

.bottle-volume-unit {
  font-size: clamp(0.72rem, 2vw, 0.86rem);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.bottle-state-label {
  font-size: clamp(0.62rem, 1.7vw, 0.74rem);
  color: var(--color-text-subtle);
  letter-spacing: 0.02em;
  margin-top: 1px;
  font-weight: 600;
  white-space: nowrap;
}

.bottle-state-label.tap-hint {
  color: var(--color-primary);
  font-weight: 700;
}

/* --- Bottle Goal Progress Tracker --- */
.bottle-goal-tracker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.bottle-goal-pill {
  font-size: clamp(0.72rem, 2vw, 0.86rem);
  font-weight: 700;
  color: var(--color-primary-hover);
  background: var(--color-primary-subtle);
  padding: 4px clamp(8px, 2.5vw, 14px);
  border-radius: var(--radius-lg);
  display: inline-block;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.bottle-dots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 8px);
}

.bottle-dot {
  width: clamp(8px, 2.2vw, 11px);
  height: clamp(8px, 2.2vw, 11px);
  border-radius: 50%;
  background: var(--color-surface-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.bottle-dot.done {
  background: var(--color-primary);
  transform: scale(1.15);
  box-shadow: 0 0 6px var(--ambient-glow);
}

.bottle-dot.current {
  border: 2px solid var(--color-primary);
  background: transparent;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* --- Bottle Action Section --- */
.bottle-action-section {
  margin-top: clamp(12px, 3.5vw, 20px);
  position: relative;
  z-index: 1;
}

.bottle-action-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(12px, 3.5vw, 18px) clamp(10px, 3.5vw, 20px);
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: all 0.3s ease;
}

.bottle-action-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.btn-fill-bottle {
  background: var(--color-primary);
  color: #ffffff;
  width: 100%;
  font-size: clamp(0.85rem, 3.6vw, 1.1rem);
  font-weight: 700;
  padding: clamp(12px, 3vw, 16px) clamp(8px, 2.5vw, 18px);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px var(--ambient-glow);
  white-space: nowrap;
  line-height: 1.2;
}

.btn-fill-bottle:hover {
  background: var(--color-primary-hover);
}

.btn-empty-bottle {
  background: var(--color-accent);
  color: #ffffff;
  width: 100%;
  font-size: clamp(0.85rem, 3.6vw, 1.1rem);
  font-weight: 700;
  padding: clamp(12px, 3vw, 16px) clamp(8px, 2.5vw, 18px);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(126, 174, 145, 0.35);
  white-space: nowrap;
  line-height: 1.2;
}

.btn-empty-bottle:hover {
  filter: brightness(0.92);
}

@media (max-width: 280px) {
  .btn-fill-bottle, .btn-empty-bottle {
    white-space: normal;
    text-align: center;
  }
}

.bottle-action-subhint {
  font-size: clamp(0.72rem, 2vw, 0.84rem);
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 320px) {
  .bottle-action-subhint {
    white-space: normal;
  }
}

.action-row-secondary {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

/* Button Foundation */
.btn {
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: clamp(0.82rem, 3vw, 0.95rem);
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  transition: background-color 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn span {
  white-space: nowrap;
}

.btn-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-icon-right {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
}

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

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  flex: 1;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  color: var(--color-text-main);
  box-shadow: var(--shadow-subtle);
  flex: 1;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-raised);
}

.btn-refill {
  background: var(--color-primary-subtle);
  border: 1px solid var(--color-surface-border);
  color: var(--color-deep-water);
  width: 100%;
  font-size: 0.96rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.btn-refill:hover {
  background: var(--color-surface-subtle);
}

/* --- Vessels Section (Glass & Gulp) --- */
.vessels-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.glass-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(10px, 2.4vw, 14px) clamp(10px, 2.8vw, 14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1.8vw, 10px);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.15s ease, background-color 0.3s ease;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.glass-card:hover {
  border-color: var(--color-primary);
}

.glass-left {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.8vw, 10px);
  min-width: 0;
  flex: 1;
  white-space: nowrap;
}

.glass-visual {
  width: clamp(32px, 8.5vw, 38px);
  height: clamp(38px, 10vw, 46px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-svg {
  width: 100%;
  height: 100%;
}

.glass-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  white-space: nowrap;
}

.glass-amount {
  font-size: clamp(0.9rem, 2.6vw, 1.1rem);
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.2;
  white-space: nowrap;
}

.glass-label {
  font-size: clamp(0.66rem, 1.8vw, 0.76rem);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.glass-action-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: auto;
  padding: clamp(8px, 1.8vw, 10px) clamp(10px, 2.5vw, 14px);
  font-size: clamp(0.72rem, 2.1vw, 0.84rem);
  font-weight: 700;
  border-radius: var(--radius-md);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.glass-action-btn span {
  white-space: nowrap;
}

.gulp-drop {
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.gulp-drop.animating-drop {
  transform: translateY(35px) scale(0.2);
  opacity: 0;
}

.gulp-ripple.animating-ripple {
  animation: ripplePop 0.5s ease-out forwards;
}

@keyframes ripplePop {
  0% { r: 6px; opacity: 0.9; stroke-width: 3px; }
  100% { r: 28px; opacity: 0; stroke-width: 1px; }
}

/* --- Theme Selection Atmosphere Grid (Section 5 & 23) --- */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.theme-card {
  background: var(--color-surface-raised);
  border: 1.5px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-subtle);
}

.theme-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.theme-card.selected {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.theme-swatch-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-bottom: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.theme-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 2px;
  white-space: nowrap;
}

.theme-card-tag {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}

/* --- Onboarding Cards (Section 23) --- */
.onboarding-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 75vh;
}

.onboarding-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}

.onboarding-title {
  font-size: clamp(1.2rem, 4.5vw, 1.55rem);
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  white-space: nowrap;
}

@media (max-width: 320px) {
  .onboarding-title {
    white-space: normal;
  }
}

.onboarding-subtitle {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 22px;
}

.form-group {
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.input-control {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-surface-border);
  background: var(--color-surface-raised);
  color: var(--color-text-main);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
}

.input-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--ambient-glow);
}

/* Custom Tactile Themed Dropdown Component */
.custom-dropdown {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.dropdown-trigger {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background-color: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  color: var(--color-text-main);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: clamp(0.82rem, 2.4vw, 0.92rem);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.dropdown-trigger:hover {
  border-color: var(--color-primary);
}

.custom-dropdown.open .dropdown-trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--ambient-glow);
  background-color: var(--color-surface);
}

.dropdown-selected-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.dropdown-chevron {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-chevron svg {
  width: 15px;
  height: 15px;
}

.custom-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu Popup (Soft Rounded Corners & Themed Glassmorphism) */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-surface-raised);
  border: 1.5px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(18, 30, 36, 0.18), 0 2px 6px rgba(18, 30, 36, 0.06);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box;
}

.custom-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Smart Drop-Up when near bottom */
.custom-dropdown.drop-up .dropdown-menu {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(6px) scale(0.98);
}

.custom-dropdown.drop-up.open .dropdown-menu {
  transform: translateY(0) scale(1);
}

.dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
  font-size: clamp(0.8rem, 2.3vw, 0.88rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}

.dropdown-option:hover {
  background-color: var(--color-surface);
  color: var(--color-text-main);
}

.dropdown-option.selected {
  background-color: var(--color-primary-subtle);
  color: var(--color-deep-water);
  font-weight: 700;
}

.option-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.option-check-icon {
  width: 15px;
  height: 15px;
  color: var(--color-deep-water);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.dropdown-option.selected .option-check-icon {
  opacity: 1;
}

.option-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.option-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  text-align: center;
  box-shadow: var(--shadow-subtle);
  font-weight: 600;
  font-size: 0.92rem;
}

.option-card:hover {
  border-color: var(--color-primary);
}

.option-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  color: var(--color-deep-water);
}

.option-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 3px;
}

.option-card-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.bottle-cap-custom-card {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.custom-cap-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-cap-input-group .input-control {
  flex: 1;
}

.custom-cap-unit {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.setting-cap-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.setting-cap-preset {
  padding: 8px 4px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  color: var(--color-text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setting-cap-preset:hover {
  border-color: var(--color-primary);
}

.setting-cap-preset.active {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  color: var(--color-deep-water);
}

/* --- History Screen Timeline (Section 20) --- */
.history-day-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-subtle);
}

.history-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-surface-border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.history-date {
  font-weight: 700;
  font-size: 0.95rem;
}

.history-day-total {
  font-size: 0.88rem;
  color: var(--color-primary);
  font-weight: 700;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9rem;
}

.history-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  color: var(--color-primary);
}

.history-svg-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

/* --- Insights Screen (Calm Hydration Companion) --- */
.insights-reflection-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3.8vw, 22px) clamp(14px, 3.5vw, 18px);
  margin-bottom: 14px;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.reflection-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.reflection-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.reflection-headline {
  font-size: clamp(1.05rem, 3.4vw, 1.25rem);
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.reflection-sub {
  font-size: clamp(0.78rem, 2.3vw, 0.86rem);
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.reflection-chips-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(6px, 2vw, 10px);
  margin-top: 14px;
}

.reflection-chip {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  min-width: 0;
}

.chip-metric {
  display: block;
  font-size: clamp(1rem, 3.4vw, 1.2rem);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.chip-desc {
  display: block;
  font-size: clamp(0.68rem, 2vw, 0.76rem);
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
}

/* 2. Your Week: Tactile 7-Day Rhythm */
.week-rhythm-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3.8vw, 20px) clamp(12px, 3.2vw, 16px);
  margin-bottom: 14px;
  box-shadow: var(--shadow-subtle);
}

.section-heading-row {
  margin-bottom: 10px;
}

.section-card-title {
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.01em;
}

.section-card-sub {
  font-size: clamp(0.76rem, 2.2vw, 0.82rem);
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.week-bottles-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(2px, 1vw, 6px);
  padding: 6px 0;
  align-items: end;
  width: 100%;
  box-sizing: border-box;
}

.day-bottle-col {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 1px;
  min-width: 0;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  color: inherit;
  box-sizing: border-box;
}

.day-bottle-col:hover {
  background: var(--color-surface-raised);
  transform: translateY(-2px);
}

.day-bottle-col:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.day-bottle-col.active {
  background: var(--color-surface-raised);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px var(--ambient-glow);
}

.mini-vessel-wrap {
  width: clamp(20px, 5.2vw, 26px);
  height: clamp(32px, 8.5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-day-vessel-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.04));
}

.day-col-letter {
  font-size: clamp(0.68rem, 2vw, 0.76rem);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  line-height: 1;
}

.day-bottle-col.active .day-col-letter {
  color: var(--color-primary);
  font-weight: 800;
}

.day-detail-panel {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 10px;
  animation: fadeIn 0.2s ease;
}

.day-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.day-detail-name {
  font-size: clamp(0.82rem, 2.4vw, 0.9rem);
  font-weight: 700;
  color: var(--color-text-main);
}

.day-detail-pct {
  font-size: clamp(0.72rem, 2vw, 0.78rem);
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 12px;
  border: 1px solid var(--color-surface-border);
}

.day-detail-pct.reached {
  color: var(--color-deep-water);
  background: var(--color-primary-subtle);
  border-color: var(--color-primary);
}

.day-detail-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: 2px;
  gap: 4px;
}

.day-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  flex: 1;
}

.day-stat-val {
  font-size: clamp(0.85rem, 2.8vw, 1rem);
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.day-stat-lbl {
  font-size: clamp(0.64rem, 1.8vw, 0.72rem);
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
}

.day-stat-divider {
  width: 1px;
  height: 20px;
  background: var(--color-surface-border);
  flex-shrink: 0;
}

/* 3. When You Tend to Drink */
.drinking-rhythm-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3.8vw, 20px) clamp(12px, 3.2vw, 16px);
  margin-bottom: 14px;
  box-shadow: var(--shadow-subtle);
}

.rhythm-segmented-bar {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-surface-subtle);
  margin: 12px 0 10px 0;
  gap: 2px;
}

.rhythm-seg {
  height: 100%;
  transition: width 0.4s ease;
  min-width: 4px;
}

.rhythm-seg.seg-morning {
  background: #E8B960;
}

.rhythm-seg.seg-afternoon {
  background: var(--color-primary);
}

.rhythm-seg.seg-evening {
  background: #5D7290;
}

.rhythm-legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(4px, 1.5vw, 8px);
  margin-bottom: 10px;
}

.rhythm-legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  background: var(--color-surface-raised);
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-surface-border);
  min-width: 0;
}

.legend-icon-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legend-icon-badge svg {
  width: 13px;
  height: 13px;
}

.legend-icon-badge.morning {
  background: rgba(232, 185, 96, 0.18);
  color: #B88220;
}

.legend-icon-badge.afternoon {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.legend-icon-badge.evening {
  background: rgba(93, 114, 144, 0.18);
  color: #4A5E78;
}

.legend-title {
  display: block;
  font-size: clamp(0.66rem, 1.8vw, 0.74rem);
  color: var(--color-text-muted);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

.legend-pct {
  display: block;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.1;
}

.rhythm-coaching-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--color-surface-raised);
  border-left: 3px solid var(--color-primary);
  padding: 8px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 4px;
}

.coaching-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.coaching-icon svg {
  width: 15px;
  height: 15px;
}

.coaching-text {
  font-size: clamp(0.74rem, 2vw, 0.8rem);
  color: var(--color-text-muted);
  line-height: 1.35;
  margin: 0;
}

/* 4. Things We've Noticed */
.noticed-section {
  margin-bottom: 14px;
}

.noticed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.noticed-item-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-subtle);
}

.noticed-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.noticed-icon-wrap svg {
  width: 16px;
  height: 16px;
}

.noticed-content {
  flex: 1;
  min-width: 0;
}

.noticed-title {
  font-size: clamp(0.82rem, 2.4vw, 0.88rem);
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 2px;
  line-height: 1.3;
}

.noticed-detail {
  font-size: clamp(0.74rem, 2vw, 0.78rem);
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* 5. Target Progressive Derivation */
.target-journey-flow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.journey-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-sm);
}

.journey-step.total {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-num.total {
  background: var(--color-primary);
  color: #fff;
  border: none;
}

.step-num.total svg {
  width: 12px;
  height: 12px;
}

.step-info {
  flex: 1;
  min-width: 0;
}

.step-name {
  font-size: clamp(0.78rem, 2.2vw, 0.84rem);
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.25;
}

.step-detail {
  font-size: clamp(0.68rem, 1.9vw, 0.74rem);
  color: var(--color-text-muted);
  line-height: 1.35;
  white-space: normal;
  word-break: normal;
}

.step-val {
  font-size: clamp(0.8rem, 2.4vw, 0.88rem);
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
  white-space: nowrap;
}

.step-val.total {
  font-size: clamp(0.92rem, 2.8vw, 1.05rem);
  font-weight: 800;
  color: var(--color-deep-water);
}

/* --- Transparency / Methodology Card --- */
.transparency-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-subtle);
}

.transparency-title {
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 3px;
  color: var(--color-text-main);
  letter-spacing: -0.01em;
}

.transparency-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.target-preview-pill {
  padding: 10px 14px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  margin: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.target-preview-label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.target-preview-val {
  color: var(--color-primary);
  font-size: 1.05rem;
  font-weight: 800;
}

.breakdown-list {
  list-style: none;
  margin-top: 12px;
}

.breakdown-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-surface-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.breakdown-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.breakdown-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Toggle Switch Component */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-surface-border);
  transition: 0.25s;
  border-radius: 24px;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: 0.25s;
  border-radius: 50%;
}

.toggle-switch input:checked + .slider {
  background-color: var(--color-primary);
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* --- Bottom Navigation Bar --- */
nav.app-navbar {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-surface-border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 12px 0;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
}

nav.app-navbar.hidden {
  display: none !important;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
  min-width: 60px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.active {
  color: var(--color-primary);
}

/* --- Authentication Screen (Section 15) --- */
#screen-auth {
  position: relative;
  min-height: 100vh;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
}

#screen-auth.active {
  display: flex;
}

.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 64px 0 24px;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(14px, 2.5vh, 22px) clamp(16px, 3.5vw, 22px);
  box-shadow: var(--shadow-card);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.auth-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(38px, 5vh, 46px);
  height: clamp(38px, 5vh, 46px);
  border-radius: 50%;
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  margin-bottom: clamp(4px, 1vh, 8px);
}

.auth-title {
  font-size: clamp(1.15rem, 3.5vw, 1.38rem);
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.auth-subtitle {
  font-size: clamp(0.76rem, 2.2vw, 0.82rem);
  color: var(--color-text-muted);
  line-height: 1.35;
  margin-bottom: clamp(6px, 1.4vh, 12px);
}

.auth-tabs {
  display: flex;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: clamp(6px, 1.4vh, 12px);
  gap: 3px;
}

.auth-tab {
  flex: 1;
  padding: 6px 10px;
  border-radius: calc(var(--radius-md) - 3px);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: var(--color-surface);
  color: var(--color-text-main);
  box-shadow: var(--shadow-subtle);
}

.auth-error-msg {
  background: rgba(200, 137, 148, 0.15);
  border: 1px solid rgba(200, 137, 148, 0.4);
  color: #a85866;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: left;
}

.auth-success-msg {
  background: rgba(72, 187, 120, 0.15);
  border: 1px solid rgba(72, 187, 120, 0.4);
  color: #276749;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: left;
  line-height: 1.35;
}

.auth-forgot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: clamp(6px, 1.2vh, 10px);
}

.auth-forgot-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.auth-forgot-link:hover {
  color: var(--color-deep-water);
  text-decoration: underline;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.auth-back-link:hover {
  color: var(--color-text-main);
  background: var(--color-surface-raised);
}

/* Mobile Phone Optimizations (<= 480px) */
@media (max-width: 480px) {
  main.app-content {
    padding: 16px 14px 96px 14px;
  }

  .screen-header {
    margin-bottom: 14px;
  }

  .screen-title {
    font-size: 1.35rem;
  }

  .screen-subtitle {
    font-size: 0.82rem;
  }

  .transparency-card {
    padding: 14px 12px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-label {
    font-size: 0.82rem;
    margin-bottom: 6px;
  }

  .input-control {
    padding: 10px 12px;
    font-size: 0.92rem;
    min-height: 42px;
  }

  .dropdown-trigger {
    padding: 9px 12px;
    font-size: 0.86rem;
    min-height: 42px;
  }

  .setting-cap-presets {
    gap: 4px;
  }

  .setting-cap-preset {
    padding: 7px 2px;
    font-size: 0.78rem;
    min-height: 34px;
  }

  .theme-picker-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .theme-card {
    padding: 8px 4px;
  }

  .theme-swatch-circle {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
  }

  .theme-card-name {
    font-size: 0.78rem;
  }

  .theme-card-tag {
    font-size: 0.64rem;
  }

  .btn {
    padding: 11px 14px;
    font-size: 0.88rem;
    min-height: 44px;
  }
}

/* Prevent background window scroll when modal is active */
body.modal-open {
  overflow: hidden !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
}

/* ==========================================================================
   Fill Bottle Stepped Slider Modal
   ========================================================================== */
.fill-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--modal-backdrop-bg, rgba(38, 59, 66, 0.42));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: clamp(8px, 2.5vw, 16px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease, background-color 0.3s ease;
  box-sizing: border-box;
}

.fill-modal-backdrop.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fill-modal-card {
  width: min(94vw, 420px);
  max-height: min(92vh, calc(100dvh - 20px), 620px);
  height: auto;
  background: var(--color-surface-raised, #edf3f0);
  border: 1px solid var(--color-surface-border, #c4d4d6);
  border-radius: var(--radius-lg, 20px);
  box-shadow: 0 20px 48px rgba(24, 45, 52, 0.2), 0 2px 10px rgba(24, 45, 52, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fillModalAppear 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes fillModalAppear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fill-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 2vh, 15px) clamp(14px, 3.5vw, 20px);
  border-bottom: 1px solid var(--color-surface-subtle, #d2e3e5);
  flex-shrink: 0;
}

.fill-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
}

.fill-modal-icon {
  width: clamp(32px, 7.5vw, 38px);
  height: clamp(32px, 7.5vw, 38px);
  border-radius: clamp(8px, 2vw, 12px);
  background: var(--color-primary-subtle, #c0e2eb);
  color: var(--color-deep-water, #3e8198);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fill-modal-icon svg {
  width: clamp(18px, 4.2vw, 22px);
  height: clamp(18px, 4.2vw, 22px);
}

.fill-modal-title {
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  font-weight: 700;
  color: var(--color-text-main, #263b42);
  margin: 0;
  line-height: 1.2;
}

.fill-modal-subtitle {
  font-size: clamp(0.7rem, 2vw, 0.78rem);
  color: var(--color-text-muted, #5d737a);
  margin: 1px 0 0 0;
}

.fill-modal-close-btn {
  background: transparent;
  border: none;
  font-size: clamp(1.3rem, 4vw, 1.5rem);
  line-height: 1;
  color: var(--color-text-muted, #5d737a);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm, 8px);
  transition: all 0.15s ease;
}

.fill-modal-close-btn:hover {
  background: var(--color-surface-subtle, #d2e3e5);
  color: var(--color-text-main, #263b42);
}

.fill-modal-body {
  padding: clamp(10px, 2vh, 16px) clamp(14px, 3.5vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.8vh, 14px);
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* Visual Readout & Mini Bottle Card */
.fill-readout-card {
  background: var(--color-surface, #e5efee);
  border: 1px solid var(--color-surface-border, #c4d4d6);
  border-radius: var(--radius-md, 14px);
  padding: clamp(8px, 1.5vh, 12px) clamp(12px, 3vw, 16px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vw, 18px);
  flex-shrink: 0;
}

.fill-readout-preview {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-bottle-meter-svg-wrap {
  width: clamp(34px, 8vw, 42px);
  height: clamp(58px, 14vw, 74px);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 8px var(--ambient-glow, rgba(103, 175, 196, 0.25)));
}

.mini-bottle-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mini-liquid-rect {
  will-change: y, height;
}

#fillModalBottleWave {
  will-change: y1, y2;
}

.fill-readout-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fill-volume-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: nowrap;
}

.fill-volume-num {
  font-size: clamp(1.75rem, 5.5vw, 2.35rem);
  font-weight: 800;
  color: var(--color-text-main, #263b42);
  line-height: 1;
  font-feature-settings: "tnum";
}

.fill-volume-unit {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 600;
  color: var(--color-text-muted, #5d737a);
}

.fill-volume-plus {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 700;
  color: var(--color-primary, #67afc4);
}

.fill-pct-badge {
  display: inline-flex;
  align-items: center;
  font-size: clamp(0.72rem, 2vw, 0.82rem);
  font-weight: 700;
  color: var(--color-deep-water, #3e8198);
  background: var(--color-primary-subtle, #c0e2eb);
  padding: 2px clamp(7px, 1.8vw, 9px);
  border-radius: 999px;
  margin-left: 4px;
}

.fill-meta-sub {
  font-size: clamp(0.72rem, 2vw, 0.8rem);
  font-weight: 500;
  color: var(--color-text-subtle, #809298);
  line-height: 1.25;
  white-space: nowrap;
}

/* Slider Section & Phone Volume Style Controls */
.fill-slider-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.fill-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fill-slider-label {
  font-size: clamp(0.78rem, 2.2vw, 0.86rem);
  font-weight: 700;
  color: var(--color-text-main, #263b42);
}

.fill-slider-wrapper {
  display: flex;
  flex-direction: column;
}

.fill-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: clamp(16px, 3vh, 20px);
  border-radius: 999px;
  background: linear-gradient(to right, var(--color-primary, #67afc4) 0%, var(--color-primary, #67afc4) var(--fill-pct, 100%), var(--color-surface-subtle, #d2e3e5) var(--fill-pct, 100%), var(--color-surface-subtle, #d2e3e5) 100%);
  outline: none;
  cursor: pointer;
  touch-action: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.fill-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(26px, 6.5vw, 30px);
  height: clamp(26px, 6.5vw, 30px);
  border-radius: 50%;
  background: #ffffff;
  border: 3.5px solid var(--color-primary, #67afc4);
  box-shadow: 0 2px 8px rgba(38, 59, 66, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: grab;
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.1s ease;
}

.fill-range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(38, 59, 66, 0.32), 0 0 0 5px rgba(103, 175, 196, 0.2);
}

.fill-range-slider::-moz-range-thumb {
  width: clamp(26px, 6.5vw, 30px);
  height: clamp(26px, 6.5vw, 30px);
  border-radius: 50%;
  background: #ffffff;
  border: 3.5px solid var(--color-primary, #67afc4);
  box-shadow: 0 2px 8px rgba(38, 59, 66, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: grab;
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.1s ease;
}

.fill-range-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(38, 59, 66, 0.32), 0 0 0 5px rgba(103, 175, 196, 0.2);
}

/* Quick Fill Presets Grid */
.fill-quick-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.fill-quick-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fill-quick-label {
  font-size: clamp(0.78rem, 2.2vw, 0.86rem);
  font-weight: 700;
  color: var(--color-text-main, #263b42);
}

.fill-quick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(4px, 1.5vw, 8px);
}

.quick-fill-btn {
  background: var(--color-surface, #e5efee);
  border: 1px solid var(--color-surface-border, #c4d4d6);
  border-radius: clamp(8px, 2vw, 12px);
  padding: clamp(8px, 1.6vh, 12px) 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.76rem, 2.2vw, 0.88rem);
  font-weight: 700;
  color: var(--color-text-main, #263b42);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(38, 59, 66, 0.04);
}

.quick-fill-btn:hover {
  background: var(--color-primary-subtle, #c0e2eb);
  border-color: var(--color-primary, #67afc4);
  color: var(--color-deep-water, #3e8198);
  transform: translateY(-1px);
}

.quick-fill-btn.active {
  background: var(--color-primary, #67afc4);
  border-color: var(--color-primary, #67afc4);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(103, 175, 196, 0.35);
}

/* Modal Footer */
.fill-modal-footer {
  display: flex;
  gap: clamp(8px, 2vw, 12px);
  padding: clamp(10px, 1.8vh, 14px) clamp(14px, 3.5vw, 20px);
  border-top: 1px solid var(--color-surface-subtle, #d2e3e5);
  background: var(--color-surface, #e5efee);
  flex-shrink: 0;
}

.fill-btn-cancel {
  flex: 1;
}

.fill-btn-confirm {
  flex: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.fill-btn-cancel,
.fill-btn-confirm {
  font-size: clamp(0.82rem, 2.4vw, 0.94rem);
  padding: clamp(8px, 1.5vh, 11px) clamp(10px, 2.5vw, 16px);
  min-height: clamp(38px, 5.5vh, 44px);
}

@media (max-width: 480px) {
  .fill-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .fill-modal-card {
    width: 100%;
    max-height: calc(100dvh - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 24px 24px 0 0;
    animation: fillSheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes fillSheetSlideUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ==========================================================================
   Redesigned Calm & Polished Privacy Policy Modal
   ========================================================================== */
.privacy-modal-card {
  width: min(94vw, 470px) !important;
  max-height: min(90vh, calc(100dvh - 24px), 680px) !important;
  background: var(--color-surface) !important;
  border: 1px solid var(--color-surface-border) !important;
  border-radius: var(--radius-lg, 20px) !important;
  box-shadow: 0 24px 60px rgba(18, 30, 36, 0.28), 0 4px 16px rgba(18, 30, 36, 0.08) !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.privacy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-surface-border);
  background: var(--color-surface-raised);
  flex-shrink: 0;
}

.privacy-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.privacy-modal-hero-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--color-primary-subtle);
  color: var(--color-deep-water);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.privacy-modal-hero-icon svg {
  width: 20px;
  height: 20px;
}

.privacy-modal-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin: 0;
  line-height: 1.2;
}

.privacy-modal-subtitle {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  margin: 2px 0 0 0;
  font-weight: 500;
}

.privacy-modal-close-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.privacy-modal-close-btn:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-main);
  transform: scale(1.05);
}

.privacy-modal-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.privacy-modal-scroll {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Hero Pill Banner */
.privacy-hero-banner {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
}

.privacy-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary-hover);
  background: var(--color-primary-subtle);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.privacy-hero-pill svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.privacy-hero-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  margin: 0;
}

/* Stored Data Stack */
.privacy-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.privacy-group-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.privacy-group-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--color-text-main);
}

.privacy-group-sub {
  font-size: 0.76rem;
  color: var(--color-text-subtle);
}

.privacy-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.privacy-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  transition: border-color 0.15s ease;
}

.privacy-detail-row:hover {
  border-color: var(--color-primary);
}

.privacy-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.privacy-row-icon svg {
  width: 17px;
  height: 17px;
}

.privacy-row-content {
  flex: 1;
  min-width: 0;
}

.privacy-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.privacy-row-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.privacy-chip {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-primary-hover);
  background: var(--color-primary-subtle);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.privacy-row-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  margin: 0;
}

/* Trust Grid */
.privacy-trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 380px) {
  .privacy-trust-grid {
    grid-template-columns: 1fr;
  }
}

.privacy-trust-card {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.privacy-trust-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 4px;
}

.privacy-trust-title svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.privacy-trust-desc {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin: 0;
}

/* Footer */
.privacy-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-surface-border);
  background: var(--color-surface-raised);
  flex-shrink: 0;
}

/* ==========================================================================
   Brand Footer Note: "Envisioned and created with love"
   ========================================================================== */
.brand-love-footer {
  text-align: center;
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0.92;
  transition: color 0.3s ease, opacity 0.2s ease;
}

.brand-love-footer .heart-svg {
  width: 14px;
  height: 14px;
  display: inline-block;
  color: var(--color-primary);
  fill: currentColor;
  vertical-align: middle;
  flex-shrink: 0;
  animation: gentleHeartbeat 3s infinite ease-in-out;
  transform-origin: center;
  transition: color 0.3s ease, fill 0.3s ease;
}

@keyframes gentleHeartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.18); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* --- Overhead Water Dripping Scene (Top Art) --- */
.auth-top-drip-scene {
  position: absolute;
  top: 0;
  left: -20px;
  right: -20px;
  height: 190px;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
  isolation: isolate;
}

.auth-top-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 150px;
  background: radial-gradient(ellipse at 50% 0%, var(--ambient-glow) 0%, rgba(0, 0, 0, 0) 72%);
  opacity: 0.9;
  filter: blur(14px);
  animation: topGlowBreathe 5s ease-in-out infinite alternate;
}

@keyframes topGlowBreathe {
  0% { opacity: 0.6; transform: translateX(-50%) scale(0.95); }
  100% { opacity: 0.95; transform: translateX(-50%) scale(1.08); }
}

/* Fluid Ceiling Canopy */
.auth-drip-ceiling {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  overflow: hidden;
}

.drip-ceiling-svg {
  position: absolute;
  top: -1px;
  left: -20%;
  width: 140%;
  height: calc(100% + 2px);
  transform-origin: top center;
}

.drip-ceiling-svg.ceiling-back {
  fill: var(--color-primary-subtle);
  opacity: 0.48;
  animation: ceilingDriftBack 7s ease-in-out infinite alternate;
}

.drip-ceiling-svg.ceiling-front {
  fill: var(--color-primary-light);
  opacity: 0.32;
  animation: ceilingDriftFront 5s ease-in-out infinite alternate;
}

@keyframes ceilingDriftBack {
  0% { transform: translateX(0) scaleY(1); }
  100% { transform: translateX(4%) scaleY(1.15); }
}

@keyframes ceilingDriftFront {
  0% { transform: translateX(3%) scaleY(1.08); }
  100% { transform: translateX(-3%) scaleY(0.92); }
}

/* Ambient Micro Beads falling softly from top canopy */
.auth-drip-stream {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.drip-bead {
  position: absolute;
  top: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95) 0%, var(--color-primary-light) 55%, var(--color-primary) 100%);
  box-shadow: 0 1px 4px var(--ambient-glow);
  opacity: 0;
  animation: beadFall 4.5s ease-in infinite;
}

.bead-1 { left: 28%; width: 4px; height: 4px; animation-duration: 4.2s; animation-delay: 0.4s; }
.bead-2 { left: 42%; width: 5px; height: 5px; animation-duration: 4.8s; animation-delay: 1.6s; }
.bead-3 { left: 58%; width: 4px; height: 4px; animation-duration: 3.9s; animation-delay: 2.4s; }
.bead-4 { left: 72%; width: 5px; height: 5px; animation-duration: 4.6s; animation-delay: 0.9s; }
.bead-5 { left: 50%; width: 6px; height: 6px; animation-duration: 5.2s; animation-delay: 3.1s; }

@keyframes beadFall {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  25% {
    opacity: 0.75;
  }
  80% {
    opacity: 0.55;
  }
  100% {
    transform: translateY(138px) scale(1.15);
    opacity: 0;
  }
}

/* Impact Ripple Rings at top of Auth Card / Badge */
.drip-impact-zone {
  position: absolute;
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drip-impact-ring {
  position: absolute;
  width: 42px;
  height: 18px;
  border-radius: 50%;
  border: 1.2px solid var(--color-primary-light);
  transform: rotateX(65deg) scale(0.2);
  opacity: 0;
  animation: impactRippleWave 4s cubic-bezier(0.1, 0.6, 0.3, 1) infinite;
}

.ring-1 { animation-delay: 0.8s; }
.ring-2 { animation-delay: 2.2s; }
.ring-3 { animation-delay: 3.6s; }

@keyframes impactRippleWave {
  0% {
    transform: rotateX(65deg) scale(0.2);
    opacity: 0.75;
  }
  40% {
    opacity: 0.45;
  }
  100% {
    transform: rotateX(65deg) scale(2.6);
    opacity: 0;
  }
}

/* --- Auth Page Dedicated Bottom Footer --- */
.auth-page-footer {
  margin-top: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
}

.auth-footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.auth-footer-link {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-footer-link:hover {
  color: var(--color-primary);
  background: var(--color-surface-subtle);
}

.auth-footer-divider {
  color: var(--color-border);
  font-size: 0.75rem;
}

.auth-footer-tagline {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-subtle);
}

.auth-page-footer .brand-love-footer {
  margin-top: 2px;
  margin-bottom: 0;
}

/* Reduced Motion (Section 28) */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


