/* =====================================================================
   ACES Dispatch Board — styling

   Lifted from the board as written, with three changes so it sits inside
   this portal rather than the Apps Script shell it came from:

     · the palette it expects (--amber, --white, --danger …) is declared
       here, mapped onto the portal's own colours
     · the sticky offsets read --dbtop / --dbtop2, which dispatch.js
       measures from the real header, instead of the hard 104/187px
     · .hidden is declared, since the board leans on it

   Nothing else has been touched.
   ===================================================================== */

:root{
  --amber:#F5A623; --amber-100:#FFF4E0; --amber-600:#D98A0B;
  --white:#ffffff; --danger:#C0392B; --navy-600:#2C4A75;
}

.hidden{display:none !important}

  /* the bar cancels main's 14px top padding so it rests where it sticks */
  /* same track sizes as .db-grid, so the title sits over the calendar
     and the button lines up with the schedule container */
  .db-bar{position:sticky;top:var(--dbtop,108px);z-index:30;background:var(--bg);
    display:grid;grid-template-columns:288px minmax(0,1fr) 196px 196px;gap:14px;
    align-items:center;margin:-14px 0 8px;padding:14px 0 12px;}
  .db-baractions{display:flex;align-items:center;gap:8px;min-width:0;position:relative;}
  /* one day back or forward, centred over the schedule container */
  .db-daynav{position:absolute;left:50%;transform:translateX(-50%);
    display:flex;gap:8px;}
  /* the selected date, spelled out at the top of the calendar card */
  .db-daylbl{text-align:center;font-size:13px;font-weight:700;color:var(--muted);
    white-space:nowrap;margin:0 0 12px;}
  .db-daylbl.today{color:var(--navy);}
  .db-daynav button{width:52px;height:38px;padding:0;flex:none;
    display:inline-flex;align-items:center;justify-content:center;
    border:1px solid var(--line);border-radius:8px;background:var(--white);
    color:var(--navy);cursor:pointer;font-family:inherit;
    box-shadow:0 2px 6px rgba(16,43,79,.06);
    transition:background .13s,border-color .13s;}
  .db-daynav button:hover{background:var(--amber-100);border-color:var(--amber);}
  .db-daynav svg{width:21px;height:21px;display:block;}
  /* the buttons sit at the far end of the board column, so the right edge
     lines up with the right edge of the schedule container below it */
  .db-baractions .db-sms{margin-left:auto;}
  .db-sms{padding:8px 16px;border:none;border-radius:8px;font-size:13px;font-weight:700;
    cursor:pointer;font-family:inherit;color:#fff;
    background:linear-gradient(145deg,#9AA7B5,#6B7C93);
    box-shadow:0 4px 12px rgba(107,124,147,.28);}
  .db-sms:hover:enabled{filter:brightness(1.05);}
  .db-sms:disabled{opacity:.45;cursor:default;}
  /* Send SMS and + Dispatch share one size */
  .db-baractions .db-sms,.db-baractions .db-assign{width:104px;padding:8px 0;text-align:center;}
  .db-bar .db-msg{grid-column:3 / -1;justify-self:end;margin-left:0;}
  .db-bar h2{margin:0;font-size:22px;color:var(--navy);}
  .db-msg{font-size:13px;font-weight:600;margin-left:auto;padding:7px 12px;border-radius:7px;display:none;}
  .db-msg.err{display:block;background:#FDEDEB;color:var(--danger);border:1px solid #F5C6C0;}
  .db-msg.ok{display:block;background:#EAF6EE;color:#1E7A45;border:1px solid #BFE3CC;}
  .db-grid{display:grid;grid-template-columns:288px minmax(0,1fr) 196px 196px;gap:14px;align-items:start;}
  /* the three side columns stay put; only the board scrolls */
  .db-left,.db-side{position:sticky;top:var(--dbtop2,187px);align-self:start;}
  .db-left{display:flex;flex-direction:column;gap:14px;min-width:0;}
  .db-col{background:var(--white);border:1px solid var(--line);border-radius:12px;
    box-shadow:0 2px 6px rgba(16,43,79,.06);}
  /* ---------- calendar ---------- */
  .db-cal{position:relative;padding:14px;}
  .db-cal.saving .db-veil{display:flex;}
  /* one free-text note per day, shown under the grid */
  .db-dnote{margin-top:14px;}
  .db-dntext{padding:9px 11px;border-left:3px solid var(--amber);background:var(--amber-100);
    border-radius:0 8px 8px 0;font-size:12.5px;font-weight:600;color:var(--ink);
    line-height:1.5;white-space:pre-wrap;word-break:break-word;cursor:pointer;}
  .db-dntext:hover{background:#FCE8C6;}
  .db-dnadd{width:100%;padding:8px;border:1.5px dashed var(--line);border-radius:8px;
    background:var(--white);color:var(--navy-600);font-family:inherit;font-size:12px;
    font-weight:700;cursor:pointer;}
  .db-dnadd:hover{border-style:solid;border-color:var(--amber);background:var(--amber-100);}
  .db-dnote textarea{display:block;width:100%;min-height:70px;resize:vertical;padding:8px 10px;
    font-family:inherit;font-size:12.5px;font-weight:600;color:var(--ink);
    border:1.5px solid var(--amber);border-radius:8px;background:var(--white);}
  .db-dnote textarea:focus{outline:none;}
  .db-dnrow{display:flex;gap:6px;margin-top:8px;}
  .db-dnrow button{flex:1;padding:7px;border-radius:7px;font-family:inherit;font-size:12px;
    font-weight:700;cursor:pointer;}
  .db-dnsave{border:none;color:#fff;background:linear-gradient(145deg,#34A85A,#1E7A45);}
  .db-dnsave:hover{filter:brightness(1.07);}
  .db-dncancel{border:1px solid var(--line);background:var(--white);color:var(--navy);}
  .db-dncancel:hover{background:#F1F4F8;}
  .db-calhead{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;}
  .db-calhead span{font-size:16px;font-weight:700;color:var(--navy);}
  .db-calhead button{width:30px;height:30px;border:1px solid var(--line);background:var(--white);
    border-radius:8px;cursor:pointer;font-size:15px;color:var(--navy);font-family:inherit;line-height:1;}
  .db-calhead button:hover{background:var(--amber-100);border-color:var(--amber);}
  /* The Timesheets calendar keeps a 16px column down its right edge for the
     pay-period grips. Taking the same 19px (that column plus its gap) out of
     the width here, centred, makes every day cell exactly the size it is
     there - without leaving a blank strip on one side. */
  .db-dow,.db-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;
    width:calc(100% - 19px);margin-left:auto;margin-right:auto;}
  .db-dow span{text-align:center;font-size:11.5px;font-weight:700;color:var(--muted);padding:4px 0 2px;}
  .db-day{position:relative;aspect-ratio:1;border:1px solid transparent;border-radius:9px;
    background:#FBFCFD;cursor:pointer;font-size:14px;color:var(--ink);font-family:inherit;
    display:flex;align-items:center;justify-content:center;transition:background .12s,border-color .12s;}
  /* the seven days around today stay gently lit as a band */
  .db-day.wk:not(.sel):not(.today){background:#E8F0FA;border-color:#D9E5F4;}
  .db-day.wk:not(.sel):not(.today):hover{background:var(--amber-100);border-color:var(--amber);}
  .db-day:hover{background:var(--amber-100);border-color:var(--amber);}
  .db-day.blank{background:transparent;cursor:default;}
  .db-day.blank:hover{background:transparent;border-color:transparent;}
  /* the spill-over days of the neighbouring months — shown, but faded */
  /* .dim is 12px in the portal — the spill days keep the calendar's size */
  .db-day.dim{background:transparent;color:#B9C3D0;font-weight:600;font-size:14px;}
  .db-day.dim:hover{background:var(--amber-100);border-color:var(--amber);color:var(--muted);}
  .db-day.today:not(.sel){font-weight:800;background:var(--amber);color:#fff;
    border-color:var(--amber);}
  .db-day.today:not(.sel):hover{background:var(--amber-600);border-color:var(--amber-600);}
  .db-day.sel{background:var(--navy);color:#fff;border-color:var(--navy);font-weight:700;}
  /* a day with schedules is ringed in amber instead of dotted */
  .db-day.has{border-color:var(--amber);box-shadow:inset 0 0 0 1px var(--amber);}
  .db-day.sel.has{border-color:var(--amber);box-shadow:inset 0 0 0 1px var(--amber);}
  /* on the orange "today" cell the ring needs a darker shade to read */
  .db-day.today.has:not(.sel){border-color:var(--amber-600);
    box-shadow:inset 0 0 0 1px var(--amber-600);}
  /* a day carrying a note gets a dot in its top-left corner */
  .db-day.note::before{content:'';position:absolute;top:4px;left:4px;
    width:5px;height:5px;border-radius:50%;background:#0E1B2E;}
  .db-day.sel.note::before{background:#FFFFFF;}
  .db-today{width:100%;margin-top:12px;padding:9px;border:1px solid var(--line);background:var(--white);
    border-radius:9px;cursor:pointer;font-size:13.5px;font-weight:600;color:var(--navy);font-family:inherit;}
  .db-today:hover{background:var(--amber-100);border-color:var(--amber);}
  /* wipes the selected day — red on purpose */
  .db-wipeday{width:100%;margin-top:8px;padding:9px;border:none;
    border-radius:9px;cursor:pointer;font-size:13.5px;font-weight:700;
    color:#fff;font-family:inherit;
    background:linear-gradient(145deg,#E25555,#B02A2A);
    box-shadow:0 4px 12px rgba(176,42,42,.25);}
  .db-wipeday:hover:enabled{filter:brightness(1.06);}
  .db-wipeday:disabled{opacity:.45;cursor:default;}
  /* a full-screen notice; a click anywhere puts it away */
  .db-notice{position:fixed;inset:0;z-index:95;display:none;
    align-items:center;justify-content:center;background:rgba(16,43,79,.28);
    cursor:pointer;}
  .db-notice.show{display:flex;}
  .db-noticebox{background:var(--white);border-radius:12px;padding:22px 30px;
    font-size:14.5px;font-weight:800;color:var(--navy);text-align:center;
    box-shadow:0 12px 40px rgba(16,43,79,.35);}
  /* ---------- total dispatch ---------- */
  /* sits beside "+ Add Schedule", same height as the button */
  /* align-self:stretch, so it always matches the button next to it */
  /* switches how the client containers line up — see .db-groups.even / .free */
  .db-arr{align-self:stretch;flex:none;width:38px;padding:0;
    display:inline-flex;align-items:center;justify-content:center;
    border:1px solid var(--line);border-radius:8px;background:var(--white);
    color:var(--navy);cursor:pointer;font-family:inherit;
    box-shadow:0 2px 6px rgba(16,43,79,.06);
    transition:background .13s,border-color .13s;}
  .db-arr:hover{background:var(--amber-100);border-color:var(--amber);}
  .db-arr svg{width:19px;height:19px;display:block;}
  .db-total{display:inline-flex;align-items:center;align-self:stretch;gap:8px;min-width:0;
    padding:0 13px;border:1px solid var(--line);border-radius:8px;
    background:var(--white);box-shadow:0 2px 6px rgba(16,43,79,.06);}
  .db-total span{flex:none;font-size:11.5px;font-weight:700;letter-spacing:0;
    text-transform:none;color:var(--muted);}
  .db-total b{flex:none;font-size:17px;font-weight:800;color:var(--navy);line-height:1;}
  /* ---------- board ---------- */
  .db-board{position:relative;padding:16px;min-height:200px;}
  .db-board.saving > .db-veil{display:flex;}
  /* the ONLY thing that scrolls; sized to fill the window by dbFitBoard() */
  #dbGroups{overflow-y:auto;overscroll-behavior:contain;padding:10px 11px 0 0;
    align-content:start;scrollbar-width:thin;scrollbar-color:#C6D2E0 transparent;}
  #dbGroups::-webkit-scrollbar{width:8px;}
  #dbGroups::-webkit-scrollbar-track{background:transparent;}
  #dbGroups::-webkit-scrollbar-thumb{background:#C6D2E0;border-radius:8px;}
  #dbGroups::-webkit-scrollbar-thumb:hover{background:#A9B9CC;}
  .db-assign{padding:8px 16px;border:none;border-radius:8px;font-size:13px;font-weight:700;
    cursor:pointer;font-family:inherit;color:#fff;
    background:linear-gradient(145deg,#34A85A,#1E7A45);
    box-shadow:0 4px 12px rgba(30,122,69,.28);}
  .db-assign:hover:enabled{filter:brightness(1.07);}
  .db-assign:disabled{opacity:.45;cursor:default;}
  /* ---------- add-schedule overlay ---------- */
  .db-modal{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
    background:rgba(11,27,51,.55);padding:20px;}
  .db-sheet{position:relative;width:100%;max-width:720px;background:var(--white);border-radius:14px;
    box-shadow:0 24px 60px rgba(0,0,0,.38);overflow:hidden;animation:rise .2s ease;}
  .db-shead{background:var(--navy);color:#fff;padding:14px 16px;display:flex;
    align-items:center;justify-content:space-between;gap:10px;}
  .db-shead b{font-size:15px;font-weight:700;display:block;}
  .db-shead small{font-size:11.5px;color:#B9C9DD;font-weight:600;}
  .db-sclose{border:none;background:transparent;color:#B9C9DD;font-size:22px;line-height:1;
    cursor:pointer;font-family:inherit;padding:0 2px;}
  .db-sclose:hover{color:#fff;}
  .db-sbody{padding:18px;display:grid;grid-template-columns:minmax(0,244px) minmax(0,1fr);
    gap:0 20px;align-items:start;}
  .db-scol{min-width:0;display:flex;flex-direction:column;}
  .db-slabel{display:flex;align-items:baseline;gap:6px;font-size:11px;font-weight:800;
    letter-spacing:.5px;text-transform:uppercase;color:var(--muted);margin:0 0 6px;}
  .db-slabel i{font-style:normal;font-size:10px;font-weight:700;text-transform:none;letter-spacing:0;}
  .db-sbody select,.db-sbody input[type=text]{width:100%;padding:9px 10px;font-size:13px;
    font-family:inherit;border:1.5px solid var(--line);border-radius:8px;
    background:#FBFCFD;color:var(--ink);}
  .db-sbody select:focus,.db-sbody input[type=text]:focus{outline:none;border-color:var(--amber);
    background:var(--white);}
  .db-sbody select{margin-bottom:16px;}
  /* top of Details: the client name is locked, anything typed after it is the leader */
  .db-cbox{position:relative;display:flex;align-items:center;margin:0 0 6px;
    border:1.5px solid var(--line);border-radius:8px;background:#FBFCFD;}
  .db-cbox:focus-within{border-color:var(--amber);background:var(--white);}
  .db-scol .db-cbox input[type=text]{flex:1;min-width:0;margin:0;padding:9px 2px 9px 10px;
    border:none;border-radius:0;background:transparent;font-family:inherit;font-size:13px;
    font-weight:600;color:var(--ink);}
  .db-scol .db-cbox input[type=text]:focus{outline:none;border:none;background:transparent;}
  .db-scol .db-cbox input[type=text]:disabled{color:var(--muted);cursor:default;}
  .db-cbtn{flex:none;border:none;background:transparent;cursor:pointer;padding:0 11px;
    font-size:11px;color:var(--muted);font-family:inherit;line-height:1;}
  .db-cbtn:hover{color:var(--navy);}
  .db-cmenu{position:absolute;top:calc(100% + 5px);left:0;right:0;z-index:6;max-height:196px;
    overflow-y:auto;padding:4px;background:var(--white);border:1px solid var(--line);
    border-radius:9px;box-shadow:0 12px 26px rgba(16,43,79,.20);}
  .db-cmenu button{display:block;width:100%;text-align:left;border:none;background:transparent;
    padding:7px 9px;border-radius:6px;font-family:inherit;font-size:13px;font-weight:600;
    color:var(--ink);cursor:pointer;}
  .db-cmenu button:hover{background:var(--amber-100);}
  .db-cmenu button.on{background:var(--navy);color:#fff;}
  /* the call time and the note sit in the header, on their own row under the date */
  #dbModal .db-shead{flex-direction:column;align-items:flex-start;gap:11px;}
  .db-stime{margin-left:auto;display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;}
  #dbModal .db-stime{margin-left:0;}
  .db-stime .db-time{margin-left:0;}
  .db-stime .db-time .db-timebtn{padding:6px 11px;font-size:12.5px;border-radius:8px;
    border:1.5px solid #3E5A80;background:transparent;color:#D7E2F0;cursor:pointer;}
  .db-stime .db-time .db-timebtn svg{width:13px;height:13px;opacity:1;}
  .db-stime .db-time .db-timebtn:hover{border-color:var(--amber);color:#fff;
    background:rgba(255,255,255,.10);}
  .db-stime .db-time .db-timebtn.set{color:var(--navy);background:var(--amber-100);
    border-color:var(--amber);}
  .db-stime .db-time.on .db-timebtn.live{color:var(--navy);background:var(--white);
    border-color:var(--amber);}
  .db-stime .db-time .db-timebtn span{max-width:150px;}
  /* a saved note is its own edit control — click the note to change it.
     align-self:stretch takes its height from the Set time pill beside it,
     so the two always match without either one hardcoding a height */
  .db-snoteshow{flex:0 1 auto;min-width:0;max-width:210px;padding:0 11px;text-align:left;
    display:inline-flex;align-items:center;align-self:stretch;
    border:none;border-left:3px solid var(--amber);border-radius:0 7px 7px 0;
    background:var(--amber-100);font-family:inherit;font-size:12.5px;font-weight:600;
    color:var(--ink);cursor:pointer;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .db-snoteshow:hover{background:#FFE7BF;}
  .db-snoteshow.live{background:var(--white);box-shadow:0 0 0 1.5px var(--amber);}
  .db-snotebtn{flex:none;padding:0 11px;border:1.5px dashed #3E5A80;border-radius:8px;
    display:inline-flex;align-items:center;align-self:stretch;
    background:transparent;color:#D7E2F0;font-family:inherit;font-size:12.5px;
    font-weight:700;cursor:pointer;white-space:nowrap;}
  .db-snotebtn:hover{border-style:solid;border-color:var(--amber);color:#fff;
    background:rgba(255,255,255,.10);}
  .db-snotebtn.live{border-style:solid;border-color:var(--amber);background:var(--white);
    color:var(--navy);}
  /* the note is typed right here in the row — nothing floats over the form */
  .db-snoteedit{flex:1 1 220px;min-width:0;max-width:360px;align-self:stretch;
    box-sizing:border-box;padding:0 11px;font-family:inherit;font-size:12.5px;
    font-weight:600;color:var(--navy);background:var(--white);
    border:1.5px solid var(--amber);border-radius:8px;}
  .db-snoteedit:focus{outline:none;box-shadow:0 0 0 2px rgba(245,166,35,.35);}
  .db-sbody input[type=text]{margin-bottom:6px;}
  .db-sbody .db-picklist{height:340px;max-height:none;}
  /* three columns: pick the client, tick the workers, fill in the details.
     All end level — the lists take whatever their column has left over. */
  #dbModal .db-sheet{max-width:964px;}
  #dbModal .db-sbody{grid-template-columns:minmax(0,206px) minmax(0,238px) minmax(0,1fr);}
  #dbModal .db-scol{height:404px;}
  #dbModal .db-picklist{flex:1 1 auto;height:auto;min-height:0;}
  /* the Details rows, one per ticked worker */
  #dbSchedRows{flex:1 1 auto;min-height:0;overflow-y:auto;padding:1px;
    scrollbar-width:thin;scrollbar-color:#C6D2E0 transparent;}
  #dbSchedRowList{display:flex;flex-direction:column;gap:5px;}
  #dbSchedRows::-webkit-scrollbar{width:9px;}
  #dbSchedRows::-webkit-scrollbar-track{background:transparent;}
  #dbSchedRows::-webkit-scrollbar-thumb{background-color:#C6D2E0;border-radius:10px;
    border:4px solid transparent;background-clip:content-box;min-height:28px;}
  #dbSchedRowList .db-chip{flex:none;}
  /* master ticks, sitting exactly over the two columns they drive. It lives
     inside the scroller and carries a row's own borders and padding, so the
     grid tracks line up whatever width the scrollbar leaves behind */
  .db-rowhead{position:sticky;top:0;z-index:2;background:var(--white);
    display:grid;grid-template-columns:16px minmax(0,1.15fr) 16px 16px minmax(0,1fr) 14px;
    align-items:center;gap:6px;padding:0 6px 7px 8px;
    border-left:3px solid transparent;border-right:1px solid transparent;}
  .db-tick:indeterminate{background:#E4EAF2;border-color:#8FA3BE;}
  .db-tick:indeterminate::after{content:'';position:absolute;left:3px;top:5.5px;
    width:7px;height:2px;border:none;border-radius:1px;background:var(--navy);transform:none;}
  /* beats .db-sbody input[type=text], which would otherwise blow the row apart.
     The border is transparent rather than absent, so nothing shifts on focus */
  #dbSchedRows input.db-noteline{margin:0;padding:3px 5px;font-size:11.5px;
    border:1px solid transparent;border-radius:5px;background:transparent;}
  #dbSchedRows input.db-noteline:focus{border-color:var(--amber);background:var(--white);}
  /* a warning strip inside a form, above its buttons */
  .db-formerr{display:none;margin:0 16px;padding:8px 12px;border-radius:7px;
    background:#FDEDEB;border:1px solid #F5C6C0;color:var(--danger);
    font-size:12px;font-weight:600;}
  .db-formerr.show{display:block;}
  .db-sfoot{display:flex;gap:8px;padding:12px 16px 16px;}
  .db-sfoot .db-save{flex:2;padding:10px;border:none;border-radius:8px;font-size:13px;
    font-weight:700;cursor:pointer;font-family:inherit;}
  .db-sfoot .db-save:disabled{opacity:.45;cursor:default;}
  .db-sfoot .db-cancel{flex:1;padding:10px;border:1px solid var(--line);border-radius:8px;
    font-size:13px;font-weight:700;cursor:pointer;font-family:inherit;
    transition:background .13s,border-color .13s;}
  .db-sfoot .db-cancel:hover{background:#F1F4F8;border-color:#C6D2E0;}
  /* quiet by default — it opens a confirmation before anything is removed */
  .db-sfoot .db-srem{flex:1;padding:10px;border:1px solid #F5C6C0;border-radius:8px;
    background:#FDEDEB;color:var(--danger);font-size:13px;font-weight:700;
    cursor:pointer;font-family:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .db-sfoot .db-srem:hover{background:#FBDDD9;border-color:#E9A79E;}
  .db-sheet.saving .db-veil{display:flex;}
  .db-shead.warn{background:var(--danger);}
  .db-shead.warn small{color:#F7D2CE;}
  /* the warning is one block of prose, not the two-column Add Schedule body —
     without this it is squeezed into the 244px first track and wraps early */
  #dbDropSheet .db-sbody{display:block;}
  /* this one opens on top of the Add Schedule sheet, so it outranks it */
  #dbDropModal{z-index:66;}
  #dbDropSheet{max-width:560px;}
  .db-warntext{font-size:13.5px;line-height:1.65;color:var(--ink);margin:0;}
  .db-warntext b{color:var(--danger);white-space:nowrap;}
  .db-sfoot .db-danger{flex:2;padding:10px;border:none;border-radius:8px;font-size:13px;
    font-weight:700;cursor:pointer;font-family:inherit;color:#fff;
    background:linear-gradient(145deg,#D9463A,#A93226);}
  .db-sfoot .db-danger:hover{filter:brightness(1.07);}
  .db-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
  /* within a row, the fullest container sets the height and the others match it;
     each row is measured on its own, so a row of small containers stays short */
  .db-groups.even{grid-auto-rows:auto;align-items:stretch;}
  /* each container only as tall as its own crew, packed up tight — the cards
     are moved into these columns by dbLayoutGroups() */
  .db-groups.free{display:flex;align-items:flex-start;}
  .db-gcol{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:14px;}
  .db-group{position:relative;border:1px solid var(--line);border-radius:10px;overflow:hidden;
    background:#FDFEFF;transition:box-shadow .15s,border-color .15s;}
  .db-group.drop{border-color:var(--amber);box-shadow:0 0 0 3px rgba(245,166,35,.22);}
  .db-ghead{background:var(--navy);color:#fff;padding:10px 12px;display:flex;
    align-items:center;justify-content:flex-start;gap:8px;}
  .db-ghead b{min-width:0;flex:0 1 auto;font-size:13.5px;font-weight:700;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .db-ghead b em{font-style:normal;font-weight:600;color:#BCCDE3;}
  .db-ghead i{font-style:normal;font-size:11px;font-weight:700;color:var(--navy);
    background:var(--amber);border-radius:20px;padding:2px 8px;flex:none;}
  /* ---------- call time ---------- */
  .db-time{margin-left:auto;position:relative;flex:none;}
  .db-timebtn{display:inline-flex;align-items:center;gap:5px;font-family:inherit;
    font-size:11.5px;font-weight:700;letter-spacing:.2px;white-space:nowrap;
    border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.10);
    color:#E4ECF6;border-radius:20px;padding:3px 10px;cursor:default;}
  .db-timebtn svg{width:11px;height:11px;flex:none;opacity:.85;}
  .db-timebtn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:150px;}
  .db-timebtn.set{color:#fff;background:rgba(245,166,35,.20);border-color:rgba(245,166,35,.55);}
  /* the portal's own .live adds a 10px left margin — not wanted on these */
  .db-timebtn.live,.db-snoteshow.live,.db-snotebtn.live{margin-left:0;}
  .db-timebtn.empty{color:#8FA3BE;}
  .db-time.on .db-timebtn{cursor:pointer;}
  .db-time.on .db-timebtn:hover{background:rgba(255,255,255,.20);border-color:rgba(255,255,255,.5);}
  .db-time.on .db-timebtn.live{background:var(--amber);border-color:var(--amber);color:var(--navy);}
  /* fixed so the card's overflow:hidden and the board scroller cannot clip it */
  .db-tpop{position:fixed;z-index:70;width:248px;visibility:hidden;
    background:var(--white);border:1px solid var(--line);border-radius:14px;
    box-shadow:0 18px 40px rgba(16,43,79,.26);overflow:hidden;animation:rise .14s ease;}
  /* read-out: tap the hour or the minute to jump between the two dials */
  .db-tprev{display:flex;align-items:center;justify-content:center;gap:2px;
    padding:11px 12px 9px;background:#F7F9FC;border-bottom:1px solid var(--line);}
  /* the two numbers are typeable, so they are inputs dressed as plain text */
  .db-tpop input.db-tseg{width:1.55em;box-sizing:content-box;text-align:center;
    border:none;background:transparent;font-family:inherit;font-size:26px;
    font-weight:800;line-height:1;color:#9FB0C6;cursor:pointer;padding:2px 5px;margin:0;
    border-radius:7px;caret-color:var(--navy);transition:color .12s,background .12s;}
  .db-tseg:hover{background:var(--amber-100);}
  .db-tpop input.db-tseg:focus{outline:none;color:var(--navy);background:rgba(245,166,35,.22);}
  .db-tseg.on{color:var(--navy);background:rgba(245,166,35,.22);}
  .db-tcolon{font-size:24px;font-weight:800;color:var(--navy);line-height:1;padding:0 1px;}
  .db-tapwrap{display:flex;flex-direction:column;gap:3px;margin-left:9px;}
  .db-tap{border:1px solid var(--line);background:var(--white);color:var(--muted);
    font-family:inherit;font-size:10px;font-weight:800;letter-spacing:.4px;
    padding:2px 7px;border-radius:5px;cursor:pointer;}
  .db-tap:hover{border-color:var(--amber);}
  .db-tap.on{background:var(--navy);border-color:var(--navy);color:#fff;}
  /* the clock face */
  .db-dial{position:relative;width:208px;height:208px;margin:14px auto 8px;
    border-radius:50%;background:#EEF2F7;cursor:pointer;touch-action:none;
    -webkit-user-select:none;user-select:none;}
  .db-dial.grab{cursor:grabbing;}
  .db-hand{position:absolute;left:calc(50% - 1px);bottom:50%;width:2px;height:84px;
    background:var(--navy);transform-origin:50% 100%;transition:transform .2s ease;}
  .db-dial.grab .db-hand{transition:none;}
  .db-hand::before{content:'';position:absolute;left:50%;bottom:-4px;width:8px;height:8px;
    margin-left:-4px;border-radius:50%;background:var(--navy);}
  .db-hand::after{content:'';position:absolute;left:50%;top:-17px;width:34px;height:34px;
    margin-left:-17px;border-radius:50%;background:var(--navy);}
  .db-hand.off{display:none;}
  .db-dnum{position:absolute;width:34px;height:34px;padding:0;z-index:2;
    display:flex;align-items:center;justify-content:center;
    border:none;background:transparent;border-radius:50%;
    font-family:inherit;font-size:13px;font-weight:700;color:var(--ink);cursor:pointer;}
  .db-dnum{pointer-events:none;}
  .db-dnum.hov{background:rgba(245,166,35,.40);}
  .db-dnum.on,.db-dnum.on:hover{color:#fff;background:transparent;}
  .db-thint{text-align:center;font-size:10.5px;font-weight:700;letter-spacing:.4px;
    text-transform:uppercase;color:var(--muted);padding:0 0 9px;}
  .db-tor{display:flex;align-items:center;gap:8px;padding:0 12px 10px;}
  .db-tor::before,.db-tor::after{content:'';flex:1;height:1px;background:var(--line);}
  .db-tor span{font-size:9.5px;font-weight:800;letter-spacing:.5px;
    text-transform:uppercase;color:var(--muted);}
  /* input.* so the sheet's own "input[type=text]{width:100%}" cannot win here */
  .db-tpop input.db-tnote{display:block;width:calc(100% - 24px);margin:0 12px 10px;
    padding:8px 10px;font-family:inherit;font-size:12.5px;font-weight:600;color:var(--ink);
    border:1.5px solid var(--line);border-radius:8px;background:#FBFCFD;}
  .db-tpop input.db-tnote:focus{outline:none;border-color:var(--amber);background:var(--white);}
  .db-tpop.noted input.db-tnote{border-color:var(--amber);background:var(--white);}
  .db-tfoot{display:flex;gap:6px;padding:8px;border-top:1px solid var(--line);background:#F7F9FC;}
  .db-tfoot button{flex:1;padding:7px;border-radius:7px;font-family:inherit;
    font-size:11.5px;font-weight:700;cursor:pointer;}
  .db-tclear{border:1px solid var(--line);background:var(--white);color:var(--danger);}
  .db-tdone{border:none;color:#fff;background:linear-gradient(145deg,#34A85A,#1E7A45);}
  .db-gbody{padding:9px;display:flex;flex-direction:column;gap:6px;}
  .db-group .db-ghead{border-radius:9px 9px 0 0;}
  .db-chip{display:grid;grid-template-columns:16px minmax(0,1.15fr) 16px 16px minmax(0,1fr);
    align-items:center;gap:7px;
    background:var(--white);border:1px solid var(--line);border-left:3px solid var(--amber);
    border-radius:7px;padding:6px 8px;font-size:13px;}
  .db-chip > button{border:none;background:transparent;color:var(--muted);cursor:pointer;
    font-size:15px;line-height:1;padding:0;font-family:inherit;}
  .db-chip > button:hover{color:var(--danger);}
  .db-num{font-size:11px;font-weight:700;color:var(--muted);text-align:right;}
  .db-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  /* drawn by hand so the tick mark's colour is ours, not the browser's */
  .db-tick{-webkit-appearance:none;appearance:none;position:relative;
    width:16px;height:16px;margin:0;cursor:pointer;
    border:1.5px solid #A9B9CC;border-radius:4px;background:var(--white);}
  .db-tick:checked{border-color:transparent;}
  .db-tick:checked::after{content:'';position:absolute;left:4.5px;top:1px;
    width:4px;height:8px;border-style:solid;border-width:0 2px 2px 0;
    transform:rotate(45deg);}
  .db-tick.c:checked{background:#FFC000;}
  .db-tick.c:checked::after{border-color:#4A3800;}
  .db-tick.d:checked{background:#00B050;}
  .db-tick.d:checked::after{border-color:#FFFFFF;}
  .db-tick.lock{pointer-events:none;}
  .db-noteline{min-width:0;}
  .db-noteline.txt{font-size:11px;color:var(--muted);
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  /* The portal's own .empty is a 44px-padded placeholder box; this chip
     carries the same word as a class, so the padding is taken back. */
  .db-noteline.txt.empty{color:#C3CCD8;padding:0;text-align:left;}
  input.db-noteline{padding:3px 5px;font-size:11.5px;font-family:inherit;
    border:1px solid var(--line);border-radius:5px;background:#FBFCFD;color:var(--ink);width:100%;}
  input.db-noteline:focus{outline:none;border-color:var(--amber);background:var(--white);}
  /* the empty-day message floats in the middle of the schedule container */
  .db-empty{height:100%;box-sizing:border-box;display:flex;flex-direction:column;
    justify-content:center;text-align:center;padding:18px;
    color:var(--muted);font-size:13.5px;line-height:1.7;}
  /* per-client edit */
  .db-chip.edit{grid-template-columns:16px minmax(0,1.15fr) 16px 16px minmax(0,1fr) 14px;
    padding:5px 6px 5px 8px;gap:6px;}
  .db-chip select{flex:1;min-width:0;padding:5px 6px;font-size:12.5px;font-family:inherit;
    border:1.5px solid var(--line);border-radius:6px;background:var(--white);color:var(--ink);}
  .db-chip select:focus{outline:none;border-color:var(--amber);}
  .db-picklist{max-height:132px;overflow-y:auto;display:flex;flex-direction:column;gap:3px;}
  .db-picklist label{display:flex;align-items:center;gap:7px;font-size:12.5px;background:var(--white);
    border:1px solid var(--line);border-radius:6px;padding:5px 7px;cursor:pointer;}
  .db-picklist label:hover{border-color:var(--amber);background:var(--amber-100);}
  .db-picklist label.on{border-color:var(--amber);background:var(--amber-100);}
  /* an open container is read-only until the form is clicked once. Everything
     dims and stops taking clicks except Cancel — the click still reaches the
     sheet, which is where the wake-up listener sits. */
  #dbModal .db-sheet.locked .db-stime,
  #dbModal .db-sheet.locked .db-sbody,
  #dbModal .db-sheet.locked .db-srem,
  #dbModal .db-sheet.locked .db-save{opacity:.42;pointer-events:none;}
  #dbModal .db-sheet.locked{cursor:pointer;}
  #dbModal .db-sheet.locked .db-shead small{color:var(--amber);}
  .db-picklist label span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .db-picklist input{margin:0;cursor:pointer;accent-color:#1E7A45;flex:none;}
  /* how many are already booked on that client today */
  .db-pickn{flex:none;font-style:normal;font-size:10.5px;font-weight:800;color:#8A5A00;
    background:#FFE7BF;border-radius:9px;padding:1px 7px;}
  .db-group.tap{cursor:pointer;transition:border-color .13s,box-shadow .13s;}
  .db-group.tap:hover{border-color:var(--amber);box-shadow:0 4px 14px rgba(16,43,79,.13);}
  /* ---------- right rail ---------- */
  .db-side{background:transparent;border:none;box-shadow:none;display:flex;
    flex-direction:column;gap:16px;}
  .db-panel{position:relative;display:flex;flex-direction:column;
    background:var(--white);border:1px solid var(--line);border-radius:12px;
    box-shadow:0 2px 6px rgba(16,43,79,.06);overflow:hidden;}
  .db-veil{position:absolute;inset:0;z-index:5;display:none;align-items:center;justify-content:center;
    gap:9px;background:rgba(255,255,255,.84);font-size:12.5px;font-weight:700;color:var(--navy);}
  .db-veil b{width:16px;height:16px;border:2px solid var(--line);border-top-color:var(--amber);
    border-radius:50%;animation:spin .7s linear infinite;}
  .db-panel.saving .db-veil{display:flex;}
  .db-panelhead{background:#F7F9FC;border-bottom:1px solid var(--line);padding:10px 13px;
    display:flex;align-items:center;justify-content:space-between;}
  .db-panelhead span{font-size:12px;font-weight:800;letter-spacing:.6px;
    text-transform:uppercase;color:var(--navy);}
  .db-panelhead i{font-style:normal;font-size:11px;color:var(--muted);font-weight:700;}
  .db-list{flex:1 1 auto;min-height:0;overflow-y:auto;
    padding:9px;display:flex;flex-direction:column;gap:5px;}
  /* a thin scrollbar; the 9px track stays grabbable, only the bar is slim */
  #dbWorkerList,#dbClientList{scrollbar-width:thin;scrollbar-color:#C6D2E0 transparent;}
  #dbWorkerList::-webkit-scrollbar,
  #dbClientList::-webkit-scrollbar{width:9px;}
  #dbWorkerList::-webkit-scrollbar-track,
  #dbClientList::-webkit-scrollbar-track{background:transparent;}
  #dbWorkerList::-webkit-scrollbar-thumb,
  #dbClientList::-webkit-scrollbar-thumb{background-color:#C6D2E0;border-radius:10px;
    border:4px solid transparent;background-clip:content-box;min-height:28px;}
  .db-item{display:flex;align-items:center;justify-content:space-between;gap:8px;
    border:1px solid var(--line);border-radius:7px;padding:7px 9px;font-size:13px;background:#FBFCFD;}
  .db-item.free{cursor:grab;background:#EDF6DF;border-color:#CFE6A8;border-left:3px solid #7CB342;}
  .db-item.free:active{cursor:grabbing;}
  .db-item.busy{border-left:3px solid #C6D2E0;background:#F1F4F8;color:var(--muted);}
  .db-item.target{cursor:pointer;border-left:3px solid var(--navy-600);}
  .db-item.target:hover,.db-item.drop{background:var(--amber-100);border-color:var(--amber);}
  .db-item small{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;
    text-overflow:ellipsis;max-width:78px;}
  /* worker + client rows: name on top, detail underneath, all the same height */
  .db-item.wrk,.db-item.cli{display:block;height:48px;padding:6px 9px;}
  .db-item.cli{cursor:pointer;}
  /* a client with nobody on it stands out in orange, not green */
  .db-item.cli.free{background:var(--amber-100);border-left-color:#E08A0B;border-color:#F3D19B;}
  .db-wtop{display:flex;align-items:center;gap:6px;}
  .db-wname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
    line-height:1.45;}
  .db-wclient{font-size:10.5px;font-weight:700;color:var(--muted);line-height:1.4;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .db-addbar{padding:0 9px 9px;}
  .db-addbar button{width:100%;padding:7px;border:1px dashed var(--line);border-radius:7px;
    background:var(--white);color:var(--navy-600);font-size:12px;font-weight:700;
    cursor:pointer;font-family:inherit;}
  .db-addbar button:hover{border-color:var(--amber);border-style:solid;background:var(--amber-100);}
  .db-addbar .db-hint{margin-top:6px;text-align:center;font-size:10px;color:var(--muted);line-height:1.4;}
  .db-none{font-size:12.5px;color:var(--muted);text-align:center;padding:12px 4px;}
  /* duplicate flagging */
  .db-item.dupe{border-color:#F0BDB6;border-left-color:var(--danger);background:#FDF3F2;}
  .db-tag{font-style:normal;font-size:9px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;
    color:#fff;background:var(--danger);border-radius:4px;padding:2px 5px;flex:none;}
  .db-panelhead i.warn{color:var(--danger);}
  /* workers edit mode */
  .db-panelhead .db-headright{display:flex;align-items:center;gap:8px;
    font-size:11px;font-weight:700;letter-spacing:0;text-transform:none;color:var(--muted);}
  .db-editbtn{border:1.5px solid #2E9E5B;background:var(--white);color:#1E7A45;
    font-family:inherit;font-size:10.5px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;
    padding:3px 8px;border-radius:5px;cursor:pointer;transition:background .15s,color .15s;}
  .db-editbtn:hover{background:#EAF6EE;}
  .db-editbtn.on{background:var(--danger);border-color:var(--danger);color:#fff;}
  .db-editbtn.on:hover{background:#A93226;border-color:#A93226;}
  /* the workers form: name | contact | status | remove */
  .db-staffsheet{width:620px;max-width:94vw;}
  .db-staffsearch{width:100%;box-sizing:border-box;margin:0 0 10px;padding:7px 10px;
    font-size:12.5px;font-family:inherit;border:1.5px solid var(--line);border-radius:8px;
    background:var(--white);color:var(--ink);}
  .db-staffsearch:focus{outline:none;border-color:var(--amber);}
  .db-staffcols{display:grid;grid-template-columns:minmax(0,1fr) 150px 64px 30px;
    gap:8px;align-items:center;padding:0 2px 6px;
    font-size:10.5px;font-weight:800;letter-spacing:.5px;color:var(--muted);}
  .db-staffcols span:nth-child(3){text-align:center;}
  .db-stafflist{max-height:52vh;overflow-y:auto;display:flex;flex-direction:column;gap:1px;
    scrollbar-width:thin;scrollbar-color:#C6D2E0 transparent;}
  .db-srow{display:grid;grid-template-columns:minmax(0,1fr) 150px 64px 30px;
    gap:8px;align-items:center;}
  .db-srow input[type=text]{min-width:0;padding:2px 8px;font-size:12.5px;font-family:inherit;
    border:1.5px solid var(--line);border-radius:7px;background:var(--white);color:var(--ink);}
  .db-srow input[type=text]:focus{outline:none;border-color:var(--amber);}
  .db-srow input.bad{border-color:var(--danger);background:#FDF3F2;}
  .db-srow.fresh input[type=text]{border-style:dashed;}
  .db-srow.gone input[type=text]{text-decoration:line-through;color:var(--muted);background:#F4F6F9;}
  .db-srow .st{justify-self:center;width:15px;height:15px;accent-color:#B02A2A;cursor:pointer;}
  .db-srow.off input[type=text]{color:var(--muted);background:#F4F6F9;}
  .db-srow button{width:26px;height:26px;flex:none;border:1px solid var(--line);background:var(--white);
    border-radius:6px;cursor:pointer;font-size:14px;line-height:1;color:var(--muted);font-family:inherit;}
  .db-srow button:hover{border-color:var(--danger);color:var(--danger);}
  .db-staffadd{margin-top:8px;}
  .db-staffadd button{width:100%;padding:8px;border:1.5px dashed var(--line);background:var(--white);
    border-radius:8px;cursor:pointer;font-size:12.5px;font-weight:600;color:var(--muted);font-family:inherit;}
  .db-staffadd button:hover{border-color:var(--amber);color:var(--navy);}
  /* on the workers form the tick means Active: a green box with a white check,
     and the name box wears the same green as the WORKERS container rows */
  #dbStaffList .db-srow .st{appearance:none;-webkit-appearance:none;margin:0;
    border:1.5px solid var(--line);border-radius:3px;background:var(--white);}
  #dbStaffList .db-srow .st:checked{background:#7CB342;border-color:#7CB342;}
  #dbStaffList .db-srow .st:checked::after{content:"";display:block;width:4px;height:8px;
    margin:1px 0 0 4px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);}
  #dbStaffList .db-srow.on:not(.hot) input[type=text]:first-child:not(.bad){
    background:#EDF6DF;border-color:#CFE6A8;}
  #dbStaffList .db-srow.on input[type=text]:first-child:focus{border-color:var(--amber);}
  /* the row holding the focus lights up amber — name and contact together */
  #dbStaffList .db-srow.hot input[type=text]:not(.bad){
    background:var(--amber-100);border-color:var(--amber);}
  #dbStaffList .db-srow.hot input[type=text]:focus{
    background:var(--white);border-color:var(--amber);}
  /* a duplicate stays red even while it is being typed — the focus, hot-row
     and active-green colours never hide the warning, active cell included */
  #dbStaffList .db-srow input.bad,
  #dbStaffList .db-srow input[type=text].bad:focus,
  #dbStaffList .db-srow.hot input[type=text].bad,
  #dbStaffList .db-srow.hot input[type=text].bad:focus,
  #dbStaffList .db-srow.on input[type=text].bad:first-child:focus{
    border-color:var(--danger);background:#FDF3F2;color:var(--danger);}
  /* both forms open asleep to prevent stray edits; one click anywhere wakes them */
  .db-staffsheet.dim,.db-clisheet.dim{cursor:pointer;}
  .db-staffsheet.dim .db-sbody,.db-clisheet.dim .db-sbody{opacity:.45;pointer-events:none;}
  .db-staffsheet .db-save:disabled,.db-clisheet .db-save:disabled{opacity:.45;cursor:default;}
  /* search + filter share one row: search over WORKERS, filter over STATUS */
  .db-stafftop{display:grid;grid-template-columns:minmax(0,1fr) 150px 64px 30px;
    gap:8px;margin:0 0 10px;}
  .db-stafftop .db-staffsearch{grid-column:1 / 3;margin:0;}
  .db-stafftop .db-staffsearch,.db-stafftop .db-clifilter{height:35px;padding-top:0;padding-bottom:0;}
  .db-stafftop .db-clifilter{grid-column:3 / -1;}
  .db-clisheet{width:440px;max-width:94vw;}
  .db-crow{grid-template-columns:minmax(0,1fr) 64px 30px;}
  .db-clicols{grid-template-columns:minmax(0,1fr) 64px 30px;}
  .db-clicols span:nth-child(2){text-align:center;}
  .db-clicols span:nth-child(3){text-align:left;}
  /* a duplicate stays red even while it is being typed — the focus colour
     never hides the warning, on the active cell included */
  #dbCliList .db-srow input.bad,
  #dbCliList .db-srow input.bad:focus{
    border-color:var(--danger);background:#FDF3F2;color:var(--danger);}
  /* on the clients form the tick means Active: green tick, green name box */
  .db-crow .st{appearance:none;-webkit-appearance:none;margin:0;
    border:1.5px solid var(--line);border-radius:3px;background:var(--white);}
  .db-crow .st:checked{background:#E08A0B;border-color:#E08A0B;}
  .db-crow .st:checked::after{content:"";display:block;width:4px;height:8px;
    margin:1px 0 0 4px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);}
  /* search + filter share one row: search over CLIENTS, filter over STATUS */
  .db-clitop{display:grid;grid-template-columns:minmax(0,1fr) 64px 30px;gap:8px;margin:0 0 10px;}
  .db-clitop .db-staffsearch,.db-clitop .db-clifilter{height:35px;padding-top:0;padding-bottom:0;}
  .db-clitop .db-staffsearch{margin:0;}
  .db-clifilter{grid-column:2 / -1;width:100%;box-sizing:border-box;padding:6px 6px;
    font-size:12px;font-weight:600;font-family:inherit;border:1.5px solid var(--line);
    border-radius:8px;background:var(--white);color:var(--ink);cursor:pointer;}
  .db-clifilter:focus{outline:none;border-color:var(--amber);}
  /* both forms keep their full height no matter how few rows the filter leaves */
  .db-clisheet .db-stafflist,.db-staffsheet .db-stafflist{height:52vh;}
  .db-crow.on input[type=text]:not(.bad){background:var(--amber-100);border-color:#F3D19B;}
  .db-crow.on input[type=text]:focus{border-color:var(--amber);}
  .db-erow{display:flex;align-items:center;gap:6px;}
  .db-erow input{flex:1;min-width:0;padding:6px 8px;font-size:12.5px;font-family:inherit;
    border:1.5px solid var(--line);border-radius:7px;background:var(--white);color:var(--ink);}
  .db-erow input:focus{outline:none;border-color:var(--amber);}
  .db-erow input.bad{border-color:var(--danger);background:#FDF3F2;}
  .db-erow.fresh input{border-style:dashed;}
  .db-erow.gone input{text-decoration:line-through;color:var(--muted);background:#F4F6F9;}
  .db-erow button{width:26px;height:26px;flex:none;border:1px solid var(--line);background:var(--white);
    border-radius:6px;cursor:pointer;font-size:14px;line-height:1;color:var(--muted);font-family:inherit;}
  .db-erow button:hover{border-color:var(--danger);color:var(--danger);}
  .db-erow.gone button{border-color:var(--navy-600);color:var(--navy-600);}
  .db-editbar{display:flex;gap:6px;padding:9px;border-top:1px solid var(--line);background:#F7F9FC;}
  .db-editfoot{padding:9px;border-top:1px solid var(--line);background:#F7F9FC;}
  .db-editfoot .db-editbtn{width:100%;padding:7px;font-size:11px;}
  /* the label is an icon now, so centre it and let the tooltip do the talking */
  .db-editfoot .db-editbtn svg{display:block;margin:0 auto;width:15px;height:15px;}
  .db-editfoot .db-editbtn.on{border:1px solid var(--line);background:var(--white);
    color:var(--navy);border-radius:7px;font-size:12px;font-weight:700;padding:6px;
    letter-spacing:0;text-transform:none;}
  .db-editfoot .db-editbtn.on:hover{background:#F1F4F8;border-color:#C6D2E0;}
  .db-editbar button{flex:1;padding:7px;border-radius:7px;font-size:12px;font-weight:700;
    cursor:pointer;font-family:inherit;border:none;}
  .db-save{color:#fff;background:linear-gradient(145deg,#34A85A,#1E7A45);}
  .db-save:hover:enabled{filter:brightness(1.07);}
  .db-cancel{color:var(--navy);background:var(--white);border:1px solid var(--line);}
  /* everything except the container being edited is frozen */
  .db-off{pointer-events:none;opacity:.42;filter:saturate(.55);transition:opacity .15s ease;}
  .db-grid.loading{opacity:.55;pointer-events:none;}
  .db-spin{display:none;margin:70px auto;width:30px;height:30px;border:3px solid var(--line);
    border-top-color:var(--amber);border-radius:50%;animation:spin .7s linear infinite;}
  .db-grid.loading .db-spin{display:block;}
  /* the two animations the board leans on, in case the page has no others */
  @keyframes spin{to{transform:rotate(360deg)}}
  @keyframes rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
  /* short windows: keep the calendar from becoming the tallest column */
  @media (max-height:800px){
    .db-day,.db-day.dim{font-size:13px;}
    .db-today{margin-top:10px;padding:8px;font-size:12.5px;}
  }
  /* not enough room for three abreast: the Details column drops underneath */
  @media (max-width:1010px){
    #dbModal{align-items:flex-start;overflow-y:auto;}
    #dbModal .db-sbody{grid-template-columns:minmax(0,206px) minmax(0,1fr);}
    #dbModal .db-scol:nth-child(3){grid-column:1 / -1;margin-top:14px;}
  }
  @media (max-width:700px){
    .db-sbody{grid-template-columns:1fr;gap:0;}
    .db-sbody .db-picklist{height:220px;}
    #dbModal .db-sbody{grid-template-columns:1fr;}
    #dbModal .db-scol{height:auto;}
    #dbModal .db-scol:nth-child(3){margin-top:14px;}
    #dbModal .db-picklist{flex:none;height:220px;}
    #dbSchedRows{flex:none;height:220px;}
  }
  @media (max-width:1080px){
    .db-grid{grid-template-columns:1fr;}
    .db-side{grid-column:auto;}
    .db-list{max-height:none;}
    .db-left,.db-side{position:static;}
    .db-bar{display:flex;flex-wrap:wrap;gap:12px;}
    .db-bar .db-msg{grid-column:auto;margin-left:auto;}
    .db-groups{grid-template-columns:1fr;}
    #dbGroups{height:auto !important;overflow:visible;}
  }
