/* ============================================================
           GLOBAL RESET & VARIABLES
           ============================================================ */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        :root {
            --primary: #111827;
            --primary-light: #1e293b;
            --accent: #facc15;
            --accent-hover: #e5b800;
            --bg: #f3f4f6;
            --card-bg: #ffffff;
            --text: #111827;
            --text-secondary: #6b7280;
            --border: #e5e7eb;
            --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
            --radius: 12px;
            --sidebar-width: 220px;
            --right-sidebar-width: 310px;
            --header-height: 64px;
            --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
            --mono: 'Menlo', 'Cascadia Code', 'Consolas', monospace;
        }
        html {
            scroll-behavior: smooth;
        }
        body {
            font-family: var(--font);
            background: var(--bg);
            color: var(--text);
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        /* ============================================================
           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: var(--primary);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
            z-index: 1000;
            border-bottom: 2px solid var(--accent);
            box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
        }
        .header-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 22px;
            font-weight: 700;
            letter-spacing: -0.5px;
        }
        .header-brand span {
            color: var(--accent);
        }
        .header-brand small {
            font-size: 11px;
            font-weight: 400;
            opacity: 0.6;
            letter-spacing: 0.3px;
        }
        .header-right {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .header-nav-links {
            display: flex;
            gap: 6px;
            align-items: center;
        }
        .header-nav-links a {
            color: #94a3b8;
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            padding: 6px 12px;
            border-radius: 6px;
            transition: all 0.12s;
        }
        .header-nav-links a:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
        }
        .header-nav-links a.active-link {
            background: var(--accent);
            color: var(--primary);
        }
        .header-nav-links a.active-link:hover {
            background: var(--accent-hover);
        }
        .bmc-btn {
            background: #ff813f;
            color: #fff;
            border: none;
            border-radius: 30px;
            padding: 8px 20px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.15s;
            font-family: var(--font);
            text-decoration: none;
        }
        .bmc-btn:hover {
            transform: scale(1.04);
            box-shadow: 0 4px 16px rgba(255, 129, 63, 0.4);
        }

        .menu-toggle {
            display: none;
            background: none;
            border: none;
            color: #fff;
            font-size: 24px;
            cursor: pointer;
            padding: 4px 8px;
        }

        /* ============================================================
           LEFT SIDEBAR
           ============================================================ */
        .left-sidebar {
            position: fixed;
            top: var(--header-height);
            left: 0;
            bottom: 0;
            width: var(--sidebar-width);
            background: var(--card-bg);
            border-right: 1px solid var(--border);
            overflow-y: auto;
            padding: 12px 0;
            z-index: 100;
            transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
            scrollbar-width: thin;
        }
        .left-sidebar::-webkit-scrollbar {
            width: 4px;
        }
        .left-sidebar::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 4px;
        }
        .left-sidebar .nav-section {
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--text-secondary);
            padding: 12px 18px 6px 18px;
        }
        .left-sidebar a {
            display: block;
            width: 100%;
            text-align: left;
            padding: 7px 18px;
            border: none;
            background: none;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.12s;
            font-family: var(--font);
            border-left: 3px solid transparent;
            line-height: 1.3;
            text-decoration: none;
        }
        .left-sidebar a:hover {
            background: var(--bg);
            color: var(--text);
        }
        .left-sidebar a.active {
            color: var(--accent);
            background: rgba(250, 204, 21, 0.08);
            border-left-color: var(--accent);
            color: #111827;
            font-weight: 600;
        }

        /* ============================================================
           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: 18px 16px;
            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-size: 18px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 2px;
        }
        .right-sidebar .tool-desc {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }
        .right-sidebar .how-to {
            background: var(--bg);
            border-radius: 8px;
            padding: 10px 12px;
            margin-bottom: 8px;
            border-left: 3px solid var(--accent);
            font-size: 12px;
            line-height: 1.6;
        }
        .right-sidebar .how-to strong {
            color: var(--text);
        }
        .right-sidebar .sample-section {
            background: var(--bg);
            border-radius: 8px;
            padding: 10px 12px;
            margin-bottom: 8px;
            border-left: 3px solid #059669;
        }
        .right-sidebar .sample-section .sample-label {
            font-weight: 600;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-secondary);
            margin-bottom: 2px;
        }
        .right-sidebar .sample-section .sample-code {
            background: #fff;
            padding: 6px 10px;
            border-radius: 4px;
            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: 2px;
            line-height: 1.5;
            cursor: pointer;
            user-select: all;
        }
        .right-sidebar .sample-section .sample-code:hover {
            background: #f8fafc;
        }
        .right-sidebar .sample-section .sample-output {
            margin-top: 4px;
            padding: 6px 10px;
            background: #f0fdf4;
            border-radius: 4px;
            font-family: var(--mono);
            font-size: 11px;
            color: #065f46;
            border: 1px solid #bbf7d0;
            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: 2px 0;
        }
        .right-sidebar .tool-tip {
            font-size: 12px;
            color: var(--text-secondary);
            border-top: 1px solid var(--border);
            padding-top: 10px;
            margin-top: 4px;
        }

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

        /* ============================================================
           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-size: 24px;
            font-weight: 700;
            margin-bottom: 2px;
            color: var(--text);
        }
        .tool-panel .panel-sub {
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 20px;
        }

        /* ============================================================
           NUMBERED TEXTAREA (used across all tools)
           ============================================================ */
        .numbered-wrap {
            display: flex;
            border: 2px solid var(--border);
            border-radius: 8px;
            overflow: hidden;
            background: #fafbfc;
            max-height: 400px;
            transition: border-color 0.15s;
        }
        .numbered-wrap:focus-within {
            border-color: var(--accent);
            box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.15);
        }
        .line-numbers {
            background: var(--bg);
            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: 2px 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: 340px;
            max-height: 400px;
            outline: none;
            color: var(--text);
            overflow-y: auto;
            scrollbar-width: thin;
        }
        .numbered-wrap textarea::placeholder {
            color: #b0b8c4;
        }
        .numbered-wrap textarea:read-only {
            background: #f8f9fc;
        }

        /* ============================================================
           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: #fff;
            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: 9px 24px;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            font-family: var(--font);
            transition: all 0.12s;
        }
        .btn-primary {
            background: var(--primary);
            color: #fff;
        }
        .btn-primary:hover {
            background: var(--primary-light);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(17, 24, 39, 0.25);
        }
        .btn-success {
            background: #059669;
            color: #fff;
        }
        .btn-success:hover {
            background: #047857;
            transform: translateY(-1px);
        }
        .btn-danger {
            background: #e5e7eb;
            color: #dc2626;
        }
        .btn-danger:hover {
            background: #fee2e2;
        }
        .btn-yellow {
            background: var(--accent);
            color: var(--primary);
        }
        .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: 24px 28px;
            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: 380px;
        }
        .simple-tool .row .col .numbered-wrap textarea {
            min-height: 340px;
            max-height: 380px;
        }
        .simple-tool .row .col .numbered-wrap .line-numbers {
            max-height: 380px;
        }

        .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(--primary);
            color: #fff;
        }
        .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: #e5e7eb;
            color: var(--text);
        }
        .simple-tool .toolbar .btn-sm.copy:hover {
            background: #d1d5db;
        }
        .simple-tool .toolbar .btn-sm.clear {
            background: #fff;
            color: #b91c1c;
            box-shadow: inset 0 0 0 1px #fecaca;
        }
        .simple-tool .toolbar .btn-sm.clear:hover {
            background: #fef2f2;
            box-shadow: inset 0 0 0 1px #fca5a5;
        }
        /* ============================================================
           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: #fffdf5;
        }
        .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: #fff;
        }
        .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(250, 204, 21, 0.12);
            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(250, 204, 21, 0.22);
        }

        .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: #fff;
        }

        /* ============================================================
           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: hidden;
            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(--primary);
            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: var(--primary);
            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: hidden;
            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-title {
            font-size: 11px;
            font-weight: 600;
            opacity: 0.5;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }
        .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;
        }
        .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 .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;
        }

        /* ============================================================
           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: #e5e7eb;
            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: #d1d5db;
        }
        .sql-template-code {
            margin: 0;
            padding: 14px;
            font-family: var(--mono);
            font-size: 12.5px;
            line-height: 1.6;
            color: #1e293b;
            background: #fafbfc;
            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: 28px;
            margin-top: 8px;
        }
        .hub-category h2 {
            font-size: 15px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 12px;
            padding-bottom: 6px;
            border-bottom: 2px solid var(--accent);
            display: inline-block;
        }
        .hub-cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 12px;
        }
        .hub-card {
            display: block;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            box-shadow: var(--shadow);
            padding: 14px 16px;
            text-decoration: none;
            transition: all 0.15s;
        }
        .hub-card:hover {
            border-color: var(--accent);
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
        }
        .hub-card-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 4px;
        }
        .hub-card-desc {
            font-size: 12.5px;
            line-height: 1.5;
            color: var(--text-secondary);
        }

        /* ============================================================
           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(--primary);
            color: #94a3b8;
            padding: 18px 32px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
            font-size: 13px;
            border-top: 2px solid var(--accent);
            margin-top: auto;
            margin-left: var(--sidebar-width);
            margin-right: var(--right-sidebar-width);
            flex-shrink: 0;
        }
        .footer a {
            color: #cbd5e1;
            text-decoration: none;
            transition: color 0.12s;
        }
        .footer a:hover {
            color: #fff;
        }
        .footer .links {
            display: flex;
            gap: 14px;
            align-items: center;
            flex-wrap: wrap;
        }
        .footer .links .divider {
            color: #475569;
            opacity: 0.5;
        }

        /* ============================================================
           RESPONSIVE
           ============================================================ */
        @media (max-width: 1024px) {
            .right-sidebar {
                display: none;
            }
            .main-content {
                margin-right: 0;
            }
            .footer {
                margin-right: 0;
            }
        }
        @media (max-width: 820px) {
            .left-sidebar {
                transform: translateX(-100%);
                width: 250px;
                box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
            }
            .left-sidebar.open {
                transform: translateX(0);
            }
            .menu-toggle {
                display: block;
            }
            .main-content {
                margin-left: 0;
                padding: 16px;
            }
            .footer {
                margin-left: 0;
                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;
            }
        }

        .sidebar-overlay {
            display: none;
            position: fixed;
            top: var(--header-height);
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.3);
            z-index: 99;
        }
        .sidebar-overlay.show {
            display: block;
        }
