:root {
  --bulma-primary-h: 256deg;
  --bulma-primary-s: 72%;
  --bulma-primary-l: 58%;
  /* Bulma derives dark text for this hue, which lands at 3.5:1 on the primary
     background. White is 5.7:1 and clears WCAG AA. */
  --bulma-primary-invert-l: 100%;
  --bulma-link-h: 256deg;
  --bulma-link-s: 72%;
  --bulma-link-l: 58%;
  --bulma-family-primary: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bulma-family-code: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bulma-radius: 0.5rem;
  --bulma-radius-large: 0.75rem;
  --app-sidebar-width: 15rem;
  --app-sidebar-bg: #16132b;
  --app-sidebar-fg: #c9c4e8;
  --app-sidebar-active: #2a2550;
  --app-surface: #f7f7fb;
  --app-border: #e7e6f0;
  --app-muted: #6b6883;
  --app-succeeded: #1f9d62;
  --app-failed: #d9384f;
  --app-running: #6d4ae6;
  --app-skipped: #9a98ad;
  --app-pending: #b3b1c4;
}

html { background: var(--app-surface); scroll-behavior: smooth; }
body { min-height: 100vh; }

@view-transition { navigation: auto; }

.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.app-sidebar {
  width: var(--app-sidebar-width);
  flex-shrink: 0;
  background: var(--app-sidebar-bg);
  color: var(--app-sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 1rem 0.75rem;
  z-index: 30;
  view-transition-name: sidebar;
}
.app-sidebar .brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 1.1rem; padding: .25rem .5rem 1rem; }
.app-sidebar .brand .brand-mark { border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.app-sidebar .menu-label { color: #8a84b5; font-size: .7rem; letter-spacing: .08em; margin: 1.25rem .5rem .5rem; }
.app-sidebar .menu-list a {
  color: var(--app-sidebar-fg);
  display: flex; align-items: center; gap: .6rem;
  border-radius: var(--bulma-radius);
  padding: .5rem .6rem;
  font-size: .925rem;
}
.app-sidebar .menu-list a:hover { background: var(--app-sidebar-active); color: #fff; }
.app-sidebar .menu-list a.is-active { background: var(--app-sidebar-active); color: #fff; box-shadow: inset 3px 0 0 #a78bfa; }
.app-sidebar .account-switcher { margin: 0 .25rem; }
.app-sidebar .account-switcher .button { width: 100%; justify-content: space-between; background: var(--app-sidebar-active); border: none; color: #fff; }
.app-sidebar .sidebar-footer { margin-top: auto; padding: .5rem; font-size: .8rem; color: #8a84b5; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.5rem; background: #fff; border-bottom: 1px solid var(--app-border);
  position: sticky; top: 0; z-index: 20;
}
.app-topbar .breadcrumb { margin: 0; font-size: .9rem; }
/* The breadcrumb carries user-supplied names (workflows, artifacts, connections),
   so it has to give way rather than push the topbar wider than the screen. */
.app-topbar-start { flex: 1 1 auto; min-width: 0; }
.app-topbar > .dropdown { flex: 0 0 auto; }
.app-topbar .breadcrumb, .app-topbar .breadcrumb ul { min-width: 0; flex-wrap: nowrap; }
/* Any crumb may hold a long name, so each one truncates. Ancestors keep their
   natural width up to a share of the bar, and the crumb for the current page
   takes what is left, so neither end collapses to a single letter. */
.app-topbar .breadcrumb li { min-width: 0; overflow: hidden; }
.app-topbar .breadcrumb li a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-topbar .breadcrumb li:not(:last-child) { flex: 0 0 auto; max-width: 40%; }
.app-topbar .breadcrumb li:last-child { flex: 0 1 auto; }
.app-content { padding: 1.5rem; max-width: 1400px; width: 100%; margin: 0 auto; }
.app-content.is-flush { max-width: none; }

.sidebar-toggle { display: none; }
@media (max-width: 1023px) {
  .app-sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .app-shell.sidebar-open .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  /* A phone held sideways is shorter than the menu. */
  .app-sidebar { overflow-y: auto; overscroll-behavior: contain; }
  .app-shell.sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(22,19,43,.4); }
  .sidebar-toggle { display: inline-flex; }
}
@media (max-width: 768px) {
  .app-topbar { padding: .75rem 1rem; gap: .5rem; }
  .app-content { padding: 1rem; }
  .billing-banner { padding: .6rem 1rem; }
  /* Keep the parent link so there is still a way up, and drop the crumbs above it. */
  .app-topbar .breadcrumb li:not(:last-child):not(:nth-last-child(2)) { display: none; }
  .app-topbar .breadcrumb li:nth-last-child(2)::before { display: none; }
  .app-topbar .breadcrumb li:nth-last-child(2) a { padding-left: 0; }
  .hero-prompt { padding: 1.25rem; }
  /* Step names are long, so give them a row of their own and let duration and
     status sit below. The kind icon is dropped: the step body names the kind. */
  .timeline-step > summary { flex-wrap: wrap; row-gap: .4rem; }
  .timeline-step > summary > .icon { display: none; }
  .timeline-step > summary .step-summary-title { flex-basis: 100%; }
  /* Stacked below the page, a full-height chat is mostly empty space, and
     sticky buys nothing once it is no longer beside a column. */
  .assistant-panel { position: static; height: auto; min-height: 20rem; max-height: 70dvh; }
  .assistant-panel.is-standalone { height: calc(100dvh - 11rem); max-height: none; }
  /* The example prompts are full sentences, so let them wrap instead of running wide. */
  .hero-prompt .tags .tag { white-space: normal; height: auto; text-align: left; padding: .4em .75em; line-height: 1.35; border-radius: var(--bulma-radius); }
  /* is-fullwidth pins these tables to the container, so columns holding a name
     or a summary collapse to a word per line. Give them a floor and let the
     container scroll, which is what it is there for. */
  .table-container .table { min-width: 34rem; }
  /* These drop their secondary columns on a phone instead, so what is left
     fits and the status stays in view without scrolling. */
  .table-container .table.fits-mobile { min-width: 0; }
  /* A one-line name sets its column's minimum at the name's full width; a zero
     max-width lets the column take only the room left and truncate into it. */
  .table.fits-mobile td.run-workflow { max-width: 0; width: 100%; }
  .table.fits-mobile td, .table.fits-mobile th { padding-inline: .5em; }
  /* Six columns leave the workflow little room, and a wrapped name turns one
     run into a nine-line row; the run page carries the name in full. */
  .table td.run-workflow { max-width: 12rem; }
  .table td.run-workflow a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* One truncated line of description pins the column at its full width and
     pushes the status off screen; two wrapped lines keep it in view. */
  .table .workflow-description { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  /* iOS Safari zooms the page into any field under 16px when it takes focus,
     and leaves it zoomed. Small fields are a desktop density choice anyway. */
  .input, .input.is-small, .textarea, .select select, .select.is-small select { font-size: 16px; }
  /* The crumbs are the way back up, so they need a thumb-sized target. */
  .app-topbar .breadcrumb li a { padding-block: .5rem; }
  /* Fields grow to 16px above, so a small button beside one would sit shorter
     than the field it belongs to. */
  .field.has-addons .control > .button { height: 100%; }
  /* Bulma's 1.5rem card and 2rem modal padding, nested inside the page's own,
     leaves a phone's content a column a few words wide. */
  .card-content { padding: 1.25rem 1rem; }
  .modal-card-head, .modal-card-body, .modal-card-foot { padding: 1rem 1.25rem; }
  /* Model-written Markdown carries tables as wide as the data, so they scroll
     inside the card instead of the page, and keep columns wide enough to read. */
  .content table { display: block; overflow-x: auto; }
  .content table td, .content table th { min-width: 7rem; }
  .table .last-run-time { display: block; margin-top: .2rem; }
  .table td.is-timestamp { white-space: nowrap; }
}

.icon svg { width: 1.1em; height: 1.1em; }
.icon.is-large svg { width: 2em; height: 2em; }
svg.lucide { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header > * { min-width: 0; }
.page-header .title { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem !important; }
.live-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--app-muted); }
.page-header .subtitle { color: var(--app-muted); font-size: .95rem; }
/* Titles and subtitles carry names, slugs and ids nobody chose for a phone. */
.page-header .title, .page-header .subtitle { overflow-wrap: anywhere; }

/* Artifacts and assistant replies are Markdown a model wrote, so a URL or an
   identifier with no break in it is routine and has to wrap inside its card.
   break-word, not anywhere, so table columns keep their words whole. */
.content { overflow-wrap: break-word; }
.content img { max-width: 100%; height: auto; }
.is-breakable { overflow-wrap: anywhere; }

.card, .box { box-shadow: none; border: 1px solid var(--app-border); }
.card-header { box-shadow: none; border-bottom: 1px solid var(--app-border); }
.box.is-hoverable { transition: border-color .15s ease, transform .15s ease; }
.box.is-hoverable:hover { border-color: hsl(var(--bulma-primary-h), var(--bulma-primary-s), 80%); transform: translateY(-1px); }

.table { font-size: .925rem; }
.table td, .table th { vertical-align: middle; }
.table tbody tr { transition: background .3s ease; }

.stat { padding: 1.1rem 1.25rem; }
.stat .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat .stat-label { color: var(--app-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }

.status-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--app-pending); flex-shrink: 0; }
.status-succeeded .status-dot, .status-enabled .status-dot, .status-connected .status-dot, .status-passed .status-dot, .status-current .status-dot, .status-dot.is-succeeded { background: var(--app-succeeded); }
.status-failed .status-dot, .status-failing .status-dot, .status-dot.is-failed { background: var(--app-failed); }
.status-draft .status-dot, .status-unverified .status-dot, .status-past .status-dot, .status-errored .status-dot, .status-stale .status-dot { background: #e0a100; }
.status-running .status-dot, .status-dot.is-running { background: var(--app-running); animation: pulse 1.2s ease-in-out infinite; }
.status-skipped .status-dot, .status-cancelled .status-dot, .status-orphaned .status-dot, .status-off .status-dot { background: var(--app-skipped); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(109,74,230,.5); } 50% { box-shadow: 0 0 0 .35rem rgba(109,74,230,0); } }

.tag.is-status { gap: .4rem; font-weight: 600; text-transform: capitalize; }
/* Bulma tags are nowrap and fixed height; tags carrying user-supplied names
   need to wrap instead of running off a narrow screen. */
.tag.is-wrapping { white-space: normal; height: auto; min-height: 2em; text-align: left; overflow-wrap: anywhere; }

pre.code, .code-block {
  background: #1b1830; color: #e6e3f8; border-radius: var(--bulma-radius);
  font-size: .8rem; line-height: 1.55; padding: 1rem 1.1rem; overflow: auto; max-height: 36rem;
}
pre.code.is-light { background: #f3f2f9; color: #2b2940; }
pre.code.json-view { max-height: 22rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-step .column { min-width: 0; }

/* DAG */
.dag { position: relative; overflow-x: auto; padding: .5rem .25rem 1rem; }
.dag-levels { display: flex; gap: 2.25rem; align-items: flex-start; position: relative; z-index: 1; min-width: min-content; }
/* flex-shrink has to be off, or a narrow screen squeezes the levels past
   min-width and the step text collapses to a few characters per line. */
.dag-level { display: flex; flex-direction: column; gap: 1rem; flex: 0 0 auto; min-width: 11.5rem; max-width: 16rem; }
.dag-trigger, .dag-node {
  background: #fff; border: 1px solid var(--app-border); border-radius: var(--bulma-radius-large);
  padding: .75rem .9rem; font-size: .875rem; position: relative;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.dag-node:hover { border-color: hsl(var(--bulma-primary-h), 70%, 75%); }
.dag-trigger { background: #f1edff; border-color: #d9d0ff; }
.dag-node .dag-kind, .dag-trigger .dag-kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--app-muted); display: flex; align-items: center; gap: .35rem; }
.dag-node .dag-title { font-weight: 600; margin-top: .15rem; }
.dag-node .dag-detail { color: var(--app-muted); font-size: .78rem; margin-top: .2rem; word-break: break-word; }
.dag-node.status-running { border-color: var(--app-running); box-shadow: 0 0 0 3px rgba(109,74,230,.15); }
.dag-node.status-succeeded { border-color: rgba(31,157,98,.5); }
.dag-node.status-failed { border-color: var(--app-failed); box-shadow: 0 0 0 3px rgba(217,56,79,.12); }
.dag-node.status-skipped { opacity: .6; }
.dag-node .dag-condition { font-size: .72rem; color: #8a5a00; background: #fff6e0; border-radius: .3rem; padding: .1rem .35rem; display: inline-block; margin-top: .35rem; }
.dag-node .dag-budget-chip { font-size: .72rem; color: #4a3a8f; background: #f1edff; border-radius: .3rem; padding: .1rem .35rem; display: inline-flex; align-items: center; gap: .25rem; margin-top: .35rem; }
.dag-budget { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; font-size: .8rem; color: var(--app-muted); margin-bottom: .75rem; }
.dag-budget strong { color: inherit; font-weight: 600; margin-right: .25rem; }
.budget-meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .5rem 1.25rem; max-width: 40rem; margin-top: .6rem; }
.budget-meter .progress { height: .35rem; margin-top: .2rem; margin-bottom: 0; }
.dag-edges { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: visible; }
.dag-edges path { fill: none; stroke: #cbc6e6; stroke-width: 1.5; }
.dag-edges path.is-conditional { stroke-dasharray: 4 4; }
.dag [data-lines] { cursor: pointer; }
.dag .dag-trigger.is-highlighted, .dag .dag-node.is-highlighted { border-color: hsl(var(--bulma-primary-h), 70%, 60%); box-shadow: 0 0 0 3px rgba(109,74,230,.15); }

/* A definition as its diagram or its YAML. The YAML is one span per line, so a
   step's lines can be highlighted and the gutter can number them. */
.explorer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.explorer-toolbar .button.is-selected { background: #f1edff; border-color: #d9d0ff; color: hsl(var(--bulma-primary-h), 60%, 45%); font-weight: 600; z-index: 1; }
.yaml-source { position: relative; padding-left: 0; }
/* Wide enough for the longest line, so a highlight reaches past what scrolls. */
.yaml-source code { display: inline-block; min-width: 100%; }
.yaml-line { display: block; padding-left: 3.4rem; position: relative; }
.yaml-line::before { content: attr(data-line); position: absolute; left: 0; width: 2.5rem; text-align: right; color: #6f6a92; user-select: none; }
.yaml-line.is-highlighted { background: rgba(155, 131, 255, .2); box-shadow: inset 3px 0 0 #9b83ff; }

/* Workflow assistant */
.assistant-panel { position: sticky; top: 4.5rem; height: calc(100vh - 6rem); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--app-border); border-radius: var(--bulma-radius-large); overflow: hidden; }
.assistant-panel.is-standalone { position: static; height: calc(100vh - 10rem); }

/* The editor: the chat on the left, a preview of its unsaved drafts on the right. */
.editor { display: grid; grid-template-columns: 26rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.editor-preview { position: sticky; top: 4.5rem; height: calc(100vh - 6rem); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--app-border); border-radius: var(--bulma-radius-large); overflow: hidden; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding: .55rem .75rem; border-bottom: 1px solid var(--app-border); }
.editor-stepper { display: flex; align-items: center; gap: .25rem; min-width: 0; flex: 1; }
.editor-position { display: flex; flex-direction: column; min-width: 0; padding: 0 .35rem; line-height: 1.3; }
.editor-body { flex: 1; overflow: auto; padding: 1rem; }
.editor-body .yaml-source { max-height: none; }
@media (max-width: 1023px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor .assistant-panel { position: static; height: 70dvh; min-height: 20rem; }
  .editor-preview { position: static; height: auto; min-height: 24rem; }
}
.assistant-header { padding: .8rem 1rem; border-bottom: 1px solid var(--app-border); display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.assistant-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .85rem; }
.assistant-composer { border-top: 1px solid var(--app-border); padding: .75rem; background: #fcfcfe; }
/* The textarea and its button share one bordered box. The textarea's line plus
   its padding is exactly the button's height, so a single line sits centred and
   longer text grows upward with the button kept at the bottom. */
.composer-box { display: flex; align-items: flex-end; gap: .5rem; padding: .375rem .375rem .375rem .875rem; background: #fff; border: 1px solid var(--app-border); border-radius: var(--bulma-radius-large); }
.composer-box:focus-within { border-color: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l)); box-shadow: 0 0 0 .125em hsla(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l), .25); }
.composer-input { flex: 1; min-width: 0; height: 2.25rem; max-height: 12rem; padding: .375rem 0; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 1rem; line-height: 1.5rem; color: inherit; }
.composer-input::placeholder { color: var(--app-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-input:disabled { cursor: not-allowed; }
.composer-button { flex: none; width: 2.25rem; height: 2.25rem; padding: 0; }
.composer-action .icon svg { width: .9rem; height: .9rem; fill: currentColor; }
.composer-action { display: contents; }
.message { max-width: 92%; font-size: .9rem; line-height: 1.5; }
.message.is-user { align-self: flex-end; background: hsl(var(--bulma-primary-h), 72%, 58%); color: #fff; padding: .6rem .85rem; border-radius: 1rem 1rem .25rem 1rem; white-space: pre-wrap; }
.message.is-assistant { align-self: flex-start; }
.message.is-assistant .message-body-text { background: #f4f3fa; padding: .65rem .9rem; border-radius: 1rem 1rem 1rem .25rem; }
.message.is-assistant .stream-text:empty::after { content: "…"; animation: blink 1s steps(2) infinite; }
.message .content { font-size: .9rem; }
.message .content pre { font-size: .75rem; padding: .6rem; }
.message .content p:not(:last-child) { margin-bottom: .6rem; }
.message .tool-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.message .tool-chips .tag { font-size: .7rem; }
.stream-text { white-space: pre-wrap; }
.thinking-indicator { display: inline-flex; gap: .25rem; align-items: center; color: var(--app-muted); font-size: .85rem; }
.thinking-indicator span { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; animation: bounce 1.2s infinite ease-in-out; }
.thinking-indicator span:nth-child(2) { animation-delay: .15s; }
.thinking-indicator span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }

/* Run timeline */
.timeline-step { border: 1px solid var(--app-border); border-radius: var(--bulma-radius-large); background: #fff; margin-bottom: .75rem; }
.timeline-step > summary { list-style: none; cursor: pointer; padding: .8rem 1rem; display: flex; align-items: center; gap: .75rem; }
.timeline-step > summary::-webkit-details-marker { display: none; }
.timeline-step > summary .step-summary-title { flex: 1 1 auto; min-width: 0; }
.timeline-step[open] > summary { border-bottom: 1px solid var(--app-border); }
.timeline-step .step-body { padding: 1rem; }
/* A failed HTTP call's error can be a whole HTML page; keep it as tall as the logs. */
.timeline-step .step-error { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16rem; overflow: auto; }
.timeline-step.status-running { border-color: var(--app-running); }
.timeline-step.status-failed { border-color: rgba(217,56,79,.5); }
.log-lines { font-family: var(--bulma-family-code); font-size: .75rem; background: #1b1830; color: #d7d3ef; border-radius: var(--bulma-radius); padding: .6rem .8rem; max-height: 16rem; overflow: auto; }
.log-lines:empty { display: none; }
.log-lines .log-time { color: #7d78a3; margin-right: .6rem; }
.stream-output { background: #f4f3fa; border-radius: var(--bulma-radius); padding: .6rem .8rem; font-size: .85rem; max-height: 16rem; overflow: auto; }
.stream-output:empty { display: none; }

/* A coding agent's session, one event after another. */
.agent-events { display: flex; flex-direction: column; gap: .5rem; }
.agent-event.is-message { background: #fff; border: 1px solid var(--app-border); border-radius: var(--bulma-radius-large); padding: .6rem .8rem; font-size: .875rem; }
.agent-event.is-reasoning { padding: 0 .8rem; }
.agent-event.is-tool { border: 1px solid var(--app-border); border-radius: var(--bulma-radius); background: #fff; padding: .45rem .8rem; }
.agent-event.is-tool.is-failed { border-color: rgba(217,56,79,.5); }
.agent-event.is-tool > summary { cursor: pointer; display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.agent-event.is-tool > summary .text-truncate { flex: 1 1 auto; min-width: 0; }
.agent-event-meta { flex: none; }
.agent-event.is-step { padding: 0 .8rem; }
.agent-event.is-error { margin-bottom: 0; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--app-muted); }
.empty-state .icon { color: #b8b0e8; margin-bottom: .75rem; }

/* The add-connection catalog: the marketing integrations page, restyled to sit in the app. */
.connector-catalog-controls { max-width: 48rem; margin-bottom: 2rem; }
.connector-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.connector-pill { border: 1px solid var(--app-border); background: #fff; border-radius: 999px; padding: .3rem .8rem; font: inherit; font-weight: 600; font-size: .8rem; color: var(--app-muted); cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; transition: border-color .15s ease, color .15s ease; }
.connector-pill:hover { border-color: #c9bffa; color: #16132b; }
.connector-pill.is-active { background: #16132b; border-color: #16132b; color: #fff; }
.connector-pill .icon { width: 1em; height: 1em; }
.connector-pill .icon svg { width: 1em; height: 1em; }
.connector-group { margin-bottom: 1.75rem; }
.connector-group-heading { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--app-muted); margin-bottom: .75rem; }
.connector-card { display: flex; flex-direction: column; height: 100%; color: inherit; }
.connector-card:hover { color: inherit; }
.connector-card .tags { margin-top: auto; padding-top: .75rem; }
.connector-card-title { display: flex; align-items: center; gap: .65rem; margin-bottom: .5rem; }
.connector-card-icon { flex-shrink: 0; width: 2.25rem; height: 2.25rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #f1eefe; color: #6d4ae6; }

.hero-prompt { background: linear-gradient(135deg, #221c49 0%, #3b2a8a 60%, #6d4ae6 100%); color: #fff; border-radius: var(--bulma-radius-large); padding: 2rem; }
.hero-prompt .title, .hero-prompt .subtitle { color: #fff; }
.hero-prompt textarea { border: none; }

/* Neutral rather than the brand gradient: the sign-in page carries no branding. */
.auth-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: #f4f4f6; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 26rem; }

/* left bounds the stack so a long message cannot run off a narrow screen. */
.flash-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; left: 1.25rem; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.flash-stack .notification { max-width: 24rem; box-shadow: 0 10px 30px rgba(22,19,43,.2); animation: slide-in .25s ease; }
@keyframes slide-in { from { transform: translateY(1rem); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-card { max-width: 40rem; width: calc(100% - 2rem); border-radius: var(--bulma-radius-large); }
.modal-card-head, .modal-card-foot { background: #fff; }
.modal-card-foot { justify-content: flex-end; gap: .5rem; }
.modal { animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

turbo-frame[busy] { opacity: .65; transition: opacity .2s; }
.turbo-progress-bar { height: 3px; background: #a78bfa; }

.is-mono { font-family: var(--bulma-family-code); }
.has-text-muted { color: var(--app-muted); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-2 { gap: .5rem; }
.token-reveal { word-break: break-all; }

.diff-view span { display: block; white-space: pre-wrap; padding: 0 .4rem; margin: 0 -.4rem; border-radius: .2rem; }
.diff-view .diff-added { background: #dcfce7; color: #166534; }
.diff-view .diff-removed { background: #fee2e2; color: #991b1b; }
.diff-view .diff-folded { color: var(--app-muted); font-style: italic; }
.billing-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; border-radius: 0; padding: .6rem 1.5rem; font-size: .9rem; }
.status-trial .status-dot { background: #3b82f6; }
.status-paused .status-dot { background: var(--app-failed); }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.shot-card { display: block; overflow: hidden; color: inherit; }
.shot-cover { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; background: var(--bulma-scheme-main-bis); color: #b8b0e8; overflow: hidden; }
.shot-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot-row { display: grid; grid-template-columns: repeat(var(--shot-columns, 1), minmax(0, 1fr)); gap: 1rem; align-items: start; }
.shot { margin: 0; overflow: hidden; }
.shot-caption { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; min-width: 0; }
.shot-image { display: block; border-top: 1px solid var(--bulma-border-weak); }
.shot-image img { display: block; width: 100%; height: auto; }
@media (max-width: 768px) { .shot-row { grid-template-columns: minmax(0, 1fr); } }
.browser-video { margin: 0; overflow: hidden; max-width: 64rem; }
.browser-video video { display: block; width: 100%; height: auto; background: #000; }

/* Artifact outline. Beside the document on wide screens, where it stays in view
   as the document scrolls. On narrow ones there is no room beside it, so it
   becomes a bar pinned under the topbar that names the section being read and
   opens the whole list on a tap. --outline-top is the topbar's height, measured
   by the controller because the topbar wraps differently on each screen. */
.artifact-layout.has-outline { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1.5rem; align-items: start; }
.artifact-outline { position: sticky; top: 4.5rem; font-size: .85rem; }
.artifact-outline-toggle { display: none; }
.artifact-outline-list { max-height: calc(100vh - 6rem); overflow-y: auto; overscroll-behavior: contain; }
.artifact-outline-label { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--app-muted); padding: 0 .75rem .4rem; }
.artifact-outline a { display: block; padding: .25rem .75rem; color: #5e5a7a; border-left: 2px solid var(--app-border); overflow-wrap: anywhere; }
.artifact-outline a:hover { color: #16132b; border-left-color: #c4b5fd; }
.artifact-outline a.is-active { color: #16132b; font-weight: 600; border-left-color: #a78bfa; }
.artifact-outline a.is-level-2 { padding-left: 1.5rem; }
.artifact-outline a.is-level-3 { padding-left: 2.25rem; font-size: .8rem; }
.artifact-body :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 4.5rem; }
.artifact-body .anchor { display: none; }
.artifact-body [tabindex="-1"]:focus { outline: none; }
/* A ```chart block becomes a figure; its source stays inside, shown until the
   chart is drawn so the data can still be read without the script. */
.content figure.artifact-chart { margin: 1.25rem 0; text-align: left; }
.artifact-chart figcaption { font-weight: 600; font-size: .95rem; color: #16132b; margin-bottom: .5rem; }
.artifact-chart.is-drawn > pre { display: none; }
.artifact-chart-canvas { width: 100%; color: #5e5a7a; }
.artifact-chart .uplot { font-family: inherit; }
/* The legend is a table, so it would otherwise take .content's table borders. */
.content .artifact-chart .u-legend { width: auto; margin: .25rem auto 0; font-size: .8rem; }
.content .artifact-chart .u-legend :is(th, td) { border: 0; padding: .1rem .35rem; vertical-align: middle; }
.content .artifact-chart .u-legend th { font-weight: 500; color: #16132b; }
.content .artifact-chart .u-legend .u-series:first-child { display: none; }
.artifact-chart.has-error .help { margin-bottom: .5rem; }
@media (max-width: 1215px) {
  .artifact-layout.has-outline { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .artifact-outline { order: -1; top: var(--outline-top, 3.5rem); z-index: 15; margin: 0 -1.5rem; padding: .5rem 1.5rem; background: var(--app-surface); }
  .artifact-outline-toggle {
    display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 2.75rem; padding: .5rem .75rem;
    background: #fff; border: 1px solid var(--app-border); border-radius: var(--bulma-radius-large);
    font: inherit; font-size: .9rem; color: #16132b; text-align: left; cursor: pointer;
  }
  .artifact-outline-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .artifact-outline-chevron { color: var(--app-muted); transition: transform .15s ease; }
  .artifact-outline.is-open .artifact-outline-chevron { transform: rotate(180deg); }
  .artifact-outline-list {
    display: none; position: absolute; left: 1.5rem; right: 1.5rem; top: calc(100% - .25rem);
    max-height: min(60vh, 28rem); padding: .75rem .5rem; background: #fff;
    border: 1px solid var(--app-border); border-radius: var(--bulma-radius-large); box-shadow: 0 12px 32px -12px rgba(22, 19, 43, .3);
  }
  .artifact-outline.is-open .artifact-outline-list { display: block; }
  /* Room for a finger: each entry is a full-width target at least 2.5rem tall. */
  .artifact-outline a { display: flex; align-items: center; min-height: 2.5rem; padding-top: .4rem; padding-bottom: .4rem; font-size: .9rem; }
  .artifact-outline a.is-level-3 { font-size: .85rem; }
  .artifact-body :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: calc(var(--outline-top, 3.5rem) + 4.25rem); }
}
@media (max-width: 768px) {
  .artifact-outline { margin: 0 -1rem; padding: .5rem 1rem; }
  .artifact-outline-list { left: 1rem; right: 1rem; }
}

/* Eval decisions: each one says what it's about, what was found, and what each choice does. */
.decision { padding: 1.1rem 1.25rem; margin-bottom: .85rem; }
.decision.is-resolved { padding: .6rem 1rem; }
.decision-head { display: flex; gap: .85rem; align-items: flex-start; }
.decision-icon { flex-shrink: 0; width: 2.1rem; height: 2.1rem; border-radius: .6rem; display: inline-flex; align-items: center; justify-content: center; background: #f1f1f4; color: var(--app-muted); }
.decision-icon.is-danger { background: #fdecec; color: var(--app-failed); }
.decision-icon.is-warning { background: #fff5d6; color: #a06f00; }
.decision-icon.is-info { background: #f1edff; color: hsl(var(--bulma-primary-h), 60%, 50%); }
.decision-kicker { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--app-muted); margin-bottom: .15rem; }
.decision-title { font-size: 1rem; font-weight: 600; line-height: 1.35; margin-bottom: .2rem; }
.decision-subject { font-size: .85rem; margin-bottom: .3rem; }
.decision-explain { font-size: .8rem; color: var(--app-muted); max-width: 52rem; }
.decision-body { margin: .85rem 0 0 2.95rem; }
.decision-body:empty { display: none; }
.decision-label { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--app-muted); margin-bottom: .35rem; display: flex; align-items: center; gap: .3rem; }
.decision-reasons { list-style: disc; margin-left: 1.1rem; font-size: .8rem; }
.decision-reasons li + li { margin-top: .15rem; }
.decision-verdict { font-size: .8rem; margin-top: .6rem; display: flex; align-items: center; gap: .35rem; color: var(--app-muted); }
.decision-verdict.is-good { color: var(--app-succeeded); }
.decision-verdict.is-warn { color: #a06f00; }
.decision-verdict.is-bad { color: var(--app-failed); }
.decision-verdict.is-busy { color: hsl(var(--bulma-primary-h), 60%, 50%); }
.decision-failure + .decision-failure { margin-top: .6rem; }
.decision-assistant { margin-top: .75rem; padding: .7rem .85rem; border-radius: .5rem; background: #f7f5ff; border: 1px solid #e6e0ff; }
.decision-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .75rem 1rem; margin: 1rem 0 0 2.95rem; padding-top: .85rem; border-top: 1px solid #efeff3; }
.decision-choice { min-width: 0; }
.decision-choice .button, .decision-choice form { margin-bottom: .3rem; }
.decision-choice .help { margin-top: 0; color: var(--app-muted); }
.decision-choice.is-recommended .help::before { content: "Recommended · "; font-weight: 600; color: hsl(var(--bulma-primary-h), 60%, 50%); }
.decision-section { font-size: .85rem; font-weight: 600; margin: 1.25rem 0 .6rem; }
.card-content > .decision-section:first-child { margin-top: 0; }

.eval-story { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.5rem; }
.eval-example, .eval-checklist { font-size: .8rem; }
.eval-example li { padding: .2rem 0; border-bottom: 1px dashed #ececf1; overflow-wrap: anywhere; }
.eval-example li > span:first-child { color: var(--app-muted); margin-right: .25rem; }
.eval-checklist li { display: flex; gap: .4rem; align-items: flex-start; padding: .15rem 0; overflow-wrap: anywhere; }
.eval-checklist li > .icon { color: var(--app-succeeded); flex-shrink: 0; width: 1rem; height: 1.2rem; }
.eval-value { font-family: var(--bulma-code-family, ui-monospace, monospace); font-size: .75rem; background: #f6f6f9; border-radius: .25rem; padding: 0 .25rem; }
.eval-health { font-size: .8rem; padding: .65rem 1rem; border-bottom: 1px solid #efeff3; display: flex; flex-wrap: wrap; gap: .25rem .4rem; align-items: center; }

.eval-explainer > summary { cursor: pointer; list-style: none; box-shadow: none; }
.eval-explainer > summary::-webkit-details-marker { display: none; }
.eval-explainer:not([open]) > summary { border-bottom: 0; }
.eval-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; font-size: .8rem; }
.eval-steps li { position: relative; padding: .85rem .9rem .85rem 2.9rem; border-radius: .6rem; background: #f8f7fc; }
.eval-steps li p + p { color: var(--app-muted); margin-top: .2rem; }
.eval-step-number { position: absolute; left: .85rem; top: .8rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: hsl(var(--bulma-primary-h), 72%, 58%); color: #fff; font-weight: 600; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 768px) {
  .decision-body, .decision-choices { margin-left: 0; }
}

/* What an eval starts from, shaped like the data rather than printed as JSON. */
.eval-example li { padding: .45rem 0; }
.eval-example-label { color: var(--app-muted); margin-bottom: .2rem; }
.eval-records { font-size: .75rem; width: auto; border-collapse: collapse; }
.eval-records th { font-weight: 600; color: var(--app-muted); text-align: left; padding: .15rem .6rem .15rem 0; border-bottom: 1px solid #e6e6ee; white-space: nowrap; }
.eval-records td { padding: .15rem .6rem .15rem 0; border-bottom: 1px solid #f1f1f5; vertical-align: top; }
.eval-records tr:last-child td { border-bottom: 0; }
.eval-fields > div { display: flex; gap: .5rem; padding: .1rem 0; }
.eval-fields dt { color: var(--app-muted); min-width: 5rem; flex-shrink: 0; }
.eval-fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.eval-example-items { margin-left: 1.1rem; }
.eval-example-items li { border-bottom: 0; padding: .1rem 0; }
.eval-example-all { margin-top: .25rem; font-size: .75rem; }
.eval-example-all > summary { cursor: pointer; color: hsl(var(--bulma-primary-h), 60%, 50%); }
.eval-example-all pre { max-height: 18rem; overflow: auto; margin-top: .3rem; }
.eval-check-fields { list-style: disc; margin: .15rem 0 0 1.1rem; }
.eval-checklist .eval-check-fields li { display: list-item; padding: 0; }
