:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #111120;
    --bg-tertiary: #1a1a2e;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(108, 99, 255, 0.3);
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --accent: #6c63ff;
    --accent-glow: rgba(108, 99, 255, 0.2);
    --accent-2: #ff6b9d;
    --accent-3: #00d4aa;
    --gradient-1: linear-gradient(135deg, #6c63ff, #a855f7);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.05) 0%, transparent 50%), radial-gradient(ellipse at 80% 50%, rgba(255, 107, 157, 0.03) 0%, transparent 50%)
}

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px
}

.header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.badge {
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-weight: 500
}

.converter {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 20px
}

.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border)
}

.panel-header h2 {
    font-size: 0.82rem;
    font-weight: 600
}

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

.btn-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition);
    color: var(--text-secondary)
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary)
}

.code-area {
    width: 100%;
    padding: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    resize: vertical;
    min-height: 100px
}

.code-area:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent-glow)
}

.code-area::placeholder {
    color: var(--text-muted)
}

.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px
}

.check-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    cursor: pointer
}

.check-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent)
}

.char-count {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-muted)
}

.swap-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px
}

.swap-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--accent);
    cursor: pointer;
    transition: all var(--transition)
}

.swap-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: rotate(180deg);
    box-shadow: 0 0 16px var(--accent-glow)
}

.options-bar {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    flex-wrap: wrap
}

.dump-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden
}

.dump-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border)
}

.dump-header h2 {
    font-size: 0.82rem;
    font-weight: 600
}

.dump-view {
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.8;
    color: var(--text-secondary);
    overflow-x: auto;
    min-height: 60px;
    white-space: pre
}

.dump-offset {
    color: var(--accent);
    font-weight: 500
}

.dump-hex {
    color: var(--text-primary)
}

.dump-ascii {
    color: var(--accent-3)
}

.dump-separator {
    color: var(--text-muted)
}

@media(max-width:768px) {
    .converter {
        grid-template-columns: 1fr;
        gap: 8px
    }

    .swap-container {
        padding: 4px 0;
        transform: rotate(90deg)
    }
}