@font-face {
    font-family: "Genos";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/genos/genos-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Monda";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/monda/monda-latin.woff2") format("woff2");
}

:root {
    --accent: #3ccb3c;
    --badge-w: 45px;
    --badge-h: 144px;
    --badge-top: 1.6rem;
    --badge-image-top: -1.6rem;
    --badge-image-h: 240px;
    --badge-art-w: 58px;
    --badge-art-right: -12px;
    /* sized to exactly fit the fixed badge + its left margin, so there's no leftover gap before the content */
    --spine-w: 60px;
    --content-peek: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Monda", sans-serif;
    overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Genos", sans-serif;
    letter-spacing: 0;
}

body {
    color: #163a4d;
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 20%),
        radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 22%),
        linear-gradient(180deg, #eaf8ff 0%, #bfe9fb 35%, #6cc6ec 65%, #1f9fd6 100%);
}

/* ---- Logo shown at the top of every blade's content ---- */
.blade-logo {
    display: block;
    /* scales with whichever viewport dimension is more constrained, so it always fits without ever getting oversized */
    height: clamp(40px, min(8vw, 10vh), 120px);
    width: auto;
    margin: 0 auto 1.5rem;
}

/* ---- Blade viewport: a row of vertical glass blades ---- */
#bladeViewport {
    display: flex;
    align-items: stretch;
    height: 100%;
    width: 100%;
}

.blade-panel {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    width: calc(var(--spine-w) + var(--content-peek));
    height: 100%;
    background: #5a6570;
    border-right: 1px solid rgba(0, 0, 0, 0.9);
    box-shadow: 6px 0 18px rgba(5, 30, 45, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    cursor: pointer;
    overflow: hidden;
    transition: width 0.55s linear, background 0.55s linear, box-shadow 0.55s linear;
}

/* glossy highlight sweeping across the top third, the classic Aero sheen */
.blade-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

/* shadow hugging the left edge, so the panel reads as lifted above its neighbor */
.blade-panel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 14px;
    background: linear-gradient(90deg, rgba(5, 30, 45, 0.35) 0%, rgba(5, 30, 45, 0) 100%);
    pointer-events: none;
}

.blade-panel:not(.active)::after {
    width: 20px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.62) 0%, rgba(5, 30, 45, 0.24) 45%, rgba(5, 30, 45, 0) 100%);
}

.blade-panel.active {
    /* set by JS to exactly fill whatever space the fixed-width spines leave behind */
    width: var(--active-w, 420px);
    cursor: default;
    box-shadow: 12px 0 30px rgba(5, 30, 45, 0.45), -6px 0 24px rgba(5, 30, 45, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ---- The narrow tab strip that is always visible on every blade ---- */
.blade-spine {
    position: relative;
    z-index: 4;
    flex: 0 0 var(--spine-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--badge-top);
    backdrop-filter: blur(6px);
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(8, 18, 26, 0.2) 0,
        rgba(8, 18, 26, 0.2) 1px,
        rgba(255, 255, 255, 0.14) 1px,
        rgba(255, 255, 255, 0.14) 2px,
        rgba(255, 255, 255, 0) 2px,
        rgba(255, 255, 255, 0) 20px
    );
}

.blade-spine::after {
    content: "";
    position: absolute;
    top: calc(var(--badge-top) + var(--badge-image-top) + var(--badge-image-h));
    right: var(--badge-art-right);
    bottom: 0;
    width: var(--badge-art-w);
    background-color: var(--badge-base, var(--accent));
    background-image: url("../img/badge-grayscale_repeat.png");
    background-position: top right;
    background-size: var(--badge-art-w) auto;
    background-repeat: repeat-y;
    background-blend-mode: hard-light;
    -webkit-mask-image: url("../img/badge-grayscale_repeat.png");
    mask-image: url("../img/badge-grayscale_repeat.png");
    -webkit-mask-position: top right;
    mask-position: top right;
    -webkit-mask-size: var(--badge-art-w) auto;
    mask-size: var(--badge-art-w) auto;
    -webkit-mask-repeat: repeat-y;
    mask-repeat: repeat-y;
    pointer-events: none;
}

/* PNG badge artwork behind the vertical label */
.blade-badge {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--badge-w);
    height: var(--badge-h);
    margin-left: calc(var(--spine-w) - var(--badge-w));
    padding: 1.6rem 0 0.8rem 0.2rem;
    overflow: visible;
    isolation: isolate;
    transition: none;
}

.blade-badge::before {
    content: "";
    position: absolute;
    top: var(--badge-image-top);
    right: var(--badge-art-right);
    width: var(--badge-art-w);
    height: var(--badge-image-h);
    background-color: var(--badge-base, var(--accent));
    -webkit-mask: url("../img/badge-grayscale.png") top right / 100% 100% no-repeat;
    mask: url("../img/badge-grayscale.png") top right / 100% 100% no-repeat;
    pointer-events: none;
}

.blade-badge-image {
    position: absolute;
    top: var(--badge-image-top);
    right: var(--badge-art-right);
    display: block;
    width: var(--badge-art-w);
    height: var(--badge-image-h);
    max-width: none;
    z-index: 1;
    image-rendering: auto;
    mix-blend-mode: hard-light;
    pointer-events: none;
}

.blade-label {
    position: relative;
    z-index: 2;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: "Genos", sans-serif;
    letter-spacing: 0;
    font-size: 1.14rem;
    color: #000000;
    transition: none;
    white-space: nowrap;
}

.blade-panel.active .blade-label {
    color: #ffffff;
    font-weight: 600;
}

/* ---- Expanded content area, only meaningful on the active blade ---- */
.blade-body {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    /* active panel width already includes the fixed spine, so subtract it here to keep content fully visible */
    width: calc(var(--active-w, 420px) - var(--spine-w));
    overflow: hidden;
    pointer-events: none;
    backdrop-filter: blur(6px);
    visibility: visible;
    background: var(--accent);
}

.blade-divider {
    position: absolute;
    z-index: 5;
    top: 0;
    bottom: 0;
    left: calc(var(--spine-w) + var(--content-peek) - 3px);
    width: 3px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0 2px, rgba(255, 255, 255, 0.24) 2px 3px);
    box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

.blade-panel.active .blade-body {
    pointer-events: auto;
}

.blade-content {
    height: 100%;
    overflow-y: auto;
    padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1.25rem, 5vw, 3rem) 2rem 1.75rem;
}

.blade-title {
    font-family: "Genos", sans-serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    letter-spacing: 0;
    margin: 0 0 1.5rem;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(5, 30, 45, 0.4);
    white-space: nowrap;
}

/* ---- Reusable text content styles for blade content ---- */
.text-section {
    margin: 0 0 1.15rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(8, 18, 26, 0.14) 0,
            rgba(8, 18, 26, 0.14) 1px,
            rgba(255, 255, 255, 0.1) 1px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0) 2px,
            rgba(255, 255, 255, 0) 20px
        ),
        linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.07) 46%, rgba(255, 255, 255, 0) 100%),
        linear-gradient(180deg, #6d7782 0%, #5a6570 52%, #4d5965 100%);
    background-position: 0 0, 0 0, 0 0;
    background-attachment: scroll, scroll, scroll;
    border: 1px solid rgba(0, 0, 0, 0.92);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.42), inset 0 0 8px rgba(0, 0, 0, 0.22), 0 4px 10px rgba(5, 30, 45, 0.14);
}

.text-heading {
    margin: 0 0 0.45rem;
    font-size: clamp(0.95rem, 2.5vw, 1.18rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
    font-weight: 700;
    color: #ffffff;
}

.text-subheading {
    margin: 0 0 0.45rem;
    font-size: clamp(0.82rem, 2.2vw, 0.95rem);
    line-height: 1.3;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.text-paragraph {
    margin: 0 0 0.7rem;
    font-size: clamp(0.8rem, 2vw, 0.92rem);
    line-height: 1.58;
    color: #ecf8ff;
    text-wrap: pretty;
}

.text-paragraph:last-child {
    margin-bottom: 0;
}

.auth-panel {
    max-width: 34rem;
}

.auth-panel-account {
    display: flex;
    min-height: clamp(24rem, 62vh, 34rem);
    flex-direction: column;
}

.auth-panel-signed-out {
    display: grid;
    min-height: clamp(15rem, 42vh, 22rem);
    margin: clamp(2rem, 8vh, 5rem) auto 0;
    place-items: center;
}

.auth-signed-out {
    max-width: 25rem;
    padding: 1rem;
    text-align: center;
}

.auth-signed-out .text-heading {
    margin-bottom: 0.6rem;
    font-size: clamp(1.15rem, 3vw, 1.5rem);
}

.auth-signed-out .text-paragraph {
    margin-bottom: 1.15rem;
}

.auth-eyebrow {
    margin: 0 0 0.4rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-message {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.72);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.82rem;
    line-height: 1.45;
}

.auth-message-error {
    background: rgba(117, 20, 20, 0.78);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
}

.auth-message-success {
    background: rgba(20, 104, 54, 0.78);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.auth-button {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.9);
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.04)),
        color-mix(in srgb, var(--accent) 82%, black);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 3px 7px rgba(0, 0, 0, 0.28);
    color: #ffffff;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.auth-button:hover {
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.58), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.auth-button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

.auth-button-secondary {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.03)),
        #4e5963;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: flex-start;
}

.auth-actions form {
    margin: 0;
}

.auth-actions .auth-button {
    min-width: 12rem;
}

.auth-signout {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-signout form {
    margin: 0;
}

.auth-account-layout {
    display: grid;
    gap: 1rem;
}

@media (min-width: 900px) {
    .auth-account-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

.auth-admin-panel {
    max-width: 34rem;
    --accent: #db4f52;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(8, 18, 26, 0.14) 0,
            rgba(8, 18, 26, 0.14) 1px,
            rgba(255, 255, 255, 0.1) 1px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0) 2px,
            rgba(255, 255, 255, 0) 20px
        ),
        linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.07) 46%, rgba(255, 255, 255, 0) 100%),
        linear-gradient(180deg, color-mix(in srgb, #db4f52 58%, #2a3844) 0%, color-mix(in srgb, #db4f52 66%, #1f2b36) 52%, color-mix(in srgb, #db4f52 72%, #162028) 100%);
}

.auth-admin-panel .text-heading {
    margin-bottom: 0.35rem;
}

.auth-admin-panel .text-paragraph {
    margin-bottom: 0.8rem;
}

.auth-admin-actions {
    gap: 0.55rem;
}

.auth-emoji-manager-backdrop {
    position: absolute;
    z-index: 19;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(8, 14, 18, 0.66);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-emoji-manager {
    position: absolute;
    z-index: 20;
    inset: 0 0 0 auto;
    display: flex;
    width: min(100%, 30rem);
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    border-left: 1px solid rgba(0, 0, 0, 0.9);
    --accent: #db4f52;
    background:
        repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 20px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.16)),
        color-mix(in srgb, #db4f52 60%, #1e2e3a);
    box-shadow: none;
    color: #ffffff;
    transition: transform 0.24s ease;
}

#panel-mybigsafford.emoji-manager-open .auth-emoji-manager-backdrop {
    opacity: 1;
    visibility: visible;
}

#panel-mybigsafford.emoji-manager-open .auth-emoji-manager {
    transform: translateX(0);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.48);
}

.auth-emoji-manager-header {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}

.auth-emoji-manager-header h2,
.auth-emoji-catalog-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 0;
}

.auth-emoji-manager-body {
    min-height: 0;
    overflow-y: auto;
}

.auth-user-manager-backdrop {
    position: absolute;
    z-index: 19;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(8, 14, 18, 0.66);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-user-manager {
    position: absolute;
    z-index: 20;
    inset: 0 0 0 auto;
    display: flex;
    width: min(100%, 32rem);
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    border-left: 1px solid rgba(0, 0, 0, 0.9);
    --accent: #db4f52;
    background:
        repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 20px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.16)),
        color-mix(in srgb, #db4f52 54%, #1f3244);
    box-shadow: none;
    color: #ffffff;
    transition: transform 0.24s ease;
}

#panel-mybigsafford.user-manager-open .auth-user-manager-backdrop {
    opacity: 1;
    visibility: visible;
}

#panel-mybigsafford.user-manager-open .auth-user-manager {
    transform: translateX(0);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.48);
}

.auth-user-manager-header {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}

.auth-user-manager-header h2,
.auth-user-catalog-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 0;
}

.auth-user-manager-body {
    min-height: 0;
    overflow-y: auto;
}

.auth-user-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.55rem;
}

.auth-user-search {
    width: min(12rem, 52%);
}

.auth-user-feedback {
    min-height: 1.2rem;
    margin: 0;
    padding: 0 1rem 0.45rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.72rem;
}

.auth-user-feedback[data-state="error"] {
    color: #ffd0d0;
}

.auth-user-grid {
    display: grid;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.auth-user-item {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid rgba(0, 0, 0, 0.56);
    border-radius: 6px;
    background: rgba(39, 48, 55, 0.72);
}

.auth-user-identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.auth-user-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(0, 0, 0, 0.82);
    border-radius: 50%;
    object-fit: cover;
    background: #1e2f3d;
}

.auth-user-avatar-fallback {
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-user-copy {
    min-width: 0;
}

.auth-user-copy strong,
.auth-user-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-user-copy strong {
    font-size: 0.78rem;
}

.auth-user-copy span {
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
}

.auth-user-name-form {
    display: flex;
    gap: 0.45rem;
}

.auth-user-name-input {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
}

.auth-user-name-save,
.auth-user-avatar-upload,
.auth-user-avatar-reset {
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.7rem;
}

.auth-user-avatar-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
}

.auth-user-avatar-upload-wrap {
    position: relative;
}

.auth-user-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.auth-user-avatar-reset {
    border-color: rgba(0, 0, 0, 0.78);
    background: #6e3036;
}

.auth-user-empty {
    margin: 0;
    padding: 1.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    text-align: center;
}

.auth-chat-manager-backdrop {
    position: absolute;
    z-index: 19;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(8, 14, 18, 0.66);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-chat-manager {
    position: absolute;
    z-index: 20;
    inset: 0 0 0 auto;
    display: flex;
    width: min(100%, 34rem);
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    border-left: 1px solid rgba(0, 0, 0, 0.9);
    --accent: #db4f52;
    background:
        repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 20px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.16)),
        color-mix(in srgb, #db4f52 58%, #213446);
    box-shadow: none;
    color: #ffffff;
    transition: transform 0.24s ease;
}

#panel-mybigsafford.chat-manager-open .auth-chat-manager-backdrop {
    opacity: 1;
    visibility: visible;
}

#panel-mybigsafford.chat-manager-open .auth-chat-manager {
    transform: translateX(0);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.48);
}

.auth-chat-manager-header {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}

.auth-chat-manager-header h2,
.auth-chat-catalog-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 0;
}

.auth-chat-manager-body {
    min-height: 0;
    overflow-y: auto;
}

.auth-chat-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.55rem;
}

.auth-chat-search {
    width: min(13rem, 54%);
}

.auth-chat-feedback {
    min-height: 1.2rem;
    margin: 0;
    padding: 0 1rem 0.45rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.72rem;
}

.auth-chat-feedback[data-state="error"] {
    color: #ffd0d0;
}

.auth-chat-grid {
    display: grid;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.auth-chat-item {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid rgba(0, 0, 0, 0.56);
    border-radius: 6px;
    background: rgba(39, 48, 55, 0.72);
}

.auth-chat-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.auth-chat-avatar {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.82);
    border-radius: 50%;
    background: #1e2f3d;
    object-fit: cover;
}

.auth-chat-avatar-fallback {
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
}

.auth-chat-item-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.auth-chat-item-copy strong,
.auth-chat-item-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-chat-item-copy strong {
    font-size: 0.78rem;
}

.auth-chat-item-copy span {
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
}

.auth-chat-type-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.45rem;
    padding: 0.15rem 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.72);
    border-radius: 3px;
    background: color-mix(in srgb, var(--accent) 78%, black);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-chat-members {
    grid-column: 1 / -1;
    min-width: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding-top: 0.45rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
}

.auth-chat-members summary {
    cursor: pointer;
    color: #ffffff;
    font-weight: 700;
}

.auth-chat-member-list {
    display: grid;
    gap: 0.2rem;
    margin: 0.45rem 0 0;
    padding-left: 1.1rem;
}

.auth-chat-member-list label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.auth-chat-member-checkbox {
    accent-color: var(--accent);
}

.auth-chat-members-save {
    margin-top: 0.55rem;
    min-height: 1.9rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
}

.auth-chat-name-form {
    display: flex;
    gap: 0.45rem;
}

.auth-chat-name-input {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
}

.auth-chat-name-save,
.auth-chat-icon-upload,
.auth-chat-icon-clear,
.auth-chat-delete {
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.7rem;
}

.auth-chat-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
}

.auth-chat-icon-upload-wrap {
    position: relative;
}

.auth-chat-icon-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.auth-chat-delete {
    border-color: rgba(0, 0, 0, 0.78);
    background: #6e3036;
}

.auth-chat-icon-clear {
    border-color: rgba(0, 0, 0, 0.78);
    background: #4f5f6b;
}

.auth-chat-empty {
    margin: 0;
    padding: 1.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    text-align: center;
}

.auth-emoji-upload-form {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.55);
}

.auth-emoji-upload-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-emoji-upload-preview {
    display: grid;
    width: 4rem;
    height: 4rem;
    flex: 0 0 4rem;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.85);
    border-radius: 6px;
    background: #35414a;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.5rem;
}

.auth-emoji-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-emoji-image-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.auth-emoji-fields {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem 0.7rem;
}

.auth-emoji-fields label {
    font-size: 0.76rem;
    font-weight: 700;
}

.auth-emoji-shortcode-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.78);
}

.auth-emoji-upload-submit {
    justify-self: end;
}

.auth-emoji-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.55rem;
}

.auth-emoji-search {
    width: min(12rem, 52%);
}

.auth-emoji-feedback {
    min-height: 1.2rem;
    margin: 0;
    padding: 0 1rem 0.45rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.72rem;
}

.auth-emoji-feedback[data-state="error"] {
    color: #ffd0d0;
}

.auth-emoji-grid {
    display: grid;
    gap: 0.35rem;
    padding: 0 1rem 1rem;
}

.auth-emoji-item {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.56);
    border-radius: 6px;
    background: rgba(39, 48, 55, 0.72);
}

.auth-emoji-item img {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
}

.auth-emoji-item-copy {
    min-width: 0;
}

.auth-emoji-item strong,
.auth-emoji-item code {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-emoji-item strong {
    font-size: 0.78rem;
}

.auth-emoji-item code {
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
}

.auth-emoji-delete {
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    border-color: rgba(0, 0, 0, 0.78);
    background: #6e3036;
    font-size: 0.7rem;
}

.auth-emoji-empty {
    margin: 0;
    padding: 1.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    text-align: center;
}

.auth-avatar-form {
    position: relative;
}

.auth-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.auth-avatar-editor {
    width: min(92vw, 25rem);
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    background: linear-gradient(180deg, #65717c, #46515b);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.34);
    color: #ffffff;
}

.auth-avatar-editor::backdrop {
    background: rgba(4, 12, 18, 0.72);
}

.auth-avatar-editor-header,
.auth-avatar-editor-controls,
.auth-avatar-editor-actions {
    display: flex;
    align-items: center;
}

.auth-avatar-editor-header {
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.72);
}

.auth-avatar-editor-header h2 {
    margin: 0;
    font-size: 1rem;
}

.auth-display-name-fields {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 0.85rem;
}

.auth-display-name-fields label {
    font-size: 0.76rem;
    font-weight: 700;
}

.auth-avatar-crop {
    position: relative;
    width: min(78vw, 19rem);
    aspect-ratio: 1;
    margin: 1rem auto;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 50%;
    background: #20272d;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12), inset 0 0 18px rgba(0, 0, 0, 0.55);
    cursor: grab;
    touch-action: none;
}

.auth-avatar-crop:active {
    cursor: grabbing;
}

.auth-avatar-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.auth-avatar-editor-controls {
    gap: 0.65rem;
    padding: 0.3rem 0.85rem 0.85rem;
}

.auth-avatar-zoom-label {
    font-size: 0.75rem;
    font-weight: 700;
}

.auth-avatar-zoom {
    min-width: 0;
    flex: 1 1 auto;
    accent-color: var(--accent);
}

.auth-icon-button {
    display: inline-grid;
    flex: 0 0 2.35rem;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.85);
    border-radius: 50%;
    background: linear-gradient(180deg, #75818c, #4d5862);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 2px 4px rgba(0, 0, 0, 0.28);
    color: #ffffff;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.auth-icon-button:hover,
.auth-icon-button:focus-visible {
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.58);
}

.ui-icon {
    display: block;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    pointer-events: none;
}

.auth-icon-button .ui-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.auth-avatar-editor-actions {
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.8rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-confirm-form {
    display: flex;
    flex-direction: column;
}

.auth-confirm-message {
    margin: 0;
    padding: 1rem 0.85rem;
    color: #ffffff;
    font-size: 0.82rem;
    line-height: 1.5;
}

.auth-user-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.auth-user-heading .text-heading {
    margin-bottom: 0.1rem;
}

.auth-avatar {
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    border: 1px solid rgba(0, 0, 0, 0.85);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 3px 8px rgba(0, 0, 0, 0.42);
    object-fit: cover;
}

.auth-avatar-fallback {
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--accent) 72%, black);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.auth-username {
    margin: 0;
    color: rgba(236, 248, 255, 0.82);
    font-size: 0.76rem;
}

.auth-details {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.auth-details > div {
    display: grid;
    grid-template-columns: minmax(4rem, 0.3fr) minmax(0, 1fr);
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-details dt {
    color: rgba(236, 248, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-details dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #ffffff;
    font-size: 0.82rem;
}

.auth-role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.45rem;
    padding: 0.15rem 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.72);
    border-radius: 3px;
    background: color-mix(in srgb, var(--accent) 78%, black);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
}

.auth-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.text-lead {
    font-size: clamp(0.88rem, 2.3vw, 1.03rem);
    line-height: 1.62;
    color: #ffffff;
}

.text-muted {
    color: rgba(236, 248, 255, 0.82);
}

.text-divider {
    margin: 0.85rem 0;
    height: 3px;
    border: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 34%),
        linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
    border-radius: 2px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.75), inset 0 -1px 1px rgba(255, 255, 255, 0.12), 0 1px 1px rgba(0, 0, 0, 0.35);
}

.text-list {
    margin: 0;
    padding-left: 1.15rem;
    color: #ecf8ff;
}

.text-list li {
    margin: 0 0 0.38rem;
    line-height: 1.48;
    font-size: clamp(0.8rem, 2vw, 0.92rem);
}

.text-list li:last-child {
    margin-bottom: 0;
}

.text-note {
    margin-top: 0.6rem;
    padding: 0.52rem 0.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    border-left: 3px solid rgba(255, 255, 255, 0.72);
    color: #ffffff;
    font-size: 0.78rem;
    line-height: 1.45;
}

/* ---- Reusable textbox styles for blade content ---- */
.textbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.textbox-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.textbox,
.textbox-multiline {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(242, 250, 255, 0.9) 100%);
    color: #103649;
    box-shadow: inset 0 1px 2px rgba(16, 54, 73, 0.14), 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 0.6rem 0.75rem;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.textbox::placeholder,
.textbox-multiline::placeholder {
    color: #5f8395;
}

.textbox:focus,
.textbox-multiline:focus {
    border-color: color-mix(in srgb, var(--accent) 72%, #ffffff);
    box-shadow: inset 0 1px 2px rgba(16, 54, 73, 0.14), 0 0 0 3px color-mix(in srgb, var(--accent) 28%, #ffffff);
    background: #ffffff;
}

.textbox {
    min-height: 2.4rem;
}

.textbox-multiline {
    min-height: 6rem;
    resize: vertical;
}

.textbox-sm {
    max-width: 16rem;
}

.textbox-lg {
    max-width: 28rem;
}

.textbox-error {
    border-color: #b84141;
    box-shadow: inset 0 1px 2px rgba(122, 22, 22, 0.18), 0 0 0 2px rgba(184, 65, 65, 0.2);
}

.textbox-help {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.92);
}

/* ---- Vertical tile list within a blade, styled as glossy Aero buttons ---- */
.tile-column {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(0.6rem, 2vw, 1rem);
    padding: clamp(0.6rem, 2vw, 0.9rem) clamp(0.75rem, 3vw, 1.2rem);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.92);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.07) 46%, rgba(255, 255, 255, 0) 100%),
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--accent) 88%, white) 0%,
            var(--accent) 52%,
            color-mix(in srgb, var(--accent) 68%, black) 100%
        );
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), inset 0 -4px 9px rgba(0, 0, 0, 0.72), inset 0 0 14px rgba(0, 0, 0, 0.42), 0 5px 14px rgba(5, 30, 45, 0.2);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile:is(a) {
    color: inherit;
    text-decoration: none;
}

.tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(8, 18, 26, 0.14) 0,
        rgba(8, 18, 26, 0.14) 1px,
        rgba(255, 255, 255, 0.1) 1px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(255, 255, 255, 0) 2px,
        rgba(255, 255, 255, 0) 20px
    );
    background-position: 0 0;
    background-attachment: scroll;
    pointer-events: none;
}

.tile:hover, .tile:focus-visible {
    transform: none;
    box-shadow:
        inset 0 4px 6px rgba(0, 0, 0, 0.68),
        inset 0 -2px 3px rgba(255, 255, 255, 0.14),
        inset 0 0 12px rgba(0, 0, 0, 0.42),
        0 1px 2px rgba(5, 30, 45, 0.12);
}

.tile-icon {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #f5fbff;
    width: 2rem;
    text-align: center;
}

.tile-service-icon {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    margin: 0 auto;
}

.tile-text {
    position: relative;
    z-index: 1;
}

.tile-title {
    font-size: clamp(0.8rem, 2.2vw, 0.95rem);
    font-weight: 700;
    color: #ffffff;
}

.tile-desc {
    font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    color: rgba(236, 248, 255, 0.9);
}

/* ---- Chat workspace ---- */
.chat-mobile-launch {
    display: none;
}

.chat-mobile-exit {
    display: none;
}

#panel-chat .blade-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 0 0 var(--content-peek);
}

.chat-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: #35414a;
    color: #f3f8fa;
}

.chat-main-header .chat-sidebar-toggle,
.chat-sidebar-header .chat-sidebar-close,
.chat-sidebar-backdrop {
    display: none;
}

.chat-main-title {
    min-width: 0;
    flex: 1 1 auto;
}

.chat-sign-in {
    width: 100%;
    padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1.25rem, 5vw, 3rem) 2rem 1.75rem;
}

.standalone-chat-page {
    background: #35414a;
}

.standalone-chat {
    position: relative;
    display: flex;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    --accent: #db4f52;
}

.standalone-chat > .chat-shell,
.standalone-chat > .chat-sign-in {
    flex: 1 1 auto;
}

.chat-sidebar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.8);
    background:
        repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 20px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.16)),
        var(--accent);
}

.chat-sidebar-header,
.chat-main-header,
.chat-composer-bar,
.chat-dialog-header,
.chat-dialog-actions {
    display: flex;
    align-items: center;
}

.chat-sidebar-header {
    min-height: 4rem;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}

.chat-sidebar-header h2,
.chat-main-header h2,
.chat-dialog h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 0;
}

.chat-kicker {
    margin: 0 0 0.15rem;
    color: rgba(235, 245, 250, 0.66);
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
}

.chat-create-actions,
.chat-composer-tools {
    display: flex;
    gap: 0.4rem;
}

.chat-create-backdrop,
.chat-group-backdrop,
.chat-room-settings-backdrop {
    position: absolute;
    z-index: 9;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(8, 14, 18, 0.66);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.chat-shell.create-wizard-open .chat-create-backdrop,
.chat-shell.group-panel-open .chat-group-backdrop,
.chat-shell.room-settings-open .chat-room-settings-backdrop {
    opacity: 1;
    visibility: visible;
}

.chat-create-wizard,
.chat-group-panel,
.chat-room-settings-panel {
    position: absolute;
    z-index: 10;
    inset: 0 auto 0 0;
    display: flex;
    width: min(92vw, 26rem);
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
    border-right: 1px solid rgba(0, 0, 0, 0.9);
    background:
        repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 20px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.16)),
        var(--accent);
    box-shadow: none;
    color: #ffffff;
    transition: transform 0.24s ease;
}

.chat-shell.create-wizard-open .chat-create-wizard,
.chat-shell.group-panel-open .chat-group-panel,
.chat-shell.room-settings-open .chat-room-settings-panel {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.48);
}

.chat-create-wizard-header {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}

.chat-create-wizard-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 0;
}

.chat-create-wizard-form {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.9rem;
}

.chat-wizard-progress {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
}

.chat-wizard-step {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}

.chat-wizard-step[hidden],
[data-chat-create-fields][hidden] {
    display: none;
}

.chat-wizard-step h3 {
    margin: 0;
    font-size: 0.88rem;
    letter-spacing: 0;
}

.chat-create-types {
    display: grid;
    gap: 0.55rem;
}

.chat-create-type {
    display: grid;
    grid-template-columns: 2.35rem minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    min-height: 4.25rem;
    padding: 0.65rem;
    border: 1px solid rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    background: rgba(38, 48, 55, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    color: #ffffff;
    text-align: left;
    cursor: pointer;
}

.chat-create-type:hover,
.chat-create-type:focus-visible {
    background: rgba(24, 33, 39, 0.82);
    outline: 2px solid rgba(255, 255, 255, 0.86);
    outline-offset: -2px;
}

.chat-create-type-icon {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.22);
    font-weight: 800;
}

.chat-create-type strong,
.chat-create-type small {
    display: block;
}

.chat-create-type strong {
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}

.chat-create-type small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.68rem;
    line-height: 1.35;
}

.chat-wizard-step-header,
.chat-wizard-actions {
    display: flex;
    align-items: center;
}

.chat-wizard-step-header {
    gap: 0.65rem;
}

[data-chat-create-fields] {
    display: grid;
    gap: 0.5rem;
}

[data-chat-create-fields] > label {
    font-size: 0.75rem;
    font-weight: 700;
}

.chat-wizard-actions {
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: auto;
}

.chat-icon-upload {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem;
    border: 1px solid rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    background: rgba(38, 48, 55, 0.58);
    cursor: pointer;
}

.chat-icon-upload:hover,
.chat-icon-upload:focus-within {
    background: rgba(24, 33, 39, 0.76);
    outline: 2px solid rgba(255, 255, 255, 0.82);
    outline-offset: -2px;
}

.chat-icon-upload strong,
.chat-icon-upload small {
    display: block;
}

.chat-icon-upload strong {
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}

.chat-icon-upload small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.68rem;
    line-height: 1.35;
}

.chat-icon-preview {
    display: grid;
    width: 4rem;
    height: 4rem;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.24);
    font-size: 1.1rem;
    font-weight: 800;
}

.chat-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-conversation-icon-input,
.chat-room-settings-icon {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.chat-room-settings-form {
    display: grid;
    min-height: 0;
    gap: 0.65rem;
    overflow-y: auto;
    padding: 0.9rem;
}

.chat-room-settings-form > label:not(.chat-icon-upload) {
    font-size: 0.75rem;
    font-weight: 700;
}

.chat-room-settings-feedback {
    min-height: 1rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.7rem;
}

.chat-room-settings-feedback[data-state="error"] {
    color: #ffd1d1;
}

.chat-room-settings-feedback[data-state="success"] {
    color: #e0ffe8;
}

.chat-room-settings-danger {
    margin-top: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(0, 0, 0, 0.5);
}

.chat-room-settings-delete {
    background: #6e3036;
}

.chat-room-settings-delete:hover,
.chat-room-settings-delete:focus-visible {
    background: #8f3e46;
}

.chat-room-settings-delete:disabled {
    opacity: 0.5;
    cursor: wait;
}

.chat-group-panel-content {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 0.9rem;
}

.chat-group-panel-content h3 {
    margin: 0 0 0.45rem;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.chat-group-member-list,
.chat-group-invite-options {
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.65);
    background: rgba(18, 29, 36, 0.34);
}

.chat-group-member-list {
    max-height: min(13rem, 30vh);
}

.chat-group-invite-options {
    max-height: min(15rem, 32vh);
}

.chat-group-member {
    display: grid;
    grid-template-columns: 1.8rem minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    min-height: 2.7rem;
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-group-member:last-child {
    border-bottom: 0;
}

.chat-group-member strong,
.chat-group-member small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-group-member strong {
    font-size: 0.76rem;
}

.chat-group-member small {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.66rem;
}

.chat-group-invite-form {
    display: grid;
    gap: 0.55rem;
}

.chat-group-invite-submit:disabled {
    opacity: 0.45;
    filter: grayscale(0.65);
    cursor: not-allowed;
}

.chat-group-feedback {
    min-height: 1rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.7rem;
}

.chat-group-feedback[data-state="error"] {
    color: #ffd1d1;
}

.chat-group-feedback[data-state="success"] {
    color: #e0ffe8;
}

.chat-group-panel-footer {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(0, 0, 0, 0.5);
}

.chat-group-leave {
    background: #6e3036;
}

.chat-group-leave:hover,
.chat-group-leave:focus-visible {
    background: #8f3e46;
}

.chat-icon-button {
    display: inline-grid;
    flex: 0 0 2.1rem;
    width: 2.1rem;
    height: 2.1rem;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.82);
    border-radius: 50%;
    background: linear-gradient(180deg, #77838d, #4f5a64);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 2px 4px rgba(0, 0, 0, 0.25);
    color: #ffffff;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.chat-icon-button:hover,
.chat-icon-button:focus-visible {
    background: color-mix(in srgb, var(--accent) 76%, #38434c);
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.chat-icon-button[aria-pressed="true"] {
    background: color-mix(in srgb, var(--accent) 68%, #303940);
    box-shadow: inset 0 4px 7px rgba(0, 0, 0, 0.68), inset 0 -1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(1px);
}

.chat-conversation-list {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.45rem;
}

.chat-conversation-list h3 {
    margin: 0.75rem 0.45rem 0.3rem;
    color: rgba(235, 245, 250, 0.62);
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.chat-conversation,
.chat-conversation-copy {
    min-width: 0;
}

.chat-conversation {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #edf6fa;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.chat-conversation:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-conversation.active {
    border-color: rgba(0, 0, 0, 0.72);
    background: color-mix(in srgb, var(--accent) 58%, #3d4851);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.46);
}

.chat-conversation-copy {
    display: grid;
    gap: 0.12rem;
    flex: 1 1 auto;
}

.chat-conversation-copy strong,
.chat-conversation-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-conversation-copy strong {
    font-size: 0.78rem;
}

.chat-conversation-copy small {
    color: rgba(235, 245, 250, 0.68);
    font-size: 0.66rem;
}

.chat-conversation-avatar,
.chat-message-avatar,
.chat-room-icon {
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.chat-conversation-avatar,
.chat-room-icon {
    width: 2rem;
    height: 2rem;
}

.chat-room-icon,
.chat-avatar-fallback {
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 0, 0, 0.76);
    background: color-mix(in srgb, var(--accent) 66%, #35414a);
    color: #ffffff;
    font-weight: 800;
}

.chat-main {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: linear-gradient(180deg, #53606a, #46515b);
}

.chat-main-header {
    min-height: 4rem;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.chat-main-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-group-manage,
.chat-room-settings {
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.78);
    border-radius: 4px;
    background: #596872;
    color: #ffffff;
    font: inherit;
    font-size: 0.66rem;
    cursor: pointer;
}

.chat-group-manage:hover,
.chat-group-manage:focus-visible,
.chat-room-settings:hover,
.chat-room-settings:focus-visible {
    background: color-mix(in srgb, var(--accent) 66%, #35414a);
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}

.chat-connection {
    color: rgba(235, 245, 250, 0.66);
    font-size: 0.67rem;
}

.chat-connection::before {
    content: "";
    display: inline-block;
    width: 0.48rem;
    height: 0.48rem;
    margin-right: 0.35rem;
    border-radius: 50%;
    background: #d39a3c;
    box-shadow: 0 0 5px rgba(211, 154, 60, 0.7);
}

.chat-connection.connected::before {
    background: #55cf77;
    box-shadow: 0 0 5px rgba(85, 207, 119, 0.8);
}

.chat-messages {
    min-height: 0;
    overflow-y: auto;
    padding: 0.9rem;
    scroll-behavior: smooth;
}

.chat-empty-state,
.chat-loading {
    margin: 1.5rem auto;
    color: rgba(235, 245, 250, 0.7);
    font-size: 0.78rem;
    text-align: center;
}

.chat-message {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.6rem;
    padding: 0.55rem 0;
}

.chat-message + .chat-message {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-message-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(0, 0, 0, 0.75);
}

.chat-message-content {
    min-width: 0;
}

.chat-message-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.chat-message-meta strong {
    color: #ffffff;
    font-size: 0.78rem;
}

.chat-message-meta time {
    color: rgba(235, 245, 250, 0.55);
    font-size: 0.62rem;
}

.chat-message-delete {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(235, 245, 250, 0.55);
    font: inherit;
    font-size: 0.62rem;
    cursor: pointer;
}

.chat-message-delete:hover,
.chat-message-delete:focus-visible {
    color: #ffffff;
    text-decoration: underline;
    outline: none;
}

.chat-message-delete:disabled {
    opacity: 0.5;
    cursor: wait;
}

.chat-message-hard-delete {
    color: #ffb8b8;
}

.chat-message-soft-delete + .chat-message-hard-delete {
    margin-left: 0;
}

.chat-message-content p {
    margin: 0.2rem 0 0;
    overflow-wrap: anywhere;
    color: #f0f7fa;
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.chat-inline-emoji {
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    margin: 0 0.08em;
    object-fit: contain;
    vertical-align: -0.28em;
}

.chat-message-emoji-only {
    font-size: 3.2em !important;
    line-height: 1.15 !important;
    letter-spacing: -0.12em;
}

.chat-message-emoji-only .chat-inline-emoji {
    width: 1em;
    height: 1em;
    margin: 0 -0.12em 0 0;
    vertical-align: -0.12em;
}

.chat-message-content .chat-message-tombstone {
    color: rgba(235, 245, 250, 0.52);
    font-style: italic;
}

.chat-message-deleted-indicator {
    padding: 0.05rem 0.3rem;
    border: 1px solid rgba(255, 190, 190, 0.42);
    border-radius: 3px;
    color: #ffc6c6;
    font-size: 0.58rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.chat-message.deleted .chat-message-content > p,
.chat-message.deleted .chat-message-image-link {
    opacity: 0.72;
}

.chat-message.hard-deleted .chat-message-deleted-indicator {
    border-color: rgba(255, 150, 150, 0.68);
    color: #ffadad;
}

.chat-message-image-link {
    display: block;
    width: fit-content;
    max-width: min(100%, 28rem);
    margin-top: 0.45rem;
}

.chat-message-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 22rem;
    border: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 6px;
    object-fit: contain;
    background: #263038;
}

.chat-composer {
    position: relative;
    padding: 0.65rem;
    border-top: 1px solid rgba(0, 0, 0, 0.78);
    background: #3d4851;
}

.chat-message-input {
    display: block;
    width: 100%;
    min-height: 2.7rem;
    max-height: 8rem;
    resize: vertical;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.82);
    border-radius: 6px;
    background: #f6fbfd;
    color: #173746;
    font: inherit;
    font-size: 0.82rem;
}

.chat-message-input:focus {
    outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
    outline-offset: 1px;
}

.chat-composer-bar {
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.chat-compose-status {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: #ffd9d9;
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-send {
    min-height: 2.1rem;
    padding: 0.4rem 0.8rem;
}

.chat-send:disabled,
.chat-message-input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.chat-image-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.chat-image-preview {
    position: relative;
    width: 5rem;
    margin-bottom: 0.5rem;
}

.chat-image-preview > img {
    display: block;
    width: 5rem;
    height: 4rem;
    border: 1px solid rgba(0, 0, 0, 0.82);
    border-radius: 5px;
    object-fit: cover;
}

.chat-image-preview .chat-remove-image {
    position: absolute;
    top: -0.55rem;
    right: -0.55rem;
    width: 1.55rem;
    height: 1.55rem;
    font-size: 0.9rem;
}

.chat-emoji-picker {
    position: absolute;
    z-index: 4;
    bottom: calc(100% + 0.35rem);
    left: 0.65rem;
    display: block;
    width: min(22rem, calc(100% - 1.3rem));
    height: min(25rem, 58vh);
    --background: #f3f7f9;
    --border-color: #27323a;
    --border-radius: 6px;
    --button-active-background: #c9d7de;
    --button-hover-background: #dce6ea;
    --category-font-color: #29414d;
    --indicator-color: #b33d43;
    --input-border-color: #738995;
    --input-font-color: #173746;
    --input-placeholder-color: #647d89;
    --num-columns: 8;
    --outline-color: #b33d43;
    --emoji-size: 2rem;
    --emoji-padding: 0.35rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.chat-emoji-picker[hidden] {
    display: none;
}

.chat-dialog {
    width: min(92vw, 24rem);
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    background: linear-gradient(180deg, #65717c, #46515b);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58);
    color: #ffffff;
}

.chat-dialog::backdrop {
    background: rgba(4, 12, 18, 0.72);
}

.chat-dialog-form {
    display: grid;
    gap: 0.65rem;
    padding: 0.9rem;
}

.chat-dialog-header {
    justify-content: space-between;
    margin: -0.2rem 0 0.2rem;
}

.chat-dialog-form > label {
    font-size: 0.75rem;
    font-weight: 700;
}

.chat-member-picker {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.chat-member-picker legend {
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.chat-member-options {
    max-height: min(15rem, 38vh);
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.65);
    background: rgba(18, 29, 36, 0.34);
}

.chat-member-option {
    display: grid;
    grid-template-columns: auto 1.8rem minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    min-height: 2.7rem;
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 0.76rem;
}

.chat-member-option:last-child {
    border-bottom: 0;
}

.chat-member-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chat-member-option input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--accent);
}

.chat-member-option > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-member-avatar {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    object-fit: cover;
}

.chat-member-empty {
    margin: 0;
    padding: 0.75rem;
    color: rgba(235, 245, 250, 0.7);
    font-size: 0.74rem;
}

.chat-dialog-help,
.chat-dialog-error {
    min-height: 1rem;
    margin: 0;
    font-size: 0.7rem;
}

.chat-dialog-help {
    color: rgba(235, 245, 250, 0.7);
}

.chat-dialog-error {
    color: #ffd1d1;
}

.chat-dialog-actions {
    justify-content: flex-end;
    gap: 0.6rem;
}

.chat-confirm-dialog {
    width: min(92vw, 27rem);
}

.chat-confirm-message {
    margin: 0;
    color: rgba(244, 250, 252, 0.9);
    font-size: 0.82rem;
    line-height: 1.55;
}

.chat-confirm-submit {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.03)),
        #8d343a;
}

.chat-toast {
    position: fixed;
    z-index: 20;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    width: min(22rem, calc(100vw - 2rem));
    grid-template-columns: 2.4rem minmax(0, 1fr) 1rem;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem;
    border: 1px solid rgba(0, 0, 0, 0.92);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 48%),
        #47545e;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 28px rgba(0, 0, 0, 0.42);
    color: #ffffff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    opacity: 0;
    transform: translateY(0.75rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-toast[hidden] {
    display: none;
}

.chat-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-toast:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

.chat-toast-avatar {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border: 1px solid rgba(0, 0, 0, 0.76);
    border-radius: 50%;
    background: #b33d43;
    font-size: 0.85rem;
    font-weight: 800;
}

.chat-toast-copy {
    display: grid;
    min-width: 0;
    gap: 0.16rem;
}

.chat-toast-copy strong,
.chat-toast-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-toast-copy strong {
    font-size: 0.76rem;
}

.chat-toast-copy small {
    color: rgba(239, 247, 250, 0.78);
    font-size: 0.7rem;
}

.chat-toast-close {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* ---- Mobile: shrink the spine further and tighten spacing ---- */
@media (max-width: 600px) {
    :root {
        --mobile-spine-h: 42px;
        --mobile-badge-art-w: 240px;
        --mobile-badge-overhang: calc(var(--badge-art-w) - var(--mobile-spine-h));
        --content-peek: 0px;
        --active-h: calc(100dvh - (var(--mobile-spine-h) * 4));
    }

    #bladeViewport {
        flex-direction: column;
    }

    .blade-panel,
    .blade-panel.active {
        width: 100%;
    }

    .blade-panel {
        flex-direction: column;
        height: var(--mobile-spine-h);
        transition: background 0.45s linear, box-shadow 0.45s linear;
    }

    .blade-panel.active {
        height: var(--active-h, 300px);
    }

    .blade-spine {
        flex: 0 0 var(--badge-art-w);
        width: 100%;
        height: var(--badge-art-w);
        flex-direction: row;
        align-items: flex-start;
        padding: 0;
        background-color: #5a6570;
        background-image:
            repeating-linear-gradient(
                to right,
                rgba(8, 18, 26, 0.2) 0,
                rgba(8, 18, 26, 0.2) 1px,
                rgba(255, 255, 255, 0.14) 1px,
                rgba(255, 255, 255, 0.14) 2px,
                transparent 2px,
                transparent 20px
            ),
            linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.12) 48%, rgba(0, 0, 0, 0.18));
    }

    .blade-panel:not(.active) .blade-spine {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46), inset 0 -2px 0 rgba(0, 0, 0, 0.5);
    }

    .blade-spine::after {
        display: block;
        top: 0;
        right: auto;
        bottom: auto;
        left: var(--mobile-badge-art-w);
        width: var(--badge-art-w);
        height: 100vw;
        background-color: var(--badge-base, var(--accent));
        background-image: url("../img/badge-grayscale_repeat.png");
        background-position: top right;
        background-size: var(--badge-art-w) auto;
        background-repeat: repeat-y;
        background-blend-mode: hard-light;
        transform: translateX(100vw) rotate(90deg);
        transform-origin: top left;
    }

    .blade-badge::before,
    .blade-badge-image {
        display: block;
        top: 0;
        right: auto;
        left: 0;
        width: var(--badge-art-w);
        height: var(--mobile-badge-art-w);
        transform: rotate(90deg) scaleY(-1);
        transform-origin: top left;
    }

    .blade-badge {
        width: 100%;
        height: var(--mobile-spine-h);
        flex-direction: row;
        align-items: center;
        margin: 0;
        padding: 0 0.9rem 0 3.5rem;
    }

    .blade-panel:not(.active) .blade-badge {
        clip-path: inset(0 0 3px 0);
    }

    .blade-label {
        writing-mode: horizontal-tb;
        transform: none;
        margin: 0;
        font-size: 0.912rem;
        letter-spacing: 0;
    }

    .blade-body {
        width: 100%;
        height: calc(var(--active-h, 300px) - var(--badge-art-w));
        flex: 0 0 auto;
    }

    .blade-divider {
        top: calc(var(--mobile-spine-h) + var(--mobile-badge-overhang) - 3px);
        right: 0;
        bottom: auto;
        left: 0;
        width: 100%;
        height: 3px;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.88) 0 2px, rgba(255, 255, 255, 0.24) 2px 3px);
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.65);
    }

    .blade-panel:not(.active) .blade-divider {
        top: calc(var(--mobile-spine-h) - 3px);
    }

    .blade-content {
        padding: 0.75rem;
    }

    #panel-chat .blade-content {
        padding: 0;
    }

    #panel-chat .chat-shell,
    #panel-chat .chat-sign-in {
        display: none;
    }

    #panel-chat .chat-mobile-launch {
        display: grid;
        flex: 1 1 auto;
        width: 100%;
        height: 100%;
        place-items: center;
        padding: 1rem;
        background:
            repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 20px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.16)),
            var(--accent);
    }

    .chat-mobile-launch-button {
        gap: 0.45rem;
    }

    .blade-title {
        margin-bottom: 0.65rem;
        font-size: 1.3rem;
    }

    .tile-column {
        gap: 0.6rem;
    }

    .chat-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
        min-height: 0;
    }

    .chat-sidebar {
        position: absolute;
        z-index: 7;
        inset: 0 auto 0 0;
        width: min(82vw, 20rem);
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        border-right: 1px solid rgba(0, 0, 0, 0.9);
        border-bottom: 0;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.42);
    }

    .chat-shell.sidebar-open .chat-sidebar {
        transform: translateX(0);
    }

    .chat-sidebar-backdrop {
        position: absolute;
        z-index: 6;
        inset: 0;
        display: block;
        border: 0;
        background: rgba(8, 14, 18, 0.62);
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .chat-shell.sidebar-open .chat-sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .chat-sidebar-header {
        min-height: 3rem;
        padding: 0.4rem 0.55rem;
    }

    .chat-sidebar-header h2 {
        font-size: 0.82rem;
    }

    .chat-sidebar-header .chat-sidebar-close,
    .chat-main-header .chat-sidebar-toggle {
        display: inline-grid;
    }

    body.mobile-chat-active {
        overscroll-behavior: none;
    }

    body.mobile-chat-active #panel-chat {
        background:
            repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 20px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.16)),
            #db4f52;
    }

    body.mobile-chat-active #panel-chat::before {
        display: none;
    }

    body.mobile-chat-active #panel-chat .blade-body {
        position: fixed;
        z-index: 100;
        inset: 0;
        width: 100%;
        height: 100dvh;
        overflow: hidden;
        background: #35414a;
        box-shadow: none;
        transform: translate3d(-100%, 0, 0);
        transition: none;
    }

    body.mobile-chat-active.mobile-chat-animating #panel-chat .blade-body {
        transition: transform 0.28s ease;
    }

    body.mobile-chat-active.mobile-chat-open #panel-chat .blade-body {
        transform: translate3d(0, 0, 0);
    }

    body.mobile-chat-active #panel-chat .chat-mobile-launch {
        display: none;
    }

    body.mobile-chat-active #panel-chat .blade-content {
        width: 100%;
        height: 100%;
        flex: 1 1 auto;
    }

    body.mobile-chat-active #panel-chat .chat-shell,
    body.mobile-chat-active #panel-chat .chat-sign-in {
        display: grid;
    }

    body.mobile-chat-active #panel-chat .chat-mobile-exit {
        display: block;
        padding: 0.55rem;
        border-top: 1px solid rgba(0, 0, 0, 0.7);
    }

    .chat-mobile-close {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
    }

    .chat-conversation-list {
        display: block;
        min-height: 0;
        flex: 1 1 auto;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 0.45rem;
    }

    .chat-conversation-list h3 {
        display: block;
    }

    .chat-conversation {
        width: 100%;
        padding: 0.5rem;
    }

    .chat-main-header {
        min-height: 3.1rem;
        justify-content: flex-start;
        padding: 0.45rem 0.6rem;
    }

    .chat-messages {
        padding: 0.55rem;
    }

    .chat-composer {
        padding: 0.5rem;
    }

    .chat-emoji-picker {
        left: 0.5rem;
        width: calc(100% - 1rem);
        height: min(22rem, 52vh);
        --emoji-size: 1.75rem;
        --category-emoji-size: 1.125rem;
        --emoji-padding: 0.4rem;
        --num-columns: 6;
    }

    .chat-message-image {
        max-height: 13rem;
    }

    #panel-mybigsafford.chat-manager-open .blade-body,
    #panel-mybigsafford.emoji-manager-open .blade-body,
    #panel-mybigsafford.user-manager-open .blade-body {
        position: fixed;
        z-index: 100;
        inset: 0;
        width: 100%;
        height: 100dvh;
        overflow: hidden;
        background: #35414a;
        box-shadow: none;
    }

    #panel-mybigsafford.chat-manager-open .blade-content,
    #panel-mybigsafford.emoji-manager-open .blade-content,
    #panel-mybigsafford.user-manager-open .blade-content {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .auth-chat-manager-backdrop,
    .auth-emoji-manager-backdrop,
    .auth-user-manager-backdrop {
        position: fixed;
        z-index: 109;
        inset: 0;
    }

    .auth-chat-manager,
    .auth-emoji-manager,
    .auth-user-manager {
        position: fixed;
        z-index: 110;
        inset: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        border-left: 0;
        box-shadow: none;
    }

    #panel-mybigsafford.chat-manager-open .auth-chat-manager,
    #panel-mybigsafford.emoji-manager-open .auth-emoji-manager,
    #panel-mybigsafford.user-manager-open .auth-user-manager {
        box-shadow: none;
    }
}

