/* ====================================================================
   Design System: MindBalance Standard Theme
   Typography: Outfit & Inter
   Directionality: Designed purely using CSS Logical Properties
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700;800&family=Manrope:wght@300;400;500;600;700&family=Assistant:wght@300;400;500;600;700;800&family=Rubik:wght@300;400;500;600;700&family=Instrument+Serif:ital@0;1&family=Frank+Ruhl+Libre:wght@400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  /* Typography — Manrope for LTR (replaces Outfit/Inter). Assistant kept for RTL. */
  --font-family: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
  /* Instrument Serif has no Hebrew glyphs — Frank Ruhl Libre takes over per-character
     for עברית, so titles render serif in both languages. */
  --font-serif:  'Instrument Serif', 'Frank Ruhl Libre', Georgia, serif;

  /* Surface — cream / paper / sand */
  --bg-primary:    hsl(40 36% 95%);          /* cream  #F8F4EC */
  --bg-secondary:  hsl(43 40% 97%);          /* paper  #FBF9F3 */
  --bg-tertiary:   hsl(40 31% 89%);          /* sand   #EFE8DA */

  /* Text — charcoal / muted */
  --text-primary:    hsl(40 6% 14%);         /* charcoal #262522 */
  --text-secondary:  hsl(40 7% 35%);         /* ink     #5F5B53 */
  --text-soft:       hsl(40 6% 55%);         /* labels / muted */
  --border-color:    hsla(40, 6%, 14%, 0.10);
  --hairline:        hsla(40, 6%, 14%, 0.07);

  /* Accent — sage deep (replaces vivid purple) */
  --accent-color:  hsl(108 11% 40%);         /* sageDeep #5C6E5A */
  --accent-light:  hsl(108 16% 88%);         /* sage wash for active backgrounds */
  --accent-hover:  hsl(108 11% 33%);
  --accent-glow:   hsla(108, 11%, 40%, 0.15);

  /* Semantic — calm versions, NO red alarms for a therapy audience */
  --success-color:  hsl(108 20% 38%);
  --success-light:  hsl(108 22% 92%);
  --success-border: hsl(108 22% 82%);

  --warning-color:  hsl(28 35% 50%);         /* warm cocoa #A27B5C */
  --warning-light:  hsl(28 50% 94%);
  --warning-border: hsl(28 40% 82%);

  /* Danger uses the same warm cocoa — never red. */
  --danger-color:   hsl(28 35% 50%);
  --danger-light:   hsl(28 50% 94%);
  --danger-border:  hsl(28 40% 82%);

  --cyan-color:     hsl(180 13% 47%);        /* soft teal */
  --cyan-light:     hsl(180 20% 93%);
  --cyan-border:    hsl(180 20% 82%);

  /* Shadows — warmer, less harsh than rgb(0,0,0) */
  --shadow-sm:    0 1px 2px 0 rgba(38, 37, 34, 0.04);
  --shadow-md:    0 4px 14px -2px rgba(38, 37, 34, 0.06),
                  0 2px 6px -1px rgba(38, 37, 34, 0.04);
  --shadow-lg:    0 20px 30px -8px rgba(38, 37, 34, 0.08),
                  0 10px 12px -6px rgba(38, 37, 34, 0.04);
  --shadow-inset: inset 0 1px 3px 0 rgba(38, 37, 34, 0.04);

  /* Geometry — slightly larger radii for a softer, calmer feel */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Motion — same speed; ease curve aligned with marketing site */
  --transition-base: 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Calendar — client color palette (soft pastels on sand) */
  --c-peach:  #F9D6B7;  --c-peach-stripe:  #E89A78;
  --c-butter: #F8E1A6;  --c-butter-stripe: #D6B654;
  --c-sky:    #D2DEEA;  --c-sky-stripe:    #8AA9C2;
  --c-lilac:  #D9CBE3;  --c-lilac-stripe:  #A48ABA;
  --c-sage:   #C6D2BF;  --c-sage-stripe:   #6F8B6B;
  --c-teal:   #BCD2CF;  --c-teal-stripe:   #5F8C86;
  --c-clay:   #E4C2A5;  --c-clay-stripe:   #A87649;
  --c-rose:   #EFCFCF;  --c-rose-stripe:   #BC8585;

  /* Calendar — avatar / brand-mark fills (slightly more saturated) */
  --c-peach-solid:  #F2B48B;
  --c-butter-solid: #F4D58A;
  --c-sky-solid:    #BFD3E4;
  --c-lilac-solid:  #C8B6D6;
  --c-sage-solid:   #8DA386;
  --c-teal-solid:   #7FA9A4;
  --c-clay-solid:   #C8956E;
  --c-rose-solid:   #E5B4B4;

  /* Shared brand palette aliases — used by client directory avatars,
     daily-quote decorative mark, and any future avatar-style accents. */
  --peach:  #F2B48B;
  --butter: #F4D58A;
  --sky:    #BFD3E4;
  --lilac:  #C8B6D6;
  --sage:   #8DA386;
  --teal:   #7FA9A4;
  --clay:   #C8956E;
  --rose:   #E5B4B4;

  /* Calendar — non-client kinds */
  --c-break:       #ECE6D6;
  --c-personal:    #E8DEEC;
  --c-supervision: #DCDDB9;

  /* Calendar — color-by-kind palette (overrides per-client when active) */
  --k-regular:     #DBE5D4;
  --k-long:        #C9DDD9;
  --k-intake:      #F0DBC4;
  --k-couple:      #E7D4D4;
  --k-online:      #D6E2EA;
  --k-supervision: #DCDDB9;
  --k-break:       #ECE6D6;
  --k-personal:    #E8DEEC;

  /* Calendar — geometry */
  --slot-h:        30px;   /* one 30-min slot. 22 compact / 38 airy */
  --time-col:      64px;
  --event-radius:  10px;
  --day-count:     7;

  --in-oklab: ;
}

[data-mode="dark"] {
  --bg-primary:    hsl(40 6% 10%);
  --bg-secondary:  hsl(40 5% 13%);
  --bg-tertiary:   hsl(40 5% 16%);
  --text-primary:    hsl(40 25% 96%);
  --text-secondary:  hsl(40 6% 70%);
  --text-soft:       hsl(40 6% 55%);
  --border-color:    hsla(40, 6%, 96%, 0.08);
  --hairline:        hsla(40, 6%, 96%, 0.05);

  --accent-color:  hsl(108 16% 60%);
  --accent-light:  hsl(108 14% 20%);
  --accent-hover:  hsl(108 18% 70%);
  --accent-glow:   hsla(108, 16%, 60%, 0.20);

  --success-color:  hsl(108 28% 60%);
  --success-light:  hsl(108 14% 18%);
  --success-border: hsl(108 14% 26%);

  --warning-color:  hsl(28 45% 65%);
  --warning-light:  hsl(28 14% 18%);
  --warning-border: hsl(28 18% 28%);

  --danger-color:   hsl(28 45% 65%);
  --danger-light:   hsl(28 14% 18%);
  --danger-border:  hsl(28 18% 28%);

  --cyan-color:     hsl(180 28% 62%);
  --cyan-light:     hsl(180 14% 16%);
  --cyan-border:    hsl(180 14% 24%);
}

@supports (linear-gradient(in oklab, white, black)) {
  :root { --in-oklab: in oklab; }
}

[dir="rtl"] {
  --font-family: 'Assistant', 'Rubik', system-ui, -apple-system, sans-serif;
}

/* ====================================================================
   Generic Defaults & Boilerplate Resets
   ==================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Skeleton Container */
.app-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-block-size: 100vh;
  transition: var(--transition-base);
}

/* Sidebar Navigation */
.app-sidebar {
  background-color: var(--bg-secondary);
  border-inline-end: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  block-size: 100vh;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-block-end: 2rem;
}

.brand-logo {
  font-family: 'Manrope', 'Outfit', var(--font-family);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1;
}
.brand-logo .brand-word { display: inline-flex; align-items: baseline; }
.brand-logo .brand-word-app {
  color: var(--accent-color);
  font-weight: 700;
}
.brand-logo .brand-mark { flex-shrink: 0; }

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--accent-color);
  background-color: var(--accent-light);
  font-weight: 600;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-block-start: 1px solid var(--border-color);
  padding-block-start: 1.5rem;
}

.utility-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-base);
  inline-size: 100%;
}

.utility-button:hover {
  background-color: var(--border-color);
}

/* ====================================================================
   Main Dashboard Layout
   ==================================================================== */

.app-main {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  max-inline-size: 1600px;
  margin-inline: auto;
  inline-size: 100%;
}

/* Dashboard Header Row */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-title h1 {
  font-family: 'Outfit', var(--font-family);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.header-title p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Operational Widget Triage Grid */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.widget-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.widget-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.widget-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.widget-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.widget-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Widget Specific Displays */

/* 1. Overdue Aging AR Display */
.widget-ar-value {
  font-family: 'Outfit', var(--font-family);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--danger-color);
  line-height: 1;
}

.widget-ar-alert {
  background-color: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-block-start: 0.5rem;
  align-self: flex-start;
}

/* 2. Billing Sync Queue */
.sync-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-block-size: 140px;
  overflow-y: auto;
}

.sync-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background-color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

.sync-item-meta {
  display: flex;
  flex-direction: column;
}

.sync-item-name {
  font-weight: 600;
}

.sync-item-date {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* 3. Dispatch Hub */
.dispatch-count {
  font-family: 'Outfit', var(--font-family);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
}

.document-type-select {
  min-inline-size: 12rem;
  max-inline-size: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
}

/* 4. Revenue Pulse Chart */
.revenue-pulse-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-block-start: 0.5rem;
}

.chart-bar-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.chart-bar-label {
  inline-size: 80px;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: end;
}

.chart-bar-track {
  flex-grow: 1;
  background-color: var(--bg-tertiary);
  block-size: 10px;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-inset);
}

.chart-bar-fill {
  block-size: 100%;
  border-radius: 5px;
  transition: width var(--transition-slow) ease-in-out;
}

.chart-bar-fill.collected {
  background: linear-gradient(to right var(--in-oklab), var(--success-color), hsl(142 80% 45%));
}

.chart-bar-fill.outstanding {
  background: linear-gradient(to right var(--in-oklab), var(--warning-color), hsl(38 92% 65%));
}

.chart-bar-value {
  inline-size: 60px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: start;
}

/* ====================================================================
   Zero-Dependency Custom CSS Grid / Table Component
   ==================================================================== */

.ledger-section {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.table-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-block-end: 1px solid var(--border-color);
  padding-block-end: 1rem;
}

/* Custom CSS Responsive Grid Table Layout */
.custom-table {
  display: flex;
  flex-direction: column;
  inline-size: 100%;
}

/* Define columns globally for Desktop: Checkbox, Client, Date, Status, Fee, State, Actions */
.custom-table-row {
  display: grid;
  grid-template-columns: 40px 1.5fr 1.2fr 1fr 0.8fr 1fr 1.2fr;
  align-items: center;
  padding: 0.9rem 1rem;
  border-block-end: 1px solid var(--border-color);
  transition: background-color var(--transition-base);
  font-size: 0.9rem;
}

.custom-table-row:last-child {
  border-block-end: none;
}

.custom-table-header {
  background-color: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  border-block-end: none;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.custom-table-row:not(.custom-table-header):hover {
  background-color: var(--bg-primary);
}

/* Cell alignment styling using logical systems */
.table-cell {
  display: flex;
  align-items: center;
  text-align: start;
}

.table-cell.actions {
  justify-content: flex-end;
  gap: 0.5rem;
}

.table-cell.numeric {
  justify-content: flex-start;
  font-weight: 600;
}

/* ====================================================================
   Minimalist Progressive Disclosure Forms (Critical Feature)
   ==================================================================== */

.minimalist-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.client-form-container {
  inline-size: 100%;
  max-inline-size: 1100px;
  margin-inline: auto;
}

/* In edit mode the form re-uses the new-client layout but the "Step 1 of 3"
   wizard indicators stop making sense — hide them. Section titles stay. */
.client-form-container.is-editing .nc-step { display: none; }

.client-create-form {
  gap: 14px;
}

.client-form-topic {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px;
  box-sizing: border-box;
  min-inline-size: 0;
}

.client-form-topic-head {
  margin-block-end: 16px;
}

.client-form-topic-head h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.client-form-topic-head p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.client-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.client-form-grid .form-group {
  min-inline-size: 0;
}

.client-notes-field {
  grid-column: 1 / -1;
}

.client-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-start;
  padding-block-start: 4px;
}

.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Underline Form Fields */
.minimalist-input {
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-block-end: 1px solid var(--border-color);
  padding: 0.5rem 0.25rem;
  outline: none;
  transition: border-color var(--transition-base);
  min-inline-size: 0;
  box-sizing: border-box;
}

.minimalist-input:focus {
  border-block-end: 2px solid var(--accent-color);
}

.form-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.form-hint {
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1.45;
  margin-block-start: 3px;
}

/* Progressive Disclosure Dropdowns and Autocompletes */
.progressive-disclosure {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-block-size: 200px;
  overflow-y: auto;
  
  /* Initial State: Hidden and shifted */
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  display: none;
  transition: opacity var(--transition-base) ease, transform var(--transition-base) ease;
}

/* Active class triggered on onFocus via client-side logic */
.progressive-disclosure.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.disclosure-option {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-base);
  text-align: start;
}

.disclosure-option:hover {
  background-color: var(--bg-tertiary);
  color: var(--accent-color);
}

@media (max-width: 760px) {
  .client-form-topic {
    padding: 16px;
  }
  .client-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .client-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Expandable internal notes text area styling */
.tech-notes-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tech-notes-toggle {
  font-size: 0.8rem;
  color: var(--accent-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  user-select: none;
}

.tech-notes-textarea {
  display: none;
  font-family: var(--font-family);
  font-size: 0.85rem;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  min-block-size: 80px;
}

.tech-notes-textarea.visible {
  display: block;
  animation: slideDown var(--transition-base) forwards;
}

/* ====================================================================
   Buttons, Badges, Modals, & Micro-animations
   ==================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-base), transform 0.1s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background-color: var(--accent-color);
  color: white;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}

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

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

.btn-pdf {
  color: var(--text-secondary);
  transition: all var(--transition-base) !important;
}

.btn-pdf:hover {
  color: var(--accent-color) !important;
  background-color: var(--accent-light) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: hsl(142 72% 23%);
}

.btn-icon {
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-draft {
  background-color: var(--warning-light);
  color: var(--warning-color);
  border: 1px solid var(--warning-border);
}

.badge-issued {
  background-color: var(--accent-light);
  color: var(--accent-color);
  border: 1px solid var(--border-color);
}

.badge-paid {
  background-color: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-border);
}

.badge-demand {
  background-color: var(--accent-light);
  color: var(--accent-color);
  border: 1px solid var(--accent-glow);
}

.badge-paid-internal {
  background-color: var(--cyan-light);
  color: var(--cyan-color);
  border: 1px solid var(--cyan-border);
}

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

.badge-event.completed {
  background-color: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-border);
}

.ledger-status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.badge-stripe-none,
.badge-stripe-pending {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-stripe-succeeded {
  background-color: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-border);
}

.badge-stripe-failed {
  background-color: var(--danger-light);
  color: var(--danger-color);
  border: 1px solid var(--danger-border);
}

.badge-stripe-refunded {
  background-color: var(--cyan-light);
  color: var(--cyan-color);
  border: 1px solid var(--cyan-border);
}

.btn-stripe:hover {
  color: var(--success-color) !important;
  background-color: var(--success-light) !important;
  border-color: var(--success-border) !important;
}

.badge-event.billable {
  background-color: var(--danger-light);
  color: var(--danger-color);
  border: 1px solid var(--danger-border);
}

/* Compliance Lock Indicator */
.compliance-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--success-color);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base) ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  inline-size: 90%;
  max-inline-size: 480px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform var(--transition-base) ease;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

.modal-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-block-start: 1px solid var(--border-color);
  padding-block-start: 1rem;
}

/* ====================================================================
   Micro-Animations & Keyframes
   ==================================================================== */

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

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 hsla(262, 80%, 50%, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px hsla(262, 80%, 50%, 0);
  }
  100% {
    box-shadow: 0 0 0 0 hsla(262, 80%, 50%, 0);
  }
}

.pulse-target {
  animation: pulseGlow 2s infinite;
  border-radius: var(--radius-md);
}

/* Toggle Switch Styling */
.switch-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  inline-size: 40px;
  block-size: 22px;
}

.switch input {
  opacity: 0;
  inline-size: 0;
  block-size: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  block-size: 14px;
  inline-size: 14px;
  inset-inline-start: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: white;
}

/* RTL adjustment for slider */
[dir="rtl"] input:checked + .slider:before {
  transform: translateX(-18px);
}

/* Success Pulse highlight for newly created item */
.new-client-highlight {
  animation: pulse-success-glow 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes pulse-success-glow {
  0% {
    border-color: #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.4);
    background-color: rgba(16, 185, 129, 0.05);
    transform: scale(1.02);
  }
  30% {
    border-color: #10b981;
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.1);
    background-color: rgba(16, 185, 129, 0.02);
    transform: scale(1.01);
  }
  100% {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
    background-color: var(--bg-secondary);
    transform: scale(1);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Premium Form Success Alert Banner */
.form-success-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-block-end: 1.25rem;
  border-radius: var(--radius-md);
  background-color: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success-color);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transform: translateY(-10px);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-success-alert.show {
  transform: translateY(0);
  opacity: 1;
}

/* ====================================================================
   RESPONSIVE DESIGN & MOBILE-FIRST STACKING (Critical Constraint)
   ==================================================================== */

@media (max-width: 992px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  
  .app-sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    inline-size: 100vw;
    block-size: 60px;
    padding: 0.5rem 1rem;
    border-inline-end: none;
    border-block-start: 1px solid var(--border-color);
    flex-direction: row;
    align-items: center;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
  }
  
  .brand-section, .sidebar-footer {
    display: none;
  }
  
  .nav-menu {
    flex-direction: row;
    justify-content: space-around;
    inline-size: 100%;
    margin: 0;
  }
  
  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    flex-direction: column;
    gap: 0.1rem;
  }
  
  .app-main {
    padding: 1.5rem 1.5rem 80px 1.5rem; /* Extra bottom padding to avoid sidebar overlap */
  }
}

/* CUSTOM LIGHTWEIGHT TABLE RESPONSIVE CARD STACKING */
@media (max-width: 768px) {
  
  /* 1. Hide the table column headers entirely on mobile */
  .custom-table-header {
    display: none;
  }
  
  /* 2. Transform the rows into vertical cards */
  .custom-table-row {
    grid-template-columns: 1fr; /* Stack vertically */
    gap: 0.6rem;
    padding: 1.25rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-block-end: 1rem;
    box-shadow: var(--shadow-sm);
  }
  
  /* 3. Render each cell as a horizontal key-value pair */
  .table-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: end;
    inline-size: 100%;
    padding-block-end: 0.4rem;
    border-block-end: 1px dashed var(--border-color);
  }
  
  .table-cell:last-child, .table-cell.actions {
    border-block-end: none;
    padding-block-end: 0;
  }
  
  /* Force Actions to stretch or align beautifully */
  .table-cell.actions {
    justify-content: flex-end;
    margin-block-start: 0.5rem;
    gap: 0.5rem;
  }
  
  /* 4. Display data-label attribute as mobile header key */
  .table-cell::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-inline-end: 1rem;
    text-align: start;
  }
  
  /* Overrides for specific mobile styles */
  .table-cell.numeric {
    justify-content: space-between;
  }
  
  /* Expand checkbox label width on mobile */
  .table-cell:first-child {
    justify-content: flex-start;
  }
  .table-cell:first-child::before {
    content: "Select";
  }
}

/* ====================================================================
   Premium Empty-State and Editing Highlight Rules
   ==================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 2rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background-color: rgba(255, 255, 255, 0.01);
  margin-block-start: 1rem;
  transition: var(--transition-base);
  inline-size: 100%;
}

.empty-state:hover {
  border-color: var(--accent-color);
  background-color: var(--accent-glow);
}

.empty-state-icon {
  margin-block-end: 1rem;
  color: var(--text-secondary);
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  transition: var(--transition-base);
}

.empty-state:hover .empty-state-icon {
  color: var(--accent-color);
  background: var(--accent-light);
  transform: scale(1.08);
}

.empty-state-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-block-end: 0.5rem;
}

.empty-state-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-inline-size: 340px;
  line-height: 1.45;
}

/* Editing Highlight Border for Client Directory Cards */
.editing-client-highlight {
  border: 2px solid var(--accent-color) !important;
  box-shadow: 0 0 14px var(--accent-glow) !important;
  background-color: var(--accent-light) !important;
  transform: translateY(-2px) scale(1.01);
  transition: var(--transition-base);
}

[data-mode="dark"] .editing-client-highlight {
  background-color: rgba(139, 92, 246, 0.08) !important;
}

/* ====================================================================
   Multi-Tenant Practitioner Authentication & Scoped Access Style Block
   ==================================================================== */

/* Premium Standalone Auth Page */
/* ==========================================================================
   Auth screen — split-layout redesign (takingcare.app)
   Brand panel + form panel · sprout logo · sage / cream / cocoa tokens
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: block;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--transition-slow) ease, visibility var(--transition-slow) ease;
  overflow: auto;
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

body:has(#authOverlay.active) .app-container { display: none !important; }

.auth-split {
  min-block-size: 100vh;
  inline-size: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

/* ---------- Brand / ambient panel (time-of-day) ---------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  /* default palette = day (overridden by .auth-brand[data-time="…"]) */
  --sky-1: hsl(108 16% 86%);
  --sky-2: hsl(43 40% 96%);
  --sky-3: var(--bg-primary);
  --sun: hsl(46 90% 84%);
  --sun-top: 2%;
  --sun-start: 8%;
  --sun-size: 380px;
  background: linear-gradient(160deg, var(--sky-1) 0%, var(--sky-2) 58%, var(--sky-3) 100%);
  display: flex;
  flex-direction: column;
  padding: clamp(36px, 5vw, 64px);
  transition: background 1.3s ease;
}
.brand-decor { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.brand-decor span {
  position: absolute; border-radius: 50%; filter: blur(2px); opacity: 0.5;
  transition: background 1.3s ease, opacity 1.3s ease;
}
/* b1 = corner sun / moon ambient glow (time-driven) */
.brand-decor .b1 {
  inline-size: var(--sun-size); block-size: var(--sun-size);
  background: radial-gradient(circle at 50% 50%, var(--sun), transparent 70%);
  inset-block-start: var(--sun-top); inset-inline-start: var(--sun-start);
  opacity: 0.7; filter: blur(3px);
}
.brand-decor .b2 {
  inline-size: 300px; block-size: 300px;
  background: radial-gradient(circle at 50% 50%, hsl(108 22% 70%), transparent 70%);
  inset-block-end: 60px; inset-inline-end: -40px;
}
.brand-decor .b3 {
  inline-size: 220px; block-size: 220px;
  background: radial-gradient(circle at 50% 50%, var(--sky, hsl(208 35% 82%)), transparent 70%);
  inset-block-end: -60px; inset-inline-start: 30%; opacity: 0.4;
}

/* twinkling stars — night only */
.stars { position: absolute; inset: 0; z-index: 0; opacity: 0; transition: opacity 1.3s ease; pointer-events: none; }
.stars i {
  position: absolute; inline-size: 3px; block-size: 3px; border-radius: 50%;
  background: hsl(46 70% 92%); box-shadow: 0 0 6px hsl(46 80% 88%);
}

/* celestial body — sun (visible mark, breathing glow + ripple halo) */
.celestial {
  position: absolute; z-index: 0; pointer-events: none;
  inline-size: 96px; block-size: 96px;
  inset-block-start: 16%; inset-inline-start: 16%;
  transition: opacity 1.3s ease, background 1.3s ease, box-shadow 1.3s ease;
}
.celestial .disc {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, var(--cel-hi, hsl(50 100% 92%)), var(--cel, hsl(46 92% 76%)) 68%);
  box-shadow: 0 0 46px 10px var(--cel-glow, hsl(46 90% 80% / 0.55));
  transition: background 1.3s ease, box-shadow 1.3s ease;
}
.celestial .halo {
  position: absolute; inset: -22%; border-radius: 50%;
  border: 1.5px solid var(--cel-glow, hsl(46 90% 80% / 0.55));
  opacity: 0;
}
.auth-brand[data-time="night"] .celestial { opacity: 0; }

/* moon — shown at dusk (alongside setting sun) and at night */
.moon {
  position: absolute; z-index: 0; pointer-events: none; opacity: 0;
  inline-size: 72px; block-size: 72px;
  inset-block-start: 14%; inset-inline-start: 22%;
  transition: opacity 1.3s ease, background 1.3s ease, box-shadow 1.3s ease;
}
.moon .disc {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, hsl(48 42% 95%), hsl(45 26% 85%) 70%);
  box-shadow: 0 0 34px 8px hsl(220 35% 72% / 0.4);
}
.auth-brand[data-time="evening"] .moon,
.auth-brand[data-time="night"] .moon { opacity: 1; }

/* explicit celestial positions per time — concrete values (logical-inset vars are unreliable) */
.auth-brand[data-time="morning"] .celestial { inset-block-start: 20%; inset-inline-start: 18%; inline-size: 92px;  block-size: 92px; }
.auth-brand[data-time="day"]     .celestial { inset-block-start: 12%; inset-inline-start: 22%; inline-size: 100px; block-size: 100px; }
.auth-brand[data-time="evening"] .celestial { inset-block-start: 60%; inset-inline-start: 56%; inline-size: 120px; block-size: 120px; }
.auth-brand[data-time="evening"] .moon { inset-block-start: 10%; inset-inline-start: 24%; inline-size: 56px; block-size: 56px; }
.auth-brand[data-time="night"]   .moon { inset-block-start: 14%; inset-inline-start: 20%; inline-size: 84px; block-size: 84px; }

/* Brand-panel animations — always-on (gentle/calm; reduce-motion users opt out via a manual toggle if needed) */
.celestial { animation: cel-bob 9s ease-in-out infinite; }
.celestial .disc { animation: cel-breathe 6s ease-in-out infinite; }
.celestial .halo { animation: cel-ripple 6s ease-out infinite; }
.moon { animation: cel-bob 12s ease-in-out infinite; }
.moon .disc { animation: cel-breathe 8s ease-in-out infinite; }
.brand-decor .b1 { animation: sun-glow 9s ease-in-out infinite, drift-a 30s ease-in-out infinite; }
.brand-decor .b2 { animation: drift-b 36s ease-in-out infinite; }
.brand-decor .b3 { animation: drift-a 42s ease-in-out infinite; }
.stars i { animation: twinkle var(--d, 4s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes cel-bob { 0%, 100% { transform: translateY(-20px); } 50% { transform: translateY(110px); } }
@keyframes cel-breathe { 0%,100% { transform: scale(0.94); filter: brightness(0.96); } 50% { transform: scale(1.12); filter: brightness(1.15); } }
@keyframes cel-ripple { 0% { transform: scale(0.7); opacity: 0.85; } 70% { opacity: 0.1; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes sun-glow { 0%,100% { opacity: 0.55; transform: scale(0.96); } 50% { opacity: 0.9; transform: scale(1.1); } }
@keyframes drift-a { 0%,100% { translate: 0 0; } 50% { translate: -16px 12px; } }
@keyframes drift-b { 0%,100% { translate: 0 0; } 50% { translate: 14px -12px; } }
@keyframes twinkle { 0%,100% { opacity: 0.15; transform: scale(0.7); } 50% { opacity: 0.95; transform: scale(1); } }

/* per-time palettes (sky gradient + sun glow ambient + celestial colors) */
.auth-brand[data-time="morning"] {
  --sky-1: hsl(26 64% 88%); --sky-2: hsl(40 48% 94%); --sky-3: var(--bg-primary);
  --sun: hsl(28 90% 80%); --sun-top: 8%; --sun-start: 6%; --sun-size: 360px;
  --cel: hsl(30 92% 72%); --cel-hi: hsl(42 96% 88%); --cel-glow: hsl(28 88% 74% / 0.5);
}
.auth-brand[data-time="day"] {
  --sky-1: hsl(108 18% 86%); --sky-2: hsl(43 42% 96%); --sky-3: var(--bg-primary);
  --sun: hsl(46 92% 84%); --sun-top: 0%; --sun-start: 10%; --sun-size: 380px;
  --cel: hsl(46 95% 76%); --cel-hi: hsl(50 100% 92%); --cel-glow: hsl(46 92% 80% / 0.55);
}
.auth-brand[data-time="evening"] {
  --sky-1: hsl(18 66% 79%); --sky-2: hsl(30 54% 87%); --sky-3: hsl(40 34% 91%);
  --sun: hsl(12 78% 66%); --sun-top: 30%; --sun-start: -2%; --sun-size: 360px;
  --cel: hsl(11 84% 60%); --cel-hi: hsl(22 90% 73%); --cel-glow: hsl(9 82% 58% / 0.55);
}
.auth-brand[data-time="night"] {
  --sky-1: hsl(226 30% 23%); --sky-2: hsl(223 27% 32%); --sky-3: hsl(220 22% 41%);
  --sun: hsl(46 38% 86%); --sun-top: 4%; --sun-start: 12%; --sun-size: 190px;
}
.auth-brand[data-time="night"] .stars { opacity: 1; }
.auth-brand[data-time="night"] .brand-decor .b1 { opacity: 0.55; filter: blur(1px); }
.auth-brand[data-time="night"] .brand-decor .b2,
.auth-brand[data-time="night"] .brand-decor .b3 { opacity: 0.16; }

/* night → light text on the dark panel */
.auth-brand[data-time="night"] .wordmark .wm-text { color: hsl(40 28% 92%); }
.auth-brand[data-time="night"] .wordmark .mark,
.auth-brand[data-time="night"] .wordmark .wm-leaf,
.auth-brand[data-time="night"] .wordmark .wm-app { color: hsl(108 32% 78%); }
.auth-brand[data-time="night"] .brand-illo { color: hsl(108 32% 78%); }
.auth-brand[data-time="night"] .brand-tag { color: hsl(40 30% 95%); }
.auth-brand[data-time="night"] .brand-tag em,
.auth-brand[data-time="night"] .brand-tag-eyebrow { color: hsl(108 34% 80%); }
.auth-brand[data-time="night"] .brand-sub { color: hsl(40 16% 82%); }
.auth-brand[data-time="night"] .auth-brand-foot { color: hsl(40 12% 68%); }

.auth-brand-top { position: relative; z-index: 1; }
.auth-brand-center {
  position: relative; z-index: 1;
  margin-block: auto;
  max-inline-size: 38ch;
}
.brand-illo {
  inline-size: 132px; block-size: 132px;
  color: var(--accent-color);
  margin-block-end: 28px;
}
/* Brand sprout illustration — always-on breathing */
.brand-illo .breathe-grp { transform-origin: 50% 50%; animation: tcw-breathe 7s ease-in-out infinite; }
@keyframes tcw-breathe {
  0%, 100% { transform: scale(0.88); opacity: 0.88; }
  50%      { transform: scale(1.12); opacity: 1; }
}

.brand-tag-eyebrow {
  display: block;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-hover);
  font-weight: 600;
  margin-block-end: 10px;
}
.brand-tag {
  font-size: clamp(25px, 2.6vw, 31px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 14px;
  text-wrap: pretty;
}
.brand-tag em { font-style: normal; color: var(--accent-hover); }
.brand-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
  max-inline-size: 40ch;
}
.auth-brand-foot {
  position: relative; z-index: 1;
  font-size: 12.5px;
  color: var(--text-soft, var(--text-secondary));
}

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 11px; }
.wordmark .mark { inline-size: 34px; block-size: 34px; color: var(--accent-color); flex: none; }
.wordmark .wm-text {
  font-family: 'Manrope', 'Outfit', var(--font-family);
  font-weight: 700; font-size: 23px;
  letter-spacing: -0.03em; color: var(--text-primary); line-height: 1;
  display: inline-flex; align-items: center;
  direction: ltr;
}
.wordmark .wm-leaf { inline-size: 13px; block-size: 13px; color: var(--accent-color); margin: 0 1px; }
.wordmark .wm-app { color: var(--accent-color); font-weight: 600; }

/* ---------- Form panel ---------- */
.auth-form-side {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(28px, 5vw, 56px);
}
.auth-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  inline-size: min(440px, 100%);
  display: block;
  transform: none;
  transition: none;
  gap: 0;
}
[data-mode="dark"] .auth-card { background: transparent; border: none; box-shadow: none; }
.auth-overlay.active .auth-card { transform: none; }

.auth-card-logo { display: none; margin-block-end: 28px; }

/* Language toggle pill — small, top-end corner of the auth card */
.auth-lang-toggle {
  position: absolute;
  inset-block-start: clamp(18px, 2.6vw, 28px);
  inset-inline-end: clamp(18px, 2.6vw, 28px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color var(--transition-base), border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
  z-index: 2;
}
.auth-lang-toggle:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.auth-form-side { position: relative; }
.auth-brand { position: relative; }

/* ---------- Tabs ---------- */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 999px; padding: 4px;
  margin-block-end: 18px;
  inline-size: 100%;
  box-sizing: border-box;
}
.auth-tab-btn {
  border: none; background: transparent; border-radius: 999px;
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer;
  text-align: center; white-space: nowrap;
  transition: background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}
.auth-tab-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.auth-tab-btn:hover:not(.active) { color: var(--text-primary); }

.auth-subtitle-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 18px;
  line-height: 1.5;
}

/* ---------- Error ---------- */
.auth-error {
  display: none;
  font-size: 0.85rem;
  color: var(--danger-color, var(--cocoa, hsl(28 35% 50%)));
  background-color: var(--danger-light, hsl(28 50% 95%));
  border: 1px solid var(--danger-border, hsl(28 40% 85%));
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  align-items: center;
  gap: 0.5rem;
  line-height: 1.4;
  margin-block-end: 16px;
}
.auth-error.visible { display: flex; }

/* ---------- Panes ---------- */
.pane { display: none; }
.pane.is-active { display: block; }

/* ---------- SSO button ---------- */
.sso-btn {
  inline-size: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-family: var(--font-family);
  font-size: 14.5px; font-weight: 600; color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}
.sso-btn:hover {
  border-color: var(--text-soft, var(--text-secondary));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.sso-btn svg { inline-size: 18px; block-size: 18px; flex-shrink: 0; }

/* ---------- Divider ---------- */
.divider {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0;
  color: var(--text-soft, var(--text-secondary));
  font-size: 12.5px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; block-size: 1px;
  background: var(--hairline, var(--border-color));
}

/* ---------- Form fields ---------- */
.auth-form { display: block; }
.field { margin-block-end: 16px; }
.field label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-block-end: 7px;
  text-transform: none;
  letter-spacing: normal;
}
.field .input-wrap { position: relative; }
.field input {
  inline-size: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  font-family: var(--font-family);
  font-size: 14.5px;
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.field input::placeholder { color: var(--text-soft, var(--text-secondary)); opacity: 0.85; }
.field input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light, var(--accent-glow));
}
.field.has-toggle input,
.field input[type="password"] { padding-inline-start: 42px; }

.pw-toggle {
  position: absolute;
  inset-block-start: 50%; inset-inline-start: 12px;
  transform: translateY(-50%);
  background: none; border: none; padding: 4px;
  color: var(--text-soft, var(--text-secondary));
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color var(--transition-base);
}
.pw-toggle:hover { color: var(--text-secondary); }
.pw-toggle svg { inline-size: 18px; block-size: 18px; }

/* ---------- Remember-me + forgot-password row ---------- */
.field-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-block-end: 20px;
}
.remember {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
}
.remember input {
  inline-size: 16px; block-size: 16px;
  accent-color: var(--accent-color);
  margin: 0;
}
.link-soft {
  font-size: 13px; font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
}
.link-soft:hover {
  color: var(--accent-hover);
  text-decoration: underline; text-underline-offset: 2px;
}

/* ---------- Primary CTA ---------- */
.cta {
  inline-size: 100%;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-color);
  color: #fff;
  padding: 14px 16px;
  font-family: var(--font-family);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}
.cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.cta[disabled] { opacity: 0.65; cursor: not-allowed; transform: none; }

/* ---------- Foot note ---------- */
.auth-foot-note {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-block-start: 20px;
}
.auth-foot-note a {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}
.auth-foot-note a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Legacy auth-form classes (kept for #authOnboardingCard) ---------- */
#authOnboardingCard .auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
#authOnboardingCard .auth-group { display: flex; flex-direction: column; gap: 0.35rem; }
#authOnboardingCard .auth-label {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}
#authOnboardingCard .auth-input {
  font-family: var(--font-family); font-size: 0.9rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary); color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
#authOnboardingCard .auth-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light, var(--accent-glow));
}
#authOnboardingCard {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  inline-size: min(420px, 100%);
  box-shadow: var(--shadow-md);
  margin: 0 auto;
}
#authOnboardingCard .auth-header {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  margin-block-end: 1rem;
}
#authOnboardingCard .auth-logo {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: 'Manrope', 'Outfit', var(--font-family);
  font-weight: 700; font-size: 1.6rem; letter-spacing: -0.03em; line-height: 1;
  color: var(--text-primary);
}
#authOnboardingCard .auth-logo .auth-logo-word { display: inline-flex; align-items: baseline; }
#authOnboardingCard .auth-logo .auth-logo-word-app { color: var(--accent-color); font-weight: 700; }
.auth-toggle {
  text-align: center; font-size: 0.85rem; color: var(--accent-color);
  cursor: pointer; font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card-logo { display: flex; justify-content: center; }
  .auth-form-side { align-items: flex-start; padding-block-start: clamp(40px, 9vh, 88px); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-illo .breathe-grp { animation: none !important; }
}

/* Onboarding Screen layout overrides */
#authOnboardingCard {
  animation: slideDown var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Theming toolbar floats top-inline-start (top-right in RTL). theme.css ships
   it at z-index 200, but the auth overlay (9999) and the billing entitlement
   gate (10000) both sit above it — keep the toolbar visible everywhere so the
   user can switch palette/mode from any state. */
.theme-toolbar-float { z-index: 10001 !important; }

/* Sidebar footer — identity row + separate logout button.
   Source: design/_inbox/design_handoff_theming/reference-client-card.html
   (also: design/_inbox/design_handoff_sidebar_logout/, superseded by v12). */
.side-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-block-end: 0.25rem;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
}

.side-user .su-av {
  inline-size: 38px;
  block-size: 38px;
  flex: none;
  background: var(--accent-light);
  color: var(--accent-hover);
  /* organic "blob" — the app's avatar signature, not a plain circle */
  border-radius: 58% 42% 53% 47% / 50% 56% 44% 50%;
  display: grid;
  place-items: center;
  font-family: 'Outfit', var(--font-family);
  font-weight: 600;
  font-size: 13px;
}

.side-user .su-meta {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  line-height: 1.35;
  flex: 1;
  overflow: hidden;
}

.su-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.su-role {
  font-size: 11.5px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  inline-size: 100%;
  text-align: start;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition-base), color var(--transition-base);
}

.logout-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.logout-btn svg {
  inline-size: 16px;
  block-size: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

/* ====================================================================
   SaaS Tenant Settings Panel Styling
   ==================================================================== */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  inline-size: 100%;
  animation: fadeIn var(--transition-base) ease-in-out;
}

.settings-header {
  margin-block-end: 0.5rem;
}

.settings-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  inline-size: 100%;
}

.settings-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

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

.settings-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-block-end: 1px solid var(--border-color);
  padding-block-end: 0.75rem;
}

.settings-card-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.settings-input,
.settings-select,
.settings-textarea {
  font-family: var(--font-family);
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-base);
  inline-size: 100%;
}

.settings-textarea {
  min-block-size: 80px;
  resize: vertical;
  line-height: 1.5;
}

.settings-input:focus,
.settings-select:focus,
.settings-textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background-color: var(--bg-primary);
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--border-color);
  margin-block-start: 1rem;
}

.btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-color), #ec4899);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: all var(--transition-base);
}

.btn-save:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-save:active:not(:disabled) {
  transform: translateY(0);
}

.btn-save:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-save .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  display: none;
}

.btn-save.loading .spinner {
  display: block;
}

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

/* RTL Specific Logical Styles for Settings Form */
[dir="rtl"] .btn-save {
  flex-direction: row-reverse;
}

/* ====================================================================
   SaaS Client Card & Unified activity timeline styling
   ==================================================================== */

/* Sub-Tabs styling */
.client-tab-btn {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-base);
  white-space: nowrap;
}

.client-tab-btn.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.client-tab-btn:hover {
  color: var(--text-primary);
}

/* Bi-directional Logical Timeline stream */
.timeline-stream {
  position: relative;
  padding-inline-start: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.timeline-stream::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  inset-inline-start: 6px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-dot {
  position: absolute;
  inset-inline-start: -26px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 3px solid var(--border-color);
  z-index: 1;
  transition: var(--transition-base);
}

.timeline-item.session .timeline-dot {
  border-color: var(--accent-color);
}

.timeline-item.invoice .timeline-dot {
  border-color: var(--warning-color);
}

.timeline-item.payment .timeline-dot {
  border-color: var(--success-color);
  background-color: var(--success-color);
}

.timeline-content-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Client Ledger clickable Link */
.client-ledger-link {
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-glow);
  cursor: pointer;
  transition: all var(--transition-base);
}

.client-ledger-link:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* Style overrides for active highlighting on client list */
.new-client-highlight {
  border: 2px solid var(--success-color) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
}

.unbilled-session-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-base);
}

.unbilled-session-checkbox-label:hover {
  background-color: var(--bg-primary);
}

/* Logical CSS rules for responsive components */
[dir="rtl"] .back-arrow-icon {
  transform: scaleX(-1);
}

/* ====================================================================
   SaaS Payment Tracking Card & Status indicator styles
   ==================================================================== */
.payment-track-card {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border-inline-start: 6px solid var(--border-color);
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

[dir="rtl"] .payment-track-card {
  border-right: 6px solid var(--border-color);
  border-left: 1px solid var(--border-color);
}

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

/* Vivid, Reassuring Theme Colors for Simple/Anxious Users */
.payment-track-card.state-unpaid {
  border-inline-start-color: var(--danger-color);
  background-color: rgba(239, 68, 68, 0.04);
}
[dir="rtl"] .payment-track-card.state-unpaid {
  border-right-color: var(--danger-color);
}
[data-mode="dark"] .payment-track-card.state-unpaid {
  background-color: rgba(239, 68, 68, 0.08);
}

.payment-track-card.state-partial {
  border-inline-start-color: var(--warning-color);
  background-color: rgba(245, 158, 11, 0.04);
}
[dir="rtl"] .payment-track-card.state-partial {
  border-right-color: var(--warning-color);
}
[data-mode="dark"] .payment-track-card.state-partial {
  background-color: rgba(245, 158, 11, 0.08);
}

.payment-track-card.state-paid {
  border-inline-start-color: var(--success-color);
  background-color: rgba(16, 185, 129, 0.04);
}
[dir="rtl"] .payment-track-card.state-paid {
  border-right-color: var(--success-color);
}
[data-mode="dark"] .payment-track-card.state-paid {
  background-color: rgba(16, 185, 129, 0.08);
}

.payment-track-card.state-overpaid {
  border-inline-start-color: #0ea5e9;
  background-color: rgba(14, 165, 233, 0.04);
}
[dir="rtl"] .payment-track-card.state-overpaid {
  border-right-color: #0ea5e9;
}
[data-mode="dark"] .payment-track-card.state-overpaid {
  background-color: rgba(14, 165, 233, 0.08);
}

/* Overdue Badge & Explanation styling */
.payment-track-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.badge-unpaid {
  background-color: rgba(239, 68, 68, 0.12);
  color: var(--danger-color);
}

.badge-partial {
  background-color: rgba(245, 158, 11, 0.12);
  color: var(--warning-color);
}

.badge-paid {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--success-color);
}

.badge-overpaid {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
}

.payment-track-badge.badge-demand {
  background-color: var(--accent-light);
  color: var(--accent-color);
  border: none;
}

.payment-track-badge.badge-paid-internal {
  background-color: var(--cyan-light);
  color: var(--cyan-color);
  border: none;
}

.payment-track-desc {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.5;
}

.state-unpaid .payment-track-desc { color: var(--danger-color); }
.state-partial .payment-track-desc { color: #d97706; }
.state-paid .payment-track-desc { color: var(--success-color); }
.state-overpaid .payment-track-desc { color: #0369a1; }

.overdue-pulse-indicator {
  display: inline-flex;
  align-items: center;
  background-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  animation: overduePulse 2s infinite ease-in-out;
}

@keyframes overduePulse {
  0% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.98); }
  100% { opacity: 0.95; transform: scale(1); }
}

/* Calm, Neutral Pending State (Unpaid/Partial but not overdue yet) */
.payment-track-card.state-pending {
  border-inline-start-color: var(--text-secondary);
  background-color: rgba(100, 116, 139, 0.04);
}
[dir="rtl"] .payment-track-card.state-pending {
  border-right-color: var(--text-secondary);
}
[data-mode="dark"] .payment-track-card.state-pending {
  background-color: rgba(100, 116, 139, 0.08);
}

.badge-pending {
  background-color: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
}

.state-pending .payment-track-desc {
  color: var(--text-secondary);
}

/* ====================================================================
   Super Friendly Therapist Billing Summary Panel & Reminder Styles
   ==================================================================== */
.friendly-summary-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base) !important;
}
.friendly-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(124, 58, 237, 0.25) !important;
}

#externalUploadContainer {
  transition: border-color var(--transition-base), background-color var(--transition-base), transform var(--transition-base) !important;
}
#externalUploadContainer:hover {
  border-color: var(--accent-color) !important;
  background-color: rgba(124, 58, 237, 0.03) !important;
}
#externalUploadContainer svg {
  transition: color var(--transition-base), transform var(--transition-base) !important;
}
#externalUploadContainer:hover svg {
  color: var(--accent-color) !important;
  transform: translateY(-2px);
}

.timeline-item.reminder .timeline-dot {
  border-color: var(--accent-color) !important;
  background-color: var(--accent-color) !important;
}

/* ====================================================================
   Client Import Wizard & CSV File Uploader Stepper Styles
   ==================================================================== */
.import-stepper {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.stepper-step {
  padding: 0.25rem 0.5rem;
  transition: color var(--transition-base), opacity var(--transition-base);
  opacity: 0.5;
}

.stepper-step.active {
  color: var(--accent-color);
  opacity: 1;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.15rem;
}

#csvDropzone {
  transition: border-color var(--transition-base), background-color var(--transition-base), transform var(--transition-base) !important;
}

#csvDropzone:hover {
  border-color: var(--accent-color) !important;
  background-color: rgba(124, 58, 237, 0.03) !important;
}

#importMappingTableBody tr:hover {
  background-color: var(--bg-tertiary);
}

#importPreviewTableBody tr:hover {
  background-color: var(--bg-tertiary);
}

/* ====================================================================
   Clinical Calendar & Appointment Scheduler Styles
   ==================================================================== */
[dir="rtl"] .calendar-controls button svg {
  transform: scaleX(-1);
}

.calendar-event-card {
  position: absolute;
  inset-inline-start: 4px;
  inset-inline-end: 4px;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), filter var(--transition-base);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  font-family: inherit;
  font-weight: 600;
  text-align: start;
  line-height: 1.25;
  box-sizing: border-box;
}

.calendar-event-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  z-index: 20;
  filter: brightness(0.95);
}

/* Event status colors conforming to Google Calendar API & Outlook */
/* Scheduled (מתוזמן) - Blueberry Blue */
.event-status-scheduled {
  background-color: rgba(63, 81, 181, 0.1);
  border-inline-start: 4px solid #3f51b5;
  color: #3f51b5;
}
[data-mode="dark"] .event-status-scheduled {
  background-color: rgba(63, 81, 181, 0.2);
  color: #7986cb;
}

/* Completed (הושלם) - Basil Green */
.event-status-completed {
  background-color: rgba(11, 128, 67, 0.1);
  border-inline-start: 4px solid #0b8043;
  color: #0b8043;
}
[data-mode="dark"] .event-status-completed {
  background-color: rgba(11, 128, 67, 0.2);
  color: #34a853;
}

/* Late Cancelled / No-Show Billable (היעדרות לחיוב) - Tomato Red */
.event-status-noshow-billable {
  background-color: rgba(213, 0, 0, 0.1);
  border-inline-start: 4px solid #d50000;
  color: #d50000;
}
[data-mode="dark"] .event-status-noshow-billable {
  background-color: rgba(213, 0, 0, 0.2);
  color: #ff5252;
}

/* Excused / No-Show Excused (היעדרות מאושרת) - Graphite Gray */
.event-status-noshow-excused {
  background-color: rgba(97, 97, 97, 0.12);
  border-inline-start: 4px solid #616161;
  color: #616161;
}
[data-mode="dark"] .event-status-noshow-excused {
  background-color: rgba(97, 97, 97, 0.22);
  color: #9e9e9e;
}

/* Form Styles inside Modals */
.reschedule-option-card:hover {
  background-color: var(--bg-primary);
  border-color: var(--accent-color) !important;
}

.reschedule-option-card input[type="radio"]:checked + div span {
  font-weight: 800 !important;
}

/* Calendar View Toggle Segmented Controls */
.btn-view-mode {
  transition: all var(--transition-base);
}
.btn-view-mode:not(.active):hover {
  background: rgba(0,0,0,0.03) !important;
  color: var(--text-primary) !important;
}

/* Month Grid Layout */
.calendar-month-cell {
  background-color: var(--bg-secondary);
  border-block-end: 1px solid var(--border-color);
  border-inline-end: 1px solid var(--border-color);
  padding: 0.4rem;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
  box-sizing: border-box;
  transition: background-color var(--transition-base);
}

.calendar-month-cell:hover {
  background-color: var(--bg-primary);
}

/* Outside month cells */
.calendar-month-cell.month-cell-outside {
  background-color: var(--bg-primary);
  opacity: 0.45;
}

.month-day-number {
  align-self: flex-end;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-block-end: 0.1rem;
}

/* Month Event Badges */
.month-event-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  transition: transform var(--transition-base), filter var(--transition-base);
  border-inline-start-width: 3px;
  border-inline-start-style: solid;
}

.month-event-badge:hover {
  transform: translateY(-0.5px);
  filter: brightness(0.95);
}

.month-badge-scheduled {
  background-color: rgba(63, 81, 181, 0.1);
  border-inline-start-color: #3f51b5;
  color: #3f51b5;
}
[data-mode="dark"] .month-badge-scheduled {
  background-color: rgba(63, 81, 181, 0.2);
  color: #7986cb;
}

.month-badge-completed {
  background-color: rgba(11, 128, 67, 0.1);
  border-inline-start-color: #0b8043;
  color: #0b8043;
}
[data-mode="dark"] .month-badge-completed {
  background-color: rgba(11, 128, 67, 0.2);
  color: #34a853;
}

.month-badge-noshow-billable {
  background-color: rgba(213, 0, 0, 0.1);
  border-inline-start-color: #d50000;
  color: #d50000;
}
[data-mode="dark"] .month-badge-noshow-billable {
  background-color: rgba(213, 0, 0, 0.2);
  color: #ff5252;
}

.month-badge-noshow-excused {
  background-color: rgba(97, 97, 97, 0.12);
  border-inline-start-color: #616161;
  color: #616161;
}
[data-mode="dark"] .month-badge-noshow-excused {
  background-color: rgba(97, 97, 97, 0.22);
  color: #9e9e9e;
}

/* Drag and Drop premium animations & states */
.calendar-event-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base);
  cursor: grab;
}
.calendar-event-card:active {
  cursor: grabbing;
}
.calendar-event-card.dragging {
  opacity: 0.55 !important;
  transform: scale(0.97);
  box-shadow: var(--shadow-lg) !important;
  border: 2px dashed var(--accent-color) !important;
}

.calendar-day-column {
  transition: background-color var(--transition-base);
}

.calendar-month-cell {
  transition: background-color var(--transition-base);
}

.month-event-badge {
  transition: opacity var(--transition-base), transform var(--transition-base);
  cursor: grab;
}
.month-event-badge:active {
  cursor: grabbing;
}

/* ====================================================================
   Calendar (MindBalance Calendar — high-fidelity design)
   All selectors scoped under .cal-page so they don't bleed into other
   tabs. Drawer (.side-drawer) is global because it's reusable.
   ==================================================================== */

.cal-page {
  display: grid;
  grid-template-rows: auto 1fr;
  block-size: 100vh;
  min-block-size: 0;
  overflow: hidden;
  background: var(--bg-primary);
  font-family: var(--font-family);
}
[dir="rtl"] .cal-page { font-family: 'Assistant', 'Rubik', system-ui, sans-serif; }

/* === Header === */
.cal-page .cal-header {
  padding: 22px clamp(20px, 3vw, 36px) 14px;
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
  border-block-end: 1px solid var(--hairline);
  background: var(--bg-primary);
}
.cal-page .cal-title-block {
  display: flex; flex-direction: column; gap: 4px;
  min-inline-size: 200px;
}
.cal-page .cal-eyebrow {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 500;
}
.cal-page .cal-month-title {
  margin: 0;
  font-size: 26px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1;
  display: flex; align-items: baseline; gap: 10px;
  color: var(--text-primary);
}
.cal-page .cal-month-title .cal-year {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  color: var(--text-soft);
  font-size: 22px;
}

.cal-page .cal-nav-cluster,
.cal-page .cal-views {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px;
}
.cal-page .cal-nav-cluster button,
.cal-page .cal-views button {
  border: none; background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .cal-nav-cluster button:hover,
.cal-page .cal-views button:hover { color: var(--text-primary); }
.cal-page .cal-nav-cluster button.is-today {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}
.cal-page .cal-nav-cluster button.cal-refresh-btn {
  min-inline-size: 82px;
}
.cal-page .cal-nav-cluster button.cal-refresh-btn[aria-busy="true"] svg {
  animation: calRefreshSpin 0.9s linear infinite;
}
.cal-page .cal-nav-cluster button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.cal-page .cal-nav-cluster svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cal-page .cal-views button.is-active { background: var(--text-primary); color: var(--bg-primary); }
.cal-page .cal-header-spacer { flex: 1; }

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

.cal-page .cal-search {
  position: relative;
  inline-size: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.cal-page .cal-search:focus-within { border-color: var(--border-color); }
.cal-page .cal-search svg {
  position: absolute; inset-inline-end: 14px; inset-block-start: 50%;
  transform: translateY(-50%); width: 14px; height: 14px;
  stroke: var(--text-soft); fill: none; stroke-width: 1.7; pointer-events: none;
}
.cal-page .cal-search input {
  inline-size: 100%; border: none; background: transparent;
  padding-block: 10px; padding-inline-start: 14px; padding-inline-end: 36px;
  font: 400 13px/1 var(--font-family);
  color: var(--text-primary); outline: none;
}
.cal-page .cal-search input::placeholder { color: var(--text-soft); }

.cal-page .cal-new-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--text-primary); color: var(--bg-primary);
  border: none; border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}
.cal-page .cal-new-btn:hover { background: var(--text-secondary); transform: translateY(-1px); }
.cal-page .cal-new-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* === Body grid === */
.cal-page .cal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  min-block-size: 0;
}

/* === Side rail === */
.cal-page .cal-rail {
  border-inline-end: 1px solid var(--hairline);
  padding: 22px 20px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  background: var(--bg-primary);
}
.cal-page .cal-rail h3 {
  margin: 0 0 10px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
}

/* mini calendar */
.cal-page .mini-cal { font-size: 12px; }
.cal-page .mini-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-block-end: 10px;
}
.cal-page .mini-month { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.cal-page .mini-nav { display: flex; gap: 2px; }
.cal-page .mini-nav button {
  inline-size: 22px; block-size: 22px;
  border: none; background: transparent;
  color: var(--text-soft); cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .mini-nav button:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.cal-page .mini-nav svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.cal-page .mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; user-select: none; touch-action: none; }
.cal-page .mini-dow {
  text-align: center; font-size: 10.5px; color: var(--text-soft);
  padding: 4px 0; font-weight: 600; letter-spacing: 0.04em;
}
.cal-page .mini-day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 11.5px; color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .mini-day:hover { background: var(--bg-tertiary); }
.cal-page .mini-day.is-out { color: var(--text-soft); opacity: 0.4; }
.cal-page .mini-day.is-today { background: var(--accent-light); color: var(--accent-hover); font-weight: 600; }
.cal-page .mini-day.in-week { background: var(--bg-tertiary); color: var(--text-primary); }
.cal-page .mini-day.in-week.is-today { background: var(--accent-color); color: var(--bg-primary); }
.cal-page .mini-day.has-events::after {
  content: ''; position: absolute; inset-block-end: 2px;
  inline-size: 3px; block-size: 3px; border-radius: 50%;
  background: var(--text-soft);
}
.cal-page .mini-day.in-week.has-events::after { background: var(--text-primary); }
.cal-page .mini-day.in-week.is-today.has-events::after { background: var(--bg-primary); }
/* Multi-day range selection (committed + while dragging) */
.cal-page .mini-day.is-selected,
.cal-page .mini-day.is-selecting {
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 0;
  font-weight: 600;
}
.cal-page .mini-day.is-selected.is-today,
.cal-page .mini-day.is-selecting.is-today {
  background: var(--accent-color); color: var(--bg-primary);
}

/* legend */
.cal-page .legend-list { display: flex; flex-direction: column; gap: 8px; }
.cal-page .legend-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 4px;
  border-radius: 6px;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .legend-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.cal-page .legend-swatch {
  inline-size: 10px; block-size: 10px; border-radius: 3px; flex-shrink: 0;
}

/* tweaks */
.cal-page .tweaks-group { display: flex; flex-direction: column; gap: 12px; }
.cal-page .tweak { display: flex; flex-direction: column; gap: 6px; }
.cal-page .tweak-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.cal-page .seg {
  display: flex; gap: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 2px;
}
.cal-page .seg button {
  flex: 1;
  border: none; background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  font: 500 11.5px/1 var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .seg button:hover { color: var(--text-primary); }
.cal-page .seg button.is-active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* === Calendar main wrap === */
.cal-page .cal-wrap {
  overflow: hidden;
  display: flex; flex-direction: column;
  min-inline-size: 0;
}

/* Time-view (day / workweek / week) */
.cal-page .cal-wrap[data-view="month"] .time-view,
.cal-page .cal-wrap[data-view="agenda"] .time-view { display: none; }
.cal-page .cal-wrap[data-view="day"] .time-view,
.cal-page .cal-wrap[data-view="workweek"] .time-view,
.cal-page .cal-wrap[data-view="week"] .time-view,
.cal-page .cal-wrap[data-view="custom"] .time-view { display: flex; flex-direction: column; flex: 1; min-block-size: 0; }

.cal-page .cal-wrap[data-view="month"] .month-view  { display: flex; }
.cal-page .cal-wrap[data-view="agenda"] .agenda-view { display: block; }

/* Day header row */
.cal-page .cal-headrow {
  display: grid;
  grid-template-columns: var(--time-col) repeat(var(--day-count, 7), 1fr);
  border-block-end: 1px solid var(--hairline);
  background: var(--bg-primary);
  position: sticky; inset-block-start: 0; z-index: 5;
}
.cal-page .cal-headrow .corner { border-inline-end: 1px solid var(--hairline); }
.cal-page .day-head {
  padding: 12px 14px;
  border-inline-end: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer;
  transition: background var(--transition-base);
}
.cal-page .day-head:hover { background: var(--bg-secondary); }
.cal-page .day-head:last-child { border-inline-end: none; }
.cal-page .day-head .dow {
  font-size: 11.5px; color: var(--text-soft); font-weight: 500;
  letter-spacing: 0.04em;
}
.cal-page .day-head .dnum {
  font-size: 20px; font-weight: 500; color: var(--text-primary);
  letter-spacing: -0.02em; line-height: 1.1;
}
.cal-page .day-head.is-today .dnum { color: var(--accent-hover); }
.cal-page .day-head.is-today .dnum::before {
  content: ''; display: inline-block;
  inline-size: 6px; block-size: 6px; border-radius: 50%;
  background: var(--accent-color);
  margin-inline-end: 6px;
  vertical-align: middle;
  transform: translateY(-2px);
}
.cal-page .day-head.is-weekend { background: linear-gradient(180deg, hsla(28, 50%, 94%, 0.5), transparent); }
.cal-page .day-head.is-weekend .dow { color: var(--c-clay-stripe); }

/* Time grid */
.cal-page .cal-scroll {
  overflow-y: auto;
  flex: 1;
  background: var(--bg-secondary);
  min-block-size: 0;
}
.cal-page .cal-grid {
  display: grid;
  grid-template-columns: var(--time-col) repeat(var(--day-count, 7), 1fr);
  position: relative;
}

.cal-page .time-col {
  border-inline-end: 1px solid var(--hairline);
  background: var(--bg-primary);
  position: sticky; inset-inline-start: 0; z-index: 2;
}
.cal-page .time-label {
  position: absolute;
  inset-inline: 0;
  transform: translateY(-50%);
  padding: 0 8px;
  font-size: 10.5px;
  line-height: 1;
  color: var(--text-soft);
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.cal-page .time-label:first-child {
  transform: none;
}

.cal-page .day-col {
  border-inline-end: 1px solid var(--hairline);
  position: relative;
  background: var(--bg-primary);
}
.cal-page .day-col:last-child { border-inline-end: none; }
.cal-page .day-col.is-weekend { background: hsl(28 35% 96%); }

.cal-page .day-col .slot {
  block-size: var(--slot-h);
  border-block-end: 1px solid var(--hairline);
  cursor: pointer;
  transition: background var(--transition-base);
  position: relative;
}
.cal-page .day-col .slot.is-half {
  border-block-end-style: dashed;
  border-block-end-color: var(--hairline);
  opacity: 0.7;
}
.cal-page .day-col .slot:hover { background: hsla(108, 16%, 88%, 0.4); }
.cal-page .day-col .slot:hover::after {
  content: '+ פגישה';
  position: absolute; pointer-events: none;
  font-size: 10.5px; color: var(--accent-hover);
  padding: 2px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--accent-light);
  border-radius: 4px;
  margin: 4px;
  z-index: 1;
}
[lang="en"] .cal-page .day-col .slot:hover::after { content: '+ Session'; }

/* Now-line */
.cal-page .now-line {
  position: absolute;
  inset-inline: 0;
  block-size: 1.5px;
  background: var(--c-clay-stripe);
  z-index: 4;
  pointer-events: none;
}
.cal-page .now-line::before {
  content: '';
  position: absolute;
  inset-inline-start: -5px;
  inset-block-start: -4px;
  inline-size: 9px; block-size: 9px;
  border-radius: 50%;
  background: var(--c-clay-stripe);
}

/* Events (time-grid) */
.cal-page .event {
  position: absolute;
  inset-inline: 4px;
  border-radius: var(--event-radius);
  padding: 7px 10px 6px;
  color: hsl(40 8% 16%);
  cursor: pointer;
  z-index: 3;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex; flex-direction: column; gap: 2px;
  background: var(--c-sage);
}
.cal-page .event:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); z-index: 6; }
.cal-page .event .e-time {
  font-size: 10.5px; color: rgba(38,37,34,0.55);
  font-variant-numeric: tabular-nums;
}
.cal-page .event .e-code {
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 5;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(0,0,0,0.34);
  color: #fff;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
  box-shadow: none;
}
.cal-page .event.has-code .e-time,
.cal-page .event.has-code .e-title,
.cal-page .event.has-code .e-meta {
  padding-left: 40px;
}
.cal-page .event .e-title {
  font-size: 13px; font-weight: 600; color: hsl(40 8% 14%);
  letter-spacing: -0.005em; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Resize handles on the top/bottom edge of a time-grid event */
.cal-page .event .e-resize {
  position: absolute;
  inset-inline: 0;
  block-size: 7px;
  cursor: ns-resize;
  z-index: 4;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.cal-page .event .e-resize-top { inset-block-start: -1px; }
.cal-page .event .e-resize-bottom { inset-block-end: -1px; }
.cal-page .event:hover .e-resize { opacity: 1; }
/* subtle grip line so the handle is discoverable on hover */
.cal-page .event:hover .e-resize::after {
  content: '';
  position: absolute;
  inset-inline: 50% auto;
  inline-size: 22px; block-size: 3px;
  transform: translateX(50%);
  border-radius: 999px;
  background: rgba(38,37,34,0.28);
}
.cal-page .event .e-resize-top::after { inset-block-start: 1px; }
.cal-page .event .e-resize-bottom::after { inset-block-end: 1px; }
body.cal-resizing { cursor: ns-resize !important; user-select: none; }
body.cal-resizing .cal-page .event { transition: none; } /* snappy live resize */
.cal-page .event .e-resize { touch-action: none; }      /* don't scroll while resizing on touch */

/* Pointer-based move-drag (mouse + touch) */
.cal-page .event { touch-action: none; }                 /* allow drag-move on touch */
.cal-page .event.is-dragging { opacity: 0.5; box-shadow: var(--shadow-md); }
body.cal-dragging { user-select: none; cursor: grabbing; }

/* Compact events (≤45min) — tighter so text never clips mid-line */
.cal-page .event.is-compact {
  padding: 3px 8px;
  gap: 0;
  justify-content: center;
}
.cal-page .event.is-compact .e-code { top: 2px; font-size: 9px; padding: 1px 4px; }
.cal-page .event.is-compact.has-code .e-time,
.cal-page .event.is-compact.has-code .e-title,
.cal-page .event.is-compact.has-code .e-meta {
  padding-left: 34px;
}
.cal-page .event.is-compact .e-time { font-size: 9.5px; line-height: 1.15; }
.cal-page .event.is-compact .e-title { font-size: 11.5px; line-height: 1.15; }
.cal-page .event .e-meta {
  font-size: 11px; color: rgba(38,37,34,0.6);
  line-height: 1.2;
  display: flex; align-items: center; gap: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-page .event .e-meta svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 1.7; flex-shrink: 0; }
.cal-page .event .e-dot {
  position: absolute;
  inset-block-start: 8px; inset-inline-end: 8px;
  inline-size: 6px; block-size: 6px; border-radius: 50%;
  background: var(--success-color);
  opacity: 0.85;
}
.cal-page .event .e-dot.is-due  { background: var(--warning-color); }
.cal-page .event .e-dot.is-late { background: var(--c-clay-stripe); }
.cal-page .event.is-current {
  z-index: 7;
  box-shadow: 0 0 0 2px hsla(17, 55%, 46%, 0.22), var(--shadow-md);
}
.cal-page .event.is-current::after {
  content: '';
  position: absolute;
  inset-inline: -4px;
  inset-block-start: var(--event-progress, 50%);
  block-size: 2px;
  transform: translateY(-50%);
  background: var(--c-clay-stripe, hsl(17 55% 46%));
  box-shadow: 0 0 0 1px hsla(0, 0%, 100%, 0.65);
  z-index: 7;
  pointer-events: none;
}
.cal-page .event .e-now-pin {
  position: absolute;
  inset-inline-start: -1px;
  inset-block-start: calc(var(--event-progress, 50%) - 5px);
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: var(--c-clay-stripe, hsl(17 55% 46%));
  box-shadow: 0 0 0 3px hsla(17, 55%, 46%, 0.20), 0 1px 3px rgba(38, 37, 34, 0.24);
  z-index: 8;
  pointer-events: none;
}

/* Event color variants — by client */
.cal-page .event[data-color="peach"]  { background: var(--c-peach); }
.cal-page .event[data-color="butter"] { background: var(--c-butter); }
.cal-page .event[data-color="sky"]    { background: var(--c-sky); }
.cal-page .event[data-color="lilac"]  { background: var(--c-lilac); }
.cal-page .event[data-color="sage"]   { background: var(--c-sage); }
.cal-page .event[data-color="teal"]   { background: var(--c-teal); }
.cal-page .event[data-color="clay"]   { background: var(--c-clay); color: hsl(28 30% 20%); }
.cal-page .event[data-color="rose"]   { background: var(--c-rose); }
/* Non-client kinds */
.cal-page .event[data-kind="break"] {
  background: var(--c-break);
  border: 1px dashed rgba(140,120,90,0.4);
  box-shadow: none;
}
.cal-page .event[data-kind="break"] .e-title {
  font-style: italic; color: hsl(40 8% 30%); font-weight: 500;
}
.cal-page .event[data-kind="personal"] {
  background: var(--c-personal);
  border: 1px dashed rgba(120,100,140,0.35);
  box-shadow: none;
}
.cal-page .event[data-kind="personal"] .e-title {
  font-style: italic; color: hsl(270 10% 30%); font-weight: 500;
}
.cal-page .event[data-kind="supervision"] { background: var(--c-supervision); }
.cal-page .event[data-google-color="1"] .e-time,
.cal-page .event[data-google-color="1"] .e-title,
.cal-page .event[data-google-color="1"] .e-meta {
  color: inherit;
}
.cal-page .event[data-google-color="1"] .e-meta {
  opacity: 0.82;
}
.cal-page .event[data-google-color="1"] .e-time {
  opacity: 1;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0,0,0,0.18);
}
.cal-page .event.is-past { opacity: 0.5; }

/* Style tweak: stripe variant */
.cal-page .cal-wrap[data-style="stripe"] .event {
  background: transparent !important;
  box-shadow: none;
  border: none;
  border-inline-start: 3px solid var(--event-stripe, var(--c-sage-stripe));
  padding-inline-start: 10px;
  backdrop-filter: blur(2px);
}
.cal-page .cal-wrap[data-style="stripe"] .event::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--event-radius);
  opacity: 0.55; z-index: -1;
  background: inherit;
}
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="peach"]  { --event-stripe: var(--c-peach-stripe);  background: #FBEADD; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="butter"] { --event-stripe: var(--c-butter-stripe); background: #FBF1D4; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="sky"]    { --event-stripe: var(--c-sky-stripe);    background: #E3ECF3; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="lilac"]  { --event-stripe: var(--c-lilac-stripe);  background: #EBE2F0; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="sage"]   { --event-stripe: var(--c-sage-stripe);   background: #DEE6D7; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="teal"]   { --event-stripe: var(--c-teal-stripe);   background: #D7E3E1; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="clay"]   { --event-stripe: var(--c-clay-stripe);   background: #EFD9C2; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="rose"]   { --event-stripe: var(--c-rose-stripe);   background: #F4DEDE; }

/* Color-by-kind override */
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="regular"]     { background: var(--k-regular); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="long"]        { background: var(--k-long); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="intake"]      { background: var(--k-intake); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="couple"]      { background: var(--k-couple); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="online"]      { background: var(--k-online); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="supervision"] { background: var(--k-supervision); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="break"]       { background: var(--k-break); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="personal"]    { background: var(--k-personal); }

/* Empty-day suggestion */
.cal-page .day-col.is-empty-suggest::before {
  content: '';
  position: absolute;
  inset: 30% 14% 30%;
  border-radius: 18px;
  background: radial-gradient(ellipse at center, hsla(108, 16%, 78%, 0.4), transparent 70%);
  z-index: 1;
  pointer-events: none;
}
.cal-page .empty-pill {
  position: absolute;
  inset-block-start: 42%;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
  font: 500 11.5px/1 var(--font-family);
  color: var(--text-secondary);
  z-index: 2;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
  white-space: nowrap;
}
[dir="rtl"] .cal-page .empty-pill { transform: translateX(50%); }
.cal-page .empty-pill svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.cal-page .empty-pill:hover { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--border-color); }

/* Density tweak */
.cal-page .cal-wrap[data-density="airy"]    { --slot-h: 38px; }
.cal-page .cal-wrap[data-density="compact"] { --slot-h: 22px; }
.cal-page .cal-wrap[data-density="compact"] .day-col .slot:hover::after { display: none; }

/* === Month view === */
.cal-page .month-view {
  display: none;
  flex: 1;
  overflow: auto;
  background: var(--bg-secondary);
  flex-direction: column;
  min-block-size: 0;
}
.cal-page .month-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-block-end: 1px solid var(--hairline);
  background: var(--bg-primary);
  position: sticky; inset-block-start: 0; z-index: 4;
}
.cal-page .month-dow {
  padding: 10px 14px;
  font-size: 11.5px; color: var(--text-soft);
  font-weight: 600; letter-spacing: 0.06em;
  border-inline-end: 1px solid var(--hairline);
}
.cal-page .month-dow:last-child { border-inline-end: none; }
.cal-page .month-dow.is-weekend { color: var(--c-clay-stripe); background: hsl(28 35% 96%); }

.cal-page .month-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(120px, 1fr);
  background: var(--hairline);
  gap: 1px;
}
.cal-page .mcell {
  background: var(--bg-primary);
  padding: 8px 10px;
  display: flex; flex-direction: column;
  gap: 6px;
  min-inline-size: 0;
  min-block-size: 0;
  cursor: pointer;
  transition: background var(--transition-base);
  position: relative;
}
.cal-page .mcell:hover { background: var(--bg-secondary); }
.cal-page .mcell.is-weekend { background: hsl(28 35% 97%); }
.cal-page .mcell.is-weekend:hover { background: hsl(28 35% 95%); }
.cal-page .mcell.is-out { background: var(--bg-secondary); }
.cal-page .mcell.is-out .mcell-num { color: var(--text-soft); opacity: 0.5; }
.cal-page .mcell.is-out .mevent { opacity: 0.45; }

.cal-page .mcell-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-block-end: 2px;
}
.cal-page .mcell-num {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  inline-size: 24px; block-size: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .mcell.is-today .mcell-num {
  background: var(--accent-color); color: var(--bg-primary);
}
.cal-page .mcell-count {
  font-size: 10.5px; color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.cal-page .mevents {
  display: flex; flex-direction: column; gap: 2px;
  min-block-size: 0; overflow: hidden;
}
.cal-page .mevent {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  color: hsl(40 8% 18%);
  cursor: pointer;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: transform var(--transition-base);
  background: var(--c-sage);
}
.cal-page .mevent:hover { transform: translateX(2px); }
[dir="rtl"] .cal-page .mevent:hover { transform: translateX(-2px); }
.cal-page .mevent .me-time {
  font-size: 10.5px; color: rgba(38,37,34,0.55);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.cal-page .mevent .me-title {
  overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}
.cal-page .mevent[data-color="peach"]  { background: var(--c-peach); }
.cal-page .mevent[data-color="butter"] { background: var(--c-butter); }
.cal-page .mevent[data-color="sky"]    { background: var(--c-sky); }
.cal-page .mevent[data-color="lilac"]  { background: var(--c-lilac); }
.cal-page .mevent[data-color="sage"]   { background: var(--c-sage); }
.cal-page .mevent[data-color="teal"]   { background: var(--c-teal); }
.cal-page .mevent[data-color="clay"]   { background: var(--c-clay); }
.cal-page .mevent[data-color="rose"]   { background: var(--c-rose); }
.cal-page .mevent[data-kind="break"]    { background: var(--c-break); font-style: italic; }
.cal-page .mevent[data-kind="personal"] { background: var(--c-personal); font-style: italic; }
.cal-page .mevent[data-kind="supervision"] { background: var(--c-supervision); }
.cal-page .mevent[data-google-color="1"] .me-time,
.cal-page .mevent[data-google-color="1"] .me-title {
  color: inherit;
}
.cal-page .mevent[data-google-color="1"] .me-time { opacity: 0.76; }
.cal-page .mevent.is-past { opacity: 0.5; }
.cal-page .mevent.is-more {
  background: transparent;
  color: var(--text-soft);
  font-weight: 500;
  padding-inline-start: 7px;
}

/* === Agenda view === */
.cal-page .agenda-view {
  display: none;
  flex: 1;
  overflow: auto;
  padding-block: 16px 60px;
  padding-inline: clamp(20px, 4vw, 48px);
}
.cal-page .agenda-list { max-inline-size: 760px; margin: 0 auto; }

.cal-page .agenda-day {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-block-end: 1px solid var(--hairline);
  align-items: flex-start;
}
.cal-page .agenda-day:last-child { border-block-end: 0; }
.cal-page .agenda-day.is-today .agenda-date { color: var(--accent-hover); }
.cal-page .agenda-day.is-weekend .agenda-date small { color: var(--c-clay-stripe); }
.cal-page .agenda-day.is-empty .agenda-items {
  color: var(--text-soft); font-size: 13px; font-style: italic; padding: 6px 0;
}
.cal-page .agenda-date {
  position: sticky; inset-block-start: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-page .agenda-date .ag-dnum {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: 42px; line-height: 1; letter-spacing: -0.02em;
  color: var(--text-primary);
}
.cal-page .agenda-day.is-today .agenda-date .ag-dnum { color: var(--accent-hover); }
.cal-page .agenda-date small {
  font-size: 12px; color: var(--text-soft); letter-spacing: 0.04em;
  text-transform: uppercase; font-weight: 600;
}
.cal-page .agenda-date .ag-month {
  font-size: 12px; color: var(--text-soft);
  margin-block-start: 2px;
}

.cal-page .agenda-items { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
.cal-page .ag-event {
  display: grid;
  grid-template-columns: 86px minmax(0,1fr) auto auto;
  gap: 18px; align-items: center;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-inline-start: 3px solid var(--ag-stripe, var(--c-sage-stripe));
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}
.cal-page .ag-event:hover { background: var(--bg-primary); transform: translateY(-1px); }
.cal-page .ag-event[data-color="peach"]  { --ag-stripe: var(--c-peach-stripe); }
.cal-page .ag-event[data-color="butter"] { --ag-stripe: var(--c-butter-stripe); }
.cal-page .ag-event[data-color="sky"]    { --ag-stripe: var(--c-sky-stripe); }
.cal-page .ag-event[data-color="lilac"]  { --ag-stripe: var(--c-lilac-stripe); }
.cal-page .ag-event[data-color="sage"]   { --ag-stripe: var(--c-sage-stripe); }
.cal-page .ag-event[data-color="teal"]   { --ag-stripe: var(--c-teal-stripe); }
.cal-page .ag-event[data-color="clay"]   { --ag-stripe: var(--c-clay-stripe); }
.cal-page .ag-event[data-color="rose"]   { --ag-stripe: var(--c-rose-stripe); }
.cal-page .ag-event[data-kind="break"],
.cal-page .ag-event[data-kind="personal"] {
  --ag-stripe: hsl(40 8% 70%);
  background: transparent;
  border-style: dashed;
}
.cal-page .ag-event[data-kind="break"] .ag-title,
.cal-page .ag-event[data-kind="personal"] .ag-title {
  font-style: italic; color: var(--text-secondary); font-weight: 500;
}
.cal-page .ag-time {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.cal-page .ag-time small {
  display: block; font-size: 11px; color: var(--text-soft);
  font-weight: 400;
}
.cal-page .ag-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; color: var(--text-primary); }
.cal-page .ag-meta  { font-size: 12px; color: var(--text-soft); margin-block-start: 3px; }
.cal-page .ag-pay {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--success-light); color: var(--success-color);
  font-weight: 500; white-space: nowrap;
}
.cal-page .ag-pay.is-due  { background: var(--warning-light); color: var(--warning-color); }
.cal-page .ag-pay.is-late { background: hsl(20 40% 90%); color: hsl(20 38% 38%); }
.cal-page .ag-pay.is-none { background: transparent; color: transparent; }
.cal-page .ag-event[data-google-color="1"] .ag-time,
.cal-page .ag-event[data-google-color="1"] .ag-title,
.cal-page .ag-event[data-google-color="1"] .ag-meta,
.cal-page .ag-event[data-google-color="1"] .ag-chev {
  color: inherit;
}
.cal-page .ag-event[data-google-color="1"] .ag-time small,
.cal-page .ag-event[data-google-color="1"] .ag-meta {
  color: inherit;
  opacity: 0.76;
}
.cal-page .ag-event[data-google-color="1"] .ag-pay:not(.is-none) {
  background: rgba(255,255,255,0.28);
  color: inherit;
}
.cal-page .ag-event.is-past { opacity: 0.5; }
.cal-page .ag-chev { color: var(--text-soft); display: grid; place-items: center; }
.cal-page .ag-chev svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
[dir="rtl"] .cal-page .ag-chev svg { transform: scaleX(-1); }

/* Responsive */
@media (max-width: 1100px) {
  .cal-page .cal-body { grid-template-columns: 1fr; }
  .cal-page .cal-rail { display: none; }
}
@media (max-width: 700px) {
  .cal-page .month-grid { grid-auto-rows: minmax(82px, 1fr); }
  .cal-page .mcell { padding: 5px 6px; gap: 2px; }
  .cal-page .mcell-num { inline-size: 20px; block-size: 20px; font-size: 11.5px; }
  .cal-page .mevent .me-time { display: none; }
  .cal-page .agenda-day { grid-template-columns: 1fr; gap: 12px; }
  .cal-page .agenda-date { position: static; flex-direction: row; align-items: baseline; gap: 10px; }
  .cal-page .agenda-date .ag-dnum { font-size: 30px; }
  .cal-page .ag-event { grid-template-columns: 70px 1fr auto; }
  .cal-page .ag-event .ag-chev { display: none; }
}

/* ====================================================================
   Reusable side-drawer (global — used by calendar, can be reused elsewhere)
   ==================================================================== */
.side-drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(38, 37, 34, 0.18);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.side-drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
.side-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  inline-size: min(420px, 100vw);
  background: var(--bg-primary);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
[dir="rtl"] .side-drawer { transform: translateX(-100%); }
.side-drawer.is-open { transform: translateX(0) !important; }

.side-drawer .drawer-head {
  padding: 24px 26px 18px;
  border-block-end: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 14px;
}
.side-drawer .drawer-head .drawer-close {
  inline-size: 36px; block-size: 36px;
  margin-inline-start: auto;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: grid; place-items: center;
  transition: background var(--transition-base), color var(--transition-base);
}
.side-drawer .drawer-head .drawer-close:hover {
  background: var(--bg-secondary); color: var(--text-primary);
}
.side-drawer .drawer-head .drawer-close svg {
  width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2;
}
.side-drawer .drawer-avatar {
  inline-size: 48px; block-size: 48px;
  border-radius: 58% 42% 53% 47% / 50% 56% 44% 50%;
  background: var(--c-lilac-solid);
  display: grid; place-items: center;
  font: 600 16px/1 var(--font-family);
  color: hsl(40 10% 18%);
  flex-shrink: 0;
}
.side-drawer .drawer-name {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary);
}
.side-drawer .drawer-sub {
  font-size: 13px; color: var(--text-soft); margin-block-start: 2px;
}
.side-drawer .drawer-body {
  padding: 22px 26px;
  overflow-y: auto;
  flex: 1;
  display: flex; flex-direction: column; gap: 22px;
}
.side-drawer .drawer-field { display: flex; flex-direction: column; gap: 5px; }
.side-drawer .drawer-field-label {
  font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
}
.side-drawer .drawer-field-value {
  font-size: 14.5px; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.side-drawer .drawer-field-value svg {
  width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6;
  color: var(--text-soft);
}
.side-drawer .drawer-field-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.side-drawer .drawer-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 12px; color: var(--text-secondary); font-weight: 500;
}
.side-drawer .drawer-chip .chip-dot {
  inline-size: 6px; block-size: 6px; border-radius: 50%;
  background: var(--success-color);
}
.side-drawer .drawer-chip.is-due  .chip-dot { background: var(--warning-color); }
.side-drawer .drawer-chip.is-late .chip-dot { background: var(--c-clay-stripe); }
.side-drawer .drawer-note {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13.5px; color: var(--text-secondary); line-height: 1.55;
}
.side-drawer .drawer-history-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 6px 0;
  border-block-end: 1px dashed var(--hairline);
  font-size: 12.5px; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.side-drawer .drawer-history-row:last-child { border-block-end: none; }
.side-drawer .drawer-history-row .dh-meta { color: var(--text-soft); font-size: 11.5px; text-align: end; }
.side-drawer .drawer-actions {
  padding: 18px 26px;
  border-block-start: 1px solid var(--hairline);
  display: flex; gap: 10px;
}
.side-drawer .drawer-actions .drawer-btn-soft {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 11px 14px;
  font: 500 13px/1 var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.side-drawer .drawer-actions .drawer-btn-soft:hover {
  background: var(--bg-primary); color: var(--text-primary);
}
.side-drawer .drawer-actions .drawer-btn-primary {
  flex: 1.4;
  background: var(--text-primary); color: var(--bg-primary);
  border: none; border-radius: 999px;
  padding: 11px 14px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base);
}
.side-drawer .drawer-actions .drawer-btn-primary:hover { background: var(--text-secondary); }
.side-drawer .drawer-actions .drawer-btn-danger {
  flex: 1;
  background: transparent; color: var(--warning-color);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 11px 14px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base);
}
.side-drawer .drawer-actions .drawer-btn-danger:hover {
  background: var(--warning-light); border-color: var(--warning-border);
}

/* ====================================================================
   Appointment form + late-reschedule alert (calendar design language)
   These restyle the existing #appointmentFormModal and
   #rescheduleAlertModal dialogs by adding a .cal-modal modifier to them.
   ==================================================================== */

.cal-modal.modal-overlay {
  background: rgba(38, 37, 34, 0.18);
  backdrop-filter: blur(2px);
}
.cal-modal .cal-modal-card {
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  inline-size: min(560px, 95vw);
  max-block-size: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-family);
}
.cal-modal.is-wide .cal-modal-card { inline-size: min(620px, 95vw); }

.cal-modal-head {
  padding: 22px 26px 16px;
  border-block-end: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-primary);
}
.cal-modal-head .cal-modal-eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
  margin-block-end: 4px;
}
.cal-modal-head .cal-modal-title {
  margin: 0;
  font-size: 18px; font-weight: 600; color: var(--text-primary);
  letter-spacing: -0.01em;
}
.cal-modal-head .cal-modal-title-block { flex: 1; min-inline-size: 0; }
.cal-modal-head .cal-modal-close {
  inline-size: 36px; block-size: 36px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: grid; place-items: center;
  transition: background var(--transition-base), color var(--transition-base);
  margin-inline-start: auto;
  flex-shrink: 0;
}
.cal-modal-head .cal-modal-close:hover {
  background: var(--bg-secondary); color: var(--text-primary);
}
.cal-modal-head .cal-modal-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.cal-modal-body {
  padding: 22px 26px;
  overflow-y: auto;
  flex: 1;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-primary);
}

.cal-form-section {
  display: flex; flex-direction: column; gap: 10px;
}
.cal-form-section-title {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
  margin: 0 0 2px;
}
.cal-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cal-form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.cal-form-row.two-one { grid-template-columns: 2fr 1fr; }
.cal-form-field { display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; position: relative; }
.cal-form-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.cal-form-input,
.cal-form-select,
.cal-form-textarea {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition-base), background var(--transition-base);
  inline-size: 100%;
}
.cal-form-input::placeholder,
.cal-form-textarea::placeholder { color: var(--text-soft); }
.cal-form-input:focus,
.cal-form-select:focus,
.cal-form-textarea:focus {
  border-color: var(--accent-color);
  background: var(--bg-primary);
}
.cal-form-textarea { resize: vertical; min-block-size: 64px; font-family: var(--font-family); }
.cal-form-help {
  font-size: 11.5px; color: var(--text-soft); margin-block-start: 2px;
}

/* Kind pill picker */
.cal-kind-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cal-kind-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 12px;
  font: 500 12px/1 var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}
.cal-kind-pill:hover { color: var(--text-primary); }
.cal-kind-pill.is-active {
  background: var(--accent-light);
  border-color: var(--accent-color);
  color: var(--accent-hover);
}
.cal-kind-pill .pill-swatch {
  inline-size: 10px; block-size: 10px; border-radius: 3px;
}

/* Color swatch picker */
.cal-color-swatches {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cal-color-swatch {
  inline-size: 28px; block-size: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--bg-tertiary);
  cursor: pointer;
  padding: 0;
  outline-offset: 2px;
  transition: transform var(--transition-base), border-color var(--transition-base);
}
.cal-color-swatch:hover { transform: scale(1.08); }
.cal-color-swatch.is-active {
  border-color: var(--text-primary);
}
.cal-color-swatch[data-val="auto"] {
  background: linear-gradient(135deg, var(--c-peach) 0%, var(--c-sage) 50%, var(--c-lilac) 100%);
}
.cal-color-swatch[data-val="peach"]  { background: var(--c-peach); }
.cal-color-swatch[data-val="butter"] { background: var(--c-butter); }
.cal-color-swatch[data-val="sky"]    { background: var(--c-sky); }
.cal-color-swatch[data-val="lilac"]  { background: var(--c-lilac); }
.cal-color-swatch[data-val="sage"]   { background: var(--c-sage); }
.cal-color-swatch[data-val="teal"]   { background: var(--c-teal); }
.cal-color-swatch[data-val="clay"]   { background: var(--c-clay); }
.cal-color-swatch[data-val="rose"]   { background: var(--c-rose); }

/* Inline notice (calm replacement for the old red banner) */
.cal-inline-notice {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-light);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--accent-hover);
  font-weight: 500;
}
.cal-inline-notice svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  flex-shrink: 0;
}
.cal-inline-notice-danger {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
  margin-top: 8px;
}

/* Appointment-form day-status slots (free-slot finder via clickable chips) */
.appt-day-slots {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.appt-day-slots-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.appt-day-slots-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.appt-day-slots-sub {
  font-size: 12px; color: var(--text-secondary); margin-top: 2px;
}
.appt-day-slots-hint {
  font-size: 11.5px; color: var(--text-soft);
}
.appt-day-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 6px;
}
.appt-day-slot {
  position: relative;
  font: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.appt-day-slot:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent-color);
}
.appt-day-slot.is-selected {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--accent-on-color, #fff);
}
.appt-day-slot.is-selected .appt-day-slot-sub { color: rgba(255,255,255,0.85); }
.appt-day-slot.is-busy {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.30);
  color: #991b1b;
  cursor: not-allowed;
}
.appt-day-slot.is-busy:hover { background: rgba(220, 38, 38, 0.10); }
.appt-day-slot-time { font-weight: 600; }
.appt-day-slot-sub {
  font-size: 10.5px;
  color: var(--text-soft);
  max-width: 100%;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.appt-day-slot.is-busy .appt-day-slot-sub { color: #991b1b; opacity: 0.85; }

/* Recurrence panel */
.cal-form-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.cal-form-toggle {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-primary);
  cursor: pointer; user-select: none;
}
.cal-form-toggle input[type="checkbox"] {
  inline-size: 16px; block-size: 16px; accent-color: var(--accent-color);
  cursor: pointer;
}

/* Reschedule history list */
.cal-history {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.cal-history-title {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.cal-history-list {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
  max-block-size: 120px; overflow-y: auto;
}

/* Modal footer */
.cal-modal-foot {
  padding: 16px 26px;
  border-block-start: 1px solid var(--hairline);
  display: flex; gap: 10px; align-items: center;
  background: var(--bg-primary);
}
.cal-modal-foot .cal-modal-foot-spacer { flex: 1; }

.cal-btn {
  border: none; cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font: 500 13px/1 var(--font-family);
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
  display: inline-flex; align-items: center; gap: 6px;
}
.cal-btn-primary  { background: var(--text-primary); color: var(--bg-primary); }
.cal-btn-primary:hover { background: var(--text-secondary); transform: translateY(-1px); }
.cal-btn-soft {
  background: var(--bg-secondary); color: var(--text-secondary);
  border: 1px solid var(--hairline);
}
.cal-btn-soft:hover { background: var(--bg-primary); color: var(--text-primary); }
.cal-btn-ghost-danger {
  background: transparent; color: var(--warning-color);
  border: 1px solid transparent;
}
.cal-btn-ghost-danger:hover {
  background: var(--warning-light); border-color: var(--warning-border);
}

/* Late-reschedule policy cards */
.cal-policy-list {
  display: flex; flex-direction: column; gap: 10px;
}
.cal-policy {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base);
}
.cal-policy:hover { background: var(--bg-primary); }
.cal-policy.is-selected {
  background: var(--accent-light);
  border-color: var(--accent-color);
}
.cal-policy input[type="radio"] {
  margin-block-start: 2px;
  accent-color: var(--accent-color);
  flex-shrink: 0;
  cursor: pointer;
}
.cal-policy-body { display: flex; flex-direction: column; gap: 4px; }
.cal-policy-title {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  letter-spacing: -0.005em;
}
.cal-policy-title .pill {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  margin-inline-start: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-color);
  color: var(--bg-primary);
  font-weight: 600;
}
.cal-policy-desc {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.45;
}

.cal-warning-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--warning-color);
}
.cal-warning-banner svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  flex-shrink: 0;
  margin-block-start: 2px;
}
.cal-warning-banner-body { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
.cal-warning-banner-title {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
}
.cal-warning-banner-desc {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
}
.cal-warning-banner-times {
  display: flex; flex-direction: column; gap: 2px;
  margin-block-start: 6px;
  font-size: 12.5px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.cal-warning-banner-times strong { color: var(--text-primary); font-weight: 600; }

/* Suggestions panel for the client search */
.cal-suggestions {
  position: absolute;
  inset-block-start: 100%;
  inset-inline: 0;
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 10;
  max-block-size: 220px;
  overflow-y: auto;
  margin-block-start: 4px;
}
.cal-suggestion {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px; color: var(--text-secondary);
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-suggestion:hover { background: var(--bg-secondary); color: var(--text-primary); }
.cal-suggestion .cs-dot {
  inline-size: 10px; block-size: 10px; border-radius: 50%;
  background: var(--c-sage-solid);
  flex-shrink: 0;
}

/* Search input with leading icon */
.cal-form-search {
  position: relative;
}
.cal-form-search .cal-form-input { padding-inline-end: 36px; }
.cal-form-search-icon {
  position: absolute; inset-inline-end: 12px; inset-block-start: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  stroke: var(--text-soft); fill: none; stroke-width: 1.7;
  pointer-events: none;
}

/* ====================================================================
   Overview / סקירה (dashboard landing) — Claude Design handoff
   Calm KPI overview + today's sessions + contextual aside panel.
   Scoped under .ov-page. Reuses the global tokens.
   ==================================================================== */

.ov-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  block-size: 100vh;
  min-block-size: 0;
  overflow: hidden;
  background: var(--bg-primary);
  font-family: var(--font-family);
}
[dir="rtl"] .ov-page { font-family: 'Assistant', 'Rubik', system-ui, sans-serif; }

/* === Content column === */
.ov-content { padding: 36px 40px 56px; overflow-y: auto; }
.ov-header { margin-block-end: 32px; display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.ov-header-text { flex: 1; min-inline-size: 240px; }
.ov-eyebrow {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 500; margin-block-end: 14px;
}
.ov-title { font-size: 36px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; margin: 0; color: var(--text-primary); }
.ov-sub { font-size: 15px; color: var(--text-secondary); margin-block-start: 10px; max-inline-size: 56ch; line-height: 1.55; }

/* Kept action buttons (calendar sync + create client), calm style */
.ov-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.ov-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px;
  padding: 10px 16px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}
.ov-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ov-btn-soft {
  background: var(--bg-secondary); color: var(--text-secondary);
  border: 1px solid var(--hairline);
}
.ov-btn-soft:hover { background: var(--bg-primary); color: var(--text-primary); }
.ov-btn-primary {
  background: var(--text-primary); color: var(--bg-primary); border: 1px solid var(--text-primary);
}
.ov-btn-primary:hover { background: var(--text-secondary); border-color: var(--text-secondary); transform: translateY(-1px); }

/* === KPI widget grid === */
.ov-widgets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-block-end: 28px; }
.ov-widget {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: border-color var(--transition-base), transform var(--transition-base);
  cursor: pointer;
  text-align: start;
}
.ov-widget:hover { border-color: var(--border-color); }
.ov-widget-label { font-size: 12px; color: var(--text-soft); letter-spacing: 0.04em; font-weight: 500; margin-block-end: 8px; }
.ov-widget-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ov-widget-value.is-accent { color: var(--warning-color); }
.ov-widget-foot { font-size: 12px; color: var(--text-soft); margin-block-start: 6px; }
/* Monthly-billing reminder card: the card itself isn't the click target — it
   holds an explicit action button so the call-to-action is obvious. */
.ov-widget-billing { cursor: default; display: flex; flex-direction: column; }
.ov-widget-billing-btn { margin-block-start: 14px; width: 100%; justify-content: center; }

/* "הצג פירוט" affordance on the open-debt widget — a subtle chip that hints
   the tile is expandable into a per-client breakdown. */
.ov-widget-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-block-start: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warning-color);
  letter-spacing: 0.01em;
}
.ov-widget-cta::after { content: "›"; font-size: 14px; line-height: 1; }
.ov-widget-debt:hover .ov-widget-cta,
.ov-widget-week:hover .ov-widget-cta { text-decoration: underline; }
/* The week tile isn't an alert — use the calm accent, not the debt warning hue. */
.ov-widget-week .ov-widget-cta { color: var(--accent-color, var(--text-soft)); }

/* Monthly-billing explanatory line — tells the therapist which period the run
   consolidates, between the accrued headline and the timing footer. */
.ov-widget-explain {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft);
  margin-block-start: 8px;
}

/* === Open-debt breakdown modal === */
.debt-breakdown-content { gap: 1rem; }
.debt-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-block-size: 52vh;
  overflow-y: auto;
  margin-block: 4px;
}
.debt-breakdown-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
.debt-breakdown-avatar {
  inline-size: 40px;
  block-size: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: hsl(40 10% 24%);
}
.debt-breakdown-avatar.peach  { background: var(--peach); }
.debt-breakdown-avatar.butter { background: var(--butter); }
.debt-breakdown-avatar.sky    { background: var(--sky); }
.debt-breakdown-avatar.lilac  { background: var(--lilac); }
.debt-breakdown-avatar.sage   { background: var(--sage); color: hsl(40 10% 96%); }
.debt-breakdown-info { min-inline-size: 0; }
.debt-breakdown-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.debt-breakdown-meta { font-size: 12px; color: var(--text-soft); margin-block-start: 2px; }
.debt-breakdown-split {
  font-size: 12px;
  color: var(--text-soft);
  margin-block-start: 3px;
  font-variant-numeric: tabular-nums;
}
.debt-breakdown-amount {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.debt-breakdown-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.debt-breakdown-badge.is-over  { background: hsl(4 72% 95%); color: hsl(4 66% 44%); }
.debt-breakdown-badge.is-today { background: hsl(28 80% 94%); color: hsl(28 70% 40%); }
.debt-breakdown-badge.is-soon  { background: var(--bg-tertiary, hsl(40 20% 94%)); color: var(--text-soft); }
.debt-breakdown-badge.is-legacy { background: hsl(260 30% 94%); color: hsl(260 30% 45%); }
.debt-breakdown-badge.is-paid  { background: hsl(140 40% 93%); color: hsl(150 45% 32%); }
.debt-breakdown-badge.is-due   { background: hsl(28 80% 94%); color: hsl(28 70% 40%); }
.debt-breakdown-badge.is-sched { background: var(--bg-tertiary, hsl(40 20% 94%)); color: var(--text-soft); }
.debt-breakdown-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}
.debt-breakdown-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-soft);
  font-size: 14px;
}

/* === Bulk payment reminders modal === */
.bulk-reminder-channel {
  display: flex;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
}
.bulk-reminder-channel-opt {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-md) - 4px);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.bulk-reminder-channel-opt.is-active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.bulk-reminder-selectall {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bulk-reminder-selectall-lbl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.bulk-reminder-count { font-size: 12px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.bulk-reminder-row {
  display: grid;
  grid-template-columns: 22px 40px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
}
.bulk-reminder-cb { inline-size: 18px; block-size: 18px; cursor: pointer; }
.bulk-reminder-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.bulk-reminder-chip.has-link { background: hsl(140 40% 93%); color: hsl(150 45% 32%); }
.bulk-reminder-chip.no-link  { background: var(--bg-tertiary, hsl(40 20% 94%)); color: var(--text-soft); }
.bulk-reminder-field { display: flex; flex-direction: column; gap: 6px; }
.bulk-reminder-lbl { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.bulk-reminder-tokenhelp { font-size: 11px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.bulk-wa-progress {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bulk-wa-status { font-size: 14px; color: var(--text-primary); }
.bulk-wa-note { font-size: 12px; color: var(--text-soft); line-height: 1.5; }
.bulk-wa-actions { display: flex; gap: 8px; margin-block-start: 4px; }
.bulk-wa-list { display: flex; flex-direction: column; gap: 6px; max-block-size: 30vh; overflow-y: auto; }
.bulk-wa-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.bulk-wa-item span { font-size: 12px; color: var(--accent-color, #2f6df6); font-weight: 600; }
.bulk-wa-item:hover { border-color: var(--accent-color, #2f6df6); }

/* === Today section === */
.ov-section { margin-block-start: 36px; }
.ov-section-today { margin-block-start: 0; margin-block-end: 28px; }
.ov-section-title {
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600; margin: 0 0 16px;
}
.ov-today-list { display: flex; flex-direction: column; gap: 2px; }
.ov-today-row {
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base);
  cursor: pointer;
  overflow: hidden;
}
.ov-today-row:hover { background: var(--bg-secondary); }
.ov-today-row.is-current {
  background: hsl(20 45% 96%);
  box-shadow: inset 0 0 0 1px hsla(17, 55%, 46%, 0.34);
}
.ov-today-row.is-current::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-block: 8px;
  inline-size: 3px;
  border-radius: 999px;
  background: var(--c-clay-stripe, hsl(17 55% 46%));
}
.ov-today-row.is-current::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0;
  inline-size: var(--ov-current-progress, 0%);
  block-size: 3px;
  border-radius: 999px;
  background: var(--c-clay-stripe, hsl(17 55% 46%));
}
.ov-today-time { font-size: 14px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ov-today-time small { display: block; font-size: 11px; color: var(--text-soft); font-weight: 400; }
.ov-today-name { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.ov-today-meta { font-size: 12px; color: var(--text-secondary); margin-block-start: 2px; }
.ov-today-empty { font-size: 13px; color: var(--text-soft); font-style: italic; padding: 8px 14px; }
.ov-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  font-weight: 500; letter-spacing: 0.02em; white-space: nowrap;
}
.ov-pill.is-success { background: var(--success-light); color: var(--success-color); }
.ov-pill.is-warn    { background: var(--warning-light); color: var(--warning-color); }
.ov-pill.is-idle    { background: var(--bg-tertiary); color: var(--text-secondary); }

/* === Aside — contextual illustration panel === */
.ov-aside {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-inline-start: 1px solid var(--hairline);
  padding: 36px 32px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.ov-aside > * { position: relative; z-index: 1; }
.ov-aside .illo-stage svg { position: static; }
.ov-aside-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-soft); font-weight: 500; margin-block-end: 14px; }

/* Aside day pager — eyebrow row with prev/next day arrows */
.ov-day-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-end: 14px; }
.ov-day-head .ov-aside-eyebrow { margin-block-end: 0; }
.ov-day-head .ov-aside-eyebrow.is-away { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ov-day-nav {
  flex-shrink: 0;
  gap: 6px;
  padding-inline: 3px;
}
.ov-day-nav .aphorism-next {
  inline-size: 36px; block-size: 36px; padding: 0;
  justify-content: center;
  border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  overflow: visible;
}
.ov-day-nav .aphorism-next:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.ov-day-nav .aphorism-next svg { inline-size: 17px; block-size: 17px; flex: 0 0 auto; }
.ov-day-nav .ov-day-today { inline-size: auto; padding: 0 12px; font-size: 11px; letter-spacing: 0.06em; }
.ov-day-nav .ov-day-today.is-current { opacity: 0.4; pointer-events: none; }

/* Live temperature + condition under the day title */
.ov-day-weather { font-size: 13px; color: var(--text-secondary); margin: -4px 0 8px; min-block-size: 18px; }
.ov-aside-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; color: var(--text-primary); }
.ov-aside-sub { font-size: 14px; color: var(--text-secondary); line-height: 1.55; max-inline-size: 32ch; margin: 0 0 24px; }
.ov-aside-cta {
  align-self: flex-start;
  background: var(--text-primary); color: var(--bg-primary);
  font: 500 13px/1 var(--font-family);
  padding: 12px 20px;
  border: none; border-radius: 999px;
  cursor: pointer; letter-spacing: 0.02em;
  transition: background var(--transition-base), transform var(--transition-base);
  display: inline-flex; align-items: center; gap: 8px;
}
.ov-aside-cta:hover { background: var(--text-secondary); transform: translateY(-1px); }
.ov-aside-cta svg { stroke: currentColor; }
[dir="rtl"] .ov-aside-cta svg { transform: scaleX(-1); }

.ov-aside .illo-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  margin-block-start: 20px; min-block-size: 280px;
}
.ov-aside .illo-stage svg { width: 100%; max-width: 320px; height: auto; }

/* Ambient blobs */
.ov-aside-decor { position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0.55; }
.ov-aside-decor svg { position: absolute; }
.ov-aside-decor .a { inset-block-start: -20px; inset-inline-end: -30px; width: 180px; height: 180px; }
.ov-aside-decor .b { inset-block-end: 80px; inset-inline-start: -40px; width: 140px; height: 140px; }

/* Hidden (non-active) aside variants */
.ov-aside-variant { display: none; flex-direction: column; flex: 1; }
.ov-aside-variant.is-active { display: flex; }

/* === Aside day-view — single-day agenda (replaces the state-driven variants) ===
   The rotating-sun illustration stays on the left as a compact header, with the
   day's sessions listed below it and a calm "open calendar" action pinned last. */
.ov-aside-day .ov-day {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-block-size: 0;
}
.ov-day-title { font-size: 22px; margin-block-end: 14px; }
.ov-aside-day .ov-day-illo.illo-stage {
  flex: 0 0 auto;
  min-block-size: 0;
  max-block-size: 180px;
  margin-block: 2px 14px;
}
.ov-aside-day .ov-day-illo svg { max-width: 210px; }
.ov-day-list {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-y: auto;
  gap: 6px;
  margin-block-end: 18px;
}
.ov-aside-day .ov-today-row {
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
}
.ov-aside-day .ov-today-row:hover { background: var(--bg-primary); }
.ov-aside-day .ov-today-row.is-current,
.ov-aside-day .ov-today-row.is-current:hover {
  background: hsl(20 45% 96%);
  border-color: hsla(17, 55%, 46%, 0.42);
  box-shadow: 0 0 0 2px hsla(17, 55%, 46%, 0.10);
}
.ov-aside-day .ov-today-empty { padding: 4px 2px; }
.ov-day-cta { align-self: stretch; justify-content: center; margin-block-start: auto; }

/* Breather block between sessions — its own calm-green tone so free time reads
   distinctly from booked rows. */
.ov-day-break {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--success-light, hsl(140 32% 94%));
  border: 1px dashed hsl(150 26% 62%);
  color: var(--success-color, hsl(150 34% 34%));
  font-size: 12px;
}
.ov-day-break-label { font-weight: 600; letter-spacing: 0.02em; }
.ov-day-break-dur { opacity: 0.85; font-variant-numeric: tabular-nums; }

/* === Illustration animations === */
@keyframes ov-float-pebble   { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes ov-float-pebble-2 { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes ov-float-pebble-3 { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes ov-spin-slow { to { transform: rotate(360deg); } }
@keyframes ov-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes ov-bob-l { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ov-bob-r { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ov-wave-dash { to { stroke-dashoffset: -40; } }
.ov-peb-1 { animation: ov-float-pebble 6s ease-in-out infinite; transform-origin: center; }
.ov-peb-2 { animation: ov-float-pebble-2 7s ease-in-out infinite -1.5s; transform-origin: center; }
.ov-peb-3 { animation: ov-float-pebble-3 5.5s ease-in-out infinite -0.8s; transform-origin: center; }
.ov-petals { animation: ov-spin-slow 70s linear infinite; transform-origin: 160px 155px; }
.ov-sun    { animation: ov-breathe 7s ease-in-out infinite; transform-origin: 160px 155px; }
.ov-minute { animation: ov-spin-slow 90s linear infinite; transform-origin: 160px 155px; }
.ov-anim-bob-l { animation: ov-bob-l 4.2s ease-in-out infinite; }
.ov-anim-bob-r { animation: ov-bob-r 4.6s ease-in-out infinite -1.4s; }
.ov-anim-wave  { stroke-dasharray: 5 6; animation: ov-wave-dash 2.6s linear infinite; }

/* === Weather illustration family (ov-wx-) — swapped per live weather === */
/* clock (shared by every variant) */
.ov-wx-minute{animation:ov-wx-spin-slow 90s linear infinite;transform-origin:160px 155px}
@keyframes ov-wx-spin-slow{to{transform:rotate(360deg)}}
/* sun */
.ov-wx-sun{animation:ov-wx-breathe 7s ease-in-out infinite;transform-origin:160px 155px}
.ov-wx-petals{animation:ov-wx-spin-slow 70s linear infinite;transform-origin:160px 155px}
@keyframes ov-wx-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.05)}}
/* clouds — three drift speeds, gentle horizontal sway */
.ov-wx-drift-a{animation:ov-wx-drift 16s ease-in-out infinite;transform-origin:center}
.ov-wx-drift-b{animation:ov-wx-drift 22s ease-in-out infinite -4s;transform-origin:center}
.ov-wx-drift-c{animation:ov-wx-drift 28s ease-in-out infinite -9s;transform-origin:center}
@keyframes ov-wx-drift{0%,100%{transform:translateX(-7px)}50%{transform:translateX(7px)}}
/* stars — slow twinkle */
.ov-wx-star{animation:ov-wx-twinkle 4.5s ease-in-out infinite;transform-origin:center}
.ov-wx-star:nth-of-type(2){animation-duration:5.8s;animation-delay:-1.5s}
.ov-wx-star:nth-of-type(3){animation-duration:6.6s;animation-delay:-3s}
.ov-wx-star:nth-of-type(4){animation-duration:5.2s;animation-delay:-2.2s}
.ov-wx-star:nth-of-type(5){animation-duration:7s;animation-delay:-0.7s}
@keyframes ov-wx-twinkle{0%,100%{opacity:.25;transform:scale(.8)}50%{opacity:1;transform:scale(1)}}
/* rain — soft staggered fall */
.ov-wx-drop{animation:ov-wx-fall 1.9s linear infinite}
@keyframes ov-wx-fall{
  0%{transform:translateY(0);opacity:0}
  12%{opacity:.85}
  82%{opacity:.85}
  100%{transform:translateY(64px);opacity:0}
}
/* snow — slower fall with a lateral sway */
.ov-wx-flake{animation:ov-wx-snowfall 6.5s linear infinite}
@keyframes ov-wx-snowfall{
  0%{transform:translate(0,0);opacity:0}
  12%{opacity:.95}
  85%{opacity:.95}
  100%{transform:translate(6px,66px);opacity:0}
}
/* thunder — rare, gentle glow (roughly once / 11s) */
.ov-wx-glow{opacity:0;animation:ov-wx-flash 11s ease-in-out infinite;transform-origin:center}
@keyframes ov-wx-flash{
  0%,86%,100%{opacity:0}
  88%{opacity:.55}
  90%{opacity:.15}
  92%{opacity:.45}
  95%{opacity:0}
}
/* fog — translucent bands sliding across */
.ov-wx-fog-a{animation:ov-wx-fogslide 20s ease-in-out infinite;transform-origin:center}
.ov-wx-fog-b{animation:ov-wx-fogslide 26s ease-in-out infinite -6s;transform-origin:center}
.ov-wx-fog-c{animation:ov-wx-fogslide 32s ease-in-out infinite -13s;transform-origin:center}
@keyframes ov-wx-fogslide{0%,100%{transform:translateX(-16px)}50%{transform:translateX(16px)}}
/* moon phase mechanism — is-phase-0 (new) … is-phase-7 on the illo root */
.ov-wx-ph{display:none}
.is-phase-0 .ov-wx-ph.ph0{display:block}
.is-phase-1 .ov-wx-ph.ph1{display:block}
.is-phase-2 .ov-wx-ph.ph2{display:block}
.is-phase-3 .ov-wx-ph.ph3{display:block}
.is-phase-4 .ov-wx-ph{display:none}       /* full moon — no shadow */
.is-phase-5 .ov-wx-ph.ph5{display:block}
.is-phase-6 .ov-wx-ph.ph6{display:block}
.is-phase-7 .ov-wx-ph.ph7{display:block}

@media (prefers-reduced-motion: reduce) {
  .ov-page *, .ov-page *::before, .ov-page *::after { animation: none !important; transition: none !important; }
}

/* === Responsive === */
@media (max-width: 1100px) {
  .ov-page { grid-template-columns: 1fr; block-size: auto; overflow: visible; }
  .ov-content { overflow: visible; }
  .ov-aside { border-inline-start: none; border-block-start: 1px solid var(--hairline); }
}
@media (max-width: 700px) {
  .ov-widgets { grid-template-columns: 1fr; }
  .ov-content { padding: 28px 20px 48px; }
  .ov-header { flex-direction: column; }
  .ov-title { font-size: 30px; }
}

/* ====================================================================
   Client Card — full-screen detail with animated hero
   Namespace: .cc-*
   ==================================================================== */

:root {
  --cc-peach:  #F2B48B;
  --cc-butter: #F4D58A;
  --cc-sky:    #BFD3E4;
  --cc-lilac:  #C8B6D6;
  --cc-sage:   #8DA386;
  --cc-teal:   #7FA9A4;
  --cc-clay:   #C8956E;
  --cc-deep:   #5C6E5A;
}

.cc-page {
  inline-size: 100%;
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 4px 4px 40px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-inline-size: 0;
}

.cc-breadcrumb {
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: 22px;
}
.cc-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
.cc-breadcrumb a:hover { color: var(--text-primary); }
.cc-breadcrumb svg {
  inline-size: 12px;
  block-size: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
[dir="rtl"] .cc-breadcrumb svg { transform: scaleX(-1); }

/* === Identity row === */
.cc-ident {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-block-end: 22px;
}
.cc-ident-avatar {
  inline-size: 64px;
  block-size: 64px;
  background: var(--cc-lilac);
  border-radius: 58% 42% 53% 47% / 50% 56% 44% 50%;
  display: grid;
  place-items: center;
  color: hsl(40 10% 18%);
  font: 600 20px/1 var(--font-family);
  flex-shrink: 0;
}
.cc-ident-avatar[data-color="peach"] { background: var(--cc-peach); }
.cc-ident-avatar[data-color="sky"]   { background: var(--cc-sky); }
.cc-ident-avatar[data-color="sage"]  { background: var(--cc-sage); color: #FBF7EE; }
.cc-ident-avatar[data-color="butter"] { background: var(--cc-butter); }
.cc-ident-meta { flex: 1; min-inline-size: 0; }
.cc-ident-name {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--text-primary);
}
.cc-ident-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-block-start: 6px;
}
.cc-ident-sub .cc-dot {
  display: inline-block;
  inline-size: 3px;
  block-size: 3px;
  border-radius: 50%;
  background: var(--text-soft);
  opacity: 0.5;
  margin-inline: 8px;
  vertical-align: middle;
}
.cc-ident-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cc-icon-btn {
  inline-size: 38px;
  block-size: 38px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}
.cc-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: var(--bg-primary);
}
.cc-icon-btn svg {
  inline-size: 16px;
  block-size: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
.cc-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: 0;
  border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}
.cc-primary-btn:hover {
  background: var(--text-secondary);
  transform: translateY(-1px);
}
.cc-primary-btn svg { inline-size: 14px; block-size: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* === Hero — animated sea scene === */
.cc-hero {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 24 / 9;
  min-block-size: 240px;
  background: linear-gradient(180deg, #F8D6B5 0%, #FBE7C7 45%, #D5E2EC 70%, #B4CFDB 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: background 1.2s ease;
}
.cc-hero .cc-scene { position: absolute; inset: 0; }
.cc-hero .cc-scene svg { inline-size: 100%; block-size: 100%; display: block; }

@keyframes cc-breathe {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.04); filter: brightness(1.05); }
}
.cc-sun { transform-origin: 980px 160px; animation: cc-breathe 6.5s ease-in-out infinite; }

@keyframes cc-bird-fly {
  0%   { transform: translate(-80px, 0); opacity: 0; }
  8%   { opacity: 1; }
  50%  { transform: translate(420px, -22px); opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translate(880px, -8px); opacity: 0; }
}
.cc-bird { animation: cc-bird-fly 18s linear infinite; transform-origin: center; }

.cc-wave-band {
  position: absolute;
  inset-inline: 0;
  block-size: 60px;
  pointer-events: none;
}
.cc-wave-band svg { inline-size: 200%; block-size: 100%; }
.cc-wave-back  { inset-block-end: 60px; opacity: 0.55; animation: cc-wave-shift 14s linear infinite; }
.cc-wave-mid   { inset-block-end: 30px; opacity: 0.75; animation: cc-wave-shift 9s linear infinite; }
.cc-wave-front { inset-block-end: 0;    opacity: 1;    animation: cc-wave-shift 6s linear infinite; }
@keyframes cc-wave-shift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@keyframes cc-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-6px) rotate(1.5deg); }
}
.cc-boat { transform-origin: center bottom; animation: cc-bob 4.4s ease-in-out infinite; }

@keyframes cc-float-peb {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-5px) rotate(3deg); }
}
.cc-pebbles { opacity: 0; transition: opacity 1s ease; }
.cc-pebble  { animation: cc-float-peb 5.5s ease-in-out infinite; transform-origin: center; }
.cc-pebble:nth-child(2) { animation-duration: 6.2s; animation-delay: -1s; }
.cc-pebble:nth-child(3) { animation-duration: 5s;   animation-delay: -2.4s; }
.cc-pebble:nth-child(4) { animation-duration: 6.8s; animation-delay: -3.1s; }

@keyframes cc-raindrop {
  0%   { transform: translateY(-10px); opacity: 0; }
  20%  { opacity: 0.6; }
  100% { transform: translateY(180px); opacity: 0; }
}
.cc-rain { opacity: 0; transition: opacity 1s ease; }
.cc-rain line { animation: cc-raindrop 1.6s linear infinite; transform-origin: top; }

@keyframes cc-cloud-drift {
  0%   { transform: translateX(-40px); }
  100% { transform: translateX(120px); }
}
.cc-cloud {
  opacity: 0;
  transition: opacity 1s ease;
  animation: cc-cloud-drift 40s linear infinite;
}

.cc-hero .cc-scene,
.cc-hero .cc-wave-band { transition: opacity 0.9s ease; }

@keyframes cc-scroll-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-8px) rotate(3deg); }
}
@keyframes cc-scroll-glow {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.7; }
}
.cc-scroll-note {
  opacity: 0;
  transition: opacity 0.9s ease;
  transform-origin: center;
  animation: cc-scroll-bob 4.5s ease-in-out infinite;
}
.cc-scroll-note .cc-glow { animation: cc-scroll-glow 3s ease-in-out infinite; }

.cc-biome-desert {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.cc-biome-desert svg { inline-size: 100%; block-size: 100%; display: block; }

@keyframes cc-star-twinkle {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
.cc-star { animation: cc-star-twinkle 3.2s ease-in-out infinite; transform-origin: center; }

@keyframes cc-moon-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(244, 229, 200, 0.4)); }
  50%      { filter: drop-shadow(0 0 14px rgba(244, 229, 200, 0.7)); }
}
.cc-moon { animation: cc-moon-glow 6s ease-in-out infinite; }

@keyframes cc-z-float {
  0%   { opacity: 0; transform: translateY(0); }
  25%  { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(-36px); }
}
.cc-z { transform-origin: center; }
.cc-z.cc-z1 { animation: cc-z-float 4.5s ease-out infinite; }
.cc-z.cc-z2 { animation: cc-z-float 4.5s ease-out infinite; animation-delay: 1.5s; }
.cc-z.cc-z3 { animation: cc-z-float 4.5s ease-out infinite; animation-delay: 3.0s; }

/* Per-state overrides */
.cc-hero[data-state="sailing"]  { background: linear-gradient(180deg, #F8D6B5 0%, #FBE7C7 45%, #D5E2EC 70%, #B4CFDB 100%); }
.cc-hero[data-state="sailing"] .cc-bird { opacity: 1; }

.cc-hero[data-state="idle"]     { background: linear-gradient(180deg, #E8CDB0 0%, #ECD9BC 45%, #C9D5DE 70%, #A8C0CC 100%); }
.cc-hero[data-state="idle"] .cc-bird       { opacity: 0; }
.cc-hero[data-state="idle"] .cc-wave-front { animation-duration: 14s; }
.cc-hero[data-state="idle"] .cc-wave-mid   { animation-duration: 20s; }
.cc-hero[data-state="idle"] .cc-wave-back  { animation-duration: 26s; }
.cc-hero[data-state="idle"] .cc-boat       { animation-duration: 9s; }
.cc-hero[data-state="idle"] .cc-sun        { opacity: 0.85; }

.cc-hero[data-state="tobill"]   { background: linear-gradient(180deg, #F8D6B5 0%, #FBE7C7 45%, #D5E2EC 70%, #B4CFDB 100%); }
.cc-hero[data-state="tobill"] .cc-bird        { opacity: 0; }
.cc-hero[data-state="tobill"] .cc-scroll-note { opacity: 1; }
.cc-hero[data-state="tobill"] .cc-boat        { animation-duration: 5s; }

.cc-hero[data-state="pending"]  { background: linear-gradient(180deg, #F2C99F 0%, #F7DBB2 45%, #CEDBE5 70%, #ADC6D3 100%); }
.cc-hero[data-state="pending"] .cc-bird       { opacity: 0; }
.cc-hero[data-state="pending"] .cc-pebbles    { opacity: 1; }
.cc-hero[data-state="pending"] .cc-cloud      { opacity: 0.5; }
.cc-hero[data-state="pending"] .cc-wave-front { animation-duration: 7s; }
.cc-hero[data-state="pending"] .cc-boat       { animation-duration: 4.4s; }

.cc-hero[data-state="drizzle"]  { background: linear-gradient(180deg, #DFC4A8 0%, #DACEB6 45%, #BFCED7 70%, #9AB4C2 100%); }
.cc-hero[data-state="drizzle"] .cc-bird       { opacity: 0; }
.cc-hero[data-state="drizzle"] .cc-pebbles    { opacity: 1; }
.cc-hero[data-state="drizzle"] .cc-rain       { opacity: 0.55; }
.cc-hero[data-state="drizzle"] .cc-cloud      { opacity: 0.8; }
.cc-hero[data-state="drizzle"] .cc-sun        { opacity: 0.7; }
.cc-hero[data-state="drizzle"] .cc-wave-front { animation-duration: 5s; }
.cc-hero[data-state="drizzle"] .cc-boat       { animation-duration: 3.8s; }

.cc-hero[data-state="storm"]    { background: linear-gradient(180deg, #B5A292 0%, #B0B6B0 45%, #8FA4B0 70%, #738F9C 100%); }
.cc-hero[data-state="storm"] .cc-bird       { opacity: 0; }
.cc-hero[data-state="storm"] .cc-pebbles    { opacity: 1; }
.cc-hero[data-state="storm"] .cc-rain       { opacity: 1; }
.cc-hero[data-state="storm"] .cc-cloud      { opacity: 1; }
.cc-hero[data-state="storm"] .cc-sun        { opacity: 0.3; }
.cc-hero[data-state="storm"] .cc-wave-front { animation-duration: 3.5s; }
.cc-hero[data-state="storm"] .cc-wave-mid   { animation-duration: 5s; }
.cc-hero[data-state="storm"] .cc-boat       { animation-duration: 2.6s; }

.cc-hero[data-state="sleeping"] { background: linear-gradient(180deg, #2D3550 0%, #4A4264 45%, #7A6A85 75%, #B89B95 100%); }
.cc-hero[data-state="sleeping"] .cc-scene,
.cc-hero[data-state="sleeping"] .cc-wave-band   { opacity: 0; }
.cc-hero[data-state="sleeping"] .cc-biome-desert { opacity: 1; }

.cc-hero-caption {
  position: absolute;
  inset-block-end: 20px;
  inset-inline-start: 24px;
  z-index: 2;
  background: rgba(251, 247, 238, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 10px 16px;
  border-radius: 999px;
  font: 500 12.5px/1.2 var(--font-family);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-hero-caption .cc-swatch {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--success-color);
}
.cc-hero[data-state="sailing"]  .cc-hero-caption .cc-swatch { background: var(--success-color); }
.cc-hero[data-state="idle"]     .cc-hero-caption .cc-swatch { background: var(--cc-sky); }
.cc-hero[data-state="tobill"]   .cc-hero-caption .cc-swatch { background: var(--cc-butter); }
.cc-hero[data-state="pending"]  .cc-hero-caption .cc-swatch { background: var(--warning-color); }
.cc-hero[data-state="drizzle"]  .cc-hero-caption .cc-swatch { background: var(--cc-clay); }
.cc-hero[data-state="storm"]    .cc-hero-caption .cc-swatch { background: hsl(28 25% 38%); }
.cc-hero[data-state="sleeping"] .cc-hero-caption .cc-swatch { background: var(--cc-lilac); }
.cc-hero[data-state="sleeping"] .cc-hero-caption {
  background: rgba(45, 53, 80, 0.55);
  color: #F4E5C8;
  border-color: rgba(244, 229, 200, 0.25);
}

/* === Quick stats + cards === */
.cc-card {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-sizing: border-box;
  min-inline-size: 0;
}
.cc-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-block-end: 16px;
  gap: 12px;
}
.cc-card-title {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  font-weight: 600;
  margin: 0;
}
.cc-card-link {
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
}
.cc-card-link:hover { color: var(--text-primary); }

.cc-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cc-stat { padding: 10px 0; }
.cc-stat-label {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  margin-block-end: 6px;
}
.cc-stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.cc-stat-value.cc-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 30px;
}
.cc-stat-foot {
  font-size: 12px;
  color: var(--text-soft);
  margin-block-start: 4px;
}

/* === Payment-tracking card === */
.cc-billing-card .cc-card-head {
  align-items: flex-start;
  flex-direction: column;
  gap: 14px;
  margin-block-end: 16px;
}
.cc-billing-head-row {
  display: flex;
  align-items: center;
  gap: 16px;
  inline-size: 100%;
  flex-wrap: wrap;
  min-inline-size: 0;
}
.cc-billing-head-row > .cc-card-title { margin-inline-end: auto; }
.cc-billing-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-soft);
  min-inline-size: 0;
}
.cc-mode-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  min-inline-size: 0;
}
.cc-mode-toggle button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  font: 500 12px/1 var(--font-family);
  color: var(--text-secondary);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.cc-mode-toggle button.active {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.cc-topic-panel {
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 18px;
  box-sizing: border-box;
  min-inline-size: 0;
}
.cc-topic-panel + .cc-topic-panel { margin-block-start: 14px; }
.cc-topic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 14px;
}
.cc-topic-head h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}
.cc-topic-head p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.cc-billing-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  border: 0;
  margin-block-end: 0;
}
.cc-bs-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-inline-size: 0;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.cc-bs-label {
  font-size: 10.5px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}
.cc-bs-value {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.cc-bs-value.cc-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 28px;
  line-height: 1;
}
.cc-bs-value.cc-alert { color: var(--warning-color); }
.cc-bs-value.cc-late  { color: hsl(20 38% 40%); }
.cc-bs-value.cc-muted { color: var(--text-soft); }

.cc-billing-footnote {
  margin-block-start: 14px;
  padding: 11px 14px;
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.cc-billing-footnote svg {
  inline-size: 14px;
  block-size: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  flex-shrink: 0;
  margin-block-start: 2px;
  opacity: 0.7;
}
.cc-billing-footnote strong { color: var(--text-primary); font-weight: 600; }

/* === Per-session billing cards === */
.cc-bsession-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-block-start: 0;
}

.cc-group-invoice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin: 16px 0 4px;
  background: hsl(43 55% 96%);
  border: 1px solid hsl(43 45% 80%);
  border-radius: var(--radius-md);
  position: relative;
}
.cc-gi-icon {
  inline-size: 46px;
  block-size: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: hsl(43 45% 85%);
  color: hsl(43 38% 28%);
  flex-shrink: 0;
}
.cc-gi-icon svg { inline-size: 22px; block-size: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.cc-gi-body { flex: 1; min-inline-size: 0; }
.cc-gi-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.cc-gi-title .cc-num { color: hsl(43 38% 28%); font-variant-numeric: tabular-nums; }
.cc-gi-title .cc-total {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  color: hsl(43 38% 24%);
  letter-spacing: -0.01em;
}
.cc-gi-sub { font-size: 12.5px; color: var(--text-secondary); margin-block-start: 5px; }
.cc-gi-sub strong { color: var(--text-primary); font-weight: 500; }
.cc-gi-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cc-gi-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid hsl(43 45% 75%);
  background: var(--bg-secondary);
  color: hsl(43 38% 28%);
  font: 500 12.5px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.cc-gi-btn:hover { background: hsl(43 50% 90%); }
.cc-gi-btn.cc-primary {
  background: hsl(43 38% 28%);
  color: hsl(43 55% 96%);
  border-color: hsl(43 38% 28%);
}
.cc-gi-btn.cc-primary:hover { background: hsl(43 38% 22%); }
.cc-gi-btn svg { inline-size: 13px; block-size: 13px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.cc-bsession {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 18px;
  border-inline-start: 4px solid var(--hairline);
  position: relative;
  box-sizing: border-box;
  min-inline-size: 0;
}
.cc-bsession.cc-paid     { border-inline-start-color: var(--success-color); }
.cc-bsession.cc-partial  { border-inline-start-color: hsl(28 45% 55%); background: hsl(28 42% 98%); }
.cc-bsession.cc-late     { border-inline-start-color: var(--cc-clay); background: hsl(20 38% 98%); }
.cc-bsession.cc-pending  { border-inline-start-color: var(--warning-color); }
.cc-bsession.cc-awaiting { border-inline-start-color: var(--cc-butter); background: hsl(43 44% 98%); }

.cc-bsession-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-block-end: 14px;
}
.cc-bsession-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.cc-bsession-date {
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  margin-block-start: 5px;
}
.cc-bsession-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.cc-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cc-pill::before {
  content: '';
  inline-size: 5px;
  block-size: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.cc-pill.cc-paid     { background: var(--success-light); color: var(--success-color); }
.cc-pill.cc-partial  { background: hsl(28 50% 92%); color: hsl(28 38% 38%); }
.cc-pill.cc-late     { background: hsl(20 40% 90%); color: hsl(20 38% 38%); }
.cc-pill.cc-pending  { background: var(--warning-light); color: var(--warning-color); }
.cc-pill.cc-awaiting { background: hsl(43 35% 88%); color: hsl(43 38% 30%); }

.cc-bsession-alert {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-block-end: 14px;
  background: hsl(20 44% 96%);
  color: hsl(20 36% 35%);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.5;
}
.cc-bsession-alert.cc-warn { background: var(--warning-light); color: var(--warning-color); }
.cc-bsession-alert.cc-info { background: var(--success-light); color: var(--success-color); }
.cc-bsession-alert svg {
  inline-size: 14px;
  block-size: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
  margin-block-start: 2px;
}
.cc-bsession-alert strong { font-weight: 600; }

.cc-bsession-topic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.cc-session-topic {
  background: hsl(43 40% 97%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-inline-size: 0;
}
.cc-session-topic h4 {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.cc-bsession-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-block-end: 0;
}
.cc-bstat {
  background: var(--bg-secondary);
  padding: 11px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cc-bstat-label {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}
.cc-bstat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.cc-bstat-value.cc-alert { color: var(--cc-clay); }
.cc-bstat-value.cc-warn  { color: var(--warning-color); }
.cc-bstat-value.cc-good  { color: var(--success-color); }
.cc-bstat-value.cc-muted { color: var(--text-soft); font-weight: 500; }

.cc-bsession-terms {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-block: 12px 14px;
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: hsl(43 40% 97%);
}
.cc-bsession-terms strong { color: var(--text-secondary); font-weight: 500; }

.cc-bsession-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  inline-size: 100%;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px;
  font: 500 13.5px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base);
}
.cc-bsession-action:hover { background: var(--accent-hover); }
.cc-bsession-action svg { inline-size: 14px; block-size: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cc-bsession-action.cc-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--hairline);
}
.cc-bsession-action.cc-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.cc-bsession-action.cc-warn { background: var(--warning-color); }
.cc-bsession-action.cc-warn:hover { background: hsl(28 35% 42%); }

.cc-bsession-actions-row { display: flex; gap: 8px; }
.cc-bsession-actions-row .cc-bsession-action { flex: 1; }

.cc-bsession-receipts {
  margin-block-start: 14px;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--border-color);
}
.cc-bsession-receipts-title {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  margin-block-end: 8px;
  text-transform: uppercase;
}
.cc-bsession-receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-block: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.cc-bsession-receipt-row .cc-method { color: var(--text-primary); }
.cc-bsession-receipt-row .cc-amt    { color: var(--success-color); font-weight: 500; }
.cc-bsession-receipt-row.cc-refund .cc-amt { color: var(--cc-clay); }

/* === Body grid === */
.cc-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 22px;
  margin-block-start: 22px;
}
.cc-body-main { display: flex; flex-direction: column; gap: 22px; }
.cc-body-aside { display: flex; flex-direction: column; gap: 22px; }

.cc-timeline { position: relative; padding-inline-start: 18px; }
.cc-timeline::before {
  content: '';
  position: absolute;
  inset-block: 6px;
  inset-inline-start: 5px;
  inline-size: 1.5px;
  background: var(--hairline);
}
.cc-tl-item {
  position: relative;
  padding-block: 10px;
  padding-inline-start: 14px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: baseline;
}
.cc-tl-item::before {
  content: '';
  position: absolute;
  inset-block-start: 18px;
  inset-inline-start: -4px;
  inline-size: 9px;
  block-size: 9px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--accent-color);
}
.cc-tl-item.cc-upcoming::before {
  border-style: dashed;
  background: var(--bg-primary);
}
.cc-tl-date {
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.cc-tl-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}
.cc-tl-text .cc-note {
  color: var(--text-soft);
  font-size: 13px;
  display: block;
  margin-block-start: 2px;
}
.cc-tl-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
}
.cc-tl-tag.cc-paid { background: var(--success-light); color: var(--success-color); }
.cc-tl-tag.cc-due  { background: var(--warning-light); color: var(--warning-color); }

.cc-note-pad {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.cc-note-pad p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.cc-note-pad p + p { margin-block-start: 10px; }
.cc-note-meta {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-block-start: 14px;
}

.cc-aside-status {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.cc-aside-status .cc-stat-amount {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  color: var(--text-primary);
}
.cc-aside-status .cc-stat-foot {
  margin-block-start: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.cc-aside-status .cc-stat-cta {
  margin-block-start: 14px;
  display: block;
  inline-size: 100%;
  border: 1px solid var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 999px;
  padding: 10px 14px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: opacity var(--transition-base);
}
.cc-aside-status .cc-stat-cta:hover { opacity: 0.85; }
.cc-aside-status .cc-stat-cta.cc-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px dashed var(--border-color);
}

.cc-contact-row { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: var(--text-secondary); }
.cc-contact-row > div span.cc-contact-label {
  color: var(--text-soft);
  display: block;
  font-size: 11.5px;
  margin-block-end: 3px;
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .cc-hero,
  .cc-hero *,
  .cc-hero *::before,
  .cc-hero *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* === Responsive === */
@media (max-width: 1100px) {
  .cc-body-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .cc-ident { flex-wrap: wrap; }
  .cc-ident-actions { inline-size: 100%; justify-content: flex-end; }
}
@media (max-width: 700px) {
  .cc-page { max-inline-size: 100%; padding-inline: 0; }
  .cc-card { padding: 16px; }
  .cc-billing-head-row { flex-direction: column; align-items: stretch; }
  .cc-billing-head-row > .cc-card-title { margin-inline-end: 0; }
  .cc-billing-mode { flex-wrap: wrap; align-items: flex-start; }
  .cc-mode-toggle { flex-wrap: wrap; border-radius: var(--radius-sm); }
  .cc-mode-toggle button { flex: 1 1 auto; }
  .cc-billing-summary { grid-template-columns: 1fr; }
  .cc-topic-panel { padding: 14px; }
  .cc-group-invoice { flex-direction: column; align-items: flex-start; }
  .cc-gi-actions { inline-size: 100%; }
  .cc-gi-btn { flex: 1; justify-content: center; }
  .cc-bsession { padding: 16px; }
  .cc-bsession-head { flex-direction: column; gap: 10px; }
  .cc-bsession-pills { justify-content: flex-start; }
  .cc-bsession-topic-grid { grid-template-columns: 1fr; }
  .cc-bstat { padding: 10px 6px; }
  .cc-bstat-value { font-size: 14px; }
  .cc-bsession-actions-row { flex-direction: column; }
  .cc-ident-name { font-size: 26px; }
  .cc-stat-row { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .cc-bsession-stats { grid-template-columns: 1fr; }
  .cc-bstat {
    text-align: start;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .cc-bstat-label,
  .cc-bstat-value {
    min-inline-size: 0;
  }
  .cc-bstat-label {
    overflow-wrap: anywhere;
  }
  .cc-bstat-value {
    white-space: nowrap;
  }
}

/* ========================================================================
   Client Directory — "Living Connections" (cd-living)
   ======================================================================== */
.client-directory-container.cd-living {
  max-inline-size: 1100px;
  margin-inline: auto;
  padding-block: 4px 24px;
}

.cd-living .cd-header { margin-block-end: 28px; }
.cd-living .cd-eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
  margin-block-end: 14px;
}
.cd-living .cd-title {
  font-family: var(--font-family);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-primary);
}
.cd-living .cd-title-num {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 56px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.cd-living .cd-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 12px 0 0;
  max-inline-size: 50ch;
  line-height: 1.6;
}

/* Toolbar */
.cd-living .cd-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  flex-wrap: wrap;
}
.cd-living .cd-search {
  flex: 1 1 280px;
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: border-color var(--transition-base);
  display: block;
}
.cd-living .cd-search:focus-within { border-color: var(--border-color); }
.cd-living .cd-search svg {
  position: absolute;
  inset-inline-end: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-soft);
  fill: none;
  stroke-width: 1.7;
  pointer-events: none;
}
.cd-living .cd-search input {
  width: 100%;
  border: none;
  background: transparent;
  padding-block: 12px;
  padding-inline-start: 18px;
  padding-inline-end: 42px;
  font: 400 14px/1 var(--font-family);
  color: var(--text-primary);
  outline: none;
  text-align: start;
}
.cd-living .cd-search input::placeholder { color: var(--text-soft); }
[dir="ltr"] .cd-living .cd-search svg {
  inset-inline-end: auto;
  inset-inline-start: 16px;
}
[dir="ltr"] .cd-living .cd-search input {
  padding-inline-start: 42px;
  padding-inline-end: 18px;
}

.cd-living .cd-filters {
  display: flex;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px;
}
.cd-living .cd-filters button {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cd-living .cd-filters button:hover { color: var(--text-primary); }
.cd-living .cd-filters button.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.cd-living .cd-filters .cd-count {
  color: var(--text-soft);
  font-weight: 400;
  font-size: 12px;
}
.cd-living .cd-filters button.active .cd-count { color: var(--text-secondary); }

.cd-living .cd-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}
.cd-living .cd-new-btn:hover {
  background: var(--text-secondary);
  transform: translateY(-1px);
}
.cd-living .cd-new-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.cd-living .cd-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cd-living .cd-import-btn,
.cd-living .cd-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}
.cd-living .cd-import-btn:hover,
.cd-living .cd-refresh-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}
.cd-living .cd-import-btn svg,
.cd-living .cd-refresh-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
.cd-living .cd-refresh-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

/* Groups */
.cd-living .cd-group { margin-block-start: 28px; }
.cd-living .cd-group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-block-end: 10px;
  padding-inline: 6px;
  flex-wrap: wrap;
}
.cd-living .cd-group-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
  margin: 0;
}
.cd-living .cd-group-hint {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 400;
}

.cd-living .cd-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Row */
.cd-living .cd-row {
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 48px minmax(0, 1.5fr) minmax(96px, 0.7fr) minmax(130px, 0.9fr) 22px;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-base);
  background: transparent;
  border: none;
  inline-size: 100%;
  text-align: start;
  font-family: var(--font-family);
}
.cd-living .cd-row:hover { background: var(--bg-secondary); }
.cd-living .cd-row:hover .cd-chev { opacity: 1; transform: translateX(0); }

/* Avatar — organic blob */
.cd-living .cd-avatar {
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  font: 600 14px/1 var(--font-family);
  color: hsl(40 10% 18%);
  background: var(--peach);
  position: relative;
  flex-shrink: 0;
  border-radius: 58% 42% 53% 47% / 50% 56% 44% 50%;
}
.cd-living .cd-avatar.peach  { background: var(--peach); }
.cd-living .cd-avatar.butter { background: var(--butter); }
.cd-living .cd-avatar.sky    { background: var(--sky); }
.cd-living .cd-avatar.lilac  { background: var(--lilac); }
.cd-living .cd-avatar.sage   { background: var(--sage); color: hsl(40 10% 96%); }
.cd-living .cd-avatar.teal   { background: var(--teal); color: hsl(40 10% 96%); }
.cd-living .cd-avatar.clay   { background: var(--clay); color: hsl(40 10% 96%); }

.cd-living .cd-name {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.cd-living .cd-row-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-block-start: 3px;
}
.cd-living .cd-row-sub .cd-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-soft);
  opacity: 0.5;
  margin-inline: 8px;
  vertical-align: middle;
}

.cd-living .cd-cadence {
  font-size: 13px;
  color: var(--text-secondary);
}
.cd-living .cd-cadence-em {
  color: var(--text-primary);
  font-weight: 500;
}

/* Grid column headers — aligned to the same template as .cd-row */
.cd-living .cd-grid-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.5fr) minmax(96px, 0.7fr) minmax(130px, 0.9fr) 22px;
  gap: 18px;
  align-items: end;
  padding: 4px 14px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
}
.cd-living .cd-grid-head .cdh-money { text-align: end; }

/* Money columns — debt + paid-this-month (with optional in-bank note) */
.cd-living .cd-debt,
.cd-living .cd-paid {
  text-align: end;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.cd-living .cd-debt-v {
  font-size: 15px;
  font-weight: 700;
  color: var(--clay, #b0603f);
}
.cd-living .cd-paid-v {
  font-size: 15px;
  font-weight: 600;
  color: var(--sage, #4c7a4c);
}
.cd-living .cd-money-zero { color: var(--text-soft); opacity: 0.6; font-weight: 500; }
.cd-living .cd-paid-bank {
  font-size: 11.5px;
  color: var(--teal, #2f7d78);
  font-weight: 600;
}
.cd-living .cd-next-inline {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-block-start: 3px;
  font-variant-numeric: tabular-nums;
}
.cd-living .cd-next-inline strong { color: var(--text-secondary); font-weight: 600; }

/* Billing column — four compact label/value lines */
.cd-living .cd-billing {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.cd-living .cdb-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.cd-living .cdb-k { color: var(--text-soft); }
.cd-living .cdb-v { color: var(--text-secondary); font-weight: 500; }
.cd-living .cdb-v.cdb-zero { color: var(--text-soft); opacity: 0.55; font-weight: 400; }
.cd-living .cdb-paid .cdb-v:not(.cdb-zero) { color: var(--sage, #4c7a4c); }
.cd-living .cdb-bank .cdb-k { color: var(--text-secondary); }
.cd-living .cdb-bank .cdb-v:not(.cdb-zero) { color: var(--teal, #2f7d78); font-weight: 600; }
.cd-living .cdb-bal {
  margin-block-start: 3px;
  padding-block-start: 4px;
  border-block-start: 1px solid var(--border-soft, rgba(76,99,76,0.12));
}
.cd-living .cdb-bal .cdb-k { color: var(--text-secondary); font-weight: 600; }
.cd-living .cdb-bal .cdb-v { font-weight: 700; color: var(--text-primary); }
.cd-living .cdb-bal .cdb-v:not(.cdb-zero) { color: var(--clay, #b0603f); }
.cd-living .cdb-bal .cdb-v.cdb-zero { color: var(--text-soft); font-weight: 500; }

/* Refresh button — matches the toolbar action buttons */
.cd-living .cd-refresh-btn svg {
  transition: transform var(--transition-base);
}
.cd-living .cd-refresh-btn.is-loading svg {
  animation: cd-spin 0.8s linear infinite;
}
@keyframes cd-spin { to { transform: rotate(360deg); } }

.cd-living .cd-next {
  text-align: end;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-inline-size: 110px;
}
.cd-living .cd-next .cd-day {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}
.cd-living .cd-next .cd-time {
  color: var(--text-soft);
  margin-block-start: 2px;
}

.cd-living .cd-chev {
  width: 22px;
  height: 22px;
  color: var(--text-soft);
  opacity: 0;
  transition: opacity var(--transition-base), transform var(--transition-base);
  transform: translateX(4px);
}
[dir="rtl"] .cd-living .cd-chev { transform: translateX(-4px); }
.cd-living .cd-chev svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

/* Inline status pill */
.cd-living .cd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 11px/1 var(--font-family);
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  margin-inline-start: 8px;
  vertical-align: middle;
}
.cd-living .cd-pill.new   { background: var(--success-light); color: var(--success-color); }
.cd-living .cd-pill.care  { background: var(--warning-light); color: var(--warning-color); }
.cd-living .cd-pill.pause { background: var(--bg-tertiary); color: var(--text-soft); }
.cd-living .cd-calendar-code {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 8px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-hover);
  font: 700 11px/1 var(--font-family);
  vertical-align: middle;
}

/* Resting group — muted */
.cd-living .cd-group.cd-resting .cd-row { opacity: 0.78; }
.cd-living .cd-group.cd-resting .cd-row:hover { opacity: 1; }
.cd-living .cd-group.cd-resting .cd-name { font-weight: 500; }

/* Active editing highlight on a row */
.cd-living .cd-row.cd-active-edit {
  background: var(--accent-light);
  box-shadow: inset 0 0 0 1px var(--border-color);
}

/* Active client highlight (newly created) — gentle pulse */
.cd-living .cd-row.cd-new-highlight {
  animation: cdRowFlash 1.6s ease-out 1;
}
@keyframes cdRowFlash {
  0%   { background: var(--accent-light); }
  100% { background: transparent; }
}

/* Soft footer note */
.cd-living .cd-leaf-note {
  margin-block-start: 56px;
  padding: 18px 22px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
  max-inline-size: 720px;
}
.cd-living .cd-leaf-note .cd-leaf {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Empty state inside the directory */
.cd-living .cd-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}
.cd-living .cd-empty strong {
  display: block;
  color: var(--text-secondary);
  font-weight: 600;
  margin-block-end: 6px;
}

@media (max-width: 820px) {
  .cd-living .cd-row {
    grid-template-columns: 40px minmax(0, 1fr) auto auto;
    gap: 10px 12px;
    align-items: center;
  }
  /* Chevron is the 5th cell — hiding it drops the row back to 4 columns:
     avatar · name · debt · paid. */
  .cd-living .cd-cadence,
  .cd-living .cd-chev { display: none; }
  .cd-living .cd-debt-v,
  .cd-living .cd-paid-v { font-size: 14px; }
  .cd-living .cd-title { font-size: 32px; }
  .cd-living .cd-title-num { font-size: 44px; }
}

/* ========================================================================
   Daily Quote — "פתגם היום" (overview content column, after "היום")
   ======================================================================== */
.daily-quote {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 24px 22px;
  margin-block-start: 28px;
  margin-block-end: 14px;
  overflow: hidden;
  transition: background var(--transition-base), border-color var(--transition-base);
}
.daily-quote[hidden] { display: none; }

.daily-quote .dq-mark {
  font-family: var(--font-serif);
  font-size: 72px;
  line-height: 0.6;
  color: var(--peach);
  opacity: 0.6;
  margin-block-start: 6px;
  user-select: none;
}
.daily-quote .dq-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-block-end: 12px;
}
.daily-quote .dq-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  font-weight: 600;
}
.daily-quote .dq-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-hover);
  display: none;
}
.daily-quote .dq-text {
  font-family: var(--font-serif);
  font-size: 24px;
  font-style: italic;
  line-height: 1.45;
  color: var(--text-primary);
  margin: 0;
  text-wrap: pretty;
}
.daily-quote .dq-author {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, var(--text-soft));
  margin-block-start: 14px;
  letter-spacing: 0.01em;
}
.daily-quote .dq-author::before {
  content: '— ';
  opacity: 0.6;
}
.daily-quote .dq-author:empty { display: none; }
.daily-quote .dq-author:empty::before { content: none; }

/* holiday tints — one theme per occasion */
.daily-quote.is-holiday .dq-badge { display: inline-block; }

.daily-quote.h-honey {
  background: linear-gradient(180deg, hsl(36 62% 94%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(36 48% 80%);
}
.daily-quote.h-honey .dq-mark { color: hsl(28 55% 58%); }
.daily-quote.h-honey .dq-badge { background: hsl(36 60% 88%); color: hsl(28 45% 36%); }

.daily-quote.h-sky {
  background: linear-gradient(180deg, hsl(208 45% 94%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(208 38% 80%);
}
.daily-quote.h-sky .dq-mark { color: hsl(208 45% 58%); }
.daily-quote.h-sky .dq-badge { background: hsl(208 48% 88%); color: hsl(208 42% 36%); }

.daily-quote.h-slate {
  background: linear-gradient(180deg, hsl(220 24% 94%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(220 18% 82%);
}
.daily-quote.h-slate .dq-mark { color: hsl(220 20% 60%); }
.daily-quote.h-slate .dq-badge { background: hsl(220 22% 88%); color: hsl(220 22% 38%); }

.daily-quote.h-gold {
  background: linear-gradient(180deg, hsl(45 72% 92%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(45 55% 78%);
}
.daily-quote.h-gold .dq-mark { color: hsl(43 70% 50%); }
.daily-quote.h-gold .dq-badge { background: hsl(45 66% 85%); color: hsl(40 55% 33%); }

.daily-quote.h-blue {
  background: linear-gradient(180deg, hsl(210 55% 93%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(210 45% 78%);
}
.daily-quote.h-blue .dq-mark { color: hsl(212 58% 55%); }
.daily-quote.h-blue .dq-badge { background: hsl(210 55% 86%); color: hsl(212 52% 36%); }

.daily-quote.h-rose {
  background: linear-gradient(180deg, hsl(345 56% 95%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(345 40% 84%);
}
.daily-quote.h-rose .dq-mark { color: hsl(345 55% 65%); }
.daily-quote.h-rose .dq-badge { background: hsl(345 50% 90%); color: hsl(345 45% 42%); }

.daily-quote.h-sage {
  background: linear-gradient(180deg, hsl(108 30% 93%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(108 24% 78%);
}
.daily-quote.h-sage .dq-mark { color: hsl(108 24% 48%); }
.daily-quote.h-sage .dq-badge { background: hsl(108 28% 86%); color: hsl(108 26% 30%); }

@media (max-width: 820px) {
  .daily-quote { padding: 18px 18px 20px; gap: 14px; }
  .daily-quote .dq-mark { font-size: 56px; }
  .daily-quote .dq-text { font-size: 20px; }
}

/* ========================================================================
   Aphorism Feedback — interactive daily-quote with thumbs + reasons +
   source-picker. Drop-in from design/_inbox/design_handoff_aphorism_feedback
   (2026-05-31). Wired to mindbalance.aphorisms + aphorism_feedback +
   aphorism_source_preferences.
   ======================================================================== */

/* --- Card --- */
.aphorism-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline, var(--border-color));
  border-radius: var(--radius-md);
  padding: 22px 24px 16px;
  margin-block-start: 28px;
  margin-block-end: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base), opacity var(--transition-base);
  overflow: hidden;
}
.aphorism-card[hidden] { display: none; }
.aphorism-card::before {
  content: '”';
  position: absolute;
  inset-block-start: -18px;
  inset-inline-start: 16px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 96px;
  line-height: 1;
  color: var(--accent-color);
  opacity: 0.10;
  pointer-events: none;
}
.aphorism-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.aphorism-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-block-end: 14px; position: relative; z-index: 1;
}
.aphorism-card-eyebrow {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-soft, var(--text-secondary)); font-weight: 600;
}
.aphorism-nav {
  display: inline-flex; align-items: center; gap: 2px;
}
.aphorism-next {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-soft, var(--text-secondary)); font-weight: 500;
  background: none; border: none; padding: 4px 6px; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base);
}
.aphorism-next:hover { color: var(--text-secondary); background: var(--bg-tertiary); }
.aphorism-next svg { inline-size: 13px; block-size: 13px; }

.aphorism-body { position: relative; z-index: 1; transition: opacity 0.3s ease; }
.aphorism-card.is-loading .aphorism-body { opacity: 0; }

.aphorism-card-text {
  font-size: 1.4rem; line-height: 1.6; font-weight: 500;
  color: var(--text-primary); margin: 0; text-wrap: pretty;
}
.aphorism-card-en {
  font-size: 0.85rem; line-height: 1.55; color: var(--text-secondary);
  margin-block-start: 10px; text-wrap: pretty;
}
.aphorism-card-en.is-hidden { display: none; }
.aphorism-toggle-en {
  background: none; border: none; padding: 0; margin-block-start: 8px;
  font-size: 12px; color: var(--text-soft, var(--text-secondary)); font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.aphorism-toggle-en:hover { color: var(--text-secondary); }
.aphorism-card-meta {
  font-size: 13px; color: var(--text-soft, var(--text-secondary));
  margin-block-start: 14px; font-weight: 500;
}

.aphorism-action-row {
  display: flex; align-items: center; gap: 8px;
  margin-block-start: 18px; padding-block-start: 14px;
  border-block-start: 1px solid var(--hairline, var(--border-color));
  position: relative; z-index: 1;
}
.aphorism-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  block-size: 38px; min-inline-size: 38px; padding-inline: 11px;
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid transparent; border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}
.aphorism-action-btn svg { inline-size: 17px; block-size: 17px; }
.aphorism-action-btn:hover { transform: translateY(-1px); }
.aphorism-action-btn .btn-label {
  max-inline-size: 0; overflow: hidden; white-space: nowrap;
  opacity: 0; transition: max-inline-size var(--transition-base), opacity var(--transition-base);
}
.aphorism-action-btn.is-selected .btn-label { max-inline-size: 120px; opacity: 1; }
.aphorism-action-btn.up.is-selected     { background: var(--accent-color); color: #fff; }
.aphorism-action-btn.down.is-selected   { background: var(--warning-color); color: #fff; }
.aphorism-action-btn.snooze.is-selected { background: var(--text-secondary); color: var(--bg-secondary); }
.aphorism-spacer { flex: 1; }

/* Snoozed placeholder */
.aphorism-card.is-snoozed .aphorism-body,
.aphorism-card.is-snoozed .aphorism-action-row { display: none; }
.aphorism-snoozed {
  display: none; flex-direction: column; align-items: flex-start; gap: 10px;
  padding-block: 18px 8px; position: relative; z-index: 1;
}
.aphorism-card.is-snoozed .aphorism-snoozed { display: flex; }
.aphorism-card.is-snoozed { opacity: 0.55; }
.aphorism-snoozed-text { font-size: 1.05rem; font-weight: 500; color: var(--text-secondary); }
.aphorism-restore {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--accent-color);
  text-decoration: underline; text-underline-offset: 2px;
}
.aphorism-restore:hover { color: var(--accent-hover); }

/* Empty feed (all sources off) */
.aphorism-empty { display: none; padding-block: 6px 8px; position: relative; z-index: 1; }
.aphorism-card.is-empty .aphorism-body,
.aphorism-card.is-empty .aphorism-action-row { display: none; }
.aphorism-card.is-empty .aphorism-empty { display: block; }
.aphorism-empty p { margin: 0; color: var(--text-secondary); font-size: 0.95rem; }

/* --- Downvote Reason Sheet / Modal --- */
.feedback-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(38, 37, 34, 0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.feedback-backdrop.is-open { opacity: 1; visibility: visible; }
.feedback-sheet {
  inline-size: min(440px, 100%);
  background: var(--bg-secondary);
  border: 1px solid var(--hairline, var(--border-color));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 22px;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-base);
}
.feedback-backdrop.is-open .feedback-sheet { transform: translateY(0) scale(1); }
.feedback-sheet h3 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.feedback-sheet .sheet-sub { margin: 6px 0 20px; font-size: 13px; color: var(--text-secondary); }
.feedback-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.feedback-chip {
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid transparent; border-radius: 999px;
  padding: 9px 15px; font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.feedback-chip:hover { border-color: var(--border-color); }
.feedback-chip.is-selected {
  background: var(--accent-light); color: var(--accent-hover);
  border-color: hsl(108 16% 78%);
}
.feedback-other-wrap { margin-block-start: 14px; max-block-size: 0; overflow: hidden; transition: max-block-size var(--transition-base); }
.feedback-other-wrap.is-open { max-block-size: 160px; }
.feedback-other-wrap textarea {
  inline-size: 100%; min-block-size: 76px; resize: vertical;
  font-family: inherit; font-size: 14px; color: var(--text-primary);
  background: var(--bg-primary); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.feedback-other-wrap textarea:focus { outline: none; border-color: var(--accent-color); }
.feedback-actions { display: flex; gap: 10px; justify-content: flex-end; margin-block-start: 22px; }
.aphorism-card-host .btn-ghost,
.feedback-sheet .btn-ghost,
.feedback-sheet .btn-primary {
  border-radius: 999px; padding: 11px 20px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}
.feedback-sheet .btn-ghost { background: none; border: 1px solid var(--border-color); color: var(--text-secondary); }
.feedback-sheet .btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.feedback-sheet .btn-primary { background: var(--accent-color); border: 1px solid transparent; color: #fff; }
.feedback-sheet .btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* --- Source Preferences Panel (in Settings) --- */
.source-prefs {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.source-prefs h3 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.source-prefs .prefs-sub { margin: 6px 0 18px; font-size: 13px; color: var(--text-secondary); }
.source-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.source-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 15px 10px 13px;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.source-chip .chk {
  inline-size: 17px; block-size: 17px; border-radius: 5px;
  border: 1.5px solid var(--text-soft, var(--text-secondary)); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition-base), border-color var(--transition-base);
}
.source-chip .chk svg { inline-size: 11px; block-size: 11px; opacity: 0; transition: opacity var(--transition-base); }
.source-chip.is-enabled { background: var(--accent-light); color: var(--accent-hover); border-color: hsl(108 16% 78%); }
.source-chip.is-enabled .chk { background: var(--accent-color); border-color: var(--accent-color); }
.source-chip.is-enabled .chk svg { opacity: 1; }
.source-chip[data-desc]::after {
  content: attr(data-desc);
  position: absolute; inset-block-end: calc(100% + 8px); inset-inline-start: 50%;
  transform: translateX(50%) translateY(4px);
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  padding: 6px 10px; border-radius: var(--radius-sm);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 5;
}
.source-chip:hover::after { opacity: 1; transform: translateX(50%) translateY(0); }
.prefs-links { display: flex; gap: 18px; margin-block-start: 18px; }
.prefs-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--accent-color);
  text-decoration: underline; text-underline-offset: 2px;
}
.prefs-link:hover { color: var(--accent-hover); }

/* --- Toast --- */
.toast-stack {
  position: fixed; inset-block-end: 24px; inset-inline-start: 50%;
  transform: translateX(50%); z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 13px; font-weight: 500;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  display: inline-flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast .toast-dot { inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--accent-color); }

/* Bottom-sheet on small screens */
@media (max-width: 560px) {
  .feedback-backdrop { align-items: flex-end; padding: 0; }
  .feedback-sheet {
    inline-size: 100%;
    border-end-start-radius: 0; border-end-end-radius: 0;
    transform: translateY(100%);
    padding-block-end: 28px;
  }
  .feedback-backdrop.is-open .feedback-sheet { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .aphorism-card, .aphorism-card *,
  .feedback-backdrop, .feedback-sheet, .feedback-chip, .feedback-other-wrap,
  .source-chip, .toast { transition: none !important; }
}

/* ====================================================================
   New Client Form — friendly zigzag redesign (Claude Design handoff)
   Self-scoped under .nc-form to avoid clashes with existing styles.
   ==================================================================== */

.nc-form {
  display: block;
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
}

/* app.js sets the <form>'s style.display = 'flex' on show/reset/edit
   (legacy minimalist-form behavior). Lock column direction + gap so the
   redesigned .nc-block sections stack vertically as designed instead of
   collapsing into a row of narrow strips. */
.nc-form-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Hero intro */
.nc-intro { position: relative; margin-block-end: 30px; text-align: start; }
.nc-intro-eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-hover); font-weight: 600;
}
.nc-intro-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 12px 0 0;
  color: var(--text-primary);
}
.nc-intro-title em { font-style: italic; color: var(--accent-color); }
/* Hebrew: drop the Latin serif (Instrument Serif lacks Hebrew glyphs and
   Frank Ruhl Libre clashes with the sketch). Use the body sans stack
   like the dashboard "בוקר טוב" title, with weight/spacing tuned for display. */
html[lang="he"] .nc-intro-title,
:lang(he) .nc-intro-title {
  font-family: var(--font-family);
  font-weight: 700;
  letter-spacing: -0.025em;
}
html[lang="he"] .nc-intro-title em,
:lang(he) .nc-intro-title em {
  /* CSS-synthesized italic on Hebrew sans reads as a clean oblique accent */
  font-style: italic;
}
.nc-intro-sub {
  font-size: 15px; color: var(--text-secondary);
  margin: 12px 0 0; max-inline-size: 54ch; line-height: 1.55;
}
.nc-intro-legend {
  display: inline-flex; align-items: center; gap: 8px; margin-block-start: 18px;
  font-size: 13px; color: var(--text-soft);
  background: var(--bg-secondary); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 7px 14px;
}
.nc-req-dot {
  inline-size: 7px; block-size: 7px; border-radius: 50%;
  background: var(--accent-color); display: inline-block;
}

/* Zigzag block */
.nc-block {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 36px);
  margin-block-end: 22px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.nc-block.nc-flip { grid-template-columns: 1fr 320px; }
.nc-block.nc-flip .nc-illo { order: 2; }
.nc-block.nc-flip .nc-body { order: 1; }

.nc-illo {
  position: relative; display: flex;
  align-items: center; justify-content: center;
  min-block-size: 220px;
}
.nc-illo-wrap { inline-size: 100%; max-inline-size: 290px; }
.nc-illo-wrap svg { inline-size: 100%; block-size: auto; display: block; overflow: visible; }

.nc-step {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
}
.nc-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 27px; line-height: 1.15;
  margin: 8px 0 0;
  color: var(--text-primary);
}
html[lang="he"] .nc-title,
:lang(he) .nc-title {
  font-family: var(--font-family);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nc-desc {
  font-size: 14px; color: var(--text-secondary);
  margin: 8px 0 22px;
  line-height: 1.55; max-inline-size: 46ch;
}

/* Field grid (scoped, won't fight global .grid/.field) */
.nc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
.nc-field {
  display: flex; flex-direction: column; gap: 6px;
  min-inline-size: 0;
  text-align: start;
}
.nc-field.nc-full { grid-column: 1 / -1; }

.nc-label {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 7px;
}
.nc-label .nc-req {
  inline-size: 6px; block-size: 6px; border-radius: 50%;
  background: var(--accent-color); flex: none;
}
.nc-label .nc-opt {
  font-weight: 500; color: var(--text-soft); font-size: 11.5px;
}

.nc-input {
  font-family: inherit;
  font-size: 15px; color: var(--text-primary);
  background: transparent;
  border: none;
  border-block-end: 1px solid var(--border-color);
  padding: 8px 2px;
  outline: none;
  transition: border-color var(--transition-base);
  inline-size: 100%;
  box-sizing: border-box;
  text-align: start;
}
.nc-input::placeholder { color: var(--text-soft); opacity: 0.6; }
.nc-input:focus { border-block-end: 2px solid var(--accent-color); padding-block-end: 7px; }
.nc-readonly-value {
  min-block-size: 37px;
  display: flex;
  align-items: center;
  border-block-end: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 15px;
  padding: 8px 2px;
  box-sizing: border-box;
}
.nc-hint {
  font-size: 12px; color: var(--text-soft);
  line-height: 1.45; margin-block-start: 2px;
}
.nc-inline-suggest {
  align-self: flex-start;
  margin-block-start: 6px;
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-hover);
  font: 600 12px/1 var(--font-family);
  padding: 7px 10px;
  cursor: pointer;
}
.nc-inline-suggest:hover {
  border-color: var(--accent-color);
}

textarea.nc-input {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-block-size: 92px;
  padding: 11px;
  resize: vertical;
}
textarea.nc-input:focus { border: 1px solid var(--accent-color); padding: 11px; }

/* Segmented control */
.nc-seg {
  display: inline-flex;
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px; gap: 2px;
}
.nc-seg-btn {
  border: none; background: transparent;
  padding: 8px 16px; border-radius: 999px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--transition-base), color var(--transition-base);
  white-space: nowrap; cursor: pointer;
}
.nc-seg-btn.is-active { background: var(--accent-color); color: #fff; }

/* Quick-pick chips for the item-name field. Sit above the free-text input
   and write into it when clicked. Active state is derived from value match
   in JS (window.ncSyncItemNamePresets). */
.nc-item-name-presets {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-block-end: 8px;
}
.nc-preset-chip {
  border: 1px solid var(--hairline);
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: 5px 12px; border-radius: 999px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.nc-preset-chip:hover { border-color: var(--accent-color); color: var(--text-primary); }
.nc-preset-chip.is-active { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }

/* Collapsible section header — toggles visibility of the body below. */
.nc-collapsible-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: none; padding: 8px 0;
  font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--text-primary); cursor: pointer;
}
.nc-collapsible-toggle small { font-weight: 500; }
.nc-collapsible-chev {
  transition: transform var(--transition-base);
}
.nc-collapsible-toggle[aria-expanded="true"] .nc-collapsible-chev {
  transform: rotate(180deg);
}
.nc-collapsible-body {
  display: grid; gap: 14px;
  padding-block-start: 10px;
}

/* Toggle row — pair of compact checkbox controls. */
.nc-toggles-row {
  display: flex; flex-wrap: wrap; gap: 16px;
}
.nc-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-primary);
  cursor: pointer;
}
.nc-toggle input { accent-color: var(--accent-color); width: 16px; height: 16px; cursor: pointer; }

/* Inherit chip — reads as inheritance, not a typed value */
.nc-inherit {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
}
.nc-inherit svg {
  inline-size: 15px; block-size: 15px;
  stroke: var(--accent-color); fill: none; stroke-width: 1.8;
  flex: none;
}
.nc-inherit .nc-it-text {
  flex: 1; min-inline-size: 0;
  font-size: 13.5px; color: var(--text-secondary);
}
.nc-inherit .nc-it-text b { color: var(--text-primary); font-weight: 600; }
.nc-inherit .nc-it-change {
  font-size: 12.5px; font-weight: 600;
  color: var(--accent-color);
  background: none; border: none;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; padding: 0;
  font-family: inherit;
}
.nc-inherit .nc-it-change:hover { color: var(--accent-hover); }

/* Chooser */
.nc-chooser { position: relative; }
.nc-chooser-btn {
  inline-size: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-soft);
  text-align: start;
  transition: border-color var(--transition-base);
  cursor: pointer;
}
.nc-chooser-btn.has-value { color: var(--text-primary); font-weight: 500; }
.nc-chooser-btn:hover { border-color: var(--text-soft); }
.nc-chooser-btn .nc-chev {
  inline-size: 16px; block-size: 16px;
  stroke: var(--text-soft); fill: none; stroke-width: 2;
  flex: none;
  transition: transform var(--transition-base);
}
.nc-chooser.is-open .nc-chooser-btn .nc-chev { transform: rotate(180deg); }
.nc-chooser-menu {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 50;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none; flex-direction: column; gap: 2px;
}
.nc-chooser.is-open .nc-chooser-menu { display: flex; }
.nc-chooser-opt {
  text-align: start;
  background: none; border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit; font-size: 14px; color: var(--text-secondary);
  display: flex; flex-direction: column; gap: 3px;
  transition: background var(--transition-base);
  cursor: pointer;
}
.nc-chooser-opt:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nc-chooser-opt small { font-size: 12px; color: var(--text-soft); }
.nc-chooser-opt.is-sel { background: var(--accent-light); color: var(--accent-hover); }

/* On-demand block */
.nc-add-block {
  inline-size: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: transparent;
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  font-family: inherit;
  font-size: 14.5px; font-weight: 600;
  color: var(--text-secondary);
  margin-block-end: 22px;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.nc-add-block:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--text-soft);
}
.nc-add-block svg {
  inline-size: 17px; block-size: 17px;
  stroke: currentColor; fill: none; stroke-width: 2;
}
.nc-block.nc-optional { display: none; }
.nc-block.nc-optional.is-open { display: grid; }

/* Sticky save bar */
.nc-save-bar {
  position: sticky;
  inset-block-end: 0;
  background: hsl(43 40% 97% / 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 14px 22px;
  display: flex; align-items: center; gap: 16px;
  z-index: 30;
  margin-block-start: 16px;
}
.nc-save-status {
  font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 9px;
  margin-inline-end: auto;
}
.nc-save-status .nc-ring { inline-size: 22px; block-size: 22px; flex: none; }
.nc-save-status b { color: var(--text-primary); font-weight: 700; }
.nc-save-bar .btn { padding: 10px 20px; }

/* Toast (scoped to avoid clashing with global .toast) */
.nc-toast-stack {
  position: fixed;
  inset-block-end: 90px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.nc-toast {
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 13px; font-weight: 500;
  padding: 11px 18px; border-radius: 999px;
  box-shadow: var(--shadow-lg);
  display: inline-flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}
.nc-toast.is-in { opacity: 1; transform: translateY(0); }
.nc-toast .nc-dot {
  inline-size: 7px; block-size: 7px; border-radius: 50%;
  background: var(--accent-color);
}

/* Idle motion — ready for a richer animation pass later */
@media (prefers-reduced-motion: no-preference) {
  .nc-illo-wrap .float-a { animation: nc-floaty 7s ease-in-out infinite; transform-origin: center; }
  .nc-illo-wrap .float-b { animation: nc-floaty 9s ease-in-out infinite; transform-origin: center; animation-delay: -2s; }
  .nc-illo-wrap .float-c { animation: nc-floaty 8s ease-in-out infinite; transform-origin: center; animation-delay: -4s; }
  .nc-illo-wrap .breathe { animation: nc-breathe 7s ease-in-out infinite; transform-origin: center; }
  .nc-illo-wrap .twinkle { animation: nc-twinkle 4s ease-in-out infinite; }
  .nc-illo-wrap .dash-move { stroke-dasharray: 4 7; animation: nc-dashmove 6s linear infinite; }
}
@keyframes nc-floaty { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-7px) rotate(1.5deg); } }
@keyframes nc-breathe { 0%, 100% { transform: scale(0.97); } 50% { transform: scale(1.03); } }
@keyframes nc-twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes nc-dashmove { to { stroke-dashoffset: -44; } }

/* Hidden helper — for fields driven by hidden radios/inputs that we keep
   in the markup so app.js's reset/save flows still work. */
.nc-hidden-field { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Responsive */
@media (max-width: 820px) {
  .nc-block, .nc-block.nc-flip { grid-template-columns: 1fr; gap: 4px; }
  .nc-block.nc-flip .nc-illo { order: 0; }
  .nc-illo { min-block-size: 0; margin-block-end: 8px; }
  .nc-illo-wrap { max-inline-size: 200px; }
  .nc-grid { grid-template-columns: 1fr; }
  .nc-save-bar { flex-wrap: wrap; }
  .nc-save-status { inline-size: 100%; margin-inline-end: 0; }
}

/* ====================================================================
   Clinic Settings Redesign — Calm Landing Page Style (.set- prefixed)
   ==================================================================== */
.set-section-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 36px);
  margin-block-end: 22px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  text-align: start;
}

.set-section-card .nc-title {
  margin: 0 0 6px 0;
}

.set-section-card .nc-desc {
  margin: 0 0 24px 0;
  max-inline-size: 100%;
}

.set-section-card.set-optional {
  display: none;
}

.set-section-card.set-optional.is-open {
  display: flex;
}

/* === Billing mode card (Settings → Clinic Settings) ===
   Mirrors design/prototypes/billing_settings_v2 App Settings Prototype.
   The two-card radio + monthly-consolidated toggle drive
   clinic_settings.billing_mode and clinic_settings.monthly_consolidated_enabled. */
.billing-mode-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-block-end: 18px;
}
.billing-mode-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.billing-mode-choice:hover {
  border-color: var(--accent-color);
}
.billing-mode-choice.active {
  border-color: var(--accent-color);
  background: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent-color) inset;
}
.bmc-tag {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-color);
  color: var(--bg-primary);
  padding: 3px 8px;
  border-radius: 999px;
}
.bmc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.bmc-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
@media (max-width: 700px) {
  .billing-mode-choices { grid-template-columns: 1fr; }
}

.bmc-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  transition: opacity 0.18s ease;
}
.bmc-row[hidden] { display: none; }
.bmc-row > div:first-child { flex: 1; min-width: 0; }
.bmc-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.bmc-row-hint {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-block-start: 3px;
  line-height: 1.5;
}
.bmc-toggle {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.bmc-toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.bmc-toggle-track {
  position: absolute; inset: 0;
  background: var(--bg-tertiary);
  border-radius: 999px;
  transition: background 0.18s ease;
}
.bmc-toggle-track::after {
  content: '';
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 18px; height: 18px;
  background: var(--bg-secondary);
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.bmc-toggle input:checked + .bmc-toggle-track {
  background: var(--accent-color);
}
[dir="rtl"] .bmc-toggle input:checked + .bmc-toggle-track::after { transform: translateX(-20px); }
[dir="ltr"] .bmc-toggle input:checked + .bmc-toggle-track::after { transform: translateX(20px); }

/* === Billing-type classifier badge ===
   Shown wherever a client identity is listed (bulk-dispatch rows, client card
   identity zone). Three variants map to clients.billing_cycle.
   Style is intentionally a "category tag", not a status pill (radius 6px,
   icon-led) — to avoid confusion with the .pill status indicators. */
.bill-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.2;
}
.bill-type svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex: none;
}
.bill-type.retainer    { background: var(--accent-light); color: var(--accent-hover); }
.bill-type.postsession { background: hsl(208 32% 89%); color: hsl(208 40% 33%); }
.bill-type.advance     { background: var(--warning-light); color: var(--warning-color); }
/* postsession uses a hard-coded sky color (not a token), so the dark-mode
   override is explicit. retainer/advance ride the CSS-variable dark-mode swap. */
html[data-mode="dark"] .bill-type.postsession {
  background: hsl(208 30% 24%);
  color: hsl(208 45% 74%);
}

/* === Billing screen v2 — design/prototypes/billing_settings_v2 === */
.billing-screen { display: flex; flex-direction: column; gap: 22px; inline-size: 100%; }
.billing-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.billing-eyebrow { font-size: 12px; color: var(--accent-color); font-weight: 700; letter-spacing: 0; margin-block-end: 6px; }
.billing-page-title { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1; color: var(--text-primary); }
.billing-page-sub { margin: 10px 0 0; color: var(--text-secondary); font-size: 15px; line-height: 1.55; max-inline-size: 680px; }
.billing-mode-display {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--radius-md);
  background: var(--bg-secondary); color: var(--text-soft); font-size: 12px; white-space: nowrap;
}
.billing-mode-display strong { color: var(--text-primary); }
.billing-mode-display button { border: 0; background: transparent; color: var(--accent-color); font: inherit; font-weight: 700; cursor: pointer; }
.billing-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.billing-kpi {
  min-block-size: 150px; padding: 18px; border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  background: var(--bg-secondary); box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  align-items: stretch; text-align: start; color: inherit; transition: transform var(--transition-base), box-shadow var(--transition-base);
}
button.billing-kpi { cursor: pointer; }
button.billing-kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.billing-kpi.soon { border-style: dashed; opacity: 0.72; }
.billing-kpi .kpi-head, .billing-kpi .kpi-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.billing-kpi .kpi-label { color: var(--text-soft); font-size: 12px; font-weight: 700; }
.billing-kpi .kpi-month, .billing-kpi .kpi-soon, .billing-kpi .kpi-tag {
  display: inline-flex; align-items: center; border-radius: 999px; background: var(--bg-tertiary);
  color: var(--text-secondary); font-size: 11px; font-weight: 700; padding: 4px 8px;
}
.billing-kpi .kpi-tag { color: var(--warning-color); background: var(--warning-light); }
.billing-kpi .kpi-tag.soft { color: var(--accent-hover); background: var(--accent-light); }
.billing-kpi .kpi-value { margin-block-start: 18px; font-size: 32px; line-height: 1; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.billing-kpi .kpi-value.soft { color: var(--text-secondary); }
.billing-kpi .kpi-foot { margin-block-start: 8px; color: var(--text-soft); font-size: 12.5px; line-height: 1.45; }
.billing-kpi .kpi-action { margin-block-start: auto; padding-block-start: 14px; }
.billing-kpi .kpi-show { color: var(--accent-color); font-size: 12px; font-weight: 800; }
.billing-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px;
  border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--bg-secondary);
}
.billing-filter-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.billing-chip {
  border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-secondary);
  border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.billing-chip.active { background: var(--text-primary); color: var(--bg-secondary); border-color: var(--text-primary); }
.billing-chip .count { display: inline-flex; margin-inline-start: 4px; opacity: 0.68; font-variant-numeric: tabular-nums; }
.billing-toolbar-spacer { flex: 1 1 auto; }
.billing-period-select, .billing-search {
  block-size: 38px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-primary); color: var(--text-primary);
}
.billing-period-select { padding-inline: 14px 30px; font: inherit; font-size: 12px; font-weight: 700; }
.billing-search { display: inline-flex; align-items: center; gap: 8px; padding-inline: 12px; min-inline-size: min(100%, 280px); }
.billing-search svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; color: var(--text-soft); }
.billing-search input { border: 0; outline: 0; background: transparent; color: var(--text-primary); inline-size: 100%; font: inherit; font-size: 13px; }
.billing-month-banner, .billing-selection-bar {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--bg-secondary);
}
.billing-month-banner[hidden], .billing-selection-bar[hidden] { display: none; }
.billing-month-banner .mb-icon {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-light); color: var(--accent-hover); flex: none;
}
.billing-month-banner svg, .cg-toggle svg, .sr-action svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.billing-month-banner .mb-text { flex: 1; min-inline-size: 0; }
.billing-month-banner .mb-title { font-weight: 800; color: var(--text-primary); }
.billing-month-banner .mb-sub { color: var(--text-soft); font-size: 12.5px; margin-block-start: 2px; }
.billing-selection-bar { position: sticky; top: 14px; z-index: 5; box-shadow: var(--shadow-md); }
.billing-selection-bar .sel-info { font-weight: 800; }
.billing-selection-bar .sel-total { color: var(--accent-color); font-weight: 800; font-variant-numeric: tabular-nums; }
.billing-selection-bar .sel-spacer { flex: 1; }
.billing-selection-bar .sel-clear { border: 0; background: transparent; color: var(--text-soft); font: inherit; font-weight: 700; cursor: pointer; }
.billing-client-groups { display: flex; flex-direction: column; gap: 12px; }
.billing-cgroup { border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--bg-secondary); box-shadow: var(--shadow-sm); overflow: hidden; }
.billing-cgroup .cgroup-head {
  width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto 28px; gap: 14px; align-items: center;
  padding: 16px 18px; border: 0; background: transparent; color: inherit; text-align: start; cursor: pointer;
}
.billing-cgroup .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--text-primary); }
.billing-cgroup .avatar.peach  { background: var(--peach); }
.billing-cgroup .avatar.butter { background: var(--butter); }
.billing-cgroup .avatar.sky    { background: var(--sky); }
.billing-cgroup .avatar.sage   { background: var(--accent-light); color: var(--accent-hover); }
.billing-cgroup .avatar.lilac  { background: var(--lilac); }
.billing-cgroup .cg-main { display: flex; flex-direction: column; min-inline-size: 0; }
.billing-cgroup .cg-name { font-size: 15px; font-weight: 800; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-cgroup .cg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-block-start: 4px; color: var(--text-soft); font-size: 12px; }
.billing-cgroup .cg-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.billing-cgroup .cg-total { color: var(--text-primary); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: start; white-space: nowrap; }
.billing-cgroup .cg-total.alert { color: var(--clay); }
.billing-cgroup .cg-total.warn  { color: var(--warning-color); }
.billing-cgroup .cg-total.good  { color: var(--success-color); }
.billing-cgroup .cg-total small { display: block; margin-block-start: 1px; color: var(--text-soft); font-size: 11px; font-weight: 500; }
.billing-cgroup .cg-toggle { display: grid; place-items: center; width: 28px; height: 28px; color: var(--text-soft); border-radius: 50%; }
.billing-cgroup.open .cg-toggle svg { transform: rotate(180deg); }
.billing-cgroup .cgroup-body { display: none; padding: 0 18px 16px; }
.billing-cgroup.open .cgroup-body { display: block; }
.billing-pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border-radius: 999px;
  padding: 4px 10px; font-size: 11px; font-weight: 700;
}
.billing-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.billing-pill.paid     { background: var(--success-light); color: var(--success-color); }
.billing-pill.partial  { background: hsl(28 50% 92%); color: hsl(28 38% 38%); }
.billing-pill.late     { background: hsl(20 40% 90%); color: hsl(20 38% 38%); }
.billing-pill.pending  { background: var(--warning-light); color: var(--warning-color); }
.billing-pill.awaiting { background: hsl(43 35% 88%); color: hsl(43 38% 30%); }
.billing-session-row {
  display: grid; grid-template-columns: 28px 86px minmax(0, 1.15fr) minmax(150px, 1.35fr) 100px 94px minmax(150px, auto);
  gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hairline);
}
.billing-session-row.late { background: linear-gradient(90deg, hsla(20, 40%, 90%, 0.34), transparent 60%); margin-inline: -8px; padding-inline: 8px; border-radius: var(--radius-sm); }
.billing-session-row.partial { background: linear-gradient(90deg, hsla(28, 45%, 92%, 0.38), transparent 60%); margin-inline: -8px; padding-inline: 8px; border-radius: var(--radius-sm); }
.sr-select { display: flex; align-items: center; justify-content: center; }
.billing-row-check { width: 16px; height: 16px; accent-color: var(--accent-color); }
.billing-row-lock { width: 16px; height: 16px; }
.sr-date, .sr-label, .sr-doc-text, .sr-amount { min-inline-size: 0; }
.sr-date { color: var(--text-soft); font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.sr-date strong { display: block; color: var(--text-primary); font-size: 13px; }
.sr-label { color: var(--text-primary); font-size: 13px; font-weight: 700; }
.sr-label small, .sr-doc-text small, .sr-amount small { display: block; margin-block-start: 2px; color: var(--text-soft); font-size: 11px; font-weight: 500; line-height: 1.35; }
.sr-doc { display: flex; align-items: center; gap: 9px; min-inline-size: 0; }
.sr-doc-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; background: var(--bg-tertiary); color: var(--text-soft); }
.sr-doc-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.sr-doc.invoice .sr-doc-icon { background: var(--warning-light); color: var(--warning-color); }
.sr-doc.receipt .sr-doc-icon { background: var(--success-light); color: var(--success-color); }
.sr-doc-text strong, .sr-amount strong { color: var(--text-primary); font-size: 12.5px; font-weight: 800; }
.sr-amount { text-align: start; font-variant-numeric: tabular-nums; }
.sr-amount.alert strong { color: var(--clay); }
.sr-amount.partial strong { color: hsl(28 38% 38%); }
.sr-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.sr-action, .cg-actions button {
  border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-primary);
  border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.sr-action.primary, .cg-actions button.primary { border-color: var(--accent-color); background: var(--accent-color); color: white; }
.cg-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--hairline); padding-block-start: 12px; }

/* Saved-payment-link controls (copy / resend / status) — shown on issued
   invoices in the ledger and client card. */
.pay-link-controls { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pay-link-badge { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.pay-link-badge.pending { background: color-mix(in srgb, var(--warning-color, #d08700) 16%, transparent); color: var(--warning-color, #a86b00); }
.pay-link-badge.paid { background: color-mix(in srgb, var(--success-color, #2e7d32) 16%, transparent); color: var(--success-color, #2e7d32); }
.di-paylink { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; margin-block-start: 6px; }
.di-paylink .pay-link-btn { border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-primary); border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.billing-open-items { margin-block-start: 4px; }

@media (max-width: 1180px) {
  .billing-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-session-row { grid-template-columns: 28px 82px minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .billing-page-header { flex-direction: column; }
  .billing-mode-display { white-space: normal; }
  .billing-kpis { grid-template-columns: 1fr; }
  .billing-search, .billing-period-select { inline-size: 100%; }
  .billing-toolbar-spacer { display: none; }
  .billing-cgroup .cgroup-head { grid-template-columns: 38px minmax(0, 1fr) 28px; }
  .billing-cgroup .cg-status, .billing-cgroup .cg-total { grid-column: 2 / -1; justify-self: start; }
  .billing-session-row { grid-template-columns: 24px minmax(0, 1fr); gap: 8px 12px; padding-block: 14px; }
  .billing-session-row > *:not(.sr-select) { grid-column: 2; }
  .sr-actions { justify-content: flex-start; }
  .billing-selection-bar { flex-wrap: wrap; }
  .billing-selection-bar .sel-spacer { display: none; }
  .cg-actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* ====================================================================
   Settings v2 — tabbed shell (sidebar + panels)
   Mirrors design/prototypes/billing_settings_v2 App Settings Prototype.
   ==================================================================== */
.settings-section.settings-v2 {
  display: block;
  max-width: 1180px;
}
.nc-intro-v2 {
  margin-block-end: 32px;
}
.settings-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  align-items: start;
}
.settings-shell .tab-rail {
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 24px;
}
.settings-shell .tab-rail-title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
  padding: 6px 12px;
  margin-block-end: 6px;
}
.settings-shell .tab-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font: 500 14px/1.2 var(--font-family);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  text-align: start;
  transition: background var(--transition-base), color var(--transition-base);
}
.settings-shell .tab-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.settings-shell .tab-link.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--hairline);
}
.settings-shell .tab-link svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  flex-shrink: 0;
}

.settings-panels { min-width: 0; }
.settings-panels .settings-form { display: block; }
.set-panel {
  display: none;
  animation: setPanelFade 0.2s ease;
}
.set-panel.active { display: block; }
@keyframes setPanelFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.set-panel-title {
  font-size: 22px;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 6px;
}
.set-panel-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 0 24px;
  line-height: 1.55;
  max-width: 60ch;
}
.set-card-h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.set-card-hint {
  font-size: 12.5px;
  color: var(--text-soft);
  margin: 0 0 18px;
  line-height: 1.55;
}

.set-help-card {
  background: hsl(43 50% 95%);
  border: 1px solid hsl(43 45% 85%);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-block-end: 22px;
  display: flex; gap: 12px;
  font-size: 13px;
  color: hsl(43 35% 28%);
  line-height: 1.55;
}
.set-help-card svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  flex-shrink: 0; margin-block-start: 1px;
}
.set-help-card strong { color: hsl(43 38% 22%); font-weight: 600; }
html[data-mode="dark"] .set-help-card {
  background: var(--accent-light);
  border-color: var(--hairline);
  color: var(--text-secondary);
}
html[data-mode="dark"] .set-help-card strong { color: var(--text-primary); }

.set-card-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-block-end: 1px solid var(--hairline);
}
.set-card-row:last-child { border-block-end: 0; padding-block-end: 0; }
.set-card-row:first-of-type { padding-block-start: 0; }
.set-card-row.dim > div:first-child { opacity: 0.65; }
.set-row-label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}
.set-row-hint {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-block-start: 3px;
  line-height: 1.45;
}
.set-row-value {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.stripe-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 92px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stripe-status-pill.is-connected {
  background: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-border);
}

.stripe-status-pill.is-muted {
  background: var(--bg-tertiary);
  color: var(--text-soft);
  border: 1px solid var(--border-color);
}

.connect-pay-block {
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border-subtle, rgba(0,0,0,0.08));
}

.connect-pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 10px;
}

.stripe-events-head {
  margin-block-start: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.stripe-events-list {
  display: grid;
  gap: 8px;
  margin-block-start: 10px;
}

.stripe-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

.stripe-event-type {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-primary);
}

.stripe-event-time,
.stripe-events-empty {
  font-size: 12px;
  color: var(--text-soft);
}

.stripe-event-state {
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

.stripe-event-state.is-ok {
  color: var(--success-color);
  background: var(--success-light);
}

.stripe-event-state.is-pending {
  color: var(--warning-color);
  background: var(--warning-light);
}

.stripe-event-state.is-error {
  color: var(--danger-color);
  background: var(--danger-light);
}

.badge-soon {
  display: inline-block;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  margin-inline-start: 8px;
  vertical-align: middle;
  font-weight: 600;
}

.services-coming-soon {
  display: flex; flex-direction: column; gap: 2px;
}
.services-coming-soon-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.services-coming-soon-row.dim { opacity: 0.5; }
.scs-name { font-weight: 500; color: var(--text-primary); }
.scs-meta { font-size: 12px; color: var(--text-soft); }
.scs-active {
  font-size: 11px; font-weight: 600;
  color: var(--success-color, hsl(108 20% 38%));
  background: var(--success-light, hsl(108 22% 92%));
  padding: 2px 8px; border-radius: 999px;
}
.scs-soon {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-soft);
  background: var(--bg-tertiary);
  padding: 2px 8px; border-radius: 999px;
}

@media (max-width: 1000px) {
  .settings-shell { grid-template-columns: 1fr; gap: 20px; }
  .settings-shell .tab-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-block-end: 6px;
    border-block-end: 1px solid var(--hairline);
  }
  .settings-shell .tab-rail-title { display: none; }
  .settings-shell .tab-link { white-space: nowrap; flex-shrink: 0; }
}

/* Manual-mode banner — shown in bulk-dispatch modal (and similar surfaces)
   when clinic_settings.billing_mode === 'manual'. Reminds the user that docs
   are issued externally; nothing here writes a real invoice. */
.manual-mode-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--warning-light);
  border: 1px solid hsla(28, 50%, 60%, 0.35);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}
.manual-mode-banner[hidden] { display: none; }
.manual-mode-banner > svg {
  width: 20px; height: 20px;
  stroke: var(--warning-color);
  fill: none; stroke-width: 1.8;
  flex: none; margin-top: 2px;
}
.manual-mode-banner .mmb-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.manual-mode-banner .mmb-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.5;
}

/* Custom styling for selects to match underline nc-input design */
select.nc-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f5b53' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px;
  padding-inline-end: 28px !important;
  cursor: pointer;
}

/* RTL specific arrow positioning */
[dir="rtl"] select.nc-input,
body[dir="rtl"] select.nc-input {
  background-position: left 8px center;
  padding-inline-start: 8px;
  padding-inline-end: 28px !important;
}

[dir="ltr"] select.nc-input {
  background-position: right 8px center;
  padding-inline-start: 28px !important;
  padding-inline-end: 8px;
}

/* Redesign Settings Page save button to match the calm sage theme */
.btn-save {
  background: var(--accent-color) !important;
  box-shadow: 0 4px 10px var(--accent-glow) !important;
}

.btn-save:hover:not(:disabled) {
  background: var(--accent-hover) !important;
  box-shadow: 0 4px 14px var(--accent-glow) !important;
  filter: none !important;
}

/* ---- Monthly-billing footer hint + reusable work/result dialog ---- */
.monthly-billing-foot-hint {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.result-dialog-card {
  max-inline-size: 440px;
  text-align: center;
  align-items: center;
  gap: 1.1rem;
}
.rd-working,
.rd-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  inline-size: 100%;
}
.rd-working[hidden],
.rd-result[hidden] { display: none; }
.rd-spinner {
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-color);
  animation: rd-spin 0.8s linear infinite;
}
@keyframes rd-spin { to { transform: rotate(360deg); } }
.rd-title { font-size: 1.2rem; margin: 0; color: var(--text-primary); }
.rd-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  min-block-size: 1.2em;
}
.rd-track {
  inline-size: 100%;
  block-size: 10px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}
.rd-fill {
  block-size: 100%;
  inline-size: 0%;
  background: var(--accent-color);
  border-radius: 999px;
  transition: inline-size 0.3s ease;
}
.rd-count {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.rd-icon {
  inline-size: 56px;
  block-size: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 700;
  color: #fff;
  background: #2e7d32;
}
.rd-icon.is-error { background: #c62828; }
.rd-icon.is-info { background: #1565c0; }
.rd-body {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
}
.rd-body b { color: var(--text-primary); }
.rd-actions { inline-size: 100%; display: flex; justify-content: center; }
.rd-actions .btn { min-inline-size: 140px; }

/* Live send progress (email-review footer) */
.mb-send-prog {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-inline-size: 180px;
}
.mb-send-bar {
  inline-size: 100%;
  block-size: 7px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}
.mb-send-bar__fill {
  block-size: 100%;
  inline-size: 0%;
  background: var(--accent-color);
  border-radius: 999px;
  transition: inline-size 0.25s ease;
}
.mb-send-prog__label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ===== Overview: smart assistant (chat-style navigator) ===== */
.ov-assistant { margin-block-end: 22px; }
.ova-card { position: relative; background: var(--bg-primary); border: 1px solid var(--border-color);
  border-radius: 18px; padding: 16px 18px 14px;
  box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.03); }
.ova-inputwrap { position: relative; display: flex; align-items: center; gap: 10px;
  background: var(--bg-secondary); border: 1.5px solid var(--border-color); border-radius: 14px;
  padding: 4px 14px; transition: border-color .15s, box-shadow .15s; }
.ova-inputwrap:focus-within { border-color: var(--accent-color, #5F715B);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color, #5F715B) 16%, transparent); }
.ova-spark { flex: 0 0 auto; inline-size: 20px; block-size: 20px; color: var(--accent-color, #5F715B); }
.ova-spark svg { inline-size: 100%; block-size: 100%; }
.ova-back { flex: 0 0 auto; inline-size: 26px; block-size: 26px; border: none; border-radius: 999px;
  background: color-mix(in srgb, var(--accent-color, #5F715B) 12%, transparent);
  color: var(--accent-color, #5F715B); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; padding: 4px; }
.ova-back svg { inline-size: 16px; block-size: 16px; }
.ova-input { flex: 1 1 auto; min-width: 0; border: none; background: transparent; outline: none;
  color: var(--text-primary); font: inherit; font-size: 0.98rem; padding: 10px 0; }
.ova-input::placeholder { color: var(--text-soft); }
.ova-clear { flex: 0 0 auto; inline-size: 22px; block-size: 22px; border: none; background: none;
  color: var(--text-soft); cursor: pointer; padding: 2px; display: inline-flex; }
.ova-clear svg { inline-size: 100%; block-size: 100%; }
.ova-clear:hover { color: var(--text-primary); }
.ova-back[hidden], .ova-clear[hidden] { display: none; }
.ova-list { margin-block-start: 8px; border: 1px solid var(--border-color); border-radius: 14px;
  background: var(--bg-primary); overflow: hidden; }
.ova-row { display: flex; align-items: center; gap: 12px; inline-size: 100%; text-align: start;
  border: none; background: none; cursor: pointer; padding: 11px 14px; font: inherit;
  color: var(--text-primary); border-top: 1px solid var(--hairline, var(--border-color)); }
.ova-row:first-child { border-top: none; }
.ova-row.is-active { background: color-mix(in srgb, var(--accent-color, #5F715B) 9%, transparent); }
.ova-row-ic { flex: 0 0 auto; inline-size: 32px; block-size: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent-color, #5F715B) 12%, transparent);
  color: var(--accent-color, #5F715B); }
.ova-row-ic svg { inline-size: 17px; block-size: 17px; }
.ova-row-label { flex: 1 1 auto; min-width: 0; font-size: 0.93rem; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ova-row-sub { flex: 0 0 auto; font-size: 0.74rem; color: var(--text-soft); font-weight: 700;
  border: 1px solid var(--border-color); border-radius: 999px; padding: 2px 8px; }
.ova-row-enter { flex: 0 0 auto; font-size: 0.78rem; color: var(--text-soft); opacity: 0;
  transition: opacity .1s; }
.ova-row.is-active .ova-row-enter { opacity: 1; }
.ova-empty { padding: 14px 16px; font-size: 0.88rem; color: var(--text-soft); }
.ova-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 10px; }
.ova-example { border: 1px solid var(--border-color); background: var(--bg-secondary);
  color: var(--text-primary); border-radius: 999px; padding: 5px 12px; font-size: 0.82rem;
  font-weight: 700; cursor: pointer; }
.ova-example:hover { border-color: var(--accent-color, #5F715B); color: var(--accent-color, #5F715B); }
.ova-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 12px; }
.ova-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-color);
  background: var(--bg-primary); color: var(--text-secondary); border-radius: 999px;
  padding: 7px 14px; font-size: 0.84rem; font-weight: 800; cursor: pointer;
  transition: border-color .12s, color .12s, background .12s; }
.ova-chip:hover { border-color: var(--accent-color, #5F715B); color: var(--accent-color, #5F715B);
  background: color-mix(in srgb, var(--accent-color, #5F715B) 6%, transparent); }
.ova-chip-ic { inline-size: 15px; block-size: 15px; display: inline-flex; }
.ova-chip-ic svg { inline-size: 100%; block-size: 100%; }
.ova-picker-banner { font-size: 0.85rem; font-weight: 700; color: var(--accent-color, #5F715B);
  padding: 2px 2px 0; }
.ova-chip-hot { border-color: color-mix(in srgb, var(--accent-color, #5F715B) 45%, transparent);
  background: color-mix(in srgb, var(--accent-color, #5F715B) 10%, transparent);
  color: var(--accent-color, #5F715B); }
.ova-chip-hot:hover { background: color-mix(in srgb, var(--accent-color, #5F715B) 16%, transparent); }
.ova-ai-hint { display: flex; align-items: center; gap: 7px; margin-block-start: 12px;
  font-size: 0.8rem; font-weight: 700; color: var(--accent-color, #5F715B); }
.ova-ai-hint svg { inline-size: 15px; block-size: 15px; flex: 0 0 auto; }
.ova-ai-loading { display: flex; align-items: center; gap: 9px; color: var(--text-secondary); }
.ova-ai-loading svg { inline-size: 17px; block-size: 17px; flex: 0 0 auto;
  color: var(--accent-color, #5F715B); animation: ova-spin-pulse 1.2s ease-in-out infinite; }
@keyframes ova-spin-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.25) rotate(12deg); opacity: 0.6; }
}
.ova-thread { padding: 10px 12px 12px; max-block-size: 360px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  /* theme the shared assist-core rich bubbles (assets/assist-core-bubbles.css) */
  --ac-accent: var(--accent-color, #5F715B);
  --ac-surface: var(--bg-primary);
  --ac-surface-2: var(--bg-secondary);
  --ac-ink: var(--text-primary);
  --ac-ink-soft: var(--text-soft);
  --ac-line: var(--border-color); }
.ova-thread-head { display: flex; align-items: center; justify-content: space-between;
  margin-block-end: 2px; position: sticky; top: -10px; background: var(--bg-primary); padding: 4px 0; }
.ova-thread-title { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem;
  font-weight: 800; color: var(--accent-color, #5F715B); }
.ova-thread-title svg { inline-size: 14px; block-size: 14px; }
.ova-thread-close { border: none; background: none; color: var(--text-soft); cursor: pointer;
  inline-size: 24px; block-size: 24px; padding: 4px; border-radius: 999px; display: inline-flex; }
.ova-thread-close:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.ova-thread-close svg { inline-size: 100%; block-size: 100%; }
.ova-bubble { max-inline-size: 85%; padding: 8px 13px; border-radius: 14px; font-size: 0.9rem;
  line-height: 1.45; white-space: pre-wrap; overflow-wrap: break-word; }
.ova-bubble.is-user { align-self: flex-end; background: color-mix(in srgb, var(--accent-color, #5F715B) 14%, transparent);
  color: var(--text-primary); border-end-end-radius: 4px; }
.ova-bubble.is-ai { align-self: flex-start; background: var(--bg-secondary);
  border: 1px solid var(--hairline, var(--border-color)); color: var(--text-primary);
  border-end-start-radius: 4px; }
.ova-thread-actions { border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden;
  background: var(--bg-primary); }
.ova-typing { display: inline-flex; gap: 4px; align-items: center; padding-block: 12px; }
.ova-typing span { inline-size: 6px; block-size: 6px; border-radius: 50%;
  background: var(--text-soft); animation: ova-typing-dot 1.1s ease-in-out infinite; }
.ova-typing span:nth-child(2) { animation-delay: 0.18s; }
.ova-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes ova-typing-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.ova-flash { animation: ova-attn-flash 1.6s ease-out 1; }
@keyframes ova-attn-flash {
  0%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color, #5F715B) 45%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (max-width: 720px) {
  .ova-card { padding: 12px 12px 10px; }
  .ova-chips { gap: 6px; }
  .ova-chip { padding: 6px 11px; font-size: 0.8rem; }
}

/* ===== Overview: "דורש טיפול" action list ===== */
.ov-attn { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 16px;
  padding: 18px 20px 8px; margin-block-end: 22px; }
.ov-attn-head { display: flex; align-items: baseline; gap: 10px; margin-block-end: 6px; }
.ov-attn-title { margin: 0; font-size: 1.02rem; font-weight: 800; }
.ov-attn-count { font-size: 0.8rem; color: var(--text-soft); font-weight: 700; }
.ov-attn-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px;
  border-top: 1px solid var(--hairline, var(--border-color)); }
.ov-attn-row:first-child { border-top: none; }
.ov-attn-ic { flex: 0 0 auto; inline-size: 30px; block-size: 30px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.ov-attn-ic.bill { background: color-mix(in srgb, var(--accent-color, #5F715B) 14%, transparent); }
.ov-attn-ic.late { background: color-mix(in srgb, #dc2626 12%, transparent); }
.ov-attn-ic.info { background: color-mix(in srgb, #d08700 14%, transparent); }
.ov-attn-text { flex: 1 1 auto; min-width: 0; font-size: 0.92rem; }
.ov-attn-text small { display: block; color: var(--text-soft); font-size: 0.78rem; }
.ov-attn-btn { flex: 0 0 auto; border: 1px solid var(--border-color); background: var(--bg-primary);
  color: var(--text-primary); border-radius: 999px; padding: 6px 14px; font-size: 0.82rem;
  font-weight: 800; cursor: pointer; white-space: nowrap; }
.ov-attn-btn:hover { border-color: var(--accent-color, #5F715B); color: var(--accent-color, #5F715B); }
.ov-attn-more { padding: 10px 2px 12px; font-size: 0.82rem; color: var(--text-soft);
  border-top: 1px solid var(--hairline, var(--border-color)); }
.ov-attn-more button { background: none; border: none; color: var(--accent-color, #5F715B);
  font-weight: 800; cursor: pointer; font-size: 0.82rem; padding: 0; }

/* ===== Settings: advanced disclosure ===== */
.set-advanced { margin-block-start: 18px; border: 1px dashed var(--border-color); border-radius: 14px; }
.set-advanced > summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex;
  flex-direction: column; gap: 2px; user-select: none; }
.set-advanced > summary::-webkit-details-marker { display: none; }
.set-advanced > summary::before { content: "▸"; float: inline-start; margin-inline-end: 8px;
  color: var(--accent-color, #5F715B); }
.set-advanced[open] > summary::before { content: "▾"; }
.set-advanced-title { font-weight: 800; font-size: 0.95rem; }
.set-advanced-title::before { content: "▸ "; color: var(--accent-color, #5F715B); }
.set-advanced[open] .set-advanced-title::before { content: "▾ "; }
.set-advanced > summary::before { content: none; }
.set-advanced-sub { font-size: 0.8rem; color: var(--text-soft); }
.set-advanced-body { padding: 0 18px 18px; }

/* ===== Onboarding wizard ===== */
.onb-dots { display: flex; gap: 8px; justify-content: center; margin-block-end: 18px; }
.onb-dot { inline-size: 8px; block-size: 8px; border-radius: 999px; background: var(--border-color); transition: all .2s; }
.onb-dot.active { background: var(--accent-color, #5F715B); inline-size: 22px; }
.onb-dot.done { background: color-mix(in srgb, var(--accent-color, #5F715B) 55%, transparent); }
.onb-hint { font-size: 0.8rem; color: var(--text-soft); line-height: 1.5; margin: 4px 0 0; }
.onb-nav { display: flex; gap: 10px; margin-block-start: 1.1rem; }
.onb-nav .btn { flex: 1 1 auto; padding: 0.75rem 1rem; }
.onb-nav #onbBackBtn { flex: 0 0 auto; }
.onb-summary { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px;
  padding: 14px 16px; font-size: 0.9rem; line-height: 1.9; margin-block-end: 12px; }
.onb-summary b { font-weight: 800; }
.onb-check { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; cursor: pointer; user-select: none; }
.onb-check input { accent-color: var(--accent-color, #5F715B); inline-size: 16px; block-size: 16px; }
.onb-select { background-color: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color);
  height: 42px; border-radius: var(--radius-md); padding: 0.5rem; outline: none; width: 100%; }
