/* ------------------------------------------------------------------ base -- */

:root {
  --bni-red: #cf2030;
  --bni-maroon: #9b1b28;
  --ink: #1b1f24;
  --muted: #6b7480;
  --line: #d8dde3;
  --bg: #f4f6f8;
  --card: #ffffff;
  --accent: #0b5cab;
  --ok: #16794a;
  --warn: #a4680a;
  --err: #b3261e;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font: 15.5px/1.5 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }

.grow { flex: 1; }
.hint { color: var(--muted); font-size: 13px; }
.err-text { color: var(--err); font-size: 13px; min-height: 1.2em; margin-top: .5rem; }

/* ---------------------------------------------------------------- buttons -- */

.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: .45rem .8rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #f0f3f7; }
.btn.small { padding: .34rem .66rem; font-size: 14px; }
.btn.primary { background: var(--bni-red); border-color: var(--bni-red); color: #fff; }
.btn.primary:hover { background: var(--bni-maroon); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon {
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
  line-height: 1.1;
}
.icon:hover { background: #eef1f5; color: var(--ink); }
.icon.danger:hover { background: #fdecea; color: var(--err); }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
}
.badge.warn { background: #fdf3e2; color: var(--warn); }

/* ------------------------------------------------------------------ gate -- */

#gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: linear-gradient(160deg, #2b2f36, #12151a);
  align-items: center;
  justify-content: center;
}
#gate.show { display: flex; }
#gate form {
  background: var(--card);
  padding: 2rem;
  border-radius: 12px;
  width: min(360px, 90vw);
  box-shadow: var(--shadow);
}
#gate h1 { margin: 0 0 .25rem; font-size: 20px; }
#gate p { margin: 0 0 1rem; color: var(--muted); }
#gate input { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; }
#gate .btn { width: 100%; background: var(--bni-red); border-color: var(--bni-red); color: #fff; }

/* ---------------------------------------------------------------- top bar -- */

#topbar {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  padding: .6rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}
.brand { line-height: 1.15; }
.brand span { display: block; font-weight: 700; color: var(--bni-red); letter-spacing: .02em; }
.brand small { color: var(--muted); }

.topbar-group { display: flex; align-items: flex-end; gap: .5rem; }
.topbar-group.right { margin-left: auto; }

.tb { display: flex; flex-direction: column; gap: .15rem; }
.tb > span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tb select, .tb input {
  padding: .35rem .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  min-width: 170px;
}

/* ----------------------------------------------------------------- layout -- */

/* Three view modes. The report is always a pane in the layout, never a modal —
   you look at it while you work and print only when you decide to. */
#layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  align-items: start;
}
body.mode-edit   #print-view { display: none; }
body.mode-split  #layout { grid-template-columns: 240px minmax(0, 1fr) minmax(0, 1fr); }
body.mode-report #layout { grid-template-columns: 280px minmax(0, 1fr); }
body.mode-report #editor { display: none; }

/* segmented Edit / Split / Report control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg button {
  border: 0; background: transparent; padding: .35rem .7rem;
  cursor: pointer; font-size: 13px; border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: #f0f3f7; }
.seg button.on { background: var(--bni-red); color: #fff; }

#sidebar { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 1rem; }

#nav {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .35rem;
  max-height: 58vh;
  overflow: auto;
}
.nav-group {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: .6rem .5rem .25rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .45rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: .35rem .5rem;
  border-radius: 6px;
  cursor: pointer;
}
.nav-item:hover { background: #f0f3f7; }
.nav-item.active { background: #fdeaec; color: var(--bni-maroon); font-weight: 600; }
.nav-item.foreign .nav-label { color: var(--muted); }
.nav-label { flex: 1; font-size: 14px; }
.nav-by { font-size: 10px; color: var(--muted); background: #eef1f5; border-radius: 999px; padding: 0 .35rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; }
.dot.on { background: var(--warn); }

.side-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .8rem;
}
.side-block h3 { margin: 0 0 .5rem; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.chk { display: flex; gap: .45rem; align-items: center; font-size: 14px; padding: .2rem 0; }
.act { font-size: 13px; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.act:last-child { border-bottom: 0; }
.act-time { display: block; color: var(--muted); font-size: 11px; }

/* ----------------------------------------------------------------- editor -- */

#editor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 2rem;
  min-height: 70vh;
  box-shadow: var(--shadow);
}
.empty { color: var(--muted); padding: 4rem 1rem; text-align: center; }

.sec-head { display: flex; align-items: flex-start; gap: 1rem; border-bottom: 2px solid var(--bni-red); padding-bottom: .6rem; margin-bottom: .9rem; }
.sec-head h2 { margin: 0; font-size: 20px; }
.sec-sub { font-size: 13px; color: var(--muted); margin-top: .15rem; }
.sec-actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.help { color: var(--muted); font-size: 14px; margin: -.4rem 0 1rem; }

.sec-body { display: flex; flex-direction: column; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: .2rem; max-width: 640px; }
.field-label { font-size: 13px; font-weight: 600; color: #414b57; }
.inp {
  width: 100%;
  padding: .42rem .55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.inp:focus { outline: 2px solid #cfe0f5; border-color: var(--accent); }
.inp:disabled { background: #f5f6f8; color: var(--muted); }
textarea.inp { resize: vertical; min-height: 2.4rem; }

/* editable tables */
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; background: #fbfcfd; }
.tbl-wrap > .field-label { margin-bottom: .4rem; display: block; }
.edit-tbl { width: 100%; border-collapse: collapse; }
.edit-tbl th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  padding: 0 .3rem .3rem;
  font-weight: 600;
}
.edit-tbl td { padding: 2px .15rem; vertical-align: top; }
.edit-tbl .rownum { width: 30px; color: var(--muted); text-align: center; padding-top: .5rem; }
.edit-tbl .rowact { width: 78px; }
.row-btns { display: flex; gap: 1px; padding-top: .25rem; }
.tbl-actions { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }

.edit-tbl.stacked td.stack-cell {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: .6rem;
  margin-bottom: .5rem;
}
.stack-head { display: flex; align-items: center; font-weight: 600; color: var(--muted); font-size: 12px; }
.stack-line { display: grid; grid-template-columns: 130px 1fr; gap: .5rem; align-items: start; margin-top: .35rem; }
.stack-line > span { font-size: 12px; color: #414b57; padding-top: .35rem; }

/* -------------------------------------------------- traffic-light uploader -- */

.tool-panel {
  border: 1px solid var(--line);
  border-left: 3px solid var(--bni-red);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: .8rem 1rem;
  margin-bottom: .8rem;
}
.tool-head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .5rem; }
.tool-steps { margin: 0 0 .75rem; padding-left: 1.2rem; font-size: 13px; color: #414b57; }
.tool-steps li { margin-bottom: .15rem; }

.drop-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: .7rem .8rem;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #f4f8fd; }
.drop.ok { border-style: solid; border-color: var(--ok); background: #f3faf6; }
.drop.bad { border-style: solid; border-color: var(--err); background: #fdf4f3; }
.drop-label { font-weight: 600; font-size: 13px; }
.drop-info { font-size: 12px; color: var(--muted); word-break: break-word; }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.tool-actions { display: flex; align-items: flex-end; gap: .6rem; margin-top: .7rem; flex-wrap: wrap; }

/* --------------------------------------------------------------- sign-off -- */

.tool-panel.signoff { border-left: 4px solid var(--muted); }
.tool-panel.signoff.pending { border-left-color: var(--warn); background: #fffbf2; }
.tool-panel.signoff.approved { border-left-color: var(--ok); background: #f4faf6; }

.snapshot-list { margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.snapshot-list h4 { margin: 0 0 .5rem; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.snap {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; margin-bottom: .4rem; font-size: 14px;
}
.snap-main { flex: 1; }
.snap-btns { display: flex; gap: .35rem; }

/* status chips + row tints, shared by the tracker table */
.chip-status { font-size: 11px; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); }
.ap-open      { background: #eef2f7; }
.ap-in-progress { background: #eaf1fa; }
.ap-done      { background: #eaf7ef; }
.ap-dropped   { background: #f3f3f3; color: var(--muted); }
.ap-deferred  { background: #fdf6e7; }

/* ---------------------------------------------------------------- tracker -- */

.tracker-scroll { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; margin-top: .7rem; }
.tracker-tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.tracker-tbl th {
  position: sticky; top: 0; z-index: 1;
  background: #f0f3f7; text-align: left; font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  padding: .4rem .5rem; border-bottom: 1px solid var(--line);
}
.tracker-tbl td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tracker-tbl tr:last-child td { border-bottom: 0; }
.tracker-tbl .nowrap { white-space: nowrap; }
.tracker-tbl td:nth-child(4) { font-variant-numeric: tabular-nums; }
.carried { font-size: 11px; color: var(--muted); font-style: italic; }

/* -------------------------------------------------- region chapter growth -- */

.tool-details { margin-bottom: .8rem; }
.tool-details > summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: .2rem 0; }
.drop.wide { display: block; }
.ok-line { font-size: 13px; color: var(--ok); padding: .2rem 0; }
.warn-line { font-size: 12px; color: var(--warn); padding: .1rem 0; }

/* one filter row above everything it scopes */
.chart-controls { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .7rem; }
.chart-controls .inp { min-width: 130px; }

.picker-wrap { margin-bottom: .9rem; }
.chapter-picker { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: .25rem .7rem; font-size: 13px; cursor: pointer; color: #414b57;
}
.chip:hover { background: #f0f3f7; }
.chip.on {
  border-color: var(--chip); color: #16202b; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--chip);
}
/* the colour sits on a mark beside the label, never on the text itself */
.chip.on::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--chip); margin-right: .35rem; vertical-align: -1px;
}

.chart-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: .8rem .9rem 1rem; margin-bottom: .9rem;
}
.chart-head { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.chart-head h3 { margin: 0; font-size: 15px; }

.chart-legend { display: flex; flex-wrap: wrap; gap: .1rem 1rem; margin: .5rem 0 .2rem; font-size: 12px; color: #414b57; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.chart-plot { position: relative; }
.growth-chart { width: 100%; height: auto; display: block; overflow: visible; }
.growth-chart .grid { stroke: #e7eaee; stroke-width: 1; }
.growth-chart .axis { stroke: #c9cfd6; stroke-width: 1; }
.growth-chart .zero { stroke: #9aa3ad; stroke-width: 1; }
.growth-chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.growth-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* a 2px surface ring keeps overlapping points readable */
.growth-chart .dot { stroke: #fff; stroke-width: 2; }
.growth-chart .direct { fill: #414b57; font-size: 11px; font-weight: 600; }

.chart-tip {
  position: absolute; top: 8px; pointer-events: none;
  background: #22272e; color: #fff; border-radius: 6px;
  padding: .4rem .55rem; font-size: 12px; opacity: 0;
  transition: opacity .12s; box-shadow: var(--shadow); min-width: 120px;
}
.chart-tip.show { opacity: 1; }
.chart-tip strong { display: block; margin-bottom: .2rem; }
.chart-tip div { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.chart-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-tip b { margin-left: auto; font-variant-numeric: tabular-nums; }
.growth-chart .crosshair { stroke: #9aa3ad; stroke-width: 1; }

.stat-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.stat {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: .5rem .8rem; min-width: 140px;
}
.stat-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 600; }
.stat-value.up, .growth-table .up { color: var(--ok); }
.stat-value.down, .growth-table .down { color: var(--err); }

/* the table twin — every charted value is readable here too */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.growth-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.growth-table th, .growth-table td { padding: .3rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.growth-table thead th { background: #f0f3f7; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); position: sticky; top: 0; }
.growth-table tbody th { text-align: left; font-weight: 600; }
.growth-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.growth-table .swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: .35rem; }

/* ---------------------------------------------------------- print banner -- */

#print-banner { display: none; }
#print-banner.show {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  flex-wrap: wrap;
  background: #16794a; color: #fff;
  padding: .5rem .9rem; font-size: 13px; text-align: center;
}
#print-banner .btn.inline { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); color: #fff; }
#print-banner .btn.inline:hover { background: rgba(255, 255, 255, .28); }
.inline-field { display: flex; flex-direction: column; gap: .15rem; }
.inline-field > span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.small-inp { width: 80px; }
.tool-status { margin-top: .5rem; }
.ok-text { color: var(--ok); }

.band-details { margin-bottom: 1rem; font-size: 13px; }
.band-details summary { cursor: pointer; color: var(--muted); }
.band-tbl { border-collapse: collapse; margin: .5rem 0; font-size: 12px; }
.band-tbl th, .band-tbl td { border: 1px solid var(--line); padding: .2rem .5rem; text-align: left; }
.band-tbl thead th { background: #f0f3f7; }

.inp.computed { background: #f2f4f7; color: #5c6673; font-weight: 600; text-align: right; }

/* ------------------------------------------------- generated (read-only) -- */

.generated-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: .7rem .8rem;
}
.generated-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.badge.lock { background: #eaf1fa; color: #29527f; font-weight: 600; }
.empty.small { padding: 1.5rem 1rem; font-size: 13px; }

/* The preview reuses the printed markup, scaled up for the screen. */
.mtl-preview { overflow-x: auto; }
.mtl-preview .grid { font-size: 13px; table-layout: auto; margin-bottom: .6rem; }
.mtl-preview .grid th,
.mtl-preview .grid td { border: 1px solid var(--line); padding: 4px 8px; white-space: nowrap; }
.mtl-preview .grid thead th { background: #f0f3f7; font-size: 12px; position: sticky; top: 0; }
.mtl-preview .grid tbody td:first-child { white-space: nowrap; }
.mtl-preview .pt-col { background: rgba(0, 0, 0, .04); }
.mtl-preview .total-col { font-weight: 700; }
.mtl-preview .legend { font-size: 12px; margin: .4rem 0 .8rem; }
.mtl-preview .legend .chip {
  display: inline-block; width: 12px; height: 12px;
  border: 1px solid var(--line); vertical-align: -2px; margin-right: 3px;
}
.mtl-preview .bands { font-size: 11px; }
.mtl-preview .mtl-footer { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.mtl-preview .mtl-footer .legend { white-space: nowrap; }
.mtl-preview .mtl-footer .bands { flex: 1 1 260px; }

/* --------------------------------------------------------------- save bar -- */

#save-bar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  background: #22272e;
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 999px;
  display: flex;
  gap: .75rem;
  align-items: center;
  box-shadow: var(--shadow);
  transition: transform .18s ease;
  z-index: 30;
}
#save-bar.show { transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- toasts -- */

#toasts { position: fixed; top: 70px; right: 1rem; display: flex; flex-direction: column; gap: .4rem; z-index: 80; }
.toast {
  background: #22272e;
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 1;
  transition: opacity .5s;
}
.toast.fade { opacity: 0; }
.toast.err { background: var(--err); }
.toast.warn { background: var(--warn); }

/* ----------------------------------------------------------- report pane -- */

#print-view {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #5a6068;
  box-shadow: var(--shadow);
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 90px);
}

#print-toolbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  background: #22272e;
  color: #fff;
  padding: .45rem .8rem;
  flex: none;
}
#print-toolbar .hint { color: #c6ccd4; }
#print-toolbar .chk.zoom { color: #e6e9ed; font-size: 12px; }
#print-toolbar .print-hint { font-size: 11.5px; color: #b9c0ca; white-space: nowrap; }
#print-toolbar .print-hint strong { color: #e6e9ed; font-weight: 600; }
@media (max-width: 1200px) { #print-toolbar .print-hint { display: none; } }

#print-scroll { overflow: auto; flex: 1; }

/* Shrink the A4 sheets to fit the pane. The sheets keep their real millimetre
   geometry — only the on-screen rendering is scaled, so print is unaffected. */
#print-root { transform-origin: top center; }
body.fit-width #print-root { transform: scale(var(--preview-scale, 1)); }

@media (max-width: 1200px) {
  /* Not enough width for a useful side-by-side; Split collapses to stacked. */
  body.mode-split #layout { grid-template-columns: 240px minmax(0, 1fr); }
  body.mode-split #print-view { grid-column: 1 / -1; position: static; max-height: 70vh; }
}

@media (max-width: 900px) {
  #layout { grid-template-columns: 1fr; }
  #sidebar { position: static; }
  #nav { max-height: none; }
  body.mode-split #layout, body.mode-report #layout { grid-template-columns: 1fr; }
  #print-view { position: static; max-height: 70vh; }
}


/* --------------------------------------------------- text size + page fit -- */

.size-pick { margin-top: .6rem; }
.size-pick select { width: 100%; }

.fit-warning { display: none; }
.fit-warning.show {
  display: block;
  margin-top: .6rem;
  padding: .45rem .6rem;
  border-left: 3px solid var(--warn);
  background: #fdf6e7;
  color: #6b4a06;
  font-size: 13px;
  border-radius: 0 6px 6px 0;
}

/* A rate pair that does not total 100. Amber, not red: the figures are usable,
   they just disagree with each other and someone should say which is right. */
.rate-warn {
  margin: 10px 0 0;
  padding: 7px 10px;
  border-left: 3px solid #d9a531;
  background: #fdf5e4;
  color: #6b4e12;
  font-size: 12.5px;
  border-radius: 3px;
}

/* ------------------------------------------------ visitor registrations --*/

.reg-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.reg-bar .seg { display: flex; gap: 6px; }

.reg-card {
  border: 1px solid #dfe3ea; border-left: 3px solid #b9c0cb; border-radius: 9px;
  background: #fff; padding: 12px 14px; margin-bottom: 9px;
}
.reg-card.st-attended { border-left-color: #14653f; }
.reg-card.st-declined { border-left-color: #9aa1ae; opacity: .68; }
.reg-card.st-new      { border-left-color: #cf2030; }

.reg-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.reg-head strong { font-size: 15px; }
.reg-co { color: #39404e; }
.reg-pos { color: #6b7280; font-size: 13px; }
.reg-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.reg-card .badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #eef1f6; color: #39404e; font-weight: 600; }
.reg-card .badge.st-new { background: #fdeef0; color: #97161f; }
.reg-card .badge.st-attended { background: #e6f4ec; color: #14653f; }
.reg-card .badge.st-declined { background: #f0f1f3; color: #5c6373; }
.reg-card .badge.card { background: #e9f0fb; color: #2a5fa8; }

.chip-toggle {
  font: inherit; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px;
  border: 1px solid #e0c98a; background: #fdf5e4; color: #8a5d04; cursor: pointer;
}
.chip-toggle.on { background: #e6f4ec; border-color: #a9d6bd; color: #14653f; }

.reg-meta { font-size: 12.5px; color: #6b7280; margin-top: 5px; }
.reg-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.reg-actions .inp.small { width: auto; min-width: 150px; padding: 5px 8px; font-size: 13px; }
.reg-done { margin-top: 8px; font-size: 12.5px; color: #14653f; font-weight: 600; }
