/* ============================================================
           GLOBAL RESET & VARIABLES
           ============================================================ */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        :root {
            /* neutrals */
            --primary: #171923;
            --primary-light: #2A3142;
            --bg: #F7F8FC;
            --bg-tint: #EEF1FA;
            --card-bg: #FFFFFF;
            --text: #171923;
            --text-secondary: #666C80;
            --border: #E2E5F0;

            /* brand (indigo-blue, distinct from the fitness site's green) */
            --accent: #4F5FEE;
            --accent-hover: #3F4DDB;
            --accent-tint: #EBEDFE;
            --lime: #4F5FEE;

            /* secondary functional colors (kept distinct from brand for semantics) */
            --success: #12C26B;
            --success-tint: #E4FBEF;
            --danger: #E5484D;
            --danger-tint: #FDECEC;

            /* category colors */
            --cat-core: #4F5FEE;      --cat-core-tint: #EBEDFE;
            --cat-sql: #0EA5A5;       --cat-sql-tint: #E2F8F8;
            --cat-productivity: #E08A2E; --cat-productivity-tint: #FCEEDD;
            --cat-analysis: #8B5CF6;  --cat-analysis-tint: #F1EBFE;
            --cat-design: #EC4899;   --cat-design-tint: #FDE8F3;

            --shadow: 0 4px 16px -4px rgba(23,25,35,.08), 0 2px 6px -2px rgba(23,25,35,.05);
            --shadow-sm: 0 1px 2px rgba(23,25,35,.04), 0 2px 8px -2px rgba(23,25,35,.06);
            --shadow-lift: 0 24px 48px -16px rgba(23,25,35,.18), 0 8px 20px -8px rgba(23,25,35,.1);
            --radius: 14px;
            --r-sm: 10px;
            --r-lg: 20px;
            --r-pill: 999px;
            --sidebar-width: 240px;
            --right-sidebar-width: 320px;
            --header-height: 72px;
            --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
            --display: 'Plus Jakarta Sans', var(--font);
            --mono: 'Menlo', 'Cascadia Code', 'Consolas', monospace;

            /* theme-independent dark surface, for UI that stays dark regardless
               of light/dark mode (cookie banner, sticky-notes toolbar) */
            --dark-surface: #171923;
            --dark-surface-2: #232635;
        }
        [data-theme="dark"] {
            --primary: #F3F3F9;
            --primary-light: #C7CAD9;
            --bg: #0F1117;
            --bg-tint: #171A23;
            --card-bg: #171A23;
            --text: #F3F3F9;
            --text-secondary: #9498AC;
            --border: #2A2E3D;
            --accent: #7B87FF;
            --accent-hover: #939DFF;
            --accent-tint: #232A4D;
            --lime: #7B87FF;
            --success: #3FD79C;
            --success-tint: #163229;
            --danger: #FF7A7E;
            --danger-tint: #3A1D1F;
            --shadow: 0 4px 16px -4px rgba(0,0,0,.45), 0 2px 6px -2px rgba(0,0,0,.3);
            --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px -2px rgba(0,0,0,.35);
            --shadow-lift: 0 24px 48px -16px rgba(0,0,0,.6), 0 8px 20px -8px rgba(0,0,0,.4);
        }
        html {
            scroll-behavior: smooth;
        }
        body {
            font-family: var(--font);
            background: var(--bg);
            color: var(--text);
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            transition: background .15s ease, color .15s ease;
        }

        /* ============================================================
           LAYOUT
           ============================================================ */
        .app-wrapper {
            display: flex;
            flex: 1;
            padding-top: var(--header-height);
            min-height: calc(100vh - var(--header-height));
        }

        /* ============================================================
           HEADER
           ============================================================ */
        .header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: var(--header-height);
            background: color-mix(in srgb, var(--card-bg) 90%, transparent);
            backdrop-filter: saturate(1.6) blur(14px);
            color: var(--text);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
            z-index: 1000;
            border-bottom: 1px solid var(--border);
            gap: 8px;
        }
        .header-brand {
            display: flex;
            align-items: baseline;
            gap: 8px;
            font-family: var(--display);
            font-size: 20px;
            font-weight: 800;
            letter-spacing: -0.03em;
            color: var(--text);
        }
        .header-brand span {
            color: var(--accent);
        }
        .header-brand small {
            font-size: 11px;
            font-weight: 500;
            color: var(--text-secondary);
            letter-spacing: 0.2px;
            font-family: var(--font);
        }
        .header-right {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .header-nav-links {
            display: flex;
            gap: 2px;
            align-items: center;
            margin-right: 4px;
        }
        .header-nav-links a {
            color: var(--text-secondary);
            text-decoration: none;
            font-family: var(--display);
            font-size: 15px;
            font-weight: 600;
            padding: 10px 14px;
            border-radius: 10px;
            transition: all 0.12s;
        }
        .header-nav-links a:hover {
            background: var(--bg-tint);
            color: var(--text);
        }
        .header-nav-links a.active-link {
            background: var(--accent-tint);
            color: var(--accent);
        }
        .header-nav-links a.active-link:hover {
            background: var(--accent-tint);
        }
        .bmc-btn {
            background: #ff813f;
            color: #fff;
            border: none;
            border-radius: var(--r-pill);
            padding: 10px 18px;
            font-size: 13.5px;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.15s;
            font-family: var(--display);
            text-decoration: none;
            box-shadow: 0 10px 20px -8px rgba(255,129,63,.5);
        }
        .bmc-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 12px 24px -6px rgba(255, 129, 63, 0.55);
        }

        .menu-toggle {
            display: none;
            width: 42px; height: 42px;
            align-items: center;
            justify-content: center;
            background: var(--card-bg);
            border: 1.5px solid var(--border);
            border-radius: 12px;
            color: var(--text-secondary);
            font-size: 19px;
            cursor: pointer;
            padding: 0;
            transition: border-color .14s, color .14s, background .14s;
        }
        .menu-toggle:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--accent-tint);
        }

        /* icon buttons (theme toggle etc.) — matches the mobile menu button */
        .icon-btn {
            width: 42px; height: 42px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1.5px solid var(--border);
            background: var(--card-bg);
            border-radius: 12px;
            cursor: pointer;
            color: var(--text-secondary);
            flex: none;
            transition: border-color .14s, color .14s, background .14s;
        }
        .icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
        .icon-btn svg { width: 19px; height: 19px; }
        [data-theme="dark"] .icon-sun { display: none; }
        :root:not([data-theme="dark"]) .icon-moon { display: none; }

        /* header dropdown category nav, matching the fitness site's pattern */
        .main-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
        .nav-item { position: relative; }
        .nav-trig {
            display: inline-flex; align-items: center; gap: 6px;
            font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--text-secondary);
            background: none; border: 0; cursor: pointer; padding: 10px 12px; border-radius: 10px;
            white-space: nowrap; transition: background .14s, color .14s;
        }
        .nav-trig:hover, .nav-item[data-open="true"] .nav-trig, .nav-item:focus-within .nav-trig { background: var(--bg-tint); color: var(--text); }
        .nav-caret { width: 13px; height: 13px; flex: none; transition: transform .16s ease; }
        .nav-item[data-open="true"] .nav-caret { transform: rotate(180deg); }
        .nav-drop {
            position: absolute; left: 0; top: calc(100% + 6px); min-width: 240px;
            background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px;
            box-shadow: var(--shadow-lift); padding: 10px; z-index: 60;
            opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px);
            transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
        }
        /* Invisible bridge over the gap above the dropdown — without this, moving
           the mouse from the trigger down to the dropdown crosses a dead zone with
           no hoverable element under it, breaking the hover chain and closing the
           menu before the cursor arrives. */
        .nav-drop::before {
            content: "";
            position: absolute;
            top: -6px; left: 0; right: 0; height: 6px;
        }
        .nav-item[data-open="true"] .nav-drop {
            opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
            transition: opacity .14s ease, transform .14s ease;
        }
        @media (hover: hover) and (pointer: fine) {
            .nav-item:hover .nav-drop, .nav-item:focus-within .nav-drop {
                opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
                transition: opacity .14s ease, transform .14s ease;
            }
        }
        .nav-drop ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; max-height: 60vh; overflow-y: auto; }
        .nav-drop ul a {
            display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary);
            text-decoration: none; padding: 9px 10px; border-radius: 9px; line-height: 1.35;
            transition: background .12s, color .12s;
        }
        .nav-drop ul a:hover, .nav-drop ul a:focus-visible { background: var(--bg-tint); color: var(--text); }

        /* ============================================================
           RIGHT SIDEBAR (Info Panel with Samples)
           ============================================================ */
        .right-sidebar {
            position: fixed;
            top: var(--header-height);
            right: 0;
            bottom: 0;
            width: var(--right-sidebar-width);
            background: var(--card-bg);
            border-left: 1px solid var(--border);
            overflow-y: auto;
            padding: 22px 18px;
            z-index: 100;
            scrollbar-width: thin;
            font-size: 13px;
            line-height: 1.6;
            color: var(--text-secondary);
            transition: opacity 0.15s ease;
        }
        body.hide-right-sidebar .right-sidebar {
            display: none;
        }
        body.hide-right-sidebar .main-content {
            margin-right: 0;
        }
        body.hide-right-sidebar .footer {
            margin-right: 0;
        }
        .right-sidebar::-webkit-scrollbar {
            width: 4px;
        }
        .right-sidebar::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 4px;
        }
        .right-sidebar .tool-name {
            font-family: var(--display);
            font-size: 18px;
            font-weight: 800;
            color: var(--text);
            margin-bottom: 2px;
        }
        .right-sidebar .tool-desc {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 10px;
        }
        .right-sidebar .how-to {
            background: var(--accent-tint);
            border-radius: var(--r-sm);
            padding: 12px 14px;
            margin-bottom: 10px;
            border-left: none;
            font-size: 12.5px;
            line-height: 1.6;
        }
        .right-sidebar .how-to strong {
            color: var(--text);
            font-family: var(--display);
        }
        .right-sidebar .sample-section {
            background: var(--bg-tint);
            border-radius: var(--r-sm);
            padding: 12px 14px;
            margin-bottom: 10px;
            border-left: none;
        }
        .right-sidebar .sample-section .sample-label {
            font-family: var(--display);
            font-weight: 700;
            font-size: 10.5px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-secondary);
            margin-bottom: 2px;
        }
        .right-sidebar .sample-section .sample-code {
            background: var(--card-bg);
            padding: 7px 10px;
            border-radius: var(--r-sm);
            font-family: var(--mono);
            font-size: 11px;
            color: var(--text);
            border: 1px solid var(--border);
            white-space: pre-wrap;
            word-break: break-all;
            margin-top: 3px;
            line-height: 1.5;
            cursor: pointer;
            user-select: all;
        }
        .right-sidebar .sample-section .sample-code:hover {
            border-color: var(--accent);
        }
        .right-sidebar .sample-section .sample-output {
            margin-top: 5px;
            padding: 7px 10px;
            background: var(--success-tint);
            border-radius: var(--r-sm);
            font-family: var(--mono);
            font-size: 11px;
            color: var(--success);
            border: 1px solid var(--success);
            white-space: pre-wrap;
            word-break: break-all;
        }
        .right-sidebar .sample-section .sample-arrow {
            color: var(--accent);
            font-weight: 700;
            font-size: 14px;
            text-align: center;
            padding: 3px 0;
        }
        .right-sidebar .tool-tip {
            font-size: 12px;
            color: var(--text-secondary);
            border-top: 1px solid var(--border);
            padding-top: 12px;
            margin-top: 6px;
        }

        /* ============================================================
           MAIN CONTENT
           ============================================================ */
        .main-content {
            flex: 1;
            min-width: 0;
            margin-right: var(--right-sidebar-width);
            padding: 28px 32px 44px 32px;
        }

        /* ============================================================
           TOOL PANELS
           ============================================================ */
        .tool-panel {
            display: none;
            animation: fadeUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .tool-panel.active {
            display: block;
        }
        @keyframes fadeUp {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .tool-panel .panel-title {
            font-family: var(--display);
            font-size: 26px;
            font-weight: 800;
            letter-spacing: -0.01em;
            margin-bottom: 4px;
            color: var(--text);
        }
        .tool-panel .panel-sub {
            color: var(--text-secondary);
            font-size: 14.5px;
            margin-bottom: 22px;
        }

        /* ============================================================
           NUMBERED TEXTAREA (used across all tools)
           ============================================================ */
        .numbered-wrap {
            display: flex;
            border: 1.5px solid var(--border);
            border-radius: var(--r-sm);
            overflow: hidden;
            background: var(--card-bg);
            max-height: 400px;
            transition: border-color 0.15s;
        }
        .numbered-wrap:focus-within {
            border-color: var(--accent);
            box-shadow: 0 0 0 4px var(--accent-tint);
        }
        .line-numbers {
            background: var(--bg-tint);
            padding: 10px 6px 10px 10px;
            font-family: var(--mono);
            font-size: 12px;
            line-height: 22px;
            white-space: pre;
            color: var(--text-secondary);
            text-align: right;
            user-select: none;
            border-right: 1.5px solid var(--border);
            min-width: 34px;
            overflow-y: hidden;
            max-height: 400px;
        }
        .numbered-wrap textarea {
            flex: 1;
            border: none;
            padding: 10px 14px;
            font-family: var(--mono);
            font-size: 13px;
            line-height: 1.7;
            resize: none;
            background: transparent;
            min-height: 440px;
            max-height: 480px;
            outline: none;
            color: var(--text);
            overflow-y: auto;
            scrollbar-width: thin;
        }
        .numbered-wrap textarea::placeholder {
            color: var(--text-secondary);
            opacity: .55;
        }
        .numbered-wrap textarea:read-only {
            background: var(--bg-tint);
        }

        /* ============================================================
           DELIM TOOL
           ============================================================ */
        .delim-container {
            background: var(--card-bg);
            border-radius: var(--radius);
            padding: 28px 30px;
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
        }
        .delim-columns {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }
        .delim-col {
            flex: 1;
            min-width: 0;
        }
        .delim-col-label {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 4px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .delim-col-label small {
            font-weight: 400;
            color: var(--text-secondary);
            font-size: 12px;
            background: var(--bg);
            padding: 1px 12px;
            border-radius: 12px;
        }

        .delim-settings {
            background: var(--bg);
            border-radius: 8px;
            padding: 16px 20px;
            border: 1px solid var(--border);
            margin-bottom: 14px;
        }
        .delim-settings h3 {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text);
        }
        .settings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
            gap: 8px 16px;
        }
        .setting-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            flex-wrap: wrap;
        }
        .setting-item label {
            display: flex;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            font-weight: 500;
            font-size: 12px;
        }
        .setting-item input[type="checkbox"] {
            accent-color: var(--accent);
            width: 15px;
            height: 15px;
        }
        .setting-item select,
        .setting-item input[type="text"],
        .setting-item input[type="number"] {
            padding: 3px 6px;
            border: 1px solid var(--border);
            border-radius: 4px;
            font-size: 12px;
            background: var(--card-bg);
            font-family: inherit;
            min-width: 40px;
        }
        .setting-item .hint {
            font-size: 11px;
            color: var(--text-secondary);
        }
        .setting-item .tag-group {
            display: flex;
            gap: 3px;
        }
        .setting-item .tag-group input {
            width: 48px;
        }
        .quote-group {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        .quote-group label {
            font-size: 12px;
            font-weight: 400;
            display: flex;
            align-items: center;
            gap: 3px;
        }

        /* Buttons */
        .delim-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            align-items: center;
        }
        .btn {
            padding: 11px 26px;
            border: none;
            border-radius: var(--r-pill);
            font-size: 13.5px;
            font-weight: 700;
            cursor: pointer;
            font-family: var(--display);
            transition: all 0.14s;
        }
        .btn-primary {
            background: var(--accent);
            color: #fff;
            box-shadow: 0 10px 20px -8px rgba(79,95,238,.4);
        }
        .btn-primary:hover {
            background: var(--accent-hover);
            transform: translateY(-1px);
            box-shadow: 0 12px 24px -6px rgba(79,95,238,.45);
        }
        .btn-success {
            background: var(--success);
            color: #fff;
            box-shadow: 0 10px 20px -8px rgba(18,194,107,.35);
        }
        .btn-success:hover {
            background: #0EA25A;
            transform: translateY(-1px);
        }
        .btn-danger {
            background: var(--bg-tint);
            color: var(--danger);
        }
        .btn-danger:hover {
            background: var(--danger-tint);
        }
        .btn-yellow {
            background: var(--accent);
            color: #fff;
        }
        .btn-yellow:hover {
            background: var(--accent-hover);
            transform: translateY(-1px);
        }
        .status-msg {
            font-size: 13px;
            color: #059669;
            font-weight: 500;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .status-msg.show {
            opacity: 1;
        }

        /* ============================================================
           SIMPLE TOOLS
           ============================================================ */
        .simple-tool {
            background: var(--card-bg);
            border-radius: var(--radius);
            padding: 28px 32px;
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
        }
        .simple-tool .row {
            display: flex;
            gap: 18px;
            flex-wrap: wrap;
        }
        .simple-tool .row .col {
            flex: 1;
            min-width: 180px;
        }
        .simple-tool .row .col label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            margin-bottom: 3px;
            color: var(--text-secondary);
        }
        .simple-tool .row .col .numbered-wrap {
            max-height: 480px;
        }
        .simple-tool .row .col .numbered-wrap textarea {
            min-height: 440px;
            max-height: 480px;
        }
        .simple-tool .row .col .numbered-wrap .line-numbers {
            max-height: 480px;
        }

        .simple-tool .toolbar {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 10px;
            align-items: center;
        }
        .simple-tool .toolbar .btn-sm {
            padding: 6px 16px;
            font-size: 12px;
            border: none;
            border-radius: 5px;
            font-weight: 500;
            cursor: pointer;
            font-family: var(--font);
            transition: all 0.12s;
            background: var(--text);
            color: var(--bg);
        }
        .simple-tool .toolbar .btn-sm:hover {
            transform: translateY(-1px);
            box-shadow: 0 3px 12px rgba(17, 24, 39, 0.2);
        }
        .simple-tool .toolbar .btn-sm.copy {
            background: var(--bg-tint);
            color: var(--text);
        }
        .simple-tool .toolbar .btn-sm.copy:hover {
            background: var(--border);
        }
        .simple-tool .toolbar .btn-sm.clear {
            background: var(--danger-tint);
            color: var(--danger);
            box-shadow: inset 0 0 0 1px var(--danger);
        }
        .simple-tool .toolbar .btn-sm.clear:hover {
            background: var(--danger-tint);
            box-shadow: inset 0 0 0 1px var(--danger);
            filter: brightness(0.96);
        }
        /* ============================================================
           CASE BUILDER
           ============================================================ */
        .case-builder .case-col-row {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 4px;
        }
        .case-builder .case-col-row label {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
        }
        .case-builder .case-col-row input {
            padding: 8px 10px;
            border: 2px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
            font-family: var(--mono);
            max-width: 320px;
            transition: border-color 0.15s;
        }
        .case-builder .case-col-row input:focus {
            outline: none;
            border-color: var(--accent);
        }
        .case-builder .case-conditions-label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            margin: 14px 0 6px 0;
        }
        .case-builder .case-conditions {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .case-condition-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            background: #fafbfc;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 8px 10px;
            transition: border-color 0.15s, background 0.15s;
        }
        .case-condition-row:focus-within {
            border-color: var(--accent);
            background: var(--accent-tint);
        }
        .case-condition-row .case-when-label {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.4px;
            width: 36px;
            flex-shrink: 0;
        }
        .case-condition-row input[type="text"] {
            flex: 1;
            min-width: 110px;
            padding: 7px 10px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
            font-family: var(--mono);
            background: var(--card-bg);
        }
        .case-condition-row input[type="text"]:focus {
            outline: none;
            border-color: var(--accent);
        }
        .case-condition-row .case-then-label {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.4px;
            flex-shrink: 0;
        }
        .case-condition-row .case-remove-btn {
            background: transparent;
            border: none;
            color: #9ca3af;
            font-size: 18px;
            line-height: 1;
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 5px;
            transition: all 0.12s;
            flex-shrink: 0;
        }
        .case-condition-row .case-remove-btn:hover {
            color: #dc2626;
            background: #fee2e2;
        }
        .case-builder .case-add-btn {
            margin-top: 8px;
            background: rgba(79, 95, 238, 0.10);
            border: 1.5px dashed var(--accent-hover);
            color: #92660a;
            font-weight: 600;
            font-size: 12.5px;
            padding: 7px 14px;
            border-radius: 6px;
            cursor: pointer;
            font-family: var(--font);
            transition: all 0.12s;
        }
        .case-builder .case-add-btn:hover {
            background: rgba(79, 95, 238, 0.18);
        }

        .simple-tool .toolbar .hint {
            font-size: 12px;
            color: var(--text-secondary);
        }
        .simple-tool .toolbar input[type="text"],
        .simple-tool .toolbar input[type="number"],
        .simple-tool .toolbar select {
            padding: 4px 8px;
            border: 1px solid var(--border);
            border-radius: 4px;
            font-size: 12px;
            font-family: var(--font);
            background: var(--card-bg);
        }

        /* ============================================================
           STICKY NOTES TOOL
           ============================================================ */
        .sticky-container {
            background: var(--card-bg);
            border-radius: var(--radius);
            padding: 0;
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
            overflow: auto;
            height: calc(100vh - var(--header-height) - 140px);
            min-height: 500px;
            display: flex;
            flex-direction: column;
            transition: none;
        }
        .sticky-container.sticky-expanded {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            height: 100vh;
            min-height: 0;
            z-index: 2000;
            border-radius: 0;
            border: none;
        }
        body.sticky-lock-scroll {
            overflow: hidden;
        }
        .sticky-toolbar {
            background: var(--dark-surface);
            padding: 12px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            border-bottom: 2px solid var(--accent);
            flex-shrink: 0;
        }
        .sticky-toolbar .sticky-title {
            color: #fff;
            font-size: 16px;
            font-weight: 600;
            margin-right: 8px;
        }
        .sticky-toolbar .sticky-title small {
            font-weight: 400;
            font-size: 12px;
            color: #94a3b8;
        }
        .sticky-toolbar .btn-yellow-sm {
            background: var(--accent);
            color: #fff;
            border: none;
            border-radius: 6px;
            padding: 6px 16px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            font-family: var(--font);
            transition: all 0.12s;
        }
        .sticky-toolbar .btn-yellow-sm:hover {
            background: var(--accent-hover);
            transform: translateY(-1px);
        }
        .sticky-toolbar .btn-dark-sm {
            background: #374151;
            color: #fff;
            border: none;
            border-radius: 6px;
            padding: 6px 16px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            font-family: var(--font);
            transition: all 0.12s;
        }
        .sticky-toolbar .btn-dark-sm:hover {
            background: #4b5563;
        }
        .sticky-toolbar .sticky-status {
            margin-left: auto;
            font-size: 12px;
            color: #94a3b8;
        }
        #stickyBoard {
            position: relative;
            flex: 1;
            background-color: #f3f4f6;
            background-image: radial-gradient(#d1d5db 1px, transparent 1px);
            background-size: 20px 20px;
            overflow: visible;
            min-height: 400px;
        }
        .sticky-note {
            position: absolute;
            width: 210px;
            min-height: 170px;
            padding: 14px;
            border-radius: 4px;
            box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
            user-select: none;
            touch-action: none;
            cursor: grab;
            display: flex;
            flex-direction: column;
            font-family: var(--font);
            resize: both;
            overflow: auto;
            animation: noteIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
            transition: box-shadow 0.15s ease;
        }
        @keyframes noteIn {
            from {
                opacity: 0;
                transform: scale(0.9) translateY(6px);
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }
        .sticky-note.note-removing {
            animation: noteOut 0.16s ease forwards;
            pointer-events: none;
        }
        @keyframes noteOut {
            from {
                opacity: 1;
                transform: scale(1);
            }
            to {
                opacity: 0;
                transform: scale(0.88);
            }
        }
        .sticky-note.dragging {
            cursor: grabbing;
            box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
            z-index: 9999 !important;
        }
        .sticky-note .note-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
            flex-shrink: 0;
            cursor: grab;
            padding: 2px 2px 2px 0;
            border-radius: 4px;
        }
        .sticky-note .note-header:active {
            cursor: grabbing;
        }
        .sticky-note .note-header-left {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .sticky-note .note-drag-grip {
            opacity: 0.35;
            font-size: 13px;
            letter-spacing: -1px;
            user-select: none;
        }
        .sticky-note .note-name-input {
            font-family: var(--display);
            font-size: 12px;
            font-weight: 700;
            opacity: 0.75;
            letter-spacing: 0.2px;
            border: none;
            background: transparent;
            outline: none;
            padding: 2px 4px;
            border-radius: 4px;
            width: 108px;
            min-width: 0;
            color: inherit;
        }
        .sticky-note .note-name-input::placeholder {
            color: inherit;
            opacity: 1;
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: 0.5px;
            font-size: 11px;
        }
        .sticky-note .note-name-input:hover {
            background: rgba(0, 0, 0, 0.05);
        }
        .sticky-note .note-name-input:focus {
            opacity: 1;
            background: rgba(255, 255, 255, 0.6);
            box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.15);
        }
        .sticky-note .note-header-right {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .sticky-note .font-size-btn {
            background: rgba(0, 0, 0, 0.06);
            border: none;
            border-radius: 4px;
            width: 20px;
            height: 20px;
            font-size: 12px;
            font-weight: 700;
            line-height: 1;
            cursor: pointer;
            color: rgba(0, 0, 0, 0.55);
            transition: background 0.12s;
        }
        .sticky-note .font-size-btn:hover {
            background: rgba(0, 0, 0, 0.14);
        }
        .sticky-note .note-delete {
            background: transparent;
            border: none;
            padding: 0 4px;
            font-size: 20px;
            line-height: 1;
            color: rgba(0, 0, 0, 0.35);
            cursor: pointer;
            font-family: var(--font);
            transition: color 0.12s;
        }
        .sticky-note .note-delete:hover {
            color: #111;
        }
        .sticky-note .mode-select {
            width: 100%;
            margin-bottom: 6px;
            flex-shrink: 0;
            background: rgba(0, 0, 0, 0.06);
            border: none;
            border-radius: 5px;
            padding: 4px 6px;
            font-size: 11.5px;
            font-weight: 500;
            cursor: pointer;
            font-family: var(--font);
            color: rgba(0, 0, 0, 0.7);
        }
        .sticky-note textarea {
            width: 100%;
            flex: 1;
            min-height: 100px;
            resize: none;
            border: 0;
            outline: 0;
            background: transparent;
            font-size: var(--note-font-size, 15px);
            line-height: 1.5;
            color: #111827;
            user-select: text;
            cursor: text;
            font-family: var(--font);
        }
        .sticky-note textarea::placeholder {
            color: rgba(0, 0, 0, 0.35);
        }
        .sticky-note .list-editor {
            display: none;
            flex: 1;
            min-height: 80px;
        }
        /* --- bold / strikethrough --- */
        .sticky-note textarea.note-bold,
        .sticky-note .list-editor .list-row input.item-bold {
            font-weight: 700;
        }
        .sticky-note textarea.note-strike,
        .sticky-note .list-editor .list-row input.item-done,
        .sticky-note .list-editor .list-row input.item-strike {
            text-decoration: line-through;
            opacity: 0.6;
        }
        /* --- colour palette --- */
        .sticky-note .note-color-palette {
            display: none;
            gap: 5px;
            padding: 5px 0 7px 0;
            flex-wrap: wrap;
            flex-shrink: 0;
        }
        .sticky-note .note-color-palette.open {
            display: flex;
        }
        .sticky-note .note-color-swatch {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 1.5px solid rgba(0, 0, 0, 0.25);
            cursor: pointer;
            padding: 0;
            transition: transform 0.12s, box-shadow 0.12s;
        }
        .sticky-note .note-color-swatch:hover {
            transform: scale(1.18);
        }
        .sticky-note .note-color-swatch.swatch-selected {
            border-color: #111827;
            box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #111827;
        }
        /* --- minimised state: header only --- */
        .sticky-note.note-collapsed {
            min-height: 0 !important;
            height: auto !important;
            resize: none;
            overflow: hidden;
        }
        .sticky-note.note-collapsed textarea,
        .sticky-note.note-collapsed .list-editor,
        .sticky-note.note-collapsed .mode-select,
        .sticky-note.note-collapsed .resize-handle,
        .sticky-note.note-collapsed .note-color-palette {
            display: none !important;
        }
        .sticky-note.note-collapsed .note-header {
            margin-bottom: 0;
        }
        .sticky-note .list-editor.active {
            display: flex;
            flex-direction: column;
        }
        .sticky-note .list-editor .list-items {
            flex: 1;
            overflow-y: auto;
            margin-bottom: 6px;
        }
        .sticky-note .list-editor .list-row {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 4px;
        }
        .sticky-note .list-editor .list-row input[type="text"] {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            font-size: var(--note-font-size, 14px);
            line-height: 1.4;
            font-family: var(--font);
            color: #111827;
            padding: 2px 0;
            min-width: 40px;
        }
        .sticky-note .list-editor .list-row input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: #059669;
            cursor: pointer;
            flex-shrink: 0;
        }
        .sticky-note .list-editor .list-row span {
            font-size: var(--note-font-size, 13px);
            color: #111827;
            min-width: 18px;
            text-align: center;
            flex-shrink: 0;
        }
        .sticky-note .list-editor .item-btn {
            background: rgba(0, 0, 0, 0.06);
            border: none;
            border-radius: 3px;
            padding: 1px 4px;
            font-size: 11px;
            cursor: pointer;
            color: rgba(0, 0, 0, 0.5);
            font-family: var(--font);
            line-height: 1.4;
            flex-shrink: 0;
        }
        .sticky-note .list-editor .item-btn:hover {
            background: rgba(0, 0, 0, 0.12);
        }
        .sticky-note .list-editor .item-btn:disabled {
            opacity: 0.2;
            cursor: not-allowed;
        }
        .sticky-note .list-editor .item-style-btn {
            font-size: 10px;
            font-weight: 700;
            min-width: 15px;
        }
        .sticky-note .list-editor .item-style-btn.item-style-active {
            background: rgba(0, 0, 0, 0.22);
            color: #111827;
        }
        .sticky-note .list-editor .row-drag-handle {
            flex-shrink: 0;
            cursor: grab;
            color: rgba(0, 0, 0, 0.3);
            font-size: 12px;
            letter-spacing: -1px;
            touch-action: none;
            padding: 0 1px;
        }
        .sticky-note .list-editor .row-drag-handle:hover {
            color: rgba(0, 0, 0, 0.6);
        }
        .sticky-note .list-editor .list-row.row-dragging {
            opacity: 0.85;
            background: var(--card-bg);
            border-radius: 4px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
            position: relative;
            z-index: 5;
            transition: none;
        }
        .sticky-note .list-editor .list-row.row-drop-above {
            box-shadow: inset 0 2px 0 0 #2563eb;
        }
        .sticky-note .list-editor .list-row.row-drop-below {
            box-shadow: inset 0 -2px 0 0 #2563eb;
        }
        .sticky-note .list-editor .add-item-btn {
            background: rgba(0, 0, 0, 0.06);
            border: none;
            border-radius: 4px;
            padding: 4px 10px;
            font-size: 12px;
            cursor: pointer;
            font-family: var(--font);
            color: rgba(0, 0, 0, 0.6);
            align-self: flex-start;
            transition: background 0.12s;
        }
        .sticky-note .list-editor .add-item-btn:hover {
            background: rgba(0, 0, 0, 0.12);
        }
        .sticky-note .resize-handle {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 16px;
            height: 16px;
            cursor: nwse-resize;
            opacity: 0.3;
            font-size: 14px;
            line-height: 1;
            text-align: center;
            user-select: none;
            color: rgba(0, 0, 0, 0.3);
        }
        .sticky-note .resize-handle:hover {
            opacity: 0.8;
        }

        .sticky-empty {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #9ca3af;
            pointer-events: none;
            font-size: 16px;
            font-family: var(--font);
            flex-direction: column;
            gap: 8px;
        }
        .sticky-empty .icon {
            font-size: 48px;
            opacity: 0.4;
        }

        /* Sticky note colors */
        .sticky-note.color-yellow {
            background: #fef08a;
        }
        .sticky-note.color-blue {
            background: #bfdbfe;
        }
        .sticky-note.color-green {
            background: #bbf7d0;
        }
        .sticky-note.color-pink {
            background: #fecdd3;
        }
        .sticky-note.color-purple {
            background: #ddd6fe;
        }
        .sticky-note.color-orange {
            background: #fed7aa;
        }
        /* Standalone swatch colors — same palette as the note backgrounds above,
           but usable outside a .sticky-note (e.g. in the color-picker palette). */
        .note-color-swatch.color-yellow { background: #fef08a; }
        .note-color-swatch.color-blue { background: #bfdbfe; }
        .note-color-swatch.color-green { background: #bbf7d0; }
        .note-color-swatch.color-pink { background: #fecdd3; }
        .note-color-swatch.color-purple { background: #ddd6fe; }
        .note-color-swatch.color-orange { background: #fed7aa; }

        /* ============================================================
           TEXT COMPARATOR (Tool 22)
           ============================================================ */
        .comparator-container {
            background: var(--card-bg);
            border-radius: var(--radius);
            padding: 24px 28px;
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
        }
        .comparator-container .row {
            display: flex;
            gap: 18px;
            flex-wrap: wrap;
        }
        .comparator-container .row .col {
            flex: 1;
            min-width: 200px;
        }
        .comparator-container .row .col label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            margin-bottom: 3px;
            color: var(--text-secondary);
        }
        .comparator-container .diff-output {
            background: #f8f9fc;
            border-radius: 8px;
            padding: 12px 16px;
            border: 2px solid var(--border);
            min-height: 120px;
            max-height: 300px;
            overflow-y: auto;
            font-family: var(--mono);
            font-size: 13px;
            line-height: 1.7;
            white-space: pre-wrap;
            word-break: break-all;
        }
        .comparator-container .diff-output .diff-del {
            background: #fee2e2;
            color: #dc2626;
            text-decoration: line-through;
        }
        .comparator-container .diff-output .diff-add {
            background: #dcfce7;
            color: #065f46;
        }
        .comparator-container .diff-output .diff-eq {
            color: var(--text-secondary);
        }
        .comparator-container .diff-output .diff-word-del {
            background: #fca5a5;
            color: #7f1d1d;
            text-decoration: none;
            border-radius: 2px;
            padding: 0 1px;
        }
        .comparator-container .diff-output .diff-word-add {
            background: #86efac;
            color: #064e3b;
            border-radius: 2px;
            padding: 0 1px;
        }
        .comparator-container .diff-stats {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 8px;
            padding: 8px 12px;
            background: var(--bg);
            border-radius: 6px;
        }

        /* ============================================================
           TEXT STATISTICS (Tool 23)
           ============================================================ */
        .stats-container {
            background: var(--card-bg);
            border-radius: var(--radius);
            padding: 24px 28px;
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
        }
        .stats-container .row {
            display: flex;
            gap: 18px;
            flex-wrap: wrap;
        }
        .stats-container .row .col {
            flex: 1;
            min-width: 200px;
        }
        .stats-container .row .col label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            margin-bottom: 3px;
            color: var(--text-secondary);
        }
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 10px;
        }
        .stats-card {
            background: var(--bg);
            border-radius: 8px;
            padding: 14px 16px;
            text-align: center;
            border: 1px solid var(--border);
        }
        .stats-card .number {
            font-size: 28px;
            font-weight: 700;
            color: var(--text);
        }
        .stats-card .label {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        .stats-card .label .emoji {
            font-size: 16px;
        }

        /* ============================================================
           SQL QUERY TEMPLATES
           ============================================================ */
        .sql-templates-grid {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .sql-template-category {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            color: var(--text-secondary);
            margin-top: 14px;
        }
        .sql-template-category:first-child {
            margin-top: 0;
        }
        .sql-template-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            box-shadow: var(--shadow);
            overflow: hidden;
        }
        .sql-template-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 14px;
            border-bottom: 1px solid var(--border);
        }
        .sql-template-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
        }
        .sql-template-desc {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        .sql-template-head .btn-sm {
            flex-shrink: 0;
            background: var(--bg-tint);
            color: var(--text);
            padding: 6px 14px;
            font-size: 12px;
            border: none;
            border-radius: 5px;
            font-weight: 500;
            cursor: pointer;
            font-family: var(--font);
            transition: all 0.12s;
        }
        .sql-template-head .btn-sm:hover {
            background: var(--border);
        }
        .sql-template-code {
            margin: 0;
            padding: 14px;
            font-family: var(--mono);
            font-size: 12.5px;
            line-height: 1.6;
            color: var(--text);
            background: var(--bg-tint);
            white-space: pre;
            overflow-x: auto;
        }

        /* ============================================================
           COLOR PICKER
           ============================================================ */
        .color-tool-top {
            display: flex;
            align-items: flex-end;
            gap: 20px;
            flex-wrap: wrap;
        }
        .color-swatch-wrap {
            display: block;
            width: 76px;
            height: 76px;
            border-radius: 10px;
            overflow: hidden;
            border: 2px solid var(--border);
            box-shadow: var(--shadow);
            flex-shrink: 0;
            cursor: pointer;
        }
        .color-swatch-wrap input[type="color"] {
            width: 100%;
            height: 100%;
            border: none;
            padding: 0;
            cursor: pointer;
            transform: scale(1.3);
        }
        .color-manual-inputs {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        .color-field {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .color-field label {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }
        .color-field input {
            padding: 8px 10px;
            border: 2px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
            font-family: var(--mono);
            width: 72px;
            transition: border-color 0.15s;
        }
        .color-field-hex input {
            width: 100px;
            text-transform: uppercase;
        }
        .color-field input:focus {
            outline: none;
            border-color: var(--accent);
        }
        .color-preview {
            margin-top: 16px;
            height: 64px;
            border-radius: 10px;
            border: 1px solid var(--border);
            transition: background-color 0.1s ease;
        }

        /* ============================================================
           TIME TILL (multi-timer countdown)
           ============================================================ */
        .timetill-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 14px;
        }
        .timetill-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: var(--shadow);
            padding: 16px 18px;
            display: flex;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
        }
        .timetill-card .timetill-fields {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            flex: 1;
            min-width: 260px;
        }
        .timetill-card .timetill-fields > div {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .timetill-card label {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }
        .timetill-card input[type="text"] {
            padding: 8px 10px;
            border: 2px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
            min-width: 140px;
        }
        .timetill-card input[type="date"] {
            padding: 8px 10px;
            border: 2px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
            font-family: var(--mono);
        }
        .timetill-card input[type="text"]:focus,
        .timetill-card input[type="date"]:focus {
            outline: none;
            border-color: var(--accent);
        }
        .timetill-card .timetill-weekends {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--text-secondary);
            white-space: nowrap;
        }
        .timetill-result {
            text-align: center;
            min-width: 110px;
        }
        .timetill-result .num {
            font-size: 32px;
            font-weight: 800;
            color: var(--text);
            font-variant-numeric: tabular-nums;
            line-height: 1;
        }
        .timetill-result .label {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.4px;
            margin-top: 4px;
        }
        .timetill-result.timetill-past .num {
            color: #dc2626;
        }
        .timetill-card .case-remove-btn {
            font-size: 22px;
        }

        /* ============================================================
           POMODORO TIMER
           ============================================================ */
        .pomodoro-tool {
            text-align: center;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 40px 24px;
        }
        .pomodoro-phase {
            font-size: 14px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--accent-hover);
            margin-bottom: 8px;
        }
        .pomodoro-display {
            font-size: 72px;
            font-weight: 800;
            font-variant-numeric: tabular-nums;
            color: var(--text);
            letter-spacing: 2px;
        }
        .pomodoro-tool.pomo-break .pomodoro-phase {
            color: #059669;
        }

        /* ============================================================
           QR CODE GENERATOR
           ============================================================ */
        .qr-input-row {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 18px;
        }
        .qr-input-row input[type="text"] {
            flex: 1;
            min-width: 220px;
            padding: 10px 12px;
            border: 2px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
            font-family: var(--mono);
        }
        .qr-input-row input[type="text"]:focus {
            outline: none;
            border-color: var(--accent);
        }
        .qr-input-row select {
            padding: 10px 12px;
            border: 2px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
            font-family: var(--font);
        }
        .qr-result {
            display: flex;
            gap: 24px;
            align-items: center;
            flex-wrap: wrap;
        }
        #qrCanvas {
            background: #fff;
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: var(--shadow);
        }
        .qr-meta {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .qr-meta .btn-sm.copy {
            display: inline-block;
            text-decoration: none;
            width: fit-content;
        }

        /* ============================================================
           HOME / DIRECTORY HUB
           ============================================================ */
        .hub-grid {
            display: flex;
            flex-direction: column;
            gap: 36px;
            margin-top: 8px;
        }
        /* per-category accent color, inherited by descendant .hub-card via CSS
           custom property cascade — order matches the sidebar exactly */
        .hub-category:nth-of-type(1) { --cat: var(--cat-core); --cat-tint: var(--cat-core-tint); }
        .hub-category:nth-of-type(2) { --cat: var(--cat-sql); --cat-tint: var(--cat-sql-tint); }
        .hub-category:nth-of-type(3) { --cat: var(--cat-productivity); --cat-tint: var(--cat-productivity-tint); }
        .hub-category:nth-of-type(4) { --cat: var(--cat-analysis); --cat-tint: var(--cat-analysis-tint); }
        .hub-category:nth-of-type(5) { --cat: var(--cat-design); --cat-tint: var(--cat-design-tint); }
        .hub-category h2 {
            font-family: var(--display);
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--cat, var(--accent));
            margin-bottom: 14px;
            padding: 6px 14px;
            border-bottom: none;
            background: var(--cat-tint, var(--accent-tint));
            border-radius: var(--r-pill);
            display: inline-block;
        }
        .hub-cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 16px;
        }
        .hub-card {
            position: relative;
            display: block;
            background: var(--card-bg);
            border: 1.5px solid var(--border);
            border-radius: var(--r-lg);
            box-shadow: var(--shadow-sm);
            padding: 20px;
            text-decoration: none;
            transition: all 0.15s;
        }
        .hub-card:hover {
            border-color: var(--cat, var(--accent));
            transform: translateY(-3px);
            box-shadow: var(--shadow);
        }
        .hub-card-tag {
            position: absolute;
            top: 18px;
            right: 18px;
            font-size: 10.5px;
            font-weight: 700;
            padding: 4px 10px;
            border-radius: var(--r-pill);
            background: var(--cat-tint, var(--accent-tint));
            color: var(--cat, var(--accent));
        }
        .hub-card-icon {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--cat-tint, var(--accent-tint));
            color: var(--cat, var(--accent));
            margin-bottom: 14px;
        }
        .hub-card-icon-svg {
            width: 21px;
            height: 21px;
        }
        .hub-card-title {
            font-family: var(--display);
            font-size: 15px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 6px;
            padding-right: 70px;
        }
        .hub-card-desc {
            font-size: 13px;
            line-height: 1.55;
            color: var(--text-secondary);
        }

        /* ============================================================
           PER-TOOL SEO CONTENT (below each tool)
           ============================================================ */
        .tool-content-block {
            max-width: 900px;
            margin: 72px 0 32px;
            padding: 40px 44px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 18px;
            box-shadow: 0 1px 2px rgba(23,25,35,.04), 0 8px 24px -8px rgba(23,25,35,.06);
        }
        .tool-content-block h2 {
            font-family: var(--display);
            font-size: 19px;
            font-weight: 800;
            letter-spacing: -.01em;
            color: var(--text);
            margin: 34px 0 12px;
            padding-left: 15px;
            border-left: 3px solid var(--accent);
        }
        .tool-content-block h2:first-child { margin-top: 0; }
        .tool-content-block > p {
            font-size: 14.5px;
            line-height: 1.75;
            color: var(--text-secondary);
            max-width: 74ch;
        }
        .tool-howto-steps {
            max-width: 74ch;
            padding-left: 20px;
            margin: 6px 0;
        }
        .tool-howto-steps li {
            font-size: 14.5px;
            line-height: 1.7;
            color: var(--text-secondary);
            margin-bottom: 9px;
        }
        .tool-howto-steps li::marker { font-weight: 700; color: var(--accent); }
        .tool-feature-list, .tool-usecase-list {
            max-width: 74ch;
            padding-left: 18px;
            margin: 6px 0;
        }
        .tool-feature-list li, .tool-usecase-list li {
            font-size: 14.5px;
            line-height: 1.7;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }
        .tool-terminology-list { max-width: 74ch; }
        .tool-terminology-list dt {
            font-family: var(--display);
            font-weight: 700;
            font-size: 14px;
            color: var(--text);
            margin-top: 14px;
        }
        .tool-terminology-list dt:first-child { margin-top: 0; }
        .tool-terminology-list dd {
            font-size: 14px;
            line-height: 1.65;
            color: var(--text-secondary);
            margin: 4px 0 0;
        }
        .tool-faq { border-top: 1px solid var(--border); max-width: 74ch; }
        .tool-faq-item { padding: 16px 4px; border-bottom: 1px solid var(--border); }
        .tool-faq-item h3 { font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--text); margin: 0 0 7px; }
        .tool-faq-item .tool-faq-ans { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
        .tool-related-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
            gap: 12px;
            max-width: 900px;
        }
        .tool-related-grid a {
            display: block;
            background: var(--card-bg);
            border: 1.5px solid var(--border);
            border-radius: 14px;
            padding: 14px 16px;
            text-decoration: none;
            transition: border-color .15s, transform .15s;
        }
        .tool-related-grid a:hover { border-color: var(--accent); transform: translateY(-2px); }
        .tool-related-grid .trg-title { font-family: var(--display); font-weight: 700; font-size: 13.5px; color: var(--text); }
        .tool-related-grid .trg-cat { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }

        /* ============================================================
           FLOW PLANNER
           ============================================================ */
        .planner-toolbar {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            align-items: center;
            margin-bottom: 14px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: var(--shadow);
            padding: 10px 14px;
        }
        .planner-btn-group {
            display: flex;
            gap: 4px;
            background: var(--bg);
            border-radius: 10px;
            padding: 4px;
        }
        .planner-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            font-family: var(--font);
            font-size: 12.5px;
            font-weight: 600;
            padding: 7px 12px;
            border-radius: 7px;
            cursor: pointer;
            transition: background 0.14s, color 0.14s, transform 0.1s;
        }
        .planner-btn-icon {
            font-size: 15px;
            line-height: 1;
        }
        .planner-btn:hover {
            background: var(--card-bg);
            color: var(--text);
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        }
        .planner-btn:active {
            transform: scale(0.96);
        }
        .planner-btn.planner-active {
            background: var(--accent);
            color: #fff;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
        }
        .planner-btn-icon-only {
            padding: 8px 11px;
            font-size: 15px;
        }
        .planner-btn-primary {
            color: #92660a;
        }
        .planner-btn-primary:hover {
            background: rgba(79, 95, 238, 0.15);
            color: #92660a;
        }
        .planner-btn-danger:hover {
            background: rgba(220, 38, 38, 0.1);
            color: #dc2626;
        }
        .planner-toolbar-divider {
            width: 1px;
            align-self: stretch;
            background: var(--border);
            margin: 2px 0;
        }
        .planner-colors {
            display: inline-flex;
            gap: 6px;
            align-items: center;
            padding: 0 6px;
        }
        .planner-color {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
            padding: 0;
            transition: transform 0.14s, box-shadow 0.14s;
        }
        .planner-color:hover {
            transform: scale(1.15);
        }
        .planner-color.selected {
            border-color: #111827;
            box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #111827;
        }
        .planner-toolbar .hint {
            flex-basis: 100%;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .planner-canvas-wrap {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: auto;
        }
        #plannerSvg {
            display: block;
            width: 100%;
            height: 560px;
            background-image:
                linear-gradient(rgba(0, 0, 0, 0.045) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 0, 0, 0.045) 1px, transparent 1px);
            background-size: 20px 20px;
            cursor: default;
        }
        #plannerSvg .planner-node {
            cursor: grab;
        }
        #plannerSvg .planner-node.dragging {
            cursor: grabbing;
        }
        #plannerSvg .planner-node .node-shape {
            stroke: #475569;
            stroke-width: 2;
            transition: stroke 0.12s;
        }
        #plannerSvg .planner-node.selected .node-shape {
            stroke: var(--accent-hover);
            stroke-width: 3.5;
        }
        #plannerSvg .node-label {
            font-family: var(--font);
            font-size: 13px;
            font-weight: 600;
            fill: #1e293b;
            text-anchor: middle;
            dominant-baseline: middle;
            pointer-events: none;
            user-select: none;
        }
        #plannerSvg .planner-link {
            stroke: #64748b;
            stroke-width: 2;
            marker-end: url(#plannerArrow);
            cursor: pointer;
        }
        #plannerSvg .planner-link:hover,
        #plannerSvg .planner-link.planner-link-hover {
            stroke: #dc2626;
            stroke-width: 3;
        }
        #plannerSvg .planner-link-hitbox {
            stroke: transparent;
            stroke-width: 14;
            cursor: pointer;
        }
        .planner-drag-line {
            stroke: #2563eb;
            stroke-width: 2.5;
            stroke-dasharray: 6 4;
            pointer-events: none;
        }
        /* Connection handles: small dots at N/E/S/W of a shape, shown on hover/selection */
        #plannerSvg .planner-handle {
            fill: #fff;
            stroke: #2563eb;
            stroke-width: 2;
            opacity: 0;
            transition: opacity 0.12s, r 0.12s;
            cursor: crosshair;
        }
        #plannerSvg .planner-node:hover .planner-handle,
        #plannerSvg .planner-node.selected .planner-handle {
            opacity: 1;
        }
        #plannerSvg .planner-handle:hover {
            fill: #2563eb;
            r: 7;
        }
        #plannerSvg .planner-node.connect-target .node-shape {
            stroke: #2563eb;
            stroke-width: 4;
            stroke-dasharray: 5 3;
        }
        .planner-link-selected {
            stroke: #2563eb !important;
            stroke-width: 3 !important;
        }
        .planner-link-endpoint {
            fill: #fff;
            stroke: #2563eb;
            stroke-width: 2;
            cursor: grab;
        }
        .planner-link-endpoint:hover {
            fill: #dbeafe;
        }
        .planner-link-delete {
            cursor: pointer;
        }
        .planner-link-delete circle {
            fill: #fff;
            stroke: #dc2626;
            stroke-width: 1.5;
        }
        .planner-link-delete text {
            font-size: 10px;
        }
        .planner-link-delete:hover circle {
            fill: #fee2e2;
        }
        .planner-resize-handle {
            fill: #fff;
            stroke: var(--accent-hover);
            stroke-width: 2;
            cursor: nwse-resize;
        }
        .planner-resize-handle:hover {
            fill: var(--accent);
        }
        /* Expand to full screen — same pattern as the Sticky Notes board:
           the whole tool (toolbar + canvas) expands together, so the shape
           buttons stay reachable while expanded. */
        #plannerTool.planner-expanded {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 2000;
            background: var(--bg);
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        #plannerTool.planner-expanded .planner-canvas-wrap {
            flex: 1;
            min-height: 0;
        }
        #plannerTool.planner-expanded #plannerSvg {
            height: 100%;
        }
        body.planner-lock-scroll {
            overflow: hidden;
        }
        /* Inline text editor that sits directly on top of a shape */
        .planner-edit-box {
            width: 100%;
            height: 100%;
            border: none;
            outline: 2px solid var(--accent-hover);
            outline-offset: 2px;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.92);
            font-family: var(--font);
            font-size: 13px;
            font-weight: 600;
            color: #1e293b;
            text-align: center;
            resize: none;
            padding: 4px;
            box-sizing: border-box;
        }

        /* ============================================================
           ER DIAGRAM DESIGNER
           ============================================================ */
        .erd-toolbar {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            align-items: center;
            margin-bottom: 14px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: var(--shadow);
            padding: 10px 14px;
        }
        .erd-toolbar .hint {
            flex-basis: 100%;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .erd-canvas-wrap {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: auto;
            height: 600px;
        }
        #erdTool.erd-expanded {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 2000;
            background: var(--bg);
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        #erdTool.erd-expanded .erd-canvas-wrap {
            flex: 1;
            min-height: 0;
            height: auto;
        }
        body.erd-lock-scroll {
            overflow: hidden;
        }
        .erd-board {
            position: relative;
            min-width: 100%;
            min-height: 100%;
            background-color: #f8fafc;
            background-image: radial-gradient(#d1d5db 1px, transparent 1px);
            background-size: 20px 20px;
        }
        .erd-svg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            overflow: visible;
        }
        .erd-svg .erd-relation {
            stroke: #64748b;
            stroke-width: 2;
            marker-end: url(#erdArrow);
            pointer-events: stroke;
            cursor: pointer;
        }
        .erd-svg .erd-relation-hitbox {
            stroke: transparent;
            stroke-width: 14;
            pointer-events: stroke;
            cursor: pointer;
        }
        .erd-svg .erd-relation.erd-relation-selected,
        .erd-svg .erd-relation.erd-relation-hover {
            stroke: #2563eb;
            stroke-width: 3;
        }
        .erd-svg .erd-relation-delete {
            pointer-events: all;
            cursor: pointer;
        }
        .erd-svg .erd-relation-delete circle {
            fill: #fff;
            stroke: #dc2626;
            stroke-width: 1.5;
        }
        .erd-svg .erd-relation-delete:hover circle {
            fill: #fee2e2;
        }
        .erd-svg .erd-relation-delete text {
            font-size: 10px;
        }
        .erd-svg .erd-relation-label {
            font-family: var(--mono);
            font-size: 10px;
            fill: #475569;
        }

        /* --- table card --- */
        .erd-table {
            position: absolute;
            width: 240px;
            background: var(--card-bg);
            border: 1.5px solid #475569;
            border-radius: 8px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
            font-size: 12.5px;
            overflow: hidden;
        }
        .erd-table.erd-table-selected {
            border-color: var(--accent-hover);
            box-shadow: 0 0 0 2px rgba(79, 95, 238, 0.35), 0 3px 10px rgba(0, 0, 0, 0.12);
        }
        .erd-table-header {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 7px 8px;
            cursor: grab;
            border-bottom: 1.5px solid #475569;
        }
        .erd-table-header:active {
            cursor: grabbing;
        }
        .erd-table-name {
            flex: 1;
            border: none;
            background: transparent;
            font-family: var(--font);
            font-weight: 700;
            font-size: 13px;
            color: #fff;
            min-width: 0;
        }
        .erd-table-name::placeholder {
            color: rgba(255, 255, 255, 0.6);
        }
        .erd-table-header .font-size-btn {
            background: rgba(255, 255, 255, 0.18);
            color: #fff;
            border: none;
            border-radius: 4px;
            width: 20px;
            height: 20px;
            font-size: 12px;
            cursor: pointer;
            flex-shrink: 0;
        }
        .erd-table-header .font-size-btn:hover {
            background: rgba(255, 255, 255, 0.32);
        }
        .erd-columns {
            display: flex;
            flex-direction: column;
        }
        .erd-column-row {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 6px;
            border-bottom: 1px solid var(--border);
            background: var(--card-bg);
        }
        .erd-column-row:nth-child(even) {
            background: #fafbfc;
        }
        .erd-column-row.erd-row-dragging {
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
            position: relative;
            z-index: 5;
        }
        .erd-column-row.erd-col-connect-target {
            background: rgba(37, 99, 235, 0.12) !important;
            outline: 1.5px dashed #2563eb;
            outline-offset: -1px;
        }
        .erd-col-drag-handle {
            cursor: grab;
            color: rgba(0, 0, 0, 0.28);
            font-size: 11px;
            letter-spacing: -1px;
            flex-shrink: 0;
            touch-action: none;
        }
        .erd-col-name {
            flex: 1;
            min-width: 0;
            border: none;
            background: transparent;
            font-family: var(--mono);
            font-size: 12px;
            color: #1e293b;
            padding: 2px 0;
        }
        .erd-col-type {
            border: 1px solid var(--border);
            border-radius: 4px;
            font-size: 10.5px;
            font-family: var(--mono);
            background: #f8fafc;
            color: #475569;
            padding: 1px 2px;
            flex-shrink: 0;
            max-width: 70px;
        }
        .erd-key-badge {
            flex-shrink: 0;
            width: 18px;
            height: 18px;
            border-radius: 4px;
            border: 1px solid var(--border);
            background: var(--card-bg);
            font-size: 9px;
            font-weight: 800;
            cursor: pointer;
            color: #cbd5e1;
            line-height: 1;
        }
        .erd-key-badge.erd-pk-active {
            background: #fef08a;
            border-color: #ca8a04;
            color: #92660a;
        }
        .erd-key-badge.erd-fk-active {
            background: #bfdbfe;
            border-color: #2563eb;
            color: #1d4ed8;
        }
        .erd-col-dot {
            flex-shrink: 0;
            width: 11px;
            height: 11px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid #2563eb;
            cursor: crosshair;
        }
        .erd-col-dot:hover {
            background: #2563eb;
        }
        .erd-col-delete {
            flex-shrink: 0;
            background: transparent;
            border: none;
            color: rgba(0, 0, 0, 0.3);
            font-size: 15px;
            line-height: 1;
            cursor: pointer;
            padding: 0 2px;
        }
        .erd-col-delete:hover {
            color: #dc2626;
        }
        .erd-add-column {
            width: 100%;
            border: none;
            border-top: 1px dashed var(--border);
            background: #fafbfc;
            color: var(--text-secondary);
            font-size: 11.5px;
            font-weight: 600;
            padding: 6px;
            cursor: pointer;
        }
        .erd-add-column:hover {
            background: rgba(79, 95, 238, 0.10);
            color: #92660a;
        }
        .erd-table-resize {
            position: absolute;
            right: 0;
            bottom: 0;
            width: 14px;
            height: 14px;
            cursor: nwse-resize;
            color: rgba(0, 0, 0, 0.3);
            font-size: 10px;
            line-height: 14px;
            text-align: center;
        }

        /* ============================================================
           COOKIE CONSENT BANNER
           ============================================================ */
        .cookie-banner {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 6000;
            background: var(--dark-surface);
            color: #e2e8f0;
            border-top: 2px solid var(--accent);
            box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
            /* animate transform/opacity only — no layout thrash, no CLS */
            transform: translateY(100%);
            opacity: 0;
            transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s;
        }
        .cookie-banner[hidden] {
            display: none;
        }
        .cookie-banner.cookie-visible {
            transform: translateY(0);
            opacity: 1;
        }
        .cookie-banner-inner {
            max-width: 1200px;
            margin: 0 auto;
            padding: 16px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 20px;
            flex-wrap: wrap;
        }
        .cookie-banner-text {
            font-size: 13.5px;
            line-height: 1.6;
            margin: 0;
            flex: 1;
            min-width: 260px;
            color: #cbd5e1;
        }
        .cookie-banner-text a {
            color: var(--accent);
            text-decoration: underline;
        }
        .cookie-banner-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }
        .cookie-btn {
            font-family: var(--font);
            font-size: 13px;
            font-weight: 600;
            padding: 9px 18px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            transition: background 0.14s, box-shadow 0.14s;
            white-space: nowrap;
        }
        .cookie-btn:focus-visible {
            outline: 3px solid var(--accent);
            outline-offset: 2px;
        }
        .cookie-btn-primary {
            background: var(--accent);
            color: #fff;
        }
        .cookie-btn-primary:hover {
            background: var(--accent-hover);
        }
        .cookie-btn-secondary {
            background: transparent;
            color: #e2e8f0;
            box-shadow: inset 0 0 0 1.5px #64748b;
        }
        .cookie-btn-secondary:hover {
            background: rgba(255, 255, 255, 0.08);
        }
        .cookie-btn-link {
            background: transparent;
            color: #cbd5e1;
            text-decoration: underline;
            padding: 9px 10px;
        }
        .cookie-btn-link:hover {
            color: #fff;
        }
        @media (max-width: 640px) {
            .cookie-banner-inner {
                padding: 14px 16px;
                gap: 12px;
            }
            .cookie-banner-actions {
                width: 100%;
            }
            .cookie-banner-actions .cookie-btn {
                flex: 1;
                text-align: center;
            }
        }
        /* Cookie preferences dialog */
        .cookie-prefs-overlay {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.55);
            z-index: 6100;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }
        .cookie-prefs-overlay[hidden] {
            display: none;
        }
        .cookie-prefs {
            background: var(--card-bg);
            border-radius: var(--radius);
            max-width: 520px;
            width: 100%;
            padding: 28px 32px;
            position: relative;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            max-height: 80vh;
            overflow-y: auto;
        }
        .cookie-prefs h2 {
            font-size: 19px;
            margin-bottom: 14px;
            color: var(--text);
        }
        .cookie-pref-row {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            padding: 14px 0;
            border-top: 1px solid var(--border);
        }
        .cookie-pref-row strong {
            font-size: 14px;
            color: var(--text);
        }
        .cookie-pref-row p {
            font-size: 12.5px;
            line-height: 1.55;
            color: var(--text-secondary);
            margin-top: 3px;
        }
        .cookie-pref-row input[type="checkbox"] {
            width: 18px;
            height: 18px;
            flex-shrink: 0;
            margin-top: 3px;
            cursor: pointer;
        }
        .cookie-pref-row input[type="checkbox"]:disabled {
            cursor: not-allowed;
            opacity: 0.55;
        }
        .cookie-prefs-actions {
            margin-top: 18px;
            display: flex;
            justify-content: flex-end;
        }

        /* ============================================================
           SITE MODAL (Privacy / Terms / About / Contact)
           ============================================================ */
        .site-modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.55);
            z-index: 5000;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }
        .site-modal-overlay.open {
            display: flex;
        }
        .site-modal {
            background: var(--card-bg);
            border-radius: var(--radius);
            max-width: 600px;
            width: 100%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            padding: 28px 32px;
            position: relative;
        }
        .site-modal h2 {
            font-size: 20px;
            margin-bottom: 4px;
            color: var(--text);
        }
        .site-modal .site-modal-updated {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 16px;
        }
        .site-modal h3 {
            font-size: 14px;
            margin: 18px 0 6px 0;
            color: var(--text);
        }
        .site-modal p, .site-modal li {
            font-size: 13.5px;
            line-height: 1.65;
            color: var(--text-secondary);
        }
        .site-modal ul {
            margin: 6px 0 6px 18px;
        }
        .site-modal a {
            color: var(--accent-hover);
        }
        .site-modal-close {
            position: absolute;
            top: 16px;
            right: 16px;
            background: transparent;
            border: none;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
            color: var(--text-secondary);
            padding: 4px 8px;
            border-radius: 6px;
        }
        .site-modal-close:hover {
            background: var(--bg);
            color: var(--text);
        }

        /* ============================================================
           FOOTER
           ============================================================ */
        .footer {
            background: var(--card-bg);
            color: var(--text-secondary);
            padding: 18px 32px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
            font-size: 13px;
            border-top: 1px solid var(--border);
            margin-top: auto;
            margin-right: var(--right-sidebar-width);
            flex-shrink: 0;
        }
        .footer a {
            color: var(--text-secondary);
            text-decoration: none;
            transition: color 0.12s;
            font-weight: 500;
        }
        .footer a:hover {
            color: var(--accent);
        }
        .footer .links {
            display: flex;
            gap: 14px;
            align-items: center;
            flex-wrap: wrap;
        }
        .footer .links .divider {
            color: var(--border);
            opacity: 1;
        }

        /* ============================================================
           RESPONSIVE
           ============================================================ */
        @media (max-width: 1024px) {
            .right-sidebar {
                display: none;
            }
            .main-content {
                margin-right: 0;
            }
            .footer {
                margin-right: 0;
            }
        }
        @media (max-width: 820px) {
            .main-nav {
                display: none;
                position: absolute; left: 0; right: 0; top: 100%;
                flex-direction: column; align-items: stretch;
                background: var(--card-bg); border-bottom: 1.5px solid var(--border);
                padding: 10px 16px 16px; gap: 2px; box-shadow: var(--shadow-lift);
                z-index: 900; max-height: calc(100vh - var(--header-height)); overflow-y: auto;
            }
            .main-nav.open { display: flex; }
            .nav-item { width: 100%; }
            .nav-trig { width: 100%; justify-content: space-between; padding: 12px; }
            .nav-drop {
                position: static; opacity: 1; visibility: visible; transform: none; transition: none;
                display: none; min-width: 0; width: 100%; box-shadow: none; border: 0;
                background: var(--bg-tint); margin: 2px 0 6px; padding: 6px;
            }
            .nav-item[data-open="true"] .nav-drop { display: block; }
            .menu-toggle {
                display: flex;
            }
            .main-content {
                padding: 16px;
            }
            .footer {
                padding: 16px;
            }
            .delim-columns {
                flex-direction: column;
            }
            .delim-container {
                padding: 16px;
            }
            .settings-grid {
                grid-template-columns: 1fr 1fr;
            }
            .header {
                padding: 0 16px;
            }
            .header-brand {
                font-size: 18px;
            }
            .header-nav-links a {
                font-size: 12px;
                padding: 4px 8px;
            }
            .bmc-btn {
                font-size: 12px;
                padding: 6px 14px;
            }
            .simple-tool {
                padding: 16px;
            }
            .simple-tool .row {
                flex-direction: column;
            }
            .footer {
                flex-direction: column;
                text-align: center;
                padding: 14px 20px;
                gap: 8px;
            }
            .footer .links {
                justify-content: center;
            }
            .sticky-container {
                height: calc(100vh - var(--header-height) - 100px);
                min-height: 400px;
            }
            .sticky-note {
                width: 180px;
                min-height: 150px;
            }
            .comparator-container .row {
                flex-direction: column;
            }
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        @media (max-width: 480px) {
            .settings-grid {
                grid-template-columns: 1fr;
            }
            .delim-actions {
                flex-direction: column;
                align-items: stretch;
            }
            .delim-actions .btn {
                text-align: center;
            }
            .header-brand small {
                display: none;
            }
            .header-nav-links a {
                font-size: 11px;
                padding: 3px 6px;
            }
            .footer {
                font-size: 12px;
                padding: 12px 16px;
            }
            .footer .links {
                gap: 10px;
            }
            .sticky-toolbar .sticky-title small {
                display: none;
            }
            .sticky-toolbar {
                padding: 8px 12px;
                gap: 6px;
            }
            .sticky-toolbar .btn-yellow-sm,
            .sticky-toolbar .btn-dark-sm {
                font-size: 11px;
                padding: 4px 10px;
            }
            .stats-grid {
                grid-template-columns: 1fr 1fr;
            }
        }
