/* Approved redesign foundations. Dark is the default; preference may follow the system. */
:root {
  color-scheme: dark;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  --bg: #121116;
  --surface: #1C1A23;
  --raised: #24212D;
  --line: #37323F;
  --line-2: #4A3F58;
  --text: #F4F0E9;
  --muted: #C9C1D3;
  --faint: #ABA2B6;
  --accent: #C4AFFF;
  --on-accent: #221533;
  --accent-text: #D9C9FF;
  --accent-wash: rgb(196 175 255 / .14);
  --ok: #A9DFBC;
  --warn: #EDCB99;
  --bad: #F2B6AE;
  --on-bad: #2B0F0B;
  --scrim: rgb(6 5 9 / .55);
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 14px 36px rgb(0 0 0 / .5);
  --green: var(--ok);
  --amber: var(--warn);
  color: var(--text);
  background: var(--bg);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F3EF;
  --surface: #FFFFFF;
  --raised: #F3F0F5;
  --line: #DDD7E3;
  --line-2: #CFC4DD;
  --text: #1B1820;
  --muted: #544D5C;
  --faint: #6A6274;
  --accent: #6A47DB;
  --on-accent: #FFFFFF;
  --accent-text: #5B3BC7;
  --accent-wash: rgb(106 71 219 / .10);
  --ok: #2D7448;
  --warn: #85560F;
  --bad: #A3362B;
  --on-bad: #FFFFFF;
  --scrim: rgb(27 24 32 / .22);
  --shadow: 0 1px 2px rgb(27 24 32 / .12), 0 14px 36px rgb(27 24 32 / .18);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: inherit; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 2; padding: 12px 16px; background: var(--accent); color: var(--on-accent); border-radius: 8px; transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.shell { max-width: 1120px; min-height: 100svh; margin: auto; padding: 36px 48px 24px; display: flex; flex-direction: column; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 720; font-size: 18px; line-height: 1.05; letter-spacing: -.6px; }
.brand-second { display: block; color: var(--muted); font-weight: 500; }
.brand-mark { color: var(--accent); }
.brand-mark svg { width: 38px; height: 44px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.private-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.private-label svg { height: 15px; width: 15px; stroke: currentColor; stroke-width: 1.3; }
.workspace { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 390px); align-content: center; align-items: center; gap: 70px; padding: 76px 0 88px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: normal; text-transform: none; }
.welcome > .eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.little-line { width: 22px; height: 1px; background: currentColor; }
h1 { font-size: clamp(48px, 6.1vw, 74px); font-weight: 620; letter-spacing: -3.8px; line-height: 1.04; margin: 24px 0; }
h1 > span { color: var(--accent); }
.intro { max-width: 340px; margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.platform-note { display: flex; align-items: center; gap: 9px; margin: 28px 0 0; font-size: 12px; line-height: 1.45; color: var(--faint); }
.platform-note svg { width: 18px; height: 18px; stroke: var(--faint); stroke-width: 1.2; }
.connection { min-width: 0; align-self: center; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; box-shadow: none; overflow: hidden; scroll-margin-block: 20px; }
.connection:focus:not(:focus-visible) { outline: none; }
.connection-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 62px; padding: 16px 25px; border-bottom: 1px solid var(--line); }
.connection-header > .eyebrow { font-size: 12px; color: var(--muted); letter-spacing: normal; }
.connection-badge { font-size: 12px; font-weight: 550; line-height: 1.4; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.connection[data-state="connected"] .connection-badge { color: var(--green); border-color: var(--line-2); background: var(--raised); }
.connection[data-state="setup"] .connection-badge { color: var(--amber); border-color: var(--line-2); background: var(--raised); }
.connection[data-state="error"] .connection-badge { color: var(--bad); border-color: var(--line-2); background: var(--raised); }
.connection-content { min-height: 300px; padding: 26px 25px 24px; }
.connection-symbol { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: var(--accent); background: var(--line); border: 1px solid var(--line-2); margin-bottom: 20px; }
.connection-symbol > svg { width: 26px; height: 26px; }
.symbol-indicator { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--faint); border: 3px solid var(--surface); right: -3px; bottom: -3px; box-sizing: content-box; }
.connection[data-state="connected"] .symbol-indicator { background: var(--green); }
.connection[data-state="setup"] .symbol-indicator { background: var(--amber); }
.connection[data-state="error"] .symbol-indicator { background: var(--bad); }
h2 { font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -.6px; margin: 0; overflow-wrap: anywhere; }
.detail { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 10px 0 0; text-wrap: pretty; overflow-wrap: anywhere; }
.loading-placeholder { display: grid; gap: 8px; padding-top: 26px; }
.loading-placeholder span { height: 9px; width: 100%; border-radius: 3px; background: var(--line); animation: breathe 1.4s ease-in-out infinite alternate; }
.loading-placeholder span + span { width: 64%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 22px; }
.button { min-height: 46px; width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 12px 15px; display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 650; line-height: 1.45; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.primary { background: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--accent-text); }
.secondary { background: var(--raised); color: var(--accent-text); border-color: var(--line-2); justify-content: center; }
.secondary:hover { background: var(--line); border-color: var(--faint); }
.text-button { min-height: 44px; padding: 10px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--text); }
button:disabled { opacity: .65; cursor: wait; }
.connection-note { font-size: 12px; line-height: 1.45; color: var(--faint); margin: 12px 0 0; }
.account { display: flex; gap: 11px; align-items: center; margin-top: 20px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.avatar-wrap { flex-shrink: 0; position: relative; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--line); }
.avatar-fallback { display: grid; place-items: center; height: 100%; color: var(--accent); font-size: 18px; font-weight: 600; }
.avatar-wrap img { position: absolute; inset: 0; object-fit: cover; }
.account-text { min-width: 0; overflow-wrap: anywhere; }
.account strong { display: block; font-size: 13px; line-height: 1.45; font-weight: 600; }
.handle { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.account-check { flex-shrink: 0; height: 19px; width: 19px; margin-left: auto; color: var(--green); stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.event-connection { display: flex; gap: 9px; align-items: flex-start; margin-top: 19px; }
.event-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); margin-top: 6px; flex-shrink: 0; }
.event-connection[data-state="enabled"] .event-dot { background: var(--green); }
.event-connection[data-state="error"] .event-dot { background: var(--bad); }
.event-status { font-size: 12px; line-height: 1.45; margin: 0; color: var(--accent-text); }
.event-detail { font-size: 12px; line-height: 1.45; color: var(--muted); margin: 3px 0 0; overflow-wrap: anywhere; }
.auth-message { font-size: 12px; line-height: 1.45; color: var(--bad); border-left: 2px solid var(--faint); padding: 0 0 0 11px; margin: 18px 0 0; overflow-wrap: anywhere; }
.connection-footer { display: flex; gap: 9px; align-items: flex-start; padding: 16px 25px; border-top: 1px dashed var(--line-2); background: var(--surface); }
.footer-spark { font-size: 17px; line-height: 1.2; color: var(--faint); }
.connection-footer p { font-size: 12px; line-height: 1.45; margin: 0; color: var(--faint); }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--raised); padding-top: 21px; }
.page-footer > p { margin: 0; color: var(--faint); font-size: 12px; line-height: 1.45; }
.page-footer > p > span { color: var(--faint); margin-left: 10px; }
.footer-signature { display: flex; align-items: center; gap: 18px; font-size: 12px; letter-spacing: normal; color: var(--faint); }
.footer-signature > span { font-size: 21px; color: var(--accent); }
.noscript { font-size: 13px; line-height: 1.45; color: var(--amber); }
@keyframes breathe { from { opacity: .45; } to { opacity: 1; } }

@media (min-width: 1400px) { .shell { padding-top: 48px; padding-bottom: 32px; } }
@media (max-width: 850px) {
  .shell { padding-inline: 32px; }
  .workspace { gap: 36px; grid-template-columns: minmax(0, 1fr) minmax(0, 350px); }
  h1 { font-size: 56px; letter-spacing: -3px; }
  .intro { font-size: 14px; }
  .platform-note { max-width: 230px; }
  .wide-only { display: none; }
  .footer-signature { display: none; }
}
@media (max-width: 680px) {
  .shell { max-width: 480px; padding: 24px 24px 20px; }
  .workspace { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 30px; padding: 44px 0 36px; }
  .welcome > .eyebrow { font-size: 12px; letter-spacing: normal; }
  h1 { font-size: 52px; line-height: 1.02; letter-spacing: -2.8px; margin: 18px 0; }
  .intro { max-width: 345px; font-size: 13px; line-height: 1.45; }
  .platform-note { max-width: none; font-size: 12px; margin-top: 16px; }
  .platform-note svg { width: 16px; height: 16px; }
  .connection { align-self: stretch; }


  .connection-content { min-height: 280px; }
  .page-footer { padding-top: 16px; }
  .page-footer > p { font-size: 12px; }
  .page-footer > p > span { margin-left: 0; display: block; }
}
@media (max-width: 360px) {
  .shell { padding-inline: 18px; padding-top: 20px; }
  .brand { font-size: 16px; gap: 7px; }
  .brand-mark svg { width: 32px; height: 38px; }
  .private-label { font-size: 12px; gap: 5px; }
  .workspace { padding-top: 32px; gap: 24px; }
  h1 { font-size: 46px; }
  .connection-header { padding: 14px 19px; }
  .connection-content { padding: 22px 19px 18px; }
  .connection-footer { padding: 14px 19px; }
  h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The signed-in workspace puts one readable card ahead of account settings. */
.header-tools { display: flex; align-items: center; gap: 20px; }
.quiet-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--raised); color: var(--muted); padding: 9px 12px; font-size: 12px; line-height: 1.45; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.quiet-button:hover, .icon-button:hover { background: var(--line); border-color: var(--faint); }
.quiet-button:disabled, .icon-button:disabled { opacity: .5; cursor: default; }
.masthead .quiet-button { font-size: 12px; min-height: 44px; padding: 7px 11px; }



.card-workspace { width: 100%; max-width: 900px; margin-inline: auto; }
.discovery-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.discovery-heading .eyebrow { color: var(--accent); font-size: 12px; letter-spacing: normal; }
.discovery-heading .eyebrow > span { font-size: 14px; margin-left: 5px; }
.discovery-heading h2 { font-size: 30px; margin-top: 10px; letter-spacing: -1px; }
.hand-intro { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 8px 0 0; }
#new-hand { flex-shrink: 0; align-self: flex-start; margin-top: 27px; }
.host-context { color: var(--faint); font-size: 12px; line-height: 1.45; margin: 17px 0 0; }
.host-context[data-offline="true"] { color: var(--amber); }
.hand-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 14px; }
.hand-navigation { display: flex; align-items: center; gap: 14px; }
.icon-button { width: 36px; min-height: 44px; padding: 6px; font-size: 17px; }
#hand-position { min-width: 45px; font-size: 12px; color: var(--muted); text-align: center; }
.skipped-button { font-size: 12px; min-height: 44px; padding: 6px 10px; border-style: dashed; }
.hand-layout { display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 240px); align-items: start; gap: 28px; }
.primary-hand { min-width: 0; }
.raid-card { container-type: inline-size; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: none; }
.card-media { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 270px; overflow: hidden; background: var(--raised); display: grid; place-items: center; }
.media-placeholder { font-size: 12px; color: var(--muted); padding: 24px; }
.card-media > img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.card-media[data-image="loaded"] .media-placeholder { visibility: hidden; }
.media-badges { position: absolute; left: 14px; top: 14px; display: flex; gap: 6px; }
.live-chip, .mature-chip, .viewer-chip { font-size: 12px; font-weight: 650; line-height: 1.45; border-radius: 4px; padding: 4px 7px; background: var(--surface); color: var(--text); }
.live-chip { background: var(--accent-text); color: var(--on-accent); letter-spacing: normal; }
.viewer-chip { position: absolute; right: 14px; bottom: 12px; background: transparent; }
.front-copy { padding: 20px 22px 18px; }
.card-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.card-avatar { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--line); color: var(--accent-text); font-size: 20px; overflow: hidden; }
.card-avatar > img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.card-identity-text { min-width: 0; }
.card-identity h3 { font-size: 20px; line-height: 1.25; letter-spacing: -.4px; margin: 0; font-weight: 620; overflow-wrap: anywhere; }
.channel-link { display: inline-block; color: var(--faint); font-size: 12px; line-height: 1.45; margin-top: 3px; text-decoration-color: var(--line-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.channel-link:hover { color: var(--accent-text); }
.crew-chip { align-self: flex-start; flex-shrink: 0; margin-left: auto; padding: 4px 7px; border-radius: 4px; background: var(--line); color: var(--accent-text); font-size: 12px; }
.card-category { margin: 16px 0 0; color: var(--accent-text); font-size: 13px; line-height: 1.45; font-weight: 550; overflow-wrap: anywhere; }
.stream-title { color: var(--faint); font-size: 12px; line-height: 1.45; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-reason { color: var(--accent); font-size: 12px; line-height: 1.45; margin: 13px 0 0; padding-left: 10px; border-left: 2px solid var(--faint); overflow-wrap: anywhere; }
.card-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; border-top: 1px solid var(--line); margin: 18px 0 0; padding-top: 14px; }
.card-stats > div { min-width: 0; }
.card-stats dt { font-size: 12px; line-height: 1.45; color: var(--faint); }
.card-stats dd { margin: 4px 0 0; font-size: 12px; line-height: 1.4; color: var(--text); overflow-wrap: anywhere; }
.card-actions { display: flex; align-items: center; gap: 8px; padding: 15px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.card-actions .primary { flex: 1; width: auto; min-width: 0; justify-content: center; }
.card-actions .quiet-button { padding-inline: 14px; }
.raid-unavailable { font-size: 12px; line-height: 1.45; color: var(--amber); padding: 0 22px 16px; margin: 0; background: var(--surface); }
.card-back { padding: 22px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) var(--raised); overscroll-behavior: contain; }
.card-back:focus-visible { outline-offset: -4px; }
.back-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 17px; }
.detail-section { margin-top: 21px; }
.detail-section h4 { margin: 0 0 9px; font-size: 12px; color: var(--accent-text); font-weight: 600; text-transform: none; letter-spacing: normal; }
.detail-section p { font-size: 12px; line-height: 1.45; margin: 0; color: var(--muted); }
.relationship-list { display: grid; gap: 6px; margin: 0; padding-left: 16px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.detail-section .crew-note { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--faint); background: var(--raised); white-space: pre-wrap; overflow-wrap: anywhere; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 4px 8px; color: var(--muted); background: var(--raised); border: 1px solid var(--line-2); border-radius: 5px; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; max-width: 100%; }
.clip-link { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; padding: 10px 0; }
.clip-link + .clip-link { border-top: 1px solid var(--line); }
.clip-thumbnail { position: relative; display: grid; place-items: center; width: 104px; flex-shrink: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 5px; background: var(--line); color: var(--muted); }
.clip-thumbnail img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.clip-copy { display: grid; gap: 3px; min-width: 0; }
.clip-role { color: var(--accent); font-size: 12px; line-height: 1.45; }
.clip-copy strong { color: var(--text); font-size: 12px; line-height: 1.45; font-weight: 550; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-meta { font-size: 12px; color: var(--faint); line-height: 1.45; }
.clip-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.card-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.card-warning { margin: 0; padding: 12px 22px; background: var(--raised); border-top: 1px solid var(--line-2); }
.card-warning p { margin: 0; color: var(--warn); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.card-warning .text-button { color: var(--warn); font-size: 12px; min-height: 44px; padding-block: 7px; }
.hand-rail { padding-top: 5px; }
.hand-rail > .eyebrow { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.rail-card { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 74px; padding: 14px 10px; margin-bottom: 7px; border: 1px solid transparent; border-radius: 8px; text-align: left; color: var(--muted); background: transparent; cursor: pointer; }
.rail-card:hover { background: var(--raised); }
.rail-card[aria-current="true"] { border-color: var(--line-2); background: var(--raised); }
.rail-rank { font-size: 12px; color: var(--faint); flex-shrink: 0; }
.rail-copy { display: grid; gap: 5px; min-width: 0; }
.rail-copy strong { font-size: 12px; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
.rail-copy > span { color: var(--faint); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.rail-viewers { font-size: 12px; color: var(--faint); margin-left: auto; flex-shrink: 0; }
.hand-rail-note { padding: 12px 10px; margin-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.45; color: var(--faint); }
.hand-footnote { font-size: 12px; line-height: 1.45; color: var(--faint); margin: 16px 0 0; }
.hand-notice { border-left: 2px solid var(--faint); padding: 10px 13px; margin-bottom: 16px; background: var(--raised); color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.hand-empty { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 360px; padding: 34px; border: 1px dashed var(--line-2); border-radius: 14px; background: var(--surface); }
.empty-arrow { font-size: 36px; color: var(--accent); }
.hand-empty h3 { font-size: 23px; line-height: 1.25; margin: 20px 0 12px; font-weight: 550; letter-spacing: -.5px; }
.hand-empty p { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0 0 22px; }
.hand-empty .button { width: auto; }
.skipped-panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; margin: 0 0 18px; }
.skipped-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.skipped-heading h3 { font-size: 12px; font-weight: 550; margin: 0; }
.skipped-heading .text-button { font-size: 12px; flex-shrink: 0; }
#skipped-list { max-height: 210px; overflow-y: auto; }
.skipped-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.skipped-row > span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.skipped-row .quiet-button { font-size: 12px; min-height: 44px; padding: 5px 10px; }
.skipped-panel > p { font-size: 12px; line-height: 1.45; color: var(--faint); margin: 10px 0 0; }
.raid-feedback { padding: 17px 20px; margin-bottom: 18px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.raid-feedback[data-state="queued"] { background: var(--raised); border-color: var(--line-2); }
.raid-feedback .receipt-title { font-size: 16px; color: var(--text); font-weight: 600; margin: 0 0 7px; }
.raid-feedback[data-state="queued"] .receipt-title { color: var(--ok); }
.raid-feedback > p + p { font-size: 12px; line-height: 1.45; color: var(--bad); margin: 0; overflow-wrap: anywhere; }
.raid-feedback[data-state="queued"] > p + p { color: var(--muted); }
.receipt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.receipt-actions .quiet-button { font-size: 12px; }
.hand-skeleton { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.skeleton-media { aspect-ratio: 16 / 9; max-height: 270px; background: var(--raised); animation: breathe 1.4s ease-in-out infinite alternate; }
.skeleton-copy { display: grid; gap: 17px; padding: 28px 22px 120px; }
.skeleton-copy span { height: 12px; background: var(--line); border-radius: 3px; animation: breathe 1.4s ease-in-out infinite alternate; }
.skeleton-copy span:nth-child(2) { width: 65%; }
.skeleton-copy span:nth-child(3) { width: 85%; }
@media (max-width: 950px) {
  .hand-layout { grid-template-columns: minmax(0, 620px); justify-content: center; }
  .hand-rail { display: none; }
  .card-workspace { max-width: 620px; }
}
@media (max-width: 680px) {


  .header-tools { gap: 10px; }
  .header-tools .private-label { font-size: 12px; }
  .discovery-heading h2 { font-size: 25px; letter-spacing: -.8px; margin-top: 6px; }
  .discovery-heading { align-items: flex-start; gap: 8px; }
  .hand-intro { display: none; }
  #new-hand { font-size: 12px; padding: 8px 10px; margin-top: 14px; }
  .host-context { margin-top: 10px; }
  .hand-toolbar { margin-top: 12px; margin-bottom: 10px; }
  .card-identity h3 { font-size: 18px; }
  .front-copy { padding: 14px 16px; }
  .card-category { margin-top: 10px; }
  .stream-title { -webkit-line-clamp: 1; }
  .card-reason { margin-top: 10px; }
  .card-stats { margin-top: 12px; padding-top: 10px; }
  .card-actions { padding: 13px 16px; gap: 7px; }
  .card-actions .quiet-button { padding-inline: 10px; font-size: 12px; }
  .card-back { padding: 18px 16px; }
  .card-warning { padding: 12px 16px; }
  .clip-thumbnail { width: 82px; }
  .hand-empty { padding: 25px; min-height: 330px; }
  .raid-unavailable { padding-inline: 16px; }
}
@media (max-width: 360px) {



  .discovery-heading h2 { font-size: 23px; }
  .hand-navigation { gap: 10px; }
  .card-stats { gap: 7px; }
  .card-stats dd { font-size: 12px; }
}

/* Functional MVP views; the final visual review is intentionally deferred. */
.workspace-nav { display: flex; gap: 8px; width: 100%; max-width: 900px; margin: 0 auto; order: -1; }
.workspace-nav button { border: 1px solid transparent; border-radius: 6px; padding: 10px 14px; min-height: 44px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.workspace-nav button[aria-current="page"] { border-color: var(--line-2); background: var(--raised); color: var(--accent-text); }
.functional-view, .functional-panel, #arrivals-message { min-width: 0; width: 100%; max-width: 900px; margin-inline: auto; }
.functional-view h2, .functional-panel h2 { font-size: 24px; }
.functional-panel h2, .functional-panel h3, .functional-panel legend { max-width: 100%; overflow-wrap: anywhere; }
.functional-panel { padding: 20px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.invitation-panel { grid-column: 1 / -1; order: -3; }

.arrival-panel { border-color: var(--line-2); }
.arrival-panel h2 { font-size: 17px; }
.arrival-panel .card-identity { margin-top: 15px; }
.arrival-count { font-size: 15px; line-height: 1.45; color: var(--accent-text); margin-block: 12px; overflow-wrap: anywhere; }
.functional-view > .functional-panel { margin-top: 22px; }
.functional-view > .section-heading { margin-bottom: 16px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.section-heading .quiet-button, .section-heading .text-button { flex-shrink: 0; }
.form-help { font-size: 12px; color: var(--muted); line-height: 1.45; margin-block: 10px; overflow-wrap: anywhere; }
.functional-panel > p, .functional-view > p { line-height: 1.45; overflow-wrap: anywhere; }
.functional-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.feature-message { padding: 10px 12px; margin-block: 12px; border-left: 2px solid var(--accent); color: var(--accent-text); background: var(--raised); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.functional-empty { color: var(--muted); border: 1px dashed var(--line-2); border-radius: 8px; padding: 22px; font-size: 13px; line-height: 1.45; }
.received-list, .crew-list { display: grid; gap: 8px; }
.received-row { display: grid; gap: 6px; width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 14px 16px; text-align: left; background: var(--surface); color: var(--accent-text); font: inherit; cursor: pointer; }
.received-row:hover, .received-row[aria-expanded="true"] { border-color: var(--faint); background: var(--raised); }
.received-row strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.received-row > span { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.received-row .form-help { margin: 0; }
#more-received { margin-top: 14px; }
.saved-dates { font-size: 12px; line-height: 1.45; color: var(--faint); overflow-wrap: anywhere; }
.saved-stream-context { font-size: 13px; color: var(--accent-text); }
#saved-content > .card-identity { margin-top: 24px; }
#saved-content .detail-section { margin-top: 22px; }
.retention-value { color: var(--text) !important; }
.functional-panel fieldset { border: 0; min-width: 0; margin: 0; padding: 0; }
.functional-panel legend { font-size: 17px; font-weight: 600; margin-bottom: 10px; padding: 0; color: var(--text); }
.functional-panel label { display: block; font-size: 12px; color: var(--accent-text); line-height: 1.45; margin: 12px 0 6px; }
.functional-panel input:not([type="checkbox"]) { display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.functional-panel input[type="number"] { max-width: 230px; }
.functional-panel .checkbox-label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.functional-panel input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--accent); flex-shrink: 0; }
.functional-panel form button, .functional-panel fieldset > button { margin-top: 14px; }
.functional-panel :disabled { opacity: .65; }
.crew-member { padding-block: 18px; border-bottom: 1px solid var(--line); }
.member-note { font-size: 12px; line-height: 1.45; color: var(--accent-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.crew-confirmation { padding: 15px; margin-top: 16px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--bad); font-size: 12px; line-height: 1.45; }
.chatter-access { margin-top: 20px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.chatter-access h3 { font-size: 13px; font-weight: 600; margin: 0; }
.chatter-access .quiet-button { font-size: 12px; }
@media (max-width: 680px) {

  .functional-panel { padding: 17px 15px; }
  .functional-view h2, .functional-panel h2 { font-size: 22px; }
  .arrival-panel h2 { font-size: 16px; }
  .workspace-nav { gap: 4px; }
  .workspace-nav button { padding-inline: 12px; font-size: 12px; }
  .section-heading { gap: 8px; }
  .section-heading .quiet-button { font-size: 12px; padding-inline: 10px; }
}

/* Base controls; later phases replace the transitional layout above. */
button, input { font: inherit; }
h1, h2, h3 { text-wrap: balance; }
.eyebrow, .footer-signature, .detail-section h4 { text-transform: none; letter-spacing: normal; }
.button, .quiet-button { border-radius: 11px; font-size: 15px; font-weight: 600; min-height: 48px; }
.primary { background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 700; }
.primary:hover { background: var(--accent); filter: brightness(1.07); }
.primary:disabled { background: var(--raised); color: var(--faint); border: 1px dashed var(--line-2); cursor: not-allowed; filter: none; opacity: 1; }
.secondary, .quiet-button { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.secondary:hover, .quiet-button:hover { background: var(--raised); border-color: var(--line-2); }
.text-button { color: var(--accent-text); min-height: 44px; font-size: 14px; text-underline-offset: 3px; }
.icon-button { width: 44px; height: 44px; border-radius: 10px; color: var(--muted); background: transparent; border-color: transparent; }
.form-help, .connection-note, .event-detail, .clip-meta, .handle, .platform-note, .page-footer > p { font-size: 13px; color: var(--muted); }
.channel-link { min-height: 24px; display: inline-flex; align-items: center; }
.card-identity h3, .rail-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { background: var(--raised); border-color: var(--line); color: var(--muted); font-size: 13px; border-radius: 7px; }
.avatar-fallback, .card-avatar { color: var(--text); background: var(--raised); }
.theme-section { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.theme-section > p { color: var(--faint); font-size: 12px; font-weight: 600; }
.segmented-control { display: flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 11px; background: var(--raised); }
.segmented-control button { flex: 1; min-width: 0; height: 44px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.segmented-control button[aria-pressed="true"] { color: var(--text); background: var(--surface); border-color: var(--line-2); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }






@media (max-width: 360px) {


  .header-tools { gap: 8px; }
  .header-tools .private-label { font-size: 12px; }
}

/* Phase 2: viewport shell and native floating surfaces. */
body[data-view="app"] { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
html:has(body[data-view="app"]) { overflow: hidden; }
.topbar { display: flex; align-items: center; flex: none; height: 52px; min-width: 0; padding: 0 8px; gap: 8px; border-bottom: 1px solid var(--line); background: var(--bg); z-index: 2; }
.topbar .brand { margin-right: auto; }
.topbar .brand-mark svg { width: 26px; height: 32px; }
.topbar .brand { font-size: 15px; }
.topbar .private-label { font-size: 13px; color: var(--muted); }
body[data-view="app"] .topbar .brand, body[data-view="app"] .private-label { display: none; }
.workspace-nav { display: flex; gap: 4px; flex: 1; margin: 0; width: auto; max-width: none; order: initial; }
.workspace-nav button { position: relative; min-height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.4; cursor: pointer; }
.workspace-nav button[aria-current="page"] { color: var(--text); background: var(--raised); border-color: var(--line-2); }
.account-toggle { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; position: relative; flex-shrink: 0; }
.avatar { position: relative; display: grid; place-items: center; width: 34px; height: 34px; background: var(--raised); color: var(--text); border: 1px solid var(--line-2); border-radius: 50%; font-size: 14px; font-weight: 650; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-dot { position: absolute; width: 11px; height: 11px; right: 1px; bottom: 1px; border-radius: 50%; border: 2px solid var(--bg); background: var(--bad); box-sizing: content-box; }
.account-dot[data-state="enabled"] { background: var(--ok); }
.account-dot[data-state="pending"], .account-dot[data-state="connecting"] { background: var(--warn); }
body[data-view="app"] .shell { width: 100%; max-width: 1320px; margin-inline: auto; padding: 0; min-height: 0; flex: 1; overflow: hidden; }
body[data-view="app"] .workspace { height: 100%; min-height: 0; padding: 0; display: block; }
body[data-view="app"] #landing, body[data-view="app"] .page-footer { display: none; }
body:not([data-view="app"]) .shell { min-height: calc(100dvh - 52px); padding: 24px 16px 16px; }
body:not([data-view="app"]) .workspace { display: block; padding: 0; }
#landing { width: 100%; }
#connection { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; min-height: 0; width: 100%; }
#connection-note { margin-top: 12px; }
.loading-placeholder { min-height: 48px; padding: 0; display: flex; align-items: center; color: var(--muted); }
.loading-placeholder > span { width: auto; height: auto; background: none; animation: none; }
.dock-only { display: inline; }
.web-only { display: none; }
body[data-view="app"] #discovery { display: flex; flex-direction: column; min-height: 0; height: 100%; width: 100%; max-width: none; padding: 12px; gap: 8px; }
#discovery .hand-intro, #discovery .eyebrow, .hand-footnote { display: none; }
#discovery .discovery-heading { min-height: 44px; flex-shrink: 0; }
#discovery .discovery-heading h2 { font-size: 20px; margin: 0; }
#new-hand { margin: 0; }
.host-context { margin: 0; min-height: 36px; font-size: 13px; display: flex; align-items: center; }
.hand-toolbar { margin: 0; min-height: 44px; flex-shrink: 0; }
.hand-layout { min-height: 0; flex: 1; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); }
.primary-hand { display: flex; flex-direction: column; min-height: 0; height: 100%; }
#raid-card { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#card-front, #card-back { min-height: 0; flex: 1; overflow: auto; }
.card-actions, .card-warning, .raid-unavailable { flex-shrink: 0; }
.card-warning { max-height: 140px; overflow: auto; }
.hand-empty, .hand-skeleton { flex: 1; min-height: 0; overflow: auto; }
#hand-rail { display: none; }
body[data-view="app"] .functional-view { height: 100%; min-height: 0; max-width: none; overflow: auto; padding: 14px 12px 20px; }
body[data-view="app"] .functional-view .functional-panel { max-width: none; }
.account-menu, .skipped-panel { position: fixed; inset: auto; margin: 0; top: 56px; right: 8px; width: min(320px, calc(100vw - 16px)); max-height: calc(100dvh - 72px); overflow-y: auto; padding: 4px; border: 1px solid var(--line-2); border-radius: 14px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.account-menu:popover-open { display: block; }
.account-menu::backdrop, .skipped-panel::backdrop { background: var(--scrim); }
.account-menu > .account, .account-menu > .event-connection, .account-menu > .chatter-access, .account-menu > .theme-section, #retry-menu-slot, #auth-menu-slot { margin: 0; padding: 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
#auth-menu-slot:empty, #retry-menu-slot:empty, #retry-menu-slot:has(> [hidden]), #auth-menu-slot:has(> [hidden]) { display: none; }
.account-menu .account strong { font-size: 16px; }
.account-menu .handle { font-size: 13px; }
.account-menu .event-status { font-size: 14px; }
.account-menu .event-detail, .account-menu .form-help { font-size: 13px; }
.account-menu .event-dot { width: 8px; height: 8px; }
.account-menu #logout { width: calc(100% - 24px); margin: 12px; }
.menu-footer { display: flex; align-items: flex-start; gap: 8px; color: var(--faint); padding: 0 12px 12px; font-size: 13px; margin: 0; }
[data-icon] { display: inline-flex; flex-shrink: 0; width: 16px; height: 16px; align-items: center; justify-content: center; }
[data-icon] svg { width: 100%; height: 100%; }
.sheet { position: fixed; inset: auto 8px 8px; width: auto; max-width: none; max-height: calc(100dvh - 16px); margin: 0; padding: 18px 16px 16px; border: 1px solid var(--line-2); border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); overflow-y: auto; }
.sheet[open] { display: grid; gap: 12px; }
.sheet::backdrop { background: var(--scrim); }
.sheet .functional-panel { width: 100%; max-width: none; margin: 0; padding: 0; border: 0; background: none; }
.sheet .button, .sheet .quiet-button, .sheet .functional-actions > * { width: 100%; }
.sheet .functional-actions { flex-direction: column; align-items: stretch; }
.sheet h2 { font-size: 20px; }
.alerts { position: fixed; z-index: 5; top: 160px; left: 8px; right: 8px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
body:not([data-screen="discovery"]) .alerts { top: 58px; }
body[data-overlay-open="true"] .alerts { visibility: hidden; pointer-events: none; }
.floating-alert { pointer-events: auto; border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); background: var(--surface); color: var(--text); max-height: min(300px, calc(100dvh - 170px)); overflow: auto; }
#arrival-panel { border-color: var(--accent); }
#hand-alert, #arrival-error-alert { position: relative; padding-right: 56px; }
#hand-alert > button, #arrival-error-alert > button { position: absolute; right: 4px; top: 4px; }
#hand-notice, #arrivals-message { margin: 0; padding: 0; border: 0; color: var(--text); background: none; }
#skipped-panel { padding: 12px; }
@keyframes overlay-enter { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@keyframes sheet-enter { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes overlay-fade { from { opacity: 0; } to { opacity: 1; } }
.account-menu:popover-open, .skipped-panel:popover-open, .floating-alert:not([hidden]) { animation: overlay-enter 160ms cubic-bezier(.23, 1, .32, 1); transform-origin: top right; }
.sheet[open] { animation: sheet-enter 200ms cubic-bezier(.23, 1, .32, 1); }
@media (min-width: 760px) {
  .topbar {
    height: 68px;
    padding-block: 0;
    padding-inline: max(28px, calc((100% - 1320px) / 2 + 28px));
    gap: 20px;
    border-bottom: 0;
    background-image: linear-gradient(var(--line), var(--line));
    background-position: center bottom;
    background-size: min(100%, 1320px) 1px;
    background-repeat: no-repeat;
  }
  body[data-view="app"] .topbar .brand { display: inline-flex; margin-right: 20px; }
  .topbar .brand-mark svg { width: 30px; height: 34px; }
  .topbar .brand { font-size: 17px; }
  body:not([data-view="app"]) .shell { min-height: calc(100dvh - 68px); }
  body[data-view="app"] #discovery { padding: 22px 28px 24px; }
  .hand-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
  #hand-rail { display: block; grid-column: 1; grid-row: 1; min-height: 0; overflow-y: auto; }
  .primary-hand { grid-column: 2; grid-row: 1; }
  .account-menu { top: 64px; right: 16px; width: 320px; }
  .skipped-panel { top: var(--popover-top, 112px); left: var(--popover-left, auto); right: auto; width: 320px; }
  .account-menu::backdrop, .skipped-panel::backdrop { background: transparent; }
  .sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 400px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
  .alerts { left: auto; top: 80px !important; right: 24px; width: 360px; }
  .dock-only { display: none; }
  .web-only { display: inline; }
}
@media (max-width: 339px) { .workspace-nav button { padding-inline: 7px; } .topbar .private-label { display: none; } }
@media (max-height: 559px) and (max-width: 759px) {
  html:has(body[data-view="app"]), body[data-view="app"] { height: auto; overflow: auto; }
  body[data-view="app"] .shell, body[data-view="app"] .workspace { height: auto; overflow: visible; }
  body[data-view="app"] #discovery { height: 560px; }
}
@media (prefers-reduced-motion: reduce) {
  .account-menu:popover-open, .skipped-panel:popover-open, .floating-alert:not([hidden]), .sheet[open] { animation: overlay-fade 120ms linear; }
}

/* Discover: one ticket, with independent fixed media and scrolling copy. */
body[data-view="app"] #discovery { padding: 0; }
.discover-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: 52px 44px; padding: 0 12px 8px; align-items: center; flex: none; column-gap: 8px; }
#discovery-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.avatar-strip { display: flex; grid-column: 1 / 3; grid-row: 1; gap: 4px; min-width: 0; margin-left: -6px; }
.avatar-tab { display: grid; place-items: center; flex: none; position: relative; width: 40px; height: 44px; min-height: 44px; border: 0; padding: 0; border-radius: 8px; color: var(--text); background: transparent; cursor: pointer; }
.small-avatar { position: relative; display: grid; place-items: center; overflow: hidden; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--raised); color: var(--accent-text); font-size: 15px; font-weight: 600; }
.small-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-tab[aria-selected="true"] .small-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.avatar-tab[aria-selected="true"]::after { content: ''; position: absolute; height: 3px; left: 11px; right: 11px; bottom: -2px; border-radius: 2px; background: var(--accent); }
.avatar-tab:hover .small-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-2); }
.avatar-skeleton { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--raised); margin: 5px 3px; }
#new-hand { grid-column: 3; grid-row: 1; margin: 0; align-self: center; width: 44px; height: 44px; min-height: 44px; padding: 0; background: none; border: 0; justify-content: center; }
#new-hand .label { display: none; }
#new-hand { position: relative; }
#new-hand .draw-badge { position: absolute; top: 0; right: 0; }
#new-hand:has(.draw-badge:not([hidden])) [data-icon] { transform: translate(-6px, 6px); }
#new-hand [data-icon] { width: 20px; height: 20px; }
#new-hand[data-loading="true"] svg { animation: spin 1s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.host-context { grid-row: 2; grid-column: 1; min-width: 0; margin: 0; font-size: 13px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.host-context:not(:empty)::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 8px; }
.host-context[data-offline="true"] { color: var(--warn); }
.host-context[data-offline="true"]::before { background: none; width: 13px; height: 13px; border: 1.5px solid var(--warn); vertical-align: -2px; }
.skipped-button { grid-row: 2; grid-column: 3; min-height: 44px; padding: 4px 8px; border-style: solid; border-radius: 10px; display: flex; gap: 6px; align-items: center; font-size: 13px; }
.chat-vote-button { grid-row: 2; grid-column: 2; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 4px 8px; border-radius: 10px; font-size: 13px; white-space: nowrap; }
.chat-vote-button svg { width: 16px; height: 16px; }
@media (max-width: 759px) { .discover-toolbar:has(#skipped-toggle[hidden]) #chat-vote { grid-column: 2 / 4; justify-self: end; } }
.count-badge { display: grid; place-items: center; min-width: 20px; height: 20px; padding-inline: 4px; border-radius: 6px; background: var(--raised); font-size: 12px; }
.hand-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 0 12px 12px; align-items: stretch; }
.primary-hand { display: flex; min-height: 0; min-width: 0; grid-column: 1; }
#hand-rail { display: none; }
#raid-card { container: card / size; display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; border: 0; border-radius: 0; background: none; overflow: visible; box-shadow: none; }
.ticket-main, .ticket-stub { position: relative; border: 1px solid var(--line-2); background: var(--surface); isolation: isolate; }
.ticket-main { display: flex; flex: 1; min-height: 0; border-bottom: 0; border-radius: 16px 16px 0 0; -webkit-mask: radial-gradient(circle at left bottom, transparent 9px, #000 9.5px) left / 51% 100% no-repeat, radial-gradient(circle at right bottom, transparent 9px, #000 9.5px) right / 51% 100% no-repeat; mask: radial-gradient(circle at left bottom, transparent 9px, #000 9.5px) left / 51% 100% no-repeat, radial-gradient(circle at right bottom, transparent 9px, #000 9.5px) right / 51% 100% no-repeat; }
.ticket-stub { flex: none; border-top: 0; border-radius: 0 0 16px 16px; -webkit-mask: radial-gradient(circle at left top, transparent 9px, #000 9.5px) left / 51% 100% no-repeat, radial-gradient(circle at right top, transparent 9px, #000 9.5px) right / 51% 100% no-repeat; mask: radial-gradient(circle at left top, transparent 9px, #000 9.5px) left / 51% 100% no-repeat, radial-gradient(circle at right top, transparent 9px, #000 9.5px) right / 51% 100% no-repeat; }
.ticket-stub::before { content: ''; position: absolute; top: 0; left: 16px; right: 16px; border-top: 2px dashed var(--line); }
.notch { position: absolute; z-index: 2; width: 20px; height: 20px; border: 1px solid var(--line-2); border-radius: 50%; pointer-events: none; }
.notch.l { left: -10px; } .notch.r { right: -10px; }
.ticket-main > .notch { bottom: -10px; } .ticket-stub > .notch { top: -10px; }
#card-front.face, #card-back.face, .face { flex: 1; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: 15px 15px 0 0; padding: 0; }
.card-media { flex: none; aspect-ratio: 16 / 9; max-height: none; }
.media-placeholder { font-size: 13px; color: var(--faint); }
.media-badges { top: 10px; left: 10px; }
.live-chip { background: #DFC6FF; color: #30104C; padding: 2px 7px; font-size: 12px; font-weight: 750; letter-spacing: .04em; border-radius: 6px; }
.offline-chip { background: #E3DAEA; color: #392E42; }
.viewer-chip, .mature-chip { color: #F4F0E9; background: rgb(12 11 18 / .88); padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 650; }
.viewer-chip { right: 10px; bottom: 10px; }
.front-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.front-copy { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 20px; }
.card-identity { gap: 10px; flex: none; }
.card-identity-text { flex: 1; }
.card-identity h3 { font-size: 20px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.channel-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; min-height: 24px; color: var(--muted); max-width: 100%; }
.channel-link svg { width: 12px; height: 12px; }
.card-category { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.stream-title { margin: 4px 0 0; font-size: 14px; color: var(--muted); -webkit-line-clamp: 2; }
.reason-chips { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; margin: 0; padding: 0; }
.reason-chips li { font-size: 12px; padding: 4px 7px; border-radius: 7px; color: var(--accent-text); background: var(--accent-wash); }
.card-stats { margin: 0; gap: 0; padding-top: 12px; }
.card-stats > div { padding-inline: 10px; border-left: 1px solid var(--line); }
.card-stats > div:first-child { padding-left: 0; border-left: 0; }
.card-stats dt { font-size: 12px; font-weight: 550; }
.card-stats dd { font-size: 16px; font-weight: 600; white-space: nowrap; }
.card-stats dd.no-history { font-size: 14px; font-weight: 500; color: var(--muted); }
.front-extra { display: none; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.details-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 26px; display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; }
#card-back > .card-identity { padding: 12px 16px; border-bottom: 1px solid var(--line); }
#card-back .card-avatar { width: 34px; height: 34px; font-size: 15px; }
#card-back .card-identity h3 { font-size: 17px; }
.back-summary { margin: 0; font-size: 14px; }
.back-summary > span:first-child { font-size: 16px; }
.detail-section { margin: 0; }
.detail-section h4 { font-size: 12px; font-weight: 650; color: var(--faint); margin: 0 0 8px; }
.detail-section p, .relationship-list { font-size: 14px; }
.relationship-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.relationship-list li { display: flex; gap: 8px; align-items: flex-start; }
.relationship-list svg { width: 16px; height: 20px; color: var(--ok); flex: none; }
.relationship-list li.unknown, .relationship-list li.unknown svg { color: var(--faint); }
.clip-thumbnail { width: 88px; border-radius: 7px; background: var(--raised); }
.clip-thumbnail > svg { width: 16px; height: 16px; }
.clip-link { min-height: 44px; }
.clip-copy strong { font-size: 14px; }
.clip-role { font-size: 12px; color: var(--accent-text); }
.clip-meta { font-size: 13px; }
.stub, .card-actions { display: flex; gap: 8px; padding: 12px; border: 0; background: none; }
.stub > .primary { flex: 1; width: auto; min-width: 0; }
.stub > button { min-height: 48px; }
#flip-card { display: inline-flex; align-items: center; gap: 6px; }
.card-warning { border: 0; margin: 0; padding: 12px 16px 0; background: none; }
.card-warning p { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.raid-feedback, .raid-feedback[data-state="queued"] { padding: 14px 12px 12px; margin: 0; border: 0; background: none; border-radius: 0; }
.raid-feedback .receipt-title { font-size: 14px; font-weight: 650; margin: 0; }
.raid-feedback > p + p { font-size: 14px; color: var(--muted); margin: 3px 0 0; }
.raid-feedback[data-state="unknown"] .receipt-title { color: var(--warn); }
.raid-feedback[data-state="failed"] .receipt-title { color: var(--bad); }
.receipt-actions { display: flex; gap: 8px; margin-top: 12px; }
.receipt-actions > * { flex: 1; min-height: 48px; font-size: 14px; padding-inline: 10px; }
.raid-stamp { position: absolute; right: 14px; bottom: 46px; transform: rotate(-8deg); padding: 6px 12px 5px; border: 3px double var(--ok); border-radius: 10px; color: var(--ok); background: var(--surface); text-align: center; text-transform: uppercase; font-size: 17px; font-weight: 800; line-height: 1.1; letter-spacing: .08em; }
.raid-stamp small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .05em; margin-top: 3px; }
.hand-empty { align-items: center; text-align: center; justify-content: center; min-height: 0; border: 0; padding: 24px; }
.hand-empty h3 { font-size: 19px; font-weight: 650; margin: 16px 0 8px; }
.hand-empty p { font-size: 14px; margin: 0; }
.empty-arrow { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.empty-arrow [data-icon] { width: 20px; height: 20px; }
.hand-skeleton { border: 0; }
.skeleton-media { flex: none; max-height: none; }
.skeleton-copy { padding: 20px 16px; gap: 16px; }
.skeleton-copy > span:first-child { width: 60%; } .skeleton-copy > span:nth-child(2) { width: 85%; } .skeleton-copy > span:nth-child(3) { width: 40%; }
.skeleton-stats { display: flex; gap: 12px; margin-top: 16px; } .skeleton-stats span { flex: 1; height: 32px; }
.skipped-heading h3 { font-size: 16px; font-weight: 650; }
.skipped-row { justify-content: flex-start; gap: 8px; }
.skipped-copy { display: grid; flex: 1; gap: 2px; }
.skipped-copy strong { color: var(--text); font-size: 15px; }
.skipped-copy > span { font-size: 13px; }
.skipped-panel > p { font-size: 13px; }
.details-panel { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.panel-title { padding: 16px; font-size: 16px; font-weight: 650; margin: 0; border-bottom: 1px solid var(--line); }
@container card (max-height: 500px) {
  .card-media, .skeleton-media { aspect-ratio: 2 / 1; }
  .front-copy { gap: 8px; }
  .card-avatar { width: 40px; height: 40px; }
  .stream-title { -webkit-line-clamp: 1; }
  .front-copy .reason-chips li:not(:first-child) { display: none; }
  .card-stats { padding-top: 8px; }
  .stub { padding: 10px 12px; }
}
@container card (min-height: 600px) { #raid-card:not([data-result="true"]) .extra-clip { display: block; } }
@container card (min-height: 740px) { #raid-card:not([data-result="true"]) .extra-tags { display: block; } }
@container card (min-height: 820px) { #raid-card:not([data-result="true"]) .extra-history { display: block; } }
@media (max-width: 339px) { #flip-card .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } #start-raid { font-size: 15px; } .skipped-button .label { display: none; } .avatar-strip { gap: 0; } }
@media (min-width: 760px) {
  body[data-view="app"] #discovery { padding: 0; }
  .discover-toolbar { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-rows: auto auto; padding: 22px 28px 16px; row-gap: 6px; }
  #discovery-heading { position: static; width: auto; height: auto; clip-path: none; overflow: visible; font-size: 28px; font-weight: 650; grid-column: 1; grid-row: 1; }
  .avatar-strip { display: none; }
  #host-context { grid-column: 1; grid-row: 2; }
  #skipped-toggle { grid-column: 2; grid-row: 1 / 3; }
  #chat-vote { grid-column: 3; grid-row: 1 / 3; font-size: 14px; padding: 0 12px; }
  #new-hand { grid-column: 4; grid-row: 1 / 3; width: auto; padding: 0 12px; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); }
  #new-hand .label { display: inline; }
  #new-hand .draw-badge { display: none; }
  #new-hand:has(.draw-badge:not([hidden])) [data-icon] { transform: none; }
  .hand-layout { grid-template-columns: 260px minmax(0, 440px); padding: 0 28px 24px; justify-content: center; }
  #hand-rail { display: block; grid-column: 1; grid-row: 1; padding: 0; }
  .primary-hand { grid-column: 2; grid-row: 1; }
  .hand-rail > .eyebrow { font-size: 12px; color: var(--faint); padding: 0 12px; margin: 0 0 12px; font-weight: 600; }
  .rail-card { min-height: 64px; padding: 10px 12px; gap: 10px; margin-bottom: 4px; border-radius: 12px; }
  .rail-card[aria-current="true"] { background: var(--surface); }
  .rail-rank { font-size: 13px; }
  .rail-copy { gap: 4px; }
  .rail-copy strong { font-size: 15px; font-weight: 600; }
  .rail-copy > span { font-size: 13px; }
}
@media (min-width: 1100px) { .hand-layout { grid-template-columns: 280px 400px minmax(0, 1fr); } #flip-card { display: none; } #discover-panel { grid-column: 3; grid-row: 1; } }
@media (max-height: 559px) and (max-width: 759px) { body[data-view="app"] #discovery { height: 548px; } #raid-card { min-height: 400px; } }
@media (prefers-reduced-motion: reduce) { #new-hand[data-loading="true"] svg { animation: none; } }
body[data-view="app"] #discovery { gap: 0; }
#host-context { display: block; min-height: 0; }
@media (min-width: 760px) { #discovery #hand-count { display: block; } }

/* Received and shared list/detail surfaces. */
body[data-view="app"] #received { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.view-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 12px 0; flex: none; }
.view-intro h2 { margin: 0; font-size: 20px; font-weight: 650; line-height: 44px; }
.view-subline { font-size: 14px; color: var(--muted); margin: 2px 0 14px; }
.refresh-control { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; flex: none; }
.received-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 16px; }
#received-overview { flex: 1; }
.received-list, .crew-list { display: grid; gap: 8px; }
.received-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.received-row:hover { background: var(--raised); border-color: var(--line-2); }
.received-row[aria-current="true"] { border-color: var(--accent); }
.row-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.row-copy strong { font-size: 15px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-copy > span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
/* Received rows share two tracks so date and result text cannot create a third line. */
#received-list .received-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) max-content; grid-template-rows: 21px 19px; column-gap: 12px; row-gap: 4px; align-items: center; }
#received-list .small-avatar { grid-column: 1; grid-row: 1 / 3; align-self: center; font-size: 14px; }
#received-list .received-name { grid-column: 2; grid-row: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; line-height: 21px; }
#received-list .received-date { grid-column: 2; grid-row: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 19px; color: var(--muted); }
#received-list .received-status { color: var(--warn); white-space: nowrap; }
#received-list .received-result-value { grid-column: 3; grid-row: 1; text-align: right; white-space: nowrap; font-size: 16px; font-weight: 650; line-height: 21px; }
#received-list .received-result-value.unknown-result { font-size: 13px; font-weight: 550; color: var(--muted); }
#received-list .received-result-detail { grid-column: 3; grid-row: 2; text-align: right; white-space: nowrap; font-size: 12px; line-height: 19px; color: var(--faint); }

#more-received { width: 100%; margin-top: 12px; }
.row-skeletons { display: grid; gap: 8px; margin-bottom: 12px; }
.row-skeletons i { height: 66px; border-radius: 12px; background: var(--raised); }
#received-detail { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.detail-subheader { height: 48px; flex: none; padding: 0 6px; }
.back-control { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px; font-size: 15px; font-weight: 600; color: var(--accent-text); }
#received[data-detail="true"] #received-overview, #received[data-detail="true"] #received-intro { display: none; }
.saved-ticket { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0 12px 12px; }
.saved-ticket .ticket-main { flex-direction: column; overflow: hidden; }
#saved-head { flex: none; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.saved-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 26px; overscroll-behavior: contain; scrollbar-width: thin; }
#saved-content { display: flex; flex-direction: column; gap: 18px; }
#saved-message { margin: 0 0 12px; }
#saved-status { padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--muted); background: var(--raised); }
#saved-status p { margin: 0; }
#saved-status[data-tone="warn"] { color: var(--warn); }
#saved-status .text-button { color: inherit; }
.saved-when { margin: 0; color: var(--muted); font-size: 14px; }
.saved-when strong { color: var(--text); }
.saved-notified, .source-note, .detail-section .source-note { margin: 0; color: var(--faint); font-size: 13px; }
.saved-captured { margin: 0; color: var(--faint); font-size: 12px; }
.saved-stream-context { font-size: 15px !important; font-weight: 600; color: var(--text) !important; }
#saved-channel { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; min-width: 0; min-height: 48px; }
#refresh-saved { width: 44px; height: 48px; flex: none; display: grid; place-items: center; }
.retention-block { padding: 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.retention-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.retention-label h4 { font-size: 12px; font-weight: 650; color: var(--faint); margin: 0; }
.retention-label .tag { font-size: 12px; padding: 2px 6px; }
.retention-value { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.retention-value > strong { font-size: 26px; font-weight: 700; }
.retention-value > span { font-size: 15px; color: var(--muted); }
.retention-value > span.retention-percent { margin-left: auto; color: var(--text); font-size: 17px; font-weight: 650; }
.retention-value > strong.retention-status { font-size: 18px; font-weight: 650; }
.retention-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.retention-bar::before { content: ''; display: block; height: 100%; width: var(--pct); background: var(--ok); border-radius: inherit; }
.retention-block > p { font-size: 13px; color: var(--muted); margin: 0; }
.retention-block > p.measured-at { color: var(--faint); font-size: 12px; }
.workspace-nav button[data-unseen="true"]::after { content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); top: 6px; right: 6px; }
#arrival-panel { display: flex; align-items: flex-start; padding: 4px; gap: 2px; }
#arrival-details { display: flex; align-items: center; min-width: 0; flex: 1; min-height: 56px; padding: 4px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); text-align: left; gap: 6px; cursor: pointer; }
#arrival-details:hover { background: var(--raised); }
#arrival-content { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.arrival-copy { display: grid; gap: 2px; min-width: 0; }
.arrival-copy > strong { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrival-kicker { font-size: 12px; font-weight: 650; color: var(--accent-text); }
.arrival-meta { font-size: 13px; color: var(--muted); }
#arrival-dismiss { flex: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; background: none; }
#arrival-queue { font-size: 12px; padding: 2px 5px; }
@media (min-width: 760px) {
  .view-intro { padding: 22px 28px 0; }
  .view-intro h2 { font-size: 28px; }
  .refresh-control { width: auto; gap: 8px; padding: 0 12px; }
  .received-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); padding: 0 28px 24px; gap: 20px; }
  #received[data-detail="true"] #received-overview { display: block; }
  #received[data-detail="true"] #received-intro { display: flex; }
  #received-overview { padding: 0; }
  #received-detail { grid-column: 2; grid-row: 1; }
  #received-detail .detail-subheader { display: none; }
  .saved-ticket { padding: 0; }
}
@media (min-width: 1100px) { .received-layout { grid-template-columns: 340px 400px minmax(0, 1fr); } #saved-panel { grid-column: 3; grid-row: 1; } }
#saved-content .detail-section { margin-top: 0; }

/* Crews: overview, member screen and sheets. */
body[data-view="app"] #crews { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
#crews-intro { flex-wrap: wrap; gap: 0 8px; position: relative; }
#crews-intro > div:first-child { width: 100%; }
#crews-intro h2 { padding-right: 186px; }
#crews-intro .heading-actions { position: absolute; top: 14px; right: 12px; display: flex; gap: 6px; }
#open-new-crew { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; }
.crews-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#crews-overview { flex: 1; }
.crew-badge { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 10px; background: var(--accent-wash); color: var(--accent-text); font-size: 14px; font-weight: 700; }
.crew-chevron { width: 16px; height: 16px; color: var(--faint); }
.profile-summary { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.profile-summary h3 { font-size: 16px; font-weight: 650; margin: 0; }
.profile-summary .section-heading { margin: 0 0 10px; align-items: center; }
#profile-facts p { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; margin: 8px 0; }
#profile-facts svg { width: 16px; height: 20px; flex: none; color: var(--ok); }
#profile-facts .profile-note { display: block; margin-left: 26px; color: var(--muted); overflow-wrap: anywhere; }
.privacy-note { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--faint); margin: 12px 0 0; }
#crew-detail { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#crews[data-detail="true"] #crews-overview, #crews[data-detail="true"] #crews-intro { display: none; }
.crew-detail-head { flex: none; padding: 12px 16px; }
#crew-detail-heading { font-size: 20px; font-weight: 650; margin: 0; overflow-wrap: anywhere; }
#crew-member-count { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
#crew-members { flex: 1; padding: 0 16px 16px; }
.crew-member { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.crew-member .card-avatar { width: 34px; height: 34px; font-size: 15px; }
.crew-member .card-identity h3 { white-space: normal; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.crew-member .tag { font-size: 12px; padding: 1px 5px; }
.crew-member > p { margin: 6px 0 0 44px; font-size: 13px; color: var(--muted); }
.crew-member > p.member-note { font-size: 14px; color: var(--text); }
.crew-action-bar { flex: none; padding: 12px; border-top: 1px solid var(--line); background: var(--bg); max-height: 50%; overflow-y: auto; }
.crew-action-bar .functional-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.crew-action-bar .functional-actions > * { flex: 1; min-height: 48px; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.danger-text { color: var(--bad); }
#crew-invite-output { margin-bottom: 12px; }
#crew-invite-link { width: 100%; }
.sheet fieldset { display: flex; flex-direction: column; gap: 12px; }
.sheet legend { font-size: 20px; font-weight: 650; padding: 0 0 12px; }
.sheet label { font-size: 15px; font-weight: 600; }
.sheet .form-help { font-size: 14px; color: var(--muted); margin: 0; }
.sheet input { font-size: 15px; min-height: 44px; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.switch-row { position: relative; display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.switch-row > span:first-child { margin-right: auto; }
#profile-open { position: absolute; opacity: 0; width: 46px; height: 44px; right: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); flex: none; position: relative; }
.switch-track::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: var(--surface); }
#profile-open:checked + .switch-track { background: var(--accent); }
#profile-open:checked + .switch-track::after { left: 21px; background: var(--on-accent); }
#profile-open:focus-visible + .switch-track { outline: 3px solid var(--accent); outline-offset: 3px; }
.hours-input { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); }
#profile-duration { width: 88px; }
.note-counter { margin: -4px 0 4px; text-align: right; color: var(--faint); font-size: 12px; }
.note-counter[data-warn="true"] { color: var(--warn); }
.destructive { background: var(--bad); color: var(--on-bad); border-color: var(--bad); }
.invite-card { padding: 18px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; display: flex; flex-direction: column; gap: 12px; }
.invite-owner { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.invite-owner strong { color: var(--text); font-weight: 650; }
#invite-heading { font-size: 28px; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
#invite-description { font-size: 14px; color: var(--muted); margin: 0; }
#invite-actions { display: flex; flex-direction: column; margin: 4px 0 0; gap: 8px; }
#invite-actions > * { width: 100%; }
#invite-signin-help { margin: 0; font-size: 13px; color: var(--faint); }
.invite-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 8px 0; }
#invite-expiry { margin: 0; }
#invite-about { margin-top: 18px; }
#invite-about h3 { font-size: 15px; font-weight: 650; margin: 0 0 8px; }
#invite-about p { font-size: 14px; color: var(--muted); margin: 0; }
#landing[data-invite="true"] > .welcome, #landing[data-invite="true"] > #connection, #landing[data-invite="true"] > .landing-steps, #landing[data-invite="true"] > .landing-art { display: none; }
#invite-dialog .invite-card { padding: 0; border: 0; background: none; }
#invite-dialog #invite-heading { font-size: 26px; }
#invite-dialog #invite-about, #invite-dialog #invite-expiry, #invite-dialog #invite-signin-help { display: none; }
#invite-dialog .invite-footer { display: block; padding: 8px 0 0; }
#invite-dialog #dismiss-invite { width: 100%; min-height: 48px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); text-decoration: none; font-size: 15px; font-weight: 600; }
@media (min-width: 760px) {
  #crews-intro .heading-actions { top: 22px; right: 28px; }
  #crews-intro h2 { padding-right: 240px; }
  .crews-layout { display: grid; grid-template-columns: 340px minmax(0, 560px); gap: 20px; padding: 0 28px 24px; }
  #crews-overview { padding: 0; }
  #crews[data-detail="true"] #crews-overview { display: block; }
  #crews[data-detail="true"] #crews-intro { display: flex; }
  #crew-detail { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
  #crew-detail .detail-subheader, .crew-chevron { display: none; }
  .crew-action-bar { background: var(--surface); }
  #invite-landing-slot { max-width: 520px; margin: auto; }
}

/* Signed-out landing and decorative ticket fan. */
body:not([data-view="app"]) { min-height: 100dvh; display: flex; flex-direction: column; }
body:not([data-view="app"]) .shell { width: 100%; max-width: 1320px; min-height: 0; flex: 1; padding: 0 16px 14px; margin: 0 auto; }
body:not([data-view="app"]) .workspace { display: flex; flex: 1; padding: 0; }
body:not([data-view="app"]) .topbar .brand { gap: 8px; min-height: 44px; font-size: 15px; font-weight: 700; letter-spacing: 0; }
body:not([data-view="app"]) .topbar .brand-mark svg { width: 22px; height: 26px; }
body:not([data-view="app"]) .brand-second { display: inline; font-weight: inherit; color: inherit; }
body:not([data-view="app"]) #landing { display: flex; flex-direction: column; min-height: 0; padding-top: 18px; }
#invite-landing-slot:empty, #invite-landing-slot:has(> [hidden]) { display: none; }
#landing > .welcome { margin: 0; }
#landing .welcome > .eyebrow { display: none; }
#heading { font-size: 30px; font-weight: 700; line-height: 1.08; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
#heading > span { color: var(--accent-text); white-space: nowrap; }
#landing .intro { max-width: none; font-size: 15px; margin: 8px 0 0; line-height: 1.45; }
#landing .intro.web-only { display: none; }
#connection { align-self: stretch; flex: none; overflow: visible; margin-top: 18px; }
/* White Glitch geometry comes unchanged from Twitch’s official brand package. */
#login, #invite-login { height: 48px; min-height: 48px; padding: 0 16px; border: 0; border-radius: 6px; justify-content: center; gap: 12px; background: #9146FF; color: #FFFFFF; font-size: 16px; font-weight: 600; filter: none; }
#login:hover, #invite-login:hover { background: #772CE8; filter: none; }
#login:active, #invite-login:active { background: #5C16C5; }
.twitch-login .twitch-glitch { flex: none; width: 20px; height: auto; aspect-ratio: 6 / 7; fill: #FFFFFF; stroke: none; }
#retry-landing-slot > #retry { margin-top: 8px; min-height: 48px; font-size: 15px; }
#auth-landing-slot > #auth-message { margin: 0 0 16px; }
#auth-message { font-size: 14px; padding: 10px 12px; color: var(--warn); background: var(--raised); border: 1px solid var(--line); border-radius: 10px; }
#status:not(.sr-only) { font-size: 14px; color: var(--warn); margin: 0 0 8px; }
#connection[data-state="error"] #status { color: var(--bad); }
#detail { font-size: 14px; margin: 0 0 10px; }
#loading-placeholder { width: 100%; height: 48px; font-size: 14px; }
#loading-placeholder #status { color: var(--muted); margin: 0; }
#connection-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.obs-hint { display: flex; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.obs-hint strong { color: var(--text); }
.obs-hint [data-icon] { color: var(--accent-text); margin-top: 2px; }
.landing-steps { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.landing-steps li { display: flex; align-items: flex-start; gap: 10px; }
.step-number { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1px solid var(--line-2); border-radius: 50%; font-size: 13px; font-weight: 600; }
.landing-steps strong { font-size: 14px; font-weight: 600; }
.landing-steps p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.page-footer { margin-top: auto; flex: none; padding: 16px 0 0; border: 0; }
.page-footer > p { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.page-footer > p > span { margin: 0; }
.landing-art { height: 196px; flex: none; position: relative; overflow: hidden; display: grid; place-items: center; margin: -8px -16px 18px; }
.ticket-fan { position: relative; width: 500px; height: 540px; zoom: .36; }
.example-ticket { position: absolute; left: 90px; top: 20px; width: 320px; height: 500px; display: flex; flex-direction: column; container: none; border: 0; border-radius: 0; background: none; overflow: visible; transform-origin: bottom center; }
.landing-art { pointer-events: none; user-select: none; }
.example-ticket .front-scroll { overflow: hidden; -webkit-mask-image: none; mask-image: none; }
.example-ticket .stream-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.example-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.example-tag { top: 10px; right: 10px; bottom: auto; }
.fan-left { display: none; transform: translateX(-48px) translateY(16px) rotate(-9deg); filter: brightness(.8); }
.fan-right { display: none; transform: translateX(48px) translateY(16px) rotate(9deg); filter: brightness(.8); }
@media (max-height: 700px) and (max-width: 759px) { #landing > .landing-art { display: none; } #heading { font-size: 28px; } .landing-steps p { display: none; } }
@media (min-width: 760px) {
  body:not([data-view="app"]) .shell { padding: 0; }
  body:not([data-view="app"]) .workspace { display: flex; }
  body:not([data-view="app"]) #landing { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; max-width: 760px; margin: auto; padding: 28px 56px; }
  #landing > .landing-art { display: none; }
  #landing .welcome > .eyebrow { display: block; font-size: 14px; font-weight: 600; color: var(--accent-text); margin-bottom: 14px; }
  #heading { font-size: 64px; line-height: 1.02; letter-spacing: -.035em; text-wrap: initial; }
  #landing .intro.dock-only { display: none; }
  #landing .intro.web-only { display: block; font-size: 18px; max-width: 46ch; margin-top: 18px; }
  #connection { margin-top: 28px; }
  #connection #login { width: 280px; min-width: 260px; }
  #loading-placeholder { width: 280px; min-width: 260px; max-width: 100%; }
  #invite-login { min-width: 260px; }
  #connection-note { color: var(--faint); }
  .obs-hint { display: none; }
  #connection-note .web-only { display: block; }
  .landing-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
  .landing-steps li { flex-direction: column; gap: 10px; }
  .page-footer { min-height: 52px; border-top: 1px solid var(--line); padding: 16px 28px; }
  #landing[data-invite="true"] { display: block !important; width: 100%; }
}
@media (min-width: 1100px) {
  body:not([data-view="app"]) #landing { max-width: none; grid-template-columns: minmax(0, 1fr) 500px; column-gap: 40px; padding: 28px 48px 28px 56px; }
  #landing > .landing-art { display: grid; grid-column: 2; grid-row: 1 / 4; height: 540px; width: 500px; margin: 0; overflow: visible; }
  .ticket-fan { zoom: 1; }
  .fan-left, .fan-right { display: flex; }
  #landing > .welcome, #landing > #connection, #landing > .landing-steps { grid-column: 1; }
  #landing > .welcome { grid-row: 1; } #landing > #connection { grid-row: 2; } #landing > .landing-steps { grid-row: 3; }
}
/* Final copy and spacing refinements. */
.button { font-size: 15px; min-height: 48px; border-radius: 10px; }
.quiet-button, .text-button { font-size: 14px; }
.landing-steps p.dock-only { display: block; }
.landing-steps p.web-only { display: none; }
#landing[data-invite="true"] #connection, #landing[data-invite="true"] .landing-art, #landing[data-invite="true"] .landing-steps { display: none; }
@media (max-height: 700px) and (max-width: 759px) { .landing-steps p.dock-only { display: none; } }
@media (min-width: 760px) { .landing-steps p.dock-only { display: none; } .landing-steps p.web-only { display: block; } }
#host-context[data-offline="true"]::before { display: none; }
#host-context > svg { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }

.loading-control { flex: 1; min-height: 48px; }
.loading-control > span { width: 36px; height: 9px; background: var(--line); border-radius: 5px; }
.front-scroll, .details-scroll, .saved-scroll, .view-scroll { scrollbar-width: thin; -webkit-mask-image: linear-gradient(#000 calc(100% - 20px), transparent); mask-image: linear-gradient(#000 calc(100% - 20px), transparent); }
@media (min-width: 760px) { body:not([data-view="app"]) .topbar .brand { font-size: 17px; text-transform: lowercase; } body:not([data-view="app"]) .topbar .brand-second { display: block; color: var(--muted); font-weight: 500; } body:not([data-view="app"]) .topbar .brand-mark svg { width: 30px; height: 34px; } }
/* Type roles and base components from the foundations table. */
.card-stats dt, .detail-section h4, .clip-role, .retention-label h4, .note-counter { line-height: 1.35; }
.card-stats dd { line-height: 1.2; }
.card-category, .row-copy strong { line-height: 1.35; }
.channel-link, .host-context, .viewer-chip, .clip-meta, .row-copy > span { line-height: 1.4; }
.reason-chips li { font-size: 13px; line-height: 1.4; padding: 3px 9px; }
.tag { font-size: 13px; line-height: 1.4; padding: 3px 9px; border-color: var(--line); border-radius: 7px; }
.crew-chip, .crew-member .tag, .retention-label .tag { font-size: 12px; line-height: 1.35; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line-2); }
.primary { font-size: 16px; font-weight: 700; line-height: 1.2; border-radius: 11px; }
.primary:hover { background: var(--accent); filter: brightness(1.07); }
.primary:disabled { background: var(--raised); color: var(--faint); border: 1px dashed var(--line-2); opacity: 1; cursor: not-allowed; filter: none; }
.quiet-button, .secondary { color: var(--text); background: var(--surface); border-radius: 11px; font-weight: 600; }
.stub .quiet-button, .receipt-actions .quiet-button { font-size: 15px; line-height: 1.35; }
.quiet-button:hover, .secondary:hover { background: var(--raised); }
.quiet-button[aria-pressed="true"] { background: var(--raised); border-color: var(--accent); }
.text-button { color: var(--accent-text); }
.danger-text { color: var(--bad); }
.sheet .primary { font-size: 15px; }
.sheet .functional-panel input:not([type="checkbox"]) { font-size: 15px; border-radius: 10px; }
.feature-message { font-size: 14px; border: 1px solid var(--line); border-radius: 10px; }
#crews-message { color: var(--ok); }
.icon-button { background: transparent; border-radius: 10px; }
.avatar, .card-avatar, .small-avatar { background: var(--raised); color: var(--text); border: 1px solid var(--line-2); }
.workspace-nav button[data-unseen="true"]::after { width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--bg); }
.details-scroll:focus-visible, .front-scroll:focus-visible, .saved-scroll:focus-visible { outline-offset: -3px; }
@media (max-width: 339px) { #start-raid { font-size: 15px; } }
.topbar .brand { min-height: 44px; }
.feature-message[data-tone="bad"] { color: var(--bad); }
.feature-message[data-tone="ok"] { color: var(--ok); }
body:not([data-view="app"]) .workspace { justify-content: flex-start; align-items: stretch; width: 100%; }
body:not([data-view="app"]) #landing { flex: 1; }
.sheet .functional-panel label { margin: 0; color: var(--text); font-size: 15px; }
.sheet .functional-panel .switch-row { display: flex; min-height: 44px; }
.sheet .functional-panel fieldset > button { margin-top: 0; justify-content: center; }
.sheet .functional-panel legend { margin-bottom: 0; padding-bottom: 12px; font-size: 20px; font-weight: 650; }
.sheet .functional-panel .switch-track { display: block; }
.account-menu > .chatter-access { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
.chatter-access h3 { grid-column: 1; grid-row: 1; font-size: 14px; font-weight: 600; }
#chatter-access-status { grid-column: 1; grid-row: 2; margin: 0; }
.chatter-access #enable-chatters { grid-column: 2; grid-row: 1 / 3; align-self: start; font-size: 14px; min-height: 44px; }
#chatter-help { grid-column: 1 / -1; margin: 6px 0 0; }
.feature-message, #auth-message, #hand-notice { display: flex; align-items: flex-start; gap: 8px; }
.feature-message > svg, #auth-message > svg, #hand-notice > svg { width: 16px; height: 20px; flex: none; }
.live-chip { background: #E0C8FF; color: #291239; }
.viewer-chip, .mature-chip { background: rgb(14 11 20 / .84); }
.offline-chip { background: rgb(14 11 20 / .84); color: #EDCB99; }
.card-avatar { font-size: 18px; }
.small-avatar, #card-back .card-avatar { font-size: 14px; }
.crew-chip { background: var(--raised); color: var(--muted); font-weight: 600; }
#auth-message, #saved-status[data-tone="warn"], #hand-alert { border-color: color-mix(in oklab, var(--warn) 45%, transparent); background: color-mix(in oklab, var(--warn) 10%, var(--surface)); }
.feature-message[data-tone="bad"], #auth-message[data-tone="bad"] { color: var(--text); border-color: color-mix(in oklab, var(--bad) 45%, transparent); background: color-mix(in oklab, var(--bad) 10%, var(--surface)); }
.feature-message[data-tone="bad"] > svg, #auth-message[data-tone="bad"] > svg { color: var(--bad); }
.feature-message[data-tone="ok"] { color: var(--text); }
.feature-message[data-tone="ok"] > svg { color: var(--ok); }
.account-menu, .skipped-panel { opacity: 0; transition: opacity 100ms, display 100ms allow-discrete, overlay 100ms allow-discrete; }
.account-menu:popover-open, .skipped-panel:popover-open { opacity: 1; }
.sheet { opacity: 0; transition: opacity 120ms, display 120ms allow-discrete, overlay 120ms allow-discrete; }
.sheet[open] { opacity: 1; }
[popover]:not(:popover-open), dialog:not([open]) { pointer-events: none; }
@media (min-width: 760px) { body[data-view="app"] { height: max(100dvh, 752px); overflow: auto; } html:has(body[data-view="app"]) { overflow: auto; } }
@media (prefers-reduced-motion: reduce) {
  .account-menu:popover-open, .skipped-panel:popover-open, .floating-alert:not([hidden]), .sheet[open] { animation: overlay-fade 120ms linear !important; }
}
#event-connection #retry-menu-slot { padding: 8px 0 0; border: 0; }
#event-connection #retry { width: auto; min-height: 44px; font-size: 14px; padding: 8px 12px; }
.front-extra .clip-link { padding-block: 0; }
.card-identity h3 { line-height: 1.2; }
.channel-link { margin-top: 0; }
#card-back .card-identity h3 { line-height: 1.25; }
#new-hand { justify-self: end; }
.retention-value > strong { line-height: 1; }
.button { height: 48px; padding-block: 0; }
.button .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#start-raid .label { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.stub .quiet-button, .crew-action-bar .quiet-button { height: 48px; padding-block: 0; }
.sheet .button { justify-content: center; }
.destructive { font-weight: 700; line-height: 1.35; }
@media (min-width: 760px) { body[data-view="app"] .topbar .brand { text-transform: lowercase; } }
@media (max-height: 559px) and (max-width: 759px) { body[data-view="app"] #discovery { height: 516px; } #raid-card { flex: none; height: 400px; min-height: 400px; } }

/* Chat vote uses the existing sheet, secondary controls and ticket stub. */
.poll-candidates { display: grid; max-height: 260px; overflow-y: auto; }
.sheet .poll-candidate { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 2px 0; cursor: pointer; }
.sheet .poll-candidate input { flex: none; width: 20px; height: 44px; min-height: 44px; margin: 0; padding: 0; accent-color: var(--accent); }
.poll-candidate-copy { display: grid; gap: 2px; min-width: 0; }
.poll-candidate-copy strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-candidate-copy > span { font-size: 13px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-disclosure { font-size: 12px; color: var(--faint); margin: 0; }
#chat-vote-selection { color: var(--warn); }
#chat-vote-duration button { width: auto; }
#chat-vote-heading { margin: 0; }
#chat-vote-explanation { margin: 0; color: var(--muted); }
.chat-poll-block { padding: 10px 12px 0; max-height: 50cqh; overflow-y: auto; }
.poll-heading { display: flex; align-items: flex-start; gap: 4px; }
.poll-heading .receipt-title { flex: 1; margin: 4px 0 8px; font-size: 14px; font-weight: 650; color: var(--text); }
#dismiss-chat-poll { flex: none; width: 44px; height: 44px; margin-top: -4px; }
.poll-results { display: grid; gap: 6px; }
.poll-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.poll-choice-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.poll-result[data-leader="true"] { color: var(--text); }
.poll-track { grid-column: 1 / -1; height: 4px; border-radius: 3px; overflow: hidden; background: var(--raised); }
.poll-bar { display: block; width: var(--vote-share, 0%); height: 100%; border-radius: inherit; background: var(--accent); }
.poll-actions > button { flex: 1; padding-inline: 8px; }
.poll-recovery { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.poll-recovery > * { min-height: 44px; }
#chat-poll-error { margin: 4px 0 0; font-size: 13px; }
.avatar-tab[data-poll-winner="true"] .small-avatar { outline: 2px solid var(--ok); outline-offset: 1px; }
.rail-card[data-poll-winner="true"] .rail-copy strong { color: var(--ok); }
@media (max-width: 339px) { #chat-vote .label { display: none; } }
