/* Tracx Support Agent — operator app styles.
   One small design system: colour tokens, a spacing scale, consistent controls (buttons, inputs,
   selects), cards, tables, pills and the timeline. Icons are inline SVG (see wsa/web/icons.py)
   and inherit currentColor, so they follow the text colour of whatever holds them. */

:root {
  --navy: #1b2a4a; --navy-2: #243659; --navy-3: #2c4270;
  --bg: #f4f6fb; --card: #fff; --line: #e6e9f0; --line-2: #d5dae3;
  --text: #1f2937; --muted: #6b7280; --faint: #9ca3af;
  --blue: #2f6fed; --blue-bg: #e8f0fe;
  --btn-blue: #468ad4; --btn-blue-hover: #3a76b8;  /* buttons: the logo blue */
  --green: #16a34a; --green-bg: #e7f7ec; --amber: #b45309; --amber-bg: #fff4dd;
  --red: #c2410c; --red-bg: #fde8e8; --gray-bg: #eef1f6;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --ring: 0 0 0 3px rgba(70, 138, 212, .25);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--gray-bg); padding: 1px 6px; border-radius: 6px; }
pre code { background: none; padding: 0; }
.ic { flex: none; vertical-align: -3px; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 256px; flex: none; background: linear-gradient(100deg, #424d64 0%, #2b3956 55%, #1f2e4c 100%);  /* slate on the left fading to navy */ color: #cbd5e1; padding: var(--s5) var(--s4); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: var(--s3); align-items: center; color: #fff; padding: var(--s1) var(--s2) var(--s6); }
.brand .logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; display: block; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.brand b { display: block; letter-spacing: .08em; font-size: 15px; }
.brand small { font-size: 10.5px; letter-spacing: .16em; color: #9fb0cc; }
.menu h6 { margin: var(--s4) var(--s3) var(--s2); font-size: 11px; letter-spacing: .14em; color: #8ea0bf; font-weight: 600; }
.menu a { display: flex; align-items: center; gap: var(--s3); padding: 9px var(--s3); border-radius: var(--radius-sm); color: #d6deeb; margin-bottom: 2px; font-weight: 500; position: relative; }
.menu a .ic { opacity: .85; }
.menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.menu a.active { background: var(--navy-3); color: #fff; }
.menu a.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--btn-blue); }
.menu a .count { margin-left: auto; }
.sidebar .version { margin-top: auto; font-size: 12px; color: #8ea0bf; padding: var(--s2) var(--s3); display: flex; align-items: center; gap: var(--s2); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: var(--s3); padding: var(--s3) var(--s7); background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.content { padding: var(--s6) var(--s7) 48px; max-width: 1400px; width: 100%; }

/* ---------- page header ---------- */
.crumbs { color: var(--muted); font-size: 13.5px; margin-bottom: var(--s1); display: flex; align-items: center; gap: 6px; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head .actions { width: auto; }
h1 { margin: 0 0 var(--s1); font-size: 26px; letter-spacing: -.01em; display: flex; align-items: center; gap: var(--s3); }
h1 .pill { font-size: 12.5px; }
h1 .ico-h { width: 38px; height: 38px; border-radius: 11px; background: var(--blue-bg); color: var(--btn-blue); display: grid; place-items: center; flex: none; }
h1 .ico-h .ic { width: 21px; height: 21px; }
.sub { color: var(--muted); margin: 0; max-width: 72ch; }
.page-head + .card, .sub + .card, .sub + .grid-2, .sub + .grid-4 { margin-top: var(--s5); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5) var(--s6); margin-bottom: var(--s5); box-shadow: var(--shadow); }
.card h2 { margin: 0 0 var(--s1); font-size: 17px; display: flex; align-items: center; gap: var(--s2); }
.card h2 .ic { color: var(--btn-blue); }
.card .hint { color: var(--muted); font-size: 14px; margin: 0 0 var(--s4); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.card-head h2 { margin: 0; }
.row { display: flex; gap: var(--s5); align-items: stretch; }
.row > * { flex: 1; min-width: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s5); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--s5); }
.grid-2 > * { min-width: 0; }

/* ---------- pills, counts, tiles ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--gray-bg); color: var(--muted); white-space: nowrap; line-height: 1.5; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.plain::before { display: none; }
.pill .ic { width: 14px; height: 14px; }
a.pill:hover { text-decoration: none; filter: brightness(.96); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--gray-bg); color: var(--muted); font-size: 12px; font-weight: 600; margin-left: var(--s1); }
.tabs a.active .count { background: var(--blue-bg); color: var(--blue); }
.menu a .count { background: var(--btn-blue); color: #fff; }
.tile { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); }
.tile h6 { margin: 0 0 var(--s2); font-size: 11.5px; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.tile .n { font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: var(--s2); letter-spacing: -.02em; }
.tile .d { color: var(--muted); font-size: 13.5px; }
.tile .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tile .ico .ic { width: 22px; height: 22px; }
.ico.blue { background: var(--blue-bg); color: var(--blue); } .ico.green { background: var(--green-bg); color: var(--green); }
.ico.amber { background: var(--amber-bg); color: var(--amber); } .ico.red { background: var(--red-bg); color: var(--red); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--s6)); padding: 0 var(--s6); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; letter-spacing: .1em; color: var(--muted); padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table:not(:has(tbody)) tr:not(:first-child):hover td { background: #fafbfe; }
td .t2 { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
td .err { color: var(--red); font-size: 13.5px; margin-top: 2px; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin: -6px 0 var(--s4); flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a.active { color: var(--blue); border-color: var(--blue); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs.buttons { border-bottom: 0; gap: var(--s2); margin: 0; padding: var(--s1) 0 var(--s4); }
.tabs.buttons a { padding: 6px 14px; line-height: 1.35; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; color: var(--text); font-weight: 600; margin: 0; }
.tabs.buttons a:hover { background: #f8fafc; }
.tabs.buttons a.active { background: var(--btn-blue); border-color: var(--btn-blue); color: #fff; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: #fff; color: var(--text); cursor: pointer; font: inherit; font-weight: 600; line-height: 1; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn .ic { width: 16px; height: 16px; }
.btn:hover { background: #f8fafc; text-decoration: none; border-color: #c7cdd8; }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--btn-blue); border-color: var(--btn-blue); color: #fff; }
.btn.primary:hover { background: var(--btn-blue-hover); border-color: var(--btn-blue-hover); }
.btn.danger { color: var(--red); border-color: #f3c7b8; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13.5px; }
.btn.sm .ic { width: 14px; height: 14px; }
.btn.ghost { border-color: transparent; color: var(--blue); background: transparent; }
.btn.ghost:hover { background: var(--blue-bg); }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.chip:hover { background: #f8fafc; }
.chip.active { border-color: var(--btn-blue); color: var(--btn-blue); background: var(--blue-bg); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; width: 100%; min-width: 0; }
.actions > form.inline { display: flex; flex: 1 1 220px; min-width: 0; }
.inline { display: inline-flex; gap: var(--s2); align-items: center; }
.mt { margin-top: var(--s4); }
.muted { color: var(--muted); }
.right { text-align: right; }

/* ---------- form controls ---------- */
label { display: block; font-weight: 600; margin: var(--s3) 0 6px; font-size: 14px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=search], input[type=email], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: inherit; color: var(--text); background: #fff;
  transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 10px 12px; min-height: 90px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #c7cdd8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--btn-blue); box-shadow: var(--ring); }
input[readonly] { background: #f8fafc; color: var(--muted); }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
select.auto { width: auto; }
input.short { width: 130px; }
.field { display: flex; align-items: center; gap: var(--s2); }
.field-icon { position: relative; flex: 1 1 220px; min-width: 0; }
.field-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.field-icon input, .field-icon select { padding-left: 36px; }
.field-hint { color: var(--muted); font-size: 13px; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.field-hint .ic { margin-top: 2px; }
.keyrow { display: flex; gap: var(--s2); align-items: center; width: 100%; min-width: 0; }
.keyrow input.keymask { flex: 1; min-width: 0; user-select: none; -webkit-user-select: none; cursor: default; letter-spacing: .12em; }
.verify-result { display: inline-block; flex: 1 1 auto; min-width: 0; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: var(--s3); font-weight: 600; cursor: pointer; margin: 0; }
.toggle input { display: none; }
.toggle .sw { width: 46px; height: 26px; border-radius: 999px; background: #cbd5e1; position: relative; transition: .15s; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.toggle input:checked + .sw { background: var(--green); }
.toggle input:checked + .sw::after { left: 23px; }
.switch-box { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: var(--s3) var(--s4); margin-top: var(--s4); }

/* ---------- dashboard ---------- */
.agent-head { display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap; }
.agent-head > div:not(.ico):not(.right) { flex: 1 1 260px; min-width: 0; }
.agent-head .ico { width: 60px; height: 60px; border-radius: 16px; background: var(--blue-bg); color: var(--btn-blue); display: grid; place-items: center; flex: none; }
.agent-head .ico .ic { width: 30px; height: 30px; }
.agent-head.off .ico { background: var(--gray-bg); color: var(--muted); }
.agent-head h2 { margin: 0; font-size: 19px; }
.agent-head p { margin: 2px 0 0; color: var(--muted); }
.agent-head .right { margin-left: auto; border: 1px solid var(--line); border-radius: 10px; padding: var(--s3) var(--s4); }
.kicker { margin: 0 0 var(--s2); font-size: 11.5px; letter-spacing: .12em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.kicker .value { margin-left: auto; letter-spacing: 0; font-weight: 600; color: var(--text); background: var(--gray-bg); border-radius: 999px; padding: 1px 8px; }
.kicker .muted { letter-spacing: 0; font-weight: 400; text-transform: none; }
.note { display: flex; gap: var(--s2); color: var(--muted); font-size: 13.5px; padding: var(--s3) 0 0; border-top: 1px solid var(--line); margin-top: var(--s4); align-items: flex-start; }
.note .ic { margin-top: 2px; }
.dashed { border: 1px dashed var(--line-2); border-radius: 10px; padding: var(--s4); color: var(--muted); display: flex; align-items: center; gap: var(--s2); }
.banner { display: flex; gap: var(--s3); align-items: flex-start; border-left: 4px solid var(--red); background: #fff; border-radius: 10px; padding: var(--s3) var(--s4); margin-bottom: var(--s5); box-shadow: var(--shadow); }
.banner .ic { color: var(--red); margin-top: 2px; }
.banner b { color: var(--red); }
.banner.ok { border-color: var(--green); } .banner.ok b, .banner.ok .ic { color: var(--green); }
.flash { display: flex; gap: var(--s2); align-items: center; padding: var(--s3) var(--s4); border-radius: 10px; margin-bottom: var(--s5); background: var(--green-bg); color: var(--green); font-weight: 600; }
.flash.bad { background: var(--red-bg); color: var(--red); }

/* ---------- timeline / approvals / kv ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: var(--s3); padding: 9px 0; align-items: flex-start; }
.timeline li + li { border-top: 1px solid var(--line); }
.timeline .dot { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-bg); color: var(--blue); display: grid; place-items: center; flex: none; }
.timeline .dot .ic { width: 17px; height: 17px; }
.timeline .dot.red { background: var(--red-bg); color: var(--red); } .timeline .dot.green { background: var(--green-bg); color: var(--green); }
.timeline .dot.amber { background: var(--amber-bg); color: var(--amber); } .timeline .dot.gray { background: var(--gray-bg); color: var(--muted); }
.timeline small { display: block; color: var(--muted); margin-top: 2px; }
.approval { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.approval:first-of-type { border-top: 0; }
.approval .meta { color: var(--muted); font-size: 13.5px; }
.approval .actions { margin-left: auto; width: auto; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
pre { background: #0f172a; color: #e2e8f0; padding: var(--s3); border-radius: var(--radius-sm); overflow: auto; font-size: 12.5px; max-height: 320px; }
details summary { cursor: pointer; font-weight: 600; margin: var(--s2) 0; }
details.card summary { margin: 0; display: flex; align-items: center; gap: var(--s2); }
.tier { text-align: center; padding: 10px 0; border-radius: var(--radius-sm); font-weight: 700; }
.tier-0 { background: var(--green-bg); color: var(--green); } .tier-1 { background: var(--blue-bg); color: var(--blue); }
.tier-2 { background: var(--amber-bg); color: var(--amber); } .tier-3 { background: var(--red-bg); color: var(--red); }
.empty { color: var(--muted); display: flex; align-items: center; gap: var(--s2); padding: var(--s2) 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.pager .btn.sm { min-width: 30px; }
.pager .gap { color: var(--faint); padding: 0 4px; }

@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } .sidebar { width: 210px; } .content, .topbar { padding-left: var(--s5); padding-right: var(--s5); } }
@media (max-width: 720px) { .layout { flex-direction: column; } .sidebar { width: 100%; height: auto; position: static; } .grid-4 { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }

/* --- progress: compact track (dashboard) and labelled stepper (execution page) --- */
.track { display: flex; gap: 4px; margin: 14px 0 8px; }
.track .seg { flex: 1; height: 8px; border-radius: 4px; background: var(--gray-bg); }
.track .seg.done { background: var(--green); }
.track .seg.current { background: var(--blue); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.track-caption { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; flex-wrap: wrap; }
.track-caption .stage-name { font-weight: 700; }
.now-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.stepper { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; position: relative; }
.stepper::before { content: ""; position: absolute; left: 5%; right: 5%; top: 13px; height: 2px; background: var(--line); z-index: 0; }
.stage { position: relative; z-index: 1; text-align: center; padding: 0 4px; }
.stage .dot { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.stage.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.stage.current .dot { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 4px var(--blue-bg); }
.stage .lbl { display: block; margin-top: 8px; font-size: 13px; line-height: 1.2; }
.stage.pending .lbl { color: var(--muted); }
.stage.current .lbl { font-weight: 700; color: var(--text); }
.stage small { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.2; }
@media (max-width: 1100px) { .stepper { grid-template-columns: repeat(3, 1fr); row-gap: 14px; } .stepper::before { display: none; } .stage { text-align: left; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; } .stage .lbl { margin-top: 4px; } .stage small { grid-column: 2; } }

/* ---------- execution page: plan, gates, files, timeline ---------- */
.kicker.mt { margin-top: var(--s4); }
.prose { margin: 0; max-width: 78ch; line-height: 1.6; font-size: 14.5px; color: var(--text); }
.prose code { font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: var(--gray-bg); }
.mt-0 { margin: 0; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s5); }
/* grid items default to min-width: auto, so a long path or sentence pushed the column past the card */
.split > * { min-width: 0; }
.hint-note { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
/* file tree: shared directory once, files aligned under it, guide lines like an editor's explorer */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
.tree ul { margin-left: 7px; padding-left: 16px; border-left: 1px solid var(--line); }
.tree li { position: relative; min-width: 0; }
.tree ul > li::before { content: ""; position: absolute; left: -16px; top: 13px; width: 11px; border-top: 1px solid var(--line); }
.tree ul > li:last-child::after { content: ""; position: absolute; left: -17px; top: 14px; bottom: 0; width: 2px; background: var(--card, #fff); }
.tree .row { display: flex; align-items: center; gap: 7px; min-height: 26px; min-width: 0; }
.tree .row .ic { flex: none; color: var(--muted); }
.tree .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tree li.dir > .row .name { color: var(--muted); }
.tree li.file > .row .name { color: var(--text); font-weight: 600; }
.tree li.file > .row .ic { color: var(--btn-blue); }
.gate-row { display: grid; grid-template-columns: 90px 86px 1fr 150px; gap: var(--s4); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.gate-row:first-of-type { border-top: 0; }
.gate-name { font-weight: 600; }
.gate-need { font-size: 13.5px; text-align: right; }
.tier { display: inline-block; text-align: center; padding: 5px 0; border-radius: 8px; font-weight: 700; font-size: 13px; }
.meters { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.meter { display: grid; grid-template-columns: 76px 1fr 96px; gap: 10px; align-items: center; font-size: 12.5px; }
.meter .lbl { color: var(--muted); }
.meter .bar { height: 8px; border-radius: 4px; background: var(--gray-bg); overflow: hidden; }
.meter .fill { display: block; height: 100%; border-radius: 4px; }
.meter .fill.conf { background: var(--blue); }
.meter .fill.risk { background: var(--amber); }
.meter .val { color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) { .gate-row { grid-template-columns: 1fr 1fr; } .meters, .gate-need { grid-column: 1 / -1; text-align: left; } }
th.right, td.right { text-align: right; }
.timeline-table td { padding-top: 9px; padding-bottom: 9px; }
/* room for the 3px edge accent of the current / failed row, so the spinner never touches it */
.timeline-table th:first-child, .timeline-table td:first-child { padding-left: 12px; }
.tr-current td { font-weight: 600; }
.tr-current td:first-child { box-shadow: inset 3px 0 0 var(--btn-blue); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 8px; vertical-align: middle; animation: pulse 1.6s ease-in-out infinite; }

/* status: the spinner turns only while the agent is working; stalled / dead / failed stop it */
.spinner { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; vertical-align: -2px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-right-color: currentColor; opacity: .55; } }
.status-pill .ic { flex: none; } .status-pill::before { display: none; }
.timeline-table td .spinner { color: var(--btn-blue); margin-right: 8px; }
.timeline-table td .ic { vertical-align: -2px; margin-right: 6px; }
.ic.red { color: var(--red); } .ic.amber { color: var(--amber); }
.stage.failed .dot { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 0 4px var(--red-bg); }
.stage.stopped .dot { background: var(--amber); border-color: var(--amber); color: #fff; box-shadow: 0 0 0 4px var(--amber-bg); }
.stage.failed .lbl, .stage.stopped .lbl { font-weight: 700; color: var(--text); }
.stage.failed small { color: var(--red); } .stage.stopped small { color: var(--amber); }
.seg.failed { background: var(--red); } .seg.stopped { background: var(--amber); }
.notice { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; background: var(--amber-bg); }
.notice.bad { background: var(--red-bg); }
.notice .ic { flex: none; margin-top: 2px; color: var(--amber); } .notice.bad .ic { color: var(--red); }
.notice > div { flex: 1; min-width: 0; } .notice form { flex: none; margin: 0; }
.tr-failed td { font-weight: 600; } .tr-failed td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tr-stopped td { font-weight: 600; } .tr-stopped td:first-child { box-shadow: inset 3px 0 0 var(--amber); }

.callout { border-left: 3px solid var(--btn-blue); background: #f8fafc; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: var(--s3) var(--s4); margin: 0 0 var(--s2); }
.callout .prose { max-width: 82ch; }
.prose.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.callout .btn.ghost.sm { margin-top: var(--s2); padding-left: 0; }

/* ---------- the "now" panel: one status, what runs right now, its steps, its logs ---------- */
.now-panel { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; display: flex; flex-direction: column; gap: 10px; }
.now-panel.compact { margin-top: 10px; padding: 10px 12px; }
.now-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.now-head > .pill { flex: none; margin-top: 1px; }
.now-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13.5px; line-height: 1.45; }
.now-title { font-weight: 700; color: var(--text); }
.now-step { color: var(--text); }
.now-step b { color: var(--btn-blue); font-size: 14.5px; font-weight: 800; letter-spacing: .01em; }
.now-detail { overflow-wrap: anywhere; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; line-height: 1.6; border: 1px solid var(--line-2); background: #fff; color: var(--muted); white-space: nowrap; }
.chip small { font-size: 10.5px; opacity: .85; }
.chip .ic { flex: none; }
.chip.done { color: var(--green); background: var(--green-bg); border-color: transparent; }
.chip.running { color: #fff; background: var(--btn-blue); border-color: var(--btn-blue); font-weight: 700; box-shadow: 0 0 0 3px var(--blue-bg); }
.chip.running .spinner { width: 10px; height: 10px; border-width: 2px; color: #fff; }
.chip.cached, .chip.reused, .chip.skipped { background: var(--gray-bg); border-style: dashed; }
.chip.pending { background: #fff; }
.logs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.logs-row.standalone { margin-top: 12px; border-top: 0; padding-top: 0; }
.logs-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.log-chip { display: inline-flex; align-items: center; gap: 6px; }
.log-chip code { font-size: 11.5px; padding: 1px 6px; }

/* --- accounts: sign-in pages and the signed-in user in the sidebar --- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s5); background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s6); box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.auth-card .brand { color: var(--text); padding: 0 0 var(--s5); }
.auth-card .brand small { color: var(--muted); }
.auth-card h1 { font-size: 22px; margin: 0 0 var(--s2); }
.auth-card .sub { color: var(--muted); margin: 0 0 var(--s3); }
.auth-card input { width: 100%; }
.btn.wide { width: 100%; justify-content: center; }
.me { display: flex; flex-direction: column; gap: var(--s2); margin-top: auto; padding: var(--s3) var(--s2); border-top: 1px solid rgba(255, 255, 255, .1); }
.me a { display: flex; align-items: center; gap: var(--s3); color: #d6deeb; border-radius: var(--radius-sm); padding: 6px var(--s2); }
.me a:hover, .me a.active { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.me a b { display: block; font-size: 13px; color: #fff; }
.me a small { font-size: 11.5px; color: #9fb0cc; }
.me .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-3); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.me form .btn { width: 100%; justify-content: center; color: #d6deeb; border-color: rgba(255, 255, 255, .18); background: transparent; }
.me form .btn:hover { color: #fff; background: rgba(255, 255, 255, .07); }

/* --- user detail page --- */
.user-hero { display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap; }
.user-hero .who { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.user-hero h1 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: var(--s2); }
.user-hero .muted { display: flex; align-items: center; gap: 6px; }
.user-hero .badges { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: 2px; }
.avatar-lg { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-bg); color: var(--btn-blue); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s3) var(--s5); margin-top: var(--s4); }
.info-item { display: flex; gap: var(--s3); align-items: center; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.info-item .info-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-bg); color: var(--btn-blue); display: grid; place-items: center; flex: none; align-self: center; }
.info-item .info-ico .ic { display: block; }
.info-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.info-item small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.info-item b { font-size: 14.5px; font-weight: 600; }
.info-item .muted { font-size: 13px; }
.grid-2 > div > .card + .card { margin-top: 0; }
.history .ev { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 500; }
.ev-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--gray-bg); color: var(--muted); flex: none; }
.ev-ic.green { background: var(--green-bg); color: var(--green); }
.ev-ic.red { background: var(--red-bg); color: var(--red); }
.ev-ic.amber { background: var(--amber-bg); color: var(--amber); }
.ev-ic.blue { background: var(--blue-bg); color: var(--blue); }
.nowrap { white-space: nowrap; }

/* Settings > Ticket Types */
.ticket-types .type-list { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.ticket-types .type-opt { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.ticket-types .type-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); }
.ticket-types .type-ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--blue-bg); color: var(--blue); }
.ticket-types .type-body { flex: 1; display: grid; }
.ticket-types .type-body small { color: var(--muted); }
.ticket-types .field-error { color: var(--red); font-weight: 600; display: flex; gap: var(--s2); align-items: center; }
.ticket-types .field-error[hidden] { display: none; }
.ticket-types .notes { color: var(--muted); display: grid; gap: var(--s2); margin: var(--s4) 0; }
.ticket-types .notes p { display: flex; gap: var(--s2); align-items: center; margin: 0; }
.ticket-types .tier2-list { display: grid; gap: var(--s3); margin: var(--s3) 0 var(--s4); }
.ticket-types .tier2-row { display: flex; align-items: center; gap: var(--s3); }
.ticket-types .tier2-label { width: 140px; font-weight: 600; }
.ticket-types .tier2-row input { flex: 1; max-width: 420px; }
.ticket-types .tier2-row.off { opacity: .6; }
/* ---------- insights ---------- */
.small-note { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: calc(-1 * var(--s3)) 0 var(--s4); }
.kpis .kpi { display: flex; align-items: center; gap: var(--s4); }
.kpi h6 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.kpi .n { font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi .n small { font-size: 15px; color: var(--muted); font-weight: 600; }
.kpi .d { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kpi-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.kpi-ico .ic { width: 24px; height: 24px; }
.kpi-ico.blue { background: var(--blue-bg); color: var(--blue); } .kpi-ico.green { background: var(--green-bg); color: var(--green); }
.kpi-ico.amber { background: var(--amber-bg); color: var(--amber); }
.kpi-ring { position: relative; width: 64px; height: 64px; flex: none; }
.kpi-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.kpi-ring circle { fill: none; stroke-width: 3.4; }
.kpi-ring .bg { stroke: var(--gray-bg); }
.kpi-ring .fg { stroke: var(--amber); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.kpi-ring .fg.met { stroke: var(--green); }
/* the pilot target as a tick on the ring */
.kpi-ring::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 9px; margin: -32px 0 0 -1px; background: var(--text); border-radius: 1px; transform-origin: 1px 32px; transform: rotate(calc(var(--t) * 3.6deg)); opacity: .55; }
.kpi-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; font-size: 17px; letter-spacing: -.02em; }
.weeks.daily { gap: 6px; }
.weeks.daily .wk small { font-size: 10.5px; white-space: nowrap; }
.kpi-ring b small { font-size: 11px; color: var(--muted); }
.target { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-bg); border-radius: 999px; padding: 1px 8px; }
.target.met { color: var(--green); background: var(--green-bg); }
.legend { display: flex; align-items: center; gap: var(--s2); font-size: 12.5px; color: var(--muted); }
.legend .sw, .keylist .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: var(--s2); }
.sw.fixed, .weeks .fixed { background: var(--green); } .sw.handed, .weeks .handed { background: #f59e0b; } .sw.failed, .weeks .failed { background: #cbd5e1; }
.weeks { display: flex; align-items: flex-end; gap: var(--s3); height: 210px; padding: var(--s5) 0 0; border-bottom: 1px solid var(--line); }
.weeks .wk { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.weeks .col { flex: 1; width: 100%; max-width: 46px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.weeks .col i { display: block; width: 100%; min-height: 0; }
.weeks .col i:last-child { border-radius: 0 0 2px 2px; }
.weeks .col i:not([style*="height: 0"]):first-of-type { border-radius: 6px 6px 0 0; }
.weeks .col .num { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--text); }
.weeks .wk small { color: var(--muted); font-size: 11.5px; transform: translateY(22px); }
.weeks .wk:hover .col i { filter: brightness(.92); }
.foot { margin: 34px 0 0; font-size: 13px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 28px; align-items: center; gap: var(--s3); font-size: 13.5px; }
.hbar .bar { height: 8px; border-radius: 4px; background: var(--gray-bg); overflow: hidden; }
.hbar .bar i { display: block; height: 100%; background: #f59e0b; border-radius: 4px; }
.hbar b { text-align: right; }
.stackbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--gray-bg); }
.stackbar i { display: block; }
.stackbar .merged, .sw.merged { background: var(--green); } .stackbar .review, .sw.review { background: var(--btn-blue); }
.stackbar .changes, .sw.changes { background: #f59e0b; } .stackbar .closed, .sw.closed { background: #94a3b8; }
.keylist { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--s4); font-size: 13.5px; }
.keylist li { display: flex; align-items: center; gap: 6px; }
.keylist .sw { margin-left: 0; }
.keylist b { margin-left: auto; }
td .t2.ok { color: var(--green); font-weight: 600; } td .t2.warn { color: var(--amber); font-weight: 600; }
.btn.busy { pointer-events: none; opacity: .7; }
.btn.busy .ic { animation: spin 1s linear infinite; }

/* ---------- learning ---------- */
.lesson { border: 1px solid var(--line); border-left: 3px solid #f59e0b; border-radius: var(--radius-sm); padding: var(--s3) var(--s4); margin-top: var(--s3); background: #fffdf7; }
.lesson-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.lesson-head .actions { width: auto; flex-wrap: nowrap; }
.lesson-head .actions > form.inline { flex: none; }
.page-head .actions > form.inline { flex: none; }
.chip.static { height: 24px; padding: 0 8px; font-size: 12.5px; cursor: default; gap: 4px; margin-left: 6px; background: var(--gray-bg); border-color: transparent; }
.delta { margin: var(--s3) 0 0; white-space: pre-wrap; line-height: 1.55; font-size: 14.5px; }
.lessons { margin: var(--s2) 0 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
details.decided { margin-top: var(--s4); }
details.decided summary, details.entry summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 6px 0; }
details.entry { border-top: 1px solid var(--line); }
details.entry:first-of-type { border-top: 0; }
details.entry summary { color: var(--text); font-size: 14px; padding: 10px 0; }
details.entry[open] summary { color: var(--blue); }
pre.md { white-space: pre-wrap; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); max-height: 360px; overflow: auto; margin: 0 0 var(--s3); }
.plain-list { list-style: none; padding: 0; margin: var(--s2) 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.runs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s3); font-size: 13.5px; }
.runmeter { height: 6px; border-radius: 3px; background: var(--gray-bg); overflow: hidden; margin-top: 6px; }
.runmeter i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.runmeter i.warn { background: #f59e0b; }
@media (max-width: 720px) { .keylist { grid-template-columns: 1fr; } .hbar { grid-template-columns: 1fr 1fr 24px; } .weeks { gap: 6px; } }

/* ---------- review revision ---------- */
.revision-card { border-left: 3px solid var(--btn-blue); }
.review-items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s3); }
.review-items li { display: flex; gap: var(--s3); align-items: flex-start; }
.review-items .pill { margin-left: 6px; }
.review-items code { margin-left: 6px; font-size: 12px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blue-bg); color: var(--btn-blue); font-weight: 700; font-size: 13px; }
.said { margin-top: 4px; white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; }

/* ---------- UI reproduction ---------- */
.e2e-card .agent-head p { max-width: 70ch; }
.e2e-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin: var(--s4) 0 var(--s3); }
.e2e-steps > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); background: #fafbfe; display: flex; flex-direction: column; gap: 4px; }
.e2e-steps .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-bg); color: var(--btn-blue); font-weight: 700; font-size: 12px; }
.e2e-steps small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.e2e-steps code { font-size: 11.5px; word-break: break-all; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.shot { margin: 0; display: flex; flex-direction: column; gap: var(--s2); }
.shot img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); display: block; }
.shot.before img { border-top: 3px solid var(--red); } .shot.after img { border-top: 3px solid var(--green); }
@media (max-width: 1000px) { .e2e-steps { grid-template-columns: 1fr 1fr; } .shots { grid-template-columns: 1fr; } }
