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

        body {
            font-family: 'Segoe UI', system-ui, sans-serif;
            background: #0f1117;
            color: #e2e8f0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2rem 1rem;
        }

        main {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        h1 {
            font-size: 1.75rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
            color: #f8fafc;
            letter-spacing: -0.5px;
        }

        .subtitle {
            font-size: 0.875rem;
            color: #64748b;
            margin-bottom: 2rem;
        }

        .container {
            width: 100%;
            max-width: 980px;
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            gap: 1rem;
            align-items: start;
        }

        .panel {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .panel-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
        }

        .panel label {
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #94a3b8;
        }

        .mode-badge {
            border: 1px solid #2d3348;
            border-radius: 999px;
            color: #64748b;
            font-size: 0.68rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            line-height: 1;
            padding: 0.28rem 0.5rem;
            text-transform: uppercase;
        }

        .panel.active .mode-badge {
            border-color: #4ade80;
            color: #4ade80;
        }

        .panel.output .mode-badge {
            border-color: #475569;
            color: #94a3b8;
        }

        textarea {
            width: 100%;
            height: 260px;
            background: #1e2130;
            border: 1px solid #2d3348;
            border-radius: 10px;
            color: #e2e8f0;
            font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
            font-size: 0.9rem;
            line-height: 1.6;
            padding: 0.875rem 1rem;
            resize: vertical;
            outline: none;
            transition: border-color 0.15s;
        }

        textarea[readonly] {
            background: #171a27;
            color: #94a3b8;
            cursor: default;
        }

        textarea:focus {
            border-color: #6366f1;
        }

        textarea.error {
            border-color: #ef4444;
        }

        .hint {
            font-size: 0.75rem;
            color: #475569;
            min-height: 1.1rem;
        }

        .hint.err {
            color: #f87171;
        }

        .hint.ok {
            color: #4ade80;
        }

        .arrows {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding-top: 1.6rem;
            width: 7.25rem;
        }

        .btn {
            background: #6366f1;
            border: 1px solid transparent;
            border-radius: 8px;
            color: #fff;
            cursor: pointer;
            font-size: 0.78rem;
            font-weight: 700;
            padding: 0.55rem 0.65rem;
            text-align: center;
            transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
            line-height: 1;
            width: 100%;
        }

        .btn:hover {
            background: #818cf8;
        }

        .btn.active {
            background: #4ade80;
            color: #052e16;
        }

        .btn:not(.active) {
            background: #171a27;
            border-color: #2d3348;
            color: #94a3b8;
        }

        .btn:not(.active):hover {
            border-color: #6366f1;
            color: #e2e8f0;
        }

        .btn:active {
            transform: scale(0.95);
        }

        .btn[title] {
            position: relative;
        }

        .panel-options {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem 1.25rem;
            background: #1e2130;
            border: 1px solid #2d3348;
            border-radius: 10px;
            padding: 0.875rem 1rem;
            align-items: center;
        }

        .opt-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.825rem;
            color: #94a3b8;
            min-width: 0;
        }

        .opt-group select,
        .opt-group input[type="checkbox"] {
            accent-color: #6366f1;
            cursor: pointer;
        }

        .opt-group select {
            background: #0f1117;
            border: 1px solid #2d3348;
            border-radius: 5px;
            color: #e2e8f0;
            padding: 0.2rem 0.4rem;
            font-size: 0.8rem;
            outline: none;
            max-width: 100%;
        }

        .field-footer {
            align-items: center;
            display: flex;
            gap: 0.75rem;
            justify-content: space-between;
        }

        .stats {
            color: #64748b;
            font-size: 0.74rem;
            min-height: 1rem;
        }

        .export-control {
            display: flex;
            gap: 0.5rem;
        }

        .export-control select,
        .export-btn {
            background: #171a27;
            border: 1px solid #2d3348;
            border-radius: 6px;
            color: #94a3b8;
            cursor: pointer;
            font-size: 0.74rem;
            padding: 0.42rem 0.5rem;
            transition: border-color 0.15s, color 0.15s;
        }

        .export-control select {
            flex: 1;
            min-width: 0;
            outline: none;
        }

        .export-btn {
            flex: 0 0 auto;
        }

        .export-control select:hover,
        .export-control select:focus,
        .export-btn:hover {
            border-color: #6366f1;
            color: #e2e8f0;
        }

        .utility-bar {
            width: 100%;
            max-width: 980px;
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 1rem;
        }

        .utility-btn {
            background: #1e2130;
            border: 1px solid #2d3348;
            border-radius: 6px;
            color: #94a3b8;
            cursor: pointer;
            font-size: 0.78rem;
            padding: 0.48rem 0.7rem;
            transition: border-color 0.15s, color 0.15s;
        }

        .utility-btn:hover {
            border-color: #6366f1;
            color: #e2e8f0;
        }

        .clear-btn {
            background: transparent;
            border: 1px solid #2d3348;
            border-radius: 6px;
            color: #64748b;
            cursor: pointer;
            font-size: 0.75rem;
            padding: 0.2rem 0.55rem;
            transition: color 0.15s, border-color 0.15s;
        }

        .clear-btn:hover {
            color: #f87171;
            border-color: #f87171;
        }

        .copy-btn {
            background: transparent;
            border: 1px solid #2d3348;
            border-radius: 6px;
            color: #64748b;
            cursor: pointer;
            font-size: 0.75rem;
            padding: 0.2rem 0.55rem;
            transition: color 0.15s, border-color 0.15s;
        }

        .copy-btn:hover {
            color: #4ade80;
            border-color: #4ade80;
        }

        .row-actions {
            display: flex;
            gap: 0.4rem;
        }

        .ascii-table-section {
            width: 100%;
            max-width: 980px;
            margin-top: 1.5rem;
        }

        .ascii-table-section h2 {
            color: #f8fafc;
            font-size: 1.1rem;
        }

        .ascii-table-section summary {
            align-items: center;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            list-style: none;
        }

        .ascii-table-section summary::-webkit-details-marker {
            display: none;
        }

        .ascii-table-section summary::after {
            color: #94a3b8;
            content: '+';
            font-size: 1.2rem;
            font-weight: 700;
        }

        .ascii-table-section[open] summary::after {
            content: '-';
        }

        .ascii-table-description {
            color: #94a3b8;
            font-size: 0.84rem;
            line-height: 1.5;
            margin: 0.65rem 0 0.85rem;
        }

        .table-wrap {
            border: 1px solid #2d3348;
            border-radius: 10px;
            max-height: 420px;
            overflow: auto;
        }

        .ascii-table {
            width: 100%;
            border-collapse: collapse;
            background: #171a27;
            font-size: 0.82rem;
        }

        .ascii-table th,
        .ascii-table td {
            border-bottom: 1px solid #2d3348;
            padding: 0.5rem 0.65rem;
            text-align: left;
            white-space: nowrap;
        }

        .ascii-table th {
            background: #1e2130;
            color: #94a3b8;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            position: sticky;
            text-transform: uppercase;
            top: 0;
            z-index: 1;
        }

        .ascii-table td {
            color: #cbd5e1;
        }

        .ascii-table td:nth-child(3) {
            color: #4ade80;
            font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
        }

        footer {
            width: 100%;
            max-width: 980px;
            margin-top: 2rem;
            padding-top: 1rem;
            border-top: 1px solid #2d3348;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 0.75rem;
            color: #64748b;
            font-size: 0.8rem;
        }

        footer nav {
            display: flex;
            flex-wrap: wrap;
            gap: 0.875rem;
        }

        footer a {
            color: #94a3b8;
            text-decoration: none;
        }

        footer a:hover {
            color: #e2e8f0;
        }

        .seo-content {
            width: 100%;
            max-width: 980px;
            margin-top: 2.5rem;
            border-top: 1px solid #2d3348;
            padding-top: 2rem;
        }

        .seo-content h2 {
            color: #f8fafc;
            font-size: 1.05rem;
            font-weight: 600;
            margin: 1.75rem 0 0.5rem;
        }

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

        .seo-content p {
            color: #94a3b8;
            font-size: 0.92rem;
            line-height: 1.7;
            margin-bottom: 0.5rem;
        }

        .seo-content ul {
            margin: 0.4rem 0 0.75rem;
            padding-left: 1.5rem;
        }

        .seo-content li {
            color: #94a3b8;
            font-size: 0.92rem;
            line-height: 1.6;
            margin-bottom: 0.35rem;
        }

        .seo-content code {
            background: #1e2130;
            border: 1px solid #2d3348;
            border-radius: 4px;
            color: #a5b4fc;
            font-family: 'Cascadia Code', 'Consolas', monospace;
            font-size: 0.84em;
            padding: 0.1em 0.4em;
        }

        .faq-list {
            margin-top: 0.5rem;
        }

        .faq-list dt {
            color: #e2e8f0;
            font-size: 0.92rem;
            font-weight: 600;
            margin-top: 1.25rem;
        }

        .faq-list dd {
            color: #94a3b8;
            font-size: 0.92rem;
            line-height: 1.7;
            margin: 0.35rem 0 0;
        }

        @media (max-width: 600px) {
            body {
                padding: 1rem 0.75rem;
            }

            h1 {
                font-size: 1.45rem;
            }

            .subtitle {
                margin-bottom: 1.25rem;
                text-align: center;
            }

            .container {
                grid-template-columns: 1fr;
                grid-template-rows: auto auto auto;
            }

            .arrows {
                flex-direction: row;
                padding-top: 0;
                justify-content: center;
                width: 100%;
            }

            .btn {
                min-height: 2.5rem;
            }

            .field-footer,
            .export-control {
                align-items: stretch;
                flex-direction: column;
            }

            .row-actions,
            .utility-bar {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                width: 100%;
            }

            .copy-btn,
            .clear-btn,
            .utility-btn,
            .export-btn {
                min-height: 2.35rem;
            }

            .panel-options {
                align-items: stretch;
                flex-direction: column;
            }

            .opt-group {
                justify-content: space-between;
            }
        }
