/* LegalDebug.com - Dark Academia Debugger Theme */

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

:root {
    --bg-darkest: #0a0e17;
    --bg-dark: #0f1520;
    --bg-panel: #1c2333;
    --text-parchment: #e8e0d0;
    --text-muted: #6b7a8d;
    --accent-red: #c94444;
    --accent-green: #4a9e6f;
    --accent-gold: #d4a857;

    --font-serif: 'Playfair Display', 'Lora', Georgia, serif;
    --font-body: 'Source Sans 3', 'Inter', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
    --font-condensed: 'Oswald', 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-darkest);
    color: var(--text-parchment);
    overflow-x: hidden;
    font-size: 17px;
    line-height: 1.7;
    cursor: default;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.91 0 0 0 0 0.88 0 0 0 0 0.82 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* ========== Boot Sequence ========== */
#boot-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-darkest);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#boot-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 3px,
            rgba(74, 158, 111, 0.03) 3px,
            rgba(74, 158, 111, 0.03) 4px
        );
    pointer-events: none;
}

#boot-screen.dismissed {
    transform: translateY(-100vh);
    pointer-events: none;
}

.boot-container {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent-green);
    max-width: 760px;
    width: 90%;
    position: relative;
    z-index: 2;
}

.boot-prefix {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(107, 122, 141, 0.3);
    letter-spacing: 0.05em;
}

.boot-bracket {
    color: var(--accent-gold);
}

.boot-bracket-inner {
    color: var(--accent-green);
    font-weight: 700;
    margin: 0 2px;
}

.boot-line {
    margin-bottom: 14px;
    opacity: 0;
    animation: bootFadeIn 0.3s forwards;
}

.boot-line .typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-green);
    width: 0;
    animation: typeOut 1.1s steps(60) forwards, blinkCaret 0.6s step-end infinite;
}

.boot-skip {
    margin-top: 40px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    animation: bootFadeIn 1s forwards;
    animation-delay: 5.5s;
}

@keyframes bootFadeIn {
    to { opacity: 1; }
}

@keyframes typeOut {
    to { width: 100%; }
}

@keyframes blinkCaret {
    50% { border-color: transparent; }
}

/* ========== Main Layout ========== */
#main-content {
    display: grid;
    grid-template-columns: 35% 65%;
    min-height: 100vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

#main-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Debug Sidebar ========== */
#debug-sidebar {
    background: var(--bg-dark);
    border-right: 1px solid rgba(74, 158, 111, 0.2);
    padding: 28px 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

#debug-sidebar::before {
    content: '';
    position: absolute;
    right: 0;
    top: 24px;
    bottom: 24px;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--accent-green) 20%,
        var(--accent-green) 80%,
        transparent 100%
    );
    opacity: 0.5;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(74, 158, 111, 0.15);
    margin-bottom: 28px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    color: var(--accent-green);
}

.terminal-prompt {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-green);
    letter-spacing: 0.08em;
}

.version {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    padding: 3px 8px;
    border: 1px solid rgba(107, 122, 141, 0.3);
    border-radius: 3px;
}

.sidebar-nav {
    margin-bottom: 28px;
}

.nav-section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.nav-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: var(--text-parchment);
    text-decoration: none;
    font-family: var(--font-condensed);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 3px;
    border-left: 2px solid transparent;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
    margin-bottom: 3px;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(74, 158, 111, 0.08);
    color: var(--text-parchment);
}

.nav-item.active {
    background: rgba(74, 158, 111, 0.12);
    color: var(--accent-green);
    border-left-color: var(--accent-green);
}

.nav-line {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0;
    text-transform: none;
}

.nav-item.active .nav-line {
    color: var(--accent-gold);
}

.breakpoint-diamond {
    width: 10px;
    height: 10px;
    background: var(--text-muted);
    transform: rotate(45deg);
    flex-shrink: 0;
    transition: background 0.25s, box-shadow 0.25s;
}

.nav-item:hover .breakpoint-diamond {
    background: rgba(74, 158, 111, 0.7);
}

.nav-item.active .breakpoint-diamond {
    background: var(--accent-green);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(74, 158, 111, 0.6); }
    50% { box-shadow: 0 0 14px rgba(74, 158, 111, 1), 0 0 24px rgba(74, 158, 111, 0.4); }
}

/* ========== Timeline ========== */
.timeline-spine {
    position: relative;
    padding-left: 24px;
    margin: 24px 0;
    flex-grow: 1;
}

.timeline-spine .nav-section-label {
    margin-left: -24px;
}

.timeline-spine::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 32px;
    bottom: 8px;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent-green) 0%, rgba(74, 158, 111, 0.15) 100%);
}

.timeline-marker {
    position: relative;
    margin-bottom: 18px;
    padding-left: 14px;
    transition: transform 0.2s;
}

.timeline-marker:hover {
    transform: translateX(2px);
}

.timeline-marker::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 9px;
    height: 9px;
    background: var(--accent-green);
    transform: rotate(45deg);
    transition: box-shadow 0.3s;
}

.timeline-marker.active::before {
    background: var(--accent-gold);
    box-shadow: 0 0 12px var(--accent-gold);
}

.timeline-marker .year {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-gold);
    display: block;
    letter-spacing: 0.05em;
}

.timeline-marker .event {
    font-family: var(--font-condensed);
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.timeline-marker.active .event {
    color: var(--text-parchment);
}

/* ========== Sidebar Status ========== */
.sidebar-status {
    border-top: 1px solid rgba(74, 158, 111, 0.15);
    padding-top: 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    margin-top: auto;
}

.status-line {
    margin-bottom: 7px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-key {
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.status-val {
    color: var(--text-parchment);
    font-weight: 500;
}

.status-val.error {
    color: var(--accent-red);
    animation: errorBlink 2s ease-in-out infinite;
}

.status-val.gold {
    color: var(--accent-gold);
}

@keyframes errorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========== Content Panel ========== */
#content-panel {
    min-height: 100vh;
    padding: 56px 64px 80px;
    position: relative;
    background: var(--bg-darkest);
}

/* ========== Document Header ========== */
.document-header {
    margin-bottom: 80px;
    padding-bottom: 40px;
    position: relative;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 36px;
}

.meta-tag {
    padding: 4px 10px;
    border: 1px solid rgba(107, 122, 141, 0.3);
    border-radius: 2px;
}

.meta-divider {
    width: 24px;
    height: 1px;
    background: var(--text-muted);
}

.declassified {
    color: var(--accent-red);
    font-weight: 700;
    letter-spacing: 0.1em;
    position: relative;
}

.declassified::before {
    content: '';
    position: absolute;
    left: -2px;
    right: -2px;
    top: 45%;
    height: 1px;
    background: var(--accent-red);
    transform: rotate(-2deg);
}

.document-title {
    font-family: var(--font-serif);
    font-size: clamp(40px, 5.5vw, 76px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--text-parchment);
    margin-bottom: 32px;
}

.document-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent-gold);
}

.document-subtitle {
    font-family: var(--font-body);
    font-size: 19px;
    line-height: 1.6;
    color: rgba(232, 224, 208, 0.7);
    max-width: 720px;
    margin-bottom: 40px;
}

.doc-author {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.author-label {
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.author-name {
    color: var(--accent-green);
    border-bottom: 1px solid var(--accent-green);
    padding-bottom: 1px;
}

/* ========== Diagonal Divider ========== */
.diagonal-divider {
    position: relative;
    height: 60px;
    margin: 40px -64px;
    overflow: hidden;
    background: var(--bg-panel);
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
}

.diagonal-divider::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.85) 0px,
        rgba(0, 0, 0, 0.85) 60px,
        transparent 60px,
        transparent 70px,
        rgba(0, 0, 0, 0.85) 70px,
        rgba(0, 0, 0, 0.85) 130px,
        transparent 130px,
        transparent 138px,
        rgba(0, 0, 0, 0.85) 138px,
        rgba(0, 0, 0, 0.85) 220px,
        transparent 220px,
        transparent 228px
    );
    background-size: 280px 12px;
    background-repeat: repeat;
    opacity: 0.85;
}

.diagonal-divider.alt {
    background: var(--bg-dark);
    clip-path: polygon(0 12%, 100% 0, 100% 88%, 0 100%);
}

/* ========== Content Sections ========== */
.content-section {
    margin: 64px 0;
    padding: 16px 0 56px;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.content-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.content-section:nth-child(odd) {
    /* zebra-stripe rhythm via margin/background container */
}

.section-watermark {
    position: absolute;
    top: 20px;
    right: -24px;
    font-family: var(--font-serif);
    font-size: 14px;
    color: var(--accent-gold);
    letter-spacing: 0.4em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    opacity: 0.25;
    pointer-events: none;
    text-transform: uppercase;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.line-number {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 40px;
    padding: 4px 8px;
    background: rgba(74, 158, 111, 0.06);
    border: 1px solid rgba(74, 158, 111, 0.2);
    border-radius: 2px;
    text-align: center;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--text-parchment);
    flex: 1;
    min-width: 200px;
}

.section-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    padding: 5px 11px;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 3px;
    letter-spacing: 0.1em;
    white-space: nowrap;
    background: rgba(74, 158, 111, 0.04);
}

.section-badge.error {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(201, 68, 68, 0.05);
}

.section-body {
    font-size: 17px;
    line-height: 1.75;
    color: rgba(232, 224, 208, 0.88);
    max-width: 760px;
}

.section-body p {
    margin-bottom: 22px;
}

.section-body code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--accent-gold);
    background: rgba(212, 168, 87, 0.08);
    padding: 1px 6px;
    border-radius: 2px;
}

.lead-text {
    font-size: 21px;
    line-height: 1.55;
    color: var(--text-parchment);
    font-weight: 400;
}

/* ========== Redacted Text ========== */
.redacted {
    background: #000;
    color: transparent;
    padding: 0 6px;
    cursor: pointer;
    transition: background 0.5s ease, color 0.5s ease, filter 0.5s ease;
    position: relative;
    user-select: none;
    border-radius: 1px;
    filter: blur(0);
}

.redacted::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 0,
        rgba(255, 255, 255, 0.04) 1px,
        transparent 1px,
        transparent 4px
    );
    pointer-events: none;
}

.redacted:hover,
.redacted.revealed {
    background: rgba(201, 68, 68, 0.08);
    color: var(--accent-red);
    border-bottom: 1px solid var(--accent-red);
    user-select: auto;
}

.redacted:hover::after,
.redacted.revealed::after {
    opacity: 0;
}

/* ========== Code Block ========== */
.code-block {
    background: var(--bg-dark);
    border: 1px solid rgba(74, 158, 111, 0.2);
    border-radius: 6px;
    margin: 28px 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 18px;
    background: rgba(74, 158, 111, 0.06);
    border-bottom: 1px solid rgba(74, 158, 111, 0.2);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-green);
    font-weight: 500;
}

.line-ref {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.code-block pre {
    padding: 22px 18px;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-parchment);
    background: transparent;
    padding: 0;
}

.code-line-num {
    color: var(--text-muted);
    opacity: 0.5;
    user-select: none;
    margin-right: 14px;
    display: inline-block;
    width: 20px;
}

.code-keyword { color: var(--accent-red); font-weight: 500; }
.code-var { color: var(--accent-gold); }
.code-string { color: var(--accent-green); }
.code-prop { color: #7cb7e8; }
.code-comment { color: var(--text-muted); font-style: italic; }
.code-error { color: var(--accent-red); text-decoration: underline dotted; }

/* ========== Annotation Card ========== */
.annotation-card {
    display: flex;
    gap: 18px;
    background: rgba(201, 68, 68, 0.06);
    border-left: 3px solid var(--accent-red);
    padding: 18px 22px;
    border-radius: 0 4px 4px 0;
    margin-top: 24px;
    align-items: flex-start;
}

.annotation-icon {
    width: 30px;
    height: 30px;
    background: var(--accent-red);
    color: var(--bg-darkest);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}

.annotation-text {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(232, 224, 208, 0.88);
}

.annotation-text strong {
    color: var(--accent-red);
    font-family: var(--font-condensed);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
    margin-right: 4px;
}

/* ========== Bug List ========== */
.bug-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 28px;
}

.bug-item {
    background: var(--bg-dark);
    border: 1px solid rgba(107, 122, 141, 0.18);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s;
}

.bug-item:hover {
    border-color: rgba(74, 158, 111, 0.4);
    transform: translateX(2px);
}

.bug-item.severity-critical { border-left: 3px solid var(--accent-red); }
.bug-item.severity-high { border-left: 3px solid var(--accent-gold); }
.bug-item.severity-medium { border-left: 3px solid var(--text-muted); }

.bug-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(15, 21, 32, 0.6);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.bug-header:hover {
    background: rgba(15, 21, 32, 0.9);
}

.bug-id {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.bug-severity {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 2px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.severity-critical .bug-severity {
    background: rgba(201, 68, 68, 0.18);
    color: var(--accent-red);
    border: 1px solid rgba(201, 68, 68, 0.4);
}

.severity-high .bug-severity {
    background: rgba(212, 168, 87, 0.18);
    color: var(--accent-gold);
    border: 1px solid rgba(212, 168, 87, 0.4);
}

.severity-medium .bug-severity {
    background: rgba(107, 122, 141, 0.18);
    color: var(--text-muted);
    border: 1px solid rgba(107, 122, 141, 0.4);
}

.bug-title {
    font-family: var(--font-condensed);
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.02em;
    color: var(--text-parchment);
    flex: 1;
}

.bug-toggle {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent-green);
    transition: transform 0.3s;
}

.bug-item.collapsed .bug-toggle {
    transform: none;
}

.bug-item:not(.collapsed) .bug-toggle::before {
    content: '[\2212]';
}

.bug-item.collapsed .bug-toggle::before {
    content: '[+]';
}

.bug-toggle::before {
    content: '[\2212]';
}

.bug-body {
    padding: 18px;
    transition: max-height 0.4s ease, opacity 0.3s, padding 0.3s;
    overflow: hidden;
    max-height: 600px;
}

.bug-item.collapsed .bug-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.bug-body p {
    margin-bottom: 14px;
    font-size: 15px;
    line-height: 1.65;
}

.stack-trace {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px 16px;
    background: rgba(10, 14, 23, 0.7);
    border-radius: 3px;
    border-left: 2px solid rgba(74, 158, 111, 0.3);
    line-height: 1.8;
}

.stack-trace span {
    display: block;
    padding: 1px 0;
}

.stack-trace span::before {
    content: 'at ';
    color: var(--accent-red);
    font-weight: 500;
}

/* ========== Precedent Stack ========== */
.precedent-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 28px;
    border-left: 1px solid rgba(74, 158, 111, 0.2);
    padding-left: 0;
}

.stack-frame {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 22px;
    background: var(--bg-dark);
    border: 1px solid rgba(107, 122, 141, 0.15);
    border-radius: 4px;
    padding: 22px 24px;
    margin-bottom: 12px;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.stack-frame:hover {
    border-color: rgba(74, 158, 111, 0.4);
    transform: translateX(6px);
    box-shadow: -4px 4px 16px rgba(74, 158, 111, 0.08);
}

.frame-number {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-green);
    white-space: nowrap;
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.frame-number span {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.frame-line {
    width: 1px;
    flex: 1;
    background: linear-gradient(to bottom, var(--accent-green), transparent);
    min-height: 30px;
    margin-left: 12px;
}

.frame-content h3 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-parchment);
    letter-spacing: -0.01em;
}

.frame-year {
    font-style: italic;
    font-weight: 400;
    color: var(--accent-gold);
    font-size: 0.7em;
}

.frame-desc {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 14px;
    color: rgba(232, 224, 208, 0.78);
}

.frame-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.frame-status {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 2px;
    display: inline-block;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.frame-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 10px;
    border: 1px solid rgba(107, 122, 141, 0.3);
    color: var(--text-muted);
    border-radius: 2px;
    letter-spacing: 0.08em;
}

.frame-status.resolved {
    background: rgba(74, 158, 111, 0.18);
    color: var(--accent-green);
    border: 1px solid rgba(74, 158, 111, 0.4);
}

.frame-status.reverted {
    background: rgba(201, 68, 68, 0.18);
    color: var(--accent-red);
    border: 1px solid rgba(201, 68, 68, 0.4);
}

.frame-status.partial {
    background: rgba(212, 168, 87, 0.18);
    color: var(--accent-gold);
    border: 1px solid rgba(212, 168, 87, 0.4);
}

/* ========== Watch Panel ========== */
.watch-panel {
    margin-top: 28px;
    border: 1px solid rgba(107, 122, 141, 0.18);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-dark);
}

.watch-header {
    display: grid;
    grid-template-columns: 160px 110px 1fr 130px;
    gap: 16px;
    padding: 12px 18px;
    background: rgba(74, 158, 111, 0.06);
    border-bottom: 1px solid rgba(74, 158, 111, 0.2);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.watch-item {
    display: grid;
    grid-template-columns: 160px 110px 1fr 130px;
    gap: 16px;
    align-items: center;
    padding: 13px 18px;
    font-size: 13px;
    border-bottom: 1px solid rgba(107, 122, 141, 0.08);
    transition: background 0.2s;
}

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

.watch-item:hover {
    background: rgba(74, 158, 111, 0.04);
}

.watch-name {
    font-family: var(--font-mono);
    color: var(--accent-gold);
    font-weight: 500;
}

.watch-type {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 12px;
}

.watch-value {
    font-family: var(--font-mono);
    color: var(--accent-green);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watch-status {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 2px;
    text-align: center;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.watch-status.warning {
    background: rgba(212, 168, 87, 0.18);
    color: var(--accent-gold);
    border: 1px solid rgba(212, 168, 87, 0.3);
}

.watch-status.error {
    background: rgba(201, 68, 68, 0.18);
    color: var(--accent-red);
    border: 1px solid rgba(201, 68, 68, 0.3);
}

/* ========== Console ========== */
.console-window {
    margin-top: 28px;
    background: var(--bg-darkest);
    border: 1px solid rgba(74, 158, 111, 0.25);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.console-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-panel);
    border-bottom: 1px solid rgba(74, 158, 111, 0.15);
}

.console-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.console-dot.red { background: var(--accent-red); }
.console-dot.gold { background: var(--accent-gold); }
.console-dot.green { background: var(--accent-green); }

.console-titletext {
    margin-left: 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.console-output {
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 13px;
    max-height: 360px;
    overflow-y: auto;
}

.console-line {
    padding: 3px 0;
    line-height: 1.7;
    color: var(--text-parchment);
}

.console-time {
    color: var(--text-muted);
    margin-right: 8px;
}

.console-warn {
    color: var(--accent-gold);
    font-weight: 700;
    margin-right: 8px;
}

.console-error {
    color: var(--accent-red);
    font-weight: 700;
    margin-right: 8px;
}

.console-info {
    color: var(--accent-green);
    font-weight: 700;
    margin-right: 8px;
}

.console-input-line {
    padding: 12px 18px;
    border-top: 1px solid rgba(74, 158, 111, 0.15);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-green);
    background: rgba(74, 158, 111, 0.04);
    display: flex;
    align-items: center;
    gap: 8px;
}

.console-prompt {
    color: var(--accent-gold);
    font-weight: 700;
}

.console-input-text {
    color: var(--text-parchment);
}

.console-cursor {
    width: 8px;
    height: 14px;
    background: var(--accent-green);
    display: inline-block;
    animation: blinkCaret 0.8s step-end infinite;
}

@keyframes blinkCaret {
    50% { opacity: 0; }
}

/* ========== Document Footer ========== */
.document-footer {
    margin-top: 80px;
    padding-top: 32px;
    border-top: 1px solid rgba(107, 122, 141, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-label {
    color: var(--accent-green);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.footer-meta {
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darkest);
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 158, 111, 0.4);
    border-radius: 4px;
    border: 1px solid var(--bg-darkest);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    #main-content {
        grid-template-columns: 1fr;
    }

    #debug-sidebar {
        position: static;
        height: auto;
        max-height: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(74, 158, 111, 0.2);
        padding: 20px 24px;
    }

    #debug-sidebar::before {
        display: none;
    }

    .timeline-spine {
        display: none;
    }

    .sidebar-nav {
        margin-bottom: 12px;
    }

    .sidebar-status {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .status-line {
        margin-bottom: 0;
    }

    #content-panel {
        padding: 36px 28px 60px;
    }

    .diagonal-divider {
        margin: 32px -28px;
    }
}

@media (max-width: 640px) {
    #content-panel {
        padding: 28px 20px 48px;
    }

    .diagonal-divider {
        margin: 24px -20px;
    }

    .document-title {
        font-size: 36px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .watch-header,
    .watch-item {
        grid-template-columns: 1fr 100px;
    }

    .watch-header span:nth-child(2),
    .watch-item .watch-type,
    .watch-header span:nth-child(3),
    .watch-item .watch-value {
        display: none;
    }

    .stack-frame {
        grid-template-columns: 40px 1fr;
        gap: 14px;
        padding: 16px;
    }
}
