/* Beacon. Liquid-glass project management for an agency. Dark, single theme.
   Layers: wallpaper (live canvas or image) at the back, a faint grid, clear glass panels with bright edges in front,
   modals and menus as thicker tinted glass on top. Anything the hand can grab is driven by springs in app.js. */

:root {
  color-scheme: dark;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable', 'Segoe UI', sans-serif;

  --bg: #070B1E;
  --ink: #F3F5FF;
  --ink-2: rgba(243, 245, 255, 0.70);
  --ink-3: rgba(243, 245, 255, 0.50);
  --ink-4: rgba(243, 245, 255, 0.30);

  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-solid: rgba(18, 23, 56, 0.80);
  --glass-weak: rgba(255, 255, 255, 0.035);
  --glass-line: rgba(255, 255, 255, 0.11);
  --glass-line-2: rgba(255, 255, 255, 0.22);
  --blur: blur(24px) saturate(160%);
  --blur-soft: blur(14px) saturate(140%);
  --sheen: linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02) 38%, rgba(255,255,255,0) 60%);
  --shadow-glass: inset 0 1px 0 rgba(255,255,255,0.20), inset 0 0 0 1px rgba(255,255,255,0.03), 0 24px 60px -24px rgba(0,0,0,0.65), 0 2px 8px rgba(0,0,0,0.25);
  --shadow-card: inset 0 1px 0 rgba(255,255,255,0.16), 0 2px 6px rgba(0,0,0,0.25), 0 12px 30px -16px rgba(0,0,0,0.5);
  --shadow-lift: inset 0 1px 0 rgba(255,255,255,0.24), 0 18px 36px -12px rgba(0,0,0,0.6), 0 40px 80px -30px rgba(79,139,255,0.35);
  --shadow-float: inset 0 1px 0 rgba(255,255,255,0.22), 0 40px 100px -24px rgba(0,0,0,0.75), 0 12px 32px -12px rgba(0,0,0,0.5);

  --accent: #5B8CFF;
  --accent-2: #B06CFF;
  --accent-grad: linear-gradient(135deg, #4F8BFF 0%, #8B6CFF 55%, #D96CF0 100%);
  --accent-tint: rgba(91, 140, 255, 0.18);
  --accent-ink: #A9C2FF;
  --glow: 0 10px 30px -8px rgba(123, 108, 255, 0.75);

  --gray: #A7AFCC;  --gray-bg: rgba(167,175,204,0.16);
  --blue: #86ABFF;  --blue-bg: rgba(134,171,255,0.18);
  --amber: #FFC66E; --amber-bg: rgba(255,198,110,0.18);
  --green: #62E3A4; --green-bg: rgba(98,227,164,0.16);
  --red: #FF8078;   --red-bg: rgba(255,128,120,0.18);
  --violet: #C9A2FF; --violet-bg: rgba(201,162,255,0.18);
  --teal: #68E6DD;  --teal-bg: rgba(104,230,221,0.16);
  --rose: #FF95C6;  --rose-bg: rgba(255,149,198,0.18);

  --r-xl: 24px; --r-lg: 18px; --r-md: 13px; --r-sm: 9px;
  --side: 248px;
  --top: 60px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: #10152F; --glass-strong: #151B3A; --glass-solid: #141A38; --glass-weak: #0D1229; --blur: none; --blur-soft: none; }
}
@media (prefers-contrast: more) {
  :root { --glass-line: rgba(255,255,255,0.32); --glass-line-2: rgba(255,255,255,0.55); --ink-2: #D9DDF2; --ink-3: #C2C7E3; }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow: hidden; font-optical-sizing: auto; letter-spacing: -0.005em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; letter-spacing: 0.005em; }
.muted { color: var(--ink-3); }
kbd { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,0.10); color: var(--ink-2); line-height: 1.5; letter-spacing: 0.02em; }
[hidden] { display: none !important; }
::selection { background: rgba(91,140,255,0.45); }

/* ---------- Wallpaper ---------- */
.wall { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--bg); }
#wall-canvas { position: absolute; inset: -8%; width: 116%; height: 116%; filter: blur(48px); }
#wall-img { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity 600ms ease; }
#wall-img.on { opacity: 1; }
.wall::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0.9), rgba(0,0,0,0.15) 70%, transparent); -webkit-mask-image: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0.9), rgba(0,0,0,0.15) 70%, transparent); }
.wall::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,11,30,0.10), rgba(7,11,30,0) 40%, rgba(7,11,30,0.35)); }

/* ---------- Glass ---------- */
.glass, .glass-strong, .glass-solid {
  position: relative; border: 1px solid var(--glass-line); border-radius: var(--r-xl);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow-glass);
}
.glass::before, .glass-strong::before, .glass-solid::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--sheen); pointer-events: none; }
.glass { background: var(--glass); }
.glass-strong { background: var(--glass-strong); }
.glass-solid { background: var(--glass-solid); }
.glass > *, .glass-strong > *, .glass-solid > * { position: relative; }

/* ---------- Shell ---------- */
.shell {
  position: relative; z-index: 1; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 14px; height: 100%;
  padding-block: calc(14px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter); padding-right: var(--gutter-r);
}
.side { display: flex; flex-direction: column; padding: 14px 12px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-grad); color: #fff; display: grid; place-items: center; box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,0.45); }
.brand-mark svg { width: 17px; height: 17px; stroke-width: 2.2; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.brand-ws { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-md);
  color: var(--ink-2); text-decoration: none; font-weight: 500; transition: background 120ms, transform 100ms ease-out; text-align: left;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,0.07); color: var(--ink); }
.nav a:active, .nav button:active { transform: scale(0.985); background: rgba(255,255,255,0.12); }
.nav a.active { background: rgba(255,255,255,0.10); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 6px 18px -10px rgba(0,0,0,0.6); font-weight: 600; }
.nav a.active .i { color: var(--accent-ink); }
.nav .count { margin-left: auto; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.nav .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; margin: 0 3px; }
.nav .ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.side-sect { font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 18px 10px 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.side-foot { margin-top: auto; }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-md); text-align: left; transition: background 120ms, transform 100ms ease-out; }
.me:hover { background: rgba(255,255,255,0.07); }
.me:active { transform: scale(0.985); }
.me .meta { min-width: 0; line-height: 1.25; }
.me .meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .meta span { color: var(--ink-3); font-size: 12px; }

.main { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; }
.topbar { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(280px, 520px) minmax(160px, 1fr); align-items: center; gap: 12px; padding: 8px 10px 8px 18px; min-height: var(--top); }
.topbar .where { min-width: 0; }
.topbar .where h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .where span { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.view { flex: 1; min-height: 0; overflow: auto; padding: 4px 2px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }
.view-inner { max-width: 1180px; margin: 0 auto; animation: rise 460ms cubic-bezier(0.16,1,0.3,1); }
.view-inner.quiet, .view-inner.quiet .tcard { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Quick add ---------- */
.quick { position: relative; }
.quick-in { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px; height: 42px; border-radius: 14px; background: rgba(255,255,255,0.07); border: 1px solid var(--glass-line); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); transition: box-shadow 150ms, border-color 150ms, background 150ms; }
.quick-in:focus-within { border-color: rgba(91,140,255,0.6); background: rgba(255,255,255,0.09); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 0 4px var(--accent-tint); }
.quick-in .spark { color: var(--accent-ink); }
.quick-in input { flex: 1; border: 0; background: transparent; font-size: 14px; min-width: 0; color: var(--ink); }
.quick-in input::placeholder { color: var(--ink-3); }
.quick-in input:focus { outline: none; }
.quick-in kbd { flex: none; }
.quick-pop { position: absolute; left: 0; right: 0; top: calc(100% + 8px); padding: 12px 14px; border-radius: var(--r-lg); z-index: 20; display: none; transform-origin: 50% 0; animation: materialize 220ms cubic-bezier(0.16,1,0.3,1); }
.quick-pop.on { display: block; }
.quick-pop .parsed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quick-pop .ttl { font-weight: 600; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-pop .hint { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; margin-top: 10px; gap: 10px; flex-wrap: wrap; }
.quick-pop .hint code { font-family: inherit; color: var(--ink-2); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 12px; font-weight: 600; font-size: 13.5px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-line); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  transition: transform 100ms ease-out, background 120ms, box-shadow 150ms; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.13); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent-grad); color: #fff; border-color: rgba(255,255,255,0.22); box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), var(--glow); }
.btn-primary:hover { filter: brightness(1.08); background: var(--accent-grad); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--ink); }
.btn-danger { color: var(--red); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 10px; }
.btn-icon { width: 36px; padding: 0; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); transition: transform 100ms ease-out, background 120ms; }
.icon-btn:hover { background: rgba(255,255,255,0.10); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.input, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--glass-line); border-radius: 12px; background: rgba(255,255,255,0.06); color: var(--ink); font-size: 14px;
  transition: box-shadow 150ms, border-color 150ms;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .textarea:focus { outline: none; border-color: rgba(91,140,255,0.6); box-shadow: 0 0 0 4px var(--accent-tint); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
input[type="date"] { color-scheme: dark; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 9px; border-radius: 10px; font-weight: 500; font-size: 13px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-line); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  transition: transform 100ms ease-out, background 120ms, border-color 120ms; white-space: nowrap; max-width: 100%;
}
.chip:hover { background: rgba(255,255,255,0.13); border-color: var(--glass-line-2); }
.chip:active { transform: scale(0.97); }
.chip.on { background: var(--accent-tint); border-color: rgba(91,140,255,0.45); color: var(--accent-ink); }
.chip .chev { width: 12px; height: 12px; color: var(--ink-3); margin-left: -2px; }
.chip .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .avatar { width: 18px; height: 18px; font-size: 8px; margin-left: -3px; }
.chip input[type="date"] { border: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--ink); padding: 0; width: 118px; }
.chip input[type="date"]:focus { outline: none; }
.chip.ph { color: var(--ink-3); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; line-height: 1.6; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; }
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 7px; line-height: 1.5; white-space: nowrap; }
.c-gray  { background: var(--gray-bg);  color: var(--gray); }
.c-blue  { background: var(--blue-bg);  color: var(--blue); }
.c-amber { background: var(--amber-bg); color: var(--amber); }
.c-green { background: var(--green-bg); color: var(--green); }
.c-red   { background: var(--red-bg);   color: var(--red); }
.c-violet{ background: var(--violet-bg); color: var(--violet); }
.c-teal  { background: var(--teal-bg);  color: var(--teal); }
.c-rose  { background: var(--rose-bg);  color: var(--rose); }
.bg-gray { background: var(--gray); } .bg-blue { background: var(--blue); } .bg-amber { background: var(--amber); } .bg-green { background: var(--green); }
.bg-red { background: var(--red); } .bg-violet { background: var(--violet); } .bg-teal { background: var(--teal); } .bg-rose { background: var(--rose); }

.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; flex: none; color: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35), 0 1px 2px rgba(0,0,0,0.3); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.a-zt { background: var(--accent-grad); }
.avatar.a-mr { background: linear-gradient(135deg, #B36BF0, #7B5CFF); }
.avatar.a-cb { background: linear-gradient(135deg, #2EB889, #0E8C8C); }
.avatar.a-jp { background: linear-gradient(135deg, #F28B4B, #E0566E); }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -7px; }
.progress { height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent-grad); border-radius: 3px; transition: width 500ms cubic-bezier(0.16,1,0.3,1); }
.due { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.due .i { width: 12px; height: 12px; }
.due.over { color: var(--red); }
.due.today { color: var(--amber); }
.recur { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-3); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.recur .i { width: 12px; height: 12px; }

/* ---------- Panels ---------- */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 12px; }
.panel-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.panel-head .hint { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.panel-body { padding: 0 8px 8px; }
.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; }
.stack { display: grid; gap: 16px; }

/* ---------- Home ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 6px 22px; }
.hero .eyebrow { color: var(--accent-ink); font-weight: 600; font-size: 12.5px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.hero h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.hero h1 em { font-style: normal; color: var(--ink-3); font-weight: 600; }
.hero .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px 18px 14px; text-align: left; border-radius: var(--r-lg); transition: transform 120ms ease-out, background 120ms; cursor: pointer; }
.stat:hover { background: var(--glass-strong); }
.stat:active { transform: scale(0.985); }
.stat .label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 32px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; margin-top: 6px; }
.stat .value.bad { color: var(--red); }
.stat .sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insights { margin-bottom: 16px; padding: 14px 16px; display: grid; gap: 8px; }
.insights .ttl { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--accent-ink); }
.insight { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); text-align: left; transition: transform 100ms ease-out, background 120ms; }
.insight:hover { background: rgba(255,255,255,0.10); }
.insight:active { transform: scale(0.99); }
.insight .ic { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; }
.insight .ic .i { width: 13px; height: 13px; }
.insight .tx { font-size: 13px; min-width: 0; }
.insight .tx b { font-weight: 600; }
.insight .go { color: var(--ink-3); font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.tasklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trow { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; cursor: pointer; transition: background 120ms, transform 100ms ease-out; }
.trow:hover { background: rgba(255,255,255,0.07); }
.trow:active { transform: scale(0.995); background: rgba(255,255,255,0.11); }
.trow .t { min-width: 0; }
.trow .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .sub { color: var(--ink-3); font-size: 12px; display: flex; gap: 8px; align-items: center; margin-top: 1px; min-width: 0; }
.trow .sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow.done .title { color: var(--ink-3); text-decoration: line-through; }
.trow .right { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.check { width: 20px; height: 20px; border: 1.5px solid var(--ink-4); border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,0.04); transition: background 120ms, border-color 120ms, transform 100ms ease-out; flex: none; }
.check .i { width: 11px; height: 11px; stroke-width: 2.6; opacity: 0; }
.check:hover { border-color: var(--accent-ink); }
.check:active { transform: scale(0.88); }
.check.on { background: var(--accent-grad); border-color: transparent; }
.check.on .i { opacity: 1; }
.empty { padding: 28px 18px; color: var(--ink-2); text-align: center; font-size: 13px; }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.prow { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 10px 12px; border-radius: 12px; cursor: pointer; transition: background 120ms, transform 100ms ease-out; align-items: center; }
.prow:hover { background: rgba(255,255,255,0.07); }
.prow:active { transform: scale(0.995); }
.prow .name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.prow .client { color: var(--ink-3); font-size: 12px; margin: 1px 0 8px 17px; }
.prow .pct { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0 4px; display: grid; gap: 2px; }
.feed li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 9px 10px; font-size: 13px; border-radius: 10px; }
.feed .who { font-weight: 600; }
.feed .what { color: var(--ink-2); }
.feed .when { color: var(--ink-3); font-size: 11.5px; margin-top: 1px; }

/* ---------- Projects ---------- */
.tools { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tools .spacer { flex: 1; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard { padding: 18px 18px 16px; text-align: left; border-radius: var(--r-lg); cursor: pointer; transition: transform 120ms ease-out, box-shadow 150ms, background 120ms; display: grid; grid-template-columns: 1fr 64px; gap: 14px; color: var(--ink); }
.pcard:hover { background: var(--glass-strong); box-shadow: var(--shadow-lift); }
.pcard:active { transform: scale(0.985); }
.pcard .client { font-weight: 700; font-size: 15px; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.pcard .pname { color: var(--ink-2); font-size: 13px; margin: 2px 0 10px 17px; }
.pcard .svcs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.pcard .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.ring { width: 64px; height: 64px; position: relative; }
.ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring .track { stroke: rgba(255,255,255,0.12); }
.ring .bar { stroke: url(#ring-grad); transition: stroke-dashoffset 600ms cubic-bezier(0.16,1,0.3,1); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: -0.02em; }

/* ---------- Project page ---------- */
.phead { padding: 22px 24px 20px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; margin-bottom: 16px; }
.phead .crumbs { color: var(--ink-3); font-size: 12.5px; font-weight: 600; display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.phead .crumbs a { color: var(--ink-3); text-decoration: none; }
.phead .crumbs a:hover { color: var(--ink); }
.phead h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phead h1 .sw { width: 12px; height: 12px; border-radius: 4px; }
.phead .pname { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.phead .facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--ink-2); font-size: 13px; }
.phead .facts b { color: var(--ink); font-weight: 600; }
.phead .facts span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.phead .svcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.phead .side { display: grid; justify-items: end; gap: 12px; padding: 0; }
.phead .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.svc-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.08); border: 1px solid var(--glass-line); }
.svc-pill .sw { width: 8px; height: 8px; }
.phase { margin-bottom: 14px; }
.phase-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px 8px; }
.phase-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; flex: 1; }
.phase-head .n { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.phase-head .bar { width: 90px; }
.phase .trow { grid-template-columns: 22px 1fr auto; }
.phase .trow .meta { display: flex; gap: 10px; align-items: center; white-space: nowrap; color: var(--ink-3); font-size: 12px; }
.phase .trow .meta .est { color: var(--ink-3); font-weight: 500; }
.phase.collapsed .panel-body { display: none; }
.phase-head .tog { color: var(--ink-3); transition: transform 200ms; }
.phase.collapsed .phase-head .tog { transform: rotate(-90deg); }
.facts-list { display: grid; gap: 10px; padding: 4px 20px 18px; font-size: 13px; }
.facts-list div { display: flex; justify-content: space-between; gap: 12px; }
.facts-list span:first-child { color: var(--ink-3); }
.facts-list b { font-weight: 600; text-align: right; }
.months { list-style: none; margin: 0; padding: 0 8px 8px; display: grid; gap: 4px; }
.months li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.04); }
.months .m { font-weight: 600; }
.months .f { color: var(--ink-3); font-size: 12px; display: flex; gap: 8px; align-items: center; margin-top: 2px; min-width: 0; }
.months .f span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.months .acts { display: flex; gap: 6px; align-items: center; }
.months .sent { color: var(--green); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.notes-area { padding: 0 20px 18px; }
.notes-area .textarea { background: rgba(255,255,255,0.04); }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(252px, 1fr)); gap: 12px; overflow-x: auto; padding: 2px 2px 10px; align-items: start; }
.col { background: var(--glass-weak); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--r-lg); min-height: 200px; display: flex; flex-direction: column; transition: background 150ms, box-shadow 150ms, border-color 150ms; backdrop-filter: var(--blur-soft); -webkit-backdrop-filter: var(--blur-soft); }
.col.over { background: var(--accent-tint); border-color: rgba(91,140,255,0.5); box-shadow: 0 0 0 1px rgba(91,140,255,0.35) inset, 0 0 40px -10px rgba(91,140,255,0.5); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-size: 13px; font-weight: 700; }
.col-head .n { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.col-head .add { margin-left: auto; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--ink-3); transition: transform 100ms ease-out, background 120ms; }
.col-head .add:hover { background: rgba(255,255,255,0.12); color: var(--ink); }
.col-head .add:active { transform: scale(0.9); }
.col-body { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tcard {
  background: rgba(255,255,255,0.075); border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; padding: 12px 12px 10px; cursor: grab; user-select: none; -webkit-user-select: none;
  position: relative; box-shadow: var(--shadow-card); transition: box-shadow 150ms, transform 100ms ease-out, background 120ms;
  animation: rise 460ms cubic-bezier(0.16,1,0.3,1) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.tcard:hover { background: rgba(255,255,255,0.11); }
.tcard:active:not(.dragging):not(.landing) { transform: scale(0.985); }
.tcard.dragging, .tcard.landing { transition: none; animation: none; z-index: 30; will-change: transform; box-shadow: var(--shadow-lift); background: rgba(30,36,74,0.92); }
.tcard.dragging { cursor: grabbing; }
.tcard .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tcard .title { font-weight: 600; line-height: 1.4; letter-spacing: -0.008em; }
.tcard .foot { display: grid; gap: 6px; margin-top: 10px; }
.tcard .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.tcard .proj { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 11.5px; font-weight: 500; min-width: 0; }
.tcard .proj span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .metas { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.tcard .sub { color: var(--ink-3); font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; font-weight: 500; white-space: nowrap; }
.tcard .sub .i { width: 11px; height: 11px; }
.col-empty { border: 1.5px dashed rgba(255,255,255,0.16); border-radius: 12px; padding: 20px 10px; color: var(--ink-3); text-align: center; font-size: 12px; font-weight: 500; }

/* ---------- Timeline ---------- */
.tl-wrap { overflow-x: auto; border-radius: var(--r-xl); }
.tl { display: grid; grid-template-columns: 220px repeat(var(--weeks), minmax(72px, 1fr)); min-width: 900px; position: relative; }
.tl-h { padding: 12px 12px; font-size: 12px; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--glass-line); border-left: 1px solid var(--glass-line); white-space: nowrap; }
.tl-h:first-child { border-left: 0; color: var(--ink-2); }
.tl-h.now { color: var(--accent-ink); }
.tl-row { display: contents; }
.tl-label { padding: 14px 14px; border-bottom: 1px solid var(--glass-line); display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.tl-label .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label .c { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-cell { border-bottom: 1px solid var(--glass-line); border-left: 1px solid var(--glass-line); min-height: 58px; }
.tl-row:last-of-type .tl-label, .tl-row:last-of-type .tl-cell { border-bottom: 0; }
.tl-bar { grid-row: var(--r); grid-column: var(--c1) / var(--c2); align-self: center; margin: 0 5px; height: 28px; border-radius: 9px; display: flex; align-items: center; padding: 0 10px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; position: relative; z-index: 1; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); transition: filter 150ms, transform 100ms ease-out; }
.tl-bar:hover { filter: brightness(1.15); }
.tl-bar:active { transform: scale(0.99); }
.tl-bar .pct { margin-left: auto; font-size: 11px; opacity: 0.8; padding-left: 8px; }
.tl-bar::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p); background: currentColor; opacity: 0.7; }
.tl-today { grid-row: 1 / -1; grid-column: var(--c); justify-self: start; width: 2px; background: var(--accent); opacity: 0.8; margin-left: var(--off); z-index: 2; pointer-events: none; border-radius: 1px; box-shadow: 0 0 12px rgba(91,140,255,0.8); }
.tl-ms { grid-row: var(--r); grid-column: var(--c); align-self: center; justify-self: start; margin-left: var(--off); width: 11px; height: 11px; transform: rotate(45deg) translateX(-50%); background: #fff; border-radius: 3px; z-index: 2; box-shadow: 0 0 10px rgba(255,255,255,0.6); }
.tl-legend { display: flex; gap: 18px; margin-top: 12px; color: var(--ink-2); font-size: 12px; flex-wrap: wrap; padding: 0 6px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend .ms { width: 8px; height: 8px; background: #fff; transform: rotate(45deg); border-radius: 2px; }
.tl-legend .td { width: 2px; height: 12px; background: var(--accent); }

/* ---------- Settings ---------- */
.settings { display: grid; gap: 16px; max-width: 820px; }
.setrow { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 18px 20px; border-top: 1px solid var(--glass-line); align-items: start; }
.setrow:first-of-type { border-top: 0; }
.setrow .lbl { font-weight: 600; }
.setrow .lbl span { display: block; color: var(--ink-3); font-size: 12px; font-weight: 500; margin-top: 2px; }
.setrow .ctl { display: grid; gap: 10px; min-width: 0; }
.setrow .inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.wallopt { aspect-ratio: 16 / 10; border-radius: 12px; border: 2px solid transparent; overflow: hidden; position: relative; background: center / cover no-repeat; box-shadow: var(--shadow-card); transition: transform 100ms ease-out; cursor: pointer; }
.wallopt:active { transform: scale(0.97); }
.wallopt.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint), var(--shadow-card); }
.wallopt span { position: absolute; left: 8px; bottom: 6px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.wallopt.live { background: radial-gradient(circle at 20% 30%, #2A4FC2, transparent 50%), radial-gradient(circle at 80% 20%, #7A3FD6, transparent 50%), radial-gradient(circle at 70% 85%, #C23A8C, transparent 45%), #070B1E; }
.wallopt.upload { background: rgba(255,255,255,0.06); display: grid; place-items: center; color: var(--ink-2); font-size: 12px; font-weight: 600; border: 1.5px dashed rgba(255,255,255,0.2); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Modal ---------- */
#modal-root:empty { display: none; }
.mscrim { position: fixed; inset: 0; z-index: 80; background: rgba(2, 4, 16, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; }
.dialog {
  position: fixed; z-index: 90; left: 50%; top: 50%; width: min(640px, calc(100% - 32px)); max-height: min(88vh, 900px); transform: translate(-50%, -50%) scale(0.92); opacity: 0;
  display: flex; flex-direction: column; border-radius: 26px; will-change: transform, opacity; overflow: hidden;
  background: var(--glass-solid); border: 1px solid rgba(255,255,255,0.16); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%); box-shadow: var(--shadow-float);
}
.dialog.wide { width: min(760px, calc(100% - 32px)); }
.dialog::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--sheen); border-radius: inherit; }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px 20px; position: relative; }
.dialog-head .handle { display: none; }
.dialog-head .crumb { color: var(--ink-2); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.dialog-head .crumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-body { flex: 1; overflow: auto; padding: 4px 20px 22px; position: relative; scrollbar-width: thin; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 14px 20px; border-top: 1px solid var(--glass-line); position: relative; background: rgba(255,255,255,0.03); }
.dialog-foot .actions { display: flex; gap: 8px; }
.dialog h2.dt { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; margin: 4px 0 4px; }
.dialog p.ds { color: var(--ink-2); margin: 0 0 14px; font-size: 13.5px; }
.title-in { width: 100%; border: 0; background: transparent; font-size: 24px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; padding: 4px 0 10px; color: var(--ink); }
.title-in::placeholder { color: var(--ink-4); }
.title-in:focus { outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.field { margin-top: 18px; }
.field > label, .field > .flabel { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fgrid .field { margin-top: 0; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tagrow .tag { cursor: pointer; opacity: 0.45; border: 1px solid transparent; transition: opacity 120ms, transform 100ms ease-out; padding: 4px 9px; font-size: 12px; }
.tagrow .tag:active { transform: scale(0.95); }
.tagrow .tag.on { opacity: 1; border-color: currentColor; }
.clist { list-style: none; margin: 0; padding: 0; }
.clist li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.clist li .check { width: 17px; height: 17px; border-radius: 5px; }
.clist li .check .i { width: 10px; height: 10px; }
.clist li.done span { color: var(--ink-3); text-decoration: line-through; }
.clist-add { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; margin-top: 2px; }
.clist-add .input { border-color: transparent; background: transparent; padding: 6px 0; border-radius: 0; }
.clist-add .input:focus { box-shadow: none; }
.clist-add .plus { color: var(--ink-3); display: grid; place-items: center; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.comments li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.comments .by { font-size: 12.5px; display: flex; gap: 8px; align-items: baseline; }
.comments .by b { font-weight: 600; }
.comments .by .small { color: var(--ink-3); }
.comments p { margin: 3px 0 0; line-height: 1.55; font-size: 13.5px; }
.comment-form { display: grid; grid-template-columns: 26px 1fr; gap: 10px; margin-top: 14px; }
.comment-form .textarea { min-height: 60px; }
.comment-form .row { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Service picker */
.svc-list { display: grid; gap: 8px; }
.svc { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09); cursor: pointer; transition: background 120ms, border-color 120ms, transform 100ms ease-out; text-align: left; }
.svc:hover { background: rgba(255,255,255,0.09); }
.svc:active { transform: scale(0.995); }
.svc.on { background: var(--accent-tint); border-color: rgba(91,140,255,0.45); }
.svc .check { width: 20px; height: 20px; border-radius: 6px; margin-top: 1px; }
.svc .check .i { width: 11px; height: 11px; }
.svc b { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.svc p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.svc .opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.svc .meta { color: var(--ink-3); font-size: 12px; font-weight: 600; white-space: nowrap; text-align: right; }
.svc .meta b { display: block; color: var(--ink); font-weight: 700; }
.preview-line { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.preview-line b { color: var(--ink); }
.preview-line .i { color: var(--accent-ink); }

/* ---------- Popover menus ---------- */
.menu { position: fixed; z-index: 100; min-width: 200px; max-width: min(320px, calc(100vw - 24px)); padding: 6px; border-radius: 16px; background: var(--glass-solid); border: 1px solid rgba(255,255,255,0.16); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%); box-shadow: var(--shadow-float); animation: materialize 200ms cubic-bezier(0.16,1,0.3,1); transform-origin: var(--ox, 0) var(--oy, 0); }
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left; font-weight: 500; color: var(--ink); transition: background 100ms, transform 100ms ease-out; }
.menu .mi:hover, .menu .mi.sel { background: var(--accent-tint); color: var(--accent-ink); }
.menu .mi:active { transform: scale(0.985); }
.menu .mi .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu .mi .sub { color: var(--ink-3); font-size: 12px; }
.menu .mi .ck { width: 14px; height: 14px; color: var(--accent-ink); opacity: 0; }
.menu .mi.on .ck { opacity: 1; }
.menu .mi .avatar { width: 22px; height: 22px; font-size: 9px; }
.menu .mh { font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 8px 10px 4px; text-transform: uppercase; letter-spacing: 0.06em; }
@keyframes materialize { from { opacity: 0; transform: scale(0.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* ---------- Palette ---------- */
.pal-scrim { position: fixed; inset: 0; background: rgba(2,4,16,0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 110; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.pal-scrim.on { display: flex; }
.palette { width: 100%; max-width: 580px; border-radius: 20px; overflow: hidden; animation: materialize 220ms cubic-bezier(0.16,1,0.3,1); transform-origin: 50% 0; }
.palette .in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--glass-line); color: var(--ink-2); }
.palette .in input { flex: 1; border: 0; background: transparent; font-size: 16px; color: var(--ink); }
.palette .in input:focus { outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 380px; overflow: auto; }
.palette .grp { font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 10px 10px 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.palette li.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.palette li.item .i { color: var(--ink-2); }
.palette li.item .sub { color: var(--ink-3); font-size: 12px; margin-left: auto; white-space: nowrap; }
.palette li.item.sel { background: var(--accent-grad); color: #fff; }
.palette li.item.sel .i, .palette li.item.sel .sub { color: rgba(255,255,255,0.85); }
.palette .foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--glass-line); color: var(--ink-3); font-size: 11.5px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); background: rgba(24,30,66,0.85); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border: 1px solid rgba(255,255,255,0.18); color: #fff; padding: 8px 10px 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity 200ms, transform 320ms cubic-bezier(0.16,1,0.3,1); z-index: 120; pointer-events: none; display: flex; gap: 12px; align-items: center; box-shadow: 0 16px 40px -8px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.22); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .tb { color: #fff; background: rgba(255,255,255,0.16); border-radius: 999px; padding: 4px 11px; font-weight: 700; font-size: 12.5px; transition: transform 100ms ease-out, background 120ms; }
.toast .tb:hover { background: rgba(255,255,255,0.26); }
.toast .tb:active { transform: scale(0.95); }

/* ---------- Mobile chrome ---------- */
.tabbar, .fab { display: none; }

/* ---------- Print sheet ---------- */
.printsheet { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .toast { transition: opacity 200ms !important; transform: translate(-50%, 0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .topbar { grid-template-columns: minmax(140px, 1fr) minmax(220px, 420px) auto; }
}
@media (max-width: 860px) {
  :root { --top: 52px; }
  .shell { grid-template-columns: 1fr; gap: 10px; padding-block: calc(10px + env(safe-area-inset-top, 0px)) 0; }
  .side { display: none; }
  .topbar { grid-template-columns: 1fr auto; grid-template-areas: "where right" "quick quick"; padding: 10px 12px 10px 16px; row-gap: 10px; }
  .topbar .where { grid-area: where; }
  .topbar .right { grid-area: right; }
  .topbar .quick { grid-area: quick; }
  .topbar .quick-in kbd, .topbar .btn-new { display: none; }
  .view { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .hero h1 { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 248px); }
  .setrow { grid-template-columns: 1fr; gap: 10px; }
  .phead { grid-template-columns: 1fr; }
  .phead .side { justify-items: start; }
  .phead .actions { justify-content: flex-start; }
  .fgrid { grid-template-columns: 1fr; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: var(--gutter); right: var(--gutter-r); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 60; padding: 6px; border-radius: 22px;
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 6px; border-radius: 16px; color: var(--ink-3); text-decoration: none; font-size: 10.5px; font-weight: 600; transition: background 120ms, transform 100ms ease-out; }
  .tabbar a:active { transform: scale(0.94); }
  .tabbar a.active { color: var(--accent-ink); background: rgba(255,255,255,0.12); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18); }
  .tabbar a .i { width: 20px; height: 20px; }
  .tabbar a .avatar { width: 20px; height: 20px; font-size: 8px; }
  .fab { display: grid; place-items: center; position: fixed; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(90px + env(safe-area-inset-bottom, 0px)); width: 54px; height: 54px; border-radius: 18px; background: var(--accent-grad); color: #fff; z-index: 60; box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), var(--glow); transition: transform 100ms ease-out; }
  .fab:active { transform: scale(0.93); }
  .fab .i { width: 24px; height: 24px; stroke-width: 2.2; }
  .dialog, .dialog.wide { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92dvh; transform: translate3d(0, 100%, 0); opacity: 1; border-radius: 26px 26px 0 0; border-bottom: 0; }
  .dialog-head { padding-top: 10px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; flex-wrap: wrap; }
  .dialog-head .handle { display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.25); margin: 0 auto 8px; flex-basis: 100%; }
  .dialog-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .title-in { font-size: 21px; }
}

/* ---------- Print: the project sheet ---------- */
@media print {
  @page { margin: 16mm 14mm; }
  html, body { height: auto; overflow: visible; background: #fff !important; color: #111 !important; }
  .wall, .shell, .tabbar, .fab, #modal-root, #menu-root, .toast, .pal-scrim { display: none !important; }
  .printsheet { display: block; color: #111; font-family: var(--font); font-size: 11.5pt; line-height: 1.4; }
  .printsheet h1 { font-size: 22pt; margin: 0 0 2pt; letter-spacing: -0.02em; }
  .printsheet .sub { color: #555; margin: 0 0 10pt; font-size: 11pt; }
  .printsheet .facts { display: flex; flex-wrap: wrap; gap: 4pt 18pt; font-size: 10pt; color: #333; padding: 8pt 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin-bottom: 10pt; }
  .printsheet .facts b { color: #111; }
  .printsheet h2 { font-size: 12.5pt; margin: 14pt 0 4pt; padding-bottom: 3pt; border-bottom: 1.5px solid #111; display: flex; justify-content: space-between; break-after: avoid; }
  .printsheet h2 span { font-weight: 500; color: #666; font-size: 10pt; }
  .printsheet table { width: 100%; border-collapse: collapse; }
  .printsheet td { padding: 4pt 4pt; border-bottom: 1px solid #e6e6e6; vertical-align: top; }
  .printsheet td.bx { width: 16pt; }
  .printsheet .box { display: inline-block; width: 11pt; height: 11pt; border: 1.5px solid #111; border-radius: 2pt; vertical-align: middle; }
  .printsheet .box.on { background: #111; }
  .printsheet td.d { width: 70pt; white-space: nowrap; color: #333; font-variant-numeric: tabular-nums; text-align: right; }
  .printsheet td.w { width: 70pt; color: #555; }
  .printsheet tr.done td { color: #999; text-decoration: line-through; }
  .printsheet .lines { margin-top: 16pt; }
  .printsheet .lines div { border-bottom: 1px solid #ccc; height: 20pt; }
  .printsheet .foot { margin-top: 12pt; color: #888; font-size: 9pt; display: flex; justify-content: space-between; }
}
