:root {
  --bg: #f6f6f5;
  --card: #ffffff;
  --card-subtle: #fbfbf9;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --input-bg: #ffffff;
  --btn-bg: #ffffff;
  --btn-hover: #f5f5f4;
  --column-bg: #eeecea;
  --inbox-bg: #fefce8;
  --inbox-border: #eab308;
  --inbox-empty-bg: #fbfbf9;
  --brand: #262524;
  --accent: #d97706;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --personal: #059669;
  --professional: #78716c;
  --business: #b45309;
  --kpi-bg: #fafaf9;
  --bar-bg: #e7e5e4;
  --tag-bg: #eae8e5;
  --tag-ink: #44403c;
  --seg-bg: #e7e5e4;
  --radius: 12px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #141416;
  --card: #1c1c1f;
  --card-subtle: #242429;
  --ink: #f5f5f4;
  --muted: #a8a29e;
  --line: #2e2e33;
  --input-bg: #18181b;
  --btn-bg: #212126;
  --btn-hover: #2b2b32;
  --column-bg: #17171a;
  --inbox-bg: #232014;
  --inbox-border: #ca8a04;
  --inbox-empty-bg: #1c1c1f;
  --brand: #18181b;
  --accent: #f59e0b;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --personal: #10b981;
  --professional: #a8a29e;
  --business: #fbbf24;
  --kpi-bg: #1c1c1f;
  --bar-bg: #2b2b32;
  --tag-bg: #27272a;
  --tag-ink: #e7e5e4;
  --seg-bg: #242429;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416;
    --card: #1c1c1f;
    --card-subtle: #242429;
    --ink: #f5f5f4;
    --muted: #a8a29e;
    --line: #2e2e33;
    --input-bg: #18181b;
    --btn-bg: #212126;
    --btn-hover: #2b2b32;
    --column-bg: #17171a;
    --inbox-bg: #232014;
    --inbox-border: #ca8a04;
    --inbox-empty-bg: #1c1c1f;
    --brand: #18181b;
    --accent: #f59e0b;
    --ok: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --personal: #10b981;
    --professional: #a8a29e;
    --business: #fbbf24;
    --kpi-bg: #1c1c1f;
    --bar-bg: #2b2b32;
    --tag-bg: #27272a;
    --tag-ink: #e7e5e4;
    --seg-bg: #242429;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
html, body { margin: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.05rem; }
h3 { font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--danger); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; background: var(--input-bg); color: var(--ink); width: 100%; }
textarea { resize: vertical; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
label > input, label > select, label > textarea { margin-top: .25rem; color: var(--ink); }
label.check { display: flex; gap: .5rem; align-items: center; color: var(--ink); }
label.check input { width: auto; }

.btn { border: 1px solid var(--line); background: var(--btn-bg); color: var(--ink); border-radius: 8px; padding: .5rem .9rem; cursor: pointer; }
.btn:hover { background: var(--btn-hover); border-color: var(--line); }
.btn { white-space: nowrap; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.4rem; background: var(--brand); color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); box-shadow: 0 4px 20px rgba(0,0,0,0.18); backdrop-filter: blur(12px); }

.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; user-select: none; text-decoration: none; }
.brand-logo-img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 0 12px rgba(245, 158, 11, 0.25); flex-shrink: 0; }
/* Wordmark matches the DigiAutomate family (RingQuay / NudgePost): Barlow Semi Condensed, gold accent letter, muted sub-line */
.brand-text-block { display: flex; flex-direction: column; justify-content: center; gap: 5px; line-height: 1; }
.brand-title { display: inline-flex; align-items: center; font-size: 24px; font-weight: 800; letter-spacing: 0; color: #FFFFFF; line-height: 1; font-family: "Barlow Semi Condensed", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.brand-accent-d { color: #D4A62A; }
.brand-sub { font-size: 10px; font-weight: 600; letter-spacing: .16em; color: #9AA0AA; text-transform: uppercase; line-height: 1; white-space: nowrap; font-family: Barlow, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.topbar form { margin-left: auto; }
.topbar .btn.ghost { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,.2); }
.topbar .btn.ghost:hover { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.08); }
.tabs { display: flex; gap: .35rem; }
.tab { background: transparent; border: 1px solid transparent; color: rgba(255,255,255,.75); padding: .42rem .9rem; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: all .16s ease; font-size: .88rem; font-weight: 500; }
.tab:hover:not(.active) { background: rgba(255,255,255,.08); color: #fff; }
.tab.active { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); font-weight: 600; box-shadow: 0 1px 6px rgba(245, 158, 11, 0.15); }

.banner { display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; background: color-mix(in srgb, var(--warn) 15%, var(--card)); border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, var(--card)); padding: .5rem 1rem; font-size: .9rem; color: var(--ink); }
main { max-width: 1280px; max-width: max(1280px, calc(var(--ncols, 3) * 285px + 2rem)); margin: 0 auto; padding: 1.25rem 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
[data-theme="dark"] .card { box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35); border-color: rgba(255, 255, 255, 0.08); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.row-between.wrap { flex-wrap: wrap; }

/* Custom smooth scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(160, 160, 160, 0.25); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(160, 160, 160, 0.45); }

/* brain dump */
.dump-label { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: .4rem; }
.dump textarea { font-size: 1rem; min-height: 4.5rem; }
.dump-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .6rem; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; align-items: center; }
.filters.tight { margin: 0; }
.filters.tight select { width: auto; }
.chip { border: 1px solid var(--line); background: var(--btn-bg); color: var(--ink); border-radius: 999px; padding: .3rem .8rem; cursor: pointer; font-size: .85rem; }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.ghost { background: transparent; color: var(--muted); }
.chip-select { width: auto; border-radius: 999px; padding: .3rem .7rem; font-size: .85rem; background: var(--input-bg); color: var(--ink); border: 1px solid var(--line); }

/* views */
.viewbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .3rem; }
.viewbar .filters { margin: 0; }
.seg { display: inline-flex; background: var(--seg-bg); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-btn { border: 0; background: transparent; border-radius: 999px; padding: .45rem .95rem; cursor: pointer; font-weight: 600; color: var(--muted); min-height: 40px; }
.seg-btn[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.seg-btn .n { font-weight: 500; color: var(--muted); font-size: .8rem; margin-left: .15rem; }
.view-help { margin: .2rem 0 .8rem; }
.linkish { border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }

/* inbox */
.inbox { border: 2px dashed var(--inbox-border); background: var(--inbox-bg); padding: .7rem; }
.inbox .column-head h2 { color: var(--warn); }
.inbox.empty { border-color: var(--line); background: var(--inbox-empty-bg); }
.inbox.empty .inbox-help { display: none; }
.inbox-help { margin: 0 0 .6rem; }
.inbox-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .5rem; }
.inbox.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.empty-note { margin: .3rem .2rem; }

/* board */
/* as many columns as Kabir has (Settings tab); scrolls sideways on a computer if there are very many */
.board { display: grid; grid-template-columns: var(--board-grid-cols, repeat(var(--ncols, 3), minmax(270px, 1fr))); gap: 0.85rem; align-items: start; overflow-x: auto; }
.column { background: var(--column-bg); border-radius: var(--radius); padding: .65rem; min-height: 160px; border-top: 4px solid var(--c, #999); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); }
.column.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.column-head { display: flex; justify-content: space-between; align-items: center; padding: .2rem .3rem .6rem; }
.column-head h2 { margin: 0; color: var(--c); font-size: 1.05rem; letter-spacing: -0.01em; }
.count { background: var(--card); border-radius: 999px; padding: 0 .55rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.items { display: flex; flex-direction: column; gap: .55rem; min-height: 20px; }
.inbox-items.items { display: grid; }

/* Enhanced Kanban Card - Proper Alignment, Full Width Text & Hover Elevation */
.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem 0.55rem;
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 0.6rem;
  row-gap: 0.4rem;
  align-items: start;
  color: var(--ink);
  position: relative;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s ease,
              background-color 0.2s ease;
  transform-origin: center center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

/* Hover: gives a bigger, elevated card when hovered over */
.item:hover {
  transform: translateY(-3px) scale(1.025);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--primary-glow, rgba(99, 102, 241, 0.45));
  border-color: rgba(99, 102, 241, 0.55);
  z-index: 25;
}

.item[draggable="true"] { cursor: grab; }
.item.dragging { opacity: .4; transform: scale(0.98); }
.item.done .text { text-decoration: line-through; color: var(--muted); }
.item.example { border-style: dashed; }

/* Sleek compact round tick */
.tick {
  grid-column: 1;
  grid-row: 1;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--input-bg);
  color: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  margin-top: 2px;
  transition: all 0.15s ease;
}
.tick:hover {
  border-color: var(--ok);
  color: var(--ok);
  transform: scale(1.15);
}
.tick.on {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

/* Item body - takes FULL horizontal width of column 2 */
.item-body {
  grid-column: 2;
  grid-row: 1;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  cursor: pointer;
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--ink);
}

.item-body .text {
  display: block;
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--ink);
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}

/* Tags row */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}
.tag {
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-ink);
  white-space: nowrap;
  font-weight: 500;
}
.tag.online { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
.tag.physical { background: rgba(249, 115, 22, 0.18); color: #fb923c; }
.tag.both { background: rgba(168, 85, 247, 0.18); color: #c084fc; }
.tag.week { background: rgba(234, 179, 8, 0.18); color: #fde047; }
.tag.today { background: rgba(245, 158, 11, 0.22); color: #fbbf24; font-weight: 600; }
.tag.overdue { background: rgba(239, 68, 68, 0.22); color: #f87171; font-weight: 600; }
.tag.due-today { background: rgba(245, 158, 11, 0.22); color: #fbbf24; font-weight: 600; }
.tag.due-soon { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }

/* Subtasks inside cards */
.card-subtasks {
  margin-top: 0.35rem;
  padding-top: 0.3rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.subtask-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted);
  cursor: pointer;
}
.subtask-item.checked .subtask-text {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Actions footer row - spans full width below */
.item-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
  opacity: 0.78;
  transition: opacity 0.2s ease;
}

.item:hover .item-actions {
  opacity: 1;
}

.item-actions-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.item-actions .btn.small {
  min-height: 24px;
  height: 24px;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  border-radius: 5px;
}

.item-btn-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.item-del-btn {
  padding: 0 5px !important;
  height: 24px !important;
  min-height: 24px !important;
  color: var(--danger);
  font-size: 0.82rem;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.item-del-btn:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
}

.btn.accept { background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.4); color: var(--ok); font-weight: 600; }
.icon { border: 0; background: transparent; cursor: pointer; padding: .15rem .3rem; border-radius: 6px; color: var(--muted); font-size: .95rem; }
.icon:hover { background: var(--btn-hover); color: var(--ink); }
.quick-add input { margin-top: .5rem; background: var(--input-bg); border-style: dashed; min-height: 42px; }

/* sheets (edit / move) */
dialog.sheet { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; width: min(560px, 96vw); max-height: 92vh; overflow-y: auto; }
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.sheet-head h2 { margin: 0; color: var(--ink); }
.icon.close { font-size: 1.2rem; width: 40px; height: 40px; }
.field { margin-bottom: .7rem; }
.field-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.pick { display: grid; gap: .4rem; }
.pick-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pick-col { grid-template-columns: 1fr; }
.pick-btn { border: 2px solid var(--line); background: var(--btn-bg); color: var(--ink); border-radius: 10px; min-height: 46px; padding: .4rem .3rem; cursor: pointer;
  font-weight: 600; font-size: .9rem; }
.pick-col .pick-btn { min-height: 54px; font-size: 1.05rem; text-align: left; padding-left: 1rem; }
.pick-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--card)); color: var(--ink); }
.pick-btn.has-c { border-left: 6px solid var(--c); }
.move-text { margin: 0 0 .7rem; font-weight: 600; color: var(--ink); }
.due-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.due-row input[type=date] { width: auto; flex: 1 1 150px; min-height: 42px; background: var(--input-bg); color: var(--ink); }
.due-row .chip { min-height: 38px; }
.toggles { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
label.check.big { font-size: .95rem; min-height: 40px; }
label.check.big input { width: 22px; height: 22px; }
.sheet-actions { display: flex; gap: .5rem; justify-content: space-between; margin-top: .4rem; }
.sheet-actions .btn { min-height: 44px; flex: 1; }
code { background: var(--tag-bg); color: var(--ink); padding: 0 .3rem; border-radius: 4px; font-size: .85em; }
#restoreForm { display: grid; gap: .5rem; }
#exportBtn { display: inline-block; text-decoration: none; margin: .3rem 0; }

/* money */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-2.tight { gap: .6rem; }
.grid-3 > .card, .grid-2 > .card { margin-bottom: 0; }
.grid-3, .grid-2 { margin-bottom: 1rem; }
.card .grid-2 { margin-bottom: 0; }
#importForm .btn, #importForm input[type=file] { margin-top: .3rem; }
.result { margin-top: .75rem; background: color-mix(in srgb, var(--ok) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); border-radius: 8px; padding: .6rem; font-size: .85rem; color: var(--ink); }
.result.bad { background: color-mix(in srgb, var(--danger) 12%, var(--card)); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); color: var(--ink); }
.soon { background: var(--card-subtle); border: 1px dashed var(--line); }
.soon ul { padding-left: 1.1rem; }
.pill { font-size: .7rem; background: var(--tag-bg); color: var(--muted); padding: .1rem .5rem; border-radius: 999px; vertical-align: middle; font-weight: 500; }
ul.plain { list-style: none; padding: 0; margin: 0 0 .5rem; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: .4rem; margin-top: .5rem; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: .5rem 0 .5rem; }
.kpi { background: var(--kpi-bg); border: 1px solid var(--line); border-radius: 10px; padding: .7rem; }
.kpi span { display: block; font-size: .8rem; color: var(--muted); }
.kpi b { font-size: 1.35rem; color: var(--ink); }
.bar-row { display: grid; grid-template-columns: 120px 1fr 80px; gap: .5rem; align-items: center; font-size: .88rem; margin: .3rem 0; color: var(--ink); }
.bar { background: var(--bar-bg); border-radius: 6px; height: 12px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; color: var(--ink); }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.table th, .table td { padding: .4rem .45rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.num, .table th.num { text-align: right; }
.table select { padding: .2rem .3rem; font-size: .82rem; width: auto; background: var(--input-bg); color: var(--ink); border: 1px solid var(--line); }
.neg { color: var(--ink); }
.pos { color: var(--ok); }
.scroll-x { overflow-x: auto; }
.badge { font-size: .68rem; padding: 0 .35rem; border-radius: 999px; background: rgba(239, 68, 68, 0.15); color: var(--danger); margin-left: .25rem; }
.badge.ok { background: rgba(34, 197, 94, 0.15); color: var(--ok); }

dialog { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; width: min(520px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; font-size: .9rem; z-index: 50; max-width: 92vw; box-shadow: 0 8px 24px rgba(0,0,0,.3); }

.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--brand); }
.login-card { background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: 2rem; border-radius: 16px; width: min(360px, 92vw); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.login-card .btn { width: 100%; margin-top: .4rem; }


/* ---- v3: layout switch, timing, area view, calendar, attachments ---- */
.layoutbar { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin-bottom: .55rem; flex-wrap: wrap; }
.layoutbar-tools { display: contents; }
.seg-layout { display: inline-flex; align-items: center; background: var(--seg-bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 4px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.06); }
[data-theme="dark"] .seg-layout { background: #161619; border-color: rgba(255,255,255,0.12); box-shadow: inset 0 1px 3px rgba(0,0,0,0.35); }
.seg-layout .lay-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: .35rem .95rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
}
.seg-layout .lay-btn:hover:not([aria-selected="true"]):not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.12);
}
.seg-layout .lay-btn[aria-selected="true"],
.seg-layout .lay-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  border: 1px solid #fbbf24 !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  transform: translateY(-1px);
}
.tag.t-now { background: rgba(239, 68, 68, 0.2); color: #f87171; font-weight: 600; }
.tag.t-next { background: rgba(59, 130, 246, 0.2); color: #60a5fa; font-weight: 600; }
.tag.t-later { background: var(--tag-bg); color: var(--tag-ink); }
.tag.t-someday { background: rgba(234, 179, 8, 0.18); color: #fde047; }
.tag.att { background: var(--tag-bg); color: var(--muted); }
.tag.col-tag { background: color-mix(in srgb, var(--c, #999) 15%, var(--card)); color: var(--c, var(--tag-ink)); }
.tag.col-inbox { background: rgba(234, 179, 8, 0.18); color: #fde047; }
.pick-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pick-btn.c-now.on { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 18%, var(--card)); color: var(--ink); }
.pick-area { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .3rem; }
.pick-area .pick-btn { min-height: 42px; font-size: .88rem; }
.move-area-label { margin-top: .8rem; }

/* group by area: as many columns as areas, wrapping */
.board.by-area { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.column.area-col h2 { font-size: 1rem; }

/* calendar */
.cal-card { padding: .8rem; }
.cal-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.cal-title { margin: 0 .3rem; min-width: 9.5rem; text-align: center; font-size: 1.1rem; color: var(--ink); }
.btn.icon-btn { font-size: 1.3rem; line-height: 1; width: 42px; height: 40px; padding: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: .75rem; font-weight: 600; color: var(--muted); text-align: center; padding: .2rem 0; text-transform: uppercase; letter-spacing: .03em; }
.cal-day { background: var(--card-subtle); border: 1px solid var(--line); border-radius: 8px; min-height: 104px; padding: .25rem; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; position: relative; min-width: 0; }
.cal-day:hover { border-color: var(--accent); }
.cal-day.other { background: var(--bg); opacity: .45; }
.cal-day.past .cal-num { color: var(--muted); }
.cal-day.today { background: color-mix(in srgb, var(--accent) 15%, var(--card)); border-color: var(--accent); }
.cal-day.today .cal-num { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 .45rem; }
.cal-day.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day.has-overdue { background: rgba(239, 68, 68, 0.12); }
.cal-day.drag-over { outline: 2px dashed var(--accent); outline-offset: -3px; background: color-mix(in srgb, var(--accent) 20%, var(--card)); }
.cal-num { font-size: .8rem; font-weight: 700; align-self: flex-start; color: var(--ink); }
.cal-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--c, #999); background: var(--card); color: var(--ink); border-radius: 5px;
  padding: .12rem .3rem; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.cal-chip.c-inbox { --c: #e0b84c; }
.cal-chip.overdue { background: rgba(239, 68, 68, 0.15); color: var(--danger); font-weight: 600; }
.cal-chip.done { text-decoration: line-through; color: var(--muted); }
.cal-chip.dragging { opacity: .4; }
.cal-more { font-size: .7rem; color: var(--muted); padding-left: .2rem; }
.cal-dot { display: none; }
.cal-overdue { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); border-radius: 8px;
  padding: .35rem .5rem; margin-bottom: .6rem; font-size: .85rem; color: var(--danger); }
.cal-overdue .cal-chip { width: auto; max-width: 220px; display: inline-block; }
.cal-help { margin: .5rem 0 0; }
.cal-daypanel .items { margin-top: .4rem; }
.cal-daypanel h2 { margin: 0; }
.cal-agenda { display: none; }
.agenda-title { margin: .2rem 0 .5rem; }
.agenda-day { margin-bottom: .8rem; }
.agenda-day h3 { margin: 0 0 .35rem; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .92rem; }
.agenda-day.is-today h3 { color: var(--accent); }
.agenda-day.overdue-day h3 { color: var(--danger); }

/* attachments */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.att { border: 1px solid var(--line); border-radius: 10px; padding: .3rem; background: var(--card-subtle); min-width: 0; }
.att-open { display: grid; place-items: center; height: 84px; border-radius: 7px; overflow: hidden; background: var(--bar-bg); text-decoration: none; }
.att-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-icon { font-weight: 700; color: var(--muted); font-size: .9rem; letter-spacing: .04em; }
.att-name { font-size: .75rem; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.att-row { display: flex; align-items: center; gap: .2rem; font-size: .72rem; }
.att-row .muted { margin-right: auto; }
.att-btn { border: 1px solid var(--line); background: var(--btn-bg); border-radius: 6px; min-width: 34px; height: 32px; display: inline-grid; place-items: center;
  cursor: pointer; color: var(--ink); text-decoration: none; font-size: .85rem; padding: 0; }
.att-del { color: var(--danger); }
.att-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.file-btn { display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; margin: 0; color: var(--ink); font-size: .88rem; position: relative; }

/* ---- v4: editable columns (Settings tab) ---- */
.layoutbar { align-items: center; gap: .5rem; flex-wrap: wrap; }
.edit-cols { margin-left: auto; color: var(--muted); }
.grip { cursor: grab; color: #98a1b3; font-size: 1.05rem; line-height: 1; padding: .1rem .25rem; border-radius: 6px; user-select: none; }
.column-head .grip { margin-right: .2rem; flex-shrink: 0; }
.column-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
.column-head .count { margin-left: .3rem; flex-shrink: 0; }
.column {
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.column.drag-over {
  border-color: var(--c, var(--accent)) !important;
  box-shadow: 0 0 16px color-mix(in srgb, var(--c, var(--accent)) 25%, transparent) !important;
}
.column.col-dragging, .cat-item.col-dragging {
  opacity: .35;
  transform: scale(0.98);
}
.column.col-drop-before::before,
.column.col-drop-after::after {
  content: '';
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 5px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.95), 0 0 4px #fbbf24;
  border-radius: 999px;
  z-index: 100;
  pointer-events: none;
  animation: col-line-pulse 0.9s infinite alternate ease-in-out;
}
.column.col-drop-before::before {
  left: -8px;
}
.column.col-drop-after::after {
  right: -8px;
}
@keyframes col-line-pulse {
  from { opacity: 0.8; transform: scaleX(0.95); }
  to { opacity: 1; transform: scaleX(1.25); box-shadow: 0 0 18px rgba(245, 158, 11, 1), 0 0 5px #fff; }
}

.cat-item {
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.cat-item.col-drop-before::before,
.cat-item.col-drop-after::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  height: 4px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.9);
  border-radius: 999px;
  z-index: 100;
  pointer-events: none;
  animation: col-line-pulse 0.9s infinite alternate ease-in-out;
}
.cat-item.col-drop-before::before {
  top: -4px;
}
.cat-item.col-drop-after::after {
  bottom: -4px;
}

/* Card Drag & Drop Landing Line Indicator */
.card-drop-line {
  display: flex;
  align-items: center;
  position: relative;
  height: 10px;
  margin: 6px 0;
  pointer-events: none;
  z-index: 40;
  animation: card-line-bounce 0.8s infinite alternate ease-in-out;
}
.card-drop-line .drop-line-bar {
  flex: 1;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #fbbf24, var(--accent));
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.9), 0 0 3px #fff;
  border-radius: 999px;
}
.card-drop-line .drop-line-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.95);
  flex-shrink: 0;
}
@keyframes card-line-bounce {
  from { opacity: 0.85; transform: scaleY(0.92); }
  to { opacity: 1; transform: scaleY(1.22); box-shadow: 0 0 14px rgba(245, 158, 11, 0.9); }
}

/* When a card just landed */
@keyframes landed-pulse {
  0% { transform: scale(1.03); box-shadow: 0 0 0 3px var(--accent), 0 12px 28px rgba(0,0,0,0.45); }
  100% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,0.14); }
}
.item.just-landed {
  animation: landed-pulse 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.touch-only { display: none; }
body:not(.fine) .fine-only { display: none; }
body:not(.fine) .touch-only { display: inline; }
.cat-list { list-style: none; padding: 0; margin: .4rem 0 .8rem; display: flex; flex-direction: column; gap: .45rem; }
.cat-item { display: flex; align-items: center; gap: .6rem; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--c);
  border-radius: 10px; padding: .45rem .6rem; min-height: 56px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; background: var(--c); flex: none; }
.cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cat-name { color: var(--c); overflow-wrap: anywhere; }
.warn-text { color: var(--warn); font-weight: 600; }
.cat-btns { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.cat-btns .btn { min-height: 38px; }
.btn.icon-sq { width: 38px; padding: 0; font-size: 1rem; }
.cat-add { display: grid; grid-template-columns: 1fr 56px auto; gap: .5rem; align-items: center; }
.cat-add input[type=color], .cat-namerow input[type=color] { padding: 2px; height: 42px; min-width: 52px; cursor: pointer; }
.cat-namerow { display: grid; grid-template-columns: 1fr 90px; gap: .6rem; }
.weight-label input { width: 110px; display: block; }
.cat-areas { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .5rem; }
.cat-area { border: 1px solid var(--line); border-radius: 10px; padding: .45rem; background: var(--card-subtle); display: grid; gap: .35rem; }
.cat-area-top { display: grid; grid-template-columns: 1fr 76px 34px; gap: .35rem; align-items: center; }
.cat-desc { margin: .3rem 0 .5rem; font-size: .85rem; color: var(--muted); }
.cat-desc textarea { margin-top: .3rem; }
.range { padding: 0; border: 0; accent-color: var(--accent); }
#catDialog { width: min(640px, 96vw); }

.mobile-menu-btn { display: none; }

@media (max-width: 900px) {
  .board, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .board { overflow-x: visible; }
  .kpis { grid-template-columns: 1fr 1fr 1fr; }
  .kpi b { font-size: 1.05rem; }
  main { padding: .6rem; }
}
@media (max-width: 768px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 52px;
    min-height: 52px;
    padding: 0 12px;
    padding-top: max(4px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-sizing: border-box;
    overflow: visible;
  }
  .topbar .brand {
    display: flex !important;
    font-size: 1.08rem;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: -0.01em;
  }
  header.topbar .tabs {
    display: none !important;
  }
  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }
  .topbar-actions #weeklyReviewBtn,
  .topbar-actions #focusModeBtn,
  .topbar-actions #mobileConnectBtn,
  .topbar-actions form[action="/logout"] {
    display: none !important;
  }
  #cmdPaletteBtn {
    padding: 6px 10px;
    border-radius: 8px;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #cmdPaletteBtn .cmd-label,
  #cmdPaletteBtn .kbd-badge {
    display: none !important;
  }
  .theme-btn {
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
  }
  .mobile-menu-btn:hover, .mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Brain dump touch-friendly & anti-cutoff */
  .dump-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .dump-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .dump-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
  }
  #dumpBtn {
    order: -1;
    width: 100%;
    flex: 1 1 100%;
    min-height: 44px;
    font-weight: 700;
  }

  /* Executive Briefing compact mobile */
  .daily-briefing {
    padding: 0.85rem;
    margin-bottom: 0.85rem;
  }
  .briefing-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-right: 38px;
  }
  #briefingCollapseBtn {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
  }
  .briefing-title-group h2 {
    font-size: 1.15rem;
  }
  .briefing-actions {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 2px;
    width: 100%;
  }
  .briefing-actions::-webkit-scrollbar {
    display: none;
  }
  .briefing-actions .btn {
    flex: 0 0 auto;
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    min-height: 34px;
  }
  .briefing-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .briefing-stat-card {
    padding: 8px 10px !important;
    min-height: 48px;
  }
  .briefing-stat-card .stat-icon {
    font-size: 1.15rem !important;
  }
  .briefing-stat-card .stat-num {
    font-size: 1.3rem !important;
  }
  .briefing-stat-card .stat-label {
    font-size: 0.72rem !important;
  }
  .briefing-momentum-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
  }

  /* Layout bar & View bar mobile */
  .layoutbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 0.75rem;
  }
  .layoutbar .seg-layout {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    padding: 4px;
    gap: 4px;
    box-sizing: border-box;
  }
  .layoutbar .seg-layout::-webkit-scrollbar {
    display: none;
  }
  .layoutbar .seg-layout .seg-btn {
    flex: 0 0 auto;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .layoutbar .search-box {
    width: 100%;
    margin: 0;
  }
  .layoutbar .search-box input {
    width: 100%;
  }
  .layoutbar-tools {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    width: 100%;
    padding-bottom: 2px;
  }
  .layoutbar-tools::-webkit-scrollbar {
    display: none;
  }
  .layoutbar-tools .btn,
  .layoutbar-tools .col-visibility-wrap .btn {
    flex: 0 0 auto;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .viewbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .viewbar .seg-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }
  .viewbar .filters {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 2px;
    margin: 0;
    width: 100%;
  }
  .viewbar .filters::-webkit-scrollbar {
    display: none;
  }
  .viewbar .filters .chip,
  .viewbar .filters .chip-select {
    flex: 0 0 auto;
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
  }

  /* Docs & SOPs Workspace mobile */
  .docs-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .docs-sidebar {
    max-height: 380px;
  }
  .docs-sidebar-header {
    padding: 0.75rem 0.85rem;
  }
  .docs-title-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .docs-pane {
    padding: 0.85rem;
  }
  .doc-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .doc-meta-inputs {
    width: 100%;
    min-width: 0;
  }
  .doc-title-input {
    font-size: 1.15rem;
  }
  .doc-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }
  .doc-actions-bar .btn,
  .doc-actions-bar .chip-select {
    flex: 1 1 auto;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .doc-blocks-toolbar {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 0.4rem 0.5rem;
  }
  .doc-blocks-toolbar::-webkit-scrollbar {
    display: none;
  }
  .doc-blocks-toolbar .chip {
    flex: 0 0 auto;
  }
}
@media (max-width: 600px) {
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 90vh; }
  .pick-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewbar { flex-direction: column; align-items: stretch; }
  .seg:not(.seg-layout) { display: grid; grid-template-columns: repeat(3, 1fr); }
  .seg-btn { padding: .45rem .3rem; }
  .inbox-items { grid-template-columns: 1fr; }
  .board.by-area { grid-template-columns: 1fr; }
  .pick-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* calendar on a phone: compact month (numbers + counts), agenda list underneath */
  .cal-card { padding: .55rem; }
  .cal-head .cal-title { min-width: 0; flex: 1; font-size: 1rem; }
  .cal-grid { gap: 2px; }
  .cal-day { min-height: 46px; padding: .2rem; align-items: center; justify-content: flex-start; }
  .cal-num { align-self: center; }
  .cal-chips, .cal-more { display: none; }
  .cal-dot { display: block; font-size: .68rem; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; min-width: 18px;
    text-align: center; padding: 0 .3rem; line-height: 16px; }
  .cal-dot.overdue { background: #c53030; }
  .cal-overdue { display: none; }
  .cal-agenda { display: block; }
  .cat-item { flex-wrap: wrap; }
  .cat-main { flex-basis: calc(100% - 40px); }
  .cat-btns { width: 100%; justify-content: flex-start; }
  .cat-add { grid-template-columns: 1fr 52px; }
  .cat-add .btn { grid-column: 1 / -1; min-height: 44px; }
  .edit-cols { margin-left: 0; }
}
@media (max-width: 480px) {
  .bar-row { grid-template-columns: 95px 1fr 70px; }
  .table .hide-sm { display: none; }
}

/* v5: money categories + online/physical types in Settings */
.tag.mode-tag { background: color-mix(in srgb, var(--mc) 14%, var(--card)); color: var(--mc); }
.mc-tools { gap: .5rem; align-items: end; margin-top: .4rem; }
.mc-tools .inline-form { flex: 1 1 320px; }
.cat-stats .role-note { color: var(--muted); }
#mcDialog label.check, #modeDialog label.check { margin: .35rem 0; align-items: flex-start; }
#mcDialog label.check input { margin-top: .2rem; }
#mcDialog textarea, #modeDialog textarea { margin-top: .3rem; }
@media (max-width: 600px) {
  .mc-tools { flex-direction: column; align-items: stretch; }
  .mc-tools .inline-form { flex: 0 0 auto; }
  .mc-tools .btn { min-height: 44px; }
}

/* ============================== DARK THEME REFINEMENTS ============================== */
[data-theme="dark"] .topbar { border-bottom: 1px solid var(--line); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar { border-bottom: 1px solid var(--line); }
}

[data-theme="dark"] .seg-btn[aria-selected="true"] { box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .seg-btn[aria-selected="true"] { box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
}

[data-theme="dark"] .card { box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card { box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
}

/* ============================== IMPROVISATIONS UI ============================== */
/* Theme toggle in header */
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.theme-btn { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; padding: .3rem .6rem; cursor: pointer; font-size: .95rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.theme-btn:hover { background: rgba(255,255,255,.15); }

/* Search boxes */
.search-box { position: relative; display: flex; align-items: center; min-width: 220px; flex: 1 1 240px; }
.search-box input[type="search"] { padding-left: 2rem; padding-right: 3.2rem; border-radius: 999px; height: 34px; font-size: .85rem; }
.search-box .search-icon { position: absolute; left: .7rem; color: var(--muted); pointer-events: none; font-size: .85rem; }
.search-box .search-kbd { position: absolute; right: .6rem; font-size: .68rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; pointer-events: none; background: rgba(0,0,0,.03); }
[data-theme="dark"] .search-box .search-kbd { background: rgba(255,255,255,.05); }

/* Voice Brain Dump Button */
.dump-actions { display: flex; align-items: center; gap: .5rem; }
#voiceDumpBtn { display: inline-flex; align-items: center; gap: .35rem; transition: all .2s ease; }
#voiceDumpBtn.listening { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse-red 1.2s infinite; }
@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Recurrence & Subtasks */
.tag.recur-tag { background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); font-weight: 600; }
[data-theme="dark"] .tag.recur-tag { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }

.subtasks-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--muted); margin-top: .3rem; background: var(--line); padding: 1px 7px; border-radius: 999px; font-weight: 500; }
.subtask-list { margin-top: .4rem; padding: .3rem 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; }
.subtask-item { display: flex; align-items: center; gap: .4rem; cursor: pointer; user-select: none; }
.subtask-item.checked { text-decoration: line-through; opacity: 0.6; }
.subtask-item input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }

/* Budget indicators on Money tab */
.budget-kpi { display: flex; flex-direction: column; gap: 2px; }
.budget-bar-wrap { margin-top: 4px; }
.budget-bar { height: 6px; width: 100%; background: var(--line); border-radius: 3px; overflow: hidden; }
.budget-bar-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
.budget-bar-fill.ok { background: var(--ok); }
.budget-bar-fill.warn { background: var(--warn); }
.budget-bar-fill.over { background: var(--danger); }
.budget-meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 2px; }
.budget-badge { font-size: .72rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.budget-badge.ok { background: rgba(34, 197, 94, 0.15); color: var(--ok); }
.budget-badge.warn { background: rgba(234, 179, 8, 0.15); color: var(--warn); }
.budget-badge.over { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Export actions buttons */
.export-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0; }
.export-actions .btn { text-decoration: none; }

/* Focus Mode */
body.focus-mode .dump,
body.focus-mode .layoutbar,
body.focus-mode .edit-cols,
body.focus-mode #exampleBanner,
body.focus-mode .inbox.empty { display: none !important; }
body.focus-mode .item.done { opacity: 0.35; }
body.focus-mode .item:not(.done) { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
#focusModeBtn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Today's Progress Bar */
.progress-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .65rem .85rem; margin-bottom: .8rem; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; font-size: .85rem; }
.progress-title { font-weight: 600; color: var(--ink); }
.progress-count { color: var(--muted); font-size: .8rem; }
.progress-bar-bg { width: 100%; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--ok)); border-radius: 999px; transition: width .35s ease; }

/* Quick Snooze & Actions on Tasks */
.snooze-btns { display: inline-flex; gap: 2px; }
.btn.snooze-mini { padding: 1px 6px; font-size: .72rem; line-height: 1.3; border-radius: 5px; background: var(--btn-bg); color: var(--muted); border: 1px solid var(--line); }
.btn.snooze-mini:hover { background: var(--btn-hover); color: var(--ink); }
.item-actions-row { display: flex; align-items: center; gap: .3rem; margin-top: .3rem; flex-wrap: wrap; }

/* Month-over-Month Trend on Money Tab */
.mom-badge { font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-left: .4rem; display: inline-flex; align-items: center; vertical-align: middle; }
.mom-badge.down { background: rgba(34, 197, 94, 0.15); color: var(--ok); }
.mom-badge.up { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.mom-badge.flat { background: var(--tag-bg); color: var(--muted); }

/* Donut Chart Visualizer */
.cat-chart-container { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.donut-svg { flex: 0 0 130px; }
.cat-bars-wrap { flex: 1 1 200px; }

/* Print Stylesheet for Clean Paper Daily Agenda */
@media print {
  header.topbar, .banner, .dump, .layoutbar, .viewbar, .filters, #focusModeBtn, #printAgendaBtn, #editColsBtn,
  .quick-add, .inbox-help, .item-actions, dialog, .theme-btn, .tabs, [role="tablist"] {
    display: none !important;
  }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  main { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .board { display: block !important; }
  .column { break-inside: avoid; border: 1px solid #ccc !important; margin-bottom: 1rem !important; background: transparent !important; }
  .item { border: 1px solid #eee !important; break-inside: avoid; background: transparent !important; color: #000 !important; }
  .item.done { text-decoration: line-through; opacity: 0.5; }
  .subtask-item input[type="checkbox"] { border: 1px solid #000; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* Priority Badges & Borders */
.tag.prio-high { background: rgba(239, 68, 68, 0.16); color: #ef4444; font-weight: 600; border: 1px solid rgba(239, 68, 68, 0.25); cursor: pointer; user-select: none; }
.tag.prio-medium { background: rgba(245, 158, 11, 0.16); color: #d97706; font-weight: 600; border: 1px solid rgba(245, 158, 11, 0.25); cursor: pointer; user-select: none; }
.tag.prio-low { background: rgba(59, 130, 246, 0.14); color: #3b82f6; font-weight: 500; border: 1px solid rgba(59, 130, 246, 0.2); cursor: pointer; user-select: none; }
.btn.snooze-mini.prio-btn { cursor: pointer; padding: 1px 5px; }
.item.prio-border-high { border-left: 3px solid #ef4444; }
.item.prio-border-medium { border-left: 3px solid #f59e0b; }
.item.prio-border-low { border-left: 3px solid #3b82f6; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Command Palette Overlay */
.cmd-palette-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 10vh 1rem 2rem;
}
.cmd-palette-backdrop[hidden] { display: none !important; }
.cmd-palette-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  width: 100%; max-width: 620px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden; display: flex; flex-direction: column; max-height: 75vh;
  animation: cmdPop 0.15s ease-out;
}
@keyframes cmdPop {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.cmd-palette-header {
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line); background: var(--card-subtle);
}
.cmd-search-icon { font-size: 1.15rem; color: var(--muted); }
.cmd-palette-header input {
  flex: 1; border: none; background: transparent; font-size: 1.05rem;
  color: var(--ink); outline: none; padding: .2rem 0;
}
.cmd-esc-badge {
  font-size: .72rem; padding: 2px 7px; border-radius: 5px;
  background: var(--line); color: var(--muted); font-weight: 600;
}
.cmd-palette-results {
  overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: 2px;
}
.cmd-group-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  color: var(--muted); padding: .6rem .65rem .3rem; letter-spacing: .05em;
}
.cmd-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .75rem; border-radius: 8px; cursor: pointer;
  color: var(--ink); font-size: .92rem; text-decoration: none; user-select: none; gap: .75rem;
}
.cmd-item:hover, .cmd-item.selected {
  background: color-mix(in srgb, var(--accent) 15%, var(--card));
  color: var(--ink);
}
.cmd-icon { font-size: 1.15rem; flex-shrink: 0; }
.cmd-details { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.cmd-item-title { font-weight: 500; font-size: .88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item-desc { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item-type { font-size: .7rem; padding: 2px 7px; border-radius: 6px; background: var(--line); color: var(--muted); flex-shrink: 0; }
.cmd-item-badge {
  font-size: .75rem; padding: 2px 6px; border-radius: 4px;
  background: var(--line); color: var(--muted); flex-shrink: 0;
}
.cmd-palette-footer {
  display: flex; gap: 1.25rem; padding: .65rem 1rem;
  border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted);
  background: var(--card-subtle);
}
.cmd-palette-footer kbd {
  background: var(--card); border: 1px solid var(--line); padding: 1px 4px;
  border-radius: 3px; font-family: monospace; font-size: .72rem;
}
.kbd-badge {
  font-size: .7rem; background: var(--line); padding: 1px 5px;
  border-radius: 4px; margin-left: 4px; font-family: inherit;
}

/* Security Dashboard Styles */
.security-grid { display: flex; flex-direction: column; gap: 1rem; max-width: 900px; margin: 0 auto; }
.sec-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.security-badges-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem; margin-top: 1rem;
}
.sec-badge-item {
  display: flex; align-items: center; gap: .75rem; padding: .75rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card-subtle);
}
.sec-icon { font-size: 1.5rem; }
.sec-badge-info { display: flex; flex-direction: column; gap: 2px; }
.sec-badge-info strong { font-size: .88rem; color: var(--ink); }
.sec-badge-info span { font-size: .75rem; color: var(--muted); }

.badge-green { background: rgba(34, 197, 94, 0.15); color: var(--ok); padding: 3px 8px; border-radius: 999px; font-weight: 600; font-size: .76rem; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--warn); padding: 3px 8px; border-radius: 999px; font-weight: 600; font-size: .76rem; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); padding: 3px 8px; border-radius: 999px; font-weight: 600; font-size: .76rem; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent); padding: 3px 8px; border-radius: 999px; font-weight: 600; font-size: .76rem; }
.badge-current { background: rgba(34, 197, 94, 0.15); color: var(--ok); padding: 2px 7px; border-radius: 999px; font-weight: 600; font-size: .72rem; }
.badge-audit { display: inline-block; padding: 2px 7px; border-radius: 999px; font-weight: 600; font-size: .72rem; background: var(--line); color: var(--muted); }
.badge-audit.ok { background: rgba(34, 197, 94, 0.15); color: var(--ok); }
.badge-audit.bad { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-audit.warn { background: rgba(245, 158, 11, 0.15); color: var(--warn); }

.sessions-list { display: flex; flex-direction: column; gap: .6rem; }
.session-card {
  display: flex; align-items: center; gap: .85rem;
  padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card-subtle);
}
.session-card.is-current { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.session-icon { font-size: 1.4rem; flex-shrink: 0; }
.session-details { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.session-title { display: flex; align-items: center; gap: .6rem; }
.session-title strong { font-weight: 600; color: var(--ink); font-size: .9rem; }
.session-meta { font-size: .78rem; color: var(--muted); }

.audit-log-table-wrap { overflow-x: auto; max-height: 400px; border: 1px solid var(--line); border-radius: 8px; }
.audit-log-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.audit-log-table th { background: var(--card-subtle); padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--muted); }
.audit-log-table td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.audit-log-table tr:last-child td { border-bottom: none; }
.audit-log-table tr:hover td { background: var(--btn-hover); }

.password-form { display: flex; flex-direction: column; gap: .8rem; margin-top: .5rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.form-group input { padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.danger-text { color: var(--danger) !important; border-color: rgba(239,68,68,0.3) !important; }
.danger-text:hover { background: rgba(239,68,68,0.1) !important; }
.form-status-msg { font-size: .84rem; margin-left: .5rem; }
.form-status-msg.success { color: var(--ok); font-weight: 500; }
.form-status-msg.error { color: var(--danger); font-weight: 500; }

/* Phone Access & QR Code Styles */
.phone-access-card {
  margin-top: .5rem;
}
.phone-access-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 1rem;
}
@media (max-width: 720px) {
  .phone-access-body {
    flex-direction: column;
    align-items: center;
  }
}
.phone-qr-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.qr-container {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-container img {
  display: block;
  max-width: 180px;
  height: auto;
  image-rendering: pixelated;
}
.qr-target-switch {
  display: inline-flex;
  gap: 4px;
  background: var(--card-subtle);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.qr-target-switch .btn {
  padding: 3px 10px;
  font-size: .75rem;
}
.qr-target-switch .btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.phone-info-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.phone-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
}
.phone-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: .6rem .8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-subtle);
}
.phone-stat-label {
  font-size: .74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 600;
}
.phone-stat-val {
  font-size: .88rem;
  color: var(--ink);
  word-break: break-all;
}

.url-copy-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.url-copy-box {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.url-copy-box input {
  flex: 1;
  font-family: monospace;
  font-size: .86rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
}
.url-copy-box .btn {
  white-space: nowrap;
}

.phone-instructions {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem 1rem .85rem 1.8rem;
}
.step-guide {
  margin: 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .84rem;
  line-height: 1.45;
  color: var(--ink);
}
.step-guide li {
  padding-left: .25rem;
}
.step-guide strong {
  color: var(--ink);
}

/* ==========================================================================
   Daily Executive Briefing Widget
   ========================================================================== */
.daily-briefing {
  border-left: 4px solid var(--accent);
  background: var(--card);
  margin-bottom: 1.25rem;
  transition: all .2s ease;
}
.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.briefing-title-group h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.briefing-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.icon-toggle-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: transform .2s ease;
}
.daily-briefing.collapsed .icon-toggle-btn {
  transform: rotate(-90deg);
}
.daily-briefing.collapsed .briefing-body {
  display: none;
}
.briefing-body {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.briefing-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem;
}
.briefing-stat-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-radius: 10px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.briefing-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-color: var(--accent);
}
.briefing-stat-card .stat-icon {
  font-size: 1.35rem;
  line-height: 1;
}
.briefing-stat-card .stat-content {
  display: flex;
  flex-direction: column;
}
.briefing-stat-card .stat-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.briefing-stat-card .stat-label {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.briefing-stat-card.stat-today { border-left: 3px solid var(--accent); }
.briefing-stat-card.stat-overdue { border-left: 3px solid var(--warn); }
.briefing-stat-card.stat-high { border-left: 3px solid var(--danger); }
.briefing-stat-card.stat-done { border-left: 3px solid var(--ok); }

.briefing-progress-row {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.briefing-bar-track {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.briefing-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
.briefing-progress-caption {
  font-size: .78rem;
  white-space: nowrap;
}

/* ==========================================================================
   Mobile Bottom Navigation Bar & FAB
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: max(78px, calc(64px + env(safe-area-inset-bottom)));
  }
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--card);
    border-top: 1px solid var(--line);
    padding: 6px 12px max(8px, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  }
  .mobile-nav-btn {
    position: relative;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--muted);
    font-size: .72rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
  }
  .mobile-nav-btn.active {
    color: var(--accent);
    font-weight: 600;
  }
  .mobile-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
  }
  .mobile-nav-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 999px;
  }
  .mobile-fab-btn {
    position: relative;
    top: -12px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--card);
    color: #fff;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease;
  }
  .mobile-fab-btn:active {
    transform: scale(0.92);
  }
  .fab-plus {
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 400;
  }
}

/* ==========================================================================
   Mobile Menu Sheet & Navigation Modal
   ========================================================================== */
.mobile-menu-sheet {
  max-width: 520px;
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem 1.75rem;
  background: var(--card);
}
.mobile-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-menu-header .user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 18%, var(--card-subtle));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.mobile-menu-header .user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-menu-header .user-info strong {
  font-size: 1.05rem;
  color: var(--ink);
}
.mobile-menu-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.15rem 0 0.55rem;
  text-transform: uppercase;
}
.mobile-menu-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  user-select: none;
}
.mobile-menu-item:hover, .mobile-menu-item:active {
  background: var(--btn-hover);
  border-color: var(--accent);
  transform: scale(0.98);
}
.mobile-menu-item .m-item-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}
.mobile-menu-item .m-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.mobile-menu-item .m-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-menu-item .m-item-sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mobile-qact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.mobile-qact-btn:active {
  background: var(--btn-hover);
  border-color: var(--accent);
  transform: scale(0.96);
}
.mobile-qact-btn .m-act-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.mobile-menu-footer {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.mobile-logout-form button {
  width: 100%;
  padding: 11px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
}

/* ==========================================================================
   Celebratory Confetti Canvas
   ========================================================================== */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ==========================================================================
   Print / Executive Agenda Stylesheet
   ========================================================================== */
@media print {
  header.topbar,
  #cmdPalette,
  .mobile-bottom-nav,
  .dump,
  .layoutbar,
  .viewbar,
  .snooze-btns,
  .item-actions,
  .briefing-actions,
  #toast,
  .theme-btn,
  #focusModeBtn,
  #voiceDumpBtn {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 12pt;
    padding: 0;
  }
  main {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .daily-briefing {
    border-left: 4px solid #111 !important;
    margin-bottom: 20px;
  }
  .column {
    background: #fafafa !important;
    border: 1px solid #ccc !important;
  }
  .item {
    background: #ffffff !important;
    border: 1px solid #eee !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   Login Page Styling
   ========================================================================== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.login-card h1 {
  font-size: 1.6rem;
  margin-bottom: .25rem;
  color: var(--ink);
  font-weight: 700;
}
.login-card input {
  margin-top: .4rem;
  margin-bottom: 1.25rem;
}
.login-card .btn.primary {
  width: 100%;
  padding: .65rem;
  font-weight: 600;
}

/* ==========================================================================
   Offline Status Pill & PWA Resilience
   ========================================================================== */
.offline-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(217, 119, 6, 0.12);
  color: var(--accent);
  border: 1px solid rgba(217, 119, 6, 0.3);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  animation: pulse-soft 2s infinite ease-in-out;
}
.offline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ==========================================================================
   Monthly Budget Target & Pacing Card
   ========================================================================== */
.budget-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.btn-inline-edit {
  padding: 0.15rem 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1;
}
.btn-inline-edit:hover {
  color: var(--accent);
  background: rgba(217, 119, 6, 0.12);
}
.budget-bar {
  position: relative;
  height: 8px;
  background: var(--bar-bg);
  border-radius: 4px;
  overflow: visible;
  margin-top: 0.5rem;
}
.budget-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.35s ease;
}
.budget-bar-fill.over {
  background: var(--danger);
}
.budget-bar-fill.warn {
  background: #ea580c;
}
.budget-pace-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  background: var(--ink);
  border-radius: 2px;
  z-index: 2;
  box-shadow: 0 0 4px rgba(0,0,0,0.25);
  transition: left 0.35s ease;
}
.budget-pacing-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Log Transaction Modal & Receipt Snap
   ========================================================================== */
.tx-type-toggle {
  display: flex;
  background: var(--seg-bg);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 1rem;
}
.tx-type-opt {
  flex: 1;
  text-align: center;
  margin: 0;
  cursor: pointer;
}
.tx-type-opt input {
  display: none;
}
.tx-type-opt span {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s ease;
}
.tx-type-opt input:checked + span {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.form-group-flow {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}
.currency-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.currency-sym {
  position: absolute;
  left: 0.85rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}
.currency-input-wrap input {
  padding-left: 2.2rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}
.quick-merchants {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.chip-btn {
  background: var(--kpi-bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip-btn:hover {
  background: rgba(217, 119, 6, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}
.receipt-drop-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  background: var(--kpi-bg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.receipt-drop-zone:hover {
  border-color: var(--accent);
  background: rgba(217, 119, 6, 0.04);
}
.receipt-empty-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.camera-icon {
  font-size: 1.6rem;
}
.receipt-preview-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.receipt-thumb-preview {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.receipt-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  overflow: hidden;
}
.receipt-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  background: rgba(217, 119, 6, 0.1);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(217, 119, 6, 0.25);
  transition: all 0.15s ease;
}
.receipt-badge-btn:hover {
  background: var(--accent);
  color: #fff;
}
.receipt-full-display {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}
.sheet-modal {
  max-width: 480px;
}
.receipt-viewer-dialog {
  max-width: 600px;
}
.tx-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}
.tx-del-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.tx-del-btn:hover {
  color: var(--danger);
}

/* ==========================================================================
   Improvised Features Styles: Executive Review, Radar, Ramble, Integrations
   ========================================================================== */
.sheet-modal-wide {
  max-width: 680px;
  width: 95vw;
}

/* Review Modal */
.review-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.5rem 0;
}
.review-headline-banner {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.review-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.review-headline-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.4;
}
.review-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
@media (max-width: 640px) {
  .review-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.rev-stat {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.rev-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}
.rev-num.ok { color: var(--ok); }
.rev-num.warn { color: var(--warn); }
.rev-label {
  font-size: 0.75rem;
  color: var(--muted);
}
.review-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 640px) {
  .review-sections-grid {
    grid-template-columns: 1fr;
  }
}
.review-card {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.review-card h4 {
  margin: 0 0 0.6rem 0;
  font-size: 0.92rem;
  color: var(--ink);
}
.review-bullets {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink);
}
.review-bullets li {
  margin-bottom: 0.4rem;
}
.rev-fin-details {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
}

/* Smart Ramble Splitter */
.ramble-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.ramble-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ramble-input-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ramble-output-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
}
.ramble-draft-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 45vh;
  overflow-y: auto;
}
.ramble-draft-card {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ramble-draft-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ramble-draft-title-input {
  flex: 1;
  font-weight: 500;
  font-size: 0.92rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  color: var(--ink);
}
.ramble-draft-title-input:focus {
  border-color: var(--accent);
  background: var(--input-bg);
}
.ramble-draft-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}

/* Workload Modal */
.workload-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}
@media (max-width: 680px) {
  .workload-days-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 480px) {
  .workload-days-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.workload-day-card {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.workload-day-card.overloaded {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
}
.workload-day-card.light {
  border-color: var(--ok);
}
.workload-day-name {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}
.workload-day-count {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}
.workload-day-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 10px;
}
.workload-rec-wrap {
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
}
.workload-rec-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem 0;
}
.workload-rec-item {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Renewal Radar & Cashflow */
.money-intelligence-card {
  border: 1px solid var(--line);
}
.radar-grid {
  margin-top: 0.75rem;
}
.radar-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.radar-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 280px;
  overflow-y: auto;
}
.radar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}
.radar-item.imminent {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.06);
}
.radar-merchant-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.radar-merchant-name {
  font-weight: 600;
  color: var(--ink);
}
.radar-cost-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: right;
}
.radar-amount {
  font-weight: 700;
  color: var(--ink);
}
.badge-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-weight: 600;
}
.badge-pill.warn {
  background: rgba(217, 119, 6, 0.15);
  color: var(--warn);
}
.badge-pill.ok {
  background: rgba(22, 163, 74, 0.15);
  color: var(--ok);
}
.badge-pill.danger {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}
.cashflow-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.cf-metric {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.cf-label {
  font-size: 0.75rem;
  color: var(--muted);
}
.cf-val {
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 700;
}
.cf-val.ok { color: var(--ok); }
.cf-val.warn { color: var(--warn); }
.cf-val.danger { color: var(--danger); }

/* Tax Deductible UI */
.chip-toggle.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.tax-kpis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.tax-kpi {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}
.tax-kpi-label {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
}
.tax-kpi-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}
.tax-kpi-val.ok { color: var(--ok); }
.tax-cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}
.tax-cat-pill {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  padding: 0.35rem 0.65rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
}
.tax-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(217, 119, 6, 0.15);
  color: var(--accent);
  font-weight: 600;
  margin-left: 0.35rem;
}

/* Merchant Rules & Integrations */
.merchant-rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.75rem 0;
}
.merchant-rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.8rem;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
}
.rule-check {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
}
.integration-grid {
  margin-top: 0.75rem;
}
.integration-box {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.integration-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.integration-icon {
  font-size: 1.5rem;
}
.integration-field-wrap {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.code-input {
  flex: 1;
  font-family: monospace;
  font-size: 0.82rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
}
.curl-snippet-wrap {
  background: #1e1e24;
  border-radius: 6px;
  padding: 0.6rem;
  overflow-x: auto;
}
.curl-code {
  margin: 0;
  font-family: monospace;
  font-size: 0.78rem;
  color: #38bdf8;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ------------------------------------------------------------------ Purpose Switch & Segmented Controls */
.segmented-control {
  display: inline-flex;
  background: var(--seg-bg, #e7e5e4);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-btn:hover {
  color: var(--ink);
}
.seg-btn.active {
  background: var(--card, #fff);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
[data-theme="dark"] .segmented-control,
:root:not([data-theme="light"]) .segmented-control {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .seg-btn.active,
:root:not([data-theme="light"]) .seg-btn.active {
  background: #27272a;
  color: #f5f5f4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ------------------------------------------------------------------ Multi-CSV Batch Drop Zone */
.batch-drop-zone {
  margin: 0.8rem 0;
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.batch-drop-zone:hover, .batch-drop-zone.dragover {
  border-color: var(--accent, #3b82f6);
  background: rgba(59, 130, 246, 0.05);
}
.drop-zone-icon {
  font-size: 2rem;
}
.drop-zone-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.import-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.batch-status-box {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.6rem 0;
  font-size: 0.85rem;
}
.batch-file-res-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
[data-theme="dark"] .batch-file-res-row {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.account-pills-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.8rem 0;
}
.account-pill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------ Banking Hub Card */
.banking-hub-features {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.8rem 0;
}
.hub-feat-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}
.hub-feat-item .feat-icon {
  font-size: 1.15rem;
  background: var(--chip);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
}

/* ------------------------------------------------------------------ Business & HMRC Hub */
.business-header-card {
  position: relative;
  overflow: hidden;
  border-left: 4px solid #3b82f6;
}
.biz-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.biz-badge-icon {
  font-size: 2.2rem;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
}
.biz-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0 1rem;
}
.biz-kpi-card {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
}
.biz-kpi-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.biz-kpi-val {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}
.biz-kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ------------------------------------------------------------------ VAT Threshold Meter */
.vat-threshold-container {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-top: 0.8rem;
}
.vat-meter-track {
  position: relative;
  height: 10px;
  background: var(--chip);
  border-radius: 5px;
  margin: 0.5rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
}
.vat-meter-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #10b981;
  border-radius: 5px;
  transition: width 0.4s ease;
}
.vat-meter-fill.warning {
  background: #f59e0b;
}
.vat-meter-fill.danger {
  background: #ef4444;
}
.vat-meter-warning-zone {
  position: absolute;
  top: 0;
  left: 85%;
  width: 15%;
  height: 100%;
  background: rgba(239, 68, 68, 0.15);
  border-left: 1px dashed rgba(239, 68, 68, 0.4);
}

/* ------------------------------------------------------------------ Filings Radar Cards */
.filings-radar-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
.filing-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
[data-theme="dark"] .filing-card {
  background: #201f1e;
}
.filing-card:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}
.filing-card.overdue {
  border-left: 4px solid #ef4444;
}
.filing-card.imminent {
  border-left: 4px solid #f59e0b;
}
.filing-card.filed {
  border-left: 4px solid #10b981;
  opacity: 0.8;
}
.filing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filing-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.filing-countdown-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.filing-countdown-pill.overdue {
  background: #fee2e2;
  color: #b91c1c;
}
.filing-countdown-pill.imminent {
  background: #fef3c7;
  color: #b45309;
}
.filing-countdown-pill.ok {
  background: #e0e7ff;
  color: #3730a3;
}
.filing-countdown-pill.filed {
  background: #d1fae5;
  color: #065f46;
}
[data-theme="dark"] .filing-countdown-pill.overdue {
  background: #7f1d1d;
  color: #fecaca;
}
[data-theme="dark"] .filing-countdown-pill.imminent {
  background: #78350f;
  color: #fde68a;
}
[data-theme="dark"] .filing-countdown-pill.ok {
  background: #312e81;
  color: #c7d2fe;
}
[data-theme="dark"] .filing-countdown-pill.filed {
  background: #064e3b;
  color: #a7f3d0;
}
.filing-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.filing-meta-item {
  display: inline-flex;
  gap: 0.3rem;
}
.filing-detail-box {
  background: var(--bg);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.2rem;
}
.filing-penalty-tag {
  color: #b91c1c;
  font-weight: 500;
}
[data-theme="dark"] .filing-penalty-tag {
  color: #f87171;
}
.filing-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

/* ------------------------------------------------------------------ Tax Computation Table */
.tax-computation-table {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  margin: 0.8rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.tax-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 0.25rem 0;
}
.tax-row.minus {
  color: #b91c1c;
}
[data-theme="dark"] .tax-row.minus {
  color: #f87171;
}
.tax-row.total {
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
  font-weight: 600;
}
.tax-row.highlight {
  border-top: 2px solid var(--line);
  padding-top: 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent, #3b82f6);
}
.expense-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.6rem;
}
.expense-cat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
[data-theme="dark"] .expense-cat-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* ------------------------------------------------------------------ Open Banking Hub Box */
.open-banking-status-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  margin: 0.8rem 0;
}
.ob-header {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.ob-header .ob-icon {
  font-size: 1.5rem;
}
.ob-providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.ob-provider-chip {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
}
.gov-links-box {
  margin-top: 0.8rem;
}
.gov-links-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.gov-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.gov-link-btn:hover {
  background: var(--line);
}
.compliance-detail {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
}
.compliance-detail summary {
  cursor: pointer;
  font-size: 0.88rem;
}
.compliance-detail-body {
  font-size: 0.83rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.green { background: #10b981; }
.legend-dot.amber { background: #f59e0b; }
.legend-dot.red { background: #ef4444; }

.kpi.highlight-kpi {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.08);
}

/* Mobile Connect Modal Styling */
.mobile-connect-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 0.5rem 0;
}
.connect-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.connect-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 600px) {
  .connect-grid {
    grid-template-columns: 1fr;
  }
}
.connect-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.qr-box {
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
}
.connect-steps-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.connect-step {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.step-num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.connect-tips {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.connect-tips ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.5;
}

/* ==================================================================
   PRODUCTIVITY SUITE: POMODORO, MOMENTUM, BULK ACTIONS, SAVINGS GOALS, GESTURES
   ================================================================== */

/* ------------------------------------------------------------------ 1. Momentum & Streak Sparkline */
.briefing-momentum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  margin-top: 0.75rem;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-wrap: wrap;
}
.momentum-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #ea580c;
  background: rgba(234, 88, 12, 0.12);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(234, 88, 12, 0.25);
}
[data-theme="dark"] .momentum-badge {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.3);
}
.streak-flame {
  font-size: 1.1rem;
  animation: flamePulse 2s infinite ease-in-out;
}
@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(4deg); }
}
.momentum-sparkline-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.momentum-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
}
.spark-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.spark-bar {
  width: 12px;
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  background: rgba(140, 140, 140, 0.3);
  transition: height 0.3s ease, background 0.2s ease;
}
.spark-bar.has-data {
  background: var(--accent);
}
.spark-bar.is-today {
  background: linear-gradient(180deg, #10b981, #059669);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}
.spark-label {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 500;
}

/* ------------------------------------------------------------------ 1b. Weekly Review & Momentum Suite */
.clickable-momentum {
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  border-radius: 10px;
  padding: 4px 8px;
  margin: -4px -8px;
}
.clickable-momentum:hover {
  transform: translateY(-1px);
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.clickable-momentum:active {
  transform: translateY(0);
}

.weekly-review-modal {
  max-width: 860px;
  width: 95vw;
}

.wr-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.wr-hero-card {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.wr-hero-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.wr-hero-icon {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.wr-hero-val {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}

.wr-hero-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wr-hero-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.wr-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.wr-tab {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.wr-tab:hover {
  color: var(--ink);
  background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.wr-tab.active {
  color: var(--ink);
  background: var(--accent-subtle, rgba(245, 158, 11, 0.15));
  font-weight: 600;
}

.wr-tab-badge {
  background: var(--line);
  color: var(--ink);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.wr-section-box {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.wr-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.wr-section-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
}

.wr-barchart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 160px;
  padding: 16px 8px 10px;
  background: var(--bg, rgba(0, 0, 0, 0.05));
  border-radius: 10px;
  margin-bottom: 16px;
  gap: 8px;
}

.wr-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.wr-chart-bar-wrap {
  height: 100px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.wr-chart-bar {
  width: 24px;
  max-width: 80%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: rgba(140, 140, 140, 0.35);
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
  position: relative;
}

.wr-chart-bar.has-data {
  background: var(--accent);
}

.wr-chart-bar.is-today {
  background: linear-gradient(180deg, #10b981, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

.wr-chart-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
}

.wr-chart-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.wr-insights-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.wr-insight-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.82rem;
  border: 1px solid var(--line);
}

.wr-category-list,
.wr-stale-list,
.wr-wins-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wr-cat-item {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wr-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wr-cat-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
}

.wr-cat-bar-track {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.wr-cat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.wr-stale-item {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wr-stale-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 220px;
}

.wr-stale-title {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink);
}

.wr-stale-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.wr-stale-age-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.72rem;
}

.wr-stale-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.wr-win-item {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.wr-win-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wr-win-check {
  color: #10b981;
  font-size: 1.1rem;
}

.wr-win-text {
  font-size: 0.9rem;
  color: var(--ink);
}

.wr-win-date {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ 2. Flow-State Pomodoro Widget */
.pomodoro-widget {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.pomo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pomo-status-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pomo-icon {
  font-size: 1.25rem;
}
.pomo-mode-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.pomo-session-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--muted);
}
.pomo-presets {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.pomo-preset-btn {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--fg);
  transition: all 0.15s ease;
}
.pomo-preset-btn:hover {
  background: var(--card-subtle);
}
.pomo-preset-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pomo-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.pomo-timer-display {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--fg);
}
.pomo-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.pomo-progress-track {
  width: 100%;
  height: 6px;
  background: var(--chip);
  border-radius: 999px;
  overflow: hidden;
}
.pomo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #10b981);
  border-radius: 999px;
  transition: width 1s linear;
}

/* ------------------------------------------------------------------ 3. Floating Bulk Action Bar */
.bulk-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 860px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  padding: 0.65rem 1rem;
  animation: slideUpBar 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpBar {
  from { transform: translate(-50%, 40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.bulk-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.bulk-count-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bulk-count-pill {
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}
.bulk-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.item-select-chk-wrap {
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
}
.item-select-chk {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}
.item.bulk-selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), 0 2px 8px rgba(0,0,0,0.12) !important;
  background: color-mix(in srgb, var(--accent) 10%, var(--card)) !important;
}

/* ------------------------------------------------------------------ 4. Modals (Kick-Off, Shutdown) */
.morning-kickoff-modal, .evening-shutdown-modal, .savings-goal-modal {
  max-width: 580px;
  width: 95vw;
}
.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sheet-title-icon {
  font-size: 1.8rem;
}
.modal-content-padded {
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.kickoff-intro {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}
.kickoff-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.kickoff-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.kickoff-task-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}
.kickoff-rank-pip {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shutdown-celebration-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.celeb-icon {
  font-size: 1.8rem;
}
.shutdown-unfinished-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.shutdown-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--chip);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.88rem;
}

/* ------------------------------------------------------------------ 5. Personal Savings Goals & Vaults */
.savings-goals-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}
.savings-summary-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  align-items: center;
}
.savings-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat-big {
  font-size: 1.35rem;
  font-weight: 800;
}
.savings-progress-bar-wrap {
  grid-column: 1 / -1;
  margin-top: 0.3rem;
}
.savings-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 999px;
  overflow: hidden;
}
[data-theme="dark"] .savings-bar-bg {
  background: rgba(255,255,255,0.1);
}
.savings-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 999px;
  transition: width 0.5s ease;
}
.savings-goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.savings-goal-item {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.savings-goal-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.goal-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.goal-title {
  font-weight: 700;
  font-size: 0.98rem;
  margin: 0;
}
.goal-cat-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--chip);
  border: 1px solid var(--line);
  text-transform: uppercase;
  font-weight: 600;
}
.goal-amounts-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
}
.goal-saved-amt {
  font-size: 1.15rem;
  font-weight: 800;
}
.goal-quick-deposits {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.2rem;
  align-items: center;
}
.deposit-pill {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  color: var(--fg);
  transition: all 0.12s ease;
}
.deposit-pill:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ------------------------------------------------------------------ 6. Mobile Touch Swipe Indicators */
.item.swiping {
  position: relative;
  user-select: none;
  touch-action: pan-y;
}
.item-swipe-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  pointer-events: none;
  border-radius: 8px;
  transition: opacity 0.15s ease;
  z-index: 10;
}
.item-swipe-complete {
  left: 0;
  background: #10b981;
}
.item-swipe-snooze {
  right: 0;
  background: #3b82f6;
}

/* ------------------------------------------------------------------ 7. Column & Category Visibility and Rail Collapse */
.col-visibility-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#colVisibilityBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#colVisibilityBadge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.popover-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 300px;
  max-width: 380px;
  background: var(--card, #1e1e24);
  border: 1px solid var(--line, #333);
  border-radius: 12px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 1000;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.popover-tabs {
  display: flex;
  background: var(--seg-bg, rgba(0,0,0,0.15));
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.popover-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popover-tab.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0 0.2rem;
}

.popover-head-actions {
  display: flex;
  gap: 0.3rem;
}

.popover-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 0.2rem;
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: var(--card-subtle, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.popover-item:hover {
  background: var(--btn-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.popover-item input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
}

.popover-item .item-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, #888);
  flex-shrink: 0;
}

.popover-item .item-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popover-item .item-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.popover-item .item-rail-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}
.popover-item .item-rail-btn:hover {
  color: var(--ink);
  background: var(--btn-hover);
}

.popover-footer {
  border-top: 1px solid var(--line);
  padding-top: 0.4rem;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Header buttons on columns & areas */
.col-head-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
}

.col-head-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
}

.column-head:hover .col-head-btn,
.col-head-btn:focus,
.col-head-btn:hover {
  opacity: 1;
}

.col-head-btn:hover {
  background: var(--btn-hover, rgba(255, 255, 255, 0.08));
  color: var(--ink);
  transform: scale(1.08);
}
.col-head-btn.col-head-add {
  opacity: 0.9;
  font-size: 1.05rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--accent);
}
.col-head-btn.col-head-add:hover {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}
.col-head-btn.col-head-select {
  font-size: 0.85rem;
  width: 22px;
  height: 22px;
  border-radius: 4px;
}
.col-head-btn.col-head-select:hover {
  background: color-mix(in srgb, var(--accent) 25%, var(--card));
  color: var(--ink);
  opacity: 1;
}

/* Top Column Quick-Add Input */
.column > .quick-add {
  margin: 0.25rem 0.5rem 0.45rem 0.5rem;
}
.column > .quick-add input {
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  border: 1px dashed color-mix(in srgb, var(--line) 85%, transparent);
  background: color-mix(in srgb, var(--card) 60%, transparent);
  color: var(--ink);
  border-radius: 6px;
  min-height: 28px;
  transition: all 0.15s ease;
}
.column > .quick-add input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}
.column > .quick-add input:hover {
  border-color: var(--accent);
  background: var(--card);
}
.column > .quick-add input:focus,
.column > .quick-add input.quick-add-highlight {
  border: 1.5px solid var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  outline: none;
}

/* Quick Add Task Modal */
.quick-add-modal {
  max-width: 520px;
  width: 95vw;
}
.quick-add-modal-body {
  padding: 0.5rem 0 0.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.quick-add-modal-row {
  display: flex;
  gap: 0.75rem;
}
.quick-add-modal-body input[type="text"],
.quick-add-modal-body select {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 6px;
  color: var(--ink);
}
.quick-add-modal-body input[type="text"]:focus,
.quick-add-modal-body select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.quick-add-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.quick-add-keep-open {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

/* Collapsed Column Rail (Desktop) */
.column.collapsed {
  padding: 0.6rem 0.3rem;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: var(--card-subtle);
  border-top: 4px solid var(--c, #999);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.column.collapsed:hover {
  background: var(--card);
  border-top-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.column.collapsed .collapsed-rail-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.2rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
  transition: color 0.15s ease;
}

.column.collapsed:hover .collapsed-rail-btn {
  color: var(--ink);
}

.column.collapsed .collapsed-rail-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--c);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  margin: 0.6rem 0;
  white-space: nowrap;
}

.column.collapsed .collapsed-rail-badge {
  background: var(--card);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: auto;
  border: 1px solid var(--line);
}

/* Collapsed rail on mobile (<900px) */
@media (max-width: 900px) {
  .column.collapsed {
    min-height: 46px;
    height: 46px;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
  }
  .column.collapsed .collapsed-rail-title {
    writing-mode: horizontal-tb;
    transform: none;
    margin: 0;
    margin-left: 0.4rem;
  }
  .column.collapsed .collapsed-rail-badge {
    margin-top: 0;
    margin-left: auto;
    margin-right: 0.5rem;
  }
  .column.collapsed .collapsed-rail-btn {
    margin-bottom: 0;
  }
}

/* Hidden Columns Banner */
.hidden-cols-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--accent, #f59e0b) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent, #f59e0b) 35%, transparent);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  margin: 0.4rem 0 0.8rem;
  font-size: 0.85rem;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  animation: bannerSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hidden-cols-banner .banner-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hidden-cols-banner .banner-icon {
  font-size: 1.1rem;
}

.hidden-cols-banner .banner-actions {
  display: flex;
  gap: 0.4rem;
}

/* Empty state when all columns or areas are hidden */
.empty-hidden-cols {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--line);
  background: var(--card-subtle);
  border-radius: 14px;
}

.empty-hidden-cols h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  color: var(--ink);
}

.empty-hidden-cols p {
  margin: 0 0 1rem;
  font-size: 0.88rem;
}

/* Settings tab column visibility styling */
.cat-item.col-is-hidden {
  opacity: 0.55;
  border-style: dashed;
}

.cat-vis-btn {
  font-size: 0.82rem;
}

.cat-vis-btn.is-hidden {
  color: var(--warn);
}

/* ==================================================================
   NOTION SUITE: TABLE VIEW, GALLERY VIEW, DOCS & SOPS, NOTION HUB
   ================================================================== */

/* ------------------------------------------------------------------ Notion Table View */
.notion-table-wrap {
  margin-top: 1rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.notion-table-container {
  overflow-x: auto;
  max-width: 100%;
}

.notion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.notion-table th {
  background: var(--card-subtle, rgba(0, 0, 0, 0.03));
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.notion-table th:last-child {
  border-right: none;
}

.notion-table th:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--card-subtle));
}

.notion-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: middle;
}

.notion-table td:last-child {
  border-right: none;
}

.notion-table tr:last-child td {
  border-bottom: none;
}

.notion-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

.notion-table tr.row-done td {
  opacity: 0.6;
  text-decoration: line-through;
}

.notion-table tr.row-done td.no-strike {
  text-decoration: none;
}

.notion-cell-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.notion-cell-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.notion-pills-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.notion-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--card-subtle);
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ Notion Gallery View */
.notion-gallery-wrap {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.1rem;
}

.gallery-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  position: relative;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.gallery-card.done {
  opacity: 0.65;
}

.gallery-card-cover {
  height: 72px;
  width: 100%;
  position: relative;
  background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
}

.gallery-card-cover.cover-sunset {
  background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
}

.gallery-card-cover.cover-emerald {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.gallery-card-cover.cover-neon {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
}

.gallery-card-cover.cover-ocean {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.gallery-card-cover.cover-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%);
}

.gallery-card-icon {
  position: absolute;
  bottom: -16px;
  left: 14px;
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  background: var(--card);
  border-radius: 8px;
  padding: 2px 4px;
  border: 1px solid var(--line);
}

.gallery-card-body {
  padding: 1.3rem 0.9rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.gallery-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.35;
  margin: 0;
}

.gallery-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.gallery-card-notes {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-subtask-progress {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.35rem;
}

.gallery-subtask-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.gallery-subtask-fill {
  height: 100%;
  background: #10b981;
  border-radius: 999px;
}

/* ------------------------------------------------------------------ Notion Docs & SOPs Workspace */
.docs-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  min-height: 720px;
}

@media (max-width: 860px) {
  .docs-workspace {
    grid-template-columns: 1fr;
  }
}

.docs-sidebar {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}

.docs-sidebar-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--card-subtle);
}

.docs-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-title-row h2 {
  font-size: 1.1rem;
  margin: 0;
}

.docs-filter-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.docs-filter-row input[type="search"] {
  width: 100%;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}

.docs-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.doc-list-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
  user-select: none;
}

.doc-list-item:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.doc-list-item.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.doc-item-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.doc-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.doc-item-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-item-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.doc-category-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  color: var(--muted);
}

.doc-pin-badge {
  color: #f59e0b;
  font-size: 0.8rem;
}

/* Docs Main Pane (Reader / Editor) */
.docs-pane {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
}

.doc-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 4rem 1.5rem;
  gap: 0.75rem;
}

.doc-editor-empty .empty-icon {
  font-size: 3rem;
  opacity: 0.6;
}

.doc-editor-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0.75rem;
}

.doc-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.doc-meta-inputs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 240px;
}

.doc-icon-wrap {
  position: relative;
}

.doc-icon-btn {
  font-size: 1.8rem;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.1rem 0.4rem;
  cursor: pointer;
  line-height: 1.2;
}

.doc-icon-picker-popover {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
}

.doc-title-input {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  border: none;
  background: transparent;
  width: 100%;
  padding: 0.2rem 0;
  outline: none;
}

.doc-title-input:focus {
  border-bottom: 2px solid var(--accent);
}

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

.doc-blocks-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.6rem;
  background: var(--card-subtle);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.doc-content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.doc-content-textarea {
  width: 100%;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--card);
  resize: vertical;
  min-height: 400px;
}

.doc-content-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Notion Formatted Document Preview */
.doc-preview-pane {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--card);
  overflow-y: auto;
  line-height: 1.65;
  font-size: 0.96rem;
  color: var(--ink);
  min-height: 400px;
}

.doc-preview-pane h1,
.doc-preview-pane h2,
.doc-preview-pane h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.doc-preview-pane h1 { font-size: 1.6rem; }
.doc-preview-pane h2 { font-size: 1.35rem; }
.doc-preview-pane h3 { font-size: 1.15rem; }

.doc-preview-pane hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.doc-preview-pane p {
  margin: 0.5rem 0;
}

/* Notion Callout Blocks */
.doc-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin: 0.85rem 0;
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  font-size: 0.92rem;
}

.doc-callout.callout-warn {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.doc-callout.callout-tip {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.doc-callout-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.doc-callout-text {
  flex: 1;
}

/* Notion Checklists */
.doc-check-item {
  display: flex !important;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.45rem 0;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
  width: 100%;
}

.doc-check-item input[type="checkbox"],
.doc-check-box {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  flex-shrink: 0;
  margin: 0.2rem 0 0 0 !important;
  cursor: pointer;
  accent-color: var(--accent);
}

.doc-check-item span {
  flex: 1;
}

.doc-check-item.checked span {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Notion Tables inside Docs */
.doc-preview-pane table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.doc-preview-pane table th,
.doc-preview-pane table td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.75rem;
}

.doc-preview-pane table th {
  background: var(--card-subtle);
  font-weight: 600;
}

.doc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ Notion Modal & Cosmetics */
.notion-modal {
  max-width: 620px;
  width: 92vw;
}

.notion-modal-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: var(--card-subtle);
  border-bottom: 1px solid var(--line);
}

.notion-tab-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.84rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}

.notion-tab-btn.active {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
  font-weight: 600;
}

.notion-modal-body {
  padding: 1.25rem;
}

.notion-status-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  color: var(--muted);
}

.notion-status-badge.connected {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
}

.notion-status-badge.unconnected {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #f59e0b;
}

/* Card Cosmetics in Edit Sheet */
.card-cosmetics-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 0.5rem 0;
}

.cosmetics-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.notion-icon-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.icon-presets {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.notes-slash-helpers {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: -0.2rem;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   INFO BUBBLE BUTTONS & FEATURE GUIDE MODAL
   ========================================================================== */
.info-bubble-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-subtle);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.18s ease;
  vertical-align: middle;
  margin-left: 6px;
  opacity: 0.85;
}
.info-bubble-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  opacity: 1;
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.info-guide-modal {
  width: min(560px, 94vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.info-guide-body {
  margin: 1rem 0;
}
.info-guide-desc {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.info-guide-details {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.info-guide-item {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.45;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
}
.info-guide-item b {
  color: var(--accent);
}

/* Notion Step-by-Step Setup Guide Box */
.notion-help-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.notion-help-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.notion-help-step {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.4;
}
.notion-help-step b {
  color: #fbbf24;
}

/* Discovered Databases Chips */
.discovered-db-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 3px;
  color: var(--ink);
}
.discovered-db-chip:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fbbf24;
}

/* ------------------------------------------------------------------ Hygiene & Similar Tasks Reviewer */
.hygiene-pair-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.hygiene-pair-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.hygiene-score-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
}
.hygiene-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 680px) {
  .hygiene-compare-grid {
    grid-template-columns: 1fr;
  }
}
.hygiene-item-box {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.hygiene-item-text {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.4;
}
.hygiene-item-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hygiene-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* ==========================================================================
   Notion Checklists & Staging Hub
   ========================================================================== */
.staging-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  min-height: 720px;
}
@media (max-width: 860px) {
  .staging-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}
.staging-sidebar {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}
.staging-sidebar-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--card-subtle);
}
.staging-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.staging-title-row h2 {
  font-size: 1.1rem;
  margin: 0;
}
.staging-filter-row input[type="search"] {
  width: 100%;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}
.staging-sources-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.staging-source-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s ease;
  user-select: none;
}
.staging-source-card:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.staging-source-card.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.staging-source-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.staging-source-info {
  flex: 1;
  min-width: 0;
}
.staging-source-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staging-source-meta {
  font-size: 0.72rem;
  color: var(--muted);
}
.staging-source-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  color: var(--ink);
}
.staging-pane {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  gap: 0.85rem;
}
.staging-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}
.staging-db-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.staging-db-icon {
  font-size: 1.8rem;
}
.staging-active-title {
  margin: 0;
  font-size: 1.25rem;
}
.staging-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.seg-staging-filter {
  display: inline-flex;
  background: var(--seg-bg);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.seg-staging-filter .seg-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.seg-staging-filter .seg-btn.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}
.staging-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 720px;
}

/* Collapsible Subgroup Sections */
.staging-section-group {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-subtle);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.staging-section-group:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}
.staging-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: color-mix(in srgb, var(--card) 85%, var(--card-subtle));
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  gap: 0.75rem;
}
.staging-section-header:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}
.staging-section-header.is-collapsed {
  border-bottom: none;
}
.staging-section-header.is-complete {
  background: color-mix(in srgb, var(--ok) 8%, var(--card));
  border-color: color-mix(in srgb, var(--ok) 25%, var(--line));
}
.staging-section-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}
.staging-section-chevron {
  font-size: 0.75rem;
  color: var(--muted);
  width: 14px;
  display: inline-flex;
  justify-content: center;
  transition: transform 0.15s ease;
}
.staging-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.staging-section-count {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--seg-bg);
  color: var(--muted);
  line-height: 1.3;
}
.staging-section-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}
.staging-section-quick-toggle {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--card) 90%, var(--accent));
  color: var(--ink);
  cursor: pointer;
  line-height: 1.25;
  transition: all 0.12s ease;
  user-select: none;
}
.staging-section-quick-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.staging-section-quick-toggle.is-all-done {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: color-mix(in srgb, var(--card) 90%, var(--ok));
  color: var(--ok);
}
.staging-section-quick-toggle.is-all-done:hover {
  background: var(--ok);
  color: #fff;
  border-color: var(--ok);
}
.staging-section-progress-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.staging-section-header.is-complete .staging-section-progress-text {
  color: var(--ok);
  font-weight: 700;
}
.staging-section-progress-track {
  width: 52px;
  height: 5px;
  background: var(--bar-bg);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.staging-section-progress-fill {
  height: 100%;
  background: var(--ok);
  border-radius: 999px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subgroup Item Body - Compact, Streamlined To-do List Feel */
.staging-section-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.15rem 0.35rem 0.3rem 0.35rem;
  background: color-mix(in srgb, var(--card) 45%, var(--bg));
}
.staging-section-body[hidden] {
  display: none !important;
}
.staging-section-body .staging-item-card.is-subitem {
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  transition: background 0.1s ease, opacity 0.15s ease;
  cursor: pointer;
}
.staging-section-body .staging-item-card.is-subitem:last-child {
  border-bottom: none;
}
.staging-section-body .staging-item-card.is-subitem:hover {
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
}
.staging-section-body .staging-item-card.is-subitem .staging-item-main {
  min-height: 25px;
  padding: 0.18rem 0.5rem 0.18rem 0.7rem;
  gap: 0.45rem;
}
.staging-section-body .staging-item-card.is-subitem .staging-item-check {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  accent-color: var(--ok);
  cursor: pointer;
}
.staging-section-body .staging-item-card.is-subitem .staging-item-title {
  font-size: 0.78rem;
  font-weight: 450;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
}
.staging-section-body .staging-item-card.is-subitem .staging-item-title.checked {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.55;
}
.staging-section-body .staging-item-card.is-subitem .staging-item-actions {
  opacity: 0;
  transition: opacity 0.12s ease;
  gap: 0.2rem;
}
.staging-section-body .staging-item-card.is-subitem:hover .staging-item-actions {
  opacity: 1;
}
@media (hover: none) {
  .staging-section-body .staging-item-card.is-subitem .staging-item-actions {
    opacity: 0.65;
  }
}
.staging-section-body .staging-item-card.is-subitem .checklist-item-action-btn {
  font-size: 0.7rem;
  padding: 1px 3px;
  min-width: 18px;
  height: 18px;
  line-height: 1;
}
.staging-section-body .staging-item-card.is-subitem .staging-move-btn {
  font-size: 0.68rem;
  padding: 0.08rem 0.35rem;
  height: 18px;
  line-height: 1;
  border-radius: 3px;
}

.staging-item-card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  transition: all 0.1s ease;
  overflow: hidden;
}
.staging-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0.65rem;
  min-height: 36px;
  width: 100%;
}
.staging-item-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--card) 96%, var(--accent));
}
.staging-item-card.is-moved {
  opacity: 0.55;
  background: var(--card-subtle);
}
.staging-item-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}
.staging-item-check {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #10b981;
  flex-shrink: 0;
  margin: 0;
}
.staging-item-content {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: wrap;
  line-height: 1.3;
}
.staging-item-title {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  user-select: none;
  cursor: pointer;
}
.staging-item-title.checked {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.75;
}
.staging-item-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.staging-tag {
  font-size: 0.66rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.2;
}
.staging-tag.prio-high {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  font-weight: 600;
}
.staging-tag.staging-subtask-badge {
  cursor: pointer;
  font-weight: 600;
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.3);
  background: rgba(2, 132, 199, 0.08);
  transition: all 0.12s ease;
}
.staging-tag.staging-subtask-badge:hover {
  background: rgba(2, 132, 199, 0.18);
  border-color: #0284c7;
}
.staging-tag.staging-subtask-badge.done {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}
.staging-subtasks-drawer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.25rem 0.65rem 0.4rem 2.1rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--card-subtle) 40%, transparent);
}
.staging-subtasks-drawer[hidden] {
  display: none !important;
}
.staging-subtask-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 22px;
  font-size: 0.77rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  line-height: 1.35;
  padding: 2px 0;
  transition: color 0.1s ease;
}
.staging-subtask-row:hover {
  color: var(--accent);
}
.staging-subtask-check {
  width: 14px;
  height: 14px;
  accent-color: #10b981;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.staging-subtask-row.checked .staging-subtask-text {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.65;
}
.staging-item-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}
.staging-item-card:hover .staging-item-actions {
  opacity: 1;
}
.staging-moved-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* ------------------------------------------------------------------ Checklists Hub Compact Styling */
.staging-head-btns {
  display: flex;
  align-items: center;
  gap: 5px;
}
.staging-title-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.staging-active-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.checklist-batch-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}
.checklist-progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.45rem 0.75rem;
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.checklist-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
}
.checklist-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .checklist-progress-track,
:root:not([data-theme="light"]) .checklist-progress-track {
  background: rgba(255, 255, 255, 0.1);
}
.checklist-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.checklist-quick-add-wrap {
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px dashed var(--line);
  background: var(--card-subtle);
}
.checklist-quick-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.checklist-quick-form .input {
  flex: 1;
  min-width: 160px;
  min-height: 32px;
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
}
.checklist-quick-form .chip-select {
  min-height: 32px;
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
}
.checklist-quick-form .btn.primary {
  min-height: 32px;
  padding: 0.28rem 0.7rem;
  font-size: 0.82rem;
}
.checklist-cat-pills-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 0.2rem;
}
.checklist-cat-pills-list {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.checklist-cat-pill {
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s ease;
}
.checklist-cat-pill:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.checklist-cat-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.checklist-cat-pill.ghost-pill {
  border-style: dashed;
  opacity: 0.85;
}
.checklist-cat-pill.ghost-pill:hover {
  opacity: 1;
  background: var(--btn-hover);
}
.checklist-emoji-picker-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.emoji-btn {
  font-size: 1.15rem;
  padding: 3px 5px;
  cursor: pointer;
}
.checklist-item-action-btn {
  padding: 2px 5px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1;
  transition: all 0.12s ease;
}
.checklist-item-action-btn:hover {
  background: var(--card-subtle);
  color: var(--ink);
}
.checklist-item-action-btn.danger-text:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.staging-source-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s ease;
}
.staging-source-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.staging-source-name {
  font-size: 0.84rem;
  font-weight: 600;
}
.staging-source-meta {
  font-size: 0.7rem;
  color: var(--muted);
}
.staging-source-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin-top: 3px;
  overflow: hidden;
}
.staging-source-progress-fill {
  height: 100%;
  background: #10b981;
  border-radius: 999px;
}




/* ==========================================================================
   IMPROVISED FEATURES: Habits, Timeline, Invoicing, Wealth, Radar & Shortcuts
   ========================================================================== */

/* Vim / Keyboard Power-User Navigation */
.card.keyboard-focused {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45) !important;
  transform: translateY(-2px);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* Daily Habits & Micro-Routine Matrix */
.daily-habits-card {
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius, 12px);
  padding: 16px 20px;
}
.habits-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.habits-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.habits-badge-icon {
  font-size: 1.5rem;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.habits-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.habits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.habit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all 0.15s ease;
}
[data-theme="dark"] .habit-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
.habit-card.habit-done {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}
.habit-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}
.habit-check-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.habit-done .habit-check-circle {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}
.habit-info {
  display: flex;
  flex-direction: column;
}
.habit-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.habit-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted, #64748b);
}
.habit-streak {
  font-weight: 700;
  color: #f59e0b;
}
.habit-history-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}
.habit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}
[data-theme="dark"] .habit-dot {
  background: rgba(255, 255, 255, 0.15);
}
.habit-dot.dot-done {
  background: #10b981;
}

/* Today Timeline & Timeboxing */
.timeline-wrap {
  margin-top: 14px;
  padding: 20px;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.timeline-body-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .timeline-body-grid {
    grid-template-columns: 1fr;
  }
}
.timeline-slots-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline-slot-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  min-height: 48px;
  transition: all 0.15s ease;
}
[data-theme="dark"] .timeline-slot-row {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.07);
}
.timeline-slot-time {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--muted, #64748b);
  width: 50px;
  flex-shrink: 0;
  padding-top: 4px;
}
.timeline-slot-content {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.timeline-slot-task {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 6px;
}
[data-theme="dark"] .timeline-slot-task {
  background: #252423;
  border-color: rgba(255, 255, 255, 0.12);
}
.timeline-slot-empty {
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
  font-style: italic;
}
.timeline-unscheduled-column {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
[data-theme="dark"] .timeline-unscheduled-column {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.07);
}
.timeline-unscheduled-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.timeline-unscheduled-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 500px;
  overflow-y: auto;
}
.timeline-task-pill {
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.12s ease;
}
.timeline-task-pill:hover {
  border-color: #3b82f6;
  transform: translateX(2px);
}
[data-theme="dark"] .timeline-task-pill {
  background: #252423;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Invoicing */
.invoicing-card {
  margin-bottom: 20px;
}
.invoicing-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.invoicing-kpi {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
[data-theme="dark"] .invoicing-kpi {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
.invoicing-kpi span {
  font-size: 0.75rem;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  font-weight: 600;
}
.invoicing-kpi b {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 4px;
}
.invoice-status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.invoice-status-pill.status-paid {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.invoice-status-pill.status-sent {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
.invoice-status-pill.status-draft {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

/* Net Worth & Wealth Balance Sheet */
.wealth-card {
  margin-bottom: 16px;
}
.wealth-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.wealth-kpi {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
[data-theme="dark"] .wealth-kpi {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
.wealth-kpi span {
  font-size: 0.75rem;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  font-weight: 600;
}
.wealth-kpi b {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 4px;
}
.asset-alloc-bar-wrap {
  margin: 12px 0 16px 0;
}
.asset-alloc-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
}
.alloc-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}
.alloc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.78rem;
}
.alloc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.alloc-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Contract Notice Radar */
.contract-urgency-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.contract-urgency-badge.urgency-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.contract-urgency-badge.urgency-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.contract-urgency-badge.urgency-normal {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

/* Web Clipper */
.clipper-content-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
[data-theme="dark"] .clipper-content-box {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.07);
}
.clipper-drag-area {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.bookmarklet-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff !important;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  cursor: grab;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  transition: all 0.15s ease;
}
.bookmarklet-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}
.input-with-copy {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.input-with-copy input {
  flex: 1;
  font-family: monospace;
  font-size: 0.8rem;
}

/* Shortcuts modal */
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}
.shortcuts-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}
[data-theme="dark"] .shortcuts-table td {
  border-color: rgba(255, 255, 255, 0.08);
}
.kbd-key {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
[data-theme="dark"] .kbd-key {
  background: #1e1d1c;
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

/* ==========================================================================
   ACTIVE FILTERS & CHIP STYLING
   ========================================================================== */

/* Prominent highlight on active select dropdowns & button chips */
.chip-select.filter-active,
.chip.filter-active,
.chip[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.16) !important;
  border-color: #3b82f6 !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}
[data-theme="dark"] .chip-select.filter-active,
[data-theme="dark"] .chip.filter-active,
[data-theme="dark"] .chip[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.25) !important;
  border-color: #60a5fa !important;
  color: #93c5fd !important;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35) !important;
}

/* Active Filters Indicator Strip */
.active-filters-bar {
  margin: 6px 0 12px 0;
  padding: 8px 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1.5px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  animation: fadeIn 0.15s ease-out;
}
[data-theme="dark"] .active-filters-bar {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(96, 165, 250, 0.4);
}
.active-filters-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.active-filters-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
[data-theme="dark"] .active-filters-label {
  color: #93c5fd;
}
.active-filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--card);
  border: 1.5px solid #3b82f6;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: all 0.12s ease;
}
[data-theme="dark"] .active-filter-pill {
  background: #1e1d1c;
  color: #e2e8f0;
  border-color: #60a5fa;
}
.active-filter-pill-remove {
  cursor: pointer;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  background: none;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.active-filter-pill-remove:hover {
  color: #ef4444;
}
#clearAllFiltersBtn {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.06);
  cursor: pointer;
  transition: all 0.12s ease;
}
#clearAllFiltersBtn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

/* ==========================================================================
   MOBILE PRIVACY BLUR & SPEND IDENTIFICATION TRIAGE
   ========================================================================== */
body.privacy-blur .wealth-kpi b,
body.privacy-blur .kpi b,
body.privacy-blur .savings-stat b,
body.privacy-blur .cf-val,
body.privacy-blur .tax-kpi-val,
body.privacy-blur #txTable td.num,
body.privacy-blur #byCard td.num,
body.privacy-blur #bizByAccount td.num,
body.privacy-blur #bizTxTable td.num,
body.privacy-blur #recurring td.num {
  filter: blur(7px);
  transition: filter 0.18s ease;
  user-select: none;
}
body.privacy-blur .wealth-kpi:hover b,
body.privacy-blur .kpi:hover b,
body.privacy-blur #txTable tr:hover td.num,
body.privacy-blur #byCard tr:hover td.num {
  filter: blur(0);
}

.unidentified-triage-box {
  margin: 10px 0 14px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.09), rgba(59, 130, 246, 0.07));
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
}
.triage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.triage-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}
.triage-merchant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 10px;
}
.triage-merchant-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.triage-merchant-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.triage-merchant-name {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.triage-merchant-amt {
  font-weight: 700;
  font-size: 0.85rem;
  color: #dc2626;
  white-space: nowrap;
}
.triage-merchant-example {
  font-size: 0.74rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.triage-merchant-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.triage-merchant-actions select {
  flex: 1;
  font-size: 0.78rem;
  padding: 4px 8px;
}

/* ==========================================================================
   INTEGRATED BRIEFING + HABITS & DEDICATED SUBMENU BARS
   ========================================================================== */
.integrated-habits-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="light"] .integrated-habits-section {
  border-top-color: var(--line);
}
.habits-inline-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}
.integrated-habits-section .habits-badge-icon {
  width: 28px;
  height: 28px;
  font-size: 1.05rem;
  border-radius: 7px;
}
.integrated-habits-section .habits-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.integrated-habits-section .habit-card {
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
[data-theme="light"] .integrated-habits-section .habit-card {
  background: var(--bg);
}
.integrated-habits-section .habit-name {
  color: var(--ink) !important;
  font-size: 0.83rem;
}

/* Prominent Secondary Submenu Bar for Personal Money & Business Money */
.section-subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--accent, #d97706);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 8px;
  z-index: 40;
}
.subnav-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.subnav-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-right: 10px;
  border-right: 1px solid var(--line);
}
.subnav-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.subnav-pill {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.subnav-pill:hover {
  color: var(--ink);
  background: rgba(128, 128, 128, 0.1);
}
.subnav-pill.active {
  background: rgba(217, 119, 6, 0.16);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .subnav-pill.active {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.4);
}

/* Streamlined Unified Board Command Bar & Compact Empty Inbox */
.unified-board-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
}
.unified-board-bar .search-box {
  flex: 1 1 200px;
  min-width: 170px;
}
.unified-board-bar .layoutbar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.filter-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  color: #111827;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  margin-left: 2px;
}
.board-tools-popover {
  min-width: 240px;
  right: 0;
  left: auto;
  padding: 8px;
}
.board-tools-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.tool-menu-item {
  width: 100%;
  justify-content: flex-start !important;
  text-align: left;
  padding: 7px 10px !important;
  font-size: 0.82rem !important;
  border-radius: 7px !important;
}
.tool-menu-item:hover {
  background: rgba(245, 158, 11, 0.12) !important;
}
.filters-drawer {
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
}
.inbox.empty {
  padding: 7px 14px !important;
  margin-bottom: 10px !important;
  min-height: 0 !important;
}
.inbox.empty .column-head {
  margin-bottom: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.inbox.empty .inbox-help,
.inbox.empty .inbox-items {
  display: none !important;
}
.inbox:not(.empty) .inbox-empty-inline-msg {
  display: none !important;
}

/* Editable Statement Folder Path Box */
.scan-folder-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.scan-device-buttons-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.scan-device-buttons-row .btn {
  flex: 1 1 auto;
  justify-content: center;
}
.scan-folder-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.scan-folder-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scan-folder-input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem !important;
  padding: 6px 10px !important;
  background: var(--card) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: 7px !important;
}
