:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d9dee7;
  --brand: #285f7f;
  --brand-dark: #1f465c;
  --accent: #17becf;
  --error: #c62828;
  --warning: #b7791f;
  --info: #4169a8;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 66px;
  --page-head-height: 0px;
  --issue-tabs-height: 0px;
  --filter-height: 0px;
  --issue-panel-head-height: 0px;
  --table-head-gap: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.45 var(--font-ui);
  font-variant-ligatures: none;
  font-synthesis: none;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sidebar-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: var(--sidebar-width);
  padding: 18px 14px;
  background: #1f2933;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  transition: width 160ms ease, padding 160ms ease;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) {
  width: var(--sidebar-collapsed-width);
  padding-inline: 10px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.brand {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 2px 4px;
  color: #fff;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 188px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-logo-collapsed {
  display: none;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 auto;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) .brand-logo-full {
  display: none;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) .brand-logo-collapsed {
  display: block;
}

.sidebar-toggle-button {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 30px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin: 4px 0 2px;
  border: 1px solid #46586a;
  border-radius: 6px;
  color: #dce3ea;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.sidebar-toggle-button:hover {
  background: #334250;
}

.sidebar-toggle-button::before {
  content: "";
  display: block;
  width: 16px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 5px 0 0 rgba(220, 227, 234, 0.32);
}

.sidebar-toggle-icon {
  position: absolute;
  right: 5px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg);
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) .sidebar-toggle-button {
  display: inline-flex;
  align-self: center;
  margin-inline: auto;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) .sidebar-toggle-button::before {
  box-shadow: inset -5px 0 0 rgba(220, 227, 234, 0.32);
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) .sidebar-toggle-icon {
  left: 5px;
  right: auto;
  transform: rotate(135deg);
}

nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}

nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: #dce3ea;
  padding: 9px 10px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-weight: 560;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
}

nav a.active,
nav a:hover {
  background: #334250;
  color: #fff;
  text-decoration: none;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) nav a {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) nav a span {
  display: none;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) nav a::before {
  content: attr(data-short);
  display: inline-flex;
  width: 32px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(220, 227, 234, 0.26);
  border-radius: 7px;
  background: rgba(220, 227, 234, 0.08);
  color: currentColor;
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
  opacity: 0.9;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) nav a.active::before {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.14);
}

.nav-sub-item {
  padding-left: 22px !important;
  font-size: 13px;
  opacity: 0.85;
}

nav a[data-has-sub] {
  position: relative;
  padding-right: 32px;
}

nav .subnav-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

nav .subnav-toggle::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  opacity: 0.55;
  transition: transform 160ms ease, opacity 160ms ease;
}

nav a[data-has-sub="open"] .subnav-toggle::before {
  transform: rotate(90deg);
  opacity: 0.75;
}

.nav-separator {
  height: 1px;
  margin: 7px 4px;
  background: rgba(220, 227, 234, 0.2);
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) .nav-separator {
  margin-inline: 8px;
}

.app-credit {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(220, 227, 234, 0.15);
  color: #7e8fa0;
  font-size: 11px;
  line-height: 1.5;
  font-family: var(--font-ui);
  transition: opacity 120ms ease;
}

.app-credit-line {
  margin-bottom: 5px;
}

.app-credit-version {
  display: block;
  text-align: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(220, 227, 234, 0.15);
  font-size: 11px;
  font-weight: 600;
  color: #8ec3d8;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}

.app-credit-version:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  text-decoration: none;
}

.app-credit a {
  color: #8ec3d8;
  text-decoration: none;
}

.app-credit a:hover {
  color: #fff;
  text-decoration: underline;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) .app-credit {
  opacity: 0;
}

.main {
  margin-left: var(--sidebar-width);
  min-width: 0;
  padding-bottom: 48px;
  transition: margin-left 160ms ease;
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) ~ .main {
  margin-left: var(--sidebar-collapsed-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 10px 24px;
  background: rgba(246, 247, 249, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.search,
.filter {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 36px;
}

.page-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel);
}

.filter {
  position: sticky;
  top: calc(var(--page-head-height) + var(--issue-tabs-height));
  z-index: 2;
  background: var(--panel);
  border-bottom: var(--table-head-gap) solid var(--panel);
  box-shadow:
    inset 0 -1px 0 var(--line),
    0 2px 6px rgba(15, 23, 42, 0.06);
}

th {
  position: sticky;
  top: calc(var(--page-head-height) + var(--issue-tabs-height) + var(--filter-height));
  z-index: 1;
  background: #eef2f6;
  color: #394756;
  font-weight: 650;
  white-space: nowrap;
}


input:not([type="checkbox"]):not([type="radio"]),
select,
button {
  -webkit-appearance: none;
  appearance: none;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0;
  box-sizing: border-box;
}

a.button {
  display: inline-flex;
  height: 36px;
  align-items: center;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
}

input:not([type="checkbox"]):not([type="radio"]) {
  width: min(520px, 100%);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 0;
  border-color: var(--brand);
}

button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

button.secondary:hover:not(:disabled) {
  background: #f0f4f8;
  border-color: #b0bcc8;
  color: var(--text);
}

a.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

button.danger {
  background: #b42318;
  border-color: #b42318;
}

.page-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 24px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--panel);
}

.page-head-title {
  min-width: 0;
}

.page-head h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.page-head .page-head-title > button {
  margin-top: 12px;
}

.page-head .search {
  flex-shrink: 0;
}

.page-head .search input {
  width: 320px;
}

.copy-status {
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px 24px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.metric {
  display: block;
  padding: 14px;
  color: var(--text);
}

.metric span {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
}

.grid {
  display: grid;
  gap: 16px;
  padding: 14px 24px;
}

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

.panel {
  margin: 14px 24px;
  overflow: hidden;
}

.grid .panel {
  margin: 0;
}

/* Prevent tables inside compact panels from being clipped by panel overflow */
.panel table {
  min-width: 0;
  table-layout: auto;
}

/* Disable sticky headers in panels without table-wrap — sticky + z-index causes overlap there */
.panel:not(.table-wrap) th {
  position: static;
  top: auto;
  z-index: auto;
}

.panel td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.issues-table .panel-head {
  position: sticky;
  top: calc(var(--page-head-height) + var(--issue-tabs-height) + var(--filter-height));
  z-index: 2;
  background: var(--panel);
}

.issues-table th {
  top: calc(var(--page-head-height) + var(--issue-tabs-height) + var(--filter-height) + var(--issue-panel-head-height));
}

.filter {
  padding: 14px 24px 33px;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: var(--muted);
  white-space: nowrap;
}

.check-inline input,
td input[type="checkbox"] {
  width: auto;
  height: auto;
  padding: 0;
}

.issue-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.muted-row {
  opacity: 0.55;
}

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

.settings-grid .panel {
  margin: 0;
}

.license-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

details.panel > summary { list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }

.nodes-show-label,
.nodes-hide-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 5px;
  padding: 3px 10px;
  white-space: nowrap;
}

details.panel[open] .nodes-show-label { display: none; }
details.panel:not([open]) .nodes-hide-label { display: none; }

.gamma-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: #0f766e;
  color: #f0fdfa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 4px;
}

/* Dashboard left column stacking */
.dash-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.dash-left .panel {
  margin: 0;
}

/* Donut chart */
.donut-wrap {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 16px;
}

.donut-svg-cell {
  flex: 0 0 auto;
}

.donut-svg {
  width: 180px;
  height: 180px;
  display: block;
}

.donut-num {
  font-size: 17px;
  font-weight: 700;
  fill: var(--text);
}

.donut-sub {
  font-size: 9px;
  fill: var(--muted);
}

.donut-legend {
  flex: 1 1 auto;
  min-width: 0;
  box-shadow: none;
  background: transparent;
}

.donut-legend th,
.donut-legend td {
  padding: 4px 6px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.donut-legend tfoot td {
  border-top: 2px solid var(--line);
  border-bottom: none;
}

.donut-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
}

.donut-legend th:first-child,
.donut-legend td:first-child {
  width: 1px;
  white-space: nowrap;
}

.donut-arc {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.donut-ack {
  color: #065f46;
  font-weight: 700;
}

.snap-delta {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 44px;
}

.snap-better { color: #065f46; }
.snap-worse  { color: #c62828; }
.snap-neutral { color: var(--muted); font-weight: 400; }

.snap-caption {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 16px 10px;
  margin: 0;
}

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

.profile-detail-cell {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 10px;
  align-items: baseline;
  min-width: 0;
}

.profile-detail-full {
  grid-column: span 2;
  grid-template-columns: min-content 1fr;
}

.profile-detail-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.profile-detail-value {
  font-size: 12px;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.changelog-body { font-size: 14px; line-height: 1.65; }
.changelog-body h1 { font-size: 22px; margin: 0 0 8px; }
.changelog-body h2 { font-size: 17px; margin: 28px 0 8px; }
.changelog-body h3 { font-size: 14px; margin: 16px 0 6px; color: var(--muted); }
.changelog-body small { font-size: 12px; font-weight: 400; color: var(--muted); }
.changelog-body hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.changelog-body ul { margin: 6px 0 10px 0; padding-left: 20px; }
.changelog-body li { margin: 3px 0; }
.changelog-body p { margin: 0 0 10px; }
.changelog-body code { padding: 1px 5px; border-radius: 4px; background: #e8edf3; font-size: 12px; }

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f0f2f5;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon-btn:hover {
  border-color: var(--line);
  background: #f0f4f8;
  color: var(--text);
}

.input-action-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.input-action-row input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.license-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.license-badge-unlicensed {
  background: #fef3c7;
  color: #92400e;
}

.settings-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.settings-form label {
  display: grid;
  gap: 6px;
}

.settings-form label span,
.status-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.settings-form input {
  width: min(720px, 100%);
}

.settings-form select {
  width: min(360px, 100%);
}

.settings-short-field {
  max-width: 380px;
}

.settings-import-field {
  width: min(560px, 100%);
}

.settings-import-field input,
.settings-import-field select {
  width: 100%;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-row input {
  width: auto;
}

.settings-import-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
  cursor: pointer;
}

.settings-import-toggle > input[type="checkbox"] {
  grid-column: 1;
  width: auto;
  margin: 0;
  align-self: center;
}

.settings-import-toggle > span {
  grid-column: 2;
  display: inline-block;
}

.settings-import-toggle > span + span {
  display: inline-block;
  margin-left: 12px;
  margin-top: 0;
  vertical-align: middle;
  white-space: normal !important;
  max-width: calc(100% - 120px);
  text-overflow: ellipsis;
  overflow: hidden;
}

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

.inline-form {
  display: inline;
}

.muted {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
}

.settings-muted {
  padding-top: 0;
}

.settings-data-actions {
  padding: 0 16px 16px;
}

.node-conductor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin: 20px;
}

.node-conductor-input,
.node-conductor-align {
  margin: 0;
}

.node-conductor-input > summary,
.node-conductor-align > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.node-conductor-align .settings-form {
  padding-top: 14px;
}

.node-conductor-align-actions {
  display: grid;
  grid-template-columns: max-content minmax(190px, 360px);
  gap: 6px 12px;
  align-items: center;
  justify-content: start;
}

.node-conductor-algorithm-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  align-self: end;
}

.node-conductor-align-actions select {
  width: 100%;
}

.layout-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 32, 0.68);
}

.layout-preview-panel {
  position: relative;
  z-index: 1;
  background: var(--bg);
}

.layout-preview-panel.expanded {
  position: fixed;
  inset: 5vh 5vw;
  z-index: 41;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: #151515;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
}

.layout-preview-panel.collapsed .layout-preview-shell {
  display: none;
}

body.layout-preview-open {
  overflow: hidden;
}

.layout-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  color: var(--muted);
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.layout-preview-meta strong {
  color: var(--text);
}

.layout-preview-meta > div:first-child {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.layout-preview-panel.expanded .layout-preview-meta {
  flex: 0 0 auto;
  border-top: 0;
  background: #1f2933;
}

.layout-preview-panel.expanded .layout-preview-meta strong {
  color: #fff;
}

.layout-preview-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.layout-preview-panel-actions button {
  min-width: 32px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.layout-preview-panel-actions button:hover {
  background: #eef3f7;
}

.layout-preview-shell {
  position: relative;
  height: calc(100vh - 170px);
  min-height: 560px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #1f1f1f;
}

.layout-preview-panel.expanded .layout-preview-shell {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  border-top: 0;
}

.layout-preview-toolbar {
  position: fixed;
  left: calc(var(--sidebar-width) + 24px);
  bottom: 18px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  background: rgba(31, 41, 51, 0.92);
  color: #fff;
  backdrop-filter: blur(8px);
}

.layout-preview-panel.expanded .layout-preview-toolbar {
  left: calc(5vw + 16px);
  bottom: calc(5vh + 16px);
}

.sidebar-toggle:not(:checked) + .sidebar:not(:hover) ~ .main .layout-preview-toolbar {
  left: calc(var(--sidebar-collapsed-width) + 24px);
}

.layout-preview-toolbar button {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px;
  background: #285f7f;
  color: #fff;
  font-weight: 700;
}

.layout-preview-toolbar button:hover {
  background: #1f465c;
}

.layout-preview-toolbar span {
  min-width: 48px;
  padding: 0 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #d7e0ea;
}

.layout-preview-stage {
  position: relative;
  overflow: hidden;
  background-color: #202020;
  background-image:
    linear-gradient(#303030 3px, transparent 3px),
    linear-gradient(90deg, #303030 3px, transparent 3px),
    linear-gradient(#292929 1px, transparent 1px),
    linear-gradient(90deg, #292929 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 20px 20px, 20px 20px;
}

.layout-preview-links {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.layout-preview-link {
  fill: none;
  stroke: #58d382;
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0.92;
}

.layout-preview-link.failed {
  stroke: #ff4545;
}

.layout-preview-node {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(47, 47, 47, 0.96);
  color: #f5f5f5;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 12px 32px rgba(0,0,0,0.2);
}

.layout-preview-node header {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  color: #050505;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.layout-preview-node header span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.layout-preview-node.action header {
  background: #58cc7c;
}

.layout-preview-node.output header {
  background: #ff4141;
}

.layout-preview-node.condition header {
  background: #59b6cf;
}

.layout-preview-node.trigger header {
  background: #cba442;
}

.layout-preview-ports {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0 4px;
  font-size: 16px;
  line-height: 1.45;
}

.layout-preview-output-ports {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.layout-preview-port {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.layout-preview-port.trigger {
  padding-left: 20px;
}

.layout-preview-port.trigger i {
  position: absolute;
  left: -13px;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 18px solid #d8dde3;
}

.layout-preview-output-ports .layout-preview-port {
  padding-right: 20px;
}

.layout-preview-output-ports i {
  position: absolute;
  right: -13px;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 18px solid #d8dde3;
}

.layout-preview-settings {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px 8px;
  color: #ddd;
}

.layout-preview-settings::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: #8a8f96;
}

.layout-preview-node dl {
  margin: 0;
  padding: 8px 40px 0;
}

.layout-preview-node dt {
  font-size: 15px;
  color: #fff;
}

.layout-preview-node dd {
  margin: 2px 0 0;
  color: #d8d8d8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-hardware-id {
  padding: 0;
}

.status-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
  padding: 16px;
  margin: 0;
}

.status-list dd {
  margin: 0;
  min-width: 0;
}

.manual-content {
  padding: 16px;
}

.manual-content p,
.manual-content ol {
  max-width: 980px;
  margin: 0 0 12px;
}

.manual-content p:last-child,
.manual-content ol:last-child {
  margin-bottom: 0;
}

.manual-content li {
  margin: 6px 0;
  padding-left: 2px;
}

.manual-grid .status-list {
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
}

.notice {
  padding: 14px 16px;
}

.error-notice {
  border-color: #f0b8b8;
  color: var(--error);
  background: #fff5f5;
}

.log-output {
  margin: 0;
  padding: 16px;
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #111827;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  top: 22px;
  left: calc(50% + var(--sidebar-width) / 2);
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(480px, calc(100vw - 44px));
  padding: 13px 18px;
  font-size: 15px;
  border: 1px solid #d0dae4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
  font-weight: 650;
}

.toast[hidden] {
  display: none;
}

.artifact-list {
  display: grid;
}

.artifact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.artifact-row:hover {
  background: #f8fafc;
}

.artifact-row strong,
.artifact-row small {
  display: block;
}

.artifact-row small,
.artifact-meta {
  color: var(--muted);
}

.artifact-meta {
  flex: 0 0 auto;
}

.table-wrap {
  background: var(--panel);
  overflow: visible;
}

table {
  width: 100%;
  min-width: max-content;
  background: var(--panel);
  border-collapse: collapse;
  box-shadow: 0 0 0 1px var(--line);
}

th,
td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th[draggable="true"] {
  cursor: grab;
  user-select: none;
}

th.column-dragging {
  cursor: grabbing;
  opacity: 0.55;
}

th.column-drop-left {
  box-shadow: inset 3px 0 0 var(--brand);
}

th.column-drop-right {
  box-shadow: inset -3px 0 0 var(--brand);
}

.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
}

.column-grip {
  width: 8px;
  height: 18px;
  flex: 0 0 8px;
  opacity: 0.45;
  background-image: radial-gradient(currentColor 1px, transparent 1.5px);
  background-position: 0 0;
  background-size: 4px 4px;
}

.column-resize {
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  z-index: 4;
  width: 12px;
  cursor: col-resize;
  touch-action: none;
}

.column-resize::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 5px;
  bottom: 8px;
  width: 1px;
  background: #b8c2ce;
  opacity: 0;
}

th:hover .column-resize::after,
th.column-resizing .column-resize::after {
  opacity: 1;
}

th.column-resizing,
th.column-resizing * {
  cursor: col-resize;
}

td {
  min-width: 96px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

tr:target {
  scroll-margin-top: calc(
    var(--page-head-height) +
    var(--issue-tabs-height) +
    var(--filter-height) +
    var(--issue-panel-head-height) +
    72px
  );
  background: #fff7d6;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th.num {
  width: 1px;
}

td.num {
  min-width: 0;
  white-space: nowrap;
}

th.col-fit,
td.col-fit {
  width: 1px;
  white-space: nowrap;
}

td.col-fit {
  min-width: 0;
}

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

.severity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.severity.error {
  color: #fff;
  background: var(--error);
}

.severity.deprecated {
  color: #7a271a;
  background: #ffd6d1;
}

.severity.compatibility {
  color: #23405c;
  background: #cfe8ff;
}

.severity.warning {
  color: #1f2933;
  background: #f6c85f;
}

.severity.orphan {
  color: #3b235c;
  background: #dcc7f8;
}

.severity.old-wildcard,
.severity.old.wildcard {
  color: #1e3a5f;
  background: #bfdbfe;
}

.severity.dynamic-reference {
  color: #164538;
  background: #bfebd8;
}

.severity.info {
  color: #fff;
  background: var(--info);
}

.issue-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 24px 20px;
  position: sticky;
  top: var(--page-head-height);
  z-index: 2;
  background: var(--panel);
}

.issue-tabs a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.issue-tabs a.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 24px 28px;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.pagination span {
  color: var(--muted);
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #e8edf3;
}

.workflow-progress {
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}

.workflow-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--brand);
  border-radius: inherit;
  animation: workflow-progress-slide 1.4s ease-in-out infinite;
}

@keyframes workflow-progress-slide {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(175%); }
  100% { transform: translateX(175%); }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) {
    width: auto;
    padding: 18px 14px;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) .brand-logo-full {
    display: block;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) .brand-logo-collapsed {
    display: none;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) .sidebar-toggle-button {
    display: inline-flex;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) nav a {
    justify-content: flex-start;
    padding: 9px 10px;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) nav a span {
    display: inline;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) nav a::before {
    content: none;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) .app-credit {
    opacity: 1;
  }

  .main {
    margin-left: 0;
  }

  .sidebar-toggle:not(:checked) + .sidebar:not(:hover) ~ .main {
    margin-left: 0;
  }

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

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

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

}
