@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   RESET & SYSTEM INITIALIZATION
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Fonts */
  --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Layout */
  --header-height: 70px;
  --sidebar-width: 280px;
  --max-width: 1400px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
}

/* ==========================================================================
   THEME STYLES - DARK MODE (DEFAULT)
   ========================================================================== */
[data-theme="dark"] {
  --bg-primary: hsl(222, 47%, 10%);
  --bg-secondary: hsl(223, 47%, 14%);
  --bg-tertiary: hsl(223, 47%, 18%);
  --bg-surface: hsl(223, 47%, 16%);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 75%);
  --text-muted: hsl(215, 15%, 55%);
  
  --accent-color: hsl(226, 100%, 64%);
  --accent-hover: hsl(226, 100%, 70%);
  --accent-glow: rgba(77, 108, 250, 0.25);
  
  --success-color: hsl(142, 70%, 45%);
  --success-hover: hsl(142, 70%, 50%);
  --success-glow: rgba(34, 197, 94, 0.2);
  
  --warning-color: hsl(38, 92%, 50%);
  --error-color: hsl(0, 84%, 60%);
  
  --border-color: hsl(223, 47%, 22%);
  --border-focus: hsl(226, 100%, 64%);
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 16px -4px rgba(0, 0, 0, 0.3), 0 4px 8px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 24px -4px rgba(0, 0, 0, 0.4), 0 8px 8px -4px rgba(0, 0, 0, 0.4);
  
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  
  --ad-bg: hsl(223, 47%, 12%);
  --ad-border: hsl(223, 47%, 18%);
  --scrollbar-thumb: hsl(223, 47%, 25%);
  --scrollbar-track: hsl(223, 47%, 10%);
}

/* ==========================================================================
   THEME STYLES - LIGHT MODE
   ========================================================================== */
[data-theme="light"] {
  --bg-primary: hsl(210, 40%, 97%);
  --bg-secondary: hsl(0, 0%, 100%);
  --bg-tertiary: hsl(210, 40%, 93%);
  --bg-surface: hsl(0, 0%, 100%);
  
  --text-primary: hsl(222, 47%, 11%);
  --text-secondary: hsl(217, 19%, 35%);
  --text-muted: hsl(215, 16%, 47%);
  
  --accent-color: hsl(226, 100%, 58%);
  --accent-hover: hsl(226, 100%, 50%);
  --accent-glow: rgba(59, 87, 240, 0.15);
  
  --success-color: hsl(142, 72%, 29%);
  --success-hover: hsl(142, 72%, 24%);
  --success-glow: rgba(22, 163, 74, 0.1);
  
  --warning-color: hsl(38, 92%, 40%);
  --error-color: hsl(0, 84%, 50%);
  
  --border-color: hsl(214, 32%, 91%);
  --border-focus: hsl(226, 100%, 58%);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.05);
  
  --ad-bg: hsl(210, 40%, 94%);
  --ad-border: hsl(210, 40%, 88%);
  --scrollbar-thumb: hsl(210, 10%, 80%);
  --scrollbar-track: hsl(210, 10%, 95%);
}

/* ==========================================================================
   GLOBAL PAGE STYLING
   ========================================================================== */
/* Global Heading Default with CLS Prevention */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-size-adjust: from-font;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  font-size: 16px;
  font-size-adjust: from-font; /* Prevent CLS on fallback font loading */
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Brand Consistent Form Controls - Global Accent Color */
input[type="range"],
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-hover);
}
a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

/* Visually Hidden Utility for A11y */
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* ==========================================================================
   SHELL LAYOUT (HEADER, SIDEBAR & MAIN WRAPPER)
   ========================================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.logo span {
  background: linear-gradient(135deg, var(--accent-color), var(--success-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 250px;
}

.search-box input[type="text"] {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.search-box input[type="text"]:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  fill: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Theme Toggle Button */
.theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.theme-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--text-muted);
}
.theme-btn:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.theme-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.theme-btn .sun-icon {
  display: none;
}
[data-theme="light"] .theme-btn .sun-icon {
  display: block;
}
[data-theme="light"] .theme-btn .moon-icon {
  display: none;
}
[data-theme="dark"] .theme-btn .moon-icon {
  display: block;
}

/* App Layout Wrapper */
.app-wrapper {
  display: flex;
  margin-top: var(--header-height);
  flex: 1;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.nav-section-title {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.nav-item a svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.nav-item a:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active a {
  background-color: var(--accent-glow);
  color: var(--text-primary);
  border-left: 3px solid var(--accent-color);
}

/* History Box in Sidebar */
.history-section {
  margin-top: auto;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  font-size: var(--text-xs);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: border-color var(--transition-fast);
}

.history-item:hover {
  border-color: var(--text-muted);
}

.history-item-info {
  flex: 1;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-val {
  font-weight: 600;
  color: var(--text-primary);
}

.history-item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.history-item-delete:hover {
  color: var(--error-color);
  background-color: rgba(239, 68, 68, 0.1);
}

.history-item-delete svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Main Content Area */
main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2.5rem;
  max-width: calc(var(--max-width) - var(--sidebar-width));
  width: 100%;
  margin-right: auto;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.mobile-menu-toggle:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ==========================================================================
   PAGE HERO & CATEGORY HEADERS
   ========================================================================== */
.hero {
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.hero p {
  color: var(--text-secondary);
  font-size: var(--text-md);
}

/* ==========================================================================
   CARDS & GRID LAYOUTS
   ========================================================================== */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  transition: all var(--transition-normal);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg {
  width: 24px;
  height: 24px;
  fill: var(--accent-color);
}

/* ==========================================================================
   FORMS & INPUT ELEMENT STYLINGS
   ========================================================================== */
.form-group {
  margin-bottom: 1.5rem; /* Gestalt Proximity: Clear separation of input blocks */
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Proximity rule: label height margin is small so they visually tie together */
label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 0.4rem; /* Small spacing for proximity */
  cursor: pointer;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--text-base);
  pointer-events: none;
}

.input-suffix {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: var(--text-sm);
  pointer-events: none;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-height: 48px; /* Mobile tap target sizing */
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

/* Adjust padding if prefix or suffix is present */
.has-prefix input {
  padding-left: 2rem;
}

.has-suffix input {
  padding-right: 2.5rem;
}

input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Slider Controls */
.slider-group {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: var(--radius-sm);
  background: var(--border-color);
  outline: none;
  transition: background var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--accent-hover);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
  background: var(--accent-hover);
}

.slider-val {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent-color);
  min-width: 45px;
  text-align: right;
}

/* Parent styling on validation errors using :has() and :user-invalid */
.form-group:has(:user-invalid) label {
  color: var(--error-color);
}

.form-group:has(:user-invalid) input,
.form-group:has(:user-invalid) select {
  border-color: var(--error-color);
}

.form-group:has(:user-invalid) input:focus-visible,
.form-group:has(:user-invalid) select:focus-visible {
  outline-color: var(--error-color);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.form-group:has(:user-invalid) .input-prefix,
.form-group:has(:user-invalid) .input-suffix {
  color: var(--error-color);
}

/* Radio Choice styling - visual cards */
.radio-tile-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.radio-tile-group input[type="radio"] {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.radio-tile-group input[type="radio"]:focus-visible + .radio-tile-label {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.radio-tile-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  background-color: var(--bg-tertiary);
  transition: all var(--transition-normal);
  text-align: center;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.radio-tile-group input[type="radio"]:checked + .radio-tile-label {
  border-color: var(--accent-color);
  background-color: var(--accent-glow);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  width: 100%;
}

.btn:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

/* ==========================================================================
   RESULTS DISPLAY PANELS
   ========================================================================== */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-card-highlight {
  background: linear-gradient(135deg, var(--accent-glow), rgba(16, 185, 129, 0.05));
  border: 2px solid var(--accent-color);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.result-val-primary {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--success-color);
  line-height: 1.1;
  margin: 0.5rem 0;
  text-shadow: 0 2px 10px var(--success-glow);
}

.result-grid-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.result-summary-box {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.result-summary-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.result-summary-val {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
}

/* Interactive SVG Chart wrapper */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
}

.chart-svg {
  width: 100%;
  height: 100%;
  max-height: 220px;
}

/* SVG Elements style styling */
.chart-pie-slice {
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  cursor: pointer;
}
.chart-pie-slice:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2s forwards ease-in-out;
}

.chart-area {
  opacity: 0.15;
}

.chart-grid-line {
  stroke: var(--border-color);
  stroke-width: 1;
}

.chart-axis-text {
  font-size: 10px;
  font-family: var(--font-body);
  fill: var(--text-muted);
}

.chart-tooltip {
  position: absolute;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

/* SVGs Drawing Animations */
@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Legend items underneath charts */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: var(--text-xs);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ==========================================================================
   AMORTIZATION & DATA TABLES
   ========================================================================== */
.table-wrapper {
  overflow-x: auto;
  margin-top: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-sm);
}

th, td {
  padding: 1rem 1.25rem;
}

th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

tr {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  transition: background-color var(--transition-fast);
}

tr:last-child {
  border-bottom: none;
}

tr:nth-child(even) {
  background-color: var(--bg-tertiary);
}

tr:hover {
  background-color: var(--bg-primary);
}

/* ==========================================================================
   AD UNIT SLOTS & SPONSORSHIPS
   ========================================================================== */
.ad-slot {
  background: linear-gradient(135deg, var(--bg-surface), var(--ad-bg));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 110px;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.ad-slot::after {
  content: "SPONSOR PROMO";
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 8px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.ad-slot-promo {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 600px;
  width: 100%;
}

.ad-slot-promo-icon {
  background: var(--accent-glow);
  color: var(--accent-color);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ad-slot-promo-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.ad-slot-promo-details {
  text-align: left;
  flex-grow: 1;
}

.ad-slot-promo-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.ad-slot-promo-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.ad-slot-promo-cta {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  background-color: var(--success-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
}

.ad-slot-promo-cta:hover {
  background-color: var(--success-hover);
}

@media (max-width: 640px) {
  .ad-slot-promo {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  .ad-slot-promo-details {
    text-align: center;
  }
}

.ad-sidebar {
  margin-top: auto;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, var(--bg-surface), var(--ad-bg));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Mobile Sticky Sponsor Ad Banner */
.mobile-sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  box-sizing: border-box;
  transition: transform 0.3s ease;
}

.mobile-sticky-ad.closed {
  transform: translateY(100%);
  pointer-events: none;
}

@media (min-width: 768px) {
  .mobile-sticky-ad {
    display: none; /* Hide on tablets and desktops */
  }
}

.mobile-sticky-ad .ad-content-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.75rem;
  justify-content: space-between;
}

.mobile-sticky-ad .ad-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  background-color: var(--accent-glow);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.mobile-sticky-ad .ad-promo-text {
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.mobile-sticky-ad .ad-cta-btn {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background-color: var(--accent-color);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.mobile-sticky-ad .ad-cta-btn:hover {
  background-color: var(--accent-hover);
}

.mobile-sticky-ad .close-ad-btn {
  position: absolute;
  top: -12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  z-index: 1001;
}

.mobile-sticky-ad .close-ad-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--error-color);
}

/* Auto Insurance Premium Visual Styles */
.insurance-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.insurance-bar-wrapper {
  display: flex;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--border-color);
}

.insurance-bar-segment {
  height: 100%;
  transition: width var(--transition-slow);
}

.ins-seg-liability { background-color: var(--accent-color); }
.ins-seg-collision { background-color: var(--success-color); }
.ins-seg-comprehensive { background-color: var(--warning-color); }
.ins-seg-medical { background-color: var(--error-color); }

.insurance-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.insurance-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.insurance-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.factor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.factor-discount {
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.factor-loading {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   LEARNING HUB & EDUCATIONAL DETAILS
   ========================================================================== */
.article-hub {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2.5rem;
}

.article-hub-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition-normal);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--text-muted);
}

.article-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  background-color: var(--accent-glow);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.article-card h3 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.article-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 1rem;
}

/* Dynamic article reader content container */
.article-reader {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.article-reader h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-reader p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.article-reader ul, .article-reader ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-reader li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
  margin-left: var(--sidebar-width);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-weight: 500;
}
.footer-links a:hover {
  color: var(--accent-color);
}

.disclaimer {
  font-size: var(--text-xs);
  max-width: 700px;
  margin: 1.5rem auto 0 auto;
  opacity: 0.7;
  line-height: 1.4;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 1024px) {
  .grid-2col {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 60px; /* Accommodate mobile sticky ad banner height */
  }

  header {
    padding: 0 1rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .search-box {
    display: none; /* Hide header search on mobile */
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    width: 260px;
    z-index: 150;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Overlay behind open mobile menu */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 140;
    backdrop-filter: blur(4px);
  }

  .sidebar-overlay.open {
    display: block;
  }

  main {
    margin-left: 0;
    padding: 1.5rem;
    max-width: 100%;
  }

  footer {
    margin-left: 0;
  }

  .hero h1 {
    font-size: var(--text-2xl);
  }

  .result-val-primary {
    font-size: var(--text-3xl);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

@media (max-width: 480px) {
  main {
    padding: 1rem;
  }
  
  .card {
    padding: 1.25rem;
  }
  
  .result-grid-summary {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SCIENTIFIC CALCULATOR DYNAMIC STYLING
   ========================================================================== */
.scientific-calc-card {
  max-width: 580px;
  margin: 0 auto 3rem auto;
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

.calc-screen {
  background-color: hsl(223, 47%, 8%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: right;
  font-family: monospace;
  position: relative;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .calc-screen {
  background-color: hsl(210, 40%, 94%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calc-mode-indicator {
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-color);
  background-color: var(--accent-glow);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.equation-display {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-height: 18px;
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
  padding-top: 0.25rem;
}

.result-display {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--success-color);
  word-break: break-all;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
  line-height: 1.2;
}

.calc-buttons-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.btn-calc {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  min-height: 48px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-calc:hover {
  background-color: var(--border-color);
  transform: translateY(-1px);
}

.btn-calc:active {
  transform: translateY(1px);
}

.btn-calc:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

/* Number Button Styles */
.btn-calc-num {
  background-color: var(--bg-secondary);
  font-size: var(--text-base);
}

/* Scientific Function Button Styles */
.btn-calc-sci {
  color: var(--accent-color);
  font-size: 13px;
  background-color: rgba(77, 108, 250, 0.05);
}
.btn-calc-sci:hover {
  background-color: var(--accent-glow);
}

/* Base Operator Button Styles */
.btn-calc-op {
  color: var(--warning-color);
  font-size: var(--text-base);
}

/* Special Controls Button Styles */
.btn-calc-action {
  color: var(--error-color);
}
.btn-calc-action:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--error-color);
}

/* Equals Button Styles */
.btn-calc-eq {
  background-color: var(--success-color);
  color: #fff;
  font-size: var(--text-lg);
  border-color: var(--success-color);
}
.btn-calc-eq:hover {
  background-color: var(--success-hover);
  border-color: var(--success-hover);
  box-shadow: 0 0 10px var(--success-glow);
}

@media (max-width: 480px) {
  .scientific-calc-card {
    padding: 1rem;
    margin-bottom: 2rem;
  }
  
  .btn-calc {
    min-height: 48px;
    font-size: 13px;
  }
  
  .result-display {
    font-size: var(--text-xl);
  }
}

/* ==========================================================================
   BMI CALCULATOR SPECIFIC STYLES
   ========================================================================== */
.bmi-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem 0;
  position: relative;
}
.bmi-gauge-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}
.bmi-needle {
  transform-origin: 100px 90px;
  transition: transform var(--transition-slow);
}
.bmi-category-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: var(--text-sm);
  margin-top: 0.5rem;
  text-align: center;
}
.bmi-badge-underweight { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.bmi-badge-normal { background-color: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.bmi-badge-overweight { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.bmi-badge-obese { background-color: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ==========================================================================
   CALORIE & BMR SPECIFIC STYLES
   ========================================================================== */
.calorie-doughnut-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 1.5rem 0;
}
.calorie-doughnut-svg {
  max-width: 200px;
  width: 100%;
  height: auto;
}
.calorie-center-text {
  position: absolute;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.calorie-center-val {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.calorie-center-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}
.macro-legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.macro-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  border: 1px solid var(--border-color);
}
.macro-bar-fill {
  height: 4px;
  border-radius: 2px;
  margin-top: 6px;
}

/* ==========================================================================
   PERCENTAGE CALCULATOR STYLES
   ========================================================================== */
.pct-block {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.pct-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.pct-card:focus-within {
  border-color: var(--border-focus);
}
.pct-sentence-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
}
.pct-sentence-row input[type="number"] {
  width: 90px;
  min-height: 48px;
  padding: 0.25rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: var(--text-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.pct-sentence-row input[type="number"]:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.pct-result-inline {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--success-color);
  border-bottom: 2px dashed var(--success-color);
  padding: 0 4px;
  margin-left: 0.25rem;
  min-width: 40px;
  text-align: center;
}

/* ==========================================================================
   AGE & DATE CALCULATOR STYLES
   ========================================================================== */
.agedate-result-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.agedate-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.agedate-summary-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  text-align: center;
}
.agedate-summary-num {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1.1;
}
.agedate-summary-lbl {
  font-size: var(--text-xs);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}
.birthday-countdown-card {
  background: linear-gradient(135deg, rgba(77, 108, 250, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}
.birthday-countdown-svg {
  width: 44px;
  height: 44px;
}
.fun-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.fun-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}
.fun-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.fun-stat-val {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

/* ==========================================================================
   PASSWORD GENERATOR STYLES
   ========================================================================== */
.password-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.password-box-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--accent-glow);
}
.password-display-field {
  flex-grow: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
  user-select: all;
  min-height: 28px;
  display: flex;
  align-items: center;
}
.password-display-field:empty::before {
  content: "Click Generate";
  color: var(--text-muted);
  font-style: italic;
}
.btn-copy-clipboard {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.btn-copy-clipboard:hover {
  background: var(--accent-hover);
}
.password-strength-container {
  margin: 1rem 0 1.5rem 0;
}
.password-strength-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
}
.password-strength-meter-bg {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.password-strength-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width var(--transition-normal), background-color var(--transition-normal);
}
.password-strength-weak { background-color: var(--error-color); }
.password-strength-medium { background-color: var(--warning-color); }
.password-strength-strong { background-color: var(--success-color); }
.password-strength-secure { background-color: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }

.password-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  font-size: var(--text-xs);
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.checklist-item.active {
  color: var(--text-primary);
}
.checklist-item svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.copy-tooltip {
  position: absolute;
  top: -35px;
  right: 15px;
  background: var(--success-color);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.copy-tooltip.show {
  opacity: 1;
}

@media (max-width: 580px) {
  .agedate-summary-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .password-checklist {
    grid-template-columns: 1fr;
  }
  .macro-legend-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}


