/* Skimmer-parity layout, light theme (DESIGN.md palette) */
:root {
  --primary: #0C3A6D;   /* deep navy — headings, links, buttons, topbar */
  --gold: #C68728;      /* accent / CTA / selected */
  --green: #5BAD3D;     /* paid / finished */
  --bg: #F2F5F9;        /* page background */
  --surface: #FFFFFF;   /* cards, panels, tables */
  --blue2: #3E5F98;     /* secondary blue */
  --warm: #C05621;      /* warnings / danger */
  --sky: #2C7BC9;       /* info accents */
  --text: #16233A;
  --muted: #5B6B84;
  --border: #DBE2EC;
  --side-bg: #0C3A6D;   /* sidebar stays navy for the brand identity */
  --side-text: #C7D3E6;
  --side-border: #1B4B82;
  --sidebar-w: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--primary); }

#shell { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
#sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--side-bg);
  border-right: 1px solid var(--side-border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  margin-left: 0; transition: margin-left .25s ease;
}
#shell.side-collapsed #sidebar { margin-left: calc(-1 * var(--sidebar-w)); }
.brand { display: flex; align-items: baseline; gap: 8px; padding: 18px 16px 14px; border-bottom: 1px solid var(--side-border); }
.brand-mark { font-size: 22px; font-weight: 800; color: var(--gold); letter-spacing: 1px; }
.brand-name { font-size: 13px; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: 1.5px; }
#nav { flex: 1; padding: 8px 0; }
.nav-item, .nav-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; color: var(--side-text); cursor: pointer; font-size: 13.5px;
  border-left: 3px solid transparent; user-select: none;
}
.nav-item:hover, .nav-group-head:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active {
  background: rgba(255,255,255,.14); color: #fff; border-left-color: var(--gold);
}
.nav-sub { display: none; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item { padding-left: 34px; font-size: 13px; }
.nav-caret { font-size: 10px; transition: transform .15s; }
.nav-group.open .nav-caret { transform: rotate(90deg); }
.sidebar-foot { padding: 12px 16px; font-size: 11px; color: var(--side-text); border-top: 1px solid var(--side-border); }

/* sidebar pull tab — looks like a handle you pull out, but it's a click target */
.pull-tab {
  position: fixed; left: var(--sidebar-w); top: 50%; transform: translateY(-50%);
  z-index: 25; width: 13px; height: 62px; padding: 0;
  background: var(--side-bg); border: 1px solid var(--side-border); border-left: none;
  border-radius: 0 9px 9px 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: left .25s ease;
}
.pull-tab:hover { background: #1B4B82; }
.pt-grip { width: 4px; height: 4px; border-radius: 50%; background: #9FB0C8; }
#shell.side-collapsed .pull-tab { left: 0; }

/* ---------- topbar ---------- */
#body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary); color: #fff; padding: 10px 22px 10px 14px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
#sidebarToggle { font-size: 16px; line-height: 1; padding: 6px 10px; }
.topbar-company { font-weight: 600; font-size: 15px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.bell { position: relative; }
.bell-count {
  position: absolute; top: -4px; right: -4px; background: var(--gold); color: #fff;
  border-radius: 9px; font-size: 10px; padding: 1px 5px; font-weight: 700;
}
#alertsPanel {
  position: absolute; right: 18px; top: 52px; z-index: 40; width: 380px; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 30px rgba(22,35,58,.18);
}
.alert-row { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.alert-row.urgent { border-left: 3px solid var(--warm); }
.alert-row .when { color: var(--muted); font-size: 11px; }
.alert-row.unread { background: #EEF4FB; }

/* ---------- page ---------- */
#page { padding: 22px 26px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 21px; font-weight: 700; margin: 0; color: var(--primary); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-note { color: var(--muted); font-size: 12.5px; margin: -10px 0 14px; }

/* buttons */
.btn {
  background: var(--primary); color: #fff; border: 1px solid transparent; border-radius: 6px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.btn:hover { filter: brightness(1.15); }
.btn-accent { background: var(--gold); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.45); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-outline { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: #EEF4FB; filter: none; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-danger { background: var(--surface); border-color: var(--warm); color: var(--warm); }
.btn:disabled { opacity: .4; cursor: default; }

/* filter bar */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-bar label { color: var(--muted); font-size: 12px; }
select, input[type=text], input[type=date], input[type=number], input[type=email], textarea {
  background: var(--surface); color: var(--text); border: 1px solid #C6D0DE; border-radius: 6px;
  padding: 6px 9px; font-size: 13px; font-family: inherit;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--gold); }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); }

/* tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; box-shadow: 0 1px 3px rgba(22,35,58,.06); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 12px; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: #F0F3F8;
}
tr.colfilters th { padding: 4px 8px; background: #E9EEF5; }
tr.colfilters input { width: 100%; min-width: 60px; padding: 4px 6px; font-size: 12px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F3F7FC; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }
.empty-state { padding: 34px; text-align: center; color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions a { margin-left: 10px; font-size: 12.5px; cursor: pointer; }
.row-actions a.danger { color: var(--warm); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* status pills */
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--primary); color: #fff; white-space: nowrap;
}
.pill.green { background: var(--green); }
.pill.gold { background: var(--gold); }
.pill.warm { background: var(--warm); color: #fff; }
.pill.sky { background: var(--sky); color: #fff; }
.pill.blue { background: var(--blue2); }
.pill.muted { background: #E4E9F1; color: var(--muted); }
.type-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 700;
  background: var(--blue2); color: #fff; white-space: nowrap;
}

/* cards / tiles */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(22,35,58,.06); }
.card h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.card .big { font-size: 24px; font-weight: 800; color: var(--text); }
.card .big.gold { color: var(--gold); }
.card .big.green { color: var(--green); }
.card .big.sky { color: var(--sky); }
.card .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.card-link { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.card-link:hover { border-color: var(--gold); box-shadow: 0 3px 12px rgba(22,35,58,.14); }
.card-link:hover h3 { color: var(--gold); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(22,35,58,.06); }
.panel h2 { margin: 0 0 12px; font-size: 15px; color: var(--primary); font-weight: 700; }
.panel h2.gold { color: var(--gold); }
tbody tr[data-i] { cursor: pointer; }
tbody tr[data-i]:hover { background: rgba(12, 58, 109, 0.06); }

/* tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab {
  padding: 8px 16px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; }
.check-row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; font-size: 13.5px; cursor: pointer; background: var(--card); transition: border-color .12s, background .12s; }
.check-row:hover { border-color: var(--gold); }
.check-row input { display: none; }
.check-row .check-box { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; flex: none; position: relative; }
.check-row input:checked + .check-box { background: var(--gold); border-color: var(--gold); }
.check-row input:checked + .check-box::after { content: "✓"; position: absolute; inset: -1px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.check-row:has(input:checked) { border-color: var(--gold); background: rgba(196, 135, 40, .08); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 6px; }
.check-group { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--card); }
.check-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gold); margin-bottom: 6px; }
.check-group .check-row { margin: 0 0 4px; }
.form-foot { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.save-note { color: var(--green); font-size: 13px; }

/* star rating (customers: more stars = easier) */
.stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.star-picker { display: flex; gap: 4px; }
.star-btn { background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--border); padding: 2px 4px; }
.star-btn.on { color: var(--gold); }
.star-btn:hover { color: var(--gold); transform: scale(1.12); }
.star-hint { font-size: 12px; margin-top: 2px; }

/* customer pool info block (detail modal) */
.pool-info { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; background: var(--card); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pool-info-grid { display: flex; gap: 22px; flex-wrap: wrap; }
.pool-info-grid > div { display: flex; flex-direction: column; gap: 1px; }
.pool-info-grid span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.pool-info-grid b { font-size: 13.5px; font-weight: 600; }
.pool-info-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#cd-scan-status { font-size: 12.5px; }

/* modal */
#modal-root {
  position: fixed; inset: 0; background: rgba(22,35,58,.45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
/* display:flex above beats the hidden attribute's UA display:none — without this
   the backdrop permanently covers the app and eats every click */
#modal-root[hidden] { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  width: 560px; max-width: 100%; padding: 20px 22px; box-shadow: 0 10px 50px rgba(22,35,58,.25);
}
.modal.modal-wide { width: 940px; max-width: 96vw; }
.modal h2 { margin: 0 0 16px; font-size: 17px; }
#modal-root .modal .close-x { float: right; cursor: pointer; color: var(--muted); font-size: 18px; }
.visit-photo { height: 44px; width: auto; max-width: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* route builder + maps */
.builder-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .builder-cols { grid-template-columns: 1fr; } }
.rb-map { height: 470px; border: 1px solid var(--border); border-radius: 8px; background: #E8EDF4; box-shadow: 0 1px 3px rgba(22,35,58,.06); }
.rb-map .leaflet-container { font: 13px/1.45 -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
.rb-map .leaflet-popup-content { margin: 10px 14px; line-height: 1.5; }
.rb-hint { color: var(--muted); font-size: 12px; margin: 8px 2px 0; }
.rb-pin {
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  border: 2px solid var(--primary); color: var(--primary);
  font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(22,35,58,.45);
}
.rb-pin.hl { background: var(--gold); border-color: #fff; color: #fff; transform: scale(1.3); }
.rb-startbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.rb-start-name { font-weight: 600; }
.rb-start {
  width: 30px; height: 30px; border-radius: 50%; background: var(--gold);
  border: 2px solid #fff; color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(22,35,58,.45);
}
.rb-start-mini { width: 20px; height: 20px; font-size: 11px; }
.rb-drag-handle { cursor: grab; color: var(--muted); user-select: none; padding: 2px 4px; border-radius: 4px; }
.rb-drag-handle:hover { color: var(--primary); background: #EEF4FB; }
tbody tr.rb-dragging { opacity: .35; }
tbody tr.rb-over td { border-top: 2px solid var(--gold); background: #FBF3E4; }
tbody tr.rb-row-hl td { background: #FBF3E4 !important; }
.rb-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.rb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.pool-row { padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.pool-row:hover { background: #F3F7FC; }
.pool-row:last-child { border-bottom: none; }
.pool-locate { color: var(--sky); font-weight: 700; }
.link-box { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #F0F3F8; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; word-break: break-all; }
.sig-img { max-height: 90px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.fl-row { display: grid; grid-template-columns: 1.3fr .8fr 1.1fr 1fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 900px) { .fl-row { grid-template-columns: 1fr 1fr; } }
.fl-req { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* layout helpers */
.two-col { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.side-links a { display: block; padding: 5px 0; }
.group-card { margin-bottom: 14px; }
.group-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--primary); color: #fff; border-radius: 8px 8px 0 0; font-weight: 700; }
.pagination { display: flex; gap: 8px; align-items: center; padding: 10px 12px; color: var(--muted); font-size: 12.5px; justify-content: flex-end; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.report-cat h3 { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 8px; }
.report-cat a { display: block; padding: 4px 0; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.mt { margin-top: 14px; }

@media print {
  #sidebar, #topbar, .page-actions, .filter-bar, tr.colfilters, .row-actions, #alertsPanel { display: none !important; }
  body { background: #fff; color: #000; }
  .table-wrap, .card, .panel { background: #fff; border-color: #ccc; box-shadow: none; }
  td, th { color: #000; }
}

/* ==================================================================== */
/* Mobile layout (Skimmer-style) — under 820px                          */
/* ==================================================================== */
#m-header, #m-tabs { display: none; }

@media (max-width: 820px) {
  #sidebar, #topbar, .pull-tab { display: none !important; }
  #shell { display: block; }

  /* top blue header with page title */
  #m-header {
    display: flex; align-items: center;
    position: sticky; top: 0; z-index: 45;
    height: 52px; padding: 0 14px;
    background: var(--primary); color: #fff;
    font-weight: 600; font-size: 17px;
    box-shadow: 0 1px 4px rgba(12,58,109,.35);
  }

  /* bottom tab bar */
  #m-tabs {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: #fff; border-top: 1px solid var(--border);
    height: 58px; padding-bottom: env(safe-area-inset-bottom);
  }
  #m-tabs button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; border: 0; background: none; color: var(--muted);
    font-size: 10px; font-family: inherit; cursor: pointer;
  }
  #m-tabs button.active { color: var(--primary); }
  #m-tabs svg { width: 22px; height: 22px; }

  #page { padding: 12px 12px 84px; }
  .page-title { display: none; }
  .page-head { flex-wrap: wrap; gap: 8px; }
  .page-head .page-actions { margin-left: auto; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar input, .filter-bar select { min-width: 100%; }
  .table-wrap { overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { width: 100%; max-height: 92vh; overflow-y: auto; }
  #modal-root { padding: 10px; }
  .cards { grid-template-columns: 1fr; }
  .builder-cols { grid-template-columns: 1fr; }
  .map-box, [id$="-map"] { height: 46vh !important; }

  /* ---- mobile customers screen ---- */
  .m-cust-bar { margin-bottom: 10px; }
  .m-search {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 0 10px; height: 42px; margin-bottom: 10px;
  }
  .m-search svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
  .m-search input {
    flex: 1; border: 0; outline: 0; background: none;
    font-size: 15px; font-family: inherit; color: var(--foreground);
  }
  .m-pills { display: flex; gap: 8px; }
  .m-pill {
    border: 1px solid var(--primary); background: #fff; color: var(--primary);
    border-radius: 16px; padding: 5px 16px; font-size: 13px; font-family: inherit;
    cursor: pointer;
  }
  .m-pill.active { background: var(--primary); color: #fff; }

  .m-cust-list { display: flex; flex-direction: column; gap: 1px; }
  .m-grp-h {
    background: #eef3fa; color: var(--primary);
    font-size: 12px; font-weight: 700; letter-spacing: .06em;
    padding: 5px 12px; position: sticky; top: 52px; z-index: 5;
    scroll-margin-top: 56px;
  }
  .m-crow {
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 11px 14px 11px 34px; cursor: pointer;
  }
  .m-crow:active { background: #eef3fa; }
  .m-cname { font-size: 15px; font-weight: 600; color: var(--foreground); }
  .m-ctag {
    display: inline-block; font-size: 11px; font-weight: 600;
    color: var(--primary); background: #e4edf8;
    border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px;
  }
  .m-csub { font-size: 12px; color: var(--muted); margin-top: 2px; }

  /* A-Z jump index */
  .m-index {
    position: fixed; right: 2px; top: 50%; transform: translateY(-50%); z-index: 44;
    display: flex; flex-direction: column; gap: 0;
    background: rgba(255,255,255,.85); border-radius: 10px;
    padding: 4px 2px;
  }
  .m-index button {
    border: 0; background: none; color: var(--primary);
    font-size: 10px; font-weight: 700; line-height: 1.35;
    padding: 0 4px; font-family: inherit; cursor: pointer;
  }
  .m-index button.off { color: #c7d2e0; }
}

/* ---------- Whiteboard drawer (right pop-out, pull tab) ---------- */
#wb-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw;
  background: var(--surface, #0f1c42); border-left: 1px solid var(--border, #2a3a66);
  transform: translateX(100%); transition: transform .25s ease; z-index: 940;
  display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,.4);
}
#wb-drawer.open { transform: translateX(0); }
#wb-tab {
  position: absolute; left: -34px; top: 40%; width: 34px; height: 96px;
  background: var(--accent, #c68728); color: #fff; border-radius: 10px 0 0 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; writing-mode: vertical-rl;
  box-shadow: -3px 0 10px rgba(0,0,0,.3); user-select: none;
}
#wb-body { padding: 16px; overflow-y: auto; flex: 1; }
#wb-body h3 { margin: 0 0 10px; color: var(--accent, #c68728); }
#wb-canvas {
  width: 100%; height: 200px; background: #fff; border-radius: 8px;
  border: 1px solid var(--border, #2a3a66); touch-action: none; cursor: crosshair;
}
.wb-tools { display: flex; gap: 6px; margin: 8px 0; align-items: center; }
.wb-tools button { padding: 3px 10px; font-size: 12px; }
.wb-tools .swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.wb-tools .swatch.on { border-color: #fff; }
#wb-notes {
  width: 100%; min-height: 140px; resize: vertical; margin-top: 10px;
  background: var(--surface, #0f1c42); color: var(--foreground, #e8edf7);
  border: 1px solid var(--border, #2a3a66); border-radius: 8px; padding: 10px;
  font-family: inherit; font-size: 14px; line-height: 1.5;
}
#wb-status { font-size: 12px; color: #8fa1c8; margin-top: 6px; min-height: 16px; }

/* ---------- Floating mic button + voice panel ---------- */
#fab-mic {
  position: fixed; right: 18px; bottom: 18px; width: 58px; height: 58px; z-index: 950;
  border-radius: 50%; background: linear-gradient(135deg, var(--accent, #c68728), #a86a1a);
  color: #fff; font-size: 26px; border: none; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
#fab-mic.listening { background: #c62828; animation: fab-pulse 1.2s infinite; }
#fab-mic.dragging { opacity: .85; transform: scale(1.12); box-shadow: 0 10px 26px rgba(0,0,0,.6); }
@keyframes fab-pulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, .55); }
  70% { box-shadow: 0 0 0 22px rgba(198, 40, 40, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0); }
}
#voice-panel {
  position: fixed; right: 18px; bottom: 88px; width: 330px; max-width: 92vw; z-index: 949;
  background: var(--surface, #0f1c42); border: 1px solid var(--border, #2a3a66);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); overflow: hidden;
  display: none; font-size: 13px;
}
#voice-panel.open { display: block; }
#vp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; background: rgba(0,0,0,.25); font-weight: 700; color: var(--accent, #c68728);
}
#vp-head .dot { width: 9px; height: 9px; border-radius: 50%; background: #555; display: inline-block; }
#vp-head.listening .dot { background: #e53935; animation: fab-pulse 1.2s infinite; }
#vp-body { padding: 10px 12px; max-height: 260px; overflow-y: auto; line-height: 1.5; }
#vp-body .you { color: var(--sky, #60a8ed); margin-bottom: 6px; }
#vp-body .ai { color: #ddd; margin-bottom: 8px; }
#vp-body .hint { color: #8fa1c8; font-size: 12px; }
#vp-close { background: none; border: none; color: #8fa1c8; cursor: pointer; font-size: 15px; padding: 2px 6px; }
