/* ===== CSS Variables (Dark Mode Default) ===== */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1b23;
    --bg-tertiary: #22232d;
    --bg-card: #1e1f2b;
    --bg-input: #14151f;
    --border-color: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.18);
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59,130,246,0.25);
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --json-key: #93c5fd;
    --json-string: #86efac;
    --json-number: #fbbf24;
    --json-boolean: #c084fc;
    --json-null: #f87171;
    --json-bracket: #71717a;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --radius: 10px;
    --radius-lg: 14px;
    --transition: 0.2s ease;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #f4f4f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9fafb;
    --bg-card: #ffffff;
    --bg-input: #f4f4f5;
    --border-color: rgba(0,0,0,0.1);
    --border-hover: rgba(0,0,0,0.2);
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37,99,235,0.15);
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --json-key: #2563eb;
    --json-string: #16a34a;
    --json-number: #d97706;
    --json-boolean: #9333ea;
    --json-null: #dc2626;
    --json-bracket: #a1a1aa;
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Fixed frame layout - tool fills viewport, guide content below fold */
body.fixed-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.fixed-layout main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - 56px);
    flex: none;
    padding: 12px 20px;
}

body.fixed-layout .page-header,
body.fixed-layout .toolbar,
body.fixed-layout .tabs {
    flex-shrink: 0;
}

body.fixed-layout .tab-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

body.fixed-layout .tab-panel.active {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.fixed-layout .tab-panel.active.tab-panel-flex {
    display: flex;
    flex-direction: column;
}

body.fixed-layout .tab-panel .editor-area {
    flex: 1;
    min-height: 0;
    resize: none;
}

body.fixed-layout .tab-panel .output-area {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

body.fixed-layout .site-footer {
    display: block;
}

/* ===== Navigation ===== */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-logo span {
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hamburger menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px;
}

/* Theme toggle */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition);
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* ===== Main Content ===== */
main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 24px;
}

body.fixed-layout .page-header {
    margin-bottom: 12px;
}

body.fixed-layout .page-header p {
    display: none;
}

body.fixed-layout .toolbar {
    margin-bottom: 8px;
}

body.fixed-layout .status-bar {
    margin-top: 4px;
    flex-shrink: 0;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ===== Card ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

/* ===== Editor Panels ===== */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 500px;
}

/* Full-width single panel layout (tab-based) */
.editor-layout.single {
    grid-template-columns: 1fr;
}

.editor-panel {
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    min-height: 44px;
}

.panel-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.editor-area {
    flex: 1;
    width: 100%;
    min-height: 500px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 14px;
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    tab-size: 2;
    transition: border-color var(--transition);
    white-space: pre;
    overflow-x: auto;
    word-wrap: normal;
}

.editor-area:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.editor-area::placeholder {
    color: var(--text-muted);
    white-space: pre-wrap;
}

.output-area {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 14px;
    overflow: auto;
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    min-height: 500px;
}

/* Tab panel content - hidden by default */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel.active.tab-panel-flex { display: flex; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
}

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

.btn-danger {
    background: transparent;
    color: var(--error);
    border-color: var(--error);
}

.btn-danger:hover {
    background: var(--error);
    color: #fff;
}

/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

/* ===== Select ===== */
.select {
    padding: 6px 28px 6px 10px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    font-family: inherit;
}

.select option {
    background: var(--bg-secondary);
}

/* ===== Status Bar ===== */
.status-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.valid { background: var(--success); }
.status-dot.invalid { background: var(--error); }
.status-dot.neutral { background: var(--text-muted); }

/* ===== Tree View ===== */
.tree-view {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}

.tree-node {
    padding-left: 18px;
    border-left: 1px solid var(--border-color);
    margin-left: 7px;
}

.tree-node:hover {
    border-left-color: var(--border-hover);
}

.tree-line {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 1px 0;
    cursor: default;
    border-radius: 3px;
    position: relative;
}

/* Horizontal branch line from vertical guide to content */
.tree-node > .tree-line::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 9px;
    width: 14px;
    border-top: 1px solid var(--border-color);
}

.tree-node:hover > .tree-line::before {
    border-top-color: var(--border-hover);
}

.tree-line:hover {
    background: rgba(255,255,255,0.04);
}

[data-theme="light"] .tree-line:hover {
    background: rgba(0,0,0,0.03);
}

.tree-toggle {
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-hover);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    background: var(--bg-tertiary);
    transition: background var(--transition), color var(--transition);
}

.tree-toggle:hover {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
}

/* {} [] type badges */
.tree-type-badge {
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-right: 4px;
    font-weight: 700;
}

.tree-type-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
    margin-top: 6px;
}

.tree-key {
    color: var(--json-key);
    cursor: pointer;
}

.tree-key:hover {
    text-decoration: underline;
}

.tree-string { color: var(--json-string); user-select: text; cursor: text; }
.tree-number { color: var(--json-number); user-select: text; cursor: text; }
.tree-boolean { color: var(--json-boolean); user-select: text; cursor: text; }
.tree-null { color: var(--json-null); font-style: italic; user-select: text; cursor: text; }

/* Selected tree line */
.tree-line.selected {
    background: var(--accent-glow);
    outline: 1px solid var(--accent);
    outline-offset: -1px;
    border-radius: 3px;
}

/* Node detail panel */
.node-detail {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 6px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-size: 0.78rem;
    flex-wrap: wrap;
    flex-shrink: 0;
    flex-shrink: 0;
}

.node-detail.visible {
    display: flex;
}

.node-detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.node-detail-label {
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.node-detail-val {
    color: var(--text-primary);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: text;
    cursor: text;
}

.node-detail-copy {
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border-color);
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: inherit;
    transition: all var(--transition);
}

.node-detail-copy:hover {
    color: var(--accent);
    background: var(--accent-glow);
    border-color: var(--accent);
}
.tree-bracket { color: var(--json-bracket); }
.tree-comma { color: var(--json-bracket); }
.tree-colon { color: var(--json-bracket); margin: 0 4px; }
.tree-ellipsis { color: var(--text-muted); font-style: italic; cursor: pointer; }
.tree-highlight { background: rgba(251, 191, 36, 0.2); border-radius: 2px; padding: 0 2px; }
.tree-highlight-current { background: rgba(251, 191, 36, 0.5); outline: 2px solid var(--warning); outline-offset: -1px; }

/* Search navigation buttons */
.tree-search-bar .btn-search {
    padding: 3px 8px;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition);
    white-space: nowrap;
}

.tree-search-bar .btn-search:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-hover);
}
.tree-count { color: var(--text-muted); font-size: 0.75rem; margin-left: 6px; }

/* ===== Syntax Highlighted Code ===== */
.code-view {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-view .json-key { color: var(--json-key); }
.code-view .json-string { color: var(--json-string); }
.code-view .json-number { color: var(--json-number); }
.code-view .json-boolean { color: var(--json-boolean); }
.code-view .json-null { color: var(--json-null); }
.code-view .json-bracket { color: var(--json-bracket); }

/* ===== Diff View ===== */
.diff-added { background: rgba(34,197,94,0.12); border-left: 3px solid var(--success); padding-left: 8px; }
.diff-removed { background: rgba(239,68,68,0.12); border-left: 3px solid var(--error); padding-left: 8px; }
.diff-changed { background: rgba(245,158,11,0.12); border-left: 3px solid var(--warning); padding-left: 8px; }

/* ===== Drag & Drop ===== */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    margin-bottom: 16px;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.drop-zone .drop-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.drop-zone .drop-text {
    font-size: 0.85rem;
}

.drop-zone .drop-text span {
    color: var(--accent);
    font-weight: 600;
}

/* Compact inline drop zone */
.drop-zone-inline {
    display: none;
}

/* Drag overlay on textarea */
.editor-area.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* ===== Nav Dropdown ===== */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-dropdown-toggle.has-active {
    color: var(--accent);
}

.nav-dropdown-menu {
    display: none;
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 6px;
    min-width: 160px;
    box-shadow: var(--shadow);
    z-index: 9999;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all var(--transition);
}

.nav-dropdown-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-dropdown-menu a.active {
    color: var(--accent);
    background: var(--accent-glow);
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    box-shadow: var(--shadow);
}

.toast-success {
    background: var(--success);
    color: #fff;
}

.toast-error {
    background: var(--error);
    color: #fff;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ===== Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 12px;
}

.data-table th, .data-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table td {
    color: var(--text-primary);
}

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

/* ===== Search Box ===== */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    font-family: inherit;
    transition: border-color var(--transition);
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.search-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 8px;
}

/* Tree search bar fixed at bottom of tree panel */
.tree-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius) var(--radius);
    flex-shrink: 0;
}

/* Tree panel flex layout */
.tree-panel-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tree-panel-content .tree-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.tree-panel-content .output-area {
    flex: 1;
    overflow: auto;
    min-height: 0;
    border-radius: 0;
}

/* ===== Options Row ===== */
.options-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-group label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===== Input ===== */
.input {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    transition: border-color var(--transition);
}

.input:focus {
    border-color: var(--accent);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
}

[data-theme="light"] .tab:hover {
    background: rgba(0,0,0,0.03);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--bg-input);
}

.tab-body {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--bg-input);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.tab-body .editor-area {
    border: none;
    border-radius: 0 0 var(--radius) var(--radius);
    min-height: 500px;
    flex: 1;
}

.tab-body .output-area {
    border: none;
    border-radius: 0 0 var(--radius) var(--radius);
    min-height: 500px;
    flex: 1;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    margin-top: auto;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== Content Pages (About, Privacy, Terms) ===== */
.content-page {
    max-width: 800px;
    margin: 0 auto;
}

.content-page h2 {
    font-size: 1.2rem;
    margin: 28px 0 10px;
    color: var(--text-primary);
}

.content-page p, .content-page li {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.content-page ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.content-page a {
    color: var(--accent);
}

/* ===== Tool Grid (About page) ===== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.tool-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    transition: all var(--transition);
}

.tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.tool-card h3 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tool-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Accessibility: Focus Indicators ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ===== Guide / Educational Content Section ===== */
.guide-section {
    max-width: 960px;
    margin: 40px auto 0;
    padding: 0 20px 40px;
}

.guide-section h2 {
    font-size: 1.3rem;
    margin: 32px 0 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.guide-section h2:first-child {
    margin-top: 0;
}

.guide-section h3 {
    font-size: 1.05rem;
    margin: 20px 0 8px;
    color: var(--text-primary);
}

.guide-section p, .guide-section li {
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.guide-section ul, .guide-section ol {
    padding-left: 20px;
    margin: 8px 0 16px;
}

.guide-section li {
    margin-bottom: 6px;
}

.guide-section code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--accent);
}

.guide-section .guide-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px 24px;
    margin: 16px 0;
}

.guide-steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.guide-steps li {
    counter-increment: step;
    padding-left: 36px;
    position: relative;
    margin-bottom: 12px;
}

.guide-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-item summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-item summary::before {
    content: '+';
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.faq-item[open] summary::before {
    content: '\2212';
}

.faq-item .faq-answer {
    padding: 12px 16px 16px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
    .editor-area, .output-area {
        min-height: 300px;
    }
    .tab-body { min-height: 300px; }
    .tab-body .editor-area, .tab-body .output-area { min-height: 300px; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 8px;
        box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .nav-dropdown-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        box-shadow: none;
        border: none;
        padding-left: 12px;
        margin-top: 0;
    }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .nav-toggle { display: block; }
    .page-header h1 { font-size: 1.3rem; }
    .toolbar { gap: 6px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .editor-layout { min-height: 350px; }
}
