:root {
    --sf-border: #e4e7ec;
    --sf-muted: #667085;
    --sf-img-bg: #f9fafb;
    --chip-bg: #f2f4f7;
    --chip-fg: #344054;
}

@media (prefers-color-scheme: dark) {
    :root {
        --sf-border: #2f3542;
        --sf-muted: #98a2b3;
        --sf-img-bg: #1f2430;
        --chip-bg: #2a303c;
        --chip-fg: #d0d5dd;
    }
}

.app-bar { border-bottom: 1px solid var(--sf-border); }
.cursor-pointer { cursor: pointer; }
.action-bar { position: sticky; bottom: 8px; z-index: 5; background: var(--mud-palette-surface); }

/* Weights panel */
.level-table td, .level-table th { vertical-align: middle; padding: 4px 8px !important; }
.level-table .mud-input-control { margin-top: 0; }
.stats-table td, .stats-table th { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; padding: 2px 8px !important; }
.stats-table td:first-child, .stats-table th:first-child { text-align: left; }

.level-split { display: flex; height: 22px; border-radius: 4px; overflow: hidden; }
.level-split-part { display: flex; align-items: center; justify-content: center; font-size: 11px; white-space: nowrap; overflow: hidden; }
.level-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11px; color: var(--sf-muted); }
.level-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* Storefront preview */
.storefront-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.sf-card { position: relative; background: var(--mud-palette-surface); border: 1px solid var(--sf-border); border-radius: 12px; padding: 8px; will-change: transform; }
.sf-card.locked { border-color: #f79009; box-shadow: 0 0 0 2px rgba(247, 144, 9, .25); }
.sf-img { height: 150px; display: flex; align-items: center; justify-content: center; background: var(--sf-img-bg); border-radius: 8px; overflow: hidden; color: var(--sf-muted); font-size: 12px; }
.sf-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sf-rank { position: absolute; top: 12px; left: 12px; background: #262730; color: #fff; font-weight: 600; font-size: 12px; border-radius: 6px; padding: 1px 7px; }
.sf-move { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.sf-card .sf-move { position: absolute; top: 12px; right: 12px; }
.sf-move.up { background: #dcfae6; color: #067647; }
.sf-move.down { background: #fee4e2; color: #b42318; }
.sf-move.same { background: var(--chip-bg); color: var(--sf-muted); }
.sf-move.new { background: #e0eaff; color: #1d4ed8; }
.sf-lock { position: absolute; top: 34px; right: 12px; font-size: 13px; }
.sf-name { font-size: 13px; font-weight: 600; line-height: 1.25; margin-top: 6px; height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sf-brand { font-size: 11px; color: var(--sf-muted); margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-score { font-size: 12px; font-weight: 600; color: var(--mud-palette-primary); }
.sf-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.chip { font-size: 10px; border-radius: 5px; padding: 1px 5px; background: var(--chip-bg); color: var(--chip-fg); }
.chip.g-Boys { background: #dbeafe; color: #1d4ed8; }
.chip.g-Girls { background: #fce7f3; color: #be185d; }

.table-thumb { width: 36px; height: 36px; object-fit: contain; border-radius: 4px; background: var(--sf-img-bg); }

#blazor-error-ui { background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Sign-in pages (statically rendered: plain HTML forms) */
.account-shell { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 32px; background: var(--mud-palette-background, #f7f8fa); font-family: Roboto, Helvetica, Arial, sans-serif; color: var(--mud-palette-text-primary, #1d2939); }
.account-card { width: 100%; max-width: 400px; background: var(--mud-palette-surface, #fff); border: 1px solid var(--sf-border); border-radius: 12px; padding: 28px; }
.account-brand { font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--sf-muted); margin-bottom: 16px; }
.account-title { font-size: 22px; font-weight: 500; margin: 0 0 16px; }
.account-hint { font-size: 13px; color: var(--sf-muted); margin: 0 0 12px; }
.account-form { display: flex; flex-direction: column; gap: 14px; }
.account-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.account-form input[type=email], .account-form input[type=password], .account-form input[type=text] { font: inherit; font-weight: 400; font-size: 15px; padding: 10px 12px; border: 1px solid var(--sf-border); border-radius: 8px; background: transparent; color: inherit; }
.account-form input:focus { outline: 2px solid var(--mud-palette-primary, #1c5cab); outline-offset: -1px; border-color: transparent; }
.account-form .account-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.account-form .validation-message { color: var(--mud-palette-error, #d92d20); font-weight: 400; font-size: 12px; }
.account-button { font: inherit; font-weight: 500; font-size: 14px; padding: 10px 16px; border: 0; border-radius: 8px; background: var(--mud-palette-primary, #1c5cab); color: var(--mud-palette-primary-text, #fff); cursor: pointer; }
.account-button:hover { filter: brightness(1.08); }
.account-alert { font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; background: var(--chip-bg); color: var(--chip-fg); }
.account-alert.error { background: rgba(217, 45, 32, .1); color: var(--mud-palette-error, #d92d20); }
.account-alert.ok { background: rgba(18, 183, 106, .12); color: var(--mud-palette-success, #067647); }
.account-links { margin-top: 18px; font-size: 13px; }
.account-links a { color: var(--mud-palette-primary, #1c5cab); }

/* Header menu: sign-out is a form post */
.menu-form-button { display: flex; align-items: center; width: 100%; padding: 6px 16px; border: 0; background: transparent; font: inherit; font-size: 14px; color: inherit; cursor: pointer; text-align: left; }
.menu-form-button:hover { background: var(--mud-palette-action-default-hover); }
.link-box { font-size: 12px; padding: 6px 8px; border-radius: 6px; background: var(--chip-bg); word-break: break-all; }
