html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Entry Renderer Tag Colors — per-theme CSS custom properties */

/* Dark Fantasy (default) */
.theme-dark-fantasy {
    --tag-default: #b0bec5;
    --tag-dice: #DAA520;
    --tag-dc: #ef5350;
    --tag-spell: #ce93d8;
    --tag-item: #4fc3f7;
    --tag-condition: #ef5350;
    --tag-skill: #81c784;
    --tag-creature: #ffb74d;
    --tag-action: #90a4ae;
    --tag-readaloud: #ce93d8;
    --tag-quote: #90a4ae;
}

/* Parchment (light theme) */
.theme-parchment {
    --tag-default: #5d4037;
    --tag-dice: #8B4513;
    --tag-dc: #c62828;
    --tag-spell: #7b1fa2;
    --tag-item: #0277bd;
    --tag-condition: #c62828;
    --tag-skill: #2e7d32;
    --tag-creature: #e65100;
    --tag-action: #546e7a;
    --tag-readaloud: #7b1fa2;
    --tag-quote: #546e7a;
}

/* Crimson Night */
.theme-crimson-night {
    --tag-default: #e0b0b0;
    --tag-dice: #ff6b6b;
    --tag-dc: #ff4444;
    --tag-spell: #e090c0;
    --tag-item: #80d0e0;
    --tag-condition: #ff4444;
    --tag-skill: #90c890;
    --tag-creature: #ffb070;
    --tag-action: #b0a0a0;
    --tag-readaloud: #e090c0;
    --tag-quote: #b0a0a0;
}

/* Forest Grove */
.theme-forest-grove {
    --tag-default: #a0c0a0;
    --tag-dice: #8bc34a;
    --tag-dc: #ff7043;
    --tag-spell: #b39ddb;
    --tag-item: #4dd0e1;
    --tag-condition: #ff7043;
    --tag-skill: #66bb6a;
    --tag-creature: #ffa726;
    --tag-action: #8aa88a;
    --tag-readaloud: #b39ddb;
    --tag-quote: #8aa88a;
}

/* Ocean Depths */
.theme-ocean-depths {
    --tag-default: #90c0d0;
    --tag-dice: #4dd0e1;
    --tag-dc: #ef5350;
    --tag-spell: #b39ddb;
    --tag-item: #80deea;
    --tag-condition: #ef5350;
    --tag-skill: #80cbc4;
    --tag-creature: #ffb74d;
    --tag-action: #80aab0;
    --tag-readaloud: #b39ddb;
    --tag-quote: #80aab0;
}

/* Entry Renderer Styles */
.entry-tag { color: var(--tag-default, #b0bec5); }
.entry-tag-bold { font-weight: bold; }
.entry-tag-italic { font-style: italic; }
.entry-tag-dice { color: var(--tag-dice, #DAA520); font-weight: 600; }
.entry-tag-dc { color: var(--tag-dc, #ef5350); font-weight: 600; }
.entry-tag-spell { color: var(--tag-spell, #ce93d8); cursor: help; border-bottom: 1px dotted var(--tag-spell, #ce93d8); }
.entry-tag-item { color: var(--tag-item, #4fc3f7); cursor: help; border-bottom: 1px dotted var(--tag-item, #4fc3f7); }
.entry-tag-condition { color: var(--tag-condition, #ef5350); cursor: help; border-bottom: 1px dotted var(--tag-condition, #ef5350); }
.entry-tag-skill { color: var(--tag-skill, #81c784); }
.entry-tag-creature { color: var(--tag-creature, #ffb74d); cursor: help; }
.entry-tag-action { color: var(--tag-action, #90a4ae); }

.entry-inset {
    border-left: 3px solid var(--mud-palette-primary);
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
}

.entry-readaloud {
    border-left: 3px solid var(--tag-readaloud, #ce93d8);
    background: rgba(206,147,216,0.05);
    border-radius: 4px;
    font-style: italic;
}

.entry-quote {
    border-left: 3px solid var(--tag-quote, #90a4ae);
    font-style: italic;
}

.entry-quote-by {
    font-style: normal;
    color: var(--tag-quote, #90a4ae);
    font-size: 0.9em;
}

.entry-list { padding-left: 1.5rem; }
.entry-list li { margin-bottom: 0.25rem; }

.entry-table { overflow-x: auto; }
.entry-table table { width: 100%; border-collapse: collapse; }
.entry-table th, .entry-table td { padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.entry-table th { font-weight: 600; color: var(--mud-palette-primary); }
.entry-table-caption { font-size: 1.1em; }

/* Responsive Layout Improvements */

/* Tables: horizontal scroll on small screens */
.mud-table, .mud-simple-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Character sheet stat boxes: constrain on small screens */
@media (max-width: 599px) {
    /* Compact header stats on mobile */
    .stat-box-row {
        gap: 0.5rem !important;
    }

    .stat-box-row > div {
        min-width: 50px;
    }

    /* Reduce padding on mobile */
    .mud-paper.pa-4 {
        padding: 12px !important;
    }

    /* Portrait: smaller on mobile */
    .mud-avatar.mud-avatar-large {
        width: 60px !important;
        height: 60px !important;
    }

    /* Compact tab text */
    .mud-tab {
        min-width: auto !important;
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
    }

    /* Reduce font size in tables */
    .mud-simple-table td, .mud-simple-table th {
        font-size: 0.85rem;
        padding: 4px 6px;
    }
}

/* Medium screens: slightly more breathing room */
@media (min-width: 600px) and (max-width: 959px) {
    .mud-tab {
        min-width: auto !important;
        padding: 6px 14px !important;
    }
}

/* Character list cards: responsive portrait images */
.character-card-portrait {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Click-to-roll interactive elements */
.clickable-roll {
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-radius: 4px;
}
.clickable-roll:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08);
}

/* Print-friendly character sheet */
@media print {
    /* Hide all UI chrome */
    .mud-drawer, .mud-appbar, .mud-fab,
    .mud-tabs-header, .mud-snackbar-provider,
    .no-print, .mud-dialog-provider,
    button, .mud-button, .mud-icon-button {
        display: none !important;
    }

    /* Reset layout */
    .mud-main-content {
        margin-left: 0 !important;
        padding: 8px !important;
    }

    .mud-layout {
        display: block !important;
    }

    /* Paper styling */
    .mud-paper {
        box-shadow: none !important;
        border: 1px solid #999;
        break-inside: avoid;
    }

    /* Force light colors for print */
    body, .mud-main-content, .mud-paper {
        background: white !important;
        color: black !important;
    }

    .mud-text-primary, .mud-typography {
        color: black !important;
    }

    .mud-text-secondary {
        color: #555 !important;
    }

    /* Character sheet specifics */
    .mud-tabs {
        border: none !important;
    }

    .mud-tab-panel {
        display: block !important;
        visibility: visible !important;
        padding: 0 !important;
    }

    /* Show all tab panels for print */
    .print-all-tabs .mud-tabs .mud-tab-panel {
        display: block !important;
    }

    /* Table styling */
    .mud-table, .mud-simple-table {
        border-collapse: collapse;
    }

    .mud-table td, .mud-table th,
    .mud-simple-table td, .mud-simple-table th {
        border: 1px solid #ccc !important;
        padding: 2px 6px !important;
        font-size: 10pt !important;
    }

    /* Chips */
    .mud-chip {
        border: 1px solid #999 !important;
        background: transparent !important;
        color: black !important;
        font-size: 9pt !important;
    }

    /* Compact spacing */
    .mud-grid-item {
        padding: 4px !important;
    }

    /* Page breaks */
    .print-page-break {
        page-break-before: always;
    }

    /* Font sizes */
    .mud-typography-h4 { font-size: 16pt !important; }
    .mud-typography-h5 { font-size: 14pt !important; }
    .mud-typography-h6 { font-size: 12pt !important; }
    .mud-typography-body1 { font-size: 10pt !important; }
    .mud-typography-body2 { font-size: 9pt !important; }
    .mud-typography-caption { font-size: 8pt !important; }

    /* Page setup */
    @page {
        margin: 0.5in;
        size: letter;
    }
}