/* MVP Projects - warehouse-floor palette: concrete, ink, safety yellow for points. */
:root {
  /* Dark (default) */
  color-scheme: dark;
  --concrete: #050505;        /* page */
  --concrete-deep: #101010;   /* sunken: board columns, chips */
  --panel: #121212;           /* panels, dialogs */
  --paper: #1A1A1A;           /* cards, inputs */
  --ink: #EDEDED;             /* main text */
  --ink-2: #CFCFCF;
  --steel: #8C8C8C;           /* secondary text */
  --line: #2E2E2E;
  --line-soft: #1F1F1F;
  --hover: #222222;
  --chip: #262626;
  --weekend: rgba(255, 255, 255, .025);
  --gridline: rgba(255, 255, 255, .05);
  --g-link: #9A9A9A;
  --wait-bg: rgba(214, 168, 30, .16);
  --wait-text: #E8C04A;
  --side-bg: #000000;
  --side-text: #BDBDBD;
  --side-muted: #7A7A7A;
  --side-line: #1A1A1A;
  --side-active: #1C1C1C;
  --primary: #A6FF1A;
  --primary-hover: #BFFF55;
  --primary-text: #000000;
  --brand-green: #A6FF1A;
  --safety: #F2C230;
  --safety-deep: #F2C230;
  --on-safety: #111111;
  --signal: #F07863;
  --signal-bg: rgba(240, 120, 99, .16);
  --today-bg: rgba(242, 194, 48, .16);
  --today-text: #F2C230;
  --go: #3BA370;
  --lane: #7FB2E8;
  --focus: #A6FF1A;
  --prio-high: #F0A257;
  --st-todo: #7B8794;
  --st-in_progress: #4F8FD6;
  --st-review: #D6A81E;
  --st-done: #3BA370;
  --note-bg: rgba(242, 194, 48, .10);
  --note-line: rgba(242, 194, 48, .35);
  --info-bg: rgba(127, 178, 232, .10);
  --info-line: rgba(127, 178, 232, .30);
  --cal-other: #0A0A0A;
  --cal-item: #242424;
  --cal-late: rgba(240, 120, 99, .18);
  --lb-rest: #A88E3E;
  --shadow: 0 20px 60px rgba(0, 0, 0, .8);

  --font-sign: "Bahnschrift", "DIN Alternate", "DIN Next", "Barlow Semi Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-pixel: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 3px; --r-md: 6px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --concrete: #E4E7E6;
  --concrete-deep: #D6DBDA;
  --panel: #F8F9F8;
  --paper: #FFFFFF;
  --ink: #1B2430;
  --ink-2: #2A3646;
  --steel: #5A6878;
  --line: #C9CFD1;
  --line-soft: #DDE1E2;
  --hover: #EEF1F1;
  --chip: #D6DBDA;
  --weekend: rgba(27, 36, 48, .045);
  --gridline: rgba(27, 36, 48, .07);
  --g-link: #5A6878;
  --wait-bg: #FBEFC6;
  --wait-text: #7A5A00;
  --side-bg: #1B2430;
  --side-text: #C9D2DB;
  --side-muted: #93A1AF;
  --side-line: #2C3A4B;
  --side-active: #33465C;
  --primary: #1B2430;
  --primary-hover: #2A3646;
  --primary-text: #FFFFFF;
  --brand-green: #8EE600;
  --safety-deep: #8A6A00;
  --signal: #B93A27;
  --signal-bg: #F6DDD8;
  --today-bg: #FBEFC6;
  --today-text: #8A6A00;
  --go: #2C7A54;
  --lane: #2F5E91;
  --focus: #2F6FD6;
  --prio-high: #9A5A12;
  --st-in_progress: #2F5E91;
  --st-review: #C99A12;
  --st-done: #2C7A54;
  --note-bg: #FBF3D5;
  --note-line: #EBD58A;
  --info-bg: #E8EEF5;
  --info-line: #C3D1E1;
  --cal-other: #F1F3F3;
  --cal-item: #F1F4F6;
  --cal-late: #F9E6E2;
  --lb-rest: #C9B26A;
  --shadow: 0 20px 60px rgba(15, 22, 32, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--concrete);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lane); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--steel); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--font-sign); font-weight: 600; letter-spacing: 0; margin: 0; line-height: 1.15; }
h1 { font-size: 28px; font-stretch: 87.5%; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--side-line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: var(--s5) var(--s4) var(--s4); display: flex; align-items: center; gap: var(--s3); }
.brand img { width: 40px; height: 40px; image-rendering: pixelated; flex: none; }
.brand b { font-family: var(--font-sign); font-size: 18px; font-weight: 600; color: #F2F5F8; display: block; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--side-muted); }
.nav { display: flex; flex-direction: column; padding: var(--s2); gap: 2px; }
.nav a {
  color: var(--side-text); text-decoration: none; padding: 9px var(--s3); border-radius: var(--r-md);
  display: flex; align-items: center; gap: var(--s3); font-weight: 500;
}
.nav a:hover { background: var(--side-active); color: #fff; }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--brand-green); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side-foot { margin-top: auto; padding: var(--s4); border-top: 1px solid var(--side-line); font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot button { background: none; border: 0; color: var(--side-muted); padding: 0; cursor: pointer; text-decoration: underline; }
.channel { display: inline-flex; align-items: center; gap: 6px; margin: var(--s2) 0; color: var(--side-muted); }
.channel i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-green); display: inline-block; }
.channel.remote i { background: var(--safety); }
.channel.remote { color: var(--safety); }

.main { min-width: 0; padding: var(--s5) var(--s6) var(--s7); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head p { margin: var(--s1) 0 0; color: var(--steel); }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--paper); padding: 7px 14px; cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--steel); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 45%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--steel); }
.btn.ghost:hover { color: var(--ink); background: var(--hover); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--paper); }
.seg button { border: 0; background: none; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--steel); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--steel); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); padding: 8px 10px;
  font-size: 15px; font-weight: 400; color: var(--ink); width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.check { display: flex; align-items: flex-start; gap: var(--s2); font-size: 14px; color: var(--ink); font-weight: 400; }
.check input { margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s4); }
.form-grid .full { grid-column: 1 / -1; }
.error { color: var(--signal); font-size: 14px; margin: 0; }
.error:empty { display: none; }

/* ---------- panels / tables ---------- */
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--s4) var(--s5); }
.panel > h2 { margin-bottom: var(--s3); }
.grid-home { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.stack { display: flex; flex-direction: column; gap: var(--s5); }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; color: var(--steel); font-size: 13px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--hover); }
.table-wrap { overflow-x: auto; }

.empty { padding: var(--s5) 0; color: var(--steel); }
.empty b { color: var(--ink); display: block; margin-bottom: 4px; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.chip.overdue { background: var(--signal-bg); color: var(--signal); }
.chip.today { background: var(--today-bg); color: var(--today-text); }
.chip .dot, .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.status { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--st-todo); }
.status.s-in_progress::before { background: var(--st-in_progress); }
.status.s-review::before { background: var(--st-review); }
.status.s-done::before { background: var(--st-done); }
.prio-urgent { color: var(--signal); font-weight: 700; }
.prio-high { color: var(--prio-high); font-weight: 600; }
.prio-low { color: var(--steel); }

/* Points tag - the one loud thing: a yellow shipping tag with a punched hole. */
.pts {
  --h: 22px;
  display: inline-flex; align-items: center; height: var(--h); padding: 0 8px 0 14px;
  background: var(--safety); color: var(--on-safety); font-family: var(--font-sign); font-weight: 700; font-size: 13px;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%);
  position: relative; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pts::before { content: ""; position: absolute; left: 6px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--panel); }
.pts.zero { background: var(--chip); color: var(--steel); }

/* ---------- board ---------- */
.toolbar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar input[type=search] { width: 220px; }
.toolbar select { width: auto; }
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s3); align-items: start; }
.col { background: var(--concrete-deep); border-radius: var(--r-md); display: flex; flex-direction: column; min-height: 200px; border-top: 4px solid var(--st-todo); }
.col.c-in_progress { border-top-color: var(--st-in_progress); }
.col.c-review { border-top-color: var(--st-review); }
.col.c-done { border-top-color: var(--st-done); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; }
.col-head h3 { font-size: 15px; }
.col-head .count { color: var(--steel); font-size: 13px; font-weight: 600; }
.col-body { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 60px; }
.col.drop-target .col-body { background: color-mix(in srgb, var(--focus) 12%, transparent); border-radius: var(--r-sm); }
.col-add { margin: 0 8px 8px; justify-content: center; }

.card {
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 10px 12px;
  cursor: pointer; display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%;
  border-left: 3px solid transparent;
}
.card:hover { border-color: var(--line); }
.card.p-urgent { border-left-color: var(--signal); }
.card.p-high { border-left-color: var(--prio-high); }
.card.dragging { opacity: .45; }
.card-title { font-weight: 600; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; }
.card-title:hover { text-decoration: underline; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--steel); }
.card-meta .grow { flex: 1; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--steel); font-family: var(--font-sign);
}
.drop-line { height: 3px; background: var(--focus); border-radius: 2px; }

/* ---------- projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s4); }
.proj {
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--s4);
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: var(--s3); border-top: 4px solid var(--c, var(--lane));
}
.proj:hover { border-color: var(--line); border-top-color: var(--c, var(--lane)); }
.proj h2 { font-size: 18px; }
.proj p { margin: 0; color: var(--steel); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar { height: 6px; background: var(--concrete-deep); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--go); }
.proj-head { display: flex; gap: var(--s3); align-items: flex-start; }
.swatch { width: 14px; height: 14px; border-radius: 3px; flex: none; margin-top: 6px; }
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--steel); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- timeline ---------- */
.tl { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: auto; position: relative; max-height: 70vh; }
.tl-grid { display: grid; position: relative; }
.tl-label { position: sticky; left: 0; background: var(--paper); z-index: 2; padding: 0 10px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line-soft); }
.tl-head { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--steel); }
.tl-head.tl-label { z-index: 4; }
.tl-track { position: relative; border-bottom: 1px solid var(--line-soft); }
.tl-bar {
  position: absolute; top: 8px; bottom: 8px; border-radius: var(--r-sm); background: var(--st-todo); color: #fff; font-size: 12px; font-weight: 600;
  padding: 0 6px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; border: 0; min-width: 10px;
}
.tl-bar.s-in_progress { background: var(--st-in_progress); }
.tl-bar.s-review { background: var(--st-review); color: var(--on-safety); }
.tl-bar.s-done { background: var(--st-done); }
.tl-bar.late { box-shadow: inset 0 -3px 0 var(--signal); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--signal); z-index: 1; pointer-events: none; }
.tl-week { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-soft); }
.tl-week-label { position: absolute; top: 0; bottom: 0; padding: 6px 6px; border-left: 1px solid var(--line-soft); white-space: nowrap; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line-soft); gap: 1px; border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.cal-dow { background: var(--panel); padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--steel); }
.cal-day { background: var(--paper); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: var(--cal-other); }
.cal-day.other .cal-date { color: var(--steel); opacity: .6; }
.cal-date { font-family: var(--font-sign); font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.cal-day.is-today .cal-date { background: var(--primary); color: var(--primary-text); border-radius: 4px; padding: 0 6px; align-self: flex-start; }
.cal-item {
  font-size: 12px; text-align: left; border: 0; border-left: 3px solid var(--c, var(--lane)); background: var(--cal-item); color: var(--ink); padding: 3px 6px;
  border-radius: 0 3px 3px 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
.cal-item.done { text-decoration: line-through; color: var(--steel); }
.cal-item.late { background: var(--cal-late); }
.cal-more { font-size: 12px; color: var(--steel); background: none; border: 0; text-align: left; padding: 2px 6px; cursor: pointer; }

/* ---------- leaderboard ---------- */
.lb { display: flex; flex-direction: column; }
.lb-row { display: grid; grid-template-columns: 56px minmax(120px, 220px) 1fr 92px; align-items: center; gap: var(--s4); padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.lb-rank { font-family: var(--font-sign); font-size: 30px; font-weight: 700; color: var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.lb-row.top .lb-rank { color: var(--ink); }
.lb-row.first .lb-rank { color: var(--safety-deep); }
.lb-name b { display: block; }
.lb-name span { font-size: 13px; color: var(--steel); }
.lb-track { height: 18px; background: var(--concrete-deep); border-radius: 2px; overflow: hidden; }
.lb-track i { display: block; height: 100%; background: var(--safety); border-radius: 2px; }
.lb-row:not(.top) .lb-track i { background: var(--lb-rest); }
.lb-pts { font-family: var(--font-sign); font-size: 22px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.lb-pts small { font-size: 12px; color: var(--steel); font-weight: 600; margin-left: 3px; }
.lb.compact .lb-row { grid-template-columns: 32px 1fr auto; gap: var(--s3); padding: 7px 0; }
.lb.compact .lb-rank { font-size: 20px; }
.lb.compact .lb-track { display: none; }
.lb.compact .lb-pts { font-size: 17px; }
.me-pts { display: flex; gap: var(--s5); margin-bottom: var(--s3); }
.me-pts div b { font-family: var(--font-sign); font-size: 30px; display: block; line-height: 1; font-variant-numeric: tabular-nums; }
.me-pts div span { font-size: 13px; color: var(--steel); }

/* ---------- activity ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; display: flex; gap: var(--s2); }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--steel); font-size: 12px; white-space: nowrap; margin-left: auto; padding-left: var(--s2); }
.task-line { display: flex; flex-wrap: wrap; row-gap: 6px; align-items: center; gap: var(--s3); padding: 9px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.task-line:hover .tl-title { text-decoration: underline; }
.task-line .tl-title { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; }

/* ---------- dialog ---------- */
dialog {
  border: 0; border-radius: 8px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow); border: 1px solid var(--line-soft);
}
dialog.narrow { width: min(460px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dlg-head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-soft); }
.dlg-head h2 { flex: 1; }
.dlg-body { padding: var(--s4) var(--s5); overflow: auto; }
.dlg-foot { display: flex; gap: var(--s2); justify-content: flex-end; padding: var(--s3) var(--s5); border-top: 1px solid var(--line-soft); align-items: center; }
.task-title-input { font-family: var(--font-sign); font-size: 22px !important; font-weight: 600 !important; border-color: transparent !important; background: transparent !important; padding: 4px 6px !important; margin-left: -6px; }
.task-title-input:hover { border-color: var(--line) !important; }
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--s5); }
.task-side { display: flex; flex-direction: column; gap: var(--s3); }
.comments { margin-top: var(--s5); }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.comment-head { display: flex; gap: var(--s2); align-items: center; font-size: 13px; }
.comment-body { white-space: pre-wrap; margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.note { background: var(--note-bg); border: 1px solid var(--note-line); border-radius: var(--r-md); padding: 10px 12px; font-size: 14px; }
.note.info { background: var(--info-bg); border-color: var(--info-line); }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; letter-spacing: .04em; background: var(--paper); border: 1px dashed var(--line); padding: 8px 10px; border-radius: var(--r-md); user-select: all; overflow-wrap: anywhere; }
.qr { background: #fff; display: inline-block; padding: 4px; border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.qr svg { display: block; max-width: 100%; height: auto; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); }
.auth-art { background: var(--side-bg); color: #F2F5F8; padding: var(--s7); display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.auth-logo { width: 84px; height: 84px; image-rendering: pixelated; margin-bottom: var(--s4); }
.auth-art h1 { font-size: 56px; font-stretch: 80%; line-height: 1; max-width: 10ch; }
.auth-art p { color: #9A9A9A; max-width: 44ch; }
.auth-racks { position: absolute; inset: var(--s7) var(--s7) auto var(--s7); display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; opacity: .9; }
.auth-racks i { height: 120px; border: 2px solid #222222; border-radius: 3px; display: flex; flex-direction: column-reverse; padding: 4px; gap: 4px; }
.auth-racks i b { display: block; height: 22px; background: #222222; border-radius: 2px; }
.auth-racks i b.y { background: var(--brand-green); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: var(--s7) var(--s6); gap: var(--s4); background: var(--panel); }
.auth-form form { display: flex; flex-direction: column; gap: var(--s3); }
.auth-form .btn { justify-content: center; padding: 10px; }
.code-input { font-family: var(--font-sign) !important; font-size: 28px !important; letter-spacing: .3em; text-align: center; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; pointer-events: none; }
#toast div { background: var(--ink); color: var(--concrete); padding: 10px 16px; border-radius: var(--r-md); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); margin-top: 8px; }
#toast div.err { background: var(--signal); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid-home { grid-template-columns: minmax(0, 1fr); }
  .task-layout { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { padding: var(--s3) var(--s4); }
  .brand span { display: none; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; padding: 0 var(--s2) var(--s2); }
  .nav a { padding: 7px 10px; white-space: nowrap; }
  .nav a span { font-size: 14px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: var(--s2) var(--s4); text-align: right; }
  .side-foot .channel { margin: 0; }
  .main { padding: var(--s4); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .lb-row { grid-template-columns: 36px 1fr auto; gap: var(--s3); }
  .lb-track { display: none; }
  .lb-rank { font-size: 22px; }
  .cal-day { min-height: 74px; padding: 3px; }
  .cal-item { font-size: 11px; padding: 2px 4px; }
  .toolbar input[type=search] { width: 100%; }
  .toolbar select { width: 100%; }
  .task-line .tl-title { flex: 1 1 calc(100% - 24px); white-space: normal; }
  .page-head > .row { width: 100%; }
  h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- status dropdown ---------- */
select.status-select {
  width: auto; font-size: 12px; font-weight: 600; padding: 3px 6px; border-radius: 4px; cursor: pointer;
  background-color: var(--chip); border: 1px solid transparent; border-left: 4px solid var(--st-todo); color: var(--ink); max-width: 100%;
}
select.status-select:hover { border-color: var(--line); border-left-color: inherit; }
select.status-select.s-todo { border-left-color: var(--st-todo); }
select.status-select.s-in_progress { border-left-color: var(--st-in_progress); }
select.status-select.s-review { border-left-color: var(--st-review); }
select.status-select.s-done { border-left-color: var(--st-done); }
select.status-select:disabled { opacity: .6; }
.chip.wait { background: var(--wait-bg); color: var(--wait-text); }

/* ---------- notes + photos ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { width: 88px; height: 88px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); padding: 0; background: var(--chip); cursor: pointer; position: relative; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: var(--primary); }
.thumb.pending { cursor: default; }
.thumb-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.photo-strip:not(:empty) { margin-top: var(--s4); }
.composer { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 10px; background: var(--paper); }
.composer textarea { background: transparent; border-color: transparent; padding: 4px; }
.composer textarea:focus { box-shadow: none; border-color: transparent; }
label.btn { user-select: none; }
dialog.lightbox { width: min(1100px, calc(100vw - 24px)); }
.lb { display: grid; place-items: center; background: #000; border-radius: var(--r-md); min-height: 240px; }
.lb-img { max-width: 100%; max-height: calc(100vh - 220px); display: block; }
.dep-picker { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); font-size: 14px; font-weight: 400; color: var(--ink); }
.dep-picker summary { padding: 8px 10px; cursor: pointer; }
.dep-list { max-height: 200px; overflow: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-soft); }

/* ---------- gantt ---------- */
.g-wrap { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: auto; max-height: calc(100vh - 230px); min-height: 220px; position: relative; }
.g-grid { display: grid; position: relative; }
.g-corner, .g-label { position: sticky; left: 0; z-index: 3; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; padding: 0 10px; min-width: 0; font-size: 13px; }
.g-corner { top: 0; z-index: 5; font-size: 12px; color: var(--steel); font-weight: 600; align-items: flex-end; padding-bottom: 8px; border-bottom-color: var(--line); }
.g-head { position: sticky; top: 0; z-index: 4; background: var(--panel); border-bottom: 1px solid var(--line); }
.g-head-months, .g-head-days { position: relative; height: 26px; }
.g-month { position: absolute; top: 0; bottom: 0; padding: 5px 8px; font-size: 12px; font-weight: 600; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.g-day { position: absolute; top: 0; bottom: 0; padding: 5px 4px; font-size: 11px; color: var(--steel); border-left: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; }
.z-day .g-day { text-align: center; padding: 5px 0; }
.g-day.weekend { color: color-mix(in srgb, var(--steel) 60%, transparent); }
.g-day.is-today { color: var(--primary-text); background: var(--primary); font-weight: 700; }
.z-week .g-day.is-today, .z-month .g-day.is-today { background: none; color: var(--ink); }
.g-track { position: relative; border-bottom: 1px solid var(--line-soft); }
.z-day .g-track, .z-week .g-track {
  background-image:
    repeating-linear-gradient(to right, transparent 0 calc(var(--day) * 5), var(--weekend) calc(var(--day) * 5) calc(var(--day) * 7)),
    repeating-linear-gradient(to right, var(--gridline) 0 1px, transparent 1px calc(var(--day) * 7));
}
.z-day .g-track { background-image:
    repeating-linear-gradient(to right, transparent 0 calc(var(--day) * 5), var(--weekend) calc(var(--day) * 5) calc(var(--day) * 7)),
    repeating-linear-gradient(to right, var(--gridline) 0 1px, transparent 1px var(--day)); }
.z-month .g-track { background-image: repeating-linear-gradient(to right, var(--gridline) 0 1px, transparent 1px calc(var(--day) * 7)); }
.g-group-label { font-weight: 700; font-size: 14px; background: var(--paper); }
.g-group-track { background-color: color-mix(in srgb, var(--paper) 60%, transparent); }
.g-group-name { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.g-group-name:hover { text-decoration: underline; }
.g-toggle { background: none; border: 0; color: var(--steel); cursor: pointer; width: 18px; padding: 0; font-size: 14px; }
.g-task-name { background: none; border: 0; padding: 0 0 0 18px; color: var(--ink); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; font-size: 13px; }
.g-task-name:hover { text-decoration: underline; }
.g-task-name.done { color: var(--steel); text-decoration: line-through; }
.g-label .avatar { width: 22px; height: 22px; font-size: 10px; }
.g-label .chip { font-size: 11px; padding: 1px 6px; }
.g-summary { position: absolute; top: 14px; height: 10px; background: color-mix(in srgb, var(--c) 35%, transparent); border-radius: 2px; overflow: hidden; border: 1px solid var(--c); }
.g-summary i { display: block; height: 100%; background: var(--c); }
.g-summary.late { box-shadow: 0 0 0 1px var(--signal); }
.g-bar {
  position: absolute; top: 8px; height: 22px; border-radius: 4px; z-index: 2; cursor: grab; overflow: hidden;
  background: color-mix(in srgb, var(--c) 28%, var(--panel)); border: 1px solid var(--c); touch-action: pan-x pan-y;
}
.g-bar:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.g-bar.dragging { cursor: grabbing; box-shadow: 0 4px 16px rgba(0,0,0,.45); z-index: 6; }
.g-bar.late { border-color: var(--signal); box-shadow: inset 0 -3px 0 var(--signal); }
.g-bar.s-done { opacity: .7; }
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); pointer-events: none; }
.g-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 1; }
.g-handle.l { left: 0; } .g-handle.r { right: 0; }
.g-bar:hover .g-handle { background: rgba(255,255,255,.25); }
.g-bar-label { position: absolute; top: 11px; font-size: 12px; color: var(--steel); white-space: nowrap; pointer-events: none; z-index: 2; }
.g-wait { color: var(--wait-text); font-weight: 700; }
.g-unscheduled { position: absolute; top: 9px; font-size: 12px; color: var(--steel); background: var(--chip); border: 1px dashed var(--line); border-radius: 999px; padding: 1px 10px; cursor: pointer; }
.g-today { position: absolute; bottom: 0; width: 2px; background: var(--primary); z-index: 2; pointer-events: none; }
.g-links { position: absolute; top: 0; pointer-events: none; z-index: 2; overflow: visible; }
.g-links path { fill: none; stroke: var(--g-link); stroke-width: 1.5; }
.g-links path.bad { stroke: var(--signal); stroke-dasharray: 4 3; }
.g-links marker .m-ok { fill: var(--g-link); stroke: none; }
.g-links marker .m-bad { fill: var(--signal); stroke: none; }
.g-legend { display: inline-flex; align-items: center; gap: 6px; }
.g-key { display: inline-block; width: 18px; height: 10px; border-radius: 2px; margin-left: 8px; }
.g-key.fill { background: var(--st-in_progress); }
.g-key.late { border: 1px solid var(--signal); box-shadow: inset 0 -3px 0 var(--signal); }
.g-key.link { height: 2px; background: var(--g-link); }
@media (max-width: 760px) {
  .g-legend { display: none; }
  .g-wrap { max-height: calc(100vh - 260px); }
}
