:root {
  --bg: #faf7f2; --card: #fff; --line: #ece6dc; --line-strong: #ddd4c6;
  --fg: #292524; --muted: #78716c; --faint: #a8a29e;
  --accent: #c2410c; --accent-hover: #9a3412; --accent-soft: #fff1e6;
  --link: #b45309; --danger: #b91c1c; --ok: #15803d; --warn: #b45309;
  --serif: Georgia, "Times New Roman", serif;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-size: 15px; line-height: 1.5; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* Header */
header.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  max-width: 1150px; margin: 0 auto; padding: 1.1rem 1.5rem .4rem; }
.brand { font-family: var(--serif); font-size: 1.2rem; color: var(--fg); display: flex; align-items: center; gap: .5rem; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: inline-grid; place-items: center;
  color: #fff; font-size: .8rem; font-family: system-ui, sans-serif; font-weight: 600; }
nav.links { display: flex; gap: .2rem; flex-wrap: wrap; align-items: center; }
nav.links a { color: var(--muted); padding: .35rem .7rem; border-radius: 999px; font-size: .92rem; }
nav.links a:hover { color: var(--fg); background: #f2ece2; text-decoration: none; }
nav.links a.active { color: var(--fg); background: var(--card); border: 1px solid var(--line); }
.who { display: flex; gap: .75rem; align-items: center; font-size: .9rem; color: var(--muted); }
.who form { margin: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #f2ece2; color: var(--fg); display: inline-grid; place-items: center;
  font-size: .8rem; font-weight: 600; }

main { max-width: 1150px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin: .5rem 0 1.25rem; letter-spacing: -.01em; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 2rem 0 .8rem; }
.card h2:first-child { margin-top: 0; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1.25rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-family: var(--serif); font-size: 1.7rem; margin-top: .15rem; }
.stat .value small { font-family: system-ui, sans-serif; font-size: .85rem; color: var(--muted); margin-left: .2rem; }

/* Entry cards */
.day { margin-bottom: 1.4rem; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 .3rem .45rem; color: var(--muted); font-size: .88rem; }
.day-head strong { color: var(--fg); font-weight: 600; }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1.1rem; margin-bottom: .55rem;
  display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr) auto; gap: .5rem 1.5rem; align-items: center; }
.entry:hover { border-color: var(--line-strong); }
.entry-main { display: grid; gap: .45rem; min-width: 0; }
.entry .title { font-weight: 500; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.entry-labels { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .86rem; }
.entry-comment { color: #44403c; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 1.2rem; border-left: 1px solid #f0ebe2; align-self: stretch;
  display: flex; align-items: center; }
.entry .hours { font-family: var(--serif); font-size: 1.45rem; text-align: right; }
.entry .hours small { font-family: system-ui, sans-serif; font-size: .78rem; color: var(--muted); margin-left: .15rem; }
.entry .row-actions { display: flex; gap: .6rem; font-size: .86rem; }
.entry.editing { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.entry.editing > .entry-main, .entry.editing > .entry-comment, .entry.editing > .hours { display: none; }
.entry-edit { grid-column: 1 / -1; margin: 0; }
.entry-edit .actions { justify-content: flex-start; }
@media (max-width: 800px) {
  .entry { grid-template-columns: 1fr auto; }
  .entry-comment { grid-column: 1 / -1; grid-row: 2; padding-left: 0; border-left: 0; }
}
.entry .row-actions form { margin: 0; }
.entry .title .sub { color: var(--muted); font-weight: 400; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.pc0 { background: #d97706; } .pc1 { background: #16a34a; } .pc2 { background: #2563eb; } .pc3 { background: #db2777; }
.pc4 { background: #7c3aed; } .pc5 { background: #0891b2; } .pc6 { background: #dc2626; } .pc7 { background: #65a30d; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty .big { font-family: var(--serif); font-size: 1.25rem; color: var(--fg); margin-bottom: .3rem; }

/* Tables */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .65rem .9rem; border-bottom: 1px solid #f3eee6; text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fdfbf7; }
th { font-weight: 500; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #fcfaf6; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 600; background: #fcfaf6; }

/* Forms */
form.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .85rem 1rem; align-items: end; }
form.grid .wide { grid-column: 1 / -1; }
form.inline { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--fg); padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: 10px; background: #fffdfa; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 5rem; }
button, .btn { font: inherit; font-weight: 500; padding: .55rem 1.1rem; border: 0; border-radius: 10px; background: var(--accent); color: #fff;
  cursor: pointer; display: inline-block; }
button:hover, .btn:hover { background: var(--accent-hover); text-decoration: none; }
button.secondary, .btn.secondary { background: #f2ece2; color: var(--fg); }
button.secondary:hover, .btn.secondary:hover { background: #e9e1d4; }
button.danger { background: #fff; color: var(--danger); border: 1px solid #f3c9c4; }
button.danger:hover { background: #fef2f2; }
button.link { background: none; color: var(--link); padding: 0; font-weight: 400; }
button.link:hover { background: none; text-decoration: underline; }
button.link.del { color: var(--faint); }
button.link.del:hover { color: var(--danger); }
.actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.pager { display: flex; gap: .5rem; align-items: center; margin: 0 0 1.25rem; flex-wrap: wrap; }
.pager a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font-size: .88rem; }
.pager a:hover { text-decoration: none; border-color: var(--line-strong); }
.pager .current { font-family: var(--serif); font-size: 1.1rem; margin: 0 .4rem; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar form.inline { margin: 0; }

/* Feedback */
.flash { padding: .75rem 1.1rem; border-radius: 12px; margin-bottom: 1.1rem; }
.flash.ok { background: #effaf2; color: var(--ok); border: 1px solid #c8ecd3; }
.flash.error { background: #fef2f2; color: var(--danger); border: 1px solid #f7d0cc; }
.badge { display: inline-block; padding: .08rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 500; background: #eef6ee; color: #166534; }
.badge.locked { background: #f2ece2; color: #57534e; }
.badge.warn { background: #fef3e2; color: var(--warn); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; margin-bottom: 1.2rem; font-size: 1.5rem; }
.login .card { padding: 1.6rem; }
.login form { display: grid; gap: 1rem; }
.login button { width: 100%; padding: .7rem; }

/* Project tabs (board / tasks) */
main.wide { max-width: none; padding-bottom: 1rem; }
.tabs { display: flex; align-items: center; gap: .5rem; margin: -.6rem 0 1rem; flex-wrap: wrap; }
.tabs .muted { margin-right: .6rem; }
.tabs a { padding: .35rem .9rem; border-radius: 999px; color: var(--muted); border: 1px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--fg); }
.tabs a.active { background: var(--card); border-color: var(--line); color: var(--fg); font-weight: 500; }

/* Project cards */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.project-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: grid; gap: .55rem; }
.project-card.archived { opacity: .7; }
.pc-head { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; }
.pc-stats { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.pc-stats b { color: var(--fg); font-weight: 600; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem 1rem; margin-bottom: .75rem; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-size: .95rem; color: var(--fg); }
label.check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* Tasks */
.task-add { display: grid; grid-template-columns: 1fr 190px 160px auto; gap: .6rem; }
.filters { display: flex; gap: .4rem; margin: 0 0 .9rem; flex-wrap: wrap; }
.filters a { padding: .35rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: .9rem; }
.filters a:hover { text-decoration: none; color: var(--fg); }
.filters a.active { background: var(--fg); border-color: var(--fg); color: #fff; }
.filters .count { opacity: .7; margin-left: .15rem; }
.task { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem .4rem; margin-bottom: .5rem;
  display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; align-items: center; }
.task.st-done .task-title { text-decoration: line-through; color: var(--faint); }
.task-row { display: grid; grid-template-columns: 140px 1fr 180px 150px auto; gap: .5rem; align-items: center; margin: 0; }
.task-row input, .task-row select { padding: .4rem .55rem; background: transparent; border-color: transparent; }
.task-row input:hover, .task-row select:hover { border-color: var(--line); }
.task-row input:focus, .task-row select:focus { background: #fffdfa; }
.task-title { font-weight: 500; font-size: 1rem; }
.status-select { border-radius: 999px !important; font-size: .85rem; font-weight: 500; }
.status-select.st-todo { background: #f2ece2 !important; color: #57534e; }
.status-select.st-doing { background: #fef3e2 !important; color: #b45309; }
.status-select.st-done { background: #eef6ee !important; color: #166534; }
input.overdue { color: var(--danger); font-weight: 600; }
.task-meta { grid-column: 1 / -1; font-size: .78rem; color: var(--faint); padding-left: .6rem; }
.task-del { margin: 0; }
.js .nojs { display: none; }
form.saving { opacity: .6; }

/* Client page */
.client-money .value { font-size: 1.5rem; }
.money-paid { color: #15803d; }
.money-unbilled { color: var(--warn); }
.client-money .label a { color: var(--link); }
.badge.danger { background: #fef2f2; color: var(--danger); }
.client-details { margin-top: 2rem; }
.people-table .member-form { margin: 0; }
.people-table .assignees summary { border-color: var(--line); background: #fffdfa; max-width: 320px; }
.add-person { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-top: .9rem; padding: .9rem 1.1rem; }
.add-person label { min-width: 220px; }
.add-person .assignees summary { border-color: var(--line-strong); background: #fffdfa; padding: .55rem .7rem; }
.client-details summary { cursor: pointer; list-style: none; }
.client-details summary::-webkit-details-marker { display: none; }
.client-details summary h2 { display: inline; margin: 0; }
.client-details summary h2::after { content: ' ▾'; color: var(--faint); font-size: .9rem; }
.client-details[open] summary { margin-bottom: 1rem; }

/* Rates: inline editing */
.rates-hint { margin: 0; }
.rate-group h2 { margin-top: 1.5rem; }
.rates-table th:nth-child(2), .rates-table th:nth-child(3) { width: 30%; }
.rate-cell { cursor: pointer; border-radius: 8px; }
.rate-cell:hover { background: #fdf6ec; }
.rate-cell:focus { outline: 2px solid var(--accent-soft); }
.rate-src { font-size: .78rem; color: var(--faint); margin-left: .3rem; }
.rate-src.own { color: var(--accent); font-weight: 600; }
.rate-cell.editing { padding-top: .35rem; padding-bottom: .35rem; }
.rate-input { width: 100%; max-width: 260px; padding: .35rem .55rem; }
.rate-input.bad { border-color: var(--danger); }
.rate-cell.saved { background: #effaf2; transition: background .6s; }

/* Task assignees (several people) */
.assignees { position: relative; min-width: 0; }
.assignees summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem; padding: .4rem .55rem; border: 1px solid transparent;
  border-radius: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.task-add .assignees summary { border-color: var(--line-strong); background: #fffdfa; padding: .55rem .7rem; }
.assignees summary::-webkit-details-marker { display: none; }
.assignees summary:hover, .assignees[open] summary { border-color: var(--line); }
.assignee-names { overflow: hidden; text-overflow: ellipsis; }
.assignee-count { flex: none; min-width: 1.4rem; height: 1.4rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
.assignee-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 220px; max-height: 280px; overflow: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; box-shadow: 0 12px 28px -12px rgba(41,37,36,.4); display: grid; gap: .35rem; }

/* Time on tasks, timer, earnings */
.task-time { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .45rem .6rem .2rem;
  border-top: 1px dashed #efe8dc; margin-top: .3rem; }
.time-chip { font-size: .82rem; font-weight: 600; color: #57534e; background: #f5f0e8; border-radius: 999px; padding: .15rem .65rem; font-variant-numeric: tabular-nums; }
button.small { padding: .3rem .75rem; font-size: .85rem; }
.task-time form { margin: 0; }
.timer-stop { display: flex; gap: .5rem; align-items: center; flex: 1; min-width: 320px; }
.timer-stop input { flex: 1; padding: .4rem .6rem; }
.timer-clock { font-variant-numeric: tabular-nums; font-weight: 600; }
.timer-clock.running { color: var(--danger); min-width: 4.5em; }
.time-add summary { cursor: pointer; color: var(--link); font-size: .9rem; list-style: none; }
.time-add summary::-webkit-details-marker { display: none; }
.time-add[open] { flex-basis: 100%; }
.time-add[open] summary { margin-bottom: .5rem; }
.time-add form { background: #fdfbf7; border: 1px solid var(--line); border-radius: 10px; padding: .8rem; }
.timer-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .8rem; border-radius: 999px; background: #fef2f2;
  border: 1px solid #f7d0cc; color: var(--danger); font-size: .85rem; max-width: 280px; }
.timer-pill:hover { text-decoration: none; background: #fee2e2; }
.timer-pill .tp-title { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: rec 1.2s ease-in-out infinite; flex: none; }
@keyframes rec { 50% { opacity: .25; } }
.task-link { font-weight: 600; color: var(--link); }
.tag { display: inline-block; margin-right: .5rem; padding: .05rem .55rem; border-radius: 999px; background: #eef2ff; color: #3730a3;
  font-size: .78rem; font-weight: 600; vertical-align: 1px; }
.tag-picker { display: flex; }
.tag-picker select, .tag-picker input { width: 100%; }
.timer-stop .tag-picker { flex: 0 0 170px; }
.timer-stop .tag-picker select, .timer-stop .tag-picker input { padding: .4rem .6rem; }
.comp-fields { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem 1rem; display: grid; gap: .75rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin: .25rem 0 0; }
.comp-fields legend { padding: 0 .4rem; font-size: .85rem; color: var(--muted); }
form.grid .pw-label { grid-column: span 2; }
.pw-row { display: flex; gap: .4rem; align-items: center; }
.pw-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.pw-note { font-size: .78rem; color: #15803d; }
.comp-note { margin-top: .25rem; font-size: .8rem; color: #15803d; }
.closed-note { color: var(--faint); font-size: .82rem; display: inline-flex; align-items: center; gap: .35rem; }
.row-actions { align-items: center; }
.btn-sm { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 8px; font: inherit; font-size: .84rem;
  font-weight: 500; background: #f2ece2; color: var(--fg); border: 1px solid transparent; cursor: pointer; }
.btn-sm:hover { background: #e9e1d4; text-decoration: none; }
.btn-sm.danger { background: #fff; color: var(--danger); border-color: #f3c9c4; }
.btn-sm.danger:hover { background: #fef2f2; }
.page-actions { display: flex; justify-content: flex-end; margin: -3.4rem 0 1.2rem; }
.btn.earn { background: #15803d; }
.btn.earn:hover { background: #166534; }
.earnings h2 { margin-top: 0; }
.earnings .stats { margin-bottom: 1rem; }
.earn-total .value { color: #15803d; }
.earn-amount { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .9rem; font-weight: 600; color: #15803d;
  margin-left: .45rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat .value .earn-amount { font-size: 1rem; }
.entry .hours .earn-amount { display: block; margin: .1rem 0 0; font-size: .85rem; text-align: right; }

/* Whiteboard */
.board { position: relative; height: calc(100vh - 215px); min-height: 480px; background: #fbf9f5;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; user-select: none; }
.bd-viewport { position: absolute; inset: 0; overflow: hidden; outline: none; touch-action: none; cursor: default;
  background-color: #fbf9f5; background-image: radial-gradient(circle, #d9d0c1 1px, transparent 1.3px); }
.bd-viewport.bd-far { background-image: none; }
.bd-viewport.panning, .bd-viewport.space, .bd-viewport[data-tool="hand"] { cursor: grab; }
.bd-viewport.panning { cursor: grabbing; }
.bd-viewport[data-tool="sticky"], .bd-viewport[data-tool="card"], .bd-viewport[data-tool="text"], .bd-viewport[data-tool="shape"],
.bd-viewport[data-tool="frame"], .bd-viewport[data-tool="line"], .bd-viewport[data-tool="pen"], .bd-viewport[data-tool="highlighter"] { cursor: crosshair; }
.bd-viewport[data-tool="eraser"] { cursor: cell; }
.bd-viewport.dropping { box-shadow: inset 0 0 0 3px var(--accent); }
.bd-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.bd-layer-items { position: absolute; left: 0; top: 0; z-index: 0; }
.bd-lines { position: absolute; left: 0; top: 0; overflow: visible; z-index: 1; pointer-events: none; }
.bd-layer-labels { position: absolute; left: 0; top: 0; z-index: 2; }
.bd-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible; }

/* items */
.bd-item { position: absolute; left: 0; top: 0; box-sizing: border-box; }
.bd-textwrap { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; padding: 14px; }
.bd-text { white-space: pre-wrap; overflow-wrap: anywhere; outline: none; line-height: 1.3; min-height: 1.3em; color: #1f2937; }
.bd-text:empty::before { content: attr(data-placeholder); color: #a8a29e; }
.bd-editing .bd-text, .bd-line-label .bd-text[contenteditable="true"] { cursor: text; user-select: text; -webkit-user-select: text; }
.bd-t-sticky { box-shadow: 0 1px 1px rgba(41,37,36,.08), 0 8px 16px -8px rgba(41,37,36,.35); }
.bd-t-sticky .bd-textwrap { padding: 16px; }
.bd-t-card { background: #fff; border: 1px solid #e7e2d9; border-left: 6px solid #2563eb; border-radius: 8px; box-shadow: 0 2px 8px -4px rgba(41,37,36,.3); }
.bd-t-card .bd-text { font-weight: 600; }
.bd-t-text .bd-textwrap { padding: 2px 4px; overflow: visible; }
.bd-t-shape .bd-textwrap { padding: 12% 14%; }
.bd-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bd-t-frame { border: 1px solid #d6cdbf; border-radius: 2px; box-shadow: 0 1px 2px rgba(41,37,36,.06); }
.bd-t-frame > .bd-textwrap { inset: auto auto 100% 0; padding: 0 0 6px; overflow: visible; }
.bd-t-frame .bd-text { font-size: 15px; font-weight: 600; color: #78716c; white-space: nowrap; }
.bd-t-image img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; border-radius: 2px; }
.bd-t-image { box-shadow: 0 2px 10px -6px rgba(41,37,36,.5); }
.bd-uploading { opacity: .55; }
.bd-locked { cursor: not-allowed; }
.bd-line .bd-stroke, .bd-line [class^="bd-head"] { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.bd-line .bd-hit { stroke: transparent; fill: none; pointer-events: stroke; cursor: pointer; }
.bd-line.bd-selected .bd-stroke { filter: drop-shadow(0 0 2px rgba(194,65,12,.8)); }
.bd-pen-live { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bd-line-label { position: absolute; left: 0; top: 0; background: #fbf9f5; padding: 2px 6px; border-radius: 4px; font-size: 14px;
  white-space: pre; min-width: 1em; text-align: center; cursor: pointer; }
.bd-line-label .bd-text { color: inherit; }

/* overlay */
.ov-sel { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.ov-sel-locked { stroke-dasharray: 4 3; }
.ov-item { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.ov-hover { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .45; }
.ov-marquee { fill: rgba(194,65,12,.06); stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 3; }
.ov-guide { stroke: #e11d48; stroke-width: 1; }
.ov-target { fill: rgba(194,65,12,.05); stroke: var(--accent); stroke-width: 2; }
.ov-target.soft { fill: none; stroke-width: 1; stroke-dasharray: 3 3; }
.ov-anchor { fill: #fff; stroke: #2563eb; stroke-width: 2; }
.ov-anchor.on { fill: #2563eb; stroke: #fff; stroke-width: 2.5; }
.ov-create { fill: rgba(194,65,12,.05); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 3; }
.ov-line-preview { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ov-handle { pointer-events: all; fill: #fff; stroke: var(--accent); stroke-width: 1.5; }
.ov-resize.ov-nw, .ov-resize.ov-se { cursor: nwse-resize; } .ov-resize.ov-ne, .ov-resize.ov-sw { cursor: nesw-resize; }
.ov-resize.ov-n, .ov-resize.ov-s { cursor: ns-resize; } .ov-resize.ov-e, .ov-resize.ov-w { cursor: ew-resize; }
.ov-connect { fill: var(--accent); stroke: #fff; stroke-width: 2; cursor: crosshair; opacity: .85; }
.ov-connect:hover { opacity: 1; r: 8; }
.ov-end { cursor: move; fill: #fff; stroke-width: 2; }

/* left tools panel */
.bd-tools { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 6px 20px -10px rgba(41,37,36,.35); }
.bd-tools .bd-tool { position: relative; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; background: transparent; color: #44403c; border-radius: 8px; }
.bd-tools .bd-tool:hover { background: #f5f0e8; }
.bd-tools .bd-tool.on { background: var(--accent-soft); color: var(--accent); }
.bd-tool-more { position: absolute; right: 4px; bottom: 4px; width: 0; height: 0; border-left: 4px solid transparent; border-bottom: 4px solid currentColor; opacity: .5; }
.bd-tools-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.bd-flyout { position: absolute; left: 60px; z-index: 21; display: flex; flex-wrap: wrap; gap: 4px; width: max-content; max-width: 210px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; box-shadow: 0 10px 28px -12px rgba(41,37,36,.4); }
.bd-flyout button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; background: transparent; color: #44403c; border-radius: 8px; }
.bd-flyout button:hover { background: #f5f0e8; }
.bd-flyout button.on { background: var(--accent-soft); color: var(--accent); }
.bd-flyout-sep { width: 100%; height: 1px; background: var(--line); margin: 2px 0; }
.bd-swatch span { width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); display: block; }
.bd-swatch.round span { border-radius: 50%; }
.bd-swatch.on span { outline: 2px solid var(--fg); outline-offset: 2px; }
.bd-dot { display: block; border-radius: 50%; background: #44403c; }

/* bottom-right zoom bar and top-right status */
.bd-zoombar { position: absolute; right: 12px; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 2px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 6px 20px -10px rgba(41,37,36,.35); }
.bd-zoombar button { height: 32px; min-width: 32px; padding: 0 6px; display: grid; place-items: center; background: transparent; color: #44403c; border-radius: 6px; font-weight: 500; font-size: .85rem; }
.bd-zoombar button:hover { background: #f5f0e8; }
.bd-zoombar button:disabled { opacity: .35; cursor: default; background: transparent; }
.bd-zoombar .bd-zoom { min-width: 52px; font-variant-numeric: tabular-nums; }
.bd-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.bd-topbar { position: absolute; right: 12px; top: 12px; z-index: 20; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.bd-status { font-size: .82rem; color: var(--muted); background: rgba(255,255,255,.85); border-radius: 999px; padding: 2px 10px; }
.bd-status:empty { display: none; }
.bd-status.err { color: var(--danger); }
.bd-viewers { display: flex; pointer-events: auto; }
.bd-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #292524;
  border: 2px solid #fff; margin-left: -6px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* context toolbar above the selection */
.bd-context { position: absolute; z-index: 25; display: flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px -12px rgba(41,37,36,.45); white-space: nowrap; }
.bd-context button { height: 34px; min-width: 34px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: transparent; color: #44403c; border-radius: 6px; font-weight: 500; font-size: .85rem; }
.bd-context button:hover { background: #f5f0e8; }
.bd-context button.on { background: var(--accent-soft); color: var(--accent); }
.bd-context .cx-danger:hover { color: var(--danger); background: #fef2f2; }
.bd-context .cx-glyph { font-size: 1rem; font-family: Georgia, serif; width: 34px; }
.bd-context .cx-font { min-width: 64px; justify-content: space-between; }
.bd-context .cx-num { font-size: .75rem; color: var(--muted); }
.cx-sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.cx-chip { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); display: block; }
.cx-chip.ring { background: #fff; border-width: 4px; }
.cx-chip.cx-text { border: 0; font: 700 17px Georgia, serif; display: grid; place-items: center; width: auto; height: auto; }
.bd-popover { position: absolute; z-index: 30; display: flex; flex-wrap: wrap; gap: 3px; max-width: 290px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px -12px rgba(41,37,36,.45); }
.bd-popover button { height: 32px; min-width: 32px; padding: 0 6px; display: grid; place-items: center; background: transparent; color: #44403c; border-radius: 6px; font-size: .85rem; }
.bd-popover button:hover { background: #f5f0e8; }
.bd-popover.grid { display: grid; grid-template-columns: repeat(7, 32px); }
.bd-popover .cx-sep { width: 100%; height: 1px; margin: 2px 0; }

@media (max-width: 900px) {
  .task-add, .task-row { grid-template-columns: 1fr 1fr; }
  .task-add input[name="title"], .task-row .task-title { grid-column: 1 / -1; }
  .bd-hint { display: none; }
}

@media (max-width: 700px) {
  header.top, main { padding-left: 1rem; padding-right: 1rem; }
  h1 { font-size: 1.6rem; }
  th, td { padding: .5rem .55rem; font-size: .88rem; }
}
