:root {
  color-scheme: dark;
  --bg: #020503;
  --panel: rgba(4, 14, 8, 0.84);
  --panel-strong: rgba(3, 10, 6, 0.92);
  --panel-soft: rgba(8, 22, 13, 0.72);
  --border: rgba(88, 255, 150, 0.2);
  --border-strong: rgba(88, 255, 150, 0.45);
  --text: #dbffe6;
  --muted: #73b78a;
  --accent: #5cff96;
  --accent-strong: #b0ffca;
  --accent-soft: rgba(92, 255, 150, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --max-width: 1680px;
  --hero-title-shadow: 0 0 18px rgba(92, 255, 150, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, rgba(10, 40, 20, 0.42), transparent 42%), var(--bg);
  color: var(--text);
  font-family: Inter, "SFMono-Regular", "Roboto Mono", "Menlo", monospace;
}

body {
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.fx-layer,
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.fx-layer {
  z-index: 0;
  width: 100%;
  height: 100%;
}

.fx-layer.is-hidden {
  display: none;
}

.noise-layer {
  z-index: 1;
  opacity: 0.08;
  background-image: linear-gradient(transparent 0%, rgba(92, 255, 150, 0.12) 50%, transparent 100%);
  background-size: 100% 5px;
  mix-blend-mode: screen;
}

body.theme-kami {
  --bg: #f4efe4;
  --panel: rgba(255, 250, 241, 0.82);
  --panel-strong: rgba(250, 244, 232, 0.94);
  --panel-soft: rgba(241, 235, 223, 0.76);
  --border: rgba(54, 72, 98, 0.22);
  --border-strong: rgba(49, 70, 101, 0.46);
  --text: #1f2937;
  --muted: #556476;
  --accent: #355c87;
  --accent-strong: #234261;
  --accent-soft: rgba(53, 92, 135, 0.12);
  --shadow: 0 24px 72px rgba(98, 78, 44, 0.12);
  --hero-title-shadow: none;
  color-scheme: light;
}

body.theme-kami {
  background:
    radial-gradient(circle at top, rgba(122, 147, 177, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.98), rgba(244, 239, 228, 0.98));
}

.theme-kami .fx-layer {
  filter: sepia(0.28) hue-rotate(145deg) saturate(0.38) brightness(1.06);
  opacity: 0.08;
}

.theme-kami .noise-layer {
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: linear-gradient(transparent 0%, rgba(66, 108, 153, 0.06) 50%, transparent 100%);
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
}

.sidebar,
.main-content {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding-right: 4px;
}

.hero-block,
.panel,
.toolbar,
.prompt-card,
.metric-box,
.summary-item,
.detail-drawer {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-block {
  margin-bottom: 16px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(5, 18, 9, 0.9), rgba(2, 9, 5, 0.82));
}

.panel {
  background: var(--panel);
}

.search-panel,
.summary-panel,
.wall-shell,
.scene-shell {
  padding: 16px;
}

.search-panel,
.summary-panel {
  margin-bottom: 16px;
}

.eyebrow,
.panel-kicker,
.status-label,
.detail-category,
.field-label,
.metric-label,
.card-meta,
.empty-state,
.detail-empty {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
}

.eyebrow,
.panel-kicker {
  letter-spacing: 0.04em;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1;
  text-shadow: var(--hero-title-shadow);
}

h2 {
  font-size: clamp(1.05rem, 1.4vw, 1.45rem);
  margin-bottom: 0;
}

.hero-copy,
.summary-item p,
.prompt-card p,
.detail-summary,
.markdown-body p,
.markdown-body li,
.markdown-body blockquote {
  color: #b5f2c6;
}

.hero-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-box {
  padding: 14px;
  background: rgba(4, 16, 9, 0.72);
}

.metric-label {
  display: block;
  margin-bottom: 6px;
}

.metric-box strong,
.toolbar strong {
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}

#searchInput {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 7, 3, 0.8);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(92, 255, 150, 0.05);
}

#searchInput::placeholder {
  color: #4f8c63;
}

.filter-list,
.tag-row,
.summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-list {
  margin-top: 14px;
}

.filter-chip,
.tag-chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(5, 19, 10, 0.86);
  color: var(--text);
}

.filter-chip {
  padding: 8px 12px;
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  box-shadow: 0 0 18px rgba(92, 255, 150, 0.16);
}

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

.summary-item {
  width: 100%;
  padding: 12px;
  background: rgba(8, 23, 13, 0.7);
}

.summary-item h3 {
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 0.98rem;
}

.summary-item p {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.summary-item p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.main-content {
  min-width: 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(2, 13, 7, 0.74);
  flex-wrap: wrap;
}

.toolbar-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-note {
  color: var(--muted);
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(4, 15, 8, 0.84);
}

.mode-button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.mode-button.is-active {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.wall-shell {
  background: var(--panel-strong);
}

.scene-shell {
  margin-bottom: 16px;
  background:
    radial-gradient(circle at top left, rgba(92, 255, 150, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(4, 15, 9, 0.96), rgba(2, 9, 5, 0.92));
}

.scene-shell-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.scene-shell-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.scene-viewport-frame {
  position: relative;
  min-height: 72vh;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(92, 255, 150, 0.18);
  background:
    linear-gradient(180deg, rgba(1, 8, 4, 0.88), rgba(1, 5, 3, 0.96)),
    radial-gradient(circle at center, rgba(92, 255, 150, 0.06), transparent 48%);
}

.scene-viewport {
  display: block;
  width: 100%;
  height: 72vh;
}

.scene-connections,
.scene-network {
  position: absolute;
  inset: 0;
}

.scene-connections {
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.scene-link {
  stroke: rgba(125, 255, 177, 0.5);
  stroke-width: 0.18;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px rgba(125, 255, 177, 0.55));
}

.scene-network {
  z-index: 2;
  perspective: 1400px;
  transform-style: preserve-3d;
  will-change: transform;
}

.scene-node {
  position: absolute;
  width: min(260px, 24vw);
  min-width: 180px;
  transform:
    translate3d(-50%, -50%, var(--node-z))
    rotateX(var(--node-rx))
    rotateY(var(--node-ry))
    scale(var(--node-scale));
  transform-style: preserve-3d;
  border-radius: 8px;
  border: 1px solid rgba(92, 255, 150, 0.28);
  background: linear-gradient(180deg, rgba(5, 18, 9, 0.92), rgba(3, 10, 6, 0.88));
  color: var(--text);
  text-align: left;
  padding: 14px;
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.36),
    0 0 18px rgba(92, 255, 150, 0.12);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  will-change: transform;
}

.scene-node strong,
.scene-node span {
  display: block;
}

.scene-node strong {
  margin: 6px 0 8px;
  color: #e8fff1;
  font-size: 0.96rem;
  line-height: 1.3;
}

.scene-node span:last-child {
  color: #9dd9b0;
  font-size: 0.76rem;
  line-height: 1.45;
}

.scene-node-kicker {
  color: #73b78a;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.scene-node.is-active {
  border-color: rgba(176, 255, 202, 0.9);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(92, 255, 150, 0.26);
  filter: saturate(1.05) brightness(1.06);
}

.scene-node:hover {
  border-color: rgba(176, 255, 202, 0.72);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.42),
    0 0 20px rgba(92, 255, 150, 0.2);
  filter: brightness(1.04);
}

.theme-kami .hero-copy,
.theme-kami .summary-item p,
.theme-kami .prompt-card p,
.theme-kami .detail-summary,
.theme-kami .markdown-body p,
.theme-kami .markdown-body li,
.theme-kami .markdown-body blockquote {
  color: #435468;
}

.theme-kami .hero-block {
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(245, 238, 226, 0.88));
}

.theme-kami .metric-box,
.theme-kami .summary-item,
.theme-kami .toolbar,
.theme-kami .mode-toggle,
.theme-kami #searchInput,
.theme-kami .prompt-card,
.theme-kami .scene-node,
.theme-kami .detail-drawer,
.theme-kami .scene-legend {
  background-color: rgba(255, 251, 244, 0.84);
}

.theme-kami #searchInput {
  box-shadow: inset 0 0 0 1px rgba(66, 108, 153, 0.08);
  color: #1f2937;
}

.theme-kami .filter-chip,
.theme-kami .tag-chip {
  background: rgba(255, 249, 241, 0.9);
  color: #35506f;
  border-color: rgba(49, 70, 101, 0.18);
}

.theme-kami .card-ghost {
  color: rgba(49, 81, 115, 0.18);
}

.theme-kami .scene-link {
  stroke: rgba(66, 108, 153, 0.36);
  filter: drop-shadow(0 0 4px rgba(66, 108, 153, 0.22));
}

.theme-kami .scene-node,
.theme-kami .prompt-card {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(244, 238, 229, 0.92));
}

.theme-kami .scene-node strong,
.theme-kami .scene-node span:last-child,
.theme-kami .card-headline h3,
.theme-kami .metric-box strong,
.theme-kami .toolbar strong,
.theme-kami .summary-item h3,
.theme-kami .markdown-body h1,
.theme-kami .markdown-body h2,
.theme-kami .markdown-body h3,
.theme-kami .markdown-body h4 {
  color: #234261;
}

.theme-kami .scene-node-kicker,
.theme-kami .eyebrow,
.theme-kami .panel-kicker,
.theme-kami .status-label,
.theme-kami .detail-category,
.theme-kami .field-label,
.theme-kami .metric-label,
.theme-kami .card-meta,
.theme-kami .empty-state,
.theme-kami .detail-empty {
  color: #5c6e81;
}

.theme-kami .status-dot,
.theme-kami .legend-dot {
  background: #426c99;
  box-shadow: 0 0 10px rgba(66, 108, 153, 0.32);
}

.theme-kami .scene-shell,
.theme-kami .wall-shell {
  background:
    radial-gradient(circle at top left, rgba(95, 125, 162, 0.06), transparent 34%),
    linear-gradient(180deg, rgba(252, 247, 238, 0.95), rgba(245, 238, 227, 0.92));
}

.theme-kami #searchInput::placeholder {
  color: #6a7c8f;
}

.theme-kami .filter-chip.is-active,
.theme-kami .mode-button.is-active {
  color: #1f3652;
  border-color: rgba(49, 70, 101, 0.42);
  background: rgba(53, 92, 135, 0.1);
}

.theme-kami .mode-button,
.theme-kami .drawer-dismiss,
.theme-kami .drawer-close,
.theme-kami .copy-button {
  color: #35506f;
}

.theme-kami .mode-button:hover,
.theme-kami .drawer-dismiss:hover,
.theme-kami .drawer-close:hover,
.theme-kami .copy-button:hover {
  border-color: rgba(49, 70, 101, 0.38);
}

.theme-kami .summary-item p:last-child,
.theme-kami .toolbar-note,
.theme-kami .scene-shell-meta,
.theme-kami .scene-node span:last-child,
.theme-kami .markdown-body a,
.theme-kami .markdown-body blockquote,
.theme-kami .markdown-body :not(pre) > code {
  color: #4f6276;
}

.theme-kami .card-meta,
.theme-kami .tag-chip,
.theme-kami .scene-node-kicker,
.theme-kami .metric-label,
.theme-kami .panel-kicker,
.theme-kami .status-label {
  color: #52667c;
}

.scene-legend {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(92, 255, 150, 0.18);
  background: rgba(3, 12, 7, 0.8);
  color: #c7ffda;
  backdrop-filter: blur(10px);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #7dffaf;
  box-shadow: 0 0 12px rgba(125, 255, 175, 0.9);
}

.wall-header {
  margin-bottom: 16px;
}

.drawer-dismiss,
.drawer-close,
.copy-button {
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
  cursor: pointer;
}

.card-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
  perspective: 1600px;
}

.prompt-card {
  width: 100%;
  text-align: left;
  background: linear-gradient(180deg, rgba(4, 17, 9, 0.9), rgba(3, 12, 6, 0.82));
  color: var(--text);
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  will-change: transform, opacity;
}

.prompt-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(92, 255, 150, 0.06), transparent 30%);
  pointer-events: none;
}

.prompt-card:hover,
.prompt-card:focus-visible {
  border-color: var(--border-strong);
  outline: none;
}

.prompt-card.is-active {
  border-color: var(--accent);
}

.prompt-card-inner {
  position: relative;
  padding: 16px;
  z-index: 1;
}

.card-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-headline h3 {
  margin-bottom: 0;
  color: var(--accent-strong);
  font-size: 1rem;
}

.card-ghost {
  color: rgba(176, 255, 202, 0.3);
  font-size: 1.2rem;
  line-height: 1;
}

.prompt-card p {
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.detail-drawer {
  position: fixed;
  top: 20px;
  right: 20px;
  width: min(560px, calc(100vw - 40px));
  height: calc(100vh - 40px);
  z-index: 5;
  padding: 18px;
  background: rgba(2, 11, 6, 0.95);
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  will-change: opacity;
}

.detail-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
}

.detail-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.drawer-header,
.drawer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.drawer-actions {
  flex-shrink: 0;
}

.detail-summary {
  margin: 12px 0 14px;
}

.tag-chip {
  padding: 5px 9px;
  font-size: 0.8rem;
  color: #cffff0;
}

.is-hidden {
  display: none;
}

.markdown-body {
  margin-top: 18px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 22px 0 10px;
  line-height: 1.2;
  color: var(--accent-strong);
}

.markdown-body pre {
  overflow-x: auto;
  background: rgba(0, 8, 4, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.markdown-body code {
  font-family: "SFMono-Regular", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
}

.markdown-body :not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(92, 255, 150, 0.08);
  color: #d2ffdf;
}

.markdown-body blockquote {
  margin: 14px 0;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body a {
  color: #b2ffd0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 20px;
}

.empty-state {
  padding: 48px 12px;
  text-align: center;
}

.scene-2d .prompt-card:hover,
.scene-2d .prompt-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(92, 255, 150, 0.18);
}

.scene-3d .prompt-card:hover,
.scene-3d .prompt-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(92, 255, 150, 0.18);
}

.scene-3d .hero-block,
.scene-3d .panel,
.scene-3d .toolbar,
.scene-3d .detail-drawer {
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5), 0 0 20px rgba(92, 255, 150, 0.08);
}

.scene-3d .app-shell {
  width: 100%;
  max-width: none;
  padding: 0;
  display: block;
}

.scene-3d .sidebar {
  display: none;
}

.scene-3d .main-content {
  position: static;
}

.scene-3d .toolbar {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 4;
  margin-bottom: 0;
  background: rgba(3, 12, 7, 0.82);
  border-color: rgba(92, 255, 150, 0.18);
  backdrop-filter: blur(16px);
}

.theme-kami.scene-3d .toolbar {
  background: rgba(252, 247, 238, 0.86);
}

.scene-3d .scene-shell {
  position: fixed;
  inset: 0;
  z-index: 3;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.scene-3d .scene-shell-header {
  position: absolute;
  top: 96px;
  left: 24px;
  right: 24px;
  z-index: 2;
  margin: 0;
  pointer-events: none;
}

.scene-3d .scene-shell-meta {
  text-shadow: 0 0 16px rgba(92, 255, 150, 0.24);
}

.scene-3d .scene-viewport-frame {
  min-height: 100vh;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.scene-3d .scene-viewport {
  height: 100vh;
  opacity: 0;
  pointer-events: none;
}

.scene-3d .scene-network {
  inset: 112px 24px 104px 24px;
  pointer-events: auto;
}

.scene-3d .scene-legend {
  left: 24px;
  right: auto;
  bottom: 24px;
  max-width: min(560px, calc(100vw - 48px));
  background: rgba(3, 12, 7, 0.58);
  border-color: rgba(92, 255, 150, 0.24);
  pointer-events: none;
}

.scene-3d .noise-layer {
  opacity: 0.14;
}

.scene-3d .wall-shell {
  display: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .detail-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(82vh, 900px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .scene-viewport-frame,
  .scene-viewport {
    min-height: 62vh;
    height: 62vh;
  }

  .scene-node {
    width: min(220px, 30vw);
  }

  .scene-3d .scene-network {
    inset: 126px 18px 98px 18px;
  }

  .scene-3d .toolbar {
    left: 14px;
    right: 14px;
    top: 14px;
  }

  .scene-3d .scene-shell-header {
    top: 108px;
    left: 14px;
    right: 14px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

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

  .toolbar,
  .toolbar-controls,
  .drawer-header,
  .drawer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-toggle {
    width: 100%;
  }

  .mode-button {
    flex: 1;
  }

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

  .scene-shell-header,
  .scene-shell-meta {
    text-align: left;
  }

  .scene-viewport-frame,
  .scene-viewport {
    min-height: 56vh;
    height: 56vh;
  }

  .scene-node {
    width: min(210px, 58vw);
    min-width: 0;
    padding: 12px;
  }

  .scene-node strong {
    font-size: 0.88rem;
  }

  .scene-node span:last-child {
    font-size: 0.72rem;
  }

  .scene-3d .scene-network {
    inset: 150px 12px 86px 12px;
  }

  .scene-3d .scene-shell-header {
    top: 132px;
  }

  .scene-3d .scene-legend {
    left: 12px;
    right: 12px;
    max-width: none;
    bottom: 12px;
  }

  .detail-drawer {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 8px;
    top: auto;
    height: 82vh;
  }
}
