:root {
  --black: #000000;
  --surface-hover: #111111;
  --white: #ffffff;
  --white-80: rgb(255 255 255 / 80%);
  --decorative-dot: #d9d9d9;
  --accent: #00a8ff;
  --success: #62ff8c;
  --danger: #f83d3d;
  --line-outer: var(--white);
  --line-inner: var(--white-80);
  --text-primary: var(--white);
  --text-secondary: var(--white-80);
  --sidebar-width: 250px;
  --header-height: 123px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 10px;
  --space-4: 20px;
  --space-5: 30px;
  --space-6: 40px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--text-primary);
  font-family: Consolas, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea,
code,
pre {
  font: inherit;
}

button,
input,
select,
textarea {
  border: 1px solid var(--line-inner);
  border-radius: 0;
  background: var(--black);
  color: var(--text-primary);
}

button,
select,
input:not([type="checkbox"]):not([type="file"]) {
  min-height: 40px;
}

button {
  padding: 9px 18px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease,
    transform 160ms ease;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-hover);
  color: var(--accent);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

button:active:not(:disabled) {
  transform: scale(.985);
  transition-duration: 60ms;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .45;
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 12px;
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.55;
}

input[type="file"] {
  min-height: 44px;
  padding: 7px;
}

input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 12px;
  border: 0;
  border-right: 1px solid var(--line-inner);
  background: var(--black);
  color: var(--accent);
  font: inherit;
}

select {
  appearance: auto;
}

a {
  color: inherit;
}

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

.service-wordmark,
.page-title,
.login-wordmark {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-composition {
  width: min(560px, calc(100vw - 48px));
}

.login-brand {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.login-mark {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: cover;
}

.login-wordmark {
  color: var(--accent);
  font-size: clamp(54px, 7vw, 72px);
  line-height: .95;
}

.login-panel {
  display: flex;
  min-height: 268px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line-outer);
  padding: 21px 24px 26px;
}

.reachability {
  display: flex;
  width: min(255px, 100%);
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line-inner);
  padding: 10px 12px;
  color: var(--text-secondary);
}

.reachability.is-reachable {
  border-color: rgb(98 255 140 / 80%);
  color: var(--success);
}

.reachability.is-unreachable {
  border-color: rgb(248 61 61 / 80%);
  color: var(--danger);
}

.status-square {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid var(--line-inner);
  background: transparent;
}

.is-reachable .status-square,
.secret-status-row.is-ready .status-square {
  border-color: var(--success);
  background: var(--success);
  animation: status-fade 2s ease-in-out infinite;
}

.is-unreachable .status-square {
  border-color: var(--danger);
  background: var(--danger);
}

.login-fields {
  display: grid;
  gap: 26px;
}

.login-fields input {
  min-height: 40px;
}

.login-fields button {
  min-height: 50px;
  width: 100%;
}

.form-message {
  min-height: 21px;
  margin: -17px 0 0;
  color: var(--danger);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line-outer);
  background: var(--black);
}

.sidebar-brand {
  display: flex;
  min-height: 255px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.brand-mark {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.service-wordmark {
  margin-top: 14px;
  color: var(--accent);
  font-size: 42px;
  line-height: 1;
}

.primary-nav {
  display: grid;
  gap: 3px;
  padding: 30px 11px 0 18px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 221px;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  border-color: transparent;
  padding: 8px 13px 8px 12px;
  text-align: left;
  transform-origin: left center;
}

.nav-item:hover:not(:disabled) {
  transform: scale(1.02);
}

.nav-item.active {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-item.active::before {
  position: absolute;
  left: -19px;
  width: 12px;
  height: 8px;
  background: var(--accent);
  clip-path: polygon(0 25%, 58% 25%, 58% 0, 100% 50%, 58% 100%, 58% 75%, 0 75%);
  content: "";
}

.nav-ordinal {
  color: var(--white-80);
  font-weight: 700;
}

.sidebar-footer {
  display: grid;
  gap: 18px;
  margin-top: auto;
  padding: 24px 30px 30px;
}

.footer-link {
  width: max-content;
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible {
  border: 0;
  background: transparent;
  color: var(--accent);
  transform: none;
}

.main-region {
  min-width: 0;
  grid-column: 2;
}

.page-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-outer);
  padding: 0 30px;
  background: var(--black);
}

.page-title {
  overflow: hidden;
  margin: 0;
  color: var(--accent);
  font-size: clamp(48px, 4.2vw, 80px);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-status {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.status-inline {
  color: var(--success);
}

.status-inline i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  background: currentColor;
}

.workspace {
  padding: 28px 30px 64px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-grid,
.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
}

.card {
  min-width: 0;
  border: 1px solid var(--line-outer);
  background: var(--black);
}

.span-2 {
  grid-column: span 2;
}

.span-4 {
  grid-column: span 4;
}

.metric-card {
  position: relative;
  min-height: 166px;
  padding: 34px 36px 26px;
}

.card-meta {
  position: absolute;
  inset: 8px 9px auto 9px;
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.drag-dots {
  display: none;
}

.metric-card h2,
.card-header h2 {
  margin: 0;
  color: var(--accent);
  font-size: 24px;
  line-height: 1.2;
}

.metric-value {
  margin: 28px 0 0;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
}

.metric-detail {
  margin: 3px 0 0;
  color: var(--text-secondary);
}

.success-text {
  color: var(--success);
}

.metric-line {
  position: absolute;
  inset: auto 0 0;
  height: 8px;
  border-top: 1px solid var(--line-inner);
}

.metric-line span {
  display: block;
  height: 7px;
  background: var(--accent);
}

.metric-line .full {
  width: 100%;
}

.metric-live {
  color: var(--success);
  letter-spacing: .08em;
}

.system-metric-card .metric-value {
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -.04em;
}

.system-metric-card .metric-line span {
  width: 0;
  transition: width 500ms ease;
}

.api-usage-card {
  min-height: 510px;
}

.chart-period {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.usage-dashboard {
  display: grid;
  min-height: 450px;
  grid-template-rows: auto minmax(280px, 1fr);
  gap: 34px;
}

.usage-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-inner);
}

.usage-summary-item {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 22px 24px;
}

.usage-summary-item + .usage-summary-item {
  border-left: 1px solid var(--line-inner);
}

.usage-summary-item > span,
.usage-summary-item small {
  color: var(--text-secondary);
}

.usage-summary-item strong {
  color: var(--accent);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.usage-chart-wrap {
  position: relative;
  min-height: 280px;
}

.usage-chart-legend {
  position: absolute;
  z-index: 1;
  top: -18px;
  right: 0;
  display: flex;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 12px;
}

.usage-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.usage-chart-legend i {
  display: inline-block;
  width: 17px;
  height: 4px;
}

.request-swatch {
  background: rgb(255 255 255 / 45%);
}

.token-swatch {
  background: var(--accent);
}

.usage-chart {
  display: block;
  width: 100%;
  min-height: 280px;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgb(255 255 255 / 16%);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-axis-label {
  fill: var(--text-secondary);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11px;
}

.chart-request-bar {
  fill: rgb(255 255 255 / 23%);
}

.chart-token-line {
  fill: none;
  stroke: var(--accent);
  stroke-linejoin: bevel;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.chart-token-point {
  fill: var(--black);
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-empty {
  position: absolute;
  inset: 50% auto auto 50%;
  margin: 0;
  color: var(--text-secondary);
  text-align: center;
  transform: translate(-50%, -50%);
}

.card-header {
  display: grid;
  min-height: 55px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-inner);
  padding: 9px 13px;
  color: var(--text-secondary);
}

.card-header.no-ordinal {
  grid-template-columns: minmax(0, 1fr) auto;
}

.full-run-grid {
  margin-bottom: 30px;
}

.card-header > span:first-child {
  font-weight: 700;
}

.card-body {
  padding: 30px 38px 38px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.quick-actions > div + div {
  border-left: 1px solid var(--line-inner);
  padding-left: 40px;
}

.quick-actions h3,
.settings-group h3 {
  margin-bottom: 6px;
  font-size: 20px;
}

.quick-actions p,
.settings-group p,
.activity-toolbar p,
.form-hint {
  color: var(--text-secondary);
}

.quick-actions button {
  width: 100%;
  margin-top: 8px;
}

.form-layout {
  display: grid;
  gap: 20px;
}

.form-grid {
  display: grid;
  gap: 20px;
}

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

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

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

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

.field > span,
.static-field > span {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.check-field input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.static-field {
  display: grid;
  min-height: 64px;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line-inner);
  padding: 8px 12px;
}

.static-field strong {
  color: var(--accent);
}

.idempotency-row,
.action-row,
.appearance-row,
.activity-toolbar,
.secret-status-row {
  display: flex;
  align-items: end;
  gap: 20px;
}

.grow {
  flex: 1;
}

.primary-action {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.action-row {
  min-height: 40px;
  flex-wrap: wrap;
}

.action-row .form-hint {
  align-self: center;
}

.response-body {
  padding: 0;
}

.code-output {
  min-height: 190px;
  max-height: 480px;
  overflow: auto;
  margin: 0;
  padding: 20px;
  background: var(--black);
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

#auditRows {
  max-height: 460px;
}

.result-panel {
  min-height: 190px;
}

.empty-state {
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  text-align: center;
}

.result-media {
  display: grid;
  gap: 16px;
}

.result-media img {
  width: 100%;
  max-height: 430px;
  border: 1px solid var(--line-inner);
  object-fit: contain;
  image-rendering: auto;
}

.result-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0;
}

.result-meta dt {
  color: var(--text-secondary);
}

.result-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.download-link {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--accent);
  padding: 8px 18px;
  color: var(--accent);
  text-decoration: none;
}

.documentation-layout {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  align-items: start;
  gap: 30px;
}

.documentation-toc {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  display: grid;
  max-height: calc(100vh - var(--header-height) - 56px);
  gap: 18px;
  overflow: auto;
  padding: 26px 24px;
}

.documentation-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}

.documentation-toc h2 {
  margin: -8px 0 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 28px;
}

.documentation-toc nav {
  display: grid;
  border-top: 1px solid var(--line-inner);
}

.documentation-toc nav a {
  border-bottom: 1px solid rgb(255 255 255 / 24%);
  padding: 9px 0;
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
}

.documentation-toc nav a:hover,
.documentation-toc nav a:focus-visible {
  color: var(--accent);
}

.documentation-document {
  min-width: 0;
}

.documentation-hero {
  border-bottom: 1px solid var(--line-inner);
  padding: 46px 52px 40px;
}

.documentation-hero h1,
.documentation-hero h2 {
  margin: 12px 0 14px;
  color: var(--accent);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(38px, 5vw, 70px);
  line-height: .95;
}

.operations-page {
  padding: 30px;
}

.operations-document {
  display: grid;
  max-width: 1120px;
  gap: 30px;
  margin: 0 auto;
}

.operations-document .documentation-hero .download-link {
  margin-top: 24px;
}

.operations-toc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line-inner);
  background: var(--line-inner);
}

.operations-toc a {
  min-height: 54px;
  padding: 16px;
  background: var(--black);
  color: var(--text-secondary);
  text-decoration: none;
}

.operations-toc a:hover,
.operations-toc a:focus-visible {
  color: var(--accent);
}

.documentation-hero > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.documentation-section {
  padding: 42px 52px;
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.documentation-section + .documentation-section {
  border-top: 1px solid var(--line-inner);
}

.documentation-section h3 {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  color: var(--accent);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 28px;
}

.documentation-section h3 span {
  color: var(--text-secondary);
  font: 700 12px Consolas, "Cascadia Mono", monospace;
}

.documentation-section h4 {
  margin: 30px 0 10px;
  font-size: 17px;
}

.documentation-section p,
.documentation-section li {
  color: var(--text-secondary);
}

.documentation-section p,
.documentation-section ul,
.documentation-section ol {
  max-width: 880px;
}

.documentation-section li + li {
  margin-top: 7px;
}

.documentation-section strong,
.documentation-section code {
  color: var(--text-primary);
}

.documentation-section pre {
  max-width: 100%;
  overflow: auto;
  border: 1px solid rgb(255 255 255 / 35%);
  margin: 16px 0 24px;
  padding: 20px;
  color: var(--text-secondary);
  white-space: pre;
}

.documentation-section table {
  width: 100%;
  margin: 20px 0 26px;
  border-collapse: collapse;
  color: var(--text-secondary);
  text-align: left;
}

.documentation-section th,
.documentation-section td {
  border: 1px solid rgb(255 255 255 / 35%);
  padding: 11px 13px;
  vertical-align: top;
}

.documentation-section th {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.documentation-callout {
  max-width: 880px;
  border-left: 4px solid var(--accent);
  margin: 22px 0;
  padding: 14px 18px;
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.collection-command-bar {
  position: sticky;
  z-index: 20;
  top: calc(var(--header-height) + 1px);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, auto) auto;
  align-items: stretch;
  gap: 12px;
  padding-bottom: 14px;
  background: var(--black);
}

.collection-search,
.collection-information {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line-outer);
  padding: 0 12px;
}

.collection-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.collection-search span {
  color: var(--accent);
}

.collection-search input {
  min-height: 38px !important;
  border: 0;
  padding: 6px 0;
}

.collection-information {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.collection-list {
  margin-top: 0;
}

.stage-card.is-filtered {
  display: none;
}

.settings-group + .settings-group {
  border-top: 1px solid var(--line-inner);
  padding-top: 30px;
}

.secret-status-row {
  min-height: 40px;
  justify-content: space-between;
  border: 1px solid var(--line-inner);
  padding: 9px 12px;
  color: var(--text-secondary);
}

.secret-status-row.is-ready {
  color: var(--success);
}

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

.production-request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.production-pipeline-stack {
  display: grid;
  gap: 30px;
}

.production-pipeline-card {
  width: 100%;
}

.production-pipeline-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.production-pipeline-summary > strong {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

.production-request {
  min-height: 320px;
  color: var(--text-secondary);
  font-size: 12px;
  tab-size: 2;
}

.production-request[readonly] {
  cursor: text;
}

.pipeline-integration {
  border: 1px solid var(--line-inner);
  background: color-mix(in srgb, var(--panel) 92%, var(--accent));
}

.pipeline-integration > summary,
.integration-asset > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.pipeline-integration > summary::-webkit-details-marker,
.integration-asset > summary::-webkit-details-marker {
  display: none;
}

.pipeline-integration > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 14px 18px;
}

.pipeline-integration > summary::before,
.integration-asset > summary::before {
  content: "+";
  color: var(--accent);
  font-family: var(--font-mono);
}

.pipeline-integration[open] > summary::before,
.integration-asset[open] > summary::before {
  content: "−";
}

.pipeline-integration > summary strong {
  margin-right: auto;
  font-size: 14px;
}

.pipeline-integration > summary span {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.pipeline-integration-body {
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--line-inner);
  padding: 20px;
}

.pipeline-integration-body > h3 {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.integration-note {
  margin: 0;
}

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

.integration-asset {
  min-width: 0;
  border: 1px solid var(--line-inner);
  background: var(--panel);
}

.integration-asset > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.integration-asset-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line-inner);
  padding: 14px;
}

.integration-code {
  width: 100%;
  min-height: 360px;
  margin: 0;
  white-space: pre;
}

.device-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.device-toolbar p {
  max-width: 850px;
  margin: 0;
  color: var(--text-secondary);
}

.device-toolbar code {
  color: var(--accent);
}

#deviceCount {
  min-height: auto;
  border: 0;
  padding: 0;
}

.device-list {
  display: grid;
  gap: 12px;
}

.device-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-inner);
  margin: 0;
  color: var(--text-secondary);
}

.device-card {
  border: 1px solid var(--line-inner);
  background: var(--black);
}

.device-card[open] {
  border-color: var(--line-outer);
}

.device-card.is-blocked {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line-inner));
}

.device-card summary {
  display: grid;
  min-height: 64px;
  grid-template-columns: minmax(150px, 1fr) minmax(190px, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
}

.device-card summary::-webkit-details-marker {
  display: none;
}

.device-card summary::before {
  content: "+";
  grid-column: 1;
  grid-row: 1;
  width: 18px;
  color: var(--accent);
  font-size: 18px;
}

.device-card[open] summary::before {
  content: "−";
}

.device-card summary > strong {
  grid-column: 1;
  grid-row: 1;
  padding-left: 30px;
  color: var(--accent);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 18px;
}

.device-card summary > span:not(.device-status) {
  color: var(--text-secondary);
}

.device-status {
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.device-status.is-blocked {
  color: var(--danger);
}

.device-card-body {
  display: grid;
  gap: 24px;
  border-top: 1px solid var(--line-inner);
  padding: 24px 28px 28px;
}

.device-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.device-field {
  display: grid;
  min-height: 72px;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line-inner);
  padding: 12px 14px;
}

.device-field span {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
}

.device-field strong {
  overflow-wrap: anywhere;
}

.device-actions {
  justify-content: flex-end;
}

.danger-action {
  border-color: var(--danger);
  color: var(--danger);
}

#templateFields {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.appearance-row {
  align-items: center;
  flex-wrap: wrap;
}

.color-swatch {
  display: block;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-inner);
  box-shadow: inset 0 0 0 8px var(--black);
  background: var(--accent);
}

#accentColor {
  width: min(326px, 100%);
}

.activity-card {
  min-height: calc(100vh - var(--header-height) - 58px);
}

.activity-toolbar {
  justify-content: space-between;
  margin-bottom: 20px;
}

.activity-toolbar p {
  margin: 0;
}

.log-table {
  max-height: 580px;
  overflow: auto;
  border: 1px solid var(--line-inner);
}

.log-row {
  display: grid;
  min-height: 25px;
  grid-template-columns: 100px minmax(0, 1fr) 100px;
  align-items: start;
  gap: 14px;
  padding: 4px 14px;
}

.log-head {
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--line-inner);
  background: var(--black);
  font-weight: 700;
}

.log-row:not(.log-head) span:nth-child(2) {
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.log-row .success {
  color: var(--success);
}

.log-row .error {
  color: var(--danger);
}

.notice-stack {
  position: fixed;
  z-index: 100;
  top: 20px;
  right: 20px;
  display: grid;
  width: min(460px, calc(100vw - 40px));
  gap: 10px;
}

.notice {
  border: 1px solid var(--line-outer);
  padding: 12px 16px;
  background: var(--black);
}

.notice.success {
  border-color: var(--success);
}

.notice.error {
  border-color: var(--danger);
}

.overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  background: rgb(0 0 0 / 35%);
  backdrop-filter: blur(9px);
}

.dialog {
  width: min(620px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  border: 1px solid var(--line-outer);
  background: var(--black);
}

.dialog-header {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-inner);
  padding: 8px 14px 8px 24px;
}

.dialog-header h2 {
  margin: 0;
  color: var(--accent);
  font-size: 24px;
}

.dialog-header button {
  width: 40px;
  padding: 0;
  font-size: 25px;
}

.dialog-body {
  display: grid;
  gap: 24px;
  padding: 30px 40px 40px;
}

.dialog-body p {
  color: var(--text-secondary);
}

.mobile-menu-button {
  display: none;
}

@keyframes status-fade {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

@media (max-width: 1180px) {
  .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .quick-actions > div + div {
    border-top: 1px solid var(--line-inner);
    border-left: 0;
    padding-top: 20px;
    padding-left: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 100px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-region {
    width: 100%;
  }

  .documentation-layout {
    grid-template-columns: 1fr;
  }

  .documentation-toc {
    position: static;
    max-height: none;
  }

  .operations-toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-menu-button {
    position: fixed;
    z-index: 50;
    top: 10px;
    right: 10px;
    display: block;
  }

  .page-header {
    padding-right: 94px;
  }

  .header-status {
    display: none;
  }

  .dashboard-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-4 {
    grid-column: 1;
  }

  .template-grid {
    grid-template-columns: 1fr;
  }

  .production-request-grid {
    grid-template-columns: 1fr;
  }

  .integration-grid {
    grid-template-columns: 1fr;
  }

  .device-card summary {
    grid-template-columns: minmax(130px, 1fr) auto;
  }

  .device-card summary > span:not(.device-status) {
    display: none;
  }
}

@media (max-width: 680px) {
  .login-brand {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .login-mark {
    width: 82px;
    height: 82px;
  }

  .workspace {
    padding: 20px 16px 48px;
  }

  .page-header {
    height: 92px;
    padding: 0 82px 0 16px;
  }

  .page-title {
    font-size: clamp(36px, 12vw, 54px);
  }

  .card-body,
  .metric-card {
    padding: 24px 20px 28px;
  }

  .pipeline-integration > summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .pipeline-integration > summary span {
    width: 100%;
    padding-left: 22px;
  }

  .usage-summary-grid {
    grid-template-columns: 1fr;
  }

  .usage-summary-item + .usage-summary-item {
    border-top: 1px solid var(--line-inner);
    border-left: 0;
  }

  .usage-dashboard {
    gap: 42px;
  }

  .usage-chart-legend {
    left: 0;
    right: auto;
  }

  .cols-2,
  .cols-3,
  .cols-4 {
    grid-template-columns: 1fr;
  }

  .collection-command-bar {
    top: 92px;
    grid-template-columns: 1fr auto;
  }

  .collection-search {
    grid-column: 1 / -1;
  }

  .idempotency-row,
  .activity-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .device-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .device-fields {
    grid-template-columns: 1fr;
  }

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

  .log-row span:last-child {
    grid-column: 2;
    color: var(--text-secondary);
  }

  .dialog-body {
    padding: 24px 20px 30px;
  }

  .documentation-hero,
  .documentation-section {
    padding: 30px 20px;
  }

  .documentation-section table {
    display: block;
    overflow-x: auto;
  }

  .operations-page {
    padding: 16px;
  }

  .operations-toc {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
