.image-crop-dialog { width: min(1100px, calc(100vw - 32px)); max-height: 90dvh; margin: auto; padding: 24px; border: 1px solid var(--border-card); border-radius: 16px; background: var(--bg-app); color: var(--text-main); overflow: auto; }
.image-crop-dialog::backdrop { background: rgba(0, 0, 0, .75); }
.image-crop-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.image-crop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 24px; margin-top: 16px; }
.image-crop-stage { position: relative; touch-action: none; user-select: none; cursor: crosshair; overflow: hidden; line-height: 0; }
.image-crop-stage img { display: block; width: 100%; height: auto; }
.image-crop-selection { position: absolute; border: 2px solid var(--primary); outline: 1px solid #111; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .48); pointer-events: none; }
.image-crop-controls { display: grid; gap: 12px; min-width: 0; }
.image-crop-controls fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 1px solid var(--border-card); padding: 12px; min-width: 0; }
.image-crop-controls label { display: grid; gap: 4px; min-width: 0; }
.image-crop-controls input { width: 100%; min-width: 0; min-height: 44px; }
.image-crop-controls canvas { width: 100%; height: auto; border: 1px solid var(--border-card); background: white; }
.image-crop-dialog button { min-height: 44px; }
.image-crop-dialog p { color: var(--text-muted); line-height: 1.5; margin-top: 12px; }
@media (max-width: 700px) { .image-crop-layout { grid-template-columns: minmax(0, 1fr); } .image-crop-dialog { padding: 16px; } }
/* Personal Gym module styles — all scoped under .gym-* classes to avoid
   global CSS conflicts. Reuses design tokens from application.css. */

:root {
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

.gym-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

/* Adjacent panels need breathing room (panels have no outer margin). */
.gym-stats + .panel,
.panel + .panel,
section.panel + section.panel {
  margin-top: var(--space-md);
}

.gym-stats .panel {
  margin-top: 0;
}

.gym-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
}

.gym-stat span {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gym-stat strong {
  font-size: 1.4rem;
  font-family: var(--font-mono);
}

.gym-timer {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.gym-timer-lg {
  font-size: 1.6rem;
  padding: var(--space-sm) var(--space-md);
}

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

.gym-day-start {
  cursor: pointer;
  transition: all 200ms ease;
}

.gym-day-start:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.gym-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Day chips / exercise chips: flex-wrap with min 8px gap (touch spacing).
   Replaces the nowrap .transaction-category span which clipped + jammed. */
.gym-day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: 6px;
}

/* Header with 2+ actions: keep buttons grouped with a real gap. */
.gym-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.gym-set-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.gym-set-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 200ms ease;
}

.gym-set-row.is-done {
  opacity: 0.6;
  border-color: var(--accent-glow);
}

.gym-set-row.is-done .gym-set-form label {
  text-decoration: line-through;
}

.gym-set-kind {
  min-width: 3.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.gym-set-form {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
  flex-wrap: wrap;
}

.gym-set-form label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.gym-set-form input[type="number"] {
  width: 5.5rem;
  padding: 6px 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: border-color 200ms ease;
}

.gym-set-form input[type="number"]:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.gym-plan-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.gym-plan-form {
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

.gym-plan-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.gym-plan-form input,
.gym-plan-form select {
  padding: 6px 10px;
  background: var(--surface-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: border-color 200ms ease;
}

.gym-plan-form input:focus,
.gym-plan-form select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.gym-plan-name {
  min-width: 12rem;
  font-weight: 600;
}

.gym-icon-btn {
  padding: var(--space-xs);
}

.gym-add-plan {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px dashed var(--border-subtle);
}

.gym-day-form {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.gym-day-form input {
  flex: 1;
  max-width: 20rem;
  padding: 10px 14px;
  background: var(--surface-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: border-color 200ms ease;
}

.gym-day-form input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.gym-filters {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.gym-filters > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.gym-filters input,
.gym-filters select {
  padding: 8px 12px;
  background: var(--surface-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: border-color 200ms ease;
}

.gym-filters input:focus,
.gym-filters select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.gym-trend {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  min-height: 140px;
  padding: var(--space-md) 0;
}

.gym-trend > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-xs);
  min-height: 140px;
}

.gym-trend span {
  width: 100%;
  max-width: 42px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.gym-trend small {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.gym-trend em {
  color: var(--text-subtle);
  font-size: 0.7rem;
  font-style: normal;
}

.gym-chart-wrap {
  position: relative;
  height: 280px;
}

.gym-active-panel {
  border-color: var(--accent-glow);
  box-shadow: var(--shadow-glow);
}

.gym-finish-panel {
  margin-top: var(--space-lg);
}

@media (max-width: 640px) {
  .gym-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
  }

  .gym-set-row {
    flex-wrap: wrap;
  }

  .gym-plan-name {
    min-width: 100%;
  }

  .gym-trend {
    gap: 4px;
  }
}
.learning-shell{max-width:1240px;margin:0 auto;display:grid;gap:24px;min-width:0}.learning-header,.learning-actions,.learning-meta{display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap}.learning-header h1{font-size:clamp(1.8rem,4vw,2.6rem);margin:4px 0}.learning-eyebrow{color:var(--primary);text-transform:uppercase;letter-spacing:.12em;font-size:.8rem}.learning-panel{background:var(--surface-card);border:1px solid var(--border-card);border-radius:16px;padding:24px;min-width:0;overflow-wrap:anywhere}.learning-panel h2,.learning-panel h3{margin:0 0 12px}.learning-panel p,.learning-header p{color:var(--text-muted);line-height:1.65}.learning-panel a:not(.btn){color:var(--primary);text-decoration:underline;text-underline-offset:4px}.learning-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.learning-stats strong{display:block;font-size:2.2rem;margin-top:8px}.learning-stats span,.learning-meta{color:var(--text-muted)}.learning-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.learning-meta{font-size:.85rem;margin-bottom:18px}.learning-next{border-left:4px solid var(--primary)}.learning-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:24px}.learning-wide{grid-column:1/-1}.learning-form label,.learning-filters label{display:block;margin-bottom:8px}.learning-form input:not([type=submit]),.learning-form select,.learning-form textarea,.learning-filters input:not([type=submit]),.learning-filters select{width:100%;min-height:44px;padding:12px;border:1px solid var(--border-card);border-radius:8px;background:var(--surface-input);color:var(--text-main);font:inherit;box-sizing:border-box}.learning-filters{display:flex;align-items:end;gap:16px;flex-wrap:wrap}.learning-filters>div{flex:1;min-width:160px}.learning-shell .btn,.learning-shell summary{min-height:44px;cursor:pointer}.learning-shell :focus-visible{outline:2px solid var(--primary);outline-offset:4px}.learning-shell progress{display:block;width:100%;height:10px;margin-top:12px;accent-color:var(--accent)}.learning-history{border-top:1px solid var(--border-card);padding:20px 0}.learning-source{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.8;max-width:85ch;margin:24px auto}.learning-shell .btn{white-space:normal;text-align:center}@media(max-width:1000px){.learning-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.learning-grid,.learning-form{grid-template-columns:1fr}.learning-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.learning-panel{padding:18px}.learning-actions{align-items:stretch}.learning-actions .btn{flex:1}.learning-filters>div{min-width:100%}}
/* Rendered source typography; long code and tables scroll within the article. */
.learning-markdown { white-space: normal; }
.learning-markdown :is(h1,h2,h3,h4,h5,h6) { margin: 1.7em 0 .65em; line-height: 1.3; color: var(--text-main); }
.learning-markdown > :first-child { margin-top: 0; }
.learning-markdown h2 { font-size: 1.6rem; border-bottom: 1px solid var(--border-card); padding-bottom: .5em; }
.learning-markdown h3 { font-size: 1.25rem; }
.learning-markdown p { margin: 0 0 1em; color: var(--text-main); }
.learning-markdown :is(ul,ol) { padding-left: 1.6em; margin: 0 0 1.2em; }
.learning-markdown ul { list-style: disc; }
.learning-markdown ol { list-style: decimal; }
.learning-markdown li { margin: .4em 0; }
.learning-markdown li > :is(ul,ol) { margin-bottom: .5em; }
.learning-markdown code { font-family: 'IBM Plex Mono', monospace; font-size: .88em; background: var(--surface-elevated); padding: .15em .35em; border-radius: 4px; }
.learning-markdown pre { overflow-x: auto; padding: 18px; border: 1px solid var(--border-card); border-radius: 10px; background: var(--surface-input); white-space: pre; }
.learning-markdown pre code { background: none; padding: 0; }
.learning-markdown table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.4em 0; }
.learning-markdown :is(th,td) { border: 1px solid var(--border-card); padding: 10px 14px; text-align: left; }
.learning-markdown th { background: var(--surface-elevated); }
.learning-markdown blockquote { margin: 1em 0; padding: .5em 1em; border-left: 3px solid var(--primary); }
.learning-markdown hr { border: 0; border-top: 1px solid var(--border-card); margin: 2em 0; }
/*


 */

/* ==========================================================================
   1. DESIGN TOKENS & SYSTEM VARIABLES (Obsidian Luxe Fintech)
   ========================================================================== */
:root {
  /* Color Palette - Obsidian Void & Electric Accents */
  --bg-app: #070A12;
  --bg-mesh: radial-gradient(circle at 85% -15%, rgba(56, 189, 248, 0.16) 0%, transparent 45%),
             radial-gradient(circle at 10% 25%, rgba(16, 185, 129, 0.1) 0%, transparent 35%),
             radial-gradient(circle at 50% 90%, rgba(99, 102, 241, 0.08) 0%, transparent 40%);
  --surface-card: rgba(15, 23, 42, 0.72);
  --surface-card-hover: rgba(22, 32, 56, 0.85);
  --surface-elevated: rgba(30, 41, 59, 0.7);
  --surface-input: rgba(11, 17, 32, 0.8);
  
  /* Text & Inks */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;
  
  /* Borders & Glass Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(56, 189, 248, 0.35);
  --border-active: rgba(99, 102, 241, 0.6);
  
  /* Brand & Status Accents */
  --primary: #38BDF8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --primary-hover: #0EA5E9;
  --accent: #10B981;
  --accent-glow: rgba(16, 185, 129, 0.22);
  --accent-hover: #059669;
  --positive: #10B981;
  --positive-bg: rgba(16, 185, 129, 0.12);
  --negative: #F43F5E;
  --negative-bg: rgba(244, 63, 94, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  
  /* Sidebar */
  --sidebar-bg: rgba(6, 9, 17, 0.88);
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-link: #94A3B8;
  --sidebar-link-hover: #FFFFFF;
  --sidebar-link-bg-hover: rgba(255, 255, 255, 0.06);
  --sidebar-link-active: #FFFFFF;
  --sidebar-link-bg-active: rgba(56, 189, 248, 0.14);
  
  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-card);
  --shadow-card-hover: 0 20px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-hover);
  --shadow-glow: 0 0 24px var(--primary-glow);
  
  /* Typography */
  --font-family: 'Saira', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: var(--font-family);
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-app: #F8FAFC;
  --bg-mesh: radial-gradient(circle at 85% -15%, rgba(37, 99, 235, 0.08) 0%, transparent 45%),
             radial-gradient(circle at 10% 25%, rgba(16, 185, 129, 0.06) 0%, transparent 35%);
  --surface-card: #FFFFFF;
  --surface-card-hover: #F8FAFC;
  --surface-elevated: #F1F5F9;
  --surface-input: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #64748B;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-card: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(37, 99, 235, 0.4);
  --sidebar-bg: #FFFFFF;
  --sidebar-border: rgba(15, 23, 42, 0.08);
  --sidebar-link: #475569;
  --sidebar-link-hover: #0F172A;
  --sidebar-link-bg-hover: rgba(15, 23, 42, 0.04);
  --sidebar-link-active: #0F172A;
  --sidebar-link-bg-active: rgba(37, 99, 235, 0.1);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 0 0 1px var(--border-card);
  --shadow-card-hover: 0 12px 30px -4px rgba(15, 23, 42, 0.12), 0 0 0 1px var(--border-hover);
}

/* ==========================================================================
   2. GLOBAL BASE & RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--bg-app);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.42;
}

body::before {
  width: 20rem;
  height: 20rem;
  background: rgba(37, 99, 235, 0.22);
  top: 4rem;
  right: 8%;
}

body::after {
  width: 18rem;
  height: 18rem;
  background: rgba(16, 185, 129, 0.18);
  bottom: 8%;
  left: 12%;
}

/* PDF to Markdown */
.document-upload-panel, .document-history-panel, .markdown-result-panel { margin-bottom: 1.5rem; }
.document-upload-form { max-width: 48rem; }
.document-upload-form textarea, .markdown-result {
  width: 100%;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--text-main);
  font: inherit;
  padding: 0.75rem 0.875rem;
}
.document-upload-form textarea:focus, .markdown-result:focus { outline: 3px solid var(--primary-glow); border-color: var(--primary); }
.annotation-mode-group { border: 0; padding: 0; }
.annotation-mode-group legend { color: var(--text-main); font-size: .86rem; font-weight: 700; margin-bottom: .5rem; }
.annotation-mode-options { display: grid; gap: .5rem; }
.annotation-mode-options label { align-items: center; color: var(--text-main); cursor: pointer; display: flex; font-size: .875rem; gap: .5rem; min-height: 2.75rem; }
.annotation-mode-options input { accent-color: var(--primary); height: 1rem; width: 1rem; }
.conversion-options {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}
.conversion-options:hover {
  border-color: var(--border-hover);
}
.conversion-options summary {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  transition: color 0.18s ease;
}
.conversion-options summary:hover {
  color: var(--text-main);
}
.conversion-options .field-hint {
  margin: 0.35rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.conversion-options-grid {
  display: grid;
  gap: 0.5rem 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.conversion-option {
  align-items: center;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  font-size: 0.8125rem;
  gap: 0.5rem;
  min-height: 2.2rem;
}
.conversion-option input[type="checkbox"] {
  accent-color: var(--primary);
  height: 1.05rem;
  width: 1.05rem;
  cursor: pointer;
}
.conversion-option input[type="hidden"] { display: none; }
.conversion-option--select {
  align-items: start;
  flex-direction: column;
  gap: 0.3rem;
}
.conversion-option--select label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.conversion-option--select select {
  min-height: 2.2rem;
  width: 100%;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}
.document-history-list { display: grid; gap: 0.625rem; }
.document-history-row { align-items: center; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); display: flex; gap: 1rem; justify-content: space-between; padding: 0.875rem 1rem; }
.document-history-main { display: grid; gap: 0.2rem; min-width: 0; }
.document-history-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-history-main span { color: var(--text-muted); font-size: 0.8125rem; }
.document-history-actions { align-items: center; display: flex; flex-shrink: 0; gap: 0.75rem; }
.document-status { border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.625rem; }
.document-status--completed { background: var(--positive-bg); color: var(--positive); }
.document-status--failed { background: var(--negative-bg); color: var(--negative); }
.document-status--pending, .document-status--processing { background: var(--warning-bg); color: var(--warning); }
.button-compact { padding: 0.45rem 0.75rem; font-size: 0.8125rem; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.markdown-find-bar { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .75rem; }
.markdown-find-bar input { min-height: 2.4rem; min-width: 10rem; width: 12rem; }
.markdown-find-bar span { color: var(--text-muted); font-size: .75rem; min-height: 1.25rem; }
.markdown-editor-shell {
  background: var(--surface-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  overflow: hidden;
  position: relative;
  flex: 1;
  min-height: 0;
}
.markdown-line-numbers {
  background: color-mix(in srgb, var(--surface-input), #000 18%);
  color: var(--text-muted);
  font: 0.82rem/1.65 var(--font-mono);
  margin: 0;
  overflow: hidden;
  padding: 0.85rem 0.5rem 0.85rem 0.75rem;
  text-align: right;
  user-select: none;
  border-right: 1px solid var(--border-subtle);
  min-width: 2.75rem;
}
.markdown-result {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  margin: 0;
  padding: 0.85rem 1rem;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  resize: none;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
  outline: none;
}
.markdown-result.is-no-wrap {
  white-space: pre;
  overflow-x: auto;
  word-break: normal;
}
@media (max-width: 40rem) { .document-history-row { align-items: flex-start; flex-direction: column; } .document-history-actions { width: 100%; justify-content: space-between; } }

.document-workspace { display: flex; flex-direction: column; gap: 1rem; }
.document-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.workspace-meta-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; flex: 1; }
.workspace-meta-title-row { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.workspace-meta-group strong { font-size: 0.95rem; color: var(--text-main); font-weight: 700; }
.workspace-meta-group span, .document-workspace-feedback { color: var(--text-muted); font-size: 0.78rem; }
.workspace-view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
}
.workspace-view-switcher .button-compact {
  height: 28px;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--text-muted);
}
.workspace-view-switcher .button-compact:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.workspace-view-switcher .button-compact.is-active {
  background: var(--surface-card);
  color: var(--primary);
  border-color: var(--border-focus);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.document-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.document-workspace-actions .button-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--radius-md);
}
.document-workspace-actions .btn-icon {
  flex-shrink: 0;
  opacity: 0.85;
}
.document-workspace-actions .button-compact:hover .btn-icon {
  opacity: 1;
}
.export-action-form { margin: 0; display: inline-flex; }

@media (min-width: 58rem) {
  .document-workspace-actions {
    flex-wrap: nowrap;
  }
}

.document-reprocess-bar {
  padding: 0.75rem 1.15rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.document-reprocess-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  width: 100%;
}
.reprocess-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.reprocess-controls-inline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.reprocess-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.reprocess-annotation-select {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0.35rem 2rem 0.35rem 0.75rem !important;
  font-size: 0.8rem !important;
  border-radius: var(--radius-sm) !important;
  background-color: var(--surface-input) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-subtle) !important;
}
.reprocess-submit-btn {
  height: 34px !important;
  padding: 0.35rem 0.85rem !important;
  font-size: 0.8rem !important;
}
.reprocess-options-wrapper {
  width: 100%;
}
.document-workspace-actions button:disabled { cursor: wait; opacity: .65; }
.document-workspace-feedback { min-height: 1.25rem; }

/* Document Grid Layout */
.document-workspace-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}
.workspace-view--editor .document-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}
.workspace-view--editor .markdown-preview-panel {
  display: none !important;
}
.workspace-view--preview .document-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}
.workspace-view--preview .markdown-editor-panel {
  display: none !important;
}

.markdown-editor-panel, .markdown-preview-panel {
  min-width: 0;
  height: 640px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.markdown-editor-panel .panel-header, .markdown-preview-panel .panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.editor-quick-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.button-accent {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  border: none;
}
.button-accent:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.editor-format-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.button-icon-only {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
}
.button-icon-only:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.editor-status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  border-top: 0;
  background: var(--surface-card);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  flex-shrink: 0;
}
.editor-status-bar .status-sep {
  opacity: 0.4;
}

/* Markdown Preview Styling */
.markdown-preview {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1.5rem;
  background: var(--surface-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.7;
  font-size: 0.92rem;
  color: var(--text-main);
}
.markdown-preview:focus {
  outline: 1px solid var(--border-focus);
}

.markdown-heading {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.3;
  margin: 1.3rem 0 0.6rem;
}
.markdown-h1 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.4rem;
  margin-top: 0;
}
.markdown-h2 {
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.3rem;
  margin-top: 1.4rem;
}
.markdown-h3 { font-size: 1.1rem; margin-top: 1.1rem; }
.markdown-h4, .markdown-h5, .markdown-h6 { font-size: 0.98rem; }

.markdown-p {
  color: var(--text-main);
  margin: 0 0 0.95rem;
  line-height: 1.7;
}
.markdown-list {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}
.markdown-list li {
  margin-bottom: 0.35rem;
  line-height: 1.6;
}
.markdown-quote {
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--primary);
  background: rgba(99, 102, 241, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.markdown-quote p {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}
.markdown-code-block {
  background: color-mix(in srgb, var(--surface-input), #000 25%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 1rem 0;
}
.markdown-code-block code {
  background: transparent;
  padding: 0;
  border: 0;
  font-family: inherit;
}
.markdown-divider {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  margin: 1.5rem 0;
}
.markdown-rendered-table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.85rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.markdown-rendered-table th {
  background: var(--surface-card);
  color: var(--text-main);
  font-weight: 700;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.markdown-rendered-table td {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.markdown-rendered-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
.markdown-highlight {
  background: rgba(234, 179, 8, 0.25);
  color: #fde047;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-weight: 500;
}
.markdown-underline {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--primary);
}
.markdown-figure {
  margin: 1.25rem 0;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
}
.markdown-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.markdown-figure figcaption {
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(0, 0, 0, 0.15);
}
.markdown-frontmatter-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
}
.frontmatter-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.frontmatter-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.35rem 1rem;
  margin: 0;
}
.frontmatter-item {
  display: flex;
  gap: 0.4rem;
}
.frontmatter-item dt {
  color: var(--text-muted);
  font-weight: 600;
}
.frontmatter-item dd {
  color: var(--text-main);
  margin: 0;
}
.markdown-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.document-source-panel { display: grid; gap: .75rem; }
.document-source-panel .panel-header { align-items: center; }
.document-source-viewer { background: var(--surface-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); height: 42rem; width: 100%; }
.document-stats-panel, .document-gallery-panel { margin-top: 1.5rem; }
.document-stats-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.document-stats-grid div { background: var(--surface-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: .75rem; }
.document-stats-grid dt { color: var(--text-muted); font-size: .75rem; }
.document-stats-grid dd { font-size: 1.35rem; font-weight: 700; margin: .15rem 0 0; }
.document-gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
}
.document-gallery-item {
  display: flex;
  flex-direction: column;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  overflow: hidden;
  padding-bottom: 0.625rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.document-gallery-item:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}
.document-gallery-item > a {
  color: inherit;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.document-gallery-item img {
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
  width: 100%;
}
.document-gallery-item span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.625rem 0.35rem;
  color: var(--text-muted);
}
.document-gallery-item button,
.document-gallery-item .button {
  margin: auto 0.625rem 0;
  width: calc(100% - 1.25rem);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.5rem;
  min-height: 34px;
  height: auto;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}

@media (max-width: 62rem) {
  .document-workspace-grid { grid-template-columns: 1fr; }
  .markdown-editor-panel, .markdown-preview-panel { height: 480px; }
}
@media (max-width: 40rem) {
  .document-workspace-toolbar { align-items: flex-start; flex-direction: column; }
  .document-workspace-actions { width: 100%; }
  .document-workspace-actions > * { flex: 1; }
  .markdown-find-bar input { flex: 1 1 100%; width: 100%; }
  .markdown-find-bar button { flex: 1; }
}

/* Spending report */
.report-filter-panel { margin-bottom: 1.5rem; }
.report-date-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 1.25rem;
  align-items: end;
}
.report-date-form .filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.report-date-form .filter-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}
.report-date-form .filter-actions-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.filter-actions-label {
  font-size: 0.72rem;
  line-height: 1;
  user-select: none;
  visibility: hidden;
}
.report-date-form .filter-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.report-date-form .filter-input,
.report-date-form .filter-actions .button,
.transaction-filters .filter-actions .button {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.35rem;
  font-size: 0.9rem;
}
@media (max-width: 860px) {
  .report-date-form {
    grid-template-columns: 1fr;
  }
  .filter-actions-label {
    display: none;
  }
}
.report-metrics { margin-bottom: 1.5rem; }
.spending-report-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); gap: 1.5rem; margin-bottom: 1.5rem; }
.spending-chart-figure { margin: 1.25rem 0 0; }
.spending-chart-container { height: 285px; position: relative; }
.spending-chart-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.spending-legend-item, .top-category-button { appearance: none; border: 1px solid var(--border-card); background: var(--surface-input); color: var(--text-main); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease; touch-action: manipulation; }
.spending-legend-item { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .65rem; font: inherit; font-size: .78rem; }
.spending-legend-item:hover, .spending-legend-item[aria-pressed="true"], .top-category-button:hover, .top-category-button.is-selected { background: var(--surface-card-hover); border-color: var(--border-active); box-shadow: 0 0 0 1px var(--border-active); }
.category-color-dot { width: .65rem; height: .65rem; flex: 0 0 .65rem; border-radius: 50%; display: inline-block; }
.top-category-list { list-style: none; display: grid; gap: .6rem; margin: 1.2rem 0 0; padding: 0; counter-reset: top-category; }
.top-category-list li { counter-increment: top-category; }
.top-category-button { width: 100%; min-height: 48px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .65rem .75rem; text-align: left; }
.top-category-button::before { content: counter(top-category); color: var(--text-muted); font-size: .8rem; font-family: var(--font-mono); }
.top-category-name { overflow-wrap: anywhere; font-weight: 650; }
.top-category-amount { display: grid; justify-items: end; font-variant-numeric: tabular-nums; font-size: .85rem; }
.top-category-amount small { color: var(--text-muted); font-weight: 600; }
.subcategory-panel { min-height: 175px; }
.subcategory-empty { color: var(--text-muted); padding: 1.25rem 0 .25rem; }
.subcategory-list { display: grid; gap: .65rem; margin-top: 1.2rem; }
.subcategory-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .85rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-input); font-variant-numeric: tabular-nums; }
.subcategory-name { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .spending-report-grid { grid-template-columns: 1fr; }
  .spending-chart-container { height: 250px; }
}

/* Transaction tags */
.transaction-tag-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.transaction-tag { display: inline-flex; align-items: center; min-height: 22px; padding: .15rem .5rem; border: 1px solid var(--border-active); border-radius: var(--radius-full); background: var(--primary-glow); color: var(--text-main); font-size: .72rem; font-weight: 700; line-height: 1.35; }
.tag-quick-create, .tag-management-panel { margin-bottom: 1.5rem; }
.tag-management-list, .tag-report-list { display: grid; gap: .65rem; margin-top: 1rem; }
.tag-management-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .85rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-input); }
.template-action-form { display: flex; align-items: end; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.template-management-list { display: grid; gap: .75rem; margin-top: 1rem; }
.template-management-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-input); }
.template-details { min-width: 0; }
.template-title-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.template-title-row h3 { font-size: .95rem; color: var(--text-main); margin: 0; }
.template-details p { color: var(--text-muted); font-size: .8rem; margin: .35rem 0 0; overflow-wrap: anywhere; }
.template-badge { display: inline-flex; border-radius: var(--radius-full); padding: .18rem .5rem; font-size: .7rem; font-weight: 700; color: var(--primary); background: var(--primary-glow); }
.template-badge.custom { color: var(--accent); background: var(--accent-glow); }
.template-management-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.template-inline-form { display: flex; align-items: center; gap: .5rem; }
.template-inline-form .form-control { max-width: 11rem; }
.nav-unread-badge { min-width: 1.25rem; height: 1.25rem; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; padding: 0 .3rem; border-radius: var(--radius-full); font-size: .7rem; font-weight: 800; color: #fff; background: var(--negative); }
.notification-dashboard-card { margin-bottom: 1.5rem; border-color: rgba(245, 158, 11, .35); }
.notification-preview-list, .notification-history-list { display: grid; gap: 0.75rem; }
.notification-preview, .notification-history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  transition: all 0.2s ease;
  position: relative;
}
.notification-preview:hover, .notification-history-row:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-hover);
  transform: translateX(2px);
}
.notification-preview strong, .notification-history-row h3 { color: var(--text-main); font-size: 0.95rem; font-weight: 700; margin: 0; }
.notification-preview p, .notification-history-row p { color: var(--text-muted); font-size: 0.85rem; margin: 0.25rem 0 0; line-height: 1.45; }
.notification-preview time, .notification-history-row time { color: var(--text-subtle); font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.notification-history-row.is-unread { border-left: 3px solid var(--warning); background: rgba(245, 158, 11, 0.06); }

/* Notifications Layout & Smart Spending Limits */
.notifications-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.limits-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.limit-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  transition: all 0.2s ease;
}

.limit-card:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.limit-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.limit-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.daily-icon {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38BDF8;
}

.weekly-icon {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #C084FC;
}

.limit-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.limit-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

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

.limit-input {
  width: 100%;
  padding-right: 4rem !important;
  font-family: var(--font-mono);
  font-size: 1.25rem !important;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.currency-addon {
  position: absolute;
  right: 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  pointer-events: none;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

/* Collapsible Notification History */
.notification-collapsible-panel {
  padding: 0;
  overflow: hidden;
}

.notification-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 1.5rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.18s ease;
}

.notification-collapsible-summary::-webkit-details-marker {
  display: none;
}

.notification-collapsible-summary:hover {
  background: rgba(255, 255, 255, 0.025);
}

.collapsible-summary-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.notification-bell-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-bell-badge svg {
  width: 20px;
  height: 20px;
}

.collapsible-summary-left h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.collapsible-summary-left p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
}

.collapsible-summary-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.collapsible-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

details[open] .collapsible-chevron {
  transform: rotate(180deg);
}

.notification-collapsible-content {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #F59E0B;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.badge-subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.notification-empty-state {
  padding: 2.5rem 1.5rem;
}

.notification-empty-state .empty-state-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-full);
  color: #F59E0B;
}

.notification-empty-state .empty-state-icon svg {
  width: 26px;
  height: 26px;
}

.subscription-list { display: grid; gap: 0.75rem; }
.subscription-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  transition: all 0.2s ease;
}
.subscription-row:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-hover);
  transform: translateX(2px);
}
.subscription-row.is-upcoming { border-left: 3px solid var(--warning); background: rgba(245, 158, 11, 0.04); }
.subscription-title { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.subscription-title h3 { margin: 0; color: var(--text-main); font-size: 0.95rem; font-weight: 700; }
.subscription-row p { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.82rem; }
.subscription-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.subscription-reminders { margin-bottom: 1.5rem; }

.health-score-panel { margin-bottom: 1.5rem; }
.health-score-layout {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}
.health-gauge {
  width: 140px;
  height: 140px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0%, var(--primary) calc(var(--score) * 1%), rgba(255, 255, 255, 0.06) 0);
  box-shadow: inset 0 0 0 14px var(--surface-card), 0 0 20px rgba(16, 185, 129, 0.2);
  position: relative;
}
.health-gauge strong {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1;
}
.health-gauge span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.health-suggestions {
  margin: 0.5rem 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
}
.health-trend {
  height: 90px;
  display: flex;
  align-items: end;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}
.health-trend div {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}
.health-trend span {
  width: 100%;
  max-width: 24px;
  background: linear-gradient(to top, var(--primary), var(--accent));
  border-radius: 4px 4px 0 0;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
  transition: height 0.4s ease;
}
.health-trend small {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.tag-usage-count { margin-left: 0.6rem; color: var(--text-muted); font-size: 0.82rem; }
.tag-merge-form { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border-subtle); }
.tag-merge-form .filter-field { flex: 1 1 220px; }
.tag-merge-form select[multiple] { min-height: 110px; }

/* Savings goal contributions */
.goal-detail-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.5rem; }
.goal-contribution-list { display: grid; gap: .65rem; margin-top: 1rem; }
.goal-contribution-row { padding: .8rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-input); }
.goal-contribution-row > div { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.goal-contribution-row span { color: var(--text-muted); font-size: .84rem; }
.goal-contribution-row .recurring-badge { color: var(--text-main); }
.goal-contribution-note { width: 100%; }

@media (max-width: 520px) {
  .tag-management-row { align-items: flex-start; }
  .template-management-row { align-items: flex-start; flex-direction: column; }
  .template-management-actions { justify-content: flex-start; }
  .template-inline-form { width: 100%; }
  .template-inline-form .form-control { flex: 1; max-width: none; }
  .notification-preview, .notification-history-row { flex-direction: column; gap: .4rem; }
  .subscription-row { align-items: flex-start; flex-direction: column; }
  .subscription-actions { justify-content: flex-start; }
  .goal-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .report-date-form .filter-actions { width: 100%; }
  .report-date-form .filter-actions .button { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .spending-legend-item, .top-category-button { transition: none; }
}

/* Cash flow forecast */
.forecast-assumptions { margin-bottom: 1.5rem; }
.forecast-assumptions-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 1.25rem;
  align-items: end;
}
.forecast-assumptions-form .filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.forecast-assumptions-form .filter-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}
.forecast-assumptions-form .filter-actions-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.forecast-assumptions-form .filter-actions {
  display: flex;
  align-items: center;
}
.forecast-assumptions-form .filter-input,
.forecast-assumptions-form .filter-actions .button {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.35rem;
  font-size: 0.9rem;
}
@media (max-width: 900px) {
  .forecast-assumptions-form {
    grid-template-columns: 1fr;
  }
}
.forecast-metrics { margin-bottom: 1.5rem; }
.forecast-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 1.5rem; margin-bottom: 1.5rem; }
.forecast-chart-container { position: relative; height: 320px; margin-top: 1.25rem; }
.forecast-assumption-list { display: grid; gap: .85rem; margin-top: 1.2rem; }
.forecast-assumption-list div { padding: .85rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-input); }
.forecast-assumption-list dt { font-weight: 700; }
.forecast-assumption-list dd { margin: .2rem 0 0; color: var(--text-muted); font-size: .86rem; }
.forecast-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.forecast-table th, .forecast-table td { padding: .8rem .9rem; border-bottom: 1px solid var(--border-subtle); text-align: right; white-space: nowrap; }
.forecast-table th:first-child, .forecast-table td:first-child { text-align: left; }
.forecast-table thead th { color: var(--text-muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 800px) {
  .forecast-grid { grid-template-columns: 1fr; }
  .forecast-chart-container { height: 270px; }
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--primary-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--surface-card);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  font-weight: 600;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   3. APP SHELL & SIDEBAR NAVIGATION
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  flex: 0 0 270px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}

.brand-wrapper {
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
  flex-shrink: 0;
  position: relative;
}

.sidebar-module-selector {
  position: relative;
  width: 100%;
}

.active-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}
.active-module-header:hover {
  border-color: var(--border-card);
  background: rgba(15, 23, 42, 0.65);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #38BDF8, #10B981);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
  flex-shrink: 0;
}
.brand-icon--pdf_tools {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.brand-icon--settings {
  background: linear-gradient(135deg, #475569, #334155);
  box-shadow: 0 4px 14px rgba(71, 85, 105, 0.3);
}

.icon-brand {
  width: 20px;
  height: 20px;
  color: #FFFFFF;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-switch-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.module-switch-trigger:hover, .module-switch-trigger.is-active {
  color: var(--text-main);
  background: var(--surface-hover);
  border-color: var(--border-focus);
}
.module-switch-trigger .icon-chevron {
  transition: transform 0.2s ease;
}
.module-switch-trigger.is-active .icon-chevron {
  transform: rotate(180deg);
}

/* Module Switcher Dropdown */
.module-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--surface-card), #000 20%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 0.45rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 200;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  animation: dropdownFadeIn 0.18s ease-out;
}
.module-dropdown-menu[hidden] {
  display: none !important;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.module-dropdown-title {
  font-size: 0.62rem;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem 0.15rem;
  margin: 0;
}

.module-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.18s ease;
  position: relative;
  border: 1px solid transparent;
}
.module-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.08);
}
.module-dropdown-item.is-active {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-main);
}

.module-dropdown-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.module-dropdown-icon svg {
  width: 15px;
  height: 15px;
}
.module-dropdown-icon.icon-finance {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}
.module-dropdown-icon.icon-pdf {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}
.module-dropdown-icon.icon-hub {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.module-dropdown-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.module-dropdown-info strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.module-dropdown-info span {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
  flex-shrink: 0;
}

.module-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.2rem 0;
}

.sidebar-section--common {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 0.75rem 0.35rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  color: var(--sidebar-link);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link:hover {
  color: var(--sidebar-link-hover);
  background-color: var(--sidebar-link-bg-hover);
}

.sidebar-link:hover .nav-icon {
  opacity: 1;
  transform: translateX(2px);
}

.sidebar-link.is-active {
  color: var(--sidebar-link-active);
  background-color: var(--sidebar-link-bg-active);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.sidebar-link.is-active .nav-icon {
  color: var(--primary);
  opacity: 1;
}

.nav-active-pill {
  width: 3.5px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--primary);
  position: absolute;
  left: 0;
  box-shadow: 0 0 10px var(--primary);
}

.nav-unread-badge {
  min-width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0 0.35rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--negative);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

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

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-footer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  align-items: center;
}

.sidebar-lang-col {
  min-width: 0;
}

.sidebar-theme-col {
  min-width: 0;
}

.theme-form {
  margin: 0;
}

.theme-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0 0.25rem 0 0.45rem;
  height: 32px;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.theme-select-wrapper:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

.theme-select-icon {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  pointer-events: none;
}

.theme-select {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 700;
  padding-left: 0.2rem;
  padding-right: 0.1rem;
  cursor: pointer;
  outline: none;
  appearance: auto;
}

.theme-select option {
  background: #0B1120;
  color: #F8FAFC;
}

.language-switcher {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 2px;
  width: 100%;
  gap: 2px;
  height: 32px;
  box-sizing: border-box;
}

.lang-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.4rem;
  height: 100%;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn.is-active {
  color: #FFFFFF;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

.lang-flag {
  font-size: 0.85rem;
  line-height: 1;
}

.lang-code {
  letter-spacing: 0.05em;
}

.workspace-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 8px #10B981;
  flex-shrink: 0;
}

.workspace-details {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1;
  line-height: 1;
}

.workspace-title {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  color: #94A3B8;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.workspace-currency {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  line-height: 1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.sidebar-logout-form {
  width: 100%;
  margin: 0;
}

.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #F43F5E;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.sidebar-logout-btn:hover {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.4);
  color: #FB7185;
}

.sidebar-logout-icon {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   4. MAIN CONTENT & PAGE LAYOUT
   ========================================================================== */
.page-frame {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-content {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 3.5vw, 3rem);
}

.app-shell-no-sidebar .page-content {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.workspace-hub-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-mesh);
  padding: clamp(1rem, 2.5vw, 2rem);
}

.workspace-hub-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-xl);
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.workspace-hub-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.workspace-hub-theme .theme-select {
  padding: 0.45rem 1.75rem 0.45rem 2rem;
  font-size: 0.8rem;
  height: 36px;
}

.hub-user-pill {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.85rem;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  box-sizing: border-box;
}

.hub-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(244, 63, 94, 0.08);
  color: #fda4af;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hub-logout-btn:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fff;
}

.hub-logout-icon {
  width: 15px;
  height: 15px;
}

.module-launcher-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0 3rem;
}

.module-launcher {
  width: min(1140px, 100%);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-card);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: clamp(1.75rem, 3vw, 3rem);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.module-launcher-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.module-launcher-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.module-launcher-header h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  letter-spacing: -0.04em;
  font-weight: 800;
  line-height: 1.05;
  margin: 0;
  color: var(--text-main);
}

.module-launcher-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 42rem;
  line-height: 1.6;
  margin: 0;
}

.module-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.module-launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .module-launcher-grid {
    grid-template-columns: 1fr;
  }

  .workspace-hub-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-hub-controls {
    justify-content: flex-end;
  }
}

.module-launcher-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  padding: 1.85rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(17, 26, 47, 0.85), rgba(9, 14, 26, 0.95));
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}

.module-launcher-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 45%), radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.12), transparent 45%);
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0.7;
}

.module-launcher-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.12);
}

.module-launcher-card:hover::before {
  opacity: 1;
}

.module-launcher-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.module-launcher-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--primary);
  transition: transform 0.2s ease;
}

.module-launcher-card:hover .module-launcher-icon {
  transform: scale(1.05);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.module-launcher-icon svg {
  width: 26px;
  height: 26px;
}

.module-launcher-card h2 {
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
  color: var(--text-main);
}

.module-launcher-card p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
}

.module-launcher-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.module-launcher-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.module-launcher-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.module-launcher-card:hover .module-launcher-arrow {
  background: var(--primary);
  color: #070A12;
  border-color: var(--primary);
  transform: translateX(4px);
}

.module-launcher-arrow svg {
  width: 18px;
  height: 18px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.page-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.page-header h1 {
  font-size: clamp(1.85rem, 3.2vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-main);
  line-height: 1.15;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ==========================================================================
   5. BUTTONS & ACTIONS
   ========================================================================== */
.button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.button:hover, .btn:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  border-color: rgba(255, 255, 255, 0.15);
}

.button-primary:hover {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  color: #FFFFFF;
}

.button-secondary {
  background: var(--surface-elevated);
  color: var(--text-main);
  border-color: var(--border-card);
}

.button-secondary:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-hover);
  color: var(--text-main);
}

.button-danger {
  background: var(--negative-bg);
  color: var(--negative);
  border-color: rgba(244, 63, 94, 0.2);
}

.button-danger:hover {
  background: var(--negative);
  color: #FFFFFF;
}

.button-sm {
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.text-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.text-link:hover {
  color: #60A5FA;
  text-decoration: none;
  transform: translateX(2px);
}

/* ==========================================================================
   6. METRIC CARDS & STATS (Kinetic 3D & Glassmorphism)
   ========================================================================== */
.finance-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kinetic-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform;
}

.metric-card {
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform-style: preserve-3d;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle 220px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.metric-card:hover .card-sheen,
.panel:hover .card-sheen,
.kinetic-card:hover .card-sheen {
  opacity: 1;
}

.metric-card:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
}

.metric-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-card p, .metric-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-badge-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-badge-icon svg {
  width: 18px;
  height: 18px;
}

.icon-income-badge {
  background: var(--positive-bg);
  color: var(--positive);
  box-shadow: 0 0 12px var(--accent-glow);
}

.icon-expense-badge {
  background: var(--negative-bg);
  color: var(--negative);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.2);
}

.icon-cashflow-badge {
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.icon-budget-badge {
  background: var(--warning-bg);
  color: var(--warning);
  box-shadow: 0 0 12px var(--warning-bg);
}

.metric-card strong, .metric-value {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-family: var(--font-mono);
  line-height: 1.1;
}

.value-positive {
  color: var(--positive) !important;
}

.value-negative {
  color: var(--negative) !important;
}

.metric-note {
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Card top glow accents */
.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transition: background 0.3s ease;
  z-index: 3;
}

.metric-card:hover::before {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ==========================================================================
   7. PANELS & DASHBOARD GRIDS
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

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

.panel {
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.panel-header p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* PDF tools stay a Dashboard-native landing page; Stirling itself is isolated behind /pdf-editor. */
.pdf-tools-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pdf-tools-hero h2,
.pdf-tool-card h2 {
  color: var(--text-main);
  font-size: 1.1rem;
  margin: 0.4rem 0;
}

.pdf-tools-hero p,
.pdf-tool-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pdf-tools-status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
}

.pdf-tools-status.is-ready { background: var(--positive-bg); color: var(--positive); }
.pdf-tools-status.is-waiting { background: var(--warning-bg); color: var(--warning); }

.pdf-tools-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.pdf-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pdf-tool-card .text-link { margin-top: auto; padding-top: 0.5rem; }

@media (max-width: 1024px) {
  .pdf-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .pdf-tools-hero { align-items: flex-start; flex-direction: column; }
  .pdf-tools-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   8. ENHANCED BAR CHART & VISUALIZATIONS
   ========================================================================== */
.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(36px, 1fr));
  align-items: end;
  min-height: 220px;
  gap: 0.85rem;
  padding: 1rem 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  height: 170px;
  width: 100%;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 0 4px;
}

.bar {
  width: min(16px, 45%);
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.2s ease, opacity 0.2s ease;
  position: relative;
}

.bar:hover {
  opacity: 0.85;
  transform: scaleY(1.02);
}

.income-bar {
  background: linear-gradient(180deg, #34D399, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.expense-bar {
  background: linear-gradient(180deg, #60A5FA, #2563EB);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.bar-group > span {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend-income {
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}

.legend-expense {
  background: #3B82F6;
  box-shadow: 0 0 6px #3B82F6;
}

/* Visually hidden but available to assistive technology */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chart-figure {
  margin: 0;
}

.chart-container {
  position: relative;
  width: 100%;
  height: clamp(260px, 38vh, 360px);
}

.chart-caption {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.cat-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cat-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cat-bar-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.cat-bar-values {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cat-bar-values strong {
  color: var(--text-main);
  font-weight: 700;
}

.cat-bar-planned {
  margin-left: 0.2rem;
}

.progress-fill {
  width: 0%;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease;
}

.progress-fill.is-over {
  background: linear-gradient(90deg, #F43F5E, #E11D48);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill {
    transition: none;
  }
}

/* ==========================================================================
   9. BUDGET GAUGES & PROGRESS BARS
   ========================================================================== */
.budget-panel {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.budget-select-wrapper {
  margin-top: 0.25rem;
}

.custom-budget-select-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.dropdown-category-dot {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  transition: background-color 0.25s ease;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.budget-category-dropdown {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 2.25rem 0.6rem 2.25rem;
  background-color: rgba(255, 255, 255, 0.03);
  background-image: none !important;
  background-repeat: no-repeat !important;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.budget-category-dropdown:hover {
  background-color: rgba(255, 255, 255, 0.06);
  background-image: none !important;
  border-color: var(--border-hover);
}

.budget-category-dropdown:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background-color: var(--surface-card);
  background-image: none !important;
}

.budget-category-dropdown option,
.budget-category-dropdown optgroup {
  background-color: #0F172A;
  color: #F8FAFC;
  padding: 0.6rem 0.75rem;
}

.dropdown-chevron-icon {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
  transition: color 0.2s ease;
}

.custom-budget-select-container:hover .dropdown-chevron-icon {
  color: var(--primary);
}

.budget-active-display {
  padding: 1.15rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.25s ease;
}

.budget-active-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.budget-title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.budget-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.budget-percent-pill {
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.budget-percent-pill.is-over {
  background: rgba(244, 63, 94, 0.12);
  color: #F43F5E;
  border-color: rgba(244, 63, 94, 0.25);
}

.budget-panel .budget-value {
  margin: 0.2rem 0 0.1rem;
}

.budget-value strong {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.budget-value span {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-track {
  height: 10px;
  background: var(--surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10B981, #059669);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.progress-fill.is-over {
  background: linear-gradient(90deg, #F43F5E, #E11D48);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.progress-fill.is-warning {
  background: linear-gradient(90deg, #FBBF24, #D97706);
}

.budget-footer-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.budget-note-text {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.budget-note-text strong {
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* Category Quick Chips / Breakdown */
.budget-categories-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

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

.breakdown-header h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0;
}

.category-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.budget-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.budget-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.budget-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

.budget-chip.is-active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: #60A5FA;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.budget-chip.is-over {
  border-color: rgba(244, 63, 94, 0.3);
}

.budget-chip.is-over.is-active {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.5);
  color: #FB7185;
}

.chip-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-percent {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.budget-chip.is-active .chip-percent {
  color: currentColor;
  font-weight: 700;
}

/* Budget Form Hierarchical Styles */
.budget-allocation-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.budget-category-input-group {
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.18s ease;
}

.budget-category-input-group:focus-within {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-hover);
}

.budget-category-input-group.is-subcategory {
  margin-left: 1.5rem;
  border-left: 3px solid var(--color-primary);
  background: rgba(255, 255, 255, 0.015);
}

.budget-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.budget-cat-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.budget-cat-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
}

.badge-parent-category {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-sub-category {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(148, 163, 184, 0.1);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.budget-spent-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.budget-limit-input {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ==========================================================================
   10. DATA LISTS & TABLES
   ========================================================================== */
.finance-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.finance-list article, .finance-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.18s ease;
}

.finance-list article:hover, .finance-item-row:hover {
  background: var(--surface-elevated);
  border-color: var(--border-hover);
  transform: translateX(2px);
}

.transaction-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.transaction-type-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.transaction-type-icon.income {
  background: var(--positive-bg);
  color: var(--positive);
}

.transaction-type-icon.expense {
  background: var(--negative-bg);
  color: var(--negative);
}

.transaction-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.transaction-category {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-submeta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-pill-subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-status-comfortable {
  background: var(--positive-bg);
  color: var(--positive);
}

.badge-status-plan {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-status-defer {
  background: var(--negative-bg);
  color: var(--negative);
}

.transaction-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.transaction-amount {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.transaction-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}

.action-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-card);
}

.action-btn.delete:hover {
  color: var(--negative);
  background: var(--negative-bg);
  border-color: rgba(244, 63, 94, 0.2);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   11. ACCOUNT & GOAL CARDS GRID
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card-item {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
}

.card-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-item-balance {
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ==========================================================================
   12. FORMS & INPUTS
   ========================================================================== */
.form-panel {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.form-group label, .form-panel label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

input:not([type="color"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea,
.form-panel input:not([type="color"]):not([type="submit"]):not([type="checkbox"]),
.form-panel select,
.form-panel textarea,
.custom-select,
.rate-input {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.92rem;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus,
.custom-select:focus,
.rate-input:focus {
  border-color: var(--primary);
  background: var(--surface-card);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

select:not(.theme-select):not(.budget-category-dropdown),
.form-panel select,
.filter-field select,
.filter-input[type="select"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-size: 16px 16px !important;
  padding-right: 2.5rem !important;
  cursor: pointer;
}

select:not(.theme-select):not(.budget-category-dropdown):hover,
.form-panel select:hover,
.filter-field select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2338BDF8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  border-color: var(--border-hover);
}

select option,
select optgroup {
  background-color: #0F172A;
  color: #F8FAFC;
  padding: 0.5rem;
}

.form-panel input[type="color"] {
  width: 100%;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  cursor: pointer;
}

/* ==========================================================================
   EXCHANGE RATES (Döviz Kurları)
   ========================================================================== */
.exchange-rates-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.currency-selectors-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-end;
  gap: 0.75rem;
}

.currency-select-group {
  margin-bottom: 0;
}

.currency-swap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  color: var(--primary);
  opacity: 0.85;
}

.currency-swap-icon svg {
  width: 20px;
  height: 20px;
}

.rate-input {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.currency-pairs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.currency-pair-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.currency-pair-card:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.currency-pair-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.currency-pair-flags {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.currency-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.base-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38BDF8;
}

.currency-arrow {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.quote-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10B981;
}

.currency-pair-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.currency-rate-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.currency-rate-value {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.currency-rate-value strong {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.currency-rate-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.currency-rate-calc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.currency-empty-state {
  padding: 3rem 1.5rem;
}

.currency-empty-state .empty-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  color: var(--primary);
}

.currency-empty-state .empty-state-icon svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 900px) {
  .exchange-rates-grid {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-errors {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--negative-bg);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #FDA4AF;
}

.form-errors h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #FFE4E6;
}

.form-errors ul {
  padding-left: 1.25rem;
  font-size: 0.88rem;
}

.currency-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-card);
}

.currency-form select {
  min-height: 38px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.currency-form .button {
  min-height: 38px;
  padding: 0.4rem 0.85rem;
}

/* ==========================================================================
   13. FLASH NOTIFICATIONS & EMPTY STATES
   ========================================================================== */
.flash-stack {
  width: min(1380px, calc(100% - 3rem));
  margin: 1.5rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flash {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.flash-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.flash-notice {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.flash-alert {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #FDA4AF;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  padding: 2.5rem 1.5rem;
  gap: 0.75rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 380px;
}

/* ==========================================================================
   14. YEARLY BUDGET OVERVIEW
   ========================================================================== */
.yearly-table-panel,
.yearly-chart-panel,
.yearly-category-panel {
  max-width: 100%;
}

.yearly-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.yearly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  white-space: nowrap;
}

.yearly-table th,
.yearly-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.yearly-table th {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
}

.yearly-table td.num-col,
.yearly-table th.num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.yearly-table tbody tr:hover {
  background: var(--surface-elevated);
}

.yearly-table tbody tr.no-budget {
  opacity: 0.65;
}

.yearly-table tbody tr.no-budget:hover {
  opacity: 1;
}

.month-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month-name {
  font-weight: 700;
  color: var(--text-main);
}

.yearly-total-row {
  background: rgba(255, 255, 255, 0.03);
  border-top: 2px solid var(--border-card);
}

.yearly-total-row td {
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: none;
}

.bar-chart-yearly {
  grid-template-columns: repeat(12, minmax(28px, 1fr));
}

@media (max-width: 860px) {
  .bar-chart-yearly {
    grid-template-columns: repeat(6, minmax(36px, 1fr));
  }
}

@media (max-width: 600px) {
  .bar-chart-yearly {
    grid-template-columns: repeat(4, minmax(36px, 1fr));
    gap: 0.4rem;
  }

  .yearly-table {
    font-size: 0.8rem;
  }

  .yearly-table th,
  .yearly-table td {
    padding: 0.55rem 0.65rem;
  }
}

.yearly-category-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.yearly-category-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.yearly-category-row:hover {
  background: var(--surface-elevated);
  border-color: var(--border-hover);
}

.yearly-cat-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.yearly-cat-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yearly-cat-values {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.yearly-cat-spent {
  font-weight: 700;
  color: var(--text-main);
}

.yearly-cat-separator {
  color: var(--text-muted);
}

.yearly-cat-planned {
  color: var(--text-muted);
}

.yearly-cat-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 120px;
}

.yearly-cat-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.yearly-cat-bar-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  opacity: 0.8;
}

.yearly-cat-bar-fill.is-over {
  opacity: 1;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

.yearly-cat-percent {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

.yearly-cat-percent.is-over {
  color: var(--negative);
}

@media (max-width: 700px) {
  .yearly-category-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .yearly-cat-bar-wrapper {
    min-width: 0;
  }
}

/* ==========================================================================
   15. TRANSACTION FILTERS
   ========================================================================== */
.transaction-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-field > label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-input {
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.88rem;
  transition: all 0.18s ease;
}

.filter-input:focus {
  border-color: var(--primary);
  background: var(--surface-card);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

.filter-search {
  flex: 1 1 220px;
}

.filter-search .filter-input {
  width: 100%;
}

.filter-multiselect {
  position: relative;
  min-width: 150px;
}

.filter-multiselect-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: 44px;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  list-style: none;
  box-sizing: border-box;
  transition: all 0.18s ease;
}

.filter-multiselect-summary::-webkit-details-marker {
  display: none;
}

.filter-multiselect-summary::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.filter-multiselect[open] .filter-multiselect-summary {
  border-color: var(--primary);
  background: var(--surface-card);
}

.filter-multiselect[open] .filter-multiselect-summary::after {
  transform: rotate(180deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2338BDF8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.3rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

.filter-multiselect-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 0.4rem);
  right: 0;
  left: auto;
  min-width: 220px;
  max-width: min(300px, 90vw);
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem;
  background: #0B1120;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7), 0 6px 12px -2px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease;
}

.filter-checkbox:hover {
  background: var(--surface-elevated);
}

.filter-checkbox input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (max-width: 600px) {
  .transaction-filters {
    padding: 0.85rem 1rem;
    gap: 0.6rem;
  }

  .filter-field,
  .filter-search {
    flex: 1 1 100%;
  }

  .filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .filter-actions .button {
    flex: 1;
  }
}

/* ==========================================================================
   16. PURCHASE PLAN SCENARIO COMPARISON
   ========================================================================== */
.card-item-link {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card-item-link:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.scenario-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.scenario-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.scenario-card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.scenario-card.status-comfortable {
  border-left-color: var(--positive);
}

.scenario-card.status-plan {
  border-left-color: #F59E0B;
}

.scenario-card.status-defer {
  border-left-color: var(--negative);
}

.scenario-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.scenario-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.scenario-figure {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.scenario-figure-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scenario-monthly {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.scenario-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.scenario-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.scenario-row strong {
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.scenario-goal-note {
  font-size: 0.75rem;
  font-weight: 600;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  text-align: center;
}

.assumptions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.assumption-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.assumption-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.assumption-item strong {
  font-size: 1.05rem;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.convert-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: end;
}

.convert-form .form-actions {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .convert-form {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   17. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .finance-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid, .lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1rem;
    flex: auto;
  }
  .brand-wrapper {
    margin-bottom: 1rem;
  }
  .sidebar-section {
    width: 100%;
  }
  .sidebar-label {
    display: none;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  .sidebar-link {
    flex-shrink: 0;
    padding: 0.55rem 0.85rem;
  }
  .sidebar-footer {
    display: none;
  }
}

@media (max-width: 600px) {
  .finance-cards {
    grid-template-columns: 1fr;
  }
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header .button {
    width: 100%;
  }
  .transaction-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
  }
  .bar-chart {
    gap: 0.4rem;
  }
  .page-content {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================\n+   17. MOBILE QUICK-ADD SHEET\n+   ========================================================================== */
.quick-add-trigger {
  position: fixed;
  z-index: 70;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.45);
  font: 700 0.88rem var(--font-family);
  cursor: pointer;
  transition: box-shadow 0.18s ease, opacity 0.18s ease;
}

.quick-add-trigger:active { opacity: 0.86; }
.quick-add-trigger-icon { width: 20px; height: 20px; }
.quick-add-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(2, 6, 23, 0.7); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.18s ease; }
.quick-add-sheet { position: fixed; z-index: 81; right: 0; bottom: 0; left: 0; max-height: min(88dvh, 720px); overflow-y: auto; padding: 0.5rem max(1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); background: var(--surface-card); border: 1px solid var(--border-card); border-radius: 24px 24px 0 0; box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.32); transform: translateY(105%); transition: transform 0.2s ease; }
.quick-add.is-open .quick-add-backdrop { opacity: 1; }
.quick-add.is-open .quick-add-sheet { transform: translateY(0); }
.quick-add-open { overflow: hidden; }
.quick-add-handle { width: 40px; height: 4px; margin: 0 auto 0.8rem; border-radius: 999px; background: var(--border-hover); }
.quick-add-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.quick-add-heading .eyebrow { margin-bottom: 0.15rem; }
.quick-add-heading h2 { font-size: 1.35rem; letter-spacing: -0.03em; }
.quick-add-close { display: inline-grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--border-card); border-radius: 50%; background: var(--surface-elevated); color: var(--text-main); font-size: 1.6rem; line-height: 1; cursor: pointer; transition: background 0.18s ease; }
.quick-add-close:active { background: var(--surface-card-hover); }
.quick-add-form { display: grid; gap: 1.15rem; }
.quick-add-type { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.25rem; border-radius: var(--radius-md); background: var(--surface-elevated); }
.quick-add-type-button { min-height: 44px; padding: 0.5rem; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font: 700 0.82rem var(--font-family); cursor: pointer; transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease; }
.quick-add-type-button.is-selected { background: var(--surface-card); color: var(--text-main); box-shadow: var(--shadow-sm); }
.quick-add-amount-field > label, .quick-add-section-label label { display: block; margin-bottom: 0.45rem; font-size: 0.78rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.quick-add-amount-input { display: flex; align-items: center; gap: 0.5rem; padding: 0.1rem 0.9rem; border: 1px solid var(--border-card); border-radius: var(--radius-lg); background: var(--surface-input); }
.quick-add-amount-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.quick-add-amount-input input { width: 100%; min-height: 58px; border: 0; outline: 0; background: transparent; color: var(--text-main); font: 800 1.7rem var(--font-family); letter-spacing: -0.04em; }
.quick-add-amount-input span { color: var(--text-muted); font-weight: 700; }
.quick-add-section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.quick-add-section-label span { color: var(--text-subtle); font-size: 0.76rem; }
.quick-add-category-viewport { overflow-x: auto; margin: 0 -1rem; padding: 0 1rem 0.4rem; scrollbar-width: none; }
.quick-add-category-viewport::-webkit-scrollbar { display: none; }
.quick-add-categories { display: flex; gap: 0.6rem; width: max-content; }
.quick-add-category { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 46px; padding: 0.6rem 0.8rem; border: 1px solid var(--border-card); border-radius: var(--radius-full); background: var(--surface-input); color: var(--text-main); font: 700 0.82rem var(--font-family); cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; white-space: nowrap; }
.quick-add-category.is-selected { border-color: var(--primary); background: var(--primary-glow); box-shadow: 0 0 0 1px var(--primary); }
.quick-add-category-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.quick-add-details { border-top: 1px solid var(--border-subtle); padding-top: 1rem; }
.quick-add-details summary { min-height: 44px; display: flex; align-items: center; color: var(--primary); font-size: 0.88rem; font-weight: 700; cursor: pointer; }
.quick-add-optional-fields { display: grid; gap: 0.8rem; margin-top: 0.6rem; }
.quick-add-optional-fields .form-group { display: grid; gap: 0.35rem; }
.quick-add-optional-fields label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
.quick-add-optional-fields input, .quick-add-optional-fields select { width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; border: 1px solid var(--border-card); border-radius: var(--radius-sm); background: var(--surface-input); color: var(--text-main); font: 0.9rem var(--font-family); }
.quick-add-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 0.6rem; }
.quick-add-actions .button { min-height: 48px; }

@media (min-width: 861px) { .quick-add-sheet { right: 1.5rem; bottom: 1.5rem; left: auto; width: min(460px, calc(100vw - 3rem)); border-radius: var(--radius-xl); transform: translateY(1rem); opacity: 0; pointer-events: none; } .quick-add.is-open .quick-add-sheet { transform: translateY(0); opacity: 1; pointer-events: auto; } }

/* ==========================================================================
   ONBOARDING WIZARD
   ========================================================================== */
.onboarding-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.onboarding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.onboarding-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.04em;
  margin: 0.25rem 0 0.5rem;
}

.onboarding-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.5;
}

.onboarding-stepper {
  margin-bottom: 2rem;
  position: relative;
}

.stepper-track {
  height: 4px;
  background: var(--surface-elevated);
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  overflow: hidden;
}

.stepper-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
  border-radius: var(--radius-full);
}

.stepper-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.stepper-steps::-webkit-scrollbar {
  display: none;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  color: var(--text-subtle);
  font: 600 0.84rem var(--font-family);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.stepper-step:hover {
  color: var(--text-muted);
  background: var(--surface-card-hover);
}

.stepper-step.is-active {
  color: var(--primary);
  font-weight: 700;
}

.stepper-step.is-completed {
  color: var(--accent);
}

.step-badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.stepper-step.is-active .step-badge {
  background: var(--primary);
  color: #FFFFFF;
}

.stepper-step.is-completed .step-badge {
  background: var(--accent);
  color: #FFFFFF;
}

.onboarding-card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.wizard-step {
  display: none;
  padding: 2.25rem 2rem;
  animation: fadeIn 0.25s ease-out;
}

.wizard-step.is-active {
  display: block;
}

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

.step-heading {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.step-icon-bubble {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.step-heading h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.step-heading p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.wizard-step-body {
  margin-bottom: 2.25rem;
}

.currency-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.currency-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.currency-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-card-hover);
}

.currency-card.is-selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 1px var(--primary);
}

.currency-radio {
  display: none;
}

.currency-code {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.currency-symbol {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

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

.input-with-adornment .form-control {
  padding-right: 3.5rem;
}

.input-adornment {
  position: absolute;
  right: 0.85rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.form-control-lg {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  padding: 0.75rem 1rem !important;
  min-height: 52px;
}

/* Account rows builder */
.accounts-builder-container {
  display: grid;
  gap: 0.75rem;
}

.account-builder-row {
  display: grid;
  grid-template-columns: 1.5fr 1.2fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
  background: var(--surface-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

@media (max-width: 640px) {
  .account-builder-row {
    grid-template-columns: 1fr;
  }
}

.field-mini-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  letter-spacing: 0.05em;
}

/* Categories grid */
.step-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.category-toggle-card {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.category-toggle-card:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-hover);
}

.category-toggle-card.is-enabled {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.08);
}

.category-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  width: 100%;
}

.category-toggle-checkbox {
  accent-color: var(--primary);
}

.category-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Budget summary & allocation */
.budget-live-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.summary-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-metric-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.summary-metric-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.budget-limit-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.budget-allocation-card {
  padding: 0.85rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface-input);
}

.allocation-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.allocation-category-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Goal card preview */
.goal-estimated-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  color: var(--positive);
  font-weight: 700;
  font-size: 0.92rem;
}

.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.wizard-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Recurring transactions */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin: 0.25rem 0 1.25rem;
  flex-wrap: wrap;
}

.page-toolbar .button {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: var(--surface-card);
  transition: all 0.18s ease;
}

.page-toolbar .button:hover {
  background: var(--surface-elevated);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.recurrence-fields {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.recurrence-fields legend {
  padding: 0 0.35rem;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
}

.recurrence-toggle, .recurrence-callout {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
}

.recurrence-toggle { cursor: pointer; }
.recurrence-toggle input { accent-color: var(--primary); }
.field-hint { margin: 0.5rem 0 0.85rem; color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; }

.recurrence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.recurrence-grid .form-group { margin-bottom: 0; }
.recurrence-callout { margin: 1.25rem 0; padding: 0.85rem 1rem; border-radius: var(--radius-md); background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.25); }
.recurrence-callout .text-link { margin-left: auto; white-space: nowrap; }

.recurring-badge, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.45rem;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.recurring-badge { color: #bfdbfe; background: rgba(59, 130, 246, 0.18); }
.icon-xs { width: 0.75rem; height: 0.75rem; }
.status-badge.is-active { color: #a7f3d0; background: rgba(16, 185, 129, 0.14); }
.status-badge.is-paused { color: #fde68a; background: rgba(245, 158, 11, 0.14); }
.status-badge.is-stopped { color: #fecaca; background: rgba(220, 38, 38, 0.16); }
.budget-attention { display:flex; gap:.6rem; align-items:center; padding:.8rem 1rem; margin:0 0 1rem; border:1px solid rgba(245,158,11,.5); border-radius:var(--radius-md); background:rgba(245,158,11,.12); color:#fde68a; }
.budget-chip.is-warning { border-color:#f59e0b; }
.budget-alert-label { font-size:.65rem; font-weight:700; color:#fde68a; }
.progress-fill.is-warning { background:#f59e0b; }

.recurring-rules-list { padding: 0; overflow: hidden; }
.recurring-rule-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1.5rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.recurring-rule-row:last-child { border-bottom: 0; }
.recurring-rule-title { color: var(--text-main); font-weight: 700; }
.recurring-rule-row p, .recurring-rule-row small { display: block; margin: 0.32rem 0 0; color: var(--text-muted); font-size: 0.82rem; }
.recurring-rule-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; white-space: nowrap; }
.recurring-rule-summary span { color: var(--text-muted); font-size: 0.75rem; }
.recurring-rule-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 760px) {
  .recurrence-grid, .recurring-rule-row { grid-template-columns: 1fr; }
  .recurring-rule-summary, .recurring-rule-actions { align-items: flex-start; justify-content: flex-start; }
  .recurring-badge { margin: 0.25rem 0 0; }
  .recurrence-callout { align-items: flex-start; flex-wrap: wrap; }
  .recurrence-callout .text-link { margin-left: 0; }
}

/* ==========================================================================
   10. AUTHENTICATION & LOGIN GATE (Obsidian Luxe Vault)
   ========================================================================== */
.auth-body {
  min-height: 100vh;
  background-color: var(--bg-app);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
}

.auth-shell {
  width: 100%;
  max-width: 460px;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.auth-flash-stack {
  width: 100%;
  margin-bottom: 0.5rem;
}

.auth-card {
  width: 100%;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px rgba(56, 189, 248, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38BDF8, #10B981, transparent);
}

.auth-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.auth-brand-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.auth-icon-pulse {
  position: relative;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.auth-title-block h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.auth-title-block p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-field-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

input.auth-input,
.auth-input {
  width: 100% !important;
  min-height: 46px !important;
  padding: 0.85rem 1.1rem !important;
  background: rgba(11, 17, 32, 0.85) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-main) !important;
  font-size: 0.95rem !important;
  font-family: var(--font-sans) !important;
  letter-spacing: normal !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.auth-input-wrapper input.auth-input,
.auth-input-wrapper .auth-input {
  padding-left: 3rem !important;
  padding-right: 2.85rem !important;
}

input[type="password"].auth-input,
.auth-password-input {
  font-family: var(--font-mono) !important;
  letter-spacing: 0.08em !important;
}

.auth-input-plain,
input.auth-input-plain {
  padding: 0.85rem 1.1rem !important;
  font-family: var(--font-sans) !important;
  letter-spacing: normal !important;
}

.auth-password-toggle {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0.35rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
  z-index: 3;
}

.auth-password-toggle:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  color: var(--primary);
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
}
.mfa-code-input {
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: .35em;
  padding: 0.85rem 1rem !important;
}
.mfa-secret { padding: 1rem; border: 1px solid var(--border-card); border-radius: var(--radius-md); background: rgba(11, 17, 32, .65); display: grid; gap: .45rem; text-align: center; color: var(--text-muted); }
.mfa-secret code { color: var(--primary); font-size: 1rem; font-family: var(--font-mono); overflow-wrap: anywhere; }
.mfa-secret small, .auth-field-group small { color: var(--text-muted); }

.access-settings-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1.5rem; }
.ai-settings-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1.5rem; }
.ai-connection-panel { align-self: start; }
.ai-connection-panel code { color: var(--primary); font-family: var(--font-mono); font-size: .8rem; overflow-wrap: anywhere; }
.ai-status-note { color: var(--text-muted); font-size: .86rem; line-height: 1.55; margin: 1rem 0 0; }
.ai-health-link { margin-top: 1.25rem; }
.profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.security-panel { align-self: start; }
.security-status { display: inline-flex; padding: .35rem .65rem; border-radius: var(--radius-full); color: #fecaca; background: rgba(239, 68, 68, .12); font-weight: 700; font-size: .8rem; }
.security-status.is-enabled { color: #a7f3d0; background: rgba(16, 185, 129, .14); }
.access-user-list { display: grid; }
.access-user-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--border-subtle); }
.access-user-row:last-child { border-bottom: 0; }
.access-user-row h2 { margin: 0; font-size: 1rem; }.access-user-row p { margin: .3rem 0 0; color: var(--text-muted); font-size: .85rem; }.access-user-actions { display: flex; align-items: center; gap: .65rem; }
@media (max-width: 760px) { .access-settings-grid, .ai-settings-grid, .profile-form-grid { grid-template-columns: 1fr; } .access-user-row { align-items: flex-start; flex-direction: column; }.access-user-actions { width: 100%; justify-content: space-between; } }
input.auth-input:focus,
.auth-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 0 16px var(--primary-glow) !important;
  background: rgba(15, 23, 42, 0.95) !important;
}

.auth-input:focus + .auth-input-icon,
.auth-input-wrapper:focus-within .auth-input-icon {
  color: var(--primary);
}

.auth-actions {
  margin-top: 0.5rem;
}

.auth-submit-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  justify-content: center;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
  cursor: pointer;
}

.auth-dev-hint {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}

.auth-dev-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: center;
}

.auth-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  background: rgba(11, 17, 32, 0.6);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

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

.auth-footer {
  margin-top: 0.75rem;
  text-align: center;
}

.auth-footer-link {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease;
}

.auth-footer-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Shared file selection control: native input remains keyboard accessible. */
input[type="file"]::file-selector-button {
  border: 1px solid var(--border-hover); border-radius: 8px; padding: 10px 16px;
  margin-right: 16px; background: var(--surface-elevated); color: var(--text-main); cursor: pointer;
}
.file-picker { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 64px; padding: 12px; border: 1px dashed var(--border-hover); border-radius: 12px; background: var(--surface-input); min-width: 0; }
.file-picker input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.file-picker-button { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 8px; background: var(--surface-elevated); color: var(--text-main); border: 1px solid var(--border-hover); font-weight: 600; }
.file-picker-status { flex: 1; min-width: 120px; color: var(--text-muted); overflow-wrap: anywhere; }
.file-picker:focus-within { outline: 2px solid var(--text-main); outline-offset: 3px; }
.file-picker:hover, .file-picker.has-file { border-style: solid; }
.file-picker:has(input:disabled) { opacity: .55; }
.file-picker input:disabled { cursor: not-allowed; }

.database-tool-card { text-decoration: none; }
.database-tool-card .icon-sm { width: 24px; height: 24px; }
.database-tool-card:focus-visible { outline: 2px solid var(--text-main); outline-offset: 4px; }

/* AI assistant: a private co-pilot for the authenticated workspace. */
.ai-assistant-page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 48px; }
.ai-assistant-header { gap: 24px; align-items: flex-end; }
.ai-assistant-header .page-subtitle { max-width: 680px; }
.ai-assistant-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border-card); cursor: pointer; }
.button-ghost:hover { color: var(--text-main); border-color: var(--border-hover); background: var(--surface-elevated); }
.button-ghost:focus-visible, .ai-assistant-prompts button:focus-visible, .ai-assistant-composer textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.ai-action-review { margin-top: 12px; }
.ai-action-review summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
.ai-action-review summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.ai-action-review pre { max-height: 320px; overflow: auto; padding: 14px; border: 1px solid var(--border-card); border-radius: 8px; background: var(--surface-input); color: var(--text-main); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.ai-assistant-layout { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.7fr); gap: 20px; align-items: start; }
.ai-assistant-context { padding: 24px; }
.ai-assistant-orb { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 18px; color: var(--primary); background: var(--primary-glow); border: 1px solid var(--border-hover); border-radius: 16px; box-shadow: var(--shadow-glow); }
.ai-assistant-orb-icon { width: 24px; height: 24px; }
.ai-assistant-context h2, .ai-assistant-chat h2 { margin: 0; font-size: 1.1rem; }
.ai-assistant-context p { margin: 10px 0 0; color: var(--text-muted); font-size: .92rem; line-height: 1.65; }
.ai-assistant-capabilities { display: grid; gap: 10px; margin: 20px 0; padding: 0; list-style: none; }
.ai-assistant-capabilities li { position: relative; padding-left: 20px; color: var(--text-main); font-size: .88rem; line-height: 1.45; }
.ai-assistant-capabilities li::before { content: ""; position: absolute; width: 7px; height: 7px; left: 0; top: .42rem; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.ai-assistant-note { padding-top: 16px; border-top: 1px solid var(--border-card); }
.ai-assistant-chat { min-height: 630px; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ai-action-queue { padding: 18px 24px; border-bottom: 1px solid var(--border-card); background: color-mix(in srgb, var(--warning-bg) 45%, var(--surface-card)); }.ai-action-queue h2 { margin: 0 0 10px; font-size: .95rem; }.ai-action-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--border-card); }.ai-action-card p { margin: 0; }.ai-action-card small { color: var(--text-muted); }.ai-action-card-actions { grid-row: span 2; display: flex; align-items: center; gap: 8px; }.ai-action-card-actions form { margin: 0; }
.ai-assistant-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--border-card); }
.ai-assistant-chat-header p { margin: 5px 0 0; color: var(--text-muted); font-size: .88rem; }
.ai-assistant-status { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--text-muted); font-size: .8rem; font-weight: 700; }
.ai-assistant-status span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.ai-assistant-messages { display: flex; flex: 1; flex-direction: column; gap: 16px; min-height: 310px; max-height: 520px; padding: 24px; overflow-y: auto; scroll-behavior: smooth; }
.ai-message { max-width: min(84%, 640px); padding: 14px 16px; border: 1px solid var(--border-card); border-radius: 14px; background: var(--surface-elevated); }
.ai-message--user { align-self: flex-end; border-color: rgba(56, 189, 248, .32); background: color-mix(in srgb, var(--primary) 14%, var(--surface-elevated)); }
.ai-message--assistant { align-self: flex-start; }
.ai-message-label { margin: 0 0 5px; color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ai-message--user .ai-message-label { color: var(--text-main); }
.ai-message-content { color: var(--text-main); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: .94rem; }
.ai-message.is-pending .ai-message-content { color: var(--text-muted); }
.ai-message.is-error { border-color: var(--negative); }
.ai-assistant-prompts { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 24px 16px; }
.ai-assistant-prompts button { min-height: 36px; padding: 7px 11px; color: var(--text-muted); background: transparent; border: 1px solid var(--border-card); border-radius: var(--radius-full); cursor: pointer; font: inherit; font-size: .78rem; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.ai-assistant-prompts button:hover { color: var(--text-main); border-color: var(--border-hover); background: var(--surface-elevated); }
.ai-assistant-composer { padding: 18px 24px 20px; border-top: 1px solid var(--border-card); background: color-mix(in srgb, var(--surface-card) 85%, transparent); }
.ai-assistant-composer label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: .8rem; font-weight: 700; }
.ai-assistant-composer-row { display: flex; align-items: flex-end; gap: 10px; }
.ai-assistant-composer textarea { flex: 1; min-height: 48px; max-height: 150px; resize: vertical; padding: 12px 14px; color: var(--text-main); background: var(--surface-input); border: 1px solid var(--border-card); border-radius: 10px; font: inherit; line-height: 1.45; }
.ai-assistant-composer textarea::placeholder { color: var(--text-subtle); }
.ai-assistant-composer textarea:focus { border-color: var(--primary); }
.ai-assistant-composer .button { min-height: 48px; cursor: pointer; }
.ai-assistant-composer .button:disabled { cursor: wait; opacity: .68; }
.ai-assistant-feedback { min-height: 1.25rem; margin: 8px 0 0; color: var(--text-muted); font-size: .8rem; }
@media (max-width: 900px) { .ai-assistant-layout { grid-template-columns: 1fr; }.ai-assistant-context { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; }.ai-assistant-orb { grid-row: span 3; margin: 0; }.ai-assistant-capabilities { grid-column: 1 / -1; }.ai-assistant-note { grid-column: 1 / -1; } }
@media (max-width: 640px) { .ai-assistant-page { padding: 24px 16px 36px; }.ai-assistant-header { align-items: stretch; }.ai-assistant-header-actions .button { flex: 1; justify-content: center; }.ai-assistant-chat { min-height: 590px; }.ai-assistant-chat-header, .ai-assistant-messages, .ai-assistant-composer { padding-left: 16px; padding-right: 16px; }.ai-message { max-width: 92%; }.ai-assistant-composer-row { align-items: stretch; flex-direction: column; }.ai-assistant-composer .button { width: 100%; }.ai-assistant-prompts { padding-left: 16px; padding-right: 16px; } }
@media (prefers-reduced-motion: reduce) { .ai-assistant-messages { scroll-behavior: auto; }.button-ghost, .ai-assistant-prompts button { transition: none; } }

/* Notes: uses existing dashboard tokens; no editor package required. */
.notes-page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 48px; }.notes-page-header { align-items: flex-start; gap: 20px; }.notes-page h1 { margin-bottom: 8px; }.notes-page-header > div > p:not(.eyebrow) { color: var(--text-muted); max-width: 660px; }.notes-new-button, .notes-actions { flex-shrink: 0; }.notes-search-panel, .notes-editor-panel, .notes-reading, .notes-connection-panel { padding: 24px; }.notes-search-form label, .notes-editor-form label { display: block; margin-bottom: 8px; font-weight: 700; }.notes-search-row, .notes-editor-topline, .notes-card-footer, .notes-show-meta, .notes-actions, .notes-editor-toolbar, .notes-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }.notes-search-row input { flex: 1; min-width: 220px; }.notes-search-row input, .notes-editor-form input:not([type="checkbox"]), .notes-body-input { width: 100%; color: var(--text-main); background: var(--surface-input); border: 1px solid var(--border-hover); border-radius: 8px; padding: 11px 12px; font: inherit; }.notes-search-row input:focus, .notes-editor-form input:focus, .notes-body-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }.notes-tags { margin-top: 18px; }.notes-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); background: var(--surface-elevated); border: 1px solid var(--border-card); border-radius: 999px; padding: 5px 10px; text-decoration: none; font-size: 13px; }.notes-tag:hover, .notes-tag.is-active { color: var(--text-main); border-color: var(--accent); }.notes-tag small { color: inherit; opacity: .72; }.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 20px; }.notes-card { display: flex; flex-direction: column; min-height: 190px; padding: 20px; border-left: 3px solid transparent; }.notes-card.is-pinned { border-left-color: var(--accent); }.notes-card-heading { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }.notes-card h2 { margin: 0; font-size: 18px; line-height: 1.35; }.notes-card h2 a { color: var(--text-main); text-decoration: none; }.notes-card h2 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }.notes-status { color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }.notes-excerpt { color: var(--text-muted); line-height: 1.6; margin: 14px 0 auto; }.notes-card-footer { justify-content: space-between; margin-top: 18px; color: var(--text-muted); font-size: 12px; }.notes-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }.notes-card-tags span { color: var(--accent); }.notes-empty { grid-column: 1 / -1; padding: 48px 24px; text-align: center; }.notes-empty-icon { width: 36px; height: 36px; color: var(--accent); }.notes-empty p { color: var(--text-muted); max-width: 500px; margin: 8px auto 20px; }.notes-editor-topline { align-items: end; }.notes-title-field { flex: 1; min-width: 220px; }.notes-pin-control { display: inline-flex !important; align-items: center; min-height: 44px; gap: 8px; cursor: pointer; font-weight: 600; }.notes-pin-control input { width: 18px; height: 18px; }.notes-editor-form .field-group { margin-top: 20px; }.field-hint { color: var(--text-muted); margin: 7px 0 0; font-size: 13px; }.notes-editor-toolbar { margin-top: 20px; background: var(--surface-elevated); border: 1px solid var(--border-card); border-radius: 8px; padding: 8px; }.notes-editor-toolbar button { min-height: 36px; color: var(--text-main); background: transparent; border: 1px solid var(--border-card); border-radius: 6px; padding: 6px 10px; cursor: pointer; }.notes-editor-toolbar button:hover { border-color: var(--accent); background: var(--surface-input); }.notes-body-input { min-height: 340px; resize: vertical; font-family: var(--font-mono, "IBM Plex Mono", monospace); line-height: 1.6; }.notes-form-actions { justify-content: flex-end; margin-top: 24px; }.notes-back-link { display: inline-block; color: var(--text-muted); margin-bottom: 18px; }.notes-show-meta { color: var(--text-muted); font-size: 13px; }.notes-show-meta time { margin-left: 4px; }.notes-reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }.notes-reading pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-main); font: 15px/1.75 var(--font-mono, "IBM Plex Mono", monospace); }.notes-connections { display: grid; align-content: start; gap: 16px; }.notes-connection-panel h2 { margin: 0 0 12px; font-size: 15px; }.notes-connection-panel p { color: var(--text-muted); font-size: 14px; }.notes-connection-panel ul { margin: 0; padding-left: 18px; }.notes-connection-panel li + li { margin-top: 8px; }.notes-connection-panel a { color: var(--accent); }@media (max-width: 760px) { .notes-page { padding: 24px 16px 40px; }.notes-page-header { flex-direction: column; }.notes-search-panel, .notes-editor-panel, .notes-reading, .notes-connection-panel { padding: 18px; }.notes-reading-layout { grid-template-columns: 1fr; }.notes-actions { width: 100%; }.notes-actions .btn { flex: 1; text-align: center; }.notes-new-button { width: 100%; justify-content: center; } }
.notes-header-actions { display: flex; flex-wrap: wrap; gap: 10px; }.notes-graph-panel { padding: 20px; overflow: hidden; }.notes-graph-legend { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }.notes-graph-legend span { display: inline-flex; align-items: center; gap: 7px; }.notes-graph-node-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }.notes-graph-line { width: 22px; height: 1px; background: var(--border-hover); }.notes-graph { display: block; width: 100%; min-height: 390px; background: var(--surface-input); border: 1px solid var(--border-card); border-radius: 12px; }.notes-graph-edge { stroke: var(--border-hover); stroke-width: 1.5; }.notes-graph-circle { fill: var(--accent); stroke: var(--surface-card); stroke-width: 3; transition: r .18s ease, fill .18s ease; }.notes-graph-circle.is-pinned { fill: var(--warning, #f59e0b); }.notes-graph-link:hover .notes-graph-circle, .notes-graph-link:focus .notes-graph-circle { r: 20; fill: var(--text-main); }.notes-graph-link:focus { outline: none; }.notes-graph-label { fill: var(--text-main); font-size: 14px; pointer-events: none; }.notes-graph-link:focus .notes-graph-label { fill: var(--accent); font-weight: 700; }
.notes-graph-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 16px; }.notes-graph-toolbar input, .notes-graph-toolbar select { min-height: 42px; color: var(--text-main); background: var(--surface-input); border: 1px solid var(--border-hover); border-radius: 8px; padding: 8px 10px; font: inherit; }.notes-graph-toolbar input { min-width: 220px; flex: 1; }.notes-graph-search-label, .notes-graph-select-label { font-size: 13px; font-weight: 700; }.notes-graph-toggle { display: inline-flex; align-items: center; min-height: 42px; gap: 7px; color: var(--text-muted); font-size: 13px; cursor: pointer; }.notes-graph-workspace { display: grid; grid-template-columns: 190px minmax(0, 1fr) 240px; gap: 16px; }.notes-graph-sidebar { min-width: 0; }.notes-graph-summary { color: var(--text-muted); font-size: 13px; padding-bottom: 12px; border-bottom: 1px solid var(--border-card); }.notes-graph-filter-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 15px 0 8px; }.notes-graph-filter-header h2, .notes-graph-details h2 { margin: 0; font-size: 15px; }.notes-graph-text-button { color: var(--accent); background: transparent; border: 0; padding: 5px; cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }.notes-graph-tags { display: flex; gap: 7px; flex-wrap: wrap; }.notes-graph-tag { color: var(--text-muted); background: var(--surface-input); border: 1px solid var(--border-card); border-radius: 999px; padding: 5px 8px; font: inherit; font-size: 12px; cursor: pointer; }.notes-graph-tag.is-selected { color: var(--text-main); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, var(--surface-input)); }.notes-graph-canvas-wrap { min-width: 0; position: relative; }.notes-graph-canvas-tools { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-bottom: 8px; }.notes-graph-canvas-tools button, .notes-graph-canvas-tools output { min-height: 34px; color: var(--text-main); background: var(--surface-elevated); border: 1px solid var(--border-card); border-radius: 6px; padding: 6px 9px; font: inherit; font-size: 12px; }.notes-graph-canvas-tools button { cursor: pointer; }.notes-graph-canvas-tools output { min-width: 48px; text-align: center; }.notes-graph { touch-action: none; cursor: grab; }.notes-graph:active { cursor: grabbing; }.notes-graph-edge { opacity: .62; }.notes-graph-edge.is-related { stroke: var(--accent); stroke-width: 3; opacity: 1; }.notes-graph-node { cursor: pointer; }.notes-graph-node.is-selected .notes-graph-circle { fill: var(--text-main); stroke: var(--accent); stroke-width: 5; }.notes-graph-node.is-neighbor .notes-graph-circle { stroke: var(--accent); stroke-width: 4; }.notes-graph-node:focus { outline: none; }.notes-graph-node:focus .notes-graph-circle { stroke: var(--text-main); stroke-width: 5; }.notes-graph-help { color: var(--text-muted); font-size: 12px; margin: 9px 0 0; }.notes-graph-details { align-self: start; min-height: 180px; }.notes-graph-details p { color: var(--text-muted); font-size: 14px; line-height: 1.55; }.notes-graph-details .btn { margin-top: 8px; }.notes-graph-detail-meta, .notes-graph-detail-tags { font-size: 12px !important; }.notes-graph-detail-tags { color: var(--accent) !important; }.notes-graph-toolbar input:focus, .notes-graph-toolbar select:focus, .notes-graph-toggle input:focus, .notes-graph-tag:focus-visible, .notes-graph-text-button:focus-visible, .notes-graph-canvas-tools button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1080px) { .notes-graph-workspace { grid-template-columns: 170px minmax(0, 1fr); }.notes-graph-details { grid-column: 1 / -1; } }@media (max-width: 700px) { .notes-graph-workspace { grid-template-columns: 1fr; }.notes-graph-sidebar { order: 2; }.notes-graph-details { order: 3; }.notes-graph-toolbar input { width: 100%; }.notes-graph-search-label, .notes-graph-select-label { width: 100%; margin-bottom: -5px; }.notes-graph { min-height: 330px; }.notes-graph-canvas-tools { justify-content: flex-start; } }

/* Gym tracking: surfaces use shared dashboard tokens and stay readable in both themes. */
.gym-insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.gym-insight-card { min-width: 0; padding: 22px; }.gym-insight-card .panel-header { align-items: flex-start; margin-bottom: 16px; }.gym-insight-card h2 { font-size: 1rem; }.gym-insight-card .panel-header p { margin: 4px 0 0; color: var(--text-muted); font-size: .85rem; }
.gym-weight-summary { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 16px; }.gym-weight-summary strong { color: var(--text-main); font-size: 1.65rem; }.gym-weight-summary span, .gym-weight-summary small { color: var(--text-muted); font-size: .82rem; }.gym-weight-summary .gym-change-up { color: var(--warning); }.gym-weight-summary .gym-change-down { color: var(--accent); }
.gym-compact-form { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(120px, 1.2fr) auto; gap: 10px; align-items: end; }.gym-compact-form label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: .75rem; font-weight: 700; }.gym-compact-form input, .gym-compact-form select { width: 100%; min-height: 42px; padding: 8px 10px; color: var(--text-main); background: var(--surface-input); border: 1px solid var(--border-card); border-radius: 8px; font: inherit; }.gym-compact-form input:focus, .gym-compact-form select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }.gym-compact-form .button { min-height: 42px; white-space: nowrap; }
.gym-inline-empty { min-height: auto; padding: 13px 0 18px; text-align: left; color: var(--text-muted); background: transparent; }.gym-schedule-list, .gym-load-list, .gym-readiness-list { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }.gym-schedule-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-card); }.gym-schedule-list span { display: grid; gap: 2px; color: var(--text-muted); font-size: .83rem; }.gym-schedule-list strong { color: var(--text-main); }.gym-schedule-actions { display: flex; align-items: center; gap: 8px; }.gym-schedule-actions form { margin: 0; }.gym-remove-button { padding: 6px; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: .78rem; }.gym-load-list li { display: grid; grid-template-columns: minmax(76px, .75fr) minmax(80px, 2fr) 28px; gap: 10px; align-items: center; color: var(--text-muted); font-size: .82rem; }.gym-load-list strong { color: var(--text-main); text-align: right; }.gym-load-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-elevated); }.gym-load-bar i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--accent); }.gym-readiness-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border-card); color: var(--text-main); font-size: .84rem; }.gym-readiness-list small { color: var(--text-muted); font-size: .75rem; text-align: right; }.gym-readiness-high { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, var(--border-card)); background: color-mix(in srgb, var(--warning) 12%, var(--surface-elevated)); }.gym-readiness-moderate { color: var(--primary); }.gym-readiness-ready { color: var(--accent); }
@media (max-width: 850px) { .gym-insights-grid { grid-template-columns: 1fr; }.gym-insight-card { padding: 18px; } }
@media (max-width: 560px) { .gym-compact-form { grid-template-columns: 1fr; }.gym-compact-form .button { width: 100%; }.gym-readiness-list li { grid-template-columns: 1fr auto; }.gym-readiness-list small { grid-column: 1 / -1; text-align: left; }.gym-load-list li { grid-template-columns: 85px minmax(50px, 1fr) 24px; } }
