* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top, #151a36, #090b16 55%);
    color: #e7ecff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

.header {
    text-align: center;
    padding: 18px 12px 10px;
    border-bottom: 1px solid rgba(88, 123, 255, 0.18);
    background: linear-gradient(180deg, rgba(17, 25, 56, 0.95), rgba(10, 14, 28, 0.92));
    backdrop-filter: blur(10px);
}

.header h1 {
    margin: 0 0 6px;
    font-size: clamp(1.4rem, 2vw, 2rem);
    letter-spacing: 0.05em;
    color: #7afcff;
    text-shadow: 0 0 16px rgba(0, 217, 245, 0.25);
}

.header p {
    margin: 0;
    font-size: 0.88rem;
    color: #9bb0d9;
}


.header-nav-links {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.layer-nav-btn {
    padding: 4px 10px;
    background: rgba(255,255,255,0.07);
    color: #9db1d8;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    font-weight: 700;
    cursor: pointer;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    background: rgba(8, 11, 23, 0.9);
    border-bottom: 1px solid rgba(88, 123, 255, 0.14);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 8px 12px;
}

.control-group label {
    font-size: 0.82rem;
    color: #a9badf;
}

.control-group input[type="range"] {
    width: 120px;
    accent-color: #00d9f5;
}

.val {
    min-width: 28px;
    text-align: center;
    color: #7afcff;
    font-weight: 700;
    font-size: 0.85rem;
}

button {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-wipe {
    background: linear-gradient(135deg, #ff6767, #e23434);
    color: white;
}

.btn-validate {
    background: linear-gradient(135deg, #ffc24c, #ff8b2b);
    color: #171717;
}

.btn-scan {
    background: linear-gradient(135deg, #5dffb0, #00d9f5);
    color: #061018;
}

.btn-back {
    background: linear-gradient(135deg, #8a76ff, #635bff);
    color: white;
}

.btn-link {
    background: linear-gradient(135deg, #7afcff, #5b8cff);
    color: #08111f;
}

.btn-link.hidden {
    display: none;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%) translateY(18px);
    background: rgba(10, 15, 29, 0.94);
    color: #ecf4ff;
    border: 1px solid rgba(122, 252, 255, 0.28);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}

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

.status-bar {
    text-align: center;
    padding: 8px 12px;
    min-height: 34px;
    font-size: 0.84rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.status-bar.neutral {
    background: rgba(255, 255, 255, 0.03);
    color: #9db1d8;
}

.status-bar.success {
    background: rgba(33, 150, 83, 0.18);
    color: #73ffba;
}

.status-bar.error {
    background: rgba(255, 76, 76, 0.16);
    color: #ff8f8f;
}

.status-bar.info {
    background: rgba(0, 217, 245, 0.14);
    color: #87f7ff;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    justify-content: center;
    padding: 10px 12px;
    color: #9fb1d8;
    font-size: 0.78rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
