/* Xu Core design tokens: monochrome dark (default) and light themes. */
:root {
  color-scheme: dark;
  --xu-bg: #09090b;
  --xu-bg-soft: #0d0d10;
  --xu-surface: #111114;
  --xu-surface-2: #17171c;
  --xu-surface-3: #1f1f26;
  --xu-border: #26262e;
  --xu-border-soft: #1c1c22;
  --xu-text: #f4f4f5;
  --xu-text-soft: #d4d4d8;
  --xu-muted: #8b8b96;
  --xu-accent: #e4e4e7;
  --xu-accent-ink: #0a0a0c;
  --xu-danger: #f87171;
  --xu-success: #4ade80;
  --xu-warning: #fbbf24;
  --xu-radius: 18px;
  --xu-radius-sm: 12px;
  --xu-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.85);
  --xu-font-display: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  --xu-font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --xu-font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html[data-theme='light'] {
  color-scheme: light;
  --xu-bg: #f6f6f7;
  --xu-bg-soft: #efeff1;
  --xu-surface: #ffffff;
  --xu-surface-2: #f7f7f8;
  --xu-surface-3: #ececed;
  --xu-border: #e2e2e6;
  --xu-border-soft: #ebebee;
  --xu-text: #111114;
  --xu-text-soft: #2a2a31;
  --xu-muted: #62626d;
  --xu-accent: #18181b;
  --xu-accent-ink: #fafafa;
  --xu-shadow: 0 24px 60px -40px rgba(15, 15, 20, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--xu-bg);
  color: var(--xu-text);
  font-family: var(--xu-font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { font-family: var(--xu-font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; }
code, pre, .xu-mono { font-family: var(--xu-font-mono); }

::selection { background: var(--xu-accent); color: var(--xu-accent-ink); }

/* scrollbars stay quiet so the UI reads as one surface */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--xu-border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--xu-surface-3); }

.xu-shell { display: flex; min-height: 100dvh; background: var(--xu-bg); }
.xu-sidebar {
  width: 248px;
  flex: 0 0 248px;
  border-right: 1px solid var(--xu-border-soft);
  background: var(--xu-bg-soft);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.xu-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.xu-brand canvas { display: block; height: 28px; width: 148px; }
.xu-brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(150deg, var(--xu-accent), var(--xu-surface-3));
  color: var(--xu-accent-ink);
  display: grid; place-items: center;
  font-family: var(--xu-font-display); font-weight: 700; font-size: 15px;
}
.xu-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--xu-muted); font-weight: 500; font-size: 14px;
  transition: background 160ms ease, color 160ms ease;
  cursor: pointer; border: 1px solid transparent; background: none; width: 100%; text-align: left;
}
.xu-nav-link:hover { background: var(--xu-surface-2); color: var(--xu-text); }
.xu-nav-link.is-active { background: var(--xu-surface); color: var(--xu-text); border-color: var(--xu-border); }
.xu-nav-link svg { width: 18px; height: 18px; flex: 0 0 18px; }

.xu-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.xu-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--xu-border-soft);
  background: color-mix(in srgb, var(--xu-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 30;
}
.xu-content { padding: 22px 20px 96px; max-width: 1280px; width: 100%; margin: 0 auto; }

.xu-card {
  background: var(--xu-surface);
  border: 1px solid var(--xu-border);
  border-radius: var(--xu-radius);
  padding: 18px;
  box-shadow: var(--xu-shadow);
}
.xu-card-flat { background: var(--xu-surface-2); border: 1px solid var(--xu-border-soft); border-radius: var(--xu-radius-sm); padding: 14px; }
.xu-card-title { font-family: var(--xu-font-display); font-size: 15px; font-weight: 600; }
.xu-card-sub { color: var(--xu-muted); font-size: 12.5px; }

.xu-grid { display: grid; gap: 14px; }
.xu-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xu-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xu-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.xu-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid var(--xu-border);
  background: var(--xu-surface); color: var(--xu-text);
  padding: 9px 14px; font-size: 13.5px; font-weight: 550;
  cursor: pointer; transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}
.xu-btn:hover { background: var(--xu-surface-2); }
.xu-btn:active { transform: scale(0.985); }
.xu-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.xu-btn-primary { background: var(--xu-accent); color: var(--xu-accent-ink); border-color: transparent; }
.xu-btn-primary:hover { background: color-mix(in srgb, var(--xu-accent) 88%, var(--xu-bg)); }
.xu-btn-ghost { background: transparent; border-color: transparent; color: var(--xu-muted); }
.xu-btn-ghost:hover { background: var(--xu-surface-2); color: var(--xu-text); }
.xu-btn-danger { border-color: color-mix(in srgb, var(--xu-danger) 40%, var(--xu-border)); color: var(--xu-danger); }
.xu-btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 11px; }

.xu-input, .xu-select, .xu-textarea {
  width: 100%; background: var(--xu-surface-2); color: var(--xu-text);
  border: 1px solid var(--xu-border); border-radius: 12px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  transition: border-color 160ms ease, background 160ms ease;
}
.xu-input:focus, .xu-select:focus, .xu-textarea:focus {
  outline: none; border-color: color-mix(in srgb, var(--xu-accent) 55%, var(--xu-border));
  background: var(--xu-surface);
}
.xu-textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.xu-label { display: block; font-size: 12px; color: var(--xu-muted); margin-bottom: 6px; font-weight: 550; }
.xu-hint { font-size: 11.5px; color: var(--xu-muted); }

.xu-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; border: 1px solid var(--xu-border);
  padding: 5px 11px; font-size: 12px; color: var(--xu-muted);
  background: var(--xu-surface); cursor: pointer; font-weight: 550;
}
.xu-pill.is-active { background: var(--xu-accent); color: var(--xu-accent-ink); border-color: transparent; }

.xu-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--xu-border);
  color: var(--xu-muted); background: var(--xu-surface-2);
}
.xu-badge-ok { color: var(--xu-success); border-color: color-mix(in srgb, var(--xu-success) 35%, transparent); }
.xu-badge-warn { color: var(--xu-warning); border-color: color-mix(in srgb, var(--xu-warning) 35%, transparent); }
.xu-badge-danger { color: var(--xu-danger); border-color: color-mix(in srgb, var(--xu-danger) 35%, transparent); }

.xu-switch { position: relative; display: inline-flex; width: 40px; height: 22px; flex: 0 0 40px; }
.xu-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.xu-switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--xu-surface-3);
  border: 1px solid var(--xu-border); transition: background 160ms ease;
}
.xu-switch span::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--xu-muted); transition: transform 160ms ease, background 160ms ease;
}
.xu-switch input:checked + span { background: color-mix(in srgb, var(--xu-accent) 30%, var(--xu-surface-3)); }
.xu-switch input:checked + span::after { transform: translateX(18px); background: var(--xu-accent); }

.xu-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: var(--xu-surface-3); border: 1px solid var(--xu-border);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--xu-text-soft);
  flex: 0 0 auto; overflow: hidden;
}
.xu-avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.xu-avatar-sm { width: 26px; height: 26px; font-size: 10px; }

/* cyber toast stack */
#cyberToastStack {
  position: fixed; z-index: 9000; right: 16px; bottom: 20px;
  display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.cyber-toast {
  pointer-events: auto; display: flex; gap: 11px; align-items: flex-start;
  background: var(--xu-surface); border: 1px solid var(--xu-border);
  border-radius: 14px; padding: 12px 14px; box-shadow: var(--xu-shadow);
  animation: cyberToastIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.cyber-toast.is-leaving { animation: cyberToastOut 180ms ease forwards; }
.cyber-toast-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 8px; background: var(--xu-accent); }
.cyber-toast[data-variant='success'] .cyber-toast-dot { background: var(--xu-success); }
.cyber-toast[data-variant='warn'] .cyber-toast-dot { background: var(--xu-warning); }
.cyber-toast[data-variant='error'] .cyber-toast-dot { background: var(--xu-danger); }
.cyber-toast-title { font-size: 13px; font-weight: 650; }
.cyber-toast-message { font-size: 12.5px; color: var(--xu-muted); word-break: break-word; }
@keyframes cyberToastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes cyberToastOut { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* custom confirm modal */
.xu-modal-backdrop {
  position: fixed; inset: 0; z-index: 9100;
  background: rgba(5, 5, 8, 0.62); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: cyFadeIn 160ms ease;
}
.xu-modal {
  width: min(440px, 100%); background: var(--xu-surface);
  border: 1px solid var(--xu-border); border-radius: 20px; padding: 20px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
  animation: cyPop 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cyFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cyPop { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

/* chat layout */
.xu-chat-shell { display: flex; height: 100dvh; overflow: hidden; }
.xu-chat-rail { width: 92px; flex: 0 0 92px; border-right: 1px solid var(--xu-border-soft); background: var(--xu-bg-soft); display: flex; flex-direction: column; align-items: center; padding: 16px 8px; gap: 10px; }
.xu-chat-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; position: relative; }
.xu-chat-home { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.xu-chat-room { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.xu-room-messages { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px 4px; overscroll-behavior: contain; }

.xu-chat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 16px; border: 1px solid transparent;
  cursor: pointer; transition: background 150ms ease, border-color 150ms ease;
  position: relative; background: var(--xu-surface);
}
.xu-chat-card:hover { border-color: var(--xu-border); }
.xu-chat-card.is-selected { border-color: var(--xu-accent); background: var(--xu-surface-2); }
.xu-chat-card-meta { flex: 1 1 auto; min-width: 0; }
.xu-chat-card-title { font-size: 14px; font-weight: 620; display: flex; align-items: center; gap: 6px; }
.xu-chat-card-sub { font-size: 12.5px; color: var(--xu-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xu-chat-card-time { font-size: 11px; color: var(--xu-muted); flex: 0 0 auto; }
.xu-unread-dot { min-width: 19px; height: 19px; border-radius: 999px; background: var(--xu-accent); color: var(--xu-accent-ink); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

/* bubbles */
.xu-bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.xu-bubble-row.is-mine { flex-direction: row-reverse; }
.xu-bubble {
  max-width: min(78%, 560px); padding: 9px 12px; border-radius: 18px;
  background: var(--xu-surface-2); border: 1px solid var(--xu-border-soft);
  position: relative; word-break: break-word;
}
.xu-bubble.is-mine { background: color-mix(in srgb, var(--xu-accent) 12%, var(--xu-surface-2)); border-color: color-mix(in srgb, var(--xu-accent) 22%, var(--xu-border-soft)); }
.xu-bubble-time { font-size: 10px; color: var(--xu-muted); margin-top: 4px; text-align: right; }
.xu-bubble-author { font-size: 12px; font-weight: 650; display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.xu-bubble-text { font-size: 14px; white-space: pre-wrap; line-height: 1.5; }
.xu-bubble-tail { position: absolute; top: 0; width: 12px; height: 14px; }
.xu-bubble-tail.is-left { left: -7px; }
.xu-bubble-tail.is-right { right: -7px; transform: scaleX(-1); }

/* hex role badges */
.role-hex-developer, .role-hex-member {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; font-size: 8px; font-weight: 800;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}
.role-hex-developer { background: var(--xu-accent); color: var(--xu-accent-ink); }
.role-hex-member { background: var(--xu-surface-3); color: var(--xu-text-soft); }

/* floating action bars */
#floatingTopActionBar, #floatingReactionBar {
  position: fixed; z-index: 8000; display: none; gap: 4px;
  background: var(--xu-surface); border: 1px solid var(--xu-border);
  border-radius: 13px; padding: 5px; box-shadow: var(--xu-shadow);
}
#floatingTopActionBar.is-open, #floatingReactionBar.is-open { display: flex; }
#floatingTopActionBar button, #floatingReactionBar button {
  border: none; background: transparent; border-radius: 9px; padding: 7px 9px;
  font-size: 12px; cursor: pointer; color: var(--xu-text-soft); white-space: nowrap;
}
#floatingTopActionBar button:hover, #floatingReactionBar button:hover { background: var(--xu-surface-2); }
#floatingReactionBar button { font-size: 18px; padding: 5px 7px; }

/* chat home selection bar */
#chatHomeSelectionBar {
  position: sticky; bottom: 10px; z-index: 20; display: none; gap: 6px;
  background: var(--xu-surface); border: 1px solid var(--xu-border);
  border-radius: 14px; padding: 8px; box-shadow: var(--xu-shadow);
}
#chatHomeSelectionBar.is-open { display: flex; }

/* docked emoji & sticker sheet */
#stickerBottomSheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8200;
  height: 38dvh; min-height: 232px;
  background: var(--xu-surface); border-top: 1px solid var(--xu-border);
  border-radius: 20px 20px 0 0; box-shadow: 0 -30px 70px -40px rgba(0, 0, 0, 0.9);
  transform: translateY(102%); transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), height 200ms ease;
  display: flex; flex-direction: column; overflow: hidden;
}
#stickerBottomSheet.is-open { transform: translateY(0); }
#stickerBottomSheet.xu-sheet-expanded { height: 72dvh; }
#stickerSheetDragHandle { padding: 8px 0 4px; display: grid; place-items: center; cursor: grab; touch-action: none; }
#stickerSheetDragHandle::before { content: ''; width: 42px; height: 4px; border-radius: 999px; background: var(--xu-surface-3); }
#emojiGrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; padding: 6px 10px 16px; overflow-y: auto; }
#emojiGrid button { border: none; background: transparent; font-size: 24px; line-height: 1; padding: 5px 0; border-radius: 9px; cursor: pointer; }
#emojiGrid button:hover { background: var(--xu-surface-2); }

/* media composer + album viewer */
#chatMediaComposerModal, #chatAlbumViewerModal, #stickerFavoriteSheetOverlay, #accountSecurityModal {
  position: fixed; inset: 0; z-index: 8600; display: none;
  background: rgba(4, 4, 7, 0.78); backdrop-filter: blur(8px);
}
#chatMediaComposerModal.is-open, #chatAlbumViewerModal.is-open, #stickerFavoriteSheetOverlay.is-open, #accountSecurityModal.is-open { display: flex; }
#chatAlbumViewerModal { overflow-y: auto; scroll-snap-type: y mandatory; background: #050507; flex-direction: column; }
.xu-album-slide { height: 100dvh; scroll-snap-align: center; display: grid; place-items: center; padding: 12px; }
.xu-album-slide img, .xu-album-slide video { max-width: 100%; max-height: 100dvh; object-fit: contain; border-radius: 8px; }

/* terminal */
#terminalLogOutput {
  font-family: var(--xu-font-mono); font-size: 12px; line-height: 1.65;
  background: #07070a; color: #d6d6dc; border-radius: 12px;
  padding: 12px; height: 320px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}
[data-theme='light'] #terminalLogOutput { background: #101014; color: #e6e6ea; }
.terminal-line[data-level='ok'] { color: #7ee2a8; }
.terminal-line[data-level='warn'] { color: #f5d27a; }
.terminal-line[data-level='error'] { color: #ff9b9b; }
.terminal-line[data-level='msg'] { color: #9fd1ff; }

/* code editor with line numbers */
.xu-editor-wrap { display: flex; border: 1px solid var(--xu-border); border-radius: 12px; overflow: hidden; background: #0b0b0f; }
#editorLineNumbersGutter {
  font-family: var(--xu-font-mono); font-size: 12px; line-height: 20px;
  padding: 12px 8px; text-align: right; color: #5c5c68; background: #08080b;
  user-select: none; min-width: 42px; overflow: hidden;
}
#pluginCodeEditor {
  flex: 1 1 auto; min-height: 340px; resize: vertical;
  background: transparent; color: #e6e6ea; border: none; outline: none;
  font-family: var(--xu-font-mono); font-size: 12px; line-height: 20px; padding: 12px;
  white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
#developerErrorReportBox { display: none; margin-top: 10px; border-radius: 12px; padding: 10px 12px; font-family: var(--xu-font-mono); font-size: 12px; }
#developerErrorReportBox.is-visible { display: block; }
#developerErrorReportBox.is-error { background: rgba(248, 113, 113, 0.1); color: #ffb4b4; border: 1px solid rgba(248, 113, 113, 0.3); }
#developerErrorReportBox.is-ok { background: rgba(74, 222, 128, 0.08); color: #9ff0bc; border: 1px solid rgba(74, 222, 128, 0.28); }

/* charts */
.xu-chart-box { position: relative; height: 190px; }
.xu-chart-box canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* voice note player */
.xu-vn { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.xu-vn-play { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--xu-surface-3); color: var(--xu-text); display: grid; place-items: center; cursor: pointer; flex: 0 0 34px; }
.xu-vn-play svg { width: 15px; height: 15px; }
.xu-vn-body { flex: 1 1 auto; min-width: 0; }
.xu-vn-track { position: relative; height: 5px; border-radius: 999px; background: var(--xu-surface-3); cursor: pointer; }
.xu-vn-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 999px; background: var(--xu-success); }
.xu-vn-duration { font-family: var(--xu-font-mono); font-size: 10.5px; color: var(--xu-muted); margin-top: 4px; }
.xu-vn-mic { width: 15px; height: 15px; border-radius: 50%; background: var(--xu-success); color: #06240f; display: grid; place-items: center; }
.xu-vn-mic svg { width: 9px; height: 9px; }

/* voice recording bar */
#voiceNoteRecordingBar {
  display: none; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 999px; background: var(--xu-surface-2); border: 1px solid var(--xu-border);
  transition: transform 160ms ease;
}
#voiceNoteRecordingBar.is-recording { display: flex; }
#voiceNoteRecordingBar.is-cancel { transform: translateX(-72px); border-color: var(--xu-danger); }
#voiceNoteTimer { font-family: var(--xu-font-mono); font-size: 13px; color: var(--xu-danger); }

/* emoji-only messages */
.xu-emoji-only { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.xu-emoji-only img, .xu-emoji-only span.emoji { display: inline-block; line-height: 1; }

/* sticker sheet + grid */
#stickerSheetPanel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px 12px 18px; overflow-y: auto; }
.xu-sticker-item { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--xu-surface-2); border: 1px solid var(--xu-border-soft); cursor: pointer; display: grid; place-items: center; }
.xu-sticker-item img { width: 100%; height: 100%; object-fit: contain; }

/* splash */
#xuSplashScreen {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center;
  background: var(--xu-bg); transition: opacity 420ms ease, visibility 420ms ease;
}
#xuSplashScreen.is-hidden { opacity: 0; visibility: hidden; }
.xu-splash-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.xu-splash-ring { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--xu-border); border-top-color: var(--xu-accent); animation: xuSpin 900ms linear infinite; }
@keyframes xuSpin { to { transform: rotate(360deg); } }
.xu-splash-label { font-family: var(--xu-font-mono); font-size: 11px; letter-spacing: 0.22em; color: var(--xu-muted); text-transform: uppercase; }

/* responsive */
@media (max-width: 1024px) {
  .xu-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xu-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .xu-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-102%); transition: transform 200ms ease; z-index: 100; }
  .xu-sidebar.is-open { transform: translateX(0); }
  .xu-grid-2, .xu-grid-3, .xu-grid-4 { grid-template-columns: 1fr; }
  .xu-content { padding: 16px 14px 96px; }
  .xu-chat-rail { width: 66px; flex: 0 0 66px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* utility */
.xu-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.xu-row { display: flex; align-items: center; gap: 10px; }
.xu-row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.xu-col { display: flex; flex-direction: column; gap: 10px; }
.xu-grow { flex: 1 1 auto; min-width: 0; }
.xu-wrap { flex-wrap: wrap; }
.xu-muted { color: var(--xu-muted); }
.xu-mono-xs { font-family: var(--xu-font-mono); font-size: 11px; color: var(--xu-muted); }
.xu-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xu-divider { height: 1px; background: var(--xu-border-soft); margin: 4px 0; }
.xu-empty { padding: 28px 12px; text-align: center; color: var(--xu-muted); font-size: 13px; }

/* utility fallbacks so the UI still lays out when the Tailwind CDN is unavailable */
.sr-only, .xu-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.w-10 { width: 40px; } .h-10 { height: 40px; }
.w-7 { width: 28px; } .h-7 { height: 28px; }
.w-\[22px\] { width: 22px; } .h-\[22px\] { height: 22px; }
.w-\[18px\] { width: 18px; } .h-\[18px\] { height: 18px; }
img.xu-emoji { display: inline-block; vertical-align: -0.2em; object-fit: contain; }
.snap-y { scroll-snap-type: y mandatory; }
.snap-mandatory { scroll-snap-type: y mandatory; }
.w-\[78px\] { width: 78px; }
.xu-search-hit { background: color-mix(in srgb, var(--xu-warning) 26%, transparent); }
