@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --accent: #6b3df0;
  --accent-soft: rgba(240, 236, 255, 0.88);
  --accent-soft-strong: rgba(107, 61, 240, 0.16);
  --text: #262632;
  --muted: #7b7f8c;
  --border: rgba(38, 38, 50, 0.1);
  --border-strong: rgba(38, 38, 50, 0.16);
  --bg: #f9f9fb;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --page-tint: rgba(249, 249, 251, 0.94);
  --background-key: #44e1d8;
  --background-deep: #1ed3ca;
  --danger: #b00020;
  --shadow: none;
  --shadow-soft: none;
  --focus: rgba(107, 61, 240, 0.2);
  --radius-lg: 12px;
  --radius-md: 9px;
  --radius-sm: 8px;
  --max-width: 1520px;
  --section-gap: 26px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  line-height: 1.55;
  background-color: var(--bg);
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-color: var(--bg);
  background-image: url('circe-bg-mirror2x2-v2.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  z-index: 0;
}

body::after {
  display: none;
}

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

a:hover {
  text-decoration: underline;
}

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

img,
svg {
  max-width: 100%;
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 0;
  background: transparent;
}

.header-inner,
.page-shell,
.site-shell,
.footer-inner {
  width: min(var(--max-width), calc(100% - 56px));
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 36px;
  padding: 28px 0 18px;
}

.brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  max-width: 520px;
}

.brand-logo {
  display: block;
  width: min(118px, 28vw);
  height: auto;
  margin: 0 0 10px;
}

.brand-eyebrow {
  display: block;
  margin: -4px 0 6px;
  text-transform: uppercase;
  font-size: 0.98rem;
  letter-spacing: 0.18em;
  color: #000000;
  font-weight: 700;
}

.brand strong {
  font-size: clamp(1.95rem, 4vw, 2.95rem);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  display: block;
  margin-top: 10px;
  color: rgba(38, 38, 50, 0.82);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 34rem;
}

.home-page .brand-logo {
  width: min(132px, 34vw);
}

.home-page .brand strong {
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
}

.site-page .header-inner {
  padding-top: 20px;
}

.site-page .brand-logo {
  width: min(106px, 24vw);
}

.site-page .brand strong {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

.site-page .brand-subtitle {
  font-size: 0.96rem;
}

.header-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  margin-left: auto;
  padding-top: 6px;
  width: min(620px, 100%);
}

.app-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.app-link {
  color: var(--accent);
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.app-link:hover {
  color: #5b2fe0;
  text-decoration: none;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  width: min(620px, 100%);
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  border: 1px solid rgba(107, 61, 240, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.top-nav a[aria-current="page"],
.top-nav a.active {
  background: var(--accent-soft);
  border-color: rgba(107, 61, 240, 0.2);
  color: var(--accent);
  text-decoration: none;
}

.page-shell,
.site-shell {
  position: relative;
  z-index: 1;
  padding: 8px 0 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--section-gap);
  align-content: start;
}

.page-shell > *,
.site-shell > * {
  min-width: 0;
}

.hero,
.panel,
.diagram-card,
.callout,
.step-card,
.note-card,
.quick-link {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hero {
  padding: 28px;
  border-radius: var(--radius-lg);
  margin-bottom: 0;
  display: grid;
  gap: 16px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.95rem, 3.6vw, 3rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions,
.card-grid,
.diagram-grid,
.two-col {
  display: grid;
  gap: 18px;
}

.hero,
.panel,
.section,
.hero-actions,
.card-grid,
.diagram-grid,
.two-col,
.detail-grid,
.file-stack,
.detail-card,
.file-card,
.figure-shell,
.table-wrap,
.jump-links,
.viewer-layout,
.viewer-main,
.viewer-nav {
  min-width: 0;
}

.hero-actions {
  margin-top: 0;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.card-grid,
.diagram-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.two-col {
  grid-template-columns: 1.3fr 0.9fr;
  align-items: start;
}

.quick-link,
.step-card,
.note-card,
.diagram-card {
  display: block;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.quick-link:hover,
.button-link:hover {
  text-decoration: none;
}

.quick-link h2,
.panel h2,
.step-card h3,
.diagram-card h3,
.note-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.25;
}

.quick-link p,
.step-card p,
.diagram-card p,
.note-card p,
.panel p,
.panel li {
  color: var(--muted);
}

.section {
  margin-top: 0;
}

.section-title {
  margin: 0 0 12px;
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
}

.panel > :first-child {
  margin-top: 0;
}

.panel > :last-child {
  margin-bottom: 0;
}

.callout {
  padding: 22px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
}

.callout strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.kicker {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--accent);
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 16px;
}

.step-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
}

.step-num {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(107, 61, 240, 0.18);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.92rem;
}

.check-list,
.plain-list {
  margin: 14px 0 0;
  padding-left: 18px;
}

.check-list li + li,
.plain-list li + li {
  margin-top: 8px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

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

th {
  background: rgba(240, 236, 255, 0.45);
  color: var(--text);
  font-weight: 700;
}

code,
pre {
  font-family: Consolas, 'SFMono-Regular', Monaco, monospace;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(240, 236, 255, 0.72);
  color: var(--text);
}

pre {
  margin: 0;
  white-space: pre-wrap;
}

.figure-shell {
  position: relative;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.99);
  padding: 16px;
  overflow: auto;
}

.figure-shell::before {
  display: none;
}

.figure-shell > * {
  position: relative;
}

.figure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.button-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.button-link:hover,
.button:hover {
  border-color: rgba(107, 61, 240, 0.3);
  background: rgba(240, 236, 255, 0.45);
}

.button-link.primary,
.button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.button-link.primary:hover,
.button.primary:hover {
  background: #5b2fe0;
  border-color: #5b2fe0;
}

.status-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.figure-shell .status-note {
  padding: 16px 18px;
}

.mermaid svg,
.viewer-stage svg {
  max-width: 100%;
  height: auto;
  background: transparent !important;
}

.footer {
  position: relative;
  z-index: 1;
  border-top: 0;
  background: transparent;
}

.footer-inner {
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

.caption {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.viewer-shell {
  display: grid;
  gap: 20px;
}

.viewer-intro {
  padding: 26px 28px;
  border-radius: var(--radius-lg);
}

.viewer-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 24px;
}

.viewer-nav,
.viewer-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

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

.viewer-nav header {
  margin-bottom: 14px;
}

.viewer-nav h2,
.viewer-main h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
}

.viewer-main {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.viewer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.viewer-toolbar h2 {
  margin: 0;
}

.viewer-toolbar-copy {
  min-width: 0;
}

.viewer-toolbar-copy .viewer-description {
  margin: 8px 0 0;
  max-width: none;
}

.viewer-meta,
.viewer-actions {
  display: grid;
  gap: 12px;
}

.viewer-briefs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.viewer-brief {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fdfdfe;
  padding: 16px 18px;
}

.viewer-brief h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.3;
}

.viewer-brief p {
  margin: 0;
  color: var(--muted);
}

.viewer-meta {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0;
}

.viewer-meta-item {
  min-width: 0;
}

.meta-key {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.viewer-description,
.viewer-related-note,
.viewer-hint {
  color: var(--muted);
}

.viewer-actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  margin: 0;
}

.viewer-canvas-shell {
  position: relative;
  min-height: 64vh;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
}

.viewer-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.viewer-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.viewer-zoom {
  min-width: 56px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.viewer-stage,
.source-stage {
  position: absolute;
  inset: 0;
}

.viewer-stage {
  touch-action: none;
  overflow: hidden;
  cursor: grab;
}

.viewer-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08));
  z-index: 0;
}

.viewer-stage.is-dragging {
  cursor: grabbing;
}

.viewer-stage svg,
.viewer-surface svg {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-select: none;
}

.source-stage {
  overflow: auto;
  padding: 22px;
  background: rgba(32, 28, 48, 0.96);
  color: #f7f5ff;
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 30px;
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.category-label {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: none;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.viewer-nav-group + .viewer-nav-group {
  margin-top: 18px;
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.nav-item:hover {
  border-color: rgba(107, 61, 240, 0.28);
  background: rgba(240, 236, 255, 0.36);
}

.nav-item.active {
  border-color: rgba(107, 61, 240, 0.28);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(107, 61, 240, 0.08);
}

.nav-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.nav-item span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.viewer-canvas-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border-radius: 0;
  border: 0;
  background: #ffffff;
}

.panel[id],
.file-card[id] {
  scroll-margin-top: 18px;
}

.detail-grid,
.file-stack {
  display: grid;
  gap: 16px;
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 16px;
}

.detail-card,
.file-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
}

.detail-card {
  padding: 16px 18px;
}

.detail-card strong {
  display: block;
  margin-bottom: 6px;
}

.detail-card p {
  margin: 0;
  color: var(--muted);
}

.file-stack {
  margin-top: 18px;
}

.file-card {
  padding: 20px;
}

.file-card h3 {
  margin: 0 0 8px;
  font-size: 1.04rem;
}

.file-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.file-card .figure-shell {
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  max-height: 420px;
  padding: 0;
  overflow: auto;
  background: rgba(255, 255, 255, 0.97);
  background-image: none;
}

.file-viewer-shell {
  position: relative;
  display: flex;
  min-height: 72vh;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  overflow: hidden;
}

.file-viewer-stage {
  position: relative;
  flex: 1 1 auto;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
}

.file-viewer-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border-radius: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.99);
}

.file-meta {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.file-viewer-note {
  margin-top: 12px;
  color: var(--muted);
}

.jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.jump-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(107, 61, 240, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.jump-links a:hover {
  text-decoration: none;
  border-color: rgba(107, 61, 240, 0.3);
  background: rgba(240, 236, 255, 0.45);
}

.file-render-surface {
  min-height: 0;
}

.file-sheet-shell {
  overflow: auto;
  background: #ffffff;
}

.file-sheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.file-sheet-table th,
.file-sheet-table td {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #ffffff;
}

.file-sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f5f6fa;
  font-weight: 700;
}

.file-sheet-index {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 52px;
  min-width: 52px;
  text-align: right;
  color: var(--muted);
  background: #f8f8fb;
  font-variant-numeric: tabular-nums;
}

.file-sheet-index--corner {
  z-index: 4;
  background: #eef0f5;
}

.file-code-shell {
  padding: 10px 0;
  background: #ffffff;
}

.file-code-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: start;
  font-family: Consolas, 'SFMono-Regular', Monaco, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

.file-code-line {
  padding: 0 12px 0 0;
  text-align: right;
  color: var(--muted);
  border-right: 1px solid var(--border);
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.file-code-text {
  display: block;
  padding: 0 18px;
  white-space: pre;
  background: transparent;
  color: var(--text);
}

.json-key {
  color: #4e3ab5;
}

.json-string {
  color: #0f766e;
}

.json-number {
  color: #b45309;
}

.json-literal {
  color: #7c2d12;
}

.file-raw-shell {
  background: #ffffff;
}

.file-raw-pre {
  margin: 0;
  padding: 16px 18px;
  width: max-content;
  min-width: 100%;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text);
}

.file-raw-shell.is-wrapped .file-raw-pre {
  width: 100%;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.viewer-controls--toolbar {
  justify-content: flex-end;
  align-items: flex-start;
}

.viewer-controls .button[aria-pressed="true"] {
  border-color: rgba(107, 61, 240, 0.3);
  background: rgba(240, 236, 255, 0.65);
  color: var(--accent);
}

.viewer-controls .button:disabled {
  opacity: 0.55;
  cursor: default;
}

.viewer-canvas-shell:fullscreen .viewer-overlay {
  top: 18px;
  right: 18px;
}

.viewer-canvas-shell:fullscreen .viewer-stage,
.viewer-canvas-shell:fullscreen .source-stage {
  inset: 0;
}

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0 12px;
  }

  .header-side {
    width: 100%;
    align-items: flex-start;
    padding-top: 0;
  }

  .app-links {
    align-items: flex-start;
  }

  .top-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .two-col,
  .viewer-layout {
    grid-template-columns: 1fr;
  }

  .viewer-nav {
    position: static;
    max-height: none;
  }

  .viewer-canvas-shell {
    min-height: 60vh;
  }

  .file-viewer-shell {
    min-height: 60vh;
  }

  .viewer-intro {
    padding: 22px;
  }

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

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

  .viewer-controls--toolbar {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .page-shell,
  .site-shell,
  .footer-inner {
    width: min(var(--max-width), calc(100% - 24px));
  }

  .hero,
  .panel,
  .viewer-intro,
  .viewer-main,
  .viewer-nav,
  .detail-card,
  .file-card {
    padding: 18px;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .top-nav a {
    width: 100%;
  }

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

  .jump-links a {
    width: 100%;
    justify-content: center;
  }

  .viewer-overlay {
    left: 12px;
    right: 12px;
    top: 12px;
    flex-direction: column;
    align-items: stretch;
  }

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

  .viewer-controls .button {
    width: 100%;
    min-width: 0;
  }

  .viewer-canvas-shell:fullscreen .viewer-overlay {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .file-viewer-shell:fullscreen .viewer-overlay {
    top: 12px;
    left: 12px;
    right: 12px;
  }

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

  .file-code-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .file-code-text,
  .file-raw-pre {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 480px) {
  .hero-actions,
  .card-grid,
  .diagram-grid,
  .detail-grid,
  .jump-links {
    grid-template-columns: 1fr;
  }

  .top-nav a:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1080px) {
  .detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .file-card--wide {
    grid-column: 1 / -1;
  }
}
