/* ASUDI Projects. Bento tiles on a lilac canvas, indigo accent. No inline styles are used anywhere (strict CSP). */
@font-face { font-family: Sora; font-weight: 500 700; font-display: swap; src: url(/fonts/sora-latin.woff2) format('woff2'); }

:root {
  --bg: #f5f4ff; --card: #fff; --ink: #0a1233; --slate: #5a6688; --line: #e4e1fb; --accent: var(--org-accent, #4f46e5); --accent-2: #6d5ef0; --on-accent: #fff;
  --t-indigo: #ecebff; --t-peach: #fff1e6; --t-green: #e6f7ec; --t-rose: #ffecee; --t-amber: #fff6dc;
  --ink-indigo: #3f37c9; --ink-peach: #b25a12; --ink-green: #17784a; --ink-rose: #c23a3a; --ink-amber: #8a6200;
  --s-backlog: #8b93b1; --s-todo: #4f46e5; --s-doing: #e29a1b; --s-review: #8b5cf6; --s-done: #1fa970;
  --shadow: 0 1px 2px rgba(30, 27, 90, .06), 0 10px 28px -14px rgba(30, 27, 90, .22);
  --radius: 22px; --nav-h: 72px;
  --font-display: Sora, Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-text: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font-text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.proj, .pill, .tile, .tab, .day, .icon-btn, .brand { text-decoration: none !important; }
.proj, .day { color: var(--ink); }
.link-btn { text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; }
.main { max-width: 720px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 18px 24px; display: grid; gap: 18px; align-content: start; }
.tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); max-width: 560px; margin: 0 auto; padding: 8px; border-radius: 26px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow); border: 1px solid var(--line); }
.tab { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 18px; color: var(--slate); font-size: .72rem; font-weight: 500; text-decoration: none; min-height: 52px; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current='page'] { color: var(--accent); background: var(--t-indigo); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.05rem var(--font-display); }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.org-logo { object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
  .tabbar { position: sticky; top: 16px; left: auto; right: auto; bottom: auto; margin: 16px 0 0 16px; max-width: none; height: fit-content; grid-template-columns: 1fr; width: 80px; }
  .main { max-width: 1080px; width: 100%; padding-bottom: 60px; }
  .fab { right: 40px; bottom: 40px; }
}

/* ---------- page heads ---------- */
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head h1 { font-size: 1.7rem; }
.hello small { display: block; color: var(--slate); font-size: .95rem; }
.hello h1 { font-size: 1.55rem; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); border: 1px solid var(--line); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn--accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 600 .82rem var(--font-display); color: #fff; background: var(--c, var(--accent)); flex: none; }
.avatar--sm { width: 28px; height: 28px; font-size: .68rem; }

/* ---------- cards and tiles ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--line); }
.card h2 { font-size: 1.05rem; margin-bottom: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px -6px; }
.section-head h2 { font-size: 1.1rem; }
.link-btn { color: var(--accent); font-weight: 600; font-size: .9rem; }
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 22px; color: #fff; background: linear-gradient(135deg, #0a1233 0%, #2b2a9c 55%, #4f46e5 100%); display: grid; gap: 14px; box-shadow: var(--shadow); }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(165, 180, 252, .45), transparent 65%); pointer-events: none; }
.hero small { color: #c9ceff; font-weight: 500; }
.hero h2 { font-size: 1.5rem; line-height: 1.2; color: #fff; margin: 0; max-width: 18ch; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.hero .chip-w { background: rgba(255, 255, 255, .16); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.hero progress { width: 100%; }
.hero .row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.hero .row span { font-weight: 700; min-width: 3ch; }
.hero-btn { justify-self: start; position: relative; z-index: 1; background: #fff; color: #0a1233; padding: 10px 18px; border-radius: 999px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { border-radius: 22px; padding: 16px; display: grid; gap: 2px; align-content: space-between; min-height: 104px; border: 0; text-align: left; position: relative; }
.tile small { font-weight: 500; opacity: .85; }
.tile b { font: 700 1.9rem/1.1 var(--font-display); }
.tile .tile-ic { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 14%, transparent); }
.tile .tile-ic svg { width: 20px; height: 20px; }
.t-indigo { background: var(--t-indigo); color: var(--ink-indigo); }
.t-peach { background: var(--t-peach); color: var(--ink-peach); }
.t-green { background: var(--t-green); color: var(--ink-green); }
.t-rose { background: var(--t-rose); color: var(--ink-rose); }
.t-amber { background: var(--t-amber); color: var(--ink-amber); }
.tile b, .tile small { color: inherit; }
.tile--wide { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 0; }
.proj-list { display: grid; gap: 12px; }
.proj { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.proj:last-child { border: 0; }
.proj .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--accent)); }
.proj b { font-weight: 600; }
.proj small { color: var(--slate); }
.ring { width: 46px; height: 46px; }
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--c, var(--accent)); stroke-linecap: round; }
.ring text { font: 700 .9rem var(--font-display); fill: var(--ink); }

progress { appearance: none; -webkit-appearance: none; height: 8px; border-radius: 999px; border: 0; overflow: hidden; background: color-mix(in srgb, currentColor 14%, transparent); }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.hero progress { background: rgba(255, 255, 255, .22); }
.hero progress::-webkit-progress-value { background: #fff; }
.hero progress::-moz-progress-bar { background: #fff; }
progress.p-green::-webkit-progress-value { background: var(--s-done); } progress.p-green::-moz-progress-bar { background: var(--s-done); }

/* ---------- filters and lists ---------- */
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; padding: 9px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--slate); font-weight: 500; font-size: .92rem; }
.pill[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0 12px; flex: 1 1 180px; min-height: 44px; }
.search svg { width: 18px; height: 18px; color: var(--slate); flex: none; }
.search input { border: 0; background: none; outline: none; width: 100%; min-height: 42px; }
.select, .field input, .field select, .field textarea { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 44px; width: 100%; }
.select { width: auto; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 3px; }
.seg button { padding: 8px 14px; border-radius: 11px; color: var(--slate); font-weight: 500; }
.seg button[aria-pressed='true'] { background: var(--t-indigo); color: var(--accent); }
.list { display: grid; gap: 10px; }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); width: 100%; text-align: left; }
.task .check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; }
.task .check svg { width: 14px; height: 14px; }
.task[data-done='1'] .check { background: var(--s-done); border-color: var(--s-done); color: #fff; }
.task[data-done='1'] .t { color: var(--slate); text-decoration: line-through; }
.task .t { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.task .sub { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 6px; }
.due { font-size: .8rem; color: var(--slate); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.due svg { width: 14px; height: 14px; flex: none; }
.due.late { color: var(--ink-rose); font-weight: 600; }
.bcard .sub { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: .74rem; font-weight: 600; background: var(--t-indigo); color: var(--ink-indigo); }
.chip.s-backlog { background: color-mix(in srgb, var(--s-backlog) 18%, transparent); color: var(--slate); }
.chip.s-todo { background: var(--t-indigo); color: var(--ink-indigo); }
.chip.s-doing { background: var(--t-peach); color: var(--ink-peach); }
.chip.s-review { background: color-mix(in srgb, var(--s-review) 16%, transparent); color: var(--s-review); }
.chip.s-done { background: var(--t-green); color: var(--ink-green); }
.chip.p-high { background: var(--t-rose); color: var(--ink-rose); }
.chip .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.empty { text-align: center; color: var(--slate); padding: 36px 12px; display: grid; gap: 8px; justify-items: center; }
.empty b { color: var(--ink); font-family: var(--font-display); font-size: 1.1rem; }

/* ---------- board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 82%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 -18px; padding-inline: 18px; }
@media (min-width: 900px) { .board { grid-auto-columns: minmax(230px, 1fr); margin: 0; padding-inline: 0; } }
.col { scroll-snap-align: start; background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px dashed var(--line); border-radius: 22px; padding: 12px; display: grid; gap: 10px; align-content: start; min-height: 160px; }
.col.over { border-color: var(--accent); background: var(--t-indigo); }
.col h3 { font: 600 .92rem var(--font-display); display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.col h3 .count { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; font-size: .78rem; color: var(--slate); }
.col h3 .sd { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--c); }
.bcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); text-align: left; display: grid; gap: 8px; width: 100%; }
/* drag and drop (public/js/drag.mjs): the dragged copy, the dimmed original, the line showing where it will land */
[data-dnd] { cursor: grab; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.dnd-src { opacity: .35; }
.dnd-ghost { position: fixed; left: 0; top: 0; z-index: 300; margin: 0; pointer-events: none; opacity: .97; box-shadow: 0 22px 44px -14px rgba(20, 33, 61, .5); border-radius: 14px; transform-origin: 24px 18px; }
body.dnd, body.dnd * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
body.dnd .board { scroll-snap-type: none; }
.dnd-line { height: 4px; border-radius: 4px; background: var(--accent); margin: -3px 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ag-day.over, .dayp.over { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.bcard .t { font-weight: 600; font-size: .94rem; line-height: 1.3; overflow-wrap: anywhere; }
.bcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ref { font: 500 .72rem var(--font-display); color: var(--slate); }
.quick { display: flex; gap: 6px; }
.quick input { flex: 1; min-width: 0; border: 1px dashed var(--line); background: transparent; border-radius: 12px; padding: 8px 10px; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: .72rem; color: var(--slate); padding: 4px 0; }
.cal .day { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; align-content: center; gap: 2px; font-weight: 500; position: relative; background: transparent; }
.cal .day:hover { background: var(--t-indigo); }
.cal .day.out { color: var(--slate); opacity: .45; }
.cal .day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal .day[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); }
.cal .dots { display: flex; gap: 3px; height: 6px; }
.cal .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal .day[aria-pressed='true'] .dots i { background: var(--on-accent); }
.cal .dots i.late { background: var(--ink-rose); }

/* ---------- charts ---------- */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; }
.bars .b { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 6px; height: 100%; min-height: 0; }
.bars svg { display: block; width: 100%; height: 100%; min-height: 0; }
.bars span { font-size: .72rem; color: var(--slate); }
.bars .bar { fill: var(--accent-2); opacity: .55; }
.bars .bar.on { opacity: 1; }
.donut-wrap { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.donut { width: 120px; height: 120px; }
.donut circle { fill: none; stroke-width: 14; }
.donut text { font: 700 1.1rem var(--font-display); fill: var(--ink); text-anchor: middle; }
.donut text.s { font: 500 .62rem var(--font-text); fill: var(--slate); }
.legend { display: grid; gap: 6px; font-size: .88rem; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend b { margin-left: auto; }
.seg-stroke-backlog { stroke: var(--s-backlog); } .seg-stroke-todo { stroke: var(--s-todo); } .seg-stroke-doing { stroke: var(--s-doing); } .seg-stroke-review { stroke: var(--s-review); } .seg-stroke-done { stroke: var(--s-done); }
.work { display: grid; gap: 10px; }
.work .row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.work progress { width: 100%; }
.feed { display: grid; gap: 12px; }
.feed li { display: grid; grid-template-columns: auto 1fr; gap: 10px; list-style: none; font-size: .9rem; }
.feed { padding: 0; margin: 0; }
.feed small { color: var(--slate); display: block; }

/* ---------- sheets, forms, buttons ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 10, 40, .5); z-index: 40; animation: fade .2s ease-out; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 16px; animation: up .28s cubic-bezier(.22, 1, .36, 1); box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .5); }
@media (min-width: 900px) { .sheet { left: auto; top: 0; bottom: 0; width: 520px; max-height: none; border-radius: 28px 0 0 28px; animation: side .28s cubic-bezier(.22, 1, .36, 1); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes side { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head .ref { font-size: .8rem; }
.title-input { font: 700 1.3rem/1.25 var(--font-display); border: 0; background: none; width: 100%; padding: 4px 0; outline: none; border-bottom: 2px solid transparent; resize: none; field-sizing: content; min-height: 2.6em; overflow-wrap: anywhere; }
.title-input:focus { border-bottom-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--slate); }
.field textarea { min-height: 96px; resize: vertical; }
.field small.err { color: var(--ink-rose); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; border: 0; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn--ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn--danger { background: var(--t-rose); color: var(--ink-rose); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.fab { position: fixed; right: 20px; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); z-index: 29; width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 14px 28px -10px rgba(79, 70, 229, .7); }
.fab svg { width: 26px; height: 26px; }
.checks { display: grid; gap: 8px; }
.ci { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.ci input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--accent); }
.ci input[type='text'] { border: 0; background: none; padding: 6px 0; min-height: 32px; width: 100%; border-bottom: 1px solid transparent; }
.ci input[type='text']:focus { border-bottom-color: var(--accent); outline: none; }
.ci.done input[type='text'] { color: var(--slate); text-decoration: line-through; }
.comments { display: grid; gap: 12px; }
.comment { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment small { color: var(--slate); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 24px); z-index: 60; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 16px; font-weight: 500; max-width: 90vw; box-shadow: var(--shadow); }
.toast.bad { background: #c23a3a; color: #fff; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #0a1233 0%, #2b2a9c 55%, #4f46e5 100%); }
.login .panel { width: min(420px, 100%); background: var(--card); border-radius: 30px; padding: 28px; display: grid; gap: 18px; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6); }
.login .brand { justify-content: center; font-size: 1.3rem; }
.login p.sub { margin: -8px 0 0; text-align: center; color: var(--slate); }
.form-err { background: var(--t-rose); color: var(--ink-rose); padding: 10px 14px; border-radius: 14px; font-size: .92rem; }
.profile-row { display: flex; align-items: center; gap: 14px; }
.profile-row .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.profile-row small { color: var(--slate); display: block; }
.kv { display: grid; gap: 10px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.kv > div:last-child { border: 0; }
.kv span { color: var(--slate); }
.skeleton { height: 120px; border-radius: 22px; background: linear-gradient(90deg, var(--line), transparent, var(--line)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; opacity: .6; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- small additions ---------- */
.t-body { text-align: left; width: 100%; display: grid; gap: 0; color: inherit; }
.t-body:focus-visible { outline-offset: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; }
.swatch i { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--line); }
.swatch input:checked + i { box-shadow: 0 0 0 3px var(--accent); }
.swatch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 3px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.donut-wrap .legend i[data-c='#ffffff'] { display: none; }

.main:focus, #view:focus { outline: none; }

/* ---------- project page, lifecycle and timeline ---------- */
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meta-row .chip { gap: 6px; }
.link-chip { text-decoration: none; background: var(--accent); color: var(--on-accent); }
.lead { margin: 0; color: var(--slate); }
.chip.l-planned { background: color-mix(in srgb, var(--s-backlog) 18%, transparent); color: var(--slate); }
.chip.l-in_progress { background: var(--t-indigo); color: var(--ink-indigo); }
.chip.l-paused { background: var(--t-amber); color: var(--ink-amber); }
.chip.l-completed { background: var(--t-green); color: var(--ink-green); }
.chip.l-archived { background: var(--line); color: var(--slate); }
.chip.h-good, .chip.h-done { background: var(--t-green); color: var(--ink-green); }
.chip.h-warn { background: var(--t-amber); color: var(--ink-amber); }
.chip.h-bad { background: var(--t-rose); color: var(--ink-rose); }
.chip.h-muted { background: color-mix(in srgb, var(--s-backlog) 18%, transparent); color: var(--slate); }
.chip.ph-not_started { background: color-mix(in srgb, var(--s-backlog) 18%, transparent); color: var(--slate); }
.chip.ph-in_progress { background: var(--t-indigo); color: var(--ink-indigo); }
.chip.ph-completed { background: var(--t-green); color: var(--ink-green); }
.proj-chips { display: inline-flex; margin-top: 4px; }
.hero-actions { position: relative; z-index: 1; }
.hero-btn.ghost { background: rgba(255, 255, 255, .16); color: #fff; }
.tile b.d { font-size: 1.25rem; }
.tl { display: grid; gap: 8px; }
.tl-row { display: grid; grid-template-columns: minmax(70px, 24%) 1fr; gap: 10px; align-items: center; }
.tl-name { font-size: .82rem; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-proj .tl-name { color: var(--ink); font-weight: 600; }
.tl-track { width: 100%; height: 28px; background: color-mix(in srgb, var(--line) 50%, transparent); border-radius: 8px; display: block; }
.tl-plan { fill: color-mix(in srgb, var(--accent) 28%, transparent); }
.tl-act { fill: var(--accent); }
.tl-done { fill: var(--s-done); }
.tl-today { stroke: var(--ink-rose); stroke-width: .5; vector-effect: non-scaling-stroke; stroke-dasharray: 2 2; }
.tl-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--slate); margin-left: calc(24% + 10px); }
.tl-legend { display: flex; gap: 14px; font-size: .75rem; color: var(--slate); flex-wrap: wrap; }
.tl-legend i { display: inline-block; width: 14px; height: 6px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.k-plan { background: color-mix(in srgb, var(--accent) 28%, transparent); } .k-act { background: var(--accent); } .k-today { background: var(--ink-rose); }
.phases { display: grid; gap: 12px; }
.phase { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 18px; }
.phase .pn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--t-indigo); color: var(--ink-indigo); font: 700 .8rem var(--font-display); }
.phase.s-completed .pn { background: var(--s-done); color: #fff; }
.phase .pb { display: grid; gap: 6px; min-width: 0; }
.phase .pb small { color: var(--slate); }
.phase .row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: .82rem; color: var(--slate); }
.phase .row progress { width: 100%; }
.pa { display: grid; gap: 6px; justify-items: stretch; }
.mini-btn { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: .8rem; text-align: center; text-decoration: none; color: var(--ink); }
.note { margin: 10px 2px 0; color: var(--slate); font-size: .88rem; }
.ph-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- lock screen and quick unlock ---------- */
.lockscreen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #0a1233 0%, #2b2a9c 55%, #4f46e5 100%); color: #fff; overflow-y: auto; }
.lock-in { display: grid; gap: 14px; justify-items: center; text-align: center; width: min(340px, 100%); }
.lock-in h1 { font-size: 1.35rem; color: #fff; }
.lock-in .sub { margin: 0; color: #c9ceff; }
.dots { display: flex; gap: 14px; margin: 6px 0; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #c9ceff; }
.dots i.on { background: #fff; border-color: #fff; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; justify-content: center; }
.key { width: 76px; height: 76px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font: 600 1.6rem var(--font-display); display: grid; place-items: center; }
.key:active { background: rgba(255, 255, 255, .3); }
.key svg { width: 26px; height: 26px; }
.lock-msg { min-height: 1.5em; margin: 0; color: #ffd0d0; font-weight: 500; }
.lock-actions { display: grid; gap: 10px; width: 100%; }
.lockscreen .btn { background: #fff; color: #0a1233; }
.lockscreen .btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .4); }
body.is-locked #app { visibility: hidden; }
.sub-h { font: 600 1rem var(--font-display); margin: 18px 0 8px; }
.keys { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.keys li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; }
.keys small { display: block; color: var(--slate); }
.card .note { margin: 0 0 10px; }

.btn svg, .mini-btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- connection bar ---------- */
#netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 150; display: grid; place-items: center; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; font-size: .82rem; font-weight: 600; text-align: center; }
#netbar[hidden] { display: none; }
#netbar .net.off { color: #5a3a00; } #netbar .net.sync { color: #14357a; } #netbar .net.bad { color: #7a1414; }
#netbar:has(.off) { background: #ffe9a8; } #netbar:has(.sync) { background: #cfe0ff; } #netbar:has(.bad) { background: #ffd6d6; }
#netbar a { color: inherit; text-decoration: underline; }
body:has(#netbar:not([hidden])) .main { padding-top: calc(48px + env(safe-area-inset-top)); }

.wf-row { display: grid; grid-template-columns: 1fr 84px 96px; gap: 10px; align-items: end; }
.check-row { display: flex; gap: 8px; align-items: center; min-height: 44px; justify-self: start; }
.check-row input { width: 22px; height: 22px; min-height: 0; padding: 0; flex: none; accent-color: var(--accent); }
.wf-row .note { margin: 0; align-self: center; justify-self: start; }
@media (max-width: 520px) { .wf-row { grid-template-columns: 1fr 70px; margin-bottom: 6px; } .wf-row > :last-child { grid-column: 1 / -1; } }

.similar:not(:empty) { margin: -4px 0 12px; padding: 10px 12px; border-radius: 14px; background: #fff8e6; border: 1px solid #f3dca0; font-size: .88rem; } .similar p { margin: 0 0 4px; } .similar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; } .similar li { display: flex; justify-content: space-between; gap: 10px; align-items: center; } .similar button { background: none; border: 0; padding: 4px 0; text-align: left; color: var(--accent); font: 600 .88rem var(--font-text); cursor: pointer; } .similar small { color: #7a6a3a; flex: none; }

/* text for screen readers only (names the dropdowns that have no visible label) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }

/* ---- calmer tasks page (0.7): filters behind one button, counts in the status pills ---- */
.toolbar--calm .search { flex: 1 1 220px; }
.filter-btn { gap: 6px; }
.filter-btn .fcount { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .74rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: center; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 5%, var(--card)); border: 1px solid var(--line); }
.filters[hidden] { display: none; }
.pill .pc { margin-left: 4px; opacity: .75; font-variant-numeric: tabular-nums; }
.task .t-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; margin-right: 8px; vertical-align: 1px; background: var(--s-todo); }
.task .t-dot.s-backlog { background: var(--s-backlog); } .task .t-dot.s-doing { background: var(--s-doing); } .task .t-dot.s-review { background: var(--s-review); } .task .t-dot.s-done { background: var(--s-done); }
.task .sub .meta-txt { color: var(--slate); font-size: .8rem; }

/* ---- task panel (0.7): the main fields first, the rest under "More details" ---- */
.more { border-top: 1px solid var(--line); padding-top: 12px; }
.more > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; color: var(--slate); font-weight: 600; font-size: .9rem; padding: 4px 0; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: '+'; font-size: 1.2rem; line-height: 1; }
.more[open] > summary::after { content: '–'; }
.more > .more-body { display: grid; gap: 14px; margin-top: 12px; }
.grid2 .span2 { grid-column: 1 / -1; }
.filters > .mini { justify-self: start; }
