/* Base reset (the design was previewed inside a page skeleton that provided these) */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-size: 14px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

/* Layout: left rail (Spaces, Editor, Calendar, Work List) + month-scoped main view; board cards carry exactly four facts: project, category, assignee, due date.
   The app is dark only. */
:root {
  --bg: #11151b; --rail: #161b23; --surface: #1d232d; --line: #2c3442;
  --fg: #e7ebf1; --muted: #9aa5b5; --accent: #7d9bff; --accent-soft: #232f4d; --on-accent: #0d1220;
  --late: #ff7a6e; --late-soft: #3a2020; --today: #f0b24a;
  --shadow: 0 1px 2px rgba(0,0,0,.35); --pop-shadow: 0 10px 30px rgba(0,0,0,.5);
  /* iPhone look: Apple devices use their own SF Pro; elsewhere Inter (the closest free match) */
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: var(--body); /* numbers use the same font with even-width digits */
  color-scheme: dark;
}
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px; box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
/* type weights, iOS style: 400 for reading text, 500 for names, labels and buttons, 600 only for titles */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; letter-spacing: -0.006em; }
b, strong { font-weight: 500; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; }
.space-btn .count, .col-head .n, .due, .dnum, .kv .late-tag, .code-box, .wl-n, .set-n, .set-h span, .col-tabs button b, .picker-year select { font-variant-numeric: tabular-nums; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  display: grid; grid-template-columns: 236px minmax(0, 1fr);
  height: 100%; min-height: 560px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface);
}

/* Sidebar */
.rail { background: var(--rail); border-right: 1px solid var(--line); padding: 18px 12px 12px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.15; text-wrap: balance; }
.nav-btn, .space-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 7px; font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.nav-btn { font-weight: 400; }
.nav-btn svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.space-btn .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.space-btn .count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 500; }
.nav-btn:hover, .space-btn:hover { background: var(--accent-soft); }
.nav-btn[aria-current="true"], .cat-btn[aria-current="true"], .space-btn[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.nav-btn[aria-current="true"] svg { color: var(--accent); }
.spaces { display: flex; flex-direction: column; gap: 8px; }
.space { display: flex; flex-direction: column; gap: 2px; }
.cats { display: flex; flex-direction: column; gap: 1px; padding-left: 17px; }
.cat-btn { background: none; border: 0; text-align: left; padding: 5px 8px; border-radius: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.cat-btn:hover { color: var(--fg); background: var(--accent-soft); }
.space:not(.open) .cats { display: none; }
body.is-member .admin-only { display: none !important; }
body.is-member .me { margin-top: auto; }
.ctx-menu { position: fixed; z-index: 70; min-width: 160px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--pop-shadow); padding: 4px; }
.ctx-menu button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 8px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 500; text-align: left; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--accent-soft); color: var(--accent); }
.ctx-menu svg { width: 15px; height: 15px; }
.danger-zone { display: flex; align-items: center; gap: 12px; justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.danger-zone b { display: block; font-size: 13.5px; }
.danger-zone small { font-size: 12px; color: var(--muted); }
.danger-zone .danger-outline { margin-top: 0; padding: 0 14px; }
.soon { color: var(--late); font-weight: 500; }
.rail-item { position: relative; display: flex; align-items: center; min-width: 0; }
.rail-item > .space-btn, .rail-item > .cat-btn { flex: 1; min-width: 0; }
.rail-item:hover .space-btn .count, .rail-item:focus-within .space-btn .count { visibility: hidden; }
.del-btn { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 0; background: none; border-radius: 6px; color: var(--muted); padding: 0; opacity: 0; }
.rail-item > .del-btn { position: absolute; right: 2px; }
.del-btn svg { width: 15px; height: 15px; }
.rail-item:hover .del-btn, .rail-item:focus-within .del-btn, .del-btn.show, .del-btn:focus-visible { opacity: 1; }
.del-btn:hover { color: var(--late); background: var(--late-soft); }
@media (hover: none) { .del-btn { opacity: 1; } }
.comment { position: relative; }
.comment .del-btn { margin-left: auto; }
.danger { background: var(--late); color: #fff; border: 0; border-radius: 8px; height: 38px; padding: 0 16px; font-weight: 500; font-size: 13.5px; }
.danger-outline { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 1px solid var(--line); background: none; color: var(--late); border-radius: 8px; font-weight: 500; font-size: 13px; }
.danger-outline svg { width: 15px; height: 15px; }
.danger-outline:hover { background: var(--late-soft); border-color: var(--late); }
.link-btn.danger-link { color: var(--late); margin-left: 0; }
.confirm-text { margin: -4px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.rail-row { display: flex; align-items: center; justify-content: space-between; }
.add-btn { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 15px; line-height: 1; display: grid; place-items: center; padding: 0; }
.add-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.cat-add { background: none; border: 0; text-align: left; padding: 5px 8px; border-radius: 6px; font-size: 12.5px; color: var(--accent); font-weight: 500; white-space: nowrap; }
.cat-add:hover { background: var(--accent-soft); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; padding: 0; }
.swatches button[aria-pressed="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 2px var(--surface); }
.rail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 8px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text b { font-size: 13px; }
.me-text small { font-size: 11.5px; color: var(--muted); }
.me-btn { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 4px; margin: -4px; border-radius: 8px; text-align: left; min-width: 0; }
.me-btn:hover { background: var(--accent-soft); }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.av.xl { width: 72px; height: 72px; font-size: 24px; }
.photo-row { display: flex; align-items: center; gap: 16px; }
.photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.upload { display: inline-flex; align-items: center; cursor: pointer; color: var(--fg); }
.photo-actions .link-btn { margin: 0; padding: 4px 0; font-size: 12.5px; }
.field input[readonly] { color: var(--muted); cursor: not-allowed; border-style: dashed; }
.locked { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 12px; color: var(--muted); }
.locked svg { width: 13px; height: 13px; flex: none; }
.me-text b, .me-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.crumb { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crumb small { color: var(--muted); font-size: 12px; }
.crumb h1 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 600; text-wrap: balance; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.month { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; position: relative; }
.month button { background: none; border: 0; width: 30px; height: 30px; border-radius: 6px; font-size: 16px; color: var(--muted); }
.month button:hover { background: var(--accent-soft); color: var(--fg); }
.month .month-label { width: auto; min-width: 150px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; font-weight: 500; font-size: 13.5px; color: var(--fg); }
.month .month-label svg { width: 15px; height: 15px; color: var(--accent); }
.month .month-label[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.picker { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(272px, calc(100vw - 40px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--pop-shadow); z-index: 20; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.picker-year { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.month .picker-year button { width: 32px; height: 32px; }
.picker-year select { flex: 1; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); text-align: center; font-weight: 500; font-family: var(--mono); padding: 0 6px; }
.picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.month .picker-grid button { width: auto; height: 36px; font-size: 13px; color: var(--fg); position: relative; }
.month .picker-grid button.now::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.month .picker-grid button[aria-current="true"] { background: var(--accent); color: var(--on-accent); font-weight: 500; }
.month .picker-grid button[aria-current="true"]::after { background: var(--on-accent); }
.month .picker-today { width: auto; height: 32px; font-size: 12.5px; color: var(--accent); font-weight: 500; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; padding-top: 2px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--late); color: #fff; font-size: 11px; font-weight: 500; display: grid; place-items: center; }
.primary { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 8px; padding: 0 14px; height: 38px; font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.primary svg { width: 16px; height: 16px; }
.ghost { background: none; border: 1px solid var(--line); border-radius: 8px; height: 38px; padding: 0 14px; font-weight: 500; font-size: 13.5px; }
.ghost:hover { background: var(--accent-soft); }
.view { flex: 1; min-height: 0; background: var(--bg); }

/* Board */
/* Columns share the width (min 186px) so all 7 fit on a ~1600px+ screen; smaller screens scroll sideways. */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(186px, 1fr); gap: 8px; padding: 14px 14px; overflow-x: auto; overflow-y: hidden; align-items: start; }
.col { display: flex; flex-direction: column; gap: 9px; max-height: 100%; min-height: 120px; border-radius: 10px; padding: 6px; transition: background .15s; min-width: 0; }
.col.drop { background: var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 6px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.col-head .n { font-family: var(--mono); color: var(--muted); font-weight: 500; }
.col-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 60px; }
.empty { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* Card: project, category, assignee, due. Nothing else. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 10px; cursor: grab; min-width: 0; min-height: 118px; }
.card:hover { border-color: var(--accent); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .45; }
.card-title { margin: 0; font-weight: 500; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.card-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.card-cat i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-top: 10px; margin-top: auto; border-top: 1px solid var(--line); }
.card-foot .due { font-size: 11px; }
.who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 500; color: #fff; flex: none; }
.av.lg { width: 32px; height: 32px; font-size: 12px; }
.who-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.late { color: var(--late); }
.due.today { color: var(--today); }

/* Calendar */
.calendar { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; padding: 16px 18px; overflow-y: auto; align-items: start; height: 100%; }
.cal-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); min-width: 660px; }
.cal-wd { padding: 8px 10px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--line); }
.day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day.other { background: var(--bg); }
.day.other .dnum { color: var(--muted); opacity: .6; }
.dnum { font-family: var(--mono); font-size: 12px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.day.is-today .dnum { background: var(--accent); color: var(--on-accent); }
.chip { display: flex; align-items: center; gap: 5px; width: 100%; background: var(--bg); border: 0; border-radius: 5px; padding: 3px 6px; font-size: 11.5px; text-align: left; min-width: 0; }
.chip:hover { background: var(--accent-soft); }
.chip i { width: 6px; height: 6px; border-radius: 2px; flex: none; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.done span { text-decoration: line-through; color: var(--muted); }
.more { font-size: 11px; color: var(--muted); padding-left: 6px; background: none; border: 0; text-align: left; }
.agenda { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.agenda-head small { display: block; color: var(--muted); font-size: 12px; }
.agenda-head b { font-family: var(--display); font-size: 18px; }
.agenda h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.agenda h3.late { color: var(--late); }
.agenda h3.today { color: var(--today); }
.agenda ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-item { width: 100%; text-align: left; background: var(--bg); border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.ag-item:hover { border-color: var(--accent); }
.ag-item b { font-size: 13px; font-weight: 500; }
.ag-item small { font-size: 11.5px; color: var(--muted); }
.ag-none { font-size: 12.5px; color: var(--muted); }

/* Notifications page */
.notif-page { padding: 16px 18px; overflow-y: auto; height: 100%; }
.notif-card { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.notif-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 8px; }
.tabs button { background: none; border: 0; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.link-btn { margin-left: auto; background: none; border: 0; color: var(--accent); font-weight: 500; font-size: 13px; padding: 6px; }
.n-group { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 4px 0; }
.n-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.n-item { width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left; background: none; border: 0; padding: 10px 8px; border-radius: 8px; }
.n-item:hover { background: var(--accent-soft); }
.n-item .n-text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.4; }
.n-item .n-text small { display: block; font-size: 12px; color: var(--muted); }
.n-item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.n-item.read .unread-dot { visibility: hidden; }
.n-item.read .n-text { color: var(--muted); }

/* Bell popover */
.bell-wrap { position: relative; }
.pop { position: absolute; top: 46px; right: 0; width: min(320px, calc(100vw - 40px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--pop-shadow); z-index: 20; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.pop h2 { margin: 4px 8px; font-size: 13px; }
.pop .n-item { padding: 8px; }
.pop .see-all { margin: 0; border-top: 1px solid var(--line); border-radius: 0; padding-top: 8px; text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; background: var(--fg); color: var(--surface); padding: 11px 16px; border-radius: 9px; font-size: 13px; max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Dialogs */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--fg); }
dialog::backdrop { background: rgba(10,14,20,.45); }
.dlg { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.dlg h2 { margin: 0; font-family: var(--display); font-size: 19px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field input, .field select { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--bg); font-weight: 400; font-size: 14px; color: var(--fg); }
.field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--bg); font-weight: 400; font-size: 14px; line-height: 1.45; color: var(--fg); resize: vertical; min-height: 92px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Task details */
dialog.detail { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.d-wrap { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.d-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.d-head small { color: var(--muted); font-size: 12.5px; }
.d-close { margin-left: auto; width: 32px; height: 32px; border: 0; background: none; border-radius: 7px; font-size: 20px; color: var(--muted); }
.d-close:hover { background: var(--accent-soft); color: var(--fg); }
.d-close + .d-close { margin-left: 0; }
.d-full { display: grid; place-items: center; }
.d-full svg { width: 16px; height: 16px; }
.d-full .ic-shrink, dialog.detail.full .d-full .ic-expand { display: none; }
dialog.detail.full .d-full .ic-shrink { display: block; }
dialog.detail.full { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border: 0; border-radius: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
dialog.detail.full .d-wrap { height: 100%; max-height: none; }
dialog.detail.full .d-body { flex: 1; grid-template-columns: minmax(0, 1fr) 320px; }
.d-view { display: flex; flex-direction: column; gap: 22px; }
.d-title-row { display: flex; align-items: flex-start; gap: 12px; }
.d-title-row h2 { flex: 1; }
.edit-btn { height: 32px; padding: 0 12px; font-size: 13px; flex: none; }
.d-editform { display: flex; flex-direction: column; gap: 14px; }
.d-editform textarea { min-height: 160px; }
.d-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; min-height: 0; overflow-y: auto; }
.d-main { padding: 20px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.d-main h2 { margin: 0; font-family: var(--display); font-size: 24px; text-wrap: balance; overflow-wrap: anywhere; }
.d-sec h3 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.d-desc { margin: 0; font-size: 14px; line-height: 1.65; white-space: pre-wrap; max-width: 62ch; font-weight: 350; color: var(--fg); color: color-mix(in srgb, var(--fg) 72%, var(--muted)); }
.d-desc .dh { font-weight: 500; color: var(--fg); letter-spacing: -0.005em; }
.d-desc .dk { font-weight: 400; color: var(--fg); }
.d-desc strong, .comment-body p strong { font-weight: 500; color: var(--fg); }
.mention { color: var(--accent); font-weight: 400; }
.d-desc.empty-text { color: var(--muted); }
.comments { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment-body { min-width: 0; }
.comment-body b { font-size: 13px; }
.comment-body small { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.comment-body p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.c-form { display: flex; gap: 8px; }
.c-form input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--bg); }
.d-side { border-left: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 18px; background: var(--rail); }
.d-side .field select { background: var(--surface); }
.assignee-box { display: flex; flex-direction: column; gap: 10px; }
.notify-btn { width: 100%; height: 42px; font-size: 14px; }
.kv { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kv span { font-weight: 500; font-size: 14px; color: var(--fg); display: flex; align-items: center; gap: 6px; }
.kv span i { width: 8px; height: 8px; border-radius: 2px; }
.kv .late-tag { color: var(--late); font-size: 12px; font-family: var(--mono); }

/* Login */
.login { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.login-form-wrap { display: grid; place-items: center; padding: 36px max(24px, env(safe-area-inset-right, 0px)) 36px 24px; }
.login-form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-form h2 { margin: 0; font-family: var(--display); font-size: 26px; }
.login-form > p { margin: -8px 0 4px; color: var(--muted); font-size: 13.5px; }
.login-form .primary { height: 42px; }
.login-note { font-size: 12.5px; color: var(--muted); text-align: center; }
.login-error { margin: 0; font-size: 12.5px; color: var(--late); }
.text-link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; font-size: inherit; }
.text-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .calendar { grid-template-columns: 1fr; }
  .d-body { grid-template-columns: 1fr; }
  .d-side { border-left: 0; border-top: 1px solid var(--line); order: -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Additions for the live app */
.pw-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.pw-box summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--accent); }
.pw-box[open] { display: flex; flex-direction: column; gap: 12px; }
.code-box { font-family: var(--mono); font-size: 22px; letter-spacing: .12em; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; text-align: center; color: var(--fg); margin: 8px 0; user-select: all; }
.offline { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); background: var(--late); color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; z-index: 80; }

/* Sign-in: faded photo behind, black shade on top, one tall panel holding the name and the forms */
.login {
  grid-template-columns: 1fr; grid-template-rows: 1fr; place-items: center; overflow-y: auto;
  background: #000;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  /* the sign-in screen is always dark, whatever the device theme */
  --fg: #f2f4f8; --muted: rgba(242, 244, 248, .72); --bg: rgba(255, 255, 255, .08); --line: rgba(255, 255, 255, .2);
  --surface: transparent; --accent: #8fa8ff; --on-accent: #0b0e14; --late: #ff8f84; --accent-soft: rgba(143, 168, 255, .16);
  color: var(--fg); color-scheme: dark;
}
.login-bg { position: fixed; inset: 0; background: url("/login-bg.webp") center / cover no-repeat; opacity: .5; }
.login-shade { position: fixed; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .15) 30%, rgba(0, 0, 0, .1) 65%, rgba(0, 0, 0, .45) 100%); }
.login-card {
  position: relative; width: min(420px, 100%); min-height: min(640px, calc(100vh - 48px));
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
  padding: 40px 32px; border-radius: 20px;
  background: rgba(12, 15, 22, .55); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.login-title { margin: 0; text-align: center; font-family: var(--display); font-weight: 600; font-size: clamp(26px, 4vw, 32px); line-height: 1.12; letter-spacing: -.01em; text-wrap: balance; color: #fff; }
.login-card .login-form-wrap { display: block; padding: 0; }
.login-card .login-form { width: 100%; }
.login-card .field input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }
.login-card .field input::placeholder { color: rgba(255, 255, 255, .45); }
.login-card .field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(143, 168, 255, .25); }
.login-card .ghost { color: #fff; }
@media (max-width: 780px) {
  .login { grid-template-rows: 1fr; }
  .login-card { padding: 32px 22px; min-height: auto; }
}

/* Sign-in panel sits on the right so the people in the middle of the photo stay visible (phones keep it centered) */
@media (min-width: 781px) {
  .login { place-items: center end; padding-right: max(6vw, 24px, env(safe-area-inset-right, 0px)); }
}

/* ================= Phone layout (≤ 780px wide) ================= */
.menu-btn, .col-tabs, .cat-filter, .rail-shade, .sheet-handle { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mv-list { display: flex; flex-direction: column; gap: 6px; }
.mv-list button { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent; background: var(--rail); color: var(--fg); font-size: 16px; text-align: left; }
.mv-list button i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mv-list button span { flex: 1; }
.mv-list button small { font-size: 12.5px; color: var(--muted); }
.mv-list button[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
#moveDlg h2 { font-size: 20px; line-height: 1.25; }

@media (max-width: 780px) {
  body { padding: 0; }
  .app { display: block; height: 100dvh; min-height: 0; border: 0; border-radius: 0; }
  .main { height: 100dvh; }

  /* sidebar becomes a slide-out menu */
  .rail {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: min(318px, 86vw);
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(0,0,0,.35);
    padding: calc(16px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  body.menu-open .rail { transform: none; }
  .rail-shade { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(5,7,10,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .rail-shade { opacity: 1; pointer-events: auto; }
  .nav-btn, .space-btn { min-height: 44px; font-size: 15px; }
  .cat-btn { min-height: 38px; font-size: 14px; }
  .cat-add { min-height: 38px; }
  .del-btn { opacity: 1; width: 34px; height: 34px; }
  .rail-item:hover .space-btn .count { visibility: visible; }
  .rail-item > .del-btn { position: static; }

  /* header: menu, title, bell on top; month + category below */
  .topbar { position: sticky; top: 0; z-index: 30; background: var(--rail); gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); flex-wrap: wrap; }
  .menu-btn { display: grid; flex: none; width: 44px; height: 44px; }
  .crumb { flex: 1; min-width: 0; flex-basis: auto; }
  .crumb h1 { font-size: 19px; }
  .top-actions { display: contents; }
  .bell-wrap { order: 1; }
  .icon-btn { width: 44px; height: 44px; }
  .month { order: 2; flex: none; }
  .month button { width: 40px; height: 40px; }
  .month .month-label { min-width: 0; padding: 0 6px; }
  .month .month-label svg { display: none; }
  .cat-filter { display: block; order: 3; flex: 1; min-width: 0; }
  .cat-filter select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--fg); padding: 0 10px; font-size: 15px; }
  #todayBtn { display: none; }
  .pop { display: none !important; }
  .picker { left: 0; transform: none; position: fixed; top: calc(118px + env(safe-area-inset-top, 0px)); left: 12px; }

  /* board: one column at a time, chosen by tabs or by swiping */
  .col-tabs:not([hidden]) { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 6px; background: var(--bg); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .col-tabs::-webkit-scrollbar { display: none; }
  .col-tabs button { flex: none; display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 14px; white-space: nowrap; }
  .col-tabs button i { width: 8px; height: 8px; border-radius: 50%; }
  .col-tabs button b { font-family: var(--mono); font-size: 12px; font-weight: 500; opacity: .75; }
  .col-tabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
  .view { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .board { display: block; overflow: visible; padding: 4px 12px 110px; }
  .board .col { padding: 0; min-height: 60vh; }
  .board .col:not(.active) { display: none; }
  .board .col-head { display: none; }
  .col-list { overflow: visible; gap: 10px; }
  .card { padding: 16px 14px 14px; gap: 10px; min-height: 0; border-radius: 14px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .card-title { font-size: 16px; }
  .card-cat { font-size: 13px; }
  .card-foot .av { width: 28px; height: 28px; font-size: 11px; }
  .who-name { font-size: 14px; }
  .card-foot .due { font-size: 12.5px; }
  .empty { padding: 28px 14px; }

  /* big round "New task" button */
  #newBtn { position: fixed; z-index: 35; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); height: 56px; padding: 0 22px; border-radius: 28px; font-size: 16px; box-shadow: 0 10px 28px rgba(0,0,0,.4); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  /* calendar: small month grid with dots, tap a day to see it */
  .calendar { display: flex; flex-direction: column; gap: 12px; padding: 10px 10px 30px; height: auto; }
  .cal-scroll { overflow: visible; }
  .cal { min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-wd { padding: 6px 0; text-align: center; font-size: 10.5px; }
  .day { min-height: 54px; padding: 4px 2px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 3px; border-right: 0; cursor: pointer; }
  .day .dnum { flex-basis: 100%; margin: 0 auto; width: 28px; height: 28px; }
  .day .chip { width: 6px; height: 6px; padding: 0; border-radius: 50%; background: none; }
  .day .chip i { width: 6px; height: 6px; border-radius: 50%; }
  .day .chip span, .day .more { display: none; }
  .day.picked { background: var(--accent-soft); border-radius: 10px; }
  .agenda { border-radius: 14px; }

  /* dialogs: task details, profile full screen; new task and move as bottom sheets */
  dialog.detail, dialog#profile { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
  dialog.detail .d-wrap { height: 100%; max-height: none; }
  dialog.detail .d-body { flex: 1; }
  #dFull { display: none; }
  .d-head { padding: 10px 12px; }
  .d-close { width: 44px; height: 44px; font-size: 24px; }
  .d-main { padding: 16px; }
  .d-main h2 { font-size: 22px; }
  .d-side { padding: 16px; gap: 14px; }
  .c-form input { height: 48px; border-radius: 24px; font-size: 16px; }
  dialog#profile .dlg { min-height: 100%; box-sizing: border-box; padding: 18px 16px 24px; }
  dialog#profile .dlg-actions { margin-top: auto; }
  dialog#profile .photo-row { flex-direction: column; }
  dialog#dlg, dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .sheet-handle { display: block; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
  dialog#dlg .dlg::before { content: ""; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
  .field input, .field select, .field textarea { font-size: 16px; } /* 16px stops phones zooming in */
  .field input, .field select { height: 46px; }
  .dlg-actions .primary, .dlg-actions .ghost, .dlg-actions .danger { height: 48px; flex: 1; }
  .row2 { grid-template-columns: 1fr; }

  /* lists */
  .notif-page { padding: 10px 10px 40px; }
  .notif-card { padding: 10px; }
  .n-item { padding: 12px 8px; }
}

/* Montage Motion logo */
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.login-logo { display: block; width: 76px; height: 76px; object-fit: contain; margin: 0 auto -10px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }

/* Phone: task details in the design's order — name, status/assignee/notify, details, comments, delete last */
@media (max-width: 780px) {
  dialog.detail .d-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 16px 28px; overflow-y: auto; }
  dialog.detail .d-main, dialog.detail .d-view, dialog.detail .d-side { display: contents; }
  dialog.detail .d-title-row { order: 1; }
  dialog.detail .d-side > * { order: 2; }
  dialog.detail #dView > .d-sec, dialog.detail #dEditForm { order: 3; }
  dialog.detail .d-main > .d-sec { order: 4; }
  dialog.detail #dDelete { order: 5; margin-top: 8px; height: 46px; }
}

/* ================= Computers & laptops: fit the 7 columns ================= */
@media (min-width: 781px) {
  .main { position: relative; }
  /* ☰ collapses the sidebar so the board gets the whole width */
  .menu-btn { display: grid; flex: none; }
  body.rail-collapsed .app { grid-template-columns: minmax(0, 1fr); }
  body.rail-collapsed .rail { display: none; }
  /* more compact columns before anything needs scrolling */
  .board { grid-auto-columns: minmax(150px, 1fr); }
  /* a scrollbar that is always visible when the columns don't fit */
  .board { scrollbar-width: auto; scrollbar-color: var(--muted) var(--bg); padding-bottom: 6px; }
  .board::-webkit-scrollbar { height: 12px; }
  .board::-webkit-scrollbar-track { background: var(--bg); }
  .board::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid var(--bg); }
  .board::-webkit-scrollbar-thumb:hover { background: var(--muted); }
  .board-arrow { position: absolute; top: 50%; z-index: 15; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: grid; place-items: center; box-shadow: var(--pop-shadow); }
  .board-arrow svg { width: 20px; height: 20px; }
  .board-arrow:hover { border-color: var(--accent); color: var(--accent); }
  .board-arrow.left { left: 8px; }
  .board-arrow.right { right: 8px; }
}
@media (min-width: 781px) and (max-width: 1500px) {
  .board { grid-auto-columns: minmax(136px, 1fr); gap: 6px; padding-inline: 10px; }
  .card { padding: 10px 10px 10px; }
  .card-title { font-size: 13px; }
  .card-foot { flex-wrap: wrap; row-gap: 4px; }
}
@media (max-width: 780px) { .board-arrow { display: none !important; } }


/* Phone header: short month, and a category box that's always big enough to read */
@media (max-width: 780px) {
  .month { flex: none; }
  .month .month-label { font-size: 15px; padding: 0 4px; }
  .cat-filter { flex: 1 1 150px; min-width: 150px; }
  .cat-filter select { height: 42px; font-size: 15px; text-overflow: ellipsis; }
}

/* Day/Month/Year date boxes: our text underneath, the real (invisible) date box on top */
.date-wrap { position: relative; display: inline-flex; min-width: 170px; }
.field .date-wrap { display: flex; }
.date-text { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font-weight: 400; font-size: 14px; font-variant-numeric: tabular-nums; }
.date-text svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.date-wrap input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; margin: 0; }
.date-wrap:focus-within .date-text { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.d-side .date-text { background: var(--surface); height: 36px; }
@media (max-width: 780px) { .date-text { height: 46px; font-size: 16px; } }

/* Password box with a show/hide eye on the right */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; min-width: 0; padding-right: 44px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 0; }
.pw-eye:hover { color: var(--fg); }
.pw-eye svg { width: 18px; height: 18px; }
.login-card .pw-eye { color: rgba(255, 255, 255, .6); }
.login-card .pw-eye:hover { color: #fff; }

/* Several people on one task */
.av-stack { display: flex; flex: none; }
.av-stack .av { box-shadow: 0 0 0 2px var(--surface); }
.av-stack .av + .av { margin-left: -8px; }
.people { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.person-chip { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 3px 3px 3px 6px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.person-chip b { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-x { width: 30px; height: 30px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; padding: 0; }
.chip-x:hover { color: var(--late); background: var(--late-soft); }
.people .add-person { height: 38px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--accent); font-weight: 500; font-size: 14px; padding: 0 10px; cursor: pointer; }
.people .add-person option { color: var(--fg); background: var(--surface); }
.d-side .person-chip { background: var(--surface); }
@media (max-width: 780px) {
  .person-chip { min-height: 46px; font-size: 16px; }
  .chip-x { width: 40px; height: 40px; }
  .people .add-person { height: 46px; font-size: 16px; }
}
/* the people come first on a card: if they don't fit beside the date, the date drops to the next line */
.card-foot { flex-wrap: wrap; row-gap: 6px; }
.card-foot .who { flex-shrink: 0; max-width: 100%; }
.av-more { margin-left: 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.who-names { order: 3; flex-basis: 100%; font-size: 12.5px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 780px) { .who-names { font-size: 14px; } }
.av-empty { border: 1.5px dashed var(--muted); box-sizing: border-box; background: none; }
.who.nobody .who-name { color: var(--muted); font-weight: 500; }

/* links inside task details */
.text-link { color: #4da3ff; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.text-link:hover { color: #7dbcff; }
.text-link:visited { color: #9b8cff; }
/* links inside written text: plain blue, regular weight, underline only on hover */
a.text-link { font-weight: 400; text-decoration: none; color: #5aa9ff; }
a.text-link:visited { color: #5aa9ff; }
a.text-link:hover { text-decoration: underline; color: #7dbcff; }

/* ---------- Work List: the month's tasks as a list, by category, then by status ---------- */
.worklist { display: flex; flex-direction: column; gap: 16px; padding: 16px 18px 28px; overflow-y: auto; height: 100%; box-sizing: border-box; }
.wl-block { background: var(--rail); border: 1px solid var(--line); border-left: 3px solid var(--sp); border-radius: 10px; padding: 14px 18px 8px; }
.wl-head small { display: block; margin-left: 24px; font-size: 12px; color: var(--muted); }
.wl-fold { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; color: var(--fg); font: inherit; cursor: pointer; }
.wl-fold svg { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform .15s; }
.wl-fold[aria-expanded="false"] svg { transform: rotate(-90deg); }
.wl-title { margin-top: 2px; font-size: 17px; font-weight: 600; gap: 6px; }
.wl-title .wl-n { margin-left: 4px; }
.wl-group { margin-top: 16px; }
.wl-pill { background: var(--c); color: #fff; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 6px; }
.wl-n { color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.wl-table { margin: 6px 0 0 26px; }
.wl-cols, .wl-row { display: grid; grid-template-columns: minmax(0, 1fr) 230px 110px 150px; gap: 14px; align-items: center; }
.wl-cols { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.wl-row { width: 100%; min-height: 46px; padding: 8px 10px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.wl-row:hover { background: var(--surface); }
.wl-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wl-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wl-name b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-st { width: 14px; height: 14px; flex: none; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--c); }
.wl-st.done { background: var(--c); }
.wl-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wl-who .av-stack .av { box-shadow: 0 0 0 2px var(--rail); }
.wl-row:hover .wl-who .av-stack .av { box-shadow: 0 0 0 2px var(--surface); }
.wl-who-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-date { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wl-date small { display: none; }
.wl-due.late { color: var(--late); }
.wl-due.today { color: var(--today); }
.wl-add { margin: 2px 0 4px 26px; padding: 9px 10px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.wl-add:hover { color: var(--fg); }
@media (max-width: 1100px) { .wl-cols, .wl-row { grid-template-columns: minmax(0, 1fr) 170px 80px 120px; } }
@media (max-width: 780px) {
  .worklist { padding: 10px 10px 40px; height: auto; gap: 12px; }
  .wl-block { padding: 12px 12px 6px; }
  .wl-head small { margin-left: 26px; }
  .wl-table { margin-left: 0; }
  .wl-cols { display: none; }
  .wl-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name name name" "who start due"; row-gap: 8px; column-gap: 12px; padding: 12px 6px; }
  .wl-name { grid-area: name; }
  .wl-name b { font-size: 15.5px; white-space: normal; }
  .wl-who { grid-area: who; }
  .wl-start { grid-area: start; }
  .wl-due { grid-area: due; }
  .wl-date { font-size: 13.5px; }
  .wl-date small { display: inline; margin-right: 4px; color: var(--muted); }
  .wl-add { margin-left: 0; min-height: 44px; }
}

/* Editor, Calendar and Work List sit together at the bottom of the sidebar */
.nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }
.rail .nav-bottom + .me { margin-top: 4px; }

/* a new card that is still being saved */
.card.saving { opacity: .6; cursor: progress; }

/* press and hold a link on a phone: Copy link / Open link */
.link-url { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#linkDlg .mv-list button svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
#linkDlg .mv-list button span { flex: 1; }
@media (hover: none) { .text-link { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }

/* Phones: everything a size smaller, so the board and task details aren't so zoomed in */
@media (max-width: 780px) {
  .topbar { padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; gap: 6px; }
  .menu-btn, .icon-btn { width: 40px; height: 40px; }
  .crumb h1 { font-size: 17px; }
  .month button { width: 36px; height: 36px; }
  .month .month-label { font-size: 14px; }
  .cat-filter select { height: 38px; font-size: 14px; }
  .col-tabs:not([hidden]) { gap: 6px; padding: 8px 12px 4px; }
  .col-tabs button { height: 34px; padding: 0 12px; font-size: 13px; gap: 6px; }
  .col-list { gap: 8px; }
  .card { padding: 12px 12px 11px; gap: 7px; border-radius: 12px; }
  .card-title { font-size: 14.5px; }
  .card-cat { font-size: 12px; }
  .card-foot .av { width: 24px; height: 24px; font-size: 10px; }
  .who-name, .who-names { font-size: 13px; }
  .card-foot .due { font-size: 12px; }
  #newBtn { height: 48px; padding: 0 20px; border-radius: 24px; font-size: 15px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .nav-btn, .space-btn { min-height: 40px; font-size: 14px; }
  .cat-btn, .cat-add { min-height: 34px; font-size: 13.5px; }

  /* task details */
  .d-head { padding: 6px 10px; }
  .d-close { width: 40px; height: 40px; font-size: 22px; }
  dialog.detail .d-body { gap: 13px; padding: 12px 14px 24px; }
  .d-main h2 { font-size: 19px; }
  .field input, .field select, .field textarea { font-size: 15px; }
  .field input, .field select { height: 40px; }
  .date-text, .d-side .date-text { height: 40px; font-size: 15px; }
  .person-chip { min-height: 40px; font-size: 15px; }
  .chip-x { width: 34px; height: 34px; }
  .people .add-person { height: 40px; font-size: 15px; }
  .notify-btn { height: 40px; }
  .c-form input { height: 42px; border-radius: 21px; font-size: 15px; }
  dialog.detail #dDelete { height: 40px; }
  .dlg-actions .primary, .dlg-actions .ghost, .dlg-actions .danger { height: 44px; }
  .mv-list button { height: 46px; font-size: 15px; }

  /* lists */
  .wl-name b { font-size: 14.5px; }
  .wl-date { font-size: 13px; }
}

/* ================= Clean sidebar: no boxes behind the text, the open item is just blue ================= */
.nav-btn:hover, .space-btn:hover, .cat-btn:hover, .cat-add:hover, .me-btn:hover { background: none; }
.nav-btn:hover, .space-btn:hover { color: var(--accent); }
.nav-btn:hover svg { color: var(--accent); }
.nav-btn[aria-current="true"], .cat-btn[aria-current="true"], .space-btn[aria-current="true"] { background: none; color: var(--accent); }
.cat-btn[aria-current="true"] { font-weight: 500; }
.add-btn { border: 0; background: none; color: var(--muted); font-size: 19px; width: 24px; height: 24px; }
.add-btn:hover { background: none; color: var(--fg); border: 0; }
.rail-toggle { background: none; border: 0; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.rail-toggle:hover { color: var(--fg); }
.del-btn:hover { background: none; }
.me-gear { position: relative; margin-left: auto; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; padding: 0; }
.me-gear svg { width: 19px; height: 19px; }
.me-gear:hover, .me-gear[aria-current="true"] { color: var(--accent); }
.gear-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--late); }

/* ================= Editor page ================= */
.editors { overflow-y: auto; height: 100%; padding: 18px 22px 40px; }
.ed-table { max-width: 1100px; }
.ed-row { display: grid; grid-template-columns: minmax(160px, 1.8fr) repeat(7, minmax(44px, 1fr)) 96px; align-items: center; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.ed-row:first-child { border-top: 0; }
.ed-head { padding: 0 0 8px; font-size: 11.5px; color: var(--muted); }
.ed-head span:not(:first-child) { text-align: center; }
.ed-head span:last-child { text-align: right; }
.ed-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ed-who b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-av { width: 42px; height: 42px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 14px; font-weight: 500; color: #fff; overflow: hidden; }
.ed-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-n { background: none; border: 0; padding: 6px 0; color: var(--fg); display: flex; flex-direction: column; align-items: center; gap: 1px; border-radius: 6px; }
.ed-n b { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ed-n small { display: none; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ed-n.zero b { color: var(--muted); opacity: .45; font-weight: 500; }
.ed-n:hover b, .ed-n.on b { color: var(--accent); opacity: 1; }
.ed-st { justify-self: end; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 6px; }
.ed-st.free { background: var(--accent-soft); color: var(--accent); }
.ed-st.busy { background: var(--late-soft); color: var(--late); }
.ed-empty { color: var(--muted); font-size: 13.5px; }
.ed-pop { position: fixed; z-index: 65; width: 230px; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--pop-shadow); padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.ed-pop small { font-size: 11.5px; color: var(--muted); padding: 2px 4px 1px; }
/* each project name sits in a soft box: the accent colour at 10% */
.ed-pop button { background: rgba(125, 155, 255, .10); border: 0; border-radius: 7px; text-align: left; padding: 8px 10px; color: var(--accent); font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.ed-pop button:hover { background: rgba(125, 155, 255, .18); }
.ed-pop p { margin: 4px; font-size: 13px; color: var(--muted); }

/* ================= Settings ================= */
.settings { overflow-y: auto; height: 100%; padding: 18px 22px 40px; }
.set-wrap { display: flex; gap: 36px; max-width: 900px; min-height: 100%; }
.set-nav { width: 130px; flex: none; display: flex; flex-direction: column; gap: 2px; }
.set-nav { gap: 6px; }
/* tabs: a thin, quiet outline; the open one gets a soft blue outline */
.set-nav button { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; text-align: left; padding: 7px 12px; font-size: 14px; font-weight: 500; color: var(--fg); }
.set-nav button:hover { color: var(--accent); border-color: rgba(125, 155, 255, .3); }
.set-nav button[aria-current="true"] { color: var(--accent); border-color: rgba(125, 155, 255, .45); }
/* Sign out right under the last tab, in a soft red box (red at 10%) */
.set-nav .set-out { margin-top: 14px; align-self: flex-start; color: var(--late); background: rgba(255, 122, 110, .10); border-color: transparent; border-radius: 7px; padding: 7px 14px; }
/* Editor, Calendar, Work List at the bottom of the sidebar: the same thin outline */
.nav-bottom { gap: 6px; }
.nav-bottom .nav-btn { border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; padding: 7px 10px; }
.nav-bottom .nav-btn:hover { border-color: rgba(125, 155, 255, .3); }
.nav-bottom .nav-btn[aria-current="true"] { border-color: rgba(125, 155, 255, .45); }
.set-nav .set-out:hover { color: var(--late); background: rgba(255, 122, 110, .18); }
.set-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--late); color: #fff; font-size: 11px; display: grid; place-items: center; }
.set-n { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 500; }
.set-body { flex: 1; min-width: 0; }
.set-h { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--muted); display: flex; gap: 8px; }
.set-h span { font-family: var(--mono); font-weight: 500; }
.set-list + .set-h { margin-top: 26px; }
.set-list { list-style: none; margin: 0; padding: 0; }
.set-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row.slim { padding: 9px 0; }
.set-info { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 2px; }
.set-info b { font-size: 14px; font-weight: 500; }
.set-info small { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.set-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.set-title { font-size: 13px; color: var(--muted); }
.set-select { height: 32px; border: 0; background: none; color: var(--fg); font-size: 13.5px; font-weight: 500; padding: 0 2px; cursor: pointer; }
.set-select option { background: var(--surface); color: var(--fg); }
.text-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font-size: 13.5px; font-weight: 500; }
.text-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.text-btn.muted { color: var(--muted); }
.text-btn.danger { color: var(--late); }
.set-lock { color: var(--muted); display: grid; place-items: center; width: 26px; }
.set-lock svg { width: 15px; height: 15px; }
.set-add { display: flex; align-items: flex-end; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.set-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.set-field input { width: 220px; height: 34px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--fg); font-size: 14px; padding: 0 2px; }
.set-field input:focus { outline: none; border-bottom-color: var(--accent); }
.set-note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.set-note:first-child { margin-top: 0; margin-bottom: 8px; }
.set-profile { display: flex; align-items: center; gap: 18px; }
.set-profile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-profile-text b { font-size: 17px; }
.set-profile-text small { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.set-profile-text .text-btn { align-self: flex-start; margin-top: 6px; }

/* ================= Phones ================= */
@media (max-width: 780px) {
  /* every page scrolls inside the screen (the board, lists, settings...): nothing gets cut off at the bottom */
  .main { display: flex; flex-direction: column; }
  .main > .view { flex: 1 1 auto; min-height: 0; height: auto; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .rail { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .board .col { max-height: none; }

  .editors { padding: 8px 14px 40px; }
  .ed-head { display: none; }
  .ed-head + .ed-row { border-top: 0; }
  .ed-row { grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 6px; padding: 12px 0; }
  .ed-who { grid-row: 1; grid-column: 1 / 6; }
  .ed-st { grid-row: 1; grid-column: 6 / 8; }
  .ed-n small { display: block; }
  .ed-n b { font-size: 15px; }
  .ed-av { width: 40px; height: 40px; }

  .settings { padding: 6px 14px 40px; }
  .set-wrap { flex-direction: column; gap: 14px; min-height: 0; }
  .set-nav { width: auto; flex-direction: row; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav button { white-space: nowrap; padding: 8px 12px; min-height: 38px; }
  .set-nav .set-out { margin: 0; align-self: auto; min-height: 38px; padding: 8px 12px; }
  .set-actions { width: 100%; }
  .av.lg ~ .set-actions { padding-left: 44px; }
  .set-select { font-size: 15px; height: 38px; }
  .set-field input { font-size: 16px; width: 100%; }
  .set-add { align-items: stretch; flex-direction: column; gap: 10px; }
  .set-add .text-btn { align-self: flex-start; min-height: 40px; }
}

/* Board cards: a little more room top to bottom, so two or three people on a card don't look squeezed */
.col-list { gap: 12px; }
/* a card is always as tall as what's on it: a long column scrolls instead of squashing the cards */
.card { padding: 16px 14px 16px; gap: 12px; min-height: 140px; flex-shrink: 0; }
/* columns still scroll (mouse wheel, touch), just without a visible scroll bar */
.col-list { scrollbar-width: none; -ms-overflow-style: none; }
.col-list::-webkit-scrollbar { display: none; }
.card-foot { padding-top: 12px; row-gap: 9px; }
.card-foot .who-names { line-height: 1.5; }
@media (min-width: 781px) and (max-width: 1500px) {
  .card { padding: 15px 12px 14px; }
}
@media (max-width: 780px) {
  .col-list { gap: 11px; }
  .card { padding: 15px 14px 14px; gap: 10px; min-height: 0; }
  .card-foot { padding-top: 11px; row-gap: 8px; }
}

/* ================= Attached files: a name to press (downloads it), no preview ================= */
.files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.files:empty { display: none; }
.files li { position: relative; display: flex; align-items: center; gap: 4px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; overflow: hidden; }
.files .file { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px 10px; color: var(--fg); text-decoration: none; font-size: 13.5px; }
.files a.file:hover { color: var(--accent); }
.files li:has(a.file:hover) { border-color: rgba(125, 155, 255, .35); }
.files .file svg { width: 17px; height: 17px; flex: none; color: var(--accent); }
.files .file-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.files .file small { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.files .chip-x { width: 30px; height: 30px; margin-right: 3px; }
/* uploading: a thin bar fills along the bottom */
.files li.uploading::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--pct, 0%); background: var(--accent); transition: width .2s; }
.files li.uploading .file { color: var(--muted); }
.comment-body .files { margin-top: 6px; }
.c-files { margin: 0 0 8px; }
.attach-box { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.attach-box .files { margin: 0; width: 100%; }
.attach-box .clip-btn { margin-left: -9px; }
.clip-btn { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); cursor: pointer; }
.clip-btn:hover { color: var(--accent); }
.clip-btn svg { width: 19px; height: 19px; }
@media (max-width: 780px) {
  .files .file { padding: 10px 10px; font-size: 14px; }
  .clip-btn { width: 42px; height: 42px; }
}

/* ================= Video: third column in task details ================= */
dialog.detail { width: min(1180px, calc(100vw - 32px)); }
.d-body { grid-template-columns: minmax(0, 1fr) 250px 270px; }
dialog.detail.full .d-body { grid-template-columns: minmax(0, 1fr) 300px 320px; }
.d-video { border-left: 1px solid var(--line); padding: 20px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.d-video:empty { display: none; }
.k-label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.v-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: #000; }
.v-thumb video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.v-badge { position: absolute; top: 7px; left: 7px; font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 5px; background: rgba(10, 12, 16, .72); color: #fff; pointer-events: none; }
.v-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; text-align: center; font-size: 12.5px; color: var(--muted); background: var(--bg); }
.v-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: vspin 1s linear infinite; flex: none; }
@keyframes vspin { to { transform: rotate(360deg); } }
.v-name { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.d-video .mt { font-size: 12px; color: var(--muted); }
.v-btn { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; height: 38px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; background: none; color: var(--fg); font-weight: 500; font-size: 13.5px; }
.v-btn:hover { border-color: rgba(125, 155, 255, .45); }
.v-btn svg { width: 17px; height: 17px; }
.v-btn.primary-soft { background: rgba(125, 155, 255, .10); border-color: transparent; color: var(--accent); }
.v-btn.primary-soft:hover { background: rgba(125, 155, 255, .18); }
.d-video .v-btn:first-of-type { margin-top: 4px; }
.v-drop { aspect-ratio: 16 / 9; border: 1.5px dashed var(--line); border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; color: var(--muted); cursor: pointer; padding: 8px; }
.v-drop:hover, .v-drop.hot { border-color: var(--accent); color: var(--accent); background: rgba(125, 155, 255, .06); }
.v-drop b { color: var(--fg); font-size: 13.5px; }
.v-drop small { font-size: 12px; }
.v-drop-ic svg { width: 22px; height: 22px; }
.v-note { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.4; }
.v-up { border: 1px solid rgba(255, 255, 255, .08); border-radius: 9px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.v-prog { height: 5px; border-radius: 3px; background: #232a36; overflow: hidden; }
.v-prog i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.v-err { font-size: 12px; color: var(--today); }
.v-links { display: flex; gap: 16px; }
@media (max-width: 1100px) {
  .d-body { grid-template-columns: minmax(0, 1fr) 260px; }
  .d-main { grid-row: 1 / 3; }
  .d-video { grid-column: 2; border-top: 1px solid var(--line); background: var(--rail); }
}
@media (max-width: 900px) { .d-body { grid-template-columns: 1fr; } .d-main { grid-row: auto; } .d-video { grid-column: auto; border-left: 0; } }
@media (max-width: 780px) {
  dialog.detail .d-video { display: flex; order: 2; border: 0; padding: 4px 0; background: none; }
  dialog.detail .d-video:empty { display: none; }
}

/* full-screen review: watch, switch versions, download the original */
dialog.vreview { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); background: #0b0e13; }
.vr-root { height: 100%; }

/* ---------- the review screen (review-core.js), in the app and on a client's share link ---------- */
.rv { height: 100%; display: flex; flex-direction: column; background: #0b0e13; color: var(--fg); }
.rv-top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); min-height: 52px; }
.rv-title { font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-who { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rv-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.rv-vers { margin-left: auto; }
.rv-pills button { background: none; border: 1px solid rgba(255, 255, 255, .08); border-radius: 7px; padding: 4px 10px; font-weight: 500; font-size: 12.5px; color: var(--fg); }
.rv-pills button.on { color: var(--accent); border-color: rgba(125, 155, 255, .45); background: rgba(125, 155, 255, .10); }
.rv-pills button:disabled { opacity: .4; cursor: default; }
.rv-ib { width: 36px; height: 36px; flex: none; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--fg); padding: 0; }
.rv-ib:hover { color: var(--accent); }
.rv-ib svg { width: 21px; height: 21px; }
.rv-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.rv-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 16px; gap: 8px; }
.rv-stage { position: relative; flex: 1; min-height: 200px; background: #000; border-radius: 10px; overflow: hidden; }
.rv-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.rv-draw { position: absolute; pointer-events: none; }
.rv-draw.on { pointer-events: auto; cursor: crosshair; touch-action: none; }
.rv-badge { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 5px; background: rgba(10, 12, 16, .72); color: #fff; pointer-events: none; }
.rv-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(10, 12, 16, .55); color: #fff; display: grid; place-items: center; }
.rv-big svg { width: 30px; height: 30px; margin-left: 3px; }
.rv-stage:fullscreen { border-radius: 0; }
.rv-ctrl { display: flex; align-items: center; gap: 8px; }
.rv-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 92px; }
.rv-tl { position: relative; flex: 1; height: 26px; cursor: pointer; touch-action: none; }
.rv-trk, .rv-fill { position: absolute; left: 0; top: 11px; height: 4px; border-radius: 2px; }
.rv-trk { right: 0; background: #2c3442; }
.rv-fill { background: var(--accent); }
.rv-mk { position: absolute; top: 4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #f0b24a; pointer-events: none; }
.rv-under { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-dl { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; padding: 6px 12px; color: var(--fg); text-decoration: none; font-weight: 500; font-size: 13px; }
.rv-dl:hover { border-color: rgba(125, 155, 255, .45); }
.rv-dl svg { width: 16px; height: 16px; }
.rv-side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.rv-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rv-count { font-size: 12.5px; color: var(--muted); }
.rv-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.rv-c-head { display: flex; align-items: center; gap: 6px; }
.rv-c-head b { font-size: 13px; }
.rv-tag { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: rgba(125, 155, 255, .10); color: var(--accent); }
.rv-del { margin-left: auto; background: none; border: 0; color: var(--muted); padding: 2px; display: grid; place-items: center; }
.rv-del:hover { color: var(--late); }
.rv-del svg { width: 15px; height: 15px; }
.rv-c p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.rv-ts { background: rgba(125, 155, 255, .10); border: 0; border-radius: 5px; color: var(--accent); font-size: 11.5px; font-weight: 500; padding: 1px 6px; margin-right: 6px; }
.rv-replies { margin: 8px 0 0 10px; padding-left: 10px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.rv-reply { background: none; border: 0; padding: 4px 0 0; color: var(--accent); font-weight: 500; font-size: 12px; }
.rv-rform { display: flex; gap: 6px; margin-top: 6px; }
.rv-rform input { flex: 1; min-width: 0; height: 34px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; color: var(--fg); }
.rv-rform button { background: rgba(125, 155, 255, .10); border: 0; border-radius: 7px; color: var(--accent); font-weight: 500; padding: 0 10px; }
.rv-cfiles { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; }
.rv-form { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.rv-at { font-size: 12px; color: var(--muted); }
.rv-at b { color: var(--accent); }
.rv-box { position: relative; }
.rv-box textarea { width: 100%; resize: vertical; min-height: 64px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 40px 8px 10px; color: var(--fg); font: inherit; font-size: 14px; display: block; }
.rv-clip { position: absolute; right: 6px; top: 6px; color: var(--muted); padding: 4px; cursor: pointer; display: grid; }
.rv-clip:hover { color: var(--accent); }
.rv-clip svg { width: 18px; height: 18px; }
.rv-files { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--muted); }
.rv-files:empty { display: none; }
.rv-files button { background: none; border: 0; color: var(--muted); margin-left: 6px; }
.rv-err { font-size: 12.5px; color: var(--late); }
.rv-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rv-tool { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 1px solid transparent; border-radius: 7px; color: var(--muted); padding: 0; }
.rv-tool:hover { color: var(--fg); }
.rv-tool.on { color: var(--accent); border-color: rgba(125, 155, 255, .45); background: rgba(125, 155, 255, .10); }
.rv-tool svg { width: 17px; height: 17px; }
.rv-sw { width: 16px; height: 16px; border-radius: 50%; border: 0; padding: 0; margin: 0 2px; }
.rv-sw.on { outline: 2px solid #fff; outline-offset: 2px; }
.rv-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.rv-post { margin-left: auto; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 8px; padding: 7px 14px; font-weight: 500; }
.rv-post:disabled { opacity: .6; }
.rv-note { margin: 0; padding: 12px 14px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) {
  .rv-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); overflow-y: auto; }
  .rv-left { padding: 8px 10px; }
  .rv-stage { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .rv-side { border-left: 0; border-top: 1px solid var(--line); min-height: 50vh; }
  .rv-who { display: none; }
}

/* ---------- share window ---------- */
dialog.share-dlg { width: min(500px, calc(100vw - 24px)); }
.sh-row { display: flex; align-items: center; gap: 12px; font-weight: 400; color: var(--fg); }
.sh-ic { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(95, 211, 154, .12); color: #5fd39a; }
.sh-ic.team { background: var(--bg); color: var(--muted); }
.sh-ic svg { width: 19px; height: 19px; }
.sh-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sh-who small { font-size: 12px; color: var(--muted); font-weight: 400; }
.sh-row select { background: none; border: 0; color: var(--fg); font-weight: 500; padding: 2px 0; cursor: pointer; }
.sh-row select option { background: var(--surface); }
.sh-linkbox { display: flex; gap: 8px; align-items: center; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; padding: 6px 6px 6px 10px; }
.sh-linkbox span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
.sh-linkbox .primary { height: 34px; }
.sh-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.sh-create { width: 100%; }
dialog.share-dlg .dlg-actions { align-items: center; justify-content: space-between; }

/* video card: name + comment count */
.v-namerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v-namerow .v-name { flex: 1; min-width: 0; }
.v-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; border: 1px solid rgba(255, 255, 255, .08); background: none; border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 500; color: var(--accent); }
.v-chip svg { width: 13px; height: 13px; }

/* ---------- Client Projects ---------- */
.clients { overflow-y: auto; height: 100%; padding: 16px 20px 40px; }
.cp-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.cp-tabs button { background: none; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; padding: 6px 12px; font-weight: 500; font-size: 13.5px; color: var(--fg); }
.cp-tabs button[aria-current="true"] { color: var(--accent); border-color: rgba(125, 155, 255, .45); }
.cp-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.cp-folder { display: flex; flex-direction: column; align-items: center; gap: 5px; background: var(--surface); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 20px 12px 16px; color: var(--fg); text-align: center; }
.cp-folder:hover { border-color: rgba(125, 155, 255, .45); }
.cp-folder b { font-size: 14.5px; margin-top: 4px; overflow-wrap: anywhere; }
.cp-folder small { font-size: 12px; color: var(--muted); }
.cp-count { font-size: 12px; color: var(--accent); border: 1px solid rgba(255, 255, 255, .08); border-radius: 6px; padding: 1px 8px; margin-top: 2px; }
.cp-face { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 500; flex: none; overflow: hidden; }
.cp-face img { width: 100%; height: 100%; object-fit: cover; }
.cp-back { margin-bottom: 12px; }
.cp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cp-head b { display: block; font-size: 16px; }
.cp-head small { font-size: 12.5px; color: var(--muted); }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cp-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 8px; text-align: left; color: var(--fg); }
.cp-card:hover { border-color: rgba(125, 155, 255, .45); }
.cp-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; display: grid; place-items: center; }
.cp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cp-thumb.none { background: var(--bg); border: 1.5px dashed var(--line); color: var(--muted); font-size: 12.5px; }
.cp-dur { position: absolute; right: 6px; bottom: 6px; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: rgba(10, 12, 16, .72); color: #fff; }
.cp-body { padding: 10px 4px 4px; display: flex; flex-direction: column; gap: 3px; }
.cp-namerow { display: flex; align-items: center; gap: 8px; }
.cp-namerow b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.cp-body small { font-size: 12px; color: var(--muted); }
.cp-people { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
@media (max-width: 780px) {
  .clients { padding: 10px 12px 40px; height: auto; }
  .cp-folders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cp-grid { grid-template-columns: 1fr; }
}

/* ---------- Settings → Storage ---------- */
.st-tag { font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 5px; background: rgba(95, 211, 154, .12); color: #5fd39a; margin-left: 6px; }
.st-bar { height: 7px; border-radius: 4px; background: #232a36; overflow: hidden; margin: 6px 0 3px; max-width: 520px; }
.st-bar i { display: block; height: 100%; background: var(--accent); }
.st-warn { color: var(--today); }
.st-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.st-sep { color: var(--muted); }
.st-list { list-style: none; margin: 0; padding: 0; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; max-width: 640px; }
.st-list li + li { border-top: 1px solid #222937; }
.st-item { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 10px 12px; color: var(--fg); text-align: left; font-size: 13.5px; }
.st-item:hover { color: var(--accent); }
.st-item > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.st-item small { color: var(--muted); font-size: 12px; }
.st-go { color: var(--muted); font-size: 12.5px; }

/* ---------- a client's share-link page ---------- */
body.guest-page { padding: 0; height: 100dvh; overflow: hidden; background: #0b0e13; }
.g-review { height: 100%; }
.g-gate, .g-msg { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: #0b0e13; }
.g-box { width: min(380px, 100%); background: var(--surface); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.g-box .field { width: 100%; }
.g-box .primary { width: 100%; height: 44px; margin-top: 6px; }
.g-brand { font-size: 18px; margin-top: 6px; }
.g-sub, .g-small { font-size: 12.5px; color: var(--muted); text-align: center; }
.g-small { margin-top: 10px; }
.g-msg { color: var(--muted); font-size: 15px; text-align: center; }
@media (max-width: 860px) { body.guest-page { overflow-y: auto; height: auto; } }

/* long task details: a few lines, then "See more" */
.d-desc.clamped { max-height: calc(1.6em * var(--desc-lines, 8)); overflow: hidden; -webkit-mask-image: linear-gradient(#000 calc(100% - 2.6em), transparent); mask-image: linear-gradient(#000 calc(100% - 2.6em), transparent); }
.see-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 6px 2px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.see-more:hover { text-decoration: underline; text-underline-offset: 2px; }
.see-more svg { width: 16px; height: 16px; transition: transform .15s; }
.see-more[aria-expanded="true"] svg { transform: rotate(180deg); }
