:root {
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --bg: #0C0E1A;
    --surface: #161929;
    --surface-2: #1F2337;
    --border: rgba(251, 146, 60, .12);
    --border-hover: rgba(251, 146, 60, .3);
    --primary: #FB923C;
    --primary-glow: rgba(251, 146, 60, .2);
    --accent: #FBBF24;
    --text: #E8E4F0;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --green: #4ADE80;
    --red: #F87171;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, .4);
    --transition: .25s ease
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    background-image: radial-gradient(ellipse at 20% 0%, rgba(251, 146, 60, .05) 0%, transparent 50%), radial-gradient(ellipse at 80% 100%, rgba(251, 191, 36, .04) 0%, transparent 50%)
}

.header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    background: rgba(12, 14, 26, .8);
    position: sticky;
    top: 0;
    z-index: 50
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem
}

.logo {
    display: flex;
    align-items: center;
    gap: .75rem
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 146, 60, .1);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 1.25rem
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.header-tagline {
    font-size: .8rem;
    color: var(--text-muted)
}

.main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
    width: 100%
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn .5s ease backwards
}

.section-title {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .85rem
}

/* Permission */
.permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: .5rem
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background .3s ease
}

.status-dot.granted {
    background: var(--green)
}

.status-dot.denied {
    background: var(--red)
}

.status-dot.default {
    background: var(--accent)
}

.status-text {
    font-size: .9rem;
    font-weight: 600
}

.hint {
    font-size: .75rem;
    color: var(--text-dim);
    margin-top: .5rem
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 0
}

.form-group {
    margin-bottom: .85rem
}

.form-group label {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: .3rem
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: .5rem .75rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: .85rem;
    outline: none;
    transition: border-color var(--transition);
    resize: vertical
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow)
}

.range-row {
    display: flex;
    align-items: center;
    gap: .75rem
}

.range-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--surface-2);
    border-radius: 999px;
    outline: none
}

.range-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid #fff
}

.range-value {
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--text-muted);
    min-width: 30px;
    text-align: right
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    user-select: none
}

.toggle-option input {
    display: none
}

.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: all .15s ease;
    flex-shrink: 0
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all .25s ease
}

.toggle-option input:checked+.toggle-slider {
    background: var(--primary);
    border-color: var(--primary)
}

.toggle-option input:checked+.toggle-slider::after {
    left: 18px;
    background: #fff
}

.toggle-label {
    font-size: .85rem;
    color: var(--text-muted)
}

/* Actions */
.actions-list {
    display: flex;
    flex-direction: column;
    gap: .4rem
}

.action-row {
    display: flex;
    gap: .4rem;
    align-items: center
}

.action-row input {
    flex: 1;
    padding: .35rem .5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: .8rem;
    outline: none
}

.action-row input:focus {
    border-color: var(--primary)
}

.action-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: .9rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center
}

.action-remove:hover {
    background: rgba(248, 113, 113, .15);
    color: var(--red)
}

/* Countdown */
.countdown {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    padding: 1rem;
    animation: pulse 1s ease infinite
}

/* Log */
.log-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .35rem
}

.log-entry {
    padding: .4rem .6rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: .75rem;
    border-left: 3px solid var(--primary)
}

.log-time {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: .65rem
}

.log-msg {
    color: var(--text-muted)
}

/* Notification Preview */
.notif-preview {
    display: flex;
    gap: .75rem;
    padding: .75rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border)
}

.np-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 146, 60, .12);
    border-radius: 8px;
    font-size: 1.25rem;
    flex-shrink: 0
}

.np-icon img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover
}

.np-title {
    font-size: .85rem;
    font-weight: 600
}

.np-body {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .15rem
}

.empty-state {
    text-align: center;
    padding: 1rem;
    color: var(--text-dim);
    font-size: .8rem
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: .6rem 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 16px var(--primary-glow)
}

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

.btn--lg {
    padding: .85rem 1.5rem;
    font-size: 1rem
}

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    padding: .4rem .75rem
}

.btn--ghost:hover {
    background: rgba(251, 146, 60, .1);
    color: var(--text)
}

.btn--sm {
    font-size: .8rem;
    padding: .35rem .65rem
}

.hidden {
    display: none !important
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: all .4s cubic-bezier(.16, 1, .3, 1);
    z-index: 100
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
}

.footer {
    text-align: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: .8rem
}

@media(max-width:800px) {
    .editor-layout {
        grid-template-columns: 1fr
    }

    .header {
        padding: 1rem
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem
    }

    .main {
        padding: 1rem
    }
}

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

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .5
    }
}