/* ===================================================================
   D&D Legacy — UI theme adapted from D&D Beyond (dndbeyond.com/characters).
   Two faces, faithfully to DDB:
     • BUILDER (light): white cards on a cool light-grey page, crisp
       rectangular corners, D&D crimson accent, charcoal chrome.
     • CHARACTER SHEET (dark): the iconic charcoal + crimson sheet with
       hex ability boxes and a shield AC — scoped under `.ds`.
   Display font: Roboto Condensed (uppercase labels/buttons).
   Fantasy name flourish: Vollkorn. Body: Inter.
   NB: the `--q-*` variable names + component class names are kept from the
   previous theme so the Razor markup needs no churn — only the values changed.
   =================================================================== */

:root {
    /* ---- LIGHT DDB palette (content light; only chrome dark). Char sheet stays dark (--ds-*). ---- */
    --q-bg:        #E7E8EB;   /* light page */
    --q-bg-top:    #EEEFF1;
    --q-bg-bottom: #E2E3E6;
    --q-surface:   #FFFFFF;   /* white cards */
    --q-surface-2: #F3F4F6;   /* raised surfaces, inputs, hovers */
    --q-dark:      #17181D;   /* dark chrome (header / nav) — stays dark */
    --q-coral:     #C42B2B;   /* D&D crimson accent */
    --q-coral-deep:#8A0F13;
    --q-gold:      #9A7A3C;
    --q-text:      #1F2126;   /* dark ink on light */
    --q-text-soft: #5C5F67;
    --q-line:      #DCDEE3;   /* panel borders on light */
    --q-radius:    8px;
    --q-shadow:    0 4px 16px rgba(20, 22, 28, .10);
    --q-shadow-sm: 0 1px 4px rgba(20, 22, 28, .08);

    /* ---- Character sheet (dark) palette ---- */
    --ds-bg:       #17181C;
    --ds-panel:    #202228;
    --ds-panel-2:  #282A31;
    --ds-line:     #3A3D44;
    --ds-ink:      #ECEDEF;
    --ds-ink-soft: #9C9FA6;
    --ds-red:      #E23B3B;
    --ds-red-2:    #F0766F;

    /* ---- Fonts ---- */
    --ddb-display: 'Roboto Condensed', 'Oswald', 'Inter', sans-serif;
    --ddb-serif:   'Vollkorn', 'Georgia', serif;
    --ddb-body:    'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

html, body {
    font-family: var(--ddb-body);
    color: var(--q-text);
    /* Light page — DDB content sits on a soft neutral ground (only the chrome is dark). */
    background: linear-gradient(180deg, var(--q-bg-top) 0%, var(--q-bg) 45%, var(--q-bg-bottom) 100%) fixed;
    min-height: 100vh;
}
html { background-color: var(--q-bg); }

.brand-title {
    font-family: var(--ddb-display);
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 700;
    color: #F2F2F3;
}

/* ---------- App bar: dark DDB header ---------- */
.mud-appbar.mud-appbar-fixed-top { box-shadow: 0 1px 0 rgba(0,0,0,.5); }
.mud-appbar > .mud-toolbar {
    background: var(--q-dark);
    border-bottom: 2px solid #000;
}
.mud-appbar .mud-icon-button,
.mud-appbar .mud-button-root { color: #E7E7E9; }

/* ---------- Surfaces: white cards, crisp corners ---------- */
.mud-paper {
    border-radius: var(--q-radius);
    box-shadow: var(--q-shadow-sm);
    border: 1px solid var(--q-line);
}
.mud-paper.mud-elevation-0 { box-shadow: none; }
.mud-card {
    border-radius: var(--q-radius);
    box-shadow: var(--q-shadow-sm);
    border: 1px solid var(--q-line);
}

/* Drawer / nav */
.mud-drawer { border-right: 1px solid #000 !important; }
.mud-nav-link { border-radius: 6px; margin: 2px 8px; }
.mud-nav-link.active {
    background: rgba(197, 49, 49, .14);
    color: var(--q-coral) !important;
    font-weight: 700;
}

/* ---------- Buttons: rectangular, uppercase condensed (DDB) ---------- */
.mud-button-root {
    border-radius: 4px;
    text-transform: uppercase;
    font-family: var(--ddb-display);
    font-weight: 700;
    letter-spacing: .04em;
}
.mud-button-filled { box-shadow: none; }
.mud-button-filled.mud-button-filled-primary {
    background-color: var(--q-coral);
    color: #fff;
}
.mud-button-filled.mud-button-filled-primary:hover { background-color: #A82525; }
.mud-button-outlined {
    border-radius: 4px;
    border-color: var(--q-line);
    color: var(--q-text);
}
.mud-button-outlined.mud-button-outlined-primary { border-color: var(--q-coral); color: var(--q-coral); }
.mud-button-text { border-radius: 4px; }

/* Icon buttons: gently rounded, not full pills */
.mud-icon-button { border-radius: 6px; }

/* ---------- Inputs: crisp rectangular fields, crimson focus ---------- */
.mud-input.mud-input-outlined {
    border-radius: 6px;
    background: var(--q-surface-2);
}
.mud-input.mud-input-outlined .mud-input-outlined-border {
    border-radius: 6px !important;
    border-color: var(--q-line) !important;
    transition: border-color .15s ease, border-width .15s ease;
}
.mud-input.mud-input-outlined:hover .mud-input-outlined-border { border-color: #52545E !important; }
.mud-input.mud-input-outlined.mud-focused .mud-input-outlined-border {
    border-color: var(--q-coral) !important;
    border-width: 2px !important;
}
.mud-input.mud-input-filled,
.mud-input.mud-input-filled.mud-input-filled-with-label {
    border-radius: 6px !important;
    background: var(--q-surface-2) !important;
    border: 1px solid var(--q-line);
}
.mud-input-control input, .mud-input-control textarea,
.mud-input-slot, .mud-select .mud-input { color: var(--q-text) !important; }
.mud-input.mud-input-filled::before,
.mud-input.mud-input-filled::after { display: none !important; }
.mud-input-control.mud-focused .mud-input-label,
.mud-input-label.mud-input-label-inputcontrol.mud-focused { color: var(--q-coral) !important; }
.mud-input-control input,
.mud-input-control textarea { font-family: var(--ddb-body); }
.mud-input-adornment-start { color: var(--q-text-soft); }

/* ---------- Chips ---------- */
.mud-chip { border-radius: 4px; font-weight: 600; font-family: var(--ddb-body); }

/* ---------- Tabs: crimson active underline ---------- */
.mud-tabs-toolbar { border-radius: var(--q-radius) var(--q-radius) 0 0; }
.mud-tab { text-transform: uppercase; font-family: var(--ddb-display); font-weight: 700; letter-spacing:.03em; border-radius: 6px; }
.mud-tab.mud-tab-active { color: var(--q-coral) !important; }
.mud-tab-slider { background: var(--q-coral) !important; height: 3px; border-radius: 0; }

/* ---------- Tables ---------- */
.mud-table { border-radius: var(--q-radius); box-shadow: var(--q-shadow-sm); overflow: hidden; }
.mud-table-root { background: var(--q-surface); }
.mud-table-head th {
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing:.04em;
    font-weight: 700; color: #fff; background: var(--q-dark);
}
.mud-table-row:hover { background: var(--q-surface-2) !important; }

/* ---------- Expansion panels ---------- */
.mud-expand-panel {
    border-radius: 6px !important;
    margin-bottom: 8px;
    border: 1px solid var(--q-line);
    box-shadow: var(--q-shadow-sm);
}
.mud-expand-panel::before { display: none; }

/* ---------- Dialogs ---------- */
.mud-dialog { border-radius: 10px; box-shadow: 0 18px 60px rgba(0,0,0,.35); border: 1px solid var(--q-line); }

/* ---------- Alerts ---------- */
.mud-alert { border-radius: 6px; }

/* ---------- Selectable choice cards (race/class/etc.) ---------- */
.choice-card {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    border: 1px solid var(--q-line);
    border-radius: var(--q-radius);
    height: 100%;
    box-shadow: var(--q-shadow-sm);
}
.choice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--q-shadow);
    border-color: #B9BABD;
}
.choice-card.selected {
    border-color: var(--q-coral);
    box-shadow: 0 0 0 2px var(--q-coral), var(--q-shadow);
}

.stat-pill { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* Wizard ribbon (sticky action bar) */
.wizard-ribbon {
    position: sticky;
    top: 72px;
    z-index: 10;
    margin-bottom: 16px;
    padding: 10px 18px;
    border: 1px solid var(--q-line);
    border-radius: var(--q-radius);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(6px);
    box-shadow: var(--q-shadow-sm);
    border-left: 4px solid var(--q-coral);
}

/* Info dialog */
.info-title { font-weight: 700; line-height: 1.2; font-family: var(--ddb-display); }
.info-heading {
    font-weight: 700;
    font-family: var(--ddb-display);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--q-coral);
    border-bottom: 1px solid var(--q-line);
    padding-bottom: 3px;
    margin-bottom: 4px;
}
.info-text { line-height: 1.6; color: #C4C5CA; margin-bottom: 6px; }

/* Inline action icons */
.icon-row .mud-icon-button { padding: 4px; }
.icon-row .mud-icon-root { font-size: 1.15rem; }

/* ---------- Error / loading ---------- */
#blazor-error-ui {
    color-scheme: light only;
    background: #fff3d6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred." }

.loading-progress {
    position: absolute; display: block; width: 8rem; height: 8rem;
    inset: 20vh 0 auto 0; margin: 0 auto;
}
.loading-progress circle {
    fill: none; stroke: #d3d4d7; stroke-width: 0.6rem;
    transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--q-coral);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute; text-align: center; font-weight: bold; color: var(--q-text);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

/* ===================== Floating bottom nav (charcoal + crimson) ===================== */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--q-dark);
    padding: 8px 10px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    border: 1px solid #000;
    z-index: 1300;
}
.bnav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    min-width: 44px;
    padding: 0 12px;
    border-radius: 6px;
    color: #C9CACD;
    background: transparent;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    justify-content: center;
    font-family: var(--ddb-display);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.bnav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.bnav-item .mud-icon-root { font-size: 1.35rem; }
.bnav-item.active {
    background: var(--q-coral);
    color: #fff;
    font-weight: 700;
    padding: 0 18px;
}
.bnav-label { font-size: .9rem; font-weight: 700; }

/* avatar */
.mud-avatar { box-shadow: var(--q-shadow-sm); border-radius: 8px; }

/* ===================== Home: greeting + character rows ===================== */
.home-greet { display: flex; align-items: center; gap: 14px; }
.home-greet .mud-avatar { width: 56px; height: 56px; }

.char-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--q-radius);
    background: var(--q-surface);
    box-shadow: var(--q-shadow-sm);
    border: 1px solid var(--q-line);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.char-row:hover { transform: translateY(-2px); box-shadow: var(--q-shadow); }
.char-ava {
    flex: 0 0 auto;
    width: 48px; height: 48px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1.05rem;
    box-shadow: var(--q-shadow-sm);
    font-family: var(--ddb-display);
}
.char-info { flex: 1 1 auto; min-width: 0; }
.char-name { font-weight: 700; font-size: 1.05rem; color: var(--q-text); }
.char-meta { font-size: .85rem; color: var(--q-text-soft); display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.char-meta .dot { color: #c7c8cb; }
.char-lvl {
    background: rgba(197,49,49,.14); color: var(--q-coral);
    font-weight: 700; padding: 1px 9px; border-radius: 4px; font-size: .78rem;
}
.char-issue { color: var(--q-warning, #C77C1E); display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.char-issue .mud-icon-root { font-size: 1rem; }
.char-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }

/* colored category badge (race/class choice cards) */
.cat-ico {
    width: 40px; height: 40px; flex: 0 0 auto;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.05rem;
    box-shadow: var(--q-shadow-sm);
    font-family: var(--ddb-display);
}

/* ===================== Lists (Skills / Feats / Spells steps) ===================== */
.mud-list { padding: 4px; }
.mud-list-item {
    border-radius: 6px;
    margin: 3px 4px;
    transition: background .12s ease;
}
.mud-list-item:hover { background: var(--q-surface-2); }
.mud-list-item.mud-selected-item {
    background: rgba(197,49,49,.12) !important;
    color: var(--q-coral) !important;
}

/* Stepper / wizard step nav */
.mud-stepper-nav, .step-nav { gap: 6px; }

/* Form controls */
.mud-select .mud-input.mud-input-outlined { border-radius: 6px; }
.mud-switch-track { border-radius: 999px; }
.mud-checkbox .mud-icon-root,
.mud-radio .mud-icon-root { color: var(--q-coral); }
.mud-slider .mud-slider-track-filled { background: var(--q-coral); }

/* Badges */
.mud-badge { border-radius: 4px; font-weight: 700; }

/* Menus / popovers */
.mud-popover, .mud-menu-list, .mud-list.mud-menu-list {
    border-radius: 8px !important;
    box-shadow: var(--q-shadow) !important;
}
.mud-menu-item { border-radius: 6px; margin: 2px 6px; }

/* Snackbars */
.mud-snackbar { border-radius: 8px; }

/* Tooltips */
.mud-tooltip {
    border-radius: 6px;
    background: var(--q-dark);
    font-weight: 500;
}

/* Tabs container surface */
.mud-tabs-panels { background: transparent; }

/* Progress / linear */
.mud-progress-linear { border-radius: 999px; overflow: hidden; }
.mud-progress-circular-circle { stroke: var(--q-coral); }

/* Avatars */
.mud-avatar.mud-avatar-rounded { border-radius: 8px; }

/* Data tables */
.mud-table-cell { border-bottom-color: var(--q-line) !important; }

/* Section title helper */
.section-title { font-weight: 700; color: var(--q-text); font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .04em; }

/* ===================== Login: centered DDB card ===================== */
.login-wrap {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.login-card.mud-paper {
    width: 100%;
    max-width: 420px;
    background: var(--q-surface);
    border: 1px solid var(--q-line);
    border-top: 4px solid var(--q-coral);
    border-radius: 10px !important;
    box-shadow: var(--q-shadow) !important;
    padding: 36px 32px 30px !important;
}
.login-badge {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--q-dark);
    box-shadow: var(--q-shadow-sm);
    margin-bottom: 14px;
}
.login-badge .mud-icon-root { font-size: 2rem; color: var(--q-coral); }
/* Brand title is light for the dark header; on the white login card it must be dark. */
.login-card .brand-title { color: var(--q-text); }
.login-sub { color: var(--q-text-soft); }
.login-or .mud-divider-text {
    color: var(--q-text-soft) !important;
    font-size: .76rem; letter-spacing: .06em; text-transform: uppercase;
}
.login-providers .mud-icon-button {
    width: 48px; height: 48px;
    border: 1px solid var(--q-line) !important;
    border-radius: 6px !important;
    color: var(--q-text);
    background: var(--q-surface);
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.login-providers .mud-icon-button:not(:disabled):hover {
    border-color: var(--q-coral) !important;
    box-shadow: 0 0 0 2px rgba(197,49,49,.18);
    transform: translateY(-1px);
}
.login-providers .mud-icon-button:disabled { opacity: .38; }

/* Live-panel stat pills */
.mud-chip.mud-chip-text { font-weight: 600; }

/* Dialog title spacing */
.mud-dialog-title { padding-bottom: 6px; font-family: var(--ddb-display); }

/* Numeric +/- buttons */
.mud-input-adornment .mud-icon-button { border-radius: 6px; }

/* ===================== Rules page ===================== */
.rule-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rule-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 6px;
    background: var(--q-surface);
    border: 1px solid var(--q-line);
    box-shadow: var(--q-shadow-sm);
    cursor: pointer; font-weight: 700; color: var(--q-text);
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .03em;
    transition: transform .12s ease, box-shadow .12s ease;
    user-select: none;
}
.rule-chip:hover { transform: translateY(-1px); box-shadow: var(--q-shadow); }
.rule-chip.active { background: var(--q-coral); color: #fff; border-color: var(--q-coral); }
.rule-chip-ico {
    width: 28px; height: 28px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.rule-chip-ico .mud-icon-root { font-size: 1.05rem; }
.rule-chip-n { font-size: .78rem; opacity: .7; font-weight: 700; }

.rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    margin-bottom: 6px;
}
.rule-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    border-radius: var(--q-radius);
    background: var(--q-surface);
    border: 1px solid var(--q-line);
    box-shadow: var(--q-shadow-sm);
    cursor: pointer;
    height: 100%;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.rule-row:hover { transform: translateY(-2px); box-shadow: var(--q-shadow); border-color: #B9BABD; }
.rule-row .char-ava { flex: 0 0 auto; }
.rule-row .char-info { min-width: 0; }
.rule-row .char-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rule-pager {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 14px 0 6px;
}

.rule-table { border-radius: var(--q-radius); border: 1px solid var(--q-line); box-shadow: var(--q-shadow-sm); overflow: hidden; background: var(--q-surface); }
.rule-glyph {
    width: 26px; height: 26px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: .8rem; font-family: var(--ddb-display);
}
.rule-cell-name { font-weight: 600; color: var(--q-text); }

/* ===================== Wizard stepper (DDB numbered progress) ===================== */
.qstepper {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    row-gap: 8px;
}
.qstep {
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer; min-width: 58px; flex: 0 0 auto;
}
.qstep-dot {
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem; font-family: var(--ddb-display);
    background: #fff; color: var(--q-text-soft);
    border: 2px solid var(--q-line);
    transition: all .15s ease;
}
.qstep-label {
    margin-top: 5px; font-size: .72rem; text-align: center;
    color: var(--q-text-soft); max-width: 72px; line-height: 1.1;
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .02em;
}
.qstep:hover .qstep-dot { border-color: var(--q-coral); }
.qstep.active .qstep-dot {
    background: var(--q-coral); color: #fff; border-color: var(--q-coral);
    box-shadow: 0 0 0 4px rgba(197,49,49,.20);
}
.qstep.active .qstep-label { color: var(--q-text); font-weight: 700; }
.qstep.done .qstep-dot { background: var(--q-dark); color: #fff; border-color: var(--q-dark); }
.qstep.done .qstep-label { color: var(--q-text); font-weight: 600; }
.qstep-line {
    flex: 1 1 14px; min-width: 12px; height: 2px;
    background: var(--q-line); margin-top: 17px;
    border-radius: 2px;
}
.qstep-line.done { background: var(--q-dark); }

/* Source-book tag */
.source-tag {
    display: inline-flex; align-items: center;
    padding: 2px 9px; border-radius: 4px;
    background: var(--q-dark); color: #fff;
    font-size: .68rem; font-weight: 700; letter-spacing: .04em;
    font-family: var(--ddb-display); text-transform: uppercase;
    white-space: nowrap;
}

/* ===================== RichText: structured reference descriptions ===================== */
.rich-h {
    font-weight: 700 !important;
    font-family: var(--ddb-display);
    text-transform: uppercase; letter-spacing: .03em;
    color: var(--q-text) !important;
    margin: 14px 0 4px !important;
    padding-bottom: 3px;
    border-bottom: 2px solid var(--q-coral);
    display: inline-block;
}
.rich-p { margin: 0 0 9px !important; line-height: 1.55; color: var(--q-text); }
.rich-ul { margin: 0 0 9px; padding-left: 20px; }
.rich-ul li { margin-bottom: 3px; line-height: 1.5; }
.rich-table-wrap { overflow-x: auto; margin: 6px 0 12px; }
.rich-table {
    border-collapse: collapse;
    width: 100%;
    font-size: .82rem;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--q-shadow-sm);
}
.rich-table th {
    background: var(--q-dark); color: #fff;
    text-align: left; font-weight: 700;
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .03em;
    padding: 7px 11px; white-space: nowrap;
}
.rich-table td {
    padding: 6px 11px;
    border-top: 1px solid var(--q-line);
    color: var(--q-text); vertical-align: top;
}
.rich-table tbody tr:nth-child(odd) { background: var(--q-surface-2); }
.rich-table tbody tr:nth-child(even) { background: var(--q-surface); }

/* ===================== Skills table flags ===================== */
.skill-tflag {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 5px;
    background: var(--q-surface-2); color: var(--q-text-soft);
    font-weight: 800; font-size: .72rem; line-height: 1;
    cursor: default;
}
.skills-table .skill-row-forbidden { opacity: .5; }
.skills-table .skill-row-forbidden td { text-decoration: line-through; text-decoration-color: rgba(40,40,40,.35); }
.skills-table .skill-row-forbidden .skill-tflag,
.skills-table .skill-row-forbidden .mud-icon-button { text-decoration: none; }

/* ===================== Live stats: ability tiles ===================== */
.ability-tile {
    border-radius: 8px !important;
    background: var(--q-dark) !important;
    border: 1px solid #000;
    box-shadow: var(--q-shadow-sm);
    color: #fff;
}
.ability-tile .mud-typography { color: #fff; }
.ability-tile-label { color: #A9ABAF !important; letter-spacing: .10em; font-weight: 700; font-family: var(--ddb-display); }

@media (max-width: 600px) {
    .char-actions .mud-button-root span.mud-button-label { display: none; }
}

/* ===================== Home characters: dark DDB cards ===================== */
.sheet-hero-ava {
    flex: 0 0 auto;
    width: 64px; height: 64px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; font-weight: 800; color: #fff;
    background: linear-gradient(180deg, var(--q-coral) 0%, #8A0F13 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
    font-family: var(--ddb-display);
}
.sheet-hero-lvl {
    flex: 0 0 auto;
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 16px; border-radius: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14);
    z-index: 1;
}
.sheet-hero-lvl .lvl-num { font-size: 1.6rem; font-weight: 800; line-height: 1; color: #fff; font-family: var(--ddb-display); }
.sheet-hero-lvl .lvl-cap { font-size: .62rem; letter-spacing: .14em; color: rgba(255,255,255,.7); margin-top: 2px; font-family: var(--ddb-display); }

.char-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--q-radius);
    background: var(--q-dark);
    color: #fff;
    box-shadow: var(--q-shadow-sm);
    border: 1px solid #000;
    border-left: 4px solid var(--q-coral);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease;
}
.char-hero:hover { transform: translateY(-2px); box-shadow: var(--q-shadow); }
.char-hero::after {
    content: "";
    position: absolute; right: -50px; top: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(197,49,49,.40) 0%, rgba(197,49,49,0) 70%);
    pointer-events: none;
}
.char-hero > * { position: relative; z-index: 1; }
.char-hero .sheet-hero-ava { width: 56px; height: 56px; border-radius: 8px; font-size: 1.45rem; }
.char-hero-info { flex: 1 1 auto; min-width: 0; }
.char-hero-name {
    font-weight: 800; font-size: 1.2rem; line-height: 1.15; font-family: var(--ddb-serif);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.char-hero-meta {
    color: rgba(255,255,255,.66); font-weight: 500; font-size: .9rem;
    margin-top: 2px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.char-hero-meta .dot { opacity: .5; }
.char-hero-issue {
    display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
    color: #F0B44E; font-weight: 600;
}
.char-hero-issue .mud-icon-root { font-size: 1rem; }
.char-hero .char-actions .mud-icon-button { color: rgba(255,255,255,.78); }
.char-hero .char-actions .mud-icon-button:hover { color: #fff; background: rgba(255,255,255,.12); }

/* ===================== Wizard: unified step header ===================== */
.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}
.step-header-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.step-header-ico {
    flex: 0 0 auto;
    width: 44px; height: 44px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    background: var(--q-coral);
    box-shadow: var(--q-shadow-sm);
}
.step-header-ico .mud-icon-root { font-size: 1.4rem; }
.step-header-text { min-width: 0; }
.step-header-title { font-weight: 800 !important; line-height: 1.15; font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .02em; }
.step-header-sub { color: var(--q-text-soft) !important; margin-top: 1px; }
.step-header-right { flex: 0 0 auto; }

/* SheetCard: light card surface (used in the builder's Details step) */
.sheet-card.mud-paper {
    border-radius: var(--q-radius) !important;
    border: 1px solid var(--q-line) !important;
    box-shadow: var(--q-shadow-sm) !important;
    background: var(--q-surface);
}
.sheet-card-title {
    font-weight: 700 !important;
    font-family: var(--ddb-display);
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--q-coral) !important;
}

/* ===================================================================
   CHARACTER SHEET — dark DDB sheet (scoped under `.ds`)
   =================================================================== */
.ds {
    background: var(--ds-bg);
    color: var(--ds-ink);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #000;
    box-shadow: 0 12px 34px rgba(0,0,0,.30);
    font-family: var(--ddb-body);
}

/* Crimson banner header */
.ds-banner {
    display: flex; align-items: center; gap: 18px;
    padding: 22px 24px;
    background: linear-gradient(100deg, #6E0A0E 0%, #B62A2A 55%, #8A1418 100%);
    position: relative;
    border-bottom: 3px solid #000;
}
.ds-portrait {
    flex: 0 0 auto;
    width: 68px; height: 68px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; font-weight: 800; color: #fff;
    background: rgba(0,0,0,.28);
    border: 2px solid rgba(255,255,255,.35);
    font-family: var(--ddb-serif);
}
.ds-id { min-width: 0; flex: 1 1 auto; }
.ds-name {
    font-family: var(--ddb-serif);
    font-weight: 800; font-size: 1.85rem; line-height: 1.1; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
    margin: 0;
}
.ds-sub {
    color: rgba(255,255,255,.86); font-weight: 500; margin-top: 3px;
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .04em; font-size: .82rem;
}
.ds-xp {
    flex: 0 0 auto;
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 18px; border-radius: 10px;
    background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.20);
}
.ds-level { font-family: var(--ddb-display); font-size: 1.9rem; font-weight: 700; line-height: 1; color: #fff; }
.ds-level-cap { font-family: var(--ddb-display); font-size: .6rem; letter-spacing: .16em; color: rgba(255,255,255,.75); margin-top: 3px; }

/* Warning strip */
.ds-warn {
    display: flex; flex-direction: column; gap: 2px;
    background: rgba(199,124,30,.14);
    border-bottom: 1px solid var(--ds-line);
    color: #E7B45B; padding: 10px 24px; font-size: .86rem;
}

/* Top combat bar */
.ds-combat {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 12px;
    padding: 18px 24px;
    background: var(--ds-panel);
    border-bottom: 1px solid var(--ds-line);
}
.ds-cstat {
    background: var(--ds-panel-2);
    border: 1px solid var(--ds-line);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
}
.ds-cstat-num { font-family: var(--ddb-display); font-size: 1.7rem; font-weight: 700; line-height: 1; color: #fff; }
.ds-cstat-cap { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; color: var(--ds-ink-soft); margin-top: 6px; }
.ds-cstat-sub { font-size: .68rem; color: var(--ds-ink-soft); margin-top: 3px; }
/* AC shield */
.ds-cstat.shield {
    background: linear-gradient(180deg, #33272A 0%, #241d20 100%);
    border-color: var(--ds-red);
    clip-path: polygon(50% 0, 100% 12%, 100% 58%, 50% 100%, 0 58%, 0 12%);
    padding: 14px 10px 30px;
}
.ds-cstat.shield .ds-cstat-num { color: #fff; }
/* HP heart-tinted */
.ds-cstat.hp { border-color: #7C1F22; }
.ds-cstat.hp .ds-cstat-num { color: var(--ds-red-2); }

/* Ability hexes */
.ds-abils {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 18px 24px;
    background: var(--ds-bg);
}
.ds-hex {
    background: var(--ds-panel);
    border: 1px solid var(--ds-line);
    border-radius: 12px;
    padding: 12px 6px 12px;
    text-align: center;
    position: relative;
}
.ds-hex-cap { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .08em; font-size: .64rem; color: var(--ds-ink-soft); }
.ds-hex-mod { font-family: var(--ddb-display); font-size: 2rem; font-weight: 700; line-height: 1; margin: 8px 0 10px; color: #fff; }
.ds-hex-score {
    display: inline-flex; width: 34px; height: 26px; border-radius: 999px;
    border: 1px solid var(--ds-line); background: var(--ds-bg);
    align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; color: var(--ds-ink);
}
@media (max-width: 720px) { .ds-abils { grid-template-columns: repeat(3, 1fr); } }

/* Two-column body */
.ds-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    padding: 4px 24px 24px;
}
@media (max-width: 860px) { .ds-body { grid-template-columns: 1fr; } }

.ds-panel {
    background: var(--ds-panel);
    border: 1px solid var(--ds-line);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.ds-panel-h {
    font-family: var(--ddb-display);
    text-transform: uppercase; letter-spacing: .08em;
    font-size: .74rem; font-weight: 700; color: var(--ds-red-2);
    border-bottom: 1px solid var(--ds-line);
    padding-bottom: 8px; margin-bottom: 12px;
}

/* Saves + row stat lines */
.ds-saves { display: flex; gap: 10px; }
.ds-save {
    flex: 1 1 0; text-align: center;
    background: var(--ds-panel-2); border: 1px solid var(--ds-line);
    border-radius: 8px; padding: 10px 4px;
}
.ds-save-cap { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .06em; font-size: .62rem; color: var(--ds-ink-soft); }
.ds-save-num { font-family: var(--ddb-display); font-size: 1.4rem; font-weight: 700; color: #fff; margin-top: 4px; }

.ds-line {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 2px; border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: .88rem;
}
.ds-line:last-child { border-bottom: none; }
.ds-line-k { color: var(--ds-ink-soft); }
.ds-line-v { font-family: var(--ddb-display); font-weight: 700; color: #fff; }

/* Skills */
.ds-skill {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 2px; border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: .86rem;
}
.ds-skill:last-child { border-bottom: none; }
.ds-skill-star { flex: 0 0 14px; color: #E7B45B; font-size: .8rem; text-align: center; }
.ds-skill-tot { flex: 0 0 40px; text-align: right; font-family: var(--ddb-display); font-weight: 700; color: #fff; }
.ds-skill-name { flex: 1 1 auto; min-width: 0; }
.ds-skill-ab { flex: 0 0 auto; color: var(--ds-ink-soft); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }

/* Feats / languages chips on dark */
.ds-chip {
    display: inline-flex; align-items: center;
    padding: 4px 10px; margin: 0 6px 6px 0;
    border-radius: 4px;
    background: var(--ds-panel-2); border: 1px solid var(--ds-line);
    color: var(--ds-ink); font-size: .82rem; font-weight: 600;
}
.ds-bio { line-height: 1.6; color: var(--ds-ink); white-space: pre-wrap; }
.ds-empty { color: var(--ds-ink-soft); font-size: .86rem; }

/* ===================================================================
   CLASS STEP — DDB-style master/detail browser (light builder)
   =================================================================== */
.class-browser {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 860px) { .class-browser { grid-template-columns: 1fr; } }

.class-list { display: flex; flex-direction: column; gap: 8px; }
.class-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--q-line);
    border-left: 3px solid transparent;
    border-radius: 8px;
    background: var(--q-surface);
    box-shadow: var(--q-shadow-sm);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.class-list-item:hover { transform: translateY(-1px); box-shadow: var(--q-shadow); border-color: #B9BABD; }
.class-list-item.active {
    border-color: var(--q-coral);
    border-left-color: var(--q-coral);
    box-shadow: 0 0 0 2px rgba(197,49,49,.18), var(--q-shadow-sm);
}
.class-list-item.taken { border-left-color: var(--q-coral); }
.cli-body { flex: 1 1 auto; min-width: 0; }
.cli-name { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .02em; font-weight: 700; line-height: 1.1; }
.cli-meta { font-size: .72rem; color: var(--q-text-soft); margin-top: 1px; }
.cli-flags { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; color: var(--q-coral); }
.cli-flags .mud-icon-root { font-size: 1.1rem; }
.cli-spark { color: var(--q-text-soft); }

/* Detail panel */
.class-detail {
    position: sticky; top: 150px;
    background: var(--q-surface);
    border: 1px solid var(--q-line);
    border-radius: var(--q-radius);
    box-shadow: var(--q-shadow);
    overflow: hidden;
}
.cd-head {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px;
    color: #fff;
    position: relative;
}
.cd-head::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,0) 60%);
    pointer-events: none;
}
.cd-head > * { position: relative; z-index: 1; }
.cd-ico {
    width: 48px; height: 48px; border-radius: 10px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.4);
    font-family: var(--ddb-display); font-weight: 800; font-size: 1.3rem;
}
.cd-title { font-family: var(--ddb-serif); font-size: 1.55rem; font-weight: 800; line-height: 1.05; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.cd-title-sub { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .05em; font-size: .74rem; color: rgba(255,255,255,.9); margin-top: 2px; }
.cd-caster {
    margin-left: auto; align-self: flex-start;
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.3);
    color: #fff; padding: 4px 9px; border-radius: 4px;
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; font-weight: 700;
}
.cd-caster .mud-icon-root { font-size: .95rem; }

.cd-body { padding: 18px 20px 20px; }
.cd-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 10px; margin-bottom: 18px;
}
.cd-stat { background: var(--q-surface-2); border: 1px solid var(--q-line); border-radius: 8px; padding: 10px 8px; text-align: center; }
.cd-stat-num { font-family: var(--ddb-display); font-size: 1.3rem; font-weight: 700; line-height: 1; color: var(--q-text); }
.cd-stat-cap { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .06em; font-size: .6rem; color: var(--q-text-soft); margin-top: 5px; }

.cd-h {
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .04em;
    font-weight: 700; color: var(--q-coral); font-size: .78rem;
    border-bottom: 1px solid var(--q-line); padding-bottom: 4px;
    margin: 16px 0 10px;
}
.cd-saves { display: flex; gap: 8px; }
.cd-save {
    flex: 1 1 0; text-align: center; border-radius: 8px; padding: 8px 4px;
    border: 1px solid var(--q-line); background: var(--q-surface-2);
}
.cd-save.good { border-color: var(--q-coral); background: rgba(211,59,56,.14); }
.cd-save-cap { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .05em; font-size: .6rem; color: var(--q-text-soft); }
.cd-save-q { font-family: var(--ddb-display); font-weight: 700; font-size: .9rem; margin-top: 2px; }
.cd-save.good .cd-save-q { color: var(--q-coral); }

.cd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-chip {
    display: inline-flex; padding: 3px 9px; border-radius: 4px;
    background: var(--q-surface-2); border: 1px solid var(--q-line);
    color: var(--q-text); font-size: .78rem; font-weight: 600;
}
.cd-adj {
    display: inline-flex; padding: 4px 11px; border-radius: 4px;
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .03em;
    font-size: .8rem; font-weight: 700;
}
.cd-adj.up { background: rgba(63,158,86,.14); color: #2E7D46; border: 1px solid rgba(63,158,86,.35); }
.cd-adj.dn { background: rgba(192,57,43,.12); color: #B23A2C; border: 1px solid rgba(192,57,43,.30); }
.cd-cast { font-size: .86rem; line-height: 1.5; color: var(--q-text); }
.cd-feats { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.cd-feat-name { font-weight: 700; font-size: .88rem; }
.cd-feat-desc { font-size: .82rem; color: #C4C5CA; line-height: 1.5; }
.cd-prog { font-size: .8rem; line-height: 1.5; color: #C4C5CA; }
.cd-prog b { font-family: var(--ddb-display); color: var(--q-text); }
.cd-cta { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* ===================================================================
   DDB BUILDER SHELL — dark header + left step rail + main + preview
   =================================================================== */
.builder { display: flex; flex-direction: column; gap: 16px; }

/* Top bar: character identity + primary actions */
.builder-topbar {
    position: sticky; top: 64px; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 18px;
    background: var(--q-dark);
    border: 1px solid #000;
    border-radius: var(--q-radius);
    box-shadow: var(--q-shadow);
    color: #fff;
}
.builder-topbar .bt-name .mud-input-control { margin: 0; }
.builder-topbar .bt-name input {
    color: #fff !important; font-family: var(--ddb-serif); font-size: 1.35rem; font-weight: 800;
}
.builder-topbar .bt-name .mud-input.mud-input-outlined { background: transparent; box-shadow: none; }
.builder-topbar .bt-name .mud-input-outlined-border { border-color: rgba(255,255,255,.22) !important; }
.builder-topbar .bt-name.mud-input-control .mud-input-label { color: rgba(255,255,255,.6) !important; }
.bt-id { flex: 1 1 auto; min-width: 0; }
.bt-summary {
    color: rgba(255,255,255,.66); font-family: var(--ddb-display);
    text-transform: uppercase; letter-spacing: .05em; font-size: .74rem; margin-top: 3px;
}
.bt-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
/* Legible controls on the dark top bar */
.builder-topbar .mud-button-outlined { border-color: rgba(255,255,255,.30) !important; color: #E7E7E9 !important; }
.builder-topbar .mud-button-outlined:hover:not(:disabled) { border-color: #fff !important; background: rgba(255,255,255,.10) !important; }
.builder-topbar .mud-button-outlined:disabled { color: rgba(255,255,255,.32) !important; border-color: rgba(255,255,255,.14) !important; }
.bt-issue {
    display: inline-flex; align-items: center; gap: 4px;
    color: #F0B44E; font-weight: 700; font-size: .82rem; cursor: default;
}

/* 3-column grid: rail | main | preview */
.builder-grid {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr) 304px;
    gap: 16px;
    align-items: start;
}
.builder-grid.review { grid-template-columns: 232px minmax(0, 1fr); }
@media (max-width: 1200px) {
    .builder-grid, .builder-grid.review { grid-template-columns: 200px minmax(0, 1fr); }
    .builder-side { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .builder-grid, .builder-grid.review { grid-template-columns: 1fr; }
}

/* Left step rail */
.builder-rail {
    position: sticky; top: 140px;
    display: flex; flex-direction: column; gap: 6px;
    background: var(--q-surface);
    border: 1px solid var(--q-line);
    border-radius: var(--q-radius);
    box-shadow: var(--q-shadow-sm);
    padding: 8px;
}
@media (max-width: 760px) {
    .builder-rail {
        position: static; flex-direction: row; overflow-x: auto;
        gap: 4px; padding: 8px;
    }
}
.brail-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
    color: var(--q-text);
    white-space: nowrap;
}
.brail-item:hover { background: var(--q-surface-2); }
.brail-item.active {
    background: rgba(197,49,49,.10);
    border-left-color: var(--q-coral);
}
.brail-ico {
    width: 30px; height: 30px; flex: 0 0 auto; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    background: var(--q-surface-2); color: var(--q-text-soft);
}
.brail-ico .mud-icon-root { font-size: 1.1rem; }
.brail-item.active .brail-ico { background: var(--q-coral); color: #fff; }
.brail-item.done .brail-ico { background: rgba(63,158,86,.16); color: #2E7D46; }
.brail-body { flex: 1 1 auto; min-width: 0; }
.brail-label { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; font-size: .82rem; line-height: 1.1; }
.brail-sub { font-size: .68rem; color: var(--q-text-soft); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.brail-state { flex: 0 0 auto; color: #2E7D46; }
.brail-state .mud-icon-root { font-size: 1.05rem; }
.brail-item.todo .brail-sub { color: #B0B2B6; }

/* Main content card */
.builder-main {
    background: var(--q-surface);
    border: 1px solid var(--q-line);
    border-radius: var(--q-radius);
    box-shadow: var(--q-shadow-sm);
    padding: 22px 24px;
    min-width: 0;
}
.builder-main.flush { padding: 0; background: transparent; border: none; box-shadow: none; }

/* Right preview column */
.builder-side { min-width: 0; }

/* ===================================================================
   DDB CHARACTER LIST — portrait card grid
   =================================================================== */
.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.char-card {
    display: flex; flex-direction: column;
    background: var(--q-dark);
    border: 1px solid #000;
    border-radius: var(--q-radius);
    overflow: hidden;
    box-shadow: var(--q-shadow-sm);
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease;
    position: relative;
}
.char-card:hover { transform: translateY(-3px); box-shadow: var(--q-shadow); }
.char-portrait {
    height: 116px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    border-bottom: 3px solid rgba(0,0,0,.35);
}
.char-portrait .cp-mono {
    font-family: var(--ddb-serif); font-weight: 800; font-size: 3rem; color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.char-portrait .cp-lvl {
    position: absolute; top: 10px; right: 10px;
    display: flex; flex-direction: column; align-items: center;
    background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px; padding: 4px 10px;
}
.cp-lvl .cp-lvl-n { font-family: var(--ddb-display); font-weight: 700; font-size: 1.1rem; color: #fff; line-height: 1; }
.cp-lvl .cp-lvl-c { font-family: var(--ddb-display); font-size: .52rem; letter-spacing: .12em; color: rgba(255,255,255,.75); }
.char-cardbody { padding: 12px 14px 8px; color: #fff; flex: 1 1 auto; }
.char-cardname { font-family: var(--ddb-serif); font-weight: 800; font-size: 1.2rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-cardmeta { color: rgba(255,255,255,.66); font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; margin-top: 3px; }
.char-cardfoot {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.20);
}
.char-cardfoot .mud-icon-button { color: rgba(255,255,255,.8); }
.char-cardfoot .mud-icon-button:hover { color: #fff; background: rgba(255,255,255,.12); }
.char-card-issue { display: inline-flex; align-items: center; gap: 3px; color: #F0B44E; font-size: .78rem; font-weight: 600; margin-right: auto; padding-left: 4px; }

/* Create-new tile */
.char-card.new {
    background: rgba(255,255,255,.02);
    border: 2px dashed #4A4C55;
    color: var(--q-text-soft);
    align-items: center; justify-content: center;
    min-height: 210px;
    text-align: center;
    box-shadow: none;
}
.char-card.new:hover { border-color: var(--q-coral); color: var(--q-coral); background: rgba(197,49,49,.04); }
.char-card.new .mud-icon-root { font-size: 2.4rem; }
.char-card.new .ccn-label { font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-top: 8px; }

/* ===================================================================
   SETTINGS / PREFERENCES step (DDB Home/Basic equivalent)
   =================================================================== */
.pref-opts { display: flex; flex-direction: column; gap: 8px; }
.pref-opt {
    border: 1px solid var(--q-line);
    border-left: 3px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background: var(--q-surface);
    transition: border-color .12s ease, background .12s ease;
}
.pref-opt:hover { background: var(--q-surface-2); }
.pref-opt.active {
    border-color: var(--q-coral);
    border-left-color: var(--q-coral);
    background: rgba(197,49,49,.05);
}
.pref-opt-h {
    display: flex; align-items: center; gap: 7px;
    font-family: var(--ddb-display); text-transform: uppercase; letter-spacing: .03em;
    font-weight: 700; font-size: .9rem; color: var(--q-text);
}
.pref-opt.active .pref-opt-h { color: var(--q-coral); }
.pref-opt-h .mud-icon-root { font-size: 1.05rem; }
.pref-opt-sub { font-size: .78rem; color: var(--q-text-soft); margin-top: 3px; line-height: 1.4; }
.pref-note { font-size: .85rem; color: var(--q-text); line-height: 1.5; }
