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

.page {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    min-height: 0;
}

.content {
    height: 100%;
    min-height: 0;
}

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;
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOT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undary::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;
}
.account-form {
    max-width: 420px;
}

/* ── Shared edit-page chrome (TechEdit, CharacterEdit) ── */
.edit-page-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.edit-page-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
}

.edit-page-form .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.edit-section-title {
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

.edit-tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.edit-empty {
    color: #6c757d;
    font-style: italic;
    padding: 1rem;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.edit-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.edit-save-bar-messages {
    flex: 1 1 auto;
    min-width: 0;
}

    .edit-save-bar-messages ul {
        margin: 0;
        padding-left: 1.1rem;
        color: #e50000;
    }

.editor-card.editor-card-nested {
    background: #fbfbfc;
}

.chip-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip-toggle {
    border: 1px solid #ced4da;
    background: #fff;
    color: #495057;
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: background-color 0.1s, border-color 0.1s;
}

    .chip-toggle:hover {
        border-color: #1b6ec2;
    }

    .chip-toggle.on {
        background: #1b6ec2;
        border-color: #1b6ec2;
        color: #fff;
    }

/* Disabled MudSelectItems used as section headers ("System Resources" / "Custom Resources").
   Global because MudBlazor renders the dropdown list in a popover outside the component. */
.fnode-select-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── CSS tooltip (Bootstrap's JS isn't loaded). Usage: <span class="hint" data-hint="...">.
   Shows on hover and keyboard focus; wraps long text. js/ui.js sets data-hint-pos to flip it
   below or pin it to an edge when the default (above, centred) spot would be clipped. ── */
.hint {
    position: relative;
}

    .hint[data-hint]:hover::after,
    .hint[data-hint]:focus-within::after,
    .hint-probe {
        width: max-content;
        max-width: 280px;
        padding: 0.35rem 0.55rem;
        border-radius: 4px;
        font-size: 0.78rem;
        font-weight: 400;
        line-height: 1.35;
        text-align: left;
        white-space: normal;
    }

    .hint[data-hint]:hover::after,
    .hint[data-hint]:focus-within::after {
        content: attr(data-hint);
        position: absolute;
        left: 50%;
        bottom: calc(100% + 6px);
        transform: translateX(-50%);
        z-index: 1080;
        background: #212529;
        color: #fff;
        pointer-events: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    .hint[data-hint-pos~="below"]:hover::after,
    .hint[data-hint-pos~="below"]:focus-within::after {
        bottom: auto;
        top: calc(100% + 6px);
    }

    .hint[data-hint-pos~="start"]:hover::after,
    .hint[data-hint-pos~="start"]:focus-within::after {
        left: 0;
        transform: none;
    }

    .hint[data-hint-pos~="end"]:hover::after,
    .hint[data-hint-pos~="end"]:focus-within::after {
        left: auto;
        right: 0;
        transform: none;
    }

/* Off-screen copy js/ui.js uses to measure a tooltip before it shows. */
.hint-probe {
    position: fixed;
    left: -10000px;
    top: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Small Blazor-driven tab strip (TabSet/TabPage) ── */
.tab-set-body {
    border: 1px solid #dee2e6;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    padding: 1rem;
    background: #fff;
}

.tab-set .nav-tabs .nav-link {
    color: #495057;
}

    .tab-set .nav-tabs .nav-link.active {
        color: #1b6ec2;
        font-weight: 600;
    }

.tech-filter-panel {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafbfc;
    padding: 0.6rem 0.75rem 0.75rem;
}

    .tech-filter-panel .form-label {
        font-weight: 600;
        color: #495057;
    }

/* ── Library list pages (Tech Library, Resource Library) ── */
.library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.library-table {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

    .library-table thead th {
        background: #f6f7f9;
        font-size: 0.85rem;
        color: #495057;
    }

.resource-swatch {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 3px;
    margin-right: 0.4rem;
    vertical-align: -0.05rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

/* ── Icon-only buttons (SvgIcon inside a plain button) ── */
.svg-icon {
    display: inline-block;
    vertical-align: middle;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    line-height: 1;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #495057;
}

    .btn-icon:hover {
        background: rgba(0, 0, 0, 0.06);
    }

    .btn-icon-danger {
        color: #c62828;
    }

        .btn-icon-danger:hover {
            background: rgba(198, 40, 40, 0.08);
        }
