/* SCX ALMS - brand: SCX blue #0086CD (main), secondary #0096C8 #006499 #8FE9FF, near-black ink.
   Font: Mundial (load via Adobe Fonts / the supplied OTFs) with Arial as the documented fallback.
   Redesign (22 Sep, Danny's ask - "it looks and feels very 90's"): refreshed tokens (softer shadows,
   larger radii, a real type scale, motion), a left-sidebar app shell instead of a single top bar, and
   modernised cards/buttons/tables/badges/tiles. Every existing class and id name that a template or a
   *.js file selects on is kept exactly as-is - only how things look changed, not what selects them. */
:root {
  --scx: #0086CD; --scx-mid: #0096C8; --scx-deep: #006499; --scx-pink: #8FE9FF;
  --scx-tint: #F1F8FB; --scx-tint-2: #E3F0F7;
  --ink: #18131D; --ink-2: #4A4453; --muted: #7A7484;
  --line: #E7E2EE; --line-2: #D8D1E4; --panel: #F7F5FB; --surface: #FFFFFF;
  /* reserved status colours (dataviz palette) - always shipped with a text label / glyph */
  --st-red: #D0374A; --st-amber: #E9971C; --st-green: #189A56; --st-serious: #EC835A;
  --st-await: #8A6FB0; --st-none: #B9B3C4;
  --st-red-tint: #FCEAEC; --st-amber-tint: #FCF1DE; --st-green-tint: #E4F5EC;
  /* elevation - soft, layered, never a hard 1px border alone doing the work */
  --shadow-sm: 0 1px 2px rgba(24, 19, 29, .06), 0 1px 1px rgba(24, 19, 29, .04);
  --shadow-md: 0 4px 14px rgba(24, 19, 29, .08), 0 1px 3px rgba(24, 19, 29, .06);
  --shadow-lg: 0 12px 32px rgba(24, 19, 29, .14), 0 4px 10px rgba(24, 19, 29, .08);
  --shadow-focus: 0 0 0 4px rgba(0, 100, 153, .16);
  --radius-sm: 8px; --radius: 12px; --radius-lg: 18px; --radius-pill: 999px;
  --gap: 16px; --ease: cubic-bezier(.2, .7, .3, 1); --dur: 160ms;
  --font: "Mundial", Arial, Helvetica, sans-serif;
  --sidebar-w: 240px;
}
* { box-sizing: border-box; }
/* several elements toggled with the plain `hidden` attribute (e.g. #viewdeleted, #selbar) also carry a
   class or id rule that sets `display` with the same CSS specificity as the browser's built-in
   `[hidden] { display: none }` rule, so author-stylesheet order alone would win and leave them visible.
   Force `hidden` to always actually hide, regardless of what else targets the element. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--panel); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; }
a { color: var(--scx-deep); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--scx-mid); }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: 6px; }
h1, h2, h3 { font-weight: 800; line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--scx-tint-2); color: var(--scx-deep); }

/* ---------- shell: left sidebar + main column (collapses to a top bar under 900px) */
.shell { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px; gap: 18px; z-index: 30; }
.sidebar .logo { display: block; padding: 4px 8px 12px; }
.sidebar .logo img { height: 34px; display: block; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); font-weight: 700;
  font-size: .92rem; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.sidebar nav a:hover { background: var(--scx-tint); color: var(--scx-deep); }
.sidebar nav a[aria-current="page"] { background: var(--scx-deep); color: #fff; box-shadow: var(--shadow-sm); }
.sidebar nav a.navback { color: var(--muted); font-weight: 600; font-size: .82rem; padding: 6px 12px 2px; }
.sidebar nav a.navback:hover { background: none; color: var(--scx-deep); }
.sidebar nav .navctx { display: flex; flex-direction: column; gap: 1px; padding: 0 12px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.sidebar nav .navctx-name { font-weight: 800; font-size: 1rem; color: var(--ink); overflow-wrap: anywhere; }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-foot .who { font-size: .85rem; font-weight: 700; display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.sidebar-foot .who .badge { align-self: flex-start; }
.sidebar-foot a, .sidebar-foot form { font-size: .82rem; }
.sidebar-foot form { margin: 0; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wrap { max-width: 1320px; width: 100%; margin: 0 auto; padding: 28px 32px 60px; flex: 1; }
.footer { max-width: 1320px; margin: 0 auto; width: 100%; padding: 0 32px 32px; display: flex; justify-content: space-between; gap: 16px;
  color: var(--muted); font-size: .8rem; }
.footer .group b { color: var(--ink); }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 700; box-shadow: var(--shadow-sm); }
.flash.ok { background: var(--st-green-tint); color: #0b5d0b; } .flash.err { background: var(--st-red-tint); color: #8a1d1d; }
@media (max-width: 900px) {
  /* Stacked rows (logo / nav / user) rather than cramming everything into one horizontal line. */
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: sticky; top: 0; flex-direction: column; align-items: stretch; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--line); gap: 8px; z-index: 30; background: var(--surface); }
  .sidebar .logo { padding: 0 0 2px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 4px; align-items: center; }
  .sidebar nav .navctx { flex-basis: 100%; border-bottom: 0; padding: 0 4px 2px; margin-bottom: 0; flex-direction: row; align-items: baseline; gap: 6px; }
  .sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; border-top: 1px solid var(--line);
    padding-top: 8px; gap: 12px; }
  .sidebar-foot .who { flex-direction: row; align-items: center; gap: 8px; }
  .wrap { padding: 18px 16px 44px; }
  .footer { padding: 0 16px 24px; }
}

/* ---------- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--scx-deep); color: #fff; border: 1px solid var(--scx-deep);
  padding: 9px 18px; border-radius: var(--radius-sm); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease); }
.btn:hover { background: #0082C7; border-color: #0082C7; color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn.ghost { background: transparent; color: var(--scx-deep); border-color: var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: var(--scx-tint); color: var(--scx-deep); border-color: var(--scx); box-shadow: none; transform: none; }
.btn.small { padding: 5px 12px; font-size: .85rem; }
.btn.danger { background: #fff; color: #b02a2a; border-color: #eec2c2; }
.btn.danger:hover { background: var(--st-red-tint); border-color: #e3a3a3; color: #8a1d1d; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 8px 10px; max-width: 100%; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
input:focus, select:focus, textarea:focus { border-color: var(--scx); box-shadow: var(--shadow-focus); outline: none; }
input[type=checkbox], input[type=radio] { accent-color: var(--scx-deep); width: 1.05em; height: 1.05em; }
label { font-weight: 700; font-size: .85rem; display: block; margin-bottom: 4px; color: var(--ink-2); }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: .95rem; color: var(--ink); }
.field { margin-bottom: 14px; } .hint { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.grid { display: grid; gap: var(--gap); } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); } .g6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; } }

/* ---------- cards & tiles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
a.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-2); }
.card h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card h2 .sub { font-weight: 400; color: var(--muted); font-size: .8rem; }
.page-head { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head img.mod { height: 58px; } .page-head .meta { flex: 1; min-width: 240px; }
.page-head .meta .line { color: var(--muted); font-size: .9rem; }
.badge { display: inline-block; padding: 3px 11px; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 700; background: var(--scx-tint); color: var(--scx-deep); }
.badge.warn { background: var(--st-amber-tint); color: #7a5200; }
.badge.claim { background: var(--st-red-tint); color: #8a1414; }
.badge.ai { background: var(--scx-tint-2); color: #006499; }
.badge.edited { background: #E3EEFB; color: #0a3d8f; }
.badge.manual { background: var(--st-green-tint); color: #0a6a0a; }
.badge + .badge { margin-left: 4px; }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.photogrid img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: box-shadow var(--dur) var(--ease); }
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--scx); border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.tile:hover { box-shadow: var(--shadow-md); }
.tile .k { font-size: .78rem; color: var(--ink-2); font-weight: 700; }
.tile .v { font-size: 1.8rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.tile .s { font-size: .78rem; color: var(--muted); }
.tile.red::before { background: var(--st-red); } .tile.amber::before { background: var(--st-amber); } .tile.green::before { background: var(--st-green); }
.tile.await::before { background: var(--st-await); } .tile.none::before { background: var(--st-none); }
.tile.clickable { cursor: pointer; } .tile.clickable:hover { box-shadow: var(--shadow-md); border-color: var(--scx); }
.tile.clickable:focus-visible { outline: 2px solid var(--scx-deep); outline-offset: 2px; }
.tile.clickable .s::after { content: "View list \2192"; display: block; margin-top: 4px; color: var(--scx-deep); font-weight: 700; }

/* ---------- status glyph chips (colour is never the only cue) */
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.st i { width: 10px; height: 10px; display: inline-block; flex: none; }
.st.red i { background: var(--st-red); border-radius: 50%; } .st.amber i { background: var(--st-amber); transform: rotate(45deg) scale(.85); }
.st.green i { background: var(--st-green); border-radius: 2px; } .st.await i { background: var(--st-await); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.st.none i { border: 2px solid var(--st-none); border-radius: 50%; }

/* ---------- filter bar */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 18px;
  position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow-sm); }
.filters .row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filters .f { min-width: 150px; } .filters .f label { margin-bottom: 3px; font-size: .74rem; color: var(--ink-2); }
.filters select[multiple] { display: none; }
.ms { position: relative; }
.ms > button { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 28px 8px 10px; font: inherit; cursor: pointer; position: relative; transition: border-color var(--dur) var(--ease); }
.ms > button::after { content: ""; position: absolute; right: 10px; top: 50%; border: 5px solid transparent; border-top-color: var(--ink-2); transform: translateY(-25%); }
.ms > button.on { border-color: var(--scx-deep); background: var(--scx-tint); font-weight: 700; }
.ms .pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 240px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.ms .pop label { font-weight: 400; font-size: .9rem; display: flex; gap: 8px; align-items: center; padding: 5px 7px; margin: 0; border-radius: var(--radius-sm); cursor: pointer; }
.ms .pop label:hover { background: var(--scx-tint); } .ms .pop .n { margin-left: auto; color: var(--muted); font-size: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 0; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--scx-tint); color: var(--scx-deep); border-radius: var(--radius-pill); padding: 3px 4px 3px 11px; font-size: .8rem; font-weight: 700; }
.chip button { border: 0; background: rgba(0,100,153,.12); color: var(--scx-deep); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-weight: 700; line-height: 1; transition: background var(--dur) var(--ease); }
.chip button:hover { background: rgba(0,100,153,.22); }
.viewcount { margin-left: auto; font-weight: 700; color: var(--scx-deep); align-self: center; }

/* ---------- charts */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-2); font-size: 12px; }
.chart .lbl { fill: var(--ink); font-size: 12px; } .chart .val { fill: var(--ink); font-weight: 700; font-size: 12px; }
.chart .seg { cursor: pointer; transition: filter var(--dur) var(--ease); } .chart .seg:hover { filter: brightness(.92); stroke: var(--ink); stroke-width: 1.5px; }
.chart .grid line { stroke: var(--line); } .chart .base { stroke: var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 10px; font-size: .8rem; }
.legend .st { font-weight: 400; color: var(--ink-2); }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 11px; border-radius: var(--radius-sm); font-size: .8rem; max-width: 280px; box-shadow: var(--shadow-lg); }
.tip b { color: #fff; } .tip .m { color: #d4d4d4; }
.empty { color: var(--muted); padding: 40px 20px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--panel); }

/* ---------- tables */
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); max-height: 620px; box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: .85rem; background: #fff; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { position: sticky; top: 0; background: var(--scx-deep); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; z-index: 2;
  user-select: none; transition: background var(--dur) var(--ease); }
thead th:hover { background: #0082C7; }
thead th.sorted::after { content: " \25B2"; font-size: .7em; } thead th.sorted.desc::after { content: " \25BC"; }
tbody tr { transition: background var(--dur) var(--ease); }
tbody tr:hover { background: var(--scx-tint); } tbody tr.click { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; font-size: .85rem; }

/* ---------- drawer */
.drawer { position: fixed; top: 0; right: 0; width: min(520px, 100vw); height: 100vh; background: #fff; z-index: 60; box-shadow: var(--shadow-lg);
  padding: 24px; overflow: auto; transform: translateX(105%); transition: transform 220ms var(--ease); }
.drawer.open { transform: none; } .drawer h2 { padding-right: 40px; }
.drawer .x { position: absolute; top: 16px; right: 16px; }
.drawer dl { display: grid; grid-template-columns: 170px 1fr; gap: 7px 12px; margin: 0; }
.drawer dt { font-weight: 700; color: var(--ink-2); font-size: .82rem; } .drawer dd { margin: 0; overflow-wrap: anywhere; }
.scrim { position: fixed; inset: 0; background: rgba(24,19,29,.35); backdrop-filter: blur(1px); z-index: 55; display: none; opacity: 0; transition: opacity 220ms var(--ease); }
.scrim.open { display: block; opacity: 1; }

/* ---------- misc */
.login { max-width: 400px; margin: 9vh auto; padding: 32px 30px; }
.login img { width: 240px; display: block; margin: 0 auto 26px; }
.bar { height: 14px; background: var(--scx-tint-2); border-radius: var(--radius-pill); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: var(--radius-pill); transition: width 320ms var(--ease); }
.notice { background: var(--st-amber-tint); border-left: 4px solid var(--st-amber); padding: 12px 16px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 16px; }
.notice.info { background: var(--scx-tint); border-left-color: var(--scx); }
details.f { margin: 10px 0; } details.f summary { cursor: pointer; font-weight: 700; }

/* ---------- guided wizard (wizard.js) */
.wiz-intro { background: var(--scx-tint); border: 1px solid var(--scx); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 20px; }
.wiz-intro h2 { margin-bottom: 6px; }
.wiz-intro ol { margin: 8px 0 0; padding-left: 20px; } .wiz-intro li { margin-bottom: 2px; }
.wiz-dots { display: flex; gap: 4px; margin-bottom: 22px; flex-wrap: wrap; }
.wiz-dot { display: flex; align-items: center; gap: 7px; background: none; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 5px 12px 5px 5px; font: inherit; cursor: pointer; color: var(--ink-2); transition: border-color var(--dur) var(--ease); }
.wiz-dot:disabled { cursor: default; opacity: .5; }
.wiz-dot:not(:disabled):hover { border-color: var(--scx); }
.wiz-dot-n { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex: none; }
.wiz-dot-l { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.wiz-dot.on { border-color: var(--scx-deep); background: var(--scx-tint); color: var(--scx-deep); }
.wiz-dot.on .wiz-dot-n { background: var(--scx-deep); border-color: var(--scx-deep); color: #fff; }
.wiz-dot.done .wiz-dot-n { background: var(--st-green); border-color: var(--st-green); color: #fff; }
.wiz-dot.done .wiz-dot-n::before { content: "\2713"; }
@media (max-width: 700px) { .wiz-dot-l { display: none; } }
.wiz-step { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.wiz-step h2 { margin-bottom: 4px; }
.wiz-why { background: var(--panel); border-left: 4px solid var(--scx); border-radius: var(--radius-sm); padding: 10px 13px; font-size: .87rem; color: var(--ink-2); margin: 6px 0 18px; }
.wiz-why b { color: var(--ink); }
.wiz-controls { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.wiz-count { flex: 1; text-align: center; }
.wiz-review dl { display: grid; grid-template-columns: max-content 1fr; gap: 5px 16px; margin: 0; font-size: .92rem; }
.wiz-review dt { font-weight: 700; color: var(--ink-2); } .wiz-review dd { margin: 0; }
.wiz-final { margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; } legend { font-weight: 700; padding: 0 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }
@media print { .sidebar, .filters, .btn, .pager { display: none !important; } body { background: #fff; } .card { break-inside: avoid; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .drawer, .scrim, .btn, .card, .tile, tbody tr, thead th, .bar > span { transition: none; } }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress .bar { flex: 1; height: 18px; } .progress b { min-width: 3.5em; text-align: right; }
.cardgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .cardgrid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; font-size: .9rem; } .kv dt { font-weight: 700; color: var(--ink-2); } .kv dd { margin: 0; }

#reg td:nth-child(3) { min-width: 240px; } #reg td:nth-child(4), #reg td:nth-child(6) { min-width: 130px; } #reg td:nth-child(12), #reg td:nth-child(13) { white-space: nowrap; }

/* ---------- forward plan */
.plan-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.plan-layout.view { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1000px) { .plan-layout { grid-template-columns: minmax(0, 1fr); } }
.sugg-list { display: grid; gap: 10px; margin-top: 10px; }
.sugg { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: #fff; box-shadow: var(--shadow-sm); }
.sugg h3 { font-size: .95rem; margin: 0 0 4px; }
.sugg p { margin: 0 0 8px; font-size: .84rem; color: var(--ink-2); }
.sugg .facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; margin-bottom: 8px; align-items: center; }
.sugg .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.small { padding: 4px 10px; font-size: .82rem; }
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: stretch; }
.col { flex: 0 0 236px; background: var(--scx-tint); border: 2px solid transparent; border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.col.over { border-color: var(--scx-deep); background: var(--scx-tint-2); }
.col.unsched { background: var(--panel); border: 2px dashed var(--line-2); }
.col header { display: grid; gap: 3px; }
.col header .yr { font-size: 1.15rem; font-weight: 800; color: var(--scx-deep); }
.col header .sp { font-size: .82rem; font-weight: 700; }
.col header .bud { font-size: .76rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.col header .bud input { width: 92px; padding: 3px 6px; font-size: .8rem; }
.col .meter { height: 6px; background: var(--scx-tint-2); border-radius: var(--radius-pill); overflow: hidden; } .col .meter > span { display: block; height: 100%; background: var(--scx-mid); }
.col .meter.over > span { background: var(--st-red); }
.col .warn { color: #9a1f1f; font-weight: 700; font-size: .78rem; }
.col .warn::before { content: "\25B2  "; }
.cc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 11px; cursor: default; box-shadow: var(--shadow-sm); transition: box-shadow var(--dur) var(--ease); }
.cc:hover { box-shadow: var(--shadow-md); }
.cc[draggable="true"] { cursor: grab; } .cc.dragging { opacity: .45; }
.cc .top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.cc .nm { font-weight: 700; font-size: .9rem; line-height: 1.25; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--ink); font-family: inherit; }
.cc .nm:hover { color: var(--scx-deep); text-decoration: underline; }
.cc .meta { font-size: .8rem; color: var(--ink-2); margin: 4px 0; }
.cc .rag { display: flex; gap: 10px; font-size: .78rem; margin: 4px 0; }
.cc .foot { font-size: .75rem; color: var(--muted); }
.cc select { width: 100%; margin-top: 6px; font-size: .8rem; padding: 3px 4px; }
.cc .whensel { display: flex; gap: 6px; margin-top: 6px; }
.cc .whensel select { width: auto; flex: 1; min-width: 0; margin-top: 0; }
.pill { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
.pill.Draft { border: 1px dashed var(--muted); color: #55555c; background: #fff; }
.pill.Proposed { background: var(--scx-tint); color: var(--scx-deep); border: 1px solid var(--scx); }
.pill.Agreed { background: var(--scx-deep); color: #fff; }
.pill.Complete { background: var(--st-green-tint); color: #0a6a0a; border: 1px solid #7ccf7c; } .pill.Complete::before { content: "\2713  "; }
.pill.schedule { background: var(--panel); color: var(--ink-2); border: 1px solid var(--line-2); }
.pill.visit { background: var(--scx-tint); color: var(--scx-deep); border: 1px solid var(--scx); }
.projgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

/* ---------- campaign builder: filterable register -> drag onto a campaign lane */
.buildlayout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; margin-bottom: 16px; }
@media (max-width: 1100px) { .buildlayout { grid-template-columns: minmax(0, 1fr); } }
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; max-height: 720px; overflow-y: auto; padding: 4px; border-radius: var(--radius); transition: background var(--dur) var(--ease); }
.pool.over { background: var(--scx-tint); }
.pc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.pc:hover { box-shadow: var(--shadow-md); }
.pc.dragging { opacity: .4; }
.pc.assigned { opacity: .6; }
.pc .d { font-size: .82rem; font-weight: 700; margin: 4px 0 2px; line-height: 1.25; }
.pc .s { font-size: .74rem; color: var(--muted); }
.pc .in { font-size: .72rem; color: var(--scx-deep); font-weight: 700; margin-top: 3px; }
.lanes { display: flex; flex-direction: column; gap: 10px; max-height: 760px; overflow-y: auto; padding: 2px; }
.lane { background: var(--scx-tint); border: 2px solid transparent; border-radius: var(--radius); padding: 12px; transition: border-color var(--dur) var(--ease); }
.lhead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.lname { flex: 1; min-width: 0; font-weight: 800; font-size: .95rem; border: 1px solid transparent; background: none; border-radius: var(--radius-sm); padding: 3px 6px; font-family: inherit; }
.lname:hover, .lname:focus { border-color: var(--line-2); background: #fff; }
.lmembers { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; margin: 8px 0; padding: 8px; background: #fff; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.lmembers.over { border-color: var(--scx-deep); background: var(--scx-tint-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px 6px 3px 9px; font-size: .78rem; cursor: grab; }
.chip.dragging { opacity: .4; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip .dot.red { background: var(--st-red); } .chip .dot.amber { background: var(--st-amber); } .chip .dot.green { background: var(--st-green); }
.chip button { border: 0; background: none; cursor: pointer; font-size: .95rem; line-height: 1; color: var(--muted); padding: 0 2px; }
.chip button:hover { color: #9a1f1f; }
.lfoot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- SAMS: combined 3-year programme (month-by-month board, reuses .board/.col/.cc from the forward plan) */
.board.months .col { flex: 0 0 188px; min-height: 90px; max-height: 640px; overflow-y: auto; }
.pcard .top { flex-wrap: wrap; gap: 4px; }
.pcard .btn.small, .pcard .btn.ghost.small { padding: 3px 8px; font-size: .76rem; }
.formgrid { display: grid; gap: 10px; margin: 12px 0; }
.formgrid label { display: grid; gap: 3px; font-weight: 700; font-size: .82rem; }
.formgrid input, .formgrid select, .formgrid textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-weight: 400; }
.members { width: 100%; font-size: .82rem; } .members td { padding: 6px 8px; } .members button { padding: 1px 7px; }
.addsearch { position: relative; } .addres { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 4px; max-height: 190px; overflow: auto; background: #fff; box-shadow: var(--shadow-md); }
.addres button { display: flex; width: 100%; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 7px 9px; cursor: pointer; font: inherit; font-size: .82rem; border-bottom: 1px solid var(--line); }
.addres button:hover { background: var(--scx-tint); }
.livemsg { min-height: 1.3em; font-size: .85rem; margin: 4px 0 8px; } .livemsg.err { color: #9a1f1f; font-weight: 700; }
.drawer.wide { width: min(620px, 100vw); }

/* ---------- POMS page: lean header, collapsible filters */
.headline { font-size: 1.15rem; line-height: 1.5; margin: 0 0 16px; max-width: 70ch; }
.filters .fhead { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.filters .fhead .chips { margin: 0; flex: 1; min-width: 120px; }
.filters .row { margin-top: 12px; }
#ftoggle::after { content: "\25BE"; margin-left: 4px; } #ftoggle[aria-expanded="true"]::after { content: "\25B4"; }
#ftoggle.on { background: var(--scx-tint); }
details.more { margin: 0 0 18px; } details.more > summary { cursor: pointer; font-weight: 700; color: var(--scx-deep); padding: 6px 0; }
details.more[open] > summary { margin-bottom: 8px; }
.plancard h2 { margin-bottom: 4px; }
.healthbanner { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-left-width: 8px; border-radius: var(--radius-lg); padding: 18px 22px; background: #fff; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.healthbanner.Red { border-left-color: var(--st-red); } .healthbanner.Amber { border-left-color: var(--st-amber); } .healthbanner.Green { border-left-color: var(--st-green); } .healthbanner.na { border-left-color: var(--st-none); }
.healthbanner .big { font-size: 1.9rem; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.healthbanner .sent { color: var(--ink-2); max-width: 60ch; }
.modrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.modcard .st { font-size: 1rem; } .modcard .why { margin: 6px 0 12px; }
.attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.attn li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 4px 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; }
.attn li:last-child { border-bottom: 0; }
.attn .mod { font-size: .72rem; font-weight: 700; color: var(--scx-deep); background: var(--scx-tint); border-radius: var(--radius-sm); padding: 2px 6px; text-align: center; margin-top: 2px; }
.attn .t { font-weight: 700; overflow-wrap: anywhere; } .attn .d { font-size: .84rem; color: var(--ink-2); } .attn .p { font-size: .8rem; color: var(--muted); }
.attn .p.no { color: #9a1f1f; font-weight: 700; }
.clip { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
#ch-proj svg { max-width: 900px; }

/* ---------- register: system tabs, multi-select + bulk edit/delete */
.systabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 14px; }
.systab { font: inherit; font-weight: 700; font-size: .85rem; background: var(--panel); color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 6px 15px; cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease); }
.systab .n { font-weight: 400; color: var(--muted); margin-left: 5px; }
.systab.on { background: var(--scx-deep); color: #fff; border-color: var(--scx-deep); box-shadow: var(--shadow-sm); } .systab.on .n { color: #CBDEE8; }
.systab:hover:not(.on) { border-color: var(--scx); }
#selbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--scx-tint); border: 1px solid var(--scx); border-radius: var(--radius); padding: 9px 14px; margin-bottom: 14px; }
#selbar b { color: var(--scx-deep); }
#selbar .selmsg { font-size: .82rem; color: #9a1f1f; font-weight: 700; }
#reg th.sel, #reg td.sel { width: 30px; text-align: center; }
#reg th.sel input, #reg td.sel input { margin: 0; }
.bulk-note { color: var(--muted); font-size: .8rem; margin: 10px 0 0; }
.delrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.delrow:last-child { border-bottom: 0; }
.delrow .d1 { font-weight: 700; } .delrow .d2 { font-size: .82rem; color: var(--muted); }

/* ---------- SAMS: fleet-wide engineer calendar (5-year plan / resourcing, added 23 Sep) */
.calgrid th:first-child, .calgrid td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 140px; box-shadow: 1px 0 0 var(--line); }
.calgrid thead th:first-child { z-index: 3; background: var(--scx-deep); }
.calgrid td.calcell { min-width: 150px; vertical-align: top; padding: 6px; }
.calchip { display: block; background: var(--scx-tint); border: 1px solid var(--scx); border-radius: var(--radius-sm); padding: 5px 7px; margin-bottom: 4px; font-size: .78rem; line-height: 1.3; color: var(--ink); text-decoration: none; }
.calchip:hover { background: var(--scx-tint-2); }
.calchip .d { font-weight: 700; color: var(--scx-deep); }
.calchip:last-child { margin-bottom: 0; }
