/* Folkways console: the simple view (simple.js), in the Alpha chat's shape.
 *
 * The tokens are the Alpha design system's dark theme, by the same names and values
 * (aipotluck.org web/src/lib/alpha-ds/tokens/generated/tokens.css, theme "alpha"). Rules from its
 * spec (web/src/lib/chat/design-system.md): three background tones by elevation, white borders at
 * 10/30/50 %, one accent for the primary action and one for destructive ones, never an accent fill
 * at surface scale, DM Mono for labels and Plus Jakarta Sans for reading, left-aligned text. */

:root {
  --ds-font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --ds-font-mono: "DM Mono", ui-monospace, "SFMono-Regular", monospace;
  --ds-bg-1: oklch(0.209 0 0);
  --ds-bg-2: oklch(0.182 0 0);
  --ds-bg-3: oklch(0.305 0 0);
  --ds-fg-1: oklch(1 0 0);
  --ds-fg-2: oklch(0.802 0 0);
  --ds-fg-3: oklch(0.62 0 0);
  --ds-line-1: oklch(1 0 0 / 0.1);
  --ds-line-2: oklch(1 0 0 / 0.3);
  --ds-line-3: oklch(1 0 0 / 0.5);
  --ds-accent-1: oklch(0.738 0.145 27.7);
  --ds-accent-2: oklch(0.614 0.217 29.4);
  --ds-accent-2-text: oklch(0.694 0.196 29.4);
  --ds-positive: oklch(0.637 0.094 176.9);
  --ds-positive-text: oklch(0.66 0.094 176.9);
  --ds-caution: oklch(0.744 0.112 76.4);
  --ds-tint-subtle: oklch(1 0 0 / 0.06);
  --ds-tint-hover: oklch(1 0 0 / 0.15);
  --ds-tint-active: oklch(1 0 0 / 0.3);
  --ds-focus: oklch(0.738 0.145 27.7);
  --ds-overlay: oklch(0 0 0 / 0.651);
  --ds-radius-sharp: 4px;
  --ds-radius-card: 8px;
  --ds-sidebar-width: 16.5rem;
  --ds-header-height: 2.75rem;
  --ds-page-width: 48rem;
  --ds-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ---------------------------------------------------------------- frame */
.s-app {
  position: fixed; inset: 0; display: flex; overflow: hidden;
  background: var(--ds-bg-1); color: var(--ds-fg-1);
  font-family: var(--ds-font-sans); font-size: 14px; line-height: 22px;
}
.s-app *:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.s-app h1:focus, .s-app h1:focus-visible { outline: none; }
.s-app ::selection { background: oklch(0.738 0.145 27.7 / 0.35); }
.s-icon { width: 16px; height: 16px; flex: none; }
.s-spacer { flex: 1 1 auto; }
.s-app .mono { font-family: var(--ds-font-mono); font-size: 12px; overflow-wrap: anywhere; }
.s-dim { color: var(--ds-fg-3); }

/* Labels: DM Mono, uppercase, tracked (the spec's type-label). */
.s-label, .s-nav-label, .s-eyebrow {
  margin: 0; font-family: var(--ds-font-mono); font-size: 10px; line-height: 14px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3);
}

/* ---------------------------------------------------------------- sidebar */
.s-side {
  width: var(--ds-sidebar-width); flex: none; display: flex; flex-direction: column; min-height: 0;
  background: var(--ds-bg-1); border-right: 1px solid var(--ds-line-1);
}
.s-side-head { display: flex; align-items: center; gap: 10px; height: var(--ds-header-height); padding: 0 8px 0 16px; flex: none; }
.s-mark { width: 16px; height: 16px; flex: none; color: var(--ds-accent-1); }
.s-brand {
  font-family: var(--ds-font-mono); font-size: 14px; line-height: 30px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-1);
}
.s-brand-sub { font-family: var(--ds-font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); flex: 1; }

.s-ctx { padding: 4px 8px 8px; flex: none; display: flex; flex-direction: column; gap: 2px; }
.s-ctx .s-nav-label { padding: 7px 8px; }

.s-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 12px; }
.s-nav-group { display: flex; flex-direction: column; }
.s-nav-group .s-nav-label { height: 28px; display: flex; align-items: center; padding: 0 8px; }
.s-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }

.s-item {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: 28px; padding: 0 8px;
  border: 0; border-radius: var(--ds-radius-sharp); background: transparent; color: var(--ds-fg-2);
  font: 400 14px/22px var(--ds-font-sans); text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color 90ms var(--ds-ease), color 90ms var(--ds-ease);
}
.s-item:hover { background: var(--ds-tint-subtle); color: var(--ds-fg-1); }
.s-item.is-current, .s-item.is-current:hover { background: var(--ds-tint-hover); color: var(--ds-fg-1); }
.s-item-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-marker {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-sharp); background: var(--ds-bg-2);
  font: 500 10px/1 var(--ds-font-mono); color: var(--ds-fg-1);
}
.s-marker.is-err { color: var(--ds-accent-2-text); }
.s-marker.is-warn { color: var(--ds-caution); }

.s-side-foot { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-top: 1px solid var(--ds-line-1); }
.s-account { height: auto; min-height: 40px; padding: 6px 8px; }
.s-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none;
  border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-sharp); background: var(--ds-bg-2);
  font: 500 10px/1 var(--ds-font-mono); text-transform: uppercase; color: var(--ds-fg-1);
}
.s-account-text { display: flex; flex-direction: column; min-width: 0; }
.s-account-name { color: var(--ds-fg-1); font-size: 14px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-account-role {
  font-family: var(--ds-font-mono); font-size: 10px; line-height: 14px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ds-fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------------------------------------------------------- controls */
.s-select { position: relative; display: flex; align-items: center; min-width: 0; }
.s-select select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 32px; min-height: 32px; max-width: none;
  padding: 0 30px 0 10px; border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-sharp);
  background: var(--ds-bg-2); color: var(--ds-fg-1); font: 400 12px/1 var(--ds-font-mono); letter-spacing: 0; cursor: pointer;
  text-overflow: ellipsis;
}
.s-select select:hover { border-color: var(--ds-line-3); }
.s-select select:disabled { opacity: 0.4; cursor: default; }
.s-select .s-icon { position: absolute; right: 8px; color: var(--ds-fg-3); pointer-events: none; }
.s-select.is-inline { width: auto; min-width: 160px; max-width: 280px; }

.s-btn {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; height: 32px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--ds-radius-sharp);
  font: 500 12px/18px var(--ds-font-mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  white-space: nowrap; cursor: pointer; transition: background-color 90ms var(--ds-ease), color 90ms var(--ds-ease), opacity 90ms var(--ds-ease);
}
.s-btn:disabled { opacity: 0.4; cursor: default; }
.s-btn.is-primary { background: var(--ds-fg-1); color: var(--ds-bg-1); }
.s-btn.is-primary:hover:not(:disabled) { opacity: 0.85; }
.s-btn.is-primary:active:not(:disabled) { opacity: 0.75; }
.s-btn.is-secondary { border-color: var(--ds-line-2); background-color: var(--ds-bg-2); color: var(--ds-fg-2); }
.s-btn.is-secondary:hover:not(:disabled) { color: var(--ds-fg-1); background-image: linear-gradient(var(--ds-tint-hover), var(--ds-tint-hover)); }
.s-btn.is-ghost { background: transparent; color: var(--ds-fg-2); }
.s-btn.is-ghost:hover:not(:disabled) { background: var(--ds-tint-hover); color: var(--ds-fg-1); }

.s-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; padding: 0;
  border: 0; border-radius: var(--ds-radius-sharp); background: transparent; color: var(--ds-fg-1); cursor: pointer;
}
.s-icon-btn:hover { background: var(--ds-tint-hover); }
.s-icon-btn:active { background: var(--ds-tint-active); }

.s-link {
  display: inline-flex; align-items: center; gap: 2px; color: var(--ds-fg-2); text-decoration: underline;
  text-decoration-color: var(--ds-line-3); text-underline-offset: 4px;
}
.s-link:hover { color: var(--ds-fg-1); text-decoration-color: var(--ds-fg-1); }
.s-link.small { font-size: 12px; }

.s-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 7px; flex: none; max-width: 100%;
  border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-sharp); background: var(--ds-bg-3);
  font: 500 10px/1 var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-1); white-space: nowrap;
}
.s-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--ds-fg-3); }
.s-pill.is-ok .s-dot { background: var(--ds-positive); }
.s-pill.is-warn .s-dot { background: var(--ds-caution); }
.s-pill.is-err .s-dot { background: var(--ds-accent-2); }
.s-pill.is-info .s-dot { background: var(--ds-accent-1); }
.s-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- main column */
.s-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.s-top { display: flex; align-items: center; gap: 8px; height: var(--ds-header-height); flex: none; padding: 0 12px 0 24px; }
.s-top-ctx { display: flex; align-items: center; gap: 6px; min-width: 0; font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; overflow: hidden; white-space: nowrap; }
.s-top-dim { color: var(--ds-fg-3); }
.s-top-sep { color: var(--ds-line-3); }
.s-top-env { color: var(--ds-fg-1); }
.s-updated { font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); white-space: nowrap; }

.s-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.s-page { max-width: var(--ds-page-width); margin: 0 auto; padding: 24px 32px 64px; display: flex; flex-direction: column; gap: 24px; }
.s-only-narrow { display: none; }

/* The shared banner (console.js) while it sits in this view. */
.s-banner-slot { max-width: var(--ds-page-width); margin: 0 auto; padding: 0 32px; }
.s-banner-slot .banner {
  margin: 16px 0 0; padding: 10px 12px; border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-card);
  background: var(--ds-bg-2); color: var(--ds-fg-1); font-size: 14px;
}
.s-banner-slot .banner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ds-accent-2); flex: none; }
.s-banner-slot .banner.info::before { background: var(--ds-accent-1); }

/* ---------------------------------------------------------------- page header and sections */
.s-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--ds-line-2); }
.s-head-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 320px; }
.s-title {
  margin: 0; font-family: var(--ds-font-mono); font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -0.03em;
  color: var(--ds-fg-1); overflow-wrap: anywhere;
}
.s-desc { margin: 0; max-width: 65ch; color: var(--ds-fg-2); }
.s-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.s-crumbs { display: flex; align-items: center; gap: 4px; font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); }
.s-crumbs a { color: var(--ds-fg-3); text-decoration: none; border-radius: var(--ds-radius-sharp); }
.s-crumbs a:hover { color: var(--ds-fg-1); }
.s-crumbs .s-icon { width: 14px; height: 14px; }

.s-section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.s-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.s-section-head .s-label { font-size: 10px; }
.s-note { margin: 0; font-size: 12px; line-height: 18px; color: var(--ds-fg-3); }
.s-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.s-error { color: var(--ds-accent-2-text); font-size: 12px; margin: 0; }
.s-code {
  margin: 0; padding: 10px 12px; border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-sharp); background: var(--ds-bg-2);
  font: 400 12px/18px var(--ds-font-mono); color: var(--ds-fg-1); white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- cards and rows */
.s-card { background: var(--ds-bg-2); border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-card); min-width: 0; overflow: hidden; }
.s-card.s-pad { padding: 12px 16px; }
.s-card .section-error { padding: 12px 16px; color: var(--ds-accent-2-text); }

.s-rows { list-style: none; margin: 0; padding: 0; }
.s-rows > li + li { border-top: 1px solid var(--ds-line-1); }
.s-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 16px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none;
}
.s-row.is-link { cursor: pointer; transition: background-color 90ms var(--ds-ease); }
.s-row.is-link:hover { background: var(--ds-tint-subtle); }
.s-row.is-link:focus-visible { outline-offset: -2px; }
.s-row-icon { display: inline-flex; color: var(--ds-fg-2); flex: none; }
.s-row-icon.is-ok { color: var(--ds-positive-text); }
.s-row-icon.is-warn { color: var(--ds-caution); }
.s-row-icon.is-err { color: var(--ds-accent-2-text); }
.s-row-icon.is-info { color: var(--ds-accent-1); }
.s-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.s-row-title { color: var(--ds-fg-1); overflow-wrap: anywhere; }
.s-row-title strong, .s-live-line strong, .s-fact strong { font-weight: 600; }
.s-row-sub { font-size: 12px; line-height: 18px; color: var(--ds-fg-3); overflow-wrap: anywhere; }
.s-row-note { color: var(--ds-fg-2); }
.s-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; font-size: 12px; line-height: 18px; color: var(--ds-fg-3); white-space: nowrap; text-align: right; }
.s-row-go { display: inline-flex; color: var(--ds-fg-3); flex: none; }
.s-row-go .is-turned { transform: rotate(90deg); }
.s-row.is-link:hover .s-row-go { color: var(--ds-fg-1); }

.s-facts { margin: 0; display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr); }
.s-fact { display: contents; }
.s-fact dt, .s-fact dd { padding: 10px 16px; border-top: 1px solid var(--ds-line-1); }
.s-fact:first-child dt, .s-fact:first-child dd { border-top: 0; }
.s-fact dt { font: 500 10px/22px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); }
.s-fact dd { margin: 0; color: var(--ds-fg-1); min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- overview */
.s-live { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.s-live-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.s-live-id { margin: 0; font: 500 16px/24px var(--ds-font-mono); color: var(--ds-fg-1); overflow-wrap: anywhere; }
.s-live-line { margin: 0; color: var(--ds-fg-2); }
.s-quote { margin: 0 0 4px; padding-left: 12px; border-left: 1px solid var(--ds-line-2); color: var(--ds-fg-2); font-size: 12px; line-height: 18px; }
.s-live .s-link { font-size: 12px; }
.s-live .s-btn { margin-top: 6px; }

.s-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.s-stat {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px;
  background: var(--ds-bg-2); border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-card);
  color: inherit; text-decoration: none;
}
.s-stat.is-link { transition: border-color 90ms var(--ds-ease); }
.s-stat.is-link:hover { border-color: var(--ds-line-3); }
.s-stat-value { font: 500 20px/28px var(--ds-font-mono); letter-spacing: -0.03em; color: var(--ds-fg-1); }
.s-stat-value.is-err { color: var(--ds-accent-2-text); }
.s-stat-value.is-warn { color: var(--ds-caution); }
.s-stat-sub { font-size: 12px; line-height: 18px; color: var(--ds-fg-3); }

.s-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.s-tile {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px 16px;
  background: var(--ds-bg-2); border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-card);
  color: inherit; text-decoration: none; transition: border-color 90ms var(--ds-ease);
}
.s-tile:hover { border-color: var(--ds-line-3); }
.s-tile-icon { display: inline-flex; color: var(--ds-fg-1); margin-bottom: 8px; }
.s-tile-title { font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); }
.s-tile-value { font-size: 16px; line-height: 24px; font-weight: 700; color: var(--ds-fg-1); }
.s-tile-sub { font-size: 12px; line-height: 18px; color: var(--ds-fg-3); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- prompts */
.s-seg-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--ds-line-1); }
.s-seg-n { font: 500 10px/14px var(--ds-font-mono); color: var(--ds-fg-3); }
.s-seg-id { font: 500 12px/18px var(--ds-font-mono); color: var(--ds-fg-1); overflow-wrap: anywhere; }
.s-seg-body { padding: 12px 16px 14px; }
.s-app .s-seg-body .pre { font-family: var(--ds-font-sans); font-size: 14px; line-height: 22px; color: var(--ds-fg-2); }
.s-app .clamp.folded .pre { max-height: 132px; }
.s-app .clamp-inline.folded .pre { max-height: 54px; }
.s-app .clamp.folded::after { background: linear-gradient(180deg, transparent 0%, var(--ds-bg-2) 100%); bottom: 26px; }
.s-app .clamp .linklike {
  margin-top: 6px; font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-2);
  text-decoration: underline; text-decoration-color: var(--ds-line-3); text-underline-offset: 4px;
}
.s-app .clamp .linklike:hover { color: var(--ds-fg-1); }
.s-host { display: flex; align-items: center; gap: 12px; font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); }
.s-host::before, .s-host::after { content: ""; flex: 1; border-top: 1px dashed var(--ds-line-2); }

/* ---------------------------------------------------------------- safety, release detail: disclosure rows */
.s-app details > summary { font: inherit; letter-spacing: 0; text-transform: none; color: inherit; list-style: none; }
.s-app details > summary::-webkit-details-marker { display: none; }
.s-app details[open] > summary { margin-bottom: 0; }
.s-rule + .s-rule { border-top: 1px solid var(--ds-line-1); }
.s-rule > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 16px; cursor: pointer; }
.s-rule > summary:hover { background: var(--ds-tint-subtle); }
.s-rule > summary:focus-visible { outline-offset: -2px; }
.s-rule-name { color: var(--ds-fg-1); min-width: 0; overflow-wrap: anywhere; }
.s-rule-caret { color: var(--ds-fg-3); transition: transform 140ms var(--ds-ease); }
details[open] > summary .s-rule-caret { transform: rotate(90deg); }
.s-rule-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.s-rule-body .s-label { margin-bottom: 4px; }
.s-rule-text { margin: 0; color: var(--ds-fg-2); }
.s-rule-body .pre { font-family: var(--ds-font-sans); font-size: 14px; line-height: 22px; color: var(--ds-fg-2); }
.s-rule-body .s-facts { border: 1px solid var(--ds-line-1); border-radius: var(--ds-radius-sharp); }
.s-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; cursor: pointer; color: var(--ds-fg-2); }
.s-more > summary:hover { color: var(--ds-fg-1); background: var(--ds-tint-subtle); }
.s-more[open] > summary { border-bottom: 1px solid var(--ds-line-1); }

/* ---------------------------------------------------------------- models */
.s-model-default { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.s-model-name { margin: 0; font: 500 16px/24px var(--ds-font-mono); color: var(--ds-fg-1); overflow-wrap: anywhere; }
.s-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--ds-line-1); }
.s-chain-sep { color: var(--ds-fg-3); }
.s-table { width: 100%; border-collapse: collapse; }
.s-table th { padding: 10px 16px; text-align: left; font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); border-bottom: 1px solid var(--ds-line-1); }
.s-table td { padding: 10px 16px; border-top: 1px solid var(--ds-line-1); color: var(--ds-fg-1); vertical-align: top; }
.s-table tr:first-child td { border-top: 0; }

/* ---------------------------------------------------------------- release detail (reused advanced parts) */
.s-app .diff-title { font-size: 12px; color: var(--ds-fg-2); }
.s-app .diff-block { border-color: var(--ds-line-1); border-radius: var(--ds-radius-sharp); overflow: hidden; }
.s-app .diff-head { background: var(--ds-bg-1); border-color: var(--ds-line-1); }
.s-app .eval-list { margin: 0; }
.s-app .eval-item { border-color: var(--ds-line-1); }
.s-more .layers { padding-bottom: 8px; }
.s-more .obj { background: var(--ds-bg-1); border-color: var(--ds-line-1); }

/* ---------------------------------------------------------------- activity */
.s-tabs { display: flex; gap: 4px; }
.s-tab {
  height: 32px; padding: 0 12px; border: 0; border-radius: var(--ds-radius-sharp); background: transparent; color: var(--ds-fg-2); cursor: pointer;
  font: 500 12px/18px var(--ds-font-mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.s-tab:hover { background: var(--ds-tint-subtle); color: var(--ds-fg-1); }
.s-tab[aria-selected="true"] { background: var(--ds-tint-hover); color: var(--ds-fg-1); }

/* ---------------------------------------------------------------- gateways */
.s-gw-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.s-gw-name { font: 500 14px/22px var(--ds-font-mono); color: var(--ds-fg-1); overflow-wrap: anywhere; }
.s-gw-ver { font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); }
.s-gw-text { margin: 0; padding: 0 16px 12px; font-size: 12px; line-height: 18px; color: var(--ds-fg-2); }
.s-gw-text.is-err { color: var(--ds-accent-2-text); }
.s-gw-text.is-warn { color: var(--ds-caution); }
.s-gw .s-facts { border-top: 1px solid var(--ds-line-1); }
.s-gw .s-facts + .s-gw-text { padding-top: 12px; border-top: 1px solid var(--ds-line-1); }

/* ---------------------------------------------------------------- calls */
.s-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.s-count { font: 500 10px/14px var(--ds-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-fg-3); }
.s-callout {
  display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px;
  border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-card); background: var(--ds-bg-2); font-size: 12px; line-height: 18px; color: var(--ds-fg-1);
}
.s-callout.is-warn .s-icon { color: var(--ds-caution); }
.s-callout.is-err .s-icon { color: var(--ds-accent-2-text); }
.s-call .s-row-title .mono { font-size: 12px; }
.s-call.is-open { background: var(--ds-tint-subtle); }
.s-call-detail { background: var(--ds-bg-1); }
.s-call-detail .s-fact dt, .s-call-detail .s-fact dd { padding-top: 7px; padding-bottom: 7px; }
.s-call-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px 12px; border-top: 1px solid var(--ds-line-1); }
.s-more-row { display: flex; }

/* ---------------------------------------------------------------- empty states */
.s-empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 32px;
  border: 1px solid var(--ds-line-1); border-radius: var(--ds-radius-card); background: var(--ds-bg-2);
}
.s-empty-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-bottom: 4px;
  border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-sharp); background: var(--ds-bg-3); color: var(--ds-fg-1);
}
.s-empty-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 700; color: var(--ds-fg-1); }
.s-empty-body { margin: 0; max-width: 60ch; color: var(--ds-fg-2); }
.s-empty .s-btn { margin-top: 8px; }
.s-empty .s-code { align-self: stretch; }

/* ---------------------------------------------------------------- assistants: the pairings card from the advanced view */
.s-pairings .card { background: var(--ds-bg-2); border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-card); overflow: hidden; }
.s-pairings .card-head { border-bottom-color: var(--ds-line-1); padding: 10px 16px; }
.s-pairings .card-head .title { font-size: 10px; line-height: 14px; letter-spacing: 0.05em; color: var(--ds-fg-3); }
.s-pairings .card-body { padding: 16px; }
.s-pairings .card-body > p:first-child { display: none; } /* the page header says it */
.s-pairings .tbl th { background: var(--ds-bg-2); border-color: var(--ds-line-1); }
.s-pairings .tbl td { border-color: var(--ds-line-1); }
.s-pairings .empty { padding: 12px 16px; border-top: 1px solid var(--ds-line-1); }
.s-app input[type="text"], .s-app input[type="password"], .s-app textarea {
  min-height: 32px; padding: 6px 10px; border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-sharp);
  background: var(--ds-bg-2); color: var(--ds-fg-1); font-size: 14px;
}
.s-app input[type="text"]:hover, .s-app textarea:hover { border-color: var(--ds-line-3); }
.s-app .btn, body[data-view="simple"] .dlg .btn {
  min-height: 32px; padding: 0 12px; border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-sharp);
  background: var(--ds-bg-3); color: var(--ds-fg-2); font-size: 12px; letter-spacing: 0.08em;
}
.s-app .btn:hover:not(:disabled), body[data-view="simple"] .dlg .btn:hover:not(:disabled) {
  color: var(--ds-fg-1); border-color: var(--ds-line-3); background-image: linear-gradient(var(--ds-tint-hover), var(--ds-tint-hover));
}
.s-app .btn.primary, body[data-view="simple"] .dlg .btn.primary { background: var(--ds-fg-1); border-color: var(--ds-fg-1); color: var(--ds-bg-1); }
.s-app .btn.primary:hover:not(:disabled), body[data-view="simple"] .dlg .btn.primary:hover:not(:disabled) {
  background: var(--ds-fg-1); border-color: var(--ds-fg-1); color: var(--ds-bg-1); opacity: 0.85;
}
.s-app .btn.small { min-height: 24px; padding: 0 8px; font-size: 10px; }
.s-app .help { border-radius: var(--ds-radius-sharp); }

/* Dialogs float above the page: Background 3 and Border 3 (spec section 4). */
body[data-view="simple"] dialog.dlg { border-radius: var(--ds-radius-card); border-color: var(--ds-line-3); background: var(--ds-bg-3); }
body[data-view="simple"] dialog.dlg::backdrop { background: var(--ds-overlay); }
body[data-view="simple"] .dlg-head, body[data-view="simple"] .dlg-foot { border-color: var(--ds-line-2); }
body[data-view="simple"] .dlg input, body[data-view="simple"] .dlg textarea, body[data-view="simple"] .dlg select { border-radius: var(--ds-radius-sharp); }

/* ---------------------------------------------------------------- narrow screens: the sidebar becomes a drawer */
@media (max-width: 767px) {
  .s-only-narrow { display: inline-flex; }
  .s-side {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(var(--ds-sidebar-width), 86vw);
    transform: translateX(-100%); transition: transform 140ms var(--ds-ease); visibility: hidden;
  }
  .s-app[data-drawer] .s-side { transform: none; visibility: visible; }
  .s-scrim { position: fixed; inset: 0; z-index: 39; background: var(--ds-overlay); }
  .s-item { min-height: 44px; gap: 12px; padding: 0 12px; }
  .s-item .s-icon { width: 20px; height: 20px; }
  .s-top { padding: 0 8px; }
  .s-updated { display: none; }
  .s-top-ctx { flex: 1 1 auto; text-overflow: ellipsis; }
  .s-page { padding: 16px 16px 48px; gap: 20px; }
  .s-banner-slot { padding: 0 16px; }
  .s-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-tiles { grid-template-columns: minmax(0, 1fr); }
  .s-facts { grid-template-columns: minmax(0, 1fr); }
  .s-fact dd { border-top: 0; padding-top: 0; }
  .s-select.is-inline { flex: 1 1 140px; max-width: none; }
  .s-row-meta { display: none; }
  .s-call .s-row-meta { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .s-app *, .s-app *::before, .s-app *::after { transition: none !important; }
}
@media (min-width: 768px) {
  .s-scrim { display: none; }
}
