/* Feasibility Study Workbench — one stylesheet, brand tokens from the design
   system (plugin/templates/Horwath-Feasibility-Study-Design-System/tokens/tokens.css).
   No external fonts, no CDN. Plain and dense: this is a working tool. */

:root {
  --navy: #011E41;
  --blue: #003F9F;
  --gold: #F5A800;
  --gold-text: #8A6A18;
  --callout-warm: #FFF9EC;
  --ink: #1d2433;
  --ink-2: #4b5468;
  --ink-3: #7d879c;
  --rule: #D9DEE8;
  --tint: #F4F7FC;
  --tint-emphasis: #EAF0F9;
  --white: #FFFFFF;
  --ok: #0b7a4b;
  --ok-bg: #e7f6ee;
  --warn: #8A6A18;
  --warn-bg: #FFF9EC;
  --bad: #a3241a;
  --bad-bg: #fdecea;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--tint);
}
a { color: var(--blue); }
a:hover { text-decoration: none; }

header.app-bar {
  background: var(--navy);
  color: #fff;
  padding: 10px 20px;
  border-bottom: 4px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
header.app-bar .brand { font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
header.app-bar nav { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
header.app-bar nav a { color: #dfe6f2; text-decoration: none; font-size: 13.5px; }
header.app-bar nav a.current { color: #fff; font-weight: 600; }
header.app-bar nav a:hover { color: #fff; }
header.app-bar .who { font-size: 13px; color: #c9d3e4; white-space: nowrap; }
header.app-bar .who a { color: #c9d3e4; margin-left: 10px; }

main.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
}
main.narrow { max-width: 460px; margin: 48px auto; }

.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card.pad-sm { padding: 12px 14px; }

h1 { font-size: 21px; margin: 0 0 14px; color: var(--navy); }
h2 { font-size: 16px; margin: 18px 0 8px; color: var(--navy); }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--navy); }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

.error, .flash-error {
  background: var(--bad-bg); color: var(--bad);
  padding: 9px 12px; border-radius: 4px; margin-bottom: 12px;
  white-space: pre-line;
}
.notice, .flash-ok {
  background: var(--tint-emphasis); color: var(--navy);
  padding: 9px 12px; border-radius: 4px; margin-bottom: 12px;
  border-left: 3px solid var(--blue);
  white-space: pre-line;
}
.warn-box {
  background: var(--warn-bg); color: var(--warn-text, #6b4f10);
  padding: 9px 12px; border-radius: 4px; margin-bottom: 12px;
  border-left: 3px solid var(--gold);
  white-space: pre-line;
}

/* pills */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6e9ef;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad, .pill.refuse { background: var(--bad-bg); color: var(--bad); }
.pill.navy { background: var(--navy); color: #fff; }
.pill.gold { background: var(--gold); color: #4a3200; }

/* buttons */
.btn, button, input[type=submit] {
  display: inline-block;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 4px;
  border: 1px solid var(--navy);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover, button:hover { background: var(--tint-emphasis); }
.btn.primary, button.primary, input[type=submit].primary {
  background: var(--navy); color: #fff;
}
.btn.primary:hover { background: #012c5c; }
.btn.gold, button.gold {
  background: var(--gold); color: #4a3200; border-color: var(--gold);
}
.btn.gold:hover { background: #e39a00; }
.btn.danger, button.danger { border-color: var(--bad); color: var(--bad); }
.btn.small, button.small { font-size: 12px; padding: 4px 9px; }
.btn[disabled], button[disabled] { opacity: .5; cursor: default; }

/* forms */
label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 3px; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #c3c8d1;
  border-radius: 4px;
  font: inherit;
  font-size: 13.5px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 70px; font-family: var(--font); }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.field-row > div { flex: 1; min-width: 160px; }
.actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.page-actions { margin: 0 0 12px; }
.page-tabs nav { display: flex; gap: 6px; flex-wrap: wrap; }
.proposal-card { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid #eef0f4; }
.proposal-card:last-child { border-bottom: none; }
.proposal-card p { margin: 4px 0; }
.outline-editor { margin-top: 12px; border-top: 1px solid #eef0f4; padding-top: 10px; }
.outline-editor summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.copy-prompt { min-height: 58px; font-size: 12.5px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* tables / lists */
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th {
  text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .03em; color: var(--ink-3); border-bottom: 1px solid var(--rule);
  padding: 6px 8px;
}
table.list td { padding: 7px 8px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: var(--tint); }
.table-scroll { overflow-x: auto; }
.source-ledger { min-width: 860px; }
.source-ledger input[type=text], .source-ledger select { min-width: 175px; }
.table-editor-wrap { overflow-x: auto; }
.table-editor { min-width: max-content; margin-top: 8px; }
.table-editor input { min-width: 120px; }
.item-editor { margin: 8px 0; }
.document-list { margin-top: 14px; }
.source-current { font-size: 12.5px; margin: 8px 0 3px; }
.source-picker { margin: 3px 0 8px; }
.source-picker summary { color: var(--blue); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.source-options { border: 0; margin: 6px 0 0; padding: 0; }
.source-option { display: flex; align-items: flex-start; gap: 7px; font-weight: 400; margin: 4px 0; }
.source-option input[type=checkbox] { flex: none; margin: 3px 0 0; }
.source-option span { overflow-wrap: anywhere; }

.row-flex { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef0f4; flex-wrap: wrap; }
.row-flex:last-child { border-bottom: none; }
.row-flex .grow { flex: 1; min-width: 200px; }

/* layout: sidebar + main */
.layout-2 { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.layout-3 { display: grid; grid-template-columns: 220px 1fr 260px; gap: 16px; align-items: start; }
@media (max-width: 900px) {
  .layout-2, .layout-3 { grid-template-columns: 1fr; }
}
.side-list a, .side-list .side-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 4px; text-decoration: none; color: var(--ink);
  font-size: 13.5px;
}
.side-list a > span:last-child, .side-list .side-item > span:last-child { flex: none; }

/* An entries list where the title's length is unpredictable: the pill always
   sits on its own line under the title, so nothing can push it past the
   panel edge whatever the title wraps to. */
.entry-row {
  display: block; padding: 7px 8px; border-radius: 4px; text-decoration: none;
  color: var(--ink); font-size: 13.5px;
}
.entry-row:hover { background: var(--tint); }
.entry-row.current { background: var(--tint-emphasis); font-weight: 600; }
.entry-row-title { margin-bottom: 4px; }
.entry-row-meta .pill { max-width: 100%; overflow-wrap: break-word; white-space: normal; }
.side-list a:hover, .side-list .side-item:hover { background: var(--tint); }
.side-list a.current { background: var(--tint-emphasis); font-weight: 600; }

.block-box { border: 1px solid var(--rule); border-radius: 4px; padding: 10px 12px; margin: 10px 0; background: #fbfcfe; }
.block-box.gap { border-color: var(--bad); background: var(--bad-bg); }
.block-box .block-type { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.prov-chip {
  display: inline-block; font-size: 10.5px; padding: 1px 6px; margin: 0 3px 3px 0;
  border-radius: 3px; border: 1px solid var(--rule); cursor: help;
}
.prov-chip.resolved { border-color: var(--ok); color: var(--ok); }
.prov-chip.unchecked { border-color: var(--ink-3); color: var(--ink-3); }
.prov-chip.refused { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }

.stage-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.stage-track .stage-card {
  border: 1px solid var(--rule); border-radius: 5px; padding: 10px 12px; background: #fff;
}
.stage-track .stage-card.current { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.stage-track .stage-card b { display: block; color: var(--navy); font-size: 13px; margin-bottom: 4px; }
@media (max-width: 700px) {
  .stage-track { grid-template-columns: 1fr 1fr; }
  .proposal-card { align-items: flex-start; flex-direction: column; }
}

.rendered h1, .rendered h2, .rendered h3 { color: var(--navy); }
.rendered table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.rendered table th, .rendered table td { border: 1px solid var(--rule); padding: 5px 8px; text-align: left; }
.rendered table th { background: var(--navy); color: #fff; }
.rendered sup { color: var(--blue); font-weight: 600; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.auth-card { max-width: 420px; margin: 56px auto 0; }
