@font-face {
  font-family: "Inter";
  src: url("/generated/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Serif";
  src: url("/generated/geist-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Map the static shell onto the same surfaces as the Fluid controls. */
:root {
  color-scheme: light;
  --bg: var(--surface-1);
  --sidebar-bg: light-dark(#fff, #0a0a0a);
  --paper: var(--surface-1, var(--bg));
  --rail: var(--surface-2);
  --surface: light-dark(#f5f5f5, #262626);
  --ink: light-dark(#0a0a0a, #fafafa);
  --mute: light-dark(#737373, #a3a3a3);
  --line: light-dark(#e5e5e5, #303030);
  --primary: light-dark(#171717, #fafafa);
  --on-primary: light-dark(#fafafa, #171717);
  --amber: var(--primary);
  --ok: light-dark(#237744, #78bd92);
  --bad: light-dark(#b91c1c, #ffa6a6);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-geist-serif-regular: "Geist Serif";
  --serif: var(--font-geist-serif-regular), "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --radius: 1rem;
  --panel-duration: 200ms;
  --panel-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[hidden] { display: none !important; }
:focus-visible:not([data-slot]):not([data-slot="trace"] *) { outline: 2px solid var(--fluid-accent); outline-offset: 2px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

:where(button, input, select, textarea) { font-family: inherit; }
/* Geist Serif is reserved for display headings. */
#gate h1, #empty-thread h1, .workspace-content > h1,
.settings-panel > h2, .settings-form h3, .msg.assistant .reply h1,
.sidebar-takeover-title, .sidebar-section-label {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
}
:where(pre, code, kbd, samp) { font-family: var(--mono); }

#gate {
  min-height: 100%;
}

.app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

#workspace-shell, #preview-shell { min-height: 0; min-width: 0; }

.aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 4px;
}
.brand { display: flex; gap: 8px; align-items: center; }
.mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--amber);
  border-radius: 3px;
}
#roster, #chats { display: flex; flex-direction: column; gap: 2px; }
.aside-actions { display: flex; gap: 4px; }
.bot-mark {
  width: 10px;
  height: 10px;
  flex: none;
  display: inline-block;
}
.box-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 10px 8px;
  cursor: pointer;
  font: inherit;
}
.box-row .bot-copy { min-width: 0; }
.chip.user { border-color: var(--amber); }
.box-row:hover, .box-row.active { background: var(--surface); }
.box-row .name { display: block; }
.box-row .caps {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  margin-top: 2px;
}
.skill-list {
  margin-top: auto;
  padding: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}
.chip {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 2px 6px;
  border: 1px solid var(--line);
}
.chip.off { opacity: 0.4; text-decoration: line-through; }

#machines { padding: 0 8px 8px; }
.machine-row {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px;
  font-size: 13px;
}
.machine-row .dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 1px;
  background: var(--mute);
}
.machine-row.online .dot { background: var(--ok); }
.machine-row.drain .dot { background: var(--amber); }
.machine-row .name { display: block; }
.machine-row .caps {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  margin-top: 2px;
}
.machine-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.ghost.tiny {
  font-size: 11px;
  padding: 2px 6px;
}
.machine-hint {
  margin: 0 12px 10px;
  font-size: 11px;
  color: var(--mute);
}

.thread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  background: var(--paper);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px 18px;
}
.sub { display: block; color: var(--mute); font-size: 12px; font-family: var(--mono); }
.status {
  font-size: 12px;
  font-weight: 500;
  color: var(--mute);
}
.status.live { color: var(--amber); }
.status.err { color: var(--bad); }

#log {
  overflow-y: auto;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg { max-width: 640px; }
.msg.user { align-self: flex-end; }
.msg.assistant .reply p { margin: 0 0 8px; }
.msg.assistant .reply p:last-child { margin-bottom: 0; }
.msg.assistant .reply h1,
.msg.assistant .reply h2,
.msg.assistant .reply h3 { margin: 0 0 8px; }
.msg.assistant .reply h1 { font-size: 28px; }
.msg.assistant .reply h2 { font-size: 23px; }
.msg.assistant .reply h3 { font-size: 20px; }
.msg.assistant .reply pre {
  overflow: auto;
  background: var(--surface);
  padding: 10px;
  border: 1px solid var(--line);
}
.msg.assistant .reply code { font-family: var(--mono); font-size: 13px; }
.msg.assistant .reply table { border-collapse: collapse; width: 100%; margin: 0 0 8px; }
.msg.assistant .reply th,
.msg.assistant .reply td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.msg.assistant .reply a { color: var(--amber); }
.hl-kw { color: var(--amber); }
.hl-str { color: var(--ok); }
.hl-num { color: #d6c08a; }
.hl-com { color: #6e685c; }
.math { font-family: var(--mono); }
#composer.drag [data-slot="input-group"] {
  outline: 1px dashed var(--mute);
  outline-offset: 2px;
}
.tool-trace summary::-webkit-details-marker { display: none; }
.tool-trace .trace-chevron { transition: transform 150ms ease; }
.tool-trace[open] .trace-chevron { transform: rotate(90deg); }

.file-chip {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line);
  padding: 2px 6px;
  color: var(--mute);
}
.artifact img { max-width: 100%; height: auto; display: block; margin: 0 0 8px; }
.user-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.user-files img { max-width: 160px; max-height: 120px; display: block; }
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px;
  max-width: 640px;
}
.card-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
.card-summary, .card-line, .card-subject, .card-result {
  margin: 0 0 8px;
}
.card-subject { font-weight: 600; }
.card-body {
  margin: 0 0 10px;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions button.on { outline: 1px solid var(--amber); }
.card input[type="text"] {
  width: 100%;
  margin: 8px 0;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font: inherit;
}
.card-actions button { min-height: 36px; }
textarea:not([data-slot]) {
  resize: none;
  min-height: 44px;
  max-height: 160px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  outline: none;
}
textarea:not([data-slot]):focus { border-color: var(--amber); }
button.ghost {
  background: transparent;
  color: var(--mute);
  padding: 0 8px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
}

.lede { color: var(--mute); font-size: 13px; margin: 0; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; min-height: 28px; padding: 0; border: 2px solid transparent; }
.swatch.on { border-color: var(--ink); }
.memory-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
}
.memory-row p { margin: 0; }
.memory-kind { font-family: var(--mono); font-size: 11px; color: var(--mute); }
#show-bots { flex-shrink: 0; }
#workspace-shell { min-width: 0; height: 100%; }
#workspace-content {
  transition-property: margin, border-radius, box-shadow;
  transition-duration: var(--panel-duration);
  transition-timing-function: var(--panel-ease);
}
/* The inbox is inert whenever its desktop rail or mobile drawer is closed.
   Settings hides Preview while retaining its open state for the return to chat. */
.app:is(:not(.with-preview), .show-settings) #inbox[inert] ~ #workspace-content {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
#workspace-content > section { flex: 1; background: transparent; }
#workspace-content > section > header { min-height: 48px; padding: 6px 8px; }
#preview-shell { grid-column: 2; grid-row: 1; }
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  #inbox {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 15;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform var(--panel-duration) var(--panel-ease), visibility var(--panel-duration);
    background: var(--surface-1);
  }
  #dismiss-inbox { position: fixed; inset: 0; z-index: 14; background: rgb(0 0 0 / 0.15); border: 0; }
  #inbox.open { visibility: visible; transform: translateX(0); box-shadow: var(--shadow-4); }
}
#computer-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
#inbox .aside-head { padding-inline: 4px; }
#newchat { width: 100%; justify-content: flex-start; }
#chats { min-width: 0; }
.inbox-group { font-size: 12px; color: var(--mute); padding: 8px 10px 4px; }
#inbox .box-row {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--ink);
  background: transparent;
}
#inbox .box-row:hover, #inbox .box-row.active { background: var(--surface); }
#inbox .box-row.active { font-weight: 600; }
.box-row .name, .box-row .caps { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-tools { padding: 12px; }
.workspace-tools section + section { margin-top: 12px; }
.workspace-tools h2 { margin: 0 8px 4px; font-size: 12px; font-weight: 600; }
.workspace-tools #machines, .workspace-tools .skill-list { padding: 4px 8px; }
.workspace-tools .skill-list { border: 0; font: 12px var(--sans); }
.workspace-tools .chip { border-radius: var(--radius); }
.workspace-tools .box-row:hover, .workspace-tools .box-row.active { background: var(--surface); }
.thread-heading, .thread-title, .thread-actions { display: flex; align-items: center; gap: 8px; }
.thread-heading, .thread-title { min-width: 0; }
.thread-title .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--sans); }
.thread-title .sub:empty { display: none; }
.thread-actions { flex-shrink: 0; }
.thread-actions .status:empty { position: absolute; padding: 0; }
#box-name {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.thread-body {
  display: grid;
  grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
  min-height: 0;
}
#log, #empty-thread { grid-area: 1 / 1; }
#log { min-height: 0; gap: 20px; --radius: 0.5rem; }
#composer { grid-area: 2 / 1; margin: 0 auto 16px; width: min(calc(100% - 32px), 700px); }
#empty-thread { place-self: center; text-align: center; margin: 16px; }
#empty-thread h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.02em; }

#toggle-preview[aria-expanded="true"], .ghost:hover { background: var(--surface); color: var(--ink); }
#log > .msg { width: min(100%, 668px); margin-inline: auto; }
.card { border-radius: var(--radius); }
@media (max-width: 720px) {
  .app.with-preview { grid-template-columns: minmax(0, 1fr); }
  #preview-shell {
    position: fixed;
    z-index: 14;
    inset: 0 0 0 auto;
    background: var(--surface-1);
  }
  .thread-actions { gap: 0; }
  .thread-actions .status { display: none; }
  .thread-title .sub { display: none; }
  .thread > header { padding-inline: 8px; gap: 4px; }
}

.workspace-page { padding: clamp(24px, 5vw, 56px) 16px; }
.workspace-content { max-width: 920px; margin-inline: auto; }
.workspace-content h1 { margin: 16px 0 24px; font-size: 40px; }
.workspace-content .lede { max-width: 60ch; font-size: 14px; line-height: 1.5; }
.settings-back { color: var(--mute); font-size: 13px; text-decoration: none; }
.settings-back:hover { color: var(--ink); }
.settings-layout { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: clamp(16px, 4vw, 48px); }
.settings-layout nav { width: 100%; }
.settings-panel { min-width: 0; padding-bottom: 32px; }
.settings-panel > h2 { margin: 0 0 10px; font-size: var(--fs-display); line-height: var(--lh-display); }
.settings-form { display: grid; gap: 14px; max-width: 560px; }
.settings-form h3 { margin: 12px 0 0; font-size: 24px; }
.settings-form .lede { margin: 0; }
.settings-form [role="status"]:empty, #bot-save-status:empty { display: none; }
.workspace-vault .lede { margin: 0 0 16px; }
.workspace-vault form { max-width: 440px; }
@media (max-width: 600px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-layout nav ul { flex-direction: row; flex-wrap: wrap; }
  .settings-layout nav li { width: auto; }
}

.app.show-settings { grid-template-columns: minmax(0, 1fr); }
.app.show-settings #preview-shell { display: none; }
#settings-view {
  grid-area: 1 / 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  --settings-gutter: clamp(12px, 3vw, 32px);
  padding: 12px var(--settings-gutter) 16px;
}
.settings-view-heading {
  display: flex;
  flex: none;
  margin: -12px calc(-1 * var(--settings-gutter)) 0;
}
.app.inbox-collapsed .settings-view-heading { display: flex; }
.settings-outlet { flex: 1; min-height: 0; overflow-y: auto; }

.settings-embedded { padding: 0; background: transparent; }
.settings-embedded .settings-panel {
  padding-block: clamp(20px, 5vw, 40px) clamp(32px, 6vw, 56px);
  padding-inline: 2px 12px;
}

@media (max-width: 720px) {
  .app.show-settings { grid-template-columns: minmax(0, 1fr); }
  #settings-view { grid-column: 1; }
  .settings-view-heading { display: flex; padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --panel-duration: 0ms; }
}

.chat-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  padding-right: 4px;
  border-radius: var(--radius);
}
#inbox .chat-entry:hover, #inbox .chat-entry:has(.box-row.active) { background: var(--surface); }
#inbox .chat-entry .box-row {
  min-width: 0;
  padding-right: 6px;
  background: transparent;
}
.chat-entry .bot-copy { width: 100%; }
.chat-entry-actions { display: flex; gap: 2px; }
@media (hover: hover) {
  .chat-entry-actions { opacity: 0; pointer-events: none; }
  .chat-entry:hover .chat-entry-actions,
  .chat-entry:has(:focus-visible) .chat-entry-actions { opacity: 1; pointer-events: auto; }
}
.chat-entry-actions button { color: var(--mute); }
.chat-entry-actions button:hover, .chat-entry-actions button:focus-visible { color: var(--ink); }
.connections-intro { margin-bottom: 16px; }
#connections-status:empty, .connection-error:empty { display: none; }
.expandable-list {
  max-width: 680px;
  margin: 0;
  padding: 4px 16px;
  list-style: none;
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: calc(var(--radius) + 4px);
}
.expandable-list-item + .expandable-list-item {
  border-top: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}
.expandable-list-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}
.expandable-list-row[data-expandable] {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.expandable-list-row[data-expandable]:has(.expandable-list-disclosure[aria-expanded="false"]) .expandable-list-description:not([hidden]) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.expandable-list-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--mute);
}
.expandable-list-icon svg { width: 16px; height: 16px; }
.expandable-list-title { margin: 0 0 2px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.expandable-list-description, .expandable-list-content p {
  margin: 0;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.expandable-list-actions { display: flex; gap: 6px; align-items: center; }
.expandable-list-actions:empty, .expandable-list-cta:empty { display: none; }
.expandable-list-disclosure { color: var(--mute); }
.expandable-list-disclosure svg { transition: transform var(--panel-duration) var(--panel-ease); }
.expandable-list-disclosure[aria-expanded="true"] svg { transform: rotate(180deg); }
.expandable-list-content {
  margin: 0 0 14px 44px;
  padding: 10px 12px;
  background: var(--rail);
  border-radius: var(--radius);
}
.connection-connected { color: var(--ok); font-size: 12px; }
.connection-error { margin: 0 0 12px; color: var(--bad); }

@media (max-width: 420px) {
  .expandable-list { padding-inline: 10px; }
  .expandable-list-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; }
  .machine-settings-actions { flex-direction: column; align-items: stretch; }
  .expandable-list-icon { width: 28px; height: 28px; }
  .expandable-list-content { margin-left: 36px; }
}

#schedule { font-family: var(--mono); }

#box-name { font-weight: 400; }
.conversation-tools { display: flex; align-items: center; gap: 2px; }
.conversation-card {
  position: fixed;
  inset: 52px 16px auto auto;
  margin: 0;
  width: min(352px, calc(100vw - 32px));
  max-height: min(70dvh, 560px);
  overflow: auto;
  padding: 16px;
  color: var(--ink);
  background: var(--surface-3);
  border: 0;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-5);
}
.conversation-card h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.conversation-card p { margin: 0 0 12px; color: var(--mute); font-size: 13px; }
.conversation-card p:empty { display: none; }
.conversation-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.conversation-rename { display: grid; gap: 8px; }
.conversation-rename label { font-size: 13px; font-weight: 500; }
.conversation-card .conversation-card-status:not(:empty) { margin: 8px 0 0; }
#conversation-summary { padding: 8px; }
[data-summary-sections] section { padding: 4px 0 6px; }
[data-summary-sections] h3 {
  margin: 0;
  padding: 6px 10px 3px;
  color: var(--mute);
  font-size: 13px;
  font-weight: 500;
}
[data-summary-sections] ul, [data-summary-sections] dl {
  margin: 0;
  padding: 0;
  list-style: none;
}
.summary-row, [data-summary-sections] dl > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 14px;
}
#conversation-summary .summary-row {
  width: 100%;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
}
#conversation-summary .summary-row:hover { background: var(--surface); }
.summary-row:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.summary-row svg { width: 16px; height: 16px; flex: none; color: var(--mute); }
.summary-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-detail, [data-summary-sections] dt { color: var(--mute); }
.summary-detail { white-space: nowrap; }
[data-summary-sections] dd { margin: 0 0 0 auto; text-align: right; overflow-wrap: anywhere; }
[data-summary-sections] dt { flex: none; }
@media (pointer: coarse) {
  .summary-row { min-height: 44px; }
}
.machine-settings-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#settings-status:empty { display: none; }

.projects-nav { position: relative; margin-bottom: 12px; }
.projects-nav > details > summary { margin-right: 32px; }

.sidebar-takeover-title { font-size: 22px; }
.sidebar-section-label { font-size: 18px; }
.sidebar-disclosure {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px;
  color: var(--mute);
  border-radius: var(--radius);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.sidebar-disclosure::-webkit-details-marker { display: none; }
summary.sidebar-disclosure:hover { color: var(--ink); }
#empty-projects-label { cursor: default; }
.sidebar-disclosure:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.sidebar-disclosure svg { flex: none; width: 15px; height: 15px; }
.sidebar-disclosure svg:last-child { margin-inline-start: -4px; }
details[open] > .sidebar-disclosure svg:last-child { transform: rotate(90deg); }
.sidebar-disclosure span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project > [data-project-chats], .project > [data-project-new-chat] { margin-inline-start: 20px; }
.project > [data-project-new-chat] { color: var(--mute); }
#project-dialog {
  margin: auto;
  width: min(360px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--rail);
  color: var(--ink);
}
#project-dialog::backdrop { background: rgb(0 0 0 / 0.5); }
#project-dialog form { display: grid; gap: 10px; }
#project-dialog h2, #project-dialog p { margin: 0; }
#project-dialog p:empty { display: none; }

:root.dark { color-scheme: dark; }
h1, h2, h3 {
  font-family: var(--serif);
  font-variation-settings: normal !important;
  font-weight: 400 !important;
  font-synthesis-weight: none;
}
/* Both sidebars sit directly on the workspace surface. Only the page being
   previewed gets its own canvas. */
#preview-sidebar [data-sidebar="sidebar"] { padding: 8px; }
.browser-tabs, .browser-tools { display: flex; align-items: center; gap: 2px; min-width: 0; }
.browser-tabs { min-height: 36px; padding-inline: 2px; }
.browser-tabs [role="tablist"] { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.browser-tab { position: relative; flex: none; }
.browser-tab-close { position: absolute; z-index: 11; inset-inline-end: 3px; inset-block: 0; display: flex; align-items: center; }
.browser-tab-close button { width: 22px; height: 22px; }
.browser-tabs [role="tab"] { white-space: nowrap; }
.browser-tabs [role="tab"] span span { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; }
.browser-close { display: inline-flex; margin-inline-start: auto; }
.browser-page, #computer-pane { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.browser-tools { padding-block: 6px 10px; }
.browser-tools input { flex: 1; }
.browser-frame { flex: 1; min-height: 0; width: 100%; border: 0; border-radius: 12px; background: white; }
.browser-frame.phone { max-width: 375px; align-self: center; }
.browser-start { overflow: auto; margin: auto; min-width: 0; max-width: 100%; padding: 16px; text-align: center; color: var(--mute); }
.browser-start > svg { margin: 0 auto 8px; width: 22px; height: 22px; }
.browser-start h2 { margin: 0; font-size: 24px; color: var(--ink); }
.browser-links, .browser-files { display: grid; gap: 4px; margin-top: 16px; overflow: auto; }
.browser-links > span { font-size: 12px; }
.browser-links button, .browser-files button { min-width: 0; max-width: 100%; justify-content: flex-start; overflow: hidden; }
.browser-links button span, .browser-files button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-error { font-size: 12px; margin: 0 8px 8px; color: var(--bad); }
#computer-pane.pi-computer { background: transparent; }
#computer-pane .pi-computer-bar { border: 0; }
#computer-pane .pi-computer-frame { min-height: 0; }

/* The native window controls sit over this draggable strip. */
html[data-desktop] body { padding-top: 34px; }
.desktop-titlebar {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  height: 34px;
  background: var(--bg);
  -webkit-app-region: drag;
}
html[data-desktop] :is(#workspace-shell, #preview-shell) [data-slot="sidebar-wrapper"] { min-height: 0; height: 100%; }
html[data-desktop] [data-slot="sidebar"] { height: calc(100dvh - 34px); }
@media (max-width: 720px) {
  html[data-desktop] :is(#inbox, #preview-shell, #dismiss-inbox) { top: 34px; }
}

.runtime-fields { display: flex; flex: 1; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.runtime-picker { max-width: min(100%, 215px); min-width: 0; }
.runtime-picker > span { min-width: 0; }
.runtime-picker > span > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.runtime-picker svg { flex-shrink: 0; }
.runtime-options { max-width: min(320px, calc(100vw - 24px)); }
.runtime-notice { margin: -2px -2px 0; padding: 7px 10px; font-size: 12px; border-radius: 12px; background: var(--surface); }
.runtime-notice[data-state="error"] { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }

.workspace-routines .lede { margin: 0 0 22px; }
.routine { padding: 14px 0; }
.routine h3 { margin: 0; font-size: 16px; }
.routine-meta { margin: 4px 0 8px; color: var(--mute); font-family: var(--mono); font-size: 12px; }
.routine-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.routine-state { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.routine-state:is(.succeeded, .running) { color: var(--ok); }
.routine-state.failed { color: var(--bad); }
.routine-state:is(.waiting, .paused) { color: var(--amber); }
.routine-history { margin-top: 10px; }
.routine-history pre { margin: 6px 0 0; white-space: pre-wrap; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.routine-secret { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--amber); font-family: var(--mono); font-size: 12px; word-break: break-all; }
.routine-error { color: var(--bad); min-height: 1.2em; }

.pi-computer { display: flex; flex-direction: column; min-height: 240px; color: var(--ink); font-family: var(--sans), sans-serif; }
.pi-computer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: 12px; color: var(--mute); }
.pi-computer-bar a { color: var(--ink); text-decoration: none; }
.pi-computer-frame { flex: 1; width: 100%; border: 0; background: var(--bg); min-height: 0; }
.pi-computer-banner { background: var(--surface); color: var(--ink); padding: 6px 10px; font-size: 12px; }

.connection-accounts { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.connection-accounts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; font-size: 14px; }
.connection-default { color: var(--mute); }
