@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
    --slot-size: 120px;
    --container-width: 200px;
    --main-content-width: min(1600px, 100%);
    --nav-menu-width: min(1600px, 100%);
    --rz-scheduler-border-radius: 12px;
    --rz-scheduler-event-line-height: 2.5rem;
    --rz-scheduler-event-font-size: 0.9rem;
    --space-bg: #0a0f1a;
    --ship-color: #c0c5d1;
    --engine-glow: #f76d3c;
    --scan-color: #4cc9f0;
    --star-color: #ffffff;
    --star-speed: 60s; /* Adjust duration to control speed (higher = slower) */
    --star-count: 100; /* Approximate number of stars per layer */

    --rarity-common: #BFBFBF;
    --rarity-uncommon: #398750;
    --rarity-rare: #67A0F9;
    --rarity-epic: #B759CE;
    --rarity-legendary: #FF9F4A;
    --rarity-boss: #832B2B;
    --affinity-antimatter: #7E37D1;
    --affinity-chemical: #456811;
    --affinity-thermal: #CA5525;
    --affinity-electric: #2948CC;
    --color-transparent: rgba(255, 255, 255, 0);
    --content-top-margin: 2rem;
}

.content{
    margin-top: var(--content-top-margin);
}

.round-toggle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.round-toggle .material-icons {
    font-size: 18px;
    line-height: 1;
}

.col-md-12 {
    
    position: relative;
    padding-right: 15px;
    padding-left: 15px;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.main-header { /* Your top bar container */
    position: sticky; /* Changed from fixed */
    top: 0; /* Stick to the top when scrolling */
    z-index: 1030; /* Keep it above other content */
}

.fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

.fixed-bottom {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
}


.danger-text {
    color: var(--rz-danger) !important;
}

.app-divider {
    border: 0;
    border-top: 1px solid var(--rz-border-color);
    margin: 0 0 8px 0;
}

.my-popup {
    display: none;
    position: absolute;
    overflow: hidden;
    height: 360px;
    width: 600px;
    border-width: 1px;
    border-style: solid;
    border-color: #dadfe2;
    box-shadow: 0 1px 2px rgba(69, 73, 79, 0.3), 0 1px 3px 1px rgba(69, 73, 79, 0.15);
    border-radius: 4px
}

.data-row {
    width: 100%;
    padding: 0.3rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.data-row-label-container {
    height: 100%;
}

.data-row-label-container .rz-text {
    opacity: 0.7;
    font-size: 0.85rem;
}

.event-name-container {
    background-color: #b4b4b4;

    height: var(--slot-size);
    width: var(--container-width);
    display: inline-flex;
    flex-flow: wrap;
    z-index: 1;
    position: sticky;
    left: 0;
}

.event-type-container {
    display: flex;
    position: relative;
    flex-direction: row;
}

.event-container {
}

.my-event-content {
    border-radius: var(--rz-scheduler-border-radius);
    height: 100%;
    padding: var(--rz-scheduler-event-content-padding);
    font-size: var(--rz-scheduler-event-font-size);
    line-height: var(--rz-scheduler-event-line-height);
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.rz-cell-filter {
    background-color: var(--rz-base);
}

.event-type-header a span {
    color: var(--rz-text-color) !important;
}

.event-type-header a span:hover {
    color: var(--rz-text-color) !important;
    text-decoration-line: underline;
}

.event-type-header {
    border-right: 2px solid #000000;
    width: var(--container-width);
    padding-right: var(--container-width);
    display: flex;
    align-items: center;
    line-height: 1.2;
    background-color: var(--rz-base);
    z-index: 999;
    position: sticky;
    left: 0;
    font-family: comfortaa, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.vertical-line {
    border-left: 10px solid var(--rz-base-darker) !important;
}

.rz-horizontal-slot-header {
    text-align: center;
    border-left: 1px solid var(--rz-base-darker);
}

.rz-horizontal-slot-content {
    border-top: 1px solid var(--rz-base-darker);
    border-left: 1px solid var(--rz-base-darker);
}

.rz-calendar .rz-inputtext {
    background-color: var(--rz-base);
}

.rotate {
    -webkit-animation-name: spin;
    -webkit-animation-duration: 1000ms;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-timing-function: linear;
    -moz-animation-name: spin;
    -moz-animation-duration: 1000ms;
    -moz-animation-iteration-count: infinite;
    -moz-animation-timing-function: linear;
    -ms-animation-name: spin;
    -ms-animation-duration: 1000ms;
    -ms-animation-iteration-count: infinite;
    -ms-animation-timing-function: linear;

    animation-name: spin;
    animation-duration: 1000ms;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

@-ms-keyframes spin {
    from {
        -ms-transform: rotate(0deg);
    }
    to {
        -ms-transform: rotate(359deg);
    }
}

@-moz-keyframes spin {
    from {
        -moz-transform: rotate(0deg);
    }
    to {
        -moz-transform: rotate(359deg);
    }
}

@-webkit-keyframes spin {
    from {
        -webkit-transform: rotate(0deg);
    }
    to {
        -webkit-transform: rotate(359deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}

html, body {
    font-family: var(--rz-text-font-family, sans-serif);
    overflow-x: clip;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

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

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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: 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."
}


/* Combat System */

.row {
    margin-bottom: 1rem;
}

.hex {
    -webkit-clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
    clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    width: 250px;
    color: white;
}

.hex-grid {
    margin-bottom: 4rem;
}

.hex-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: -50px;
}

.hex-row-left {
}

.hex-row-right {
    margin-left: 125px;
}

.hex-friendly {
    background: var(--rz-info-darker);
    color: white;
}

.hex-enemy {
    background: var(--rz-danger-darker);
    color: white;
}

.log-line {
    margin-bottom: 1rem;
}

.unit-card {
    width: 250px;
    height: 250px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.unit-card * {
    color: var(--rz-white) !important;
}

.unit-card-info {
    margin-top: 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.unit-card-level-details {
    padding: 0 100% 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.unit-card-level-details p {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
    font-weight: bold;
    color: #f5f5f5;
}

.unit-card-details {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    background-color: rgba(55, 55, 55, 0.5)
}

.unit-card-details p {
    margin: 0;
}

.unit-card-name {
    color: #f5f5f5;
    font-size: 1vw;
    font-weight: bold;
}

.unit-card-type {
    color: #dbdbdb;
    font-size: 0.75rem;
}

.unit-card-attributes p {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
}

.unit-card-attributes-left {
    text-align: left;
    max-width: 20%;
    margin-left: 0;
    position: absolute;
    top: 25%;
    left: 5%;
}

.unit-card-attributes-right {
    text-align: right;
    max-width: 21%;
    position: absolute;
    top: 25%;
    right: 5%;
}

.unit-square-image {
    background-size: cover;
    width: 100px;
    height: 100px;
    justify-content: center;
    align-items: center;
}

.sim-unit-result-damage {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sim-unit-result-damage-icon {
    margin-right: 0.5rem;
}

.table-padding {
    padding-right: 2rem;
}

.table-padding-bigger {
    padding-left: 3rem;
}


.my-appointment {
    font-family: 'Comfortaa', sans-serif;
    border-radius: 12px !important;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.flex-container {
    display: flex;
    align-items: center;
}

.small-image {
    width: 50px;
}

.alliance-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.unit-row {
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: center;
}

.unit-info {
    text-align: center;
}

.arena-avatar a {
    color: var(--rz-text-color) !important;
    text-decoration-line: none;
}

.arena-avatar a:hover {
    color: var(--rz-link-color) !important;
    text-decoration-line: underline;
}

.arena-avatar p {
    font-size: 2.5rem;
}

.arena-avatar-alliance, .arena-avatar-rating {
    color: var(--rz-base-500) !important;
}

.avatar-container-border {
    background-color: var(--rz-base-light);
    width: 132px;
    height: 132px;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%)
}

.avatar-container {
    position: relative;
    display: inline-block;
    width: 128px;
    height: 128px;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    margin: 2px;
}

.avatar-level {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 5px;
    margin: 0;
    font-size: 1.5rem;
    background-color: var(--rz-base-light);
}

.avatar-level p {
    font-size: 1.25rem;
    color: var(--rz-on-base-light) !important;
    margin-bottom: 0;
}

.unit-item-container {
    position: relative;
    display: inline-block;
    width: 152px;
    height: 206px;
    margin: 5px;
}

.unit-item-type {
    position: absolute;
    top: 0;
    left: 0;
    padding: 5px;
    border-radius: 2px;
}

.unit-item-level p {
    font-size: 1.25rem;
    color: var(--rz-white) !important;
    margin-bottom: 0;
}

.unit-item-level {
    position: absolute;
    top: 0;
    right: 0;
    padding: 5px;
    margin: 5px 5px 0 0;
    font-size: 1.5rem;
}

.unit-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    text-align: center;
    padding: 5px;
    font-family: var(--rz-text-font-family, sans-serif);
    font-weight: bold;
    font-size: 1.2em;
}

.skill-info-block {
    display: inline-flex;
    flex-direction: column-reverse;
    vertical-align: baseline;
    margin-left: 0.3em;
    line-height: 1;
}

.skill-id {
    display: block;
    font-size: 0.7em;
    color: var(--rz-text-disabled-color, #6c757d);
    line-height: 0.9;
    margin-bottom: -0.15em;
}

.ability-result-unit {
    font-size: 1.25rem;
}

.skill-loc-hint {
    display: block;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--rz-text-secondary-color, #6c757d);
    line-height: 1.1;
}


.skill-categories {
    font-style: italic;
    color: var(--rz-text-secondary-color, #6c757d) !important;
    font-size: 0.95em;
    margin: 0 0.3em;
}


.actor-row {
    background-color: var(--rz-highlight-color);
}

.dead-row td {
    opacity: 0.55;
    text-decoration: line-through;
}

.log-unit, .log-skill {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
}

.log-action {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 0 0.5rem;
}

.log-skill {
    text-align: right;
}

.unit-id, .skill-id {
    font-size: 0.9rem;
    color: #999;
    word-break: break-all;
    cursor: pointer;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    padding: 0.1rem 0.2rem;
    margin: -0.1rem -0.2rem;
    border-radius: 3px;
}

.action-verb {
    font-size: 0.95rem;
    color: #ccc;
}

.action-tags {
    margin-top: 0.3rem;
}

/* Style for each distinct effect entry (Skill Added, Duration Change, etc.) */
.effect-entry {
    padding-left: 0.5rem; /* Indent effect details slightly */
    margin-bottom: 0.4rem; /* Space between effect entries */
    /* border-left: 2px solid var(--rz-base-lighter); */ /* Optional subtle left border */
}

/* Style for the main Skill Definition ID */
/* Style for the localization hint text */
.localization-hint {
    font-size: 0.9em;
    color: var(--rz-text-disabled-color);
    font-style: italic;
}

/* Container for the second line of details */
.effect-details {
    font-size: 0.9em; /* Make details slightly smaller */
    /*padding-left: 1.5rem; !* Indent further, aligning past the icon+space *!*/
    color: var(--rz-text-secondary-color); /* Slightly dimmer text */
}

/* Individual detail items like Duration, CustomField */
.detail-item {
    margin-right: 0.75rem; /* Space between detail items */
}

/* Styling for the Instance ID */
.id-detail {
    color: var(--rz-text-secondary-color) !important; /* Make ID very subtle */
    font-family: monospace; /* Use monospace for IDs */
    font-size: 0.9em; /* Match detail font size */
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    /* display: block; */ /* Optional: Force ID onto its own sub-line */
    /* margin-top: 0.1rem; */ /* Optional: Space above ID if on new line */
}

.id-detail:hover {
    color: var(--rz-info) !important; /* Highlight on hover */
}

/* Container for the whole pre-combat skills section */
.pre-combat-skills-section {
    padding-left: 1rem;
    margin-bottom: 1rem;
}

/* Styling for each single line skill instance entry */
.pre-combat-skill-instance-line {
    display: flex; /* Use flexbox for alignment */
    align-items: baseline; /* Align text along the baseline */
    flex-wrap: wrap; /* Allow wrapping if absolutely necessary */
    gap: 0.5rem; /* Space between elements */
    margin-bottom: 0.4rem; /* Space between lines */
    line-height: 1.4; /* Ensure enough line height */
}

/* Skill Definition ID - Main focus */
/* Separator Text */
.owned-by-separator {
    font-size: 0.9em;
    color: var(--rz-text-disabled-color) !important;
    flex-shrink: 0; /* Don't shrink separator */
}

/* Unit Name */

/* Instance ID - Subtle */
.instance-id {
    font-size: 0.85em;
    color: var(--rz-text-secondary-color) !important; /* Greyed out */
    font-family: monospace;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    /* Allow breaking the long GUID */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all; /* Force break anywhere */
    flex-shrink: 1; /* Allow shrinking */
    /* Add some margin to push it away slightly if wrapped */
    /* margin-left: 1rem; */
}

.instance-id:hover {
    color: var(--rz-info) !important;
}

/* ── Combat hex map ───────────────────────────────────────── */
.combat-hex-map {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.05rem;
    line-height: 1.15;
    letter-spacing: 0.05em;
    background-color: var(--rz-base-background-color, #f4f5f7);
    border: 1px solid var(--rz-border-color, #e0e0e0);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    width: fit-content;
    min-width: 12rem;
    margin: 0.5rem 0;
}

.combat-hex-map-row {
    white-space: pre;
    margin: 0;
}

.combat-hex-map .map-unit {
    font-weight: 700;
    cursor: default;
}

.combat-hex-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0 0 1rem;
    font-size: 0.85rem;
}

.combat-hex-map-legend-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}

.combat-hex-map-legend-item .map-unit {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
}

/* ── Pre-combat / start-of-turn skill groups ──────────────── */
.precombat-skill-group {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rz-border-color, rgba(127,127,127,0.25));
}

.precombat-skill-group:last-child {
    border-bottom: none;
}

.precombat-skill-head {
    margin-bottom: 0.35rem;
}

.precombat-skill-head .skill-definition-id {
    font-size: 1rem;
}

.precombat-skill-units {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.unit-chip {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--rz-base-200, #f0f1f3);
    border: 1px solid var(--rz-border-color, #e0e0e0);
    transition: filter 0.15s ease-in-out;
}

.unit-chip:hover {
    filter: brightness(0.95);
}

/* ── HP / Shield stat bars ────────────────────────────────── */
.stat-bar {
    position: relative;
    height: 1.25rem;
    min-width: 7rem;
    border-radius: 3px;
    background-color: var(--rz-base-300, #e6e6e6);
    overflow: hidden;
}

.stat-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    opacity: 0.45;
    transition: width 0.2s ease-in-out;
}

.stat-bar-fill-shield {
    background-color: var(--rz-info, #2196f3);
}

.stat-bar-label {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    line-height: 1.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Per-target ability effects (compact) ─────────────────── */
.target-result {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--rz-border-color, rgba(127,127,127,0.25));
}

.target-result:last-child {
    border-bottom: none;
}

.target-result-unit {
    flex: 0 0 9rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.target-result-body {
    flex: 1 1 16rem;
    min-width: 0;
}

.equipment-item {
    max-width: 300px
}

.equipment-item-container {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 420/320;

    position: relative;
    overflow: hidden;
}

.equipment-item-set {
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
}

.equipment-item-set-image {
    width: 100%;
    height: 100%;
}

.equipment-item-level p {
    font-size: 2rem;
    font-weight: bold;
    color: var(--rz-on-base-dark) !important;
}

.equipment-item-level-lock {
    position: absolute;
    top: 10px;
    right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.equipment-item-rank {
    position: absolute;
    bottom: 0;
    left: 0;

    text-align: center;
    width: 100%;
    height: 20%;
}

.locked-icon {
    height: 40px;
}

.locked-icon-background {
    background-color: var(--rz-black);
    padding: 5px;
}

.equipment-info-bg-common {
    background-image: url("../images/Equipment/Ornament_Common.png");
    background-size: cover;
}

.equipment-info-bg-uncommon {
    background-image: url("../images/Equipment/Ornament_Uncommon.png");
    background-size: cover;
}

.equipment-info-bg-rare {
    background-image: url("../images/Equipment/Ornament_Rare.png");
    background-size: cover;

}

.equipment-info-bg-epic {
    background-image: url("../images/Equipment/Ornament_Epic.png");
    background-size: cover;
}

.equipment-info-bg-legendary {
    background-image: url("../images/Equipment/Ornament_Legendary.png");
    background-size: cover;
}

.equipment-viewer-item {
    flex-basis: 30%;
    width: 100px;
}

.equipment-card {
    background-color: var(--rz-base);
    border: 2px solid var(--rz-base-darker);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    height: 355px;
    width: 320px;
    max-width: 100%;
}

.item-card-header {
    position: relative;
    min-height: 150px;
    border-bottom: 1px solid var(--rz-base-dark);
    flex-shrink: 0;
    overflow: hidden;
}

.header-top-row {
    position: relative;
    z-index: 3;
}

.header-middle-row {
    align-items: flex-end;
    position: relative;
    z-index: 1;
    min-height: 70px;
}

.item-set-info {
    background-color: rgba(40, 40, 40, 0.6);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.set-icon-small {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.item-set-text {
    border: 1px solid var(--rz-base-dark);
    color: var(--rz-on-base-dark) !important;
    padding: 5px;
    font-size: 0.9em;
    font-weight: 500;
    margin-left: 0.3rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    line-height: 1.2;
}

.item-level-lock-area {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 4;
}

.item-level {
    font-size: 1.8rem !important;
    font-weight: bold !important;
    line-height: 1 !important;
    color: var(--rz-on-base-dark) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.item-main-stats {
    padding-left: 0.1rem;
    position: relative;
    z-index: 2;
}

.main-stat-label {
    font-size: 1.2rem !important;
    color: var(--rz-on-base-dark) !important;
    text-transform: uppercase !important;
    margin-bottom: -2px !important;
}

.main-stat-value {
    font-size: 2rem !important;
    font-weight: bold !important;
    color: var(--rz-warning) !important;
    line-height: 1.1 !important;
}

.item-image-rarity-area {
    position: absolute;
    bottom: -15px;
    right: 5px;
    z-index: 2;
    width: 110px;
}

.item-image {
    width: 150px;
    height: auto;
    display: block;
    margin-bottom: -12px;
    filter: drop-shadow(2px 3px 3px rgba(0, 0, 0, 0.4));
}

.item-rarity {
    position: relative;
    padding: 0.1rem 0.8rem 0.1rem 1.2rem;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
    clip-path: polygon(15% 0%, 100% 0%, 100% 100%, 0% 100%);
    margin-left: -15px;
    z-index: 2;
    align-self: flex-end;
}

.rarity-common {
    background-color: var(--rarity-common);
}

.rarity-uncommon {
    background-color: var(--rarity-uncommon);
}

.rarity-rare {
    background-color: var(--rarity-rare);
}

.rarity-epic {
    background-color: var(--rarity-epic);
}

.rarity-legendary {
    background-color: var(--rarity-legendary);
}

.item-stats-section {
    background-color: var(--rz-base);
    display: flex;
    flex-direction: column;
    justify-content: start;
    flex-grow: 1;
}

.stat-name {
    font-weight: bold !important;
    font-size: 1.2em !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
    margin-left: 0.5rem;
    margin-bottom: 0 !important;
}

.stat-value {
    font-weight: bold !important;
    font-size: 1.2rem !important;
    color: var(--rz-warning) !important;
    white-space: nowrap;
    margin-right: 0.5rem;
    margin-bottom: 0 !important;
}

.item-set-bonus-section {
    background-color: var(--rz-base);
    border-top: 1px solid var(--rz-base-dark);
    flex-shrink: 0;
}

.set-icon-large {
    width: 32px;
    height: 32px;
}

.set-name {
    font-weight: bold !important;
    font-size: 0.95em !important;
    margin: 0 !important;
}

.set-bonus-desc {
    font-size: 0.9em !important;
    color: var(--rz-text-secondary-color) !important;
    margin: 0 !important;
}

.implant-item-container {
    position: relative;
}

.implant-image {
    position: relative;
    display: inline-block;
    width: 200px;
    height: 200px;
    vertical-align: middle;
    border-radius: 4px;
    overflow: hidden;
}

.implant-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.implant-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.implant-image-base-container {
    z-index: 1;
}

.implant-image-base-container {
    object-fit: cover;
}

.implant-image-set-container {
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
}

.implant-image-set-container .implant-image {
    object-fit: contain;
}

.implant-rarity-common {
    border-color: var(--rarity-common);
}

.implant-rarity-uncommon {
    border-color: var(--rarity-uncommon);
}

.implant-rarity-rare {
    border-color: var(--rarity-rare);
}

.implant-rarity-epic {
    border-color: var(--rarity-epic);
}

.implant-rarity-legendary {
    border-color: var(--rarity-legendary);
}

.implant-slot-flag {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    background-color: #30353a;
    z-index: 3;
    clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 0% 100%);

    /* Center the letter inside */
    display: flex;
    justify-content: center;
    align-items: center;
}

.slot-letter {
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    line-height: 1;
    text-align: center;
}

.implant-card {
    border-radius: 8px;
    border: 2px solid var(--rz-base-dark);
    background-color: var(--rz-base-darker);
    overflow: hidden;
    position: relative;
    max-height: 355px;
    width: 320px;
    max-width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.implant-card.implant-common {
    --implant-theme-color: var(--rarity-common);
    --implant-header-bg: linear-gradient(to bottom, #4d3a2a, #3c2e1f);
    --implant-tag-bg: var(--rarity-common);
    --implant-tag-text: white;
    --implant-ability-label: var(--rarity-common);
    --implant-border-color: var(--rarity-common);
}

.implant-card.implant-uncommon {
    --implant-theme-color: var(--rarity-uncommon);
    --implant-header-bg: linear-gradient(to bottom, #4d3a2a, #3c2e1f);
    --implant-tag-bg: var(--rarity-uncommon);
    --implant-tag-text: white;
    --implant-ability-label: var(--rarity-uncommon);
    --implant-border-color: var(--rarity-uncommon);
}

.implant-card.implant-rare {
    --implant-theme-color: var(--rarity-rare);
    --implant-header-bg: linear-gradient(to bottom, #4d3a2a, #3c2e1f);
    --implant-tag-bg: var(--rarity-rare);
    --implant-tag-text: white;
    --implant-ability-label: var(--rarity-rare);
    --implant-border-color: var(--rarity-rare);
}

.implant-card.implant-epic {
    --implant-theme-color: var(--rarity-epic);
    --implant-header-bg: linear-gradient(to bottom, #4a2f6b, #3b2555);
    --implant-tag-bg: var(--rarity-epic);
    --implant-tag-text: white;
    --implant-ability-label: var(--rarity-epic);
    --implant-border-color: var(--rarity-epic);
}

.implant-card.implant-legendary {
    --implant-theme-color: var(--rarity-legendary);
    --implant-header-bg: linear-gradient(to bottom, #6a1f5a, #551a4a);
    --implant-tag-bg: var(--rarity-legendary);
    --implant-tag-text: white;
    --implant-ability-label: var(--rarity-legendary);
    --implant-border-color: var(--rarity-legendary);
}

.implant-card {
    border: 2px solid var(--implant-border-color, #555);
    box-shadow: 0 0 8px var(--implant-border-color, transparent);
}

.implant-header {
    position: relative;
    background: var(--implant-header-bg);
    min-height: 60px;
    overflow: visible;
}

.header-content {
    z-index: 2;
    margin-top: 0.5rem;
    margin-left: 0.3rem;
}

.header-set-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.header-title-text {
    font-weight: bold;
    font-size: 0.9em;
    color: white;
    text-transform: uppercase;
}

.header-implant-image-container {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 65px;
    height: 65px;
    z-index: 3;
}

.header-slot-letter {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    border-radius: 2px;
    z-index: 4;
    border: 1px solid #ccc;
}

.implant-set-name-tag {
    background-color: var(--implant-tag-bg);
    color: var(--implant-tag-text);
    padding: 0.2rem 0.8rem 0.2rem 1.2rem;
    font-weight: bold;
    font-size: 1.1em;
    text-transform: uppercase;
    position: relative;
    margin-left: 0.5rem;
    width: fit-content;
    clip-path: polygon(10% 0%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 1;
}

.implant-minor .implant-set-name-tag {
    background-color: var(--implant-tag-bg);
    clip-path: polygon(0% 0%, calc(100% - 10px) 0%, 100% 100%, 0% 100%);
    margin-left: auto;
    margin-right: 0.5rem;
    padding: 0.2rem 1.2rem 0.2rem 0.8rem;
    top: -18px;
}

.implant-body {
    position: relative;
    background-color: var(--rz-base-dark);
    flex-grow: 1;
    min-height: 100px;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
}

.ultimate-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/ultimate-nebula-bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 0;
}

.implant-ability {
    border-top: 1px solid #444;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.ability-label {
    font-weight: bold;
    color: var();
    font-size: 0.9em;
    text-transform: uppercase;
}

.ability-name {
    font-weight: bold;
    font-size: 1em;
    color: white;
}

.implant-info-image-container {
    width: 70px;
    height: 70px;
}

.implant-ability-description p {
    white-space: normal;
}

.implant-ability-description {
    font-size: 1.25em;
    color: var(--rz-text-secondary-color);
    margin-top: 0.1rem;
    padding: 0 0.5rem;
    line-height: 1.4;
}

.implant-ability-container {
    margin: 0.5rem;
}

.admin-button {
    align-self: center;
    margin: 0 3rem 3rem 3rem;
}

.user-layout-wrapper {
    display: flex;
    flex-direction: column;
    /* Height will be determined by content or parent (<article>) */
    width: 100%;
}

/* Styling for the user context header (below MainLayout's header) */
.user-context-header {
    background-color: var(--rz-base-dark, #3a4752);
    color: var(--rz-text-on-primary-color, #fff);
    border-bottom: 1px solid var(--rz-grid-cell-border-color, #4b5866);
    flex-shrink: 0; /* Don't shrink header */
    position: sticky; /* Make the User header sticky as well */
    /* Stick just below the app header; js.js keeps --main-header-height in sync. */
    top: var(--main-header-height, 64px);
    z-index: 1025; /* Below MainLayout header (1030), above content */
    padding: 1rem 0 1rem 2rem;
}

.user-context-name{
    margin-bottom: 0 !important;
    /* Usernames can be long unbroken tokens (e.g. 32-char hex); without this
       they widen the sticky header past the viewport on phones. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Container for the sidebar + content, uses flexbox */
.user-page-sticky-layout-container {
    display: flex;
    align-items: flex-start; /* Align top */
    /* Takes remaining space */
    flex-grow: 1;
}


.user-sticky-sidebar {
    /*width: 260px; !* Sidebar width *!*/
    flex-shrink: 0;

    /* --- Sticky Positioning --- */
    position: sticky;
    /* Below BOTH the app header (measured into --main-header-height by js.js)
       and the user context header (~49px). */
    top: calc(var(--main-header-height, 64px) + 49px);
    height: calc(100vh - var(--main-header-height, 64px) - 49px);
    overflow-y: auto; /* Allow menu scrolling */

    /* Background and border */
    background-color: var(--rz-base-background-color, #2a333c);
    border-right: 1px solid var(--rz-grid-cell-border-color, #4b5866);
    z-index: 1020; /* Below user context header */
}

.user-sticky-content {
    flex-grow: 1;
    padding: 1.5rem; /* Padding for the actual page content */
    min-width: 0; /* Prevent flex overflow */
}

/* --- Optional: Custom RadzenPanelMenu styles within this layout --- */
/* You might scope these if you use panel menus elsewhere */
.user-nav-menu-sidebar .custom-panel-menu .rz-panel-menu-item-link {
    color: #d0d0d0;
    padding: 10px 15px;
}
.user-nav-menu-sidebar .custom-panel-menu .rz-panel-menu-item-link:hover {
    background-color: #2a333c;
    color: #fff;
}
.user-nav-menu-sidebar .custom-panel-menu .rz-panel-menu-item-link-active {
    background-color: var(--rz-primary-darker, #3a6ea5);
    color: #fff;
    font-weight: bold;
}
.user-nav-menu-sidebar .custom-panel-menu .rz-panel-menu-item-icon {
    margin-right: 10px;
    color: #a0a0a0;
}
.user-nav-menu-sidebar .custom-panel-menu .rz-panel-menu-item-link-active .rz-panel-menu-item-icon {
    color: #fff;
}

.unit-star-ascended {
    fill: #ff6600; /* color for ascended unit-stars */
}

.unit-star-ranked {
    fill: #828282;
}

.unit-star-path {
    fill: #f9f9f9;
}

.unit-star-path:hover,
.unit-star-ranked:hover,
.unit-star-ascended:hover,
.unit-star-svg:hover  {
    fill: #0dcaf0; /* color on hover */
}

.unit-star-transition {
    transition: fill 0.1s;
}

.challenge-card{
    max-width: 350px;
}

/* ---------------------------------------------------------------------------
   Navigation progress bar (NavigationProgressBar.razor)
   Appears only if a navigation takes longer than 150ms, so fast pages never
   flash the bar.
--------------------------------------------------------------------------- */

.sc-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10000;
    background-color: transparent;
    overflow: hidden;
    opacity: 0;
    animation: sc-nav-progress-appear 0s linear 150ms forwards;
}

.sc-nav-progress-bar {
    height: 100%;
    width: 40%;
    background-color: var(--rz-info);
    animation: sc-nav-progress-slide 1.2s ease-in-out infinite;
}

@keyframes sc-nav-progress-appear {
    to {
        opacity: 1;
    }
}

@keyframes sc-nav-progress-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(350%);
    }
}

/* ---------------------------------------------------------------------------
   Blazor Server reconnect overlay (see _Layout.cshtml)
   blazor.server.js toggles the components-reconnect-* classes on the
   #components-reconnect-modal element.
--------------------------------------------------------------------------- */

#components-reconnect-modal {
    display: none;
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    align-items: center;
    gap: 10px;
}

#components-reconnect-modal.components-reconnect-show {
    background-color: var(--rz-warning-dark, #b45309);
}

#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    background-color: var(--rz-danger-dark, #b91c1c);
}

#components-reconnect-modal .sc-reconnect-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sc-reconnect-spin 0.8s linear infinite;
}

#components-reconnect-modal .sc-reconnect-retry {
    display: none;
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font: inherit;
    padding: 0;
}

#components-reconnect-modal.components-reconnect-failed .sc-reconnect-retry,
#components-reconnect-modal.components-reconnect-rejected .sc-reconnect-retry {
    display: inline;
}

#components-reconnect-modal.components-reconnect-failed .sc-reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .sc-reconnect-spinner {
    display: none;
}

#components-reconnect-modal .sc-reconnect-text-reconnecting,
#components-reconnect-modal .sc-reconnect-text-failed {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .sc-reconnect-text-reconnecting {
    display: inline;
}

#components-reconnect-modal.components-reconnect-failed .sc-reconnect-text-failed,
#components-reconnect-modal.components-reconnect-rejected .sc-reconnect-text-failed {
    display: inline;
}

@keyframes sc-reconnect-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------------------------------------------------------------------------
   NavMenu marker suppression
   Our NavMenu wraps RadzenMenuItems in RadzenStack divs, which breaks the
   list-style inheritance Radzen relies on - native square <li> markers can
   flash during SPA re-renders. Suppress them explicitly.
--------------------------------------------------------------------------- */

.rz-menu li,
.rz-navigation-item {
    list-style: none;
}

/* ===== Responsive app header + navigation drawer (Phase 2) ===== */

.app-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    max-width: var(--nav-menu-width);
    margin: 0 auto;
}

.app-header-spacer {
    flex: 1 1 auto;
}

.app-header-env {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* .rz-menu qualifier keeps these ahead of the theme's
   .rz-menu:not(.rz-profile-menu) rules, which tie bare (0,2,0) selectors and
   win on load order (the theme stylesheet is injected after site.css). */
.app-header .app-top-nav.rz-menu {
    background: transparent;
    flex-wrap: wrap;
}

.app-header-urls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
    font-size: 0.78rem;
    opacity: 0.85;
    white-space: nowrap;
}

.app-header-profile,
.app-header-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

/* Hamburger hidden on desktop; the drawer is a mobile affordance but stays
   usable at any width (power users can still open it on desktop via touch). */
.app-hamburger {
    display: none;
}

/* Doubled class specificity: the Radzen theme stylesheet is injected AFTER
   site.css and its .rz-sidebar rules (z-index:1, width:250px) would otherwise
   win the cascade and leave the drawer stuck underneath the backdrop. */
.rz-sidebar.app-drawer {
    --rz-sidebar-width: min(320px, 85vw);
    z-index: 1050; /* above .main-header (1030) and backdrop (1045) */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* single scroll area: the menu below */
}

/* The nav list is the drawer's main content: give it all remaining height
   and make it the only scrolling region, so the footer stays compact and
   pinned instead of stealing space from the menu. */
.rz-sidebar.app-drawer .app-side-nav-menu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Standalone (non-RadzenLayout) sidebars get an inline width:250px from the
   component, which no cascade rule can beat — hence !important. Scoped to the
   expanded state so the collapsed width:0 keeps working. */
.rz-sidebar.app-drawer.rz-sidebar-expanded {
    width: var(--rz-sidebar-width) !important;
}

.app-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1045;
}

.app-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1;
}

.app-side-nav-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--rz-border-color, rgba(255, 255, 255, 0.12));
    padding: 0.5rem 1rem 0.6rem;
}

.app-side-nav-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.app-side-nav-profile,
.app-side-nav-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.app-side-nav-profile span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-side-nav-profile:hover,
.app-side-nav-logout:hover {
    color: var(--rz-primary);
}

/* Which auth/game server this WebAdmin instance is talking to. */
.app-side-nav-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
    white-space: nowrap;
}

.app-side-nav-meta-sep {
    opacity: 0.5;
}

/* Tablet and below: collapse the horizontal menu into the drawer. */
@media (max-width: 1023.98px) {
    .app-header .app-top-nav.rz-menu {
        display: none;
    }

    .app-hamburger {
        display: inline-flex;
    }

    .app-header-user-name,
    .app-header-logout-text {
        display: none;
    }
}

/* The auth/server labels are compact now, so they only need to hide when the
   whole menu collapses into the drawer. */
@media (max-width: 1023.98px) {
    .app-header-urls {
        display: none;
    }
}

/* ===== Responsive polish (Phase 4) ===== */

/* User info page: main details + Mixpanel side panel. Wraps into a single
   column when both flex bases (320px + 300px + gap) no longer fit, so the
   side panel drops below the details instead of crushing them. */
.user-info-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    width: 100%;
}

.user-info-columns > .user-info-main {
    flex: 1 1 320px;
    min-width: 0;
}

.user-info-columns > .user-info-side {
    flex: 1 1 300px;
    max-width: 380px;
}

/* Site footer (App.razor). Styles live here instead of inline so the mobile
   rules below can shrink the desktop whitespace. */
.app-footer {
    max-width: var(--main-content-width);
    margin: 10rem auto 1rem;
}

.app-footer p {
    text-align: center;
    color: var(--rz-text-title-color);
}

@media (max-width: 899.98px) {
    .app-footer {
        margin-top: 3rem;
    }
}

/* User detail sub-nav width lives here instead of an inline style so the
   mobile stacking rules below can override it. */
.user-nav-panel-menu {
    width: 200px;
}

/* Dialogs: near-fullscreen on phones. Radzen sets inline width from dialog
   options, hence the !important. Side/dropdown dialogs are left alone. */
@media (max-width: 640px) {
    .rz-dialog:not(.rz-dialog-side) {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 92dvh;
    }

    .rz-dialog-content {
        max-height: calc(92dvh - 4rem);
        overflow-y: auto;
    }
}

/* User detail layout: the sub-nav collapses behind a toggle bar on narrow
   screens so the page content is the first thing visible, not the menu. */
.user-subnav-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    border-bottom: 1px solid var(--rz-grid-cell-border-color, #4b5866);
    background-color: var(--rz-base-background-color, #2a333c);
    color: var(--rz-text-color);
    font: inherit;
    cursor: pointer;
}

.user-subnav-toggle .rzi:last-child {
    margin-left: auto;
}

@media (max-width: 899.98px) {
    .user-subnav-toggle {
        display: flex;
    }

    .user-page-sticky-layout-container {
        flex-direction: column;
    }

    .user-sticky-sidebar {
        display: none;
        position: static;
        width: 100%;
        height: auto;
        max-height: 50vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--rz-grid-cell-border-color, #4b5866);
    }

    .user-sticky-sidebar.user-subnav-open {
        display: block;
    }

    .user-nav-panel-menu {
        width: 100%;
    }

    .user-context-header {
        padding-left: 1rem;
    }

    /* The full GUID wraps the compact header on phones; the short name is
       enough there, and copy-from-GUID remains available on wider screens. */
    .user-context-guid {
        display: none;
    }

    /* Desktop spaces admin action buttons with big margins; on phones those
       margins (3rem each side) force overflow, wrapping does the spacing. */
    .admin-button {
        margin: 0 0.25rem 0.75rem;
    }

    /* Long accordion titles ("Devices (N) — all device IDs…") clip on one
       line; let them wrap instead. */
    .rz-accordion-header a,
    .rz-accordion-header .rz-accordion-toggle-title {
        white-space: normal;
    }

    /* Once the info/Mixpanel columns stack, the side panel can use the full
       width instead of stopping at its desktop cap. */
    .user-info-columns > .user-info-side {
        max-width: 100%;
    }

        /* Utility: hide low-value table columns / elements on phones. Applied via
           CssClass/HeaderCssClass on RadzenDataGridColumn (e.g. System Inbox) so
           wide grids show only the essentials on small screens. */
        .hide-on-mobile {
            display: none !important;
        }
    }

    /* Search bar + button above list pages (System Inbox, etc). Full-width input
       on phones; capped on desktop where the old inline width:30% used to be. */
    .page-search-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .page-search-row .rz-textbox {
        flex: 1 1 16rem;
        max-width: 30rem;
    }

    /* Grids: momentum scrolling and a thin scrollbar so it's obvious that wide
       tables pan sideways on touch screens. */
    .rz-data-grid-data {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    /* ---- Global phone-size fixes ---------------------------------------------- */
    @media (max-width: 899.98px) {
        /* Form controls go full width, overriding the hundreds of inline
           width:30% / fixed-px styles across create/edit pages. Full-width inputs
           are the right call on phones anyway, so this beats fixing every page. */
        .rz-textbox,
        .rz-textarea,
        .rz-dropdown,
        .rz-multiselect,
        .rz-numeric,
        .rz-datepicker,
        .rz-autocomplete,
        .rz-html-editor {
            width: 100% !important;
            max-width: 100% !important;
        }

        /* ...except the pager's page-size dropdown, which Radzen lays out in its
           own compact grid below 768px. */
        .rz-pager .rz-dropdown {
            width: auto !important;
        }

        /* Comfortable touch targets on pager controls and icon-only buttons. */
        .rz-pager .rz-pager-element,
        .rz-pager .rz-pager-page {
            min-width: 2.5rem;
            min-height: 2.5rem;
        }

        .rz-button.rz-button-icon-only {
            min-width: 2.5rem;
            min-height: 2.5rem;
        }

        /* Tab headers scroll sideways instead of clipping (System Inbox, etc). */
        .rz-tabview-nav {
            overflow-x: auto;
            flex-wrap: nowrap;
            scrollbar-width: none;
        }

        .rz-tabview-nav li {
            flex: 0 0 auto;
        }
    }
