/* Improve · portal · styles.css
 *
 * Every class is prefixed imp- so nothing collides with the docs-viewer's
 * imdoc- rules or with anything a future host might inject. The tokens are
 * the ones the widget reads from its hosts, with the widget's fallback values,
 * so the portal and the widget look like the same family.
 *
 * Light theme only. Small type, no external fonts, and the page body never
 * scrolls sideways: wide things scroll inside .imp-scroll or .imp-board.
 *
 * The colours, borders and corners are the shared Coryton look,
 * design/coryton.css (1.0.0, adopted 2026-11-13), which the build copies to
 * vendor/coryton.css and index.html loads before this file. Its tokens
 * (--navy, --teal, --ink, --ink-soft, --border, --line, --card, --paper,
 * --chip, --amber-bg, --amber-fg, --radius, --shadow, …) are not repeated
 * here: change the look there, for every app, not in this file.
 */

:root {
  /* Improve's own, on top of the shared ones. */
  --danger: var(--red);
}

* { box-sizing: border-box; }

/* A class that sets display (.imp-grid-2, .imp-field) beats the browser's
   own [hidden] rule, which once left the non-code Owner box showing for a
   code change, where its choice was discarded on Save. hidden means hidden. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 13px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

a { color: var(--teal); }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--navy); margin: 0 0 8px; line-height: 1.3; }
h1 { font-size: 20px; }
h2 { font-size: 16px; margin-top: 18px; }
h3 { font-size: 13.5px; margin-top: 14px; }
p { margin: 0 0 10px; }

/* ---- shell --------------------------------------------------------------- */

.imp-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* The estate's header (design/coryton.css .cy-header): navy, the teal rule,
   12px 24px, the app name at --text-xl. */
.imp-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding: 12px 24px;
  background: var(--navy); color: #fff;
  border-bottom: var(--header-rule) solid var(--teal);
}

/* "‹ Coryton Portal", the estate's button, to the left of the name. */
.imp-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.imp-brand {
  font-weight: 700; font-size: var(--text-xl); letter-spacing: 0.2px;
  color: #fff; text-decoration: none;
}
.imp-brand:hover { text-decoration: none; opacity: 0.9; }
.imp-brand { display: inline-flex; align-items: center; gap: 8px; }
.imp-brand-mark { display: block; border-radius: 5px; }

/* "← Coryton Portal": the way back to the front door, only when it sent
   the person here. Its look is the shared .cy-back (design/coryton.css),
   as in RFT Board, FleetBooking, Equipment Checks and Portal Admin. */
.imp-portal-back { white-space: nowrap; }
.imp-portal-back[hidden] { display: none; }

.imp-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.imp-nav a, .imp-nav summary {
  display: inline-block; padding: 5px 10px; border-radius: 4px;
  color: rgba(255, 255, 255, 0.85); text-decoration: none; font-weight: 600; font-size: 12.5px;
  cursor: pointer; list-style: none; white-space: nowrap;
}
.imp-nav summary::-webkit-details-marker { display: none; }
.imp-nav a:hover, .imp-nav summary:hover { background: rgba(255, 255, 255, 0.12); color: #fff; text-decoration: none; }
.imp-nav a.active, .imp-nav summary.active { background: rgba(255, 255, 255, 0.2); color: #fff; }

.imp-nav-apps { position: relative; }
.imp-menu {
  position: absolute; top: 100%; left: 0; z-index: 30; min-width: 180px; margin-top: 4px;
  background: var(--card); color: var(--ink); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15); padding: 4px;
}
.imp-menu a {
  display: block; padding: 6px 10px; border-radius: 4px; color: var(--ink);
  font-weight: 500; font-size: 12.5px;
}
.imp-menu a:hover { background: var(--chip); text-decoration: none; }
.imp-menu a.active { background: var(--chip); color: var(--navy); font-weight: 700; }
.imp-menu .imp-muted { display: block; padding: 6px 10px; }

.imp-session {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(255, 255, 255, 0.85);
}
.imp-session strong { color: #fff; }
.imp-session .imp-btn { color: #fff; border-color: rgba(255, 255, 255, 0.35); background: transparent; min-height: 30px; padding: 5px 11px; font-size: 12px; }
.imp-session .imp-btn:hover { background: rgba(255, 255, 255, 0.12); }

.imp-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 6px 18px; font-size: 12px;
  background: var(--amber-bg); color: var(--amber-fg); border-bottom: 1px solid #fde68a;
}
.imp-banner[hidden] { display: none; }
.imp-banner .imp-btn { padding: 2px 8px; font-size: 11.5px; }
.imp-banner--live { background: #e0f2fe; color: #075985; border-bottom-color: #bae6fd; }

.imp-main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 18px; }

/* ---- strips and tiles ---------------------------------------------------- */

.imp-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px;
}
.imp-strip-item {
  flex: 1 1 140px; min-width: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; font-size: 12px; color: var(--ink-soft); box-shadow: var(--shadow);
}
.imp-strip-item strong { display: block; font-size: 17px; color: var(--navy); line-height: 1.2; }
.imp-strip-item a { color: inherit; }
.imp-strip-item.imp-warn { color: var(--amber-fg); }
.imp-strip-item.imp-warn strong { color: var(--amber-fg); }

.imp-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px;
}
.imp-tile {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
a.imp-tile:hover { border-color: var(--teal); text-decoration: none; }
.imp-tile-n { font-size: 24px; font-weight: 800; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.imp-tile-l { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }

/* ---- cards --------------------------------------------------------------- */

.imp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.imp-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap;
}
.imp-card-head[data-id], .imp-card-head[data-open] { cursor: pointer; }
.imp-title { font-weight: 600; font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.imp-title a { color: inherit; text-decoration: none; }
.imp-title a:hover { text-decoration: underline; }
.imp-meta { margin-top: 5px; font-size: 11px; color: var(--ink-soft); overflow-wrap: anywhere; }
.imp-meta a { color: inherit; }

.imp-badge {
  flex: none; display: inline-block; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 3px; white-space: nowrap; line-height: 1.4;
}

/* The reporter's answers on an Inbox card: label / answer pairs, only the
 * questions that were answered. Small, so the card stays a card. */
.imp-brief {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px;
  margin: 6px 0 0; font-size: 12px;
}
.imp-brief dt { color: var(--ink-soft); white-space: nowrap; }
.imp-brief dd { margin: 0; overflow-wrap: anywhere; }

.imp-chip {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px;
  border-radius: 10px; background: var(--chip); color: var(--ink-soft); white-space: nowrap; line-height: 1.6;
}
.imp-chip--blocked   { background: #fee2e2; color: #991b1b; }
.imp-chip--slow      { background: #ffedd5; color: #9a3412; }
.imp-chip--annoyance { background: #fef9c3; color: #854d0e; }
.imp-chip--idea      { background: #dbeafe; color: #1e40af; }
/* Raised in-house: the owner's plan, an audit finding, something parked. */
.imp-chip--inhouse   { background: #ccfbf1; color: #115e59; }

.imp-source {
  display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 0 5px; border-radius: 3px; border: 1px solid var(--border); color: var(--ink-soft); line-height: 1.7;
  vertical-align: middle;
}
.imp-source[data-src="index"]  { border-color: #a7f3d0; color: #065f46; background: #ecfdf5; }
.imp-source[data-src="github"] { border-color: #c7d2fe; color: #3730a3; background: #eef2ff; }
.imp-source[data-src="portal"] { border-color: #fde68a; color: #92400e; background: #fffbeb; }

.imp-warn {
  padding: 8px 10px; margin: 0 0 10px; border-radius: 4px;
  background: var(--amber-bg); color: var(--amber-fg); font-size: 12px;
}
.imp-warn a { color: inherit; }

.imp-empty {
  padding: 22px 16px; text-align: center; color: var(--ink-soft); font-style: italic;
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); margin: 0 0 10px;
}
.imp-empty strong { font-style: normal; color: var(--ink); }

.imp-note {
  margin: 6px 0 10px; padding: 6px 0 6px 10px; font-size: 12px; color: var(--ink-soft);
  border-left: 2px solid var(--line);
}

.imp-muted { color: var(--ink-soft); }
.imp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
pre.imp-mono { background: var(--chip); padding: 10px 12px; border-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- tables -------------------------------------------------------------- */

.imp-scroll { overflow-x: auto; max-width: 100%; margin: 0 0 12px; -webkit-overflow-scrolling: touch; }

.imp-table { border-collapse: collapse; width: 100%; font-size: 12.5px; background: var(--card); }
.imp-table th {
  text-align: left; padding: 7px 10px; background: var(--chip); color: var(--navy);
  border-bottom: 2px solid var(--border); white-space: nowrap; font-size: 11.5px;
}
.imp-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.imp-table tr[data-id] { cursor: pointer; }
.imp-table tr[data-id]:hover td { background: #f8fafc; }
.imp-table .imp-num { text-align: right; font-variant-numeric: tabular-nums; }
/* In a narrow cell a nowrap badge is clipped mid-word; wrapping beats that. */
.imp-table .imp-badge { white-space: normal; }

/* ---- board --------------------------------------------------------------- */

/* The six lanes share the width and fit side by side from about 1240px;
   narrower, the board scrolls sideways. Its height is capped so that
   scrollbar is on screen rather than below the longest lane, and it is
   drawn always, not only on hover (overlay scrollbars on macOS and iPad
   hid it in the 2026-11 walkthrough). */
.imp-board {
  display: flex; gap: 10px; align-items: flex-start;
  overflow: auto; padding: 2px 2px 12px; margin: 0 0 14px;
  max-height: calc(100vh - 150px); min-height: 320px;
  scrollbar-width: auto; scrollbar-color: #94a3b8 #e2e8f0;
}
.imp-board::-webkit-scrollbar { height: 12px; width: 12px; }
.imp-board::-webkit-scrollbar-track { background: #e2e8f0; border-radius: 6px; }
.imp-board::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 6px; border: 2px solid #e2e8f0; }
.imp-column {
  flex: 1 1 0; min-width: 185px; max-width: 320px;
  background: #eef2f6; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px;
}
.imp-column-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--navy); margin: 0 2px 8px; display: flex; justify-content: space-between; gap: 6px;
}
.imp-column-head .imp-chip { text-transform: none; letter-spacing: 0; }
/* A lane drawn ahead of the process behind it (the Vizora release gate). */
.imp-column--to-follow { background: #f5f3ff; border: 1px dashed #6d28d9; }
.imp-column--to-follow .imp-column-head { color: #5b21b6; }
.imp-bcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 8px 10px; margin-bottom: 8px; font-size: 12px; box-shadow: var(--shadow); cursor: pointer;
}
.imp-bcard:hover { border-color: var(--teal); }
a.imp-bcard { display: block; color: inherit; text-decoration: none; }
a.imp-bcard:hover { text-decoration: none; }

/* ---- job page ------------------------------------------------------------ */

.imp-job-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; margin: 0 0 12px; }
.imp-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.imp-steps li { padding: 6px 8px; border-radius: 4px; background: var(--card); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-soft); }
.imp-steps li.done { background: var(--navy); border-color: var(--navy); color: #fff; }
.imp-steps li.here { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; box-shadow: 0 0 0 2px var(--teal); }
.imp-steps li.to-follow:not(.done):not(.here) { border-style: dashed; border-color: #6d28d9; color: #5b21b6; }
.imp-job-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.imp-job-main { flex: 999 1 460px; min-width: 0; margin: 0; }
.imp-job-panel, .imp-job-side { flex: 1 1 300px; min-width: 0; margin: 0; }
.imp-job-panel--primary { border: 2px solid var(--teal); }
/* Handed over, waiting for GitHub to register the issue (screens/job.js). */
.imp-landing-steps { list-style: none; margin: 4px 0 12px; padding: 0; font-size: 13px; }
.imp-landing-steps li { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--ink-soft); }
.imp-landing-steps li.done { color: var(--ink); }
.imp-landing-steps li.here { color: var(--ink); font-weight: 600; }
.imp-spinner {
  display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--teal); animation: imp-spin 0.9s linear infinite;
}
@keyframes imp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .imp-spinner { animation: none; border-top-color: var(--teal); } }
.imp-checklist { display: flex; flex-direction: column; gap: 6px; }
.imp-checklist label { display: flex; gap: 8px; align-items: flex-start; }
.imp-code { background: var(--chip); border-radius: 4px; padding: 8px 10px; overflow-x: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 0 0 10px; }
.imp-error { color: var(--danger); }
/* The review, on a job whose pull request is open: four tiles in order. */
.imp-review-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.imp-review-col { display: grid; gap: 10px; min-width: 0; }
@media (max-width: 900px) { .imp-review-split { grid-template-columns: minmax(0, 1fr); } }
.imp-review-tile { border-left: 4px solid var(--line); }
.imp-review-tile h3 { font-size: 14px; }
.imp-review-tile p { margin: 0 0 8px; }
.imp-review-tile--good { border-left-color: #15803d; }
.imp-review-tile--warn { border-left-color: #b45309; background: #fffbeb; }
.imp-review-tile--bad { border-left-color: var(--danger); background: #fef2f2; }
.imp-copilot-plan { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); max-height: 420px; overflow: auto; }
.imp-copilot-plan summary { font-weight: 600; font-size: 12.5px; cursor: pointer; }
.imp-testing { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); max-height: 520px; overflow: auto; }
.imp-testing-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.imp-testing-head .imp-btn { margin-left: auto; padding: 2px 8px; }
.imp-metrics { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 12.5px; }
.imp-metrics dt { color: var(--muted, #667085); }
.imp-metrics dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; }
.imp-add { color: #15803d; } .imp-del { color: var(--danger); }
.imp-chosen:empty { display: none; }
.imp-chosen { margin: 6px 0; display: grid; gap: 6px; }
.imp-chosen-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.imp-chosen-head .imp-btn { padding: 2px 8px; }
.imp-chosen-list { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: 12.5px; }
.imp-chip-thumb { padding: 0; border: 0; background: none; cursor: zoom-in; line-height: 0; }
.imp-chip-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.imp-chip-kind { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 4px; background: var(--chip, #eef0f4); font-size: 10.5px; font-weight: 700; }
.imp-chip-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-chip-size { color: var(--muted, #667085); font-variant-numeric: tabular-nums; }
.imp-chip-x { border: 0; background: none; color: var(--danger); cursor: pointer; font: inherit; font-size: 12px; padding: 2px 4px; }
.imp-chip-x:hover { text-decoration: underline; }
.imp-lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(15, 20, 30, 0.82); cursor: zoom-out; }
.imp-lightbox figure { margin: 0; display: grid; gap: 8px; max-width: 100%; max-height: 100%; }
.imp-lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; background: #fff; border-radius: 4px; }
.imp-lightbox figcaption { color: #fff; font-size: 13px; text-align: center; }
.imp-review-back { display: grid; gap: 6px; margin: 0 0 12px; }
.imp-btn.imp-btn--back { width: 100%; font-size: 15px; padding: 12px 16px; border-width: 2px; border-color: #b45309; color: #b45309; }
.imp-btn.imp-btn--back:hover { background: #fffbeb; }
.imp-seg { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.imp-seg-btn { font: inherit; font-size: 12.5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); cursor: pointer; }
.imp-seg-btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.imp-seg-btn:disabled { opacity: 0.55; cursor: not-allowed; background: var(--chip); }
.imp-chat { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; max-height: 480px; overflow-y: auto; }
.imp-msg { padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); font-size: 12.5px; }
.imp-msg--you { background: #eef2f6; }
.imp-msg--claude { border-color: var(--teal); }
.imp-msg--tool { background: var(--chip); font-size: 12px; }
/* ---- the agent tabs' guided panel (screens/guide.js) ---------------------- */
.imp-guide { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.imp-guide-steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.imp-guide-steps li { display: flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: var(--radius-sm); background: var(--chip); color: var(--ink-soft); font-size: 11.5px; line-height: 1.25; min-width: 0; }
.imp-guide-steps li.done { background: var(--green-bg); color: var(--green-fg); }
.imp-guide-steps li.here { background: var(--navy); color: #fff; font-weight: 700; box-shadow: 0 0 0 2px var(--teal); }
.imp-guide-n { flex: 0 0 auto; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: rgba(255, 255, 255, 0.65); color: inherit; font-size: 10.5px; font-weight: 700; }
.imp-guide-steps li.here .imp-guide-n { background: var(--teal); color: #fff; }
.imp-guide-now { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.imp-guide-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-soft); transform: translateY(1px); }
.imp-guide-dot--you, .imp-guide-dot--tests { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.imp-guide-dot--agent { background: var(--teal); box-shadow: 0 0 0 3px var(--info-bg); animation: imp-pulse 1.6s ease-in-out infinite; }
.imp-guide-dot--reviewer { background: var(--navy); }
.imp-guide[data-sure="no"] .imp-guide-now { font-weight: 500; color: var(--ink-soft); }
@keyframes imp-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .imp-guide-dot--agent { animation: none; } }
.imp-callout { margin: 0 0 10px; padding: 12px 14px; border-radius: var(--radius); border: 2px solid var(--amber); background: var(--amber-bg); color: var(--ink); }
.imp-callout h3 { margin: 0 0 6px; font-size: 15px; color: var(--amber-fg); }
.imp-callout p { margin: 0 0 8px; }
.imp-callout .imp-actions { margin: 4px 0 0; }
.imp-callout-list { margin: 0 0 8px; padding-left: 22px; font-size: 13.5px; font-weight: 600; }
.imp-callout-list li { margin: 0 0 4px; }
.imp-callout-step { padding: 6px 8px; border-radius: var(--radius-sm); background: var(--card); font-size: 12.5px; overflow-wrap: anywhere; }
.imp-callout-checks { margin: 8px 0 0; font-size: 12.5px; }
.imp-callout--preview { border-color: var(--green); background: var(--green-bg); }
.imp-callout--preview h3 { color: var(--green-fg); }
.imp-callout--review { border-color: var(--teal); background: var(--info-bg); }
.imp-callout--review h3 { color: var(--info-fg); }
.imp-callout--failed, .imp-callout--stopped { border-color: var(--red); background: var(--red-bg); }
.imp-callout--failed h3, .imp-callout--stopped h3 { color: var(--red-fg); }
.imp-callout--working { border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); font-size: 12.5px; padding: 8px 12px; }
.imp-callout--working strong { color: var(--ink); }
.imp-also { margin: 0 0 10px; padding: 6px 10px; border-left: 4px solid var(--navy); border-radius: var(--radius-sm); background: var(--chip); font-size: 12.5px; }
.imp-also--tried { border-left-color: var(--ink-soft); }
/* Every attempt on a job, in the GitHub side panel: merged, open, closed. */
.imp-attempts { list-style: none; margin: 0 0 10px; padding: 0; }
.imp-attempts li { margin: 0 0 6px; padding: 5px 8px; border-left: 4px solid var(--border); border-radius: var(--radius-sm); background: var(--chip); font-size: 13px; }
.imp-attempts li[data-state="merged"] { border-left-color: var(--green); }
.imp-attempts li[data-state="open"], .imp-attempts li[data-state="draft"] { border-left-color: var(--navy); }
.imp-attempts-summary { margin: 0 0 8px; font-size: 13px; }
.imp-finished-note { margin: 12px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--chip); color: var(--ink-soft); font-size: 13px; }
.imp-how { margin: 0 0 10px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); font-size: 12.5px; }
.imp-how summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.imp-how ol { margin: 6px 0; padding-left: 20px; }
.imp-how li { margin: 0 0 3px; }
.imp-how p { margin: 4px 0 2px; }
.imp-changes { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-soft); }
.imp-plan { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius); background: var(--card); }
.imp-plan summary { cursor: pointer; font-size: 13.5px; }
.imp-plan-body { max-height: 420px; overflow: auto; margin-top: 6px; }
.imp-chat-note { margin: 0; padding: 2px 4px; font-size: 11.5px; color: var(--ink-soft); text-align: center; }
.imp-chat-tool { text-align: left; }
.imp-msg-head { margin: 0 0 3px; }
.imp-msg--you { align-self: flex-end; max-width: 88%; }
.imp-msg--agent { align-self: flex-start; max-width: 92%; border-color: var(--teal); }
.imp-msg--brief { align-self: stretch; max-width: none; }
.imp-msg--brief summary { cursor: pointer; color: var(--ink-soft); }
.imp-msg--pending { opacity: 0.7; border-style: dashed; }
.imp-msg--sent { opacity: 1; border-style: solid; }
.imp-msg-seen { margin-top: 4px; font-size: 11.5px; color: var(--ink-soft); text-align: right; }
.imp-msg .imdoc-body, .imp-msg .imdoc { font-size: 12.5px; }
.imp-msgbox { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.imp-msgbox-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 0 0 4px; }
.imp-msgbox-head .imp-label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.imp-quick { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.imp-msgbox[data-sending] textarea { opacity: 0.6; }
@media (max-width: 700px) {
  .imp-guide-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .imp-guide-now { font-size: 13.5px; }
  .imp-msg--you, .imp-msg--agent { max-width: 100%; }
}
.imp-more { margin: 10px 0 0; }
.imp-more summary { cursor: pointer; color: var(--teal); font-size: 12.5px; }
.imp-steps-guide { margin: 6px 0 0; padding-left: 20px; font-size: 12.5px; }
.imp-attach { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 0; font-size: 12.5px; }
.imp-skills { flex: 1 1 100%; }
.imp-skill-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.imp-skill-list li { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: var(--card); }
.imp-choices { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.imp-choice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.imp-choice:has(input:checked) { border-color: var(--teal); background: #f0fdfa; }
@media (max-width: 700px) { .imp-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.imp-bcard .imp-title { font-size: 12.5px; }
.imp-bcard .imp-meta { margin-top: 4px; }
.imp-bcard .imp-badge { margin-top: 6px; white-space: normal; }

/* ---- drawer -------------------------------------------------------------- */

.imp-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: 100%; max-width: 560px; height: 100%;
  background: var(--card); border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.18);
  overflow-y: auto; overflow-x: hidden;
  transform: translateX(105%); transition: transform 0.2s ease-out;
  visibility: hidden;
}
.imp-drawer.imp-drawer-open,
body.imp-drawer-open .imp-drawer { transform: translateX(0); visibility: visible; }

.imp-drawer-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border);
}
.imp-drawer-head h2, .imp-drawer-head .imp-title { margin: 0; font-size: 15px; }
.imp-drawer-body { padding: 14px 16px 30px; }
.imp-drawer-close {
  flex: none; font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
  background: transparent; border: 0; color: var(--ink-soft); padding: 2px 6px; border-radius: 4px;
}
.imp-drawer-close:hover { background: var(--chip); color: var(--ink); }

/* ---- forms --------------------------------------------------------------- */

.imp-form { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; }
.imp-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.imp-label {
  display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--navy);
}
.imp-input, .imp-select, .imp-textarea {
  width: 100%; padding: 7px 9px; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.imp-input:focus, .imp-select:focus, .imp-textarea:focus { outline: 2px solid rgba(15, 118, 110, 0.35); border-color: var(--teal); }
.imp-textarea { resize: vertical; min-height: 72px; }
.imp-input:disabled, .imp-select:disabled, .imp-textarea:disabled { background: var(--chip); color: var(--ink-soft); }

.imp-btn {
  display: inline-block; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card); color: var(--ink); text-decoration: none; line-height: 1.4;
}
.imp-btn:hover { background: var(--chip); text-decoration: none; }
.imp-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.imp-btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.imp-btn--primary:hover { background: #115e59; }
.imp-btn--quiet { background: transparent; border-color: transparent; color: var(--ink-soft); text-decoration: underline; }
.imp-btn--quiet:hover { background: transparent; color: var(--ink); }
.imp-btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.imp-btn--danger:hover { background: #fef2f2; }
.imp-btn--lg { font-size: 14px; padding: 9px 18px; }

/* An app page's header actions: Raise, Run an audit. */
.imp-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* A modal saying something, never a form people fill in. */
.imp-dialog {
  max-width: 520px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; background: var(--card); color: var(--ink); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}
.imp-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.imp-dialog p { font-size: 13px; line-height: 1.5; }

.imp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.imp-actions .imp-muted { font-size: 11.5px; }

/* ---- charts and timelines ------------------------------------------------ */

.imp-bars { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; }
.imp-bar {
  display: grid; grid-template-columns: minmax(70px, 1fr) minmax(0, 3fr) auto;
  align-items: center; gap: 8px; font-size: 12px; min-width: 0;
}
.imp-bar-l { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-bar-v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 2ch; }
.imp-bar svg { display: block; width: 100%; height: 12px; overflow: visible; }
.imp-bar svg rect { fill: var(--teal); }
.imp-bars svg, .imp-tile svg, .imp-card svg { max-width: 100%; height: auto; }

.imp-timeline { list-style: none; margin: 0 0 12px; padding: 0; border-left: 2px solid var(--line); }
.imp-tl-row {
  position: relative; display: grid; grid-template-columns: minmax(80px, 130px) minmax(0, 1fr) auto;
  gap: 6px 10px; align-items: baseline; padding: 4px 0 4px 12px; font-size: 12px;
}
.imp-tl-row::before {
  content: ""; position: absolute; left: -5px; top: 10px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--teal);
}
.imp-tl-row .imp-muted:first-child, .imp-tl-row > b, .imp-tl-row > strong { color: var(--navy); }
.imp-tl-row time { color: var(--ink-soft); white-space: nowrap; }

.imp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 12px; }

/* The docs-viewer styles its own imdoc- classes; only spacing is ours. */
.imdoc { margin: 6px 0 16px; }
.imp-card .imdoc, .imp-drawer .imdoc { max-width: none; }

/* ---- toast --------------------------------------------------------------- */

.imp-toast-host {
  position: fixed; left: 0; right: 0; bottom: 20px; z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.imp-toast {
  background: #111827; color: #fff; padding: 9px 16px; border-radius: 6px; font-size: 12.5px;
  max-width: min(92vw, 520px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0; transform: translateY(12px); transition: opacity 0.2s, transform 0.2s;
}
.imp-toast.imp-toast-show { opacity: 1; transform: translateY(0); }

/* ---- sign-in ------------------------------------------------------------- */

.imp-signin { max-width: 440px; margin: 40px auto; }
/* Sign in with Microsoft (lib/signin.js draws the button, cysi-btn). Only
   present when config.js signIn.mode, or ?signin= on the address, turns it on. */
.imp-signin-ms { margin: 4px 0 2px; }
.imp-signin-ms .cysi-btn { max-width: none; }
.imp-signin-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--ink-soft, #566079); font-size: 12.5px; }
.imp-signin-or::before, .imp-signin-or::after { content: ''; flex: 1; border-top: 1px solid var(--line, #d9dfe8); }
.imp-signin-error { margin: 0 0 12px; padding: 8px 10px; border-radius: var(--radius-sm, 6px); background: var(--red-bg, #fee2e2); color: var(--red-fg, #991b1b); }
.imp-signin-leaving { text-align: center; }
/* Microsoft only (config.js passwordForm: false): the button is the whole sign-in. */
.imp-signin--ms-only form[data-form="signin"], .imp-signin--ms-only #imp-signin-msg { display: none; }
.imp-people { display: flex; flex-direction: column; gap: 6px; }
.imp-people .imp-btn { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 9px 12px; }
.imp-people .imp-btn .imp-muted { font-weight: 400; font-size: 11.5px; }

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 720px) {
  .imp-header { padding: 10px 16px; }
  .imp-main { padding: 12px; }
  .imp-session { margin-left: 0; width: 100%; }
  .imp-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .imp-tl-row { grid-template-columns: minmax(0, 1fr) auto; }
  .imp-tl-row > :nth-child(2) { grid-column: 1 / -1; }
  .imp-column { flex-basis: 220px; max-width: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  .imp-drawer, .imp-toast { transition: none; }
}

/* ---- annotated screens in the drawer (screens/detail.js) ----------------- */

.imp-shot { margin: 0 0 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.imp-shot img { display: block; width: 100%; height: auto; cursor: zoom-in; background: var(--chip); }
.imp-shot figcaption { padding: 8px 10px; font-size: 12px; color: var(--ink); }
.imp-shot figcaption > div { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.imp-pins { margin: 6px 0 0; padding-left: 20px; }
.imp-pins li { margin: 2px 0; overflow-wrap: anywhere; }
/* Full size: the picture over everything, click again to put it back. */
.imp-shot--zoom { position: fixed; inset: 0; z-index: 200; margin: 0; border: 0; border-radius: 0;
  background: rgba(15, 23, 42, 0.92); overflow: auto; display: flex; flex-direction: column; }
.imp-shot--zoom img { width: auto; max-width: 100%; margin: auto; cursor: zoom-out; background: none; }
.imp-shot--zoom figcaption { color: #fff; background: rgba(0, 0, 0, 0.35); }
