/* MillerKnoll Government RFP Assistant: components (v1.0, 2026-10-02). Needs tokens.css.
   Class names match the live site (aise-govcon-rfp/web), so markup moves between them unchanged. */

/* ========== Base ========== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* components set display; the attribute must still win */
html, body { height: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: var(--text-body); line-height: var(--leading);
}
h1 { margin: 0; font-family: var(--font-bold); font-weight: 700; font-size: var(--text-h1); color: var(--ink-strong); }
h2 { margin: 0; font-family: var(--font-bold); font-weight: 700; font-size: var(--text-h2); color: var(--ink-strong); }
h3 { margin: 0; font-family: var(--font-medium); font-weight: 400; font-size: var(--text-ui); color: var(--ink); }
p { margin: 0; }
a { color: var(--ink); text-underline-offset: 3px; }
code { font-family: var(--font-mono); font-size: 12px; background: var(--code-bg); padding: 0 3px; border-radius: 3px; }
.muted { color: var(--muted); font-size: var(--text-ui); }
.lede { max-width: 72ch; color: var(--ink-body); font-size: var(--text-ui); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible,
summary:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: var(--accent-w) solid var(--ink); outline-offset: 2px; }

/* ========== Page frame: header, page, bottom bar, footer ========== */
/* Header: wordmark left, optional notice centered on the page, navigation right. */
.site-header {
  display: grid; grid-template-columns: 1fr minmax(0, var(--notice-max)) 1fr; align-items: center;
  gap: var(--space-8); padding: var(--header-pad);
}
.site-header > a:first-child { justify-self: start; }
.site-header img { height: 25px; width: auto; display: block; }
.site-nav { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: var(--space-10); font-family: var(--font-medium); font-size: var(--text-body); }
.site-nav a, .site-nav span { color: var(--ink); text-decoration: none; white-space: nowrap; }
.site-nav a.current, .site-nav a[aria-current="page"] { color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.site-nav .rule { width: 1px; height: 24px; background: var(--divider); }
/* Demo notice: a quiet outlined strip in the header's center column. */
.demo-flag { grid-column: 2; width: 100%; border: var(--rule-w) solid var(--line); border-radius: var(--radius); padding: 8px 14px; font-size: var(--text-ui); color: var(--ink-body); text-align: center; }

.page { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 18px var(--page-pad) 48px; display: flex; flex-direction: column; gap: var(--space-8); flex: 1 0 auto; }
.view { display: grid; gap: 22px; }
.page > .view:not([hidden]) { flex: 1 0 auto; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Bottom bar: help line centered, demo switch at the right, just above the footer. */
.bottom-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px var(--space-8); }
.bottom-bar .help { grid-column: 2; margin: 0; max-width: 820px; text-align: center; font-size: var(--text-small); color: var(--muted); }
/* Footer: black band, product name in white at the right. */
.site-footer { flex-shrink: 0; background: #000; color: #fff; font-family: var(--font-medium); font-size: var(--text-body); padding: 12px 80px; text-align: right; }

/* ========== Welcome (home) ========== */
.welcome { display: grid; justify-items: center; align-content: center; text-align: center; gap: 26px; padding: 40px 0; }
.welcome h1 { font-family: var(--font); font-weight: 400; font-size: var(--text-display); line-height: 1.25; max-width: 760px; }
.welcome-lede { max-width: 720px; font-size: var(--text-lead); color: var(--ink-body); }
.welcome-steps { list-style: none; margin: 8px 0 0; padding: 0; width: 100%; max-width: 960px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; text-align: left; }
.welcome-steps li { counter-increment: step; padding: 18px 20px; border-left: var(--rule-w) solid var(--rule); display: grid; gap: 6px; align-content: start; }
.welcome-steps li:first-child { border-left: 0; }
.welcome-steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: var(--radius-round); border: var(--rule-w) solid var(--ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-bold); font-size: var(--text-small); }
.welcome-steps b { font-family: var(--font-medium); font-weight: 400; color: var(--ink); }
.welcome-steps span { font-size: var(--text-ui); color: var(--ink-body); }
.welcome-note { max-width: 640px; color: var(--muted); font-size: 15px; }
.welcome-note b { color: var(--ink); font-family: var(--font-medium); font-weight: 400; }

/* ========== Steps (a multi-step task) ========== */
/* Step strip: current step black and underlined, finished black, later grey. */
.progress { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-9); font-family: var(--font-medium); font-size: var(--text-ui); }
.progress li { color: var(--muted); }
.progress li.done { color: var(--ink); }
.progress li.current { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
/* Finished steps collapse into summary rows: black numbered dot, name, detail, Edit. */
.done-steps { display: grid; }
.done-steps:empty { display: none; }
.done-step { display: grid; grid-template-columns: 26px 140px minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: 12px 0; border-top: var(--rule-w) solid var(--rule); font-size: var(--text-ui); }
.done-num { width: 22px; height: 22px; border-radius: var(--radius-round); background: var(--ink); color: #fff; font-size: var(--text-caption); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-medium); }
.done-name { font-family: var(--font-medium); color: var(--ink); }
.done-detail { color: var(--ink-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A step's body: separated by a rule, not boxed. */
.card { border-top: var(--rule-w) solid var(--rule); padding-top: 22px; display: grid; gap: var(--space-6); }

/* ========== Forms ========== */
form { display: grid; gap: var(--space-6); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.field { display: grid; gap: var(--space-2); min-width: 0; }
label { font-family: var(--font-medium); font-size: var(--text-ui); color: var(--ink); }
input, select, textarea {
  font: inherit; font-size: var(--text-ui); color: var(--ink-body); background: var(--surface);
  border: var(--rule-w) solid var(--line); border-radius: var(--radius); padding: 8.5px 14px; min-width: 0;
}
textarea { resize: vertical; min-height: 72px; padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input[type="checkbox"] { accent-color: #000; width: 16px; height: 16px; padding: 0; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; font-family: var(--font); color: var(--ink-body); font-size: var(--text-ui); }
.drop { border: var(--rule-w) dashed var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; color: var(--ink-body); font-size: var(--text-ui); }
.drop.over { border-color: var(--ink); background: var(--surface-hover); }

/* ========== Buttons ========== */
/* Secondary is the default (outlined); primary is solid black; disabled is light grey. */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: flex-end; }
.actions.start { justify-content: flex-start; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-medium); font-size: var(--text-ui); height: var(--control-h); padding: 0 16px;
  border-radius: var(--radius); border: var(--rule-w) solid var(--ink); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none;
}
button.primary, .button.primary { background: var(--ink); color: #fff; }
button:hover, .button:hover { opacity: 0.85; }
button:disabled { background: var(--disabled); border-color: var(--disabled); color: #fff; cursor: not-allowed; opacity: 1; }
button.small { height: var(--control-h-small); padding: 0 12px; font-size: var(--text-small); }
button[aria-busy="true"], .button[aria-busy="true"] { cursor: progress; opacity: 0.7; }
button.link { height: auto; padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: var(--text-ui); }
/* Segmented control: outlined group, the pressed segment is solid black. */
.segmented { display: inline-flex; border: var(--rule-w) solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.segmented .seg { border: 0; border-radius: 0; height: var(--control-h); background: var(--surface); color: var(--ink); }
.segmented .seg + .seg { border-left: var(--rule-w) solid var(--ink); }
.segmented .seg[aria-pressed="true"] { background: var(--ink); color: #fff; }
.segmented .count { font-family: var(--font); opacity: 0.7; margin-left: 4px; }
/* Switch (the demo switch): outlined chip with a track and thumb. */
.switch { display: inline-flex; align-items: center; gap: var(--space-3); height: 38px; padding: 0 14px 0 10px; background: var(--surface); border: var(--rule-w) solid var(--ink); border-radius: var(--radius); font-family: var(--font-medium); font-size: var(--text-ui); justify-self: end; }
.switch .track { width: 34px; height: 18px; border-radius: 9px; background: var(--disabled); position: relative; transition: background var(--ease); }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: left var(--ease); }
.switch[aria-checked="true"] .track { background: var(--ink); }
.switch[aria-checked="true"] .thumb { left: 18px; }

/* ========== Lists and tables ========== */
/* A list with a grey header band: <ul class="list" data-header="Files">. */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list:not(:empty)::before { content: attr(data-header); display: block; background: var(--band); padding: 10px 12px; font-size: var(--text-ui); color: var(--ink); }
.list li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: 8px 12px; border-bottom: var(--rule-w) solid var(--rule); font-size: var(--text-ui); color: var(--ink-body); }
.list a { color: var(--ink); font-family: var(--font-medium); text-decoration: underline; text-underline-offset: 3px; }
.data { font-size: var(--text-small); font-variant-numeric: tabular-nums; color: var(--muted); }
/* Data table: grey header band (pinned when the table scrolls), thin row rules. */
.table-wrap { overflow: auto; border: var(--rule-w) solid var(--rule); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-ui); color: var(--ink-body); }
.table th { position: sticky; top: 0; z-index: 1; background: var(--band); text-align: left; font-weight: 400; color: var(--ink); padding: 10px 12px; }
.table td { padding: 10px 12px; border-bottom: var(--rule-w) solid var(--rule); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-hover); }
.table tbody tr.selected { background: var(--surface-selected); box-shadow: inset 3px 0 0 var(--ink); }
.table .sub { display: block; font-size: var(--text-caption); color: var(--muted); }
/* Check rows: status dot, text and detail, pill. */
.rows { list-style: none; margin: 0; padding: 0; display: grid; border: var(--rule-w) solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.rows li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 14px; padding: 10px 14px; border-bottom: var(--rule-w) solid var(--rule); align-items: start; font-size: var(--text-ui); color: var(--ink-body); }
.rows li:last-child { border-bottom: 0; }
.rows .detail { color: var(--muted); font-size: var(--text-small); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.stop { background: var(--stop); }

/* ========== Status: pills, states, tags ========== */
/* Outlined in the status color; text never on a colored fill. */
.pill, .state { font-family: var(--font-medium); font-size: var(--text-caption); padding: 2px 10px; border-radius: var(--radius); border: var(--rule-w) solid currentColor; white-space: nowrap; display: inline-block; }
.pill.ok, .state.complete { color: var(--ok); }
.pill.warn, .state.waiting { color: var(--warn); }
.pill.stop, .state.failed, .state.needs_attention, .state.budget_reached { color: var(--stop); }
.state.running, .state.collecting { color: var(--ink); }
.state.draft, .state.prechecked, .state.stopped { color: var(--muted); }
.tag { font-size: var(--text-caption); border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 1px 8px; color: var(--muted); white-space: nowrap; }
.tag.on { color: var(--ok); border-color: var(--ok); }
.tag.rec { color: var(--ink); border-color: var(--ink); }
.summary { display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: var(--text-ui); color: var(--ink-body); }
.summary b { font-family: var(--font-medium); font-weight: 400; color: var(--ink); }
.status-line { display: flex; gap: var(--space-4); align-items: center; font-family: var(--font-medium); font-size: var(--text-body); }
.live { font-family: var(--font-medium); font-size: var(--text-caption); color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 1.2s ease-in-out infinite; }

/* ========== Messages ========== */
/* Notice: a black left rule, not a box. */
.notice { border-left: var(--accent-w) solid var(--ink); padding: 4px 14px; font-size: var(--text-ui); display: grid; gap: var(--space-2); color: var(--ink-body); }
.notice strong { font-family: var(--font-medium); font-weight: 400; color: var(--ink); }
.notice.inline { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
/* Estimate / callout: a heavier left rule. */
.callout { border-left: 3px solid var(--ink); padding: 6px 12px; font-size: var(--text-ui); color: var(--ink-body); }
.callout b { font-family: var(--font-medium); font-weight: 400; color: var(--ink); }
/* Banner: outlined strip; error in red. */
.banner { border: var(--rule-w) solid var(--line); border-radius: var(--radius); padding: 10px 14px; font-size: var(--text-ui); color: var(--ink-body); }
.banner.error { border-color: var(--stop); color: var(--stop); }
/* Question waiting for the user: the only amber outline. */
.question { border: var(--rule-w) solid var(--warn); border-left-width: 4px; border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; }
.question b { font-family: var(--font-medium); font-weight: 400; color: var(--warn); font-size: var(--text-ui); }
.question p { color: var(--ink); font-size: var(--text-ui); white-space: pre-wrap; }

/* ========== Panels ========== */
.panel { border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 18px; display: grid; gap: var(--space-5); align-content: start; }
/* Section bar: grey band label above content. */
.band { background: var(--band); padding: 8px 12px; font-size: var(--text-ui); color: var(--ink); display: flex; align-items: center; gap: var(--space-3); }
/* Folding section: grey bar with a caret, optional action at the right. Use <details class="fold" open>. */
.fold { border: var(--rule-w) solid var(--rule); border-radius: var(--radius); }
.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); background: var(--band); padding: 6px 12px; min-height: 38px; cursor: pointer; font-size: var(--text-ui); color: var(--ink); }
.fold > summary::-webkit-details-marker { display: none; }
.fold-title { display: inline-flex; align-items: center; gap: var(--space-3); }
.fold-title::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); transition: transform var(--ease); margin-right: 2px; }
.fold[open] .fold-title::before { transform: rotate(45deg); margin-top: -4px; }
.fold-count { color: var(--muted); font-size: var(--text-small); }
.fold-body { padding: var(--space-4); display: grid; gap: var(--space-3); }
/* Activity feed: time column, one line per event; status lines in Medium. */
.feed { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; border: var(--rule-w) solid var(--rule); }
.feed li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--space-4); padding: 8px 12px; border-bottom: var(--rule-w) solid var(--rule); font-size: var(--text-ui); color: var(--ink-body); }
.feed li:last-child { border-bottom: 0; }
.feed .time { font-size: var(--text-caption); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }
.feed li.status { font-family: var(--font-medium); color: var(--ink); }
.feed li.message { background: var(--surface-hover); }
.feed li.you { background: var(--surface-subtle); }
.feed li.you > span:last-child::before { content: "You: "; font-family: var(--font-medium); }
.feed li.question { background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--warn); }
.feed li.new { animation: arrive 0.6s ease-out; }
/* Composer (message box). */
.chat { border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 14px; display: grid; gap: var(--space-3); }
.chat-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
/* Dialog: plain white sheet, the one shadow in the system. */
.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-dialog); color: var(--ink); }
.dialog::backdrop { background: var(--backdrop); }
.dialog form { padding: var(--space-8); display: grid; gap: var(--space-5); }
.dialog p { font-size: var(--text-ui); color: var(--ink-body); }
/* Loader: five grey dots. */
.spinner { display: inline-flex; }
.spinner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9e9e9e; box-shadow: 14px 0 #b0b0b0, 28px 0 #c2c2c2, 42px 0 #d4d4d4, 56px 0 #e6e6e6; margin-right: 56px; animation: pulse 1.2s ease-in-out infinite; }

/* ========== Long-form report (the gap report on the page) ========== */
.doc { font-size: var(--text-ui); color: var(--ink-body); }
.doc h1 { font-size: 18px; margin: 14px 0 6px; }
.doc h2 { font-size: 16px; margin: 18px 0 6px; }
.doc h3 { margin: 14px 0 6px; }
.doc p, .doc ul, .doc ol { margin: 6px 0; }
.doc table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: var(--text-small); }
.doc th { background: var(--band); text-align: left; font-weight: 400; padding: 6px 8px; }
.doc td { border-bottom: var(--rule-w) solid var(--rule); padding: 6px 8px; vertical-align: top; }

/* ========== Motion ========== */
@keyframes pulse { 50% { opacity: 0.4; } }
@keyframes arrive { from { background: #f0f0f0; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .switch .track, .switch .thumb, .fold-title::before { transition: none; }
  .live::before, .spinner::before, .feed li.new { animation: none; }
}

/* ========== Small screens ========== */
@media (max-width: 900px) {
  .site-header { grid-template-columns: auto 1fr; }
  .site-nav { grid-column: 2; }
  .demo-flag { grid-column: 1 / -1; grid-row: 2; }
  .bottom-bar { grid-template-columns: 1fr; justify-items: center; }
  .bottom-bar .help { grid-column: 1; }
  .switch { justify-self: center; }
}
@media (max-width: 760px) {
  .site-header { padding: 16px; }
  .site-nav { gap: 18px; font-size: var(--text-ui); }
  .page { padding-inline: 16px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .site-footer { padding: 12px 16px; }
  .welcome h1 { font-size: 26px; }
  .welcome-steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .welcome-steps li:nth-child(3) { border-left: 0; }
  .done-step { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .done-detail { grid-column: 2 / 4; white-space: normal; }
}
