:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #eef1f5;
  --line: #e2e5ea;
  --text: #14171c;
  --muted: #6b7280;
  --accent: #0f8a6f;
  --accent-ink: #ffffff;
  --danger: #c0362c;
  --bubble-mine: #0f8a6f;
  --bubble-mine-ink: #ffffff;
  --bubble-theirs: #ffffff;
  --shadow: 0 8px 24px rgba(20, 23, 28, 0.06);
}

body[data-theme="dark"], @media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --panel: #161b22;
    --panel-2: #21262d;
    --line: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #2ea043;
    --accent-ink: #ffffff;
    --danger: #f85149;
    --bubble-mine: #238636;
    --bubble-mine-ink: #ffffff;
    --bubble-theirs: #21262d;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

body[data-theme="dark"] {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #21262d;
  --line: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #2ea043;
  --accent-ink: #ffffff;
  --danger: #f85149;
  --bubble-mine: #238636;
  --bubble-mine-ink: #ffffff;
  --bubble-theirs: #21262d;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
}
button:disabled { opacity: .45; cursor: not-allowed; }
input, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--text);
  width: 100%;
}
textarea { resize: none; }

#app { height: 100%; }

.app-shell {
  height: 100%;
  display: grid;
  grid-template-columns: 76px minmax(280px, 360px) 1fr;
}

/* Rail nav */
.rail {
  background: #101418;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 10px;
}
.rail .logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent);
  display: grid; place-items: center;
  font-weight: 700;
  margin-bottom: 12px;
}
.rail button {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 12px;
  color: #9aa4b2;
  display: grid; place-items: center;
  font-size: 20px;
}
.nav-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.conn-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: #6b7280;
  margin-bottom: 8px;
}
.conn-dot.live { background: #22c55e; }
.rail button.active { background: rgba(255,255,255,.12); color: #fff; }
.rail .spacer { flex: 1; }

/* List pane */
.pane-list {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pane-list header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.pane-list header h1 { font-size: 20px; margin: 0; }
.search-bar { padding: 10px 16px; border-bottom: 1px solid var(--panel-2); }
.search-bar input { border-radius: 999px; background: var(--panel-2); border-color: transparent; }
.unread-dot {
  min-width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
  padding: 0 5px;
  flex-shrink: 0;
  align-self: center;
}
.archived-toggle { margin: 10px 16px; font-size: 12.5px; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--panel-2);
  display: grid; place-items: center;
  font-size: 16px;
}
.icon-btn:hover { background: var(--line); }
.list { overflow-y: auto; flex: 1; }
.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-2);
  cursor: pointer;
}
.contact-row:hover, .contact-row.active { background: var(--panel-2); }
.avatar {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f8a6f, #1f4b8f);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.contact-meta { min-width: 0; flex: 1; }
.contact-meta .name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.contact-meta .preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff3d6;
  color: #8a5a00;
}
.badge-muted { background: var(--panel-2); color: var(--muted); }
.request-detail { display: flex; align-items: center; gap: 10px; }
.request-note {
  background: var(--panel-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-style: italic;
}
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

/* Thread pane */
.pane-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}
.thread-header {
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.thread-header .back { display: none; font-size: 20px; }
.thread-header .title { flex: 1; min-width: 0; }
.thread-header .title strong { display: block; }
.thread-header .title span { color: var(--muted); font-size: 12px; }
.thread-actions { display: flex; gap: 6px; }
.thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble-row { display: flex; align-items: center; gap: 4px; }
.bubble-row.mine { justify-content: flex-end; }
.bubble-actions {
  display: none;
  gap: 2px;
}
.bubble-row:hover .bubble-actions { display: flex; }
.bubble-actions button {
  width: 26px; height: 26px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 12px;
  color: var(--muted);
}
.reply-quote {
  border-left: 2px solid currentColor;
  opacity: .85;
  padding-left: 8px;
  margin-bottom: 4px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.reply-preview {
  margin: 0 20px;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bubble {
  max-width: 62%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}
.bubble-row.mine .bubble { background: var(--bubble-mine); color: var(--bubble-mine-ink); border-bottom-right-radius: 4px; }
.bubble-row:not(.mine) .bubble { background: var(--bubble-theirs); border-bottom-left-radius: 4px; }
.bubble .time { display: block; font-size: 10px; opacity: .7; margin-top: 4px; }
.bubble.attachment a { color: inherit; text-decoration: underline; }
.system-row { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0; }
.call-row {
  display: flex; align-items: center; gap: 8px;
  align-self: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--muted);
}
.composer {
  padding: 14px 20px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.composer textarea { flex: 1; max-height: 120px; }
.composer .send-btn {
  background: var(--accent);
  color: var(--accent-ink);
  width: 40px; height: 40px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.composer .attach-btn {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--panel-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.pending-notice {
  margin: 12px 20px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff3d6;
  color: #8a5a00;
  font-size: 13px;
}
.attachment-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  margin: 0 20px;
}
.attachment-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.attachment-link { font-size: 12.5px; text-decoration: underline; }

/* Compose mode switcher */
.mode-switch {
  display: flex;
  gap: 4px;
  padding: 8px 20px 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.mode-switch button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
}
.mode-switch button.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
.subject-input { margin: 10px 20px 0; font-weight: 600; }

/* Email-style card (thread) */
.email-card {
  max-width: 76%;
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}
.email-card.mine { border-left-color: var(--accent); }
.email-meta { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.email-subject { font-weight: 700; font-size: 15px; }
.email-body { overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.email-body strong { font-weight: 700; }
.email-body em { font-style: italic; }
.email-quote { border-left: 2px solid var(--line); padding-left: 10px; margin-top: 4px; }
.email-quote blockquote { margin: 4px 0 0; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.email-reply-btn { justify-self: start; margin-top: 4px; font-size: 12.5px; padding: 6px 12px; }

/* Email compose window */
.email-compose { width: min(560px, 100%); text-align: left; display: grid; gap: 12px; }
.email-compose-header { display: flex; align-items: center; justify-content: space-between; }
.email-compose-header h2 { margin: 0; }
.email-field { display: flex; gap: 8px; align-items: center; font-size: 13px; border-bottom: 1px solid var(--panel-2); padding-bottom: 10px; }
.email-field span { color: var(--muted); width: 32px; }
.email-toolbar { display: flex; gap: 4px; }
.email-toolbar button {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--panel-2);
  font-size: 13px;
}
.email-compose-body { min-height: 220px; resize: vertical; font-size: 14.5px; line-height: 1.5; }
.email-attachments { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.email-compose-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Alert card */
.alert-card {
  align-self: center;
  background: #fff3d6;
  color: #8a5a00;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-card .time { font-size: 10px; opacity: .8; margin-left: 6px; }

/* Payment request card */
.payment-card {
  max-width: 78%;
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.payment-head { font-weight: 700; margin-bottom: 4px; }
.payment-memo { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.payment-warning {
  background: #fde8e6;
  color: var(--danger);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  margin-bottom: 8px;
  font-weight: 600;
}
.payment-note {
  background: #fff3d6;
  color: #8a5a00;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  margin-bottom: 8px;
}
.payment-note.ok { background: #e4f6ee; color: #0f6b46; }
.payment-details { display: grid; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.payment-details div { display: flex; justify-content: space-between; gap: 10px; }
.payment-details span { color: var(--muted); }
.payment-card .time { display: block; font-size: 10px; color: var(--muted); margin-top: 8px; }

.payment-form {
  padding: 10px 20px 14px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

/* Overlay / sheet */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 18, 22, .45);
  display: grid; place-items: center;
  z-index: 20;
  padding: 20px;
}
.sheet {
  background: var(--panel);
  border-radius: 16px;
  padding: 22px;
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.sheet h2 { margin: 0; font-size: 18px; }
.sheet .muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 4px;
}
.qr-code { width: 180px; height: 180px; }
.qr-scanner {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.qr-scanner video { width: 100%; height: 100%; object-fit: cover; }
.qr-scanner-frame {
  position: absolute;
  inset: 15%;
  border: 3px solid rgba(255,255,255,.85);
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.25);
  pointer-events: none;
}
.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 10px;
  word-break: break-all;
  max-height: 90px;
  overflow-y: auto;
}
.btn {
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--panel-2);
  text-align: center;
  font-weight: 600;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.row { display: flex; gap: 8px; }
.checkboxes { display: flex; gap: 10px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.check input { width: auto; }
.row > * { flex: 1; }

/* Security alert banner (e.g. "new device added") */
.security-alert-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--danger); color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  z-index: 40;
  max-width: 420px;
}
.security-alert-banner .icon { font-size: 20px; line-height: 1; }
.security-alert-banner .body { flex: 1; min-width: 0; }
.security-alert-banner .sub { font-size: 12px; opacity: .9; margin-top: 2px; }
.security-alert-banner .actions { display: flex; flex-direction: column; gap: 6px; }
.security-alert-banner .btn.primary { background: #fff; color: var(--danger); }
.security-alert-banner .btn.ghost { color: #fff; }

/* Incoming call banner */
.call-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: #101418; color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  z-index: 30;
}
.call-banner strong { display: block; }
.call-banner .sub { font-size: 12px; color: #a7b0bd; }
.call-banner .actions { display: flex; gap: 8px; }
.call-banner .accept { background: var(--accent); color: #fff; border-radius: 999px; padding: 8px 14px; }
.call-banner .decline { background: var(--danger); color: #fff; border-radius: 999px; padding: 8px 14px; }

.call-sheet { max-width: 480px; }
.call-video-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #101418; border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.call-video-wrap .remote-video { width: 100%; height: 100%; object-fit: cover; }
.call-video-wrap .local-video { position: absolute; right: 10px; bottom: 10px; width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid rgba(255,255,255,.6); }

/* Onboarding */
.onboard-wrap {
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #0f8a6f 0%, #101418 100%);
  padding: 20px;
}
.onboard-card {
  background: var(--panel);
  border-radius: 20px;
  padding: 32px;
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.onboard-card h1 { margin: 0; font-size: 26px; }
.onboard-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.invite-banner {
  margin: 0;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Settings */
.settings-view { max-width: 560px; margin: 0 auto; padding: 24px; display: grid; gap: 18px; }
.settings-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
}
.settings-section h3 { margin: 0; font-size: 14px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--panel-2); }
.settings-row:first-of-type { border-top: none; padding-top: 0; }
.settings-row .label { font-size: 14px; }
.settings-row .value { color: var(--muted); font-size: 13px; }
.device-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--panel-2); }
.device-row:first-of-type { border-top: none; }
.settings-subsection { padding: 6px 0 6px 12px; border-left: 2px solid var(--panel-2); margin: 4px 0 8px; display: grid; gap: 4px; }

.error-banner {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--danger); color: #fff;
  padding: 10px 16px; border-radius: 10px;
  font-size: 13px;
  z-index: 40;
  max-width: 90vw;
}

.hint-link { font-size: 12px; color: var(--muted); text-align: center; }

/* Structured Communication Objects */
.structured-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 6px 0;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
  max-width: 440px;
}
.structured-card.mine {
  border-left: 4px solid var(--accent);
}
.structured-card:not(.mine) {
  border-left: 4px solid #3b82f6;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}
.card-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--muted);
}
.card-body {
  font-size: 14px;
  line-height: 1.4;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* Migration Assistant */
.migration-preview-box {
  background: var(--panel-2);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.migration-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.migration-stat {
  background: var(--panel);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.migration-stat .num { font-size: 16px; font-weight: 700; color: var(--accent); }
.migration-stat .lbl { font-size: 11px; color: var(--muted); }

/* Reach Badges */
.reach-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
}
.reach-pill.active { background: rgba(15, 138, 111, 0.12); color: var(--accent); }
.reach-pill.pending { background: rgba(234, 179, 8, 0.15); color: #854d0e; }
.reach-pill.revoked { background: rgba(192, 54, 44, 0.12); color: var(--danger); }

/* Command Palette */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  z-index: 100;
}
.cmd-palette {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(580px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: grid;
}
.cmd-input-wrap {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.cmd-input-wrap input {
  border: none;
  background: transparent;
  font-size: 16px;
  padding: 0;
  outline: none;
  width: 100%;
}
.cmd-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 2px;
}
.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.cmd-item:hover, .cmd-item.active {
  background: var(--panel-2);
}
.cmd-key {
  font-size: 11px;
  font-family: monospace;
  background: var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--muted);
}

/* Reactions */
.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.reaction-badge {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform .1s;
}
.reaction-badge:hover {
  transform: scale(1.08);
}
.reaction-badge.mine {
  background: rgba(15, 138, 111, 0.15);
  border-color: var(--accent);
}

/* Pinned Banner */
.pinned-banner {
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Shortcut Grid */
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 13px;
  margin: 12px 0;
}
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 64px;
  }
  .rail {
    order: 2;
    flex-direction: row;
    justify-content: space-around;
    padding: 6px 0;
    width: 100%;
  }
  .rail .logo, .rail .spacer { display: none; }
  .pane-list, .pane-thread { grid-row: 1; }
  .app-shell:not([data-active="detail"]) .pane-thread { display: none; }
  .app-shell[data-active="detail"] .pane-list { display: none; }
  .app-shell { display: grid; }
  .pane-list, .pane-thread { grid-column: 1; width: 100%; }
  .thread-header .back { display: block; }
}


