/* Workspace sections: nav flyouts, settings pages, tasks, boards, analytics and automations.
   Tokens only (see docs/UI_RULES.md). */

/* ---------- section sidebars (Meetings, Boards, Analytics, Automations) ---------- */
#app { grid-template-columns: var(--nav-w, 248px) auto minmax(0, 1fr) auto; }
#app.nav-collapsed { grid-template-columns: 68px auto minmax(0, 1fr) auto; }
@media (max-width: 900px) { #app, #app.nav-collapsed { grid-template-columns: 68px auto minmax(0, 1fr) auto; } }
html.desk #app, html.desk #app.nav-collapsed { grid-template-columns: 1fr; }
html.desk #subnav { display: none; }
#subnav { width: 0; position: relative; height: 100vh; transition: width .18s ease; z-index: 20; }
#app.has-sn #subnav { width: 256px; }
#app.has-sn.sn-closed #subnav { width: 0; }
.sn-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg2, var(--bg)); border-right: 1px solid var(--line); overflow: hidden; width: 256px; transition: transform .18s ease, opacity .18s; }
#app.sn-closed .sn-panel { transform: translateX(-100%); opacity: 0; pointer-events: none; }
#app:not(.has-sn) .sn-panel, #app:not(.has-sn) .sn-pull { display: none; }
.sn-pull { position: absolute; top: 18px; left: 0; z-index: 30; width: 18px; height: 40px; border-radius: 0 var(--r) var(--r) 0; background: var(--panel); border: 1px solid var(--line); border-left: 0; display: grid; place-items: center; color: var(--text3); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .18s; }
#app.sn-closed .sn-pull { opacity: 1; pointer-events: auto; }
.sn-pull:hover { color: var(--accent); width: 22px; }
.sn-head { display: flex; align-items: center; gap: var(--s1); padding: var(--s4) var(--s2) var(--s2) var(--s4); min-height: 56px; }
.sn-head .grow { flex: 1; }
.sn-title { font: 700 16px var(--font-display); letter-spacing: -.01em; color: var(--text); }
.sn-title:hover { color: var(--accent); }
.sb.sn-filter { display: flex; margin: 0 var(--s3) var(--s2); width: auto; max-width: none; }
.sb.mp-disc-q, .sb.mp-facet-q { display: flex; max-width: none; }
#popup .sb.pop-sb { display: flex; width: auto; max-width: none; margin: var(--s2) var(--s2) var(--s1); }
.sn-body { flex: 1; overflow-y: auto; padding: 0 var(--s2) var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.sn-sec-h { display: flex; align-items: center; justify-content: space-between; padding-right: 2px; }
.sn-sec-t { display: flex; align-items: center; gap: var(--s1); height: 28px; padding: 0 var(--s2) 0 var(--s1); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; flex: 1; text-align: left; }
.sn-sec-t:hover { color: var(--text2); }
.sn-chev { display: inline-grid; place-items: center; transition: transform .15s; color: var(--text3); }
.sn-sec-h.open .sn-chev, .sn-folder.open .sn-chev { transform: rotate(90deg); }
.sn-add { width: 24px; height: 24px; opacity: 0; }
.sn-sec:hover .sn-add, .sn-add:focus-visible { opacity: 1; }
.sn-items { display: flex; flex-direction: column; gap: 1px; }
.sn-item, .sn-folder { display: flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 var(--s2); border-radius: var(--r); color: var(--text2); font-size: 13.5px; width: 100%; text-align: left; }
.sn-item:hover, .sn-folder:hover { background: var(--hover); color: var(--text); }
.sn-item.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.sn-item.on .sn-ic { color: var(--accent); }
.sn-folder { color: var(--text); font-weight: 500; padding-left: 4px; }
.sn-folder-items { padding-left: var(--s5); display: flex; flex-direction: column; gap: 1px; }
.sn-ic { width: 18px; display: inline-grid; place-items: center; color: var(--text3); flex: none; }
.sn-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-meta { flex: none; font-size: 11.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.sn-empty { font-size: 12.5px; color: var(--text3); padding: var(--s1) var(--s2) var(--s2) var(--s5); }
.sn-loading { display: grid; place-items: center; padding: var(--s8); }
.sn-foot { border-top: 1px solid var(--line); padding: var(--s2); }
.np-foot-l { display: flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 var(--s2); border-radius: var(--r); font-size: 13px; color: var(--text2); }
.np-foot-l:hover { background: var(--hover); color: var(--text); }
.np-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text3); }
.np-dot.live { background: var(--good, #1f9d55); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good, #1f9d55) 18%, transparent); }
.np-dot.warn { background: var(--bad); }
/* narrow windows: the section sidebar floats over the page */
@media (max-width: 900px) {
  #app.has-sn #subnav { width: 0; }
  #app.has-sn:not(.sn-closed) .sn-panel { box-shadow: var(--shadow); z-index: 40; }
}

/* ---------- shared page frame for the overhauled sections ---------- */
.ws { padding: var(--s6) var(--s6) var(--s12); max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s6); }
.ws.wide { max-width: none; }
.ws-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; min-height: var(--h-md); }
.ws-head h1 { margin: 0; font: 700 26px var(--font-display); letter-spacing: -.02em; }
.ws-head .grow { flex: 1; }
.ws-head .ws-sub { color: var(--text3); font-size: 13.5px; }
.ws-sec { display: flex; flex-direction: column; gap: var(--s3); }
.ws-sec-h { display: flex; align-items: center; gap: var(--s2); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; }
.ws-sec-h .n { font-variant-numeric: tabular-nums; }
.ws-sec-h .grow { flex: 1; }
.ws-empty { border: 1px dashed var(--line2); border-radius: var(--r-lg); padding: var(--s8) var(--s6); display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; color: var(--text3); font-size: 13.5px; }
.ws-empty b { color: var(--text); font-size: 15px; }
.ws-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--panel2); }
.ws-tabs button, .ws-tabs a { height: 28px; padding: 0 var(--s3); border-radius: calc(var(--r) - 3px); font-size: 13px; color: var(--text2); display: inline-flex; align-items: center; gap: var(--s1); }
.ws-tabs .on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
@media (max-width: 700px) { .ws { padding: var(--s4) var(--s4) var(--s10); gap: var(--s4); } .ws-head h1 { font-size: 22px; } }

/* ---------- settings: appearance + connections ---------- */
.set-theme { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.set-theme button { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); border: 1px solid var(--line2); border-radius: var(--r-lg); background: var(--panel); text-align: left; font-size: 13.5px; font-weight: 600; }
.set-theme button.on { border-color: var(--accent); box-shadow: var(--focus-ring); }
.set-theme .sw { height: 64px; border-radius: var(--r); border: 1px solid var(--line); }
.set-theme .sw.light { background: linear-gradient(90deg, #f4f4f5 28%, #fff 0); }
.set-theme .sw.dark { background: linear-gradient(90deg, #17171a 28%, #0e0e10 0); }
.set-theme .sw.system { background: linear-gradient(135deg, #fff 50%, #0e0e10 0); }
.conn { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.conn:last-child { border-bottom: 0; }
.conn-ic { width: 36px; height: 36px; border-radius: var(--r); background: var(--panel2); display: grid; place-items: center; flex: none; }
.conn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.conn-main .muted { font-size: 12.5px; }
.conn-main .bad { color: var(--bad); }
.conn-act { display: flex; gap: var(--s2); flex: none; }

/* ---------- tasks ---------- */
.tk-view { max-width: 960px; }
.tk-search { width: 220px; height: var(--h-sm); font-size: 13px; }
.tk-new { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s1) var(--s1) var(--s3); border: 1px solid var(--line2); border-radius: var(--r-lg); background: var(--panel); transition: border-color .12s, box-shadow .12s; }
.tk-new:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.tk-new-ic { color: var(--text3); display: inline-grid; place-items: center; }
.tk-new-in { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 14.5px; height: var(--h-md); }
.tk-new-date { width: 150px; }
.tk-body { display: flex; flex-direction: column; gap: var(--s5); }
.tk-group { display: flex; flex-direction: column; gap: var(--s2); }
.tk-group-h { display: inline-flex; align-items: center; gap: var(--s2); align-self: flex-start; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); padding: 0 var(--s1); }
.tk-group-h.bad { color: var(--bad); }
.tk-group-h .n { font-weight: 500; color: var(--text3); letter-spacing: 0; }
.tk-chev { display: inline-grid; place-items: center; transition: transform .15s; }
.tk-group-h.closed .tk-chev { transform: rotate(-90deg); }
.tk-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.tk-row { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--s4); cursor: default; position: relative; }
.tk-row + .tk-row { border-top: 1px solid var(--line); }
.tk-row:hover { background: var(--hover); }
.tk-row.selected { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.tk-row > .selbox { display: none; }
.tk-check { flex: none; display: inline-grid; place-items: center; height: 22px; }
.tk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s1); }
.tk-text { font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.tk-row.done .tk-text { color: var(--text3); text-decoration: line-through; }
.tk-meta { display: flex; align-items: center; gap: var(--s1) var(--s3); flex-wrap: wrap; font-size: 12.5px; color: var(--text3); min-width: 0; }
.tk-due { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 var(--s2) 0 6px; border-radius: var(--pill); background: var(--panel2); color: var(--text2); font-size: 12px; font-weight: 500; }
.tk-due:hover { color: var(--accent); }
.tk-due.now { background: var(--accent-bg); color: var(--accent); }
.tk-due.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.tk-due.empty { background: none; padding: 0; opacity: 0; }
.tk-row:hover .tk-due.empty { opacity: 1; }
.tk-rec { display: inline-flex; align-items: center; gap: 4px; color: var(--text2); cursor: pointer; max-width: 220px; }
.tk-rec span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-rec:hover { color: var(--accent); }
.tk-src { display: inline-flex; align-items: center; gap: 4px; color: var(--text3); min-width: 0; max-width: 100%; }
.tk-src:hover { color: var(--accent); }
.tk-src-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tk-x { opacity: 0; flex: none; }
.tk-row:hover .tk-x { opacity: .7; }
@media (max-width: 700px) { .tk-search { width: 100%; order: 5; } .tk-new-date { width: 120px; } }

/* ---------- automations ---------- */
.au-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.au-tile { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.au-tile-l { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; }
.au-tile b { font: 700 22px var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.au-tile-s { font-size: 12px; color: var(--text3); }
.au-tile.bad b { color: var(--bad); }
.au-bar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.au-bar .grow { flex: 1; }
.au-bar select { height: var(--h-md); min-width: 200px; }
.au-search { width: 240px; height: var(--h-sm); font-size: 13px; }
.au-n { margin-left: 4px; font-size: 11.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.au-body { display: flex; flex-direction: column; gap: var(--s5); }
.au-group { display: flex; flex-direction: column; gap: var(--s2); }
.au-folder { display: inline-flex; align-items: center; gap: var(--s2); align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--text2); padding: 0 var(--s1); }
.au-folder .n { font-weight: 500; color: var(--text3); font-size: 12px; }
.au-folder.closed .tk-chev { transform: rotate(-90deg); }
.au-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.au-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s3) var(--s3) var(--s4); color: inherit; min-height: 72px; }
.au-row + .au-row { border-top: 1px solid var(--line); }
.au-row:hover { background: var(--hover); }
.au-row.is-off .au-main b, .au-row.is-off .au-ic { opacity: .6; }
.au-ic { width: 32px; height: 32px; border-radius: var(--r); background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.au-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.au-name { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.au-name b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-desc { font-size: 12.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-who { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-status { flex: none; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: var(--pill); display: inline-flex; align-items: center; gap: 4px; }
.au-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.au-status.live { color: var(--good, #1f9d55); background: color-mix(in srgb, var(--good, #1f9d55) 12%, transparent); }
.au-status.off { color: var(--text3); background: var(--panel2); }
.au-status.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.au-perf { display: flex; align-items: center; gap: var(--s3); flex: none; }
.au-perf-t { display: flex; flex-direction: column; font-size: 12px; color: var(--text3); width: 76px; line-height: 1.4; }
.au-perf-t b { color: var(--text); font-weight: 600; }
.au-perf-t .bad { color: var(--bad); }
.au-spark svg { display: block; }
.au-spark rect.v { fill: var(--accent); opacity: .75; }
.au-spark rect.e { fill: var(--bad); }
.au-spark rect.z { fill: var(--line2); }
.au-more { flex: none; }
.au-none { padding: var(--s4) 0; }
.au-note { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4); font-size: 13px; }
.au-note + .au-note { border-top: 1px solid var(--line); }
.au-note.unread { background: var(--accent-bg); }
.au-note .grow { flex: 1; }
@media (max-width: 900px) { .au-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } .au-perf .au-spark, .au-perf-t:last-child { display: none; } }
@media (max-width: 600px) { .au-perf { display: none; } .au-search { width: 100%; } }
/* activity log */
.au-log { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.au-log:has(> .ws-empty) { border: 0; background: none; }
.au-run + .au-run { border-top: 1px solid var(--line); }
.au-run summary { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); cursor: pointer; list-style: none; font-size: 13.5px; }
.au-run summary::-webkit-details-marker { display: none; }
.au-run summary:hover { background: var(--hover); }
.au-run-ic { display: inline-grid; place-items: center; flex: none; }
.au-run.ok .au-run-ic { color: var(--good, #1f9d55); }
.au-run.error .au-run-ic, .au-run.error .au-run-res { color: var(--bad); }
.au-run.skipped .au-run-ic { color: var(--text3); }
.au-run-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-run-res { font-size: 12px; font-weight: 600; color: var(--text2); flex: none; }
.au-run-ms, .au-run-at { font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }
.au-run-at { width: 130px; text-align: right; }
.au-run-b { padding: 0 var(--s4) var(--s3) calc(var(--s4) + 28px); display: flex; flex-direction: column; gap: var(--s1); font-size: 13px; }
.au-loadmore { align-self: center; }
/* templates */
.au-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }
.au-tpl { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); text-align: left; font-size: 13px; min-height: 130px; transition: border-color .12s, box-shadow .12s; }
.au-tpl:hover { border-color: var(--accent); box-shadow: var(--focus-ring); }
.au-tpl b { font-size: 14px; }
.au-tpl.blank { border-style: dashed; }
/* builder overview */
.au-edit .ab { max-width: none; }
.au-about { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.au-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.au-kpis > div { display: flex; flex-direction: column; }
.au-kpis b { font: 700 18px var(--font-display); font-variant-numeric: tabular-nums; }
.au-kpis b.bad { color: var(--bad); }
.au-kpis .muted { font-size: 11.5px; }
.au-fact { display: flex; justify-content: space-between; gap: var(--s3); font-size: 12.5px; }
.au-fact span:last-child { text-align: right; }
.au-field { display: flex; flex-direction: column; gap: var(--s1); font-size: 12.5px; }
.au-field > span:first-child { color: var(--text3); font-weight: 600; }
.au-people { display: flex; flex-direction: column; gap: 2px; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r); max-height: 180px; overflow-y: auto; }
.au-person { display: flex; align-items: center; gap: var(--s2); font-size: 13px; padding: 2px 0; }

/* ---------- analytics ---------- */
.an-search { width: 260px; height: var(--h-sm); font-size: 13px; }
.an-home-b { display: flex; flex-direction: column; gap: var(--s6); }
.an-folders { display: flex; flex-direction: column; gap: var(--s4); }
.an-folder-h { display: flex; align-items: center; gap: var(--s2); font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: var(--s2); }
.an-cards, .an-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }
.an-card { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); color: inherit; transition: border-color .12s, box-shadow .12s; }
.an-card:hover, .an-tpl:hover { border-color: var(--accent); box-shadow: var(--focus-ring); }
.an-card-ic { width: 36px; height: 36px; border-radius: var(--r); background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.an-card-m { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.an-card-m b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-card-m .muted { font-size: 12px; }
.an-tpl { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); text-align: left; font-size: 13px; min-height: 150px; position: relative; transition: border-color .12s, box-shadow .12s; }
.an-tpl b { font-size: 14px; }
.an-tpl .muted { font-size: 12.5px; line-height: 1.45; }
.an-tpl-n { margin-top: auto; font-size: 11.5px; color: var(--text3); }
.an-tpl.blank { border-style: dashed; }
.an-reps { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.an-rep { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(0, 220px) 120px; align-items: center; gap: var(--s3); padding: 0 var(--s4); height: 44px; color: inherit; font-size: 13.5px; }
.an-rep + .an-rep { border-top: 1px solid var(--line); }
.an-rep:hover { background: var(--hover); }
.an-rep b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-rep .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-all { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--accent); }
@media (max-width: 700px) { .an-rep { grid-template-columns: 20px minmax(0, 1fr); } .an-rep .muted { display: none; } .an-search { width: 100%; } }
/* dashboard */
.an-dash { gap: var(--s3); }
.an-crumbs { display: flex; align-items: center; gap: var(--s1); font-size: 12.5px; color: var(--text3); }
.an-crumbs a { color: var(--text3); }
.an-crumbs a:hover { color: var(--accent); }
.an-dash .dash { display: flex; flex-direction: column; gap: var(--s3); }
.an-filters { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.an-filters select { height: var(--h-sm); font-size: 13px; }
.an-filters .grow { flex: 1; }
.an-f-ic { color: var(--text3); display: inline-grid; place-items: center; }
.an-cmp { display: inline-flex; align-items: center; gap: var(--s1); font-size: 13px; color: var(--text2); }
.an-sep { width: 1px; height: 20px; background: var(--line); margin: 0 var(--s1); }
.an-chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 2px 0 var(--s2); border-radius: var(--pill); background: var(--accent-bg); color: var(--accent); font-size: 12.5px; }
.an-chip b { font-weight: 600; }
.an-chip-x { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; }
.an-chip-x:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.an-updated { font-size: 12px; }
.drillable [data-label] { cursor: pointer; }
.drillable.w-body:has(.chart-kpi, .kpi) { cursor: pointer; }
.an-drill { width: min(720px, 100vw); }
.an-drill-sub { font-size: 12px; }
.an-drill-b { padding: var(--s4); overflow: auto; flex: 1; display: flex; flex-direction: column; gap: var(--s3); }
.an-drill-n { font-size: 12.5px; }
.an-drill-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.an-drill-t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); font-weight: 600; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
.an-drill-t td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.an-drill-t td a { color: var(--accent); cursor: pointer; font-weight: 500; }
.an-drill-t tr:hover td { background: var(--hover); }
.an-page .an-main { display: flex; flex-direction: column; gap: var(--s4); }
/* the AI box as one compact line on section pages */
.ws .ai-box.compact { padding: var(--s3) var(--s4); gap: var(--s2); }
.ws .ai-box.compact .ai-head .muted { display: none; }
.ws .ai-box.compact textarea.ai-input { min-height: var(--h-lg); height: var(--h-lg); resize: none; font: 14px/1.4 var(--font); padding: 11px var(--s3); }
.ws .ai-box.compact textarea.ai-input:focus { height: 84px; }
.ws .ai-box.compact .ai-row { align-items: flex-start; }
.ws .ai-box.compact .ai-row .btn { height: var(--h-lg); }
.an-dash .dash { padding: 0; max-width: none; }
.an-filters select { height: var(--h-sm); font-size: 13px; }

/* ---------- boards ---------- */
.bc-gray { --bc: #8a8f98; } .bc-blue { --bc: #3b6ff5; } .bc-green { --bc: #1f9d55; } .bc-yellow { --bc: #d4a106; } .bc-orange { --bc: #ea7a1c; }
.bc-red { --bc: #e5484d; } .bc-purple { --bc: #8b5cf6; } .bc-pink { --bc: #e2549c; } .bc-teal { --bc: #129a9a; }
.bd-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bc, var(--text3)); flex: none; display: inline-block; }
.bd-label { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s2); border-radius: var(--pill); font-size: 11.5px; font-weight: 600; color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, transparent); }
.bd-search { width: 200px; height: var(--h-sm); font-size: 13px; }
.bd-star.on { color: #e5a00d; }
.bd-star.on svg { fill: currentColor; }
/* home */
.bd-home-b { display: flex; flex-direction: column; gap: var(--s6); }
.bd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s3); }
.bd-card { position: relative; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); color: inherit; transition: border-color .12s, box-shadow .12s; }
.bd-card:hover { border-color: var(--accent); box-shadow: var(--focus-ring); }
.bd-card-prev { display: flex; gap: 4px; height: 44px; align-items: flex-end; }
.bd-card-prev span { flex: 1; border-radius: 4px; background: color-mix(in srgb, var(--bc) 30%, transparent); height: 100%; }
.bd-card-prev span:nth-child(2n) { height: 70%; } .bd-card-prev span:nth-child(3n) { height: 45%; }
.bd-card-m { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd-card-m b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 28px; }
.bd-card-m .muted { font-size: 12px; }
.bd-card .bd-star { position: absolute; top: var(--s3); right: var(--s3); opacity: 0; }
.bd-card:hover .bd-star, .bd-card .bd-star.on { opacity: 1; }
/* new board + templates */
.bd-new { width: min(760px, calc(100vw - 2 * var(--s4))); max-height: 86vh; display: flex; flex-direction: column; }
.bd-new-b { overflow-y: auto; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); }
.bd-new-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; margin-top: var(--s2); }
.bd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s2); }
.bd-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); text-align: left; font-size: 12.5px; transition: border-color .12s, box-shadow .12s; }
.bd-tile:hover { border-color: var(--accent); box-shadow: var(--focus-ring); }
.bd-tile b { font-size: 13.5px; }
.bd-tile.blank { border-style: dashed; }
.bd-tile-ic { width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); margin-bottom: 2px; flex: none; }
.bd-tile-cols { font-size: 11.5px; color: var(--text3); margin-top: auto; padding-top: var(--s1); }
.bd-rec { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: 13.5px; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-lg); }
.bd-rec select { width: auto; min-width: 140px; height: var(--h-md); }
.bd-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.bd-trow { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
.bd-trow + .bd-trow { border-top: 1px solid var(--line); }
.bd-trow-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.bd-trow-m .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the board */
.bd-page { gap: var(--s3); padding-bottom: var(--s4); height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
.bd-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.bd-head .grow { flex: 1; }
.bd-head .btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.bd-name { margin: 0; font: 700 24px var(--font-display); letter-spacing: -.02em; outline: none; border-radius: var(--r); padding: 0 4px; margin-left: -4px; }
.bd-name:focus { background: var(--hover); }
.bd-sub { font-size: 13px; color: var(--text3); }
.bd-columns { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--s4); padding-bottom: var(--s2); }
.bd-lane-cols { display: flex; gap: var(--s3); align-items: flex-start; min-width: max-content; }
.bd-columns:not(.laned) .bd-lane-cols { min-height: 100%; }
.bd-lane { display: flex; flex-direction: column; gap: var(--s2); }
.bd-lane-h { display: flex; align-items: center; gap: var(--s2); font-size: 13.5px; position: sticky; left: 0; }
.bd-col { width: 284px; flex: none; display: flex; flex-direction: column; background: var(--panel2); border-radius: var(--r-lg); max-height: 100%; border: 1px solid transparent; }
.bd-columns.laned .bd-col { max-height: none; }
.bd-col.over { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.bd-col.dragging { opacity: .5; }
.bd-col.col-drop { border-color: var(--accent); }
.bd-col-h { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s3); min-height: 40px; }
.bd-col-h[draggable="true"] { cursor: grab; }
.bd-col-h .grow { flex: 1; }
.bd-col-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-count { font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; }
.bd-count.over { color: var(--bad); font-weight: 700; }
.bd-done { color: var(--good, #1f9d55); display: inline-grid; place-items: center; }
.bd-col-add { opacity: 0; }
.bd-col:hover .bd-col-add { opacity: 1; }
.bd-list-c { display: flex; flex-direction: column; gap: var(--s2); padding: 0 var(--s2) var(--s1); overflow-y: auto; min-height: 12px; }
.bd-card-i { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); cursor: pointer; outline: none; }
.bd-card-i:hover { border-color: var(--line2); }
.bd-card-i:focus-visible { box-shadow: var(--focus-ring); border-color: var(--accent); }
.bd-card-i.dragging { opacity: .35; }
.bd-col.is-done .bd-card-t { color: var(--text2); }
.bd-card-t { font-size: 13.5px; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.bd-card-f { display: flex; justify-content: space-between; gap: var(--s2); font-size: 12px; }
.bd-card-f span:last-child { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bd-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.bd-meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: 12px; color: var(--text3); }
.bd-meta .grow { flex: 1; }
.bd-m, .bd-m-due { display: inline-flex; align-items: center; gap: 3px; }
.bd-m.ok { color: var(--good, #1f9d55); }
.bd-m-due { padding: 1px 6px; border-radius: var(--pill); background: var(--panel2); color: var(--text2); }
.bd-m-due.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.bd-m-due.now { background: var(--accent-bg); color: var(--accent); }
.bd-link { color: var(--text2); max-width: 130px; }
.bd-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-link:hover { color: var(--accent); }
.bd-av { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.bd-marker { height: 3px; border-radius: 2px; background: var(--accent); margin: -2px 0; }
.bd-add-wrap { padding: var(--s1) var(--s2) var(--s2); }
.bd-add { display: flex; align-items: center; gap: var(--s2); width: 100%; height: 32px; padding: 0 var(--s2); border-radius: var(--r); color: var(--text3); font-size: 13px; }
.bd-add:hover { background: var(--hover); color: var(--text); }
.bd-add-box { display: flex; flex-direction: column; gap: var(--s2); }
.bd-add-in { width: 100%; border: 1px solid var(--accent); border-radius: var(--r); padding: var(--s2); font: inherit; font-size: 13.5px; resize: none; background: var(--panel); outline: none; box-shadow: var(--focus-ring); }
.bd-add-row { display: flex; align-items: center; gap: var(--s2); }
.bd-col-new { background: none; border: 1px dashed var(--line2); }
.bd-addcol { display: flex; align-items: center; gap: var(--s2); height: 44px; padding: 0 var(--s3); color: var(--text3); font-size: 13.5px; width: 100%; }
.bd-addcol:hover { color: var(--accent); }
/* card drawer + customize */
.bd-drawer { width: min(560px, 100vw); }
.bd-drawer .drawer-head { display: flex; align-items: center; gap: var(--s2); }
.bd-drawer .drawer-head .grow { flex: 1; }
.bd-cd, .bd-cust { padding: var(--s4) var(--s5); overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: var(--s3); }
.bd-cd-where { font-size: 12.5px; }
.bd-cd-title { font: 700 20px/1.3 var(--font-display); letter-spacing: -.01em; border: 0; outline: none; resize: none; background: transparent; padding: var(--s1) 0; overflow: hidden; }
.bd-cd-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: var(--s3); min-height: var(--h-md); }
.bd-cd-l { font-size: 12.5px; color: var(--text3); }
.bd-cd-v select, .bd-cd-v input { max-width: 240px; }
.bd-cd-labels { display: flex; flex-wrap: wrap; gap: var(--s1); }
.bd-cd-labels .bd-label { cursor: pointer; }
.bd-cd-labels .bd-label.off { opacity: .45; background: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bc) 40%, transparent); }
.bd-cd-links { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.bd-cd-link { display: inline-flex; align-items: center; gap: 2px; padding-left: var(--s2); border-radius: var(--pill); background: var(--panel2); font-size: 12.5px; }
.bd-cd-link a { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.bd-cd-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; margin-top: var(--s2); }
.bd-cd-desc { width: 100%; font: inherit; font-size: 14px; line-height: 1.55; min-height: 110px; }
.bd-cl { display: flex; flex-direction: column; gap: 2px; }
.bd-cl-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-bottom: var(--s2); }
.bd-cl-bar span { display: block; height: 100%; background: var(--good, #1f9d55); }
.bd-cl-i { display: flex; align-items: center; gap: var(--s2); padding: 4px 0; font-size: 13.5px; }
.bd-cl-i span { flex: 1; }
.bd-cl-i.done span { color: var(--text3); text-decoration: line-through; }
.bd-cl-i .icon-btn { opacity: 0; }
.bd-cl-i:hover .icon-btn { opacity: 1; }
.bd-cl-new { margin-top: var(--s1); }
.bd-cd-foot { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 12px; }
.bd-cd-foot .grow { flex: 1; }
.bd-cust-s { display: flex; flex-direction: column; gap: var(--s2); padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.bd-cust-s:last-child { border-bottom: 0; }
.bd-cust-h { font-weight: 700; font-size: 14px; }
.bd-cust-hint { font-size: 12.5px; }
.bd-cust-cols, .bd-cust-labels { display: flex; flex-direction: column; gap: var(--s2); }
.bd-cust-col { display: flex; align-items: center; gap: var(--s2); }
.bd-cust-col input.input:not(.bd-wip) { flex: 1; min-width: 0; }
.bd-cust-col select { width: 92px; }
.bd-wip { width: 84px; }
.bd-cb { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.bd-cust-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.bd-cust-s .btn { align-self: flex-start; }
@media (max-width: 700px) { .bd-col { width: 82vw; } .bd-search { width: 100%; } }
.bd-cd > *, .bd-cust > * { flex: none; }
@media (max-width: 700px) {
  .tk-new { flex-wrap: wrap; padding: var(--s2); }
  .tk-new-in { flex: 1 1 calc(100% - 40px); }
  .tk-new-date { flex: 1; }
  .ws-tabs { max-width: 100%; overflow-x: auto; }
  .ws-tabs button, .ws-tabs a { white-space: nowrap; }
  .au-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .au-tile b { font-size: 18px; }
  .bd-head .bd-search { order: 5; width: 100%; }
}

/* ---------- Build with AI dialog ---------- */
.btn.ai-launch { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--panel)); border-color: color-mix(in srgb, var(--accent) 35%, var(--line2)); color: var(--accent); font-weight: 600; }
.btn.ai-launch:hover { border-color: var(--accent); }
.ai-dialog.ail { width: min(640px, calc(100vw - 2 * var(--s4))); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ail-top { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s5) var(--s3); }
.ail-top .grow { flex: 1; }
.ail-badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #8b5cf6); flex: none; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.ail-title { font: 700 18px var(--font-display); letter-spacing: -.01em; }
.ail-intro { font-size: 13px; margin-top: 2px; }
.ail .ai-box { border: 0; background: none; padding: 0 var(--s5); box-shadow: none; }
.ail .ai-box .ai-head { display: none; }
.ail .ai-box textarea.ai-input { min-height: 96px; font: 15px/1.5 var(--font); padding: var(--s3); }
.ail-ex { padding: var(--s4) var(--s5) var(--s5); display: flex; flex-direction: column; gap: var(--s2); background: var(--panel2); border-top: 1px solid var(--line); margin-top: var(--s4); }
.ail-ex-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; }
.ail-ex-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.ail-ex-i { display: flex; gap: var(--s2); align-items: flex-start; text-align: left; padding: var(--s3); border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--text2); }
.ail-ex-i:hover { border-color: var(--accent); color: var(--text); }
.ail-ex-i span:first-child { color: var(--accent); display: inline-grid; margin-top: 2px; }
@media (max-width: 600px) { .ail-ex-g { grid-template-columns: 1fr; } }

/* ---------- one page head everywhere: title left, search centered, actions right ---------- */
.ws-head.ph { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 340px) minmax(0, 1fr); align-items: center; gap: var(--s4); }
.ws-head.ph:not(.has-search) { grid-template-columns: minmax(0, 1fr) 0 auto; }
.ph-l { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.ph-l h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-c { display: flex; justify-content: center; min-width: 0; }
.ph-r { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); flex-wrap: wrap; }
@media (max-width: 900px) {
  .ws-head.ph, .ws-head.ph:not(.has-search) { grid-template-columns: minmax(0, 1fr) auto; }
  .ph-c { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; }
  .ph-c .sb { width: 100%; }
}
/* the search box */
/* every search and filter field (searchBox in ui.js): looks like the sidebar's search */
.sb { display: inline-flex; align-items: center; gap: var(--s2); width: 100%; max-width: 340px; height: var(--h-md); padding: 0 var(--s3); border-radius: var(--pill); background: var(--raised); border: 1px solid var(--line); color: var(--text3); transition: background .12s, border-color .12s, box-shadow .12s; cursor: text; }
.sb:hover { border-color: var(--line2); }
.sb:focus-within { background: var(--panel); border-color: var(--accent); box-shadow: var(--focus-ring); color: var(--accent); }
.sb > .sb-ic { display: inline-grid; place-items: center; flex: none; width: auto; color: inherit; }
.sb-in { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 13.5px; color: var(--text); height: 100%; }
.sb-in::placeholder { color: var(--text3); }
.sb-in::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- one dropdown style everywhere ---------- */
select, select.input {
  -webkit-appearance: none; appearance: none;
  height: var(--h-md); padding: 0 34px 0 var(--s3); line-height: normal;
  border-radius: var(--r); border: 1px solid var(--line2); background-color: var(--panel); color: var(--text);
  font-size: 13.5px; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  transition: border-color .12s, box-shadow .12s;
}
select:hover { border-color: var(--text3); }
select:focus, select.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
select.sm, select.input.sm, .sm > select { height: var(--h-sm); font-size: 13px; padding-right: 30px; background-position: right 8px center; background-size: 14px; }
select:disabled { opacity: .55; cursor: default; }
select[multiple] { height: auto; background-image: none; padding: var(--s1); }
/* every select keeps room for its arrow, whatever a page sets for padding */
select:not([multiple]) { padding-right: 32px !important; }
/* page head: a flex row that stacks the search under the title when the page is narrow */
#main { container-type: inline-size; container-name: page; }
.ws-head.ph, .ws-head.ph:not(.has-search) { display: flex; flex-wrap: nowrap; }
.ph-l { flex: none; max-width: 45%; }
.ph-c { flex: 1; min-width: 160px; }
.ph-r { flex: none; flex-wrap: nowrap; }
.ws-head.ph:not(.has-search) .ph-c { min-width: 0; }
@container page (max-width: 860px) {
  .ws-head.ph { flex-wrap: wrap; }
  .ws-head.ph .ph-l { flex: 1; max-width: none; }
  .ws-head.ph .ph-c { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .ws-head.ph .ph-c .sb { max-width: none; }
  .ws-head.ph .ph-r { flex-wrap: wrap; }
}
#app.has-sn #subnav, .sn-panel { width: 240px; }
#app.has-sn.sn-closed #subnav { width: 0; }
@container page (max-width: 860px) {
  .ws-head.ph .ph-l { flex: 1 0 auto; max-width: 100%; }
  .ws-head.ph .ph-r { flex: 0 1 auto; flex-wrap: wrap; }
}

/* ---------- the shared date picker ---------- */
.dpi { display: inline-flex; align-items: center; gap: var(--s1); height: var(--h-md); padding: 0 var(--s3) 0 var(--s2); border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel); color: var(--text); font-size: 13.5px; white-space: nowrap; transition: border-color .12s, box-shadow .12s; max-width: 100%; }
.dpi:hover { border-color: var(--text3); }
.dpi:focus-visible, .dpi[aria-expanded="true"] { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.dpi.sm { height: var(--h-sm); font-size: 13px; padding: 0 var(--s2) 0 6px; }
.dpi-ic { display: inline-grid; place-items: center; color: var(--text3); }
.dpi.empty .dpi-l { color: var(--text3); }
.dpi:disabled { opacity: .55; cursor: default; }
.dpi.fv { border-color: transparent; background: transparent; padding-left: 0; }
.dpi.fv:hover { border-color: transparent; background: transparent; }
.dp { position: fixed; z-index: 120; width: 260px; padding: var(--s3); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: dp-in .12s ease-out; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px); } }
.dp-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s2); }
.dp-m { font-size: 13.5px; font-weight: 600; }
.dp-nav { width: 28px; height: 28px; border-radius: var(--r); display: grid; place-items: center; color: var(--text2); }
.dp-nav:hover { background: var(--hover); color: var(--text); }
.dp-w, .dp-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-w span { font-size: 10.5px; font-weight: 600; color: var(--text3); text-align: center; padding: 2px 0 4px; }
.dp-d { height: 32px; border-radius: 8px; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; position: relative; }
.dp-d:hover { background: var(--hover); }
.dp-d.dp-out { color: var(--text3); opacity: .55; }
.dp-d.dp-wkend:not(.dp-sel) { color: var(--text2); }
.dp-d.dp-today { color: var(--accent); font-weight: 700; }
.dp-d.dp-today::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.dp-d.dp-focus:not(.dp-sel) { box-shadow: inset 0 0 0 1px var(--line2); }
.dp-d.dp-sel { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.dp-d.dp-sel::after { background: var(--accent-ink); }
.dp-q { display: flex; align-items: center; gap: var(--s1); margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.dp-q .grow { flex: 1; }
.dp-qb { height: 26px; padding: 0 var(--s2); border-radius: var(--pill); font-size: 12px; color: var(--text2); background: var(--panel2); }
.dp-qb:hover { color: var(--accent); background: var(--accent-bg); }
.dp-qb.clear { background: none; color: var(--text3); }
/* daily note header: fixed controls, Today lit when you're on today */
.day-nav .day-today.on { background: var(--accent-bg); color: var(--accent); border-color: transparent; font-weight: 600; }
.day-nav .day-cal { width: var(--h-md); padding: 0; }

/* ---------- boards v2: full-height columns, record cards, one head row ---------- */
.ws.bd-page { height: 100vh; max-height: 100vh; overflow: hidden; padding-bottom: var(--s3); }
.bd-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: nowrap; min-height: var(--h-md); }
.bd-head-l { display: flex; align-items: center; gap: var(--s2); flex: none; min-width: 0; max-width: 40%; }
.bd-head-l .bd-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-head-c { flex: 1; display: flex; justify-content: center; min-width: 160px; }
.bd-head-r { display: flex; align-items: center; gap: var(--s2); flex: none; }
@container page (max-width: 900px) { .bd-head { flex-wrap: wrap; } .bd-head-l { max-width: none; flex: 1; } .bd-head-c { order: 3; flex-basis: 100%; justify-content: flex-start; } .bd-head-c .sb { max-width: none; } }
.bd-columns { flex: 1; min-height: 0; }
.bd-columns:not(.laned) .bd-lane-cols { height: 100%; min-height: 0; align-items: stretch; }
.bd-columns:not(.laned) .bd-col { max-height: none; height: 100%; }
.bd-col { background: var(--panel2); }
.bd-list-c { flex: 1; min-height: 40px; }
.bd-col-new { background: none; height: auto !important; align-self: flex-start; }
/* a record card */
.bd-card-i.rec { gap: var(--s2); padding: var(--s3); }
.bd-rc-h { display: flex; align-items: flex-start; gap: var(--s2); }
.bd-rc-ic { flex: none; display: inline-grid; place-items: center; margin-top: 2px; }
.bd-rc-h .bd-card-t { font-weight: 600; }
.bd-rc-fields { display: flex; flex-direction: column; gap: 4px; padding-top: var(--s1); border-top: 1px solid var(--line); }
.bd-card-f { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-size: 12.5px; }
.bd-rc-l { color: var(--text3); white-space: nowrap; }
.bd-rc-v { color: var(--text); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bd-rc-v.money { font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-rc-foot { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text3); }
/* the new-board dialog */
.bd-new { width: min(640px, calc(100vw - 2 * var(--s4))); max-height: 88vh; }
.bd-new-f { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: var(--s3); font-size: 13.5px; }
.bd-new-f > span { color: var(--text2); font-weight: 500; }
.bd-opts { display: flex; flex-direction: column; gap: var(--s2); }
.bd-opt { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); text-align: left; transition: border-color .12s, box-shadow .12s; }
.bd-opt:hover { border-color: var(--line2); }
.bd-opt.on { border-color: var(--accent); box-shadow: var(--focus-ring); }
.bd-opt-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.bd-opt-m b { font-size: 13.5px; }
.bd-opt-m .muted { font-size: 12px; }
.bd-opt-cols { display: flex; gap: 4px; flex-wrap: wrap; margin-top: var(--s1); }
.bd-chip { font-size: 11px; padding: 1px 7px; border-radius: var(--pill); color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, transparent); font-weight: 600; }
.bd-opt-r { color: var(--accent); flex: none; display: inline-grid; place-items: center; width: 18px; }
.bd-new-foot { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.bd-new-foot .muted { font-size: 12px; max-width: 320px; }
.bd-new-foot .grow { flex: 1; }
.bd-head { flex-wrap: nowrap; }
.bd-head .grow, .bd-tools .grow { flex: 1; }
.bd-head-l { max-width: none; flex: 0 1 auto; }
.bd-sub { white-space: nowrap; }
.bd-tools { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.bd-tools .sb { max-width: 280px; }
.bd-tools .btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

/* ---------- one frame for every page (older views follow the same spacing and type as .ws) ---------- */
.view, .view.wide, .view.daily-view, .view.rec-page, .view.rec-wide { padding: var(--s6) var(--s6) var(--s12); }
.set-main { padding: var(--s6) var(--s6) var(--s12); }
.view-head, .lv-head { margin-bottom: var(--s5); min-height: var(--h-md); }
.view-head h1, .lv-title h1, .set-head h1, .ws-head h1, .day-title h1, .rv-title h1 { font: 700 26px/1.2 var(--font-display); letter-spacing: -.02em; }
.dash-empty { border: 1px dashed var(--line2); gap: var(--s2); padding: var(--s8) var(--s6); }
.dash-empty .big-num { font: 700 17px/1.3 var(--font); letter-spacing: 0; color: var(--text); }
.dash-empty .muted { font-size: 13.5px; }
@media (max-width: 700px) { .view, .view.wide, .view.daily-view, .set-main { padding: var(--s4) var(--s4) var(--s10); } }

/* records boards: one + per column (in its header), record cards that open the record */
.bd-col-add { width: 26px; height: 26px; border-radius: 8px; color: var(--text2); background: var(--raised); box-shadow: 0 0 0 1px var(--line); }
.bd-col-add:hover { color: var(--accent-ink); background: var(--accent); box-shadow: none; }
.bd-empty { margin: var(--s2); padding: var(--s5) var(--s3); border: 1px dashed var(--line2); border-radius: var(--r); text-align: center; color: var(--text3); font-size: 12.5px; }
.bd-card-i.rec { cursor: pointer; position: relative; }
.bd-rc-h .bd-card-t { flex: 1; min-width: 0; }
.bd-rc-x { width: 22px; height: 22px; margin: -2px -4px 0 0; opacity: 0; flex: none; }
.bd-card-i.rec:hover .bd-rc-x, .bd-rc-x:focus-visible { opacity: 1; }
@media (hover: none) { .bd-rc-x { opacity: .6; } }
.bd-card-i.just-added { animation: bd-added 1.2s var(--ease); }
@keyframes bd-added { 0% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.bd-col .bd-col-add, .bd-col:hover .bd-col-add { opacity: 1; }
.bd-new-cf { margin-top: var(--s4); }
.bd-cf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-cf { height: 30px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--line2); background: var(--raised); font-size: 13px; color: var(--text2); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.bd-cf:hover { border-color: var(--text); color: var(--text); }
.bd-cf.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.bd-new-cf { margin: var(--s2) 0 var(--s4); }
.bd-cf { display: inline-flex; align-items: center; gap: 4px; }
.bd-cf.fixed { opacity: .7; }
.bd-cf.add { border-style: dashed; color: var(--text3); background: transparent; }
.bd-cf-x { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: -6px; border-radius: 50%; color: inherit; opacity: .6; }
.bd-cf-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); }
.bd-cf-x svg { width: 12px; height: 12px; }

/* ── Maps ─────────────────────────────────────────────────────────── */
#main > .maps-page { position: absolute; inset: 0; overflow: hidden; }
.maps-page > .mp-stage { position: absolute; inset: 0; }
.mp-map { position: absolute; inset: 0; background: var(--panel2); }
.mp-map.picking { cursor: crosshair; }
.mp-panel { position: absolute; top: 16px; left: 16px; bottom: 16px; width: 340px; display: flex; flex-direction: column; gap: 12px; padding: 16px; z-index: 5;
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.mp-head { display: flex; align-items: center; gap: 8px; }
.mp-head h1 { margin: 0; font: 600 22px/1 var(--font-display); letter-spacing: -.03em; }
.mp-count { font-size: 12.5px; color: var(--text3); }
.mp-search { width: 100%; }
.mp-group { display: grid; gap: 6px; }
.mp-row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mp-label-s { font-size: 11.5px; font-weight: 600; color: var(--text3); }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--pill); border: 1px solid var(--line2); background: var(--raised); font-size: 12.5px; color: var(--text2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.mp-chip:hover { border-color: var(--text); color: var(--text); }
.mp-chip:active { transform: scale(.97); }
.mp-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.mp-chip.on .mp-n { color: inherit; opacity: .7; }
.mp-sw { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.mp-n { font-size: 11.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.mp-seg { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
.mp-seg button { padding: 5px 0; font-size: 12.5px; }
.mp-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); cursor: pointer; }
.mp-more summary { font-size: 12.5px; color: var(--text3); cursor: pointer; padding: 2px 0; }
.mp-more[open] summary { margin-bottom: 6px; }
.mp-list { flex: 1; min-height: 0; overflow-y: auto; margin: 2px -8px -8px; padding: 0 4px 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.mp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border-radius: 10px; text-align: left; transition: background var(--t-fast) var(--ease); }
.mp-row:hover { background: var(--hover); }
.mp-row.on { background: var(--raised); box-shadow: 0 0 0 1px var(--line); }
.mp-row-m { flex: 1; min-width: 0; display: grid; }
.mp-row-t { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-row-a { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-empty { padding: 24px 8px; text-align: center; color: var(--text3); font-size: 13px; }
.mp-status { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 6; padding: 8px 14px; border-radius: var(--pill); background: var(--text); color: var(--bg); font-size: 12.5px; box-shadow: var(--shadow); }
.mp-error { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text3); padding: 40px; text-align: center; }

/* pins: a colored dot with the record type's icon; size = how often notes mention it */
.mp-pin { position: relative; display: flex; align-items: center; transform: translateY(50%); cursor: pointer; }
.mp-dot { width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(21,20,15,.35); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.mp-dot svg { width: 60%; height: 60%; }
.mp-pin.pinned .mp-dot { border-style: dashed; }
.mp-label { position: absolute; left: calc(var(--s) + 6px); white-space: nowrap; font: 600 12px var(--font); color: var(--text); background: var(--raised); padding: 3px 8px; border-radius: var(--pill);
  box-shadow: 0 1px 3px rgba(21,20,15,.18); opacity: 0; transform: translateX(-4px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); pointer-events: none; }
.mp-pin:hover .mp-dot, .mp-pin.hover .mp-dot, .mp-pin.on .mp-dot { transform: scale(1.18); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent), 0 4px 12px rgba(21,20,15,.35); }
.mp-pin:hover .mp-label, .mp-pin.hover .mp-label, .mp-pin.on .mp-label { opacity: 1; transform: none; }
.mp-cluster { width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font: 600 13px var(--font);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--text) 18%, transparent), 0 4px 12px rgba(21,20,15,.3); transform: translateY(50%); }

/* the selected place */
.mp-card { position: absolute; top: 16px; right: 16px; width: 360px; max-height: calc(100% - 32px); overflow-y: auto; z-index: 5; padding: 16px; display: grid; gap: 12px; align-content: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: pop-in var(--t-base) var(--ease) both; }
.mp-card-h { display: flex; align-items: flex-start; gap: 8px; }
.mp-card-t { flex: 1; display: flex; align-items: center; gap: 8px; font: 600 18px/1.2 var(--font-display); letter-spacing: -.02em; }
.mp-card-t a:hover { color: var(--link); }
.mp-card-addr { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--text2); }
.mp-card-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--text3); }
.mp-card-stats b { color: var(--text); }
.mp-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-sec { font-size: 11.5px; font-weight: 600; color: var(--text3); margin-top: 4px; }
.mp-notes { display: grid; gap: 8px; }
.mp-note { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); transition: border-color var(--t-fast) var(--ease); }
.mp-note:hover { border-color: var(--line2); }
.mp-note-m { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text3); }
.mp-note-b { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mp-conns { display: grid; gap: 2px; }
.mp-conn { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; text-align: left; font-size: 13px; }
.mp-conn:hover { background: var(--hover); }
.mp-conn-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mp-conn .muted { font-size: 11.5px; }

/* pinning */
.mp-pinbox { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 7; width: min(420px, calc(100% - 32px)); display: grid; gap: 8px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: pop-in var(--t-base) var(--ease) both; }
.mp-pinbox-t { font-size: 13.5px; }
.mp-pinbox-r { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }

/* setup */
.mp-setup { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.mp-setup-c { max-width: 560px; padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.mp-setup-c h1 { margin: 12px 0 6px; font: 600 26px/1.1 var(--font-display); letter-spacing: -.03em; }
.mp-setup-c ol { padding-left: 20px; display: grid; gap: 10px; font-size: 14px; color: var(--text2); }
.mp-setup-c code { font: 12.5px var(--code); background: var(--panel2); padding: 1px 6px; border-radius: 5px; }
.mp-setup-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-bg); color: var(--accent); }

@media (max-width: 860px) {
  .mp-panel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 46%; }
  .mp-card { top: 12px; left: 12px; right: 12px; width: auto; max-height: 50%; }
}
.mp-keyerr { position: absolute; left: calc(340px + 48px); right: 32px; top: 50%; transform: translateY(-50%); max-width: 520px; margin: 0 auto; z-index: 6; display: grid; gap: 10px; padding: 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.mp-keyerr b { font: 600 17px var(--font-display); }
.mp-keyerr p { margin: 0; color: var(--text2); font-size: 14px; line-height: 1.55; }
.mp-keyerr code { justify-self: start; font: 12px var(--code); background: var(--panel2); padding: 2px 8px; border-radius: 6px; color: var(--text3); }
.mp-keyerr .btn { justify-self: start; }
@media (max-width: 860px) { .mp-keyerr { left: 16px; right: 16px; } }

/* Maps overhaul: search bar, tabs, routes, areas */
.mp-panel { gap: 10px; }
.mp-tabs { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
.mp-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 0; font-size: 13px; }
.mp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; margin: 0 -16px -16px; padding: 2px 16px 16px; }
.mp-body > .mp-list { flex: 1; margin: 0 -8px; padding: 0 4px; border-top: 0; overflow: visible; }
.mp-filters { border: 1px solid var(--line); border-radius: 14px; background: var(--raised); padding: 0 12px; }
.mp-filters > summary { list-style: none; display: flex; align-items: center; gap: 8px; height: 40px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text2); }
.mp-filters > summary::-webkit-details-marker { display: none; }
.mp-filters[open] { padding-bottom: 12px; display: grid; gap: 10px; }
.mp-clear { margin-left: auto; font-size: 12px; color: var(--link); }
.mp-sw.lg { width: 12px; height: 12px; }
.mp-new { width: 100%; }

/* search bar over the map */
.mp-searchbar { position: absolute; top: 16px; left: calc(340px + 32px); right: 16px; max-width: 520px; margin: 0 auto; z-index: 6; }
.mp-search-in { width: 100%; height: 46px; padding: 0 16px 0 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); font: 400 14.5px var(--font); color: var(--text); box-shadow: var(--shadow); outline: none; transition: border-color var(--t-fast) var(--ease); }
.mp-search-in:focus { border-color: var(--accent); box-shadow: var(--shadow), var(--focus-ring); }
.mp-search-ic { position: absolute; left: 16px; top: 15px; color: var(--text3); pointer-events: none; }
.mp-search-list { position: absolute; top: 52px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; animation: pop-in var(--t-fast) var(--ease) both; }
.mp-search-it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: left; }
.mp-search-it.on, .mp-search-it:hover { background: var(--hover); }
.mp-search-iic { width: 22px; display: grid; place-items: center; color: var(--text3); flex: none; }
.mp-search-m { display: grid; min-width: 0; }
.mp-search-m b { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-search-m span { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-card { top: calc(16px + 46px + 12px); max-height: calc(100% - 90px); }

/* temporary pin, route stops, area corners */
.mp-temp { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--text) 18%, transparent), 0 3px 10px rgba(0,0,0,.3); transform: translateY(50%); }
.mp-stop { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; border: 2px solid #fff; display: grid; place-items: center; font: 700 12px var(--font); box-shadow: 0 3px 10px rgba(0,0,0,.3); transform: translateY(50%); }
.mp-stop.first { background: var(--good); }
.mp-stop.last { background: var(--text); }
.mp-vertex { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); transform: translateY(50%); }

/* routes */
.mp-route-top { display: flex; gap: 6px; align-items: center; }
.mp-route-top .input { flex: 1; }
.mp-stops { display: grid; gap: 4px; }
.mp-stop-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); cursor: grab; }
.mp-stop-row.dragging { opacity: .4; }
.mp-stop-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 11px var(--font); flex: none; margin-top: 1px; }
.mp-stop-n.first { background: var(--good); }
.mp-stop-n.last { background: var(--text); }
.mp-stop-act { display: flex; gap: 2px; margin-left: auto; opacity: .55; }
.mp-stop-row:hover .mp-stop-act { opacity: 1; }
.mp-leg { font-size: 11.5px; color: var(--text3); }
.mp-route-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mp-route-sum { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--bg); }
.mp-route-sum b { font: 600 20px var(--font-display); letter-spacing: -.02em; }
.mp-route-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-route-page { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--link); }
.mp-route-row { display: flex; align-items: center; gap: 6px; padding-right: 4px; }
.mp-route-row .mp-row-m { text-align: left; flex: 1; }
.mp-hint { font-size: 12px; }

/* areas */
.mp-draw-hint { padding: 10px 12px; border-radius: 12px; background: var(--accent-bg); color: var(--text); font-size: 13px; }
.mp-swatches { display: flex; gap: 8px; }
.mp-swatch { width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px transparent; transition: box-shadow var(--t-fast) var(--ease); }
.mp-swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--c); }

/* notes on the card */
.mp-note-add { display: grid; gap: 6px; }
.mp-note-add .btn { justify-self: end; }
.mp-note-in { min-height: 56px; font-size: 13px; }

/* right-click menu (inside Google's InfoWindow) */
.mp-ctx { display: grid; gap: 2px; min-width: 190px; font: 13px var(--font); color: #15140F; }
.mp-ctx-it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-align: left; }
.mp-ctx-it:hover { background: #F3EFE7; }

/* addresses that weren't found */
.mp-unfound { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.mp-unfound > summary { font-size: 12.5px; color: var(--bad); cursor: pointer; padding: 4px 4px 8px; }
.mp-fix { display: grid; gap: 6px; padding: 10px; margin: 0 4px 8px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.mp-fix-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 500; }
.mp-fix-h .muted { font-weight: 400; font-size: 12px; }
.mp-fix-r { display: flex; gap: 6px; }
.mp-status.clickable { cursor: pointer; }
@media (max-width: 860px) { .mp-searchbar { left: 12px; right: 12px; top: 12px; } .mp-card { top: 70px; } }

/* Maps v3: views, sources, facets, progress */
.mp-view-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 8px 4px 2px; border-radius: 10px; font: 600 19px/1.1 var(--font-display); letter-spacing: -.025em; transition: background var(--t-fast) var(--ease); }
.mp-view-btn:hover { background: var(--hover); }
.mp-view-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-vm { position: absolute; top: 56px; left: 12px; z-index: 20; min-width: 230px; padding: 6px; display: grid; gap: 1px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); animation: pop-in var(--t-fast) var(--ease) both; }
.mp-vm-it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; text-align: left; color: var(--text2); }
.mp-vm-it:hover { background: var(--hover); color: var(--text); }
.mp-vm-it.on { color: var(--text); font-weight: 600; }
.mp-vm-it.on::after { content: '✓'; margin-left: auto; color: var(--accent); }
.mp-vm-it.danger:hover { color: var(--bad); }
.mp-vm-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.mp-sec2 { border-bottom: 1px solid var(--line); padding: 2px 0 10px; }
.mp-sec2 > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 2px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.mp-sec2 > summary::-webkit-details-marker { display: none; }
.mp-sec2 > summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--text3); border-bottom: 1.5px solid var(--text3); transform: rotate(45deg); transition: transform var(--t-fast) var(--ease); }
.mp-sec2[open] > summary::after { transform: rotate(225deg); }
.mp-badge { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.mp-srcs { display: grid; gap: 2px; }
.mp-src { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; transition: background var(--t-fast) var(--ease); }
.mp-src:hover { background: var(--hover); }
.mp-src input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.mp-src-m { flex: 1; min-width: 0; display: grid; }
.mp-src-m b { font-size: 13px; font-weight: 500; }
.mp-src-m span { font-size: 11.5px; color: var(--text3); }
.mp-src:not(.on) .mp-src-m b { color: var(--text3); }
.mp-none { font-size: 12.5px; padding: 4px 2px; }
.mp-clear-all { align-self: flex-start; font-size: 12.5px; color: var(--link); padding: 2px; }
.mp-list-h { font-size: 12.5px; padding: 4px 2px 0; }
.mp-list-h b { font-weight: 600; }
.mp-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-bg); font-size: 13px; }
.mp-row { cursor: pointer; }
.mp-row-x { opacity: 0; width: 24px; height: 24px; }
.mp-row:hover .mp-row-x { opacity: 1; }
.mp-search-head { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }
.mp-status { display: inline-flex; align-items: center; gap: 10px; }
.mp-prog { width: 90px; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 30%, transparent); overflow: hidden; }
.mp-prog i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s var(--ease); }
.mp-banner { position: absolute; left: calc(340px + 48px); right: 32px; bottom: 24px; max-width: 560px; margin: 0 auto; z-index: 8; display: grid; gap: 8px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--bad); border-radius: 14px; box-shadow: var(--shadow); }
.mp-banner b { font-size: 14.5px; }
.mp-banner p { margin: 0; font-size: 13px; color: var(--text2); line-height: 1.55; }
.mp-banner-r { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 860px) { .mp-banner { left: 12px; right: 12px; } }

/* Maps v4: individual pins (no cluster bubbles), two tabs */
.mp-tabs { grid-template-columns: repeat(2, 1fr); }
.mp-pin { transform: translateY(50%); }
.mp-dot { width: var(--s); height: var(--s); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(21,20,15,.35); }
.mp-dot svg { display: none; }
.mp-pin:hover .mp-dot, .mp-pin.hover .mp-dot, .mp-pin.on .mp-dot { transform: scale(1.45); }
.mp-label { left: calc(var(--s) + 8px); }
.mp-route-top .input, .mp-route-name { height: var(--h-md); }

/* Map card: notes in the shared editor; nearby list; route autosave line */
.mp-compose { min-height: 64px; padding: 8px 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--raised); font-size: 13.5px; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.mp-compose:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.mp-compose .block, .mp-compose .bl { margin: 0; }
.mp-more-btn { width: 100%; padding: 8px; border-radius: 10px; font-size: 12.5px; color: var(--link); text-align: center; }
.mp-more-btn:hover { background: var(--hover); }
.mp-card .mp-conns { max-height: none; }
.mp-route-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }

/* Maps: places from Google (category chips, results, saving a place as a record) */
.mp-disc-chiprow { position: relative; margin-top: 8px; }
.mp-disc-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; scroll-behavior: smooth; }
/* when chips run past the edge: a fade says there's more, and a round arrow scrolls to it */
.mp-disc-chiprow.fade-r .mp-disc-chips { mask-image: linear-gradient(to right, #000 calc(100% - 64px), transparent); }
.mp-disc-chiprow.fade-l .mp-disc-chips { mask-image: linear-gradient(to left, #000 calc(100% - 64px), transparent); }
.mp-disc-chiprow.fade-l.fade-r .mp-disc-chips { mask-image: linear-gradient(to right, transparent, #000 64px, #000 calc(100% - 64px), transparent); }
.mp-disc-more { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--text); border: 1px solid var(--line2); box-shadow: var(--shadow); z-index: 1; }
.mp-disc-more:hover { background: var(--hover); }
.mp-disc-more.prev { left: 0; }
.mp-disc-more.next { right: 0; }
.mp-disc-more svg { width: 15px; height: 15px; }
.mp-disc-chips::-webkit-scrollbar { display: none; }
.mp-disc-chip { flex: none; box-shadow: var(--shadow); background: var(--raised); }
.mp-disc-chip svg { width: 15px; height: 15px; }
.mp-stage.has-disc .mp-card { top: calc(16px + 46px + 8px + 32px + 12px); max-height: calc(100% - 130px); }
.mp-disc { position: absolute; top: calc(16px + 46px + 8px + 32px + 12px); right: 16px; width: 360px; max-height: calc(100% - 130px); overflow-y: auto; z-index: 5; padding: 16px; display: grid; gap: 10px; align-content: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: pop-in var(--t-base) var(--ease) both; }
.mp-disc-list { display: grid; gap: 2px; margin: 0 -8px; }
.mp-disc-n { font-size: 12px; }
.mp-disc-row { align-items: flex-start; cursor: pointer; }
.mp-disc-row .mp-row-m { gap: 2px; }
.mp-disc-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--text2); }
.mp-disc-meta.lg { font-size: 13px; }
.mp-disc-meta > span + span::before { content: '·'; margin-right: 8px; color: var(--text3); }
.mp-disc-meta .good { color: var(--good); }
.mp-disc-meta .bad { color: var(--bad); }
.mp-disc-stars { color: var(--warn); font-weight: 600; }
.mp-disc-saved { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; color: var(--accent); padding: 4px 6px; border-radius: 8px; }
.mp-disc-saved:hover { background: var(--accent-bg); }
.mp-disc-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.mp-disc-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--link); }
.mp-disc-form { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); }
.mp-disc-form .mp-sec { margin-top: 2px; }
.mp-disc-linkto .mp-chip { gap: 4px; padding-right: 4px; }
.mp-disc-x { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: inherit; opacity: .7; }
.mp-disc-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); }
.mp-disc-problem { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); }
.mp-disc-problem p { margin: 0; color: var(--text2); font-size: 13.5px; line-height: 1.55; }
.mp-disc-problem code { justify-self: start; font: 12px var(--code); background: var(--panel2); padding: 2px 8px; border-radius: 6px; color: var(--text3); white-space: normal; }
.mp-disc-problem .btn { justify-self: start; }
.mp-disc-redo { position: absolute; left: 50%; top: calc(16px + 46px + 8px + 32px + 12px); transform: translateX(-50%); z-index: 6; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--pill); background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; font-weight: 500; color: var(--text); animation: pop-in var(--t-fast) var(--ease) both; }
.mp-disc-redo:hover { border-color: var(--text); }
/* a Google place: a round marker with the category's icon; a saved one shows a bookmark */
.mp-gp { --c: var(--accent); position: relative; display: flex; align-items: center; transform: translateY(50%); cursor: pointer; }
.mp-gp-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--bg); border: 2px solid var(--raised); box-shadow: var(--shadow);
  transition: transform var(--t-fast) var(--ease); }
.mp-gp-dot svg { width: 14px; height: 14px; }
.mp-gp.saved { --c: var(--good); }
.mp-gp .mp-label { left: 32px; }
.mp-gp:hover .mp-gp-dot, .mp-gp.hover .mp-gp-dot, .mp-gp.on .mp-gp-dot { transform: scale(1.18); }
.mp-gp:hover .mp-label, .mp-gp.hover .mp-label, .mp-gp.on .mp-label { opacity: 1; transform: none; }
@media (max-width: 860px) {
  .mp-disc { top: 112px; left: 12px; right: 12px; width: auto; max-height: 50%; }
  .mp-stage.has-disc .mp-card { top: 112px; }
  .mp-disc-redo { top: 112px; }
}
.mp-disc-go { justify-self: start; }
.mp-disc-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-bg); color: var(--accent); }
.mp-disc-other { justify-self: start; font-size: 12.5px; color: var(--text3); padding: 2px 0; }
.mp-disc-other:hover { color: var(--link); }
