:root {
  --chat-rail: #09151b;
  --chat-canvas: #0b171d;
  --chat-elevated: #102129;
  --chat-border: rgba(185, 153, 83, .19);
  --chat-cool-border: rgba(129, 183, 189, .14);
}

html:has(.chat-page) { overflow: hidden; }
.chat-page { min-height: 100dvh; overflow: hidden; background: #071017; }
.chat-page svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-page button { border: 0; }
.chat-page .card-kicker { margin: 0; color: var(--gold); font-size: 9px; font-weight: 850; letter-spacing: .18em; }

.chat-loading, .chat-error { position: fixed; z-index: 100; inset: 0; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; background: radial-gradient(circle at 50% 39%, rgba(54, 119, 125, .2), transparent 25%), #071017; }
.chat-loading::before, .chat-error::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .36; background-image: radial-gradient(circle, rgba(222, 235, 213, .65) 0 1px, transparent 1.3px); background-size: 79px 79px; mask-image: linear-gradient(to bottom, black, transparent 75%); }
.chat-loading > *, .chat-error > * { position: relative; }
.chat-loading img, .chat-error img { margin-bottom: 17px; border: 1px solid rgba(217, 185, 110, .28); border-radius: 50%; box-shadow: 0 0 42px rgba(96, 176, 181, .13); }
.chat-loading strong { margin-top: 8px; color: #dfe8e3; font: 400 20px var(--serif); }
.chat-loading img { animation: chat-breathe 2.5s ease-in-out infinite; }
.chat-error { align-content: center; }
.chat-error h1 { max-width: 520px; margin: 12px 0 4px; font: 400 clamp(31px, 5vw, 48px)/1.05 var(--serif); }
.chat-error > p:not(.card-kicker) { max-width: 510px; margin: 10px 0 24px; color: var(--muted); line-height: 1.65; }

@keyframes chat-breathe { 50% { transform: translateY(-4px); filter: brightness(1.12); } }

.chat-app { height: 100dvh; display: grid; grid-template-rows: 68px minmax(0, 1fr); background: var(--chat-canvas); }
.chat-topbar { position: relative; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 0 18px; border-bottom: 1px solid var(--chat-border); background: rgba(7, 16, 22, .97); box-shadow: 0 12px 40px rgba(0, 0, 0, .18); }
.chat-brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; text-decoration: none; }
.chat-brand img { border-radius: 50%; border: 1px solid rgba(217, 185, 110, .32); box-shadow: 0 0 24px rgba(111, 182, 184, .11); }
.chat-brand span { display: grid; gap: 1px; }
.chat-brand small { color: var(--gold); font-size: 7px; font-weight: 850; letter-spacing: .22em; }
.chat-brand strong { color: #f2f2eb; font: 400 18px var(--serif); }
.chat-site-nav { justify-content: center; margin: 0 auto; gap: clamp(10px, 1.7vw, 24px); }
.chat-topbar-actions { display: flex; align-items: center; gap: 8px; }
.chat-icon-button, .chat-install { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--chat-cool-border) !important; border-radius: 9px; color: #a8bbba; background: rgba(130, 181, 190, .05); text-decoration: none; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.chat-icon-button:hover, .chat-install:hover { color: var(--gold-bright); border-color: rgba(217, 185, 110, .34) !important; background: rgba(217, 185, 110, .06); }
.chat-install { display: flex; width: auto; gap: 8px; padding: 0 13px; color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.chat-install svg { width: 18px; height: 18px; }
.bridge-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 11px; border: 1px solid rgba(217, 185, 110, .18); border-radius: 999px; color: #ad9f7d; background: rgba(217, 185, 110, .04); font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.bridge-pill i { width: 6px; height: 6px; border-radius: 50%; background: #b4934c; box-shadow: 0 0 0 4px rgba(180, 147, 76, .09); }
.bridge-pill.is-ready { color: #9ad9b7; border-color: rgba(115, 201, 154, .24); }
.bridge-pill.is-ready i { background: var(--green); box-shadow: 0 0 0 4px rgba(115, 201, 154, .11); }

.chat-layout { position: relative; display: grid; grid-template-columns: 292px minmax(390px, 1fr) 310px; min-height: 0; }
.persona-rail, .chat-details { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(217, 185, 110, .2) transparent; }
.persona-rail { position: relative; z-index: 20; display: flex; flex-direction: column; border-right: 1px solid var(--chat-border); background: linear-gradient(180deg, rgba(10, 25, 31, .98), rgba(7, 16, 21, .99)); }
.active-persona { padding: 21px 17px 16px; border-bottom: 1px solid var(--chat-cool-border); }
.rail-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: #77898a; font-size: 8px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.rail-section-heading small { color: #657778; font-size: 8px; }
.persona-card { position: relative; display: flex; align-items: center; gap: 11px; min-height: 71px; padding: 11px; overflow: hidden; border: 1px solid rgba(217, 185, 110, .24); border-radius: 12px; background: radial-gradient(circle at 88% 18%, rgba(104, 185, 187, .14), transparent 30%), linear-gradient(135deg, rgba(217, 185, 110, .08), rgba(12, 29, 35, .85)); }
.persona-card::after { content: ""; position: absolute; width: 70px; height: 70px; right: -29px; bottom: -37px; border: 1px solid rgba(217, 185, 110, .12); transform: rotate(45deg); }
.character-avatar { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(217, 185, 110, .31); border-radius: 50%; color: var(--gold-bright); background: #0c1b21; font: 500 17px var(--serif); box-shadow: inset 0 0 18px rgba(123, 188, 192, .09); }
.character-avatar i { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border: 2px solid #102027; border-radius: 50%; background: #627173; }
.character-avatar i.online { background: var(--green); box-shadow: 0 0 8px rgba(115, 201, 154, .6); }
.character-copy { position: relative; z-index: 1; display: grid; min-width: 0; gap: 3px; }
.character-copy strong { overflow: hidden; color: #f2f2eb; font: 500 16px var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.character-copy small { overflow: hidden; color: #819393; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.realm-token { display: inline-flex; align-items: center; justify-self: start; padding: 4px 6px; border: 1px solid rgba(123, 188, 192, .18); border-radius: 4px; color: #8bc6c4; background: rgba(123, 188, 192, .05); font-size: 7px !important; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.realm-token.canopy { color: var(--gold); border-color: rgba(217, 185, 110, .2); background: rgba(217, 185, 110, .05); }
.persona-empty { color: var(--muted); font-size: 11px; line-height: 1.45; }

.character-switcher { padding: 17px 12px 13px; border-bottom: 1px solid var(--chat-cool-border); }
.character-switcher .rail-section-heading { padding: 0 5px; }
.realm-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 0 4px 10px; padding: 3px; border: 1px solid var(--chat-cool-border); border-radius: 9px; background: rgba(4, 11, 15, .48); }
.realm-filter button { min-width: 0; padding: 8px 5px; border-radius: 6px; color: #738889; background: transparent; font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.realm-filter button.active { color: var(--gold-bright); background: rgba(217, 185, 110, .09); box-shadow: inset 0 0 0 1px rgba(217, 185, 110, .13); }
.character-list { display: grid; gap: 3px; max-height: 184px; overflow-y: auto; }
.character-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 9px; color: inherit; background: transparent; text-align: left; cursor: pointer; transition: background .18s; }
.character-row:hover { background: rgba(130, 181, 190, .06); }
.character-row.active { background: rgba(217, 185, 110, .075); box-shadow: inset 0 0 0 1px rgba(217, 185, 110, .13); }
.character-row .character-avatar { width: 34px; height: 34px; font-size: 13px; }
.character-row .character-copy { flex: 1; }
.character-row .character-copy strong { font: 600 12px var(--sans); }
.character-row .character-copy small { font-size: 8px; }
.character-level { color: #6f8383; font-size: 8px; font-weight: 800; }
.character-empty { padding: 13px 8px; color: #778889; font: 11px/1.5 var(--serif); }

.chat-destinations { display: grid; gap: 3px; padding: 16px 12px; }
.chat-player-links { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 13px 12px; border-top: 1px solid var(--chat-cool-border); }
.chat-player-links a { padding: 8px 6px; border: 1px solid var(--chat-cool-border); border-radius: 7px; color: #819394; font-size: 7px; font-weight: 800; letter-spacing: .06em; text-align: center; text-decoration: none; text-transform: uppercase; }
.chat-player-links a:hover { color: var(--gold-bright); border-color: rgba(217, 185, 110, .25); }
.rail-nav-label { padding: 0 5px 7px; color: #607375; font-size: 8px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.destination { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 54px; padding: 8px 10px; border-radius: 10px; color: #73888a; background: transparent; text-align: left; cursor: pointer; transition: color .18s, background .18s; }
.destination svg { flex: 0 0 auto; width: 20px; height: 20px; }
.destination > span { display: grid; min-width: 0; gap: 3px; }
.destination strong { color: #b9c4c1; font-size: 11px; font-weight: 720; }
.destination small { overflow: hidden; color: #607374; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.destination:hover { color: var(--teal-bright); background: rgba(130, 181, 190, .045); }
.destination.active { color: var(--gold-bright); background: linear-gradient(90deg, rgba(217, 185, 110, .1), rgba(217, 185, 110, .025)); box-shadow: inset 2px 0 var(--gold); }
.destination.active strong { color: #f0ead9; }
.rail-account { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 14px 17px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--chat-cool-border); background: rgba(4, 11, 15, .24); }
.rail-account span { display: grid; gap: 3px; min-width: 0; }
.rail-account small { color: #607274; font-size: 7px; font-weight: 850; letter-spacing: .15em; }
.rail-account strong { overflow: hidden; color: #c7d0cd; font-size: 10px; text-overflow: ellipsis; }
.rail-account a { color: var(--gold); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }

.conversation { position: relative; display: grid; grid-template-rows: 73px minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(circle at 50% 30%, rgba(29, 76, 81, .1), transparent 35%), linear-gradient(180deg, #0b171d, #091419); }
.conversation::before { content: ""; position: absolute; inset: 73px 0 0; pointer-events: none; opacity: .12; background-image: radial-gradient(circle, rgba(220, 229, 215, .5) 0 .7px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(to bottom, black, transparent 70%); }
.conversation-header { position: relative; z-index: 2; display: flex; align-items: center; gap: 13px; padding: 0 22px; border-bottom: 1px solid var(--chat-cool-border); background: rgba(10, 23, 29, .84); backdrop-filter: blur(14px); }
.conversation-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(217, 185, 110, .25); border-radius: 11px; color: var(--gold-bright); background: rgba(217, 185, 110, .07); font: 600 14px var(--serif); }
.conversation-header > div:nth-child(2) { min-width: 0; }
.conversation-header h1 { margin: 3px 0 0; overflow: hidden; color: #f1f2ea; font: 400 18px var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.conversation-actions { margin-left: auto; }
.message-stream { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 25px clamp(18px, 4vw, 54px); }
.message-day { display: flex; align-items: center; gap: 12px; margin: 4px 0 25px; color: #607172; font-size: 7px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.message-day::before, .message-day::after { content: ""; flex: 1; height: 1px; background: var(--chat-cool-border); }
.system-message { width: min(590px, 100%); margin: auto; padding: clamp(24px, 4vw, 38px); border: 1px solid var(--chat-border); border-radius: 18px; text-align: center; background: radial-gradient(circle at 50% 0, rgba(123, 188, 192, .11), transparent 38%), rgba(8, 20, 25, .88); box-shadow: 0 24px 70px rgba(0, 0, 0, .2); }
.system-rune { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 16px; border: 1px solid rgba(217, 185, 110, .28); border-radius: 50%; color: var(--gold-bright); background: rgba(217, 185, 110, .06); font: 21px var(--serif); }
.system-message h2 { margin: 0 0 8px; color: #eef1e8; font: 400 clamp(23px, 3vw, 31px)/1.15 var(--serif); }
.system-message > p { max-width: 480px; margin: 0 auto; color: #829293; font: 12px/1.7 var(--serif); }
.delivery-path { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 8px; max-width: 420px; margin: 25px auto 0; }
.delivery-node { display: grid; place-items: center; min-height: 58px; padding: 8px; border: 1px solid var(--chat-cool-border); border-radius: 10px; color: #9eafad; background: rgba(130, 181, 190, .035); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.delivery-node.is-ready { color: #9dd9bd; border-color: rgba(115, 201, 154, .22); background: rgba(115, 201, 154, .045); }
.delivery-node.is-pending { color: #a39168; border-color: rgba(217, 185, 110, .18); }
.delivery-arrow { color: #506365; font-size: 15px; }

.chat-empty { width: min(530px, 100%); margin: auto; padding: 28px; border: 1px solid var(--chat-cool-border); border-radius: 16px; color: #849596; background: rgba(8, 20, 25, .7); text-align: center; font: 12px/1.65 var(--serif); }
.chat-empty strong { display: block; margin-bottom: 7px; color: #e3e8df; font: 400 23px var(--serif); }
.chat-message { display: grid; grid-template-columns: 36px minmax(0, 610px); gap: 10px; align-self: flex-start; width: min(680px, 94%); margin: 7px 0; }
.chat-message.mine { grid-template-columns: minmax(0, 610px) 36px; align-self: flex-end; justify-content: end; }
.chat-message-avatar { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(130, 181, 190, .2); border-radius: 50%; color: #91c4c4; background: #10242b; font: 500 12px var(--serif); }
.chat-message.mine .chat-message-avatar { grid-column: 2; color: var(--gold-bright); border-color: rgba(217, 185, 110, .25); }
.chat-bubble { min-width: 0; padding: 10px 13px; border: 1px solid var(--chat-cool-border); border-radius: 4px 13px 13px; background: rgba(15, 35, 42, .88); }
.chat-message.mine .chat-bubble { grid-column: 1; grid-row: 1; border-color: rgba(217, 185, 110, .18); border-radius: 13px 4px 13px 13px; background: rgba(65, 55, 31, .24); }
.chat-message-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.chat-message-head strong { color: #dce7e2; font-size: 10px; }
.chat-message-head time { flex: 0 0 auto; color: #5f7475; font-size: 7px; }
.chat-bubble p { margin: 0; overflow-wrap: anywhere; color: #bfcac6; font: 12px/1.5 var(--serif); white-space: pre-wrap; }
.chat-message-meta { display: block; margin-top: 5px; color: #66797a; font-size: 7px; text-align: right; text-transform: capitalize; }
.chat-message-meta.failed { color: #d8877c; }

.chat-composer { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 42px; gap: 9px; padding: 13px clamp(14px, 3vw, 28px) calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid var(--chat-cool-border); background: rgba(7, 16, 21, .94); }
.whisper-recipient { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(120px, 250px) 1fr; align-items: center; gap: 9px; }
.whisper-recipient > span { color: var(--gold); font-size: 8px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.whisper-recipient input { min-height: 34px; padding: 7px 10px; border: 1px solid rgba(130, 181, 190, .16); border-radius: 8px; color: #dce5e1; background: rgba(16, 33, 40, .7); }
.whisper-recipient i { color: #647778; font-size: 8px; font-style: normal; }
.chat-composer textarea { width: 100%; min-height: 44px; max-height: 120px; padding: 13px 15px; resize: none; border: 1px solid rgba(130, 181, 190, .14); border-radius: 11px; color: #dce5e1; background: rgba(16, 33, 40, .7); line-height: 1.45; }
.chat-composer textarea:disabled { color: #687a7a; opacity: 1; cursor: not-allowed; }
.chat-composer > button { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; color: #6b7e7f; background: rgba(217, 185, 110, .08); }
.chat-composer > button:not(:disabled) { color: #111; background: var(--gold); cursor: pointer; }
.chat-composer small { grid-column: 1 / -1; display: flex; justify-content: space-between; color: #596c6d; font-size: 7px; letter-spacing: .08em; }
.composer-status { grid-column: 1 / -1; margin: 0; color: #d8877c; font-size: 9px; }

.chat-details { padding: 30px 24px; border-left: 1px solid var(--chat-border); background: linear-gradient(180deg, #0c1b22, #081218); }
.details-crest { position: relative; display: grid; place-items: center; width: 112px; margin: 2px auto 21px; }
.details-crest img { border: 1px solid rgba(217, 185, 110, .28); border-radius: 50%; box-shadow: 0 0 45px rgba(96, 174, 179, .12); }
.preview-seal { position: absolute; right: -3px; bottom: -5px; padding: 5px 7px; border: 1px solid rgba(217, 185, 110, .33); border-radius: 5px; color: var(--gold-bright); background: #0c1a20; font-size: 7px; font-weight: 900; letter-spacing: .13em; }
.chat-details h2 { margin: 10px 0; color: #edf0e8; font: 400 25px/1.2 var(--serif); }
.chat-details > p:not(.card-kicker) { margin: 0; color: #829293; font: 11px/1.7 var(--serif); }
.bridge-checklist { margin: 24px 0; border-top: 1px solid var(--chat-cool-border); }
.bridge-checklist div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--chat-cool-border); }
.bridge-checklist dt { color: #8d9d9b; font-size: 9px; }
.bridge-checklist dd { margin: 0; color: #a99870; font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.bridge-checklist dd.is-ready { color: #8dd0ae; }
.bridge-checklist dd.is-soon { color: #8bc6c4; }
.discord-link-panel { display: grid; gap: 10px; margin: -8px 0 18px; padding: 13px; border: 1px solid rgba(115, 137, 218, .25); border-radius: 11px; background: rgba(88, 101, 242, .055); }
.discord-link-heading { display: flex; align-items: center; gap: 10px; }
.discord-link-heading img { flex: 0 0 auto; border-radius: 9px; }
.discord-link-heading p { display: grid; gap: 3px; margin: 0; }
.discord-link-heading strong { color: #dfe3ef; font-size: 10px; }
.discord-link-heading span { color: #87949c; font: 9px/1.45 var(--serif); }
.discord-link-panel button, .discord-link-panel a { min-height: 34px; padding: 8px 10px; border: 1px solid rgba(115, 137, 218, .24); border-radius: 7px; color: #c9d0f2; background: rgba(88, 101, 242, .12); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-align: center; text-decoration: none; text-transform: uppercase; cursor: pointer; }
.discord-link-panel button:hover, .discord-link-panel a:hover { border-color: rgba(147, 160, 236, .48); background: rgba(88, 101, 242, .2); }
.discord-link-panel button:disabled { opacity: .48; cursor: wait; }
.discord-identities { display: grid; gap: 7px; padding-top: 3px; }
.discord-identities label { display: grid; gap: 5px; color: #7f9096; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.discord-identities select { width: 100%; padding: 8px; border: 1px solid var(--chat-cool-border); border-radius: 7px; color: #d8e0dc; background: #0a181e; font: 10px var(--sans); }
.discord-link-actions { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.discord-link-actions button { color: #cf9993; background: rgba(190, 86, 79, .06); }
.discord-feedback { margin: 0; color: #91c8c3; font: 9px/1.5 var(--serif); }
.discord-feedback.is-error { color: #d8877c; }
.details-note { display: flex; gap: 10px; padding: 13px; border: 1px solid rgba(217, 185, 110, .16); border-radius: 10px; background: rgba(217, 185, 110, .035); }
.details-note svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--gold); }
.details-note p { display: grid; gap: 4px; margin: 0; }
.details-note strong { color: #c9c3af; font-size: 9px; }
.details-note span { color: #77898a; font: 9px/1.5 var(--serif); }

.mobile-chat-nav, .mobile-only, .persona-backdrop { display: none; }

@media (max-width: 1120px) {
  .chat-site-nav { display: none; }
  .chat-layout { grid-template-columns: 274px minmax(370px, 1fr); }
  .chat-details { position: absolute; z-index: 15; top: 0; right: 0; bottom: 0; width: 310px; transform: translateX(102%); box-shadow: -28px 0 70px rgba(0, 0, 0, .32); transition: transform .25s ease; }
  .details-open .chat-details { transform: translateX(0); }
}

@media (max-width: 720px) {
  html:has(.chat-page), .chat-page { overflow: hidden; }
  .chat-app { grid-template-rows: calc(58px + env(safe-area-inset-top)) minmax(0, 1fr); }
  .chat-topbar { padding: env(safe-area-inset-top) 10px 0; }
  .chat-brand { margin-right: auto; margin-left: 9px; }
  .chat-brand img { width: 36px; height: 36px; }
  .chat-brand small { font-size: 6px; }
  .chat-brand strong { font-size: 16px; }
  .bridge-pill, .chat-install span { display: none; }
  .chat-install { width: 38px; padding: 0; }
  .mobile-only { display: grid; }
  .chat-layout { display: block; min-height: 0; }
  .conversation { height: 100%; grid-template-rows: 64px minmax(0, 1fr) auto; padding-bottom: calc(57px + env(safe-area-inset-bottom)); }
  .conversation-header { padding: 0 14px; }
  .conversation-header .card-kicker { font-size: 7px; }
  .conversation-header h1 { font-size: 16px; }
  .conversation-mark { width: 35px; height: 35px; }
  .message-stream { padding: 18px 14px; }
  .system-message { padding: 25px 18px; }
  .system-message h2 { font-size: 24px; }
  .delivery-path { grid-template-columns: 1fr auto 1fr; }
  .delivery-path .delivery-node:last-child, .delivery-path .delivery-arrow:nth-last-child(2) { display: none; }
  .chat-composer { padding: 10px 10px 8px; }
  .chat-composer small { padding: 0 3px; }
  .persona-rail { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(88vw, 330px); padding-top: env(safe-area-inset-top); transform: translateX(-102%); box-shadow: 30px 0 80px rgba(0, 0, 0, .45); transition: transform .25s ease; }
  .persona-open .persona-rail { transform: translateX(0); }
  .persona-backdrop { position: fixed; z-index: 55; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(1, 7, 10, .7); backdrop-filter: blur(3px); cursor: pointer; }
  .persona-open .persona-backdrop { display: block; }
  .character-list { max-height: 230px; }
  .chat-details { position: fixed; z-index: 65; top: calc(58px + env(safe-area-inset-top)); bottom: calc(57px + env(safe-area-inset-bottom)); width: min(92vw, 330px); }
  .mobile-chat-nav { position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); min-height: calc(57px + env(safe-area-inset-bottom)); padding: 4px 5px env(safe-area-inset-bottom); border-top: 1px solid var(--chat-border); background: rgba(7, 16, 21, .98); }
  .mobile-chat-nav button { display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 8px; color: #687d7e; background: transparent; cursor: pointer; }
  .mobile-chat-nav button.active { color: var(--gold-bright); background: rgba(217, 185, 110, .06); }
  .mobile-chat-nav span { font-size: 18px; line-height: 1; }
  .mobile-chat-nav small { font-size: 7px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
}

@media (max-width: 390px) {
  .chat-topbar-actions { gap: 5px; }
  .chat-brand { margin-left: 5px; }
  .chat-brand img { display: none; }
  .chat-icon-button, .chat-install { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-loading img { animation: none; }
}
