:root {
    --bg: #05070b;
    --bg-card: #111827;
    --border: #1f2937;
    --accent: #3b82f6;
    --accent-soft: #1f2937;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --danger: #f97373;
    --warning: #fbbf24;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #111827 0%, #020617 45%, #000 100%);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app {
    width: 100%;
    max-width: 960px;
    padding: 24px;
}

h1 {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #f9fafb;
}

.card {
    background: radial-gradient(circle at top left, #0b1120 0%, #020617 55%, #000 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

.hidden {
    display: none;
}

/* Login */
#login {
    max-width: 360px;
    margin: 0 auto;
}

#login h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
}

#pwd {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #020617;
    color: var(--text);
    outline: none;
    margin-bottom: 12px;
}

#pwd:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

#loginBtn {
    width: 100%;
}

#loginMsg {
    margin-top: 8px;
    font-size: 13px;
    color: var(--danger);
}

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

/* Main */
#main {
    margin-top: 0;
}

/* Info Box */
.info-box {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.06);
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.5;
}

.info-box h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #f3f4f6;
}

.info-box p {
    margin: 6px 0;
}

.info-box .important {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ff4d4d;
    font-weight: 600;
}

/* Feature Flag (Only 0-fee) */
.feature-flag {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.06);
    border-radius: 10px;
}

.feature-flag .filter-title {
    margin-bottom: 6px;
    color: var(--warning);
}

.switch-row {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.switch-row input[type="checkbox"] {
    cursor: not-allowed;
}

.switch-row span {
    color: #e5e7eb;
    font-weight: 600;
}

.switch-row em {
    color: #9ca3af;
    font-style: italic;
    font-weight: 400;
}

/* Legend (dynamic warnings) */
.legend {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    line-height: 1.6;
}

.legend .warn {
    color: #ff4d4d;
    font-weight: 800;
}

.legend .legend-note {
    color: var(--warning);
}

/* Badge Spot (gwiazdka) */
.badge-spot {
    color: var(--warning);
    font-weight: 800;
    margin-left: 4px;
    font-size: 16px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

#meta {
    font-size: 13px;
    color: var(--text-muted);
}

.buttons {
    display: flex;
    gap: 8px;
}

/* Buttons */
button {
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--accent-soft);
    background: linear-gradient(135deg, #0f172a, #020617);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

button:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, #1d2538, #020617);
}

button:active {
    transform: scale(0.97);
}

/* Textarea */
#output {
    width: 400px;
    max-width: 100%;
    min-width: 100%;
    height: 400px;
    resize: vertical;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #020617;
    color: var(--text);
    padding: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    white-space: pre;
    box-sizing: border-box;
    resize: vertical;
}

#output:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.logo-wrap {
    text-align: center;
    margin: 0 auto 16px;
    max-width: 420px;
}

.logo {
    display: block;
    max-width: 720px;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Footer (global) */
.app {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer {
    margin-top: 14px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(4px);
    text-align: center;
    opacity: 0.9;
}

.footer small {
    font-size: 13px;
    color: var(--text-muted);
}

.email-link {
    color: #1de7ec;
    text-decoration: none;
    border-bottom: 1px dashed rgba(30, 167, 255, 0.5);
}

.email-link:hover {
    border-bottom-style: solid;
}

/* Filters */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 13px;
}

.filter-group select {
    padding: 8px;
    min-width: 150px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #27e5e0;
    border-radius: 4px;
}

.filter-group select[multiple] {
    min-height: 80px;
}

.filter-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.exchange-disabled {
    opacity: 0.35;
}

.exchange-disabled input[type="checkbox"] {
    pointer-events: none;
}

/* Small screens */
@media (max-width: 720px) {
    .app {
        padding: 16px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .buttons {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .logo-wrap {
        text-align: center;
        margin-bottom: 12px;
    }

    .logo {
        max-width: 260px;
        filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.6));
    }

    #output {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }
}