@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    /* ── Haven "Deep Space" palette ─────────────────────── */
    --dc-bg-primary: #101827;
    --dc-bg-secondary: #0c1220;
    --dc-bg-tertiary: #080e18;
    --dc-bg-secondary-alt: #0e1624;
    --dc-bg-floating: #060a12;
    --dc-bg-modifier-hover: rgba(100,170,255,0.07);
    --dc-bg-modifier-selected: rgba(100,170,255,0.13);
    --dc-bg-modifier-active: rgba(100,170,255,0.18);
    --dc-header-primary: #e6edf6;
    --dc-header-secondary: #8da2ba;
    --dc-text-normal: #c9d4e2;
    --dc-text-muted: #5a7394;
    --dc-text-link: #5cb8ff;
    --dc-interactive-normal: #8da2ba;
    --dc-interactive-hover: #c9d4e2;
    --dc-interactive-active: #e6edf6;
    --dc-brand: #4a9eff;
    --dc-brand-hover: #3580d9;
    --dc-brand-active: #2968b5;
    --dc-green: #23a55a;
    --dc-red: #f23f42;
    --dc-yellow: #f0b232;
    --dc-input-bg: #0a1019;
    --dc-input-placeholder: #4a6580;
    --dc-channeltextarea-bg: #141e2e;
    --dc-scrollbar-thumb: #0f1a28;
    --dc-scrollbar-track: transparent;
    --dc-separator: rgba(80,150,255,0.08);
    --dc-blurple: #4a9eff;
    --font-primary: 'Inter', 'gg sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-display: 'Inter', 'gg sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-code: 'Consolas', 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--dc-bg-primary);
    color: var(--dc-text-normal);
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.375;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#blazor-error-ui {
    display: none;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dc-scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background-color: var(--dc-scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #0d0d0e;
}

a {
    color: var(--dc-text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: var(--font-primary);
    cursor: pointer;
    border: none;
    outline: none;
}

input, textarea {
    font-family: var(--font-primary);
    outline: none;
}

/* ── Error boundary overlay ──────────────────────────────────────────────── */

.haven-error-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.haven-error-box {
    background: #1e2030;
    border: 1px solid #ed4245;
    border-radius: 12px;
    padding: 32px 36px;
    max-width: 480px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.haven-error-icon {
    font-size: 48px;
    color: #ed4245;
    line-height: 1;
}

.haven-error-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.haven-error-msg {
    margin: 0;
    font-size: 14px;
    color: #b9bbbe;
    line-height: 1.5;
}

.haven-error-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.haven-error-btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 6px;
    background: #5865f2;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .15s;
}

.haven-error-btn-primary:hover { background: #4752c4; }

.haven-error-btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 6px;
    background: #2c2f3b;
    color: #dcddde;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #3a3d4d;
    transition: background .15s;
}

.haven-error-btn-secondary:hover { background: #3a3d4d; }

.haven-error-details {
    width: 100%;
    text-align: left;
}

.haven-error-details summary {
    font-size: 12px;
    color: #72767d;
    cursor: pointer;
    user-select: none;
    margin-bottom: 6px;
}

.haven-error-details pre {
    margin: 0;
    font-size: 11px;
    color: #ed4245;
    background: #111318;
    border-radius: 6px;
    padding: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
