:root {
  --teal: #14B8A6;
  --teal-dark: #0d9488;
  --cyan: #06B6D4;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-secondary: #475569;
  --border: #E2E8F0;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;

  --gradient: linear-gradient(135deg, var(--teal), var(--cyan));

  /* Radius scale -- every border-radius in the app should reference one of these five,
     not a raw px value. --radius-xs is for micro chips (kbd tags, tiny audio buttons);
     --radius-sm is for small content blocks (form inputs, example/tip boxes); --radius-btn
     and --radius-card are the two original, most-used tokens (unchanged values, so this
     addition never shifts anything that already referenced them); --radius-pill replaces
     the ad hoc literal "999px" scattered around for pill/dot shapes. */
  --radius-xs: 6px;
  --radius-sm: 12px;
  --radius-btn: 14px;
  --radius-card: 20px;
  --radius-pill: 999px;

  --shadow-soft: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-softer: 0 2px 12px rgba(15, 23, 42, 0.04);
  /* Layered card shadow: a tight contact shadow, a bigger ambient one, and a whisper of
     brand teal underneath for warmth -- reads as "soft depth", not a flat grey box. */
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 16px 36px -10px rgba(15, 23, 42, 0.16), 0 5px 16px -6px rgba(20, 184, 166, 0.12);

  /* Spacing scale -- gap/padding/margin should snap to one of these instead of an
     arbitrary px value. The existing .gap-8/.gap-12/.gap-16/.gap-24 utility classes
     already happened to land on this scale, so they're unaffected. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Type scale -- 8 steps instead of the 15+ one-off font-size values that had
     accumulated across style.css and per-page inline styles. */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --text-display: 34px;

  --font-en: 'Inter', -apple-system, 'SF Pro', Arial, Helvetica, sans-serif;
  --font-fa: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif;

  /* Component-specific, not part of the generic --space-* scale on purpose (this is one
     fixed component's own height, not a reusable spacing value) -- see .currency-bar. */
  --currency-bar-height: 44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  -webkit-font-smoothing: antialiased;
}

body[dir="rtl"], .fa {
  font-family: var(--font-fa);
}

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p { color: var(--text-secondary); line-height: 1.7; margin: 0 0 1em; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navigation */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.navbar img.logo { height: 32px; display: block; }
.navbar nav { display: flex; align-items: center; gap: 28px; }
.navbar nav a { color: var(--text-secondary); font-weight: 500; font-size: 15px; }
.navbar nav a:hover { color: var(--text); text-decoration: none; }

/* Sidebar (replaces .navbar on the main app pages -- see js/sidebar.js) */
.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  overflow-y: auto;
}
.sidebar-logo {
  display: block;
  padding: 6px 10px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img { height: 30px; display: block; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14.5px;
  padding: 9px 14px;
  border-radius: var(--radius-btn);
  transition: background-color .15s ease, color .15s ease;
}
.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--text-secondary);
  opacity: .8;
  transition: color .15s ease, opacity .15s ease;
}
.sidebar-icon svg { width: 100%; height: 100%; display: block; }
.sidebar-nav a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.sidebar-nav a:hover .sidebar-icon { color: var(--text); opacity: 1; }
.sidebar-nav a.active { color: var(--teal-dark); background: rgba(20, 184, 166, .10); border: 1px solid rgba(20, 184, 166, .18); font-weight: 600; }
.sidebar-nav a:not(.active) { border: 1px solid transparent; }
.sidebar-nav a.active .sidebar-icon { color: var(--teal-dark); opacity: 1; }
.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 3px;
  background: var(--teal);
}
@media (prefers-color-scheme: dark) {
  .sidebar-nav a.active { background: rgba(20, 184, 166, .16); }
}

/* Top currency bar (streak/XP/gem/energy) -- see js/currencyBar.js, included on every
   authenticated page. Always spans the full viewport width, above both .navbar and
   .sidebar (which is position:fixed and so isn't pushed down by body padding on its
   own -- it needs its own `top` override below). z-index 40 is deliberately under
   .modal-backdrop's 50/.confirm-sheet's 100/.quick-bar's 200, so any of those still
   correctly cover the bar rather than the reverse. */
.currency-bar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.currency-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--currency-bar-height);
  padding: 0 var(--space-2);
  max-width: 1120px;
  margin: 0 auto;
}
/* Measured at 320px: 4 items with --space-4 gaps and --space-2 horizontal item padding
   overflowed the viewport by a couple of px (items total ~309px vs ~305px available) --
   tightened gap/padding here (not font-size) closes that with real margin to spare,
   confirmed via the same DOM-measurement approach as the earlier navbar overflow fix,
   not guessed. */
.currency-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  padding: var(--space-1);
  font-family: inherit;
  line-height: 1;
}
.currency-icon { font-size: var(--text-md); line-height: 1; }
.currency-energy { cursor: pointer; }
.currency-energy:hover { background: var(--bg); }
body.has-currency-bar { padding-top: var(--currency-bar-height); }
body.has-currency-bar .sidebar { top: var(--currency-bar-height); }

/* Energy refill modal content (js/currencyBar.js) -- reuses .modal/.modal-body/
   .progress-track/.btn-* as-is; these two classes are the only genuinely new rules,
   for the icon and the button stack. */
.currency-energy-icon { font-size: 48px; line-height: 1; margin-bottom: var(--space-2); }
.currency-energy-actions { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-4); }

body.has-sidebar main,
body.has-sidebar > .container {
  margin-inline-start: 232px;
}
/* .section's default 80px top+bottom padding is tuned for the landing page; on the
   app pages the sidebar already reserves side space and each page sets its own
   padding-top, so the leftover 80px bottom padding just forces an unnecessary
   scrollbar on short pages (e.g. Account) for no visual benefit. */
body.has-sidebar main.section {
  padding-bottom: 24px;
}
/* .container's `margin: 0 auto` centers it within its own containing block. Once the
   sidebar shifts main over by 232px, "centered" is relative to the space after the
   sidebar, not the true window -- so content visually drifts toward the right edge
   (a 232px-wide empty strip on the left it doesn't have on the right). Left-align
   instead so content starts right after the sidebar, like the rest of the app. */
/* Also raise the default 1120px max-width: it was sized for a centered marketing-style
   column; pages that don't set their own narrower max-width inline (Dashboard,
   Community -- their card grids already use `auto-fill` and can use more room) were
   left with a large dead strip on wide screens. Pages with an intentional narrow
   reading width (Account, Settings, Study Plan, Inbox) set max-width inline, which
   wins over this rule and is unaffected. Bounded (not `none`) on purpose -- unbounded
   width caused real overflow on at least one real machine that this environment's
   testing never reproduced. */
body.has-sidebar main .container {
  margin-inline: 0;
  max-width: 1600px;
  /* .container's base 24px side padding read as content glued to the sidebar/window
     edge once it was left-aligned -- give it real breathing room on both sides. */
  padding-inline: 36px;
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-inline-end: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .sidebar-logo { padding: 0; margin-bottom: 0; border-bottom: none; }
  .sidebar-nav { flex-direction: row; gap: 4px; }
  body.has-sidebar main,
  body.has-sidebar > .container {
    margin-inline-start: 0;
  }
}

.lang-switch {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23475569' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 13px 34px 13px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}
.lang-switch:hover { border-color: var(--teal); color: var(--text); }
.lang-switch:focus { outline: none; border-color: var(--teal); }
body[dir="rtl"] .lang-switch { background-position: left 14px center; padding: 13px 16px 13px 34px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px -6px rgba(13, 148, 136, 0.45), 0 2px 6px rgba(13, 148, 136, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--teal-dark), #0b7a70);
  box-shadow: 0 12px 26px -6px rgba(13, 148, 136, 0.5), 0 3px 8px rgba(13, 148, 136, 0.3);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 4px 12px -4px rgba(13, 148, 136, 0.4); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-block { width: 100%; }

/* Square icon-only button -- same visual family as .btn-secondary (border/color/hover)
   but sized for a single icon instead of stretching a pill around it. Matches .btn's
   height via the same vertical padding so it sits flush next to text buttons in a row. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  padding: 13px 0;
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: var(--text-lg);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal-dark); transform: translateY(-1px); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #F0FDFA;
  color: var(--teal-dark);
  border: 1px solid #CCFBF1;
}
.badge-slate { background: #F1F5F9; color: var(--text-secondary); border-color: var(--border); }
.badge-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.badge-success { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }

/* Custom <select> chrome -- a bare, unwrapped <select> (no .field/.filters-bar
   ancestor) previously got zero styling beyond the browser's own native dropdown, which
   reads as unfinished next to everything else. This is a base element-selector rule
   (lowest specificity), so any more specific context -- .field select, .filters-bar
   select, .lang-switch -- still wins its own border/padding/width where it already
   defines one; this only fills the gap for selects with no such wrapper. The chevron is
   a static data-URI (can't reference CSS custom properties), hardcoded to
   --text-secondary's light-mode value -- see the dark-mode block below for the redraw. */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  max-width: 100%;
  /* A <select> with no explicit width sizes to its widest <option> text by default --
     harmless for short option lists, but a long one (e.g. Inbox's topic names) can force
     the select wider than its own container/viewport with no wrapping. text-overflow
     only actually clips in Firefox; max-width is the real cross-browser backstop. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 10px 38px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23475569' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px 7px;
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select:hover { border-color: var(--teal); }
select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15); }
body[dir="rtl"] select { background-position: left 14px center; padding: 10px 14px 10px 38px; }

/* Forms */
.field { margin-bottom: 18px; text-align: left; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.field .hint { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.field .error-text { font-size: 12px; color: var(--error); margin-top: 6px; display: none; }

/* Custom checkbox/radio -- a bare OS checkbox (blue square) or radio next to Cortexly's
   own rounded, teal-branded controls is the single most "unfinished product" tell there
   is. appearance:none drops native rendering entirely; the checked mark/dot and its pop
   animation are drawn in CSS. Global element selectors (not a .field-scoped class) so
   every checkbox/radio in the app -- Inbox's field picker, Browser's row selects, Saved
   Reviews' deck/state lists -- picks this up with no markup changes. */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
input[type="checkbox"]:hover { border-color: var(--teal); }
input[type="checkbox"]:checked { background: var(--teal); border-color: var(--teal); }
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  animation: checkPop 0.18s ease forwards;
}
input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
@keyframes checkPop {
  0% { transform: rotate(45deg) scale(0); opacity: 0; }
  60% { transform: rotate(45deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(45deg) scale(1); opacity: 1; }
}

input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: border-color 0.15s ease;
}
input[type="radio"]:hover { border-color: var(--teal); }
input[type="radio"]:checked { border-color: var(--teal); }
input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  animation: radioPop 0.18s ease forwards;
}
input[type="radio"]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
@keyframes radioPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"]:checked::after { animation: none; transform: rotate(45deg) scale(1); }
  input[type="radio"]:checked::after { animation: none; transform: scale(1); }
}

.form-error-banner {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

/* Checkbox list panel -- groups a run of related checkboxes (Inbox's field picker,
   reusable later for Saved Reviews' deck/state lists) into one bordered panel with a
   real 2-column grid instead of N loose <label> rows stacked with no visual boundary. */
.field-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}
.field-check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  cursor: pointer;
}
/* A field with sub-levels (e.g. "Examples") breaks the 2-column flow -- it spans the
   full row so its indented sub-checkboxes read as a group, not scattered into whichever
   column the grid would otherwise have put them in. */
.field-check-group { grid-column: 1 / -1; }
.field-check-group-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: var(--space-2) 0 2px;
}
.field-check-row-sub { margin-inline-start: var(--space-4); font-size: var(--text-xs); padding: 3px 0; }
.field-check-row-sub input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; }
.field-check-row-sub input[type="checkbox"]:checked::after { left: 4px; top: 1px; width: 4px; height: 8px; }

/* Icons */
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Utility */
.text-center { text-align: center; }
.muted { color: var(--text-secondary); }
.section { padding: 80px 0; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* Sheet modal (shared: settings/detail modals across pages) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: 20px; padding: 0; width: 90%; max-width: 420px; max-height: 85vh; overflow-y: auto; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.sheet-header .sheet-action { background: none; border: none; font-size: 15px; font-weight: 600; color: var(--teal-dark); cursor: pointer; padding: 4px; font-family: inherit; }
.sheet-header .sheet-action.muted-action { color: var(--text-secondary); }
.sheet-header h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 8px 20px 20px; }

/* Confirm Sheet -- reusable bottom-sheet confirmation dialog (see js/confirmSheet.js).
   Bottom-anchored and width-capped on every viewport, not just mobile -- the same
   thumb-reachable shape reads as a clean, familiar dialog on desktop too, so there's
   no separate desktop-only "centered modal" variant to build or maintain. */
.confirm-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, background-color .2s ease;
}
.confirm-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(15, 23, 42, .5);
}
.confirm-sheet {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-soft);
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.32, .72, 0, 1);
}
.confirm-sheet-backdrop.open .confirm-sheet {
  transform: translateY(0);
}
.confirm-sheet-message {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 20px;
}
.confirm-sheet-actions { display: flex; gap: 10px; }
.confirm-sheet-actions .btn { flex: 1; }
.confirm-sheet-danger {
  background: var(--error);
  color: #fff;
  border: 1px solid var(--error);
}
.confirm-sheet-danger:hover { background: #dc2626; }
@media (prefers-color-scheme: dark) {
  .confirm-sheet-danger:hover { background: #ef4444; }
}

/* Quick Bar (Ctrl+K) -- global command-palette-style search (see js/quickBar.js).
   Anchored near the top, not bottom like Confirm Sheet -- this is a "jump to X" tool
   you glance up at, not a bottom-sheet confirmation. */
.quick-bar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, background-color .15s ease;
}
.quick-bar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(15, 23, 42, .5);
}
.quick-bar {
  background: var(--surface);
  width: 92%;
  max-width: 560px;
  max-height: 70vh;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-8px);
  transition: transform .15s ease;
}
.quick-bar-backdrop.open .quick-bar { transform: translateY(0); }
.quick-bar-input {
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-size: 16px;
  font-family: inherit;
  background: none;
  color: var(--text);
  outline: none;
  flex-shrink: 0;
}
.quick-bar-results { overflow-y: auto; padding: 8px; }
.quick-bar-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-secondary);
  padding: 10px 12px 4px;
}
.quick-bar-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.quick-bar-row.active,
.quick-bar-row:hover { background: var(--bg); }
.quick-bar-empty { padding: 20px 12px; text-align: center; color: var(--text-secondary); font-size: 14px; }
body[dir="rtl"] .quick-bar-input,
body[dir="rtl"] .quick-bar-row { text-align: right; }
body.quick-bar-locked { overflow: hidden; }

/* Sidebar's search trigger -- looks like a disabled search input, opens Quick Bar */
.sidebar-search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.sidebar-search-btn:hover { color: var(--text); border-color: var(--text-secondary); }
.sidebar-search-btn .sidebar-icon { width: 16px; height: 16px; opacity: .8; }
.sidebar-search-label { flex: 1; }
.sidebar-search-kbd {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  flex-shrink: 0;
}
body[dir="rtl"] .sidebar-search-btn { text-align: right; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .row-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.list-row .row-body { flex: 1; min-width: 0; }
.list-row .row-body .row-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.list-row .row-body input, .list-row .row-body select { border: none; background: none; padding: 0; font-size: 15px; width: 100%; font-family: inherit; color: var(--text); }
.list-row .row-body input:focus, .list-row .row-body select:focus { outline: none; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--bg); margin: 0 -12px; padding: 12px; border-radius: 10px; }
.list-row .row-chevron { color: var(--text-secondary); font-size: 18px; flex-shrink: 0; }
.list-row .row-value { color: var(--text-secondary); font-size: 14px; }
body[dir="rtl"] .row-chevron { transform: scaleX(-1); }

.field-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.field-row:last-child { border-bottom: none; }
.field-row .row-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.field-row input, .field-row select, .field-row textarea { border: none; background: none; padding: 0; font-size: 15px; width: 100%; font-family: inherit; color: var(--text); resize: vertical; }
.field-row input:focus, .field-row select:focus, .field-row textarea:focus { outline: none; }

/* Shared activity heatmap (public/js/heatmap.js) -- used by stats.html and
   community.html's member-profile modal. Deliberately direction: ltr on both grids
   regardless of page dir -- see heatmap.js's header comment for why. overflow-x:auto
   on the outer wrapper keeps a year-wide grid from breaking narrow layouts. */
.heatmap { overflow-x: auto; }
.heatmap-months, .heatmap-grid { display: grid; grid-auto-flow: column; gap: 3px; direction: ltr; }
.heatmap-months { grid-template-rows: 14px; margin-bottom: 4px; }
.heatmap-month-label { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.heatmap-grid { grid-template-rows: repeat(7, 12px); }
.heatmap-cell { width: 12px; height: 12px; border-radius: 3px; background: var(--border); }
.heatmap-cell-empty { background: transparent; }
.heatmap-cell[data-level="1"] { background: #99f0e5; }
.heatmap-cell[data-level="2"] { background: #4dd9c7; }
.heatmap-cell[data-level="3"] { background: var(--teal); }
.heatmap-cell[data-level="4"] { background: var(--teal-dark); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --surface: #111827;
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --border: #1E293B;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.35), 0 16px 36px -10px rgba(0, 0, 0, 0.5), 0 5px 16px -6px rgba(20, 184, 166, 0.14);
  }
  .field input, .field select { background: #0B1220; }
  .badge { background: #0f2e2a; border-color: #134e4a; color: #5eead4; }
  .badge-slate { background: #1E293B; color: #94A3B8; }
  /* Redraws the select chevron in the dark-mode --text-secondary tone -- the light-mode
     arrow (hardcoded #475569, a data-URI can't reference CSS custom properties) would
     be nearly invisible against a dark surface otherwise. */
  select {
    background-color: var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2394A3B8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
