/* ═══════════════════════════════════════════════════════
   Polymorpher – Design System
   Dark theme · Glassmorphism · Sidebar Navigation
   ═══════════════════════════════════════════════════════ */

:root {
    --sidebar-w: 280px;
    --radius: 0.875rem;
    --transition: 0.25s cubic-bezier(.4, 0, .2, 1);

    --green: #22c55e;
    --amber: #f59e0b;
}

/* ── Dark Theme (default) ────────────────────────────── */
:root,
[data-theme="dark"] {
    --bg-dark: #1e2433;
    --bg-surface: #252d3f;
    --bg-elevated: #2e3750;

    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-glow: rgba(129, 140, 248, 0.3);
    --accent-dim: rgba(129, 140, 248, 0.12);

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #90a4be;

    --glass-bg: rgba(37, 45, 63, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(30, 36, 51, 0.85);
}

/* ── Light Theme ───────────────────────────────────── */
[data-theme="light"] {
    --bg-dark: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-elevated: #f8f9fb;

    --accent: #4f46e5;
    --accent-hover: #6366f1;
    --accent-glow: rgba(79, 70, 229, 0.18);
    --accent-dim: rgba(79, 70, 229, 0.08);

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #657083;

    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.14);
    --input-bg: rgba(241, 245, 249, 0.9);
}

/* ── Light theme specific overrides ────────────────── */
[data-theme="light"] h1 {
    background: linear-gradient(135deg, #1e293b 30%, var(--accent) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .bg-glow {
    display: none;
}

/* ── Light theme: Unit Converter cards ─────────────── */
[data-theme="light"] .unit-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .unit-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

[data-theme="light"] .unit-card.active {
    background: var(--accent);
    border-color: var(--accent);
}

[data-theme="light"] .unit-card__value {
    color: #1e293b;
}

[data-theme="light"] .unit-card:hover .unit-card__value {
    color: var(--accent);
}

[data-theme="light"] .unit-card.active .unit-card__value {
    color: #fff;
}

[data-theme="light"] .unit-card__name {
    color: #475569;
}

[data-theme="light"] .unit-card.active .unit-card__name {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .unit-card__abbr {
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent);
}

[data-theme="light"] .unit-card.active .unit-card__abbr {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

[data-theme="light"] .unit-card::before {
    display: none;
}

[data-theme="light"] .unit-card::after {
    display: none;
}

/* ── Theme Switcher ────────────────────────────────── */
.theme-switcher {
    display: flex;
    gap: 0.25rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 3px;
    margin-top: 0.75rem;
}

.theme-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: 2rem;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.theme-btn:hover {
    color: var(--text-primary);
    background: var(--glass-border);
}

.theme-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.theme-btn__icon {
    font-size: 0.8rem;
    line-height: 1;
}

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

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── Ambient Glows ──────────────────────────────────── */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(100px);
    will-change: transform, opacity;
    contain: layout style;
}

.bg-glow--1 {
    top: -15%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: var(--accent-glow);
    opacity: .2;
    animation: pulse1 10s ease-in-out infinite alternate;
}

.bg-glow--2 {
    bottom: -20%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(34, 197, 94, 0.12);
    opacity: .15;
    animation: pulse2 12s ease-in-out infinite alternate;
}

@keyframes pulse1 {
    0% {
        opacity: .2;
        transform: scale(1)
    }

    100% {
        opacity: .45;
        transform: scale(1.15)
    }
}

@keyframes pulse2 {
    0% {
        opacity: .15;
        transform: scale(1)
    }

    100% {
        opacity: .3;
        transform: scale(1.1)
    }
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition);
}

.sidebar__header {
    padding: 1.75rem 1.5rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

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

.logo-tag {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 2px;
}

/* ── Fixed Top-Right Nav ──────────────────────────────── */
.top-nav {
    margin-left: auto;
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
}

.top-nav a {
    padding: 6px 14px;
    border-radius: 7px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}

.top-nav a:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

[data-theme="light"] .top-nav {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

/* ── Nav Groups ─────────────────────────────────────── */
.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar__nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar__nav::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.nav-group {
    margin-bottom: 0.25rem;
}

.nav-group__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}

.nav-group__header:hover {
    color: var(--text-secondary);
}

.nav-group__chevron {
    margin-left: auto;
    transition: transform var(--transition);
    font-size: 0.6rem;
    color: var(--text-muted);
}

.nav-group.collapsed .nav-group__chevron {
    transform: rotate(-90deg);
}

.nav-group.collapsed .nav-group__items {
    display: none;
}

.nav-group__items {
    padding: 0.15rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1.5rem 0.55rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all var(--transition);
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--accent-dim);
}

.nav-item.active {
    color: var(--accent-hover);
    background: var(--accent-dim);
    border-left-color: var(--accent);
    font-weight: 500;
}

.nav-item__icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-item__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Sidebar Footer ─────────────────────────────────── */
.sidebar__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar__copy {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.75rem;
}

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════ */
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 0 2.5rem 3rem;
    transition: margin-left var(--transition);
}

/* ── Top Bar ────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 64px;
    position: sticky;
    top: 0;
    background: rgba(8, 9, 12, 0.8);
    backdrop-filter: blur(12px);
    z-index: 100;
    margin: 0 -2.5rem;
    padding: 0 2.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.topbar__toggle {
    display: none;
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    padding: 0.45rem;
    cursor: pointer;
    transition: all var(--transition);
}

.topbar__toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.topbar__breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb__category {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.breadcrumb__sep {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.breadcrumb__tool {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ── Tool Options Bar ──────────────────────────────── */
.tool-options {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tool-options__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.tool-options__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tool-options__key-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.tool-options__key-input {
    flex: 1;
    min-width: 200px;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    outline: none;
    transition: border-color 0.2s;
}

.tool-options__key-input:focus {
    border-color: var(--accent);
}

.tool-option-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 2rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    white-space: nowrap;
}

.tool-option-pill:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.tool-option-pill.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.tool-option-pill__icon {
    font-size: 0.9rem;
    line-height: 1;
}

/* ── Flat Nav Item entrance animation ─────────────── */
@keyframes navItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar__nav>.nav-item {
    animation: navItemSlideIn 0.3s ease both;
}

/* ── Glass Panel ────────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ── Editor Placeholder Overlay ────────────────────── */
.editor-pane__wrapper {
    position: relative;
    flex: 1;
    display: flex;
}

.editor-pane__wrapper textarea {
    position: relative;
    z-index: 1;
    background: transparent;
}

/* ── Floating Output Copy Button ─────────────────────── */
.output-copy-btn {
    position: absolute;
    top: 8px;
    right: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.08);
    backdrop-filter: blur(12px);
    cursor: pointer;
    color: var(--accent);
    transition: all 0.25s ease;
    opacity: 0.75;
}

.output-copy-btn:hover {
    opacity: 1;
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: scale(1.1);
    box-shadow: 0 0 18px var(--accent-glow);
}

.output-copy-btn:active {
    transform: scale(0.9);
}

.output-copy-btn--copied {
    opacity: 1 !important;
    color: var(--green) !important;
    border-color: var(--green) !important;
    background: rgba(16, 185, 129, 0.12) !important;
    animation: copyBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes copyBounce {
    0% {
        transform: scale(0.7);
    }

    60% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

[data-theme="light"] .output-copy-btn {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--accent);
    opacity: 0.8;
}

[data-theme="light"] .output-copy-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--accent);
}

.editor-placeholder {
    position: absolute;
    inset: 0;
    z-index: 0;
    margin: 0;
    padding: 1rem 3rem 1rem 1.15rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-muted);
    opacity: 0.50;
    pointer-events: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-all;
    border: none;
    background: none;
}

/* ── Tool Panel ─────────────────────────────────────── */
.tool-panel {
    padding: 2rem 2.5rem;
    margin-top: 1.5rem;
}

.tool-panel__header {
    margin-bottom: 1.75rem;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--accent-hover) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
}

.tool-panel__header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

/* ── Editor Grid ────────────────────────────────────── */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.25rem;
    align-items: stretch;
}

/* DateTime Converter: narrower input, wider output */
.datetime-layout .editor-grid {
    grid-template-columns: 0.5fr auto 1.5fr;
}

.datetime-layout .editor-pane:last-child textarea {
    font-size: 0.82rem;
    letter-spacing: -0.2px;
}

.editor-pane {
    display: flex;
    flex-direction: column;
}

.editor-pane__label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.editor-pane__label label {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

/* ── Color Picker Trigger ──────────────────────────── */
.color-picker-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
}

.color-picker-trigger:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.color-picker-trigger input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

.color-picker-trigger__icon {
    font-size: 0.9rem;
    line-height: 1;
}

[data-theme="light"] .color-picker-trigger {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .color-picker-trigger:hover {
    background: rgba(99, 102, 241, 0.08);
}

.label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.label-dot--input {
    background: var(--green);
}

.label-dot--output {
    background: var(--amber);
}

textarea {
    flex: 1;
    min-height: 400px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem 3.25rem 1rem 1.15rem;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.65;
    resize: none;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Textarea Scrollbar (Webkit) ─────────────────────── */
textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
    background-clip: content-box;
}

[data-theme="light"] textarea {
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

[data-theme="light"] textarea::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    background-clip: content-box;
}

[data-theme="light"] textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
    background-clip: content-box;
}

/* ── Buttons ────────────────────────────────────────── */
.editor-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
    padding: 0.85rem 1.5rem;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn--primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    padding: 0.65rem 1rem;
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn--accent-ghost {
    background: var(--accent-dim);
    color: var(--accent-hover);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.65rem 1rem;
    transition: all var(--transition);
}

.btn--accent-ghost:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
}

.btn--accent-ghost.reversed {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
}

@keyframes spinOnce {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-once {
    animation: spinOnce 0.4s cubic-bezier(.4, 0, .2, 1);
}

/* ── Ad Placeholders ────────────────────────────────── */
.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-placeholder--banner {
    min-height: 90px;
    height: auto;
    padding: 1rem;
    margin-top: 1.25rem;
    background: rgba(255, 255, 255, 0.015);
}

.ad-placeholder--inline {
    min-height: 90px;
    height: auto;
    padding: 1rem;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.015);
    text-align: center;
}

.ad-placeholder--sidebar {
    height: 350px;
    background: rgba(255, 255, 255, 0.02);
}

/* ── Regex Pattern Row ──────────────────────────────── */
.regex-pattern-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.regex-pattern-row__label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.regex-pattern-input {
    flex: 1;
    padding: 0.65rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--accent-hover);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.regex-pattern-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.regex-pattern-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.6;
}

/* ── Regex Blog Cheat Sheet Banner ────────────────────── */
.regex-blog-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.15rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.07), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.regex-blog-banner:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1);
}

.regex-blog-banner__emoji {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.regex-blog-banner__text {
    flex: 1;
    min-width: 0;
}

.regex-blog-banner__text strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.regex-blog-banner__text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.regex-blog-banner__text em {
    color: var(--accent-hover);
    font-style: normal;
    font-weight: 600;
}

.regex-blog-banner__btn {
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 10px var(--accent-glow);
    transition: background 0.25s;
}

.regex-blog-banner:hover .regex-blog-banner__btn {
    background: var(--accent-hover);
}

@media (max-width: 600px) {
    .regex-blog-banner__btn {
        display: none;
    }
}

/* ── SEO Block ──────────────────────────────────────── */
.seo-block {
    padding: 1.5rem 2rem;
    margin-top: 1.25rem;
}

.seo-block h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.seo-block p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.seo-block h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.seo-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.seo-block strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.json-ld {
    margin-top: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow-x: auto;
}

/* ═══════════════════════════════════════════════════════
   CONVERSION MATRIX (Unit Converter)
   ═══════════════════════════════════════════════════════ */

/* ── Calculator Layout (main + side ad) ────────────── */
.calc-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.calc-layout__main {
    flex: 1;
    min-width: 0;
}

.calc-layout__ad {
    flex-shrink: 0;
    width: 300px;
    position: sticky;
    top: 1rem;
}

.ad-placeholder--side {
    width: 300px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ad-placeholder__size {
    font-size: 0.65rem;
    opacity: 0.6;
}

@media (max-width: 1200px) {
    .calc-layout__ad {
        display: none;
    }
}

/* ── Value Input Row ───────────────────────────────── */
.converter-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.converter-input {
    flex: 1;
    background: var(--input-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition);
    -moz-appearance: textfield;
    appearance: textfield;
}

.converter-input::-webkit-inner-spin-button,
.converter-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.converter-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-dim);
}

.converter-source-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.4rem 1rem;
    min-width: 80px;
    box-shadow: 0 2px 10px var(--accent-glow);
    transition: all var(--transition);
}

.converter-source-badge #source-unit-name {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

.converter-source-badge .source-abbr {
    font-size: 1rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Category Tabs ─────────────────────────────────── */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.category-tab {
    padding: 0.35rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.category-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.category-tab.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* ── Search Bar ────────────────────────────────────── */
.unit-search {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 0.5rem 0.85rem;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 0.75rem;
    transition: border-color var(--transition);
}

.unit-search:focus {
    border-color: var(--accent);
}

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

/* ── Unit Toolbar ──────────────────────────────────── */
.unit-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.unit-toolbar .unit-search {
    margin-bottom: 0;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 0.45rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.sort-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.sort-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.sort-btn__icon {
    font-size: 1rem;
}

/* ── Unit Split Layout ─────────────────────────────── */
.unit-split {
    display: grid;
    grid-template-columns: 1fr 100px 1fr;
    gap: 0;
}

/* ── Mascot Panel (between Metric & Imperial) ─────── */
.unit-mascot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.5rem 0.75rem;
    position: relative;
    text-align: center;
    align-self: start;
    position: sticky;
    top: 1rem;
}

.unit-mascot::before {
    display: none;
}

.unit-mascot__emoji {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
    transition: transform 0.1s;
}

.unit-mascot__text,
.unit-mascot__subtext {
    display: none;
}

/* ── Mascot Entry Animation ───────────────────────── */
@keyframes mascotEnter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.unit-mascot.entering {
    animation: mascotEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.unit-mascot.entering .unit-mascot__emoji {
    animation: mascotEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
}

.unit-mascot.entering .unit-mascot__text {
    animation: mascotEnter 0.4s ease 0.12s both;
}

.unit-mascot.entering .unit-mascot__subtext {
    animation: mascotEnter 0.4s ease 0.2s both;
}

/* ── Per-Category Emoji Animations ────────────────── */

/* Length: stretching bounce */
@keyframes mascotBounce {

    0%,
    100% {
        transform: scaleY(1) scaleX(1);
    }

    25% {
        transform: scaleY(1.25) scaleX(0.85);
    }

    50% {
        transform: scaleY(0.85) scaleX(1.15);
    }

    75% {
        transform: scaleY(1.1) scaleX(0.95);
    }
}

.mascot-anim--bounce .unit-mascot__emoji {
    animation: mascotBounce 2s ease-in-out infinite;
}

/* Area: expanding pulse */
@keyframes mascotExpand {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.mascot-anim--expand .unit-mascot__emoji {
    animation: mascotExpand 2.5s ease-in-out infinite;
}

/* Weight: heavy wobble */
@keyframes mascotWiggle {

    0%,
    100% {
        transform: rotate(0deg) translateY(0);
    }

    20% {
        transform: rotate(-8deg) translateY(2px);
    }

    40% {
        transform: rotate(6deg) translateY(4px);
    }

    60% {
        transform: rotate(-4deg) translateY(2px);
    }

    80% {
        transform: rotate(3deg) translateY(1px);
    }
}

.mascot-anim--wiggle .unit-mascot__emoji {
    animation: mascotWiggle 1.8s ease-in-out infinite;
}

/* Volume: liquid wave */
@keyframes mascotWave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(15deg);
    }

    75% {
        transform: rotate(-15deg);
    }
}

.mascot-anim--wave .unit-mascot__emoji {
    animation: mascotWave 2s ease-in-out infinite;
    transform-origin: bottom center;
}

/* Temperature: heat throb with color glow */
@keyframes mascotPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
    }

    50% {
        transform: scale(1.12);
        filter: drop-shadow(0 4px 20px rgba(239, 68, 68, 0.5));
    }
}

.mascot-anim--pulse .unit-mascot__emoji {
    animation: mascotPulse 1.5s ease-in-out infinite;
}

/* Speed: zoom in/out */
@keyframes mascotZoom {
    0% {
        transform: translateX(-8px) scale(0.9);
        opacity: 0.7;
    }

    50% {
        transform: translateX(8px) scale(1.15);
        opacity: 1;
    }

    100% {
        transform: translateX(-8px) scale(0.9);
        opacity: 0.7;
    }
}

.mascot-anim--zoom .unit-mascot__emoji {
    animation: mascotZoom 1.6s ease-in-out infinite;
}

/* Data: digital glitch */
@keyframes mascotGlitch {

    0%,
    90%,
    100% {
        transform: translate(0, 0) skewX(0deg);
        opacity: 1;
    }

    92% {
        transform: translate(-3px, 1px) skewX(-2deg);
        opacity: 0.8;
    }

    94% {
        transform: translate(3px, -1px) skewX(3deg);
        opacity: 0.9;
    }

    96% {
        transform: translate(-1px, 2px) skewX(-1deg);
        opacity: 0.85;
    }

    98% {
        transform: translate(2px, 0px) skewX(1deg);
        opacity: 1;
    }
}

.mascot-anim--glitch .unit-mascot__emoji {
    animation: mascotGlitch 3s ease-in-out infinite;
}

/* Pressure: compression */
@keyframes mascotCompress {

    0%,
    100% {
        transform: scaleX(1) scaleY(1);
    }

    50% {
        transform: scaleX(1.2) scaleY(0.8);
    }
}

.mascot-anim--compress .unit-mascot__emoji {
    animation: mascotCompress 2s ease-in-out infinite;
}

.unit-column {
    display: flex;
    flex-direction: column;
}

.unit-column__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--glass-border);
    margin-bottom: 0.75rem;
}

.unit-column__header-icon {
    font-size: 1rem;
}

/* ── Card Grid ─────────────────────────────────────── */
.unit-column__cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    perspective: 800px;
}

/* ═══════════════════════════════════════════════════════
   UNIT CARD — Premium Glassmorphism + Animated Borders
   ═══════════════════════════════════════════════════════ */
.unit-card {
    --card-glow: rgba(99, 102, 241, 0);
    position: relative;
    background: rgba(18, 20, 30, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.65rem;
    padding: 0.6rem 0.7rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
    overflow: hidden;
    isolation: isolate;
}

/* ── Animated gradient border (rotating conic) ───── */
.unit-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(from var(--border-angle, 0deg),
            transparent 40%,
            rgba(99, 102, 241, 0.4) 50%,
            rgba(168, 85, 247, 0.3) 55%,
            transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -2;
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    to {
        --border-angle: 360deg;
    }
}

@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ── Shimmer sweep effect ──────────────────────────── */
.unit-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.04),
            transparent);
    transform: skewX(-15deg);
    transition: left 0.6s ease;
    z-index: -1;
}

.unit-card:hover::after {
    left: 130%;
}

/* ── Hover: 3D lift + gradient border reveal ───────── */
.unit-card:hover {
    transform: translateY(-4px) rotateX(2deg) scale(1.02);
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(24, 26, 40, 0.85);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    z-index: 10;
}

.unit-card:hover::before {
    opacity: 1;
}

/* ── Active: Neon glow + breathing pulse ───────────── */
.unit-card.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
    border-color: var(--accent);
    box-shadow:
        0 0 16px rgba(99, 102, 241, 0.25),
        0 0 40px rgba(99, 102, 241, 0.1),
        0 0 0 1px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: cardPulse 3s ease-in-out infinite;
}

.unit-card.active::before {
    opacity: 0.8;
}

@keyframes cardPulse {

    0%,
    100% {
        box-shadow:
            0 0 16px rgba(99, 102, 241, 0.25),
            0 0 40px rgba(99, 102, 241, 0.1),
            0 0 0 1px rgba(99, 102, 241, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    50% {
        box-shadow:
            0 0 24px rgba(99, 102, 241, 0.35),
            0 0 60px rgba(99, 102, 241, 0.15),
            0 0 0 2px rgba(99, 102, 241, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }
}

/* ── Value ─────────────────────────────────────────── */
.unit-card__value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.unit-card:hover .unit-card__value {
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.unit-card.active .unit-card__value {
    color: var(--accent-hover);
    text-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

/* ── Name ──────────────────────────────────────────── */
.unit-card__name {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.unit-card:hover .unit-card__name {
    color: var(--text-secondary);
}

.unit-card.active .unit-card__name {
    color: rgba(165, 180, 252, 0.8);
}

/* ── Abbreviation Badge ────────────────────────────── */
.unit-card__abbr {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--accent-hover);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 0.1rem 0.35rem;
    border-radius: 0.3rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.unit-card:hover .unit-card__abbr {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.15);
}

.unit-card.active .unit-card__abbr {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* ── Entrance Animation ────────────────────────────── */
@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.92) rotateX(8deg);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}

.unit-card {
    animation: cardReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Spin animation ────────────────────────────────── */
@keyframes spin {
    100% {
        transform: rotate(360deg)
    }
}

.spin {
    animation: spin 0.7s linear infinite;
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
    }

    .main {
        margin-left: 0;
    }

    .topbar__toggle {
        display: flex;
    }

    .editor-grid {
        grid-template-columns: 1fr;
    }

    .editor-actions {
        flex-direction: row;
        justify-content: center;
        margin: 0.5rem 0;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 0 1rem 2rem;
    }

    .topbar {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .tool-panel {
        padding: 1.25rem;
    }

    h1 {
        font-size: 1.4rem;
    }
}

/* ── Site Footer ──────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-left: var(--sidebar-w);
}

.site-footer__copy {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.site-footer__links {
    display: flex;
    gap: 1.25rem;
}

.site-footer__links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    transition: color 0.2s;
}

.site-footer__links a:hover {
    color: var(--accent);
}

@media (max-width: 1024px) {
    .site-footer {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .site-footer {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
}

/* ── Color Preview Swatch ─────────────────────────────── */
.color-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
}

.color-preview__swatch {
    width: 64px;
    height: 64px;
    border-radius: 0.75rem;
    border: 2px solid var(--glass-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    /* Checkerboard pattern for transparency visibility */
    background-image:
        linear-gradient(45deg, var(--bg-elevated) 25%, transparent 25%),
        linear-gradient(-45deg, var(--bg-elevated) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--bg-elevated) 75%),
        linear-gradient(-45deg, transparent 75%, var(--bg-elevated) 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.color-preview__swatch::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--swatch-color, transparent);
}

.color-preview__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════
   LOGO LINK
   ═══════════════════════════════════════════════════════ */
.logo-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity var(--transition);
}

.logo-link:hover {
    opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════
   INFO BUTTONS (Metric / Imperial headers)
   ═══════════════════════════════════════════════════════ */
.info-btn {
    margin-left: auto;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--accent);
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.info-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

/* ═══════════════════════════════════════════════════════
   SYSTEM INFO MODAL
   ═══════════════════════════════════════════════════════ */
.system-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease;
}

.system-modal {
    position: relative;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem 2.25rem;
    animation: modalEnter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.system-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.system-modal__close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
}

.system-modal__header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.system-modal__emoji {
    font-size: 2.5rem;
    line-height: 1;
}

.system-modal__title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--accent-hover) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.system-modal__body h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin: 1.25rem 0 0.5rem;
}

.system-modal__body h3:first-child {
    margin-top: 0;
}

.system-modal__body p {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.system-modal__body .country-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.system-modal__body .country-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 2rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.system-modal__body .stat-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.system-modal__body .stat-row__icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.system-modal__body .stat-row__text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.system-modal__body .stat-row__text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   HOMEPAGE PANEL
   ═══════════════════════════════════════════════════════ */
.home-panel {
    padding: 1rem 0;
    max-width: 960px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

.home-hero {
    text-align: center;
    margin-bottom: 1rem;
}

.home-hero__title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

.home-hero__tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.home-hero__sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.2s forwards;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Quick Stats Bar ────────────────────────────────── */
.home-stats {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.home-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    backdrop-filter: blur(8px);
    animation: fadeSlideUp 0.5s ease both;
}

.home-stat:nth-child(1) {
    animation-delay: 0.1s;
}

.home-stat:nth-child(2) {
    animation-delay: 0.2s;
}

.home-stat:nth-child(3) {
    animation-delay: 0.3s;
}

.home-stat:nth-child(4) {
    animation-delay: 0.4s;
}

.home-stat__icon {
    font-size: 1.1rem;
    line-height: 1;
}

.home-stat__value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-hover);
}

.home-stat__label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Section Title ──────────────────────────────────── */
.home-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    padding-left: 0.25rem;
    letter-spacing: 0.5px;
}

/* ── Tool Showcase Grid ─────────────────────────────── */
.home-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.home-tool-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.home-tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.home-tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.home-tool-card:hover::before {
    opacity: 1;
}

.home-tool-card__icon {
    font-size: 1.25rem;
    line-height: 1;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.home-tool-card__info {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.home-tool-card__name {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-tool-card__desc {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Light theme overrides ──────────────────────────── */
[data-theme="light"] .home-stat {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .home-tool-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .home-tool-card:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.12);
}

/* ── Daily Fact Card ─────────────────────────────────── */
.daily-fact-card {
    padding: 0.85rem 1.25rem;
    position: relative;
    overflow: hidden;
}

.daily-fact-card__body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.daily-fact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #a855f7, var(--accent));
    background-size: 200% 100%;
    animation: gradientSlide 4s ease infinite;
}

@keyframes gradientSlide {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.daily-fact-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.daily-fact-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background: var(--accent-dim);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-hover);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.daily-fact-card__date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.daily-fact-card__emoji {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

@keyframes factEmojiFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.daily-fact-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.daily-fact-card__text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0;
    animation: factTextReveal 0.8s ease 0.3s both;
}

@keyframes factTextReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.daily-fact-card__source {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.7;
}




@keyframes hintPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════
   SEO RELATED TOOLS LINKS
   ═══════════════════════════════════════════════════════ */
.seo-related {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    font-size: 0.85rem;
    opacity: 0.85;
}

.seo-related a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.seo-related a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════
   WOW EFFECTS — Confetti Burst
   ═══════════════════════════════════════════════════════ */
.confetti-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 9999;
    animation: confettiBurst 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes confettiBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.2);
    }
}

/* ═══════════════════════════════════════════════════════
   WOW EFFECTS — Ripple Click
   ═══════════════════════════════════════════════════════ */
.btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

@keyframes rippleExpand {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════
   WOW EFFECTS — Floating Particles Background
   ═══════════════════════════════════════════════════════ */
.floating-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: particleFloat var(--duration) var(--delay) ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0.5);
    }

    10% {
        opacity: var(--max-opacity, 0.3);
    }

    90% {
        opacity: var(--max-opacity, 0.3);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

/* ═══════════════════════════════════════════════════════
   WOW EFFECTS — 3D Tilt Hover on Tool Cards
   ═══════════════════════════════════════════════════════ */
.home-tool-grid {
    perspective: 1000px;
}

.home-tool-card {
    transform-style: preserve-3d;
    transition: all 0.25s ease, transform 0.15s ease;
}

.home-tool-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--glowX, 50%) var(--glowY, 50%),
            rgba(99, 102, 241, 0.15) 0%,
            transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.home-tool-card:hover::after {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════
   WOW EFFECTS — Typewriter Cursor
   ═══════════════════════════════════════════════════════ */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.7s step-end infinite;
}

@keyframes cursorBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Light theme adjustments */
[data-theme="light"] .ripple {
    background: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .confetti-particle {
    filter: brightness(0.9);
}

/* ═══════════════════════════════════════════════════════
   COMMAND PALETTE (Ctrl+K)
   ═══════════════════════════════════════════════════════ */
.cmd-palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    animation: cmdFadeIn 0.15s ease;
}

@keyframes cmdFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.cmd-palette {
    width: 520px;
    max-width: 90vw;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--glass-border);
    animation: cmdSlideIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cmdSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cmd-palette__search-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.cmd-palette__search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.cmd-palette__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
}

.cmd-palette__input::placeholder {
    color: var(--text-muted);
}

.cmd-palette__esc {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
}

.cmd-palette__results {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.cmd-palette__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 400;
}

.cmd-palette__item:hover,
.cmd-palette__item.active {
    background: var(--accent-dim);
    color: var(--text-primary);
}

.cmd-palette__item.active {
    background: var(--accent);
    color: #fff;
}

.cmd-palette__item-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.cmd-palette__item-label {
    flex: 1;
}

.cmd-palette__item-slug {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.cmd-palette__item.active .cmd-palette__item-slug {
    color: rgba(255, 255, 255, 0.6);
}

.cmd-palette__empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.cmd-palette__footer {
    display: flex;
    gap: 1.25rem;
    padding: 0.55rem 1.25rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.cmd-palette__footer kbd {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    margin-right: 0.25rem;
}

/* Light theme adjustments */
[data-theme="light"] .cmd-palette-overlay {
    background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .cmd-palette__esc,
[data-theme="light"] .cmd-palette__footer kbd {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .cmd-palette__item.active {
    background: var(--accent);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS HINT BAR
   ═══════════════════════════════════════════════════════ */
.kbd-hints {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-w);
    right: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.45rem 1rem;
    background: rgba(8, 9, 12, 0.7);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--glass-border);
    z-index: 90;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.kbd-hint kbd {
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .kbd-hints {
    background: rgba(240, 242, 245, 0.85);
}

[data-theme="light"] .kbd-hint kbd {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

@media (max-width: 1024px) {
    .kbd-hints {
        left: 0;
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════
   ONBOARDING TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */
.onboard-toast {
    position: fixed;
    bottom: 48px;
    right: 24px;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.15rem;
    max-width: 380px;
    border-radius: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(99, 102, 241, 0.1);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--text-primary);
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

.onboard-toast.dismissing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(80px);
    }
}

.onboard-toast__emoji {
    font-size: 1.35rem;
    flex-shrink: 0;
    line-height: 1;
}

.onboard-toast__body {
    flex: 1;
    line-height: 1.45;
}

.onboard-toast__body strong {
    color: var(--accent-hover);
    font-weight: 600;
}

.onboard-toast__body kbd {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--accent-hover);
}

.onboard-toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.onboard-toast__close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.onboard-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 14px 14px;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ── localStorage Restore Badge ──────────────────────── */
.restored-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.68rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--green);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    animation: badgeFadeIn 0.4s ease;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.restored-badge.fading {
    animation: badgeFadeOut 0.4s ease forwards;
}

@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes badgeFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* ── Auto-transform indicator ────────────────────────── */
.auto-flash {
    animation: autoFlash 0.6s ease;
}

@keyframes autoFlash {
    0% {
        color: var(--text-secondary);
    }

    50% {
        color: var(--accent);
    }

    100% {
        color: var(--text-secondary);
    }
}

/* Light theme adjustments for toasts */
[data-theme="light"] .onboard-toast {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .onboard-toast__body kbd {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .onboard-toast {
        right: 12px;
        left: 12px;
        max-width: none;
        bottom: 12px;
    }
}