/*
 * Storebench web demo.
 * Colors, sizes and radii follow Storebench's own design tokens
 * (macos/Sources/StorebenchCore/Resources/design.json): a navy sidebar,
 * soft neutral surfaces, a blue accent, 13px body text and 12px panels.
 */
:root {
  color-scheme: light;
  --page-bg: #0f1828;
  --shell-text: #eef2f8;
  --shell-muted: #b1bfd4;
  --shell-line: rgba(212, 220, 235, 0.14);
  --text: #16213a;
  --text-secondary: #43536b;
  --muted: #53637b;
  --subtle: #55647a;
  --page: #f4f6f9;
  --surface: #ffffff;
  --surface-subtle: #f7f8fb;
  --surface-sunken: #edf0f5;
  --surface-accent: #f0f4fc;
  --surface-accent-strong: #e6eefb;
  --border: #d4dce7;
  --border-strong: #c3cfdf;
  --border-control: #7c8a9f;
  --border-accent: #7889a9;
  --focus: #244db2;
  --accent: #345fd1;
  --accent-strong: #244db2;
  --danger: #a23b33;
  --danger-surface: #fff1f0;
  --success: #267653;
  --success-surface: #edf7f2;
  --warning: #8b5a10;
  --warning-surface: #fff3de;
  --nav: #17243b;
  --nav-raised: #253550;
  --nav-active: #263b66;
  --nav-text: #d4dceb;
  --nav-muted: #b1bfd4;
  --nav-focus: #adc4ff;
  --chart-1: #3662ce;
  --chart-2: #c2571d;
  --chart-3: #23845a;
  --chart-4: #8350c8;
  --chart-grid: #e4eaf3;
  --panel-shadow: 0 2px 8px rgba(23, 36, 59, 0.08);
  --radius: 12px;
  --control-radius: 8px;
  --control-height: 32px;
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100svh;
  margin: 0;
  /* clip, not hidden: hidden would make body a scroll container and break the sticky header. */
  overflow-x: clip;
  background:
    radial-gradient(circle at 20% -10%, rgba(54, 98, 206, 0.22), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(35, 132, 90, 0.12), transparent 28rem),
    linear-gradient(180deg, #132036, var(--page-bg) 70%);
  color: var(--shell-text);
  font-size: 15px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Page shell                                                          */
/* ------------------------------------------------------------------ */

.demo-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--shell-line);
  background: rgba(15, 24, 40, 0.94);
  padding: 0.55rem 4vw;
  backdrop-filter: blur(18px);
}

.brand,
.demo-header nav {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand {
  color: var(--shell-text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 40px;
  height: 38px;
  object-fit: contain;
}

.demo-header nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.demo-header nav a {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  color: var(--shell-muted);
  font-weight: 600;
  text-decoration: none;
}

.demo-header nav .nav-back {
  border-color: rgba(173, 196, 255, 0.22);
  background: rgba(173, 196, 255, 0.1);
  color: #e7eeff;
}

.demo-header nav a:hover,
.demo-header nav a:focus-visible {
  border-color: var(--shell-line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--shell-text);
}

/* Storebench has no App Store listing yet, so GitHub is the page's one filled call to action. */
.demo-header nav .nav-store,
.demo-header nav .nav-store:hover,
.demo-header nav .nav-store:focus-visible {
  border: 1px solid transparent;
  background: #f4f6f8;
  padding: 0.42rem 0.8rem;
  color: #0b0d10;
  font-weight: 700;
}

.demo-header nav .nav-store:hover,
.demo-header nav .nav-store:focus-visible {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(244, 246, 248, 0.22);
}

.demo-header a:focus-visible,
.demo-cues :focus-visible {
  outline: 2px solid var(--nav-focus);
  outline-offset: 2px;
}

.demo-shell {
  display: grid;
  width: min(1480px, 92vw);
  gap: 0.9rem;
  margin-inline: auto;
  padding: clamp(0.85rem, 1.7vw, 1.25rem) 0 2rem;
}

.demo-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0 0.15rem;
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--nav-focus);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-intro h1 {
  max-width: 820px;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  font-weight: 700;
  line-height: 1.04;
}

.demo-intro p:not(.eyebrow) {
  max-width: 640px;
  margin-top: 0.55rem;
  color: #c0cbdb;
  font-size: clamp(1rem, 1.35vw, 1.1rem);
}

.demo-cues {
  display: flex;
  max-width: 560px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.demo-cues button,
.demo-feature-link {
  display: inline-flex;
  min-height: 0;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(173, 196, 255, 0.22);
  border-radius: 999px;
  background: rgba(173, 196, 255, 0.09);
  color: #d8e2f6;
  padding: 0.36rem 0.62rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.demo-cues button:hover,
.demo-cues button:focus-visible,
.demo-cues button.is-active,
.demo-feature-link:hover,
.demo-feature-link:focus-visible {
  border-color: rgba(173, 196, 255, 0.55);
  background: rgba(173, 196, 255, 0.18);
  color: #ffffff;
}

.demo-tooltip {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  max-width: min(300px, calc(100vw - 1.5rem));
  border: 1px solid rgba(173, 196, 255, 0.3);
  border-radius: 8px;
  background: rgba(17, 26, 43, 0.97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  color: #f3f6fb;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.3;
  opacity: 0;
  padding: 0.4rem 0.52rem;
  pointer-events: none;
  transform: translateY(3px);
  transition:
    opacity 90ms ease,
    transform 90ms ease;
}

.demo-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ------------------------------------------------------------------ */
/* Application window (tokens from design.json)                        */
/* ------------------------------------------------------------------ */

.app-window {
  --text-tertiary: #4e5f77;
  --accent-medium: #365fbe;
  --accent-muted: #294fa8;
  --accent-slate: #435b83;
  --accent-soft: #7086ce;
  --danger-border: #b5514a;
  --success-border: #4b8e6e;
  --warning-border: #a27225;
  --chart-axis: #53637b;
  --chart-gap: #f1f4f9;
  --gap: 16px;
  --pad: 20px;
  --action-width: 192px;
  position: relative;
  display: grid;
  overflow: hidden;
  height: clamp(640px, calc(100svh - 120px), 900px);
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: var(--page);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.5),
    0 28px 80px rgba(0, 0, 0, 0.42);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.38;
}

.app-window h2,
.app-window h3,
.app-window h4,
.app-window p {
  margin: 0;
}

.app-window .ui-icon {
  width: var(--icon, 18px);
  height: var(--icon, 18px);
  stroke-width: 1.8;
}

.window-titlebar {
  display: grid;
  min-height: 30px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: #fbfbfc;
  padding: 0 12px;
}

.traffic-lights {
  display: flex;
  gap: 8px;
}

.traffic-lights span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}

.traffic-lights span:nth-child(2) {
  background: #febc2e;
}

.traffic-lights span:nth-child(3) {
  background: #28c840;
}

.window-title {
  color: #4b5568;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: 248px minmax(0, 1fr);
}

/* Sidebar: StorebenchSidebar */

.sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: var(--nav);
  color: var(--nav-text);
}

.sidebar-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 16px 12px;
  scrollbar-color: var(--nav-raised) transparent;
}

.sidebar-brand {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #ffffff;
  padding: 0 10px 18px;
  text-align: left;
}

.sidebar-brand img {
  width: 34px;
  height: 32px;
  object-fit: contain;
}

.sidebar-brand span {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.7px;
}

.sidebar-groups {
  display: grid;
  gap: 14px;
}

.nav-group-toggle {
  display: flex;
  width: 100%;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--nav-muted);
  padding: 2px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.nav-group-toggle .ui-icon {
  transform: rotate(90deg);
  transition: transform 150ms ease;
}

.nav-group.is-collapsed .nav-group-toggle .ui-icon {
  transform: rotate(0deg);
}

.nav-group ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 14px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--nav-text);
  padding: 6px 11px;
  font-size: 13px;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.is-active {
  background: var(--nav-active);
  color: #ffffff;
  font-weight: 600;
}

.nav-item.is-active::before {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background: var(--nav-focus);
  content: "";
  transform: translateY(-50%);
}

.nav-item span {
  min-width: 0;
  flex: 1 1 auto;
}

.nav-badge {
  min-width: 20px;
  flex: 0 0 auto !important;
  border-radius: 999px;
  background: var(--nav-focus);
  color: var(--nav);
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.nav-item:focus-visible,
.nav-group-toggle:focus-visible,
.sidebar-brand:focus-visible {
  border-color: var(--nav-focus);
  outline: none;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--nav-raised);
  padding: 20px 26px;
}

.sidebar-footer span {
  color: var(--nav-text);
}

.sidebar-footer small {
  color: var(--nav-muted);
  font-size: 13px;
}

/* Topbar: StorebenchTopbar */

.content {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
  container-type: inline-size;
}

.topbar-inner {
  display: flex;
  max-width: 1380px;
  min-height: 64px;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 0 48px;
}

.topbar-nav {
  display: flex;
  gap: 4px;
}

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: 0;
}

.icon-button.is-hidden {
  visibility: hidden;
}

.breadcrumb {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.breadcrumb li span,
.breadcrumb li strong {
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
}

.breadcrumb li strong {
  max-width: none;
  color: var(--text);
  font-weight: 600;
}

.breadcrumb .ui-icon {
  color: var(--subtle);
}

.crumb {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  font-size: 13px;
}

/* Page: StorebenchPageContent */

.page {
  min-height: 0;
  overflow-y: auto;
  container-type: inline-size;
}

.page:focus {
  outline: none;
}

.page-content {
  display: flex;
  max-width: 1380px;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
  padding: 32px 48px 24px;
}

.page-footer {
  display: grid;
  gap: 16px;
  margin-top: 4px;
}

.page-footer small {
  color: var(--subtle);
  font-size: 11px;
}

.divider {
  display: block;
  height: 1px;
  flex: 1 1 auto;
  background: var(--border);
}

.page-header {
  display: grid;
  gap: 8px;
}

.page-header.has-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.page-copy {
  display: grid;
  gap: 8px;
}

.page-eyebrow {
  min-height: 18px;
  color: var(--accent-medium);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.page-title-row,
.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title {
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.25;
}

.page-lede {
  max-width: 860px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.page-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.page-actions .feedback {
  max-width: 400px;
  text-align: right;
}

.help-button,
.info-tip {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--accent-muted);
  padding: 0;
}

.help-button:hover,
.info-tip:hover {
  background: var(--surface-accent);
}

/* Card */

.card,
.card-list,
.notice {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--panel-shadow);
}

.card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.card-head {
  display: grid;
  gap: 4px;
}

.card-head.has-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.card-copy {
  display: grid;
  gap: 4px;
}

.card-copy h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.card-copy p,
.muted {
  color: var(--muted);
}

.card-actions {
  display: flex;
  justify-content: flex-end;
}

.card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap);
}

.card-section {
  display: grid;
  gap: 12px;
}

.card-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-section-head h4 {
  flex: 0 1 auto;
  font-size: 13px;
  font-weight: 600;
}

.card-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

.card-list.is-padded {
  gap: var(--gap);
  padding: 20px;
}

.card-list-section {
  display: grid;
  gap: var(--gap);
  border-top: 1px solid var(--border);
  padding: 20px;
}

.section-heading {
  font-size: 17px;
  font-weight: 600;
}

/* Facts and status */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr));
  gap: var(--gap);
}

.fact {
  display: flex;
  min-width: 0;
  min-height: 140px;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--panel-shadow);
  padding: 12px 16px;
}

.fact.is-compact {
  min-height: 104px;
}

.fact-title {
  display: flex;
  min-height: 34px;
  align-items: flex-start;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
}

.fact-value {
  min-height: 36px;
  overflow-wrap: anywhere;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
}

.fact.is-compact .fact-value {
  font-size: 13px;
  font-weight: 600;
}

.fact-hint {
  min-height: 32px;
  color: var(--subtle);
  font-size: 11px;
}

.status-list {
  display: grid;
  gap: 6px;
}

.status-fact {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
}

.status-label {
  font-weight: 600;
}

.status-value {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.status-fact.is-done .status-value {
  color: var(--success);
}

.status-fact.is-problem .status-value {
  color: var(--danger);
}

.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px var(--action-width);
  align-items: center;
  gap: 4px 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.status-row.no-separator,
.status-row:last-child {
  border-bottom: 0;
}

.status-row-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.status-row-copy span {
  color: var(--muted);
  white-space: pre-line;
}

.status-row-action {
  display: flex;
  justify-content: flex-end;
}

.status-row-details {
  grid-column: 1 / -1;
}

.sync-badge {
  display: inline-flex;
  width: 100%;
  height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sync-badge.tone-success {
  border-color: var(--success-border);
  background: var(--success-surface);
  color: var(--success);
}

.sync-badge.tone-warning {
  border-color: var(--warning-border);
  background: var(--warning-surface);
  color: var(--warning);
}

.sync-badge.tone-danger {
  border-color: var(--danger-border);
  background: var(--danger-surface);
  color: var(--danger);
}

.sync-badge.tone-accent {
  border-color: var(--border-accent);
  background: var(--surface-accent);
  color: var(--accent-muted);
}

.state-label {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.state-mark {
  display: inline-grid;
  width: 12px;
  height: 12px;
  place-items: center;
  align-self: center;
}

.state-mark.is-complete {
  color: var(--success);
}

.state-mark i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.state-mark i.is-pending {
  background: var(--warning);
}

.state-mark i.is-problem {
  background: var(--danger);
}

.badge {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-accent-strong);
  color: var(--accent-muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}

.badge.tone-success {
  background: var(--success-surface);
  color: var(--success);
}

/* Notice, attention, feedback */

.notice {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.card .notice {
  box-shadow: none;
}

.notice-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-accent-strong);
  color: var(--accent-medium);
}

.notice-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.notice-copy strong {
  font-weight: 600;
}

.notice-copy span {
  color: var(--accent-slate);
}

.attention {
  display: grid;
  gap: 8px;
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  background: var(--danger-surface);
  padding: 16px;
}

.attention.is-done {
  border-color: var(--success-border);
  background: var(--success-surface);
}

.attention-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--danger);
}

.attention.is-done .attention-head {
  color: var(--success);
}

.feedback {
  min-height: 18px;
  color: var(--muted);
}

.feedback:empty {
  min-height: 0;
}

.feedback.is-error {
  color: var(--danger);
}

.read-age,
.freshness {
  color: var(--muted);
  font-size: 11px;
}

/* Buttons: StorebenchButtonStyle */

.button {
  display: inline-flex;
  min-width: var(--action-width);
  max-width: var(--action-width);
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--surface-accent);
  color: var(--accent-muted);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 120ms ease, background-color 120ms ease;
}

.button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.button:hover:not(:disabled) {
  background: var(--surface-accent-strong);
}

.button:active:not(:disabled) {
  transform: scale(0.97);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button-primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.button-quiet {
  border-color: var(--border-control);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.button-quiet:hover:not(:disabled) {
  background: var(--surface-accent);
}

.button-danger {
  border-color: var(--danger-border);
  background: var(--danger-surface);
  color: var(--danger);
}

.button-danger:hover:not(:disabled) {
  background: #ffe4e1;
}

.button-natural {
  min-width: 0;
  max-width: none;
}

.button-icon {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
}

.button:disabled,
.button[aria-disabled="true"] {
  border-color: var(--border);
  background: var(--surface-sunken);
  color: var(--subtle);
  cursor: not-allowed;
}

.button:focus-visible,
.app-window input:focus-visible,
.app-window select:focus-visible,
.app-window textarea:focus-visible,
.chip:focus-visible,
.choice-picker button:focus-visible,
.nav-tabs button:focus-visible,
.collection-toggle:focus-visible,
.collection-link:focus-visible,
.nav-card:focus-visible,
.step-item:focus-visible,
.card-thumb:focus-visible,
.card-canvas:focus-visible,
.thumb-button:focus-visible,
.icon-button:focus-visible,
.help-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.action-group.is-trailing {
  justify-content: flex-end;
}

.form-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.menu-select {
  position: relative;
  display: inline-flex;
  min-width: var(--action-width);
  max-width: var(--action-width);
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.menu-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.notice-action .menu-select {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.notice-action .menu-select::after {
  content: "Create Release";
}

.file-button {
  position: relative;
  cursor: pointer;
}

/* Forms */

.app-window input[type="text"],
.app-window input[type="search"],
.app-window input[type="email"],
.app-window input[type="url"],
.app-window input[type="password"],
.app-window input[type="date"],
.app-window input:not([type]),
.app-window select,
.app-window textarea {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 11px;
  font: inherit;
}

.app-window textarea {
  min-height: 64px;
  padding: 10px 11px;
  line-height: 20.8px;
  resize: vertical;
}

.app-window input:disabled,
.app-window select:disabled,
.app-window textarea:disabled {
  background: var(--surface-sunken);
  color: var(--subtle);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 12px var(--gap);
}

.form-column {
  display: grid;
  max-width: 440px;
  gap: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 7px var(--gap);
}

.field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.field.is-wide,
.field-grid .disclosure {
  grid-column: 1 / -1;
}

.field > label,
.field-label {
  min-height: 18px;
  font-weight: 600;
}

.field-value {
  min-height: 32px;
  border-radius: 8px;
  background: var(--surface-sunken);
  padding: 6px 11px;
}

.field-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.field-hint,
.field-count {
  color: var(--muted);
  font-size: 11px;
}

.field-count {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.field.is-over input,
.field.is-over textarea,
.field.is-over select {
  border-color: var(--danger-border);
  background: var(--danger-surface);
}

.field.is-over .field-hint,
.field.is-over .field-count {
  color: var(--danger);
}

.field.is-changed > label::after {
  margin-left: 6px;
  color: var(--accent-medium);
  content: "· changed";
  font-size: 11px;
  font-weight: 600;
}

.toggle,
.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 120ms ease;
}

.toggle-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  content: "";
  transition: transform 120ms ease;
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(14px);
}

.toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.checkbox input,
.radio input,
.data-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.checkbox.is-full {
  visibility: hidden;
}

.radio-list {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.radio-list legend {
  margin-bottom: 6px;
  font-weight: 600;
}

.radio {
  align-items: flex-start;
}

.choice-picker,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-picker {
  gap: 0;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 2px;
}

.choice-picker button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  padding: 0 12px;
  font-size: 13px;
}

.choice-picker button.is-selected {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 36, 59, 0.16);
  color: var(--text);
  font-weight: 600;
}

.chip {
  min-height: 32px;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}

.chip.is-selected {
  border-color: var(--border-accent);
  background: var(--surface-accent);
  color: var(--accent-muted);
}

.range-row,
.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-row input {
  min-width: 0;
  flex: 1 1 auto;
  accent-color: var(--accent);
}

.range-row output,
.color-row code {
  min-width: 52px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.color-row input {
  width: 44px;
  height: 32px;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: none;
  padding: 2px;
}

.search-row {
  display: flex;
}

.search-field {
  display: flex;
  width: min(420px, 100%);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
}

.search-field input {
  min-height: 30px;
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
}

.search-field input:focus-visible {
  outline: none !important;
}

.search-field:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* Disclosure, tabs, collection */

.disclosure summary,
.change summary,
.help-topic summary {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  color: var(--accent-muted);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.disclosure summary::-webkit-details-marker,
.change summary::-webkit-details-marker,
.help-topic summary::-webkit-details-marker {
  display: none;
}

.disclosure summary .ui-icon,
.change summary .ui-icon,
.help-topic summary .ui-icon {
  transition: transform 150ms ease;
}

.disclosure[open] > summary .ui-icon,
.change[open] > summary .ui-icon,
.help-topic[open] > summary .ui-icon {
  transform: rotate(90deg);
}

.disclosure-body {
  display: grid;
  gap: 12px;
  padding: 4px 0 4px 22px;
}

.compare {
  margin-top: -2px;
}

.compare summary {
  min-height: 24px;
  font-size: 11px;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-tabs button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}

.nav-tabs button.is-selected {
  border-color: var(--border-accent);
  background: var(--surface-accent);
  color: var(--accent-muted);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.workspace-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.app-chooser {
  width: min(440px, 100%);
}

.collection {
  display: grid;
  gap: 12px;
}

.collection-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.collection-bar small {
  color: var(--muted);
  font-size: 11px;
}

.collection-bar .button {
  margin-left: auto;
}

.collection-options {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: var(--accent-muted);
  padding: 4px 0;
  font-size: 13px;
  font-weight: 600;
}

.collection-options[aria-expanded="true"] .ui-icon {
  transform: rotate(90deg);
}

.collection-options-panel {
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 12px;
}

.collection-items {
  display: grid;
  gap: 12px;
}

.collection-card {
  display: grid;
  min-width: 0;
}

.collection-card.is-surface,
.collection-link.is-surface {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 20px;
}

.collection-card.is-open {
  gap: var(--gap);
}

.collection-toggle,
.collection-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  padding: 0;
  text-align: left;
}

.collection-link.is-surface:hover {
  background: var(--page);
}

.collection-copy {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
}

.collection-copy strong {
  font-weight: 600;
}

.collection-copy small {
  color: var(--muted);
  font-size: 11px;
  white-space: pre-line;
}

.collection-chevron {
  color: var(--accent-muted);
  transition: transform 150ms ease;
}

.collection-card.is-open .collection-chevron {
  transform: rotate(90deg);
}

.collection-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap);
}

.collection-icon,
.nav-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-medium);
}

/* Navigation card */

.nav-card {
  display: grid;
  width: 100%;
  min-height: 82px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  padding: 20px;
  text-align: left;
}

.nav-card:hover {
  background: var(--page);
}

.nav-card.is-embedded {
  padding: 8px 0;
}

.nav-card.is-embedded:hover {
  background: none;
}

.nav-card-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.nav-card-copy strong {
  font-weight: 600;
}

.nav-card-copy span {
  color: var(--muted);
  white-space: pre-line;
}

.nav-card-action {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-muted);
  padding: 0 12px;
  font-weight: 600;
  white-space: nowrap;
}

.app-icon {
  display: grid;
  width: var(--size, 42px);
  height: var(--size, 42px);
  place-items: center;
  border-radius: 22%;
  background: linear-gradient(145deg, var(--from), var(--to));
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2);
  color: #ffffff;
  font-size: calc(var(--size, 42px) * 0.36);
  font-weight: 700;
}

.app-cards {
  display: grid;
  gap: var(--gap);
}

.connected-app {
  display: grid;
  gap: 4px;
}

.all-sync {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.all-sync strong {
  font-size: 13px;
  font-weight: 600;
}

/* Step rail: StorebenchStepRail and StorebenchSetupStep */

.step-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.step-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 20px;
}

.step-rail {
  display: grid;
  gap: 4px;
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}

.step-rail-title {
  font-weight: 600;
}

.step-rail-count {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.step-rail ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-item {
  display: grid;
  width: 100%;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  padding: 8px;
  text-align: left;
}

.step-item:hover {
  background: var(--surface-subtle);
}

.step-item.is-selected {
  background: var(--surface-accent-strong);
}

.step-circle,
.setup-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-accent-strong);
  color: var(--accent-muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.step-item.is-selected .step-circle,
.step-item.is-current .step-circle {
  background: var(--accent);
  color: #ffffff;
}

.step-item.is-complete .step-circle,
.setup-step.is-done .setup-number {
  background: var(--success);
  color: #ffffff;
}

.step-copy {
  display: grid;
  gap: 2px;
}

.step-item.is-selected .step-title {
  font-weight: 600;
}

.step-copy small {
  color: var(--muted);
  font-size: 11px;
}

.step-item.is-current .step-copy small {
  color: var(--accent-deep, #244db2);
}

.setup-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
}

.setup-number {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

.setup-step > div {
  display: grid;
  gap: 4px;
}

.setup-step strong {
  font-weight: 600;
}

.setup-step p {
  color: var(--muted);
}

.guide-section.is-current {
  border-color: var(--border-accent);
}

/* Language editor and screenshots */

.language-editor {
  display: grid;
  gap: var(--gap);
}

.editor-summary {
  color: var(--muted);
}

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.keyword-check {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  background: var(--warning-surface);
  padding: 12px;
}

.screenshots-editor {
  display: grid;
  gap: 12px;
}

.editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-head > div:first-child {
  display: grid;
  gap: 2px;
}

.editor-head small {
  color: var(--muted);
  font-size: 11px;
}

.shot-grid,
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.asset-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  padding: 16px;
  text-align: left;
}

.asset-card[draggable="true"] {
  cursor: grab;
}

.asset-card.is-dragging {
  opacity: 0.5;
}

.asset-preview {
  display: grid;
  height: 220px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--surface-sunken);
  padding: 12px;
}

.asset-meta {
  display: grid;
  min-height: 40px;
  gap: 2px;
}

.asset-meta strong {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta small {
  color: var(--muted);
  font-size: 11px;
}

.asset-badges,
.asset-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.drop-zone {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

label.drop-zone {
  cursor: pointer;
}

label.drop-zone strong {
  color: var(--text);
}

.asset-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.asset-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 124px auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.asset-thumb {
  display: grid;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-sunken);
  padding: 4px;
}

.asset-thumb img {
  max-width: 100%;
  max-height: 100%;
}

.asset-info {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.asset-info small {
  color: var(--muted);
  font-size: 11px;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(110px, 100%), 1fr));
  gap: 12px;
}

.thumb-button {
  display: grid;
  height: 120px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--surface-sunken);
  padding: 6px;
}

.data-table .thumb-button {
  width: 64px;
  height: 64px;
}

/* Sample screenshots, drawn with CSS */

.shot-art {
  position: relative;
  display: flex;
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  gap: 6%;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(160deg, var(--from), var(--to));
  color: #ffffff;
  padding: 9% 8%;
  container-type: inline-size;
}

.shot-art.is-mac {
  width: 100%;
  height: auto;
  padding: 5% 6%;
}

.shot-art .shot-title {
  font-size: clamp(7px, 9cqw, 22px);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.shot-screen {
  display: grid;
  width: 100%;
  flex: 1 1 auto;
  align-content: start;
  gap: 6%;
  border-radius: 8cqw;
  background: rgba(255, 255, 255, 0.92);
  color: #16213a;
  padding: 10% 9%;
}

.shot-art.is-mac .shot-screen {
  border-radius: 3cqw;
  gap: 4%;
  padding: 5% 6%;
}

.shot-screen b {
  font-size: clamp(5px, 6cqw, 13px);
}

.shot-screen i {
  display: block;
  height: max(3px, 3cqw);
  border-radius: 2px;
  background: rgba(23, 36, 59, 0.16);
}

.shot-screen i.short {
  width: 62%;
}

.shot-pill {
  width: 40%;
  height: max(5px, 6cqw);
  border-radius: 99px;
  background: var(--to);
  opacity: 0.75;
}

.shot-viewer {
  display: grid;
  max-height: 60vh;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--nav);
  padding: 16px;
}

.shot-viewer .shot-art {
  height: 52vh;
}

/* Create Media */

.card-art {
  position: relative;
  display: flex;
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  color: #ffffff;
  container-type: inline-size;
}

.card-art.layout-textOnly .card-text {
  flex: 1 1 auto !important;
  justify-content: center;
}

.card-text {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 1.5cqw;
  padding: 2cqw 0;
}

.card-text .shot-title {
  font-size: calc(9cqw * var(--text-size, 1));
  font-weight: 700;
  line-height: 1.12;
}

.card-subtitle {
  font-size: calc(4.8cqw * var(--text-size, 1));
  font-weight: 500;
}

.card-body-text {
  font-size: calc(4cqw * var(--text-size, 1));
}

.card-shot {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.card-shot.is-bleed {
  flex-grow: 1.3;
}

.card-art.layout-bleedBottom .card-shot {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  margin-bottom: -12cqw;
}

.card-art.layout-bleedTop .card-shot {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  margin-top: -12cqw;
}

.card-screen {
  display: grid;
  width: 100%;
  height: 100%;
  align-content: start;
  gap: 4cqw;
  background: linear-gradient(180deg, var(--to) 0 14%, rgba(255, 255, 255, 0.95) 14%);
  color: #16213a;
  padding: 4cqw 6cqw;
}

.card-screen b {
  color: #ffffff;
  font-size: 4cqw;
}

.card-screen i {
  display: block;
  height: 2.4cqw;
  border-radius: 1cqw;
  background: rgba(23, 36, 59, 0.16);
}

.card-screen i.short {
  width: 60%;
}

.card-screen.is-empty {
  place-items: center;
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 4cqw;
}

.card-shot.is-focus .card-screen {
  transform: scale(1.8) !important;
}

.card-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 0;
  padding: 2px 2px 6px;
  list-style: none;
}

.card-thumb {
  position: relative;
  display: grid;
  width: 96px;
  height: 160px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--surface-sunken);
  padding: 6px;
}

.card-thumb.is-selected {
  border-color: var(--accent);
}

.card-thumb .badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
}

.card-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: var(--gap);
}

.card-preview-column {
  position: sticky;
  top: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.card-canvas {
  display: grid;
  height: min(560px, 62vh);
  place-items: center;
  border-radius: 12px;
  background: var(--nav);
  padding: 16px;
}

.card-settings {
  max-height: 680px;
  overflow-y: auto;
  padding-right: 12px;
}

.card-controls {
  display: grid;
  gap: 14px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--border-control);
  padding: 0;
}

/* Tables */

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  height: 53px;
  border-bottom: 1px solid var(--border);
  padding: 4px 12px 4px 0;
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  height: 45px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.data-table tbody th {
  font-weight: 600;
}

.data-table .is-numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.data-table tr.is-selected {
  background: var(--surface-accent);
}

.pre-line {
  white-space: pre-line;
}

.muted-cell {
  color: var(--muted);
}

.row-link {
  border: 0;
  background: none;
  color: var(--accent-muted);
  padding: 0;
  font-weight: 600;
  text-align: left;
}

.empty-state {
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 16px;
}

/* Reviews before sending */

.review {
  display: grid;
  gap: 12px;
}

.progress {
  display: grid;
  gap: 6px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-sunken);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 200ms ease;
}

.progress small {
  color: var(--muted);
  font-size: 11px;
}

.changes {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.change {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}

.change summary {
  color: var(--text);
  font-weight: 400;
}

.change-label {
  min-width: 0;
  flex: 1 1 auto;
}

.change-state {
  display: inline-flex;
  min-width: 100px;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.change-state.is-problem {
  color: var(--danger);
}

.change-body {
  display: grid;
  gap: 6px;
  padding: 6px 0 8px 22px;
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface-accent-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.saved-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.saved-values > div {
  display: grid;
  gap: 6px;
}

.saved-values span {
  font-weight: 600;
}

.saved-values p {
  min-height: 32px;
  border-radius: 8px;
  background: var(--surface-sunken);
  padding: 7px 11px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.op-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.op-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.op-method {
  display: inline-grid;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-accent-strong);
  color: var(--accent-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.op-body {
  display: grid;
  min-width: 0;
  gap: 8px;
}

/* Charts */

.chart-frame {
  position: relative;
  height: 240px;
}

.report-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.grid-line {
  stroke: var(--chart-grid);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.axis-label {
  fill: var(--chart-axis);
  font-size: 10px;
}

.series-line {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.marker-line {
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.marker-layer {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 14px;
}

.chart-marker {
  position: absolute;
  top: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--marker);
  box-shadow: 0 0 0 1px var(--marker);
  padding: 0;
  transform: translateX(-50%);
}

.chart-marker:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.chart-legend,
.marker-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  list-style: none;
}

.chart-legend li,
.marker-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i,
.marker-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.measure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 8px 16px;
}

.note-form {
  display: grid;
  gap: 12px;
}

.diff-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.diff-list li {
  display: grid;
  gap: 2px;
}

.diff-added {
  color: var(--success);
}

.diff-removed {
  color: var(--danger);
}

.diff-table {
  display: grid;
  gap: 12px;
}

.diff-row {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.diff-row.is-changed strong {
  color: var(--accent-muted);
}

.age-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 12px 16px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: 12px;
}

.availability-list,
.draft-list {
  display: grid;
}

.feedback-shot {
  display: grid;
  width: 140px;
  height: 200px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-sunken);
  padding: 8px;
}

/* Sheets */

.sheet-overlay {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 24, 40, 0.38);
  padding: 20px;
}

.sheet {
  display: grid;
  width: min(480px, 100%);
  max-height: calc(100% - 20px);
  gap: 12px;
  overflow-y: auto;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 22px;
}

.sheet-wide {
  width: min(760px, 100%);
}

.sheet h2 {
  font-size: 17px;
  font-weight: 600;
}

.sheet p {
  color: var(--muted);
}

.sheet-note {
  border-radius: 8px;
  background: var(--warning-surface);
  color: var(--warning) !important;
  padding: 10px 12px;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.sheet-actions .button {
  min-width: 140px;
}

.settings-grid,
.help-list {
  display: grid;
  gap: 16px;
}

.help-list {
  max-height: 50vh;
  gap: 4px;
  overflow-y: auto;
}

.help-topic {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}

.help-topic p {
  padding: 4px 0 8px 22px;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pick-tile {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
}

.pick-tile:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-accent);
}

.pick-preview {
  display: grid;
  height: 120px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-sunken);
  padding: 4px;
}

.pick-tile small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

/* ------------------------------------------------------------------ */
/* Narrower windows (ComponentLayout.pageInsets and stacking widths)   */
/* ------------------------------------------------------------------ */

@container (max-width: 1000px) {
  .page-content {
    padding: 32px 28px 24px;
  }

  .metric-grid {
    grid-template-columns: repeat(min(var(--columns, 4), 2), minmax(0, 1fr));
  }

  .card-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-preview-column {
    position: static;
  }

  .card-settings {
    max-height: none;
    overflow: visible;
  }
}

@container (max-width: 1000px) {
  .topbar-inner {
    padding: 0 28px;
  }
}

@container (max-width: 880px) {
  .step-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container (max-width: 760px) {
  .page-header.has-actions,
  .card-head.has-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-actions,
  .card-actions {
    justify-items: start;
    justify-content: flex-start;
  }

  .page-actions .feedback {
    text-align: left;
  }

  .action-group.is-trailing {
    justify-content: flex-start;
  }
}

@container (max-width: 700px) {
  .page-content {
    gap: 16px;
    padding: 24px 20px 20px;
  }

  .topbar-inner {
    padding: 0 20px;
  }

  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .status-row-copy {
    grid-column: 1 / -1;
  }

  .status-row-status {
    min-width: 124px;
  }

  .status-fact {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .saved-values {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .asset-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .asset-state,
  .asset-actions {
    grid-column: 1 / -1;
  }

  .nav-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .nav-card-action {
    grid-column: 2;
    padding: 0;
  }

  .notice {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
  }

  .notice-icon {
    width: 32px;
    height: 32px;
  }

  .notice-action {
    grid-column: 2;
  }
}

@media (max-width: 1180px) {
  .demo-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-cues {
    max-width: none;
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 216px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .demo-header nav a {
    padding: 0.4rem 0.5rem;
    font-size: 0.84rem;
  }
}
/* Phones: the workspace comes first, the sidebar becomes a scrolling strip. */
@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .demo-header {
    display: grid;
    min-height: 58px;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    padding: max(0.4rem, env(safe-area-inset-top)) 0.55rem 0.4rem;
  }

  .brand {
    width: 44px;
  }

  .brand span,
  .demo-header nav a:nth-of-type(n + 4) {
    display: none;
  }

  .demo-header nav {
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.15rem;
    overflow-x: auto;
    padding: 0.1rem;
    scrollbar-width: none;
  }

  .demo-header nav::-webkit-scrollbar {
    display: none;
  }

  .demo-header nav a {
    min-height: 38px;
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .demo-shell {
    width: 100%;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem 1.5rem;
  }

  .demo-intro {
    display: block;
    overflow: hidden;
    padding: 0;
  }

  .demo-intro > div:first-child {
    display: none;
  }

  .demo-cues {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.15rem 0.05rem 0.25rem;
    scrollbar-width: none;
  }

  .demo-cues::-webkit-scrollbar {
    display: none;
  }

  .demo-cues button,
  .demo-feature-link {
    min-height: 36px;
    flex: 0 0 auto;
  }

  .app-window {
    height: auto;
    overflow: clip;
    grid-template-rows: auto auto;
    border-radius: 10px;
  }

  .window-titlebar {
    min-height: 28px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The sidebar becomes one scrolling row that stays below the sticky header. */
  .sidebar {
    position: sticky;
    z-index: 5;
    top: 58px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-scroll {
    overflow: visible;
    padding: 0;
  }

  .sidebar-brand,
  .sidebar-footer,
  .nav-group-toggle {
    display: none;
  }

  .sidebar-groups,
  .nav-group ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .nav-group.is-collapsed ul li {
    display: list-item;
  }

  .nav-group + .nav-group {
    border-left: 1px solid var(--nav-raised);
    padding-left: 4px;
  }

  .nav-item {
    min-height: 38px;
    gap: 7px;
    padding: 6px 11px;
    white-space: nowrap;
  }

  .nav-item.is-active::before {
    top: auto;
    bottom: 3px;
    left: 50%;
    width: 18px;
    height: 3px;
    transform: translateX(-50%);
  }

  .content {
    grid-template-rows: auto auto;
  }

  .topbar-inner {
    min-height: 52px;
    padding: 0 12px;
  }

  .breadcrumb li:not(:last-child),
  .breadcrumb li:last-child .ui-icon,
  .icon-button.is-hidden {
    display: none;
  }

  .page {
    overflow: visible;
  }

  .page-content {
    padding: 18px 12px 20px;
  }

  .page-title {
    font-size: 24px;
  }

  .card,
  .card-list.is-padded,
  .collection-card.is-surface,
  .collection-link.is-surface,
  .notice {
    padding: 14px;
  }

  .button,
  .menu-select {
    min-width: 0;
    max-width: none;
    flex: 1 1 140px;
  }

  .button-icon {
    flex: 0 0 32px;
  }

  .button-natural {
    flex: 0 1 auto;
  }

  .sheet-overlay {
    position: fixed;
    z-index: 60;
    padding-top: 96px;
  }

  .chart-frame {
    height: 200px;
  }

  .asset-preview {
    height: 180px;
  }

  .card-canvas {
    height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.app-window :is(.op-method, .data-table thead th, .nav-group-toggle span, .page-eyebrow, .segmented button.is-active) {
  font-weight: 500 !important;
}

/* Header navigation matches the other demos: one line on tablets with the
   brand kept on a single line. */
.demo-header .brand {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .demo-header nav {
    flex-wrap: nowrap;
    gap: 0.2rem;
  }

  .demo-header nav a {
    padding: 0.4rem 0.5rem;
    font-size: 0.86rem;
  }
}

@media (min-width: 761px) {
  .demo-header {
    gap: 1rem;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .demo-header nav {
    gap: 0.1rem;
  }

  .demo-header nav a {
    padding: 0.36rem 0.42rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 760px) {
  /* Quick starts scroll the window to the top of the viewport; keep it clear of the sticky header. */
  .app-window {
    scroll-margin-top: 66px;
  }
}
