/* ============================================================
   Life Command Center — design system
   ============================================================ */
:root {
  --bg: #0a0e17;
  --bg-2: #0f1522;
  --panel: #141b2b;
  --panel-2: #1a2233;
  --panel-3: #212c42;
  --line: #26314a;
  --line-soft: #1e2740;
  --text: #e8edf6;
  --muted: #8a97b0;
  --muted-2: #647089;
  --accent: #4f9dff;
  --accent-2: #6ee7d8;
  --danger: #f4685e;
  --warn: #fbbf24;
  --good: #34d399;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #16233d 0%, transparent 55%),
              radial-gradient(900px 500px at -10% 110%, #1a1430 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }
hr.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3551; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #36436a; }

/* ---- Layout ---------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px; flex: 0 0 42px;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff;
  box-shadow: 0 6px 18px -6px rgba(79, 157, 255, 0.7);
}
.brand-title { font-weight: 700; font-size: 15.5px; }
.brand-sub { font-size: 11.5px; color: var(--muted-2); letter-spacing: 0.04em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 14px; text-align: left;
  font-family: inherit; transition: background 0.15s, color 0.15s; position: relative;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav-ico { font-size: 16px; width: 20px; text-align: center; }
.nav-item.subtle { color: var(--muted-2); }
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.sidebar-tag { font-size: 11px; color: var(--muted-2); padding: 8px 12px 2px; }
.cloud-status { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: none; background: transparent; color: var(--muted); font-family: inherit; font-size: 12px; cursor: pointer; border-radius: 9px; text-align: left; }
.cloud-status:hover { background: var(--panel); color: var(--text); }
.cloud-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--muted-2); }
.cloud-status.ok .cloud-dot { background: var(--good); }
.cloud-status.off .cloud-dot { background: var(--warn); }
.cloud-status.err .cloud-dot { background: var(--danger); }
.cloud-status.busy .cloud-dot { background: var(--accent); animation: pulse 1.4s infinite; }
.cloud-settings h4 { margin-bottom: 6px; }
.cloud-settings .settings-actions { margin-top: 10px; }
.cloud-settings .cloud-dot { display: inline-block; vertical-align: middle; margin-right: 5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 13px 26px; background: rgba(10, 14, 23, 0.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 650; font-size: 16px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.menu-btn { display: none; }
.view { padding: 26px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ---- Buttons --------------------------------------------------------- */
.btn {
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  border-radius: 10px; padding: 9px 15px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); transition: all 0.15s; white-space: nowrap;
}
.btn:hover { border-color: #3a4566; transform: translateY(-1px); background: var(--panel-3); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #6f7bff); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: rgba(244, 104, 94, 0.4); }
.btn.danger.ghost:hover { background: rgba(244, 104, 94, 0.12); }
.btn.tiny { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.full { width: 100%; margin-top: 12px; }
.icon-btn {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: 20px; width: 34px; height: 34px; border-radius: 8px; line-height: 1;
  display: grid; place-items: center; transition: all 0.15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; font-size: 13px; }

/* ---- Page head ------------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin-top: 5px; max-width: 620px; }
.section-h { margin: 28px 0 14px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- Cards ----------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 7px; }

/* ---- Hero ------------------------------------------------------------ */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(120deg, #15203a 0%, #161d33 60%, #1c1733 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: radial-gradient(circle, rgba(79,157,255,0.18), transparent 70%); }
.hero-greet { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.hero-sub { color: var(--muted); margin-top: 6px; max-width: 560px; }
.hero-date { text-align: right; z-index: 1; }
.hero-day { font-size: 17px; font-weight: 650; color: var(--accent-2); }
.hero-full { color: var(--muted); font-size: 13px; }

/* ---- Stat strip ------------------------------------------------------ */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-val { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; }
.stat-label { color: var(--text); font-size: 13px; margin-top: 2px; }
.stat-sub { color: var(--muted-2); font-size: 11.5px; }

/* ---- Dashboard grid -------------------------------------------------- */
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dash-grid .span2 { grid-column: span 2; }

.priority-stack { display: flex; flex-direction: column; gap: 8px; }
.priority-row { display: flex; align-items: center; gap: 13px; padding: 11px 12px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px; }
.priority-rank { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--accent), #7c5cff); color: #fff; }
.priority-body { flex: 1; min-width: 0; }
.priority-focus { font-weight: 600; }
.priority-track { color: var(--muted); font-size: 12px; }

.mini-list { display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--muted-2); font-size: 13px; padding: 14px; text-align: center; }
.empty.big { padding: 50px; font-size: 14px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }

.mini-task { display: flex; gap: 11px; align-items: flex-start; padding: 9px 10px; background: var(--panel-2); border-radius: 9px; border: 1px solid var(--line-soft); }
.mini-task.done .mini-task-title { text-decoration: line-through; color: var(--muted-2); }
.mini-task-body { flex: 1; min-width: 0; }
.mini-task-title { font-size: 13.5px; }
.mini-task-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.check { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 6px; border: 2px solid var(--line); background: transparent; cursor: pointer; margin-top: 1px; transition: all 0.15s; }
.check:hover { border-color: var(--good); }
.check.on, .check:active { background: var(--good); border-color: var(--good); }
.dot-prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-prio.high { background: var(--danger); } .dot-prio.med { background: var(--warn); } .dot-prio.low { background: var(--muted-2); }

.pulse-grid { display: grid; gap: 12px; }
.pulse-item { background: var(--panel-2); border-radius: 9px; padding: 10px 12px; border: 1px solid var(--line-soft); }
.pulse-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.pulse-name { font-size: 12.5px; color: var(--muted); }
.pulse-val { font-weight: 700; font-size: 15px; }

.goal-row, .dec-row, .review-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; background: var(--panel-2); border-radius: 9px; border: 1px solid var(--line-soft); }
.dec-row, .review-row { justify-content: space-between; }
.dec-row { cursor: pointer; } .dec-row:hover { border-color: var(--accent); }
.goal-body, .dec-row > div:first-child { min-width: 0; }
.goal-title, .dec-title, .review-label { font-weight: 600; font-size: 13.5px; }

.bal-grid { display: grid; gap: 9px; }
.bal-row { display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 5px 6px; border-radius: 8px; }
.bal-row:hover { background: var(--panel-2); }
.bal-ico { width: 20px; } .bal-name { width: 96px; flex: 0 0 96px; font-size: 13px; }
.bal-track { flex: 1; height: 8px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.bal-fill { height: 100%; border-radius: 6px; }
.bal-count { width: 48px; text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Pills / chips --------------------------------------------------- */
.pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel-3); color: var(--muted); white-space: nowrap; }
.pill.ghost { background: transparent; border: 1px solid var(--line); }
.pill.warn { background: rgba(251,191,36,0.15); color: var(--warn); }
.s-active { background: rgba(52,211,153,0.16); color: var(--good); }
.s-researching { background: rgba(167,139,250,0.16); color: #b9a4ff; }
.s-incubating { background: rgba(96,165,250,0.16); color: #8fc1ff; }
.s-waiting { background: rgba(148,163,184,0.16); color: #aab6cc; }
.s-parked { background: rgba(148,163,184,0.12); color: var(--muted); }
.s-complete { background: rgba(110,231,216,0.14); color: var(--accent-2); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 7px; font-size: 11.5px; background: var(--panel-3); color: var(--muted); }
.chip.accent { background: rgba(79,157,255,0.16); color: #8fc1ff; }
.chip.warn { background: rgba(251,191,36,0.15); color: var(--warn); }
.chip.sm { font-size: 11px; padding: 2px 7px; }
.tag { font-size: 11px; color: var(--accent-2); }

/* ---- Toolbar / inputs ------------------------------------------------ */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; flex: 1; min-width: 200px; }
.search-ico { color: var(--muted-2); }
.search .inp { border: none; background: transparent; padding: 9px 0; }
.count-line { margin-bottom: 10px; }

.inp {
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; width: 100%; transition: border 0.15s; outline: none;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,157,255,0.12); }
textarea.inp { resize: vertical; line-height: 1.5; }
select.inp { cursor: pointer; }
.inp[type="color"] { padding: 3px; height: 38px; cursor: pointer; }
.slider { -webkit-appearance: none; appearance: none; height: 6px; background: var(--panel-3); padding: 0; border: none; border-radius: 4px; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 0 0 4px rgba(79,157,255,0.2); }

/* ---- Forms ----------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 13px; }
.form-row { display: flex; gap: 12px; }
.form-row > .field { flex: 1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }

/* ---- Projects -------------------------------------------------------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 15px; }
.proj-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-left: 3px solid var(--pf, var(--accent));
  border-radius: var(--radius); padding: 16px; cursor: pointer; transition: all 0.16s; position: relative;
}
.proj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line); }
.proj-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.proj-value { font-size: 11.5px; color: var(--warn); font-weight: 600; }
.proj-name { font-size: 15.5px; margin-bottom: 5px; }
.proj-port { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.proj-obj { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 11px; }
.proj-foot { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Detail ---------------------------------------------------------- */
.detail-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 18px; }
.meta-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 11px; background: var(--panel-2); border-radius: 8px; font-size: 13px; }
.meta-label { color: var(--muted); } .meta-value { font-weight: 600; text-align: right; }
.detail-block { margin-bottom: 14px; }
.detail-block h4 { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.detail-block p { font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.detail-block.muted p { color: var(--muted-2); }
.detail-tasks { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---- Portfolios ------------------------------------------------------ */
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.port-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-top: 3px solid var(--pf, var(--line)); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: all 0.16s; }
.port-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.port-card-head { display: flex; gap: 13px; align-items: center; margin-bottom: 12px; }
.port-ico { font-size: 30px; width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; background: color-mix(in srgb, var(--pf, var(--line)) 16%, transparent); border-radius: 12px; }
.port-card-head h3 { font-size: 16px; }
.port-emph { color: var(--muted); font-size: 13px; margin-bottom: 12px; min-height: 36px; }
.port-need { background: var(--panel-2); border-radius: 9px; padding: 9px 11px; margin-bottom: 11px; display: flex; flex-direction: column; gap: 2px; }
.need-label { font-size: 10px; letter-spacing: 0.08em; color: var(--pf); font-weight: 700; }
.port-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.port-list { display: flex; flex-direction: column; gap: 8px; }
.port-list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 12px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; cursor: pointer; }
.port-list-row:hover { border-color: var(--accent); }
.plr-name { font-weight: 600; } .plr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }

/* ---- Tasks board ----------------------------------------------------- */
.task-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.task-col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.task-col.drag-over { border-color: var(--accent); background: var(--panel); }
.task-col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; font-weight: 650; font-size: 13.5px; }
.col-count { background: var(--panel-3); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.task-col-body { display: flex; flex-direction: column; gap: 9px; min-height: 40px; }
.tcard { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--pf, var(--accent)); border-radius: 10px; padding: 11px; cursor: grab; }
.tcard:active { cursor: grabbing; }
.tcard.done { opacity: 0.55; } .tcard.done .tcard-title { text-decoration: line-through; }
.tcard-top { display: flex; gap: 9px; align-items: flex-start; }
.tcard-title { font-size: 13.5px; flex: 1; }
.tcard-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 0 29px; }
.tcard-actions { display: flex; gap: 2px; margin: 6px 0 0 25px; }

/* ---- Goals ----------------------------------------------------------- */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 15px; }
.goal-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; border-top: 3px solid var(--pf); }
.goal-card-top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.goal-card-info h3 { font-size: 15.5px; margin-bottom: 6px; }
.goal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-metric { background: var(--panel-2); border-radius: 9px; padding: 9px 11px; margin-bottom: 10px; }
.goal-slider { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.goal-slider .slider { flex: 1; }
.goal-pct { font-variant-numeric: tabular-nums; font-weight: 700; width: 42px; text-align: right; }
.goal-card-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---- Ideas ----------------------------------------------------------- */
.quick-wrap { margin-bottom: 16px; }
.quick-capture { font-size: 15px; padding: 13px 16px; }
.idea-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 13px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.idea-col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.idea-col.drag-over { border-color: var(--accent); }
.idea-col-head { display: flex; justify-content: space-between; margin-bottom: 11px; font-weight: 650; font-size: 13px; }
.idea-col-body { display: flex; flex-direction: column; gap: 9px; min-height: 40px; }
.idea-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px; cursor: grab; }
.idea-title { font-weight: 600; font-size: 13.5px; margin-bottom: 7px; }
.idea-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.idea-cat { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(79,157,255,0.16); color: #8fc1ff; cursor: pointer; }
.idea-cat:hover { background: rgba(79,157,255,0.28); }
.idea-subcat { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel-3); color: var(--muted); cursor: pointer; }
.idea-subcat:hover { color: var(--text); }
.idea-note { color: var(--muted); font-size: 12px; margin: 7px 0; }
.filter-ico { font-size: 15px; }
.idea-actions { display: flex; gap: 4px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

/* ---- Trackers -------------------------------------------------------- */
.tracker-datebar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.tracker-date { display: flex; flex-direction: column; gap: 2px; }
.tracker-date .inp { padding: 6px 9px; }
.tracker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 15px; }
.tracker-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-top: 3px solid var(--pf); border-radius: var(--radius); padding: 16px; }
.tracker-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.tracker-ico { font-size: 22px; width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; background: color-mix(in srgb, var(--pf) 16%, transparent); border-radius: 11px; }
.tracker-card-head h3 { font-size: 14.5px; }
.streak { margin-left: auto; font-size: 13px; }
.toggle-big { width: 100%; padding: 13px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel-2); color: var(--text); font-weight: 650; font-size: 14px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.toggle-big:hover { border-color: var(--good); }
.toggle-big.on { color: #06210f; }
.num-control { display: flex; align-items: center; gap: 9px; }
.num-inp { font-size: 19px; font-weight: 700; text-align: center; }
.num-unit { color: var(--muted); font-size: 13px; }
.tracker-spark { margin-top: 14px; }
.spark-cap { text-align: right; margin-top: 2px; }
.tracker-actions { margin-top: 10px; }

/* ---- Reviews --------------------------------------------------------- */
.review-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.review-start-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }
.review-ico { font-size: 34px; display: block; margin-bottom: 8px; }
.review-start-card h3 { margin-bottom: 6px; }
.review-start-card .btn { margin-top: 14px; }
.review-hist-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; cursor: pointer; }
.review-hist-row:hover { border-color: var(--accent); }
.rh-title { font-weight: 600; }
.review-run { display: flex; flex-direction: column; gap: 4px; }
.review-check { display: flex; gap: 11px; align-items: flex-start; padding: 11px 12px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; cursor: pointer; transition: all 0.15s; }
.review-check:hover { border-color: var(--line); }
.review-check.checked { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.3); }
.review-check.checked span { color: var(--muted); text-decoration: line-through; }
.review-check input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--good); cursor: pointer; }
.review-notes { margin-top: 14px; } .review-notes h4 { margin-bottom: 7px; font-size: 13px; color: var(--muted); }

/* ---- Vault ----------------------------------------------------------- */
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; }
.vault-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-left: 3px solid var(--pf); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: all 0.16s; }
.vault-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.vault-title { font-size: 15px; margin-bottom: 7px; }
.vault-body { color: var(--muted); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.vault-foot { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 12px; }
.vault-date { margin-left: auto; }
.vault-tags-line { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.vault-read { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.6; color: var(--text); margin: 0; background: var(--panel-2); padding: 16px; border-radius: 10px; max-height: 50vh; overflow: auto; }

/* ---- Children & XP --------------------------------------------------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.child-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-top: 3px solid var(--pf); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: all 0.16s; }
.child-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.child-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.child-avatar { font-size: 30px; width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; background: color-mix(in srgb, var(--pf) 18%, transparent); border-radius: 14px; }
.child-card-id { flex: 1; min-width: 0; } .child-card-id h3 { font-size: 16px; }
.level-badge { background: linear-gradient(135deg, var(--pf, var(--accent)), #7c5cff); color: #fff; font-weight: 800; font-size: 11px; padding: 4px 9px; border-radius: 7px; letter-spacing: 0.03em; white-space: nowrap; }
.level-badge.big { font-size: 13px; padding: 6px 13px; }
.child-xp-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.child-xp-info { flex: 1; }
.child-xp-big { font-size: 22px; font-weight: 750; } .child-xp-big .muted { font-size: 14px; font-weight: 500; }
.streak-line { color: var(--warn); font-size: 12.5px; font-weight: 600; margin-top: 3px; }
.child-spark { margin-bottom: 12px; }
.interest-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.interest-chip { background: var(--panel-3); color: var(--text); font-size: 12px; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.interest-chip.removable { padding-right: 6px; }
.chip-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.chip-x:hover { color: var(--danger); }
.child-card-foot { display: flex; gap: 8px; }

.child-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.back-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 8px 14px; cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 600; }
.back-btn:hover { background: var(--panel-3); }
.child-hero { display: flex; align-items: center; gap: 18px; background: linear-gradient(120deg, color-mix(in srgb, var(--pf) 18%, var(--panel)), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.child-hero-avatar { font-size: 46px; width: 78px; height: 78px; flex: 0 0 78px; display: grid; place-items: center; background: color-mix(in srgb, var(--pf) 22%, transparent); border-radius: 20px; }
.child-hero-id { flex: 1; } .child-hero-id h1 { font-size: 27px; }
.child-hero-level { width: 230px; text-align: right; }
.level-bar { height: 8px; background: var(--panel-3); border-radius: 6px; overflow: hidden; margin: 9px 0 5px; }
.level-bar-fill { height: 100%; border-radius: 6px; transition: width 0.3s; }

.today-xp { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.today-xp-big { font-size: 17px; } .tx-num { font-size: 30px; font-weight: 800; }
.tiles-label { margin-bottom: 8px; display: block; }
.block-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 8px; }
.block-tile { background: var(--panel-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--pf); border-radius: 10px; padding: 10px 8px; cursor: pointer; text-align: center; position: relative; transition: all 0.14s; }
.block-tile:hover { transform: translateY(-2px); background: var(--panel-3); }
.block-ico { font-size: 20px; display: block; } .block-name { font-size: 10.5px; color: var(--muted); display: block; margin: 3px 0; line-height: 1.2; }
.block-xp { font-size: 13px; font-weight: 700; display: block; }
.block-add { position: absolute; top: 5px; right: 8px; color: var(--muted-2); font-weight: 700; }

.xp-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 6px; }
.xp-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.xp-bar-track { position: relative; width: 100%; flex: 1; display: flex; align-items: flex-end; background: var(--bg-2); border-radius: 6px 6px 0 0; }
.xp-bar-fill { width: 100%; border-radius: 6px 6px 0 0; min-height: 2px; transition: height 0.3s; }
.xp-target-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--warn); opacity: 0.6; }
.xp-bar-val { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.xp-bar-day { font-size: 11px; color: var(--muted-2); }

.ms-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ms-block { background: var(--bg-2); border: 1px solid var(--line-soft); border-top: 2px solid var(--pf); border-radius: 11px; padding: 12px; }
.ms-block-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 650; margin-bottom: 9px; }
.ms-list { display: flex; flex-direction: column; gap: 6px; }
.ms-row { display: flex; align-items: center; gap: 8px; padding: 6px 7px; background: var(--panel-2); border-radius: 8px; }
.ms-row.done .ms-title { text-decoration: line-through; color: var(--muted-2); }
.ms-title { flex: 1; font-size: 12.5px; }

.interest-edit { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 6px 0 4px; }
.interest-input { width: 150px; padding: 6px 10px; font-size: 12.5px; }
.row-check { flex-direction: row; align-items: center; gap: 9px; }
.row-check input { width: 17px; height: 17px; accent-color: var(--accent); }

.xp-quick { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.xp-chip { background: var(--panel-3); border: 1px solid var(--line); color: var(--text); border-radius: 7px; padding: 4px 9px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.xp-chip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.xp-log { display: flex; flex-direction: column; gap: 7px; }
.xp-log-row { display: flex; align-items: center; gap: 11px; padding: 9px 11px; background: var(--panel-2); border-radius: 9px; border: 1px solid var(--line-soft); }
.xp-log-block { width: 8px; height: 34px; border-radius: 4px; flex: 0 0 8px; }
.xp-log-body { flex: 1; min-width: 0; }
.xp-log-subj { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.bonus-tag { background: rgba(251,191,36,0.18); color: var(--warn); font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 4px; letter-spacing: 0.04em; }
.xp-log-amt { font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; }

.bonus-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.bonus-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px; }
.bonus-amt { font-size: 18px; font-weight: 800; width: 52px; flex: 0 0 52px; }
.bonus-body { flex: 1; min-width: 0; } .bonus-title { font-weight: 600; font-size: 13.5px; }

/* ---- Project page (planner + AI chat) -------------------------------- */
.project-page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 2px solid var(--pf, var(--line)); }
.pph-title { flex: 1; min-width: 0; }
.pph-title h1 { font-size: 24px; }
.pph-meta { display: flex; align-items: center; gap: 9px; margin-top: 6px; flex-wrap: wrap; }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.planner-col, .chat-col { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.chat-col { display: flex; flex-direction: column; min-height: 540px; max-height: calc(100vh - 200px); position: sticky; top: 84px; }

.planner-progress { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.pp-bar { flex: 1; height: 8px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.pp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--good)); border-radius: 6px; transition: width 0.3s; }

.phase-card { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 11px; padding: 13px; margin-bottom: 11px; }
.phase-card.done { border-left-color: var(--good); opacity: 0.85; }
.phase-head { display: flex; align-items: flex-start; gap: 10px; }
.phase-num { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #7c5cff); color: #fff; font-weight: 800; font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
.phase-titles { flex: 1; min-width: 0; }
.phase-title { font-weight: 650; font-size: 14.5px; }
.phase-note { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.phase-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.phase-tools { display: flex; gap: 1px; flex: 0 0 auto; }
.milestone-list { margin: 11px 0 0 34px; display: flex; flex-direction: column; gap: 5px; }
.milestone-row { display: flex; align-items: center; gap: 9px; padding: 5px 7px; background: var(--panel-2); border-radius: 8px; }
.milestone-row.done .ms-text { text-decoration: line-through; color: var(--muted-2); }
.ms-text { flex: 1; font-size: 13px; }
.ms-add { padding: 6px 9px; font-size: 12.5px; background: transparent; border-style: dashed; }

/* chat */
.chat-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 4px 10px; }
.chat-hello { text-align: center; padding: 18px 8px; }
.chat-hello .btn { margin-top: 10px; }
.chat-bubble { max-width: 86%; padding: 10px 13px; border-radius: 13px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.chat-bubble.user { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #6f7bff); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.assistant { align-self: flex-start; background: var(--panel-3); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble.err { background: rgba(244,104,94,0.14); color: #ffb3ad; border: 1px solid rgba(244,104,94,0.3); }
.chat-bubble.typing { display: flex; gap: 4px; align-items: center; }
.chat-bubble.typing .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.chat-bubble.typing .dot:nth-child(2) { animation-delay: 0.2s; } .chat-bubble.typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.chat-composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.chat-input { resize: none; flex: 1; }
.send-btn { flex: 0 0 auto; height: 40px; }

.ai-connect { text-align: center; padding: 40px 20px; }
.ai-connect-ico { font-size: 40px; margin-bottom: 10px; }
.ai-connect h4 { margin-bottom: 7px; }
.ai-connect .btn { margin-top: 14px; }

.proposal { align-self: stretch; background: linear-gradient(180deg, rgba(110,231,216,0.08), var(--panel-2)); border: 1px solid rgba(110,231,216,0.35); border-radius: 13px; padding: 13px; }
.proposal-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.proposal-badge { font-weight: 700; font-size: 13px; color: var(--accent-2); }
.proposal-summary { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.proposal-phase { background: var(--bg-2); border-radius: 9px; padding: 9px 11px; margin-bottom: 7px; }
.pp-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.pp-ms { margin: 0; padding-left: 18px; }
.pp-ms li { font-size: 12.5px; color: var(--muted); margin: 2px 0; }
.proposal-actions { display: flex; gap: 8px; margin-top: 10px; }

.ai-settings h4 { margin-bottom: 6px; }
.ai-settings .field { margin-top: 10px; }
.ai-status { font-size: 12.5px; color: var(--muted-2); align-self: center; }
.ai-status.ok { color: var(--good); }

/* ---- Finances -------------------------------------------------------- */
.finance-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.finance-bar .inp { width: auto; }
.kpi-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi-tiles.small { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 4px; }
.kpi-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi-val { font-size: 23px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.kpi-sub { font-size: 11px; color: var(--muted-2); }
.kpi-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi-input { font-size: 14px; }

.finance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.finance-grid .span2 { grid-column: span 2; }

.pl-statement { display: flex; flex-direction: column; }
.pl-row { display: flex; align-items: baseline; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.pl-row:last-child { border-bottom: none; }
.pl-row.sub { padding-left: 14px; color: var(--muted); font-size: 12.5px; }
.pl-row.total { font-weight: 700; border-top: 1.5px solid var(--line); border-bottom: none; margin-top: 2px; }
.pl-label { flex: 1; } .pl-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.pl-row.sub .pl-val { font-weight: 500; }
.pl-val.neg { color: var(--danger); }
.pl-note { font-size: 11px; color: var(--muted-2); flex: 0 0 auto; }
.bs-head { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin: 12px 0 4px; }
.bs-head:first-child { margin-top: 0; }

.fin-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.fin-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; }
.fin-bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fin-bar { width: 42%; border-radius: 4px 4px 0 0; min-height: 2px; }
.fin-bar.in { background: var(--good); } .fin-bar.out { background: var(--warn); }
.fin-bar-day { font-size: 10.5px; color: var(--muted-2); }
.fin-legend { display: flex; gap: 10px; font-size: 11.5px; }
.fin-legend .in { color: var(--good); } .fin-legend .out { color: var(--warn); }

.budget-list { display: flex; flex-direction: column; gap: 11px; }
.budget-row { }
.budget-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.budget-cat { font-weight: 600; } .budget-fig { color: var(--muted); font-variant-numeric: tabular-nums; }
.budget-fig.over { color: var(--danger); font-weight: 700; }
.budget-track { height: 7px; background: var(--panel-3); border-radius: 5px; overflow: hidden; }
.budget-fill { height: 100%; border-radius: 5px; transition: width 0.3s; }
.budget-actions { display: flex; justify-content: flex-end; gap: 2px; margin-top: 2px; }

.breakdown { display: flex; flex-direction: column; gap: 8px; }
.bd-row { display: flex; align-items: center; gap: 10px; }
.bd-cat { width: 120px; flex: 0 0 120px; font-size: 12.5px; }
.bd-track { flex: 1; height: 9px; background: var(--panel-3); border-radius: 5px; overflow: hidden; }
.bd-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #7c5cff); border-radius: 5px; }
.bd-amt { width: 72px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }

.ledger { display: flex; flex-direction: column; gap: 6px; }
.ledger-row { display: flex; align-items: center; gap: 11px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; }
.led-date { font-size: 12px; color: var(--muted-2); width: 42px; flex: 0 0 42px; font-variant-numeric: tabular-nums; }
.led-body { flex: 1; min-width: 0; } .led-cat { font-weight: 600; font-size: 13px; }
.led-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.led-amt.income { color: var(--good); } .led-amt.expense { color: var(--warn); }
.led-actions { display: flex; gap: 1px; }
.ledger-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.entity-tag { font-size: 10px; font-weight: 600; color: #fbbf24; background: rgba(251,191,36,0.14); padding: 1px 7px; border-radius: 5px; }
.attach-tag { font-size: 10px; color: var(--accent-2); }
.ledger-row.reviewed { opacity: 0.62; }
.ledger-row.reviewed .led-cat { text-decoration: none; }

/* entity table + management */
.entity-table { display: flex; flex-direction: column; }
.entity-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1.2fr 1.2fr; gap: 8px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); font-size: 13px; cursor: pointer; }
.entity-row:hover:not(.head) { background: var(--panel-2); }
.entity-row.head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-2); cursor: default; font-weight: 700; }
.entity-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.entity-row .num.neg { color: var(--danger); }
.ent-name { font-weight: 600; }
.ent-manage-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.ent-manage-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 12px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; }
.ai-classify-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.split-wrap { display: flex; flex-direction: column; gap: 8px; }
.split-panel { background: var(--panel-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.split-rows { display: flex; flex-direction: column; gap: 8px; }
.split-row { display: flex; gap: 8px; align-items: center; }
.split-row .split-val { width: 110px; flex: 0 0 110px; }
.split-remainder { font-weight: 600; }
.led-cat { display: flex; align-items: center; gap: 7px; }
.noncash-tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; color: var(--muted); background: var(--panel-3); padding: 1px 6px; border-radius: 5px; }
.led-amt.noncash { color: var(--muted-2); font-style: italic; }
.mileage-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rate-inp { width: 74px; padding: 5px 8px; font-size: 13px; }
.mileage-summary { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.mileage-summary b { font-size: 18px; font-variant-numeric: tabular-nums; }
.trip-calc { padding-top: 4px; font-weight: 600; color: var(--accent-2); }
.rate-hint { display: block; font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.rate-table { display: flex; flex-direction: column; gap: 8px; }
.rate-row { display: flex; align-items: center; gap: 12px; }
.rate-year { width: 52px; flex: 0 0 52px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rate-row .rate-inp { width: 100px; flex: 0 0 100px; }

.biz-fields { background: var(--panel-2); border-radius: 10px; padding: 12px; }

/* Businesses list */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; }
.biz-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-top: 3px solid var(--warn); border-radius: var(--radius); padding: 17px; cursor: pointer; transition: all 0.16s; }
.biz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.biz-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.biz-ico { font-size: 26px; width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; background: rgba(251,191,36,0.16); border-radius: 12px; }
.biz-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 13px; }
.biz-stat { background: var(--panel-2); border-radius: 8px; padding: 9px; text-align: center; }
.biz-stat-v { display: block; font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums; }
.biz-stat-l { font-size: 11px; color: var(--muted); }

/* Finances hub */
.fin-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.fin-hub-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: all 0.16s; }
.fin-hub-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.fin-hub-card.personal { border-left: 3px solid var(--good); max-width: 520px; }
.fhc-top { display: flex; gap: 11px; align-items: center; margin-bottom: 12px; }
.fhc-ico { font-size: 22px; }
.fhc-name { font-weight: 650; font-size: 15px; }
.fhc-figs { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.fhc-figs b { font-variant-numeric: tabular-nums; }

.nw-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: center; }
.nw-hero { text-align: center; }
.nw-hero-val { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nw-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; text-align: left; }
.nw-bar { display: grid; grid-template-columns: 70px 1fr auto; gap: 9px; align-items: center; font-size: 12.5px; }
.nw-bar-lbl { color: var(--muted); }
.nw-bar-track { height: 10px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.nw-bar-fill { height: 100%; border-radius: 6px; }
.nw-bar-fill.asset { background: var(--good); } .nw-bar-fill.liab { background: var(--danger); }
.nw-bar-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 760px) { .nw-split { grid-template-columns: 1fr; } }

/* Transaction page */
.review-toggle { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; }
.review-toggle input { width: 16px; height: 16px; accent-color: var(--good); }
.txn-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.txn-save { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.attach-drop { border: 1.5px dashed var(--line); border-radius: 11px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: all 0.15s; margin-bottom: 14px; }
.attach-drop:hover, .attach-drop.over { border-color: var(--accent); background: var(--panel-2); color: var(--text); }
.attach-grid { display: flex; flex-direction: column; gap: 9px; }
.attach-tile { display: flex; align-items: center; gap: 11px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px; }
.attach-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; display: block; }
.attach-file { width: 52px; height: 52px; display: grid; place-items: center; background: var(--panel-3); border-radius: 8px; font-size: 24px; text-decoration: none; }
.attach-meta { flex: 1; min-width: 0; }
.attach-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-actions { display: flex; align-items: center; gap: 4px; }
.attach-dl { text-decoration: none; font-size: 15px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.attach-dl:hover { background: var(--panel-3); color: var(--text); }
@media (max-width: 860px) { .txn-grid { grid-template-columns: 1fr; } }

/* Finance audit dashboard */
.preset-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.preset-chip { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-family: inherit; text-align: left; }
.preset-chip:hover { border-color: var(--accent); color: var(--text); }
.ai-ask { display: flex; gap: 9px; align-items: flex-end; }
.ai-ask textarea { flex: 1; resize: vertical; }
.ai-ask .btn { height: 40px; }
.ai-out { margin-top: 14px; }
.ai-analysis { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.dup-list { display: flex; flex-direction: column; gap: 10px; }
.dup-group { background: var(--panel-2); border: 1px solid rgba(251,191,36,0.3); border-radius: 10px; padding: 10px 12px; }
.dup-head { font-weight: 650; font-size: 13px; margin-bottom: 7px; }
.dup-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.audit-progress { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.audit-progress .pp-bar { flex: 1; }

/* ---- Clock bar (active time tracking) -------------------------------- */
.clockbar { position: fixed; bottom: 20px; right: 22px; z-index: 90; display: none; align-items: center; gap: 13px; background: linear-gradient(135deg, #14233f, var(--panel-2)); border: 1px solid var(--accent); border-radius: 13px; padding: 11px 15px; box-shadow: var(--shadow-lg), 0 0 0 4px rgba(79,157,255,0.12); max-width: 340px; pointer-events: none; }
.clockbar .clock-out { pointer-events: auto; } /* drops must pass through the bar, but Clock out stays clickable */
.clockbar.show { display: flex; animation: clockIn 0.25s ease; }
@keyframes clockIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.clock-pulse { width: 11px; height: 11px; border-radius: 50%; background: var(--good); flex: 0 0 11px; box-shadow: 0 0 0 0 rgba(52,211,153,0.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.5); } 70% { box-shadow: 0 0 0 9px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.clock-info { min-width: 0; flex: 1; }
.clock-task { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.clock-time { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.clock-out { background: var(--danger) !important; border-color: transparent !important; color: #fff !important; }
.btn.clockon { background: var(--danger); border-color: transparent; color: #fff; }
.clock-mini { background: var(--panel-3); border: 1px solid var(--line); color: var(--text); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; flex: 0 0 28px; font-size: 11px; transition: all 0.14s; }
.clock-mini:hover { border-color: var(--accent); }
.clock-mini.on { background: var(--danger); border-color: transparent; color: #fff; }
.tcard.running, .mini-task.running { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ---- Connection task person checks ----------------------------------- */
.task-people { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 9px 0 0 29px; }
.tp-label { font-size: 11px; color: var(--muted); margin-right: 2px; }
.tp-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px 3px 6px; cursor: pointer; font-family: inherit; color: var(--text); transition: all 0.14s; }
.tp-chip:hover { border-color: var(--accent); }
.tp-chip.on { font-weight: 600; }
.tp-emoji { font-size: 13px; } .tp-initial { font-size: 11.5px; }

/* ---- Connection (People) view ---------------------------------------- */
.neglect-banner { display: flex; align-items: center; gap: 14px; background: linear-gradient(120deg, rgba(244,104,94,0.14), var(--panel)); border: 1px solid rgba(244,104,94,0.35); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.neglect-banner.neutral { background: linear-gradient(120deg, rgba(79,157,255,0.12), var(--panel)); border-color: var(--line); }
.nb-emoji { font-size: 26px; } .nb-title { font-weight: 700; font-size: 15.5px; } .nb-sub { color: var(--muted); font-size: 13px; }
.neglect-banner > div:nth-child(2) { flex: 1; }
.also-line { margin: -4px 0 16px 2px; }

.person-check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.person-check-row.compact { margin-top: 9px; }
.person-toggle { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 11px; padding: 8px 13px; cursor: pointer; font-family: inherit; color: var(--text); font-size: 13.5px; transition: all 0.14s; }
.person-toggle:hover { transform: translateY(-1px); border-color: var(--accent); }
.person-toggle .pt-emoji { font-size: 17px; }
.person-toggle.on { font-weight: 650; }
.pt-check { font-weight: 800; color: var(--muted-2); }
.person-toggle.on .pt-check { color: var(--good); }
.person-toggle.mini { padding: 5px 9px; font-size: 12px; border-radius: 9px; gap: 5px; }
.person-toggle.mini .pt-emoji { font-size: 14px; }
.con-top { margin-bottom: 4px; font-size: 13.5px; }

.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 15px; }
.person-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-left: 3px solid var(--pf); border-radius: var(--radius); padding: 16px; }
.person-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.person-rank { font-size: 12px; font-weight: 800; color: var(--muted-2); width: 26px; }
.person-emoji { font-size: 26px; width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; background: color-mix(in srgb, var(--pf) 18%, transparent); border-radius: 12px; }
.person-id { flex: 1; min-width: 0; } .person-id h3 { font-size: 15.5px; }
.person-status-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.person-since { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.ps-label { color: var(--muted); font-size: 12.5px; } .ps-value { font-weight: 700; font-size: 14px; }
.gap-track { height: 7px; background: var(--panel-3); border-radius: 5px; overflow: hidden; margin-bottom: 11px; }
.gap-fill { height: 100%; border-radius: 5px; transition: width 0.3s; }
.person-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 11px; }
.person-stats b { color: var(--text); }
.person-spark { margin-bottom: 12px; }
.person-foot { display: flex; gap: 7px; align-items: center; }
.person-hist-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.hist-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 11px; background: var(--panel-2); border-radius: 8px; font-size: 13px; }

/* ---- Topbar contextual page menu ------------------------------------- */
.page-menu-wrap { position: relative; }
.page-menu-btn { font-size: 14px; }
.page-menu-drop { display: none; position: absolute; top: 112%; left: 0; z-index: 80; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; }
.page-menu-drop.open { display: block; }
.page-menu-item { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); font: inherit; padding: 8px 11px; border-radius: 7px; cursor: pointer; }
.page-menu-item:hover { background: var(--panel-2); }

/* ---- Personal Finances: tabs + debt tracker -------------------------- */
.fin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 18px; }
.fin-tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font: inherit; font-weight: 600; padding: 9px 16px; cursor: pointer; border-radius: 8px 8px 0 0; }
.fin-tab:hover { color: var(--text); background: var(--panel-2); }
.fin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.bi-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.bi-acts { display: flex; gap: 3px; }
.debt-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.debt-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr 64px; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.debt-row:last-child { border-bottom: none; }
.debt-row.head { background: var(--panel-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
.debt-name { font-weight: 650; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.debt-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 999px; border: 1px solid transparent; }
.debt-tag.secured { color: #60a5fa; background: rgba(96, 165, 250, 0.12); border-color: rgba(96, 165, 250, 0.3); }
.debt-tag.unsecured { color: #fbbf24; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.3); }
.debt-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.debt-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 999px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
.debt-num { font-variant-numeric: tabular-nums; }
.debt-payoff { font-size: 13px; font-weight: 600; }
.debt-acts { display: flex; gap: 3px; justify-content: flex-end; }
.debt-foot { display: flex; align-items: center; gap: 26px; padding: 16px 14px 4px; flex-wrap: wrap; }
.debt-foot-tot .debt-tot { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.debt-foot .btn.primary { margin-left: auto; }
.debt-preview { margin-top: 8px; padding: 9px 12px; background: var(--panel-2); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
@media (max-width: 760px) { .debt-table { overflow-x: auto; } .debt-row { min-width: 620px; } }

/* ---- Personal Finances: Step 2 payoff plan --------------------------- */
.payoff-card { margin-top: 16px; }
.payoff-controls { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 16px; }
.payoff-results .kpi-tiles { margin-bottom: 12px; }
.payoff-compare { margin: 2px 0 16px; }
.payoff-sched { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.payoff-sched-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.payoff-sched-row:last-child { border-bottom: none; }
.payoff-sched-row.head { background: var(--panel-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
.payoff-sched-name { font-weight: 650; }
.payoff-ord { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 9px; border-radius: 50%; background: var(--accent); color: #0a0e17; font-size: 11px; font-weight: 800; }
@media (max-width: 620px) { .payoff-controls { grid-template-columns: 1fr; } }

/* ---- Clickable balance rows + Asset/Liability detail page ------------ */
.bi-row.clickable, .debt-row.clickable { cursor: pointer; transition: background .12s; }
.bi-row.clickable:hover, .debt-row.clickable:hover { background: var(--panel-2); }
.drag-handle { cursor: grab; color: var(--muted); font-size: 15px; line-height: 1; user-select: none; touch-action: none; padding: 5px; margin: -5px; }
.drag-handle:hover { color: var(--text); }
.drag-handle:active { cursor: grabbing; }
.bi-row.dragging, .debt-row.dragging { opacity: 0.45; }
.bi-row.drag-over, .debt-row.drag-over { box-shadow: inset 0 2px 0 0 var(--accent); }
.dn-row { display: flex; align-items: center; gap: 7px; }
.export-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Sortable tiles (drag-to-reorder) + flagged-business list -------- */
.tile-grip { font-size: 14px; align-self: center; }
.biz-card.dragging, .proj-card.dragging, .fin-hub-card.dragging { opacity: 0.45; }
.biz-card.drag-over, .proj-card.drag-over, .fin-hub-card.drag-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.flagged-list { display: flex; flex-direction: column; gap: 8px; }
.flagged-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.flagged-name { font-weight: 650; }
.flagged-acts { display: flex; gap: 6px; }

/* ---- Connection: emoji drop-up + type priority ---------------------- */
.emoji-pick { position: relative; display: inline-block; }
.emoji-pick-btn { font-size: 22px; line-height: 1; width: 60px; height: 38px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--text); }
.emoji-pick-btn:hover { border-color: var(--accent); }
.emoji-pop { display: none; position: absolute; bottom: 100%; left: 0; margin-bottom: 6px; z-index: 90; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); width: max-content; }
.emoji-pop.open { display: grid; }
.emoji-pop.down { top: 100%; bottom: auto; margin-top: 6px; margin-bottom: 0; }
.emoji-opt { font-size: 20px; line-height: 1; background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; }
.emoji-opt:hover { background: var(--panel-2); }
.prio-list { display: flex; flex-direction: column; gap: 6px; }
.prio-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; }
.prio-rank { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #0a0e17; font-size: 11px; font-weight: 800; flex: none; }
.prio-name { flex: 1; font-weight: 600; }
.prio-arrows { display: flex; gap: 2px; }
.prio-row.dragging { opacity: 0.45; }
.prio-row.drag-over { box-shadow: inset 0 2px 0 0 var(--accent); }

/* ---- Project groups (manual sort) ----------------------------------- */
.groups-bar { margin-bottom: 14px; }
.proj-groups { display: flex; flex-direction: column; gap: 24px; }
.proj-group-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.pg-name { font-weight: 700; font-size: 15px; }
.pg-acts { margin-left: auto; display: flex; gap: 2px; }
.pg-empty { padding: 14px 2px; }
.proj-card-top .proj-value { margin-left: auto; }
.card-grip { color: var(--muted); }
.manual-link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.bi-link { font-weight: 600; border-bottom: 1px dashed var(--line); }
.bi-row.clickable:hover .bi-link { border-bottom-color: var(--accent); color: var(--accent); }
.pph-name { font-weight: 700; font-size: 15px; }
.reveal-wrap { display: flex; gap: 6px; align-items: center; }
.reveal-wrap .inp { flex: 1; min-width: 0; }
.reveal-btn { flex: none; white-space: nowrap; }
.bi-cat-fields { display: flex; flex-direction: column; gap: 12px; }
.bi-cat-fields:empty { display: none; }
.bi-custom-head { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 2px; flex-wrap: wrap; }
.bi-custom-head h4 { margin: 0; font-size: 14px; }
.bi-custom { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.bi-custom-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
@media (max-width: 560px) { .bi-custom-row { grid-template-columns: 1fr 1fr auto; } }

/* ---- Résumé / CV builder --------------------------------------------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rz-profile { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.rz-name { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.rz-headline { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 2px; }
.rz-contact { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.rz-summary { margin: 10px 0 0; font-size: 13.5px; color: var(--text); max-width: 70ch; }
.rz-section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 9px; }
.rz-section-head h3 { font-size: 15px; }
.rz-empty { color: var(--muted-2); font-size: 13px; padding: 8px 2px 4px; }
.rz-list { display: flex; flex-direction: column; gap: 10px; }
.rz-card { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; position: relative; }
.rz-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rz-card-org { font-weight: 700; font-size: 14.5px; }
.rz-card-title { color: var(--muted); font-size: 13px; margin-top: 1px; }
.rz-card-date { color: var(--muted-2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rz-card-bullets { margin: 9px 0 0; padding-left: 18px; }
.rz-card-bullets li { font-size: 13px; margin-bottom: 3px; color: var(--text); }
.rz-card-actions { display: flex; gap: 4px; margin-top: 10px; justify-content: flex-end; }
.rz-skill-list { display: flex; flex-direction: column; gap: 6px; }
.rz-skill { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 13px; }
.rz-skill-name { font-weight: 650; font-size: 13.5px; }
.rz-skill-detail { color: var(--muted); font-size: 13px; }
.rz-skill-actions { display: flex; gap: 3px; }
.rz-bullets-edit { display: flex; flex-direction: column; gap: 6px; }
.rz-bullet-edit { display: flex; gap: 5px; align-items: center; }
.rz-bullet-edit .inp { flex: 1; }
.rz-current { display: flex; align-items: center; gap: 6px; height: 38px; }
.rz-current input { width: 17px; height: 17px; accent-color: var(--accent); }
/* export selector */
.rz-ver-row { display: flex; gap: 6px; align-items: center; }
.rz-ver-row .inp { flex: 1; }
.rz-export-tree { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 10px; background: var(--bg-2); }
.rz-ex-row { display: flex; align-items: flex-start; gap: 8px; padding: 3px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.rz-ex-row:hover { background: var(--panel-2); }
.rz-ex-row input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 15px; }
.rz-ex-row.section { font-weight: 700; margin-top: 7px; color: var(--text); }
.rz-ex-row.section:first-child { margin-top: 0; }
.rz-ex-row.entry { margin-left: 20px; color: var(--text); font-weight: 550; }
.rz-ex-row.bullet { margin-left: 40px; color: var(--muted); }

/* ---- Auth gate (login wall) ------------------------------------------ */
.gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 80% -10%, #16233d 0%, transparent 55%),
              radial-gradient(800px 460px at -10% 110%, #1a1430 0%, transparent 50%), var(--bg); }
.gate-wrap { width: 100%; max-width: 400px; }
.gate-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 38px 30px; text-align: center; }
.gate-mark { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.gate-title { font-size: 22px; font-weight: 750; letter-spacing: -0.01em; margin-bottom: 10px; }
.gate-card p { margin: 0 0 22px; color: var(--muted); }
.gate-btn { display: flex; width: 100%; justify-content: center; }
.gate-spin { width: 30px; height: 30px; margin: 6px auto 16px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: gate-spin 0.8s linear infinite; }
@keyframes gate-spin { to { transform: rotate(360deg); } }

/* ---- Modal ----------------------------------------------------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(5, 8, 14, 0.72); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 24px; opacity: 0; transition: opacity 0.2s; overflow-y: auto; }
.modal-overlay.show { opacity: 1; }
.modal { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; max-height: 90vh; display: flex; flex-direction: column; transform: translateY(12px) scale(0.99); transition: transform 0.2s; }
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; padding: 15px 20px; border-top: 1px solid var(--line); align-items: center; }

/* ---- Toast ----------------------------------------------------------- */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel-3); border: 1px solid var(--line); color: var(--text); padding: 11px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: all 0.25s; }
.toast.show { opacity: 1; transform: none; }
.toast.err { border-color: var(--danger); color: #ffb3ad; }
/* A toast that asks rather than tells needs to be clickable, so it opts back
   into pointer events the wrap turns off for the plain ones. */
.toast.has-action { display: flex; align-items: center; gap: 12px; padding-right: 8px; pointer-events: auto; }
.toast-action {
  background: var(--accent); border: 0; color: #fff; font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; min-height: 30px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.toast-action:hover { filter: brightness(1.12); }

/* ---- Settings -------------------------------------------------------- */
.settings-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.mini-stat { background: var(--panel-2); border-radius: 9px; padding: 12px; text-align: center; }
.mini-stat-v { display: block; font-size: 22px; font-weight: 750; }
.mini-stat-l { font-size: 11.5px; color: var(--muted); }
.settings-actions { display: flex; flex-direction: column; gap: 9px; }
.danger-zone { background: rgba(244,104,94,0.06); border: 1px solid rgba(244,104,94,0.25); border-radius: 11px; padding: 14px; }
.danger-zone h4 { color: var(--danger); margin-bottom: 9px; font-size: 13px; }

/* ---- SVG helpers ----------------------------------------------------- */
.spark { display: block; } .spark-empty { fill: var(--muted-2); font-size: 9px; }
.ring-txt { fill: var(--text); font-size: 13px; font-weight: 700; }
svg.ring { flex: 0 0 auto; }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid .span2 { grid-column: span 2; }
  .review-cards { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .chat-col { position: static; max-height: none; min-height: 460px; }
  .finance-grid { grid-template-columns: 1fr; }
  .finance-grid .span2 { grid-column: span 1; }
  .kpi-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform 0.25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .span2 { grid-column: span 1; }
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-date { text-align: left; }
  .form-row { flex-direction: column; }
  .page-head { flex-direction: column; }
  .view { padding: 18px 16px; }
  .kpi-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Daily Bread + Hierarchy + Prerequisites (added feature set)
   ============================================================ */

/* ---- shared bits ---- */
.pill.blocked { background: rgba(244,104,94,0.16); color: var(--danger); }
.btn.good { background: rgba(52,211,153,0.18); border-color: transparent; color: var(--good); }
.btn.good:hover { background: rgba(52,211,153,0.28); }
.check.sm { width: 18px; height: 18px; flex: 0 0 18px; }
.emoji-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emoji-pal { display: flex; flex-wrap: wrap; gap: 2px; max-width: 320px; }
.hier-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ---- prerequisites ---- */
.prereq-list { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: 6px; background: var(--bg-2); }
.prereq-item { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.prereq-item:hover { background: var(--panel-2); }
.prereq-item input { flex: 0 0 auto; }
.prereq-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- day-of-week controls ---- */
.day-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.day-check { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12.5px; background: var(--panel-2); }
.day-check input { margin: 0; }
.day-chip { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 6px; font-size: 11px; font-weight: 700; color: var(--muted-2); background: var(--panel-2); border: 1px solid var(--line-soft); }
.day-chip.on { color: #fff; background: color-mix(in srgb, var(--pf, var(--accent)) 60%, var(--panel-3)); border-color: transparent; }
.day-chip.today { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- Daily Bread ---- */
.bread-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.bread-neglect { display: flex; align-items: center; gap: 10px; background: rgba(244,104,94,0.10); border: 1px solid rgba(244,104,94,0.35); color: var(--text); border-radius: 11px; padding: 11px 15px; margin-bottom: 18px; font-size: 13.5px; }
.bread-neglect .bn-ico { font-size: 18px; }
.bread-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.bread-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-top: 3px solid var(--pf); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.bread-card.met { border-top-color: var(--good); }
.bread-card.running { box-shadow: 0 0 0 2px color-mix(in srgb, var(--pf) 45%, transparent) inset; }
.bread-card-head { display: flex; align-items: center; gap: 12px; }
.bread-emoji { font-size: 26px; width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; background: color-mix(in srgb, var(--pf) 16%, transparent); border-radius: 12px; }
.bread-title-wrap { flex: 1; min-width: 0; }
.bread-name { font-size: 16px; }
.bread-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.bread-type { font-size: 11.5px; color: var(--muted); }
.bread-streak { text-align: center; flex: 0 0 auto; }
.bread-streak .streak-num { display: block; font-weight: 750; font-size: 15px; }
.bread-days { display: flex; gap: 5px; }
.bread-prog { display: flex; flex-direction: column; gap: 5px; }
.bread-bar { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.bread-bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s; }
.bread-prog-text { font-size: 12.5px; color: var(--muted); }
.bread-heat { display: flex; flex-wrap: wrap; gap: 3px; }
.bread-heat .he { width: 13px; height: 13px; border-radius: 3px; background: var(--panel-3); }
.bread-heat .he-met { background: var(--good); }
.bread-heat .he-miss { background: rgba(244,104,94,0.55); }
.bread-heat .he-today { background: transparent; border: 1.5px solid var(--warn); }
.bread-heat .he-off { background: var(--panel-2); opacity: 0.5; }
.bread-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }

/* ---- Hierarchy tree ---- */
.hier-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hier-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; color: var(--muted); font-size: 12.5px; }
.hier-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.tl-badge { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 6px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line-soft); }
.tl-badge.tl-0 { border-left: 3px solid #60a5fa; } .tl-badge.tl-1 { border-left: 3px solid #a78bfa; }
.tl-badge.tl-2 { border-left: 3px solid #34d399; } .tl-badge.tl-3 { border-left: 3px solid #fbbf24; }
.tl-badge.tl-4 { border-left: 3px solid #8a97b0; }
.tree { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.tree-row { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-bottom: 1px solid var(--line-soft); border-left: 3px solid transparent; min-height: 40px; }
.tree-row:last-child { border-bottom: none; }
.tree-row:hover { background: var(--panel); }
.tree-row.tl-0 { border-left-color: #60a5fa; background: color-mix(in srgb, #60a5fa 6%, transparent); }
.tree-row.tl-1 { border-left-color: #a78bfa; }
.tree-row.tl-2 { border-left-color: #34d399; }
.tree-row.tl-3 { border-left-color: #fbbf24; }
.tree-row.tl-4 { border-left-color: #8a97b0; }
.tree-row.done .tree-label { text-decoration: line-through; color: var(--muted); }
.tree-toggle { background: none; border: none; color: var(--muted); cursor: pointer; width: 20px; height: 20px; flex: 0 0 20px; border-radius: 5px; font-size: 11px; display: grid; place-items: center; }
.tree-toggle:hover { background: var(--panel-2); color: var(--text); }
.tree-toggle.leaf { cursor: default; }
.tree-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--muted-2); }
.tree-label { cursor: pointer; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.tree-badges { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tree-count { background: var(--panel-2); border-radius: 999px; padding: 1px 7px; }
.tree-acts { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.tree-acts .icon-btn { opacity: 0.55; }
.tree-row:hover .tree-acts .icon-btn { opacity: 1; }

/* ---- subtasks on task cards ---- */
.subtask-list { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; padding-left: 4px; border-left: 2px solid var(--line-soft); }
.subtask-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; font-size: 12.5px; }
.subtask-row.done .subtask-title { text-decoration: line-through; color: var(--muted-2); }
.subtask-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtask-lock { font-size: 11px; }
.chip.sm.blocked { background: rgba(244,104,94,0.16); color: var(--danger); }

@media (max-width: 860px) {
  .bread-summary { grid-template-columns: repeat(3, 1fr); }
  .tree-label { max-width: 38vw; }
}

/* ---- Portfolios: display modes (Cards / Workbench / Master-detail) ---- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.seg button { background: transparent; border: none; color: var(--muted); font-family: inherit; font-size: 12.5px; padding: 8px 13px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: linear-gradient(135deg, rgba(79, 157, 255, 0.22), rgba(124, 92, 255, 0.22)); color: var(--text); }
.pf-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.pf-statline { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; }
.pf-pct { font-size: 12px; color: var(--muted); min-width: 34px; text-align: right; }
.pf-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.pf-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pf-loose-card { border-style: dashed; border-top-style: solid; cursor: default; }
.pf-loose-card:hover { transform: none; box-shadow: none; }
.pf-loose-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; margin-bottom: 6px; cursor: pointer; }
.pf-loose-row:hover { border-color: var(--accent); }
.pf-assign { display: flex; gap: 8px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pf-assign select { flex: 1; min-width: 0; }

/* workbench */
.wb-dom-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.wb-dom-head .section-h { margin: 0; }
.wb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.wb-box { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-top: 3px solid var(--pf, var(--line)); border-radius: var(--radius); padding: 13px 13px 11px; }
.wb-box.wb-loose { border-style: dashed; border-top-style: solid; }
.wb-box-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.wb-box-head h4 { font-size: 14px; }
.wb-box-head h4[title] { cursor: pointer; }
.wb-box-head h4[title]:hover { color: var(--accent); }
.wb-rollups { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 11.5px; color: var(--muted); margin-bottom: 9px; }
.wb-rows { min-height: 36px; display: flex; flex-direction: column; gap: 6px; }
.wb-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; }
.wb-row .wb-name { flex: 1; font-size: 13px; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-row .wb-name:hover { color: var(--accent); }
.wb-row.dragging { opacity: 0.45; }
.wb-row.drag-over { box-shadow: inset 0 2px 0 0 var(--accent); }
.wb-pct { font-size: 11px; color: var(--muted-2); }
.wb-foot { display: flex; gap: 6px; align-items: center; margin-top: 9px; }
.wb-empty { border: 1px dashed var(--line-soft); border-radius: 9px; padding: 9px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* master-detail */
.md-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.md-rail { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 75px; max-height: calc(100vh - 89px); overflow-y: auto; } /* 61px sticky topbar + 14px gap */
.md-dom { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 8px 5px; display: flex; gap: 7px; align-items: center; }
.md-leaf { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 9px; border: 1px solid transparent; background: transparent; color: var(--text); font-family: inherit; font-size: 13px; border-radius: 9px; cursor: pointer; text-align: left; }
.md-leaf:hover { background: var(--panel-2); }
.md-leaf.sel { background: var(--panel-2); border-color: var(--accent); }
.md-leaf .md-count { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--panel-3); border-radius: 999px; padding: 2px 8px; }
.md-leaf.md-loose-leaf { color: var(--muted); font-style: italic; }
.md-pane { min-width: 0; }
.md-pane-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.md-pane-head .port-ico { font-size: 26px; }
.md-pane-acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.md-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.md-stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.md-stat-label { font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
.md-stat-v { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 7px; }
.md-row .md-name { flex: 1; min-width: 0; cursor: pointer; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-row .md-name:hover { color: var(--accent); }
.md-next { font-size: 11.5px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-check { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex: 0 0 17px; }
.md-bulk { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; margin-top: 12px; }
.md-bulk select { flex: 1 1 200px; width: auto; min-width: 0; } /* .inp's width:100% would stack the bar into a column */
.pf-flash { animation: pfflash 1.6s ease-out 1; }
@keyframes pfflash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 760px) {
  .md-wrap { grid-template-columns: 1fr; }
  .md-rail { position: static; display: flex; align-items: center; overflow-x: auto; gap: 4px; padding: 8px; }
  .md-dom { padding: 4px 6px; white-space: nowrap; }
  .md-leaf { width: auto; white-space: nowrap; }
  .md-leaf .md-count { margin-left: 6px; }
  .md-row .pp-bar { display: none; }
  .md-next { display: none; }
}

/* ============================================================
   POA&M — Plan of Action & Milestones
   A diagonal time axis with dots (grandchildren) coloured by
   category (children). Solid ring = hard deadline, dotted = soft.
   ============================================================ */
/* the chart's own colours live on .poam so App.POAM.render works in any host element */
.poam { --poam-bg: #0d1421; --poam-axis: #5d6d90; }
.poam-card { padding: 16px 16px 12px; margin-bottom: 18px; overflow: hidden; }
.poam-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.poam-head-titles { flex: 1; min-width: 220px; }
.poam-head-titles h3 { font-size: 15px; }
.poam-head-acts { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.poam-seg button { padding: 7px 11px; }

.poam-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.poam-canvas {
  position: relative; width: 1000px; height: 600px; flex: 0 0 auto; margin: 0 auto;
  background: radial-gradient(700px 380px at 78% 8%, #16233d 0%, transparent 60%), var(--poam-bg);
  border: 1px solid var(--line); border-radius: 12px;
}
.poam-svg { position: absolute; inset: 0; display: block; }
.poam-tick-txt { fill: var(--muted-2); font-size: 10px; font-family: inherit; letter-spacing: 0.04em; }
.poam-today-txt { fill: var(--good); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; font-family: inherit; }

/* phase columns */
.poam-phase-label {
  position: absolute; display: flex; flex-direction: column; gap: 1px;
  background: none; border: none; border-left: 2px solid var(--pc, var(--accent));
  padding: 2px 0 2px 8px; text-align: left; cursor: pointer; font-family: inherit; color: var(--text);
  border-radius: 0 6px 6px 0; transition: background 0.15s; z-index: 3;
}
.poam-phase-label:hover { background: rgba(255, 255, 255, 0.05); }
.poam-phase-name { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poam-phase-note { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* dots */
.poam-mark { cursor: grab; outline: none; }
.poam-mark:hover { filter: brightness(1.25); }
.poam-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.poam-mark.dragging { cursor: grabbing; opacity: 0.85; }
/* clamped onto the axis end because its date is outside the visible window — click only */
.poam-mark.pinned { cursor: pointer; }
.poam-drag-tip {
  position: absolute; transform: translateX(-50%); background: var(--panel-3); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; font-size: 11px;
  font-weight: 700; letter-spacing: 0.03em; pointer-events: none; white-space: nowrap; z-index: 4;
}

/* dot labels */
.poam-label { position: absolute; z-index: 2; pointer-events: none; }
.poam-label-date { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: var(--pc, var(--muted)); letter-spacing: 0.05em; }
.poam-label-title {
  pointer-events: auto; width: 100%; text-align: left; background: none; border: none;
  padding: 1px 0 0; margin: 0; font-family: inherit; font-size: 11.5px; line-height: 1.25; color: var(--text);
  cursor: pointer; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.poam-label-title:hover { color: var(--pc, var(--accent)); text-decoration: underline; }
.poam-label.done .poam-label-title { color: var(--muted-2); text-decoration: line-through; }
.poam-label.cat .poam-label-title { font-weight: 700; }

/* hard / soft key */
.poam-deadline { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; display: inline-block; border: 2px solid currentColor; }
.poam-deadline.hard { background: currentColor; }
.poam-deadline.soft { background: none; border-style: dotted; }

.poam-empty { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* legend */
.poam-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.poam-legend-label { font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.07em; margin-right: 2px; }
.poam-lg { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 8px; }
.poam-lg.off { opacity: 0.42; }
.poam-lg-swatch { width: 11px; height: 11px; border-radius: 50%; border: none; padding: 0; flex: 0 0 11px; background: var(--pc, var(--accent)); cursor: pointer; }
.poam-lg.off .poam-lg-swatch { background: none; border: 2px solid var(--pc, var(--accent)); }
.poam-lg-name { background: none; border: none; color: var(--text); font-family: inherit; font-size: 12px; cursor: pointer; padding: 0; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poam-lg-name:hover { color: var(--pc, var(--accent)); }
.poam-lg-n { font-size: 10.5px; color: var(--muted-2); background: var(--panel-3); border-radius: 999px; padding: 0 6px; }
.poam-lg-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.poam-lg-toggle input { width: 15px; height: 15px; accent-color: var(--accent); }
.poam-lg-key { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-2); margin-left: 4px; }
.poam-lg-key .poam-deadline { color: var(--muted); }

/* undated tray */
.poam-tray { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.poam-tray-label { font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.07em; }
.poam-tray-items { display: flex; gap: 6px; flex-wrap: wrap; }
.poam-tray-chip { background: var(--panel-2); border: 1px dashed var(--pc, var(--line)); color: var(--muted); border-radius: 7px; padding: 3px 9px; font-family: inherit; font-size: 11.5px; cursor: pointer; }
.poam-tray-chip:hover { color: var(--text); background: var(--panel-3); }

/* table view */
.poam-table-wrap { overflow-x: auto; }
.poam-tbl-head { margin: 12px 0 8px; }
.poam-tbl-head h4 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.poam-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.poam-table th { text-align: left; font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.poam-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.poam-table td .inp { padding: 5px 8px; font-size: 12.5px; }
.poam-table td:last-child { white-space: nowrap; text-align: right; }
.poam-table tr.done td { opacity: 0.55; }
.poam-table tr.done .poam-tbl-title { text-decoration: line-through; }
.poam-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: middle; }
.poam-sw.big { width: 26px; height: 26px; border-radius: 7px; margin: 0; flex: 0 0 26px; }
.poam-inspect-top { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.poam-inspect-name { font-weight: 650; font-size: 15px; }
.poam-hard-check { justify-content: flex-start; padding-top: 20px; }

/* deadline control (shared by every editor) */
.deadline-field { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.deadline-field > .field:first-child { flex: 0 0 190px; }
.deadline-hard { flex: 1; min-width: 200px; padding-top: 21px; }

/* ---- Portfolio / Domain pages --------------------------------------- */
.pph-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.page-lede { margin: -6px 0 16px; max-width: 78ch; }
.section-head { margin-top: 22px; }
.section-head h3 { font-size: 15px; }
.pfp-list { display: flex; flex-direction: column; gap: 7px; }
.pfp-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--pf, var(--line));
  border-radius: 10px;
}
.pfp-row:hover { background: var(--panel-2); }
.pfp-name { background: none; border: none; color: var(--text); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 0; text-align: left; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfp-name:hover { color: var(--accent); }
.pfp-bar { display: flex; align-items: center; gap: 7px; width: 130px; flex: 0 0 130px; }
.phase-dates { margin-top: 2px; letter-spacing: 0.04em; }
.phase-title { display: flex; align-items: center; gap: 7px; }

@media (max-width: 900px) {
  .poam-head-acts { width: 100%; }
  .pfp-bar { display: none; }
  .deadline-field > .field:first-child { flex: 1 1 100%; }
  .deadline-hard { padding-top: 0; }
}
/* ============================================================
   Trackers upgrade — calendar heat grid + summary
   ============================================================ */
.tracker-summary { margin-bottom: 14px; }
.hab-heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; gap: 3px; margin: 10px 0 2px; overflow-x: auto; padding-bottom: 2px; }
.hab-heat .hh { width: 13px; height: 13px; border-radius: 3px; background: var(--panel-3); }
.hab-heat .hh-met { background: var(--pf, var(--good)); }
.hab-heat .hh-part { background: color-mix(in srgb, var(--pf, var(--good)) 35%, transparent); }
.hab-heat .hh-today { outline: 1.5px solid var(--warn); outline-offset: -1.5px; }
.hab-heat .hh-pad { background: transparent; }
.tracker-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Daily Bread — trackers quick check-off section */
.bread-trackers-card { margin-top: 18px; }
.bread-trackers { display: flex; flex-direction: column; gap: 6px; }
.bt-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--pf, var(--accent)); border-radius: 9px; }
.bt-ico { font-size: 17px; }
.bt-name { flex: 1; font-weight: 600; font-size: 13.5px; }
.bt-num { width: 90px; }
.bt-numwrap { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   Goals 2.0 — links, track pills
   ============================================================ */
.pill.good { background: rgba(52,211,153,0.15); color: var(--good); }
.pill.bad { background: rgba(244,104,94,0.16); color: var(--danger); }
.goal-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.link-chip { font-family: inherit; font-size: 11.5px; font-weight: 600; color: var(--text); background: var(--panel-3); border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 10px; cursor: pointer; transition: all 0.15s; }
.link-chip:hover { border-color: var(--accent); color: var(--accent); }
.goal-auto-cap { flex: 1; }
.goal-pick { min-width: 0; }
.goal-pick .prereq-item span { font-size: 12px; }

/* ============================================================
   Vault upgrade — kinds, tag filters, pinning
   ============================================================ */
.vault-toolbar { row-gap: 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
button.tag { font-family: inherit; background: transparent; border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 9px; cursor: pointer; transition: all 0.15s; }
button.tag:hover { border-color: var(--accent); }
button.tag.on { background: rgba(79,157,255,0.16); border-color: var(--accent); color: var(--text); }
.vault-card-top { display: flex; align-items: flex-start; gap: 8px; }
.vault-card-top .vault-title { flex: 1; margin: 0; }
.vault-kind-ico { font-size: 16px; line-height: 1.4; }
.vault-pin { opacity: 0.35; }
.vault-pin.on, .vault-card:hover .vault-pin { opacity: 1; }
.vault-card.pinned { border-color: color-mix(in srgb, var(--pf) 55%, var(--line)); }
.vault-url { text-decoration: none; }
.vault-url-line { margin: 8px 0 2px; font-size: 13px; word-break: break-all; }

/* ============================================================
   Guided Reviews — wizard
   ============================================================ */
.review-resume { display: flex; flex-direction: column; gap: 6px; }
.rh-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.rw-done-banner { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); color: var(--good); border-radius: 10px; padding: 9px 13px; font-size: 13px; margin-bottom: 12px; }
.rw-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.rw-step { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 999px; padding: 7px 13px; cursor: pointer; transition: all 0.15s; }
.rw-step:hover { color: var(--text); border-color: var(--line); }
.rw-step.on { background: linear-gradient(135deg, rgba(79,157,255,0.22), rgba(124,92,255,0.22)); border-color: var(--accent); color: var(--text); }
.rw-step.done { opacity: 0.75; }
.rw-body { min-height: 220px; }
.rw-sub { margin: 14px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.rw-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.rw-row:last-child { border-bottom: none; }
.rw-row[onclick], .rw-row.clickable { cursor: pointer; }
.rw-row:hover { background: var(--panel-2); }
.rw-row.overdue { border-left: 3px solid var(--danger); background: rgba(244,104,94,0.05); border-radius: 6px; }
.rw-row-main { flex: 1; min-width: 0; }
.rw-row-main > div:first-child { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rw-adh { display: flex; flex-direction: column; gap: 3px; width: 160px; flex: 0 0 160px; }
.rw-status { width: 160px; flex: 0 0 160px; }
.rw-hab-ico { font-size: 15px; }
.rw-slider { width: 140px; flex: 0 0 140px; }
.rw-idea-actions { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.rw-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.rw-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.rw-finish { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.rw-foot-link { margin-top: 10px; }

@media (max-width: 620px) {
  .rw-adh { width: 110px; flex-basis: 110px; }
  .rw-idea-actions { justify-content: flex-start; }
}

/* ============================================================
   Prerequisite picker — hierarchy tree (Domain › Portfolio › Project › Task)
   ============================================================ */
.prereq-tree { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pt-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pt-search { flex: 1 1 150px; min-width: 0; }
.pt-count { flex: 0 0 auto; white-space: nowrap; }
.pt-body { max-height: 300px; }
.pt-group { display: flex; align-items: center; gap: 7px; width: 100%; padding: 5px 7px; border: none; border-radius: 7px; background: none; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: left; transition: background 0.12s, color 0.12s; }
.pt-group:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.pt-group:disabled { cursor: default; }
.pt-caret { flex: 0 0 12px; width: 12px; font-size: 11px; line-height: 1; text-align: center; color: var(--muted); }
.pt-group:hover:not(:disabled) .pt-caret { color: var(--text); }
.pt-group .tl-badge { width: 19px; height: 19px; flex: 0 0 19px; font-size: 10px; }
.pt-gname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-sel { flex: 0 0 auto; background: rgba(79, 157, 255, 0.18); color: var(--accent); }
/* scoped to the tree: goals.js reuses .prereq-item and needs its labels to wrap */
.prereq-tree .pt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prereq-tree .pt-done { flex: 0 0 auto; color: var(--good); font-weight: 700; }

/* ============================================================
   Task types — card badges, editor extras, dashboard nag tile
   ============================================================ */
.chip.sm.ttype { font-weight: 600; }
.tt-deep { background: rgba(167,139,250,0.16); color: #a78bfa; }
.tt-admin { background: rgba(148,163,184,0.16); color: #94a3b8; }
.tt-errand { background: rgba(251,146,60,0.16); color: #fb923c; }
.tt-waiting { background: rgba(56,189,248,0.16); color: #38bdf8; }
.tt-decision { background: rgba(244,104,94,0.18); color: var(--danger); font-weight: 700; }
.tt-maint { background: rgba(52,211,153,0.14); color: var(--good); }
.tt-appointment { background: rgba(232,121,249,0.16); color: #e879f9; }
.tt-capture { background: var(--panel-3); color: var(--muted); }
.type-hint { margin-top: 4px; }
.type-extra { margin-top: 2px; }

/* dashboard: Waiting On & Decisions */
.nag-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); cursor: pointer; border-radius: 8px; }
.nag-row:last-child { border-bottom: none; }
.nag-row:hover { background: var(--panel-2); }
.nag-ico { font-size: 17px; flex: 0 0 auto; }
.nag-body { flex: 1; min-width: 0; }
.nag-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tasks board — scrollbar proxy above the columns (the real one is below the fold) */
.board-scroll-rail { overflow-x: auto; overflow-y: hidden; margin-bottom: 6px; }
.board-scroll-spacer { height: 1px; }
.board-scroll-rail::-webkit-scrollbar { height: 10px; }

/* record history line (created / last updated) + portfolio row colour swatch */
.stamp-line { opacity: 0.75; }
.form > .stamp-line { display: block; margin-top: 4px; }
.pfp-sw { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; }
.presync-backup { margin-top: 8px; }

/* POA&M — same-day stacks share a left edge and hang off one spine */
.poam-label.stacked .poam-label-title { -webkit-line-clamp: 2; }
.poam-spine { stroke-linecap: round; }

/* milestones-are-tasks: badges + the project page's task list */
.ms-chip { background: rgba(79,157,255,0.18); color: var(--accent); font-weight: 700; }
.ms-diamond { color: var(--accent); flex: 0 0 auto; }
.ms-link { background: none; border: none; font-family: inherit; text-align: left; cursor: pointer; color: inherit; padding: 0; }
.ms-link:hover { color: var(--accent); }
.proj-tasks { margin-top: 14px; }
.poam-showall { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.poam-showall:hover { color: var(--text); }

/* task progress (0-10) + AI-prompt export picker */
.tcard-prog { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.prog-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; }
.prog-sel { flex: 0 0 auto; width: 118px; font-size: 11.5px; padding: 3px 6px; }
.prompt-pick { max-height: 320px; }
.prompt-pick .prereq-item { gap: 7px; }
.chip.sm.warn { background: rgba(251,191,36,0.16); color: var(--warn); }
.poam-tbl-check { width: 34px; }

/* daily reviews: five cadence cards, and completed rows in a step */
.review-cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.rw-row.rw-done .rw-row-main b { text-decoration: line-through; color: var(--muted); }
.rz-section-head { display: flex; align-items: center; gap: 4px; }
.rz-section-head h3 { margin-right: 4px; }

/* project page: task list doubles as the timeline key */
.ms-sw { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; }
.milestone-row.on-chart { border-left: 3px solid var(--pf); padding-left: 7px; }
.emoji-pal { max-height: 132px; overflow-y: auto; }

/* shared photo picker (people, inventory) */
.photo-field { display: flex; align-items: center; gap: 12px; }
.pf-frame { width: 84px; height: 84px; flex: 0 0 84px; border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; }
.pf-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-placeholder { font-size: 30px; opacity: 0.5; }
.pf-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
img.person-photo { object-fit: cover; border-radius: 50%; display: inline-block; vertical-align: middle; }
img.person-photo.person-emoji { width: 40px; height: 40px; }
img.person-photo.pt-emoji, img.person-photo.tp-emoji { width: 20px; height: 20px; }

/* ============================================================
   Inventory — physical & digital things you own
   ============================================================ */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.inv-card { display: flex; align-items: center; gap: 12px; padding: 11px; background: linear-gradient(150deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: transform 0.14s, border-color 0.14s; }
.inv-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.inv-thumb { width: 62px; height: 62px; flex: 0 0 62px; border-radius: 10px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; }
.inv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.inv-thumb-ph { font-size: 26px; opacity: 0.55; }
.inv-body { flex: 1; min-width: 0; }
.inv-name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 4px; }
.inv-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.inv-value { flex: 0 0 auto; font-weight: 700; font-size: 13.5px; color: var(--good); }
.inv-detail-photo { display: block; margin-bottom: 12px; }
.inv-detail-photo img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; background: var(--bg-2); }
.inv-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin-bottom: 10px; }
.inv-detail-row { display: flex; flex-direction: column; gap: 1px; }

/* inventory lists rail */
.inv-lists { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.inv-list-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 150px; padding: 8px 11px; background: var(--panel-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--pf, var(--line)); border-radius: 10px; font-family: inherit; color: var(--muted); cursor: pointer; text-align: left; transition: all 0.14s; }
.inv-list-chip:hover { color: var(--text); border-color: var(--line); }
.inv-list-chip.on { background: linear-gradient(135deg, rgba(79,157,255,0.16), rgba(124,92,255,0.16)); color: var(--text); border-color: var(--accent); }
.ilc-top { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; }
.ilc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.ilc-edit { opacity: 0; }
.inv-list-chip:hover .ilc-edit { opacity: 0.8; }
.inv-card { border-left: 3px solid var(--pf, var(--line)); }

/* ============================================================
   Calendar — month grid, week columns, agenda
   ============================================================ */
.cal-toolbar { align-items: center; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-label { font-weight: 700; font-size: 15px; margin-left: 8px; white-space: nowrap; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 14px; }
.cal-hidedone { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; margin-left: 4px; }

.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.cal-dow span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: center; }
/* minmax(0,…) not 1fr: a nowrap chip's min-content width would otherwise push
   the grid wider than its container and shear it off the right edge. */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day { min-width: 0; min-height: 108px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.cal-day.is-out { opacity: 0.45; }
.cal-day.is-today { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); }
.cal-day.drag-over { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; }
.cal-daynum { background: none; border: none; color: var(--text); font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 1px 5px; border-radius: 6px; }
.cal-daynum:hover { background: var(--panel-2); color: var(--accent); }
.cal-day.is-today .cal-daynum { background: var(--accent); color: #fff; }
.cal-more { background: none; border: none; color: var(--muted); font-family: inherit; font-size: 11px; cursor: pointer; text-align: left; padding: 1px 4px; }
.cal-more:hover { color: var(--accent); }

.cal-ev { display: flex; align-items: center; gap: 5px; width: 100%; padding: 2px 5px; border: none; border-left: 3px solid var(--pf, var(--accent)); border-radius: 5px; background: var(--panel-2); color: var(--text); font-family: inherit; font-size: 11.5px; cursor: pointer; text-align: left; transition: background 0.12s; }
.cal-ev:hover { background: var(--panel-3); }
.cal-ev.done { opacity: 0.5; }
.cal-ev.done .cal-ev-title { text-decoration: line-through; }
.cal-ev.overdue { border-left-color: var(--danger); }
.cal-ev.ev-appointment { border-left-color: #e879f9; }
.cal-ev.ev-deadline { border-left-color: var(--warn); }
.cal-ev.ev-bread { border-left-color: var(--good); }
.cal-ev.ev-review { border-left-color: #a78bfa; }
.cal-ev-time { flex: 0 0 auto; font-weight: 700; font-size: 10.5px; color: var(--muted); }
.cal-ev-dot { flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--pf, var(--muted-2)); }
/* basis 0, not auto: with wrap on (.stacked) an auto basis wider than the space
   left beside the time would break to its own line instead of just shrinking. */
.cal-ev-title { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the title matters more than the meta — let the meta give way first */
.cal-ev-meta { flex: 0 1 auto; min-width: 0; max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* week columns are too narrow to share a line — drop the meta underneath */
.cal-ev.stacked { flex-wrap: wrap; row-gap: 1px; }
.cal-ev.stacked .cal-ev-meta { flex: 1 0 100%; max-width: 100%; padding-left: 10px; }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-wcol { min-width: 0; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 7px; display: flex; flex-direction: column; gap: 4px; min-height: 260px; }
.cal-wcol.is-today { border-color: var(--accent); }
.cal-wcol.drag-over { border-color: var(--good); }
.cal-wcol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.cal-wdow { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.cal-empty-day { color: var(--muted-2); font-size: 12px; text-align: center; padding: 6px 0; }
.cal-add-inline { margin-top: auto; background: none; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); cursor: pointer; font-family: inherit; padding: 2px; }
.cal-add-inline:hover { border-color: var(--accent); color: var(--accent); }

.cal-agenda { display: flex; flex-direction: column; gap: 10px; }
.cal-agenda-day { display: flex; gap: 14px; padding: 9px 10px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px; }
.cal-agenda-date { flex: 0 0 68px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cal-ad-dow { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.cal-ad-num { font-size: 21px; font-weight: 800; line-height: 1; }
.cal-agenda-events { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-daylist { display: flex; flex-direction: column; gap: 6px; }
.cal-dayrow { display: flex; align-items: center; gap: 10px; padding: 6px; border-bottom: 1px solid var(--line-soft); }
.cal-dayrow:last-child { border-bottom: none; }
.cal-dayrow-main { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-day { min-height: 76px; }
  /* narrow enough that any meta belongs on its own line rather than hidden */
  .cal-ev { flex-wrap: wrap; row-gap: 1px; }
  .cal-ev .cal-ev-meta { flex: 1 0 100%; max-width: 100%; padding-left: 10px; }
}

/* ---- Calendar: imported (Google / Outlook) events ---- */
.cal-ev.ev-external { border-left-style: dashed; border-left-color: var(--pf, #4285f4); }
.cal-ev.ev-external .cal-ev-dot { border: 1px solid var(--pf, #4285f4); background: transparent; }
.imp-title { margin: 0 0 10px; font-size: 17px; }
.imp-rows { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.imp-row { display: flex; gap: 12px; align-items: baseline; }
.imp-k { flex: 0 0 74px; text-transform: uppercase; letter-spacing: 0.05em; }
.imp-v { flex: 1; min-width: 0; }

.extcal-provider { border: 1px solid var(--line-soft); border-radius: 10px; padding: 11px 12px; margin-bottom: 10px; background: var(--bg-2); }
.extcal-head { display: flex; align-items: center; gap: 10px; }
.row-gap { display: flex; gap: 6px; }
.extcal-hint { margin-top: 7px; }
.extcal-cal { display: flex; align-items: center; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.extcal-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.extcal-toggle, .extcal-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.extcal-err { margin-top: 5px; color: var(--danger); }
.extcal-foot { margin-top: 6px; }
.extcal-picklist { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; }
.extcal-pick { padding: 7px 6px; border-radius: 7px; color: var(--text); font-size: 13px; }
.extcal-pick:hover { background: var(--panel-2); }

/* ============================================================
   PDI — print composer, sheet rendering, and the print swap
   ============================================================ */
.pdi-composer { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 22px; align-items: start; margin-bottom: 26px; }
.pdi-opts { display: flex; flex-direction: column; gap: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 16px; }
.pdi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pdi-preview { display: flex; flex-direction: column; gap: 8px; }
.pdi-prevbar { display: flex; align-items: center; gap: 10px; }
.pdi-warn { color: var(--warn); font-size: 12px; font-weight: 600; }
.pdi-frame { position: relative; overflow: hidden; border-radius: 4px; box-shadow: 0 6px 30px rgba(0,0,0,0.45); background: #fff; }
.pdi-h2 { font-size: 15px; margin: 8px 0 10px; }
.pdi-instances { display: flex; flex-direction: column; gap: 8px; }
.pdi-inst { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.pdi-inst.archived { opacity: 0.55; }
.pdi-inst-icon { font-size: 16px; }
.pdi-inst-main { flex: 1; min-width: 0; }
.pdi-code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 13px; letter-spacing: 0.08em; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; }

/* The sheet's own look (paper, ink, checkbox borders) lives in
   App.PDI.SHEET_CSS — injected for previews and inlined into the print
   iframe — so the printed page can never drift from the preview. Printing
   happens in that iframe; the app page itself is never restyled for print. */
.pdi-pagelabel { margin: 2px 0 -4px; }

@media (max-width: 980px) {
  .pdi-composer { grid-template-columns: 1fr; }
}

/* ---- PDI scan flow ---- */
.pdi-scan { min-width: min(560px, 86vw); }
.pdi-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 40px 24px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: center; transition: border-color 0.15s; }
.pdi-drop:hover, .pdi-drop.over { border-color: var(--accent); }
.pdi-drop-icon { font-size: 34px; }
.pdi-scan-err { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid var(--danger); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.pdi-scan-id { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pdi-scan-rows { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.pdi-scan-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 10px; }
.pdi-scan-row { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 11px; cursor: pointer; }
.pdi-scan-title { flex: 1; min-width: 0; }
.pdi-scan-write { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 11px; }
.pdi-scan-wmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pdi-evidence { max-width: 170px; max-height: 54px; border-radius: 5px; background: #fff; object-fit: contain; }
.pdi-scan-conflict { background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 9px; padding: 8px 11px; font-size: 12.5px; }
.pdi-scan-noop { margin-top: 6px; }
.pdi-scan-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }

/* ---- PDI scan diagnostics (spec §12) ---- */
.pdi-diag { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.pdi-diag-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pdi-diag-frame { border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,0.4); }
.pdi-diag-canvas { display: block; width: 100%; height: auto; }
.pdi-diag-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); }
.pdi-diag-key { display: inline-flex; align-items: center; gap: 5px; }
.pdi-diag-sw { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.pdi-diag-rows { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow-y: auto; font-size: 12px; }
.pdi-diag-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; background: var(--bg-2); }
.pdi-diag-id { flex: 0 0 auto; font-size: 11px; color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdi-diag-status { flex: 0 0 auto; font-weight: 600; }
.pdi-diag-outcome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   PHONE
   The app is built for a wide desktop: a permanent 248px rail, dense
   rows, and cursor-sized controls. On a handset all three assumptions
   break, so this section retunes them. Two breakpoints, each with a
   job: 860px is where the rail becomes a drawer (the layout question),
   640px is where fingers replace a cursor (the input question).
   ============================================================ */

/* Fills the viewport even as mobile browser chrome slides away; vh is
   frozen at the largest chrome-free height and leaves a gap. */
.shell { min-height: 100dvh; }

/* The drawer's backdrop. It exists only where the drawer does — on a
   desktop the rail is permanent and a scrim would be nonsense. */
.nav-scrim { display: none; }

@media (max-width: 860px) {
  .sidebar { height: 100dvh; width: min(84vw, 300px); flex-basis: min(84vw, 300px); padding-top: max(18px, env(safe-area-inset-top)); }

  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(5, 8, 14, 0.6); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .nav-scrim.show { opacity: 1; pointer-events: auto; }
  /* the page behind the drawer must not scroll under it */
  body.nav-open { overflow: hidden; }

  /* viewport-fit=cover means the page runs under the notch and the home
     indicator; these keep real content out from under both. */
  .topbar { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .view { padding-bottom: calc(30px + env(safe-area-inset-bottom)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .clockbar { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
  .toast-wrap { bottom: calc(18px + env(safe-area-inset-bottom)); width: min(92vw, 460px); }
  .toast { width: 100%; text-align: center; }
}

@media (max-width: 640px) {
  /* ---- targets a fingertip can actually hit ---- */
  .btn { min-height: 40px; }
  .btn.tiny { min-height: 36px; font-size: 13px; padding: 8px 12px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  /* …but the .sm variant lives in dense rows inside cards; at 40px a row of
     five pushed itself outside its own card. 34px still clears WCAG's 24. */
  .icon-btn.sm { min-width: 34px; min-height: 34px; }
  /* and the row wraps rather than running off the card edge */
  .tcard-actions { flex-wrap: wrap; margin-left: 0; row-gap: 4px; }
  .manual-link { display: inline-flex; align-items: center; min-height: 32px; }
  .check { width: 24px; height: 24px; flex: 0 0 24px; }
  .check.sm { width: 22px; height: 22px; flex: 0 0 22px; }
  .nav-item { min-height: 44px; }
  .seg button { min-height: 38px; padding: 9px 13px; }
  .tag { font-size: 12px; }

  /* iOS zooms the entire page when a focused control's text is under
     16px — and does not zoom back out. This is a fix, not a taste call.
     It applies to selects too: focusing one zooms just the same, so the
     dense in-row selects get the same treatment and lose padding instead. */
  .inp, input, select, textarea { font-size: 16px; }
  select.prog-sel { font-size: 16px; padding: 4px 6px; min-width: 0; }

  /* bare checkboxes and radios render ~13px; that is not a tap target */
  input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; accent-color: var(--accent); }

  /* A segmented control cannot wrap without stopping being one, and with
     four templates or five filters it is wider than a phone. Let it
     scroll: the control keeps its shape and every option stays reachable. */
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }

  /* filter chips and day numbers are tapped constantly */
  .tag { min-height: 32px; display: inline-flex; align-items: center; }
  .tp-chip { min-height: 30px; }
  .need-label { font-size: 11px; }

  /* A 6px-tall track is a 6px-tall drag target. The thumb is bigger, but
     you have to hit the track to start; give the whole control real height
     and keep the track itself thin with a gradient-free background. */
  .slider { height: 28px; background: transparent; }
  .slider::-webkit-slider-runnable-track { height: 6px; background: var(--panel-3); border-radius: 4px; }
  .slider::-moz-range-track { height: 6px; background: var(--panel-3); border-radius: 4px; }
  .slider::-webkit-slider-thumb { margin-top: -6px; }

  /* Hierarchy rows carry a label plus up to five icon actions; at 390px the
     actions ran off the edge. Let the row wrap and the actions sit under
     the label rather than shrinking either to uselessness. */
  .tree-row { flex-wrap: wrap; row-gap: 4px; }
  .tree-label { max-width: 100%; white-space: normal; }
  .tree-acts { margin-left: auto; }
  .tree-toggle { width: 24px; height: 24px; flex: 0 0 24px; }
  .cal-daynum { min-width: 32px; min-height: 30px; }
  .clock-mini { min-width: 32px; min-height: 32px; }
  .check { width: 26px; height: 26px; flex: 0 0 26px; }

  /* ---- modals become bottom sheets ---- */
  .modal-overlay { padding: 0; place-items: end center; }
  .modal { max-width: none; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .modal-head { padding: 15px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; text-align: center; }

  /* ---- chrome ---- */
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 6px; }
  .view { padding: 16px 14px; }
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 21px; }

  /* ---- one column, everywhere it still isn't ---- */
  .stat-strip, .kpi-tiles, .bread-summary { grid-template-columns: repeat(2, 1fr); }
  .form-row { gap: 10px; }

  /* ---- boards: one column per screen, snapping ----
     They already scroll sideways; at 260px you get one and a half
     columns and read neither. A near-full-width snap gives you one
     column at a time with a peek at the next. */
  .task-board, .idea-board { grid-auto-columns: 84vw; scroll-snap-type: x mandatory; gap: 10px; }
  .task-col, .idea-col { scroll-snap-align: start; }

  /* ---- wide artifacts stay scrollable rather than squeezing ---- */
  .poam-scroll, .board-scroll-rail { -webkit-overflow-scrolling: touch; }
  .emoji-pal { max-width: 100%; }
  .extcal-picklist { max-height: 40dvh; }
  .pdi-scan-rows { max-height: 44dvh; }
}

/* An actual phone in landscape, or a very small handset: the drawer must
   not eat the screen and the chrome must shrink out of the way. */
@media (max-width: 400px) {
  .stat-strip, .kpi-tiles, .bread-summary { grid-template-columns: 1fr; }
  .topbar-actions .btn { padding: 8px 10px; }
}

/* ---- "Move to column" chooser (the touch route onto the board) ---- */
.move-list { display: flex; flex-direction: column; gap: 6px; }
.move-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left;
  background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--text);
  font-family: inherit; font-size: 14px;
}
.move-opt:hover { border-color: var(--accent); background: var(--panel); }
.move-opt.on { border-color: var(--accent); opacity: 0.65; cursor: default; }
.move-opt-label { flex: 1; min-width: 0; }

/* ---- Month grid on a phone ----
   Seven columns is seven columns however narrow the screen, so each day is
   ~41px and an event chip renders one letter. Rather than pretend, the
   chips become dots — the same thing every phone calendar does — and the
   day number opens the day list, where the events are actually readable. */
@media (max-width: 640px) {
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 62px; padding: 3px; gap: 2px; }
  .cal-month .cal-ev {
    width: 8px; height: 8px; min-height: 0; padding: 0; gap: 0;
    border: none; border-radius: 50%; background: var(--pf, var(--accent));
    overflow: hidden; text-indent: -999px; flex: 0 0 8px;
  }
  .cal-month .cal-ev > * { display: none; }
  .cal-month .cal-day-evs, .cal-month .cal-day > .cal-ev { align-self: flex-start; }
  /* dots flow in rows inside the cell */
  .cal-month .cal-day { flex-direction: column; }
  .cal-month .cal-day .cal-ev { display: inline-block; margin: 0 2px 2px 0; }
  .cal-more { font-size: 10px; padding: 0 2px; }
  .cal-dow span { font-size: 10px; }
}

/* ---- POA&M legend + tray, and other sub-11px labels, on a phone ----
   The chart itself scrolls (it is a fixed 1000pt canvas by design), but its
   CONTROLS are ordinary buttons and were sized for a mouse. */
@media (max-width: 640px) {
  /* flex-basis is what actually sizes it in the legend row, so the base
     `flex: 0 0 11px` has to be overridden too, not just width */
  .poam-lg-swatch { width: 24px; height: 24px; flex: 0 0 24px; }
  .poam-lg-name, .poam-tray-chip, .pfp-name { min-height: 26px; display: inline-flex; align-items: center; }
  .md-stat-label, .poam-legend-label, .poam-tray-label { font-size: 11px; }
  /* a checkbox in a flex row must not be allowed to shrink below its target */
  input[type="checkbox"], input[type="radio"] { flex: 0 0 24px; min-width: 24px; }
}

/* ---- Reschedule chooser (the touch route for calendar drag) ---- */
.resched-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.resched-quick .btn { flex: 1 1 auto; justify-content: center; }

/* ---- Task types manager ---- */
.ttypes { display: flex; flex-direction: column; gap: 6px; }
.ttype-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px; }
.ttype-ico { font-size: 18px; flex: 0 0 auto; }
.ttype-main { flex: 1; min-width: 0; }
.icon-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 4px; }
.icon-pick {
  min-width: 32px; min-height: 32px; font-size: 16px; line-height: 1; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 8px; color: var(--text);
}
.icon-pick:hover { border-color: var(--accent); background: var(--panel); }

/* ---- Calendar: "connected but nothing imported here" bar ---- */
.cal-syncbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 13px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--accent);
}
.cal-syncbar.warn { border-color: var(--warn); }
.cal-syncicon { font-size: 15px; flex: 0 0 auto; }
.cal-syncmsg { font-size: 13px; color: var(--text); min-width: 0; }

/* ---- Task stages (Send / Follow-up / Closed and friends) ---- */
.tcard-stage { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.stage-step {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 4px 9px; min-height: 26px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--muted);
}
.stage-step:hover { border-color: var(--accent); color: var(--text); }
.stage-step.past { color: var(--text); opacity: 0.6; }
.stage-step.on { background: var(--panel-3); border-color: var(--accent); color: var(--text); }
.stage-step.final.on { border-color: var(--good); }
.stage-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; font-size: 9.5px; font-weight: 700;
  background: var(--line); color: var(--text);
}
.stage-step.on .stage-n { background: var(--accent); color: #fff; }
.stage-count { font-size: 10px; font-weight: 700; color: var(--warn); }
