/* ==========================================================================
   API Toolkit — Minimal Developer UI Stylesheet
   System Fonts • Single Accent • Compact Grid • Zero Dependencies
   ========================================================================== */

:root {
    /* Light surface palette */
    --bg-body: #fafafa;
    --bg-surface: #ffffff;
    --bg-alt: #f4f4f5;
    --bg-subtle: #f8fafc;
    --bg-editor: #ffffff;
    --bg-editor-readonly: #fafafa;

    /* Typography colors */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-editor: #0f172a;

    /* Borders */
    --border-color: #d4d4d8;
    --border-subtle: #e4e4e7;
    --border-strong: #a1a1aa;

    /* Single primary accent color */
    --accent-primary: #0284c7;
    --accent-primary-hover: #0369a1;
    --accent-primary-active: #075985;
    --accent-subtle: #f0f9ff;
    --accent-border: #bae6fd;
    --accent-focus: #0284c7;

    /* Status & Semantic Feedback */
    --status-ok-bg: #f0fdf4;
    --status-ok-border: #86efac;
    --status-ok-text: #166534;

    --status-err-bg: #fef2f2;
    --status-err-border: #fca5a5;
    --status-err-text: #991b1b;

    --status-neutral-bg: #f8fafc;
    --status-neutral-border: #e2e8f0;
    --status-neutral-text: #334155;

    /* Diff Change Colors */
    --diff-added-bg: #dcfce7;
    --diff-added-border: #86efac;
    --diff-added-text: #166534;

    --diff-removed-bg: #fee2e2;
    --diff-removed-border: #fca5a5;
    --diff-removed-text: #991b1b;

    --diff-changed-bg: #fef3c7;
    --diff-changed-border: #fcd34d;
    --diff-changed-text: #92400e;

    /* System Fonts */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Compact Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* Radii */
    --radius-sm: 5px;
    --radius-md: 6px;
}

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

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.main-content {
    flex: 1 0 auto;
}

/* Accessibility Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    background: var(--accent-primary);
    color: #ffffff;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1000;
    text-decoration: none;
}

.skip-link:focus {
    top: var(--space-2);
    outline: 2px solid var(--accent-focus);
    outline-offset: 2px;
}

/* Centered Container */
.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* ==========================================================================
   1. Compact Header & Navigation
   ========================================================================== */

.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    gap: var(--space-3);
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.brand-logo:hover {
    color: var(--accent-primary);
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-subtle);
    color: var(--accent-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.12rem 0.38rem;
    border-radius: 4px;
    border: 1px solid var(--accent-border);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

.header-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 32px;
    padding: 0 0.55rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background-color: var(--bg-body);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.header-search-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background-color: var(--bg-alt);
}

.header-search-btn kbd {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1;
    padding: 0.12rem 0.3rem;
    border-radius: 3px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.primary-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    height: 32px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0 0.6rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-alt);
}

.nav-link.is-active {
    color: var(--accent-primary);
    background-color: var(--accent-subtle);
    font-weight: 600;
}

.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 34px;
    height: 34px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem;
    cursor: pointer;
    color: var(--text-primary);
}

.mobile-nav-toggle:hover {
    background-color: var(--bg-alt);
}

.hamburger-bar {
    display: block;
    width: 15px;
    height: 1.5px;
    background-color: var(--text-primary);
    margin: 1.75px 0;
}

/* ==========================================================================
   2. Compact Breadcrumbs
   ========================================================================== */

.breadcrumb-nav {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.35rem 0;
    font-size: 0.78rem;
}

.breadcrumb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.breadcrumb-separator {
    margin-left: 0.3rem;
    color: var(--border-color);
}

/* ==========================================================================
   3. Homepage Directory — Search, Category Filters & Compact Tool Grid
   ========================================================================== */

.home-directory {
    padding: var(--space-5) 0 var(--space-8);
}

.home-intro {
    margin-bottom: var(--space-4);
}

.hero-title {
    font-size: clamp(1.35rem, 2.2vw, 1.6rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    max-width: 680px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

/* Search & Category Bar */
.directory-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.search-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 520px;
    width: 100%;
}

.search-box-icon {
    position: absolute;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    pointer-events: none;
}

.tool-search-input {
    width: 100%;
    height: 40px;
    padding: 0 3.75rem 0 2.3rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    appearance: none;
}

.tool-search-input::placeholder {
    color: var(--text-muted);
}

.tool-search-input:hover {
    border-color: var(--border-strong);
}

.tool-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.tool-search-input::-webkit-search-cancel-button {
    display: none;
}

.search-kbd-hint {
    position: absolute;
    right: 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 0.45rem;
    height: 26px;
    padding: 0 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-alt);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
}

.search-clear-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Compact Category Filter Pills */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 0.65rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
}

.category-pill:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
    background-color: var(--bg-alt);
}

.category-pill.is-active {
    background-color: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
    font-weight: 600;
}

/* Tool Category Groups & Compact Grid */
.tools-catalog {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.tool-category-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.category-group-title {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.5rem 0.65rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    min-width: 0;
}

.tool-item.is-active-tool {
    border-color: var(--border-color);
}

.tool-item.is-active-tool:hover {
    border-color: var(--accent-primary);
    background-color: var(--accent-subtle);
}

.tool-item.is-active-tool:hover .tool-item-name {
    color: var(--accent-primary-active);
}

.tool-item.is-active-tool:hover .tool-item-arrow {
    color: var(--accent-primary);
    transform: translateX(2px);
}

.tool-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background-color: var(--accent-subtle);
    color: var(--accent-primary);
    flex-shrink: 0;
}

.tool-item.is-coming-soon {
    background-color: var(--bg-body);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
    cursor: default;
}

.tool-item.is-coming-soon .tool-item-icon {
    background-color: var(--bg-alt);
    color: var(--text-muted);
}

.tool-item-name {
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--text-primary);
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.tool-item.is-coming-soon .tool-item-name {
    color: var(--text-secondary);
}

.tool-item-arrow {
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.12s ease, color 0.12s ease;
}

.tool-item-status {
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text-muted);
    background-color: var(--bg-alt);
    border: 1px solid var(--border-subtle);
    padding: 0.15rem 0.38rem;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Empty Search State */
.tools-empty-state {
    padding: var(--space-6) var(--space-4);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: center;
}

.tools-empty-title {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tools-empty-desc {
    margin: 0 0 var(--space-3);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   4. Buttons & Focus States
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 34px;
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn:focus-visible,
.btn-chip:focus-visible,
.toolbar-select:focus-visible,
.code-editor:focus-visible,
.filter-chip:focus-visible,
.nav-link:focus-visible,
.header-search-btn:focus-visible,
.mobile-nav-toggle:focus-visible,
.category-pill:focus-visible,
.search-clear-btn:focus-visible,
.tool-item:focus-visible {
    outline: 2px solid var(--accent-focus);
    outline-offset: 2px;
}

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

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
}

.btn-primary:active {
    background-color: var(--accent-primary-active);
}

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

.btn-secondary:hover {
    background-color: var(--bg-alt);
    border-color: var(--border-strong);
}

.btn-danger-ghost {
    background-color: var(--bg-surface);
    color: #b91c1c;
    border-color: #fecaca;
}

.btn-danger-ghost:hover {
    background-color: #fef2f2;
    border-color: #fca5a5;
}

/* ==========================================================================
   5. Tool Pages (JSON Formatter & JSON Diff)
   ========================================================================== */

.tool-header-section {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-3) 0;
}

.tool-header-section h1 {
    font-size: clamp(1.25rem, 2vw, 1.45rem);
    margin: 0 0 0.15rem;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.tool-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-alt);
    border: 1px solid var(--border-subtle);
    padding: 0.12rem 0.45rem;
    border-radius: 3px;
    margin-bottom: 0.25rem;
}

.tool-lead {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 760px;
}

.tool-workspace-section {
    padding: var(--space-3) 0 var(--space-6);
}

.workspace-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.6rem;
    margin-bottom: var(--space-2);
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.toolbar-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.toolbar-select {
    min-height: 34px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
}

.toolbar-input {
    min-height: 34px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

.toolbar-input-mono {
    font-family: var(--font-mono);
}

.toolbar-input:focus {
    outline: 2px solid var(--accent-focus);
    outline-offset: 1px;
}

.toolbar-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0.35rem;
}

.toolbar-check input[type="checkbox"] {
    margin: 0;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Compact Metric / Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
}

.stat-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
}

.stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
}

/* Single-Column Editor Stack & Panels */
.editor-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.code-editor-sm {
    min-height: 150px;
}

.code-editor-md {
    min-height: 260px;
}

.panel-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-top: var(--space-3);
}

.panel-box-title {
    margin: 0 0 var(--space-2);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Text Diff Viewer */
.text-diff-output {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.5;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    max-height: 520px;
    overflow: auto;
    background-color: var(--bg-surface);
}

.text-diff-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-subtle);
}

.text-diff-row:last-child {
    border-bottom: 0;
}

.text-diff-num {
    width: 46px;
    padding: 0.2rem 0.45rem;
    text-align: right;
    color: var(--text-muted);
    background-color: var(--bg-alt);
    border-right: 1px solid var(--border-subtle);
    user-select: none;
    flex-shrink: 0;
    font-size: 0.74rem;
}

.text-diff-sign {
    width: 24px;
    padding: 0.2rem 0;
    text-align: center;
    font-weight: 700;
    user-select: none;
    flex-shrink: 0;
}

.text-diff-content {
    padding: 0.2rem 0.6rem;
    white-space: pre-wrap;
    word-break: break-all;
    flex: 1 1 auto;
    min-width: 0;
}

.text-diff-added {
    background-color: var(--diff-added-bg);
    color: var(--diff-added-text);
}

.text-diff-removed {
    background-color: var(--diff-removed-bg);
    color: var(--diff-removed-text);
}

.text-diff-unchanged {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

.copy-inline-btn {
    height: 26px;
    padding: 0 0.55rem;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
}

.copy-inline-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background-color: var(--accent-subtle);
}

/* Status & Error Diagnostic Banner */
.status-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--status-neutral-border);
    background-color: var(--status-neutral-bg);
    color: var(--status-neutral-text);
    font-size: 0.83rem;
    font-weight: 500;
    margin-bottom: var(--space-2);
    min-height: 36px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: #64748b;
}

.status-banner.status-ok {
    background-color: var(--status-ok-bg);
    border-color: var(--status-ok-border);
    color: var(--status-ok-text);
}

.status-banner.status-ok .status-indicator {
    background-color: #16a34a;
}

.status-banner.status-error {
    background-color: var(--status-err-bg);
    border-color: var(--status-err-border);
    color: var(--status-err-text);
}

.status-banner.status-error .status-indicator {
    background-color: #dc2626;
}

/* Two-Column Editor Grid */
.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    align-items: stretch;
}

.editor-pane {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.editor-pane:focus-within {
    border-color: var(--accent-primary);
}

.editor-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background-color: var(--bg-alt);
    border-bottom: 1px solid var(--border-subtle);
}

.editor-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.editor-meta {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--text-muted);
}

.code-editor {
    width: 100%;
    min-height: 420px;
    resize: vertical;
    border: 0;
    padding: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    line-height: 1.5;
    background-color: var(--bg-editor);
    color: var(--text-editor);
    tab-size: 2;
    overflow-x: auto;
}

.code-editor::placeholder {
    color: #94a3b8;
}

.code-editor-readonly {
    background-color: var(--bg-editor-readonly);
}

/* Minimal Workspace Footer Meta Bar */
.workspace-footer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.workspace-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
}

.status-divider {
    color: var(--border-color);
}

.workspace-status-row kbd,
.diff-empty-desc kbd {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 0.05rem 0.28rem;
    color: var(--text-secondary);
}

.sample-presets-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.sample-presets-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.btn-chip {
    display: inline-flex;
    align-items: center;
    height: 26px;
    font-family: var(--font-sans);
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 0 0.5rem;
    cursor: pointer;
}

.btn-chip:hover {
    color: var(--accent-primary);
    border-color: var(--accent-border);
    background-color: var(--accent-subtle);
}

/* JSON Diff Empty Hint & Comparison Results */
.diff-empty-state {
    margin-top: var(--space-2);
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.diff-empty-desc {
    margin: 0;
    font-size: 0.82rem;
}

.diff-results-panel {
    margin-top: var(--space-3);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-3);
}

.diff-results-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
}

.diff-results-title-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.diff-results-header h2 {
    margin: 0;
    font-size: 0.95rem;
}

.diff-summary-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
}

.summary-pill-added {
    background-color: var(--diff-added-bg);
    color: var(--diff-added-text);
    border: 1px solid var(--diff-added-border);
}

.summary-pill-removed {
    background-color: var(--diff-removed-bg);
    color: var(--diff-removed-text);
    border: 1px solid var(--diff-removed-border);
}

.summary-pill-changed {
    background-color: var(--diff-changed-bg);
    color: var(--diff-changed-text);
    border: 1px solid var(--diff-changed-border);
}

.diff-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    height: 30px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
}

.filter-chip:hover {
    background-color: var(--bg-alt);
    color: var(--text-primary);
}

.filter-chip.is-active {
    background-color: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
}

.diff-equivalent-box {
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    background-color: var(--status-ok-bg);
    border: 1px solid var(--status-ok-border);
    color: var(--status-ok-text);
    font-size: 0.85rem;
}

.diff-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.diff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.diff-table th,
.diff-table td {
    text-align: left;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}

.diff-table tr:last-child td {
    border-bottom: 0;
}

.diff-table th {
    background-color: var(--bg-alt);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.diff-path-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.diff-val-cell {
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 340px;
}

.diff-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.42rem;
    border-radius: 3px;
    white-space: nowrap;
}

.diff-badge-added {
    background-color: var(--diff-added-bg);
    color: var(--diff-added-text);
    border: 1px solid var(--diff-added-border);
}

.diff-badge-removed {
    background-color: var(--diff-removed-bg);
    color: var(--diff-removed-text);
    border: 1px solid var(--diff-removed-border);
}

.diff-badge-changed {
    background-color: var(--diff-changed-bg);
    color: var(--diff-changed-text);
    border: 1px solid var(--diff-changed-border);
}

/* ==========================================================================
   6. Subtle Google AdSense Placement (Only Rendered When Configured)
   ========================================================================== */

.ad-slot-wrapper {
    padding: var(--space-2) 0;
}

.ad-slot-wrapper .container {
    padding: 0;
}

.ad-slot-container {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    padding: 0.5rem 0.75rem;
    text-align: center;
    overflow: hidden;
}

.ad-slot-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   7. Restrained SEO Documentation & FAQ Sections
   ========================================================================== */

.section {
    padding: var(--space-6) 0;
}

.content-section {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
}

.content-prose {
    max-width: 860px;
}

.content-prose h2 {
    font-size: 1.1rem;
    margin: var(--space-6) 0 var(--space-2);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.content-prose h2:first-child {
    margin-top: 0;
}

.content-prose p,
.content-prose li {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.content-prose a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.content-prose a:hover {
    text-decoration: underline;
}

.content-prose code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background-color: var(--bg-alt);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin: var(--space-3) 0;
}

.info-card {
    background-color: var(--bg-body);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
}

.info-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.info-card ul {
    margin: 0;
    padding-left: 1.1rem;
}

.info-card li {
    margin-bottom: 0.25rem;
    font-size: 0.84rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.faq-item {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.8rem;
    background-color: var(--bg-body);
}

.faq-item summary {
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    color: var(--text-primary);
}

.faq-item p {
    margin: 0.45rem 0 0;
    font-size: 0.84rem;
}

.related-tools-box {
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background-color: var(--bg-body);
    border: 1px solid var(--border-subtle);
}

.related-tools-box h3 {
    margin: 0 0 0.2rem;
    font-size: 0.9rem;
}

.related-tools-box p {
    margin: 0;
    font-size: 0.84rem;
}

.alert {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-3);
    font-size: 0.85rem;
}

.alert-error {
    background-color: var(--status-err-bg);
    border: 1px solid var(--status-err-border);
    color: var(--status-err-text);
}

/* ==========================================================================
   8. Minimal Footer
   ========================================================================== */

.site-footer {
    background-color: var(--bg-surface);
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-4) 0;
    margin-top: auto;
    font-size: 0.8rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
}

.footer-copy {
    margin: 0;
    color: var(--text-secondary);
}

.footer-sep {
    margin: 0 0.35rem;
    color: var(--border-color);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* ==========================================================================
   9. Responsive Breakpoints (1920px, 1366px, 768px, 430px, 390px, 360px)
   ========================================================================== */

/* 3 columns on medium screens / tablets */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Stack editors on tablet & mobile */
@media (max-width: 860px) {
    .editor-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .code-editor {
        min-height: 260px;
    }
}

/* 2 columns on mobile (e.g. 430px up to 720px) + collapsible mobile menu */
@media (max-width: 720px) {
    .container {
        padding: 0 0.85rem;
    }

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

    .mobile-nav-toggle {
        display: inline-flex;
    }

    .primary-nav {
        display: none;
        width: 100%;
        padding: var(--space-2) 0;
        border-top: 1px solid var(--border-subtle);
    }

    .primary-nav.is-open {
        display: flex;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        height: 38px;
    }

    .workspace-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-group {
        width: 100%;
    }

    .toolbar-group .btn,
    .toolbar-group .toolbar-select {
        flex: 1 1 auto;
        min-height: 38px;
    }

    .tool-item {
        flex-wrap: wrap;
        padding: 0.45rem 0.55rem;
    }
}

/* Fall back to 1 column on narrow screens (< 420px, e.g. 360px & 390px) */
@media (max-width: 419px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .header-search-btn kbd {
        display: none;
    }
}
