:root {
  color-scheme: light;
  --bg: #f4f3ef; --surface: #ffffff; --surface-2: #f0efec; --hover: #e8e7e2;
  --ink: #16181d; --ink-2: #52514e; --muted: #7d7b75; --line: #e1e0d9;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #d9f0ed;
  --danger: #c2362f; --ok: #15803d; --ok-soft: #dcf3e3; --warn-soft: #fdecc8; --warn-ink: #7a4a00; --bad-soft: #fde0de; --bad-ink: #a1261f;
  --list: #ecebe6; --shadow: 0 1px 2px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .04); --pop-shadow: 0 12px 32px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .08);
  --series-1: #2a78d6; --grid: #e1e0d9;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #0f1011; --surface: #1c1d1f; --surface-2: #26282b; --hover: #303236;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #94928b; --line: #303236;
  --accent: #2bb3a6; --accent-ink: #06211f; --accent-soft: #17403c;
  --danger: #e66767; --ok: #4ade80; --ok-soft: #173a25; --warn-soft: #4a3606; --warn-ink: #fcd37a; --bad-soft: #4a1a18; --bad-ink: #ffb0aa;
  --list: #131415; --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06); --pop-shadow: 0 12px 32px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1);
  --series-1: #3987e5; --grid: #2c2c2a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); overflow: hidden; }
#app { height: 100%; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
a { color: var(--accent); }
input:not([type=checkbox]):not([type=file]), select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; width: 100%; outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
button:focus-visible, a:focus-visible, .bar-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { resize: vertical; display: block; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
small { color: var(--muted); font-size: 12px; }
.ic { display: inline-flex; flex: none; }
.grow { flex: 1; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.block { display: block; }
.empty { color: var(--muted); padding: 14px 4px; text-align: center; }
.err { background: var(--bad-soft); color: var(--bad-ink); padding: 8px 10px; border-radius: 6px; }
.splash { height: 100%; display: grid; place-items: center; color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border-radius: 6px; background: var(--surface-2); font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; color: inherit; flex: none; position: relative; }
.icon-btn:hover { background: rgba(128, 128, 128, .2); }
.icon-btn.sm { width: 26px; height: 26px; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.link.strong { font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; }
.link.strong:hover { text-decoration: underline; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field.inline { display: flex; align-items: center; gap: 8px; flex-direction: row-reverse; justify-content: flex-end; }
.field.inline > span { margin: 0; }
.field-2 { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 13px; }
.with-av { display: inline-flex; align-items: center; gap: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 40px; height: 28px; border-radius: 6px; flex: none; display: inline-block; }
.swatch.round { width: 26px; height: 26px; border-radius: 50%; }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatches.big .swatch { width: calc(50% - 3px); height: 64px; }
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; user-select: none; }
.av.more { width: 28px; height: 28px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; }
.avs { display: flex; }
.avs .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }

/* board backgrounds */
.bg-teal { background: linear-gradient(135deg, #0f766e, #155e75); }
.bg-ocean { background: linear-gradient(135deg, #1d4ed8, #0e7490); }
.bg-plum { background: linear-gradient(135deg, #6d28d9, #be185d); }
.bg-ember { background: linear-gradient(135deg, #c2410c, #b91c1c); }
.bg-forest { background: linear-gradient(135deg, #166534, #3f6212); }
.bg-slate { background: linear-gradient(135deg, #334155, #1e293b); }
.bg-sunrise { background: linear-gradient(135deg, #d97706, #db2777); }
.bg-night { background: linear-gradient(135deg, #111827, #312e81); }

/* label colours */
.lc-green { --lc: #7bd3a4; --lct: #0d3b25; } .lc-yellow { --lc: #f2d04b; --lct: #4a3900; } .lc-orange { --lc: #f6a45c; --lct: #4f2600; }
.lc-red { --lc: #f08b85; --lct: #5a1210; } .lc-purple { --lc: #b79cf0; --lct: #2c1766; } .lc-blue { --lc: #7fb2f5; --lct: #0c2f63; }
.lc-teal { --lc: #6fcfd6; --lct: #06393d; } .lc-lime { --lc: #b5d96a; --lct: #2c3f06; } .lc-pink { --lc: #f09cc8; --lct: #5a1039; } .lc-gray { --lc: #b9bcc4; --lct: #23262d; }
.swatch[class*=lc-], .dotc, .card-cover.color, .modal-cover.color { background: var(--lc); }
.lab { display: inline-flex; align-items: center; min-height: 18px; max-width: 100%; padding: 1px 8px; border-radius: 4px; background: var(--lc); color: var(--lct); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab.empty { min-width: 36px; min-height: 8px; padding: 0; }
.lab.big { min-height: 30px; padding: 4px 12px; font-size: 13px; }
.lab.big.empty { min-width: 44px; }
.lab.wide { flex: 1; min-height: 30px; padding: 4px 10px; gap: 6px; }
.dotc { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* top bar */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar { height: 50px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.on-board .topbar { background: rgba(0, 0, 0, .3); border-color: transparent; color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: inherit; text-decoration: none; letter-spacing: -.01em; }
.brand.big { font-size: 22px; justify-content: center; margin-bottom: 14px; }
.brand-mark { width: 24px; height: 24px; background: url(/logo.svg) center / contain no-repeat; flex: none; }
.brand.big .brand-mark { width: 34px; height: 34px; }
.on-board .brand-mark { border-radius: 6px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7); }
.top-link { color: inherit; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.top-link:hover { background: rgba(128, 128, 128, .2); }
.search { position: relative; display: flex; align-items: center; gap: 6px; width: min(340px, 34vw); padding: 0 10px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.search input { border: 0 !important; background: none !important; box-shadow: none !important; padding: 7px 0 !important; color: var(--ink); }
.on-board .search { background: rgba(255, 255, 255, .2); color: #fff; }
.on-board .search input { color: #fff; } .on-board .search input::placeholder { color: rgba(255, 255, 255, .8); }
.search-panel { position: absolute; top: 40px; left: 0; width: 420px; max-width: 90vw; max-height: 60vh; overflow: auto; background: var(--surface); color: var(--ink); border-radius: 8px; box-shadow: var(--pop-shadow); padding: 6px; z-index: 40; }
.search-row { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.search-row:hover { background: var(--surface-2); } .search-row b { display: block; } .search-row span { color: var(--muted); font-size: 12px; }
.offline { background: var(--warn-soft); color: var(--warn-ink); padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.bell .dot { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #d03b3b; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.av-btn { border-radius: 50%; display: grid; }

/* popover */
.pop { position: fixed; z-index: 60; background: var(--surface); color: var(--ink); border-radius: 10px; box-shadow: var(--pop-shadow); padding: 12px; max-height: calc(100vh - 16px); overflow: auto; }
.pop-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin: -2px 0 10px; color: var(--ink-2); }
.notif-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.notif { display: block; width: 100%; padding: 8px 10px; border-radius: 6px; }
.notif:hover { background: var(--surface-2); } .notif.unread { background: var(--accent-soft); }
.notif span { display: block; }
.me-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px; }
.me-head b, .me-head small { display: block; }
.label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.cover-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cover-img { border-radius: 6px; overflow: hidden; height: 54px; }
.cover-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-img.on { outline: 2px solid var(--ink); outline-offset: 2px; }

/* auth */
.auth { height: 100%; overflow: auto; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #0f766e, #155e75); }
.auth-card { width: 360px; max-width: 100%; background: var(--surface); border-radius: 12px; padding: 28px; box-shadow: var(--pop-shadow); }
.auth-card h1 { font-size: 18px; margin-bottom: 14px; text-align: center; }
.auth-card .sub { margin: -6px 0 14px; text-align: center; }
.auth-card .link { display: block; margin: 14px auto 0; text-align: center; }
.auth-card .err { margin-bottom: 4px; }

/* home */
.home { flex: 1; min-height: 0; overflow: auto; }
.home-inner { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.home-inner.narrow { max-width: 760px; }
.home-sec { margin-bottom: 34px; }
.home-sec h2, .share h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 12px; }
.home-sec .sub { margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tile { height: 100px; border-radius: 10px; padding: 12px; color: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; font-weight: 600; }
.tile:hover { filter: brightness(1.1); }
.tile-title { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { display: flex; align-items: center; gap: 8px; }
.tile-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; background: rgba(0, 0, 0, .28); padding: 2px 7px; border-radius: 99px; }
.tile-star { color: #fff; opacity: .6; display: grid; } .tile-star:hover, .tile-star.on { opacity: 1; } .tile-star.on { color: #ffd23f; }
.tile.new { background: var(--surface-2); color: var(--ink-2); align-items: center; justify-content: center; flex-direction: row; gap: 8px; font-weight: 500; }
.tile.new:hover { background: var(--hover); filter: none; }
.rows { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; } .row.top { align-items: flex-start; } .row.off { opacity: .55; }
.row b, .row small { display: block; } .row select { width: auto; }
.drawer .row { padding: 10px 0; }
.share { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 18px; }
.share-urls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.url { display: inline-flex; align-items: center; gap: 8px; font: 600 15px ui-monospace, Consolas, monospace; background: var(--accent-soft); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.inline-form { display: flex; gap: 8px; max-width: 420px; }

/* board */
.board-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-msg { margin: 80px auto; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); }
.bbar { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: #fff; flex-wrap: wrap; }
.btitle { font-size: 18px; font-weight: 700; padding: 3px 8px; border-radius: 6px; cursor: pointer; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btitle:hover { background: rgba(255, 255, 255, .2); }
.btitle-edit { width: 280px !important; font-size: 18px; font-weight: 700; padding: 3px 8px !important; }
.bbtn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; color: #fff; font-weight: 500; white-space: nowrap; }
.bbtn:hover { background: rgba(255, 255, 255, .2); }
.bbtn.on { background: #fff; color: #16181d; }
.bbtn.icon.on { background: none; color: #ffd23f; }
.bbtn .count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; font-size: 11px; padding: 0 5px; }
.bchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; background: rgba(0, 0, 0, .25); padding: 3px 9px; border-radius: 99px; }
.bchip.warn { background: #fab219; color: #0b0b0b; font-weight: 600; }
.views { display: flex; gap: 2px; margin-left: 8px; background: rgba(0, 0, 0, .18); padding: 3px; border-radius: 8px; }
.views .bbtn { padding: 4px 10px; }
.bbar .avs .av + .av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }

.kanban { flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 10px; padding: 4px 12px 12px; overflow-x: auto; overflow-y: hidden; }
.list, .list-ph, .add-list { width: 284px; flex: none; }
.list { max-height: 100%; display: flex; flex-direction: column; background: var(--list); border-radius: 12px; padding: 8px; }
.list.dragging { opacity: .35; }
.list-ph { border-radius: 12px; background: rgba(0, 0, 0, .25); }
.list-head { display: flex; align-items: center; gap: 6px; padding: 2px 2px 8px 6px; cursor: grab; }
.list-head h3 { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; cursor: pointer; padding: 3px 0; }
.list-title-edit { flex: 1; padding: 3px 6px !important; font-weight: 600; }
.list-count { font-size: 12px; color: var(--muted); padding: 0 4px; }
.cards { flex: 1; min-height: 4px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 1px 2px 2px; margin: 0 -2px; scrollbar-width: thin; }
.card { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); cursor: pointer; flex: none; overflow: hidden; }
.card:hover { box-shadow: var(--shadow), 0 0 0 2px var(--accent); }
.card.dragging { opacity: .3; }
.card-ph { border-radius: 8px; background: rgba(128, 128, 128, .28); flex: none; }
.card-cover { display: block; width: 100%; height: 130px; object-fit: cover; }
.card-cover.color { height: 34px; }
.card-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.card-title { display: flex; gap: 7px; align-items: flex-start; overflow-wrap: anywhere; }
.is-done .card-title span { color: var(--muted); }
.tick { width: 17px; height: 17px; margin-top: 1.5px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; display: grid; place-items: center; color: #fff; opacity: .55; }
.tick:hover { opacity: 1; border-color: var(--ok); }
.tick.on { background: var(--ok); border-color: var(--ok); opacity: 1; }
:root[data-theme=dark] .tick.on { color: #06210f; }
.tick.big { width: 24px; height: 24px; margin-top: 5px; }
.card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); border-radius: 4px; }
.badge.ok { color: var(--ok); font-weight: 600; }
.badge.field { background: var(--surface-2); padding: 1px 6px; max-width: 200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.badge.due { padding: 1px 6px; background: var(--surface-2); }
.badge.due.overdue { background: var(--bad-soft); color: var(--bad-ink); font-weight: 600; }
.badge.due.soon { background: var(--warn-soft); color: var(--warn-ink); font-weight: 600; }
.badge.due.done { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.add-card, .add-list-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px; margin-top: 6px; border-radius: 8px; color: var(--ink-2); }
.add-card:hover { background: rgba(128, 128, 128, .18); color: var(--ink); }
.add-list-btn { margin: 0; padding: 12px; background: rgba(255, 255, 255, .22); color: #fff; font-weight: 500; border-radius: 12px; }
.add-list-btn:hover { background: rgba(255, 255, 255, .32); }
.add-list .composer { background: var(--list); padding: 8px; border-radius: 12px; margin: 0; }
.composer { margin-top: 6px; }
.composer-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }

/* view panels */
.view-panel { flex: 1; min-height: 0; margin: 4px 12px 12px; background: var(--surface); border-radius: 12px; overflow: auto; }
.view-empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.view-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; flex-wrap: wrap; position: sticky; left: 0; }
.view-bar h2 { font-size: 16px; margin-left: 6px; }
.view-bar select { width: auto; padding: 4px 8px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-size: 12px; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
.tbl th.sorted { color: var(--ink); } .sort { font-size: 9px; margin-left: 4px; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; } .tbl tbody tr:hover { background: var(--surface-2); }
.tbl .tight { width: 36px; } .tbl .strong { font-weight: 600; min-width: 220px; } .tbl .struck { color: var(--muted); } .nowrap { white-space: nowrap; }
select.quiet { border-color: transparent; background: transparent; padding: 4px 6px; width: auto; max-width: 180px; }
select.quiet:hover { border-color: var(--line); }

.cal { display: flex; flex-direction: column; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--line); flex: 1; }
.cal-grid.head { flex: none; }
.cal-wd { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cal-day { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--surface-2); } .cal-day.other .cal-num { color: var(--muted); }
.cal-day.over { background: var(--accent-soft); }
.cal-num { font-size: 12px; font-weight: 600; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); }
.cal-card { display: flex; align-items: center; gap: 5px; width: 100%; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); font-size: 12px; }
.cal-card:hover { background: var(--hover); }
.cal-card.overdue { background: var(--bad-soft); color: var(--bad-ink); } .cal-card.soon { background: var(--warn-soft); color: var(--warn-ink); }
.cal-card.done { color: var(--muted); text-decoration: line-through; }

.tl { display: flex; flex-direction: column; overflow: hidden; }
.tl-scroll { flex: 1; overflow: auto; border-top: 1px solid var(--line); }
.tl-head, .tl-group { display: flex; }
.tl-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.tl-side { width: 180px; flex: none; position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); padding: 8px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.tl-days { display: flex; }
.tl-day { text-align: center; padding: 4px 0; flex: none; }
.tl-day small, .tl-day b { display: block; } .tl-day b { font-size: 12px; font-weight: 600; width: 22px; height: 22px; line-height: 22px; margin: 0 auto; border-radius: 50%; }
.tl-day.we { background: var(--surface-2); } .tl-day.today b { background: var(--accent); color: var(--accent-ink); }
.tl-group { border-bottom: 1px solid var(--line); }
.tl-lane { position: relative; padding: 5px 0; background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px); }
.tl-row { position: relative; height: 28px; } .tl-row.empty { height: 22px; }
.tl-bar { position: absolute; top: 2px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--lc, var(--series-1)); color: var(--lct, #fff); font-size: 12px; font-weight: 600; display: flex; align-items: center; z-index: 1; }
.tl-bar.plain { background: var(--series-1); color: #fff; }
.tl-bar.done { opacity: .55; text-decoration: line-through; }
.tl-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .tl-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-bar:hover { filter: brightness(.94); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .7; }

.dash { padding: 16px; background: var(--bg); }
.dash > .sub { margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat, .chart { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 14px 16px; }
.stat span { display: block; font-size: 13px; color: var(--ink-2); } .stat b { display: block; font-size: 30px; font-weight: 650; line-height: 1.2; } .stat small { display: block; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.chart h3 { font-size: 14px; margin-bottom: 2px; } .chart .sub { font-size: 12px; }
.bars { margin-top: 12px; display: flex; flex-direction: column; border-left: 1px solid var(--grid); margin-left: 150px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; margin-left: -151px; padding: 5px 0; border-radius: 4px; }
.bar-row:hover { background: var(--surface-2); }
.bar-name { padding-right: 10px; font-size: 13px; color: var(--ink-2); text-align: right; }
.bar-name .dotc { margin-right: 6px; }
.bar-track { height: 14px; }
.bar-fill { height: 100%; min-width: 3px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; padding-right: 4px; }
#tip { position: fixed; z-index: 100; pointer-events: none; background: #16181d; color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }

/* card modal */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .6); overflow-y: auto; padding: 44px 16px 60px; }
.modal { position: relative; width: 800px; max-width: 100%; margin: 0 auto; background: var(--surface); border-radius: 12px; box-shadow: var(--pop-shadow); padding-bottom: 20px; }
.modal.small { width: 420px; padding: 24px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.modal-cover { height: 150px; border-radius: 12px 12px 0 0; overflow: hidden; background: var(--surface-2); }
.modal-cover.color { height: 76px; }
.modal-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.modal-x { position: absolute; top: 10px; right: 10px; background: var(--surface); border-radius: 50%; z-index: 2; }
.banner { display: flex; align-items: center; gap: 8px; background: var(--warn-soft); color: var(--warn-ink); padding: 10px 20px; font-weight: 500; }
.modal-head { display: flex; gap: 10px; padding: 18px 56px 4px 20px; }
.modal-title { font-size: 20px; font-weight: 700; border-color: transparent !important; background: transparent !important; padding: 2px 6px !important; margin-left: -6px; resize: none; overflow: hidden; line-height: 1.3; }
.modal-title:focus { background: var(--surface) !important; border-color: var(--accent) !important; }
.in-list { color: var(--muted); font-size: 13px; }
.modal-cols { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 20px; padding: 8px 20px 0; }
.modal-main { min-width: 0; }
.modal-side { display: flex; flex-direction: column; gap: 6px; }
.modal-side h4 { font-size: 12px; color: var(--ink-2); margin: 8px 0 2px; }
.side-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 6px; background: var(--surface-2); font-weight: 500; cursor: pointer; }
.side-btn:hover { background: var(--hover); } .side-btn.danger { color: var(--danger); }
.meta { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-bottom: 4px; }
.meta-item > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.round-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; } .round-btn:hover { background: var(--hover); }
.date-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 6px; background: var(--surface-2); font-weight: 500; } .date-chip:hover { background: var(--hover); }
.pill { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.bad { background: var(--bad-soft); color: var(--bad-ink); } .pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.sec { margin-top: 22px; }
.sec h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 10px; }
.md { overflow-wrap: anywhere; cursor: text; }
.md p, .md ul, .md h4 { margin: 0 0 8px; } .md ul { padding-left: 20px; } .md > :last-child { margin-bottom: 0; }
.md code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.mention { background: var(--accent-soft); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.placeholder { width: 100%; min-height: 56px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); display: block; }
.placeholder:hover { background: var(--hover); }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; align-items: end; }
.att { display: flex; gap: 12px; padding: 6px 0; }
.att-thumb { width: 96px; height: 68px; border-radius: 6px; background: var(--surface-2); flex: none; display: grid; place-items: center; overflow: hidden; text-decoration: none; color: var(--ink-2); font-weight: 700; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-info { min-width: 0; } .att-info b { display: block; overflow-wrap: anywhere; } .att-info small { display: block; }
.att-actions { display: flex; gap: 12px; margin-top: 3px; }
.progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.progress span { width: 34px; }
.progress .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress .fill { height: 100%; background: var(--series-1); border-radius: 99px; transition: width .15s; } .progress .fill.ok { background: var(--ok); }
.item { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; margin-left: -6px; }
.item:hover { background: var(--surface-2); }
.item-text { cursor: text; overflow-wrap: anywhere; } .item.done .item-text { color: var(--muted); text-decoration: line-through; }
.item .ghost { opacity: 0; } .item:hover .ghost, .item .ghost:focus-visible { opacity: 1; }
.item-add { margin-top: 6px; }
.comment-box { display: flex; gap: 10px; margin-bottom: 14px; }
.comment-box .btn { margin-top: 6px; }
.act { display: flex; gap: 10px; margin-bottom: 14px; }
.act.small { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; align-items: flex-start; } .act.small b { color: var(--ink); }
.bubble { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-top: 3px; cursor: default; }

/* drawer */
.drawer { position: fixed; top: 50px; right: 0; bottom: 0; width: 370px; max-width: 100vw; z-index: 20; background: var(--surface); box-shadow: var(--pop-shadow); overflow-y: auto; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.drawer-body { padding: 12px 14px 30px; }
.drawer-body > div > .sub { margin-bottom: 10px; }
.box { background: var(--surface-2); border-radius: 10px; padding: 12px; margin: 12px 0; }
.box h4 { margin-bottom: 8px; } .box select { margin-bottom: 6px; }
.rule-action { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .rule-action select { margin: 0; }
.rule-preview { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 4px; }
.inline-num { display: flex; align-items: center; gap: 6px; white-space: nowrap; } .inline-num input { width: 70px; }
.seg { display: flex; background: var(--surface-2); border-radius: 8px; padding: 3px; margin-bottom: 8px; }
.seg button { flex: 1; text-align: center; padding: 6px; border-radius: 6px; font-weight: 500; } .seg button.on { background: var(--surface); box-shadow: var(--shadow); }

/* toasts */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #16181d; color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); max-width: 80vw; }
.toast.err { background: #a1261f; }

@media (max-width: 760px) {
  .modal-cols { grid-template-columns: 1fr; }
  .top-link, .views .bbtn span.ic + *, .bchip { display: none; }
  .search { width: auto; flex: 1; }
  .overlay { padding: 12px 6px 40px; }
}

/* rating & label tracker */
.stars { display: flex; gap: 2px; }
.star { display: grid; padding: 3px; border-radius: 4px; color: var(--muted); }
.star:hover { background: var(--surface-2); }
.star.on, .badge.rating .ic, .stars-txt { color: #d99a00; }
.stars-txt { letter-spacing: 1px; }
.chart.wide { grid-column: 1 / -1; }
.label-tbl { margin-top: 10px; }
.label-tbl th { cursor: default; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.tbl td.num.bad { color: var(--bad-ink); font-weight: 700; }
.tbl td.num.warn { color: var(--warn-ink); font-weight: 700; }
.tbl td.num.ok { color: var(--ok); font-weight: 600; }

.code { font: 12px/1.4 ui-monospace, Consolas, monospace; white-space: pre; overflow: auto; margin-bottom: 6px; }
.cal-card.multi.cont { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-card.multi.more { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-card.multi { box-shadow: inset 3px 0 0 var(--accent); }
.cal-dayno { margin-left: auto; opacity: .7; font-size: 10px; flex: none; }
.mention { cursor: pointer; }
.mention:hover { text-decoration: underline; }
.mention-list { position: fixed; z-index: 90; width: 280px; max-height: 240px; overflow: auto; background: var(--surface); color: var(--ink); border-radius: 10px; box-shadow: var(--pop-shadow); padding: 4px; }
.mention-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 6px; text-align: left; }
.mention-item.on, .mention-item:hover { background: var(--hover); }
.mention-item small { color: var(--muted); }
.profile-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.profile-name { font-weight: 700; font-size: 16px; }
.warn-line { color: var(--warn-ink); margin-top: 4px; }
