/* ── APP PAGE STYLES ──
   Used by: app.html
   Requires: themes.css, base.css
── */

/* ── PAGE SWITCHER ── */
.page { display: none; flex: 1; overflow: hidden; }
.page.active { display: flex; flex-direction: column; overflow: hidden; }

/* ── SIDEBAR SESSIONS LIST (app-specific extension) ── */
.sidebar-sessions {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 10px;
}
.sidebar-sessions::-webkit-scrollbar { width: 3px; }
.sidebar-sessions::-webkit-scrollbar-track { background: transparent; }
.sidebar-sessions::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 12px;
  transition: all var(--transition);
  position: relative;
}
.session-item:hover  { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.session-item.active { background: var(--sidebar-active); color: var(--sidebar-text-active); }

.session-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-active  { background: #4CAF50; }
.dot-idle    { background: rgba(255,255,255,0.2); }

.session-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── DASHBOARD ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border2); }

.card-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
}

/* Token card */
.token-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.token-used  { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; }
.token-total { font-size: 13px; color: var(--text3); margin-bottom: 4px; }

.token-bar-wrap {
  height: 6px;
  background: var(--bg3);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.token-bar {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 1s ease;
}

.token-note {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.token-reset { font-size: 11px; color: var(--text3); }

.token-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 12px;
}
.token-upgrade:hover { background: var(--accent); color: #fff; }

/* Plan card */
.plan-current { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.plan-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--accent-bg);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.plan-name-big  { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: 0.04em; }
.plan-desc-small{ font-size: 12px; color: var(--text3); margin-top: 2px; }

.plan-key-input { display: flex; gap: 8px; margin-top: 12px; }

.input-small {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text);
  outline: none;
}
.input-small:focus { border-color: var(--accent); }
.input-small::placeholder { color: var(--text3); }

.btn-small {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.btn-small:hover { background: var(--accent2); }
.provider-btn { background: var(--bg3); color: var(--text2); border: 1.5px solid var(--border); }
.provider-btn:hover { background: var(--bg2); }
.provider-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Section header */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.03em;
}

/* Session cards (dashboard list) */
.sessions-list { display: flex; flex-direction: column; gap: 10px; }

.stat-item { display: block; }

/* ── ROOM PAGE ── */
.room-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* Chat area */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.chat-topbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-topbar-left { display: flex; align-items: center; gap: 12px; }

.chat-world-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1A0F08, #3d1c0c);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.chat-world-name { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: 0.04em; }
.chat-world-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }

.chat-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg2); color: var(--text); border-color: var(--accent); }
.icon-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.msg {
  display: flex;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background var(--transition);
}
.msg:hover { background: var(--bg2); }

.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}

.av-gm     { background: linear-gradient(135deg, #8B4513, #C4782A); }
.av-p1     { background: linear-gradient(135deg, #2D4A8B, #4A6FBB); }
.av-p2     { background: linear-gradient(135deg, #6B2D8B, #9B5DBB); }
.av-system { background: var(--bg3); font-size: 14px; }

.msg-body { flex: 1; min-width: 0; }

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.msg-name { font-size: 13px; font-weight: 500; color: var(--text); }

.msg-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 8px;
  letter-spacing: 0.03em;
}
.tag-gm     { background: var(--gm-bg);     color: var(--gm-text); }
.tag-player { background: var(--player-bg); color: var(--player-text); }

.msg-time { font-size: 11px; color: var(--text3); }

.msg-regen-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text3);
  font-size: 13px;
  padding: 1px 7px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.6;
}
.msg-regen-btn:hover { background: var(--bg2); color: var(--accent); border-color: var(--accent); }

.msg-edit-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text3);
  cursor: pointer;
  font-size: 12px;
  padding: 1px 6px;
  transition: all var(--transition);
}
.msg-edit-btn:hover { background: var(--bg2); color: var(--accent); border-color: var(--accent); }

.msg-edit-textarea {
  width: 100%;
  min-height: 60px;
  background: var(--bg3);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  padding: 8px 10px;
  resize: vertical;
  box-sizing: border-box;
}
.msg-edit-actions { display: flex; gap: 8px; margin-top: 6px; }
.msg-edit-save, .msg-edit-cancel {
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 4px 12px;
  transition: opacity var(--transition);
}
.msg-edit-save { background: var(--accent); color: #fff; flex: 1; }
.msg-edit-cancel { background: var(--bg3); color: var(--text2); border: 1px solid var(--border2); }
.msg-edit-save:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Dice badges (hardcore d20) ── */
.dice-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  cursor: default;
  user-select: none;
}
.dice-crit      { background: #1a3a1a; color: #4cff6e; border: 1px solid #2a6a2a; }
.dice-success   { background: #1a2e1a; color: #80e880; border: 1px solid #2a4a2a; }
.dice-partial   { background: #2a2a12; color: #d4c44a; border: 1px solid #4a4a1a; }
.dice-fail      { background: #2a1a12; color: #d47a4a; border: 1px solid #4a2a1a; }
.dice-hard-fail { background: #2a1212; color: #d44a4a; border: 1px solid #4a1a1a; }
.dice-crit-fail { background: #1a0808; color: #ff4444; border: 1px solid #6a1010; }

@keyframes dice-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1);   opacity: 1; }
}
.dice-new { animation: dice-pop 0.35s ease-out forwards; }

.chat-model-select {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  font-family: var(--font-ui);
  padding: 0 6px;
  height: 32px;
  max-width: 140px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.chat-model-select:hover, .chat-model-select:focus { border-color: var(--accent); outline: none; }

.msg-text {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text2);
  line-height: 1.65;
}
.msg-text em     { color: var(--text); font-style: italic; }
.msg-text strong { color: var(--accent); font-weight: 600; font-style: normal; }

.msg-gm .msg-text { color: var(--text); font-size: 16px; }

/* ── MARKDOWN (GM messages) ─────────────────────────────────────────────────── */
.msg-text.md { line-height: 1.7; }

/* Paragraph gap (blank line between paragraphs) */
.msg-text.md .md-gap { height: 0.55em; }

/* Headers */
.msg-text.md h1.md-h,
.msg-text.md h2.md-h,
.msg-text.md h3.md-h {
  font-family: var(--font-display);
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
  margin: 0.6em 0 0.2em;
}
.msg-text.md h1.md-h { font-size: 1.25em; }
.msg-text.md h2.md-h { font-size: 1.1em; }
.msg-text.md h3.md-h { font-size: 1em; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text2); }

/* Horizontal rule */
.msg-text.md hr.md-hr {
  border: none;
  border-top: 1px solid var(--border2);
  margin: 0.7em 0;
}

/* Lists */
.msg-text.md ul.md-ul,
.msg-text.md ol.md-ol {
  margin: 0.35em 0 0.35em 1.3em;
  padding: 0;
}
.msg-text.md ul.md-ul { list-style: disc; }
.msg-text.md ol.md-ol { list-style: decimal; }
.msg-text.md li { margin-bottom: 2px; line-height: 1.6; }
.msg-text.md li + li { margin-top: 1px; }

/* Blockquote */
.msg-text.md blockquote.md-bq {
  border-left: 3px solid var(--accent);
  margin: 0.4em 0;
  padding: 4px 12px;
  color: var(--text2);
  font-style: italic;
  background: var(--bg2);
  border-radius: 0 6px 6px 0;
}

/* Inline code */
.msg-text.md code.md-ic {
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.84em;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
  font-style: normal;
}

/* Code block */
.msg-text.md pre.md-pre {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0.5em 0;
  overflow-x: auto;
}
.msg-text.md pre.md-pre code {
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 13px;
  color: var(--text);
  white-space: pre;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}
.msg-text.md .md-lang {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  font-family: var(--font-ui);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}

/* Strong — override base (keep accent color) */
.msg-text.md strong { color: var(--accent); font-weight: 700; }
/* Em — slightly muted for atmosphere */
.msg-text.md em { color: var(--text); font-style: italic; }

.msg-system { text-align: center; padding: 8px 16px; margin: 8px 0; }
.msg-system.thinking .msg-system-text { opacity: 0.7; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
.msg-system-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--system-bg);
  color: var(--system-text);
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 20px;
  font-style: italic;
}
.msg-system-err {
  background: rgba(220, 60, 60, 0.1);
  color: #d94040;
  font-style: normal;
  border: 1px solid rgba(220, 60, 60, 0.2);
}
.retry-btn {
  background: #d94040;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 3px 11px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.retry-btn:hover { background: #b83030; }

/* Trial mode banner */
.trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(var(--accent-rgb, 100,120,200), 0.08);
  border-top: 1px solid rgba(var(--accent-rgb, 100,120,200), 0.2);
  font-size: 13px;
  color: var(--text2);
  flex-shrink: 0;
}
.trial-banner.trial-exhausted {
  background: rgba(220,50,50,0.08);
  border-top-color: rgba(220,50,50,0.2);
  color: var(--danger, #e05);
}
.trial-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

/* Streaming GM bubble — cursor blink while text arrives */
.msg-streaming .msg-text::after {
  content: '▋';
  animation: blink 0.7s step-end infinite;
  margin-left: 1px;
  opacity: 0.7;
}
@keyframes blink { 0%,100% { opacity: 0.7; } 50% { opacity: 0; } }

/* Input area */
.chat-input-area {
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

/* Session finished banner */
.session-end-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  text-align: center;
}
.session-end-icon { font-size: 32px; line-height: 1; }
.session-end-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text1);
  letter-spacing: .02em;
}
.session-end-sub {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}
.session-end-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Manual dice roller (hardcore mode) ── */
.dice-roller {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: rgba(255,200,80,0.04);
  border: 1px solid rgba(255,200,80,0.15);
  border-radius: 12px;
}

.dice-d20-btn {
  position: relative;
  width: 52px; height: 52px;
  background: var(--bg3);
  border: 2px solid var(--border2);
  border-radius: 8px;
  transform: rotate(45deg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
}
.dice-d20-btn:hover:not(:disabled):not(.rolling) {
  border-color: var(--accent);
  transform: rotate(45deg) scale(1.08);
}

.dice-d20-num {
  display: block;
  transform: rotate(-45deg);
  font-size: 20px;
  font-weight: 700;
  color: var(--text2);
  line-height: 1;
  pointer-events: none;
  transition: color 0.2s;
}

@keyframes d20-shake {
  0%   { transform: rotate(45deg) scale(1); }
  20%  { transform: rotate(38deg) scale(1.08); }
  40%  { transform: rotate(52deg) scale(1.08); }
  60%  { transform: rotate(40deg) scale(1.06); }
  80%  { transform: rotate(50deg) scale(1.06); }
  100% { transform: rotate(45deg) scale(1); }
}
.dice-d20-btn.rolling {
  animation: d20-shake 0.11s infinite;
  border-color: var(--accent);
}
.dice-d20-btn.rolling .dice-d20-num { color: var(--accent); }

/* Rolled state — colour variants match .dice-crit etc */
.dice-d20-btn.rolled.dice-crit      { border-color: #4cff6e; background: #1a3a1a; }
.dice-d20-btn.rolled.dice-crit      .dice-d20-num { color: #4cff6e; }
.dice-d20-btn.rolled.dice-success   { border-color: #80e880; background: #1a2e1a; }
.dice-d20-btn.rolled.dice-success   .dice-d20-num { color: #80e880; }
.dice-d20-btn.rolled.dice-partial   { border-color: #d4c44a; background: #2a2a12; }
.dice-d20-btn.rolled.dice-partial   .dice-d20-num { color: #d4c44a; }
.dice-d20-btn.rolled.dice-fail      { border-color: #d47a4a; background: #2a1a12; }
.dice-d20-btn.rolled.dice-fail      .dice-d20-num { color: #d47a4a; }
.dice-d20-btn.rolled.dice-hard-fail { border-color: #d44a4a; background: #2a1212; }
.dice-d20-btn.rolled.dice-hard-fail .dice-d20-num { color: #d44a4a; }
.dice-d20-btn.rolled.dice-crit-fail { border-color: #ff4444; background: #1a0808; }
.dice-d20-btn.rolled.dice-crit-fail .dice-d20-num { color: #ff4444; }

.dice-roller-info { display: flex; flex-direction: column; gap: 3px; }
.dice-roller-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}
.dice-roller-outcome {
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
}
.dice-roller-outcome.dice-crit      { color: #4cff6e; }
.dice-roller-outcome.dice-success   { color: #80e880; }
.dice-roller-outcome.dice-partial   { color: #d4c44a; }
.dice-roller-outcome.dice-fail      { color: #d47a4a; }
.dice-roller-outcome.dice-hard-fail { color: #d44a4a; }
.dice-roller-outcome.dice-crit-fail { color: #ff4444; }


.input-wrap { display: flex; gap: 10px; align-items: flex-end; }

.chat-textarea {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 11px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  resize: none;
  outline: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color var(--transition);
}
.chat-textarea:focus { border-color: var(--accent); }
.chat-textarea::placeholder { color: var(--text3); font-style: italic; }

.send-btn {
  width: 44px; height: 44px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.send-btn:hover { background: var(--accent2); transform: translateY(-1px); }

.input-hint { font-size: 11px; color: var(--text3); margin-top: 8px; display: flex; gap: 16px; }
.input-hint kbd {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: var(--text2);
}

/* ── RIGHT PANEL ── */
.right-panel {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.panel-section {
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.panel-section:last-child { border-bottom: none; }

.panel-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
}

.panel-scroll { overflow-y: auto; flex: 1; }
.panel-scroll::-webkit-scrollbar { width: 3px; }
.panel-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* Player list */
.player-list { display: flex; flex-direction: column; gap: 8px; }

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background var(--transition);
  cursor: default;
}
.player-row:hover { background: var(--bg2); }

.player-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  flex-shrink: 0;
  position: relative;
}
.player-online::after,
.player-idle::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}
.player-online::after { background: #4CAF50; }
.player-idle::after   { background: #FFA726; }

.player-info { flex: 1; min-width: 0; }
.player-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-char { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player-role-tag { font-size: 9px; font-weight: 500; padding: 2px 6px; border-radius: 6px; flex-shrink: 0; }

/* Character card */
.char-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.char-name  { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: 0.04em; margin-bottom: 2px; }
.char-class { font-size: 11px; color: var(--text3); margin-bottom: 12px; }

.stat-row { display: flex; flex-direction: column; gap: 8px; }

.stat-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 3px;
}
.stat-val { font-weight: 500; color: var(--text2); }

.stat-bar  { height: 4px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 4px; }
.fill-hp   { background: linear-gradient(90deg, #E05050, #F07070); }
.fill-mp   { background: linear-gradient(90deg, #5070E0, #7090F0); }
.fill-st   { background: linear-gradient(90deg, #50A050, #70C070); }

/* Inventory & status */
.char-sub-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 5px;
}
.inv-list  { display: flex; flex-direction: column; gap: 3px; }
.inv-item  { font-size: 11px; color: var(--text2); }
.status-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.status-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(220,100,50,0.12);
  color: #DC6432;
  font-weight: 500;
}
.buff-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.buff-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: default;
  position: relative;
}
.buff-tag.buff      { background: rgba(60,180,80,0.13);  color: #3cb450; border: 1px solid rgba(60,180,80,0.25); }
.buff-tag.debuff    { background: rgba(200,50,80,0.13);  color: #c83250; border: 1px solid rgba(200,50,80,0.25); }
.buff-tag.condition { background: rgba(220,100,50,0.12); color: #DC6432; border: 1px solid rgba(220,100,50,0.25); }
.buff-tag-turns {
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 0 4px;
  font-size: 9px;
  line-height: 14px;
}
.effect-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0 0 0 5px;
  margin: 0;
  transition: opacity 0.15s, transform 0.1s;
}
.effect-remove-btn:hover { opacity: 1; transform: scale(1.2); }
.char-sub-label { font-family: var(--font-ui); font-size: 10px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text3); margin-bottom: 4px; }

/* Session info */
.info-list { display: flex; flex-direction: column; gap: 8px; }
.info-row  { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.info-key  { font-size: 11px; color: var(--text3); white-space: nowrap; padding-top: 1px; }
.info-val  { font-size: 12px; color: var(--text); font-weight: 500; text-align: right; word-break: break-word; }

.session-tag { font-size: 10px; padding: 2px 8px; border-radius: 8px; font-weight: 500; }

/* ── AGE GATE ── */
.age-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a0608;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.age-gate.open { display: flex; }

.age-gate-box {
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.age-gate-icon {
  font-size: 64px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 24px rgba(255,50,50,0.4));
}

.age-gate-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.age-gate-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 40px;
  line-height: 1.5;
}

.age-gate-question {
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 24px);
  color: rgba(255,255,255,0.9);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.age-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 32px;
}

.age-gate-yes {
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 16px 24px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}
.age-gate-yes:hover { background: #e74c3c; transform: translateY(-1px); }

.age-gate-no {
  background: transparent;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 14px 24px;
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.age-gate-no:hover { border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.6); }

.age-gate-legal {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  line-height: 1.6;
  max-width: 400px;
}

/* ── NEW SESSION MODAL ── */
.modal {
  padding: 36px;
  width: 100%;
  max-width: 520px;
}

.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: 0.04em; margin-bottom: 6px; }
.modal-desc  { font-size: 14px; color: var(--text3); font-style: italic; margin-bottom: 24px; }

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* World picker */
.world-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.selected-world-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--accent-bg);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  margin-bottom: 6px;
}

.world-pick-item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}
.world-pick-item:hover    { border-color: var(--accent); }
.world-pick-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.world-pick-img   { height: 54px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.world-pick-label {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

/* Mode picker */
.mode-picker { display: flex; gap: 8px; }
.mode-item {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}
.mode-item:hover    { border-color: var(--accent); }
.mode-item.selected { border-color: var(--accent); background: var(--accent-bg); }
.mode-icon { font-size: 20px; margin-bottom: 6px; }
.mode-name { font-size: 12px; font-weight: 500; color: var(--text); }
.mode-desc { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* Style picker */
.style-picker { display: flex; gap: 8px; }
.style-item {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.style-item:hover    { border-color: var(--accent); }
.style-item.selected { border-color: var(--accent); background: var(--accent-bg); }
.style-icon { font-size: 16px; }
.style-name { font-size: 12px; font-weight: 500; color: var(--text); }
.style-desc { font-size: 10px; color: var(--text3); }

/* ── Hardcore settings panel ── */
.hardcore-settings {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(255,80,80,0.04);
  border: 1px solid rgba(255,80,80,0.18);
  border-radius: 10px;
}

.hc-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.hc-setting + .hc-setting { border-top: 1px solid rgba(255,255,255,0.05); }

.hc-setting-info { display: flex; flex-direction: column; gap: 2px; }
.hc-setting-name { font-size: 13px; font-weight: 500; color: var(--text); }
.hc-setting-desc { font-size: 11px; color: var(--text3); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 14px; height: 14px;
  background: var(--text3);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(16px); background: #fff; }

/* Dice rolls picker (1 / 3) */
.hc-rolls-picker { display: flex; gap: 6px; }
.hc-roll-btn {
  width: 36px; height: 32px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: 7px;
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.hc-roll-btn:hover { border-color: var(--accent); color: var(--text); }
.hc-roll-btn.selected { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }

/* Dice roller — counter + right column */
.dice-roller-right {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.dice-roller-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
}
.dice-roller-hint { font-size: 11px; color: var(--text3); font-style: italic; white-space: nowrap; }

/* ── SETTINGS PAGE ── */
.settings-section {
  max-width: 600px;
  margin-bottom: 36px;
}
.settings-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.settings-group { margin-bottom: 20px; }
.settings-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  margin-bottom: 10px;
}
.settings-desc {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 10px;
}

.theme-picker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-pick-btn {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 18px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
}
.theme-pick-btn:hover  { border-color: var(--accent); color: var(--text); }
.theme-pick-btn.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }

.lang-row { display: flex; gap: 8px; }
.lang-btn {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 20px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
}
.lang-btn:hover  { border-color: var(--accent); }
.lang-btn.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }

.btn-danger {
  background: transparent;
  border: 1.5px solid #E05050;
  color: #E05050;
  border-radius: 8px;
  padding: 10px 22px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-danger:hover { background: #E05050; color: #fff; }

.btn-neutral {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  padding: 10px 22px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-neutral:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.btn-sm-accent:hover { opacity: 0.85; }

.settings-danger-zone {
  border-top: 1px solid rgba(224, 80, 80, 0.25);
  padding-top: 8px;
}
.settings-danger-zone .settings-section-title { color: #E05050; }

/* ── SESSION CARDS (dashboard) ── */
.session-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 8px;
}
.session-card:hover { border-color: var(--accent); background: var(--card-hover); }
.session-card-icon  { font-size: 24px; width: 36px; text-align: center; flex-shrink: 0; }
.session-card-body  { flex: 1; min-width: 0; }
.session-card-name  { font-weight: 500; color: var(--text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-card-meta  { font-size: 11px; color: var(--text3); margin-top: 3px; }
.session-resume     { flex-shrink: 0; font-size: 11px; padding: 5px 12px; pointer-events: none; }
.session-delete-btn { flex-shrink: 0; padding: 5px 8px; font-size: 11px; color: var(--text3); border-color: transparent; }
.session-delete-btn:hover { color: #e05050; border-color: #e05050 !important; }

/* ── CONTENT FILTERS ── */
.filter-row {
  margin-bottom: 14px;
}
.filter-btn-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text3);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover  { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.toggle-label-row  { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-top: 10px; }
.filter-note { font-size: 11px; color: var(--text3); }

/* ── LOCKED COOP MODE ── */
.mode-locked {
  opacity: 0.55;
  cursor: pointer;
  position: relative;
}
.mode-locked:hover { opacity: 0.75; border-color: var(--accent); }

/* ── APPEARANCE TEXTAREA ── */
.appearance-input {
  resize: none;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text2);
}
.appearance-input::placeholder { font-style: italic; color: var(--text3); }

/* ── COMPANION INPUTS ── */
.companion-main {
  display: flex;
  gap: 8px;
  align-items: center;
}
.companion-main .form-input { flex: 1; }

.companion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.companion-header .form-label { margin-bottom: 0; }
.companions-list { display: flex; flex-direction: column; gap: 8px; }
.companion-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.companion-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  border-radius: 6px;
  padding: 0 10px;
  height: 38px;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.companion-remove:hover { border-color: #e55; color: #e55; }

/* ── MODEL SELECTOR ── */
.model-select {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.model-select:focus { border-color: var(--accent); }
.model-select option { background: var(--surface); color: var(--text); }

/* ── MODEL PICKER (MPK) ── */
.mpk { position: relative; display: inline-block; }
.mpk--full { display: block; }

.mpk-trigger {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 8px;
  color: var(--text); font-family: var(--font-ui); cursor: pointer;
  transition: border-color var(--transition); text-align: left;
}
.mpk-trigger:hover, .mpk.is-open .mpk-trigger { border-color: var(--accent); outline: none; }
.mpk--compact .mpk-trigger { font-size: 11px; padding: 0 8px; height: 32px; max-width: 150px; }
.mpk--full    .mpk-trigger { font-size: 13px; padding: 9px 12px; width: 100%; max-width: 420px; box-sizing: border-box; }
.mpk-trigger-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpk-trigger-arrow { font-size: 9px; opacity: 0.5; flex-shrink: 0; }

.mpk-panel {
  display: none; flex-direction: column;
  position: absolute; top: calc(100% + 4px); z-index: 1200;
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35); overflow: hidden;
}
.mpk.is-open .mpk-panel { display: flex; }
.mpk--compact .mpk-panel { width: 280px; max-height: 340px; right: 0; }
.mpk--full    .mpk-panel { width: 100%; max-width: 420px; max-height: 440px; left: 0; }

.mpk-search { padding: 8px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mpk-search-input {
  width: 100%; box-sizing: border-box;
  background: var(--bg); border: 1px solid var(--border2); border-radius: 6px;
  color: var(--text); font-family: var(--font-ui); font-size: 12px; padding: 5px 9px; outline: none;
}
.mpk-search-input:focus { border-color: var(--accent); }

.mpk-sort-row {
  display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; flex-wrap: wrap;
}
.mpk-sort-btn {
  background: var(--bg); border: 1px solid var(--border2); border-radius: 5px;
  color: var(--text2); font-family: var(--font-ui); font-size: 10px; padding: 3px 7px;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.mpk-sort-btn:hover { border-color: var(--accent); color: var(--text); }
.mpk-sort-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.mpk-list { overflow-y: auto; flex: 1; }

.mpk-group-header {
  padding: 5px 10px 2px; font-size: 10px; font-family: var(--font-ui);
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em;
  user-select: none; background: var(--bg2); position: sticky; top: 0; z-index: 1;
}
.mpk-item {
  display: flex; align-items: center; gap: 5px; padding: 7px 10px;
  font-family: var(--font-ui); color: var(--text); cursor: pointer;
  transition: background var(--transition);
}
.mpk-item:hover { background: var(--bg3, var(--bg)); }
.mpk-item.is-selected { background: rgba(139,92,246,0.15); }
.mpk-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mpk--compact .mpk-item { padding: 5px 8px; }
.mpk--compact .mpk-item-name { font-size: 11px; }

.mpk-badges { display: flex; gap: 3px; flex-shrink: 0; }
.mpk-badge {
  font-size: 9px; padding: 1px 4px; border-radius: 3px; border: 1px solid;
  white-space: nowrap; font-family: var(--font-ui); line-height: 1.4;
}
.mpk-badge.spd-3  { color: #4ade80; border-color: #4ade80; }
.mpk-badge.spd-2  { color: #facc15; border-color: #facc15; }
.mpk-badge.spd-1  { color: #f87171; border-color: #f87171; }
.mpk-badge.qlt-3  { color: #818cf8; border-color: #818cf8; }
.mpk-badge.qlt-2  { color: #a5b4fc; border-color: #a5b4fc; }
.mpk-badge.qlt-1  { color: #94a3b8; border-color: #94a3b8; }
.mpk-badge.free   { color: #4ade80; border-color: #4ade80; }

.mpk-price {
  font-size: 9px; color: var(--text3); white-space: nowrap;
  font-family: var(--font-mono, monospace); flex-shrink: 0;
}
.mpk-empty {
  padding: 20px; text-align: center; color: var(--text3);
  font-size: 12px; font-family: var(--font-ui);
}

/* ── DRAWERS (event log / party state) ── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}
.drawer-backdrop.open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border2);
  z-index: 301;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -12px 0 48px rgba(0,0,0,0.18);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg2);
}
.drawer-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-close {
  width: 28px; height: 28px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text3);
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.drawer-close:hover { background: var(--bg3); color: var(--text); border-color: var(--accent); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.drawer-body::-webkit-scrollbar { width: 3px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.drawer-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--text3);
  font-size: 14px;
  font-family: var(--font-ui);
}

/* ── JOURNAL DRAWER ── */
.journal-drawer { width: 460px; }

.journal-drawer-head {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  padding-right: 8px;
  gap: 4px;
}
.journal-tabs {
  display: flex;
  flex: 1;
  overflow-x: auto;
}
.journal-tabs::-webkit-scrollbar { display: none; }
.journal-tab {
  flex-shrink: 0;
  padding: 12px 12px;
  font-size: 12px;
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--text3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}
.journal-tab:hover { color: var(--text2); }
.journal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Image Gallery Drawer ── */
.img-gallery-drawer { width: 420px; }

.img-gallery-toolbar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.img-gen-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.img-gen-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.img-gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}
.img-gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text3);
  font-size: 13px;
}
.img-gallery-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  cursor: pointer;
  aspect-ratio: 16/10;
  transition: border-color 0.15s;
}
.img-gallery-card:hover { border-color: var(--accent); }
.img-gallery-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.img-gallery-card-meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  padding: 8px 8px 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
}
.img-gallery-card-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.55);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.img-gallery-card:hover .img-gallery-card-del { opacity: 1; }

.journal-lore-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

/* Key events list */
.journal-events-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.journal-event-item {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  padding: 8px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  list-style: decimal;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.journal-event-turn {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: .04em;
}

/* Chronicle chapters */
.journal-arc {
  margin-bottom: 20px;
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.journal-arc-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
  font-style: italic;
}
.journal-chapter {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.journal-chapter-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 14px 6px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.journal-chapter-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
  padding: 10px 14px;
}

/* Lore drawer (shared styles, kept for journal lore tab) */
.lore-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.lore-genre-tag { background: var(--bg3); border: 1px solid var(--border2); border-radius: 20px; padding: 3px 10px; font-size: 12px; color: var(--text2); font-family: var(--font-ui); }
.lore-desc { font-size: 14px; line-height: 1.7; color: var(--text); font-family: var(--font-body, var(--font-ui)); white-space: pre-wrap; }
.lore-features { margin-top: 20px; }
.lore-section-label { font-size: 11px; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin-bottom: 8px; }
.lore-feature-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.lore-feature-list li { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* ── CHAT SEARCH BAR ── */
.chat-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-search-icon { font-size: 13px; color: var(--text3); flex-shrink: 0; }
.chat-search-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--text);
  outline: none;
}
.chat-search-input:focus { border-color: var(--accent); }
.chat-search-count {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-ui);
  white-space: nowrap;
  min-width: 48px;
  text-align: center;
  flex-shrink: 0;
}
.chat-search-nav {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text2);
  font-size: 11px;
  width: 24px; height: 24px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.chat-search-nav:hover { border-color: var(--accent); color: var(--accent); }
.chat-search-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}
.chat-search-close:hover { color: var(--text); }
mark.chat-search-match {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: inherit;
  border-radius: 2px;
  outline: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
mark.chat-search-current {
  background: var(--accent);
  color: #fff;
  border-radius: 2px;
  outline: none;
}

/* Lore — NPC & location registry */
.lore-registry-section { margin-top: 22px; }
.lore-registry-label { display: flex; align-items: center; gap: 6px; }
.lore-reg-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  min-width: 18px;
  height: 16px;
  color: var(--text3);
  text-transform: none;
  letter-spacing: 0;
}
.lore-registry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lore-reg-entry {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}
.lore-reg-entry:hover { border-color: var(--border2); }
.lore-reg-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.lore-reg-badges { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lore-reg-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb, 160,110,60), 0.12);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb, 160,110,60), 0.25);
  font-family: var(--font-ui);
  text-transform: capitalize;
  white-space: nowrap;
}
.lore-reg-status {
  background: rgba(80,160,80,0.12);
  color: #50A050;
  border-color: rgba(80,160,80,0.3);
}
.lore-reg-dead {
  background: rgba(200,60,60,0.12);
  color: #C04040;
  border-color: rgba(200,60,60,0.3);
}
.lore-reg-loc {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--font-ui);
  white-space: nowrap;
  font-weight: 400;
}
.lore-reg-notes {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}
.lore-registry-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
@keyframes loreSpinner {
  to { transform: rotate(360deg); }
}
.lore-reg-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loreSpinner 0.7s linear infinite;
}

/* Event log entries */
.event-timeline { position: relative; padding-left: 16px; }
.event-timeline::before {
  content: '';
  position: absolute;
  left: 15px; top: 16px; bottom: 0;
  width: 1px;
  background: var(--border);
}
.event-entry {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
  position: relative;
}
.event-turn {
  width: 30px; height: 30px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: 10px; font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.event-entry.intro .event-turn {
  background: var(--accent-bg);
  border-color: var(--accent);
}
.event-text {
  flex: 1;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
  padding-top: 5px;
}
.event-text-truncated { cursor: pointer; }
.event-text-truncated:hover { color: var(--text); }
.event-expand {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
}

/* Party member cards */
.party-member {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.party-member.hero-card { border-color: var(--accent); }
.party-member-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.party-member-av {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.hero-card .party-member-av { border-color: var(--accent); }
.party-member-info { flex: 1; min-width: 0; }
.party-member-name {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--text);
  letter-spacing: 0.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.party-member-role {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.party-hero-badge {
  font-family: var(--font-ui);
  font-size: 10px; font-weight: 500;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}
.party-desc {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
  padding: 6px 10px;
  background: var(--bg2);
  border-radius: 6px;
  margin-bottom: 10px;
  border-left: 2px solid var(--accent);
}
.party-stat { margin-bottom: 8px; }
.party-stat-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
}
.party-stat-bar {
  height: 5px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
.party-stat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.fill-party-hp  { background: #e05050; }
.fill-party-mp  { background: #5070E0; }
.fill-party-st  { background: #50A050; }
.party-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.party-inv-title, .party-status-title {
  font-family: var(--font-ui);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
  margin: 10px 0 5px;
}
.party-inv-items {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text2);
  line-height: 1.8;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE
══════════════════════════════════════════════════════════ */

/* ── Last session card ───────────────────────────── */
.last-session-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.last-session-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  transition: background 0.15s;
}
.last-session-inner:hover { background: var(--surface3); }
.last-session-emoji { font-size: 36px; flex-shrink: 0; line-height: 1; }
.last-session-info  { flex: 1; min-width: 0; }
.last-session-name  { font-size: 16px; font-weight: 600; color: var(--text1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last-session-meta  { font-size: 12px; color: var(--text3); margin-top: 2px; }
.last-session-turn  { font-size: 11px; color: var(--text3); margin-top: 2px; }
.last-session-btn   { flex-shrink: 0; }

/* ── Player stats grid ───────────────────────────── */
.stats-grid         { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.dash-stat-item          { background: var(--surface3); border-radius: var(--radius-md); padding: 14px 16px; }
.dash-stat-item-wide     { grid-column: 1 / -1; }
.dash-stat-val           { font-size: 15px; font-weight: 700; color: var(--text1); line-height: 1; }
.dash-stat-val-genre     { font-size: 14px; font-weight: 600; }
.dash-stat-key           { font-size: 11px; color: var(--text3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Recommended world card ──────────────────────── */
.recommend-card     { display: flex; flex-direction: column; gap: 12px; }
.recommend-body     { display: flex; gap: 14px; align-items: flex-start; flex: 1; }
.recommend-img      { font-size: 40px; line-height: 1; flex-shrink: 0; width: 52px; text-align: center; }
.recommend-info     { flex: 1; min-width: 0; }
.recommend-name     { font-size: 15px; font-weight: 600; color: var(--text1); }
.recommend-tags     { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.recommend-tag      { font-size: 10px; background: var(--surface3); border: 1px solid var(--border2); border-radius: 99px; padding: 2px 8px; color: var(--text2); }
.recommend-desc     { font-size: 12px; color: var(--text3); margin-top: 6px; line-height: 1.5; }
.recommend-btn      { align-self: flex-start; }

/* ── Tablet (769px – 1024px) ─────────────────────── */
/* Mobile panel button — visible only on ≤1024px */
.mobile-panel-btn  { display: none; }
.mobile-panel-head { display: none; }
.mobile-quick-btns { display: none; }

@media (max-width: 1024px) {
  /* Right panel becomes a bottom drawer; position:fixed takes it out of flow */
  .right-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100% !important;
    max-height: 82dvh;
    border-radius: 16px 16px 0 0;
    border-top: 1px solid var(--border2);
    z-index: 302;
    box-shadow: 0 -16px 48px rgba(0,0,0,0.24);
    transform: translateY(calc(100% + 2px));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
  }
  .right-panel.panel-open {
    transform: translateY(0);
    pointer-events: all;
  }
  .chat-area { border-right: none; }

  /* Show panel toggle, hide individual topbar action buttons */
  .mobile-panel-btn  { display: flex; }
  .chat-topbar-extra { display: none; }

  /* Mobile-only panel header and quick-action row */
  .mobile-panel-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
  }
  .mobile-panel-handle {
    position: absolute;
    left: 50%; top: 8px;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    background: var(--border2);
    border-radius: 2px;
  }
  .mobile-quick-btns {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mobile-quick-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 4px 7px;
    cursor: pointer;
    font-size: 18px;
    transition: all var(--transition);
    color: var(--text3);
  }
  .mobile-quick-btn span { font-size: 10px; color: var(--text3); display: block; }
  .mobile-quick-btn:hover { border-color: var(--accent); color: var(--text); }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* Dashboard: single column when sidebar takes space */
  .dash-grid { grid-template-columns: 1fr; gap: 14px; }

  /* Tighter content padding */
  .page-scroll { padding: 18px 20px 40px; }

  /* Session modal fits better */
  .modal { max-width: 480px; padding: 28px 24px; }

  /* Chat topbar actions wrap if needed */
  .chat-topbar { padding: 12px 16px; }
  .chat-model-select { max-width: 120px; }
}

/* ── Mobile (≤ 768px) ────────────────────────────── */
@media (max-width: 768px) {

  /* Room topbar back link gets padding too (base topbar padding set in base.css) */
  .page#page-room .topbar { padding: 0 12px 0 54px; }

  /* Dashboard */
  .page-scroll { padding: 14px 14px 80px; }
  .dash-grid   { grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
  .last-session-inner { padding: 14px 14px; gap: 12px; }
  .last-session-emoji { font-size: 28px; }
  .last-session-btn   { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dash-stat-val { font-size: 14px; }

  /* Token card compact */
  .token-used { font-size: 26px; }

  /* Session cards — hide the right "Enter" button area */

  .session-card { padding: 12px 14px; }

  /* Settings */
  .settings-section { max-width: 100%; }
  .filter-btn { padding: 5px 9px; font-size: 11px; }
  .filter-btn-row { gap: 4px; }
  .lang-row { flex-wrap: wrap; }

  /* Room: chat area */
  .chat-topbar    { padding: 10px 12px; }
  .chat-actions   { gap: 5px; }
  .chat-model-select { max-width: 100px; font-size: 10px; }
  .chat-world-name { font-size: 13px; }
  .messages       { padding: 10px 10px; gap: 2px; }
  .chat-input-area { padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .chat-textarea  { font-size: 14px; padding: 9px 12px; }
  .input-hint     { display: none; }

  /* Right panel is a fixed drawer on mobile — no layout impact */

  /* Modal → bottom sheet */
  .modal-overlay { align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    padding: 22px 18px 36px;
    max-height: 92dvh;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -16px 48px rgba(0,0,0,0.22);
  }
  .modal-overlay.open .modal { transform: translateY(0); }

  /* Modal handle bar */
  .modal::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--border2);
    border-radius: 2px;
    margin: 0 auto 18px;
  }

  /* World picker — 2 columns */
  .world-picker { grid-template-columns: repeat(2, 1fr); gap: 7px; }

  /* Hero + companion form rows — stack */
  .form-row { grid-template-columns: 1fr; gap: 8px; }

  /* Mode/style pickers — keep side by side but smaller */
  .mode-item, .style-item { padding: 10px 8px; }
  .mode-desc, .style-desc { display: none; }

  /* Drawers — full width on mobile */
  .drawer { width: 100%; max-width: 100%; border-left: none; border-top: 1px solid var(--border2); border-radius: 16px 16px 0 0; }

  /* Empty state compact */
  .empty-state { padding: 32px 16px; }
}

/* ── COOP UI ── */

/* Action strip (shows submitted status before GM responds) */
.coop-action-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  margin-bottom: 4px;
}

.coop-players-ready {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.coop-player-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: background 0.2s;
}

.coop-dot-ready   { background: var(--success, #4caf50); }
.coop-dot-waiting { background: var(--border2, rgba(0,0,0,0.15)); border: 1.5px solid var(--border); }

.coop-force-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: 500;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.coop-force-btn:hover { background: var(--accent); color: #fff; }

/* Invite code modal */
.modal-sm { max-width: 360px; }

.invite-code-block {
  text-align: center;
  padding: 20px 0 16px;
}

.invite-code-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
}

.invite-code-display {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
  background: var(--accent-bg);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 12px 24px;
  display: inline-block;
  min-width: 160px;
}

/* Join modal */
.join-code-input {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 18px;
  text-align: center;
  flex: 1;
}

.join-campaign-preview {
  background: var(--surface2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 4px;
}

.join-campaign-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.join-campaign-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.join-campaign-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.join-campaign-meta {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.join-campaign-warn {
  margin-top: 10px;
  font-size: 12px;
  color: var(--danger, #e53935);
  background: rgba(229,57,53,0.08);
  border-radius: 6px;
  padding: 7px 10px;
}

/* Player list coop badges */
.tag-ready   { background: rgba(76,175,80,0.12); color: var(--success, #4caf50); border: 1px solid rgba(76,175,80,0.25); }
.tag-waiting { background: var(--surface2); color: var(--text3); border: 1px solid var(--border); }

/* Mobile touch targets — ensure ≥44px on phones */
@media (max-width: 768px) {
  .icon-btn { width: 36px; height: 36px; }
  .send-btn  { width: 44px; height: 44px; }
}

/* Small phones (≤ 480px) ──────────────────────── */
@media (max-width: 480px) {
  .modal-title { font-size: 17px; }
  .chat-world-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Do NOT shrink buttons below touch-safe size */
  .icon-btn { width: 36px; height: 36px; font-size: 13px; }
  .send-btn  { width: 44px; height: 44px; font-size: 16px; }
}

/* ── COMMUNITY CHAT ── */
.community-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.community-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.community-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
  font-size: 14px;
}

.community-msg {
  display: flex;
  gap: 10px;
  padding: 5px 0;
}

.community-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  opacity: 0.85;
}

.community-msg-own .community-msg-avatar { opacity: 1; }

.community-msg-body { flex: 1; min-width: 0; }

.community-msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.community-msg-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.community-msg-own .community-msg-name { color: var(--accent); }

.community-msg-time {
  font-size: 11px;
  color: var(--text3);
}

.community-msg-text {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.community-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.community-textarea {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.community-textarea:focus { border-color: var(--accent); outline: none; }
.community-textarea::placeholder { color: var(--text3); }
.community-textarea:disabled { opacity: 0.5; }

.community-send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 17px;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.community-send-btn:hover { opacity: 0.85; }
.community-send-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Cancel stream button ── */
.msg-cancel-btn {
  margin-left: auto;
  background: none;
  border: 1px solid rgba(220, 80, 60, 0.35);
  border-radius: 6px;
  color: #E05050;
  font-size: 12px;
  padding: 1px 8px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.6;
}
.msg-cancel-btn:hover { background: rgba(220, 80, 60, 0.12); border-color: #E05050; }

/* ── Typing flavor text & cursor ── */
.typing-flavor {
  display: flex;
  align-items: center;
  gap: 2px;
  font-style: italic;
  color: var(--text3);
  font-size: 13px;
}
.typing-cursor {
  display: inline-block;
  animation: blink 0.9s step-end infinite;
  color: var(--accent);
  font-style: normal;
}

/* ── Skeleton loading ── */
@keyframes skeletonShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.msg-skeleton {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  opacity: 0.7;
}
.skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
  background-size: 800px 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
.skeleton-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  width: 100%;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
  background-size: 800px 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
.skeleton-line-short  { width: 35%; }
.skeleton-line-medium { width: 65%; }

/* ── Stat delta float animation ── */
@keyframes statDeltaFloat {
  0%   { opacity: 1; transform: translateY(0); }
  80%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-28px); }
}

.stat-delta {
  position: absolute;
  right: 0;
  top: -14px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  animation: statDeltaFloat 1.4s ease-out forwards;
  white-space: nowrap;
  z-index: 10;
}
.stat-delta-up   { color: #50C050; }
.stat-delta-down { color: #E05050; }

/* ── IN-APP WORLDS CATALOG ── */
.app-worlds-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Top bar: search + filter toggle */
.app-worlds-bar {
  padding: 10px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.app-worlds-bar-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-worlds-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}
.app-worlds-search-wrap .fp-search-icon {
  position: absolute;
  left: 10px;
  font-size: 14px;
  pointer-events: none;
}
.app-worlds-search {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
}
.app-worlds-search:focus { outline: none; border-color: var(--accent); }

/* Filter toggle button */
.awf-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.awf-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.awf-toggle-btn.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }

.awf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

/* Main layout: sidebar + grid */
.app-worlds-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Filter sidebar panel */
.awf-panel {
  flex: 0 0 0px;
  overflow: hidden;
  border-right: 1px solid transparent;
  background: var(--surface);
  transition: flex-basis 0.22s ease, border-color 0.22s ease;
}
.awf-panel.open {
  flex-basis: 196px;
  overflow-y: auto;
  border-right-color: var(--border);
}
.awf-panel > * { min-width: 196px; }
.awf-panel::-webkit-scrollbar { width: 3px; }
.awf-panel::-webkit-scrollbar-track { background: transparent; }
.awf-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.awf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}
.awf-panel-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text3);
}
.awf-reset-btn {
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  padding: 0;
  opacity: 0.8;
}
.awf-reset-btn:hover { opacity: 1; }

.awf-section {
  padding: 6px 14px 12px;
  border-top: 1px solid var(--border);
}
.awf-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.awf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.awf-chips .filter-chip {
  font-size: 11px;
  padding: 4px 9px;
}

/* Genre list — multi-select rows */
.awf-genre-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.awf-genre-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.awf-genre-item:hover { background: var(--bg3); color: var(--text); }
.awf-genre-item.active { color: var(--accent); }

.awf-genre-check {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border2);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.awf-genre-item.active .awf-genre-check {
  background: var(--accent);
  border-color: var(--accent);
}
.awf-genre-item.active .awf-genre-check::after {
  content: '';
  display: block;
  width: 7px;
  height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.app-worlds-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}
.app-worlds-scroll::-webkit-scrollbar { width: 4px; }
.app-worlds-scroll::-webkit-scrollbar-track { background: transparent; }
.app-worlds-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.app-worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
@media (min-width: 1440px) {
  .app-worlds-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Reuse .world-card styles from worlds.css; just tighten them for the app view */
#page-worlds .world-card { cursor: pointer; }
#page-worlds .world-card-img { height: 100px; }
#page-worlds .world-emoji { font-size: 28px; }
#page-worlds .world-desc { -webkit-line-clamp: 2; font-size: 12px; }
#page-worlds .world-name { font-size: 14px; }

/* Meta row inside app catalog card */
.awc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
}

/* Play button row — centered, half width, pinned to bottom */
.awc-play-row {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 12px;
}
.awc-play-btn {
  width: 50%;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  text-align: center;
  letter-spacing: 0.01em;
}
.awc-play-btn:hover { background: var(--accent2); transform: translateY(-1px); }
.awc-play-btn.locked {
  background: var(--bg3);
  color: var(--text3);
  cursor: default;
  transform: none;
}

/* Lazy-load skeleton card */
.world-card-skeleton {
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface2);
}
.world-card-skeleton .skel-img {
  height: 90px;
  background: var(--bg3);
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  background-size: 800px 100%;
  background-image: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
}
.world-card-skeleton .skel-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.world-card-skeleton .skel-line {
  height: 11px;
  border-radius: 4px;
  background: var(--bg3);
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  background-size: 800px 100%;
  background-image: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
}
.world-card-skeleton .skel-line-short { width: 50%; }
.world-card-skeleton .skel-line-med   { width: 75%; }

@media (max-width: 600px) {
  .app-worlds-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .app-worlds-bar { padding: 10px 12px 8px; }
  .app-worlds-scroll { padding: 10px 12px; }
  #page-worlds .world-card-img { height: 75px; }
  .app-filter-sep { display: none; }
}

/* ── worlds.css override reset for app.html modals ── */
/* worlds.css sets .modal { max-width:560px } — undo for app modals without inline max-width */
.modal-overlay .modal { max-width: 640px; }
.modal-overlay .modal-sm { max-width: 420px; }
/* worlds.css sets .modal-close position styles — ensure app modal-close stays on top */
.modal-overlay .modal-close { z-index: 2; }

/* ── HELP SIDEBAR BUTTON ── */
.help-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 7px 10px;
  background: none;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: var(--sidebar-text);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.help-sidebar-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); border-color: rgba(255,255,255,0.14); }
.help-sidebar-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── HELP MODAL ── */
.help-modal {
  max-width: 720px;
  padding: 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.help-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.help-header-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.help-header-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .03em;
}
.help-header-sub { font-size: 13px; color: var(--text3); margin-top: 2px; }

.help-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.help-nav-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text2);
  text-decoration: none;
  font-family: var(--font-ui);
  transition: all var(--transition);
  white-space: nowrap;
}
.help-nav-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

.help-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
}
.help-body::-webkit-scrollbar { width: 4px; }
.help-body::-webkit-scrollbar-track { background: transparent; }
.help-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.help-section {
  padding: 20px 28px 0;
}
.help-section + .help-section { margin-top: 4px; }
.help-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .03em;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.help-subsection-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
}
.help-desc { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 14px; }
.help-tip {
  font-size: 12px;
  color: var(--text2);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.6;
  margin-top: 12px;
}
.help-divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Steps */
.help-steps { display: flex; flex-direction: column; gap: 10px; }
.help-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.help-step-num {
  width: 26px; height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.help-step-head { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.help-step-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }

/* Chat syntax cards */
.help-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.help-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg2);
}
.help-card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-ui);
  margin-bottom: 8px;
}
.help-badge-action  { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.help-badge-speech  { background: color-mix(in srgb, #4CAF50 15%, transparent); color: #4CAF50; border: 1px solid color-mix(in srgb, #4CAF50 30%, transparent); }
.help-badge-cmd     { background: color-mix(in srgb, #9C27B0 15%, transparent); color: #9C27B0; border: 1px solid color-mix(in srgb, #9C27B0 30%, transparent); }
.help-card-title    { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.help-card-text     { font-size: 12px; color: var(--text2); line-height: 1.5; margin-bottom: 8px; }
.help-card-example  { font-size: 11px; color: var(--text3); font-style: italic; background: var(--bg3); border-radius: 5px; padding: 5px 8px; }

/* Modes */
.help-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help-mode-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg2);
}
.help-mode-icon { font-size: 24px; margin-bottom: 8px; }
.help-mode-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.help-mode-desc { font-size: 12px; color: var(--text2); line-height: 1.6; }
.help-dice-scale { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.help-dice-val { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-family: var(--font-ui); }
.help-dice-val.dice-crit      { background: color-mix(in srgb,#FFD700 20%,transparent); color:#B8860B; }
.help-dice-val.dice-success   { background: color-mix(in srgb,#4CAF50 20%,transparent); color:#2E7D32; }
.help-dice-val.dice-partial   { background: color-mix(in srgb,#2196F3 20%,transparent); color:#1565C0; }
.help-dice-val.dice-fail      { background: color-mix(in srgb,#FF9800 20%,transparent); color:#E65100; }
.help-dice-val.dice-hard-fail { background: color-mix(in srgb,#F44336 20%,transparent); color:#C62828; }
.help-dice-val.dice-crit-fail { background: color-mix(in srgb,#9C27B0 20%,transparent); color:#6A1B9A; }
.help-style-list { display: flex; flex-direction: column; gap: 6px; }
.help-style-item { font-size: 13px; color: var(--text2); line-height: 1.5; display: flex; gap: 8px; }
.help-style-icon { flex-shrink: 0; }

/* Stats */
.help-stats-grid { display: flex; flex-direction: column; gap: 10px; }
.help-stat-row { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; color: var(--text2); line-height: 1.5; }
.help-stat-bar { width: 6px; height: 42px; border-radius: 3px; flex-shrink: 0; margin-top: 2px; }
.help-bar-hp { background: linear-gradient(180deg,#ef5350,#c62828); }
.help-bar-mp { background: linear-gradient(180deg,#42a5f5,#1565c0); }
.help-bar-st { background: linear-gradient(180deg,#66bb6a,#2e7d32); }
.help-extras { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.help-extra-item { font-size: 13px; color: var(--text2); line-height: 1.5; padding: 8px 12px; background: var(--bg2); border-radius: 8px; border: 1px solid var(--border); }

/* Journal tabs description */
.help-journal-tabs { display: flex; flex-direction: column; gap: 6px; }
.help-journal-tab {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.help-journal-tab-label { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; min-width: 100px; flex-shrink: 0; }
.help-journal-tab-desc { font-size: 12px; color: var(--text2); line-height: 1.5; }

/* Chat buttons list */
.help-buttons-list { display: flex; flex-direction: column; gap: 8px; }
.help-btn-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}
.help-btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-size: 14px;
  flex-shrink: 0;
}

/* Memory layers */
.help-memory-layers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.help-memory-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text2); }
.help-memory-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Responsive */
@media (max-width: 600px) {
  .help-modal { padding: 0; }
  .help-header { padding: 18px 18px 14px; }
  .help-nav    { padding: 10px 18px; }
  .help-section { padding: 16px 18px 0; }
  .help-cards   { grid-template-columns: 1fr; }
  .help-two-col { grid-template-columns: 1fr; }
}
