/* Shared styles for the Sevak front-end prototype. */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #17201e;
  --muted: #56625e;
  --border: #e5e0d6;
  --input-border: #c9c2b5;
  --primary: #0f766e;
  --primary-hover: #0b5f59;
  --on-primary: #ffffff;
  --primary-soft: #e3f2ef;
  --accent: #b45309;
  --accent-soft: #fcefd9;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --focus: rgba(15, 118, 110, 0.35);
  --viz-required: #86b6ef;
  --viz-enrolled: #256abf;
  --status-warning: #fab219;
  --viz-grid: #e1e0d9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412;
    --surface: #151d1b;
    --text: #e8eeec;
    --muted: #9fb0ab;
    --border: #26322f;
    --input-border: #3a4844;
    --primary: #2dd4bf;
    --primary-hover: #5eead4;
    --on-primary: #04201d;
    --primary-soft: #12302c;
    --accent: #fbbf24;
    --accent-soft: #2c2312;
    --danger: #f97066;
    --danger-soft: #3a1714;
    --focus: rgba(45, 212, 191, 0.35);
    --viz-required: #184f95;
    --viz-enrolled: #5598e7;
    --status-warning: #fab219;
    --viz-grid: #2c2c2a;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1412;
  --surface: #151d1b;
  --text: #e8eeec;
  --muted: #9fb0ab;
  --border: #26322f;
  --input-border: #3a4844;
  --primary: #2dd4bf;
  --primary-hover: #5eead4;
  --on-primary: #04201d;
  --primary-soft: #12302c;
  --accent: #fbbf24;
  --accent-soft: #2c2312;
  --danger: #f97066;
  --danger-soft: #3a1714;
  --focus: rgba(45, 212, 191, 0.35);
  --viz-required: #184f95;
  --viz-enrolled: #5598e7;
  --status-warning: #fab219;
  --viz-grid: #2c2c2a;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.container { width: min(720px, 100% - 32px); margin-inline: auto; }

/* Header and footer */
.site-header { padding-block: 20px; }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.app-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.nav-group { display: flex; align-items: center; gap: 4px; }
.nav-manage { padding-left: 12px; border-left: 1px solid var(--border); }
.nav-label { margin-right: 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.app-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.app-nav a:hover { color: var(--text); background: var(--surface); }
.app-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: inherit;
  text-decoration: none;
}
.brand svg { width: 32px; height: 32px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-subtitle { font-weight: 600; font-size: 0.8rem; }
.brand-tagline { font-weight: 500; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.01em; }

.site-footer {
  margin-top: 48px;
  padding-block: 24px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer a { color: inherit; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--text); }

a { color: var(--primary); text-underline-offset: 3px; }

/* Page heading */
.page-title { margin: 8px 0 4px; font-size: clamp(1.9rem, 5vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.1; }
.page-intro { margin: 0 0 24px; color: var(--muted); max-width: 60ch; }

/* Notices */
.banner, .notice {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
}
.banner { position: relative; margin-bottom: 20px; padding-right: 48px; background: var(--accent-soft); color: var(--text); }
.banner[hidden] { display: none; }
.banner-close { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.banner-close:hover { background: var(--surface); color: var(--text); }
.banner-close:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.banner strong { color: var(--accent); }
.banner a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
.notice { background: var(--primary-soft); }
.notice-warn { background: var(--accent-soft); }
.notice p { margin: 0; }
.notice p + p { margin-top: 8px; }

/* Form sections */
.section {
  margin: 0 0 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 0;
}
.section > legend, .section-title {
  float: left;
  width: 100%;
  margin: 0 0 4px;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section > legend + * { clear: both; }
/* Headings float like legends; what follows starts below them (a search box
   or list beside a full-width float would be squeezed to nothing). */
.section > .section-title + * { clear: both; }
.section-help { margin: 0 0 16px; color: var(--muted); font-size: 0.92rem; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .span-2 { grid-column: 1 / -1; }
.stack { display: grid; gap: 16px; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; align-content: start; }
.field label, .label { font-weight: 600; font-size: 0.92rem; }
.optional { font-weight: 400; color: var(--muted); }
.hint { margin: 0; font-size: 0.85rem; color: var(--muted); }
.error { margin: 0; font-size: 0.85rem; color: var(--danger); font-weight: 600; }
.error:empty { display: none; }

input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: 10px;
}
input[type="search"] { -webkit-appearance: none; appearance: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .choice input:focus-visible + span {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
  border-color: var(--primary);
}
[aria-invalid="true"] { border-color: var(--danger) !important; }

textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field-footer { display: flex; justify-content: space-between; gap: 12px; }
.counter { margin: 0; margin-left: auto; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

/* International phone numbers */
.phone-group { display: flex; flex-wrap: wrap; gap: 8px; }
.phone-group select { flex: 1 1 12rem; width: auto; min-width: 0; }
.phone-number { flex: 1 1 11rem; display: flex; min-width: 0; }
.phone-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--input-border);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: var(--bg);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.phone-number input { border-radius: 0 10px 10px 0; min-width: 0; }
.whatsapp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 0.88rem; }
.field .whatsapp label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: 0.88rem; cursor: pointer; }
.whatsapp input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.whatsapp a { font-weight: 600; word-break: break-all; }

/* Link that opens what was typed in a URL field */
.open-link { justify-self: start; max-width: 100%; font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.open-link::after { content: " ↗"; }

/* Fill-from-website row */
.fill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; border-color: var(--input-border); }
.filled { box-shadow: 0 0 0 2px var(--accent-soft); border-color: var(--accent) !important; }

/* Radio cards */
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choices-wide { grid-template-columns: 1fr; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice > span {
  display: block;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--surface);
}
.choice strong { display: block; font-size: 0.95rem; }
.choice small { display: block; color: var(--muted); font-size: 0.82rem; }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus); }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 650;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
}
a.btn { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--input-border); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-link { min-height: 0; padding: 4px 0; background: none; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-link { min-height: 0; padding: 4px 0; background: none; color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }

/* Repeating rows (affiliations) */
.rows { display: grid; gap: 12px; margin-bottom: 12px; }
.row { display: grid; grid-template-columns: 220px 1fr auto; gap: 10px; align-items: end; }
.row .remove { min-height: 44px; }
.row-org { grid-template-columns: 1fr 200px auto; }

/* Team member cards */
.member {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.member-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.member-head h3 { margin: 0; font-size: 0.95rem; }

/* Events */
.breadcrumb { margin: 0 0 4px; font-size: 0.92rem; }
.breadcrumb a { text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.summary { margin: 0 0 12px; font-size: 0.9rem; font-weight: 600; color: var(--primary); }
.role-card .grid { margin-bottom: 4px; }
.shifts-title { margin: 16px 0 8px; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.shift-list { display: grid; gap: 10px; }
.shift-row {
  display: grid;
  grid-template-columns: minmax(9.25rem, 1.2fr) minmax(8.75rem, 1fr) minmax(8.75rem, 1fr) minmax(4rem, 0.6fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
}
.shift-row .remove-shift { margin-top: 27px; min-height: 44px; min-width: 44px; padding: 10px 12px; }
.shift-row .remove-label { display: none; }
.shift-row select { padding-left: 8px; padding-right: 2px; }
input[type="time"], input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 6px 10px 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: 10px;
}

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.section-head .section-title { float: none; width: auto; margin: 0; }
.event-list { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.event-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.event-item h3 { margin: 0; font-size: 1rem; }
.event-item h3 a { color: inherit; text-decoration: none; }
.event-item h3 a:hover { text-decoration: underline; }
.event-meta { margin: 0; font-size: 0.88rem; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-published { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-draft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-inactive { background: transparent; color: var(--muted); border-style: dashed; }
.event-item.is-inactive h3 a { color: var(--muted); }
.show-inactive { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.9rem; color: var(--muted); cursor: pointer; }
.show-inactive input { width: 18px; height: 18px; accent-color: var(--primary); }
.inactive-note .btn { margin-top: 4px; }
.empty { margin: 16px 0 0; color: var(--muted); }
.main-group {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}
.main-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.main-head h3 { margin: 0; font-size: 1.05rem; }
.main-head h3 a { color: inherit; text-decoration: none; }
.main-head h3 a:hover { text-decoration: underline; }
.sub-list { margin-top: 12px; padding-left: 14px; border-left: 3px solid var(--primary-soft); }
.sub-list .event-item { background: var(--surface); }
.main-group .empty { margin-top: 8px; font-size: 0.9rem; }
.list-heading { margin: 24px 0 0; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Organization switcher */
.org-switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; }
.org-switcher label { font-weight: 650; font-size: 0.9rem; color: var(--muted); }
.org-switcher select { width: auto; min-width: 0; max-width: 100%; flex: 0 1 20rem; min-height: 40px; padding: 6px 10px; font-weight: 600; }

/* Organization context header */
.org-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.org-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.org-context-text p { margin: 0; }
.org-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.org-name { font-size: 1.2rem; font-weight: 750; letter-spacing: -0.01em; line-height: 1.25; overflow-wrap: anywhere; }
.org-details { font-size: 0.88rem; color: var(--muted); }
.org-context-side { display: grid; justify-items: end; gap: 6px; }
.org-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.88rem; font-weight: 600; }

/* Tabs */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  scrollbar-width: thin;
}
.tab {
  position: relative;
  flex: 1 0 auto;
  min-height: 42px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--bg); }
.tab[aria-selected="true"] { color: var(--primary); background: var(--primary-soft); }
.tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.tab-dot {
  display: none;
  position: absolute;
  top: 8px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.tab.has-error .tab-dot { display: block; }
.tab-panel.is-hidden { display: none; }
.panel-next { display: flex; justify-content: flex-end; margin-top: 20px; }

/* Dashboard */
.filter-row { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 0 0 16px; }
.filter-row .field { flex: 0 1 14rem; }
.filter-row select { min-height: 40px; padding: 6px 10px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.kpi-label { margin: 0; font-size: 0.85rem; color: var(--muted); }
.kpi-value { margin: 4px 0 0; font-size: 1.9rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }

.fill-card { padding: 16px 20px; }
.fill-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.fill-value { margin: 0; font-size: 1.3rem; font-weight: 650; }
.fill-note { font-size: 0.88rem; font-weight: 400; color: var(--muted); }

/* A meter: the track is the number required, the fill the number enrolled.
   Same hue, two steps; 4px rounded data end, square at the baseline, and a
   2px surface gap where the fill meets the track. */
.meter {
  position: relative;
  display: block;
  height: 14px;
  background: var(--viz-required);
  border-radius: 0 4px 4px 0;
  overflow: hidden;
}
.meter-fill {
  display: block;
  height: 100%;
  background: var(--viz-enrolled);
  border-radius: 0 4px 4px 0;
  box-shadow: 2px 0 0 var(--surface);
}
.meter.bar { height: 16px; flex: 1 1 auto; cursor: default; }
.meter.bar:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.meter.bar-small { height: 8px; }

.view-toggle { display: inline-flex; padding: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.view-btn { min-height: 32px; padding: 4px 12px; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.view-btn[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.view-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 4px; font-size: 0.85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 14px; height: 10px; border-radius: 0 3px 3px 0; }
.swatch-enrolled { background: var(--viz-enrolled); }
.swatch-required { background: var(--viz-required); }

.bars { margin: 8px 0 0; padding: 0; list-style: none; }
.bar-row { padding: 14px 0; border-top: 1px solid var(--viz-grid); }
.bar-row:first-child { border-top: 0; }
.bar-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 6px 12px; margin-bottom: 8px; }
.bar-parent { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.bar-title { font-weight: 650; color: var(--text); text-decoration: none; }
.bar-title:hover { text-decoration: underline; }
.bar-line { display: flex; align-items: center; gap: 12px; }
.bar-value { flex: none; min-width: 7.5rem; font-size: 0.88rem; color: var(--text); font-variant-numeric: tabular-nums; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 650; color: var(--text); white-space: nowrap; }
.status-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--status-warning);
  color: #3a2a00;
  font-size: 0.72rem;
  font-weight: 800;
}

.shift-details { margin-top: 8px; font-size: 0.88rem; }
.shift-details summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.shift-bars { display: grid; gap: 8px; margin: 10px 0 0; padding: 0 0 0 4px; list-style: none; }
.shift-bars li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6rem, 0.8fr) auto; align-items: center; gap: 12px; }
.shift-label { color: var(--muted); overflow-wrap: anywhere; }
.shift-bars .bar-value { min-width: 3.5rem; text-align: right; }

.chart-card { position: relative; }
.tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  max-width: 16rem;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}
.tooltip strong { font-size: 0.95rem; }
.tooltip span { color: var(--muted); }

.table-wrap { overflow-x: auto; margin-top: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--viz-grid); }
.data-table thead th { font-size: 0.8rem; color: var(--muted); font-weight: 650; }
.data-table tbody th { font-weight: 600; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.sample-card { border-style: dashed; }

/* Volunteer sign-up */
.volunteer-link-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 12px; font-weight: 600; }
.volunteer-link-row .hint { font-weight: 400; }
.host-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; color: var(--muted); }
.host-line strong { color: var(--text); }
.event-facts { display: grid; gap: 4px; margin: 4px 0 12px; padding: 0; list-style: none; color: var(--text); }
.event-facts li::before { content: "·"; margin-right: 8px; color: var(--muted); }
.event-description { margin: 0 0 20px; max-width: 65ch; white-space: pre-line; }
.day-group + .day-group { margin-top: 18px; }
.day-title { margin: 0 0 8px; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.shift-choices { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.shift-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  cursor: pointer;
}
.shift-choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); }
.shift-choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.shift-choice:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--focus); }
.shift-choice.is-full { cursor: not-allowed; opacity: 0.6; }
.shift-choice-text { display: grid; gap: 2px; }
.shift-choice-text strong { font-size: 0.98rem; }
.shift-time { font-size: 0.9rem; color: var(--text); }
.shift-desc { font-size: 0.85rem; color: var(--muted); }
.spots { font-size: 0.85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.shift-choice:has(input:checked) .spots { color: var(--primary); }
#overlap-warning { margin-top: 12px; }

.confirm-head { display: flex; align-items: flex-start; gap: 16px; margin: 8px 0 20px; }
.confirm-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.5rem;
  font-weight: 800;
}
.my-shifts { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.my-shift { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.my-shift div { display: grid; gap: 2px; }
.my-shift.is-cancelled strong { text-decoration: line-through; color: var(--muted); }
.event-list .list-heading { display: grid; gap: 2px; margin-top: 20px; }
.event-list .list-heading .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Profile photo */
.photo-field { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin: 0 0 20px; padding: 16px; border: 1px dashed var(--input-border); border-radius: 14px; }
.photo-field.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
.photo-frame { flex: none; width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.photo-img { width: 100%; height: 100%; object-fit: cover; }
.photo-img[hidden], .photo-placeholder[hidden] { display: none; }
.photo-placeholder svg { width: 56px; height: 56px; }
.photo-body { flex: 1 1 240px; min-width: 0; display: grid; gap: 6px; }
.photo-body .label { margin: 0; }
.photo-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.photo-status:empty { display: none; }
.photo-drop-hint { position: absolute; inset: 0; display: none; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--primary-soft) 92%, transparent); color: var(--primary); font-weight: 700; pointer-events: none; }
.photo-field.is-dragover .photo-drop-hint { display: grid; }

.camera-dialog { width: min(440px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); }
.camera-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.camera-title { margin: 0 0 12px; font-size: 1.15rem; }
.camera-frame { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: #111; }
.camera-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-guide { position: absolute; inset: 12%; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 50%; pointer-events: none; }
.camera-message { position: absolute; inset: auto 12px 12px; margin: 0; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.9rem; }
.camera-message[hidden] { display: none; }
.camera-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }

@media (max-width: 480px) {
  .photo-field { justify-content: center; text-align: center; }
  .photo-buttons { justify-content: center; }
  .camera-actions .btn { flex: 1 1 auto; }
}

/* Signed-in line on the volunteer pages */
.signed-in { margin: 0 0 12px; font-size: 0.9rem; color: var(--muted); }
.signed-in strong { color: var(--text); }
.signed-in a { color: var(--primary); text-underline-offset: 3px; }
.signed-in .btn-link { font: inherit; padding: 0; border: 0; cursor: pointer; }

/* Volunteer opportunities: tabs, filter and my sign-ups */
.tab-count { font-weight: 600; }
.opp-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
.filter-chip { position: relative; cursor: pointer; }
.filter-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.filter-chip > span { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--input-border); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 0.92rem; }
.filter-chip .chip-count { font-weight: 400; color: var(--muted); }
.filter-chip input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.filter-chip input:checked + span .chip-count { color: inherit; }
.filter-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus); }
.near-row { display: grid; gap: 6px; max-width: 420px; margin: 0 0 12px; }
.near-row label { font-weight: 600; font-size: 0.92rem; }
.empty-state p { margin: 0; }
.empty-state p + p { margin-top: 8px; }
.mine-heading { margin: 20px 0 8px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
#mine-groups > .mine-heading:first-child { margin-top: 4px; }
.signup-shifts { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.92rem; }
.my-signup.is-cancelled .signup-shifts { display: block; padding-left: 18px; list-style: disc; }

/* Hours on My sign-ups */
.signup-shift { padding-top: 8px; border-top: 1px dashed var(--border); }
.signup-shift:first-child { padding-top: 0; border-top: 0; }
.signup-shift:focus { outline: none; }
.signup-shift:focus-visible { box-shadow: 0 0 0 3px var(--focus); border-radius: 6px; }
.signup-shift-label { display: block; }
.hours-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.hours-row[hidden] { display: none; }
.hours-row .btn-link { min-height: 32px; padding: 4px 0; font-size: 0.9rem; }
.hours-ask { color: var(--accent); font-weight: 600; }
.hours-done strong { color: var(--primary); }
.hours-form { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.hours-mode { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.hours-mode legend { margin: 0 0 6px; padding: 0; font-size: 0.9rem; font-weight: 600; }
.hours-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 150px)); gap: 10px; }
.hours-fields[hidden] { display: none; }
.hours-error:empty { display: none; }
.hours-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.hours-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 4px 0 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.hours-summary[hidden] { display: none; }
.hours-total { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.hours-total-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.hours-total-value { font-size: 1.5rem; color: var(--primary); }
.hours-sub { margin: 0; font-size: 0.9rem; color: var(--muted); }
#mine-status:empty { display: none; }
#mine-status { margin: 8px 0 0; }
.signup-manage { display: inline-block; margin-top: 8px; font-size: 0.9rem; font-weight: 600; color: var(--primary); text-underline-offset: 3px; }
.my-signup.is-cancelled h3, .my-signup.is-cancelled .signup-shifts { color: var(--muted); }
.my-signup.is-cancelled .signup-shifts { text-decoration: line-through; }

/* Way in to the Manage pages, team list on My profile */
.way-in-doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.way-in-door { margin: 0; display: grid; align-content: start; gap: 4px; }
.way-in-door .section-title { float: none; }
.way-in-door .btn { justify-self: start; margin-top: 4px; }
.way-in-back { margin: 20px 0 0; }
.way-in-back a, .team-doors a { color: var(--primary); text-underline-offset: 3px; }
.team-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.team-notice a { color: var(--primary); font-weight: 600; text-underline-offset: 3px; }
.preview-note { display: inline; }
.subhead { margin: 20px 0 8px; font-size: 1rem; }
.team-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.team-list[hidden] { display: none; }
.team-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; }
.team-item strong { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.team-item a { color: var(--primary); font-weight: 600; text-underline-offset: 3px; }
.team-doors { display: grid; gap: 6px; margin-top: 14px; }
.team-doors p { margin: 0; }
@media (max-width: 600px) {
  .way-in-doors { grid-template-columns: minmax(0, 1fr); }
}

.account-line { margin: -12px 0 20px; font-size: 0.9rem; color: var(--muted); }
.account-line strong { color: var(--text); }
.account-line .btn-link { font: inherit; padding: 0; border: 0; cursor: pointer; }

/* Volunteer pages: opportunities list */
.back-link { display: inline-flex; align-items: center; min-height: 36px; margin: 0 0 8px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; font-size: 0.95rem; color: var(--primary); text-decoration: none; cursor: pointer; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.back-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 6px; }
.opp-group { margin: 22px 0 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.opp-group-hint { margin: -4px 0 8px; }
.opp-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.opp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.opp-row:hover { border-color: var(--primary); }
.opp-row:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.opp-text { min-width: 0; display: grid; gap: 2px; }
.opp-title { margin: 0; font-size: 1rem; font-weight: 700; }
.opp-meta, .opp-org { margin: 0; font-size: 0.88rem; color: var(--muted); }
.opp-org { font-size: 0.8rem; }
.opp-spots { flex: none; font-size: 0.85rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.opp-spots.is-full { color: var(--muted); }

/* Volunteer pages: one event */
.event-head { margin-bottom: 8px; }
.event-host { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.event-when { margin: 4px 0 0; color: var(--text); }
.about-event { margin: 12px 0 0; }
.about-event summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.about-event summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 6px; }
.about-body { margin-top: 8px; max-width: 65ch; }
.about-body p { margin: 0 0 8px; white-space: pre-line; }
.step-title { margin: 24px 0 12px; font-size: 1.15rem; }
.day-picker { display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; padding-bottom: 2px; }
.day-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--input-border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; }
.day-chip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.day-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.day-chip-count:empty { display: none; }
.day-chip-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 0.75rem; }
.shift-lines { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.shift-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.shift-line:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.shift-line:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--focus); }
.shift-line.is-full { opacity: 0.65; }
.shift-pick { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.shift-line.is-full .shift-pick { cursor: not-allowed; }
.shift-pick input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.shift-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.shift-role { font-size: 0.98rem; }
.shift-main .shift-time { color: var(--muted); font-size: 0.9rem; }
.shift-spots { font-size: 0.85rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.shift-spots.is-full { color: var(--muted); }
.shift-more { padding: 4px 6px; border: 0; background: none; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.shift-more:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 6px; }
.shift-info { grid-column: 1 / -1; padding-left: 32px; font-size: 0.88rem; color: var(--muted); }
.shift-info p { margin: 0; }
.full-shifts { margin-top: 10px; }
.full-shifts summary { cursor: pointer; font-size: 0.9rem; color: var(--muted); }
.full-shifts .shift-lines { margin-top: 8px; }
.action-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--border); }
.action-count { margin: 0; font-weight: 600; }
.action-bar .error:empty { display: none; }
.picked-list { clear: both; display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.picked-list li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.who-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.who-summary p { margin: 0; }
.who-email { color: var(--muted); }

@media (max-width: 600px) {
  .opp-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
  .opp-filter .filter-chip { flex: none; }
  .shift-line { grid-template-columns: minmax(0, 1fr) auto; }
  .shift-more { grid-column: 1; justify-self: start; margin-left: 26px; }
  .action-bar .btn { flex: 1 1 auto; }
}

/* Joining: the Join page, profile notice, opportunities tabs, the event gate */
.narrow { width: min(640px, 100%); }
.join-ways > legend { margin-bottom: 12px; }
.org-pick { display: grid; gap: 8px; max-height: 360px; margin: 12px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.org-pick-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.org-pick-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.org-pick-item:has(input:disabled) { opacity: 0.7; cursor: default; }
.org-pick-item:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--focus); }
.org-pick-item input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.org-pick-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.join-alt { margin: 16px 0 0; font-size: 0.92rem; color: var(--muted); }
.join-alt a, .join-notice a, .team-doors-line a, .browse-hint a, .member-strip a { color: var(--primary); font-weight: 600; text-underline-offset: 3px; }
.join-notice { margin-bottom: 16px; }
.team-doors-line { margin: 8px 0 0; font-size: 0.92rem; }
.browse-hint { margin: 0 0 12px; }
.org-tabs { margin: 4px 0 12px; }
.member-strip { margin: 0 0 12px; font-size: 0.92rem; color: var(--muted); }
.member-strip p { margin: 0; }
.member-strip strong { color: var(--text); }
.opp-join { margin: 2px 0 0; font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.opp-join.is-pending { color: var(--muted); }
#discover-empty p { margin: 0 0 10px; }
/* Organization verification (organization.html, review.html) */
.verify-box { margin-bottom: 20px; }
.verify-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.verify-head .section-title { float: none; width: auto; margin: 0; }
.verify-text { margin: 0 0 12px; color: var(--muted); }
.verify-evidence { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.verify-evidence li { display: flex; flex-wrap: wrap; gap: 2px 8px; overflow-wrap: anywhere; }
.verify-label { font-weight: 600; min-width: 11em; }
.verify-note { margin: 0 0 12px; font-style: italic; overflow-wrap: anywhere; }
.verify-proto { margin: 0 0 12px; }
.verify-box .field { margin: 12px 0; }
.review-list { clear: both; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review-item { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.review-item h3 { margin: 0 0 4px; font-size: 1.05rem; }
.review-item .verify-evidence { margin-top: 10px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; }
.review-reject { margin-top: 12px; }
.review-reject[hidden] { display: none; }
.team-edit-hint { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--primary-soft); color: var(--text); font-size: 0.92rem; }
.team-edit-hint a { font-weight: 600; }
.way-in-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 20px; }
.member-hint { margin: 6px 0 0; color: var(--accent); font-weight: 600; }
.join-gate .section-title { float: none; margin-bottom: 6px; }
.join-gate p { margin: 0 0 10px; }
.join-gate .field { margin-bottom: 10px; }

/* Manage → Volunteers */
.person-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; clear: both; }
#show-all-members { margin-top: 10px; }
.person { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.person:focus { outline: none; }
.person-pic { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.person-pic img { width: 100%; height: 100%; object-fit: cover; }
.person-text { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.person-detail { margin: 2px 0 0; font-size: 0.9rem; color: var(--muted); }
.person-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 10px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1 1 auto; min-width: 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--primary); }
.section > .section-title + .person-list, .section > .section-title + .empty { clear: both; }

/* Prototype outbox */
.mail-list { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.mail { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.mail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.mail-to { margin: 2px 0 6px; font-size: 0.88rem; color: var(--muted); }
.mail-body { margin: 0 0 10px; }
.mail-link { margin: 6px 0 0; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .person { grid-template-columns: 40px minmax(0, 1fr); }
  .person-pic { width: 40px; height: 40px; }
  .person-actions { grid-column: 2; justify-content: flex-start; }
}

/* The "⋯" menu with the Manage links (header on wide screens, "More" in the phone bar) */
.nav-more { position: relative; }
.nav-more-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.nav-more-btn svg { width: 22px; height: 22px; }
.nav-more-btn:hover { background: var(--surface); color: var(--text); }
.nav-more-btn[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.nav-more-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.nav-more-btn .nav-count { position: absolute; top: 0; right: -2px; margin: 0; }
.more-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; display: grid; gap: 2px; min-width: 210px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.3); }
.more-menu[hidden] { display: none; }
.more-menu-label { margin: 4px 12px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.app-nav .more-menu a, .tab-bar .more-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 0.95rem; font-weight: 600; text-decoration: none; }
.app-nav .more-menu a:hover, .tab-bar .more-menu a:hover { background: var(--bg); }
.app-nav .more-menu a[aria-current="page"], .tab-bar .more-menu a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.more-menu a:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--focus); }
.tab-more { display: flex; flex: 1 1 0; min-width: 0; }
.tab-more-btn { width: 100%; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.tab-more-btn.is-current, .tab-more-btn[aria-expanded="true"] { color: var(--primary); }
.tab-more .more-menu { position: fixed; top: auto; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 8px); }

/* Menu count and the phone bottom bar */
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 0.72rem; font-weight: 700; line-height: 1; vertical-align: 1px; }
.tab-bar { display: none; }
@media (max-width: 600px) {
  body.has-tab-bar { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .tab-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(64px + env(safe-area-inset-bottom, 0px)); padding: 0 4px env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--border); }
  .tab-bar-item { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; color: var(--muted); font-size: 0.72rem; font-weight: 600; text-decoration: none; }
  .tab-bar-item svg { width: 24px; height: 24px; }
  .tab-bar-item[aria-current="page"] { color: var(--primary); }
  .tab-bar-item[aria-current="page"] svg { stroke-width: 2.2; }
  .tab-bar-item:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--focus); border-radius: 10px; }
  .tab-bar-item .nav-count { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
  .tab-bar-label { white-space: nowrap; }
  /* The header keeps only what the bar doesn't have. */
  .nav-main, .nav-more { display: none; }
  .has-tab-bar .save-bar, .has-tab-bar .action-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* Services */
.service-picker { max-width: 360px; }
.service-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.service-list[hidden] { display: none; }
.service-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.service-remove { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; font: inherit; font-size: 0.8rem; color: inherit; background: none; cursor: pointer; }
.service-remove:hover { background: var(--surface); }
.service-remove:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
#service-empty { margin-top: 12px; }

/* Documents */
.docs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 16px; }
.docs-head .section-title { float: none; }
.docs-head .section-help { margin-bottom: 0; max-width: 60ch; }
.docs .notice { margin-top: 16px; }
.docs-form { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.docs-form-title { margin: 0 0 12px; font-size: 1rem; }
.docs-form input[type="file"] { max-width: 100%; font: inherit; font-size: 0.92rem; }
.docs-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.docs-status:not(:empty) { margin-top: 12px; }
.docs-summary:not(:empty) { margin-top: 16px; }
.docs-table th button.docs-sort { padding: 0; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.docs-table th button.docs-sort:hover { color: var(--text); }
.docs-table th button.docs-sort:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 4px; }
.docs-table td, .docs-table tbody th { vertical-align: top; }
.docs-table tbody th { min-width: 180px; }
.docs-table td[data-label="Description"] { min-width: 140px; }
.docs-when { display: grid; }
.docs-when .hint { font-size: 0.8rem; }
.docs-name-link { padding: 0; font: inherit; font-weight: 650; text-align: left; color: var(--primary); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; overflow-wrap: anywhere; }
.docs-filename { display: block; font-weight: 400; overflow-wrap: anywhere; }
.docs-none { color: var(--muted); }
.docs-table td[data-label="Uploaded"], .docs-table td[data-label="By"] { white-space: nowrap; }
.docs-actions { display: flex; gap: 2px 14px; flex-wrap: wrap; margin-top: 4px; }
.docs-actions .btn { font-size: 0.85rem; font-weight: 600; }

/* Phones: each document becomes a card. */
@media (max-width: 700px) {
  .docs-table, .docs-table tbody, .docs-table tr, .docs-table td, .docs-table tbody th { display: block; }
  .docs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .docs-table tr { padding: 12px 0; border-bottom: 1px solid var(--viz-grid); }
  .docs-table td, .docs-table tbody th { padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  .docs-table td[data-label="Uploaded"], .docs-table td[data-label="By"] { white-space: normal; }
  .docs-table td[data-label="Description"], .docs-table td[data-label="Uploaded"], .docs-table td[data-label="By"], .docs-table td[data-label="Size"] {
    display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 8px; font-size: 0.9rem;
  }
  .docs-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 0.82rem; }
  .docs-table td.num { text-align: left; }
  .docs-table tbody th { padding-bottom: 6px; }
  .docs-when { display: block; }
  .docs-when .hint { display: inline; font-size: inherit; color: inherit; }
  .docs-when .hint::before { content: ", "; }
  .docs-head .btn { width: 100%; }
}

/* Save bar */
.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 14px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.status { margin: 0; font-size: 0.92rem; color: var(--primary); font-weight: 600; }

/* Shift rows need about 760px for one line; stack them below that. */
@media (max-width: 760px) {
  .shift-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 8px; }
  .shift-row .field:first-child { grid-column: 1 / -1; }
  .shift-row input[type="time"] { padding-left: 8px; padding-right: 4px; }
  .shift-row .remove-shift { margin-top: 27px; }
  .shift-row .remove-shift span:first-child { display: none; }
  .shift-row .remove-label { display: inline; }
}

@media (max-width: 600px) {
  .section { padding: 20px 16px; }
  .grid, .choices { grid-template-columns: minmax(0, 1fr); }
  .grid .span-2 { grid-column: auto; }
  .row { grid-template-columns: 1fr; }
  .event-item { grid-template-columns: minmax(0, 1fr); }
  .app-nav { gap: 2px 0; flex: 1 1 100%; min-width: 0; }
  .nav-group { gap: 0; }
  .nav-manage { flex: 1 1 100%; padding-left: 0; border-left: 0; }
  /* The bottom bar has the same links; these scroll if still too wide. */
  .nav-label { display: none; }
  .nav-manage { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav-manage a { flex: none; }
  .app-nav a { padding: 6px 6px; font-size: 0.84rem; white-space: nowrap; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shift-choice { grid-template-columns: 22px minmax(0, 1fr); }
  .shift-choice .spots { grid-column: 2; }
  .kpi-value { font-size: 1.6rem; }
  .bar-value { min-width: 0; }
  .shift-bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .shift-bars .meter { grid-column: 1 / -1; grid-row: 2; }
  .tab { flex: 1 1 auto; padding: 8px 5px; font-size: 0.84rem; }
  .tabs { gap: 0; padding: 3px; }
  /* Six tabs don't fit one row on a phone: show two rows of three. */
  .tabs-wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .org-context { grid-template-columns: auto minmax(0, 1fr); }
  .org-context-side { grid-column: 1 / -1; justify-items: start; }
}

/* Very narrow phones: one shift field per line so times aren't cut off. */
@media (max-width: 360px) {
  .shift-row { grid-template-columns: minmax(0, 1fr); }
  .shift-row .remove-shift { margin-top: 0; }
}

/* Very narrow phones: let the header menu wrap rather than overflow. */
@media (max-width: 365px) {
  .app-nav { flex-wrap: wrap; }
}

/* Very narrow phones: the Manage links fit on one row without their label
   (the group is still named "Manage" for screen readers). */
@media (max-width: 350px) {
  .nav-label { display: none; }
}

/* ---------- Hours approval and certificates ---------- */
.hours-row .badge { font-size: 0.78rem; }
.hours-reason { margin: 4px 0 0; color: var(--danger); font-size: 0.9rem; overflow-wrap: anywhere; }
.inline-form { flex-basis: 100%; margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.inline-fields .field { flex: 1 1 120px; min-width: 0; }
.inline-fields input[type="number"] { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--input-border); border-radius: 10px; }
.inline-form .error { margin: 6px 0 0; }
.inline-form .fill-row { margin-top: 10px; }
.person .inline-form { grid-column: 1 / -1; }

.certs { margin-top: 8px; }
.cert-list { clear: both; list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.cert-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.cert-item .event-meta { margin: 2px 0 0; }
.cert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cert-form { margin-top: 8px; }
.cert-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip-btn { min-height: 36px; padding: 6px 12px; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--input-border); border-radius: 999px; cursor: pointer; }
.chip-btn:hover { border-color: var(--primary); }
.cert-coverage { margin: 10px 0; font-weight: 600; }
.cert-coverage:empty { display: none; }

.cert-tools { margin: 4px 0 16px; }
.cert-pages { display: grid; gap: 16px; }
.cert-page { display: block; width: 100%; max-width: 820px; height: auto; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); background: #fff; }
.cert-text { margin-top: 20px; }
.cert-text summary { cursor: pointer; font-weight: 600; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cert-table th, .cert-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cert-table td:last-child, .cert-total td { text-align: right; white-space: nowrap; }
.cert-total th, .cert-total td { font-weight: 700; }
@media (max-width: 600px) {
  .cert-table { font-size: 0.84rem; }
  .cert-table th:nth-child(4), .cert-table td:nth-child(4) { display: none; }
}

.verify-result.is-genuine { border-color: var(--primary); }
.verify-result.is-genuine .section-title { color: var(--primary); }
.verify-facts { clear: both; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.verify-facts dt { font-weight: 600; color: var(--muted); }
.verify-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .verify-facts { grid-template-columns: minmax(0, 1fr); }
  .verify-facts dd { margin-bottom: 6px; }
}

.sig-pad { display: block; width: 100%; max-width: 600px; aspect-ratio: 10 / 3; height: auto; background: #fff; border: 1px dashed var(--input-border); border-radius: 10px; touch-action: none; cursor: crosshair; }
.sig-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.sig-saved img { max-height: 64px; max-width: 100%; background: #fff; border-radius: 6px; padding: 4px; }

/* Printing a certificate: just its pages */
@media print {
  body.printing-cert * { visibility: hidden; }
  body.printing-cert .cert-pages, body.printing-cert .cert-pages * { visibility: visible; }
  body.printing-cert .cert-pages { position: absolute; left: 0; top: 0; width: 100%; gap: 0; }
  body.printing-cert .cert-page { max-width: none; border: 0; border-radius: 0; box-shadow: none; page-break-after: always; break-after: page; }
  @page { size: A4; margin: 0; }
}
