/* tracker — web. Dark slate canvas, single blue accent, generous rhythm.
   Same class names as before; this is a visual + layout pass only. */

:root {
  --accent: #4d8dfa;
  --accent-soft: #7db0ff;
  --accent-deep: #2f6ede;
  --positive: #4dcc80;
  --negative: #f2666b;
  --subtle: rgba(226, 236, 255, 0.58);
  --subtle-2: rgba(226, 236, 255, 0.36);
  --text: #eef3fb;

  --g-blue: #4d8dfa;
  --g-teal: #38bdb8;
  --g-purple: #9473f5;
  --g-orange: #f59942;
  --g-green: #4dc775;
  --g-pink: #f26b9e;
  --g-yellow: #f5c542;

  --bg-0: #080b12;
  --bg-1: #0e1420;
  --surface: #121926;
  --surface-2: #161f2e;

  --card-fill: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  --card-line: rgba(255, 255, 255, 0.075);
  --card-line-hi: rgba(77, 141, 250, 0.45);
  --fill-04: rgba(255, 255, 255, 0.035);
  --fill-06: rgba(255, 255, 255, 0.06);
  --fill-08: rgba(255, 255, 255, 0.08);
  --fill-12: rgba(255, 255, 255, 0.12);

  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 10px 30px -12px rgba(0,0,0,0.65);
  --radius: 20px;
  --radius-sm: 12px;

  /* spacing rhythm */
  --gap: 14px;
  --gap-lg: 18px;
  --section-gap: 34px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 600px at 92% -8%, rgba(77, 141, 250, 0.16), transparent 62%),
    radial-gradient(700px 500px at 0% 100%, rgba(77, 141, 250, 0.07), transparent 60%),
    linear-gradient(to bottom, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--subtle); }
.tiny { font-size: 12px; }
.spacer { flex: 1; }
.rounded-num, .val, .mv, .amt, .bv, .mb-v { font-variant-numeric: tabular-nums; }

::selection { background: rgba(77,141,250,0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------------- Sign-in gate ---------------- */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-card { text-align: center; max-width: 400px; width: 100%; }
.gate-logo {
  width: 76px; height: 76px; margin: 0 auto 20px;
  display: grid; place-items: center;
  border-radius: 24px;
  background: linear-gradient(150deg, var(--accent-soft), var(--accent-deep));
  color: #fff;
  box-shadow: 0 18px 50px -14px rgba(77, 141, 250, 0.7);
}
.gate-card h1 { margin: 6px 0 10px; font-size: 34px; font-weight: 800; letter-spacing: -0.6px; }
.gate-card p { margin: 0 0 26px; color: var(--subtle); }
.apple-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; max-width: 340px; padding: 15px 20px;
  background: #fff; color: #000; border: none; border-radius: 14px;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
}
.apple-btn:hover { background: #ececec; }
.gate-note { margin-top: 18px; color: var(--subtle-2); }
.gate-alert {
  margin: 0 0 22px; padding: 12px 14px; border-radius: 12px;
  background: rgba(242, 102, 107, 0.12); border: 1px solid rgba(242, 102, 107, 0.4);
  color: #ffb4b8; font-size: 13px; text-align: left;
}

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: rgba(10, 14, 22, 0.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; white-space: nowrap; letter-spacing: -0.3px; }
.brand .brand-mark {
  width: 27px; height: 27px; border-radius: 9px;
  background: linear-gradient(150deg, var(--accent-soft), var(--accent-deep));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px -6px rgba(77,141,250,0.9);
}
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: none; color: var(--subtle); cursor: pointer;
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color .15s, background .15s;
}
.tabs button:hover { color: var(--text); background: var(--fill-04); }
.tabs button.active { background: rgba(77,141,250,0.16); color: #cfe0ff; box-shadow: inset 0 0 0 1px rgba(77,141,250,0.28); }
.topbar-right { display: flex; gap: 8px; }

/* main is the layout engine — spacing lives here, not in the markup */
.main {
  max-width: 900px; margin: 0 auto; padding: 30px 20px 120px;
  display: flex; flex-direction: column; gap: var(--gap);
}
.main > * { animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .main > * { animation: none; } }

/* ---------------- Buttons ---------------- */
button { font: inherit; cursor: pointer; }
.iconbtn {
  background: var(--fill-04); border: 1px solid var(--card-line); color: var(--subtle);
  border-radius: 10px; padding: 8px 11px; line-height: 1; display: inline-grid; place-items: center;
  transition: color .15s, border-color .15s, background .15s;
}
.iconbtn:hover { color: var(--text); border-color: var(--card-line-hi); background: rgba(77,141,250,0.1); }
.primary {
  background: linear-gradient(150deg, var(--accent-soft), var(--accent-deep)); color: #fff;
  border: none; border-radius: var(--radius-sm); padding: 10px 18px; font-weight: 600;
  box-shadow: 0 10px 24px -12px rgba(77,141,250,0.95);
}
.primary:hover { filter: brightness(1.07); }
.primary:disabled { opacity: 0.45; cursor: default; filter: none; box-shadow: none; }
.ghost { background: none; border: 1px solid var(--card-line); color: var(--subtle); border-radius: var(--radius-sm); padding: 9px 14px; }
.ghost:hover { color: var(--text); border-color: var(--subtle-2); }
.danger { background: none; border: 1px solid var(--negative); color: var(--negative); border-radius: var(--radius-sm); padding: 9px 16px; }
.danger:hover { background: var(--negative); color: #fff; }
.add-btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--card-fill);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card.pad-12 { padding: 14px; }
.card.pad-14 { padding: 16px; }

.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }

.row-between { display: flex; align-items: center; gap: 10px; }
.row-between > .spacer { flex: 1; }

/* ---------------- Headings ---------------- */
.greeting { font-size: 34px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.1; }
.greeting-sub { color: var(--subtle); font-size: 14px; margin-top: 6px; }

/* section header = hairline rule + accent icon; breathing room lives here */
.group-header {
  display: flex; align-items: center; gap: 10px;
  margin: calc(var(--section-gap) - var(--gap)) 0 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.group-header .gh-icon { color: var(--accent); display: grid; place-items: center; }
.group-header h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); margin: 4px 0 0; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head .ct { font-size: 14px; font-weight: 700; letter-spacing: -0.1px; }
.card-head .spacer { flex: 1; }
.subtle-cap { font-size: 12px; color: var(--subtle); }

.nav-title { font-size: 32px; font-weight: 800; letter-spacing: -0.7px; margin: 0 0 6px; }

/* ---------------- Segmented control ---------------- */
.segmented {
  display: flex; gap: 3px; padding: 4px; border-radius: 12px;
  background: rgba(255,255,255,0.045); border: 1px solid var(--card-line);
}
.segmented button {
  flex: 1; background: none; border: none; color: var(--subtle);
  padding: 8px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: rgba(77,141,250,0.18); color: #d6e5ff; box-shadow: inset 0 0 0 1px rgba(77,141,250,0.3); }
.segmented.small button { padding: 6px 8px; font-size: 12.5px; }

/* pill row (ranges / chart modes) */
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  background: var(--fill-04); border: 1px solid transparent; color: var(--subtle);
  padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill:hover { color: var(--text); }
.pill.active { background: rgba(77,141,250,0.18); border-color: rgba(77,141,250,0.45); color: #d6e5ff; }

/* ---------------- Stat tiles ---------------- */
.badge-icon { display: grid; place-items: center; border-radius: 10px; flex: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.stat-tile { position: relative; overflow: hidden; }
.stat-tile .badge-icon {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px;
}
.stat-tile .val { font-size: 26px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.1; }
.stat-tile .lbl { font-size: 12px; color: var(--subtle); margin-top: 6px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.stat-tile .sub { font-size: 11px; color: var(--subtle-2); margin-top: 3px; }

/* ---------------- Progress ---------------- */
.bar { height: 8px; border-radius: 999px; background: var(--fill-08); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; transition: width .35s ease; }
.ring { display: inline-grid; place-items: center; position: relative; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring .ring-label { position: absolute; font-weight: 800; }

/* ---------------- Generic list rows ---------------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.line {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-fill); border: 1px solid var(--card-line);
  border-radius: 14px; padding: 13px 15px; cursor: pointer;
  transition: border-color .14s, transform .14s;
}
.line:hover { border-color: var(--card-line-hi); transform: translateY(-1px); }
.line .dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }
.line .body { flex: 1; min-width: 0; }
.line .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line .sub { font-size: 13px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line .amt { font-weight: 800; white-space: nowrap; letter-spacing: -0.3px; }
.amt.pos { color: var(--positive); }
.amt.neg { color: var(--negative); }
.chev { color: var(--subtle-2); flex: none; }

.icon-badge { width: 28px; text-align: center; flex: none; display: grid; place-items: center; }

.pillbadge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--fill-08); color: var(--subtle); white-space: nowrap;
}

.empty {
  text-align: center; color: var(--subtle); padding: 40px 18px;
  border: 1px dashed var(--card-line); border-radius: var(--radius); background: rgba(255,255,255,0.02);
}
.empty .et { font-weight: 700; color: var(--text); font-size: 16px; margin-bottom: 5px; }

.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.mini { padding: 13px; border-radius: 14px; background: var(--fill-04); border: 1px solid rgba(255,255,255,0.04); }
.mini .mt { font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.mini .mv { font-size: 20px; font-weight: 800; margin-top: 4px; letter-spacing: -0.5px; }
.mini .ms { font-size: 11px; color: var(--subtle-2); margin-top: 2px; }

/* balance rows */
.bal-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.bal-row .bl { color: var(--subtle); flex: 1; }
.bal-row .bv { font-weight: 700; }
.bal-row.total .bl { color: var(--text); font-weight: 800; }
.bal-row.total .bv { font-weight: 800; font-size: 17px; }
.divider { height: 1px; background: rgba(255,255,255,0.08); border: none; margin: 6px 0; }

/* metric mini boxes (made / spent) */
.metric-box {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 13px; border-radius: 14px; background: var(--fill-04); border: 1px solid rgba(255,255,255,0.04);
}
.metric-box .mb-l { font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.metric-box .mb-v { font-weight: 800; font-size: 17px; letter-spacing: -0.3px; }

/* quick add buttons */
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 6px; border-radius: 16px; background: var(--card-fill);
  border: 1px solid var(--card-line); font-size: 12px; font-weight: 700;
  transition: border-color .14s, transform .14s;
}
.quick:hover { border-color: var(--card-line-hi); transform: translateY(-1px); }
.water-btns { display: flex; gap: 10px; }
.water-btns button {
  flex: 1; padding: 11px; border-radius: 12px; border: 1px solid rgba(77,141,250,0.25); font-weight: 700;
  background: rgba(77,141,250,0.12); color: var(--accent-soft);
}
.water-btns button:hover { background: rgba(77,141,250,0.24); }

/* goal hero row */
.goal-hero {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  border-radius: var(--radius); border: 1px solid var(--card-line); cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .14s, transform .14s;
}
.goal-hero:hover { transform: translateY(-1px); }
.goal-hero .gh-body { flex: 1; min-width: 0; }
.goal-hero .gh-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}

/* ---------------- Kanban ---------------- */
.kcol { border-radius: 18px; padding: 12px; margin-top: 4px; }
.kcol .khead { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.kcol .khead .kt { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.kcol .kcount { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.tcard {
  background: var(--card-fill); border: 1px solid var(--card-line);
  border-radius: 16px; padding: 14px; margin-bottom: 10px; cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start;
  transition: border-color .14s, transform .14s;
}
.tcard:hover { border-color: var(--card-line-hi); transform: translateY(-1px); }
.tcard.dragging { opacity: 0.5; }
.kcol.drop { background: rgba(77,141,250,0.07); outline: 1.5px dashed rgba(77,141,250,0.5); }
.check {
  width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--subtle-2);
  background: none; display: grid; place-items: center; padding: 0; color: transparent;
}
.check.done { background: var(--positive); border-color: var(--positive); color: #06210f; }
.tcard .tc-title { font-weight: 600; }
.tcard .tc-title.done { text-decoration: line-through; color: var(--subtle); }
.tcard .tc-det { font-size: 13px; color: var(--subtle); margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.tag.accent { background: rgba(77,141,250,0.15); color: var(--accent-soft); }

.hgoal-strip { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hgoal-strip::-webkit-scrollbar { display: none; }
.hgoal { flex: none; width: 200px; }

/* ---------------- Notes ---------------- */
.folderbar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 8px; }
.folderbar::-webkit-scrollbar { display: none; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--fill-04); border: 1px solid var(--card-line); color: var(--subtle);
}
.fchip.on { color: #fff; }
.fchip .cnt { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--fill-12); }
.note-card {
  background: var(--card-fill); border: 1px solid var(--card-line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; overflow: hidden;
  transition: border-color .14s, transform .14s;
}
.note-card:hover { border-color: var(--card-line-hi); transform: translateY(-1px); }
.note-card .nt { font-weight: 700; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-card .nb { color: var(--subtle); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-card .nmeta { margin-top: 10px; font-size: 11px; color: var(--subtle-2); display: flex; gap: 8px; align-items: center; }
.note-cover { height: 96px; margin: -16px -16px 14px; background-size: cover; background-position: center; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }

.searchbar {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 12px;
  background: var(--fill-04); border: 1px solid var(--card-line);
}
.searchbar:focus-within { border-color: var(--card-line-hi); }
.searchbar input { flex: 1; background: none; border: none; color: var(--text); font: inherit; outline: none; }

/* ---------------- Charts ---------------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart-wrap { width: 100%; }
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--subtle); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.cat-row { display: flex; flex-direction: column; gap: 6px; }
.cat-row .cr-top { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cat-row .cr-top .cname { font-weight: 600; }
.cat-row .cr-top .spacer { flex: 1; }

/* day-detail entries */
.dd-entry {
  display: flex; align-items: center; gap: 10px; padding: 11px;
  border-radius: 12px; background: var(--fill-04); cursor: pointer;
}
.dd-entry:hover { background: var(--fill-08); }

/* timeline (account detail) */
.tl-row {
  display: flex; align-items: center; gap: 12px; padding: 13px;
  background: var(--card-fill); border: 1px solid var(--card-line); border-radius: 14px; cursor: pointer;
}
.tl-row:hover { border-color: var(--card-line-hi); }

/* ---------------- Modal ---------------- */
.modal-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(4,6,10,0.68); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 34px 16px; overflow-y: auto; }
.modal {
  background: var(--surface); border: 1px solid rgba(255,255,255,0.09); border-radius: 22px;
  width: 100%; max-width: 560px; margin: auto; box-shadow: 0 30px 90px -20px rgba(0,0,0,0.8);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 20px 22px 8px; }
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 800; flex: 1; letter-spacing: -0.3px; }
.modal-body { padding: 8px 22px; max-height: 66vh; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 16px 22px 20px; }

.form-sec { margin: 18px 0; }
.form-sec > .fs-title { font-size: 12px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.form-sec > .fs-foot { font-size: 12px; color: var(--subtle-2); margin-top: 8px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field > label { font-size: 12px; font-weight: 600; color: var(--subtle); }
.field input[type=text], .field input[type=number], .field input[type=date],
.field input[type=datetime-local], .field select, .field textarea {
  background: var(--fill-04); border: 1px solid var(--card-line); color: var(--text);
  border-radius: 11px; padding: 11px 13px; font: inherit; width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,141,250,0.16); }
.field.check { flex-direction: row; align-items: center; gap: 10px; grid-column: 1 / -1; }
.field.check label { font-size: 14px; color: var(--text); font-weight: 500; order: 2; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--fill-12); border-radius: 999px; transition: .15s; }
.switch .track::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* fasting toggle row: label left, switch right */
.fast-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.fast-row .fast-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.fast-row .spacer { flex: 1; }
.fast-row .switch { flex: 0 0 46px; width: 46px; height: 28px; }

.color-swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.swatch.on { border-color: #fff; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--card-line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 38px; height: 38px; background: var(--fill-06); border: none; color: var(--text); font-size: 18px; }
.stepper button:hover { background: var(--fill-12); }
.stepper .sv { min-width: 54px; text-align: center; font-weight: 700; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
  padding: 12px 22px; z-index: 80; font-size: 14px; font-weight: 600;
  box-shadow: 0 20px 50px -18px rgba(0,0,0,0.9);
}
.toast.error { border-color: var(--negative); color: #ffb4b8; }

.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill-12); border-top-color: var(--accent); animation: spin 0.8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* calendar (events) */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .cal-dow { text-align: center; font-size: 11px; color: var(--subtle-2); font-weight: 700; padding: 4px 0; }
.cal .cal-day {
  aspect-ratio: 1; border-radius: 12px; border: none; background: var(--fill-04); color: var(--text);
  font-size: 13px; font-weight: 600; position: relative; display: grid; place-items: center;
}
.cal .cal-day:hover { background: var(--fill-08); }
.cal .cal-day.other { color: var(--subtle-2); background: transparent; }
.cal .cal-day.today { outline: 1px solid var(--accent); }
.cal .cal-day.sel { background: var(--accent); color: #fff; }
.cal .cal-day .evdot { position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal .cal-day.sel .evdot { background: #fff; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-head .cm { flex: 1; font-weight: 700; text-align: center; }

.event-card { display: flex; gap: 12px; }
.event-card .estripe { width: 4px; border-radius: 3px; flex: none; }

/* ============ Wide screens: break the single column ============
   Today + Finances become a two-column board. Charts, tile rows and
   section headers span the full width so the rhythm still reads. */
@media (min-width: 1040px) {
  .main { max-width: 1180px; padding: 34px 24px 140px; }

  .main.tab-today,
  .main.tab-finances {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap) var(--gap-lg);
    align-items: stretch;       /* paired cards match height */
  }
  .main.tab-today > *,
  .main.tab-finances > * { min-width: 0; }

  /* grid children fill their cell top to bottom */
  .main.tab-today > .card,
  .main.tab-today > .goal-hero,
  .main.tab-today > .stack-10,
  .main.tab-finances > .stack > .card,
  .main.tab-finances > .stack > .goal-hero { height: 100%; }
  .main.tab-today > .stack-10 > .card,
  .main.tab-today > .stack-10 > .goal-hero { flex: 1; }

  .main.tab-today > .group-header,
  .main.tab-today > .grid-2,
  .main.tab-today > div:first-child,
  .main.tab-today > .stack-10:has(.quick-grid),
  .main.tab-today > .card:has(.switch),
  .main.tab-finances > .nav-title,
  .main.tab-finances > .row-between,
  .main.tab-finances > .segmented,
  .main.tab-finances > .stack,
  .main.tab-finances > .empty,
  .main > .spin { grid-column: 1 / -1; }

  .main.tab-today > *:has(.chart) { grid-column: 1 / -1; }

  .main.tab-finances > .stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap) var(--gap-lg);
    align-items: stretch;
  }
  .main.tab-finances > .stack > *:has(.chart),
  .main.tab-finances > .stack > .grid-2,
  .main.tab-finances > .stack > .empty,
  .main.tab-finances > .stack > .segmented { grid-column: 1 / -1; }

  /* cards that always want the whole row */
  .main.tab-finances > .stack > .wide-card,
  .main.tab-today > .fasting-card { grid-column: 1 / -1; }

  /* a lone half card at the end of a board takes the whole row */
  .main.tab-finances > .stack > *:last-child:not(:has(.chart)):not(.grid-2),
  .main.tab-today > *:last-child:not(:has(.chart)):not(.grid-2):not(.group-header) { grid-column: 1 / -1; }

  /* stretched cards push their content apart instead of leaving dead space */
  .main.tab-today > .card,
  .main.tab-finances > .stack > .card { display: flex; flex-direction: column; }
  .main.tab-today > .card > .bar,
  .main.tab-finances > .stack > .card > .bar { margin-top: auto; }

  .main.tab-today > .grid-2,
  .main.tab-finances > .stack > .grid-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .stat-tile .val { font-size: 28px; }
}

/* ---------------- Small screens ---------------- */
@media (max-width: 620px) {
  :root { --section-gap: 28px; }
  .fgrid { grid-template-columns: 1fr; }
  .grid-2 { gap: 10px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .brand span { display: none; }
  .greeting { font-size: 28px; }
  .nav-title { font-size: 26px; }
  .stat-tile .val { font-size: 21px; }
  .main { padding: 22px 14px 110px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .card { padding: 15px; }
}

/* =======================================================================
   Notes — Notion-style workspace (sidebar + pane + inline page editor)
   ===================================================================== */
.main.tab-notes { padding-bottom: 120px; }

.notes-app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 860px) {
  .notes-app { grid-template-columns: 1fr; gap: 14px; }
}

/* ---- sidebar ---- */
.notes-side {
  position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: var(--card-fill);
  box-shadow: var(--shadow);
}
@media (max-width: 860px) { .notes-side { position: static; } }

.np-new {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 12px; margin-bottom: 4px;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 650;
  cursor: pointer; transition: filter .15s ease, transform .12s ease;
}
.np-new:hover { filter: brightness(1.08); }
.np-new:active { transform: scale(.985); }

.np-nav { display: flex; flex-direction: column; gap: 2px; }
.np-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--card-line); }

.np-cap {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--subtle-2); padding: 12px 8px 4px;
}

.np-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 10px;
  color: var(--text); cursor: pointer;
  transition: background .14s ease, color .14s ease;
  font-size: 14px; user-select: none;
}
.np-item:hover { background: var(--fill-06); }
.np-item.on { background: var(--fill-08); font-weight: 650; }
.np-item .np-ic { display: grid; place-items: center; flex: none; }
.np-item .np-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-item .np-cnt { font-size: 11px; font-weight: 700; color: var(--subtle-2); }
.np-add { color: var(--subtle); }
.np-add:hover { color: var(--text); }

.np-mini {
  display: none; place-items: center;
  border: none; background: none; color: var(--subtle-2);
  padding: 2px; border-radius: 6px; cursor: pointer;
}
.np-item:hover .np-mini { display: grid; }
.np-mini:hover { color: var(--text); background: var(--fill-08); }
.np-mini.danger-ic { display: grid; color: var(--negative); }

/* inline group create/rename */
.np-fedit {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 12px;
  background: var(--fill-04); border: 1px solid var(--card-line);
}
.np-fedit input {
  width: 100%; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--card-line); background: var(--fill-06);
  color: var(--text); font: inherit; outline: none;
}
.np-fedit input:focus { border-color: var(--card-line-hi); }
.np-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.np-swatches .swatch {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; padding: 0;
}
.np-swatches .swatch.on { border-color: #fff; }
.np-frow { display: flex; gap: 6px; align-items: center; }
.np-frow button { font-size: 13px; padding: 6px 10px; }

/* ---- pane ---- */
.notes-pane { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.np-head { display: flex; align-items: center; gap: 10px; }
.np-title { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }

.np-sel {
  background: var(--fill-06); border: 1px solid var(--card-line); color: var(--text);
  border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 13px; outline: none;
  cursor: pointer;
}
.np-sel:hover { border-color: var(--card-line-hi); }

/* ---- page editor ---- */
.np-bar {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--card-line);
  animation: rise .22s ease both;
}
.np-back {
  display: flex; align-items: center; gap: 6px;
  border: none; background: none; color: var(--subtle);
  font: inherit; font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: 9px;
}
.np-back svg { transform: rotate(180deg); }
.np-back:hover { background: var(--fill-06); color: var(--text); }
.np-status { font-size: 12px; color: var(--subtle-2); min-width: 54px; text-align: right; }

.np-tgl {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--card-line); border-radius: 9px;
  background: var(--fill-04); color: var(--subtle);
  cursor: pointer; transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.np-tgl:hover { color: var(--text); background: var(--fill-08); }
.np-del { font-size: 13px; padding: 6px 10px; }

.np-page {
  max-width: 760px; width: 100%; margin: 0 auto;
  padding: 22px 4px 140px;
  animation: rise .26s ease both;
}
.np-cover { height: 160px; border-radius: 14px; background-size: cover; background-position: center; margin-bottom: 22px; }

.np-h1 {
  width: 100%; resize: none; overflow: hidden;
  border: none; background: none; outline: none;
  color: var(--text); font: inherit; font-size: 36px; font-weight: 800;
  line-height: 1.2; letter-spacing: -0.02em;
  padding: 0; margin: 0 0 2px;
}
.np-h1::placeholder { color: rgba(226, 236, 255, 0.22); }
.np-h1.locked { font-size: 36px; }

.np-meta { font-size: 12px; color: var(--subtle-2); margin-bottom: 18px; }

.np-body {
  width: 100%; min-height: 320px; resize: none; overflow: hidden;
  border: none; background: none; outline: none;
  color: var(--text); font: inherit; font-size: 16px; line-height: 1.75;
  padding: 0;
}
.np-body::placeholder { color: rgba(226, 236, 255, 0.24); }

.np-locked {
  margin-top: 18px; padding: 20px; border-radius: 14px;
  border: 1px dashed var(--card-line); color: var(--subtle);
}
.np-locked .et { font-weight: 700; color: var(--text); margin-bottom: 6px; }

.np-tagdot { font-size: 11px; font-weight: 650; }

/* =======================================================================
   Notes — block editor (slash commands, inline marks, images)
   ===================================================================== */
.bk-root { position: relative; margin-top: 4px; }
.bk-list { display: flex; flex-direction: column; }
.bk-tail { min-height: 220px; cursor: text; }

/* ---- block frame + gutter ---- */
.bk-blk {
  position: relative;
  padding: 2px 0 2px 2px;
  border-radius: 8px;
  transition: background .12s ease;
}
.bk-blk.dragging { opacity: .45; }
.bk-blk.drop-above { box-shadow: 0 -2px 0 var(--accent); }
.bk-blk.drop-below { box-shadow: 0 2px 0 var(--accent); }

.bk-gut {
  position: absolute; top: 2px; left: -54px;
  display: flex; gap: 2px;
  opacity: 0; transition: opacity .12s ease;
}
.bk-blk:hover .bk-gut, .bk-blk:focus-within .bk-gut { opacity: 1; }
.bk-gbtn {
  display: grid; place-items: center;
  width: 24px; height: 26px; padding: 0;
  border: none; border-radius: 7px;
  background: none; color: var(--subtle-2);
  cursor: pointer;
}
.bk-gbtn:hover { background: var(--fill-08); color: var(--text); }
.bk-grip { cursor: grab; }
.bk-grip:active { cursor: grabbing; }
@media (max-width: 900px) {
  .bk-gut { left: auto; right: 0; top: -2px; opacity: .5; }
}

.bk-row { display: flex; align-items: flex-start; gap: 8px; }

/* ---- editable text ---- */
.bk-content {
  flex: 1; min-width: 0;
  outline: none;
  font-size: 16px; line-height: 1.75;
  padding: 3px 2px;
  word-break: break-word;
}
/* Placeholder only on the line the caret is actually in (plus the lone empty
   block in a fresh note), instead of every empty line shouting at once. */
.bk-content:focus:empty::before,
.bk-content.ph-solo:empty::before,
.bk-cap:focus:empty::before {
  content: attr(data-ph);
  color: rgba(226, 236, 255, 0.24);
  pointer-events: none;
}
.bk-content.ph-solo:not(:focus):empty::before { opacity: .55; }

.bk-h1 .bk-content { font-size: 28px; font-weight: 800; line-height: 1.3; letter-spacing: -0.015em; margin-top: 18px; }
.bk-h2 .bk-content { font-size: 22px; font-weight: 750; line-height: 1.35; margin-top: 14px; }
.bk-h3 .bk-content { font-size: 18px; font-weight: 700; line-height: 1.4; margin-top: 10px; }

.bk-dot { width: 18px; text-align: center; color: var(--subtle); font-size: 18px; line-height: 1.75; flex: none; padding-top: 3px; }
.bk-num { min-width: 20px; text-align: right; color: var(--subtle); font-size: 15px; line-height: 1.75; flex: none; padding-top: 3px; font-variant-numeric: tabular-nums; }

.bk-check {
  flex: none; margin-top: 8px;
  width: 18px; height: 18px; padding: 0;
  display: grid; place-items: center;
  border: 1.5px solid var(--fill-12); border-radius: 5px;
  background: var(--fill-04); color: #fff; cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.bk-check:hover { border-color: var(--accent); }
.bk-check.on { background: var(--accent); border-color: var(--accent); }
.bk-todo .bk-check.on + .bk-content { color: var(--subtle-2); text-decoration: line-through; }

.bk-quote { padding-left: 0; }
.bk-quote .bk-row { border-left: 3px solid var(--fill-12); padding-left: 12px; }
.bk-quote .bk-content { color: var(--subtle); font-style: italic; }

.bk-callout .bk-row {
  background: rgba(77, 141, 250, 0.09);
  border: 1px solid rgba(77, 141, 250, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 0;
}
.bk-cico { color: var(--accent); display: grid; place-items: center; padding-top: 5px; flex: none; }

.bk-code {
  margin: 8px 0;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #d8e4f7;
  white-space: pre-wrap; word-break: break-word;
  outline: none;
}
.bk-code:focus { border-color: var(--card-line-hi); }

.bk-hr { padding: 12px 0; }
.bk-hr hr { border: none; border-top: 1px solid var(--fill-12); margin: 0; }

/* ---- inline marks ---- */
.md-mk { color: rgba(226, 236, 255, 0.18); font-weight: 400; }
.bk-content:focus .md-mk { color: rgba(226, 236, 255, 0.32); }
.md-code {
  font: .88em ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--fill-08); border: 1px solid var(--card-line);
  padding: 1px 5px; border-radius: 6px; color: #ffd9a8;
}
.md-hi { background: rgba(245, 197, 66, 0.24); color: var(--text); border-radius: 4px; padding: 0 2px; }
.md-link { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 2px; }

/* ---- images ---- */
.bk-fig { margin: 10px 0; display: flex; flex-direction: column; }
.bk-a-left { align-items: flex-start; }
.bk-a-center { align-items: center; }
.bk-a-right { align-items: flex-end; }

.bk-imgshell {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0;
  border: 1px solid transparent;
  transition: border-color .14s ease;
}
.bk-imgshell:hover, .bk-imgshell.resizing { border-color: var(--card-line-hi); }
.bk-img { width: 100%; height: auto; display: block; border-radius: 13px; }
.bk-imgmiss {
  line-height: 1.5; padding: 22px; border: 1px dashed var(--card-line);
  border-radius: 13px; color: var(--subtle-2); font-size: 13px; text-align: center;
}

.bk-rz {
  position: absolute; top: 8%; height: 84%; width: 14px;
  display: grid; place-items: center; cursor: ew-resize;
  opacity: 0; transition: opacity .14s ease;
}
.bk-rz::after {
  content: ""; width: 5px; height: 42px; border-radius: 4px;
  background: rgba(255,255,255,.85);
  box-shadow: 0 1px 6px rgba(0,0,0,.55);
}
.bk-rz-l { left: 4px; }
.bk-rz-r { right: 4px; }
.bk-imgshell:hover .bk-rz, .bk-imgshell.resizing .bk-rz { opacity: 1; }
.bk-imgshell.resizing::before {
  content: attr(data-w);
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; line-height: 1.4; z-index: 3;
}

.bk-itb {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 3px; padding: 3px;
  border-radius: 10px;
  background: rgba(10, 14, 22, 0.78);
  border: 1px solid var(--card-line);
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .14s ease;
  line-height: 1; z-index: 2;
}
.bk-imgshell:hover .bk-itb { opacity: 1; }
.bk-itb-b {
  display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0;
  border: none; border-radius: 7px; background: none;
  color: var(--subtle); cursor: pointer;
}
.bk-itb-b:hover { background: var(--fill-12); color: var(--text); }
.bk-itb-b.on { color: var(--accent); background: rgba(77,141,250,.16); }

.bk-cap {
  margin-top: 7px; outline: none;
  font-size: 13px; color: var(--subtle);
  text-align: center; min-height: 19px;
}
.bk-a-left .bk-cap { text-align: left; }
.bk-a-right .bk-cap { text-align: right; }

/* ---- slash / block menu ---- */
.bk-menu {
  position: absolute; z-index: 60;
  width: 288px; max-height: 320px; overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: rgba(18, 25, 38, 0.97);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 48px -18px rgba(0,0,0,.8);
  animation: rise .14s ease both;
}
.bk-blkmenu { width: 190px; }
.bk-menu-cap {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--subtle-2); padding: 6px 8px 5px;
}
.bk-mi {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer;
}
.bk-mi.on { background: var(--fill-08); }
.bk-mi.danger { color: var(--negative); }
.bk-mi-ic {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--fill-06); color: var(--subtle);
}
.bk-mi.on .bk-mi-ic { color: var(--accent); }
.bk-mi.danger .bk-mi-ic { color: var(--negative); }
.bk-mi-txt { min-width: 0; }
.bk-mi-l { font-size: 14px; font-weight: 600; }
.bk-mi-h { font-size: 11.5px; color: var(--subtle-2); }

/* card previews get a little photo strip */
.note-shots { display: flex; gap: 5px; margin-top: 9px; }
.note-shot {
  width: 42px; height: 32px; border-radius: 7px;
  background-size: cover; background-position: center;
  border: 1px solid var(--card-line);
}

/* align glyphs on the image toolbar */
.bk-al { display: block; width: 13px; height: 11px; position: relative; }
.bk-al::before, .bk-al::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  border-radius: 2px; background: currentColor;
}
.bk-al::before { top: 0; }
.bk-al::after { bottom: 0; }
.bk-al-left { border-left: 6px solid currentColor; border-radius: 1px; }
.bk-al-right { border-right: 6px solid currentColor; border-radius: 1px; }
.bk-al-center { box-shadow: inset 0 0 0 0; }
.bk-al-center::before, .bk-al-center::after { left: 2px; right: 2px; }
.bk-al-center { background: linear-gradient(currentColor, currentColor) center/6px 3px no-repeat; }

/* =========================================================================
 * Vibe Code tab — full AI coding studio (VibeCode "redesign" aesthetic)
 * A self-contained blue-accent theme scoped under .tab-vibe, plus overlay
 * pieces (menus, modals) that live at the document root.
 * =======================================================================*/
.main.tab-vibe {
  --vbg-0:#05070d; --vbg-1:#0a0e18; --vbg-2:#0e1320; --vbg-3:#131a2b; --vbg-4:#1a2238;
  --vline:rgba(96,165,250,0.10); --vline-strong:rgba(96,165,250,0.22); --vline-soft:rgba(255,255,255,0.04);
  --vt1:#eaf0ff; --vt2:#a6b3d0; --vt3:#6c7a98; --vt4:#4a5572;
  --vblue-200:#9cc3ff; --vblue-300:#6ba1ff; --vblue-400:#4a90e2; --vblue-500:#2d7df0; --vblue-600:#1d63d8;
  --vglow:0 0 24px rgba(45,125,240,0.4), 0 0 60px rgba(45,125,240,0.16);
  --vmono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  max-width:none; padding:0; gap:0; height:calc(100dvh - 58px); min-height:480px;
  background:var(--vbg-2); position:relative; isolation:isolate;
}
.main.tab-vibe > * { animation:none; }
.main.tab-vibe::before {
  content:""; position:absolute; inset:0; pointer-events:none; z-index:-1;
  background:
    radial-gradient(900px 600px at 12% 8%, rgba(45,125,240,0.09), transparent 60%),
    radial-gradient(700px 500px at 92% 92%, rgba(74,144,226,0.10), transparent 60%),
    radial-gradient(500px 400px at 80% 6%, rgba(124,106,219,0.08), transparent 60%);
}
.vibe-app { display:grid; grid-template-columns:272px 1fr; flex:1; min-height:0; position:relative; }

/* Drag-and-drop overlay — hidden until a file is dragged over the Vibe tab. */
.vibe-drop-overlay {
  position:absolute; inset:0; z-index:40; display:none; place-items:center;
  padding:24px; background:rgba(8,11,18,0.72); backdrop-filter:blur(3px);
  border:2px dashed var(--card-line-hi); border-radius:16px; pointer-events:none;
}
.vibe-app.vibe-dropping .vibe-drop-overlay { display:grid; }
.vibe-drop-card {
  display:grid; justify-items:center; gap:6px; text-align:center;
  padding:26px 34px; border-radius:16px; background:var(--card-fill);
  border:1px solid var(--card-line-hi); color:var(--accent-soft);
  box-shadow:0 12px 40px rgba(0,0,0,0.4);
}
.vibe-drop-t { font-size:15px; font-weight:700; color:var(--text); }
.vibe-drop-s { font-size:12px; color:var(--subtle); }

/* ── Sidebar ── */
.vibe-side {
  background:linear-gradient(180deg, rgba(14,19,32,0.7), rgba(10,14,24,0.7));
  backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
  border-right:1px solid var(--vline); display:flex; flex-direction:column; padding:16px 12px; gap:14px; min-height:0;
}
.vibe-brand { display:flex; align-items:center; gap:10px; padding:4px 6px 12px; border-bottom:1px solid var(--vline-soft); }
.vibe-brand-mark {
  width:34px; height:34px; border-radius:10px; display:grid; place-items:center; color:#fff; position:relative; overflow:hidden;
  background:linear-gradient(135deg, var(--vblue-500), var(--vblue-600)); box-shadow:var(--vglow);
}
.vibe-brand-mark::after { content:""; position:absolute; inset:0; background:linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%); transform:translateX(-100%); animation:vibeShine 4s infinite; }
@keyframes vibeShine { 0%{transform:translateX(-100%)} 60%,100%{transform:translateX(100%)} }
.vibe-brand-name { font-weight:700; font-size:15px; letter-spacing:-0.02em; color:var(--vt1); }
.vibe-brand-name span { color:var(--vblue-300); }
.vibe-new {
  display:flex; align-items:center; justify-content:center; gap:8px; padding:11px 14px; border-radius:12px;
  background:linear-gradient(135deg, rgba(45,125,240,0.18), rgba(45,125,240,0.08)); border:1px solid var(--vline-strong);
  color:var(--vblue-200); font-size:13px; font-weight:600; cursor:pointer; transition:all .25s cubic-bezier(.4,0,.2,1);
}
.vibe-new:hover { background:linear-gradient(135deg, rgba(45,125,240,0.28), rgba(45,125,240,0.12)); color:#fff; transform:translateY(-1px); box-shadow:0 6px 20px -8px rgba(45,125,240,0.6); }

.vibe-searchwrap { position:relative; }
.vibe-search-ic { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--vt4); pointer-events:none; }
.vibe-search { width:100%; background:var(--vbg-3); border:1px solid var(--vline); color:var(--vt1); border-radius:10px; padding:9px 12px 9px 32px; font-size:13px; font-family:inherit; }
.vibe-search:focus { outline:none; border-color:var(--vline-strong); }
.vibe-search::placeholder { color:var(--vt4); }

.vibe-conv-scroll { flex:1; overflow-y:auto; margin:0 -4px; padding:0 4px; display:flex; flex-direction:column; gap:2px; min-height:0; }
.vibe-side-empty { color:var(--vt4); font-size:13px; padding:12px 8px; }
.vibe-date-label { font-size:10px; text-transform:uppercase; letter-spacing:0.12em; color:var(--vt4); font-weight:600; padding:12px 10px 5px; }
.vibe-conv { display:flex; align-items:center; gap:9px; width:100%; text-align:left; background:none; border:none; color:var(--vt2); cursor:pointer; padding:8px 10px; border-radius:9px; font-size:13.5px; transition:background .14s, color .14s; }
.vibe-conv:hover { background:var(--vbg-3); color:var(--vt1); }
.vibe-conv.active { background:rgba(45,125,240,0.14); color:#fff; box-shadow:inset 0 0 0 1px rgba(45,125,240,0.25); }
.vibe-conv-ic { color:var(--vt4); flex-shrink:0; display:inline-flex; }
.vibe-conv.active .vibe-conv-ic { color:var(--vblue-300); }
.vibe-conv-title { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vibe-conv-del { color:var(--vt4); opacity:0; padding:2px; border-radius:6px; display:inline-flex; transition:opacity .14s; }
.vibe-conv:hover .vibe-conv-del { opacity:1; }
.vibe-conv-del:hover { color:var(--negative); }

.vibe-nav-section { display:flex; flex-direction:column; gap:2px; border-top:1px solid var(--vline-soft); padding-top:12px; }
.vibe-nav-label { font-size:10px; text-transform:uppercase; letter-spacing:0.12em; color:var(--vt4); font-weight:600; padding:0 10px 6px; }
.vibe-nav-item { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; color:var(--vt2); background:none; border:none; cursor:pointer; font-size:13px; text-align:left; transition:background .14s, color .14s; }
.vibe-nav-item:hover { background:var(--vbg-3); color:var(--vt1); }
.vibe-nav-item.active { background:rgba(45,125,240,0.12); color:#fff; }
.vibe-nav-ic { display:inline-flex; flex-shrink:0; }
.vibe-nav-text { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── Main column ── */
.vibe-col { display:flex; flex-direction:column; min-width:0; min-height:0; position:relative; }
/* jump-to-latest: hidden until the reader scrolls up during a stream */
.vibe-jump { position:absolute; left:50%; bottom:96px; transform:translateX(-50%) translateY(6px); z-index:5;
  width:34px; height:34px; border-radius:50%; display:grid; place-items:center; cursor:pointer;
  background:var(--vbg-3); color:var(--vt1); border:1px solid var(--vline-strong);
  box-shadow:0 6px 20px -6px rgba(0,0,0,0.6); opacity:0; pointer-events:none; transition:opacity .18s, transform .18s; }
.vibe-jump.show { opacity:1; pointer-events:auto; transform:translateX(-50%) translateY(0); }
.vibe-jump:hover { border-color:var(--vblue-400); color:var(--vblue-200); }
.vibe-topbar { display:flex; align-items:center; gap:10px; padding:12px 20px; border-bottom:1px solid var(--vline); }
.vibe-model-btn { display:inline-flex; align-items:center; gap:8px; background:var(--vbg-3); border:1px solid var(--vline); color:var(--vt1); padding:8px 12px; border-radius:10px; font-size:13px; font-weight:600; cursor:pointer; transition:border-color .15s; }
.vibe-model-btn:hover { border-color:var(--vline-strong); }
.vibe-model-btn svg:first-child { color:var(--vblue-300); }
.vibe-topbtn { display:inline-flex; align-items:center; gap:6px; background:none; border:1px solid var(--vline); color:var(--vt2); padding:8px 12px; border-radius:10px; font-size:12.5px; cursor:pointer; transition:all .15s; }
.vibe-topbtn:hover { color:var(--vt1); border-color:var(--vline-strong); background:var(--vbg-3); }
.vibe-agent-tag { display:inline-flex; align-items:center; gap:6px; padding:6px 8px 6px 10px; border-radius:999px; font-size:12px; font-weight:600; color:#fff; background:color-mix(in srgb, var(--ac) 22%, transparent); border:1px solid color-mix(in srgb, var(--ac) 45%, transparent); }
.vibe-agent-tag svg { color:var(--ac); }
.vibe-agent-tag-x { background:none; border:none; color:var(--vt2); cursor:pointer; display:inline-flex; padding:1px; border-radius:5px; }
.vibe-agent-tag-x:hover { color:#fff; }

/* ── Thread ── */
.vibe-thread { flex:1; overflow-y:auto; padding:26px 20px; display:flex; flex-direction:column; gap:22px; }
.vibe-msg { display:flex; gap:13px; max-width:800px; width:100%; margin:0 auto; animation:vibeMsgIn .4s cubic-bezier(.4,0,.2,1) backwards; }
@keyframes vibeMsgIn { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)} }
.vibe-av { width:28px; height:28px; flex-shrink:0; border-radius:8px; display:grid; place-items:center; color:#fff; }
.vibe-user .vibe-av { background:#6f4bd6; }
.vibe-assistant .vibe-av { background:var(--vblue-600); }
.vibe-msg-main { flex:1; min-width:0; }
.vibe-msg-agent { font-size:11px; font-weight:700; color:var(--vblue-300); margin-bottom:4px; }
/* Claude-like reading column: relaxed line-height, comfortable size, soft text */
.vibe-md { min-width:0; padding-top:3px; line-height:1.7; font-size:15px; color:#e6ebf5; }
.vibe-md > *:first-child { margin-top:0; } .vibe-md > *:last-child { margin-bottom:0; }
.vibe-p { margin:0 0 14px; white-space:pre-wrap; word-wrap:break-word; }
.vibe-h { font-weight:650; margin:22px 0 10px; line-height:1.35; letter-spacing:-0.01em; color:#f2f5fb; }
.vibe-h1{font-size:20px} .vibe-h2{font-size:17.5px} .vibe-h3{font-size:15.5px} .vibe-h4{font-size:14.5px}
.vibe-ul, .vibe-ol { margin:0 0 14px; padding-left:24px; } .vibe-ul li, .vibe-ol li { margin:5px 0; }
.vibe-quote { margin:0 0 14px; padding:2px 16px; border-left:3px solid var(--vline-strong); color:var(--vt2); }
.vibe-hr { border:none; border-top:1px solid var(--vline); margin:20px 0; }
.vibe-link { color:var(--vblue-300); text-decoration:underline; text-underline-offset:2px; }
.vibe-inline-code { font-family:var(--vmono); font-size:12.5px; background:rgba(255,255,255,0.06); border:1px solid var(--vline-soft); border-radius:5px; padding:1.5px 5px; color:#e3c6a0; }
/* simple blinking caret, no glow */
.vibe-cursor { display:inline-block; width:8px; height:1.05em; margin-left:1px; vertical-align:text-bottom; background:var(--vblue-300); opacity:0.85; animation:vibeCursor 1s steps(1) infinite; }
@keyframes vibeCursor { 0%,50%{opacity:0.85} 50.01%,100%{opacity:0} }
.vibe-msg-images { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.vibe-msg-img { max-width:220px; max-height:180px; border-radius:10px; border:1px solid var(--vline); }

/* typing dots */
.vibe-typing { display:inline-flex; gap:5px; padding:6px 0; }
.vibe-typing span { width:7px; height:7px; border-radius:50%; background:var(--vblue-300); animation:vibeDot 1.2s ease-in-out infinite; }
.vibe-typing span:nth-child(2){animation-delay:.15s} .vibe-typing span:nth-child(3){animation-delay:.3s}
@keyframes vibeDot { 0%,80%,100%{opacity:.25; transform:scale(.85)} 40%{opacity:1; transform:scale(1)} }

/* think block */
.vibe-think { margin:0 0 12px; border:1px solid var(--vline); border-radius:12px; background:rgba(124,106,219,0.06); overflow:hidden; }
.vibe-think-sum { display:flex; align-items:center; gap:8px; padding:9px 13px; cursor:pointer; font-size:12.5px; font-weight:600; color:var(--vblue-200); list-style:none; user-select:none; }
.vibe-think-sum::-webkit-details-marker { display:none; }
.vibe-think-ic { color:#9473f5; display:inline-flex; }
.vibe-think-body { padding:2px 15px 12px; font-size:13px; color:var(--vt2); border-top:1px solid var(--vline-soft); }
.vibe-think-body .vibe-p { color:var(--vt2); }

/* usage badge */
.vibe-usage { display:inline-flex; align-items:center; gap:5px; margin-top:10px; padding:4px 9px; border-radius:999px; background:var(--vbg-3); border:1px solid var(--vline); color:var(--vt3); font-size:11px; font-weight:600; }
.vibe-usage-ic { color:var(--vblue-300); display:inline-flex; }
.vibe-usage-total span:last-child, .vibe-usage-total .muted { font-weight:800; color:var(--vt1); }

.vibe-error { border:1px solid rgba(242,102,107,0.4); background:rgba(242,102,107,0.08); color:var(--negative); border-radius:12px; padding:12px 14px; font-size:13.5px; }
.vibe-error strong { display:block; margin-bottom:4px; }

/* code blocks */
.vibe-code { margin:0 0 14px; border:1px solid rgba(255,255,255,0.08); border-radius:10px; overflow:hidden; background:#0b0e14; }
.vibe-code-head { display:flex; align-items:center; justify-content:space-between; padding:7px 10px 7px 14px; background:rgba(255,255,255,0.025); border-bottom:1px solid rgba(255,255,255,0.06); }
.vibe-code-label { display:flex; align-items:center; gap:8px; }
.vibe-code-dot { display:none; }
.vibe-code-lang { font-size:11.5px; color:var(--vt3); font-family:var(--vmono); letter-spacing:0.02em; }
.vibe-code-actions { display:flex; gap:2px; }
.vibe-code-btn { display:inline-flex; align-items:center; gap:5px; background:none; border:none; color:var(--vt3); font-size:11.5px; cursor:pointer; padding:4px 8px; border-radius:6px; transition:all .14s; }
.vibe-code-btn:hover { color:var(--vt1); background:rgba(255,255,255,0.06); }
.vibe-code pre { margin:0; padding:14px 16px; overflow-x:auto; }
.vibe-code code { font-family:var(--vmono); font-size:12.8px; line-height:1.65; color:#c9d1d9; white-space:pre; }
.vibe-code .tok-com { color:#5b6b86; font-style:italic; }
.vibe-code .tok-str { color:#7fd5a3; }
.vibe-code .tok-num { color:#e0a35a; }
.vibe-code .tok-kw  { color:#6ba1ff; font-weight:600; }

/* composer */
.vibe-composer-wrap { padding:12px 20px 18px; border-top:1px solid var(--vline); max-width:840px; width:100%; margin:0 auto; }
.vibe-attach-row { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.vibe-attach { display:flex; align-items:center; gap:7px; background:var(--vbg-3); border:1px solid var(--vline); border-radius:10px; padding:6px 8px; font-size:12px; color:var(--vt2); max-width:200px; }
.vibe-attach-thumb { width:22px; height:22px; border-radius:5px; object-fit:cover; }
.vibe-attach-ic { color:var(--vblue-300); display:inline-flex; }
.vibe-attach-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vibe-attach-x { background:none; border:none; color:var(--vt3); cursor:pointer; display:inline-flex; padding:1px; border-radius:5px; }
.vibe-attach-x:hover { color:#fff; }
.vibe-composer { display:flex; align-items:flex-end; gap:8px; background:var(--vbg-3); border:1px solid var(--vline); border-radius:18px; padding:8px 8px 8px 10px; transition:border-color .15s, box-shadow .15s; }
.vibe-composer:focus-within { border-color:var(--vline-strong); box-shadow:0 0 0 3px rgba(45,125,240,0.08); }
.vibe-cbtn { width:36px; height:36px; flex-shrink:0; border-radius:11px; border:none; background:none; color:var(--vt3); cursor:pointer; display:grid; place-items:center; transition:all .14s; }
.vibe-cbtn:hover { color:var(--vblue-300); background:var(--vbg-4); }
.vibe-cbtn.on { color:#fff; background:linear-gradient(135deg, rgba(45,125,240,0.4), rgba(45,125,240,0.2)); }
.vibe-cbtn:disabled { opacity:0.4; cursor:default; }
.vibe-input { flex:1; resize:none; background:none; border:none; color:var(--vt1); font-family:inherit; font-size:14.5px; line-height:1.5; padding:8px 4px; max-height:200px; overflow-y:auto; }
.vibe-input:focus { outline:none; } .vibe-input::placeholder { color:var(--vt4); }
.vibe-send { width:40px; height:40px; flex-shrink:0; border-radius:13px; border:none; cursor:pointer; color:#fff; display:grid; place-items:center; background:linear-gradient(135deg, var(--vblue-400), var(--vblue-600)); box-shadow:0 4px 14px -2px rgba(45,125,240,0.5); transition:filter .14s; }
.vibe-send:hover { filter:brightness(1.1); } .vibe-send:disabled { opacity:0.4; cursor:default; filter:none; box-shadow:none; }
.vibe-send.streaming { background:linear-gradient(135deg,#f2666b,#d84a4f); box-shadow:none; }

/* welcome */
.vibe-welcome { text-align:center; max-width:540px; margin:auto; padding:30px 20px; }
.vibe-welcome-mark { width:64px; height:64px; margin:0 auto 18px; border-radius:18px; display:grid; place-items:center; color:#fff; background:linear-gradient(135deg, var(--vblue-400), var(--vblue-600)); box-shadow:var(--vglow); }
.vibe-welcome-h { margin:0 0 8px; font-size:25px; font-weight:800; letter-spacing:-0.5px; color:var(--vt1); }
.vibe-welcome-p { color:var(--vt2); font-size:14.5px; line-height:1.65; margin:0 0 20px; }
.vibe-cta { background:linear-gradient(135deg, var(--vblue-500), var(--vblue-600)); color:#fff; border:none; border-radius:12px; padding:11px 22px; font-weight:700; font-size:14px; cursor:pointer; box-shadow:var(--vglow); }
.vibe-cta:hover { filter:brightness(1.08); }
.vibe-suggest { display:flex; flex-direction:column; gap:9px; max-width:380px; margin:0 auto; }
.vibe-chip { background:var(--vbg-3); border:1px solid var(--vline); color:var(--vt1); padding:12px 15px; border-radius:12px; font-size:13.5px; cursor:pointer; text-align:left; transition:all .15s; }
.vibe-chip:hover { border-color:var(--vline-strong); background:var(--vbg-4); transform:translateY(-1px); }

/* ── Dropdown menus (root-level overlay) ── */
.vibe-menu { position:fixed; z-index:200; min-width:250px; max-width:340px; max-height:60vh; overflow-y:auto; background:#0d1220; border:1px solid var(--card-line, rgba(96,165,250,0.22)); border-radius:14px; padding:6px; box-shadow:0 24px 60px -20px rgba(0,0,0,0.7), 0 8px 24px -8px rgba(0,0,0,0.5); animation:vibeMenuIn .16s ease; }
@keyframes vibeMenuIn { from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:translateY(0)} }
.vibe-menu-item { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:none; border:none; color:#a6b3d0; cursor:pointer; padding:9px 10px; border-radius:9px; transition:background .12s; }
.vibe-menu-item:hover { background:rgba(96,165,250,0.08); color:#eaf0ff; }
.vibe-menu-item.active { background:rgba(45,125,240,0.14); color:#fff; }
.vibe-menu-ic { color:#6ba1ff; display:inline-flex; flex-shrink:0; }
.vibe-menu-info { flex:1; min-width:0; }
.vibe-menu-name { font-size:13.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vibe-menu-sub { font-size:11.5px; color:#6c7a98; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vibe-menu-check { color:#6ba1ff; display:inline-flex; }
.vibe-menu-add { display:flex; align-items:center; gap:8px; width:100%; background:none; border:none; border-top:1px solid rgba(255,255,255,0.05); margin-top:4px; padding:11px 10px 8px; color:#6ba1ff; font-size:13px; font-weight:600; cursor:pointer; }
.vibe-menu-add:hover { color:#9cc3ff; }

/* ── Model / agent cards in modals ── */
.vibe-model-card { display:flex; align-items:center; gap:12px; cursor:pointer; padding:14px 16px; }
.vibe-model-card:hover { border-color:var(--card-line-hi); }
.vibe-star { background:none; border:none; color:var(--subtle-2); cursor:pointer; padding:4px; border-radius:8px; flex-shrink:0; }
.vibe-star.on, .vibe-star:hover { color:var(--g-yellow); }
.vibe-model-info { flex:1; min-width:0; }
.vibe-model-name { font-weight:700; font-size:14.5px; }
.vibe-agent-dot { flex-shrink:0; display:inline-flex; }
.vibe-agent-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; }
.vibe-agent-preset { display:flex; flex-direction:column; gap:6px; align-items:flex-start; text-align:left; background:var(--card-fill); border:1px solid var(--card-line); border-radius:14px; padding:14px; cursor:pointer; transition:all .15s; }
.vibe-agent-preset:hover { border-color:var(--card-line-hi); transform:translateY(-1px); }
.vibe-agent-preset-ic { width:38px; height:38px; border-radius:10px; display:grid; place-items:center; }
.vibe-agent-preset-name { font-weight:700; font-size:14px; }
.vibe-agent-preset-desc { font-size:12px; color:var(--subtle); line-height:1.4; }

/* ── Preview ── */
.vibe-preview-frame { width:100%; height:70vh; border:1px solid var(--card-line); border-radius:12px; background:#fff; }
.vibe-preview-loading { padding:40px; text-align:center; color:var(--subtle); font-size:14px; }

/* ── Mobile ── */
@media (max-width:760px) {
  .main.tab-vibe { height:calc(100dvh - 54px); }
  .vibe-app { grid-template-columns:1fr; }
  .vibe-side { flex-direction:row; align-items:center; gap:8px; border-right:none; border-bottom:1px solid var(--vline); padding:10px 12px; overflow-x:auto; }
  .vibe-brand, .vibe-searchwrap, .vibe-nav-section, .vibe-date-label { display:none; }
  .vibe-new { flex-shrink:0; padding:9px 12px; } .vibe-new span { display:none; }
  .vibe-conv-scroll { flex-direction:row; margin:0; padding:0; gap:6px; }
  .vibe-conv { width:auto; max-width:170px; flex-shrink:0; }
  .vibe-conv-del { display:none; }
  .vibe-thread { padding:18px 14px; } .vibe-composer-wrap { padding:10px 14px 14px; }
  .vibe-agent-grid { grid-template-columns:1fr; }
}
