/* Business Time
   GDBB's light system (Inter, 500-weight headings, outlined buttons, hairline
   rules, small uppercase kickers) with the same iridescent glitter wash, plus
   the Delphinus constellation and dolphins for Delphina Photography. */
:root {
  --bg: #fbfaff;
  --surface: #ffffff;
  --surface-2: #f6f4fd;
  --ink: #1b1d2b;
  --ink-2: #555a6b;
  --ink-3: #676b7e;
  --line: rgba(27, 29, 43, 0.11);
  --line-strong: rgba(27, 29, 43, 0.22);
  --tile-line: rgba(27, 29, 43, 0.22); /* GDBB's tile borders */
  --accent: #6254be;
  --accent-ink: #4f42a6;
  --accent-soft: #efecfc;
  --accent-2: #9184d9;
  --pos: #1c7556;
  --pos-soft: #e5f4ee;
  --neg: #ad4b22;
  --neg-soft: #fbece4;
  --pink: #efb3d3;
  --aqua: #a3e0e0;
  --peach: #f7d2b0;
  --lav: #cdc5fa;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(40, 30, 90, 0.05), 0 0 0 1px var(--line);
  --shadow-md: 0 8px 28px rgba(60, 40, 120, 0.10), 0 0 0 1px var(--line);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
p { margin: 0; }
.num, .money { font-variant-numeric: tabular-nums; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(98, 84, 190, 0.2); }

/* ---------- glitter ---------- */
.glitter {
  position: absolute; left: 0; right: 0; top: 0; height: 340px; z-index: 0;
  pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 100%);
}
.glitter .wash {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 90% at 12% 0%, rgba(239, 179, 211, 0.75), transparent 70%),
    radial-gradient(50% 80% at 88% 10%, rgba(163, 224, 224, 0.7), transparent 70%),
    radial-gradient(45% 70% at 55% -10%, rgba(205, 197, 250, 0.85), transparent 70%),
    linear-gradient(110deg, #fde7f3 0%, #ece7ff 28%, #e2f7f6 52%, #fff0e3 74%, #f1e7ff 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 220% 100%;
  animation: gd-shift 22s ease-in-out infinite alternate;
}
.glitter .dust, .glitter .dust2 {
  position: absolute; inset: 0;
}
.glitter .dust {
  background:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 0.8px, transparent 1.4px) 0 0 / 23px 29px,
    radial-gradient(circle, rgba(255,255,255,0.9) 0 1px, transparent 1.6px) 11px 7px / 41px 37px,
    radial-gradient(circle, rgba(186,170,255,0.9) 0 1px, transparent 1.7px) 5px 19px / 53px 47px,
    radial-gradient(circle, rgba(255,160,205,0.85) 0 1px, transparent 1.7px) 31px 3px / 67px 59px;
  animation: gd-twinkle 3.2s ease-in-out infinite;
}
.glitter .dust2 {
  background:
    radial-gradient(circle, rgba(255,255,255,1) 0 1.1px, transparent 1.8px) 17px 13px / 31px 43px,
    radial-gradient(circle, rgba(140,215,215,0.95) 0 1px, transparent 1.7px) 3px 27px / 59px 53px,
    radial-gradient(circle, rgba(255,210,160,0.95) 0 1px, transparent 1.7px) 43px 11px / 71px 61px;
  animation: gd-twinkle 4.1s ease-in-out infinite reverse;
}
.glitter svg.sparkles { position: absolute; inset: 0; width: 100%; height: 100%; }
.glitter svg.sparkles path { fill: #fff; transform-box: fill-box; transform-origin: center; animation: gd-star 2.8s ease-in-out infinite; }
@keyframes gd-shift { from { background-position: 0 0, 0 0, 0 0, 0% 0; } to { background-position: 0 0, 0 0, 0 0, 100% 0; } }
@keyframes gd-twinkle { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.35; } }
@keyframes gd-star { 0%, 100% { opacity: 0.15; transform: scale(0.55) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(20deg); } }
@media (prefers-reduced-motion: reduce) {
  .glitter .wash, .glitter .dust, .glitter .dust2, .glitter svg.sparkles path { animation: none; }
}

/* ---------- shell ---------- */
.app { position: relative; min-height: 100vh; min-height: 100dvh; }
.shell { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 32px 56px; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px 0 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; }
.brand svg { flex: none; filter: drop-shadow(0 2px 6px rgba(120, 90, 200, 0.18)); }
.brand-name { font-weight: 600; font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; }
.brand-name span { display: block; font-weight: 500; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.sync { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); display: inline-block; }
.sync.saving i { background: var(--accent-2); }
.sync.error i { background: var(--neg); }

.hero { padding: 18px 0 20px; }
.hero .kicker { margin-bottom: 6px; }
.hero-balance { font-size: 52px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.hero-sub { margin-top: 8px; color: var(--ink-2); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }

.tabs-top { display: flex; gap: 4px; background: rgba(255,255,255,0.7); padding: 4px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.tabs-top button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tabs-top button:hover { color: var(--ink); }
.tabs-top button[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- type helpers ---------- */
.kicker { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- rules ---------- */
.hr { height: 1px; border: 0; margin: 14px 0;
  background: linear-gradient(to right, transparent, var(--line) 40px, var(--line) calc(100% - 40px), transparent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 14px; border-radius: var(--radius-md);
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; line-height: 1.2; white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { flex: none; }
.btn-primary { color: var(--accent); border-color: var(--accent); background: rgba(255,255,255,0.7); }
.btn-primary:hover { background: var(--accent-soft); }
.btn-solid { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn-solid:hover { background: #2d3044; }
.btn-secondary { border-color: var(--line-strong); background: rgba(255,255,255,0.7); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--accent); padding-inline: 8px; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { color: var(--neg); border-color: rgba(173, 75, 34, 0.45); }
.btn-danger:hover { background: var(--neg-soft); }
.btn-icon { width: 38px; padding: 0; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field > label, .label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--ink-2); }
.input {
  width: 100%; min-height: 42px; padding: 8px 11px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  caret-color: var(--accent); -webkit-appearance: none; appearance: none;
}
.input:hover { border-color: rgba(27,29,43,0.38); }
.input:focus-visible { border-color: var(--accent); outline: 2px solid rgba(98,84,190,0.25); outline-offset: 0; }
select.input { padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23555a6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
textarea.input { min-height: 70px; resize: vertical; }
.money-wrap { position: relative; }
.money-wrap .cur { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.money-wrap .input { padding-left: 21px; } /* value sits right against the $ */
.pct-wrap { position: relative; }
.pct-wrap .input { padding-right: 28px; }
.pct-wrap .cur { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.seg { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: rgba(255,255,255,0.75); }
.seg button { border: 0; border-radius: 7px; background: none; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); min-height: 30px; }
.seg button:hover:not([aria-pressed="true"]) { background: var(--surface-2); color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #d9d8e3; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-title { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.section-title { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.biz { background: #fdf0e3; color: #8a4a1c; }
.tag.sav { background: var(--accent-soft); color: var(--accent-ink); }
.tag.inc { background: var(--pos-soft); color: var(--pos); }


/* ---------- sheet / dialog ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(27, 29, 43, 0.28); display: flex; align-items: center; justify-content: center; padding: 24px; animation: gd-fade .15s ease-out; }
.sheet { width: 100%; max-width: 580px; max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-md);
  padding: 0 22px 18px; animation: gd-up .2s ease-out; overscroll-behavior: contain; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 16px 0 10px; background: var(--surface); }
.sheet-head h2 { font-size: 19px; margin-right: auto; }
.sheet-foot { position: sticky; bottom: -18px; display: flex; gap: 8px; padding: 12px 0 4px; background: var(--surface); margin-top: 16px; border-top: 1px solid var(--line); }
@keyframes gd-fade { from { opacity: 0; } }
@keyframes gd-up { from { transform: translateY(24px); opacity: 0.4; } }


/* ---------- setup ---------- */
.set-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row .input { min-height: 38px; font-size: 15px; }
.set-row .name { flex: 1 1 160px; min-width: 120px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.chip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.chip button:hover { background: #e7e4f3; color: var(--ink); }
.subnav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 12px; scrollbar-width: none; }
.subnav button { border: 1px solid var(--line-strong); background: rgba(255,255,255,0.8); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.subnav button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- auth ---------- */
.auth { position: relative; z-index: 1; max-width: 400px; margin: 0 auto; padding: calc(56px + env(safe-area-inset-top)) 20px 40px; }
.auth h1 { font-size: 30px; letter-spacing: -0.025em; margin: 18px 0 6px; }
.auth .card { padding: 20px; margin-top: 22px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px; z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-md); max-width: calc(100% - 32px); }
.banner { background: var(--neg-soft); color: var(--neg); border-radius: var(--radius-md); padding: 10px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.loading { position: relative; z-index: 1; padding: 120px 20px; text-align: center; color: var(--ink-2); }

.chip .chip-name { width: auto; height: auto; border-radius: 4px; background: none; color: inherit; font: inherit; padding: 0; }
.chip .chip-name:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }


.auth { max-width: 380px; padding-top: calc(10vh + env(safe-area-inset-top)); }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-brand h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 12px 0 0; }
.auth-card { padding: 22px; margin-top: 24px; box-shadow: var(--shadow-md); }
.auth-title { font-size: 19px; font-weight: 500; margin: 0; }
.auth-msg { color: var(--accent-ink); margin: 0; }
.auth-links { justify-content: space-between; margin-top: 16px; }
.auth-links .btn-ghost:hover { background: transparent; }
.auth { max-width: 420px; } .auth-brand h1 { white-space: nowrap; font-size: 24px; }

/* =================== Business Time =================== */
.shell { max-width: 1360px; }
.accent { color: var(--accent); }
select.input.is-empty { color: #9a9cb0; }
select.input.is-empty option { color: var(--ink); }
select.input:disabled { color: #b4b6c4; background-color: var(--surface-2); cursor: not-allowed; }
.sheet .stack > * + * { margin-top: 14px; }
.card-hint { margin: -4px 0 12px; }

/* ---------- Delphinus ---------- */
.constellation line { stroke: rgba(98, 84, 190, 0.35); stroke-width: 1; stroke-dasharray: 2 3; }
.constellation .star { fill: #fff; stroke: rgba(98, 84, 190, 0.55); stroke-width: 0.8; }
.constellation .halo { fill: rgba(255, 255, 255, 0.55); }
.constellation.twinkle g { animation: bt-twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bt-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.sky { position: absolute; top: 10px; left: 56%; width: 78px; height: auto; z-index: 0; opacity: 0.9; pointer-events: none; }
.mark { flex: none; filter: drop-shadow(0 2px 6px rgba(120, 90, 200, 0.18)); }

/* ---------- topbar ----------
   Placed like GDBB's: the header spans the window, brand at the far left,
   tabs at the far right, 24px in from each edge. */
.app { overflow-x: clip; }
.topbar { position: relative; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px;
  margin: 0 calc(50% - 50vw) 8px; padding: 14px 24px 10px; }
.topbar .brand { margin-right: 0; }
.topbar .brand-name { font-size: 21px; }
.topbar .brand .mark { margin: -5px 0; }
.topbar .sync { grid-column: 3; }
.topbar .tabs-top { grid-column: 4; }

/* ---------- home layout ---------- */
.home { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(460px, 1.08fr); gap: 28px; align-items: start; }
.col-right { position: sticky; top: 18px; margin-top: 52px; } /* list-head height + its margin: lines up with the totals boxes */
@media (max-width: 960px) { .home { grid-template-columns: 1fr; } .col-right { position: static; order: -1; margin-top: 0; } }

/* Fixed height so the stopwatch can line up with the first thing below it. */
.list-head { display: flex; align-items: center; gap: 12px; height: 40px; margin-bottom: 12px; }
.list-head h2 { font-size: 24px; letter-spacing: -0.02em; }
.summary { padding: 0 0 14px; }
.summary .kicker { margin-bottom: 8px; }

/* Bordered tiles like GDBB's month stats. */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--tile-line); border: 1px solid var(--tile-line); border-radius: var(--radius-md); overflow: hidden; }
.trio > div { background: var(--surface-2); padding: 10px 12px; min-width: 0; }
.trio .label { margin: 0 0 2px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.trio .v { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trio.big { background: transparent; border: 0; gap: 10px; overflow: visible; }
.trio.big > div { background: rgba(255, 255, 255, 0.72); border: 1px solid var(--tile-line); border-radius: var(--radius-md); padding: 12px 14px; }
.trio.big .v { font-size: 22px; letter-spacing: -0.02em; }

/* ---------- project capsules ---------- */
.proj { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-sm); margin-bottom: 10px; overflow: hidden; transition: box-shadow .15s; }
.proj.sel { box-shadow: 0 0 0 1.5px var(--accent-2), 0 10px 30px rgba(98, 84, 190, 0.12); }
.proj-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; cursor: pointer; }
.proj { cursor: pointer; }
.proj-head.no-open .proj-toggle { cursor: pointer; }
.proj-toggle { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.proj-cap { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 50px; padding: 4px 12px; border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px solid var(--tile-line); color: var(--ink); line-height: 1.25; }
.proj-cap .proj-name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-cap-cat { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.proj-head .chev { color: var(--ink-3); flex: none; transition: transform .2s; }
.proj-head:has([aria-expanded="true"]) .chev { transform: rotate(90deg); }
.proj-name { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.proj-edit { width: 34px; min-height: 34px; color: var(--ink-3); }
.proj-edit:hover { color: var(--accent); }
/* Fixed size, label on top and value below, so empty and filled tiles line up. */
.date-tile { flex: none; box-sizing: border-box; width: 84px; height: 50px; display: flex; flex-direction: column; justify-content: center; padding: 0 4px;
  line-height: 1.2; } /* no tile: just the label and date on the card */
.date-tile span { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.date-tile b { display: block; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-tile.empty b { color: var(--ink-3); }
.tile-time { position: relative; }
.tile-add { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.tile-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tag.live { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.tag.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bt-pulse 1.4s ease-in-out infinite; }
@keyframes bt-pulse { 50% { opacity: 0.25; } }
.proj-stats { padding: 0 16px 14px; }
.proj-body { padding: 0 16px 14px; margin-top: -2px; }
.proj-body .mix { margin-top: 0; }

.mix { margin-top: 12px; }
.mix-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; }
.mix-bar i { display: block; min-width: 4px; flex-basis: 0; }
.mix-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; font-size: 12px; color: var(--ink-2); }
.mix-key span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.mix-key b { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.c0 { background: #9184d9; } .c1 { background: #e79ac3; } .c2 { background: #6cc3c3; }
.c3 { background: #f0b27e; } .c4 { background: #b9a9f2; } .c5 { background: #8fb8e8; }

.recs { margin-top: 10px; }
.rec { width: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr) 56px 18px; gap: 12px; align-items: center; padding: 9px 2px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; font-size: 14px; }
.rec-date { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.rec-cat { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.rec-cap { flex: none; display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.rec-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 13px; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; text-align: left; }
.rec-edit { color: var(--ink-3); opacity: 0; transition: opacity .12s; display: inline-flex; }
.rec:hover .rec-type { color: var(--ink); }
.rec:hover .rec-edit, .rec:focus-visible .rec-edit { opacity: 1; }

/* ---------- stopwatch ---------- */
.watch { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-md); padding: 20px 22px 22px; }
.watch-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 32px; }
.watch-project { font-size: 26px; letter-spacing: -0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch.off .watch-project { color: var(--ink-3); }

.face { position: relative; border-radius: 20px; overflow: hidden; padding: 34px 16px 46px; isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(98, 84, 190, 0.12); }
.face-wash { position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 90% at 8% 0%, rgba(239, 179, 211, 0.55), transparent 70%),
    radial-gradient(55% 80% at 95% 15%, rgba(163, 224, 224, 0.55), transparent 70%),
    radial-gradient(60% 70% at 50% 110%, rgba(205, 197, 250, 0.6), transparent 70%),
    linear-gradient(115deg, #fdf0f7 0%, #f1eeff 35%, #e9f8f7 65%, #fff4ea 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 220% 100%;
  animation: gd-shift 18s ease-in-out infinite alternate; }
.face-wash::after { content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 0.8px, transparent 1.4px) 0 0 / 23px 29px,
    radial-gradient(circle, rgba(186,170,255,0.8) 0 1px, transparent 1.7px) 5px 19px / 53px 47px,
    radial-gradient(circle, rgba(255,160,205,0.75) 0 1px, transparent 1.7px) 31px 3px / 67px 59px;
  animation: gd-twinkle 3.2s ease-in-out infinite; }
.face-const { position: absolute; top: 12px; right: 16px; width: 62px; height: auto; opacity: 0.85; }
.watch.off .face { filter: saturate(0.4); }
.watch.off .digits { opacity: 0.35; }

.digits { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: center; gap: 4px; font-variant-numeric: tabular-nums; color: var(--ink); }
.dg { display: inline-block; }
.dg, .colon { font-size: clamp(64px, 7.4vw, 108px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.colon { color: var(--ink); padding: 0 2px; transform: translateY(-0.06em); }
.face-note { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-size: 14px; color: var(--ink-2); }

.sea { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; pointer-events: none; }
.waves { position: absolute; left: 0; bottom: 8px; width: 100%; height: 12px; }
.waves path { fill: none; stroke: rgba(98, 84, 190, 0.28); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.leaper { position: absolute; bottom: 10px; left: -40px; width: 34px; height: 34px; opacity: 0; }
.leaper path { fill: rgba(145, 132, 217, 0.85); }
.watch.running .leaper { animation: bt-leap 9s ease-in-out infinite; }
.drifter { position: absolute; top: 8px; left: 105%; width: 86px; opacity: 0; pointer-events: none; z-index: 0; }
.drifter .constellation { width: 100%; height: auto; display: block; overflow: visible; }
.drifter .constellation line { stroke: rgba(98, 84, 190, 0.6); stroke-width: 1.4; }
.drifter .constellation .star { fill: #fff; stroke: #7c6ad6; stroke-width: 1.2; }
.drifter .constellation .halo { fill: rgba(255, 255, 255, 0.85); filter: drop-shadow(0 0 3px rgba(124, 106, 214, 0.6)); }
.watch.running .drifter { animation: bt-drift 36s linear 5s infinite; }
@keyframes bt-drift {
  0%   { left: 105%; top: 14px; opacity: 0; transform: rotate(-6deg); }
  3%   { opacity: 0.9; }
  20%  { top: 6px; }
  38%  { opacity: 0.9; }
  42%  { left: -20%; top: 18px; opacity: 0; transform: rotate(8deg); }
  100% { left: -20%; opacity: 0; }
}
@keyframes bt-leap {
  0%   { left: -40px; transform: translateY(18px) rotate(10deg); opacity: 0; }
  8%   { opacity: 1; }
  22%  { transform: translateY(-14px) rotate(-12deg); }
  36%  { transform: translateY(18px) rotate(32deg); opacity: 1; }
  40%  { left: 46%; transform: translateY(26px) rotate(40deg); opacity: 0; }
  100% { left: 46%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .watch.running .drifter { animation: none; }
  .face-wash, .face-wash::after, .constellation.twinkle g, .watch.running .leaper, .tag.live i { animation: none; }
}

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
/* Save and Discard: half the width of Start and Stop, centered beneath them. */
.controls-2 { display: grid; grid-template-columns: repeat(2, calc((100% - 12px) / 4)); justify-content: center; gap: 12px; margin-top: 12px; }
.controls-2 .big-btn { height: 44px; padding: 0 12px; font-size: 16px; }
.big-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 64px; padding: 0 24px;
  border-radius: var(--radius-md); border: 1px solid transparent; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s; }
.big-btn:active:not(:disabled) { transform: translateY(1px); }
.big-btn:disabled { cursor: not-allowed; }
.big-btn.go { color: #fff; background: linear-gradient(180deg, #2ec9b1, #14a08f); border-color: #12917f; box-shadow: 0 8px 22px rgba(20, 160, 143, 0.28); }
.big-btn.go:hover:not(:disabled) { background: linear-gradient(180deg, #25b9a2, #11907f); }
.big-btn.halt { color: #fff; background: linear-gradient(180deg, #e0575a, #c23636); border-color: #b03030; box-shadow: 0 8px 22px rgba(194, 54, 54, 0.25); }
.big-btn.halt:hover:not(:disabled) { background: linear-gradient(180deg, #d24c4f, #ad2e2e); }
.big-btn.go:disabled, .big-btn.halt:disabled { color: #a3a5b4; background: #f0eff4; border-color: var(--line); box-shadow: none; }
.big-btn.save { color: #fff; background: var(--ink); border-color: var(--ink); box-shadow: 0 8px 22px rgba(27, 29, 43, 0.2); }
.big-btn.save:hover:not(:disabled) { background: #2d3044; }
.big-btn.save:disabled, .big-btn.toss:disabled { color: #a3a5b4; background: #f0eff4; border-color: var(--line); box-shadow: none; }
.big-btn.toss { color: var(--ink-2); background: #fff; border-color: var(--line-strong); }
.big-btn.toss:hover:not(:disabled) { color: var(--ink); background: var(--surface-2); }

.picker { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.picker .label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.picker .label .faint { text-transform: none; letter-spacing: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 8px 15px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: background .12s, color .12s, box-shadow .12s; }
.pill:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--surface-2); color: var(--ink); }
.pill[aria-pressed="true"] { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 0.5px var(--accent); }
.pill.sub { padding: 6px 13px; font-size: 13px; }
.pill:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- forms in sheets ---------- */
input[type="date"].input { min-height: 42px; }

/* ---------- admin (GDBB's Setup) ---------- */
.admin .subnav { padding-top: 0; }
.setup-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); gap: 14px; align-items: start; }
.types-cols { display: grid; grid-template-columns: minmax(0, 560px); gap: 14px; align-items: start; }
.setup-cols .card + .card, .types-cols .card + .card { margin-top: 0; }
@media (max-width: 900px) { .setup-cols { grid-template-columns: minmax(0, 400px); } }
.add-row { margin: 0 0 8px; }
.add-plus { border-radius: var(--radius-md); width: 36px; height: 36px; min-height: 36px; padding: 0; flex: none; }
.set-row.nowrap { flex-wrap: nowrap; }
.set-row.nowrap .name { flex: 1 1 auto; min-width: 0; }
.archived { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
/* The Archived section draws its own top rule, so the row above it drops its bottom one. */
.set-row:has(+ .archived) { border-bottom: 0; }
.archived-row { color: var(--ink-2); font-size: 14px; }
.color-tile-wrap { position: relative; flex: none; display: inline-flex; }
.color-tile { width: 22px; height: 22px; border-radius: 7px; border: 0; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.color-tile.none { background: repeating-linear-gradient(45deg, #fff 0 4px, #f0eff6 4px 8px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.color-tile:hover { transform: scale(1.08); }
.color-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: -6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(27, 29, 43, 0.16); padding: 10px; width: 196px; }
.color-pop.up { top: auto; bottom: calc(100% + 6px); }
.color-grid { display: grid; grid-template-columns: repeat(5, 28px); gap: 8px; }
.color-dot { width: 28px; height: 28px; border-radius: 8px; border: 0; cursor: pointer; padding: 0; transition: transform .1s; }
.color-dot:hover { transform: scale(1.1); }
.color-dot.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.color-none { margin-top: 8px; width: 100%; justify-content: center; }

/* ---------- project popup ---------- */
.proj-form { display: grid; grid-template-columns: minmax(0, 1fr) 170px 170px; gap: 14px 12px; align-items: end; }
.proj-form .span2 { grid-column: span 2; }

/* ---------- date picker (GDBB's) ---------- */
.dp-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; color: var(--ink); white-space: nowrap; }
.dp-btn svg { color: var(--ink-3); flex: none; }
.dp-btn.is-empty { color: #9a9cb0; }
.dp-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(98, 84, 190, 0.14); }
.dp-pop { position: fixed; z-index: 1000; width: 268px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(27, 29, 43, 0.16); padding: 12px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 500; font-size: 14px; letter-spacing: -0.01em; }
.dp-nav { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.dp-nav:hover { background: rgba(98, 84, 190, 0.08); color: var(--accent); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow span { font-size: 11px; color: var(--ink-3); text-align: center; padding: 4px 0; text-transform: uppercase; letter-spacing: 0.04em; }
.dp-day { height: 34px; border: 0; background: transparent; border-radius: 8px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-day:hover:not(:disabled) { background: rgba(98, 84, 190, 0.08); }
.dp-day.today { box-shadow: inset 0 0 0 1px rgba(98, 84, 190, 0.45); }
.dp-day.sel { background: var(--accent); color: #fff; font-weight: 500; }
.dp-day:disabled { color: rgba(27, 29, 43, 0.25); cursor: default; }
.dp-foot { display: flex; align-items: center; margin-top: 6px; border-top: 1px solid rgba(27, 29, 43, 0.08); padding-top: 6px; }

/* Required field left empty */
.input.invalid, .input.invalid:hover { border-color: #d64545; }
.input.invalid:focus-visible { border-color: #d64545; outline: 2px solid rgba(214, 69, 69, 0.22); outline-offset: 0; }

/* Archive toggle in the Projects header */
.arch-btn { color: var(--ink-2); border-color: transparent; background: transparent; }
.arch-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
.arch-btn[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent); }

/* ---------- done projects ---------- */
.proj-done { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--ink-3); }
.proj-done:hover { color: #129482; border-color: rgba(20, 160, 143, 0.45); }
.proj-done.on { color: #fff; background: #1ab5a0; border-color: #14a08f; }
.proj-done.on:hover { background: #14a08f; }
.proj.done { box-shadow: inset 0 0 0 3px #22c1a9, var(--shadow-sm); }
.proj.done.sel { box-shadow: inset 0 0 0 3px #22c1a9, 0 0 0 1.5px var(--accent-2), 0 10px 30px rgba(98, 84, 190, 0.12); }

/* ---------- project list scrolls under the header and totals ---------- */
.col-left { display: flex; flex-direction: column; height: calc(100vh - 75px); height: calc(100dvh - 75px); }
.col-left .list-head, .col-left .summary { flex: none; }
.proj-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 2px 6px 24px; scrollbar-width: none; overscroll-behavior: contain; }
.proj-scroll::-webkit-scrollbar { display: none; }
@media (max-width: 960px) { .col-left { height: auto; } .proj-scroll { overflow: visible; } }
.shell:has(.home) { padding-bottom: 0; } /* Home fits the window; only the project list scrolls */
.input::placeholder { color: #b4b6c4; }

/* Save pressed without a category */
.pills.need { outline: 2px solid #d64545; outline-offset: 6px; border-radius: 12px; animation: bt-shake .4s ease-in-out; }
@keyframes bt-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .pills.need { animation: none; } }

/* Confirmation popups: no close button, everything centered */
.sheet.confirm .sheet-head { justify-content: center; text-align: center; }
.sheet.confirm .sheet-head h2 { margin-right: 0; }
.sheet.confirm .stack { text-align: center; }
.sheet.confirm .sheet-foot { justify-content: center; }
.watch-edit { width: 34px; min-height: 34px; color: var(--ink-3); flex: none; }
.watch-edit:hover:not(:disabled) { color: var(--accent); }
