/* Shared page frame. Editors keep their existing internal layout and handlers. */
:root {
  --workspace-width: 1440px;
  --workspace-gutter: clamp(20px, 2vw, 32px);
  --workspace-gap: 24px;
  --workspace-radius: var(--control-radius, 6px);
  --workspace-panel-gutter: 24px;
  --control-height-compact: 36px;
  --danger-hover: #b42318;
  --danger-active: #912018;
}

/* One command toolbar across every signed-in surface. */
.routras-command-actions { flex: none; gap: 6px; }
.routras-command-actions :is(.icon-button, .shell-language) { box-sizing: border-box; width: 32px; height: 32px; min-height: 32px; padding: 0; display: inline-grid; place-items: center; flex: none; border: 0; border-radius: var(--control-radius, 6px); background: transparent; }
.routras-command-actions .shell-menu { display: none; }
.routras-command-actions .icon-button > svg { width: 18px; height: 18px; }
.routras-command-actions :is(.icon-button, .shell-language):hover { background: #f1f3f5; }
.studio-header .routras-command-actions { flex-wrap: nowrap; gap: 6px; }
.studio-tabs > .routras-editor-return { margin-left: auto; }
.routras-page-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; min-width: 0; margin-left: auto; }
.routras-page-actions .refresh-time { display: inline; font-size: 11px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.routras-page-actions .switch-label { display: flex; white-space: nowrap; }
.routras-page-actions .command-button span { color: inherit; }
.routras-account { display: inline-flex; align-items: center; flex: none; }
.routras-avatar, .studio-header .routras-avatar { box-sizing: border-box; width: 32px; height: 32px; display: grid; place-items: center; flex: none; border: 1px solid var(--accent-border); border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 600; line-height: 1; }
.routras-avatar svg { width: 18px; height: 18px; }
.routras-account-menu { position: fixed; z-index: 80; inset: auto; box-sizing: border-box; width: 248px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 0; padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: var(--control-radius, 6px); background: var(--surface, #fff); color: var(--text-primary); box-shadow: 0 4px 12px rgb(15 23 42 / 10%); font-size: 13px; }
.routras-account-identity { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.routras-account-identity > div { display: grid; gap: 4px; min-width: 0; }
.routras-account-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.routras-account-identity #routras-account-handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: 11px; }
.routras-account-menu nav { display: grid; gap: 2px; padding: 6px; }
.routras-account-menu :is(nav a, .routras-account-logout) { display: flex; align-items: center; gap: 10px; box-sizing: border-box; min-height: 38px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--control-radius, 6px); background: transparent; color: var(--text-primary); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.routras-account-menu :is(nav a, .routras-account-logout):hover { background: #f1f3f5; }
.routras-account-menu :is(nav a, .routras-account-logout):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.routras-account-menu :is(nav a, .routras-account-logout) svg { width: 17px; height: 17px; flex: none; color: var(--text-secondary); }
.routras-account-footer { padding: 6px; border-top: 1px solid var(--border); }
.routras-account-menu .routras-account-logout { color: var(--danger); }
.routras-account-menu .routras-account-logout svg { color: inherit; }
.routras-account-error { margin: 4px 10px 8px; color: var(--danger); font-size: 12px; line-height: 1.6; }

/* Close controls use the same centered X and square hit area in all dialogs. */
body.routras-shell-ready button.routras-close-button { box-sizing: border-box; display: inline-grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: var(--control-radius, 6px); background: transparent; color: var(--text-secondary); line-height: 1; cursor: pointer; }
body.routras-shell-ready button.routras-close-button:hover, body.routras-shell-ready button.routras-close-button:active { background: #e9edf0; color: var(--text-primary); }
body.routras-shell-ready button.routras-close-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.routras-shell-ready button.routras-close-button svg { display: block; width: 18px; height: 18px; flex: none; stroke-width: 2; }

/* Storage stays in the command bar; status refreshes never rebuild the icon. */
.routras-storage { display: inline-flex; align-items: center; flex: none; }
.routras-storage > .icon-button { color: var(--text-muted); border-radius: var(--control-radius, 6px); }
.routras-storage > .icon-button:hover { color: var(--text-secondary); background: var(--surface); }
.routras-storage[data-state="saving"] > .icon-button { color: #2563eb; }
.routras-storage > .icon-button svg { width: 18px; height: 18px; }
.routras-storage-popover { position: fixed; z-index: 80; width: 320px; max-width: calc(100vw - 16px); padding: 16px; border: 1px solid var(--border); border-radius: var(--control-radius, 6px); background: var(--surface, #fff); box-shadow: 0 4px 12px rgb(15 23 42 / 10%); color: var(--text-primary); font-size: 12px; }
.routras-storage-popover[hidden] { display: none; }
.routras-storage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.routras-storage-head strong { font-size: 14px; }
.routras-storage-head .icon-button { width: 24px; height: 24px; }
.routras-storage-head svg { width: 15px; height: 15px; }
.routras-storage-status { margin: 6px 0 16px; line-height: 1.6; color: var(--text-secondary); }
.routras-storage-popover dl { display: grid; gap: 10px; margin: 0; font-variant-numeric: tabular-nums; }
.routras-storage-popover dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.routras-storage-popover dt { color: var(--text-secondary); white-space: nowrap; }
.routras-storage-popover dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.routras-storage-note { margin: 14px 0; color: var(--text-muted); font-size: 11px; line-height: 1.65; text-wrap: pretty; }
.routras-storage-actions { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.routras-storage-actions .command-button { min-height: 32px; border-radius: var(--control-radius, 6px); }

/* Headers and actions remain outside the one scrolling body. */
dialog.routras-dialog-scroll[open] { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); overflow: hidden; }
dialog.routras-dialog-scroll > .routras-dialog-frame { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: calc(100dvh - 42px); overflow: hidden; }
.routras-dialog-scroll :is(.dialog-head, .project-automation-head, .dialog-actions, .project-automation-actions), .routras-dialog-frame > :is(header, footer) { flex: none; position: static; background: var(--surface, #fff); }
body dialog :is(.dialog-head, .project-automation-head, header)[autofocus][tabindex="-1"] { outline: none; }
.routras-dialog-scroll .routras-dialog-body { flex: 1 1 auto; min-width: 0; min-height: 0; max-height: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.routras-dialog-scroll .dialog-actions { border-top: 1px solid var(--border); flex-wrap: wrap; }
#routras-project-automation-dialog.routras-dialog-scroll { max-height: min(760px, calc(100dvh - 40px)); border-radius: var(--control-radius, 6px); }
#routras-project-automation-dialog > .routras-dialog-frame { max-height: min(758px, calc(100dvh - 42px)); }
#supply-channel-dialog > .routras-dialog-body { padding: 20px; }
#supply-channel-dialog .admin-supply-section:last-child { margin-bottom: 0; }
body.routras-shell-ready .detail-pane:has(> .production-detail-body) { display: flex; flex-direction: column; min-height: 0; max-height: var(--production-detail-height, calc(100dvh - 320px)); overflow: hidden; }
body.routras-shell-ready .detail-pane > .job-detail-head { flex: none; min-width: 0; }
body.routras-shell-ready .production-detail-body { min-height: 0; min-width: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
body.routras-shell-ready .detail-pane > .production-detail-actions { position: static; flex: none; border-top: 1px solid var(--border); border-bottom: 0; box-shadow: none; background: var(--surface); }
body.routras-shell-ready .production-detail-body > :is(.blocked-note, .inline-media-frame, .image-preview-grid) { margin: 16px 20px; }

body.routras-shell-ready .routras-shell-main {
  background: var(--surface);
}

body.routras-shell-ready .routras-shell-main > main {
  width: 100%;
  max-width: var(--workspace-width);
  min-width: 0;
  margin-inline: auto;
  padding: var(--workspace-gutter);
  padding-bottom: 48px;
  background: transparent;
}

body.routras-shell-ready main :is(h1, h2, h3) { text-wrap: balance; }
body.routras-shell-ready main p { text-wrap: pretty; }
body.routras-shell-ready main :is(.status-cell, .instance-facts, .admin-metric, .inline-summary, .billing-summary) {
  font-variant-numeric: tabular-nums;
}

/* Headings and filters share the same edges on every category. */
body.routras-shell-ready main > :is(.production-toolbar, .asset-heading) {
  min-height: 0;
  padding: 0 0 24px;
  border: 0;
  gap: 16px;
  flex-wrap: wrap;
}

body.routras-shell-ready :is(.production-title, .asset-heading) h1 {
  font-size: 24px;
  font-weight: 650;
  line-height: 1.35;
}

body.routras-shell-ready :is(.production-title, .asset-heading) p {
  max-width: 72ch;
  margin-top: 6px;
  line-height: 1.65;
  color: var(--text-secondary);
}

body.routras-shell-ready main > :is(.production-filters, .asset-toolbar, .profile-filter-toolbar) {
  min-height: 56px;
  margin: 0 0 24px;
  padding: 4px 16px;
  border: 1px solid var(--border);
  border-radius: var(--workspace-radius);
  background: var(--surface);
  gap: 12px;
  flex-wrap: wrap;
}

/* The active rule sits inside the tab strip, over its one-pixel baseline. */
body.routras-shell-ready .view-tabs {
  display: flex;
  position: relative;
  min-width: 0;
  max-width: 100%;
  height: 48px;
  flex-wrap: nowrap;
  border: 0;
  box-shadow: inset 0 -1px var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
body.routras-shell-ready .view-tabs::-webkit-scrollbar { display: none; }
body.routras-shell-ready .view-tabs .view-tab { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
body.routras-shell-ready .view-tab.active::after { bottom: 0; height: 3px; }
body.routras-shell-ready main > :is(.production-filters, .asset-toolbar):has(.view-tabs) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.routras-shell-ready :is(.production-filters, .asset-toolbar) > .view-tabs { flex: 1 1 auto; padding: 0; }
body.routras-shell-ready .asset-main > .asset-toolbar .asset-search { height: 40px; flex: 0 1 280px; border-radius: var(--control-radius); }
body.routras-shell-ready .asset-main > .asset-toolbar .asset-search input { height: 100%; min-height: 0; }

/* Enhanced selects keep the same row footprint as the native controls. */
body.routras-shell-ready .section-actions > .routras-select { width: 134px; flex: 0 1 134px; }
body.routras-shell-ready .section-head > .routras-select { width: 160px; flex: 0 0 160px; }
body.routras-shell-ready .account-filter-bar > .routras-select { width: 150px; flex: 0 1 150px; }
body.routras-shell-ready .admin-toolbar > .routras-select { width: 160px; flex: 0 1 160px; }
body.routras-shell-ready .admin-toolbar > .admin-search { height: 40px; }
body.routras-shell-ready .admin-toolbar > .admin-search input { height: 100%; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
body.routras-shell-ready .asset-main { container: asset-layout / inline-size; }
body.routras-shell-ready .asset-main > .profile-filter-toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 40px;
  padding: 12px 16px;
  gap: 8px;
  overflow: visible;
}
body.routras-shell-ready .profile-filter-toolbar > .routras-select { width: 100%; min-width: 0; }
body.routras-shell-ready .profile-filter-toolbar .routras-select-trigger { padding-inline: 10px 30px; font-size: 12px; }

@container asset-layout (max-width: 800px) {
  body.routras-shell-ready .asset-main > .profile-filter-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)) 40px; }
  body.routras-shell-ready #profile-filter-reset { grid-column: 4; grid-row: 1 / 3; align-self: start; }
}
@container asset-layout (max-width: 480px) {
  body.routras-shell-ready .asset-main > .profile-filter-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)) 40px; }
  body.routras-shell-ready #profile-filter-reset { grid-column: 3; grid-row: 1 / 4; }
}

/* One height within each action row, including enhanced native selects. */
body.routras-shell-ready :is(.toolbar-actions, .filter-fields, .section-actions, .source-toolbar, .asset-toolbar, .billing-toolbar, .profile-filter-toolbar, .admin-toolbar, .account-filter-bar, .history-toolbar) {
  --row-control-height: 40px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

body.routras-shell-ready :is(.toolbar-actions, .filter-fields):has(> label:not(.compact-select)) {
  align-items: flex-end;
}

body.routras-shell-ready main .command-button:not(.compact) {
  min-height: 40px;
  border-radius: var(--control-radius, 6px);
}

body.routras-shell-ready :is(.toolbar-actions, .filter-fields, .section-actions, .source-toolbar, .asset-toolbar, .billing-toolbar, .profile-filter-toolbar, .admin-toolbar, .account-filter-bar, .history-toolbar)
  :is(.command-button, .icon-button, .table-icon, input:not([type="checkbox"]):not([type="radio"]), select:not([multiple]), .routras-select, .routras-select-trigger):not(.routras-select-native):not(.routras-close-button) {
  min-height: var(--row-control-height);
  height: var(--row-control-height);
  margin-block: 0;
}

body.routras-shell-ready :is(.toolbar-actions, .filter-fields, .section-actions, .source-toolbar, .asset-toolbar, .billing-toolbar, .profile-filter-toolbar, .admin-toolbar, .account-filter-bar, .history-toolbar) .routras-select {
  --routras-select-height: var(--row-control-height) !important;
}

body.routras-shell-ready :is(.toolbar-actions, .filter-fields) :is(.icon-button, .table-icon):not(.routras-close-button) {
  width: var(--row-control-height);
  flex-shrink: 0;
}

body.routras-shell-ready table .toolbar-actions,
body.routras-shell-ready .instance-footer .toolbar-actions {
  --row-control-height: 36px;
}

body.routras-shell-ready main .command-button.compact { min-height: 36px; }
body.routras-shell-ready .compact-select {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  width: 240px;
  max-width: 100%;
  min-height: 40px;
}
body.routras-shell-ready .compact-select > span:not(.routras-select),
body.routras-shell-ready .toolbar-actions > label > span:not(.routras-select) { white-space: nowrap; }
body.routras-shell-ready .voice-policy-row { align-items: flex-end; flex-wrap: wrap; }
body.routras-shell-ready .voice-policy-row > label { min-width: 0; flex: 0 1 360px; }
body.routras-shell-ready .voice-policy-row > small { display: flex; align-items: center; align-self: flex-end; min-height: 40px; margin: 0; }
body.routras-shell-ready .voice-policy-row :is(.routras-select, .routras-select-trigger) { height: 40px; min-height: 40px; --routras-select-height: 40px !important; }

body.routras-shell-ready :is(.setting-grid, .form-grid, .admin-form-grid, .account-settings-form)
  :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select:not([multiple]), .routras-select-trigger):not(.routras-select-native) {
  height: 40px;
  min-height: 40px;
  border-radius: var(--control-radius, 6px);
}

body.routras-shell-ready :is(.setting-grid, .form-grid, .admin-form-grid) { gap: 20px 16px; }
body.routras-shell-ready .dialog-actions .command-button { min-height: 40px; }

/* Existing section boundaries become quiet, independent panels. */
body.routras-shell-ready .access-columns { border: 0; }
body.routras-shell-ready main > :is(.pipeline-band, .work-section, .history-section, .access-band, .billing-section, .automation-history),
body.routras-shell-ready .access-columns > .access-band {
  min-width: 0;
  margin-bottom: var(--workspace-gap);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--workspace-radius);
  background: var(--surface);
}

body.routras-shell-ready main > .history-section { padding: 0; }
body.routras-shell-ready :is(.history-view-head, .history-toolbar) { padding: 18px var(--workspace-panel-gutter); flex-wrap: wrap; }
body.routras-shell-ready .history-section .history-table-wrap {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 0 var(--workspace-radius) var(--workspace-radius);
}
body.routras-shell-ready .history-section :is(th, td):first-child { padding-left: var(--workspace-panel-gutter); }
body.routras-shell-ready .history-section :is(th, td):last-child { padding-right: var(--workspace-panel-gutter); }
body.routras-shell-ready .history-section h2 { font-size: 16px; }
body.routras-shell-ready .section-head { gap: 16px; flex-wrap: wrap; }
body.routras-shell-ready .section-head > div { min-width: 0; max-width: 100%; }
body.routras-shell-ready .section-head h2 { line-height: 1.5; }
body.routras-shell-ready .section-head p { line-height: 1.65; color: var(--text-secondary); }
body.routras-shell-ready :is(.heading-with-summary, .inline-summary) { flex-wrap: wrap; gap: 12px; }
body.routras-shell-ready .table-wrap { max-width: 100%; border-radius: var(--workspace-radius); }
/* A framed table shares its panel edge; only cell contents receive a gutter. */
body.routras-shell-ready :is(.access-band, .compute-section, .billing-section) > .table-wrap {
  width: calc(100% + 2 * var(--workspace-panel-gutter));
  max-width: none;
  margin-inline: calc(-1 * var(--workspace-panel-gutter));
  border-inline: 0;
  border-radius: 0;
}
body.routras-shell-ready :is(.access-band, .compute-section, .billing-section) > .table-wrap:last-child {
  margin-bottom: calc(-1 * var(--workspace-panel-gutter));
  border-bottom: 0;
  border-radius: 0 0 var(--workspace-radius) var(--workspace-radius);
}
body.routras-shell-ready :is(.access-band, .compute-section, .billing-section) > .table-wrap :is(th, td):first-child { padding-left: var(--workspace-panel-gutter); }
body.routras-shell-ready :is(.access-band, .compute-section, .billing-section) > .table-wrap :is(th, td):last-child { padding-right: var(--workspace-panel-gutter); }
body.routras-shell-ready main :is(th, td) { padding-block: 12px; }
body.routras-shell-ready .access-band > .setting-grid { padding: 8px 0 0; }
body.routras-shell-ready .billing-summary { margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--workspace-radius); background: var(--surface); }
body.routras-shell-ready .billing-toolbar { padding: 0 0 24px; border: 0; flex-wrap: wrap; }
body.routras-shell-ready .billing-records { border: 1px solid var(--border); border-radius: var(--workspace-radius); background: var(--surface); }
body.routras-shell-ready .billing-records > .billing-record-panel { padding: var(--workspace-panel-gutter); border: 0; }
body.routras-shell-ready .asset-grid { padding-inline: 0; border: 0; gap: 20px; }
body.routras-shell-ready .automation-grid { padding: 0; margin-bottom: 24px; border: 0; gap: 20px; }

/* Compute: separate account, instance status, facts and actions. */
body.routras-shell-ready .compute-layout { min-width: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; container: compute-layout / inline-size; }
body.routras-shell-ready .compute-section,
body.routras-shell-ready .managed-instance-band {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--workspace-radius);
  background: var(--surface);
}
body.routras-shell-ready .compute-section { padding: 24px; }
body.routras-shell-ready .account-section th:first-child { width: 28%; }
body.routras-shell-ready .account-section th:last-child { width: 340px; }
body.routras-shell-ready .account-section .toolbar-actions { flex-wrap: nowrap; justify-content: flex-end; }
body.routras-shell-ready .table-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--control-radius, 6px);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}
body.routras-shell-ready .table-icon > svg { display: block; width: 18px; height: 18px; }
body.routras-shell-ready .table-icon:hover { color: var(--accent-dark); background: var(--accent-soft); }
body.routras-shell-ready .table-icon.danger { color: var(--danger); }
body.routras-shell-ready .table-icon:disabled { opacity: .5; cursor: default; }

/* Destructive actions keep their red palette in every theme and control family. */
body :is(.command-button, .table-icon, .asset-action, .task-action, .ui-button, .btn, .ct-page .btn, .creation-tools-dialog .btn):is(.danger, .danger-subtle, .admin-danger-button) {
  color: var(--danger);
  border: 1px solid var(--danger);
  background: var(--surface, #fff);
  box-shadow: none;
}
body :is(.command-button, .table-icon, .asset-action, .task-action, .ui-button, .btn, .ct-page .btn, .creation-tools-dialog .btn):is(.danger, .danger-subtle, .admin-danger-button):hover:not(:disabled) {
  color: var(--danger-hover);
  border-color: var(--danger-hover);
  background: var(--surface, #fff);
}
body :is(.command-button, .table-icon, .asset-action, .task-action, .ui-button, .btn, .ct-page .btn, .creation-tools-dialog .btn):is(.danger, .danger-subtle, .admin-danger-button):active:not(:disabled) {
  color: var(--danger-active);
  border-color: var(--danger-active);
}
body :is(.command-button, .table-icon, .asset-action, .task-action, .ui-button, .btn, .ct-page .btn, .creation-tools-dialog .btn):is(.danger, .danger-subtle, .admin-danger-button):focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
  box-shadow: none;
}
body :is(.command-button, .table-icon, .asset-action, .task-action, .ui-button, .btn, .ct-page .btn, .creation-tools-dialog .btn):is(.danger, .danger-subtle, .admin-danger-button) > :is(span, svg) { color: inherit; }
body.routras-shell-ready .secret-input > div .table-icon { width: 32px; height: 32px; margin-left: -36px; border: 0; background: transparent; }
body.routras-shell-ready #provider-credential-status { margin: 0 22px; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
body.routras-shell-ready #provider-credential-status:empty { display: none; }
body.routras-shell-ready .managed-instance-head { padding: 22px 24px; flex-wrap: wrap; }
body.routras-shell-ready .managed-instance-head > div:first-child { flex: 1 1 320px; min-width: 0; }
body.routras-shell-ready .instance-title-row h2 { font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
body.routras-shell-ready .managed-instance-head .node-meta { line-height: 1.65; }
body.routras-shell-ready .recycle-alert { margin: 0 24px 16px; padding: 14px 16px; border: 1px solid #ead7a2; border-radius: var(--workspace-radius); }
body.routras-shell-ready .recycle-alert.critical { border-color: #efb6b1; }
body.routras-shell-ready .recycle-alert span { line-height: 1.65; }
body.routras-shell-ready .instance-setup { margin: 0 24px 20px; padding: 16px; border: 1px solid var(--border); border-radius: var(--workspace-radius); gap: 16px; }
body.routras-shell-ready .instance-setup-icon { width: 36px; height: 36px; }
body.routras-shell-ready .instance-setup-copy small { line-height: 1.65; }
body.routras-shell-ready .instance-facts { padding: 18px 24px; gap: 16px; border-top: 1px solid var(--border); background: var(--surface); }
body.routras-shell-ready .instance-facts > div { min-width: 0; min-height: 52px; padding: 0; border: 0; }
body.routras-shell-ready .instance-facts strong { margin-top: 8px; line-height: 1.6; }
body.routras-shell-ready .instance-footer { padding: 16px 24px; flex-wrap: wrap; gap: 16px; }
body.routras-shell-ready .instance-footer .toolbar-actions { margin-left: auto; justify-content: flex-end; }
body.routras-shell-ready .node-band { min-width: 0; margin-top: 20px; padding: 0; border: 1px solid var(--border); border-radius: var(--workspace-radius); background: var(--surface); }
body.routras-shell-ready .node-band .node-head { padding: 18px 20px; flex-wrap: wrap; }
body.routras-shell-ready .node-band .node-head > div:first-child { min-width: 0; flex: 1 1 240px; }
body.routras-shell-ready .node-band .node-head .toolbar-actions { margin-left: auto; }
body.routras-shell-ready .node-band .node-reservation { margin: 0 20px 16px; }
body.routras-shell-ready .node-band > .binding-table { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--workspace-radius) var(--workspace-radius); }

/* Group labels are quieter than the navigation links below them. */
body.routras-shell-ready .routras-secondary-links .creation-secondary-group { color: #7a858e; font-weight: 500; }

/* Multi-section dialogs use one complete boundary per independent section. */
body.routras-shell-ready .publishing-dialog .admin-supply-section { margin: 0 0 20px; padding: 0; gap: 0; border: 1px solid var(--border); border-radius: var(--workspace-radius); background: var(--surface); }
body.routras-shell-ready .admin-supply-section > .section-head { margin: 0; padding: 18px 20px; border: 0; }
body.routras-shell-ready .admin-supply-section > .admin-inline-form { margin: 0; padding: 0 20px 20px; border: 0; }
body.routras-shell-ready .admin-supply-section > .table-wrap { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--workspace-radius) var(--workspace-radius); }

@container compute-layout (max-width: 1100px) {
  body.routras-shell-ready .instance-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.routras-shell-ready .instance-footer > span { flex-basis: 100%; }
}

/* List/detail workspaces keep their original panes, scrolling and controls. */
body.routras-shell-ready main > .production-workspace {
  border: 1px solid var(--border);
  border-radius: var(--workspace-radius);
  background: var(--surface);
}
body.routras-shell-ready .production-workspace > .queue-pane { border-bottom: 0; }
body.routras-shell-ready :is(.font-stage, .font-band) { border-bottom: 0; }
/* Intelligence uses its original full-height project/list/detail workspace. */
body.routras-shell-ready .routras-shell-main > main.management-shell { max-width: none; margin: 0; padding: 0; }
body.routras-shell-ready :is(.admin-panel, .admin-metrics, .admin-table-wrap) { border-radius: var(--workspace-radius); background: var(--surface); }
body.routras-shell-ready .admin-view { border: 0; }
body.routras-shell-ready .admin-toolbar { border-radius: var(--workspace-radius) var(--workspace-radius) 0 0; }
body.routras-shell-ready .admin-toolbar + .admin-table-wrap { border-radius: 0 0 var(--workspace-radius) var(--workspace-radius); }
body.routras-shell-ready .admin-nav-row { min-height: 76px; }

/* Publishing lists share one panel, with a single content gutter. */
body.routras-shell-ready .publishing-main > .publishing-view {
  padding: var(--workspace-panel-gutter);
  border: 1px solid var(--border);
  border-radius: var(--workspace-radius);
  background: var(--surface);
}
body.routras-shell-ready .publishing-view > .section-head { margin: 0; align-items: center; }
body.routras-shell-ready .publishing-view > .section-head h2 { margin: 0; }
body.routras-shell-ready .publishing-view > .section-head .section-actions { min-width: 0; max-width: 100%; }
body.routras-shell-ready .publishing-view > .account-filter-bar { margin: 0; padding: 0; border: 0; }
body.routras-shell-ready .publishing-view > .table-wrap {
  width: calc(100% + 2 * var(--workspace-panel-gutter));
  max-width: none;
  margin-inline: calc(-1 * var(--workspace-panel-gutter));
  border-inline: 0;
  border-radius: 0;
}
body.routras-shell-ready .publishing-view > .table-wrap:last-child {
  margin-bottom: calc(-1 * var(--workspace-panel-gutter));
  border-bottom: 0;
  border-radius: 0 0 var(--workspace-radius) var(--workspace-radius);
}
body.routras-shell-ready .publishing-view > .table-wrap :is(th, td):first-child { padding-left: var(--workspace-panel-gutter); }
body.routras-shell-ready .publishing-view > .table-wrap :is(th, td):last-child { padding-right: var(--workspace-panel-gutter); }
/* These publishing surfaces use the shared page width without an outer panel. */
body.routras-shell-ready .publishing-main > .publishing-view:is(#accounts, #resources, #automation-workspace, #receipts) {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.routras-shell-ready .publishing-view:is(#accounts, #resources, #receipts) > .table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--workspace-radius);
}
body.routras-shell-ready .publishing-view:is(#accounts, #resources, #receipts) > .table-wrap :is(th, td):first-child { padding-left: 16px; }
body.routras-shell-ready .publishing-view:is(#accounts, #resources, #receipts) > .table-wrap :is(th, td):last-child { padding-right: 16px; }
body.routras-shell-ready .publishing-view > .resource-workspace {
  width: calc(100% + 2 * var(--workspace-panel-gutter));
  margin-inline: calc(-1 * var(--workspace-panel-gutter));
  margin-bottom: calc(-1 * var(--workspace-panel-gutter));
  border-inline: 0;
  border-bottom: 0;
  border-radius: 0 0 var(--workspace-radius) var(--workspace-radius);
}
body.routras-shell-ready #devices > .section-head .section-actions > :is(.command-button, .routras-select, .routras-select .routras-select-trigger) { height: 40px; min-height: 40px; }
body.routras-shell-ready .social-shop-toolbar { padding: 16px 24px; gap: 16px; }
body.routras-shell-ready .social-shop-tabs { align-items: center; }
body.routras-shell-ready .social-shop-toolbar :is(.command-button, .routras-select, .routras-select-trigger) { height: 40px; min-height: 40px; --routras-select-height: 40px !important; }
body.routras-shell-ready .social-shop-toolbar > label { min-width: 0; }

/* Creation headings use the application's text hierarchy and control radius. */
body.routras-shell-ready :is(.ct-page, .creation-tools-dialog) {
  --ink: var(--text);
  --muted: var(--text-secondary);
  --line: var(--border);
  --soft: var(--surface-subtle);
  --radius: var(--control-radius, 6px);
}
body.routras-shell-ready .ct-page :is(h1, h2, h3) { color: var(--text); }
body.routras-shell-ready .ct-page :is(.ct-home-head, .page-head) h1 { font-size: 24px; font-weight: 650; line-height: 1.35; }
body.routras-shell-ready .ct-home-section { border: 0; }
body.routras-shell-ready .ct-home-preserved { padding-top: 0; }
body.routras-shell-ready .ct-home-section-head h2 { font-size: 16px; font-weight: 650; }
body.routras-shell-ready :is(.ct-home-card, .ct-home-preserved-grid > a) { color: var(--text); border-color: var(--border); }
body.routras-shell-ready :is(.ct-home-card, .ct-home-preserved-grid) h3 { font-size: 14px; font-weight: 600; }
body.routras-shell-ready :is(.ct-home-card, .ct-home-preserved-grid) p { color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
body.routras-shell-ready .ct-page .breadcrumb,
body.routras-shell-ready .ct-page .breadcrumb span:last-child,
body.routras-shell-ready .ct-page .field-label { color: var(--text-secondary); }
body.routras-shell-ready :is(.ct-home-card-icon, .ct-home-group-icon, .ct-home-preserved-grid > a > span) { color: var(--accent-dark); }
body.routras-shell-ready :is(.resource-entry-card, .resource-workspace, .flow-card, .asset-card, .automation-card),
body.routras-shell-ready .ct-page :is(.panel, .btn, .tag, .ct-home-card, .ct-home-card-icon, .ct-home-group-icon, .ct-home-preserved-grid > a),
body.routras-shell-ready :is(.settings-dialog, .creation-tools-dialog) { border-radius: var(--control-radius, 6px); }

/* Aggregate collection stages, not a percentage for the entire product. */
body.routras-shell-ready .pipeline-band .section-head { margin-bottom: 28px; }
body.routras-shell-ready .pipeline-scroll { padding: 6px 0 12px; overflow-x: auto; overflow-y: hidden; }
body.routras-shell-ready .pipeline { min-width: max(100%, 1000px); display: flex; gap: 0; }
body.routras-shell-ready .pipeline-node { flex: 1 0 100px; min-width: 100px; padding-inline: 4px; }
body.routras-shell-ready .node-icon { width: 40px; height: 40px; margin-bottom: 12px; border: 1px solid var(--border); color: var(--text-muted); }
body.routras-shell-ready .node-icon svg { width: 18px; height: 18px; }
body.routras-shell-ready .pipeline-node:not(:last-child)::after { display: block; top: 20px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; background: var(--border); }
body.routras-shell-ready .pipeline-node.success:has(+ .pipeline-node.success)::after { background: var(--accent); }
body.routras-shell-ready .pipeline-node.success .node-icon { border-color: var(--accent); background: var(--accent); color: white; }
body.routras-shell-ready .pipeline-node.running .node-icon { border: 2px solid var(--accent); color: var(--accent-dark); box-shadow: 0 0 0 4px var(--accent-soft); }
body.routras-shell-ready .pipeline-node.running .node-icon::after { display: none; }
body.routras-shell-ready .pipeline-node.failed .node-icon { border-color: var(--danger); color: var(--danger); background: #fff3f2; }
body.routras-shell-ready .pipeline-node.waiting .node-icon { border-style: dashed; border-color: var(--accent-border); color: var(--accent-dark); }
body.routras-shell-ready .node-label { min-height: 40px; font-size: 12px; line-height: 1.6; align-items: start; }
body.routras-shell-ready .node-meta { font-variant-numeric: tabular-nums; }
body.routras-shell-ready .pipeline-node .node-meta { font-size: 11px; line-height: 1.7; }
body.routras-shell-ready .pipeline-node.running .node-label { color: var(--accent-dark); }
body.routras-shell-ready .pipeline-note { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
body.routras-shell-ready .node-activity { display: block; color: var(--accent-dark); }
body.routras-shell-ready .node-failures { display: block; color: var(--danger); }

@media (max-width: 1250px) {
  body.routras-shell-ready .managed-instance-head .toolbar-actions { width: 100%; justify-content: flex-end; }
  body.routras-shell-ready main > .production-workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  body.routras-shell-ready .routras-command-bar { height: auto; min-height: 56px; flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  body.routras-shell-ready .routras-command-project { min-width: 0; flex: 1 1 0; max-width: none; }
  body.routras-shell-ready .routras-command-actions { min-width: 0; max-width: 100%; flex: 1 0 100%; overflow: visible; flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 720px) {
  body.routras-shell-ready .compact-select { width: 100%; }
  body.routras-shell-ready .voice-policy-row { align-items: stretch; }
  body.routras-shell-ready .voice-policy-row > label { flex: none; width: 100%; }
  body.routras-shell-ready .voice-policy-row > small { align-self: stretch; min-height: 0; }
  body.routras-shell-ready .table-wrap .empty-row td { text-align: left; }
}

@media (max-width: 760px) {
  body.routras-shell-ready .asset-heading-actions { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  body.routras-shell-ready .asset-heading-actions > .asset-summary { flex-basis: 100%; margin-bottom: 6px; }
  body.routras-shell-ready .asset-main > .asset-toolbar > .view-tabs { flex: none; }
  body.routras-shell-ready .asset-main > .asset-toolbar .asset-search { width: 100%; flex: none; }
}

@media (max-width: 680px) {
  .studio-header:has(.routras-command-actions) { height: auto; min-height: 66px; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  :root { --workspace-gutter: 16px; --workspace-gap: 20px; --workspace-panel-gutter: 16px; }
  body.routras-shell-ready main > :is(.pipeline-band, .work-section, .access-band, .billing-section, .automation-history),
  body.routras-shell-ready .access-columns > .access-band,
  body.routras-shell-ready .compute-section { padding: 20px 16px; }
  body.routras-shell-ready .managed-instance-head { padding: 20px 16px; }
  body.routras-shell-ready .recycle-alert { margin-inline: 16px; }
  body.routras-shell-ready .instance-setup { margin-inline: 16px; grid-template-columns: 36px minmax(0, 1fr); }
  body.routras-shell-ready .instance-setup-action { grid-column: 1 / -1; justify-self: stretch; }
  body.routras-shell-ready .instance-setup-action .command-button { width: 100%; }
  body.routras-shell-ready .instance-facts { padding: 20px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.routras-shell-ready .instance-footer { padding: 16px; }
  body.routras-shell-ready .instance-footer .toolbar-actions { justify-content: flex-start; width: 100%; }
  body.routras-shell-ready :is(.history-view-head, .history-toolbar) { padding: 16px; }
  body.routras-shell-ready .social-shop-toolbar { padding-inline: 16px; }
}

/* The automation editor is also embedded inside the publishing page. */
body:not(.embedded) > .studio-header,
body:not(.embedded) > .studio-main {
  width: 100%;
  max-width: var(--workspace-width);
  margin-inline: auto;
  padding-inline: var(--workspace-gutter);
}
body:not(.embedded) > .studio-header { min-height: 80px; height: auto; padding-block: 20px; flex-wrap: wrap; }
body:not(.embedded) > .studio-main > .studio-tabs { padding-inline: 0; }
body:not(.embedded) > .studio-main > [data-studio-view="library"] { padding-inline: 0; padding-top: 24px; }
.studio-header .ui-button,
.studio-main .filter-bar :is(input, .routras-select-trigger),
.studio-main .filter-bar .routras-select { min-height: 40px; --routras-select-height: 40px !important; }
