/* TriArc WO Tracker — plain, field-tool look (light UI on purpose, like a work order system) */
:root {
  --bg: #f1f3f6; --surface: #ffffff; --surface-2: #f7f8fa; --head: #eef1f5;
  --line: #dce0e6; --line-strong: #c5cbd4;
  --text: #1e2430; --muted: #5b6472; --faint: #8b93a1;
  --brand: #1f5f9e; --brand-ink: #ffffff; --brand-soft: #e6eef7;
  --danger: #b0342a; --danger-soft: #fbeae8; --warn: #9a5b00; --warn-soft: #fdf1dc;
  --ok: #1e7a4c; --ok-soft: #e7f5ec;
  --radius: 6px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ico { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 12px;
  border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px;
  text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: #aab2bd; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: #18507f; }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 52px; font-size: 15px; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); min-height: 34px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid #8db4dc; outline-offset: 0; border-color: var(--brand); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; color: var(--text); display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.topbar #meLabel { color: var(--muted); }
.brand { font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.brand .logo { height: 30px; width: auto; display: block; }
.brand .app-name { font-weight: 600; font-size: 14px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-strong); line-height: 22px; white-space: nowrap; }
.center-card .brand { justify-content: center; }
.center-card .brand .logo { height: 40px; }
.brand .dot { width: 24px; height: 24px; border-radius: 4px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.topbar .spacer { flex: 1; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 16px; }

/* Category tabs (underline style) */
.tabbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1 1 auto; min-width: 0; }
.tab { white-space: nowrap; padding: 9px 14px; border: none; border-bottom: 2px solid transparent; background: none; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab .n { margin-left: 6px; font-size: 11.5px; padding: 0 6px; border-radius: 3px; background: var(--head); color: var(--muted); }
.tab[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
.tabbar .btn { margin-bottom: 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; background: var(--surface); }
.seg button { border: none; background: none; padding: 6px 11px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button[aria-pressed=true] { background: var(--brand-soft); color: var(--brand); }
.toolbar select { width: auto; min-width: 190px; }
.search { flex: 1 1 220px; max-width: 360px; }
.count { color: var(--muted); font-size: 12.5px; margin-left: auto; }

/* WO list — table-like rows */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-head, .card { display: grid; grid-template-columns: minmax(0, 1fr) 230px 170px; gap: 14px; align-items: center; padding: 10px 14px; }
.list-head { background: var(--head); font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.list-head .c, .card .c { text-align: center; }
.list-head .r, .card .r { text-align: right; }
.card { border-bottom: 1px solid var(--line); cursor: pointer; }
.card:last-child { border-bottom: none; }
.card:hover { background: #f8fafc; }
.card:focus-visible { outline: 2px solid #8db4dc; outline-offset: -2px; }
.card .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .s { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12.5px; color: var(--muted); }
.meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin-top: 3px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.cat { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
.flag { font-size: 11.5px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 1px 7px; border-radius: 3px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* Legend status chip (colors set inline from the tracker legend) */
.status { display: inline-block; max-width: 100%; padding: 3px 10px; border-radius: 3px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid rgba(0,0,0,.08); }
.due { font-weight: 600; }
.due-over { color: var(--danger); }
.due-today, .due-soon { color: var(--warn); }
.due-later, .due-none { color: var(--muted); font-weight: 400; }

/* Drawer & modal */
.scrim { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100%); background: var(--bg); z-index: 41; overflow-y: auto; box-shadow: var(--shadow); }
.drawer-head { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; z-index: 2; flex-wrap: wrap; }
.drawer-head h2 { margin: 2px 0 6px; font-size: 17px; }
.drawer-body { padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel > h3 { margin: 0; padding: 9px 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--head); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: var(--radius) var(--radius) 0 0; }
.panel > .pb { padding: 12px 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.desc { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 9px 10px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 0; font-size: 13px; margin: 0; }
.kv dt, .kv dd { padding: 6px 0; border-bottom: 1px solid #edf0f3; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 12px; }
.kv dd { overflow-wrap: anywhere; white-space: pre-wrap; }
.staffonly { font-size: 10.5px; font-weight: 700; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 5px; text-transform: uppercase; letter-spacing: .04em; }

.modal { position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px);
  overflow: auto; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); }
.modal-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--surface); }
.section-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 -2px; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 4/3; border-radius: 4px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11.5px; color: var(--muted); text-align: center; padding: 0; cursor: pointer; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .ftype { font-weight: 800; letter-spacing: .06em; color: var(--faint); }
.ph .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(16,24,40,.62); color: #fff; font-size: 10.5px; padding: 3px 6px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 8px; }
.phase-h b { font-size: 12.5px; letter-spacing: .03em; }

/* Files (invoices) */
.files { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.file { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: none; }
.file .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Chat */
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.msg { max-width: 88%; padding: 7px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.msg.mine { align-self: flex-end; background: var(--brand-soft); border-color: #cfdcec; }
.msg.internal { border-style: dashed; background: #fffbea; border-color: #e7d48a; }
.msg.update { align-self: center; background: transparent; border: none; color: var(--muted); font-size: 12px; text-align: center; padding: 2px; }
.msg .who { font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* Login / notices */
.center-card { max-width: 420px; margin: 10vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.center-card .brand .dot { background: var(--brand); }
.notice { padding: 9px 12px; border-radius: 4px; background: var(--brand-soft); color: #1d4a78; font-size: 13px; border: 1px solid #cfdcec; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0d9b0; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .2s; z-index: 99;
  background: #1e2a38; color: #fff; padding: 9px 14px; border-radius: 4px; font-weight: 600; max-width: calc(100% - 32px); pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

.progress { font-size: 12.5px; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(10,14,20,.9); display: grid; place-items: center; padding: 16px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 82vh; border-radius: 4px; }
.lightbox .row { position: absolute; top: 12px; right: 12px; }

/* Menu (PDF options) */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: var(--shadow); padding: 4px; }
.menu button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 3px; cursor: pointer; font-size: 13px; }
.menu button:hover { background: var(--brand-soft); }
.menu button small { display: block; color: var(--muted); font-size: 11.5px; }

/* Sub page */
.wrap.narrow { max-width: 720px; display: flex; flex-direction: column; gap: 12px; }
label.btn { position: relative; }
details > summary { list-style: revert; }

@media (max-width: 760px) {
  .list-head { display: none; }
  .card { grid-template-columns: 1fr; gap: 6px; }
  .card .c { text-align: left; order: -1; }
  .card .r { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 10px; }
  #meLabel { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .tabbar { flex-wrap: wrap; }
  .toolbar select { min-width: 0; flex: 1 1 160px; }
}

/* ---- Printable work order page (captured into the PDF) — same look as the WorkOrder PDF Builder ---- */
#printHost { position: fixed; left: -10000px; top: 0; width: 700px; }
#printPage {
  width: 700px; background: #ffffff; color: #17181C;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 34px 38px 42px;
}
.print-header { display: flex; justify-content: flex-end; }
.print-header-right { text-align: right; }
.print-header-right h1 { font-size: 20px; margin: 0 0 6px; }
.print-header-meta { font-size: 12.5px; line-height: 1.55; color: #17181C; }
.print-hr { border: none; border-top: 2px solid #17181C; margin: 16px 0; }
.print-h2 { font-size: 13px; letter-spacing: .02em; margin: 0 0 12px; }
.print-grid { display: grid; grid-template-columns: 1fr 1fr; row-gap: 14px; column-gap: 18px; }
.print-field { padding-bottom: 8px; border-bottom: 1px solid #D8DADE; }
.print-label { font-size: 11px; color: #55585F; margin-bottom: 3px; font-weight: 600; }
.print-value { font-size: 13px; min-height: 15px; word-break: break-word; }
.print-issue-label { font-size: 11px; color: #55585F; margin: 0 0 3px; }
.print-issue-body { font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
.print-footer { display: flex; justify-content: space-between; font-size: 10px; color: #55585F; }

/* Notifications */
.bell-wrap { position: relative; margin-left: 6px; }
.bell { position: relative; width: 36px; height: 34px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.bell:hover { background: var(--surface-2); }
.bell .ico { width: 18px; height: 18px; vertical-align: 0; }
.bell .badge { position: absolute; top: -6px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.bell-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: min(420px, calc(100vw - 24px)); max-height: min(560px, 75vh); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow); }
.bell-head { position: sticky; top: 0; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.bell-head b { flex: 1; }
.bell-head .btn { min-height: 28px; padding: 3px 8px; font-size: 12px; }
.nitem { display: block; width: 100%; text-align: left; border: none; border-bottom: 1px solid var(--line); background: none; padding: 9px 12px; cursor: pointer; font-size: 13px; }
.nitem:hover { background: #f6f8fb; }
.nitem.unread { background: #eef4fb; box-shadow: inset 3px 0 0 var(--brand); }
.nitem .nt { font-weight: 700; }
.nitem .nw { color: var(--muted); font-size: 12px; }
.nitem .nb { margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.push-banner { background: #fff7e0; border-bottom: 1px solid #f0d9b0; color: #6b4a00; padding: 9px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.push-banner .btn { min-height: 30px; }
@media (max-width: 760px) { .bell-panel { position: fixed; top: 52px; left: 12px; right: 12px; width: auto; } }
.topbar .bell-panel .btn { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.topbar .bell-panel .btn:hover { background: var(--surface-2); }

/* history / footprint */
.hist { display: grid; grid-template-columns: 150px 1fr; gap: 8px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid #edf0f3; overflow-wrap: anywhere; }
.hist:last-child { border-bottom: 0; }
.hist .h-when { color: var(--muted); font-size: 12px; }
.hist .h-old { color: #8a2a20; text-decoration: line-through; text-decoration-color: rgba(138,42,32,.45); }
.hist .h-new { color: #1d6b32; font-weight: 600; }
#histList { max-height: 60vh; overflow: auto; }
.btn.small { padding: 3px 9px; font-size: 11.5px; text-transform: none; letter-spacing: 0; }
@media (max-width: 640px) { .hist { grid-template-columns: 1fr; gap: 2px; } }

@media (max-width: 420px) { .brand .logo { height: 26px; } .brand .app-name { font-size: 13px; padding-left: 8px; } }

/* =====================================================================
   SiteCapture-style layout (v6)
   ===================================================================== */
:root { --sc-top: #f5f5f5; --sc-line: #e2e2e0; --sc-gray: #eeeeec; --sc-label: #4f5d6e; --sc-sel: #5b7fc8; --sc-text: #2b2f33; }
body { background: #fff; color: var(--sc-text); }
.topbar { background: var(--sc-top); border-bottom: 1px solid var(--sc-line); box-shadow: none; padding: 0 16px; height: 52px; gap: 6px; }
.topbar .brand .logo { height: 28px; }
.topnav { display: flex; align-self: stretch; margin-left: 18px; }
.topnav a { display: flex; align-items: center; padding: 0 6px; font-size: 16px; font-weight: 600; color: #2d6be4; text-decoration: none; border-bottom: 2px solid transparent; }
.topnav a.active { border-bottom-color: #2d6be4; }
.iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 0; background: transparent; color: #666; border-radius: 6px; cursor: pointer; position: relative; padding: 0; }
.iconbtn:hover { background: rgba(0,0,0,.06); color: #333; }
.iconbtn .ico { width: 22px; height: 22px; stroke-width: 1.6; vertical-align: 0; }
.iconbtn.sm { width: 30px; height: 30px; }
.iconbtn.sm .ico { width: 17px; height: 17px; }
.iconbtn:disabled { opacity: .35; cursor: default; background: transparent; }
.bell-wrap { margin-left: 0; }
.bell { width: 38px; height: 38px; border: 0; background: transparent; color: #666; }
.bell .ico { width: 22px; height: 22px; }
.bell .badge { top: 1px; right: 0; border-color: var(--sc-top); }
.bell-panel { left: auto; right: 0; }
.drop-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 200px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow); padding: 4px; }
.dropdown button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.dropdown button:hover { background: #f0f4fb; }
.me-h { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; font-size: 13px; }
.me-h span { color: var(--muted); font-size: 12px; }
.push-banner { padding: 8px 16px; }

/* ---- list page ---- */
.lv { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: calc(100vh - 52px); }
.views { background: #f7f7f7; border-right: 1px solid var(--sc-line); padding: 18px 0; }
.views-h { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6c7480; padding: 10px 22px 8px; }
.views-h:not(:first-child) { margin-top: 14px; border-top: 1px solid var(--sc-line); padding-top: 18px; }
.vgroup button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; border: 0; background: none; padding: 9px 22px; font-size: 15px; color: #555; cursor: pointer; text-align: left; }
.vgroup button:hover { background: #ececec; }
.vgroup button .n { color: #777; font-size: 14px; }
.vgroup button[aria-pressed=true] { background: var(--sc-sel); color: #fff; font-weight: 600; }
.vgroup button[aria-pressed=true] .n { color: #fff; }
.lmain { padding: 16px 24px 40px; min-width: 0; }
.lhead { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--sc-line); flex-wrap: wrap; }
.lhead h1 { margin: 0; font-size: 24px; font-weight: 600; color: #333; }
.lhead .count { margin-left: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 0; }
.flt { display: flex; align-items: center; gap: 8px; }
.flt > span { font-size: 13px; color: #777; letter-spacing: .03em; }
.flt select { width: auto; min-width: 160px; }
.searchbox { display: flex; flex: 1 1 260px; max-width: 420px; }
.searchbox input { border-radius: 4px 0 0 4px; }
.searchbox .btn { border-radius: 0 4px 4px 0; margin-left: -1px; min-width: 52px; background: #f6f6f6; }
.searchbox .btn .ico { width: 18px; height: 18px; }
.pager { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 13.5px; font-weight: 600; color: #444; }
.pager span { margin-right: 6px; }
.pager select { width: auto; min-height: 30px; padding: 3px 6px; margin-left: 8px; }
.only-mobile { display: none; }
.list { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.wtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.wtable th { text-align: left; font-size: 13px; font-weight: 500; color: #777; letter-spacing: .02em; padding: 10px 10px; border-bottom: 1px solid #ddd; white-space: nowrap; }
.wtable td { padding: 12px 10px; border-bottom: 1px solid #eee; vertical-align: top; color: #444; }
.wtable tbody tr { cursor: pointer; }
.wtable tbody tr:hover { background: #f7f9fc; }
.wtable tbody tr:focus-visible { outline: 2px solid #8db4dc; outline-offset: -2px; }
.th-thumb, .td-thumb { width: 72px; }
.thumbbox { width: 62px; height: 62px; background: #f1f1f1; border-radius: 2px; display: grid; place-items: center; align-content: center; gap: 2px; color: #9aa0a6; font-size: 12px; }
.thumbbox b { font-weight: 600; color: #888; }
.td-title { min-width: 220px; line-height: 1.4; }
.td-title .t { font-weight: 700; color: #111; font-size: 15px; }
.td-title .meta { margin-top: 4px; }
.td-status .status { max-width: 200px; }
.wtable .sub { color: #888; font-size: 13px; margin-top: 3px; }
.td-tags .flag { display: inline-block; margin: 0 4px 4px 0; }
.flag.grey { color: var(--muted); background: var(--head); }

/* ---- WO page ---- */
.detail { background: #fff; }
.crumb { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--sc-line); background: #fff; flex-wrap: wrap; position: sticky; top: 52px; z-index: 15; }
.crumb > a { color: #2d6be4; text-decoration: none; font-size: 15px; }
.crumb .sep { color: #999; }
.crumb .cur { font-size: 15px; color: #222; font-weight: 500; }
.crumb .spacer { flex: 1; }
.crumb .menu { left: auto; right: 0; }
#pdfProg { margin: 0; padding: 0 16px; }
#pdfProg:empty { display: none; }
.dgrid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 400px; align-items: start; min-height: calc(100vh - 110px); }
.dleft { padding: 22px 22px; position: sticky; top: 110px; }
.dl-top { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.dleft h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; color: #222; }
.dleft .dl-po { font-size: 16px; }
.dl-top > div > div { font-size: 16px; color: #222; }
.pinbtn { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 3px; background: #9fd57f; color: #fff; display: grid; place-items: center; }
.pinbtn .ico { width: 20px; height: 20px; stroke: #fff; vertical-align: 0; }
.dl-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.dnav { margin-top: 18px; border-bottom: 1px solid var(--sc-line); padding-bottom: 14px; }
.dnav a { display: flex; justify-content: space-between; padding: 8px 4px; color: #5c6670; text-decoration: none; font-size: 16px; }
.dnav a:hover { color: #222; }
.dnav a .n { color: #e8892b; font-size: 14px; font-weight: 600; }
.dmain { background: var(--sc-gray); padding: 18px 24px 60px; min-height: calc(100vh - 110px); min-width: 0; }
.dmain section { margin-bottom: 22px; scroll-margin-top: 120px; }
.dmain h2 { font-size: 20px; font-weight: 700; color: #333; margin: 6px 0 12px; display: flex; align-items: center; gap: 8px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.fcard { background: #fff; border: 1px solid #e6e6e4; border-radius: 3px; padding: 14px 14px 16px; }
.fcard + .fcard { margin-top: 12px; }
.fgrid .fcard + .fcard { margin-top: 0; }
.fcard.f { cursor: pointer; }
.fcard.f:hover { border-color: #cfd6e0; }
.fl { color: var(--sc-label); font-size: 15px; font-weight: 500; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fh { color: #777; font-size: 13.5px; margin: -2px 0 8px; }
.fv { border: 1px solid #d9d9d9; border-radius: 2px; min-height: 38px; padding: 8px 10px; font-size: 15px; color: #222; background: #fff; overflow-wrap: anywhere; }
.fv.multi { white-space: pre-wrap; min-height: 64px; }
.fv.locked { background: #f4f4f3; color: #555; }
.lockmark { margin-left: auto; color: #9aa1aa; display: inline-flex; }
.lockmark .ico { width: 15px; height: 15px; }
.dright { border-left: 1px solid var(--sc-line); padding: 18px 20px 40px; background: #fff; }
.rp-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 12px; }
.rp-row label { font-size: 15px; color: #555; }
.rp-v { font-size: 15px; padding: 6px 2px; }
.rp-note { margin: -4px 0 12px 106px; }
.rp-block { border-top: 1px solid var(--sc-line); margin-top: 14px; padding-top: 14px; }
.rp-bh { font-size: 15px; color: #555; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.rp-block input { font-size: 13px; }
.rp-block .btn { min-height: 32px; padding: 5px 10px; }
.dinfo { border-top: 1px solid var(--sc-line); margin-top: 16px; padding-top: 14px; }
.info { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; margin: 0; font-size: 14px; }
.info dt { font-weight: 700; color: #333; }
.info dd { margin: 0; color: #444; overflow-wrap: anywhere; }
.activity { border-top: 1px solid var(--sc-line); margin-top: 16px; padding-top: 14px; }
.act-h { font-size: 14px; color: #555; margin-bottom: 10px; line-height: 1.5; }
.act-h b { color: #222; }
.abox { background: #f4f4f4; padding: 8px 12px; margin-bottom: 6px; font-size: 14px; overflow-wrap: anywhere; }
.abox .ah { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.abox .ah b { font-size: 13.5px; }
.abox .ah span { color: #777; font-size: 12.5px; }
.abox .h-old { color: #8a2a20; text-decoration: line-through; text-decoration-color: rgba(138,42,32,.45); }
.abox .h-new { color: #1d6b32; font-weight: 600; }
.dmain .thread { max-height: 520px; }

/* small (?) help bubbles */
.help-wrap { position: relative; display: inline-flex; vertical-align: middle; }
.help { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #9aa3ad; background: #fff; color: #6b7480; font-size: 11px; font-weight: 700; line-height: 1; padding: 0; cursor: pointer; display: grid; place-items: center; }
.help:hover { border-color: #5b6472; color: #333; }
.help-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: -8px; width: 270px; background: #fff; color: #333; border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow); padding: 9px 11px; font-size: 13px; font-weight: 400; line-height: 1.45; }

@media (max-width: 1180px) {
  .dgrid { grid-template-columns: 260px minmax(0, 1fr); }
  .dright { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--sc-line); display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 28px; }
  .dright > * { margin-top: 0 !important; }
  .dright .rp-block, .dright .dinfo, .dright .activity { border-top: 0; padding-top: 0; }
}
@media (max-width: 900px) {
  .lv { grid-template-columns: 1fr; }
  .views { display: none; }
  .only-mobile { display: flex; }
  .lmain { padding: 12px 14px 40px; }
  .lhead h1 { font-size: 20px; }
  .flt { flex: 1 1 100%; }
  .flt > span { width: 52px; }
  .flt select { flex: 1; min-width: 0; }
  .searchbox { max-width: none; flex: 1 1 100%; }
  .pager { margin-left: 0; }
  .wtable thead { display: none; }
  .wtable, .wtable tbody { display: block; }
  .wtable tr { display: grid; grid-template-columns: 62px minmax(0, 1fr); column-gap: 12px; padding: 12px 0; border-bottom: 1px solid #e6e6e6; }
  .wtable td { display: block; border: 0; padding: 0; grid-column: 2; font-size: 13px; }
  .wtable td.td-thumb { grid-column: 1; grid-row: 1 / span 9; }
  .wtable .thumbbox { width: 56px; height: 56px; }
  .wtable td.td-status { order: -1; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
  .wtable td.td-status .sub { margin: 0; }
  .wtable td[data-l]:empty, .wtable td[data-l]:has(span:empty) { display: none; }
  .wtable td[data-l]::before { content: attr(data-l) ": "; color: #888; }
  .wtable td.td-tags:empty { display: none; }
  .wtable td.td-tags { margin-top: 4px; }
  .dgrid { display: flex; flex-direction: column; }
  .dgrid > * { min-width: 0; max-width: 100%; }
  .wtable td[data-l="Updated"], .wtable td[data-l="Created"], .wtable td[data-l="Market"] .sub { display: none; }
  .wtable .td-title .meta { display: none; }
  .me-h #meLabel { display: block; }
  .dleft { position: static; padding: 16px; }
  .dnav { display: flex; gap: 6px; overflow-x: auto; border-bottom: 0; padding-bottom: 0; margin-top: 12px; }
  .dnav a { flex: 0 0 auto; border: 1px solid var(--sc-line); border-radius: 16px; padding: 5px 12px; font-size: 13.5px; gap: 6px; }
  .dright { display: contents; }
  #dHead { order: 1; padding: 4px 16px 0; }
  #dShare { order: 2; padding: 0 16px 14px; }
  #dShare .rp-block { margin-top: 4px; }
  .dmain { order: 3; padding: 14px 12px 30px; min-height: 0; }
  #dInfo { order: 4; padding: 14px 16px 0; margin: 0; }
  .activity { order: 5; padding: 14px 16px 30px; margin: 0; }
  .crumb { top: 52px; padding: 6px 10px; }
  .crumb #dCrumbAll, .crumb .sep { display: none; }
  .crumb .cur { font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crumb .spacer { display: none; }
  #dActions { width: 100%; }
  #dActions .btn { flex: 1 1 auto; }
  .fgrid { grid-template-columns: 1fr; }
  .topnav { margin-left: 8px; }
  .topnav a { font-size: 14px; }
  .help-pop { width: min(270px, 80vw); }
}
@media (max-width: 420px) { .topnav { display: none; } .iconbtn { width: 34px; } }

/* access requests (admin) */
.iconbtn .badge { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--sc-top); }
.req-bar { background: #eaf1fd; border-bottom: 1px solid #c9daf6; color: #1d3f78; padding: 9px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.req-bar .btn { min-height: 30px; }

/* fields that can't be edited here (from the tracker): clearly gray */
input:disabled, select:disabled, textarea:disabled { background: #e9ecef; color: #6b7280; -webkit-text-fill-color: #6b7280; border-color: #d6dbe0; cursor: not-allowed; opacity: 1; }
.field.is-locked > span { color: #8a929c; display: flex; align-items: center; gap: 4px; }
.field > span .lockmark { margin-left: 0; }
.fv.locked { background: #e9ecef; color: #6b7280; border-color: #d6dbe0; }
.fv.locked a { color: #4b6a99; }
.fcard.f .fl { color: var(--sc-label); }
.fcard.f:has(.fv.locked) .fl { color: #8a929c; }

/* tagline under the logo */
.tagline { display: block; font-size: 9.5px; line-height: 1; color: #6b7480; font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
.topbar .brand { flex-direction: column; align-items: flex-start; gap: 3px; text-decoration: none; }
.topbar .brand .logo { height: 25px; }
.brand-stack { display: flex; flex-direction: column; gap: 3px; }
.tagline.center { text-align: center; font-size: 12px; margin-top: -6px; }

/* bell sound / push buttons */
.bell-head .btn + .btn { margin-left: 0; }

@media (max-width: 900px) { .tagline { font-size: 8.5px; } }

/* =====================================================================
   Calendar — Google Calendar feel, TriArc legend colors
   ===================================================================== */
body.noscroll { overflow: hidden; }
/* sidebar mini month */
.minical { padding: 2px 14px 18px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 0 4px 8px; }
.cal-h b { font-size: 15px; font-weight: 600; color: #3c4043; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-grid .wd { text-align: center; font-size: 10.5px; font-weight: 600; color: #70757a; padding: 4px 0; }
.cd { border: 0; background: none; cursor: pointer; height: 36px; display: flex; flex-direction: column; align-items: center; padding: 1px 0 0; font-size: 12px; color: #3c4043; }
.cd .dn { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; transition: background .15s; }
.cd:hover .dn { background: #e8eaed; }
.cd.out { color: #b0b4b9; }
.cd.today .dn { background: #1a73e8; color: #fff; font-weight: 600; }
.dots { display: flex; gap: 2px; height: 6px; margin-top: 2px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 .5px rgba(0,0,0,.18); }
.dots i.dd { background: #fff; box-shadow: inset 0 0 0 1.5px var(--c); }
.cal-open { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 10px; padding: 10px 12px; border: 1px solid #dadce0; border-radius: 12px; background: #fff; cursor: pointer; font-size: 13px; color: #3c4043; }
.cal-open:hover { background: #f1f3f4; }
.cal-open .ico { width: 16px; height: 16px; color: #5f6368; }

/* full calendar sheet (phone-style card) */
.cal-sheet { position: fixed; z-index: 45; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1080px, calc(100% - 32px)); height: min(760px, calc(100% - 32px));
  background: #fff; border-radius: 24px; box-shadow: 0 24px 60px rgba(32,33,36,.28), 0 0 0 1px rgba(0,0,0,.06); display: flex; flex-direction: column; overflow: hidden;
  font-family: "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; animation: csIn .22s ease-out; }
@keyframes csIn { from { opacity: 0; transform: translate(-50%, -47%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.cs-grab { display: none; }
.cs-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px 22px; }
.cs-title { font-size: 20px; font-weight: 500; color: #202124; flex: 1; }
.cs-top select { width: auto; min-height: 34px; border-radius: 18px; padding: 4px 12px; border-color: #dadce0; background: #f8f9fa; font-size: 13px; }
.cs-tabs { display: none; position: relative; margin: 4px 16px 0; background: #f1f3f4; border-radius: 20px; padding: 3px; }
.cs-tabs button { position: relative; z-index: 1; flex: 1; border: 0; background: none; padding: 7px 0; font-size: 13.5px; font-weight: 600; color: #5f6368; cursor: pointer; border-radius: 17px; }
.cs-tabs button[aria-selected=true] { color: #1a73e8; }
.cs-ink { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: #fff; border-radius: 17px; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .25s ease; }
.cal-sheet[data-pane=month] .cs-ink { transform: translateX(100%); }
.cs-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 380px minmax(0, 1fr); }
.cs-pane { min-height: 0; overflow-y: auto; }
#csDay { border-right: 1px solid #e8eaed; padding: 6px 14px 20px; }
#csMonth { padding: 6px 16px 16px; display: flex; flex-direction: column; }

/* day view */
.cs-weekbar { display: flex; align-items: center; gap: 2px; }
.cs-week { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }
.wk { border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border-radius: 14px; }
.wk .wl { font-size: 11px; font-weight: 600; color: #70757a; }
.wk .wn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; color: #3c4043; }
.wk:hover .wn { background: #f1f3f4; }
.wk.today .wn { color: #1a73e8; font-weight: 700; }
.wk.sel .wn { background: #1a73e8; color: #fff; font-weight: 600; }
.cs-dayhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 4px 6px; border-bottom: 1px solid #f1f3f4; }
.cs-dayhead b { font-size: 16px; font-weight: 500; color: #202124; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; color: #1a73e8; background: #e8f0fe; border-radius: 10px; padding: 1px 8px; vertical-align: 2px; }
.cs-list { padding-top: 6px; }
.cs-sec { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #70757a; margin: 12px 4px 6px; }
.ev { display: flex; align-items: stretch; gap: 4px; margin-bottom: 8px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(60,64,67,.15), 0 1px 3px 1px rgba(60,64,67,.08); overflow: visible; position: relative; }
.ev::before { content: ""; flex: 0 0 6px; border-radius: 12px 0 0 12px; background: var(--c); }
.ev.due::before { background: repeating-linear-gradient(180deg, var(--c) 0 6px, transparent 6px 9px); box-shadow: inset -1px 0 0 var(--c); }
.ev-main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 9px 4px 9px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.ev-t { font-size: 14px; font-weight: 600; color: #202124; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-a { font-size: 13px; color: #5f6368; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-m { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.ev-k { font-size: 11.5px; font-weight: 600; color: #3c4043; }
.ev.late .ev-k { color: #d93025; }
.ev-s { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 10px; background: var(--c); color: var(--f); white-space: nowrap; }
.ev .menu-wrap { align-self: center; margin-right: 4px; }
.ev .iconbtn.sm { color: #5f6368; }
.cs-over { margin: 8px 0 4px; }
.cs-over summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #d93025; background: #fce8e6; border-radius: 12px; padding: 8px 12px; list-style: none; display: flex; align-items: center; gap: 8px; }
.cs-over summary::-webkit-details-marker { display: none; }
.cs-over[open] summary { margin-bottom: 8px; }
.dot-red { width: 8px; height: 8px; border-radius: 50%; background: #d93025; }
.cs-empty { text-align: center; color: #80868b; padding: 40px 10px; font-size: 14px; }
.cs-empty .ico { width: 36px; height: 36px; stroke-width: 1.2; color: #c4c7c5; margin-bottom: 6px; }

/* month view */
.cs-monthbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 10px; }
.cs-monthbar b { font-size: 20px; font-weight: 400; color: #3c4043; }
.btn.small.round, .cal-sheet .btn.small { border-radius: 16px; padding: 3px 12px; min-height: 30px; border-color: #dadce0; }
.mgrid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(92px, 1fr); border-top: 1px solid #e8eaed; border-left: 1px solid #e8eaed; }
.mwd { font-size: 11px; font-weight: 600; color: #70757a; text-align: center; padding: 6px 0; border-right: 1px solid #e8eaed; border-bottom: 1px solid #e8eaed; text-transform: uppercase; letter-spacing: .04em; }
.mgrid { grid-template-rows: auto; }
.mc { border: 0; border-right: 1px solid #e8eaed; border-bottom: 1px solid #e8eaed; background: #fff; text-align: left; padding: 4px 4px 6px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; overflow: hidden; }
.mc:hover { background: #f8f9fa; }
.mc .dn { align-self: center; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; color: #3c4043; margin-bottom: 2px; }
.mc.out .dn { color: #b0b4b9; }
.mc.today .dn { background: #1a73e8; color: #fff; font-weight: 600; }
.mc.sel:not(.today) .dn { background: #d2e3fc; color: #185abc; font-weight: 600; }
.chip { display: block; font-size: 11px; line-height: 17px; padding: 0 6px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--c); color: var(--f); font-weight: 600; }
.chip.due { background: #fff; color: #3c4043; box-shadow: inset 0 0 0 1.5px var(--c); }
.chip.due.late { color: #d93025; box-shadow: inset 0 0 0 1.5px #d93025; }
.mc.out .chip { opacity: .55; }
.more { font-size: 11px; color: #5f6368; font-weight: 600; padding-left: 6px; }
.cs-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 2px 0; font-size: 11.5px; color: #5f6368; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg i { width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.lg i.solid { background: #5f6368; }
.lg i.ring { background: #fff; box-shadow: inset 0 0 0 1.5px #5f6368; }
.cal-sheet .menu { z-index: 60; }
.cal-menu { left: auto; right: 0; min-width: 230px; }
.cal-menu .mi { display: block; padding: 8px 10px; border-radius: 3px; font-size: 13px; color: var(--text); text-decoration: none; }
.cal-menu .mi:hover { background: var(--brand-soft); }
.cal-menu small { display: block; color: var(--muted); font-size: 11.5px; }

/* phone: a bottom sheet you swipe between Day and Month */
@media (max-width: 900px) {
  .cal-sheet { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; height: calc(100% - 28px); border-radius: 24px 24px 0 0; animation: csUp .25s ease-out; }
  @keyframes csUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .cs-grab { display: block; width: 36px; height: 4px; border-radius: 2px; background: #dadce0; margin: 8px auto 0; }
  .cs-top { padding: 6px 12px 4px 18px; }
  .cs-tabs { display: flex; }
  .cs-panes { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
  .cs-panes::-webkit-scrollbar { display: none; }
  .cs-pane { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
  #csDay { border-right: 0; padding: 6px 12px calc(20px + env(safe-area-inset-bottom)); }
  #csMonth { padding: 6px 8px calc(16px + env(safe-area-inset-bottom)); }
  .mgrid { grid-auto-rows: minmax(64px, 1fr); }
  .mc { padding: 3px 2px 4px; align-items: center; }
  .mc .chip { font-size: 0; width: 7px; height: 7px; padding: 0; border-radius: 50%; display: inline-block; }
  .mc .chip.due { width: 7px; height: 7px; }
  .mc { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 2px; }
  .mc .dn { flex: 0 0 100%; display: grid; justify-items: center; background: none; }
  .mc.today .dn, .mc.sel:not(.today) .dn { background: none; }
  .mc.today .dn { color: #fff; background: radial-gradient(circle, #1a73e8 11px, transparent 12px); }
  .mc.sel:not(.today) .dn { color: #185abc; background: radial-gradient(circle, #d2e3fc 11px, transparent 12px); }
  .mc .more { font-size: 9.5px; padding: 0; flex: 0 0 100%; text-align: center; }
  .cs-monthbar b { font-size: 18px; }
}

/* + / − section folding on the WO page */
.dmain h2.sec-h { cursor: pointer; user-select: none; -webkit-user-select: none; justify-content: space-between; }
.dmain h2.sec-h:hover .sec-tog { background: #fff; border-color: #b9c0c8; }
.sec-tog { margin-left: auto; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; border: 1px solid #cfd4da; background: #f7f7f6; color: #4f5d6e; font-size: 19px; font-weight: 500; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0 0 2px; }
.dmain section.collapsed > :not(h2) { display: none !important; }
.dmain section.collapsed { margin-bottom: 10px; }
.dmain section.collapsed h2 { background: #fff; border: 1px solid #e6e6e4; border-radius: 3px; padding: 10px 12px; font-size: 17px; }

/* one Notifications switch (push + sound) */
.notif-sw { gap: 5px; border-radius: 16px; min-height: 30px; padding: 3px 12px; color: #5f6368; }
.notif-sw .ico { width: 15px; height: 15px; }
.notif-sw.on { background: #e8f0fe; border-color: #c6dafc; color: #1a73e8; }

/* small tags / theme switch */
.itag { font-size: 10.5px; font-weight: 700; color: #8a5a00; background: #fff4d6; border-radius: 3px; padding: 0 5px; }
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 14px; }
.theme-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 2px; }
.dropdown .theme-seg button { width: auto; padding: 4px 10px; border-radius: 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dropdown .theme-seg button[aria-pressed=true] { background: #1a73e8; color: #fff; }
.modal-head h2 .help-wrap { vertical-align: 2px; }
.modal-head h2 .help-pop { font-weight: 400; }

/* =====================================================================
   NIGHT MODE
   ===================================================================== */
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #16181c; --surface: #1e2126; --surface-2: #262a30; --head: #23272d;
  --line: #31363d; --line-strong: #3d434b;
  --text: #e3e6ea; --muted: #a3abb5; --faint: #7d8691;
  --brand: #4c8fe0; --brand-ink: #ffffff; --brand-soft: #1f3550;
  --danger: #ff7b6e; --danger-soft: #3a1f1d; --warn: #f2b45a; --warn-soft: #3a2c15; --ok: #5fd08f; --ok-soft: #1a3324;
  --sc-top: #1b1e23; --sc-line: #30353c; --sc-gray: #121417; --sc-label: #a9b6c6; --sc-sel: #3d5f9e; --sc-text: #e3e6ea;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.45);
}
[data-theme=dark] body, [data-theme=dark] .detail, [data-theme=dark] .crumb, [data-theme=dark] .dright, [data-theme=dark] .lmain { background: var(--bg); color: var(--text); }
[data-theme=dark] .topbar { background: var(--sc-top); border-color: var(--sc-line); }
[data-theme=dark] .brand .logo { content: url("logo-dark.svg"); }
[data-theme=dark] .tagline { color: #8f98a3; }
[data-theme=dark] .topnav a { color: #8ab4f8; } [data-theme=dark] .topnav a.active { border-bottom-color: #8ab4f8; }
[data-theme=dark] .iconbtn, [data-theme=dark] .bell { color: #b8c0ca; }
[data-theme=dark] .iconbtn:hover { background: rgba(255,255,255,.08); color: #fff; }
[data-theme=dark] .btn { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
[data-theme=dark] .btn:hover { background: #2e333a; border-color: #4a515a; }
[data-theme=dark] .btn.primary { background: #2f6fcf; border-color: #2f6fcf; color: #fff; }
[data-theme=dark] .btn.danger { color: var(--danger); }
[data-theme=dark] input[type=text], [data-theme=dark] input[type=email], [data-theme=dark] input[type=password], [data-theme=dark] input[type=date],
[data-theme=dark] input[type=number], [data-theme=dark] input[type=tel], [data-theme=dark] select, [data-theme=dark] textarea { background: #15171b; border-color: var(--line-strong); color: var(--text); }
[data-theme=dark] input:disabled, [data-theme=dark] select:disabled, [data-theme=dark] textarea:disabled { background: #2a2e34; color: #8c949e; -webkit-text-fill-color: #8c949e; border-color: #353a41; }
[data-theme=dark] .views { background: #1a1d21; border-color: var(--sc-line); }
[data-theme=dark] .views-h { color: #8f98a3; }
[data-theme=dark] .vgroup button { color: #c7cdd4; } [data-theme=dark] .vgroup button:hover { background: #24282e; }
[data-theme=dark] .vgroup button .n { color: #8f98a3; }
[data-theme=dark] .vgroup button[aria-pressed=true] { background: #2f5aa8; color: #fff; }
[data-theme=dark] .lhead h1, [data-theme=dark] .dmain h2, [data-theme=dark] .dleft h1, [data-theme=dark] .td-title .t, [data-theme=dark] .crumb .cur, [data-theme=dark] .dl-top > div > div { color: #eef1f4; }
[data-theme=dark] .wtable th { color: #8f98a3; border-color: var(--line); }
[data-theme=dark] .wtable td { color: #cfd5dc; border-color: #262a30; }
[data-theme=dark] .wtable tbody tr:hover { background: #1d2127; }
[data-theme=dark] .thumbbox { background: #23272d; color: #6f7883; }
[data-theme=dark] .searchbox .btn { background: var(--surface-2); }
[data-theme=dark] .pager { color: #c7cdd4; }
[data-theme=dark] .dmain { background: var(--sc-gray); }
[data-theme=dark] .fcard { background: var(--surface); border-color: var(--line); }
[data-theme=dark] .fcard.f:hover { border-color: #4a515a; }
[data-theme=dark] .fv { background: #15171b; border-color: var(--line-strong); color: var(--text); }
[data-theme=dark] .fv.locked { background: #2a2e34; color: #8c949e; border-color: #353a41; }
[data-theme=dark] .fv a, [data-theme=dark] a { color: #8ab4f8; }
[data-theme=dark] .dnav a { color: #a3abb5; } [data-theme=dark] .dnav a:hover { color: #fff; }
[data-theme=dark] .rp-row label, [data-theme=dark] .rp-bh, [data-theme=dark] .act-h, [data-theme=dark] .info dd { color: #a3abb5; }
[data-theme=dark] .info dt, [data-theme=dark] .act-h b { color: #e3e6ea; }
[data-theme=dark] .abox { background: #23272d; }
[data-theme=dark] .abox .h-old, [data-theme=dark] .hist .h-old { color: #ff9a8f; } [data-theme=dark] .abox .h-new, [data-theme=dark] .hist .h-new { color: #7ee2a8; }
[data-theme=dark] .sec-tog { background: #262a30; border-color: #3d434b; color: #c7cdd4; }
[data-theme=dark] .dmain section.collapsed h2 { background: var(--surface); border-color: var(--line); }
[data-theme=dark] .modal, [data-theme=dark] .modal-head, [data-theme=dark] .modal-foot, [data-theme=dark] .center-card,
[data-theme=dark] .dropdown, [data-theme=dark] .bell-panel, [data-theme=dark] .bell-head, [data-theme=dark] .menu, [data-theme=dark] .help-pop { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
[data-theme=dark] .dropdown button:hover, [data-theme=dark] .menu button:hover, [data-theme=dark] .cal-menu .mi:hover { background: #2a2f36; }
[data-theme=dark] .nitem { color: var(--text); border-color: var(--line); } [data-theme=dark] .nitem:hover { background: #24282e; }
[data-theme=dark] .nitem.unread { background: #1f2b3d; }
[data-theme=dark] .notice { background: #1f2b3d; color: #b9d3f5; border-color: #2e4568; }
[data-theme=dark] .notice.warn { background: #3a2c15; color: #f6cd8b; border-color: #5a4320; }
[data-theme=dark] .push-banner { background: #2d2614; border-color: #4a3d1e; color: #f0d9a0; }
[data-theme=dark] .req-bar { background: #1f2b3d; border-color: #2e4568; color: #b9d3f5; }
[data-theme=dark] .flag { background: #3a2c15; color: #f6cd8b; } [data-theme=dark] .flag.grey { background: #2a2e34; color: #a3abb5; }
[data-theme=dark] .itag { background: #3a2c15; color: #f6cd8b; }
[data-theme=dark] .msg { background: #23272d; border-color: var(--line); }
[data-theme=dark] .msg.mine { background: #1f3550; border-color: #2e4b70; }
[data-theme=dark] .msg.internal { background: #2d2614; border-color: #5a4a20; }
[data-theme=dark] .ph { background: #23272d; border-color: var(--line); }
[data-theme=dark] .files, [data-theme=dark] .file { border-color: var(--line); }
[data-theme=dark] .help { background: #23272d; border-color: #59616b; color: #b8c0ca; }
[data-theme=dark] .kv dt, [data-theme=dark] .kv dd { border-color: #2a2e34; }
[data-theme=dark] .status { border-color: rgba(255,255,255,.08); }
[data-theme=dark] #toast { background: #e3e6ea; color: #16181c; }
[data-theme=dark] .scrim { background: rgba(0,0,0,.6); }
[data-theme=dark] .lockmark { color: #7d8691; }
[data-theme=dark] .field > span { color: #a3abb5; } [data-theme=dark] .field.is-locked > span { color: #7d8691; }
[data-theme=dark] .theme-seg { background: #15171b; }
/* calendar */
[data-theme=dark] .cal-h b, [data-theme=dark] .cd, [data-theme=dark] .cs-title, [data-theme=dark] .cs-dayhead b, [data-theme=dark] .cs-monthbar b, [data-theme=dark] .ev-t, [data-theme=dark] .wk .wn, [data-theme=dark] .mc .dn { color: #e3e6ea; }
[data-theme=dark] .cd .dn:hover, [data-theme=dark] .cd:hover .dn, [data-theme=dark] .wk:hover .wn { background: #2a2f36; }
[data-theme=dark] .cd.out, [data-theme=dark] .mc.out .dn { color: #5f6873; }
[data-theme=dark] .cal-open { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
[data-theme=dark] .cal-open:hover { background: #24282e; }
[data-theme=dark] .cal-sheet { background: #1b1e23; box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px #30353c; }
[data-theme=dark] .cs-top select { background: #23272d; border-color: #3d434b; }
[data-theme=dark] .cs-tabs { background: #23272d; } [data-theme=dark] .cs-ink { background: #343a42; box-shadow: none; }
[data-theme=dark] .cs-tabs button[aria-selected=true] { color: #8ab4f8; }
[data-theme=dark] #csDay { border-color: #2a2e34; } [data-theme=dark] .cs-dayhead { border-color: #2a2e34; }
[data-theme=dark] .ev { background: #23272d; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
[data-theme=dark] .ev-a, [data-theme=dark] .ev-k { color: #a3abb5; }
[data-theme=dark] .cs-over summary { background: #3a1f1d; color: #ff9a8f; }
[data-theme=dark] .pill { background: #1f3550; color: #8ab4f8; }
[data-theme=dark] .mgrid, [data-theme=dark] .mwd, [data-theme=dark] .mc { border-color: #2a2e34; }
[data-theme=dark] .mc { background: #1b1e23; } [data-theme=dark] .mc:hover { background: #23272d; }
[data-theme=dark] .chip.due { background: #1b1e23; color: #e3e6ea; }
[data-theme=dark] .cs-legend, [data-theme=dark] .more, [data-theme=dark] .mwd, [data-theme=dark] .cal-grid .wd, [data-theme=dark] .wk .wl { color: #8f98a3; }
[data-theme=dark] .lg i.ring { background: transparent; box-shadow: inset 0 0 0 1.5px #a3abb5; } [data-theme=dark] .lg i.solid { background: #a3abb5; }
[data-theme=dark] .cs-grab { background: #3d434b; }

.linkbtn { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px; align-self: center; }
.linkbtn:hover { text-decoration: underline; }
[data-theme=dark] .linkbtn { color: #8ab4f8; }

/* sub page: short issue first, full scope behind + / − */
.scope { margin-top: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.scope-h { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: none; padding: 10px 12px; font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.scope-tog { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; font-size: 18px; line-height: 1; color: var(--muted); padding-bottom: 2px; }
.scope-b { display: none; padding: 0 12px 12px; white-space: pre-wrap; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.scope.open .scope-b { display: block; }
/* sub page header: logo + tagline stacked, "Work Order" beside it */
.subpage .topbar { height: auto; min-height: 56px; padding: 6px 16px; }
.subpage .topbar .brand { flex-direction: row; align-items: center; gap: 12px; }
.subpage .topbar .brand-stack { gap: 3px; }
