:root {
  --color-blue: #4472c4;
  --color-blue-dark: #345a9e;
  --color-orange: #f59e0b;
  --bg-dark: #0c1929;
  --bg-dark-mid: #132742;
  --bg-dark-deep: #060d18;
  --bg-panel: rgba(16, 31, 52, 0.92);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --cap: #ff6b6b;
  --json: #ffd166;
  --ecp: #31e08b;
  --accent: #67a2ff;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --top-shell-height: 72px;
  --tab-sticky-height: 40px;
  --sticky-offset: calc(var(--top-shell-height) + var(--tab-sticky-height) + 14px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  background: var(--bg-dark);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  scroll-padding-top: var(--sticky-offset);
}

[hidden] {
  display: none !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(circle at 25% 15%, rgba(68, 114, 196, 0.24), transparent 46%),
    radial-gradient(circle at 75% 78%, rgba(19, 39, 66, 0.62), transparent 52%),
    radial-gradient(circle at 84% 22%, rgba(245, 158, 11, 0.08), transparent 40%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

a {
  color: var(--accent);
}

a:hover {
  color: #ffffff;
}

.top-shell {
  position: sticky;
  top: 0;
  z-index: 1200;
  min-height: var(--top-shell-height);
  border-bottom: 1px solid var(--border);
  background: rgba(12, 25, 41, 0.92);
  backdrop-filter: blur(10px);
}

.shell-inner {
  width: min(1080px, 100% - 2rem);
  margin: 0 auto;
  min-height: var(--top-shell-height);
  padding: 0.65rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.brand-logo {
  display: block;
  width: auto;
  height: 46px;
}

.top-nav {
  display: flex;
  gap: 0.85rem;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.2rem;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 0.88rem;
}

.top-nav a:hover {
  color: #ffffff;
  border-bottom-color: var(--color-orange);
}

.studio-main {
  width: min(1080px, 100% - 2rem);
  margin: 0 auto;
  padding: 0.75rem 0 1.2rem;
}

.tab-bar {
  position: sticky;
  top: var(--top-shell-height);
  z-index: 1150;
  margin: 0 0 0.75rem;
  padding: 0.34rem;
  display: flex;
  gap: 0.3rem;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(12, 25, 41, 0.92);
  backdrop-filter: blur(10px);
}

.tab-button {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.62rem;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.tab-button:hover,
.tab-button:focus-visible {
  color: #ffffff;
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.tab-button.tab-button-active,
.tab-button[aria-selected="true"] {
  color: #ffffff;
  border-color: var(--color-blue);
  background: color-mix(in oklab, var(--color-blue) 35%, transparent);
}

.tab-panel {
  display: none;
}

.tab-panel.tab-active {
  display: block;
  scroll-margin-top: var(--sticky-offset);
  position: relative;
  z-index: 1;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.82rem;
}

.card-header h1 {
  margin: 0 0 0.1rem;
  font-size: clamp(1.1rem, 1.9vw, 1.32rem);
  line-height: 1.2;
}

.card-header h2 {
  margin: 0 0 0.2rem;
  font-size: 1.18rem;
}

.card-header p {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

textarea,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.56rem;
  color: var(--text);
  background: rgba(7, 12, 24, 0.95);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.25;
}

textarea {
  resize: vertical;
  min-height: 46px;
  font-family: var(--font-mono);
}

textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(103, 162, 255, 0.7);
  outline-offset: 2px;
}

input[type="range"] {
  width: 100%;
}

.field-help {
  margin: 0.22rem 0 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.feedback {
  margin: 0.3rem 0 0;
  min-height: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.message {
  margin-top: 0.5rem;
  border-radius: 10px;
  padding: 0.58rem 0.65rem;
  border: 1px solid var(--border);
}

.message h3 {
  margin: 0 0 0.32rem;
  font-size: 0.95rem;
}

.message p {
  margin: 0.18rem 0;
}

.message-error {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.55);
}

.status-row {
  margin-top: 0.42rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.badge {
  border-radius: 999px;
  padding: 0.16rem 0.48rem;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-success {
  background: rgba(49, 224, 139, 0.2);
  border-color: rgba(49, 224, 139, 0.56);
  color: #99f4c4;
}

.badge-danger {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.56);
  color: #ffc3c3;
}

.raw-inline {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.28rem;
}

.raw-inline-item {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 32px;
}

.raw-inline-label {
  min-width: 56px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.raw-inline code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #dce8ff;
  overflow-wrap: anywhere;
}

.btn-inline-copy {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.1rem 0.38rem;
  line-height: 1.25;
  cursor: pointer;
}

.btn-inline-copy:hover,
.btn-inline-copy:focus-visible {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.btn-primary,
.btn-secondary {
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0.36rem 0.62rem;
  cursor: pointer;
  font-weight: 700;
  font: inherit;
}

.btn-primary {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #fff;
}

#verify-button {
  padding: 0.3rem 0.56rem;
  font-size: 0.88rem;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-blue-dark);
  border-color: var(--color-blue-dark);
  outline: none;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-light);
  outline: none;
}

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

.inline-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.raw-panels {
  margin-top: 0.42rem;
  display: grid;
  gap: 0.34rem;
}

.raw-panels article {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.38rem 0.44rem;
}

.raw-panels h3,
.nested-card h3,
.size-compare h3 {
  margin: 0 0 0.22rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bit-map {
  font-family: var(--font-mono);
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
}

.bit-map-segment {
  border-radius: 7px;
  border: 1px solid var(--border);
  padding: 0.1rem 0.24rem;
  font-size: 0.74rem;
}

.segment-emergency {
  background: rgba(255, 107, 107, 0.22);
}

.segment-priority {
  background: rgba(103, 162, 255, 0.24);
}

.segment-action {
  background: rgba(255, 209, 102, 0.25);
  color: #f5e6b8;
}

.segment-zone {
  background: rgba(49, 224, 139, 0.2);
}

.segment-time {
  background: rgba(158, 140, 255, 0.2);
}

.segment-confirm {
  background: rgba(255, 139, 213, 0.2);
}

.hex-map {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.hex-byte {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12rem 0.36rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.hex-map .field-mixed {
  background:
    linear-gradient(135deg, rgba(103, 162, 255, 0.25) 0%, rgba(49, 224, 139, 0.25) 100%);
}

.hex-map .field-zone {
  background: rgba(49, 224, 139, 0.2);
}

.hex-map .field-time {
  background: rgba(158, 140, 255, 0.2);
}

.hex-map .field-confirm {
  background: rgba(255, 139, 213, 0.2);
}

.hex-map .field-header {
  background: rgba(68, 114, 196, 0.26);
}

.hex-map .field-payload {
  background: rgba(49, 224, 139, 0.2);
}

.hex-map .field-hmac {
  background: rgba(255, 209, 102, 0.25);
}

.table-wrap {
  margin-top: 0.62rem;
  overflow-x: auto;
}

.decoded-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.decoded-table th,
.decoded-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.35rem;
  font-size: 0.89rem;
}

.decoded-table th {
  color: var(--muted);
  font-weight: 700;
}

.decoded-table code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.field-cell {
  display: flex;
  align-items: center;
  gap: 0.32rem;
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-trigger {
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 1.12rem;
  height: 1.12rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: help;
}

.tooltip-text {
  position: fixed;
  top: 0;
  left: 0;
  width: min(360px, calc(100vw - 1rem));
  max-height: min(260px, calc(100vh - 1rem));
  overflow: auto;
  z-index: 20;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(5, 10, 20, 0.96);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  color: #d9e7ff;
  font-size: 0.78rem;
  line-height: 1.4;
  display: none;
  pointer-events: none;
}

.tooltip-text.open {
  display: block;
}

.envelope-panel {
  margin-top: 0.45rem;
}

.nested-card {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.48rem;
}

.envelope-hmac-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}

.build-layout {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 360px minmax(0, 1fr);
}

.build-controls label,
.build-controls legend {
  display: block;
  margin: 0.46rem 0 0.18rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.build-controls .build-flags {
  margin: 0.45rem 0 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.42rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.22rem 0.55rem;
}

.build-controls .build-flags label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.34rem;
  color: var(--text);
  font-weight: 500;
}

.build-controls .build-flags input {
  width: auto;
  margin: 0;
}

.range-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 0.5rem;
  align-items: center;
}

.build-output {
  min-width: 0;
}

.size-compare {
  margin-top: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.45rem;
}

.size-row {
  margin-top: 0.34rem;
}

.size-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.83rem;
}

.size-track {
  margin-top: 0.15rem;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.size-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 220ms ease;
}

.strategy-row-selected .size-row-head span:first-child {
  color: #e7fff1;
  font-weight: 700;
}

.strategy-row-selected .size-track {
  box-shadow: 0 0 0 1px rgba(49, 224, 139, 0.35) inset;
}

.strategy-bar-selected {
  opacity: 1;
  filter: saturate(1.18);
}

.strategy-bar-muted {
  opacity: 0.36;
}

.size-fill-cap {
  background: var(--cap);
}

.size-fill-json {
  background: var(--json);
}

.size-fill-ecp {
  background: var(--ecp);
}

.compare-layout,
.compare-subgrid {
  display: grid;
  gap: 0.72rem;
}

.compare-layout {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.compare-subgrid {
  margin-top: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-panel {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.55rem;
}

.compare-panel h3 {
  margin: 0 0 0.34rem;
  font-size: 0.9rem;
}

.compare-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-bottom: 0.32rem;
}

.compare-preset-button {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.compare-preset-button.compare-preset-button-active,
.compare-preset-button[aria-pressed="true"] {
  color: #062016;
  border-color: rgba(49, 224, 139, 0.84);
  background: rgba(49, 224, 139, 0.95);
}

.compare-refresh-button {
  opacity: 0.86;
  font-size: 0.74rem;
}

.compare-panel label {
  display: block;
  margin: 0.44rem 0 0.18rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.compare-inline-check {
  margin: 0.42rem 0 0.12rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.compare-inline-check input {
  width: auto;
  margin: 0;
}

.provenance-badge {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.provenance-estimated {
  color: #ffe2a6;
  border: 1px solid rgba(255, 209, 102, 0.5);
  background: rgba(255, 209, 102, 0.14);
}

.compare-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.compare-table th,
.compare-table td {
  padding: 0.38rem 0.3rem;
}

.compare-table th:nth-child(1),
.compare-table td:nth-child(1) {
  width: 22%;
}

.compare-table th:nth-child(2),
.compare-table td:nth-child(2),
.compare-table th:nth-child(3),
.compare-table td:nth-child(3) {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.compare-table th:nth-child(2),
.compare-table td:nth-child(2) {
  width: 14%;
}

.compare-table th:nth-child(3),
.compare-table td:nth-child(3) {
  width: 12%;
}

.compare-table th:nth-child(4),
.compare-table td:nth-child(4) {
  width: 52%;
}

.compare-table td:nth-child(4) {
  line-height: 1.35;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.compare-table .fitness-pill {
  min-width: 50px;
  padding: 0.08rem 0.34rem;
}

.compare-best-badge {
  margin-left: 0.28rem;
  padding: 0.05rem 0.3rem;
  font-size: 0.68rem;
}

.fitness-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.08rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.fitness-best {
  color: #b8ffd9;
  border-color: rgba(49, 224, 139, 0.58);
  background: rgba(49, 224, 139, 0.2);
}

.fitness-good {
  color: #d7e7ff;
  border-color: rgba(103, 162, 255, 0.58);
  background: rgba(103, 162, 255, 0.2);
}

.fitness-ok {
  color: #ffe5b1;
  border-color: rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.2);
}

.fitness-poor {
  color: #ffc3c3;
  border-color: rgba(255, 107, 107, 0.56);
  background: rgba(255, 107, 107, 0.2);
}

.compare-state,
.compare-ratio,
.compare-bandwidth,
.compare-model-note,
.compare-hybrid {
  margin-top: 0.48rem;
  font-size: 0.82rem;
}

.claim-list {
  margin: 0.22rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.22rem;
}

.claim-list li {
  color: var(--muted);
  font-size: 0.84rem;
}

.claim-link {
  margin-left: 0.2rem;
  text-decoration: none;
}

.coverage-table td,
.coverage-table th {
  font-size: 0.84rem;
}

.code-tab-bar {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  position: relative;
  z-index: 3;
  scroll-margin-top: var(--sticky-offset);
}

.code-tab-button {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.code-tab-button[aria-selected="true"] {
  color: #ffffff;
  border-color: var(--color-blue);
  background: color-mix(in oklab, var(--color-blue) 35%, transparent);
}

.generate-scenario-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.generated-pre {
  margin: 0.52rem 0 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  background: rgba(5, 10, 20, 0.96);
}

.generated-pre code {
  font-size: 0.8rem;
  line-height: 1.45;
}

.generated-pre[class*="language-"],
.generated-pre code[class*="language-"] {
  background: transparent;
}

.verify-engine-note {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.verify-results-wrap {
  margin-top: 0.46rem;
}

.verify-star-cta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.verify-star-cta a {
  font-weight: 600;
}

.verify-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.verify-summary {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.verify-summary.success {
  color: #9df7c7;
}

.verify-summary.failure {
  color: #ffc3c3;
}

.verify-results {
  margin: 0.3rem 0 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.12rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.verify-results[hidden] {
  display: none;
}

.verify-subgrid {
  margin-top: 0.78rem;
  display: grid;
  gap: 0.72rem;
  grid-template-columns: minmax(0, 1fr);
}

.verify-subgrid .compare-panel {
  margin-top: 0;
}

.placeholder-card {
  min-height: 300px;
  display: grid;
  place-items: center;
}

.placeholder-body {
  text-align: center;
  max-width: 620px;
}

.placeholder-icon {
  margin: 0 0 0.45rem;
  font-size: 1.75rem;
}

.placeholder-body h2 {
  margin: 0 0 0.3rem;
  font-size: 1.24rem;
}

.placeholder-body p {
  margin: 0.24rem 0;
  color: var(--muted);
}

.studio-footer {
  border-top: 1px solid var(--border);
  margin-top: 1.2rem;
  background: var(--bg-dark-deep);
}

.footer-inner {
  width: min(1080px, 100% - 2rem);
  margin: 0 auto;
  padding: 1.1rem 0;
  display: grid;
  gap: 0.42rem;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.footer-signature {
  margin-top: 0.28rem;
  padding-top: 0.46rem;
  border-top: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.77rem;
  color: #8ea0bb;
}

.footer-signature-link {
  display: inline-flex;
  align-items: center;
}

.footer-signature-logo {
  display: block;
  width: auto;
  height: 16px;
  transform: translateY(1px);
  opacity: 0.9;
}

.footer-inner code {
  font-family: var(--font-mono);
  color: #dce8ff;
}

@media (max-width: 1000px) {
  .build-layout {
    grid-template-columns: 1fr;
  }

  .compare-layout,
  .compare-subgrid,
  .verify-subgrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .shell-inner,
  .studio-main,
  .footer-inner {
    width: min(100% - 1.2rem, 100%);
  }

  .raw-inline-item {
    flex-wrap: wrap;
    align-items: baseline;
  }
}

@media (min-width: 1024px) {
  :root {
    --top-shell-height: 76px;
  }

  .top-shell {
    min-height: var(--top-shell-height);
  }

  .brand-logo {
    height: 50px;
  }

  .tab-bar {
    top: var(--top-shell-height);
  }
}

@media (max-width: 640px) {
  .shell-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav {
    gap: 0.5rem;
  }

  .top-nav a {
    padding: 0.24rem 0.44rem;
  }

  .tab-bar {
    overflow-x: auto;
    padding: 0.28rem;
  }

  .tab-button {
    white-space: nowrap;
  }

  .card {
    padding: 0.85rem;
  }

  .build-controls .build-flags {
    grid-template-columns: 1fr;
  }

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

  .envelope-hmac-controls {
    grid-template-columns: 1fr;
  }

}
