/* PL+ Pulse. Meliora design system, web translation.
   Flat throughout. No shadows, no gradients, no glows. Hairlines only. */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Roca Two Light';
  src: url('assets/fonts/RocaTwo-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('assets/fonts/InstrumentSans-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('assets/fonts/InstrumentSans-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('assets/fonts/InstrumentSans-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fira Code';
  src: url('assets/fonts/FiraCode-VariableFont_wght.woff2') format('woff2-variations');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Colour */
  --sand: #F1F4ED;
  --sand-elevated: #F8FAF4;
  --teal-800: #143234;
  --teal-900: #0E2526;
  --stone-700: #3A4042;
  --stone-500: #606266;
  --ochre: #C6463C;
  --ochre-500: #D75A4A;
  --orange: #EA7943;
  --orange-soft: #FCE7D9;
  --divider: #B8B9BC;
  --divider-dark: #3F4448;
  --sage: #859363;
  --soft-teal: #7FB1B7;

  /* Type */
  --font-display: 'Roca Two Light', Georgia, serif;
  --font-body: 'Instrument Sans', Calibri, sans-serif;
  --font-mono: 'Fira Code', Consolas, monospace;

  /* Shape */
  --shadow-soft: 0 8px 24px rgba(14, 37, 38, 0.10), 0 2px 6px rgba(14, 37, 38, 0.06);
  --radius-card: 14px;
  --radius-control: 10px;   /* filters and inputs, per MvSE */
  --radius-menu: 12px;
  --radius-option: 8px;
  --radius-tile: 10px;
  --radius-pill: 999px;

  /* Rhythm */
  --gap: 16px;
  --pad-card: 18px;
  --nav-w: 212px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--sand);
  color: var(--teal-800);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--ochre); text-decoration: none; }
a:hover { color: var(--ochre-500); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 300; }
p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- Type helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--orange);
}
.caption { font-size: 12px; color: var(--stone-500); }
.lede { font-family: var(--font-display); font-weight: 300; font-size: 18px; color: var(--orange); }
.view-heading { font-family: var(--font-display); font-weight: 300; font-size: 28px; color: var(--teal-800); }
.numeral { font-family: var(--font-display); font-weight: 300; font-size: 32px; color: var(--teal-800); line-height: 1.1; }
.mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--stone-500);
}

/* ---------- Left nav ---------- */
.app { display: flex; align-items: stretch; min-height: 100vh; }
.app__main { flex: 1; min-width: 0; }

.sidenav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--nav-w);
  background: var(--teal-900);
  display: flex;
  flex-direction: column;
  padding: 22px 0 20px;
  z-index: 40;
}
.app__main { margin-left: var(--nav-w); }

.sidenav__brand { display: flex; align-items: baseline; gap: 8px; padding: 0 20px 24px; }
.sidenav__logo { height: 17px; width: auto; display: block; transform: translateY(2px); }
.sidenav__title { font-family: var(--font-display); font-weight: 300; font-size: 19px; color: var(--sand); line-height: 1; }

.sidenav__links { display: flex; flex-direction: column; gap: 2px; }
.sidenav__links a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--sand);
  opacity: 0.72;
  border-left: 2px solid transparent;
  transition: opacity 120ms ease, color 120ms ease;
}
.sidenav__links a:hover { opacity: 1; color: var(--sand); }
.sidenav__links a[aria-current='page'] {
  opacity: 1;
  color: var(--ochre-500);
  border-left-color: var(--orange);
}
.sidenav__icon { width: 18px; height: 18px; flex: none; display: block; }

.sidenav__foot {
  margin-top: auto;
  display: flex; align-items: flex-start; gap: 9px;
  padding: 18px 20px 0;
  border-top: 1px solid var(--divider-dark);
  font-size: 13px; color: var(--sand);
}
.sidenav__foot .live-dot { margin-top: 3px; }
.sidenav__clock { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidenav__live { color: var(--sand); }
.sidenav__time {
  font-family: var(--font-mono); font-size: 13px; color: var(--orange);
  font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.sidenav__date { font-size: 11px; color: var(--sand); opacity: 0.62; }

.spacer { flex: 1; }

/* Live dot: 7px orange dot, 12px halo at 18%, 2s pulse */
.live-dot { position: relative; width: 12px; height: 12px; display: inline-block; flex: none; }
.live-dot::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--orange); opacity: 0.18; animation: halo 2s ease-in-out infinite;
}
.live-dot::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--orange);
}
@keyframes halo {
  0%, 100% { transform: scale(1); opacity: 0.18; }
  50% { transform: scale(1.5); opacity: 0.06; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot::before { animation: none; }
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: var(--sand-elevated);
  border-bottom: 1px solid var(--divider);
  position: sticky; top: 0; z-index: 30;
}

/* Competition picker */
.leaguepick { position: relative; }
.leaguepick__button {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--divider);
  background: var(--sand);
  font-size: 14px; color: var(--teal-800);
  transition: background 120ms ease;
}
.leaguepick__button:hover { background: var(--orange-soft); }
.crest-tile {
  width: 26px; height: 26px; flex: none;
  border-radius: 7px;
  background: var(--sand);
  border: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.crest-tile img { width: 18px; height: 18px; object-fit: contain; display: block; }
.leaguepick__button .crest-tile { width: 24px; height: 24px; border-radius: 6px; }
.leaguepick__button .crest-tile img { width: 16px; height: 16px; }
/* Same stroked chevron as the filter selects, so the controls match. */
.leaguepick__button .chev {
  width: 10px; height: 7px; margin-left: 4px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1.5 5 5.5 9 1.5' fill='none' stroke='%23606266' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 10px 7px;
  transition: transform 140ms ease;
}
.leaguepick__button:hover .chev {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1.5 5 5.5 9 1.5' fill='none' stroke='%23EA7943' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.leaguepick__button[aria-expanded='true'] .chev { transform: rotate(180deg); }

.leaguepick__menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 260px;
  background: var(--sand);
  border: 1px solid var(--divider);
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-soft);
  padding: 6px;
  z-index: 45;
}
.leaguepick__menu button {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 8px 10px;
  border-radius: var(--radius-option);
  font-size: 14px; color: var(--teal-800);
  text-align: left;
}
.leaguepick__menu button:hover { background: var(--orange-soft); }
.leaguepick__menu button[aria-selected='true'] { background: var(--teal-800); color: var(--sand); }

.leaguepick__menu .dormant-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--divider);
  margin-left: auto; flex: none;
}
.leaguepick__menu button.is-dormant { color: var(--stone-500); }
.leaguepick__menu button.is-dormant .crest-tile { opacity: 0.6; }

/* Signed-in account */
.account { display: flex; align-items: center; gap: 12px; }
.account__who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.account__name { font-size: 13px; color: var(--teal-800); }
.account__email { font-size: 11px; color: var(--stone-500); }

/* Search */
.searchbox { position: relative; display: inline-flex; align-items: center; }
.searchbox img { position: absolute; left: 12px; width: 14px; height: 14px; opacity: 0.7; pointer-events: none; }
.searchbox input.field { padding-left: 32px; width: 220px; }
.searchbox input.field::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Sign in ---------- */
.signin {
  position: fixed; inset: 0;
  background: var(--sand);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 100;
  overflow-y: auto;
}
.signin__card {
  width: 100%; max-width: 400px;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--divider);
  background: var(--sand-elevated);
  box-shadow: var(--shadow-soft);
}

/* The panel carries the brand: flat deep teal, no gradient. */
.signin__panel {
  background: var(--stone-700);
  padding: 30px 30px 26px;
  text-align: center;
}
/* Logo and wordmark share a baseline, so it reads as one lockup. */
.signin__brand {
  display: inline-flex; align-items: baseline; gap: 9px;
  margin-bottom: 24px;
}
.signin__logo { height: 20px; width: auto; display: block; transform: translateY(2px); }
.signin__product {
  font-family: var(--font-display); font-weight: 300; font-size: 21px;
  color: var(--sand); line-height: 1;
}
.signin__title {
  font-family: var(--font-display); font-weight: 300; font-size: 26px;
  color: var(--sand); margin-bottom: 8px;
}
.signin__lede { font-size: 13px; color: var(--sand); opacity: 0.72; margin-bottom: 20px; line-height: 1.5; }
.signin__to { color: var(--orange); opacity: 1; }

.signin .signin__field {
  width: 100%; margin-bottom: 12px;
  background: rgba(241, 244, 237, 0.08);
  border: 1px solid rgba(241, 244, 237, 0.28);
  color: var(--sand);
  text-align: center;
}
.signin .signin__field::placeholder { color: var(--sand); opacity: 0.45; }
.signin .signin__field:focus { border-color: var(--orange); }
.signin__submit { width: 100%; }

/* One box per digit, as on the reference, in brand shapes. */
.otp { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.otp__box {
  width: 46px; height: 54px;
  border-radius: var(--radius-tile);
  border: 1px solid rgba(241, 244, 237, 0.30);
  background: rgba(241, 244, 237, 0.08);
  color: var(--sand);
  font-family: var(--font-mono); font-size: 22px; text-align: center;
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.otp__box:focus { border-color: var(--orange); background: rgba(241, 244, 237, 0.14); }
.otp__box.is-filled { color: var(--orange); border-color: rgba(241, 244, 237, 0.42); }
.otp.is-wrong .otp__box { border-color: var(--ochre-500); }
@media (max-width: 400px) {
  .otp { gap: 6px; }
  .otp__box { width: 40px; height: 48px; font-size: 19px; }
}

.signin__resend { font-size: 12px; color: var(--sand); opacity: 0.72; margin-top: 14px; }
.signin__resend button { color: var(--orange); font-size: 12px; }
.signin__resend button:hover { color: var(--ochre-500); }
.signin__resend button[disabled] { color: var(--sand); opacity: 0.5; cursor: default; }
.signin__back {
  display: block; width: 100%; margin-top: 14px;
  font-size: 12px; color: var(--sand); opacity: 0.6;
}
.signin__back:hover { opacity: 1; }
.signin__error {
  margin-top: 16px; font-size: 12px; color: var(--ochre-500);
}
.signin__foot {
  padding: 13px 20px;
  text-align: center;
  font-size: 11px; color: var(--stone-500);
  border-top: 1px solid var(--divider);
}

@media (max-width: 900px) {
  .topbar { padding: 9px 14px; gap: 10px; position: static; }
  .account__who { display: none; }
  .searchbox input.field { width: 100%; }
  .searchbox { flex: 1; min-width: 160px; }
}

/* ---------- Discussion ---------- */
.discussion-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); align-items: start; }
.discussion-col { display: flex; flex-direction: column; gap: 10px; }
.discussion-col__head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.discussion-col__name { font-size: 14px; font-weight: 600; color: var(--teal-800); }
.discussion-col__count { font-size: 12px; color: var(--stone-500); }
.post { display: flex; gap: 11px; }
.post__body { flex: 1; min-width: 0; }
.post__tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.post__text { font-size: 13px; color: var(--teal-800); }
.post__meta { margin-top: 8px; font-size: 12px; color: var(--stone-500); }

/* ---------- Layout ---------- */
.shell { max-width: 1400px; margin: 0 auto; padding: 26px 24px 40px; }
.view-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.footer {
  border-top: 1px solid var(--divider);
  margin-top: 36px;
  padding: 16px 24px 26px;
  text-align: left;
  max-width: 1400px;
  margin-left: auto; margin-right: auto;
}

/* ---------- Card primitives ---------- */
.card {
  background: var(--sand-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: var(--pad-card);
}
.icon-tile {
  width: 40px; height: 40px; flex: none;
  border-radius: var(--radius-tile);
  background: var(--orange-soft);
  display: flex; align-items: center; justify-content: center;
}
.icon-tile img { width: 24px; height: 24px; display: block; }
.icon-tile--sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-tile--sm img { width: 18px; height: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  background: var(--sand-elevated);
  color: var(--teal-800);
  border: 1px solid var(--divider);
  transition: background 120ms ease, color 120ms ease;
}
.btn:hover { background: var(--orange-soft); color: var(--teal-800); }
.btn--primary { background: var(--ochre); color: var(--sand); border-color: var(--ochre); }
.btn--primary:hover { background: var(--ochre-500); border-color: var(--ochre-500); color: var(--sand); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--stone-500); height: 28px; padding: 0 10px; font-size: 12px; }
.btn--quiet:hover { background: var(--orange-soft); color: var(--teal-800); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn img { width: 14px; height: 14px; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center;
  height: 19px; padding: 0 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0;
  white-space: nowrap;
}
.pill--workstream { background: var(--orange-soft); color: var(--teal-800); }
.pill--isolated { background: var(--sand); color: var(--divider); }
.pill--repeated { background: var(--sand-elevated); color: var(--stone-700); border: 1px solid var(--divider); }
.pill--widespread { background: var(--sand-elevated); color: var(--ochre); border: 1px solid var(--divider); }
.pill--report { background: var(--sand); color: var(--stone-500); border: 1px solid var(--divider); }
.pill--pinned { background: var(--orange-soft); color: var(--ochre); }
.signal-glyph { font-family: var(--font-mono); font-size: 12px; line-height: 1; }
.signal-glyph--positive { color: var(--ochre); }
.signal-glyph--negative { color: var(--teal-800); }
.signal-glyph--neutral { color: var(--stone-500); }
.signal-glyph--mixed { color: var(--stone-700); }

/* ---------- Monitor: KPI row ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { display: flex; flex-direction: column; gap: 12px; }
.kpi__label { font-size: 11px; color: var(--stone-500); text-transform: none; }

/* ---------- Monitor: two columns ---------- */
.monitor-cols { display: grid; grid-template-columns: 38% 1fr; gap: var(--gap); align-items: start; }

/* The agents column rides with the feed: it stays in view while the feed
   scrolls, and takes its own scrollbar only if it outgrows the viewport. */
.monitor-col--agents {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
}
.monitor-col--agents::-webkit-scrollbar { width: 6px; }
.monitor-col--agents::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 999px; }
.monitor-col--agents::-webkit-scrollbar-track { background: transparent; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }

/* Agent cards */
.agent-list { display: flex; flex-direction: column; gap: 10px; }
.agent-card {
  display: flex; gap: 12px; align-items: flex-start;
  width: 100%; text-align: left;
  background: var(--sand-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: 14px;
  transition: background 120ms ease;
}
.agent-card:hover { background: var(--orange-soft); }
.agent-card[aria-pressed='true'] { background: var(--orange-soft); }
.agent-card__body { flex: 1; min-width: 0; }
.agent-card__name { font-size: 14px; font-weight: 600; color: var(--teal-800); }
.agent-card__state { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--stone-700); margin-top: 5px; }
.agent-card__count { font-size: 12px; color: var(--stone-500); margin-top: 3px; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--orange); }
.state-dot--sweeping { background: var(--ochre); box-shadow: none; position: relative; }
.state-dot--sweeping::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: var(--ochre); opacity: 0.18; animation: halo 2s ease-in-out infinite;
}
.state-dot--failed { background: var(--divider); }
.agent-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

/* Sweep progress shows inside the agent card that is working, rather than as a
   bare rule across the column. Motion only, no gradient or glow. */
.agent-card__scan { height: 2px; background: var(--divider); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.agent-card__scan span { display: block; height: 100%; width: 40%; background: var(--ochre); animation: scan 1.5s ease-in-out infinite; }

/* Arrivals ticker */
.arrivals {
  display: inline-flex; align-items: center; height: 19px; padding: 0 9px;
  border-radius: var(--radius-pill);
  background: var(--orange-soft); color: var(--ochre);
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0;
  animation: slidein 260ms ease both;
}

@media (prefers-reduced-motion: reduce) {
  .agent-card__scan span { animation: none; width: 100%; }
  .arrivals { animation: none; }
}

/* Feed */
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-card { position: relative; display: flex; gap: 12px; }
.feed-card--new { animation: slidein 300ms ease both, flash 1400ms ease 300ms both; }
.feed-card--new .icon-tile { animation: tilepop 380ms ease both; }
@keyframes tilepop { from { transform: scale(0.82); } to { transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes flash { from { background-color: var(--orange-soft); } to { background-color: var(--sand-elevated); } }
@media (prefers-reduced-motion: reduce) {
  .feed-card--new, .feed-card--new .icon-tile { animation: none; }
}
.feed-card__body { flex: 1; min-width: 0; }
.feed-card__tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.feed-card__obs { font-size: 14px; color: var(--teal-800); }
.feed-card__obs.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feed-card__more { font-size: 12px; color: var(--ochre); margin-top: 3px; }
.quote {
  margin: 9px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--ochre);
  font-size: 13px;
  color: var(--stone-700);
  font-style: italic;
}
.feed-card__meta { margin-top: 9px; font-size: 12px; color: var(--stone-500); }
.feed-card__why { margin-top: 6px; font-size: 12px; color: var(--stone-700); }
.feed-card__actions {
  display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap;
  opacity: 0; transition: opacity 120ms ease;
}
.feed-card:hover .feed-card__actions,
.feed-card:focus-within .feed-card__actions { opacity: 1; }
@media (hover: none) { .feed-card__actions { opacity: 1; } }

/* ---------- Insights table ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.field {
  height: 36px; padding: 0 12px;
  background: var(--sand);
  border: 1px solid var(--divider);
  border-radius: var(--radius-control);
  font-size: 13px; color: var(--teal-800);
  outline: none;
}
.field:focus { border-color: var(--orange); }
/* Native select arrows vary by platform, so draw our own in stone. */
select.field,
select.row-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1.5 5 5.5 9 1.5' fill='none' stroke='%23606266' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 7px;
  padding-right: 30px;
  cursor: pointer;
}
select.field:hover, select.row-select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1.5 5 5.5 9 1.5' fill='none' stroke='%23EA7943' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
select.field:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1.5 5 5.5 9 1.5' fill='none' stroke='%23EA7943' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
select.row-select { background-position: right 8px center; padding-right: 24px; }
.toolbar__search { flex: 1; min-width: 180px; max-width: 320px; }
.table-wrap { border: 1px solid var(--divider); border-radius: var(--radius-card); overflow: hidden; background: var(--sand-elevated); }
table.data { width: 100%; border-collapse: collapse; }
table.data thead th {
  background: var(--teal-800);
  color: var(--sand);
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0;
  text-align: left;
  padding: 9px 12px;
  white-space: nowrap;
}
table.data tbody td { padding: 11px 12px; vertical-align: top; font-size: 13px; border-top: 1px solid var(--divider); }
table.data tbody tr:nth-child(even) { background: var(--sand); }
table.data tbody tr:hover { background: var(--orange-soft); cursor: pointer; }
table.data tbody tr.is-dismissed { opacity: 0.5; }
.cell-obs { max-width: none; }

/* Insights table column widths: the observation is the content, everything else
   is a label. */
.table--insights { table-layout: fixed; }
.table--insights th:nth-child(1), .table--insights td:nth-child(1) { width: 40%; }
.table--insights th:nth-child(2), .table--insights td:nth-child(2) { width: 8%; }
.table--insights th:nth-child(3), .table--insights td:nth-child(3) { width: 8%; }
.table--insights th:nth-child(4), .table--insights td:nth-child(4) { width: 8%; }
.table--insights th:nth-child(5), .table--insights td:nth-child(5) { width: 9%; }
.table--insights th:nth-child(6), .table--insights td:nth-child(6) { width: 6%; }
.table--insights th:nth-child(7), .table--insights td:nth-child(7) { width: 10%; }
.table--insights th:nth-child(8), .table--insights td:nth-child(8) { width: 11%; }
.table--insights td { overflow-wrap: break-word; }
.table--insights td:nth-child(2), .table--insights td:nth-child(3),
.table--insights td:nth-child(4), .table--insights td:nth-child(6) { white-space: nowrap; }
.table--insights td:nth-child(5) a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.table--insights .cell-actions { white-space: normal; }
.table--insights .cell-actions .btn { padding: 0 6px; height: 24px; font-size: 11px; }
.cell-obs .quote { margin-top: 6px; font-size: 12px; }
.cell-actions { white-space: nowrap; }
.row-select {
  height: 26px; padding: 0 8px; font-size: 11px;
  border-radius: var(--radius-option);
  border: 1px solid var(--divider);
  background: var(--sand);
  width: 100%; max-width: 100%; min-width: 0;
  box-sizing: border-box;
}
table.data td { overflow: hidden; }

.bidders { display: flex; flex-wrap: wrap; gap: 4px; }
.bidders .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Rights table: long agent prose is trimmed in the cell and kept on the tooltip. */
.rationale { margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.src-link { display: block; overflow-wrap: break-word; }
#rights-body td { vertical-align: top; }
.table--rights { table-layout: fixed; }
.table--rights th:nth-child(1), .table--rights td:nth-child(1) { width: 13%; }
.table--rights th:nth-child(2), .table--rights td:nth-child(2) { width: 22%; }
.table--rights th:nth-child(3), .table--rights td:nth-child(3) { width: 8%; }
.table--rights th:nth-child(4), .table--rights td:nth-child(4) { width: 12%; }
.table--rights th:nth-child(5), .table--rights td:nth-child(5) { width: 8%; }
.table--rights th:nth-child(6), .table--rights td:nth-child(6) { width: 23%; }
.table--rights th:nth-child(7), .table--rights td:nth-child(7) { width: 14%; }
.table--rights td { overflow-wrap: break-word; }
#rights-body td[data-label='Expected bidders'] { max-width: 260px; }

/* ---------- Rights map ---------- */
.map-card { padding: 14px 14px 10px; margin-bottom: var(--gap); }
.map-card__head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.map-card__foot { margin-top: 6px; }
.map-zoom { display: flex; gap: 4px; }
.map-zoom .btn { min-width: 30px; }

.map-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--stone-500); }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.map-stage {
  position: relative;
  background: var(--sand);
  border-radius: var(--radius-tile);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  /* Tall enough that the map is worth zooming into, and that a drag has
     somewhere to go. */
  height: clamp(380px, 60vh, 660px);
}
.map-stage.is-panning { cursor: grabbing; }
#world-map { display: block; width: 100%; height: 100%; }
/* The dots are a 1.05 degree grid, so a bare circle leaves gaps the cursor can
   fall through. A transparent stroke widens the hit geometry past half the grid
   spacing, which makes the whole country hoverable without doubling the element
   count. */
/* Solid country shapes: hover covers the whole territory, and the palette reads
   as one system. Flat fills with a hairline sand border, no gradients. */
#world-map { display: block; width: 100%; height: 100%; }
#world-map .map-sea { fill: var(--sand); }
#world-map path {
  stroke: var(--sand);
  stroke-width: 0.35;
  stroke-linejoin: round;
  transition: fill 110ms ease;
  cursor: pointer;
}
#world-map path.is-marker {
  stroke: var(--sand-elevated);
  stroke-width: 0.8;
}
#world-map path.is-hot {
  fill: var(--teal-800) !important;
  stroke: var(--sand);
  stroke-width: 0.6;
}

.map-tip {
  position: absolute;
  min-width: 210px; max-width: 300px;
  background: var(--teal-900);
  color: var(--sand);
  border-radius: var(--radius-tile);
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  z-index: 5;
}
.map-tip__name { font-family: var(--font-display); font-weight: 300; font-size: 16px; color: var(--sand); }
.map-tip__region { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--orange); letter-spacing: 0; }
.map-tip dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.map-tip dt { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; color: var(--sand); opacity: 0.55; letter-spacing: 0; align-self: start; padding-top: 2px; }
.map-tip dd { margin: 0; color: var(--sand); }
.map-tip__none { margin-top: 6px; opacity: 0.7; }

@media (max-width: 900px) {
  .map-stage { height: clamp(300px, 46vh, 420px); }
  .map-tip { max-width: 220px; }
}

/* ---------- Document picker ---------- */
.docpick { position: relative; }
.docpick__button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 9px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--divider);
  background: var(--sand);
  font-size: 13px; font-weight: 500; color: var(--teal-800);
  text-align: left;
}
.docpick__button:hover { background: var(--orange-soft); }
.docpick__button .sub { display: block; font-size: 11px; font-weight: 400; color: var(--stone-500); margin-top: 2px; }
.docpick__menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--sand);
  border: 1px solid var(--divider);
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-soft);
  padding: 6px; z-index: 60;
}
.docpick__menu button {
  display: block; width: 100%; padding: 8px 10px;
  border-radius: var(--radius-option);
  font-size: 13px; color: var(--teal-800); text-align: left;
}
.docpick__menu button:hover { background: var(--orange-soft); }
.docpick__menu button[aria-selected='true'] { background: var(--sand-elevated); }
.docpick__menu .sub { display: block; font-size: 11px; color: var(--stone-500); margin-top: 2px; }
.docpick__menu .new { border-top: 1px solid var(--divider); margin-top: 6px; padding-top: 10px; color: var(--ochre); }

/* ---------- Dropdown ---------- */
/* Shapes and sizing follow the MvSE dropdown: a rounded rectangle rather than a
   pill, on stone rather than white. The native select stays in the DOM as the
   source of truth and this component drives it. */
.dropdown { position: relative; display: inline-flex; }
.dropdown select { display: none; }

.dropdown__trigger {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0; max-width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--divider);
  background: var(--sand);
  font-size: 13px; font-weight: 500; line-height: 1;
  color: var(--teal-800);
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease;
}
.dropdown__trigger:hover { background: var(--orange-soft); border-color: var(--divider); }
.dropdown__trigger[aria-expanded='true'] { border-color: var(--orange); }
.dropdown__chev {
  width: 10px; height: 7px; flex: 0 0 auto; margin-left: 4px; opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1.5 5 5.5 9 1.5' fill='none' stroke='%23606266' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 10px 7px;
  transition: transform 140ms ease;
}
.dropdown__trigger[aria-expanded='true'] .dropdown__chev { transform: rotate(180deg); opacity: 1; }

.dropdown__menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 100%; width: max-content; max-width: 320px;
  max-height: 340px; overflow-y: auto;
  background: var(--sand);
  border: 1px solid var(--divider);
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-soft);
  padding: 6px;
  z-index: 60;
}
.dropdown__menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px;
  border-radius: var(--radius-option);
  font-size: 13px; color: var(--teal-800);
  line-height: 1.25; text-align: left;
}
.dropdown__menu button:hover { background: var(--orange-soft); }
.dropdown__menu button[aria-selected='true'] { background: var(--sand-elevated); }
.dropdown__menu .tick {
  margin-left: auto; flex: 0 0 auto;
  width: 13px; height: 10px; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='10' viewBox='0 0 13 10'%3E%3Cpath d='M1 5 4.8 8.8 12 1.6' fill='none' stroke='%23C6463C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 13px 10px;
}
.dropdown__menu button[aria-selected='true'] .tick { opacity: 1; }

@media (max-width: 900px) {
  .dropdown__menu { max-width: 260px; }
}

/* ---------- Sort switch ---------- */
.sortswitch {
  display: inline-flex;
  border: 1px solid var(--divider);
  border-radius: var(--radius-control);
  background: var(--sand);
  overflow: hidden;
}
.sortswitch button {
  height: 32px; padding: 0 14px;
  font-size: 12px; color: var(--stone-500);
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}
.sortswitch button:hover { background: var(--orange-soft); color: var(--teal-800); }
.sortswitch button[aria-pressed='true'] { background: var(--teal-800); color: var(--sand); }
.sortswitch button + button { border-left: 1px solid var(--divider); }

@media (max-width: 900px) {
  .sortswitch button { padding: 0 10px; font-size: 11px; }
}

/* ---------- Detail panel ---------- */
.panel-scrim { position: fixed; inset: 0; background: rgba(14, 37, 38, 0.28); z-index: 50; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw;
  background: var(--sand-elevated);
  border-left: 1px solid var(--divider);
  z-index: 51;
  display: flex; flex-direction: column;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.panel__body { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.panel__foot { border-top: 1px solid var(--divider); padding: 14px 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.field-block { margin-bottom: 16px; }
.field-block > .mono-label { display: block; margin-bottom: 5px; }
.field-block input.field, .field-block select.field, .field-block textarea.field {
  width: 100%; border-radius: 10px;
}
.field-block textarea.field { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.45; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Report view ---------- */
.report-cols { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.rail { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; }
.rail__group > .mono-label { display: block; margin-bottom: 8px; }
.outline { display: flex; flex-direction: column; gap: 4px; }
.outline button { text-align: left; font-size: 13px; color: var(--stone-700); padding: 3px 0; }
.outline button:hover { color: var(--ochre); }
.outline .lvl-2 { padding-left: 10px; font-size: 12px; }
.versions { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.versions button { text-align: left; font-size: 12px; color: var(--stone-500); padding: 4px 0; }
.versions button:hover { color: var(--ochre); }
.rail__actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.rail__actions .btn { width: 100%; }

.doc-surface {
  background: var(--sand-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  max-width: 760px;
  padding: 46px 56px 60px;
}
.doc-toolbar {
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  max-width: 760px; margin-bottom: 12px;
  padding: 6px; background: var(--sand-elevated);
  border: 1px solid var(--divider); border-radius: var(--radius-pill);
}
.doc-toolbar button {
  height: 26px; min-width: 30px; padding: 0 9px; border-radius: var(--radius-pill);
  font-size: 12px; color: var(--stone-700);
}
.doc-toolbar button:hover { background: var(--orange-soft); color: var(--teal-800); }
.doc-toolbar button.is-active { background: var(--orange-soft); color: var(--ochre); }
.doc-toolbar .sep { width: 1px; height: 16px; background: var(--divider); margin: 0 4px; }
.save-state { text-align: right; max-width: 760px; margin-top: 8px; }

/* Who else is editing */
.peers { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; min-height: 18px; }
.peer { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--stone-700); }
.peer i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Remote cursors and selections, drawn by CollaborationCursor */
.collaboration-cursor__caret {
  position: relative;
  margin-left: -1px; margin-right: -1px;
  border-left: 1px solid var(--teal-800);
  border-right: 1px solid var(--teal-800);
  word-break: normal;
  pointer-events: none;
}
.collaboration-cursor__label {
  position: absolute; top: -1.45em; left: -1px;
  font-family: var(--font-mono); font-size: 10px; line-height: 1.4;
  color: var(--sand);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  user-select: none;
}

/* Editor content, styled as the Meliora document */
.ProseMirror { outline: none; }
.ProseMirror h1 { font-family: var(--font-display); font-weight: 300; font-size: 32px; color: var(--teal-800); margin: 0 0 6px; }
.ProseMirror h2 {
  font-family: var(--font-display); font-weight: 300; font-size: 22px; color: var(--teal-800);
  margin: 30px 0 8px; padding-top: 16px; border-top: 1px solid var(--divider);
}
.ProseMirror h3 { font-family: var(--font-display); font-weight: 300; font-size: 18px; color: var(--teal-800); margin: 20px 0 6px; }
.ProseMirror p { font-size: 15px; color: var(--teal-800); margin: 0 0 11px; line-height: 1.62; }
.ProseMirror p.subhead, .ProseMirror p[class='subhead'] { font-family: var(--font-display); font-size: 18px; color: var(--orange); font-style: normal; }
.ProseMirror p.subhead em { font-style: normal; }
.ProseMirror blockquote {
  margin: 0 0 12px; padding-left: 14px;
  border-left: 2px solid var(--ochre);
  color: var(--stone-700); font-style: italic;
}
.ProseMirror ul, .ProseMirror ol { margin: 0 0 12px; padding-left: 22px; font-size: 15px; line-height: 1.62; }
.ProseMirror li { margin-bottom: 4px; }
.ProseMirror hr { border: none; border-top: 1px solid var(--divider); margin: 22px 0; }
.ProseMirror a { color: var(--ochre); }
.ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder); float: left; height: 0; pointer-events: none; color: var(--stone-500);
}
.ProseMirror p.evidence-meta { font-size: 12px; color: var(--stone-500); }

/* ---------- Banners, toasts, empties ---------- */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--orange-soft);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: 11px 16px;
  font-size: 13px; color: var(--teal-800);
  margin-bottom: 14px;
}
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--teal-900); color: var(--sand);
  border-radius: var(--radius-pill); padding: 9px 18px; font-size: 13px;
  animation: slidein 220ms ease both;
}
.empty {
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  background: var(--sand-elevated);
  padding: 34px 22px; text-align: center;
  color: var(--stone-500); font-size: 13px;
}

/* ---------- Responsive ---------- */

/* The insights table carries eight columns. Under ~1180px it stops being a
   table worth reading, so it becomes cards well before the layout stacks. */
@media (max-width: 1180px) {
  .table-wrap { border: none; background: transparent; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tbody tr {
    background: var(--sand-elevated); border: 1px solid var(--divider);
    border-radius: var(--radius-card); margin-bottom: 10px; padding: 8px 4px;
  }
  table.data tbody tr:nth-child(even) { background: var(--sand-elevated); }
  table.data tbody td { border-top: none; padding: 5px 14px; }
  table.data tbody td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--stone-500);
    margin-bottom: 2px;
  }
  table.data tbody td.cell-obs::before { display: none; }
  .table--insights, .table--insights th, .table--insights td { width: auto !important; table-layout: auto; }
  .table--rights, .table--rights th, .table--rights td { width: auto !important; table-layout: auto; }
  .rationale { -webkit-line-clamp: unset; display: block; }
  .table--insights td:nth-child(2), .table--insights td:nth-child(3),
  .table--insights td:nth-child(4), .table--insights td:nth-child(6) { white-space: normal; }
  .cell-obs { max-width: none; }
  .cell-actions { display: flex !important; gap: 4px; flex-wrap: wrap; padding-top: 8px !important; }
  .cell-actions::before { display: none; }
  #rights-body td[data-label='Expected bidders'] { max-width: none; }
}

@media (max-width: 900px) {
  .app { display: block; }
  .app__main { margin-left: 0; }
  .sidenav {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .sidenav__brand { flex-direction: row; align-items: baseline; gap: 10px; padding: 0; }
  .sidenav__logo { align-self: center; }
  .sidenav__eyebrow { display: none; }
  .sidenav__links { flex-direction: row; gap: 4px; margin-left: auto; }
  .sidenav__links a { padding: 6px 10px; border-left: none; border-bottom: 2px solid transparent; }
  .sidenav__links a[aria-current='page'] { border-left-color: transparent; border-bottom-color: var(--orange); }
  .sidenav__links a span { display: none; }
  .sidenav__icon { width: 20px; height: 20px; }
  .sidenav__foot { margin-top: 0; padding: 0; border-top: none; width: 100%; align-items: center; }
  .sidenav__clock { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .shell { padding: 20px 14px 32px; }
  .discussion-cols { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .monitor-cols { grid-template-columns: 1fr; }
  .monitor-col--agents { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .report-cols { grid-template-columns: 1fr; }
  .rail { position: static; }
  .rail.is-collapsed { display: none; }
  .doc-surface { padding: 26px 20px 36px; }
  .panel { width: 100%; }
  .table-wrap { border: none; background: transparent; }
  table.data thead { display: none; }
  .table--insights { table-layout: auto; }
  .table--insights th, .table--insights td { width: auto !important; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tbody tr {
    background: var(--sand-elevated); border: 1px solid var(--divider);
    border-radius: var(--radius-card); margin-bottom: 10px; padding: 6px 4px;
  }
  table.data tbody tr:nth-child(even) { background: var(--sand-elevated); }
  table.data tbody td { border-top: none; padding: 5px 12px; }
  table.data tbody td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--stone-500);
    margin-bottom: 2px;
  }
  table.data tbody td.cell-obs::before { display: none; }
  .cell-obs { max-width: none; }
}
.rail-toggle { display: none; }
@media (max-width: 900px) { .rail-toggle { display: inline-flex; margin-bottom: 12px; } }
