[hidden]{display:none!important}
header{display:flex;align-items:center;gap:12px}
header .brand{margin:0}
#menu-toggle{background:#171a17;color:white;border:1px solid #717771;border-radius:8px;font-size:22px;min-width:44px;min-height:44px}
#drawer{position:fixed;z-index:10;inset:0 auto 0 0;width:min(82vw,320px);overflow:auto;padding:14px;background:#171a17;color:white;box-shadow:0 0 0 100vmax #0006}
#drawer button{display:block;width:100%;background:#262b26;color:white;border:1px solid #535b53;border-radius:7px;padding:11px;text-align:left;margin:5px 0}
#drawer nav{margin:14px 0}
#back{min-height:40px;border:1px solid #bbc4bb;background:white;border-radius:8px}
#today-summary{padding:10px 14px;background:#f0faf2;margin-top:0}
.schedule-scroll{overflow:auto}
.schedule-scroll table{min-width:450px}
.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(92px,1fr));min-width:644px;gap:5px}
.calendar-day{min-height:76px;background:#f3f5f3;border:1px solid #e1e7e1;padding:5px;overflow-wrap:anywhere}
.calendar-day strong{display:block}
#panel .job-chip,#today-summary .job-chip{border:1px solid #c9d3c9;border-left:5px solid var(--job-color);background:white;padding:6px;border-radius:6px;text-align:left;max-width:100%;overflow-wrap:anywhere}
a.map{margin-left:8px;white-space:nowrap;color:#125536}
fieldset{border:1px solid #d5ddd5;border-radius:8px;margin:10px 0}
#owner-status:empty{display:none}
@media print{#drawer,#back,#owner-status,.cloud,.private,.map{display:none!important}}
@media(max-width:600px){input:not([type=checkbox]),select{font-size:16px;min-width:0}.row>label{max-width:100%}.brand h1{font-size:18px}.brand img{max-width:85px;height:auto}.app main{padding:14px}}
button.attention-link{width:100%;background:transparent;color:inherit;text-align:left}
button.attention-link:hover{background:#f0faf2}

#crm-issue{width:min(calc(100% - 28px),520px);max-height:85vh;padding:20px;border:1px solid #cbd5cf;border-radius:12px;color:#14221a;background:#fff}
#crm-issue::backdrop{background:#0008}
#crm-issue h2{margin:0 0 10px}
#crm-issue p{line-height:1.45}
#crm-issue-actions{display:flex;gap:8px;flex-wrap:wrap}
#crm-issue-actions button{padding:9px 12px;border:1px solid #cbd5cf;border-radius:7px;background:#f1f8f3;min-height:42px}

@media screen {
  :root {
    color-scheme:dark;
    --surface-black:#080808;
    --surface-panel:#141414;
    --surface-control:#202020;
    --surface-hover:#292c29;
    --border-dark:#3c423d;
    --text-light:#f1f3f1;
    --text-muted:#b0b8b2;
    --green-accent:#30e65b;
    --green-tint:#14281a;
  }

  body,.app {background:var(--surface-black);color:var(--text-light)}
  .app {box-shadow:none}
  .cloud, #today-summary, .calendar-day, .placeholder, #crm-issue {
    background:var(--surface-panel);
    border-color:var(--border-dark);
    color:var(--text-light);
  }
  #crm-issue::backdrop {background:#000b}
  section, .alert, fieldset, td, th, hr {border-color:var(--border-dark)}
  th {background:var(--surface-panel)}
  .tab, .tile, #panel button, #matches button, #back, #menu-toggle,
  #drawer button, #crm-issue-actions button, .cloud button, #crew-view button,
  #location-request button, #owner-status button, #pay-reviews button {
    background:var(--surface-control);
    color:var(--text-light);
    border-color:var(--border-dark);
  }
  #drawer {background:var(--surface-panel);box-shadow:0 0 0 100vmax #0009}
  .tab.active {background:var(--green-accent);border-color:var(--green-accent);color:#07140a}
  .tile:hover, .tile:active, #panel button:hover, #matches button:hover,
  #drawer button:hover, button.attention-link:hover, #crm-issue-actions button:hover {
    background:var(--surface-hover);
  }
  #panel .job-chip, #today-summary .job-chip {
    background:var(--surface-control);
    color:var(--text-light);
    border-color:var(--border-dark);
    border-left-color:var(--job-color);
  }
  .symbol, .alerticon, a {color:var(--green-accent)}
  .alerticon {background:var(--green-tint)}
  .note, .alert small, input::placeholder, textarea::placeholder {color:var(--text-muted)}
  a.map {color:#84eda0}
  a:hover {color:#a4f4b8}
  input:not([type=checkbox], [type=radio]), select, textarea {
    background:var(--surface-control);
    color:var(--text-light);
    border-color:var(--border-dark);
  }
  input[type=checkbox], input[type=radio] {accent-color:var(--green-accent)}
  button:disabled {opacity:.55;cursor:default}
  :focus-visible {outline-color:var(--green-accent)}
}
