:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-elevated: #16161f;
    --bg-section: #1a1a24;
    --border-subtle: #2a2a3a;
    --border-hover: #3a3a4a;
    --text-primary: #e8e8f0;
    --text-secondary: #9999b0;
    --text-muted: #6a6a80;
    --text-dim: #4a4a5a;
    
    /* Layer colors - swapped as requested */
    --dimensional: #06b6d4;  /* was lineage cyan */
    --dimensional-bg: rgba(6, 182, 212, 0.08);
    --ownership: #8b5cf6;
    --ownership-bg: rgba(139, 92, 246, 0.08);
    --lineage: #f59e0b;  /* was dimensional amber */
    --lineage-bg: rgba(245, 158, 11, 0.08);
    --dq: #10b981;
    --dq-bg: rgba(16, 185, 129, 0.08);
    --business: #3b82f6;  /* was physical blue */
    --business-bg: rgba(59, 130, 246, 0.08);
    --physical: #f43f5e;  /* was business red/pink */
    --physical-bg: rgba(244, 63, 94, 0.08);
    
    /* Prevent Android forced dark mode from inverting colors */
    color-scheme: dark only;
}

/* Prevent Android Chrome forced dark mode from inverting SVG colors */
svg, svg * {
    forced-color-adjust: none;
}

/* Page load animation */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.main-content {
    animation: fadeSlideUp 0.5s ease-out forwards;
}

.side-panel {
    animation: fadeIn 0.5s ease-out forwards;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Header */
header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

h1 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--dimensional), var(--business), var(--physical));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 700px;
}

/* Layer filter controls */
.controls {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.layer-toggle:hover {
    border-color: var(--border-hover);
}

.layer-toggle.active {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.layer-toggle .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: opacity 0.2s ease;
}

.layer-toggle:not(.active) .dot {
    opacity: 0.3;
}

.controls-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
    margin: 0 4px;
}

/* Layer controls - always visible, dimmed when not applicable */
.layer-controls-group {
    display: contents;
}

.layer-controls-group.disabled {
    pointer-events: none;
}

.layer-controls-group.disabled .layer-toggle,
.layer-controls-group.disabled .filter-btn {
    opacity: 0.35;
}

.layer-controls-group.disabled .controls-divider {
    opacity: 0.35;
}

.filter-btn {
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.asset-search-container {
    position: relative;
}

#assetSearch {
    padding: 6px 12px;
    padding-right: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'IBM Plex Sans', sans-serif;
    cursor: pointer;
    min-width: 180px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a6a80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

#assetSearch:hover {
    border-color: var(--border-hover);
}

#assetSearch:focus {
    outline: none;
    border-color: var(--text-muted);
}

#assetSearch option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

#assetSearch optgroup {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
}

/* Edge tooltip */
.edge-tooltip {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.75rem;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 1100;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.edge-tooltip .edge-cardinality {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-muted);
    margin-right: 6px;
}

.edge-tooltip .edge-note {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-top: 4px;
}

.stat-tooltip {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1100;
    max-width: 240px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    line-height: 1.4;
}

/* Main content area */
.main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .side-panel {
        position: static !important;
    }
}

/* Tabs */
.tabs-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
}

.nav-tabs {
    display: flex;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-tab {
    padding: 12px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    position: relative;
}

.nav-tab:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.02);
}

.nav-tab.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--dimensional), var(--physical));
}

.tab-content {
    display: none;
    padding: 24px;
}

.tab-content.active {
    display: block;
}

/* Overview Tab */
.overview-content {
    max-width: 920px;
}

.overview-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-card {
    background: var(--bg-section);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 16px 20px;
    min-width: 140px;
    transition: border-color 0.2s ease;
}

.stat-card[data-tooltip] {
    cursor: help;
}

.stat-card[data-tooltip]:hover {
    border-color: var(--border-hover);
}

.stat-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.principles-section {
    margin-bottom: 32px;
}

.principles-section h2,
.decisions-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Subsection headings (h3) within overview content */
.overview-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Force 2-column layout for specific grids */
.principles-grid.two-col {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 700px) {
    .principles-grid,
    .principles-grid.two-col {
        grid-template-columns: 1fr;
    }
}

.principle-card {
    background: var(--bg-section);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 16px;
}

.principle-card h3 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.principle-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.decisions-section {
    margin-bottom: 32px;
}

.decisions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 12px;
}

.decision-card {
    background: var(--bg-section);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 14px 16px;
}

.decision-card h4 {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.decision-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.overview-diagram {
    margin-top: 32px;
}

.overview-diagram h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.overview-diagram svg {
    width: 100%;
    max-width: 900px;
    height: auto;
}

.layer-card-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-card-clickable:hover rect {
    filter: brightness(1.2);
}

.asset-link {
    cursor: pointer;
    transition: fill 0.2s ease;
}

.asset-link:hover {
    fill: var(--text-primary) !important;
    text-decoration: underline;
}

.asset-ref {
    color: var(--dimensional);
    cursor: pointer;
    transition: color 0.2s ease;
    border-bottom: 1px dotted var(--dimensional);
}

.asset-ref:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.asset-ref-subtle {
    cursor: pointer;
}

.asset-ref-subtle:hover {
    text-decoration: underline;
}

.ownable-assets-box,
.taggable-assets-box {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ownable-assets-box:hover rect,
.taggable-assets-box:hover rect {
    stroke-width: 2.5 !important;
    filter: brightness(1.3);
}

.ownable-assets-box.selected rect,
.taggable-assets-box.selected rect {
    stroke-width: 3 !important;
}

.universal-note {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--bg-section);
    border-radius: 4px;
    border-left: 2px solid var(--dimensional);
}

/* Layer View Tab */
.layers-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.layer-section {
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.layer-section.hidden {
    display: none;
}

.layer-section.collapsed {
    border-color: var(--border-subtle);
}

.layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.layer-header:hover {
    background: rgba(255,255,255,0.02);
}

.layer-header h3 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.layer-header .layer-icon {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.layer-header .expand-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.layer-section.collapsed .expand-icon {
    transform: rotate(-90deg);
}

.layer-content {
    padding: 0 16px 16px;
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
}

.layer-section.collapsed .layer-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Layer specific styles */
.layer-dimensional { border-color: var(--dimensional); }
.layer-dimensional .layer-header { background: var(--dimensional-bg); }
.layer-dimensional .layer-icon { background: var(--dimensional); }

.layer-ownership { border-color: var(--ownership); }
.layer-ownership .layer-header { background: var(--ownership-bg); }
.layer-ownership .layer-icon { background: var(--ownership); }

.layer-lineage { border-color: var(--lineage); }
.layer-lineage .layer-header { background: var(--lineage-bg); }
.layer-lineage .layer-icon { background: var(--lineage); }

.layer-dq { border-color: var(--dq); }
.layer-dq .layer-header { background: var(--dq-bg); }
.layer-dq .layer-icon { background: var(--dq); }

.layer-business { border-color: var(--business); }
.layer-business .layer-header { background: var(--business-bg); }
.layer-business .layer-icon { background: var(--business); }

.layer-physical { border-color: var(--physical); }
.layer-physical .layer-header { background: var(--physical-bg); }
.layer-physical .layer-icon { background: var(--physical); }

.layer-diagram {
    width: 100%;
    min-height: 100px;
}

/* Fade-in animation for diagram nodes */
@keyframes nodesFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.asset-node {
    cursor: pointer;
}

.asset-node rect {
    transition: all 0.2s ease;
}

.asset-node:hover rect {
    filter: brightness(1.3) !important;
    stroke-width: 2 !important;
}

.asset-node.selected rect {
    stroke-width: 2.5 !important;
    filter: brightness(1.2) !important;
}

.asset-node text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    pointer-events: none;
}

/* Graph Tab */
.graph-container {
    position: relative;
    height: 600px;
    background: var(--bg-dark);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-bottom: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.graph-container.zoom-active {
    border-color: var(--border-hover);
    box-shadow: inset 0 0 0 1px var(--border-subtle);
}

.graph-container svg#graph-svg {
    width: 100%;
    height: 100%;
}

.graph-legend {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(18, 18, 26, 0.95);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px;
    backdrop-filter: blur(10px);
    max-width: 200px;
}

.graph-legend-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.graph-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.graph-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.graph-legend-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.graph-layer-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0 0 8px 8px;
    border-top: none;
    margin-top: -1px;
    flex-wrap: wrap;
}

.graph-layer-filters .filter-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 8px;
}

.graph-layer-filters .filter-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    margin: 0 8px;
}

.graph-layer-filters .layer-toggle {
    padding: 5px 10px;
    font-size: 0.7rem;
    min-width: auto;
}

.graph-layer-filters .layer-toggle .dot {
    width: 8px;
    height: 8px;
}

.graph-layer-filters .filter-btn {
    padding: 5px 12px;
    font-size: 0.7rem;
}

.graph-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.graph-btn {
    padding: 8px 12px;
    background: rgba(18, 18, 26, 0.95);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.graph-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.graph-hint {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(18, 18, 26, 0.9);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    z-index: 10;
}

.graph-hint .highlight {
    color: var(--physical);
    font-weight: 500;
}

/* Graph node styles */
.graph-node {
    cursor: pointer;
    transition: opacity 0.3s;
}

.graph-node circle {
    stroke-width: 2px;
    transition: all 0.2s;
}

.graph-node:hover circle {
    stroke-width: 3px;
    filter: brightness(1.2) drop-shadow(0 0 8px currentColor);
}

.graph-node.selected circle {
    stroke-width: 4px;
    filter: drop-shadow(0 0 12px currentColor);
}

.graph-node.faded {
    opacity: 0.1;
}

.graph-node.layer-hidden {
    opacity: 0.1 !important;
}

.graph-node.layer-hidden text {
    opacity: 0 !important;
}

.graph-node text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 500;
    fill: var(--text-primary);
    pointer-events: none;
}

.graph-node.faded text {
    opacity: 0;
}

.graph-link {
    fill: none;
    transition: opacity 0.3s, stroke-width 0.2s;
    cursor: pointer;
}

.graph-link.faded {
    opacity: 0.05 !important;
}

.graph-link.layer-hidden {
    opacity: 0.05 !important;
}

.graph-link.faded.hover-override {
    opacity: 0.7 !important;
}

.graph-link.highlighted {
    opacity: 1 !important;
    stroke-width: 2.5px !important;
}

.graph-link-xor {
    stroke-dasharray: 6, 4;
}

.graph-link-universal {
    opacity: 0 !important;
    pointer-events: none;
}

.graph-link-universal.visible {
    opacity: 0.4 !important;
    stroke-dasharray: 2, 4;
    pointer-events: auto;
}

.graph-link-universal.highlighted {
    opacity: 0.7 !important;
}

.graph-link-hitarea {
    pointer-events: stroke;
}

.graph-link-hitarea.graph-link-universal {
    pointer-events: none;
}

.graph-link-universal.visible + .graph-link-hitarea.graph-link-universal,
.hit-areas .graph-link-hitarea {
    pointer-events: stroke;
}

/* Side Panel */
.side-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.panel-header .asset-search-container #assetSearch {
    font-size: 0.7rem;
    padding: 4px 24px 4px 8px;
    min-width: 140px;
}

.panel-content {
    padding: 16px;
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-dim);
}

.empty-state p {
    font-size: 0.85rem;
}

/* Asset detail styles */
.asset-header {
    margin-bottom: 16px;
}

.asset-layer-badge {
    display: inline-block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
}

.asset-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.asset-definition {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.asset-example {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.asset-example::before {
    content: 'e.g. ';
    font-style: normal;
    color: var(--text-dim);
}

/* Asset types highlight box */
.asset-types-box {
    background: var(--bg-section);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
}

.asset-types-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.asset-type-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.asset-type-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.asset-type-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.asset-type-trigger {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: 'IBM Plex Mono', monospace;
}

/* Collapsible sections */
.detail-section {
    border-top: 1px solid var(--border-subtle);
    margin-top: 12px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    user-select: none;
}

.section-header:hover {
    color: var(--text-primary);
}

.section-header h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 500;
}

.section-toggle {
    font-size: 0.7rem;
    color: var(--text-dim);
    transition: transform 0.2s;
}

.detail-section.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding-bottom: 12px;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    overflow: hidden;
}

.detail-section.collapsed .section-content {
    max-height: 0 !important;
    opacity: 0;
    padding-bottom: 0;
}

.relationship-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-section);
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.relationship-item .direction {
    color: var(--text-dim);
    flex-shrink: 0;
    width: 18px;
    font-family: 'IBM Plex Mono', monospace;
}

.relationship-item .target {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.relationship-item .cardinality {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-family: 'IBM Plex Mono', monospace;
}

.attribute-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.attribute-item:last-child {
    border-bottom: none;
}

.attribute-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.attribute-meta {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.attribute-type {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.attribute-mandatory {
    font-size: 0.65rem;
    color: var(--lineage);
    text-transform: uppercase;
}

.attribute-note {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* Detail tables for relationships and attributes */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.detail-table thead th {
    text-align: left;
    padding: 6px 8px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 500;
}

.detail-table tbody td {
    padding: 8px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}

.detail-table tbody tr:last-child td {
    border-bottom: none;
}

.detail-table .direction-cell {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-dim);
    text-align: center;
}

.detail-table .cardinality-cell {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.detail-table .attr-name-cell {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-table .attr-type-cell {
    color: var(--text-muted);
}

.detail-table .attr-req-cell {
    text-align: center;
    color: var(--lineage);
}

.detail-table .note-row td {
    padding-top: 0;
    border-bottom: 1px solid var(--border-subtle);
}

.detail-table .note-row:last-child td,
.detail-table tbody tr:has(+ .note-row) td {
    border-bottom: none;
}

.detail-table .note-cell {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-style: italic;
    padding-left: 12px;
}

/* Content tables for overview sections (Why Does This Matter, Inheritance Rules, etc.) */
.content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.content-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
}

.content-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
    color: var(--text-secondary);
    line-height: 1.5;
}

.content-table tbody tr:last-child td {
    border-bottom: none;
}

.content-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.content-table-label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.content-table-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Tables without headers - round top corners */
.content-table.no-header {
    border-radius: 8px;
}

.content-table.no-header tbody tr:first-child td:first-child {
    border-top-left-radius: 7px;
}

.content-table.no-header tbody tr:first-child td:last-child {
    border-top-right-radius: 7px;
}

/* Tab links in How To Use section */
.tab-link {
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: text-decoration 0.15s ease;
}

.tab-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Design Decisions List */
.design-decisions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.design-decisions-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
}

.decision-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dimensional);
    margin-top: 2px;
}

.decision-icon svg {
    width: 18px;
    height: 18px;
}

.decision-content {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.decision-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.rule-item {
    padding: 8px 10px;
    background: var(--bg-section);
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.rule-item .rule-num {
    color: var(--dq);
    font-weight: 600;
    margin-right: 8px;
    font-family: 'IBM Plex Mono', monospace;
}

/* Scrollbar styling */
.side-panel::-webkit-scrollbar {
    width: 6px;
}

.side-panel::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.side-panel::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.side-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Quiz Tab Styles */
.quiz-container {
    max-width: 800px;
}

.quiz-intro {
    margin-bottom: 32px;
}

.quiz-intro h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.quiz-intro p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.difficulty-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.difficulty-btn {
    flex: 1;
    padding: 20px 16px;
    background: var(--bg-section);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.difficulty-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.difficulty-btn.selected {
    border-color: var(--text-muted);
}

.difficulty-btn.easy.selected {
    border-color: var(--dq);
    background: rgba(16, 185, 129, 0.1);
}

.difficulty-btn.medium.selected {
    border-color: var(--lineage);
    background: rgba(245, 158, 11, 0.1);
}

.difficulty-btn.hard.selected {
    border-color: var(--physical);
    background: rgba(244, 63, 94, 0.1);
}

.difficulty-btn .difficulty-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.difficulty-btn.easy .difficulty-label { color: var(--dq); }
.difficulty-btn.medium .difficulty-label { color: var(--lineage); }
.difficulty-btn.hard .difficulty-label { color: var(--physical); }

.difficulty-btn .difficulty-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.start-quiz-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--dimensional), var(--business));
    border: none;
    border-radius: 6px;
    color: white;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.5;
    pointer-events: none;
}

.start-quiz-btn.enabled {
    opacity: 1;
    pointer-events: auto;
}

.start-quiz-btn.enabled:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* Quiz in progress */
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-section);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--dimensional), var(--business));
    transition: width 0.3s ease;
    border-radius: 3px;
}

.progress-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.quiz-question-card {
    background: var(--bg-section);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.question-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.question-text {
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-option {
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.answer-option:hover:not(.disabled) {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.answer-option.disabled {
    cursor: default;
}

.answer-option.selected {
    border-color: var(--dimensional);
    background: rgba(6, 182, 212, 0.1);
}

.answer-option.correct {
    border-color: var(--dq);
    background: rgba(16, 185, 129, 0.15);
}

.answer-option.incorrect {
    border-color: var(--physical);
    background: rgba(244, 63, 94, 0.15);
}

.answer-option.was-correct {
    border-color: var(--dq);
    border-style: dashed;
}

.answer-letter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 20px;
}

.answer-option.correct .answer-letter { color: var(--dq); }
.answer-option.incorrect .answer-letter { color: var(--physical); }

.answer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.answer-option.correct .answer-text { color: var(--text-primary); }
.answer-option.incorrect .answer-text { color: var(--text-primary); }

.feedback-box {
    margin-top: 20px;
    padding: 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
    display: none;
}

.feedback-box.visible {
    display: block;
}

.feedback-box.correct {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--dq);
}

.feedback-box.incorrect {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--text-secondary);
}

.feedback-box .feedback-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.feedback-box.correct .feedback-title { color: var(--dq); }
.feedback-box.incorrect .feedback-title { color: var(--physical); }

.next-question-btn {
    padding: 12px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.next-question-btn:hover {
    background: var(--bg-section);
    border-color: var(--text-muted);
}

/* Quiz Results */
.quiz-results {
    text-align: center;
    padding: 40px 20px;
}

.results-score {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 4rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.results-score.excellent { color: var(--dq); }
.results-score.good { color: var(--dimensional); }
.results-score.fair { color: var(--lineage); }
.results-score.poor { color: var(--physical); }

.results-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.results-message {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.results-breakdown {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
}

.breakdown-item {
    text-align: center;
}

.breakdown-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
}

.breakdown-number.correct { color: var(--dq); }
.breakdown-number.incorrect { color: var(--physical); }

.breakdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.retake-btn {
    padding: 14px 32px;
    background: var(--bg-section);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.retake-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
}

.new-quiz-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--dimensional), var(--business));
    border: none;
    border-radius: 6px;
    color: white;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-quiz-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* Side panel hidden state for quiz */
.side-panel.hidden-for-quiz {
    display: none;
}

@media (max-width: 1200px) {
    .side-panel.hidden-for-quiz {
        display: none;
    }
}

.main-content.quiz-active {
    grid-template-columns: 1fr;
}

.main-content.quiz-active .quiz-container {
    margin: 0 auto;
}

.exit-quiz-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.exit-quiz-btn:hover {
    border-color: var(--physical);
    color: var(--physical);
    background: rgba(244, 63, 94, 0.1);
}

/* Side panel mobile toggle */
.side-panel-toggle {
    display: none; /* Hidden on desktop */
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
}

.side-panel-toggle .toggle-icon {
    transition: transform 0.2s ease;
}

.side-panel.collapsed .side-panel-toggle .toggle-icon {
    transform: rotate(-90deg);
}

.side-panel-content-wrapper {
    display: contents; /* No effect on desktop */
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

/* Hamburger button - hidden on desktop */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1;
    z-index: 1001;
}

.hamburger-btn:hover {
    color: var(--text-primary);
}

.hamburger-close {
    display: none;
}

.mobile-nav-title {
    display: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile nav overlay - hidden on desktop */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    padding: 80px 24px 24px;
    gap: 4px;
}

.mobile-nav-item {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: 'IBM Plex Sans', sans-serif;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-nav-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.mobile-nav-item.active {
    background: var(--bg-elevated);
    border-color: var(--dimensional);
    color: var(--text-primary);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet breakpoint */
@media (max-width: 900px) {
    .container {
        padding: 20px 16px;
    }

    header {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .tagline {
        font-size: 0.65rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .controls {
        gap: 6px;
    }

    .layer-toggle {
        padding: 5px 8px;
        font-size: 0.6rem;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tab {
        padding: 10px 12px;
        font-size: 0.65rem;
        flex: 1 1 auto;
        text-align: center;
    }

    .graph-container {
        height: 450px;
    }

    .graph-legend {
        padding: 10px;
        max-width: 160px;
    }

    .graph-legend-title {
        font-size: 0.55rem;
    }

    .graph-legend-item {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }

    .graph-controls {
        gap: 6px;
    }

    .graph-btn {
        padding: 6px 10px;
        font-size: 0.6rem;
    }

    .graph-hint {
        font-size: 0.65rem;
        padding: 6px 12px;
    }

    .layer-diagram {
        min-height: auto;
    }

    .side-panel {
        max-height: none;
    }

    /* Show toggle, make content collapsible */
    .side-panel-toggle {
        display: flex;
    }

    .side-panel-content-wrapper {
        display: block;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .side-panel.collapsed .side-panel-content-wrapper {
        max-height: 0;
    }

    .side-panel:not(.collapsed) .side-panel-content-wrapper {
        max-height: 2000px; /* Large enough to fit content */
    }

    .panel-header .panel-title {
        display: none; /* Hide duplicate title since toggle shows it */
    }

    .panel-content {
        padding: 12px;
    }

    .overview-diagram svg {
        max-width: 100%;
        height: auto;
    }

    /* Design decisions list - tablet */
    .design-decisions-list {
        gap: 10px;
    }

    .design-decisions-list li {
        padding: 12px 14px;
    }

    .decision-content {
        font-size: 0.8rem;
    }

    /* Content tables - tablet */
    .content-table {
        font-size: 0.8rem;
    }

    .content-table thead th {
        padding: 10px 14px;
        font-size: 0.7rem;
    }

    .content-table tbody td {
        padding: 10px 14px;
    }
}

/* Phone breakpoint */
@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .logo {
        flex-direction: column;
        gap: 4px;
    }

    h1 {
        font-size: 1.2rem;
    }

    .tagline {
        font-size: 0.6rem;
    }

    .subtitle {
        font-size: 0.75rem;
        display: none; /* Hide on very small screens */
    }

    .controls {
        margin-top: 12px;
    }

    /* Force 2x2 grid for stat cards on mobile */
    .overview-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        min-width: unset;
        padding: 12px 14px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .layer-toggle {
        padding: 4px 6px;
        font-size: 0.55rem;
    }

    .layer-toggle .dot {
        width: 6px;
        height: 6px;
    }

    .controls-divider {
        display: none;
    }

    .filter-btn {
        padding: 4px 6px;
        font-size: 0.55rem;
    }

    #assetSearch {
        min-width: 120px;
        font-size: 0.65rem;
    }

    /* Hamburger menu - show on mobile */
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-title {
        display: block;
        flex: 1;
        text-align: center;
        padding-right: 32px; /* Balance the hamburger button */
    }

    .mobile-nav-overlay {
        display: block;
    }

    .nav-tabs {
        justify-content: flex-start;
        align-items: center;
        padding: 8px 12px;
    }

    .nav-tab {
        display: none; /* Hide tabs, use hamburger menu instead */
    }

    /* Hamburger icon swap when menu is open */
    body.mobile-nav-open .hamburger-icon {
        display: none;
    }

    body.mobile-nav-open .hamburger-close {
        display: inline;
    }

    .tab-content {
        padding: 12px;
    }

    .graph-container {
        height: 350px;
    }

    .graph-legend {
        top: 8px;
        left: 8px;
        padding: 8px;
        max-width: 130px;
    }

    .graph-legend-title {
        font-size: 0.5rem;
        margin-bottom: 6px;
    }

    .graph-legend-item {
        font-size: 0.55rem;
        gap: 4px;
        margin-bottom: 3px;
    }

    .graph-legend-dot {
        width: 8px;
        height: 8px;
    }

    .graph-legend-section {
        margin-top: 8px;
        padding-top: 8px;
    }

    .graph-controls {
        top: 8px;
        right: 8px;
        gap: 4px;
    }

    .graph-btn {
        padding: 5px 8px;
        font-size: 0.55rem;
    }

    .graph-hint {
        font-size: 0.55rem;
        padding: 5px 10px;
        bottom: 8px;
    }

    .graph-node text {
        font-size: 7px;
    }

    .graph-node circle {
        r: 20;
    }

    .layer-section {
        margin-bottom: 12px;
    }

    .layer-header h3 {
        font-size: 0.7rem;
    }

    .layer-content {
        padding: 12px;
    }

    .layer-description p {
        font-size: 0.75rem;
    }

    .overview-content {
        padding: 12px;
    }

    .decisions-section h2,
    .overview-content h2 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .principles-grid {
        gap: 8px;
    }

    .principle-card {
        padding: 12px;
    }

    .principle-card h3 {
        font-size: 0.8rem;
    }

    .principle-card p {
        font-size: 0.7rem;
    }

    .decisions-grid {
        gap: 8px;
    }

    .decision-card {
        padding: 10px;
    }

    .decision-card h4 {
        font-size: 0.75rem;
    }

    .decision-card p {
        font-size: 0.7rem;
    }

    /* Design decisions list - mobile */
    .design-decisions-list {
        gap: 8px;
    }

    .design-decisions-list li {
        padding: 10px 12px;
        gap: 10px;
    }

    .decision-icon {
        width: 16px;
        height: 16px;
    }

    .decision-icon svg {
        width: 16px;
        height: 16px;
    }

    .decision-content {
        font-size: 0.75rem;
        line-height: 1.5;
    }

    /* Content tables - mobile */
    .content-table {
        font-size: 0.75rem;
    }

    .content-table thead th {
        padding: 10px 12px;
        font-size: 0.65rem;
    }

    .content-table tbody td {
        padding: 10px 12px;
    }

    .content-table-label {
        white-space: normal;
        font-size: 0.75rem;
    }

    .content-table-note {
        font-size: 0.7rem;
    }

    .panel-header {
        padding: 12px;
    }

    .panel-title {
        font-size: 0.6rem;
    }

    .asset-name {
        font-size: 1rem;
    }

    .asset-definition {
        font-size: 0.75rem;
    }

    .detail-section h4 {
        font-size: 0.65rem;
    }

    .attribute-row {
        font-size: 0.7rem;
    }

    .relationship-item {
        font-size: 0.7rem;
        padding: 6px 8px;
    }

    /* Quiz adjustments */
    .quiz-intro h2 {
        font-size: 1.2rem;
    }

    .difficulty-selector {
        flex-direction: column;
        gap: 8px;
    }

    .difficulty-btn {
        width: 100%;
    }

    .quiz-question-container {
        padding: 16px;
    }

    .question-text {
        font-size: 0.9rem;
    }

    .answer-option {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .results-score {
        font-size: 2.5rem;
    }

    /* SVG diagrams - scale down */
    .layer-diagram {
        max-width: 100%;
        overflow-x: auto;
    }

    .overview-diagram {
        overflow-x: auto;
    }

    .overview-diagram svg {
        min-width: 500px;
    }
}

/* Very small screens - further simplification */
@media (max-width: 400px) {
    h1 {
        font-size: 1rem;
    }

    .nav-tab {
        padding: 6px 8px;
        font-size: 0.55rem;
    }

    .graph-container {
        height: 300px;
    }

    .graph-legend {
        display: none; /* Hide legend on very small screens */
    }

    .graph-hint {
        max-width: 90%;
        text-align: center;
    }
}