:root {
  --ink: #17222d;
  --ink-2: #4b5967;
  --muted: #6b7784;
  --line: #dde3e8;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --brand: #1d3b5a;
  --accent: #2f6fd6;
  --danger: #b8453c;
  --warn: #b7791f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 6px 20px rgba(20, 30, 40, .08);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h2, h3 { margin: 0; line-height: 1.25; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); }

/* ---- top bar ---- */
.topbar {
  height: 52px; display: flex; align-items: center; gap: 20px; padding: 0 16px;
  background: var(--brand); color: #fff; position: relative; z-index: 1000;
}
.brand { color: #fff; font-weight: 700; letter-spacing: .01em; font-size: 16px; white-space: nowrap; }
.brand span { font-weight: 400; opacity: .7; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: #cfdbe7; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.topbar nav a[aria-current] { color: #fff; background: rgba(255, 255, 255, .12); }
.topbar nav a:hover { text-decoration: none; color: #fff; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #e8a33a; color: #1b1b1b; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.search { margin-left: auto; position: relative; width: min(340px, 40vw); }
.search input { width: 100%; height: 34px; border-radius: 8px; border: 0; padding: 0 12px; font: inherit; }
.search-results {
  position: absolute; top: 40px; right: 0; width: max(100%, 320px); max-height: 60vh; overflow: auto;
  background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px;
}
.search-results button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; font: inherit; cursor: pointer; }
.search-results button:hover { background: var(--bg); }
.search-results p { margin: 8px 10px; }

/* ---- layout ---- */
.layout { display: grid; grid-template-columns: 250px 1fr; height: calc(100vh - 52px); height: calc(100dvh - 52px); }
body.panel-open .layout { grid-template-columns: 250px 1fr 420px; }
.map-wrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #eef1f4; }
body.with-streets #map { background: #ddd; }

.filters { background: var(--surface); border-right: 1px solid var(--line); overflow: auto; padding: 14px 16px; }
.filters-toggle { display: none; }
.filters fieldset { border: 0; padding: 0; margin: 16px 0 0; }
.filters legend, .field { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; display: block; }
.field select { display: block; width: 100%; margin-top: 6px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.filters > .filters-body > .field + .field, .filters .field { margin-top: 16px; }
.filters .filters-body > .field:first-child { margin-top: 0; }
.check { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; color: var(--ink); }
.legend { display: grid; grid-template-columns: 1fr; gap: 4px 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.legend i.hollow { background: #fff; border: 1.5px solid #6c7682; }
.legend-item:has(.ringed) { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.legend i.ringed { background: #fff; border: 2.5px solid #1d2a3a; }
.legend-item b { margin-left: auto; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- form controls ---- */
input, select, textarea { font: inherit; color: var(--ink); }
.stack input, .stack select, .stack textarea, .inline-note input, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: #fff;
}
.stack textarea { resize: vertical; }
.stack input:focus, .stack select:focus, .stack textarea:focus, .inline-note input:focus, .search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.stack { display: grid; gap: 10px; }
.stack label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.actions.spread { justify-content: space-between; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 14px; border-radius: 7px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #b9c3cc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #274c72; }
.btn:disabled { opacity: .55; cursor: default; }
.linkish { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.linkish.danger { color: var(--danger); font-size: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: middle;
  color: color-mix(in srgb, var(--c) 78%, black); background: color-mix(in srgb, var(--c) 14%, white);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.due { font-size: 12px; color: var(--ink-2); }
.due.soon { color: var(--warn); font-weight: 600; }
.due.overdue { color: var(--danger); font-weight: 600; }

/* ---- map tooltip and popup ---- */
.leaflet-tooltip.tip { border: 0; border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font: inherit; max-width: 280px; white-space: normal; color: var(--ink); }
.tip strong { display: block; font-size: 13px; }
.tip-status, .tip-pills { margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 12px 14px; font: inherit; min-width: 220px; }
.pop strong { font-size: 14px; display: block; padding-right: 12px; }
.pop-actions { display: flex; gap: 8px; margin-top: 10px; }
.leaflet-container { font: inherit; }

/* ---- side panel ---- */
.panel { background: var(--bg); border-left: 1px solid var(--line); overflow: auto; position: relative; padding: 0 14px 30px; }
.panel-close { position: sticky; top: 8px; float: right; margin-top: 8px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; z-index: 2; }
.panel-head { padding: 18px 2px 8px; }
.panel-head h2 { font-size: 20px; margin: 2px 40px 4px 0; }
.panel-head p { margin: 2px 0; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px !important; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.card h3 { font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card details { margin-top: 10px; }
.attach-list { list-style: none; margin: 0 0 10px; padding: 0; }
.attach-list li { padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.attach-list li:last-child { border-bottom: 0; }
.attach-list .linkish { float: right; margin-left: 10px; }
.card summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-bottom: 8px; }
.status-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.status-picker label { display: block; cursor: pointer; }
.status-picker input { position: absolute; opacity: 0; pointer-events: none; }
.status-picker span { display: block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); background: #fff; }
.status-picker input:checked + span { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; }
.status-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.plain { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 13px; }
.tag { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; background: var(--bg); color: var(--ink-2); font-weight: 700; }
.tag.open { background: #fdf0da; color: #8a5a10; }
.tag.done { background: #dff3e5; color: #1f6b36; }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.inline-note { display: flex; gap: 8px; margin-bottom: 12px; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.timeline li { border-left: 2px solid var(--line); padding-left: 10px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1f2a35; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 3000;
  transition: opacity .15s, transform .15s; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); }

/* ---- to-do page ---- */
.todo-page .page { max-width: 1060px; margin: 0 auto; padding: 22px 16px 60px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; min-width: 96px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.group { margin-top: 26px; }
.group > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.group > h2 .count { color: var(--muted); font-weight: 400; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; }
.task-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) auto; gap: 14px; padding: 12px 14px; align-items: center; }
.task-title a { font-weight: 600; color: var(--ink); font-size: 14px; }
.task-title .muted { display: block; margin-top: 2px; }
.task-next { font-size: 13px; }
.task-next .focus { color: var(--muted); font-size: 12px; display: block; }
.task-side { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.task .touch-form { border-top: 1px solid var(--line); padding: 14px; }
.pri1 { border-left: 3px solid var(--danger); }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; color: var(--muted); }

/* ---- standing signals ---- */
.tag.sig { background: #fbe9d0; color: #7a4a06; }
.sig { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin: 10px 0; font-size: 13px; }
.sig.flag { border-left-color: var(--warn); }
.sig p, .sig ul { margin: 4px 0; }
.sig-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12px; }
.sig-table th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 3px 4px; }
.sig-table td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
.sig-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sig-table tr.hi td { font-weight: 600; background: #fdf3e3; }

/* ---- narrow screens ---- */
@media (max-width: 900px) {
  .layout, body.panel-open .layout { grid-template-columns: 1fr; }
  .filters { position: absolute; z-index: 900; top: 52px; left: 0; right: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 0; max-height: calc(100dvh - 52px); }
  .filters-toggle { display: block; width: 100%; border: 0; background: var(--surface); padding: 10px 16px; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
  .filters .filters-body { display: none; padding: 0 16px 16px; }
  .filters.open .filters-body { display: block; }
  .map-wrap { margin-top: 40px; }
  .panel { position: fixed; inset: auto 0 0 0; height: 78dvh; z-index: 1500; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: var(--shadow); }
  .topbar { gap: 10px; }
  .search { width: auto; flex: 1; }
  .task-main { grid-template-columns: 1fr; gap: 8px; }
  .task-side { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .brand span { display: none; }
  .row2 { grid-template-columns: 1fr; }
}

/* ---- sign-in, account, team (2026-10-22) ---- */
.signin-page {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #2b5379 0%, transparent 60%), linear-gradient(160deg, #15304b 0%, #1d3b5a 55%, #24496d 100%);
}
.signin { width: min(400px, 100%); display: grid; gap: 18px; }
.signin-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.signin-brand img { border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.signin-brand div { display: grid; line-height: 1.25; }
.signin-brand strong { font-size: 16px; letter-spacing: .01em; }
.signin-brand span { font-size: 12px; opacity: .7; text-transform: uppercase; letter-spacing: .12em; }
.signin-card { background: var(--surface); border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(5, 15, 30, .35); }
.signin-card h1 { margin: 0 0 4px; font-size: 21px; }
.signin-card p { margin: 0; }
.signin-card .stack, .signin-card.stack { gap: 14px; }
.signin-card input { height: 40px; }
.signin-foot { color: rgba(255, 255, 255, .55); text-align: center; margin: 0; }
.btn.wide { width: 100%; height: 40px; justify-content: center; font-weight: 600; }
.form-error { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fbeceb; color: var(--danger); font-size: 13px; }

.usermenu { position: relative; margin-left: 12px; }
.todo-page .usermenu, .usermenu:first-child { margin-left: auto; }
.topbar nav + .usermenu { margin-left: auto; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14);
  color: #fff; font: 600 12px/1 inherit; letter-spacing: .03em; cursor: pointer;
}
.avatar:hover, .avatar[aria-expanded="true"] { background: rgba(255, 255, 255, .26); }
.usermenu-pop {
  position: absolute; right: 0; top: 42px; width: 240px; background: var(--surface); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 6px; display: grid;
}
.usermenu-who { display: grid; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.usermenu-who span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.usermenu-pop a, .usermenu-pop button { display: block; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); border: 0; background: none; font: inherit; cursor: pointer; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--bg); text-decoration: none; }

.page.narrow { max-width: 760px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--bg); }
.session-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.session-list li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #eef1f4; color: var(--ink-2); }
.tag.ok { background: #e5f4ea; color: #23703c; }
.tag.wait { background: #fdf3e2; color: #8a5a12; }
.tag.off { background: #f0f1f3; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.team-table { width: 100%; border-collapse: collapse; }
.team-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 0 10px 8px 0; }
.team-table td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.team-table select { height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.team-table .actions { text-align: right; white-space: nowrap; }
.btn.small-btn { padding: 4px 10px; font-size: 12px; margin-left: 4px; }
.btn.danger { color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } .signin-card { padding: 22px; } }
.stack label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--ink); }
.stack label.check input { width: auto; height: auto; margin: 0; }
.session-list .tag { justify-self: start; }

body.with-context #map { background: #f2f3f1; }
.context-tiles { filter: grayscale(1) contrast(.85) brightness(1.08); opacity: .55; }

/* Email drafts in the side panel */
.tag.draft { background: #e3ecf7; color: #1d4f86; }
.dtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dtabs button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 3px 11px; font-size: 12px; cursor: pointer; color: var(--ink); }
.dtabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.dtabs button.sent:not(.on) { color: var(--ink-2); }
.dtabs button.add { border-style: dashed; color: var(--ink-2); }
.dfield { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.dfield .dlabel { flex: 0 0 52px; color: var(--ink-2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.dfield .dval { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dfield.body { border-bottom: 0; }
.dfield .btn.small-btn { margin-left: auto; flex: none; }
.dbody { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.5; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; max-height: 340px; overflow: auto; }
.dwarn { white-space: pre-line; background: #fdf3e2; color: #7a4a06; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin: 0 0 8px; }
.dinfo { white-space: pre-line; background: #f1f3f5; color: #4a5560; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin: 0 0 8px; }

/* Pending queue: every unsent draft, opened from the top bar */
.pending-btn { color: #cfdbe7; background: none; border: 0; padding: 6px 10px; border-radius: 6px; font: inherit; cursor: pointer; white-space: nowrap; }
.pending-btn:hover, .pending-btn[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, .12); }
.badge.draft { background: #cfe0f5; color: #1d4f86; }
.layout { position: relative; }
.queue { position: absolute; z-index: 1200; top: 0; bottom: 0; left: 0; width: 360px; background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow); overflow: auto; padding: 0 14px 30px; }
.queue-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); padding: 12px 0 4px; z-index: 1; }
.queue-head h2 { font-size: 17px; }
.queue-head .panel-close { position: static; margin: 0; float: none; }
.qgov { border-top: 1px solid var(--line); padding: 10px 0; }
.qgov.on { background: #f1f6fc; margin: 0 -14px; padding: 10px 14px; }
.qgov strong { display: block; }
.qitem { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 9px; margin-top: 6px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.qitem:hover { border-color: var(--accent); }
.qitem .qarea { font-weight: 600; flex: none; }
.qitem .qsub { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tag.check { background: #fdf3e2; color: #8a5a12; flex: none; }
.tag.ready { background: #e5f4ea; color: #23703c; flex: none; }
.sent-form { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 8px; background: var(--bg); }
@media (max-width: 900px) {
  .queue { position: fixed; top: 52px; width: auto; right: 0; }
}

/* ---- Work page (2026-10-29): tiles, tabbed worklist, and the panel as a drawer ---- */
.work { max-width: 1280px; margin: 0 auto; padding: 18px 16px 60px; }
body.work-page.panel-open .work { margin-right: min(600px, 45vw); max-width: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 2px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font: inherit; color: var(--ink); cursor: pointer; border-top: 3px solid var(--line); }
.tile:hover { border-color: #b9c3cc; }
.tile.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.tile.good { border-top-color: #2e9a4f; }
.tile.warn { border-top-color: var(--warn); }
.tile.bad { border-top-color: var(--danger); }
.tile b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.tile em { font-style: normal; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.bad em { color: var(--danger); font-weight: 600; }
.worklist { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px 10px; }
.worklist-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.wtabs { display: flex; gap: 2px; }
.wtabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink-2); padding: 13px 12px 11px; border-bottom: 2px solid transparent; cursor: pointer; }
.wtabs button.on { color: var(--ink); border-bottom-color: var(--brand); }
.wtabs .count { font-weight: 400; color: var(--muted); }
#wfilter { margin-left: auto; width: min(300px, 100%); height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; }
#wfilter:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 3px 11px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); }
.chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.wtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.wtable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 4px 10px 8px 0; white-space: nowrap; }
.wtable td { padding: 9px 10px 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.wtable tbody tr[data-i] { cursor: pointer; }
.wtable tbody tr[data-i]:hover td { background: #f7f9fb; }
.wtable tbody tr.on td { background: #eaf2fc; }
.wtable tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wtable td:first-child { padding-left: 6px; }
.wtable th:first-child { padding-left: 6px; }
.wtable td strong { display: block; font-weight: 600; }
.wtable .wnote { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #7a4a06; font-size: 12px; margin-top: 3px; max-width: 360px; }
.wtable .wnote.info { color: #6b7680; }
.wtable .wnext { max-width: 340px; color: var(--ink-2); }
.wtable .wact { text-align: right; white-space: nowrap; }
.wtable .when { display: block; font-weight: 600; white-space: nowrap; }
.wtable .when.now { color: #23703c; }
.wtable .when.wait { color: var(--warn); }
.wtable .tag { display: inline-block; white-space: nowrap; }   /* .check alone is the checkbox label rule */
#wnote { margin: 10px 0 0; }
body.work-page .panel { position: fixed; top: 52px; right: 0; bottom: 0; width: min(600px, 45vw); z-index: 1000; box-shadow: var(--shadow); padding-top: 0; }
.drawer-nav { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; background: var(--bg); padding: 10px 0 8px; border-bottom: 1px solid var(--line); margin: 0 -2px; }
.drawer-nav #row-pos { flex: 1; text-align: center; }
.drawer-nav .btn.small-btn { margin-left: 0; }
.drawer-nav .panel-close { position: static; float: none; margin: 0; }
.reply-dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 18px; box-shadow: 0 20px 50px rgba(5, 15, 30, .3); }
.reply-dialog::backdrop { background: rgba(15, 25, 35, .35); }
.reply-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.reply-head h2 { font-size: 17px; }
.reply-head .panel-close { position: static; float: none; margin: 0; }
@media (max-width: 1100px) {
  body.work-page.panel-open .work { margin-right: 0; }
  body.work-page .panel { width: min(520px, 100vw); }
}
@media (max-width: 900px) {
  body.work-page .panel { top: auto; width: auto; }
  .wtable th:nth-child(n+4), .wtable td:nth-child(n+4) { display: none; }
  .wtable.send th:nth-child(5), .wtable.send td:nth-child(5), .wtable.send th:nth-child(6), .wtable.send td:nth-child(6) { display: table-cell; }
  .wtable.send th:nth-child(2), .wtable.send td:nth-child(2), .wtable.send th:nth-child(4), .wtable.send td:nth-child(4) { display: none; }
  .wtable .wact { display: table-cell !important; }
  .wtable .wnote { max-width: 150px; }
  .wtabs button { padding: 12px 8px 10px; }
}
