/* ============================================================================
   Enercon Africa Opportunity Tracker — design system
   Refined institutional · deep-navy blue · polished light.
   Tokens first, then components. Every class the templates use is styled here.
   ========================================================================== */
:root {
  /* neutrals — cool, navy-biased (chosen, not defaulted) */
  --bg: #f4f7fb;            /* app canvas */
  --panel: #ffffff;         /* cards / surfaces */
  --panel-2: #f8fafd;       /* inset / subtle fills */
  --ink: #111b2e;           /* primary text (navy-black) */
  --ink-soft: #33425c;      /* secondary text */
  --muted: #64748b;         /* tertiary / labels */
  --line: #e6ecf4;          /* hairline borders */
  --line-2: #eef2f8;        /* softer inner rules */

  /* brand — refined blue system */
  --navy-900: #0a2540;
  --navy-800: #0d2f56;
  --navy-700: #123c6e;
  --brand: #123c6e;         /* deep navy — headers/emphasis */
  --brand-green: #17a35a;   /* Africa accent — echoes the logo continent */
  --brand-ink: #ffffff;
  --accent: #2563eb;        /* azure — interactive */
  --accent-600: #1d4ed8;
  --accent-soft: #eef4ff;   /* accent tint */

  /* semantic */
  --hi: #0a7c42;  --hi-bg: #e7f6ee;         /* good / high fit */
  --mid: #9a6b00; --mid-bg: #fbf3e0;        /* warning / mid */
  --lo: #64748b;  --lo-bg: #eef2f7;         /* neutral / low */
  --danger: #b42318;

  /* depth + shape */
  --shadow-sm: 0 1px 2px rgba(16,34,64,.06), 0 1px 3px rgba(16,34,64,.05);
  --shadow: 0 1px 2px rgba(16,34,64,.06), 0 1px 3px rgba(16,34,64,.05);
  --shadow-md: 0 8px 28px -10px rgba(13,47,86,.20), 0 2px 8px rgba(13,47,86,.06);
  --r: 12px;      /* cards */
  --r-sm: 9px;    /* controls */
  --r-xs: 6px;    /* chips */

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, Cambria, ui-serif, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-600); text-decoration: underline; }
h1 { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; margin: 1.6rem 0 .7rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 1.1rem 0 .5rem; }
::selection { background: rgba(37,99,235,.16); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }

/* ---- top bar ------------------------------------------------------------- */
.topbar { display: flex; align-items: center; gap: 1.1rem; background: var(--panel);
  border-bottom: 1px solid var(--line); padding: .7rem 1.5rem;
  position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(16,34,64,.02); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand-mark { height: 38px; width: 38px; display: block; }
.brand-wm { display: flex; flex-direction: column; line-height: 1.05; }
.brand-wm-1 { font-size: 1.02rem; font-weight: 750; letter-spacing: -.02em; color: var(--brand); }
.brand-wm-1 b { color: var(--brand-green, #17a35a); font-weight: 750; }
.brand-wm-2 { font-size: .62rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); margin-top: 1px; }
@media (max-width: 860px) { .brand-wm { display: none; } }
.topbar nav { display: flex; gap: .2rem; margin-left: .4rem; flex-wrap: wrap; }
.topbar nav a { color: var(--ink-soft); font-weight: 600; font-size: .87rem;
  padding: .4rem .7rem; border-radius: var(--r-sm); transition: background .12s, color .12s; }
.topbar nav a:hover { background: var(--line-2); color: var(--navy-900); text-decoration: none; }
.topbar nav a.active { color: var(--navy-900); background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.uname { color: var(--muted); font-weight: 600; font-size: .88rem; }
.logout { font-size: .85rem; }
.role { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em;
  padding: .18rem .5rem; border-radius: 999px; font-weight: 700; }
.role-reviewer { background: var(--lo-bg); color: var(--lo); }
.role-bd, .role-admin { background: var(--accent-soft); color: var(--accent-600); }

/* ---- layout -------------------------------------------------------------- */
.content { max-width: 1180px; margin: 1.9rem auto 3.5rem; padding: 0 1.5rem; }
/* the opportunity board is a wide data table — give it room so no column clips.
   Scoped to the board only (not every page that uses .board-wrap). */
.content:has(.board-wide) { max-width: 1460px; }
.page-title { display: flex; align-items: center; gap: .6rem; }
.page-title .count { font-size: .8rem; font-weight: 700; color: var(--navy-700);
  background: var(--panel); border: 1px solid var(--line); padding: .14rem .6rem;
  border-radius: 999px; }
.lead { color: var(--muted); max-width: 66ch; line-height: 1.55; font-size: .95rem;
  margin: .3rem 0 1.4rem; }

/* ---- buttons ------------------------------------------------------------- */
button, .btn { background: var(--navy-700); color: var(--brand-ink); border: 1px solid transparent;
  padding: .5rem 1rem; border-radius: var(--r-sm); font: inherit; font-weight: 650; font-size: .88rem;
  cursor: pointer; transition: background .12s, box-shadow .12s, transform .04s; box-shadow: var(--shadow-sm); }
button:hover, .btn:hover { background: var(--navy-800); text-decoration: none; color: var(--brand-ink); }
button:active, .btn:active { transform: translateY(.5px); }
.btn { display: inline-block; }
.btn-accent { background: var(--accent); } .btn-accent:hover { background: var(--accent-600); }
.btn-ghost, button.ghost { background: var(--panel); color: var(--navy-700); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover, button.ghost:hover { background: var(--panel-2); color: var(--navy-900); }
.btn.danger { background: var(--panel); color: var(--danger); border: 1px solid #f3c6c0; box-shadow: none; }
.btn.danger:hover { background: #fdecea; color: var(--danger); }
.btn-sm { font-size: .78rem; padding: .28rem .6rem; }

/* Contacts — enrichment display */
.c-sub { font-size: .74rem; color: var(--muted); margin-top: 1px; }
.c-actions { white-space: nowrap; }
.c-actions form { display: inline-block; margin: 0; }
.c-actions .btn, .c-actions form button { margin: 0 .15rem .15rem 0; }
.li-badge { display: inline-block; margin-left: .35rem; width: 16px; height: 16px; line-height: 16px;
  text-align: center; font-size: .64rem; font-weight: 800; border-radius: 3px;
  background: #0a66c2; color: #fff; text-transform: lowercase; vertical-align: middle; }
.li-badge:hover { color: #fff; opacity: .88; }
.pill.signal { background: var(--hi-bg); color: var(--hi); margin: 0 .2rem .2rem 0; }
.clear { color: var(--muted); font-size: .85rem; }

/* ---- filters ------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: .6rem; margin: 1rem 0 1.1rem; box-shadow: var(--shadow-sm); }
.filters select, .filters input { padding: .44rem .6rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--panel-2); color: var(--ink-soft);
  font: inherit; font-size: .86rem; font-weight: 600; }
.filters select:focus, .filters input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: var(--panel); }
.filters .inline { color: var(--muted); display: flex; align-items: center; gap: .35rem; font-size: .85rem; }

/* ---- board table --------------------------------------------------------- */
.board-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); background: var(--panel); }
table.board { width: 100%; border-collapse: collapse; background: var(--panel); }
.board-wrap table.board { border: 0; }
.board th { text-align: left; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: .7rem .85rem;
  border-bottom: 1px solid var(--line); background: #fafbfe; white-space: nowrap; }
.board td { padding: .6rem .7rem; border-bottom: 1px solid var(--line-2); vertical-align: middle;
  font-size: .86rem; white-space: nowrap; }
/* single-line, ellipsised cells — full text on hover (title attr) */
.board td.col-title { max-width: 240px; }
.board td.col-title a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* reliable in auto-layout tables: the inner block carries the max-width */
.board td.col-ellip a, .board td.col-ellip span { display: inline-block; max-width: 340px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.col-country { white-space: nowrap; }
.col-country .risk { margin-left: .25rem; }
.board tr:last-child td { border-bottom: 0; }
.board tbody tr { transition: background .12s; }
.board tbody tr:hover td { background: #f9fbfe; }
.board td a { font-weight: 650; color: var(--navy-900); letter-spacing: -.01em; }
.board td a:hover { color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 2.5rem; }

/* fit / stage / status / risk chips */
.fit { display: inline-grid; place-items: center; min-width: 2.2rem; height: 1.75rem;
  padding: 0 .45rem; border-radius: var(--r-xs); font-weight: 750; font-size: .82rem;
  font-variant-numeric: tabular-nums; }
.fit-hi { background: var(--hi-bg); color: var(--hi); }
.fit-mid { background: var(--mid-bg); color: var(--mid); }
.fit-lo { background: var(--lo-bg); color: var(--lo); }
.stage { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--navy-700); background: var(--accent-soft);
  padding: .16rem .5rem; border-radius: var(--r-xs); white-space: nowrap; }
.status { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: .16rem .55rem; border-radius: 999px; background: var(--lo-bg); color: var(--lo);
  white-space: nowrap; }
.status-new, .status-active, .status-open { background: var(--accent-soft); color: var(--accent-600); }
.status-pursue { background: var(--hi-bg); color: var(--hi); }
.status-watch, .status-review { background: var(--mid-bg); color: var(--mid); }
.status-won { background: var(--hi-bg); color: var(--hi); }
.status-dead, .status-lost { background: #fdecea; color: var(--danger); }
.pill { display: inline-block; font-size: .68rem; font-weight: 700; background: var(--line-2);
  color: var(--ink-soft); border-radius: 5px; padding: .08rem .4rem; margin-right: .25rem; }
.num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- login --------------------------------------------------------------- */
.login-wrap { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 2.25rem; width: 380px; box-shadow: var(--shadow-md); }
.login-logos { display: flex; align-items: center; justify-content: center; margin-bottom: 1.1rem; }
.login-mark { height: 84px; width: 84px; display: block; }
.accent-africa { color: var(--brand-green, #17a35a); }
.login-card h1 { font-size: 1.28rem; margin: 0 0 .25rem; text-align: center; }
.login-card .sub { color: var(--muted); margin: 0 0 1.4rem; text-align: center; font-size: .92rem; }
.login-card label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .85rem; }
.login-card input { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); margin-top: .3rem; font-size: .95rem; background: var(--panel-2); }
.login-card input:focus { outline: none; border-color: var(--accent); background: var(--panel);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.login-card button { width: 100%; margin-top: .5rem; padding: .65rem; }
.alert { background: #fdecea; color: var(--danger); padding: .6rem .8rem; border: 1px solid #f5cdc7;
  border-radius: var(--r-sm); margin-bottom: 1rem; font-size: .85rem; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  background: var(--panel); color: #3c4043; border: 1px solid #dadce0; border-radius: var(--r-sm);
  padding: .65rem; font-weight: 600; box-shadow: none; }
.google-btn:hover { background: #f7f8fa; text-decoration: none; color: #3c4043; }
.google-btn .g { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; border: 1px solid #dadce0; color: #4285f4; font-weight: 800; font-size: .8rem; }
.divider { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .8rem; margin: 1.1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- opportunity detail -------------------------------------------------- */
.back { display: inline-block; color: var(--muted); font-size: .85rem; font-weight: 600; margin-bottom: .5rem; }
.back:hover { color: var(--accent); text-decoration: none; }
.opp-head { display: flex; align-items: center; gap: 1rem; margin: .3rem 0 1.4rem; }
.opp-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.4rem; align-items: start; }
.opp-main, .opp-side { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm); }
.opp-side { position: sticky; top: 5rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 1.5rem; margin: 1rem 0;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1rem 1.1rem; background: var(--panel-2); }
.facts > div { padding: .35rem 0; }
.facts dt { font-size: .66rem; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; font-weight: 700; }
.facts dd { margin: .15rem 0 0; font-weight: 600; }
.tags { margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { background: var(--accent-soft); color: var(--accent-600); font-size: .72rem; font-weight: 600;
  padding: .18rem .55rem; border-radius: 999px; }
.signals { list-style: none; padding: 0; margin: 0; }
.signals li { padding: .6rem 0; border-bottom: 1px solid var(--line-2); }
.signals li:last-child { border-bottom: 0; }
.sig-type { font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; color: var(--navy-700);
  background: var(--accent-soft); border-radius: 5px; padding: .1rem .4rem; margin-right: .45rem; font-weight: 700; }
.sig-src { display: block; font-size: .76rem; color: var(--muted); margin-top: .2rem; }
.timeline { list-style: none; padding: 0; margin: .3rem 0; }
.timeline li { padding: .4rem 0 .4rem .9rem; border-left: 2px solid var(--line); margin-left: .3rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .7rem; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); }
.opp-side h2:first-child { margin-top: 0; }
.opp-side form select { width: 100%; padding: .5rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); margin-bottom: .5rem; background: var(--panel-2); font: inherit; }
.opp-side form button { width: 100%; }
.bd-actions { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.bd-actions .btn { text-align: center; }
.empty-page { text-align: center; padding: 3.5rem; color: var(--muted); }
@media (max-width: 860px) { .opp-grid { grid-template-columns: 1fr; } .opp-side { position: static; } }

/* ---- AI / studio rows ---------------------------------------------------- */
.ai-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }
.ai-row select, .ai-row input[type=text], .ai-row input:not([type]) { padding: .48rem .6rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); font: inherit; }
.section { font-size: 1.05rem; }

/* ---- collaboration ------------------------------------------------------- */
.comments { list-style: none; padding: 0; margin: .3rem 0; }
.comments li { padding: .6rem 0; border-bottom: 1px solid var(--line-2); }
.comments li:last-child { border-bottom: 0; }
.cauthor { font-weight: 650; }
.reviews { margin-top: .7rem; display: flex; flex-direction: column; gap: .4rem; }
.rev { font-size: .84rem; } .rnote { color: var(--muted); font-size: .8rem; }
.tasklist { list-style: none; padding: 0; margin: .3rem 0 .6rem; }
.tasklist li { padding: .4rem 0; border-bottom: 1px solid var(--line-2); font-size: .87rem; }
.tstatus { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
  padding: .1rem .4rem; border-radius: 999px; background: var(--lo-bg); color: var(--lo); }
.tstatus-in_progress { background: var(--mid-bg); color: var(--mid); }
.tstatus-blocked { background: #fdecea; color: var(--danger); }
.tstatus-done { background: var(--hi-bg); color: var(--hi); }

/* ---- kanban -------------------------------------------------------------- */
.newtask { margin: 1rem 0; }
.newtask summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.newtask-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); padding: .8rem; box-shadow: var(--shadow-sm); }
.newtask-form input, .newtask-form select { padding: .48rem .55rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--panel-2); color: var(--ink); font: inherit; }
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-top: 1.2rem; }
.kcol { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem; }
.kcol h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  margin: 0 0 .7rem; display: flex; gap: .4rem; align-items: center; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .7rem; margin-bottom: .6rem; box-shadow: var(--shadow-sm); }
.ktitle { font-weight: 650; font-size: .88rem; margin-bottom: .25rem; }
.kmeta { font-size: .74rem; color: var(--muted); display: block; margin-top: .15rem; }
.kwho { background: var(--accent-soft); color: var(--accent-600); border-radius: 999px; padding: .05rem .45rem; font-weight: 600; }
.kmove { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .5rem; }
.kmove button { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  padding: .22rem .5rem; font-size: .68rem; border-radius: var(--r-xs); box-shadow: none; }
.kmove button:hover { color: var(--accent); border-color: var(--accent); background: var(--panel); }
.kempty { font-size: .8rem; padding: .5rem 0; color: var(--muted); }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr 1fr; } }

/* ---- submission readiness ------------------------------------------------ */
.progressbar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: .2rem 0 .8rem; }
.progressbar span { display: block; height: 100%; background: var(--hi); }
.checklist { list-style: none; padding: 0; margin: .3rem 0 .6rem; }
.checklist li { padding: .3rem 0; border-bottom: 1px solid var(--line-2); }
.checklist li:last-child { border-bottom: 0; }
.ck-form { display: flex; align-items: center; gap: .45rem; margin: 0; }
.ck-box { background: none; border: 0; cursor: pointer; font-size: 1.05rem; line-height: 1; color: var(--accent); padding: 0; box-shadow: none; }
.ck-box:hover { background: none; }
.ck-label { font-size: .9rem; }
.ck-done .ck-label { text-decoration: line-through; color: var(--muted); }

/* ---- documents: proposal body + rendered doc ----------------------------- */
.proposal-body { font: 16px/1.7 var(--serif); color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1rem 1.15rem; resize: vertical; width: 100%; }
.proposal-body:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.proposal-doc { font: 16px/1.75 var(--serif); color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem 1.75rem; max-width: 74ch; }
.proposal-doc h1 { font-size: 1.5rem; font-family: var(--font); margin: .2rem 0 .8rem; line-height: 1.2; }
.proposal-doc h2 { font-size: 1.2rem; font-family: var(--font); margin: 1.5rem 0 .6rem;
  padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.proposal-doc h3 { font-size: 1.05rem; font-family: var(--font); margin: 1.2rem 0 .4rem; color: var(--navy-700); }
.proposal-doc p { margin: .7rem 0; }
.proposal-doc ul, .proposal-doc ol { margin: .6rem 0 .8rem 1.4rem; padding: 0; }
.proposal-doc li { margin: .3rem 0; }
.proposal-doc strong { color: var(--ink); font-weight: 700; }
.proposal-doc hr { border: 0; border-top: 1px solid var(--line); margin: 1.3rem 0; }
.proposal-doc code { font: .88em var(--mono); background: var(--lo-bg); padding: .08rem .35rem; border-radius: 4px; }
.proposal-doc table { border-collapse: collapse; width: 100%; margin: .9rem 0; font-size: .9em; font-family: var(--font); }
.proposal-doc th, .proposal-doc td { border: 1px solid var(--line); padding: .45rem .65rem; text-align: left; vertical-align: top; }
.proposal-doc thead th { background: var(--panel-2); font-weight: 700; }
.proposal-doc tbody tr:nth-child(even) td { background: #fbfcfe; }

.drive-tag { background: var(--accent-soft); color: var(--accent-600); font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: .1rem .4rem; border-radius: 5px; vertical-align: middle; }

/* ---- AI studio artifacts ------------------------------------------------- */
.artifact { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  margin-bottom: 1rem; overflow: hidden; box-shadow: var(--shadow-sm); }
.artifact-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .7rem .95rem;
  border-bottom: 1px solid var(--line); background: var(--panel-2); }
.artifact-body { border: 0; border-radius: 0; max-width: none; overflow-x: auto; }

/* ---- board synopsis (single line, ellipsis, full text on hover) --------- */
.synopsis { max-width: 300px; font-size: .8rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .synopsis { max-width: 220px; } }

/* ---- political risk ------------------------------------------------------ */
.risk { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  padding: .1rem .45rem; border-radius: 999px; white-space: nowrap; }
.risk-lg { font-size: .98rem; padding: .18rem .6rem; }
.risk-low { background: var(--hi-bg); color: var(--hi); }
.risk-moderate { background: #eaf5e0; color: #4d7c1f; }
.risk-elevated { background: var(--mid-bg); color: var(--mid); }
.risk-high { background: #fdeede; color: #b4530f; }
.risk-severe { background: #fdecea; color: var(--danger); }
.risk-panel { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .85rem .9rem; background: var(--panel-2); }
.risk-drivers { margin: .45rem 0 .2rem; padding-left: 1.15rem; font-size: .82rem; color: var(--ink-soft); }
.risk-drivers li { margin: .15rem 0; }
.risk-dims { margin: .6rem 0 .35rem; display: grid; gap: .35rem; }
.risk-dim { display: grid; grid-template-columns: 6.4rem 1fr 1.2rem; align-items: center; gap: .5rem;
  font-size: .77rem; color: var(--ink-soft); }
.risk-dim-label { color: var(--muted); }
.risk-dim-track { height: 7px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.risk-dim-fill { display: block; height: 100%; border-radius: 999px; }
.risk-dim-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.risk-low-bar { background: #23a55a; }
.risk-moderate-bar { background: #7cb342; }
.risk-elevated-bar { background: #e0a100; }
.risk-high-bar { background: #e07b39; }
.risk-severe-bar { background: #d64430; }
.risk-enercon { margin: .55rem 0 .2rem; padding: .55rem .65rem; font-size: .82rem; line-height: 1.45;
  background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 5px; color: var(--ink-soft); }
.risk-enercon strong { color: var(--navy-900); }

/* ---- project location map ------------------------------------------------ */
.map-card { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background: var(--panel); margin-bottom: .6rem; box-shadow: var(--shadow-sm); }
.map-meta { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  padding: .65rem .85rem; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.map-prec { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.map-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #eef1f5; }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-foot { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .6rem .85rem; font-size: .82rem; }
.map-open { white-space: nowrap; }
.map-card .meta { padding: 0 .85rem .6rem; }
@supports not (aspect-ratio: 1) { .map-embed { height: 320px; } }

/* ---- banners ------------------------------------------------------------- */
.banner { padding: .6rem .85rem; border-radius: var(--r-sm); margin: 0 0 1rem; font-size: .9rem;
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow-sm); }
.banner.ok { background: var(--hi-bg); border-color: #bfe6cd; color: var(--hi); }

/* ---- document library / dropzone ----------------------------------------- */
.lib-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.1rem;
  margin-bottom: 1.5rem; align-items: start; }
.lib-drop, .lib-drive { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); min-width: 0; }
.lib-drop h2, .lib-drive h2 { margin-top: 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center;
  padding: 1.8rem 1rem; border: 2px dashed var(--line); border-radius: var(--r); background: var(--panel-2);
  cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dz-icon { font-size: 1.6rem; color: var(--accent); }
.dz-main { font-weight: 650; color: var(--ink); }
.dz-sub { font-size: .8rem; color: var(--muted); }
.dz-picked { font-size: .82rem; color: var(--accent-600); font-weight: 650; margin-top: .2rem; }
.lib-tagrow { display: flex; align-items: end; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.lib-tagrow label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted);
  flex: 1 1 0; min-width: 0; }
.lib-tagrow select { padding: .5rem .55rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel-2); font: inherit; width: 100%; max-width: 100%; }
.lib-tagrow button { flex: 0 0 auto; }
@media (max-width: 860px) { .lib-grid { grid-template-columns: 1fr; } }

/* ---- CRM engagement log -------------------------------------------------- */
.crm-form { display: flex; flex-direction: column; gap: .55rem; }
.crm-form-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.crm-form-row select, .crm-form-row input { padding: .5rem .55rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); flex: 1; min-width: 8.5rem; background: var(--panel-2); font: inherit; }
.crm-form .crm-subject, .crm-form textarea { padding: .55rem .6rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); width: 100%; font: inherit; background: var(--panel-2); }
.crm-form .crm-subject:focus, .crm-form textarea:focus, .crm-form-row select:focus, .crm-form-row input:focus {
  outline: none; border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.crm-form button { align-self: flex-start; }
.crm-filter { display: flex; flex-direction: column; gap: .6rem; }
.crm-filter label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); }
.crm-filter select { padding: .5rem .55rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); font: inherit; }
.crm-timeline { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; }
.crm-item { display: flex; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line-2); }
.crm-item:last-child { border-bottom: 0; }
.crm-ico { flex: 0 0 2rem; height: 2rem; width: 2rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--lo-bg); font-size: .95rem; }
.crm-call { background: var(--accent-soft); }
.crm-meeting { background: var(--hi-bg); }
.crm-email { background: var(--mid-bg); }
.crm-note { background: #f1eefc; }
.crm-body { flex: 1; min-width: 0; }
.crm-line1 { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.crm-when { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.crm-who { font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.crm-body .crm-note { background: none; font-size: .88rem; color: var(--ink-soft); margin-top: .3rem; line-height: 1.5; }
.crm-meta { display: flex; align-items: center; gap: .6rem; margin-top: .35rem; }
.linkbtn { background: none; border: 0; color: var(--muted); font-size: .78rem; cursor: pointer;
  padding: 0; text-decoration: underline; box-shadow: none; }
.linkbtn:hover { color: var(--danger); background: none; }

/* ---- shared: cards, sub-headers, meta ------------------------------------ */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); }
.card.soft { background: var(--panel-2); box-shadow: none; }
.cols { display: grid; grid-template-columns: 1fr 320px; gap: 1.4rem; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.sub { color: var(--muted); font-size: .95rem; margin: .3rem 0 1.3rem; max-width: 70ch; }
.sub a { font-weight: 600; }
.meta { color: var(--muted); }
.meta small { color: var(--muted); }
.sigmeta { display: block; font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.num { width: 5rem; }
h2.section, h3.section { letter-spacing: -.01em; }
label { display: block; }
label + label, form label { margin-top: .1rem; }
textarea, input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input:not([type]), select { font: inherit; color: var(--ink); }
form textarea, form input[type=text], form input[type=email], form input[type=password],
form input[type=number], form input[type=date], form input:not([type]) {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: .55rem .65rem;
  background: var(--panel-2); margin-top: .3rem; }
form textarea:focus, form input:focus, form select:focus { outline: none;
  border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
form label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .7rem; }

/* documents page tidy-ups */
.lib-drive-open { display: block; width: 100%; text-align: center; box-sizing: border-box; margin-bottom: .5rem; }
.dropzone { min-height: 160px; justify-content: center; }
.lib-drop form { min-width: 0; }
