:root {
  --ink: #173b33;
  --muted: #68746f;
  --brand: #14382f;
  --accent: #ef6a47;
  --paper: #fffdf8;
  --line: #dfe6e2;
  --soft: #f2f6f3;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Aptos, "Segoe UI", sans-serif; }
a { color: inherit; }
.app-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; color: white; background: var(--brand); }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; color: var(--brand); background: #ffcf61; font: 800 20px/1 Bahnschrift, sans-serif; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: #c8d7d2; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.text-button { border: 0; color: white; background: transparent; cursor: pointer; font: inherit; }
.app-main { width: min(1200px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font: 800 clamp(30px, 4vw, 50px)/1.05 Bahnschrift, Aptos, sans-serif; letter-spacing: -.035em; }
.lede { max-width: 720px; margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.private-badge { padding: 8px 11px; border: 1px solid #bfd0c9; color: var(--brand); background: var(--soft); font-size: 12px; font-weight: 700; }
.activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.activity-card { border: 1px solid var(--line); background: var(--white); box-shadow: 0 12px 28px rgba(20, 56, 47, .07); }
.activity-card__heading { display: flex; gap: 12px; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.activity-card__heading h2 { margin: 0; font-size: 19px; }
.activity-number { color: var(--accent); font: 800 13px/1 Bahnschrift, sans-serif; }
.city-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.city-list a { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; font-size: 13px; }
.city-list a:hover, .city-list a:focus-visible { background: var(--soft); outline: none; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border: 2px solid #8b9893; border-radius: 50%; }
.login-shell { min-height: calc(100vh - 175px); display: grid; place-items: center; }
.login-panel { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); background: white; box-shadow: 0 18px 50px rgba(20, 56, 47, .12); }
.login-panel h1 { font-size: 38px; }
.login-form { display: grid; gap: 8px; margin-top: 25px; }
.login-form label { margin-top: 8px; font-size: 13px; font-weight: 700; }
.login-form input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #acb9b4; color: var(--ink); background: white; font: inherit; }
.login-form input:focus { border-color: var(--brand); outline: 3px solid rgba(20,56,47,.13); }
.primary-button { min-height: 46px; margin-top: 14px; border: 0; color: white; background: var(--brand); cursor: pointer; font: 700 14px/1 Aptos, sans-serif; }
.primary-button:hover { background: #0e2c25; }
.form-error { padding: 10px 12px; border-left: 4px solid #b43d32; background: #fff1ef; color: #7d211a; }
.privacy-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.back-link { color: var(--brand); font-size: 13px; font-weight: 700; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.matrix-stack { display: grid; gap: 28px; }
.status-legend { display: flex; flex-wrap: wrap; gap: 13px; margin: -8px 0 22px; color: var(--muted); font-size: 11px; }
.status-legend span { display: inline-flex; align-items: center; gap: 5px; }
.status-legend i { display: inline-grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; font-style: normal; font-weight: 800; }
.matrix-card { overflow: hidden; border: 1px solid var(--line); background: white; box-shadow: 0 12px 28px rgba(20, 56, 47, .07); }
.matrix-card__heading { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.matrix-card__heading h2 { margin: 0; font-size: 20px; }
.matrix-toggle { display: grid; width: 42px; height: 42px; margin-left: auto; place-items: center; border: 1px solid transparent; border-radius: 50%; color: var(--brand); background: transparent; cursor: pointer; }
.matrix-toggle:hover { border-color: var(--line); background: var(--soft); }
.matrix-toggle:focus-visible { outline: 3px solid rgba(20, 56, 47, .18); outline-offset: 2px; }
.matrix-toggle span { display: block; width: 9px; height: 9px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); transition: transform .18s ease; }
.matrix-toggle[aria-expanded="false"] span { transform: rotate(-45deg); }
.matrix-scroll { overflow-x: auto; }
.campaign-matrix { width: 100%; min-width: 1180px; border-collapse: collapse; table-layout: fixed; }
.campaign-matrix th, .campaign-matrix td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.campaign-matrix thead th { min-width: 82px; padding: 10px 7px; color: var(--muted); background: #f6f8f6; font-size: 11px; line-height: 1.2; }
.campaign-matrix thead th:first-child { width: 250px; text-align: left; }
.campaign-matrix thead a { text-decoration: none; }
.campaign-matrix tbody th { padding: 9px 12px; text-align: left; font-size: 12px; font-weight: 650; }
.campaign-matrix tbody th span { display: inline-grid; width: 22px; height: 22px; margin-right: 8px; place-items: center; color: var(--accent); background: #fff0eb; font-size: 10px; }
.campaign-matrix td { padding: 5px; text-align: center; }
.matrix-status { display: grid; width: 31px; height: 31px; margin: auto; place-items: center; border-radius: 50%; text-decoration: none; font-weight: 900; }
.status-todo { color: #60716b; background: #edf1ef; }
.status-in_progress { color: #9c5905; background: #fff0d5; }
.status-done { color: #247a4b; background: #e5f3ea; }
.status-not_applicable { color: #7d8783; background: #f1f2f2; }
.status-blocked { color: #a83b35; background: #fbeceb; }
.query-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; margin-top: 15px; padding: 25px; border: 1px solid var(--line); background: white; box-shadow: 0 8px 25px rgba(20,56,47,.06); }
.lifecycle-control { display: grid; justify-items: end; align-content: start; gap: 8px; min-width: 210px; }
.lifecycle-control summary { cursor: pointer; color: var(--brand); font-size: 11px; font-weight: 800; text-align: right; }
.lifecycle-control form { display: grid; gap: 7px; width: min(310px, 70vw); margin-top: 8px; padding: 12px; border: 1px solid var(--line); background: var(--soft); }
.lifecycle-control form > label:not(.confirmation-check) { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.lifecycle-control textarea { width: 100%; padding: 8px; border: 1px solid var(--line); font: inherit; resize: vertical; }
.confirmation-check { display: flex; gap: 7px; align-items: flex-start; font-size: 11px; }
.lifecycle-control button { padding: 9px 12px; border: 0; color: white; background: var(--brand); font-weight: 800; cursor: pointer; }
.lifecycle-control button:hover, .lifecycle-control button:focus-visible { background: #1b6547; }
.query-phrases { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 15px; border-top: 1px solid var(--line); }
.query-phrases span { padding: 6px 9px; color: var(--muted); background: var(--soft); font-size: 12px; }
.query-phrases .primary-phrase { color: var(--brand); background: #ffedb7; font-weight: 750; }
.status-pill { display: inline-flex; min-height: 29px; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.summary-grid { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 1px; margin-top: 16px; border: 1px solid var(--line); background: var(--line); }
.summary-grid article { min-height: 105px; display: grid; align-content: center; padding: 17px; background: white; }
.summary-grid article > span, .progress-card div > span { color: var(--muted); font-size: 11px; }
.summary-grid article > strong { margin-top: 2px; color: var(--brand); font: 800 29px/1 Bahnschrift, sans-serif; }
.progress-card strong { display: block; margin-top: 3px; }
.progress-track { height: 8px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: #e3e9e5; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: #247a4b; }
.tabs { display: flex; gap: 4px; margin-top: 22px; border-bottom: 1px solid var(--line); }
.tab-button { min-height: 43px; padding: 8px 14px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-weight: 700; }
.tab-button.active { border-bottom-color: var(--accent); color: var(--brand); }
.tab-button span { display: inline-grid; min-width: 20px; height: 20px; margin-left: 4px; place-items: center; border-radius: 50%; background: var(--soft); font-size: 10px; }
.tab-panel { margin-top: 16px; padding: 22px; border: 1px solid var(--line); background: white; box-shadow: 0 10px 28px rgba(20,56,47,.05); }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.panel-heading h2, .empty-panel h2 { margin: 0; font: 800 24px/1.15 Bahnschrift, sans-serif; }
.panel-heading > p { max-width: 440px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.task-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.task-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; }
.task-number { display: grid; width: 29px; height: 29px; place-items: center; color: var(--brand); background: #ffedb7; font: 800 12px/1 Bahnschrift, sans-serif; }
.task-list strong { display: block; font-size: 13px; }
.task-list p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.task-editor { grid-column: 2 / -1; width: 100%; margin-top: 2px; }
.task-editor summary { width: max-content; cursor: pointer; color: var(--brand); font-size: 11px; font-weight: 800; }
.task-editor form { display: grid; grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr) auto; gap: 8px 12px; align-items: end; margin-top: 11px; padding: 13px; background: var(--soft); }
.task-editor label { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.task-editor label:nth-of-type(2) { grid-column: 2; }
.task-editor select, .task-editor textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: white; font: inherit; }
.task-editor select { grid-column: 1; min-height: 40px; padding: 8px; }
.task-editor textarea { grid-column: 2; min-height: 72px; padding: 9px; resize: vertical; }
.task-editor form > p { grid-column: 1 / 3; margin: 0; }
.task-editor button { grid-column: 3; grid-row: 2; min-height: 40px; padding: 9px 13px; border: 0; color: white; background: var(--brand); font-weight: 800; cursor: pointer; }
.task-editor button:hover, .task-editor button:focus-visible { background: #1b6547; }
.prospect-table-wrap { overflow-x: auto; }
.prospect-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.prospect-table th { padding: 9px 10px; color: var(--muted); background: var(--soft); text-align: left; font-size: 11px; }
.prospect-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: top; }
.company-cell { min-width: 250px; }
.company-cell a { display: block; color: var(--brand); text-decoration: none; }
.company-cell strong, .company-cell span { display: block; }
.company-cell span { max-width: 330px; margin-top: 3px; color: var(--muted); font-size: 11px; }
.score { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: white; background: var(--brand); font-weight: 800; }
.empty-panel { min-height: 180px; }
.empty-panel > p:last-child { color: var(--muted); }
.event-list { position: relative; display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.event-list::before { position: absolute; top: 8px; bottom: 8px; left: 128px; width: 1px; background: var(--line); content: ""; }
.event-list li { position: relative; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 36px; }
.event-list li::before { position: absolute; top: 18px; left: 123px; z-index: 1; width: 11px; height: 11px; border: 3px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--line); content: ""; }
.event-list time { padding-top: 16px; color: var(--muted); font-size: 11px; text-align: right; }
.event-card { padding: 14px 16px; border: 1px solid var(--line); background: #fff; }
.event-card__heading { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.event-type { padding: 4px 7px; color: var(--brand); background: var(--soft); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.event-type-import { color: #9c5905; background: #fff0d5; }
.event-type-task_status { color: #247a4b; background: #e5f3ea; }
.event-type-closure { color: #a83b35; background: #fbeceb; }
.event-actor { color: var(--muted); font-size: 11px; }
.event-card h3 { margin: 8px 0 0; font-size: 14px; }
.event-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.document-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.document-list li { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); background: #fff; }
.document-type { display: grid; width: 48px; height: 48px; place-items: center; color: var(--brand); background: var(--soft); font-size: 10px; font-weight: 900; }
.document-list h3 { margin: 0; font-size: 14px; }
.document-list p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.document-download { padding: 9px 12px; border: 1px solid var(--brand); color: var(--brand); font-size: 11px; font-weight: 800; text-decoration: none; }
.document-download:hover, .document-download:focus-visible { color: white; background: var(--brand); }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .app-header { padding: 0 18px; }
  .app-main { width: min(100% - 28px, 1200px); padding-top: 28px; }
  .activity-grid { grid-template-columns: 1fr; }
  .page-heading { display: block; }
  .private-badge { display: inline-block; margin-top: 16px; }
  .login-panel { padding: 24px; }
  .query-hero { grid-template-columns: 1fr; padding: 19px; }
  .lifecycle-control { justify-items: start; min-width: 0; }
  .lifecycle-control summary { text-align: left; }
  .lifecycle-control form { width: 100%; }
  .query-phrases { grid-column: 1; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-card { grid-column: 1 / -1; }
  .summary-grid article:last-child { grid-column: 1 / -1; }
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab-button { padding-inline: 6px; white-space: nowrap; }
  .tab-panel { padding: 15px; }
  .panel-heading { display: block; }
  .panel-heading > p { margin-top: 8px; text-align: left; }
  .task-list li { grid-template-columns: 32px 1fr; }
  .task-list .status-pill { grid-column: 2; justify-self: start; }
  .task-editor { grid-column: 1 / -1; }
  .task-editor form { grid-template-columns: 1fr; }
  .task-editor label, .task-editor label:nth-of-type(2), .task-editor select, .task-editor textarea, .task-editor form > p, .task-editor button { grid-column: 1; grid-row: auto; }
  .event-list::before { left: 5px; }
  .event-list li { grid-template-columns: 1fr; gap: 5px; padding-left: 22px; }
  .event-list li::before { top: 8px; left: 0; }
  .event-list time { padding-top: 0; text-align: left; }
  .document-list li { grid-template-columns: 48px 1fr; }
  .document-download { grid-column: 1 / -1; text-align: center; }
}
