/* ==========================================================================
   Spider — "web-slinger" theme
   Black chassis, orange arc-light, faint web geometry. Bootstrap 5.3 dark mode
   supplies the primitives; everything below re-skins it.
   ========================================================================== */

:root,
[data-bs-theme="dark"] {
  --web-black:      #07070a;
  --web-panel:      #101017;
  --web-panel-2:    #16161f;
  --web-line:       #25252f;
  --web-line-soft:  #1c1c25;

  --web-orange:     #ff6a13;
  --web-orange-lo:  #d64f05;
  --web-orange-hi:  #ff9245;
  --web-red:        #e0243d;
  --web-cyan:       #45d0ff;

  --web-text:       #eceef2;
  --web-dim:        #8b8f9c;
  --web-faint:      #5d616e;

  --bs-body-bg: var(--web-black);
  --bs-body-color: var(--web-text);
  --bs-border-color: var(--web-line);
  --bs-primary: var(--web-orange);
  --bs-primary-rgb: 255, 106, 19;
  --bs-link-color: var(--web-orange-hi);
  --bs-link-hover-color: #ffb277;
  --bs-emphasis-color: #fff;
  --bs-secondary-color: var(--web-dim);
  --bs-code-color: var(--web-orange-hi);
  --bs-font-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- page chassis: black + a faint spider-web weave ---------- */

/* Old-TV black: a switched-on CRT showing nothing. Three layers, all faint —
   phosphor grain (an inline SVG turbulence tile, so no asset and no request),
   scanlines every 3px, and a vignette that pools the corners the way a curved
   tube did. The grain is what keeps the black from reading as a dead void;
   turn any of these up and body text starts to swim. */
body {
  background-color: var(--web-black);
  background-image:
    radial-gradient(130% 95% at 50% 40%, transparent 55%, rgba(0,0,0,.5) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E"),
    radial-gradient(900px 420px at 78% -12%, rgba(255,106,19,.10), transparent 62%);
  background-repeat: no-repeat, repeat, repeat, no-repeat;
  background-attachment: fixed;
  color: var(--web-text);
  font-feature-settings: "cv02", "cv03", "cv04";
  letter-spacing: -.006em;
}

.mono, code, pre, .form-control.mono, .form-select.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8125rem;
}

/* ---------- the top bar: the mark, the nav, the account ----------

   Slim on purpose. It was removed once in favour of nav-inside-the-avatar-menu
   and going anywhere became two clicks with one hidden — the bar is for moving
   around, the avatar menu keeps the account things. */

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 1.1rem; padding: .5rem 1.2rem;
  background: linear-gradient(180deg, rgba(9,9,13,.95), rgba(9,9,13,.82));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--web-line-soft);
}
.topbar-mark {
  display: inline-flex; align-items: center; gap: .45rem; text-decoration: none;
  color: #fff; font-weight: 750; letter-spacing: -.03em; font-size: .95rem;
}
.topbar-mark svg { width: 22px; height: 22px; }
.topbar-nav { display: flex; gap: .25rem; align-items: center; flex: 1 1 auto; }
.topbar-nav a {
  text-decoration: none; color: var(--web-dim); font-size: .8rem; font-weight: 560;
  padding: .32rem .65rem; border-radius: 8px; border: 1px solid transparent;
  transition: .15s ease; display: inline-flex; align-items: center; gap: .35rem;
}
.topbar-nav a i.bi { font-size: .85rem; }
.topbar-nav a:hover { color: var(--web-text); background: rgba(255,255,255,.045); }
.topbar-nav a.active {
  color: #fff; border-color: rgba(255,106,19,.4);
  background: linear-gradient(180deg, rgba(255,106,19,.2), rgba(255,106,19,.06));
}
.usermenu { position: relative; flex: none; }
.usermenu > summary {
  list-style: none; cursor: pointer; display: block; border-radius: 50%;
  transition: box-shadow .16s ease;
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover, .usermenu[open] > summary {
  box-shadow: 0 0 0 2px rgba(255,106,19,.45), 0 0 20px rgba(255,106,19,.28);
}
.userpic {
  position: relative; display: grid; place-items: center; overflow: hidden;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,106,19,.4);
  background: radial-gradient(circle at 30% 25%, rgba(255,106,19,.35), rgba(255,106,19,.06));
}
.userpic.lg { width: 42px; height: 42px; border-radius: 13px; }
.userpic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.userpic-letter { font-size: .82rem; font-weight: 750; color: #fff; }

.usercard {
  position: absolute; top: calc(100% + .55rem); right: 0; width: 17.5rem;
  border: 1px solid var(--web-line); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #14141c, #0b0b11);
  box-shadow: 0 18px 44px rgba(0,0,0,.6);
}
.usercard-head {
  display: flex; align-items: center; gap: .6rem; padding: .8rem .85rem;
  border-bottom: 1px solid var(--web-line-soft);
}
.usercard-name { display: block; font-weight: 640; color: #fff; font-size: .88rem; }
.usercard-plan { display: block; font-size: .72rem; color: var(--web-orange-hi); }

.usercard-meter { padding: .7rem .85rem; border-bottom: 1px solid var(--web-line-soft); }
.meter-line {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  font-size: .72rem; color: var(--web-dim); margin-bottom: .3rem;
}
.meter-line .mono, .meter-line .mock { white-space: nowrap; flex: none; }
.meter {
  height: 5px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden;
}
.meter > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--web-orange-lo), var(--web-orange-hi));
}
/* Says out loud that the numbers beside it are invented. */
.mock {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 640;
  color: var(--web-faint); border: 1px dashed var(--web-line); border-radius: 999px;
  padding: .05rem .4rem;
}

.usercard-nav { display: flex; flex-direction: column; padding: .3rem; }
.usercard-nav + .usercard-nav { border-top: 1px solid var(--web-line-soft); }
.usercard-nav a {
  display: flex; align-items: center; gap: .5rem; text-decoration: none;
  color: var(--web-text); font-size: .82rem; padding: .4rem .55rem; border-radius: 9px;
}
.usercard-nav a:hover { background: rgba(255,106,19,.1); color: #fff; }
.usercard-nav a i.bi { color: var(--web-faint); font-size: .9rem; }
.usercard-nav a:hover i.bi, .usercard-nav a.active i.bi { color: var(--web-orange); }
.usercard-nav a.active { color: #fff; background: rgba(255,106,19,.12); }
.usercard-nav.muted a { color: var(--web-dim); font-size: .78rem; }

/* ---------- panels ---------- */

.card {
  background: linear-gradient(180deg, var(--web-panel), #0c0c12);
  border: 1px solid var(--web-line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--web-line-soft);
  font-weight: 640; font-size: .875rem; letter-spacing: -.01em;
  color: #fff; padding: .8rem 1rem;
}
.card-header i.bi { color: var(--web-orange); margin-right: .35rem; }
.card-footer { background: rgba(255,255,255,.015); border-top: 1px solid var(--web-line-soft); }
.list-group-item { background: transparent; border-color: var(--web-line-soft); color: var(--web-text); }
.list-group-item-action:hover { background: rgba(255,106,19,.07); color: #fff; }

/* ---------- type ---------- */

.small-muted { color: var(--web-dim); font-size: .8125rem; }
th {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--web-faint); font-weight: 640; border-color: var(--web-line-soft) !important;
}
td { vertical-align: middle; border-color: var(--web-line-soft) !important; }
.table > :not(caption) > * > * { background-color: transparent; color: var(--web-text); }
.table-hover > tbody > tr:hover > * { background-color: rgba(255,106,19,.075); color: #fff; }
.url-cell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- controls ---------- */

.form-control, .form-select {
  background-color: #0b0b11; border-color: var(--web-line); color: var(--web-text);
  border-radius: 9px; font-size: .875rem;
}
.form-control:focus, .form-select:focus {
  background-color: #0b0b11; color: #fff; border-color: var(--web-orange);
  box-shadow: 0 0 0 3px rgba(255,106,19,.18);
}
.form-control::placeholder { color: #4a4e5a; }
.form-label, .field-row label, .child-block label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--web-faint); font-weight: 600; margin-bottom: .22rem;
}
.form-text { color: var(--web-faint); font-size: .78rem; }
.form-check-input { background-color: #0b0b11; border-color: var(--web-line); }
.form-check-input:checked { background-color: var(--web-orange); border-color: var(--web-orange); }
.form-check-label { font-size: .8rem; color: var(--web-dim); }

.btn { border-radius: 9px; font-weight: 600; font-size: .84rem; letter-spacing: -.01em; }
.btn-primary, .btn-success {
  border: 0; color: #100a04;
  background: linear-gradient(135deg, var(--web-orange-hi), var(--web-orange) 45%, var(--web-orange-lo));
  box-shadow: 0 4px 18px rgba(255,106,19,.32);
}
.btn-primary:hover, .btn-success:hover {
  color: #100a04; filter: brightness(1.08);
  box-shadow: 0 6px 26px rgba(255,106,19,.45);
}
.btn-outline-primary { color: var(--web-orange-hi); border-color: rgba(255,106,19,.45); }
.btn-outline-primary:hover { background: rgba(255,106,19,.15); color: #fff; border-color: var(--web-orange); }
.btn-outline-secondary { color: var(--web-dim); border-color: var(--web-line); }
.btn-outline-secondary:hover { background: rgba(255,255,255,.06); color: #fff; border-color: #3a3a46; }
.btn-outline-danger { color: #ff7a8c; border-color: rgba(224,36,61,.4); }
.btn-outline-danger:hover { background: rgba(224,36,61,.18); color: #fff; border-color: var(--web-red); }

/* ---------- status pills ---------- */

.status-badge {
  font-size: .68rem; font-weight: 680; padding: .22rem .55rem; border-radius: 999px;
  text-transform: lowercase; letter-spacing: .02em; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
}
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-ready, .status-done { background: rgba(46,204,113,.12); color: #4ade80; border-color: rgba(74,222,128,.28); }
.status-failed { background: rgba(224,36,61,.13); color: #ff7a8c; border-color: rgba(224,36,61,.32); }
.status-queued, .status-running, .status-pending, .status-loading,
.status-analyzing, .status-generating, .status-validating, .status-verifying {
  background: rgba(255,106,19,.13); color: var(--web-orange-hi); border-color: rgba(255,106,19,.32);
}
.status-running::before, .status-queued::before,
.status-loading::before, .status-analyzing::before, .status-generating::before,
.status-validating::before, .status-verifying::before { animation: pulse 1.25s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.7); } }

.chip {
  display: inline-block; font-size: .72rem; padding: .16rem .5rem; border-radius: 6px;
  border: 1px solid var(--web-line); background: rgba(255,255,255,.03);
  color: var(--web-dim); margin: 0 .25rem .3rem 0;
}
.chip-accent {
  border-color: rgba(255,106,19,.38); background: rgba(255,106,19,.10); color: var(--web-orange-hi);
}

/* ---------- code + console ---------- */

.console, .code-block {
  background: #050508; color: #d7dae1; border: 1px solid var(--web-line-soft);
  padding: .9rem 1rem; margin: 0; overflow: auto; white-space: pre-wrap;
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: .78rem; line-height: 1.55;
}
.console { max-height: 340px; border-radius: 0 0 13px 13px; }
.code-block { max-height: 560px; white-space: pre; }
.console::-webkit-scrollbar, .code-block::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar { width: 9px; height: 9px; }
.console::-webkit-scrollbar-thumb, .code-block::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb { background: #2a2a35; border-radius: 8px; }
.console::-webkit-scrollbar-thumb:hover, .code-block::-webkit-scrollbar-thumb:hover { background: var(--web-orange-lo); }

.feedback-block {
  background: linear-gradient(90deg, rgba(255,106,19,.12), rgba(255,106,19,.02));
  border-left: 2px solid var(--web-orange);
  padding: .7rem 1rem; font-size: .84rem; color: #ffd0ac; white-space: pre-wrap;
}
.alert { border-radius: 10px; border-width: 1px; font-size: .85rem; }
.alert-danger { background: rgba(224,36,61,.12); border-color: rgba(224,36,61,.35); color: #ff97a5; }
.alert-success { background: rgba(46,204,113,.10); border-color: rgba(74,222,128,.3); color: #86efac; }
.alert-warning { background: rgba(255,106,19,.10); border-color: rgba(255,106,19,.32); color: #ffc08a; }

/* ---------- schema editor ---------- */

.field-row {
  background: linear-gradient(180deg, var(--web-panel-2), #0d0d14);
  border: 1px solid var(--web-line-soft); border-left: 2px solid rgba(255,106,19,.35);
  border-radius: 10px; padding: .8rem; margin-bottom: .6rem; transition: border-color .16s ease;
}
.field-row:hover { border-left-color: var(--web-orange); }
.child-block {
  background: rgba(255,106,19,.035);
  border: 1px dashed rgba(255,106,19,.3); border-radius: 12px;
  padding: 1rem; margin-bottom: 1rem;
}
details summary { cursor: pointer; color: var(--web-orange-hi); }

/* ---------- misc ---------- */

a { text-decoration: none; }
a:hover { text-decoration: underline; }
.section-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -.03em; color: #fff; }
.htmx-request .spinner-hide { display: none; }
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
/* A long request's "I heard you" line — shown under the button while it runs.
   Keyed off the button hx-disabled-elt disables, not only the htmx-request
   class: the disable observably fires, and the note must never fail to show
   while a minute-long LLM call is in flight. */
.working-note {
  display: flex; align-items: center; gap: .5rem; margin-top: .6rem;
  font-size: .78rem; color: var(--web-orange-hi);
}
form:has(> button:disabled) .working-note,
form:has(button:disabled) .working-note { opacity: 1; }

/* The edit page's folded-away side doors (paste / describe-to-AI). */
.rebuild > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .82rem; color: var(--web-dim); padding: .45rem .7rem;
  border: 1px dashed var(--web-line); border-radius: 10px; transition: .15s ease;
}
.rebuild > summary::-webkit-details-marker { display: none; }
.rebuild > summary:hover { color: var(--web-orange-hi); border-color: rgba(255,106,19,.45); }
.rebuild[open] > summary { color: #fff; border-style: solid; border-color: rgba(255,106,19,.4); }
.rebuild > summary i.bi { color: var(--web-orange); }

/* Back-office blueprint cards — sketches of controls that do not exist yet. */
.blueprint { border-style: dashed; opacity: .92; }
.blueprint i.bi { color: var(--web-orange); }
.blueprint-title { font-weight: 640; color: #fff; font-size: .875rem; }

/* ---------- the calendar: schedules on a month ---------- */

.cal-title { font-weight: 700; color: #fff; letter-spacing: -.02em; min-width: 9rem; text-align: center; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--web-line-soft);
}
.cal-head {
  padding: .45rem .6rem; font-size: .64rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--web-faint); font-weight: 640;
  border-bottom: 1px solid var(--web-line-soft);
}
.cal-day {
  min-height: 6.2rem; padding: .4rem .45rem .5rem;
  border-bottom: 1px solid var(--web-line-soft); border-right: 1px solid var(--web-line-soft);
  display: flex; flex-direction: column; gap: .25rem; min-width: 0;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: rgba(0,0,0,.28); }
.cal-day.out .cal-num { color: var(--web-faint); opacity: .55; }
.cal-day.today { background: rgba(255,106,19,.06); box-shadow: inset 0 0 0 1px rgba(255,106,19,.35); }
.cal-day.today .cal-num {
  color: #fff; background: var(--web-orange); border-radius: 999px;
  width: 1.35rem; height: 1.35rem; display: grid; place-items: center;
}
.cal-num { font-size: .74rem; color: var(--web-dim); font-variant-numeric: tabular-nums; flex: none; }
.cal-chip {
  display: flex; align-items: center; gap: .3rem; min-width: 0;
  font-size: .68rem; text-decoration: none; color: var(--web-text);
  border: 1px solid var(--web-line); border-radius: 7px; padding: .14rem .3rem;
  background: rgba(255,255,255,.03); transition: .13s ease;
}
.cal-chip:hover { border-color: rgba(255,106,19,.5); background: rgba(255,106,19,.1); color: #fff; }
/* Yesterday's projected runs — already happened (or would have); kept faint
   so the eye lands on what is still coming. */
.cal-chip.past { opacity: .45; }
.cal-chip-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip-time { margin-left: auto; color: var(--web-faint); font-variant-numeric: tabular-nums; flex: none; }
.site-logo.sm { width: 1.05rem; height: 1.05rem; border-radius: 4px; flex: none; }
.site-logo.sm .site-letter { font-size: .55rem; }

@media (max-width: 900px) {
  .cal-day { min-height: 4.2rem; }
  .cal-chip-host { display: none; }   /* the logo and the time still say it */
}
.working-note .spinner-border { --bs-spinner-border-width: 2px; flex: none; }

/* ==========================================================================
   Agent pipeline graph
   ========================================================================== */

.agent-graph {
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
  padding: 1rem 1.1rem; position: relative;
}
.ag-node {
  display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 1 1 150px;
  padding: .55rem .7rem; border-radius: 11px;
  border: 1px solid var(--web-line-soft); background: rgba(255,255,255,.018);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.ag-dot {
  position: relative; flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: .95rem;
  border: 1px solid var(--web-line); background: #0b0b11; color: var(--web-faint);
}
.ag-label { font-size: .8rem; font-weight: 650; color: var(--web-dim); letter-spacing: -.01em; }
.ag-blurb {
  font-size: .68rem; color: var(--web-faint); line-height: 1.25;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.ag-done .ag-dot { color: #4ade80; border-color: rgba(74,222,128,.4); background: rgba(46,204,113,.1); }
.ag-done .ag-label { color: #cfd3db; }

.ag-active {
  border-color: rgba(255,106,19,.5); background: rgba(255,106,19,.08);
  box-shadow: 0 0 22px rgba(255,106,19,.18);
}
.ag-active .ag-dot { color: var(--web-orange-hi); border-color: var(--web-orange); background: rgba(255,106,19,.16); }
.ag-active .ag-label { color: #fff; }

.ag-failed { border-color: rgba(224,36,61,.45); background: rgba(224,36,61,.08); }
.ag-failed .ag-dot { color: #ff7a8c; border-color: rgba(224,36,61,.5); background: rgba(224,36,61,.14); }
.ag-failed .ag-label { color: #ffb3bd; }

.ag-ping {
  position: absolute; inset: -4px; border-radius: 13px;
  border: 1px solid var(--web-orange); animation: agping 1.5s ease-out infinite;
}
@keyframes agping {
  0%   { transform: scale(.85); opacity: .9; }
  100% { transform: scale(1.25); opacity: 0; }
}

.ag-edge { flex: 0 0 26px; display: grid; place-items: center; }
.ag-edge span { display: block; width: 100%; height: 2px; border-radius: 2px; }
.ag-edge-dim span { background: repeating-linear-gradient(90deg, var(--web-line) 0 4px, transparent 4px 8px); }
.ag-edge-lit span {
  background: linear-gradient(90deg, rgba(74,222,128,.25), var(--web-orange));
  box-shadow: 0 0 10px rgba(255,106,19,.5);
}

.agent-graph-single .ag-node { flex: 0 1 260px; }

/* --- status bar above the graph: attempts + ETA --- */
.ag-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding: .6rem 1.1rem .1rem;
}
.ag-attempts {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .74rem; letter-spacing: .04em; color: var(--web-dim);
  border: 1px solid var(--web-line); border-radius: 999px; padding: .3rem .75rem;
  background: rgba(255,255,255,.02);
}
.ag-attempts b { color: #fff; font-weight: 700; }
.ag-attempts-hot {
  color: var(--web-orange-hi); border-color: rgba(255,106,19,.5);
  background: rgba(255,106,19,.12); box-shadow: 0 0 16px rgba(255,106,19,.18);
}
.ag-attempts-hot b { color: var(--web-orange-hi); }
.ag-attempts-hot i { animation: agspin 2.4s linear infinite; }
@keyframes agspin { to { transform: rotate(360deg); } }
.ag-retry-tag {
  font-size: .64rem; text-transform: uppercase; letter-spacing: .1em;
  padding-left: .5rem; margin-left: .2rem; border-left: 1px solid rgba(255,106,19,.35);
}

.ag-eta {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .74rem; color: var(--web-dim);
}
.ag-eta i { color: var(--web-orange); }
.ag-eta-value {
  font-weight: 700; color: #fff; font-family: "JetBrains Mono", monospace; font-size: .8rem;
}
.ag-eta-src {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--web-faint); border: 1px solid var(--web-line-soft);
  border-radius: 5px; padding: .1rem .35rem; margin-left: .3rem;
}

/* --- per-node timing --- */
.ag-time {
  font-size: .66rem; font-weight: 600; font-family: "JetBrains Mono", monospace;
  color: var(--web-faint); margin-left: .35rem; white-space: nowrap;
}
.ag-time-done { color: #4ade80; }
.ag-time-failed { color: #ff7a8c; }
.ag-time-active { color: var(--web-orange-hi); }
.ag-progress {
  height: 3px; border-radius: 3px; background: rgba(255,255,255,.07);
  margin-top: .3rem; overflow: hidden;
}
.ag-progress span {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--web-orange-lo), var(--web-orange-hi));
  transition: width .6s ease;
}

/* ==========================================================================
   View switcher + auto-generated item UI
   ========================================================================== */

.viewtabs { display: inline-flex; gap: .2rem; padding: .2rem; border: 1px solid var(--web-line); border-radius: 10px; background: #0b0b11; }
.viewtab {
  font-size: .78rem; font-weight: 600; padding: .3rem .7rem; border-radius: 8px;
  color: var(--web-dim); text-decoration: none; border: 1px solid transparent;
}
.viewtab:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.05); }
.viewtab.active {
  color: #100a04; background: linear-gradient(135deg, var(--web-orange-hi), var(--web-orange));
  box-shadow: 0 2px 12px rgba(255,106,19,.3);
}

.json-view {
  background: #050508; border: 1px solid var(--web-line-soft); border-radius: 0 0 13px 13px;
  padding: 1rem; margin: 0; max-height: 640px; overflow: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .78rem; line-height: 1.5;
  color: #cfd3db; white-space: pre;
}
.json-key { color: var(--web-orange-hi); }
.json-str { color: #86efac; }
.json-num { color: var(--web-cyan); }
.json-bool, .json-null { color: #c084fc; }

.item-card {
  border: 1px solid var(--web-line-soft); border-left: 2px solid rgba(255,106,19,.45);
  border-radius: 11px; padding: .85rem 1rem; background: rgba(255,255,255,.016); height: 100%;
}
.item-card h6 { font-size: .95rem; font-weight: 680; color: #fff; letter-spacing: -.02em; margin-bottom: .4rem; }
.item-field { display: flex; gap: .5rem; font-size: .8rem; margin-bottom: .2rem; }
.item-field .k { color: var(--web-faint); min-width: 92px; flex: none; font-family: "JetBrains Mono", monospace; font-size: .72rem; padding-top: .1rem; }
.item-field .v { color: #d5d8df; min-width: 0; overflow-wrap: anywhere; }
.item-thumb { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: .6rem; border: 1px solid var(--web-line-soft); }

.autoform-row { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .4rem; }
.autoform-row .form-control { font-size: .82rem; }
.badge-req { font-size: .6rem; color: var(--web-orange-hi); letter-spacing: .06em; }

/* ---------- browser screenshots: a fixed stage, like a video ----------
   The whole point is that nothing moves. The stage has a fixed height and the
   image is contained inside it, so a tall full-page recipe and a short viewport
   listing occupy exactly the same box — a new frame replaces the picture in
   place instead of growing the card and pushing the page down.              */

.shot-stream { padding: 1rem; }

.shot-stage {
  position: relative;
  height: 340px;                 /* fixed: the frame changes, the box does not */
  border: 1px solid var(--web-line); border-radius: 10px; overflow: hidden;
  background: #07070a;
  display: flex; align-items: center; justify-content: center;
}
.shot-stage > a {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; min-width: 0; min-height: 0;
}
/* Fixed box, natural image. It is scaled DOWN to fit when it is too big and
   left alone when it already fits — never stretched to fill, which turned a
   full-page capture into a tall thin sliver. */
.shot-stage img {
  display: block;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 4px;
}
.shot-empty { border-style: dashed; }
.shot-empty p { margin: 0; }

.shot-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: .6rem;
  padding: .35rem .6rem;
  background: linear-gradient(0deg, rgba(7,7,10,.94), rgba(7,7,10,.55) 70%, transparent);
  font-size: .7rem; font-family: "JetBrains Mono", monospace; color: var(--web-dim);
}
.shot-counter {
  color: #100a04; font-weight: 700; padding: .1rem .45rem; border-radius: 5px;
  background: linear-gradient(135deg, var(--web-orange-hi), var(--web-orange));
  white-space: nowrap;
}
.shot-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-gif { color: var(--web-orange-hi); text-decoration: none; white-space: nowrap; }
.shot-gif:hover { color: #fff; text-decoration: none; }

.shot-kept { border-color: rgba(74,222,128,.35); }
.shot-rejected, .shot-failed { border-color: rgba(224,36,61,.45); }
.shot-kept .shot-name { color: #86efac; }
.shot-rejected .shot-name, .shot-failed .shot-name { color: #ff9aa6; }
.shot-playing img { max-width: 100%; max-height: 100%; width: auto; height: auto; }

/* Filmstrip: fixed height and horizontally scrollable, so adding frames never
   changes the card's height either. */
.shot-strip {
  display: flex; gap: .35rem; margin-top: .5rem;
  height: 46px; overflow-x: auto; overflow-y: hidden;
}
.shot-strip a {
  flex: 0 0 auto; width: 58px; height: 40px; border-radius: 5px; overflow: hidden;
  border: 1px solid var(--web-line); opacity: .5; transition: .15s ease;
}
.shot-strip a:hover { opacity: 1; border-color: var(--web-orange); }
.shot-strip a.is-current { opacity: 1; border-color: var(--web-orange); box-shadow: 0 0 8px rgba(255,106,19,.35); }
.shot-strip img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* ---------- what the scraper is doing on the site ---------- */
.steps-panel { padding: .8rem 1rem; }
.steps-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; }
.steps-progress {
  flex: 1 1 auto; height: 4px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden;
}
.steps-progress > span {
  display: block; height: 100%; border-radius: 3px; transition: width .5s ease;
  background: linear-gradient(90deg, var(--web-orange-lo), var(--web-orange-hi));
}
.steps-meta { font-size: .68rem; font-family: "JetBrains Mono", monospace; color: var(--web-faint); white-space: nowrap; }

.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: .55rem; align-items: flex-start; padding: .22rem 0; }
.step-mark { flex: none; width: 18px; height: 18px; display: grid; place-items: center; font-size: .7rem; margin-top: .1rem; }
.step-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--web-line); display: block; }
.step-spin {
  width: 11px; height: 11px; border-radius: 50%; display: block;
  border: 2px solid rgba(255,106,19,.25); border-top-color: var(--web-orange);
  animation: stepspin .8s linear infinite;
}
@keyframes stepspin { to { transform: rotate(360deg); } }
.step-body { min-width: 0; display: flex; flex-direction: column; }
.step-label { font-size: .8rem; color: var(--web-dim); line-height: 1.3; }
.step-detail {
  font-size: .68rem; color: var(--web-faint); font-family: "JetBrains Mono", monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-done .step-mark { color: #4ade80; }
.step-done .step-label { color: #b9bec9; }
.step-active .step-label { color: #fff; font-weight: 600; }
.step-failed .step-mark { color: #ff7a8c; }
.step-failed .step-label { color: #ffb3bd; }
.steps-note { margin: .5rem 0 0; font-size: .72rem; color: var(--web-faint); font-family: "JetBrains Mono", monospace; }

/* ---------- run monitor ---------- */
.monitor-card {
  border: 1px solid var(--web-line-soft); border-left: 2px solid var(--web-line);
  border-radius: 10px; padding: .7rem .85rem; background: rgba(255,255,255,.015); height: 100%;
}
.monitor-card.is-running { border-left-color: var(--web-orange); background: rgba(255,106,19,.05); }
.monitor-step { display: flex; gap: .5rem; align-items: flex-start; font-size: .78rem; color: var(--web-dim); }
.monitor-step strong { color: #fff; font-weight: 600; }

/* ---------- smooth frame changes ----------
   The stage only re-renders when a genuinely new frame exists (the server
   answers 204 otherwise), so a fade here reads as the picture changing rather
   than the panel blinking. */
.shot-stage img { animation: shotfade .32s ease-out; }
@keyframes shotfade { from { opacity: .35; } to { opacity: 1; } }
.shot-strip a { transition: opacity .2s ease, border-color .2s ease; }

/* Step rows move often; keep their motion continuous rather than snapping. */
.steps-progress > span { transition: width .45s cubic-bezier(.4,0,.2,1); }
.step-label, .step-detail { transition: color .25s ease; }

/* htmx swaps: settle new content in instead of popping it. */
.steps-panel .steps, .steps-panel .steps-head { animation: stepsettle .25s ease-out; }
@keyframes stepsettle { from { opacity: .55; } to { opacity: 1; } }

/* A poll that changes nothing must not flash the request indicator. */
.shot-stream.htmx-request, .steps-panel.htmx-request { opacity: 1; }

/* ---------- bulk option on the build form ---------- */
.bulk-block {
  border: 1px dashed var(--web-line); border-radius: 9px; padding: .5rem .75rem;
  background: rgba(255,255,255,.015);
}
.bulk-block summary {
  cursor: pointer; font-size: .78rem; color: var(--web-orange-hi); list-style: none;
}
.bulk-block summary::-webkit-details-marker { display: none; }
.bulk-block summary::before { content: "＋ "; font-weight: 700; }
.bulk-block[open] summary::before { content: "− "; }

/* ==========================================================================
   Property editor — Notion-ish: one line per property, detail on demand
   ========================================================================== */

.prop-list { margin-bottom: .35rem; }

.prop {
  border-bottom: 1px solid var(--web-line-soft);
  padding: .3rem 0; transition: background .15s ease;
}
.prop:hover { background: rgba(255,255,255,.02); }
.prop:last-of-type { border-bottom: 0; }

.prop-main { display: flex; align-items: center; gap: .45rem; }
.prop-grip { color: #33333f; cursor: grab; font-size: .9rem; line-height: 1; }
.prop:hover .prop-grip { color: var(--web-faint); }
.prop-icon {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: 5px; background: rgba(255,255,255,.04); color: var(--web-orange-hi);
  font-size: .78rem;
}

.prop-name {
  flex: 1 1 auto; min-width: 6rem;
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: #fff; font-size: .84rem; padding: .25rem .4rem;
}
.prop-name:focus {
  outline: none; background: #0b0b11;
  border-color: var(--web-orange); box-shadow: 0 0 0 3px rgba(255,106,19,.15);
}
.prop-name::placeholder { color: #4a4e5a; }

.prop-type {
  flex: none; width: 6.5rem;
  background: rgba(255,255,255,.04); border: 1px solid var(--web-line-soft);
  color: var(--web-dim); border-radius: 6px; font-size: .72rem;
  padding: .2rem .3rem; font-family: "JetBrains Mono", monospace;
}
.prop-type:focus { outline: none; border-color: var(--web-orange); color: #fff; }

.prop-flag {
  flex: none; display: inline-flex; align-items: center; gap: .25rem;
  font-size: .66rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--web-faint); cursor: pointer; user-select: none;
}
.prop-flag input { accent-color: var(--web-orange); }

.prop-actions { flex: none; opacity: 0; transition: opacity .15s ease; }
.prop:hover .prop-actions, .prop:focus-within .prop-actions { opacity: 1; }
.prop-btn {
  background: transparent; border: 0; color: var(--web-faint);
  padding: .15rem .35rem; border-radius: 5px; font-size: .8rem;
}
.prop-btn:hover { color: #ff7a8c; background: rgba(224,36,61,.12); }

.prop-more { margin: .1rem 0 .2rem 3.1rem; }
.prop-more summary {
  cursor: pointer; list-style: none; font-size: .68rem; color: var(--web-faint);
  padding: .1rem 0;
}
.prop-more summary::-webkit-details-marker { display: none; }
.prop-more summary::before { content: "⋯ "; letter-spacing: .1em; }
.prop-more[open] summary::before { content: "⌄ "; }
.prop-more summary:hover { color: var(--web-orange-hi); }

.prop-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .5rem; padding: .5rem 0 .3rem;
}
.prop-grid label {
  display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--web-faint); margin-bottom: .15rem;
}
.prop-wide { grid-column: 1 / -1; }

.prop-add {
  background: transparent; border: 0; color: var(--web-faint);
  font-size: .78rem; padding: .35rem .2rem; border-radius: 6px; width: 100%;
  text-align: left; transition: color .15s ease, background .15s ease;
}
.prop-add:hover { color: var(--web-orange-hi); background: rgba(255,106,19,.06); }

/* ==========================================================================
   Conversation layout
   Home reads as Spider talking to you and attaching widgets to what it says.
   One column, one measure — the old three-panel dashboard put the thing you
   came to do (paste a URL) beside four things you did not.
   ========================================================================== */

.narrow { max-width: 880px; margin: 0 auto; }
.narrow.wide { max-width: 1080px; }

.page-head { margin: .5rem 0 1.4rem; }
.page-head h1 {
  font-size: 1.5rem; font-weight: 760; letter-spacing: -.035em; color: #fff; margin: 0;
}
.page-head p { color: var(--web-dim); font-size: .875rem; margin: .25rem 0 0; }

.talk { padding-top: .5rem; }
.turn { display: grid; grid-template-columns: 38px 1fr; gap: .85rem; margin-bottom: 1.6rem; }
.turn .avatar {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  border: 1px solid rgba(255,106,19,.42);
  background: radial-gradient(circle at 30% 25%, rgba(255,106,19,.28), rgba(255,106,19,.04));
  box-shadow: 0 0 16px rgba(255,106,19,.18);
}
.turn .avatar svg { width: 21px; height: 21px; }
.turn .avatar.quiet {
  border-color: var(--web-line); background: rgba(255,255,255,.03); box-shadow: none;
}
.turn .avatar.quiet i { color: var(--web-faint); font-size: .95rem; }
.says { min-width: 0; padding-top: .15rem; }

.lede {
  font-size: 1.06rem; font-weight: 560; color: #fff; letter-spacing: -.02em;
  line-height: 1.45; margin: 0 0 .2rem;
}
.lede-sm {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--web-faint); font-weight: 640; margin: .3rem 0 .55rem;
}
.seemore {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .7rem;
  font-size: .8rem; color: var(--web-dim); text-decoration: none;
}
.seemore:hover { color: var(--web-orange-hi); }

/* ---------- home: build on the left, where things stand on the right ----------

   Two panels, not a dashboard: the left one is the only place you do anything,
   and the right one answers one question at a time. The stack of mini-widgets
   that used to sit above the composer is gone — it pushed the thing you came
   to do below the fold to report things you had not asked about. */

.home-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: 1.6rem; align-items: start; max-width: 1220px; margin: 0 auto;
}
.home-left { min-width: 0; padding-top: .5rem; }
.home-right { min-width: 0; position: sticky; top: 1rem; }

.panel {
  border: 1px solid var(--web-line); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, var(--web-panel), #0c0c12);
}
.panel-head {
  display: flex; align-items: center; gap: .4rem; padding: .5rem .55rem;
  border-bottom: 1px solid var(--web-line-soft); background: rgba(255,255,255,.015);
}
.switches { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.switch {
  display: inline-flex; align-items: center; gap: .25rem; cursor: pointer;
  font-size: .72rem; font-weight: 560; color: var(--web-dim); white-space: nowrap;
  padding: .26rem .48rem; border-radius: 999px; border: 1px solid var(--web-line);
  background: rgba(255,255,255,.025); transition: .15s ease;
}
.switch i.bi { font-size: .74rem; }
.switch:hover { color: var(--web-text); border-color: var(--web-faint); }
.switch.on {
  color: #fff; border-color: rgba(255,106,19,.45);
  background: linear-gradient(180deg, rgba(255,106,19,.2), rgba(255,106,19,.06));
}
.switch-count { font-size: .66rem; color: var(--web-faint); font-variant-numeric: tabular-nums; }
.switch.on .switch-count { color: var(--web-orange-hi); }
.icon-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  border: 1px solid var(--web-line); background: rgba(255,255,255,.025); cursor: pointer;
  color: var(--web-dim); border-radius: 999px; padding: .2rem .55rem; font-size: .72rem;
  transition: .15s ease; flex: none;
}
.icon-btn:hover { color: var(--web-orange-hi); border-color: rgba(255,106,19,.45); }
.panel-note {
  padding: .45rem .8rem; font-size: .74rem; color: var(--web-orange-hi);
  background: rgba(255,106,19,.07); border-bottom: 1px solid var(--web-line-soft);
}
.panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .35rem .8rem .5rem; border-top: 1px solid var(--web-line-soft);
  font-size: .72rem;
}
.panel-foot .seemore { margin-top: 0; }

/* One row per site. The logo is the site's own favicon, cached in the
   workspace — see core/favicons.py for why it is never hot-linked. */
.site-row {
  display: grid; align-items: center; gap: .6rem;
  grid-template-columns: 1.9rem minmax(0, 1fr) auto auto;
  padding: .5rem .8rem; text-decoration: none; color: var(--web-text);
  border-bottom: 1px solid var(--web-line-soft); transition: background .13s ease;
}
.site-row:last-child { border-bottom: 0; }
.site-row:hover { background: rgba(255,106,19,.07); }
.site-logo {
  width: 1.9rem; height: 1.9rem; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--web-line); background: rgba(255,255,255,.04); overflow: hidden;
}
/* Fill the tile: half these icons are wordmarks, and a wordmark shrunk to
   16px is a grey smudge. `contain` keeps square marks square. */
.site-logo img { width: 100%; height: 100%; object-fit: contain; padding: 1px; }
.site-letter { font-size: .78rem; font-weight: 700; color: var(--web-faint); }
.site-main { min-width: 0; }
.site-name {
  display: block; font-size: .84rem; color: var(--web-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-row:hover .site-name { color: #fff; }
.site-sub {
  display: block; font-size: .7rem; color: var(--web-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-metric {
  font-size: .72rem; color: var(--web-dim); text-align: right;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.site-state { text-align: right; }
.site-when {
  display: block; font-size: .66rem; color: var(--web-faint);
  font-variant-numeric: tabular-nums; margin-top: .15rem;
}

@media (max-width: 980px) {
  .home-split { grid-template-columns: 1fr; }
  .home-right { position: static; }
}

/* ---------- the composer ---------- */

.composer {
  border: 1px solid var(--web-line); border-radius: 16px; margin: 0 0 1.6rem;
  background: linear-gradient(180deg, var(--web-panel-2), #0b0b11);
  box-shadow: 0 14px 38px rgba(0,0,0,.5); overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.composer:focus-within {
  border-color: rgba(255,106,19,.5);
  box-shadow: 0 14px 38px rgba(0,0,0,.5), 0 0 0 3px rgba(255,106,19,.14);
}
.composer-main { display: flex; align-items: center; gap: .5rem; padding: .55rem .55rem .55rem .95rem; }
.composer-url {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  color: var(--web-text); font-size: .95rem; padding: .5rem 0;
}
.composer-url::placeholder { color: #4a4e5a; }
.composer-go { white-space: nowrap; padding: .5rem 1.05rem; }

.composer-foot {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .5rem .75rem; border-top: 1px solid var(--web-line-soft);
  background: rgba(255,255,255,.014);
}
/* ---------- picking the model ----------

   The model is the target the whole pipeline is aimed at, so it is picked from
   cards that show what it holds rather than from a dropdown that shows a name.
   Each card carries its own pencil: whichever model you are looking at is one
   click from its editor. */

.modelpick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: .5rem; padding: .6rem .75rem; border-top: 1px solid var(--web-line-soft);
}
.modelcard {
  position: relative; display: flex; flex-direction: column; gap: .35rem;
  padding: .55rem .6rem; border-radius: 11px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--web-line); background: rgba(255,255,255,.022);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.modelcard input { position: absolute; opacity: 0; pointer-events: none; }
.modelcard:hover { border-color: var(--web-faint); transform: translateY(-1px); }
/* `.on` is the server's answer; `:has(:checked)` is the one you just clicked —
   nothing re-renders on a pick, so the card has to light up on its own. */
.modelcard.on, .modelcard:has(input:checked) {
  border-color: rgba(255,106,19,.5); background: linear-gradient(180deg, rgba(255,106,19,.15), rgba(255,106,19,.04));
  box-shadow: 0 0 18px rgba(255,106,19,.12);
}
.modelcard:not(:has(input:checked)) { border-color: var(--web-line); }
.modelcard:focus-within { outline: 2px solid var(--web-orange); outline-offset: 2px; }
.modelcard-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.modelcard-title {
  font-size: .84rem; font-weight: 640; color: #fff; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.modelcard-edit {
  flex: none; color: var(--web-faint); font-size: .78rem; text-decoration: none;
  border-radius: 7px; padding: 0 .2rem;
}
.modelcard-edit:hover { color: var(--web-orange-hi); }
.modelcard-fields { display: flex; flex-wrap: wrap; gap: .22rem; }
.pip {
  font-size: .62rem; color: var(--web-dim); background: rgba(255,255,255,.05);
  border-radius: 999px; padding: .05rem .38rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.pip-child { color: var(--web-cyan); background: rgba(69,208,255,.08); }
.modelcard-foot { font-size: .66rem; color: var(--web-faint); }
.modelcard-new { justify-content: center; border-style: dashed; }
.modelcard-new:hover { border-color: rgba(255,106,19,.45); }
.composer-more { margin-left: auto; }
.composer-more > summary {
  list-style: none; cursor: pointer; color: var(--web-faint); font-size: .78rem;
  padding: .3rem .5rem; border-radius: 8px; user-select: none;
}
.composer-more > summary::-webkit-details-marker { display: none; }
.composer-more > summary:hover { color: var(--web-orange-hi); background: rgba(255,106,19,.07); }
.composer-extra {
  flex-basis: 100%; padding: .85rem .1rem .3rem; border-top: 1px solid var(--web-line-soft);
  margin-top: .5rem;
}
.composer-more[open] { flex-basis: 100%; margin-left: 0; }

/* ==========================================================================
   Activity feed — builds and scrapes in one list
   ========================================================================== */

.filterbar {
  border: 1px solid var(--web-line); border-radius: 13px; padding: .6rem .85rem;
  background: linear-gradient(180deg, var(--web-panel), #0c0c12); margin-bottom: 1rem;
}
.filter-line {
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; padding: .22rem 0;
}
.filter-label {
  font-size: .64rem; text-transform: uppercase; letter-spacing: .11em;
  color: var(--web-faint); font-weight: 640; width: 3.4rem; flex: none;
}
.chip-toggle {
  position: relative; font-size: .78rem; color: var(--web-dim); cursor: pointer;
  padding: .26rem .6rem; border-radius: 999px; border: 1px solid var(--web-line);
  background: rgba(255,255,255,.025); display: inline-flex; align-items: center; gap: .35rem;
  transition: .15s ease; user-select: none;
}
/* Visually hidden, not gone: opacity:0 + pointer-events:none took these out of
   the accessibility tree and off the tab order, leaving the filters mouse-only. */
.chip-toggle input {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.chip-toggle:focus-within {
  outline: 2px solid var(--web-orange); outline-offset: 2px; color: #fff;
}
.chip-toggle:hover { color: var(--web-text); border-color: var(--web-faint); }
/* `.on` is what the server rendered; `:has(:checked)` is what you just clicked.
   Only the rows are swapped on a filter change, so without the second selector
   the chip you pressed would stay dark while the feed underneath it updated. */
.chip-toggle.on,
.chip-toggle:has(input:checked) {
  color: #fff; border-color: rgba(255,106,19,.45);
  background: linear-gradient(180deg, rgba(255,106,19,.2), rgba(255,106,19,.06));
}
.chip-toggle:not(:has(input:checked)) {
  color: var(--web-dim); border-color: var(--web-line);
  background: rgba(255,255,255,.025);
}
.chip-count { font-size: .68rem; color: var(--web-faint); font-variant-numeric: tabular-nums; }
.chip-toggle.on .chip-count,
.chip-toggle:has(input:checked) .chip-count { color: var(--web-orange-hi); }

.feed { border: 1px solid var(--web-line); border-radius: 13px; overflow: hidden; }
.feed-row {
  display: grid; align-items: center; gap: .75rem;
  grid-template-columns: 5.6rem minmax(0, 1fr) 4.4rem 5.6rem 2.4rem;
  padding: .6rem .85rem; text-decoration: none; color: var(--web-text);
  border-bottom: 1px solid var(--web-line-soft); border-left: 2px solid transparent;
  transition: background .13s ease;
}
.feed-row:last-child { border-bottom: 0; }
.feed-row:hover { background: rgba(255,106,19,.07); }
.feed-running { border-left-color: var(--web-orange); }
.feed-failed  { border-left-color: rgba(224,36,61,.7); }

.feed-kind {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--web-faint); font-weight: 640; display: inline-flex; align-items: center; gap: .3rem;
}
.feed-kind i.bi { font-size: .8rem; }
.kind-build i.bi { color: var(--web-orange); }
.kind-scrape i.bi { color: var(--web-cyan); }

.feed-main { min-width: 0; }
.feed-url {
  display: block; font-size: .85rem; color: var(--web-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-row:hover .feed-url { color: #fff; }
.feed-sub {
  display: block; font-size: .72rem; color: var(--web-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-metric {
  font-size: .9rem; font-weight: 640; text-align: right; color: var(--web-text);
  font-variant-numeric: tabular-nums;
}
.feed-metric-unit {
  display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--web-faint); font-weight: 500;
}
.feed-when {
  font-size: .72rem; color: var(--web-faint); text-align: right;
  font-variant-numeric: tabular-nums;
}
.feed-empty { padding: 1.6rem; text-align: center; color: var(--web-faint); font-size: .84rem; }
.feed-empty i.bi { display: block; font-size: 1.3rem; margin-bottom: .35rem; opacity: .6; }
.feed-more {
  padding: .5rem .85rem; font-size: .72rem; color: var(--web-faint);
  background: rgba(255,255,255,.015); border-top: 1px solid var(--web-line-soft);
}

/* A finished build nobody has judged yet — neither green nor red. */
.status-built {
  background: rgba(255,176,32,.12); color: #ffc65c; border-color: rgba(255,176,32,.3);
}

@media (max-width: 720px) {
  .feed-row { grid-template-columns: minmax(0, 1fr) 4.6rem 2.4rem; row-gap: .3rem; }
  .feed-kind, .feed-metric { display: none; }
  /* the word fits, the labels do not — the bar keeps its icons */
  .topbar { gap: .6rem; padding: .5rem .8rem; }
  .topbar-nav a span { display: none; }
  .composer { margin-left: 0; }
  .turn { grid-template-columns: 1fr; }
  .turn .avatar { display: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.underfoot {
  margin-top: 3rem; border-top: 1px solid var(--web-line);
  background: linear-gradient(180deg, rgba(255,255,255,.012), transparent);
}
.underfoot .inner {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  padding: 1.1rem 1.5rem 2rem; max-width: 1080px; margin: 0 auto;
}
.footlink {
  display: inline-flex; align-items: baseline; gap: .4rem; text-decoration: none;
  color: var(--web-dim); font-size: .84rem; font-weight: 560;
  padding: .35rem .6rem; border-radius: 8px; border: 1px solid transparent;
}
.footlink:hover { color: #fff; background: rgba(255,255,255,.045); }
.footlink.active {
  color: #fff; border-color: rgba(255,106,19,.4);
  background: linear-gradient(180deg, rgba(255,106,19,.18), rgba(255,106,19,.05));
}
.footlink i.bi { color: var(--web-orange); }
.footnote { color: var(--web-faint); font-size: .72rem; font-weight: 400; }
.footmark {
  margin-left: auto; color: var(--web-faint); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase;
}
