/* ShiftOS console, Eplough brand. Mobile-first; iPhone/iPad Safari friendly (16px inputs, 44px targets, safe areas). */
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/Poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/Poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400 600; font-style: normal; font-display: swap; src: url("assets/OpenSans-var.woff2") format("woff2"); }

:root {
  --ink: #111418; --ink-2: #1f242b; --fg: #1d2430; --muted: #5d6673; --line: #e3e7ec; --bg: #f5f7f9; --card: #fff;
  --brand: #29cb8b; --brand-dark: #13875a; --brand-tint: #e6f8f0; --navy: #020381;
  --ok: #13744c; --ok-bg: #e3f6ec; --warn: #8a5300; --warn-bg: #fff3dc; --bad: #b4232c; --bad-bg: #fdecee;
  --info: #1d4ed8; --info-bg: #e8effd; --hold: #6b3fa0; --hold-bg: #f1e9fb; --neutral-bg: #eef1f4;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --head: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--body); color: var(--fg); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.25; color: var(--ink); }
h2 { font-size: 1.35rem; margin: .2rem 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 .6rem; }
a { color: var(--brand-dark); }
code { font-size: .88em; background: var(--neutral-bg); padding: 0 .3em; border-radius: 4px; word-break: break-all; }

/* ---------------------------------------------------------------- header + navigation */
header#top { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; padding: calc(.5rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left)); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.brandbar { display: flex; align-items: center; gap: .75rem; min-height: 44px; }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand .name { font-family: var(--head); font-weight: 600; font-size: 1.15rem; letter-spacing: .02em; }
.brand .by { font-size: .72rem; color: #aab3bf; text-transform: uppercase; letter-spacing: .12em; display: block; line-height: 1; }
#who { margin-left: auto; display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: #cfd6de; text-align: right; min-width: 0; }
#who .who-name { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
#who button { background: transparent; color: #fff; border-color: #4a525d; min-height: 36px; margin: 0; }
nav#nav { display: flex; gap: .15rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: .35rem -.25rem 0; }
nav#nav::-webkit-scrollbar { display: none; }
nav#nav a { flex: 0 0 auto; color: #cfd6de; text-decoration: none; padding: .6rem .7rem .55rem; border-bottom: 3px solid transparent; font-size: .9rem; white-space: nowrap; min-height: 44px; display: flex; align-items: center; }
nav#nav a:hover { color: #fff; }
nav#nav a.active { color: #fff; border-bottom-color: var(--brand); font-weight: 600; }

/* ---------------------------------------------------------------- banner + layout */
#banner:not(:empty) { margin: .75rem auto 0; max-width: 80rem; padding: .7rem 1rem; background: var(--brand-tint); color: var(--ok); border-left: 4px solid var(--brand); border-radius: 6px; }
#banner.error { background: var(--bad-bg); color: var(--bad); border-left-color: var(--bad); }
main { padding: 1rem max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left)); max-width: 80rem; margin: 0 auto; }
section > h2:first-child { margin-top: .4rem; }
.panel { background: var(--card); border: 1px solid var(--line); padding: 1rem 1.1rem; margin: 1rem 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- landing / sign-in card */
.landing { max-width: 26rem; margin: 12vh auto 0; text-align: center; background: var(--card); border-radius: 16px; padding: 2rem 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.landing img { width: 160px; height: auto; }
.landing h1 { font-size: 1.4rem; margin: .8rem 0 .3rem; }
.landing p { color: var(--muted); margin: .3rem 0 1rem; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; margin: .5rem auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------------------------------------------------------------- tables: cards on phones, grid from tablets up */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; -webkit-overflow-scrolling: touch; margin: .5rem 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f9fafb; font-family: var(--head); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: 0; }
tbody tr:nth-child(even) td { background: #fbfcfd; }
tbody tr:hover td { background: var(--brand-tint); }
tbody tr:last-child td { border-bottom: 0; }
td { overflow-wrap: break-word; }
td.actions { white-space: nowrap; width: 1%; }
button { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 1.6rem 1rem; margin: 0; }
.empty::before { content: ""; display: block; width: 40px; height: 40px; margin: 0 auto .5rem; background: url("assets/emblem-black.png") center / contain no-repeat; opacity: .15; }
@media (max-width: 640px) {
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 .7rem; padding: .3rem 0; }
  .table-wrap tbody tr:nth-child(even) td, .table-wrap tbody tr:hover td { background: transparent; }
  .table-wrap td { border: 0; padding: .3rem .9rem; display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; }
  .table-wrap td > * { justify-self: start; }
  .table-wrap td.actions { width: 100%; white-space: normal; }
  .table-wrap td.actions button { width: 100%; }
  .table-wrap td::before { content: attr(data-label); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: .15rem; }
  .table-wrap td[data-label=""] { grid-template-columns: 1fr; }
  .table-wrap td[data-label=""]::before { display: none; }
  .empty { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
}

/* ---------------------------------------------------------------- controls */
button { font: inherit; font-weight: 600; padding: .5rem .95rem; margin: 0 .35rem .35rem 0; cursor: pointer; border-radius: 8px; border: 1px solid #cfd5dc; background: #fff; color: var(--ink); min-height: 40px; }
button:hover { border-color: var(--brand-dark); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(41, 203, 139, .45); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--brand-dark); color: #fff; border-color: var(--brand-dark); }
button.primary:hover { background: #0f6e49; }
button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
textarea { width: 100%; min-height: 8rem; font: inherit; padding: .6rem; border: 1px solid #cfd5dc; border-radius: 8px; background: #fff; }
input, select { font: inherit; margin: 0 .5rem .4rem 0; padding: .45rem .55rem; border: 1px solid #cfd5dc; border-radius: 8px; background: #fff; min-height: 40px; max-width: 100%; }
input[type="checkbox"] { min-height: 0; width: 1.15rem; height: 1.15rem; vertical-align: -.2rem; accent-color: var(--brand-dark); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; margin-bottom: .8rem; }
label.field { display: inline-block; margin: 0 1em .4em 0; }
#rate-form p { margin: .4em 0; }

/* ---------------------------------------------------------------- status badges */
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--neutral-bg); color: #3c4450; font-size: .76rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.pill.tone-ok { background: var(--ok-bg); color: var(--ok); }
.pill.tone-warn { background: var(--warn-bg); color: var(--warn); }
.pill.tone-bad { background: var(--bad-bg); color: var(--bad); }
.pill.tone-info { background: var(--info-bg); color: var(--info); }
.pill.tone-hold { background: var(--hold-bg); color: var(--hold); }

/* ---------------------------------------------------------------- phones + iOS */
@media (max-width: 640px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; } /* no iOS zoom on focus */
  button { min-height: 44px; }
  .brand .by { display: none; }
  #who .who-role { display: none; }
  h2 { font-size: 1.2rem; }
  .panel { padding: .9rem; }
  input[size] { width: 100%; }
}
@media print { header#top, nav#nav, button { display: none !important; } body { background: #fff; } .table-wrap, .panel { box-shadow: none; } }

/* ---------------------------------------------------------------- toolbars (search, filters, tabs) */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .25rem 0 .75rem; }
.toolbar input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.toolbar a { padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--fg); min-height: 36px; display: inline-flex; align-items: center; }
.toolbar a.active { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.toolbar button { margin: 0; }
.photo-review { width: 96px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
/* Worker page (v0.11.1) */
a.worker-link { color: var(--brand-dark); font-weight: 600; text-decoration: none; }
a.worker-link:hover { text-decoration: underline; }
.worker-head { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 1rem; }
.worker-head h2 { margin: 0 0 .2rem; }
.worker-photo { width: 96px; height: 120px; border-radius: 10px; background: var(--line, #e5e7eb); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: #667; overflow: hidden; flex: none; }
.worker-photo img { width: 100%; height: 100%; object-fit: cover; }
.worker-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem 1rem; }
.worker-form p { grid-column: 1 / -1; margin: .3rem 0 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0; }
dl.kv dt { color: #667; } dl.kv dd { margin: 0; }

/* ---------------------------------------------------------------- shift calendar (v0.12.0; console + worker portal) */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; justify-content: space-between; margin-bottom: .6rem; }
.cal-title { margin: 0; font-size: 1.05rem; }
.cal-nav, .cal-tabs { display: flex; gap: .3rem; }
.cal-nav button, .cal-tab { min-height: 36px; padding: .3rem .75rem; border: 1px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; font: inherit; }
.cal-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font: 600 .78rem var(--head); color: var(--muted); text-align: center; padding: .2rem 0; }
.cal-day { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-week .cal-day { min-height: 160px; }
.cal-month .cal-day { min-height: 92px; }
.cal-out { background: var(--bg); opacity: .65; }
.cal-today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-target { background: var(--brand-tint); border: 2px dashed var(--brand-dark); }
.cal-date { font-size: .75rem; font-weight: 600; color: var(--muted); }
.cal-chip { display: flex; flex-direction: column; align-items: flex-start; text-align: left; width: 100%; border: 1px solid transparent; border-left-width: 4px; border-radius: 6px; padding: 3px 5px; font: inherit; font-size: .74rem; line-height: 1.25; cursor: pointer; background: var(--neutral-bg); color: var(--fg); min-height: 32px; }
.cal-chip span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-time { font-weight: 700; }
.cal-state { font-size: .68rem; opacity: .85; }
.cal-drag { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.cal-ghost { position: fixed; z-index: 1000; width: 150px; pointer-events: none; opacity: .9; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.cal-confirmed { background: var(--ok-bg); border-left-color: var(--ok); color: var(--ok); }
.cal-pending { background: repeating-linear-gradient(135deg, var(--warn-bg) 0 6px, #ffe6b0 6px 12px); border-left-color: #d98a00; color: var(--warn); }
.cal-home { background: var(--info-bg); border-left-color: var(--info); color: var(--info); }
.cal-declined, .cal-cancelled { background: var(--neutral-bg); border-left-color: #9aa3ad; color: var(--muted); text-decoration: line-through; }
.cal-open { background: var(--card); border: 1px dashed var(--brand-dark); border-left: 4px solid var(--brand); }
.cal-blocked { opacity: .55; border-color: var(--line); border-left-color: #9aa3ad; cursor: pointer; }
.cal-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; max-height: 560px; overflow: auto; }
.cal-panel h4 { margin: 0 0 .2rem; font-family: var(--head); }
.cal-panel .muted { font-size: .78rem; margin: 0 0 .5rem; }
.cal-open-list { display: flex; flex-direction: column; gap: 6px; }
.cal-open-list .cal-chip { font-size: .8rem; min-height: 44px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.cal-key { font-size: .72rem; padding: .15rem .5rem; border-radius: 999px; border-left: 4px solid; }
.cal-key.cal-declined { text-decoration: line-through; }
.cal-actions { margin-top: .6rem; }
@media (max-width: 760px) {
  .cal-body { grid-template-columns: 1fr; }
  .cal-panel { max-height: none; }
  .cal-week .cal-grid, .cal-grid.cal-week { grid-template-columns: 1fr; }
  .cal-grid.cal-week .cal-dow { display: none; }
  .cal-grid.cal-week .cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cal-grid.cal-week .cal-date { width: 100%; }
  .cal-grid.cal-week .cal-chip { width: auto; flex: 1 1 140px; }
  .cal-month .cal-day { min-height: 56px; padding: 2px; }
  .cal-month .cal-chip { padding: 2px 3px; min-height: 22px; }
  .cal-month .cal-site, .cal-month .cal-state { display: none; }
}
/* v0.13.0 alerts strip */
.alert-strip { margin: 0.5rem 1rem; }
.alert-strip .alert { background: #fff4f2; border-left: 4px solid #b42318; padding: 0.5rem 0.75rem; margin-bottom: 0.25rem; }
.alert-strip .alert.info { background: #f2f7ff; border-left-color: #1d4ed8; }
.alert-strip .alert button { margin-left: 0.5rem; }

/* Web phone */
#phone .ph-pad { display: grid; grid-template-columns: repeat(3, 4.5rem); gap: .5rem; margin: 1rem 0; }
#phone .ph-pad button { font-size: 1.4rem; padding: .7rem 0; }
#phone .ph-dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem; }
#phone .ph-dir button { text-align: left; }
#phone #ph-number { min-width: 16rem; font-size: 1.1rem; }
.phonebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(.75rem, env(safe-area-inset-bottom)); z-index: 50; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  background: #111418; color: #fff; padding: .5rem .75rem; border-radius: 999px; box-shadow: 0 4px 18px rgba(0,0,0,.3); max-width: calc(100vw - 1.5rem); }
.phonebar a { color: #fff; text-decoration: none; font-weight: 600; }
.phonebar.ringing { background: #0b6b2e; animation: pb-pulse 1s infinite alternate; }
.phonebar.live { background: #13406b; }
.phonebar .pb-ok { background: #1aa34a; color: #fff; }
.phonebar .pb-no { background: #c62828; color: #fff; }
@keyframes pb-pulse { from { opacity: 1; } to { opacity: .8; } }
/* Bot chat */
#bots .bc-picker { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
#bots .bc-picker button.active { background: #111418; color: #fff; }
#bots .bc-log { border: 1px solid #d9dde3; border-radius: 10px; padding: .75rem; height: min(55vh, 34rem); overflow-y: auto; background: #fafbfc; display: flex; flex-direction: column; gap: .5rem; }
#bots .bc-msg { max-width: 80%; padding: .55rem .75rem; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
#bots .bc-msg.me { align-self: flex-end; background: #13406b; color: #fff; }
#bots .bc-msg.bot { align-self: flex-start; background: #fff; border: 1px solid #d9dde3; }
#bots .bc-time { font-size: .75rem; opacity: .65; margin-top: .2rem; }
#bots .bc-choices { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
#bots .bc-choices button { text-align: left; }
#bots .bc-readback { margin-top: .5rem; padding: .5rem; border-left: 3px solid #e0a100; background: #fff8e5; color: #111418; }
#bots .bc-readback button { margin-right: .4rem; }
#bots .bc-form { display: flex; gap: .5rem; margin-top: .6rem; align-items: stretch; }
#bots .bc-form textarea { flex: 1; font: inherit; padding: .5rem; resize: vertical; }
#bots .bc-err { color: #a3001b; min-height: 1.2em; }
#bots .bc-req { border: 1px solid #d9dde3; border-radius: 8px; padding: .5rem .75rem; margin: .4rem 0; }
#bots .bc-req button { margin-right: .4rem; }

/* ---------------------------------------------------------------- menu bar, header tools, search, phone panel (15 Oct 2026) */
nav#nav { overflow: visible; flex-wrap: wrap; }
nav#nav .menu { position: relative; }
nav#nav .menu-btn { background: transparent; color: #cfd6de; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: .6rem .7rem .55rem; min-height: 44px; margin: 0; font-size: .9rem; white-space: nowrap; cursor: pointer; }
nav#nav .menu-btn:hover, nav#nav .menu.open .menu-btn { color: #fff; }
nav#nav .menu.has-active .menu-btn { color: #fff; border-bottom-color: var(--brand); font-weight: 600; }
.menu-list { display: none; position: absolute; top: 100%; left: 0; z-index: 30; min-width: 14rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: .3rem 0; }
nav#nav .menu.open .menu-list { display: block; }
.menu-list a, nav#nav .menu-list a { display: flex; align-items: center; gap: .4rem; color: var(--fg); padding: .55rem .9rem; min-height: 40px; border: 0; text-decoration: none; font-size: .92rem; white-space: nowrap; }
.menu-list a:hover { background: var(--brand-tint); color: var(--ink); }
nav#nav .menu-list a.active { color: var(--brand-dark); font-weight: 600; border: 0; }
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.hdr-tools + #who { margin-left: .5rem; }
.hdr-btn { position: relative; background: transparent; color: #fff; border: 1px solid #4a525d; border-radius: 8px; min-height: 36px; min-width: 40px; margin: 0; padding: 0 .55rem; font-size: 1rem; cursor: pointer; }
.hdr-hint { font-size: .8rem; color: #aab3bf; }
@media (max-width: 700px) { .hdr-hint { display: none; } }
.quick-wrap { position: relative; }
.menu-list.quick { display: block; left: auto; right: 0; }
.menu-list.quick[hidden] { display: none; }
.hbadge { display: inline-block; min-width: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: var(--bad); color: #fff; font-size: .7rem; line-height: 1.2rem; text-align: center; font-weight: 600; }
.hdr-btn .hbadge { position: absolute; top: -6px; right: -6px; }
.hbadge[hidden] { display: none; }
.gs-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(17, 20, 24, .45); display: flex; justify-content: center; align-items: flex-start; padding-top: 10vh; }
.gs-overlay[hidden] { display: none; }
.gs-box { width: min(40rem, 94vw); background: var(--card); border-radius: 12px; padding: 1rem; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); max-height: 75vh; overflow-y: auto; }
.gs-box input { width: 100%; font-size: 16px; }
.gs-out h4 { margin: .8rem 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gs-row { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 6px; padding: .45rem .6rem; margin: 0; min-height: 40px; cursor: pointer; }
.gs-row:hover, .gs-row:focus { background: var(--brand-tint); }
.gs-hint { font-size: .8rem; margin: .6rem 0 0; }
.phone-fab { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: calc(4.5rem + env(safe-area-inset-bottom)); z-index: 50; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font-size: 1.5rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); cursor: pointer; margin: 0; padding: 0; }
.phone-fab.ready { background: var(--brand-dark); }
.phone-fab.live { background: var(--brand); }
.phone-fab.ringing { background: var(--bad); animation: fabpulse 1s ease-in-out infinite; }
@keyframes fabpulse { 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .phone-fab.ringing { animation: none; } }
.phone-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: min(24rem, 100vw); background: var(--card); box-shadow: -8px 0 24px rgba(0, 0, 0, .2); padding: calc(1rem + env(safe-area-inset-top)) 1rem 6rem; overflow-y: auto; }
.phone-panel[hidden] { display: none; }
.pp-head { display: flex; align-items: center; justify-content: space-between; }
.pp-close { background: transparent; border: 0; font-size: 1.6rem; margin: 0; min-height: 40px; cursor: pointer; }
.pp-controls button, .pp-caller button { margin-right: .35rem; }
.pp-caller:not(:empty) { background: var(--brand-tint); border-radius: 8px; padding: .5rem .7rem; margin: .5rem 0; }
.pp-links { margin-top: 1rem; }
.contact-actions { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.home-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .7rem 1rem; margin: .5rem 0; }
.compose { position: fixed; z-index: 65; right: 1rem; bottom: 1rem; width: min(34rem, 94vw); max-height: 85vh; overflow-y: auto; margin: 0; }
.compose textarea, .compose input[type=email], .compose input[type=text] { width: 100%; }
a.button { display: inline-flex; align-items: center; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; min-height: 40px; }

/* ---------- PloughBots (top-level link with icon, as prominent as Admin; page works on iPad Safari) */
nav#nav a.nav-top { color: #fff; font-weight: 600; background: rgba(41, 203, 139, .16); border-radius: 8px 8px 0 0; border-bottom: 3px solid var(--brand); gap: .2rem; }
nav#nav a.nav-top.active { background: rgba(41, 203, 139, .32); }
nav#nav a.nav-top .nav-icon { font-size: 1.15rem; line-height: 1; }
.pb h2 .pb-icon { font-size: 1.4rem; }
.pb-picker { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.pb-picker button { min-height: 44px; }
.pb-picker button.active { background: #111418; color: #fff; }
.pb-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #9aa3ad; }
.pb-dot.on { background: var(--brand); box-shadow: 0 0 0 3px rgba(41, 203, 139, .25); }
.pb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .pb-grid { grid-template-columns: minmax(0, 1fr); } }
/* 18 Oct: .pb-grid sets display, which beat the hidden attribute, so the PloughBot chat stayed on screen above the Chief of Staff panel. */
.pb-grid[hidden], #pb-chief[hidden] { display: none; }
.pb-files { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
.pb-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.pb-panel { padding: .9rem 1rem; }
.pb-panel h3 { margin: 0 0 .4rem; }
.pb-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0; }
.pb-row button { min-height: 44px; }
.pb-check { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; }
.pb-check input { width: 1.3rem; height: 1.3rem; }
.pb-screen { background: #0b0d10; color: #cfd6de; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.pb-frame { width: 100%; height: 100%; border: 0; display: block; touch-action: none; }
.pb-log { max-height: 55vh; min-height: 8rem; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; background: var(--bg); }
.pb-ev { padding: .35rem .2rem; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.pb-ev:last-child { border-bottom: 0; }
.pb-time { color: var(--muted); font-size: .75rem; }
.pb-text { white-space: pre-wrap; word-break: break-word; }
.pb-k-result .pb-text { background: var(--brand-tint); border-radius: 8px; padding: .5rem .6rem; font-size: .95rem; }
.pb-k-message .pb-text { background: #111418; color: #fff; border-radius: 8px; padding: .4rem .6rem; }
.pb-k-refused .pb-text, .pb-k-error .pb-text { color: var(--bad); }
.pb-k-tool .pb-text, .pb-k-tool_result .pb-text, .pb-k-status .pb-text { color: var(--muted); }
.pb-shot { max-width: 100%; border-radius: 6px; border: 1px solid var(--line); margin-top: .3rem; }
.pb-form textarea { width: 100%; font-size: 16px; /* no iOS zoom */ margin-top: .5rem; }
.pb-hrow { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; margin: 0 0 .4rem; min-height: 44px; color: var(--fg); }
.pb-hrow.active { border-color: var(--brand); }
.pb-prev { display: block; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-mail { border-bottom: 1px solid var(--line); padding: .5rem 0; }
.pb-body { white-space: pre-wrap; background: var(--bg); padding: .5rem; border-radius: 6px; max-height: 14rem; overflow: auto; font-size: .85rem; }
.pb-err { color: var(--bad); }
.pill.pb-done { background: var(--ok-bg); color: var(--ok); } .pill.pb-running { background: var(--info-bg); color: var(--info); }
.pill.pb-queued { background: var(--warn-bg); color: var(--warn); } .pill.pb-failed, .pill.pb-refused { background: var(--bad-bg); color: var(--bad); }
.pill.pb-held { background: var(--hold-bg); color: var(--hold); } .pill.pb-sent { background: var(--ok-bg); color: var(--ok); } .pill.pb-cancelled, .pill.pb-rejected { background: var(--neutral-bg); }
/* 18 Oct: bot steps collapsed behind a toggle; only the latest screenshot shown in the chat. */
.pb-steps { margin: .4rem 0; border: 1px solid var(--line, #ddd); border-radius: 6px; padding: .3rem .6rem; }
.pb-steps > summary { cursor: pointer; font-weight: 600; color: var(--muted, #555); }
.pb-steps-body { max-height: 50vh; overflow: auto; }
.pb-lastshot .pb-shot { max-height: 260px; }
.pb-warn { color: #b45309; font-weight: 600; }
