/* Portal X components. Tokens only - no hex codes in this file.
 * Rendered set: /styleguide/ */

/* ---------- card ---------- */
.card-title { font-size: 1.05rem; margin: 0 0 .15rem; }
.card-subtitle { color: var(--ink-muted); margin: 0 0 .85rem; font-size: .9rem; }

/* ---------- page header ---------- */
.page-header {
  display: flex; align-items: flex-start; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.page-header h1 { margin: 0; }
.page-header-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- accordion ---------- */
.accordion {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.accordion-item + .accordion-item { border-top: 1px solid var(--line); }
.accordion-item > summary {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem .9rem; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--ink);
}
.accordion-item > summary::-webkit-details-marker { display: none; }
.accordion-item > summary:hover { background: var(--surface-2); }
.accordion-title { flex: 1; }
.accordion-chevron { color: var(--ink-subtle); transition: transform .15s ease; flex: none; }
.accordion-item[open] > summary > .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  padding: .2rem .9rem .9rem;
  border-top: 1px solid var(--line);
  padding-top: .8rem;
}

/* ---------- modal ---------- */
.modal {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  padding: 1.1rem 1.25rem 1.25rem; max-width: 32rem; width: calc(100% - 2rem);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.modal-lg { max-width: 48rem; }
.modal::backdrop { background: rgba(0, 0, 0, .45); }
.modal-close-form { margin: 0; float: right; }
.modal-close {
  background: transparent; color: var(--ink-subtle); border: 0;
  font-size: 1.35rem; line-height: 1; padding: 0 .2rem; cursor: pointer;
}
.modal-close:hover { background: transparent; color: var(--ink); }
.modal-title { font-size: 1.1rem; margin: 0 0 .6rem; }
.modal-body { clear: both; }

/* A picture full size, in the page (ui.js, a[data-viewer]). */
.viewer {
  padding: 0; border: 0; border-radius: var(--radius); background: var(--surface);
  max-width: 96vw; max-height: 92vh; overflow: auto;
}
.viewer::backdrop { background: rgba(0, 0, 0, .7); }
.viewer img { display: block; max-width: 96vw; max-height: 92vh; object-fit: contain; }
.viewer-close {
  position: sticky; top: .4rem; float: right; margin: .4rem .4rem -2.6rem 0; z-index: 1;
  width: 2.2rem; height: 2.2rem; padding: 0; border-radius: 50%;
  font-size: 1.4rem; line-height: 1; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
}

/* ---------- tabs ---------- */
.tab-strip {
  display: flex; gap: .15rem; border-bottom: 1px solid var(--line);
  margin-bottom: .9rem; flex-wrap: wrap;
}
.tab-btn {
  background: transparent; color: var(--ink-muted); border: 0;
  border-bottom: 2px solid transparent; border-radius: 0;
  padding: .45rem .8rem; font-weight: 600; cursor: pointer;
}
.tab-btn:hover { background: var(--surface-2); color: var(--ink); }
.tab-btn.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel.is-hidden { display: none; }

/* ---------- empty state ---------- */
.empty-state {
  text-align: center; padding: 2rem 1rem; color: var(--ink-muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty-state-title { color: var(--ink); font-weight: 600; margin: .4rem 0 .2rem; }

/* ---------- form fields ---------- */
.form-field { margin-bottom: .85rem; max-width: 26rem; }
.form-field .req { color: var(--danger); }
.field-help { color: var(--ink-subtle); font-size: .82rem; margin: .25rem 0 0; }
.field-error { color: var(--danger); font-size: .82rem; margin: .25rem 0 0; }
.form-field.has-error .form-input,
.form-field.has-error .form-select { border-color: var(--danger); }
.form-check { width: auto; }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- alerts ---------- */
.alerts { margin-bottom: 1rem; }
.alert {
  padding: .6rem .85rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; margin-bottom: .5rem;
}
.alert-info, .alert-debug { background: var(--info-soft); color: var(--info); }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* ---------- employee mockup bits ---------- */
.emp-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.emp-avatar {
  width: 3.4rem; height: 3.4rem; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
  color: var(--ink-inverse); background: var(--team, var(--accent));
  box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 3px var(--team, var(--accent));
}
.team-dot {
  display: inline-block; width: .65rem; height: .65rem; border-radius: 50%;
  background: var(--team, var(--accent)); margin-right: .4rem; vertical-align: -1px;
}
.emp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-items: start; }
@media (max-width: 46rem) { .emp-cols { grid-template-columns: 1fr; } }

/* fields whose value arrives from the payroll import */
.from-import .form-field > label::after {
  content: "payroll"; margin-left: .45rem; padding: .02rem .32rem;
  border-radius: 999px; font-size: .68rem; font-weight: 600;
  background: var(--info-soft); color: var(--info); vertical-align: 1px;
}
.skill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .75rem; }
@media (max-width: 34rem) { .skill-grid { grid-template-columns: 1fr; } }
.skill-check { display: flex; align-items: center; gap: .4rem; color: var(--ink); font-size: .92rem; margin: 0; }
.skill-check input { width: auto; }
.emp-head-main { min-width: 0; }
.emp-head-actions { margin-left: auto; align-self: flex-start; }

/* ---------- collapsible card ---------- */
.card-collapsible { padding: 0; }
.card-collapsible > summary {
  display: flex; align-items: center; gap: .6rem;
  padding: .85rem 1.1rem; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 1.05rem; color: var(--ink);
  border-radius: var(--radius);
}
.card-collapsible > summary::-webkit-details-marker { display: none; }
.card-collapsible > summary:hover { background: var(--surface-2); }
.card-collapsible[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-collapsible-title { flex: 1; }
.card-collapsible > summary > .accordion-chevron { color: var(--ink-subtle); flex: none; }
.card-collapsible[open] > summary > .accordion-chevron { transform: rotate(180deg); }
.card-collapsible-body { padding: 1rem 1.1rem 1.1rem; }
.card-collapsible-body > .card-subtitle { margin-top: 0; }

/* ---------- certification rows ---------- */
.cert-list { display: flex; flex-direction: column; gap: .3rem; }
.cert-row {
  display: flex; flex-wrap: wrap; gap: .35rem .75rem;
  align-items: center; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  border-left-width: 3px; border-left-color: var(--line-strong);
  background: var(--surface);
}
.cert-row.cert-valid { border-left-color: var(--ok); }
.cert-row.cert-expiring { border-left-color: var(--warn); }
.cert-row.cert-expired { border-left-color: var(--danger); }
.cert-name { font-weight: 600; flex: 1 1 8rem; }
.cert-dates { font-size: .85rem; color: var(--ink-muted); white-space: nowrap; }
@media (max-width: 34rem) {
  .cert-dates { white-space: normal; }
}
.cert-file { font-size: .85rem; white-space: nowrap; }
.cert-note { margin: -.1rem 0 .35rem .7rem; font-size: .82rem; }

/* ---------- certification table (record pages) ---------- */
.cert-table td:first-child { border-left: 3px solid transparent; padding-left: .6rem; }
.cert-table tr.cert-valid td:first-child { border-left-color: var(--ok); }
.cert-table tr.cert-expiring td:first-child { border-left-color: var(--warn); }
.cert-table tr.cert-expired td:first-child { border-left-color: var(--danger); }
.cert-table .cert-name { font-weight: 600; }

/* ---------- layout: sidebar + content ---------- */
.layout { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.layout-anon .content { align-items: center; }

.sidebar {
  width: 15rem; flex: none;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .5rem;
  padding: .95rem 1rem; border-bottom: 1px solid var(--line);
}
.sidebar-close { display: none; margin-left: auto; font-size: 1.2rem; line-height: 1; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .6rem .5rem; }
.sidebar-foot { border-top: 1px solid var(--line); padding: .5rem; }

.navgroup { margin-bottom: .9rem; }
.navgroup-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-subtle); padding: .2rem .6rem .3rem;
}
.navlink {
  display: block; padding: .4rem .6rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 500;
}
.navlink:hover { background: var(--surface-2); color: var(--ink); }
.navlink.is-current {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ---------- user badge ---------- */
.usermenu { position: relative; }
.usermenu > summary {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .5rem; border-radius: var(--radius-sm);
  cursor: pointer; list-style: none;
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover, .usermenu[open] > summary { background: var(--surface-2); }
.usermenu > summary svg { margin-left: auto; color: var(--ink-subtle); flex: none; }
.usermenu[open] > summary svg { transform: rotate(180deg); }
.avatar {
  width: 2.1rem; height: 2.1rem; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: .8rem;
}
.usermeta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.usermeta strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermeta .subtle { font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.usermenu-panel {
  position: absolute; bottom: calc(100% + .35rem); left: 0; right: 0; z-index: 50;
  padding: .5rem; display: flex; flex-direction: column; gap: .5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.usermenu-panel a {
  padding: .35rem .5rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-size: .9rem;
}
.usermenu-panel a:hover { background: var(--surface-2); color: var(--accent); }
.usermenu-panel .theme-form { flex-direction: column; align-items: stretch; gap: .25rem; }
.usermenu-panel .theme-form select { width: 100%; }
.usermenu-signout { width: 100%; text-align: left; }

/* Inside the installed app there's no point offering the app. */
@media (display-mode: standalone) {
  .only-in-browser { display: none !important; }
}

/* ---------- a person's ... menu on a crew (jobs/_person_menu.html) ---------- */
/* Their other actions behind one button, so a tap can't take anyone off by
 * accident. On the job page's Crew card and Dispatch's cards alike. */
.pmenu { position: relative; }
.pmenu > summary { list-style: none; }
.pmenu > summary::-webkit-details-marker { display: none; }
.pmenu-list {
  position: absolute; right: 0; top: calc(100% + .3rem); z-index: 20; min-width: 12rem; padding: .3rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.pmenu-note { margin: 0; padding: .35rem .6rem .45rem; font-size: .76rem; color: var(--ink-subtle); border-bottom: 1px solid var(--line); }
.pmenu-list button { display: block; width: 100%; text-align: left; background: none; color: var(--ink); border: 0; padding: .5rem .6rem; font-size: .9rem; border-radius: var(--radius-sm); }
.pmenu-list button:hover { background: var(--surface-2); }
.pmenu-list button.is-danger { color: var(--danger); }

/* ---------- narrow screens ---------- */
.topbar { display: none; }
.sidebar-scrim { display: none; }

@media (max-width: 52rem) {
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: var(--shadow-1);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: block; }
  .topbar {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .9rem; background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  body.sidebar-open .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(0, 0, 0, .45);
  }
}

/* ---------- certification table (record pages) ---------- */
.cert-table td:first-child { border-left: 3px solid transparent; padding-left: .6rem; }
.cert-table tr.cert-valid td:first-child { border-left-color: var(--ok); }
.cert-table tr.cert-expiring td:first-child { border-left-color: var(--warn); }
.cert-table tr.cert-expired td:first-child { border-left-color: var(--danger); }
.cert-table .cert-name { font-weight: 600; }

/* ---------- navigation ---------- */
.site-nav { display: flex; gap: .15rem; align-items: center; flex-wrap: wrap; }
.site-tools {
  margin-left: auto; display: flex; gap: .9rem; align-items: center;
  font-size: .9rem; color: var(--ink-muted);
}
.navlink, .navmenu > summary {
  display: flex; align-items: center; gap: .3rem;
  padding: .35rem .6rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem;
  cursor: pointer; list-style: none; white-space: nowrap;
}
.navlink:hover, .navmenu > summary:hover { background: var(--surface-2); color: var(--ink); }
.navmenu { position: relative; }
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu[open] > summary { background: var(--surface-2); }
.navmenu[open] > summary svg { transform: rotate(180deg); }
.navmenu-panel {
  position: absolute; top: calc(100% + .3rem); left: 0; z-index: 40;
  min-width: 12rem; padding: .3rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column;
}
.navmenu-panel a {
  padding: .4rem .6rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-size: .92rem; white-space: nowrap;
}
.navmenu-panel a:hover { background: var(--surface-2); color: var(--accent); }
@media (max-width: 40rem) {
  .navmenu-panel { position: static; box-shadow: none; border: 0; padding-left: .8rem; }
}
.type-meta {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: .8rem;
}
.type-meta > a, .type-actions { margin-left: auto; }
.type-actions { display: flex; gap: .5rem; flex-wrap: wrap; }


/* ---------- rotation ---------- */
.rotation-grid th.rot-week { text-align: center; white-space: nowrap; }
/* The team name stays in view while the weeks scroll sideways on a phone. */
.rotation-grid th:first-child, .rotation-grid td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
}
.rotation-grid th.rot-week.is-current { color: var(--accent); }
.rot-cell { text-align: center; font-weight: 600; font-size: .85rem; }
.rot-cell.rot-on { background: var(--ok-soft); color: var(--ok); }
.rot-cell.rot-off { background: var(--surface-2); color: var(--ink-subtle); }
.rot-cell.is-current { box-shadow: inset 0 0 0 2px var(--accent); }
.week-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.week-cell {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .5rem; text-align: center;
}
.week-cell.rot-on { background: var(--ok-soft); border-color: var(--ok); }
.week-cell.is-current { box-shadow: inset 0 0 0 2px var(--accent); }
.week-date { font-size: .78rem; color: var(--ink-muted); }
.week-state { font-weight: 700; }


/* ---------- employee crew badge ---------- */
.emp-badge {
  display: inline-grid; place-items: center; position: relative;
  width: 1.75rem; height: 1.75rem; border-radius: 50%; flex: none;
  background: var(--badge-bg); color: var(--badge-ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.emp-badge svg { width: 1.05rem; height: 1.05rem; }
.emp-badge-lg { width: 2.3rem; height: 2.3rem; }
.emp-badge-lg svg { width: 1.35rem; height: 1.35rem; }

/* Licence problem behind a driver approval. The mark sits on the corner rather
   than recolouring the badge, because the badge colour already means crew and
   cannot mean two things at once. */
.emp-badge-mark {
  position: absolute; right: -2px; bottom: -2px;
  width: .85rem; height: .85rem; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .62rem; font-weight: 700; line-height: 1;
  background: var(--warn); color: var(--warn-soft);
  box-shadow: 0 0 0 1.5px var(--surface);
}
.emp-badge-warn-expired .emp-badge-mark { background: var(--danger); color: var(--danger-soft); }
.emp-badge-lg .emp-badge-mark { width: 1.05rem; height: 1.05rem; font-size: .78rem; }
.badge-cell { width: 1px; padding-right: .25rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

tr.group-head td {
  background: var(--surface-2); font-weight: 700; font-size: .85rem;
  padding-top: .5rem; padding-bottom: .5rem;
}

.badge-cell { width: 1px; padding-right: .25rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

tr.group-head td {
  background: var(--surface-2); font-weight: 700; font-size: .85rem;
  padding-top: .5rem; padding-bottom: .5rem;
}

/* ---------- multi-checkbox fields (skills) ---------- */
.form-field div[id$="skills"] { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .75rem; }
.form-field div[id$="skills"] div { display: flex; align-items: center; gap: .4rem; }
.form-field div[id$="skills"] label { margin: 0; color: var(--ink); font-size: .9rem; }
.form-field div[id$="skills"] input { width: auto; }
@media (max-width: 40rem) { .form-field div[id$="skills"] { grid-template-columns: 1fr; } }


/* ---------- roster rows ---------- */
.roster {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.emp-row + .emp-row { border-top: 1px solid var(--line); }
.emp-row > summary {
  display: grid;
  grid-template-columns: 1rem auto minmax(8rem, 1fr) 10rem 1fr;
  align-items: center; gap: .7rem;
  padding: .55rem .9rem; cursor: pointer; list-style: none;
}
.emp-row > summary::-webkit-details-marker { display: none; }
.emp-row > summary:hover { background: var(--surface-2); }
.emp-row[open] > summary { background: var(--surface-2); }
.emp-row[open] > summary .accordion-chevron { transform: rotate(180deg); }
.emp-row .accordion-chevron { color: var(--ink-subtle); }
.emp-row-name { font-weight: 600; }
.emp-row-contact { font-size: .85rem; color: var(--ink-muted); }

.emp-row-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem;
  padding: .9rem 1.1rem 1.1rem 2.6rem; border-top: 1px solid var(--line);
}
.emp-row-panel h3 {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-subtle); margin: 0 0 .4rem;
}
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .25rem 0; border-bottom: 1px solid var(--line);
}
.mini-list li:last-child { border-bottom: 0; }

.roster-filter { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.roster-filter input[type="search"] { flex: 1 1 16rem; }

@media (max-width: 48rem) {
  .emp-row > summary { grid-template-columns: 1rem auto 1fr; }
  .emp-row-contact { display: none; }
  .emp-row-panel { grid-template-columns: 1fr; padding-left: 1.1rem; }
}


/* ---------- import preview ---------- */
.tally { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.tally > div { display: flex; flex-direction: column; }
.tally strong { font-size: 1.6rem; line-height: 1.1; }
.tally span { font-size: .82rem; color: var(--ink-muted); }
.tally .tally-warn strong { color: var(--warn); }

.radio-row {
  display: flex; gap: .5rem; align-items: flex-start;
  padding: .5rem .6rem; margin-bottom: .35rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); font-size: .92rem; cursor: pointer;
}
.radio-row:hover { background: var(--surface-2); }
.radio-row input { width: auto; margin-top: .2rem; flex: none; }
.radio-row .subtle { display: block; margin-top: .15rem; }
input[type="file"] { font: inherit; color: var(--ink); }

/* --- Tasks mockup (v2: who may touch what) ------------------------------ */
/* Mockup-only. Promote into the real .task-* classes if the layout is adopted. */
.mk-questions li { margin-bottom: .3rem; }

.mk-viewas {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin: -.4rem 0 .9rem; font-size: .88rem; color: var(--ink-muted);
}
.mk-viewas a {
  padding: .15rem .6rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.mk-viewas a.is-current { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }

.mk-row { border-bottom: 1px solid var(--line); }
.mk-row:last-child { border-bottom: 0; }
.mk-row.is-returned { border-left: 3px solid var(--warn); padding-left: .5rem; }
.mk-row.is-dragging { opacity: .55; }
.mk-main { display: flex; align-items: center; gap: .6rem; padding: .55rem .25rem; border-radius: var(--radius-sm); }
.mk-main:hover { background: var(--surface-2); }
.mk-drag { color: var(--ink-subtle); cursor: grab; touch-action: none; user-select: none; padding: 0 .1rem; font-size: 1.05rem; }
.mk-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; cursor: pointer; }
.mk-title:hover { text-decoration: underline; }
.mk-row.is-done .mk-title { text-decoration: line-through; color: var(--ink-muted); }

/* Somebody else's task: the box is there so the row reads the same, but it is
   visibly not yours to tick. */
.task-check.is-locked { cursor: not-allowed; border-style: dashed; background: var(--surface-2); opacity: .7; }
.task-check.is-locked:hover { border-color: var(--line-strong); }

.mk-caret { flex: none; width: 1.1rem; height: 1.1rem; border: 0; background: transparent; padding: 0; position: relative; cursor: pointer; }
.mk-caret::before {
  content: ""; position: absolute; top: .2rem; left: .3rem; width: .4rem; height: .4rem;
  border-right: 2px solid var(--ink-subtle); border-bottom: 2px solid var(--ink-subtle);
  transform: rotate(45deg); transition: transform .15s;
}
.mk-caret:hover { background: transparent; }
.mk-row.is-collapsed .mk-caret::before { transform: rotate(-45deg); }
.mk-kids { list-style: none; margin: 0; padding: 0 0 .5rem 3.4rem; }
.mk-row.is-collapsed .mk-kids { display: none; }
.mk-kids .subtask { border-radius: var(--radius-sm); padding: .2rem .4rem; }
.mk-kids .subtask:hover { background: var(--surface-2); }
.mk-subcount { display: none; }
.mk-row.is-collapsed .mk-subcount { display: inline; }
.mk-row .task-returned { margin: -.2rem 0 .5rem 2.5rem; }

/* Dialog states */
.mk-ro { padding: .4rem .6rem; background: var(--surface-2); border-radius: var(--radius-sm); min-height: 2rem; }
.mk-lockline {
  font-size: .88rem; color: var(--ink-muted); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: .45rem .6rem; margin: 0 0 .8rem;
}

/* Phone numbers are the tap target themselves - no extra call/text buttons
   crowding an already dense row. Underlined only on hover so the roster does
   not turn into a wall of links. */
.tel-link { color: inherit; text-decoration: none; }
.tel-link:hover, .tel-link:focus-visible { text-decoration: underline; color: var(--accent); }

/* ---------- tasks ---------- */
.task-cols { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 56rem) { .task-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 40rem) {
  /* A phone: the title gets its own line when the badges need the room. */
  .task-main { flex-wrap: wrap; }
  .task-title { flex: 1 1 12rem; min-width: 55%; white-space: normal; overflow: visible; }
  .task-due { white-space: normal; }
}

.task-filters { list-style: none; margin: 0; padding: 0; }
.task-filters a {
  display: flex; justify-content: space-between; gap: .5rem;
  padding: .35rem .5rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none;
}
.task-filters a:hover { background: var(--surface-2); }
.task-filters a.is-current { background: var(--surface-2); font-weight: 600; }
.task-count { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.task-count-warn {
  background: var(--warn-soft); color: var(--warn); font-weight: 700;
  border-radius: 999px; padding: 0 .4rem; min-width: 1.25rem; text-align: center;
}
.task-rail-label {
  margin: .8rem 0 .2rem; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-subtle);
}
.task-heading { margin: 0 0 .6rem; font-size: 1.1rem; }

.task-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.task-add-title { flex: 1 1 16rem; }
.btn-sm { font-size: .78rem; padding: .2rem .5rem; }

/* One line per task; the checklist and a hand-back note hang underneath. */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row { border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row.is-returned { border-left: 3px solid var(--warn); padding-left: .5rem; }
.task-row.is-dragging { opacity: .55; }
.task-main { display: flex; align-items: center; gap: .6rem; padding: .55rem .25rem; border-radius: var(--radius-sm); }
.task-main:hover { background: var(--surface-2); }
.task-drag { color: var(--ink-subtle); cursor: grab; touch-action: none; user-select: none; padding: 0 .1rem; font-size: 1.05rem; }
.task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.task-open { cursor: pointer; }
.task-open:hover { text-decoration: underline; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--ink-muted); }
.task-due { font-size: .82rem; color: var(--ink-muted); white-space: nowrap; }
.task-due.is-overdue { color: var(--danger); font-weight: 600; }
.task-meta { font-size: .82rem; color: var(--ink-muted); }
.task-subcount { display: none; margin-left: .35rem; font-variant-numeric: tabular-nums; }
.task-row.is-collapsed .task-subcount { display: inline; }
.task-returned { margin: -.2rem 0 .5rem 2.5rem; font-size: .85rem; color: var(--ink-muted); }

.task-check {
  width: 1.15rem; height: 1.15rem; padding: 0; flex: none;
  border: 1.5px solid var(--line-strong); border-radius: 4px;
  background: var(--surface); color: var(--accent-ink); cursor: pointer;
  font-size: .8rem; line-height: 1;
}
.task-check:hover { border-color: var(--accent); background: var(--surface-2); }
.task-check.is-checked { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.task-check-sm { width: .95rem; height: .95rem; font-size: .65rem; }
/* Somebody else's task: the box is there so the row reads the same, but it is
   visibly not yours to tick. */
.task-check.is-locked { cursor: not-allowed; border-style: dashed; background: var(--surface-2); opacity: .7; }
.task-check.is-locked:hover { border-color: var(--line-strong); }
.task-check.is-locked.is-checked { background: var(--surface-2); color: var(--ink-muted); }

.task-caret { flex: none; width: 1.1rem; height: 1.1rem; border: 0; background: transparent; padding: 0; position: relative; cursor: pointer; }
.task-caret::before {
  content: ""; position: absolute; top: .2rem; left: .3rem; width: .4rem; height: .4rem;
  border-right: 2px solid var(--ink-subtle); border-bottom: 2px solid var(--ink-subtle);
  transform: rotate(45deg); transition: transform .15s;
}
.task-caret:hover { background: transparent; }
.task-row.is-collapsed .task-caret::before { transform: rotate(-45deg); }
.task-kids { list-style: none; margin: 0; padding: 0 0 .5rem 3.4rem; }
.task-row.is-collapsed .task-kids { display: none; }
.task-kids .subtask { border-radius: var(--radius-sm); padding: .2rem .4rem; }
.task-kids .subtask:hover { background: var(--surface-2); }

/* tasks: dialog + checklist */
.task-editor-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.task-editor-row .form-field { flex: 1 1 9rem; max-width: none; margin-bottom: .6rem; }
.modal-subhead { font-size: .95rem; margin: 1rem 0 .4rem; }
.task-handback-note { max-width: 12rem; font-size: .82rem; }
.task-delete { color: var(--danger); }
.task-ro { padding: .4rem .6rem; background: var(--surface-2); border-radius: var(--radius-sm); min-height: 2rem; }
.task-lockline {
  font-size: .88rem; color: var(--ink-muted); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: .45rem .6rem; margin: 0 0 .8rem;
}

.subtask-list { list-style: none; margin: 0 0 .4rem; padding: 0; }
.subtask { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; }
.subtask.is-done .subtask-title { text-decoration: line-through; color: var(--ink-muted); }
.subtask-title { flex: 1; font-size: .92rem; }
.subtask-remove {
  background: transparent; border: 0; color: var(--ink-subtle);
  cursor: pointer; padding: 0 .3rem; line-height: 1;
}
.subtask-remove:hover { background: transparent; color: var(--danger); }
.subtask-add { width: 100%; font-size: .9rem; }

/* Count of what other people have put on your plate, next to Tasks in the nav. */
.nav-count {
  margin-left: auto; font-size: .72rem; font-weight: 700; line-height: 1.4;
  background: var(--warn-soft); color: var(--warn);
  border-radius: 999px; padding: 0 .45rem; min-width: 1.3rem; text-align: center;
}

/* portal access actions on the employee page */
.access-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

/* Customers, locations, job types: shared page layout */
.cust-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem; align-items: start; }
/* Job pages: two columns the same width (Toby, 2026-09-22). */
.cust-cols.cols-equal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 62rem) { .cust-cols, .cust-cols.cols-equal { grid-template-columns: 1fr; } }

/* The list of locations under a customer, and of subtypes under a job type. */
.loc-list { list-style: none; margin: 0 0 .6rem; padding: 0; }
.loc { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.loc:last-child { border-bottom: 0; }
.loc.is-retired .loc-name { color: var(--ink-muted); text-decoration: line-through; }
.loc-name { font-weight: 500; }
.loc-add { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.loc-add input { flex: 1 1 11rem; }

/* Customers: accordion rows with aligned columns (the roster pattern) */
.cust-head, .cust-row > summary {
  display: grid; grid-template-columns: minmax(0,1fr) 6rem 5rem;
  gap: .5rem; align-items: center;
}
.cust-head {
  padding: .55rem .9rem .45rem; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-subtle); border-bottom: 1px solid var(--line);
}
.cust-row { border-bottom: 1px solid var(--line); }
.cust-row:last-child { border-bottom: 0; }
.cust-row > summary {
  padding: .55rem .9rem; cursor: pointer; list-style: none;
}
.cust-row > summary::-webkit-details-marker { display: none; }
.cust-row > summary:hover { background: var(--surface-2); }
.cust-row[open] > summary { background: var(--surface-2); }
.cust-row[open] > summary .accordion-chevron { transform: rotate(180deg); }
.cust-name { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.cust-name .accordion-chevron { transition: transform .15s ease; color: var(--ink-subtle); }
.cust-body { padding: .3rem .9rem .8rem 2.6rem; border-top: 1px solid var(--line); }
/* The right-hand aside on a list item: a rig phone, a person's crew. */
.loc-phone, .loc-aside { margin-left: auto; font-size: .85rem; color: var(--ink-muted); white-space: nowrap; }
/* ---------- jobs: the list as cards on a phone ---------- */
.job-cards { list-style: none; margin: 0; padding: 0; }
.job-card { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.job-card:last-child { border-bottom: 0; }
.job-card-head { display: flex; align-items: center; gap: .5rem; }
.job-card-head .mono { font-weight: 700; }
.job-card-head .badge { margin-left: auto; }
.job-card-when { margin-top: .15rem; font-size: .95rem; }

/* ---------- jobs: assignments and My jobs ---------- */
.assigned { flex-wrap: wrap; }
.relief-form { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: 0 0 .2rem; }
.relief-form label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-weight: 500; }
.relief-switch { font-weight: 600; }
.relief-fields { display: inline-flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.relief-fields input, .relief-fields select { width: auto; }
.relief-sentence { margin: 0 0 .8rem; }
.assigned .loc-name { margin-right: .1rem; }
.crew-select { width: auto; font-size: .8rem; padding: .15rem .3rem; }
.assigned-warn { flex-basis: 100%; font-size: .85rem; color: var(--warn); padding-left: 2.1rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.link-button:hover { background: none; color: var(--accent-hover); }
/* My jobs: boarding-pass cards, the time is the biggest thing on them. */
.hand-jobs { max-width: 30rem; }
.hand-job { margin-bottom: 1rem; padding: 0; overflow: hidden; }
.hand-ended { margin: 0; padding: .6rem .9rem; background: var(--warn-soft); color: var(--warn); font-size: .88rem; }
.hand-body { padding: 0 1.1rem 1.1rem; }
/* The card folds: the summary is the head, folded it adds one line (when to leave the shop). */
.hand-summary { list-style: none; cursor: pointer; }
.hand-summary::-webkit-details-marker { display: none; }
.hand-top { padding: 1rem 1.1rem; }
.hand-job[open] .hand-top { padding-bottom: 0; }
.hand-toggle { font-size: .8rem; color: var(--ink-subtle); white-space: nowrap; }
.hand-toggle::after { content: "Show \25BE"; }
.hand-job[open] .hand-toggle::after { content: "Hide \25B4"; }
.hand-folded { margin: .45rem 0 0; font-size: .95rem; font-weight: 700; }
.hand-folded.is-ended { color: var(--warn); font-weight: 600; font-size: .88rem; }
.hand-job[open] .hand-folded, .hand-job:not([open]) .hand-ended { display: none; }
.hand-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.hand-head .mono { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.hand-head .badge { margin-left: auto; }
.hand-where { margin: .15rem 0 0; font-size: 1rem; }
.hand-type { margin: .1rem 0 0; color: var(--ink-muted); font-size: .88rem; }
.hand-crew { display: inline-block; margin: .7rem 0 0; }
.hand-times { display: flex; gap: .5rem 1.2rem; flex-wrap: wrap; margin: .7rem 0 0; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.hand-time-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.hand-time-value { display: block; font-size: 1.05rem; font-weight: 700; margin-top: .1rem; }
.hand-schedule { margin: .5rem 0 0; }
.hand-schedule summary { cursor: pointer; font-size: .85rem; color: var(--ink-muted); }
.hand-schedule p { margin: .35rem 0 0; font-size: .85rem; color: var(--ink-muted); }
.hand-changed { margin: .3rem 0 0; font-size: .8rem; color: var(--ink-subtle); }
.hand-directions { margin: .8rem 0 0; padding: .7rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.hand-dir-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.hand-directions .dir-text { margin: .35rem 0 0; font-size: .92rem; }
.hand-dir > summary { list-style: none; cursor: pointer; }
.hand-dir > summary::-webkit-details-marker { display: none; }
.hand-dir-show { display: block; margin-top: .35rem; font-size: .85rem; color: var(--accent); }
.hand-dir-show::after { content: "Show directions"; }
.hand-dir[open] .hand-dir-show::after { content: "Hide directions"; }
.hand-dir-actions { margin: .6rem 0 0; }
.hand-no-dir { margin: .8rem 0 0; }
.hand-people { margin: .8rem 0 0; }
.hand-people-label { display: block; margin-bottom: .3rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.hand-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.hand-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .3rem .7rem .3rem .4rem; border-radius: 999px; background: var(--surface-2); font-size: .88rem; font-weight: 600; }
a.hand-chip { color: inherit; text-decoration: none; }
a.hand-chip:hover, a.hand-chip:focus-visible { color: var(--accent); }
.hand-avatar { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 700; }

/* ---------- jobs: the status track ---------- */
.track { display: flex; align-items: flex-start; margin: .2rem 0 1rem; }
.track-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  position: relative; text-align: center;
}
.track-step + .track-step::before {
  content: ""; position: absolute; top: .7rem; right: 50%; width: 100%; height: 3px;
  background: var(--line-strong); z-index: 0;
}
.track-step.is-done + .track-step::before { background: var(--ok); }
.track-dot {
  width: 1.45rem; height: 1.45rem; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 3px solid var(--line-strong);
  color: var(--ink-inverse); font-size: .8rem; font-weight: 700;
}
.track-dot { color: var(--ink-subtle); }
.track-step.is-done .track-dot { background: var(--ok); border-color: var(--ok); color: var(--ink-inverse); }
.track-step.is-current .track-dot {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.track-label { margin-top: .45rem; font-size: .85rem; color: var(--ink-subtle); font-weight: 600; }
.track-step.is-done .track-label { color: var(--ink-muted); }
.track-step.is-current .track-label { color: var(--ink); }
.track-sub { font-size: .75rem; color: var(--ink-subtle); margin-top: .1rem; min-height: 1em; }
.track.is-cancelled .track-step { opacity: .35; }
.track-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.track-actions .spacer { flex: 1; }
.track-hint { font-size: .85rem; color: var(--ink-muted); margin: .5rem 0 0; }
.history { margin-top: .8rem; }
.history > summary { cursor: pointer; font-weight: 500; }
.history-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.history-list li { padding: .3rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.history-note { color: var(--ink-muted); font-size: .85rem; margin-top: .1rem; }
.cancel-card { padding: 1rem 1.1rem; }
.cancel-card > summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; }
.cancel-card > summary::-webkit-details-marker { display: none; }
.cancel-card > summary::before { content: "\25B8"; margin-right: .4rem; color: var(--ink-subtle); }
.cancel-card[open] > summary::before { content: "\25BE"; }
.closeout-check { display: flex; gap: .5rem; align-items: center; font-weight: 600; margin: 0 0 .8rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cancelled-band[hidden] { display: none; }
.cancelled-band {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem;
  border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger);
  margin-bottom: .8rem;
}
@media (max-width: 40rem) {
  .track-step { min-width: 0; }
  .track-dot { width: 1.25rem; height: 1.25rem; border-width: 2px; font-size: .7rem; }
  .track-step + .track-step::before { top: .6rem; height: 2px; }
  .track-label { font-size: .68rem; letter-spacing: -.01em; }
  .track-sub { display: none; }

  /* Assigned rows: name and crew on the first line, the dates and Take off
     on a second line under them, instead of three lines. */
  .assigned .loc-aside { flex-basis: 100%; margin-left: 2.1rem; white-space: normal; }

  /* Gloved thumbs: the small controls grow to a comfortable tap height. */
  .btn-sm, .loc-add button, .loc-add select, .crew-select { min-height: 2.5rem; }
  .btn-sm { padding: .5rem .8rem; }
  .link-button { display: inline-block; padding: .45rem .25rem; }
  .track-actions button, .track-actions .btn { min-height: 2.75rem; }
  td a, .loc-name { display: inline-block; padding: .25rem 0; }
}

/* Skills: a name and one count. */
.roster-2col .cust-head, .roster-2col .cust-row > summary { grid-template-columns: minmax(0,1fr) 6rem; }
/* Count columns: right-aligned, digits lined up. */
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num, td.num { width: 6rem; }
.loc-add-phone { max-width: 12rem; }
.mk-subhead { font-size: 1rem; margin: 1.5rem 0 .5rem; }

/* ---------- directions timeline on a location ---------- */
.dir { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .8rem; background: var(--surface); }
.dir.is-current { border-color: var(--accent); }
.dir.is-next { border-style: dashed; }
.dir-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.dir-label { font-weight: 600; font-size: 1.05rem; }
.dir-dates { font-size: .85rem; color: var(--ink-muted); margin-left: auto; white-space: nowrap; }
.dir-text { margin: .3rem 0 .4rem; line-height: 1.5; overflow-wrap: anywhere; }
.dir-text a { font-weight: 600; }
.dir-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.dir-actions form { margin: 0; }
/* The customer's own picture or PDF, under the typed directions. */
.dir-attachment { margin: .4rem 0; }
.dir-file {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
}
.dir-file.is-image { padding: 0; background: none; overflow: hidden; }
.dir-file.is-image img { display: block; max-width: 100%; max-height: 16rem; }
.dir-remove img { display: block; max-width: 9rem; max-height: 7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.dir-remove-tick { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; font-weight: 400; }
.dir-prev { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.dir-prev:last-child { border-bottom: 0; }
.dir-prev summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; list-style: none; }
.dir-prev summary::-webkit-details-marker { display: none; }
.dir-prev[open] summary .accordion-chevron { transform: rotate(180deg); }
.dir-prev .dir-text { margin-left: 1.4rem; font-size: .92rem; color: var(--ink-muted); }
.dir-prev .dir-actions { margin: 0 0 .2rem 1.4rem; }

/* ---------- flags and write-ups ---------- */
.flag-row { align-items: flex-start; }
.flag-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.flag-note { color: var(--ink-muted); font-size: .9rem; }
.flag-meta { font-size: .8rem; flex-basis: 100%; }
.flag-lifted { margin-top: .5rem; }
.flag-lifted summary { cursor: pointer; font-size: .85rem; }
.flag-row.is-retired .badge { opacity: .6; }

.wu { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.wu:last-child { border-bottom: 0; }
.wu-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.wu-date { font-weight: 600; white-space: nowrap; }
.wu-summary { flex: 1; min-width: 12rem; }
.wu-details { margin: .25rem 0 0; font-size: .9rem; color: var(--ink-muted); white-space: pre-line; }
.wu-meta { font-size: .8rem; color: var(--ink-subtle); margin-top: .2rem; }
.wu.is-faded { opacity: .65; }
.wu.is-void .wu-summary { text-decoration: line-through; }
.wu-group { margin: .9rem 0 .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-subtle); }

/* ---------- jobs: updates (Dispatch cards and the job page) ---------- */
.updates > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .4rem; font-size: .88rem; }
.updates > summary::-webkit-details-marker { display: none; }
.updates-title { font-weight: 700; white-space: nowrap; }
.updates-latest { flex: 1; min-width: 0; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.updates[open] .updates-latest { visibility: hidden; }
.updates-toggle { margin-left: auto; color: var(--ink-subtle); font-size: .8rem; white-space: nowrap; }
.updates-toggle::after { content: "Show \25BE"; }
.updates[open] .updates-toggle::after { content: "Hide \25B4"; }
.updates-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.updates-list li { padding: .4rem 0; border-top: 1px solid var(--line); font-size: .88rem; }
.updates-list li:first-child { border-top: 0; }
.updates-text { overflow-wrap: anywhere; }
.updates-meta { display: block; margin-top: .1rem; font-size: .75rem; color: var(--ink-subtle); }
.updates-meta strong { color: var(--ink-muted); font-weight: 600; }
.updates-meta .link-button { font-size: .75rem; }
.updates-none { margin: .4rem 0 0; font-size: .82rem; color: var(--ink-subtle); }
.updates-add { display: flex; gap: .3rem; margin: .5rem 0 0; }
.updates-add input { flex: 1; min-width: 0; font-size: .88rem; }
.updates-editing textarea { width: 100%; font-size: .88rem; }
.updates-edit-actions { display: flex; gap: .4rem; margin-top: .3rem; }
/* Who sees an update (2026-10-07): the tags, the edit box's tick, and the
 * hand's way to the equipment problem report. */
.updates-meta .badge { font-size: .68rem; vertical-align: 1px; }
.updates-crewtick { display: flex; align-items: center; gap: .35rem; margin: .35rem 0 0; font-size: .82rem; color: var(--ink-muted); }
.updates-report { margin: .45rem 0 0; font-size: .8rem; color: var(--ink-subtle); }
.hand-updates { margin-top: .9rem; padding-top: .6rem; border-top: 1px solid var(--line); }
