:root {
  --bg-main: #1a1b26;
  --bg-panel: #24283b;
  --bg-hover: #2d3142;
  --text: #c0caf5;
  --text-dim: #565f89;
  --text-muted: var(--text-dim);
  --accent: #7aa2f7;
  --accent-soft: #7dcfff;
  --success: #9ece6a;
  --warning: #e0af68;
  --border: #3b4261;
  --radius: 6px;
  --font-ui: 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--ui-font-size, 15px);
  color: var(--text);
  background: var(--bg-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Ensure all views/panels inherit theme text color */
.center-panel,
.collections-view,
.achievements-view {
  color: var(--text);
}

.muted,
.subtext,
.hint {
  color: var(--text-muted);
}

/* Floating gain text (XP, items) */
.floating-gains {
  position: fixed;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.floating-gain {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--success);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  animation: float-up-fade 2s ease-out forwards;
  font-family: inherit;
}

.floating-gain-xp {
  color: var(--accent-soft);
}

.floating-gain-rare {
  color: var(--warning);
  text-shadow: 0 0 10px rgba(232, 175, 104, 0.5);
}

.floating-gain-key {
  color: var(--accent);
}

.floating-gain-summary {
  color: var(--success);
  font-size: 0.85rem;
}

@keyframes float-up-fade {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-32px);
  }
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Top bar: current action block with progress bar */
.top-action {
  flex: 1;
  min-width: 0;
  max-width: 480px;
}

.top-action.hidden {
  display: none !important;
}

.top-action.top-action-clickable {
  cursor: pointer;
}

.top-action-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.top-action-title {
  font-size: 0.9em;
  color: var(--text-dim);
}
.top-action-combat-indicator {
  font-size: 0.75em;
  padding: 0.15em 0.5em;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--warning);
  white-space: nowrap;
  cursor: pointer;
}
.top-action-combat-indicator:hover {
  background: var(--border);
  color: var(--text);
}
.top-action-combat-indicator.hidden {
  display: none !important;
}
.top-action-title .current-name {
  font-weight: 600;
  color: var(--accent);
}

.top-action-bar {
  height: 7px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.top-action-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.15s linear;
}

.top-action-bar-fill.no-transition {
  transition: none;
}

.top-action-meta {
  font-size: 0.8em;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.top-action-effects {
  font-size: 0.8em;
  color: var(--accent-soft);
  margin-top: 0.35rem;
}

.top-action-effects.hidden {
  display: none;
}

.top-action-effect {
  cursor: help;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-primary {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
}

/* Nav group + dropdown */
.nav-group {
  position: relative;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-btn.active {
  background: var(--accent);
  color: var(--bg-main);
  border-color: var(--accent);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  min-width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  padding: 0.25rem 0;
  display: flex;
  flex-direction: column;
}

.nav-dropdown[hidden] {
  display: none !important;
}

.nav-dd-item {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9em;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.nav-dd-item:hover {
  background: var(--bg-hover);
}

.nav-dd-item.hidden {
  display: none !important;
}

.top-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.8em;
  color: var(--text-dim);
  background: rgba(59, 66, 97, 0.5);
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.top-badge:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.top-badge span {
  font-weight: 500;
}

.gold-display {
  font-weight: 600;
  color: var(--warning);
  font-size: 0.95em;
}

/* Main layout */
.main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Non-mobile: actions area (center panel) always fills full width to the right of the sidebar.
   Uses :not(.layout-mobile) so it applies for both tablet (769–991px) and desktop (992px+). */
body:not(.layout-mobile) .main-layout.rw-main {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
  min-width: 0;
}
body:not(.layout-mobile) .center-panel {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  display: grid !important;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  align-items: start;
}
body:not(.layout-mobile) .center-panel-main {
  min-width: 0;
}
body:not(.layout-mobile) #tasks-view.tasks-sidebar {
  min-width: 0;
  max-width: 320px;
}
body:not(.layout-mobile) #tasks-view.tasks-sidebar.hidden {
  display: none !important;
}
body:not(.layout-mobile) .skill-panel,
body:not(.layout-mobile) .skill-panel-content {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
}
body:not(.layout-mobile).rw-shell .rw-main {
  width: 100% !important;
  max-width: 100% !important;
}

.left-panel {
  width: 200px;
  min-width: 180px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  overflow-y: auto;
  transition: width 0.25s ease, min-width 0.25s ease;
}

/* Edge toggle: left side of screen, vertically centered — to minimize/expand Skills panel */
.skills-drawer-edge-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 201;
  width: 28px;
  min-height: 44px;
  padding: 0.5rem 0.35rem;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
  transition: left 0.25s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.skills-drawer-edge-toggle:hover {
  background: var(--bg-panel);
  filter: brightness(1.08);
}
body.skills-panel-open .skills-drawer-edge-toggle {
  left: 200px;
}
@media (max-width: 991px) {
  body.skills-panel-open .skills-drawer-edge-toggle {
    left: min(260px, 85vw);
  }
}
/* Desktop: collapsed sidebar for more space */
body.skills-drawer-minimized .left-panel {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden;
  padding: 0;
  border-right: none;
}
body.skills-drawer-minimized .skills-drawer-edge-toggle {
  left: 0;
}
body.skills-drawer-minimized.skills-panel-open .skills-drawer-edge-toggle {
  left: 0;
}

.game-branding {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1rem 1rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.btn-close-drawer {
  display: none;
}

.game-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.game-branding-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.game-title {
  font-size: 0.9em;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}

.game-version {
  font-size: 0.75em;
  color: var(--text-dim);
}

.game-updates-link {
  font-size: 0.75em;
  color: var(--text-dim);
  text-decoration: none;
  margin-top: 0.15rem;
  display: inline-block;
}
.game-updates-link:hover {
  color: var(--accent, var(--text));
  text-decoration: underline;
}

.center-panel {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

/* Hero banner above current action / skill panel */
.rw-hero-banner {
  position: relative;
  width: 100%;
  height: 220px;
  margin: 12px 0 16px 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.rw-hero-banner__image {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(8, 12, 20, 0.18), rgba(8, 12, 20, 0.32)), url("assets/ui/runeswick-banner.png");
  background-size: cover;
  background-position: center 38%;
  background-repeat: no-repeat;
}

/* Skill-specific background: image on the panel itself (no extra div). JS sets --skill-panel-bg-image on #skill-panel. */
.skill-panel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  min-height: 0;
  background-image: var(--skill-panel-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.skill-panel.hidden {
  display: none !important;
}
.skill-panel-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(5, 10, 20, 0.65), rgba(5, 10, 20, 0.72));
  z-index: 1;
}
/* Desktop: actions list (wider) and detail panel side by side; action area gets majority of width.
   When only detail is visible (action selected), use single column so action area fills full width. */
.skill-panel-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  align-items: start;
}
/* Action detail view: actions-panel hidden → one column so detail panel uses full background width */
body:not(.layout-mobile) .skill-panel:has(.actions-panel.hidden) .skill-panel-content {
  grid-template-columns: 1fr;
}
body:not(.layout-mobile) .skill-panel:has(.actions-panel.hidden) .detail-panel.rw-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
}
/* Theme (runeswick-theme.css) sets detail scrims; keep base transparent here. */
.skill-panel .detail-panel.rw-panel {
  background: transparent;
}
.skill-panel .actions-panel.rw-panel {
  background: transparent;
}
/* Skill XP bar */
.skill-xp-bar {
  margin-bottom: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.skill-xp-bar.hidden {
  display: none !important;
}

.skill-xp-name {
  font-weight: 600;
  color: var(--accent);
}

.skill-xp-nums {
  color: var(--text-dim);
  font-size: 0.9em;
}

.skill-xp-next {
  color: var(--text-dim);
  font-size: 0.85em;
}

.skill-xp-bar-wrap {
  height: 6px;
  background: var(--bg-main);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.skill-xp-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.skill-xp-bar.level-up-pulse {
  animation: level-up-pulse 0.8s ease;
}

@keyframes level-up-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 12px var(--accent); }
}

.skill-row-levelup {
  animation: skill-row-pulse 0.8s ease;
}

@keyframes skill-row-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 10px var(--accent), inset 0 0 8px rgba(122, 162, 247, 0.2); }
}

.skill-next-unlock {
  display: block;
  font-size: 0.75em;
  color: var(--text-dim);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95em;
  cursor: pointer;
}

/* Action log */
.action-log-panel {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.action-log-title {
  margin: 0 0 0.5rem;
  font-size: 0.85em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.action-log-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.85em;
  color: var(--text-dim);
  cursor: pointer;
}

.action-log-filter input {
  cursor: pointer;
}

.action-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.85em;
  color: var(--text-dim);
}

.action-log-line {
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
}

.action-log-line:last-child {
  border-bottom: none;
}

/* Inventory & Shop: two-panel layout */
.inv-shop-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0 1rem 1rem;
  color: var(--text);
}

.inventory-view.hidden,
.shop-view.hidden {
  display: none !important;
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.header-row .panel-title {
  margin: 0;
  flex-shrink: 0;
}

.search-wrap {
  flex: 1;
  min-width: 140px;
}

.inventory-search,
.shop-search {
  width: 100%;
  min-width: 120px;
  padding: 0.4rem 0.6rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9em;
}

.inventory-search:focus,
.shop-search:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-row {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.35rem 0.6rem;
  font-size: 0.85em;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
}

.filter-tab:hover {
  background: var(--bg-hover);
}

.filter-tab.active {
  background: var(--accent);
  color: var(--bg-main);
  border-color: var(--accent);
}

.inventory-sort {
  padding: 0.35rem 0.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9em;
}

.two-panel-body {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.list-panel {
  flex: 0 0 70%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inv-shop-layout .detail-panel {
  flex: 0 0 30%;
  min-width: 200px;
  max-width: 320px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-y: auto;
  align-self: flex-start;
  position: sticky;
  top: 0.5rem;
}

.detail-content-inner {
  color: var(--text);
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}

.item-list::-webkit-scrollbar {
  width: 8px;
}

.item-list::-webkit-scrollbar-track {
  background: var(--bg-main);
  border-radius: 4px;
}

.item-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  /* Reserve left edge so .selected does not shift layout (was breaking clicks after scroll). */
  border-left: 3px solid transparent;
  cursor: pointer;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  /* Row selection uses pointerdown without preventDefault; avoid drag-selecting label text on click. */
  user-select: none;
  -webkit-user-select: none;
}

.item-row:last-child {
  border-bottom: none;
}

.item-row:hover {
  background: var(--bg-hover);
}

.item-row.selected {
  background: rgba(122, 162, 247, 0.2);
  border-left-color: var(--accent);
}

/* Inventory/shop: keep list column above detail when grid is tight (theme uses 1fr + 1.4fr). */
.rw-main .rw-view .two-panel-body .list-panel {
  position: relative;
  z-index: 2;
}
.rw-main .rw-view .two-panel-body .detail-panel.rw-panel {
  position: relative;
  z-index: 1;
}

/* Hits register on <li>; avoids split targets across icon/name/badge/qty spans. */
#inventory-view-list.item-list > li.item-row > *,
#shop-view-list.item-list > li.item-row > * {
  pointer-events: none;
}

#inventory-view-list.item-list,
#shop-view-list.item-list {
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/*
 * Visual hit-test debug (inventory / shop): in DevTools, run:
 *   document.body.classList.add('rw-debug-inv-shop-hit')
 * Remove class when done. Green = list column, magenta = detail column, orange = each row.
 */
body.rw-debug-inv-shop-hit .inventory-view .two-panel-body .list-panel,
body.rw-debug-inv-shop-hit .shop-view .two-panel-body .list-panel {
  outline: 4px solid lime !important;
  box-shadow: inset 0 0 0 9999px rgba(0, 255, 0, 0.14) !important;
}
body.rw-debug-inv-shop-hit .inventory-view .two-panel-body .detail-panel.rw-panel,
body.rw-debug-inv-shop-hit .shop-view .two-panel-body .detail-panel.rw-panel {
  outline: 4px solid magenta !important;
  box-shadow: inset 0 0 0 9999px rgba(255, 0, 255, 0.12) !important;
}
body.rw-debug-inv-shop-hit #inventory-view-list.item-list,
body.rw-debug-inv-shop-hit #shop-view-list.item-list {
  outline: 3px solid cyan !important;
}
body.rw-debug-inv-shop-hit #inventory-view-list .item-row,
body.rw-debug-inv-shop-hit #shop-view-list .item-row {
  outline: 2px solid orange !important;
  background: rgba(255, 165, 0, 0.12) !important;
}

.item-icon {
  font-size: 1.2em;
  flex-shrink: 0;
}

.item-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 0.85em;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

.item-qty {
  min-width: 2.5em;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.9em;
}

.item-value {
  min-width: 3em;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.9em;
}

.badge {
  font-size: 0.7em;
  padding: 0.1rem 0.35rem;
  background: var(--bg-hover);
  border-radius: 3px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.detail-icon-large {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-ui), "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.detail-name {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--text);
}

.detail-desc,
.detail-stats,
.detail-obtained,
.detail-price,
.detail-you-have,
.item-level-req {
  font-size: 0.9em;
  color: var(--text-muted);
  margin: 0.35rem 0;
}

.item-level-req {
  font-weight: 600;
  color: var(--accent);
}

.item-level-req.level-too-low {
  color: #f7768e;
}

.detail-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.detail-actions .btn-sell,
.detail-actions .btn-buy {
  flex-shrink: 0;
}

.inventory-empty,
.shop-empty {
  padding: 1rem;
  text-align: center;
}

.panel-title {
  margin: 0 1rem 0.75rem;
  font-size: 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Lists */
.skill-list,
.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-list {
  padding: 0.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.skill-list li {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border-bottom: none;
}

.skill-list li.skill-list-category {
  padding: 0.35rem 0.5rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #888);
  background: none;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.action-list li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.action-list li:last-child {
  border-bottom: none;
}

.action-list li.action-tier-header {
  padding: 0.4rem 0.6rem 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #888);
  background: var(--bg-soft, rgba(0,0,0,0.08));
  border-bottom: 1px solid var(--border);
  list-style: none;
  border-radius: 0;
}

.magic-skill-info {
  list-style: none;
  padding: 1rem;
  border-bottom: none;
}

.magic-spellbook-header {
  font-size: 1em;
  margin-bottom: 0.5rem;
  color: var(--accent-soft);
}

.magic-active-buff[title] {
  cursor: help;
}

.magic-skill-desc {
  margin: 0 0 0.75rem;
  font-size: 0.95em;
}

.runecrafting-hint {
  margin: 0 0 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.9em;
  color: var(--muted, #666);
  list-style: none;
  border-bottom: 1px solid var(--border, #ddd);
  color: var(--text-dim);
  line-height: 1.4;
}

.magic-skill-effects {
  margin: 0;
  font-size: 0.9em;
  color: var(--accent-soft);
}

.spellbook-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0.75rem 0 0.5rem;
}
.spellbook-tab {
  padding: 0.4rem 0.75rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.9em;
  cursor: pointer;
}
.spellbook-tab:hover { color: var(--text); }
.spellbook-tab.active {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--accent);
}
.spellbook-tab.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
.spellbook-pane { margin-top: 0.5rem; }
.spell-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.spell-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.spell-row:last-child { border-bottom: none; }
.spell-row .spell-name { flex: 1 1 auto; font-weight: 500; }
.spell-row .spell-meta { font-size: 0.85em; color: var(--text-dim); }
.spell-row .btn-cast-spell { flex-shrink: 0; }

.magic-autocast-row { margin: 0 0 0.75rem; }
.magic-autocast-row label { margin-right: 0.5rem; font-size: 0.9em; }
.magic-autocast-select { min-width: 10rem; padding: 0.25rem 0.5rem; background: var(--bg-panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); }
.magic-autocast-unlock { margin: 0 0 0.75rem; font-size: 0.9em; color: var(--text-dim); }

.skill-btn,
.action-btn {
  display: block;
  width: 100%;
  padding: 0.55rem 1rem;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.skill-btn {
  border-left: 3px solid transparent;
  padding-left: calc(1rem - 3px);
  border-radius: var(--radius);
}

.skill-btn:hover {
  background: var(--bg-hover);
}

.skill-btn.selected {
  background: rgba(122, 162, 247, 0.12);
  border-left-color: var(--accent);
}

.action-btn:hover:not(.locked) {
  background: var(--bg-hover);
}

.action-btn.selected {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  padding-left: calc(1rem - 3px);
}

.action-btn.locked {
  cursor: default;
  color: var(--text-dim);
  opacity: 0.85;
}

.action-lock {
  font-size: 0.9em;
  margin-right: 0.25rem;
}

.action-missing {
  font-size: 0.9em;
  margin-right: 0.25rem;
  color: var(--warning);
}

.action-btn.missing-items .action-missing {
  opacity: 1;
}

.action-new-badge,
.area-new-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  margin-right: 0.35rem;
  border-radius: 3px;
  background: var(--success);
  color: var(--bg-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.action-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-row .name {
  font-weight: 500;
}

.action-row .meta {
  color: var(--text-dim);
  font-size: 0.85em;
}

/* Detail panel */
.detail-panel .detail-content {
  margin: 0 1rem;
}

/* Action header: darker overlay, then badge + title row */
.rw-action-header.action-header {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  min-height: 0;
}

.rw-action-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 22, 0.97) 0%, rgba(4, 6, 12, 0.98) 100%);
  pointer-events: none;
  z-index: 0;
}

.rw-action-header.action-header .rw-action-header-icon,
.rw-action-header.action-header .rw-action-header-body,
.rw-action-header.action-header .action-skill-badge {
  position: relative;
  z-index: 1;
}

.rw-action-header-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rw-action-header-icon.rw-action-header-icon--empty {
  width: 0;
  padding: 0;
  overflow: hidden;
  min-width: 0;
  margin: 0;
}

/* Skill icon badge: framed container so icon reads clearly */
.action-skill-badge {
  width: 96px;
  height: 96px;
  min-width: 96px;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.95) 0%, rgba(6, 10, 20, 0.95) 100%);
  border: 1px solid rgba(201, 160, 35, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.action-skill-icon {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.action-skill-icon:not([src]),
.action-skill-icon[src=""] {
  display: none;
}

.rw-action-header-body.action-header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.rw-action-header .action-title.rw-panel-title,
.rw-action-header .action-title .rw-action-name {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent, #c9a023);
  margin: 0;
}

.rw-action-header .action-meta.skill-xp-bar {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim, rgba(255, 255, 255, 0.7));
}

.detail-two-col {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-col-left,
.detail-col-right {
  flex: 1;
  min-width: 0;
}

.detail-section {
  margin-bottom: 1.25rem;
}

.detail-action-stats {
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
}

.action-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem 1rem;
}

.action-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.action-stat-label {
  font-size: 0.75em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.action-stat-value {
  font-size: 0.9em;
  color: var(--text);
}

.detail-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Requires: compact but readable card grid */
.rw-requires-inner {
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.rw-requires-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rw-requires-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 9px 11px;
  gap: 5px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 0.2s ease;
}
.rw-requires-card:hover {
  box-shadow: 0 0 12px rgba(122, 162, 247, 0.35);
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-2px);
}
.rw-requires-card .rw-requires-icon {
  font-size: 1.15rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rw-requires-card .rw-requires-name {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--text);
  word-break: break-word;
  line-height: 1.2;
}
.rw-requires-card .rw-requires-badges {
  display: inline-flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.rw-requires-card .rw-badge {
  padding: 3px 7px;
  font-size: 11.5px;
}
.rw-requires-inv.rw-badge,
.requires-inv {
  color: var(--text-muted);
}

.requires-hint {
  color: var(--warning);
}

/* Action queue (detail panel) */
.action-queue-section {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.action-queue-section.queue-active {
  border-left: 3px solid var(--accent);
  padding-left: 0.5rem;
  margin-left: 0.25rem;
  background: var(--bg-panel);
  border-radius: var(--radius);
}
.queue-active-badge {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--accent);
  margin-left: 0.35rem;
}
.action-queue-hint {
  margin: 0 0 0.5rem;
  font-size: 0.85em;
  color: var(--text-muted);
}
.action-queue-unlock-hint {
  margin: 0 0 0.5rem;
  font-size: 0.82em;
  color: var(--accent-soft);
}
.action-queue-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  max-height: 12rem;
  overflow-y: auto;
}
.action-queue-step {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9em;
}
.action-queue-step.current {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-panel));
}
.action-queue-step.completed {
  opacity: 0.85;
}
.action-queue-step.completed .queue-step-name {
  color: var(--text-muted);
}
.action-queue-step.completed .queue-step-progress {
  color: var(--text-dim);
}
.queue-step-name {
  font-weight: 500;
  color: var(--text);
}
.queue-step-target {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.queue-step-progress {
  color: var(--accent-soft);
  font-variant-numeric: tabular-nums;
}
.btn-remove-queue-step {
  margin-left: auto;
  padding: 0.1rem 0.35rem;
  font-size: 1.1em;
  line-height: 1;
}
.action-queue-empty {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  color: var(--text-muted);
}
.action-queue-add {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.action-queue-add label {
  font-size: 0.9em;
  color: var(--text-dim);
}
.queue-target-input {
  width: 8rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-main);
  color: var(--text);
}
.action-queue-buttons {
  display: flex;
  gap: 0.5rem;
}

.loot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.loot-table th,
.loot-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.loot-table th {
  color: var(--text-dim);
  font-weight: 500;
}

.loot-table .chance {
  color: var(--accent-soft);
}

.loot-info {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  color: var(--text-dim);
}

.session-gains {
  margin: 0.5rem 0 0;
  font-size: 0.9em;
  color: var(--accent-soft);
}

.action-session-block {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.95em;
}

.action-session-block .rw-session-header {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.action-session-block .rw-session-drops {
  font-size: 0.9em;
  word-wrap: break-word;
}

.combat-session-block {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.95em;
}

.combat-session-block .rw-session-header {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.combat-session-block .rw-session-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.combat-session-block .rw-session-arrows {
  font-size: 0.9em;
  margin-bottom: 0.35rem;
  word-wrap: break-word;
}

.combat-session-block .rw-session-drops {
  font-size: 0.9em;
  word-wrap: break-word;
}

.consumable-slots {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.slot-group {
  flex: 1;
  min-width: 160px;
}

.slot-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85em;
  color: var(--text-dim);
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-main);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-danger {
  background: #f7768e;
  color: var(--bg-main);
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-small {
  background: var(--bg-main);
  color: var(--text);
  padding: 0.35rem 0.6rem;
  font-size: 0.85em;
}

.btn-small:hover {
  background: var(--bg-hover);
}

/* Progress bar */
.progress-bar-wrap {
  height: 8px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.25s ease;
}

/* Utility */
.hidden {
  display: none !important;
}

.welcome-panel {
  color: var(--text-dim);
  padding: 2rem 1rem;
}

.welcome-panel.hidden {
  display: none;
}

/* Select elements */
select.slot-select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9em;
}

select.slot-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.5rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Offline gains panel (return from away) - no .rw-panel to avoid theme margin/min-height */
.offline-gains-panel {
  position: fixed;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(420px, calc(100vw - 2rem));
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 0;
  margin: 0;
  min-height: 0;
}
.offline-gains-panel.hidden {
  display: none !important;
}
.offline-gains-inner {
  padding: 1rem 1.25rem;
  margin: 0;
  min-height: 0;
}
.offline-gains-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--accent);
  padding: 0;
  border: none;
  background: none;
}
.offline-gains-context {
  margin: 0 0 0.25rem 0;
  font-size: 0.9em;
  color: var(--text-dim);
}
.offline-gains-meta {
  margin: 0 0 0.35rem 0;
  font-size: 0.85em;
  color: var(--text-muted);
}
.offline-gains-xp {
  margin: 0.5rem 0 0.5rem 0;
  color: var(--success);
  font-size: 1rem;
}
.offline-gains-items-label {
  margin: 0.5rem 0 0.25rem 0;
  font-size: 0.9em;
  color: var(--text-dim);
}
.offline-gains-items {
  margin: 0 0 1rem 0;
  padding-left: 1.25rem;
  font-size: 0.9em;
}
.offline-gains-item {
  margin: 0.2rem 0;
}
.offline-gains-item-qty {
  color: var(--success);
  font-weight: 600;
}
.offline-gains-panel .rw-btn {
  margin-top: 0.25rem;
}

/* Inventory modal */
.inventory-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.inventory-modal.hidden {
  display: none !important;
}

.inventory-modal-inner {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 280px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: auto;
}

.inventory-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.inventory-modal-header h3 {
  margin: 0;
  font-size: 1rem;
}

.inventory-modal-body {
  padding: 1rem;
}

.inventory-gold {
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: var(--warning);
}

.inventory-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.inventory-modal-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.inventory-modal-row:last-child {
  border-bottom: none;
}

.inventory-modal-row .inv-item {
  flex: 1;
  min-width: 100px;
}

.inventory-modal-row .qty {
  color: var(--text-dim);
  min-width: 2em;
}

.sell-btns {
  display: flex;
  gap: 0.25rem;
}

.btn-sell {
  padding: 0.2rem 0.4rem;
  font-size: 0.8em;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.btn-sell:hover {
  background: var(--bg-hover);
}

.btn-sell:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sell:disabled:hover {
  background: var(--bg-main);
}

.shop-gold,
.inventory-total-value {
  font-weight: 600;
  color: var(--warning);
  white-space: nowrap;
}

.btn-buy {
  padding: 0.25rem 0.5rem;
  font-size: 0.85em;
  background: var(--accent);
  color: var(--bg-main);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
}

.btn-buy:hover {
  filter: brightness(1.1);
}

.btn-buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-buy:disabled:hover {
  filter: none;
}

.shop-empty {
  padding: 1rem;
  color: var(--text-dim);
  margin: 0;
}

.inventory-empty {
  margin: 0;
  color: var(--text-dim);
}

/* Settings view (in-game tab) */
.settings-view {
  padding: 0 1rem 1rem;
  color: var(--text);
}

.settings-view.hidden {
  display: none !important;
}

.settings-intro {
  margin: 0 0 1rem;
  font-size: 0.9em;
  line-height: 1.4;
}

.settings-body {
  padding: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-card {
  padding: 1rem 1.1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.settings-card-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.settings-card-desc {
  margin: 0 0 0.75rem;
  font-size: 0.85em;
  color: var(--text-dim);
  line-height: 1.35;
}

.settings-card .settings-check {
  display: block;
  margin-bottom: 0.5rem;
}

.settings-card .settings-check:last-of-type {
  margin-bottom: 0;
}

.settings-card.settings-card-danger {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--bg-panel));
}

.settings-card-danger .settings-card-title {
  color: var(--warning);
}

.settings-row {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.settings-label {
  font-size: 0.9em;
  color: var(--text-dim);
}

.settings-select {
  padding: 0.35rem 0.6rem;
  font-size: 0.9em;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
}

.settings-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Legacy section class (if used elsewhere) */
.settings-section {
  margin-bottom: 1.25rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Reduce motion: tone down animations */
body.reduce-motion .floating-gain,
body.reduce-motion .toast {
  animation: none;
  opacity: 1;
}

body.reduce-motion .skill-row-levelup,
body.reduce-motion .skill-xp-bar.level-up-pulse,
body.reduce-motion .level-up-pulse {
  animation: none;
}

/* Equipment view */
.equipment-view {
  padding: 0 1rem 1rem;
}

.equipment-view.hidden {
  display: none !important;
}

.equipment-stats-summary {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9em;
  color: var(--text-dim);
}

.equipment-stats-summary .equipment-stats-line {
  display: block;
}

.equipment-stats-summary .equipment-class-line {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-dim);
}

.equipment-stats-summary .equipment-class-bonuses {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82em;
  opacity: 0.9;
  color: var(--text-dim);
  cursor: help;
}

.equipment-stats-summary .equipment-mastery-line {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82em;
  opacity: 0.9;
  color: var(--text-dim);
}

.equipment-stats-summary .equipment-mastery-perks {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78em;
  opacity: 0.88;
  color: var(--text-dim);
}

.equipment-stats-legend {
  font-size: 0.8em;
  margin: 0 0 1rem;
  line-height: 1.4;
  max-width: 42em;
}

.equipment-upgrade-info {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9em;
}

.equipment-upgrade-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.equipment-upgrade-info p {
  margin: 0.35rem 0;
}

.equipment-upgrade-costs {
  margin: 0.5rem 0 0.35rem 1.25rem;
  padding: 0;
}

.equipment-upgrade-costs li {
  margin: 0.2rem 0;
}

.equipment-upgrade-source {
  font-size: 0.85em;
  margin-top: 0.5rem;
}

.equipment-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.equipment-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.equipment-slot label {
  min-width: 5em;
  font-size: 0.85em;
  color: var(--text-dim);
}

.equipment-slot-value {
  flex: 1;
  min-width: 120px;
}

.equipment-slot-effects {
  font-size: 0.85em;
  color: var(--accent-soft);
  margin-left: 0.25rem;
}

.equipment-slot-meta {
  font-size: 0.8em;
  color: var(--text-dim);
  margin-left: 0.25rem;
}

.equipment-slot-preview {
  font-size: 0.8em;
  color: var(--accent);
  margin-left: 0.25rem;
}

.btn-upgrade {
  margin-left: 0.25rem;
}

.btn-upgrade:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.equipment-repair-row {
  margin: 0.5rem 0;
}

.equipment-durability-hint {
  margin-top: 0.25rem;
  font-size: 0.8em;
}

.equipment-durability {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  margin-left: 5em;
}

.durability-bar {
  height: 4px;
  min-width: 40px;
  max-width: 80px;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.2s;
}

.durability-bar.durability-low {
  background: var(--warning);
}

.durability-bar.durability-wornout {
  background: var(--text-dim);
}

.durability-label {
  font-size: 0.75em;
  color: var(--text-dim);
}

.equipment-tool-row .equipment-durability {
  margin-left: 0;
}

/* Tools section - card grid */
.equipment-tools-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.equipment-tools-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

.equipment-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.tool-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tool-card-empty {
  border-style: dashed;
  opacity: 0.85;
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text);
}

.tool-card-skill-icon {
  font-size: 1.1em;
}

.tool-card-skill-name {
  color: var(--text);
}

.tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tool-card-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9em;
}

.tool-card-item-icon {
  font-size: 1.05em;
}

.tool-card-empty .tool-card-item-name {
  color: var(--text-dim);
  font-style: italic;
}

.tool-card-durability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-card-durability-track {
  flex: 1;
  min-width: 0;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.tool-card-durability .durability-bar {
  height: 100%;
  min-width: 0;
  max-width: none;
}

.tool-card-durability .durability-label {
  font-size: 0.75em;
  color: var(--text-dim);
  white-space: nowrap;
}

.tool-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(59, 66, 97, 0.5);
}

.tool-card-actions .btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.8em;
}

.equipment-hint {
  margin-top: 0.75rem;
  font-size: 0.85em;
  color: var(--text-dim);
}

.btn-equip {
  padding: 0.2rem 0.5rem;
  font-size: 0.8em;
  background: var(--accent);
  color: var(--bg-main);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
}

.btn-equip:hover {
  filter: brightness(1.1);
}

.btn-unequip {
  margin-left: auto;
}

.equipped-badge {
  font-size: 0.75em;
  color: var(--success);
  margin-left: 0.35rem;
}

/* Combat view: background image on container (JS sets --combat-panel-bg-image), overlay + content on top */
.combat-view.combat-panel-area {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  min-height: 0;
  background-image: var(--combat-panel-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.combat-view {
  padding: 0 1rem 1rem;
}

.combat-view.hidden {
  display: none !important;
}

.combat-panel-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(5, 10, 20, 0.65), rgba(5, 10, 20, 0.72));
  z-index: 1;
}

.combat-view .combat-panel-content {
  position: relative;
  z-index: 2;
}

.combat-view .rw-combat-panel {
  background: rgba(36, 40, 59, 0.88);
}

.combat-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
}

.combat-tabs .combat-tab {
  padding: 0.4rem 0.75rem;
  font-size: 0.9em;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
}

.combat-tabs .combat-tab:hover {
  background: var(--bg-hover);
}

.combat-tabs .combat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.combat-pane.hidden {
  display: none !important;
}

.prayer-desc { margin: 0 0 0.5rem; font-size: 0.9em; color: var(--text-dim); }
.prayer-points { font-weight: 600; margin: 0 0 0.75rem; }
.prayer-list { list-style: none; padding: 0; margin: 0; }
.prayer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.prayer-row:last-child { border-bottom: none; }
.prayer-row .btn-prayer { flex: 1 1 auto; text-align: left; }
.prayer-row .btn-prayer.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.prayer-desc-small { font-size: 0.85em; color: var(--text-dim); }

.combat-dungeon-context {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.combat-dungeon-context.hidden {
  display: none !important;
}

.combat-dungeon-context #combat-dungeon-name {
  font-weight: 500;
  color: var(--accent-soft);
}

.combat-layout {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.combat-left {
  min-width: 180px;
}

.combat-right {
  flex: 1;
  min-width: 260px;
}

.combat-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.85em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.combat-area-list,
.combat-creature-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
}

.combat-area-list li,
.combat-creature-list li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.combat-area-list li:last-child,
.combat-creature-list li:last-child {
  border-bottom: none;
}

.combat-area-btn,
.combat-creature-btn {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.15s;
}

.combat-area-btn:hover:not(.locked):not([disabled]),
.combat-creature-btn:hover {
  background: var(--bg-hover);
}

.combat-area-btn.selected,
.combat-creature-btn.selected {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  padding-left: calc(0.75rem - 3px);
}

.combat-area-btn.locked,
.combat-area-btn:disabled {
  cursor: default;
  color: var(--text-dim);
  opacity: 0.85;
}

.combat-dungeon-info,
.combat-dungeon-foe {
  padding: 0.5rem 0.75rem;
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

.combat-dungeon-info {
  color: var(--accent);
}

.combat-empty {
  padding: 0.5rem 0.75rem;
  color: var(--text-dim);
  margin: 0;
}

.combat-fight-panel {
  padding: 0.75rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.combat-hp-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.combat-hp-block {
  flex: 1;
  min-width: 140px;
}

.combat-hp-block label {
  display: block;
  font-size: 0.85em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.hp-bar {
  height: 8px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.hp-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.combat-hp-block .hp-bar-fill {
  background: var(--accent);
}

.combat-hp-block:last-child .hp-bar-fill {
  background: #f7768e;
}

.combat-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.combat-auto-eat-label {
  font-size: 0.85em;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.combat-auto-eat-label input {
  cursor: pointer;
}

.combat-log-title {
  margin: 0 0 0.5rem;
  font-size: 0.85em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.combat-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.85em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.combat-log-line {
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.combat-log-line:last-child {
  border-bottom: none;
}

/* Dungeons view */
.dungeons-view {
  padding: 0 1rem 1rem;
}

.dungeons-view.hidden {
  display: none !important;
}

.dungeons-hint {
  font-size: 0.85em;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

.dungeons-view-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
}

.dungeon-section-header {
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.95em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border);
  list-style: none;
  margin: 0;
}

.dungeon-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.dungeon-row:last-child {
  border-bottom: none;
}

.dungeon-name {
  flex: 1;
  min-width: 120px;
  font-weight: 500;
}

.dungeon-cleared {
  font-size: 0.85em;
  color: var(--success);
  font-weight: 500;
}

.dungeon-level {
  font-size: 0.9em;
  color: var(--text-dim);
}

.dungeon-key {
  font-size: 0.9em;
  color: var(--text-dim);
}

.dungeons-empty {
  padding: 1rem;
  color: var(--text-dim);
  margin: 0;
}

.dungeons-view-selected {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dungeons-view-selected.hidden {
  display: none !important;
}
.dungeons-coming-next {
  margin: 0 0 0.5rem 0;
  color: var(--text-dim);
  font-size: 0.95em;
}

/* Collections — let the list grow with content; .center-panel scrolls (overflow-y: auto).
   A fixed max-height + overflow:hidden here clipped long bestiary/item lists with no way to scroll. */
.collections-view {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
}

.collections-view.hidden {
  display: none !important;
}

/* Shared tab/filter button styling (Collections + Achievements, same as app theme) */
.collections-tabs button,
.achievements-category-tabs button,
.collections-items-toolbar button {
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  cursor: pointer;
}
.collections-tabs button:hover,
.achievements-category-tabs button:hover,
.collections-items-toolbar button:hover {
  background: var(--bg-hover);
}
.collections-tabs button.active,
.achievements-category-tabs button.active,
.collections-items-toolbar button.active {
  background: var(--accent);
  color: var(--bg-main);
  border-color: var(--accent);
}

.collections-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
  flex-wrap: wrap;
}

.collections-tab {
  padding: 0.4rem 0.75rem;
  font-size: 0.9em;
  border-radius: var(--radius);
}

.collections-pane {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.collections-pane.hidden {
  display: none !important;
}

.collections-view h1,
.collections-view h2,
.collections-view .panel-title,
.achievements-view h1,
.achievements-view h2,
.achievements-view .panel-title {
  color: var(--text);
}

.collections-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
}

.collections-list li {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--text);
}

.collections-list li:last-child {
  border-bottom: none;
}

.collection-entry-locked {
  opacity: 0.7;
  color: var(--text-muted);
}

.collection-status {
  min-width: 1.2em;
  font-weight: bold;
  color: var(--text);
}

.collection-name {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.collection-count,
.collection-meta {
  font-size: 0.9em;
  color: var(--text-muted);
}

.collection-badge {
  font-size: 0.75em;
  padding: 0.15rem 0.4rem;
  background: var(--accent);
  color: var(--bg-main);
  border-radius: var(--radius);
  margin-left: 0.25rem;
}

.player-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.75rem;
}
.player-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(184, 150, 46, 0.3);
  flex-shrink: 0;
}
.player-name-title {
  font-size: 0.95em;
  color: var(--text-muted);
}
.player-name-title::before {
  content: '';
  margin: 0;
}

.collections-items-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.collections-filter-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.85em;
  border-radius: var(--radius);
}

.collections-items-search {
  padding: 0.35rem 0.5rem;
  font-size: 0.9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 10rem;
  background: var(--bg-panel);
  color: var(--text);
}

.collection-title-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--text);
}
.collection-title-entry .collection-desc {
  font-size: 0.9em;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}
.collection-title-entry.title-locked {
  opacity: 0.7;
  color: var(--text-muted);
}
.collection-title-entry.title-equipped .title-equip-btn {
  background: var(--accent);
  color: var(--bg-main);
}

/* Achievements view */
.achievements-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
}
.achievements-view.hidden {
  display: none !important;
}

.achievements-category-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.5rem;
  flex-wrap: wrap;
}

.achievements-cat-tab {
  padding: 0.35rem 0.6rem;
  font-size: 0.85em;
  border-radius: var(--radius);
}

.achievements-points {
  font-size: 0.95em;
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

.achievements-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.achievement-card {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
}
.achievement-card.achievement-unlocked {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.achievement-name {
  font-weight: 600;
  margin-right: 0.5rem;
  color: var(--text);
}
.achievement-badge {
  font-size: 0.8em;
  color: var(--accent);
  font-weight: 500;
}
.achievement-desc {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9em;
  color: var(--text-muted);
}
.achievement-progress-bar {
  height: 6px;
  background: var(--bg-main);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.achievement-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s ease;
}
.achievement-progress-text {
  font-size: 0.85em;
  color: var(--text-muted);
}
.achievement-card .achievement-points {
  font-size: 0.85em;
  color: var(--text-muted);
}

/* Quests view */
.quests-view {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--text);
}
.quests-view.hidden {
  display: none !important;
}

.quests-view .panel-title {
  margin: 0 0 0.25rem;
}

.quests-hint {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  color: var(--text-muted);
  line-height: 1.4;
}

.quests-section {
  margin: 0;
}

.quests-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.quests-daily {
  margin-bottom: 0.25rem;
}

.quests-empty {
  margin: 0;
  padding: 0.75rem;
  font-size: 0.9em;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.quests-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quest-card {
  padding: 0.85rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quest-card:hover {
  border-color: var(--border-strong);
}
.quest-card.quest-claimed {
  opacity: 0.85;
}
.quest-card.quest-claimed .quest-name {
  color: var(--text-muted);
}

.quest-card-daily {
  border-left: 3px solid var(--accent);
}
.quest-card-daily.quest-claimed {
  border-left-color: var(--text-muted);
}

.quest-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.quest-name {
  font-weight: 600;
  font-size: 1em;
  color: var(--text);
}

.quest-desc {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  color: var(--text-muted);
  line-height: 1.4;
}

.quest-progress-bar {
  height: 6px;
  background: var(--bg-main);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.quest-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.quest-progress-text {
  font-size: 0.85em;
  font-weight: 500;
  color: var(--accent-soft);
}

.quest-badge {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
}
.quest-badge-claimed {
  background: var(--bg-main);
  color: var(--text-muted);
}

.quest-card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.25rem;
}
.quest-card-footer .btn-claim-quest {
  flex-shrink: 0;
}

.quest-reward-line {
  margin: 0;
  font-size: 0.85em;
  color: var(--text-dim);
}
.quest-reward-line .quest-reward {
  color: var(--accent-soft);
}

/* Tasks view */
.tasks-view {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--text);
}
.tasks-view.hidden {
  display: none !important;
}
.tasks-view .panel-title {
  margin: 0 0 0.25rem;
}
.tasks-hint {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  color: var(--text-muted);
  line-height: 1.4;
}
.tasks-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
}
.tasks-token-count {
  font-weight: 600;
  color: var(--text);
}
.tasks-reset-timer {
  font-size: 0.9em;
}
.tasks-section {
  margin: 0;
}
.tasks-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.tasks-daily-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tasks-task-card {
  padding: 0.85rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tasks-task-card:hover {
  border-color: var(--border-strong);
}
.tasks-task-card.tasks-task-claimed {
  opacity: 0.85;
}
.tasks-task-card.tasks-task-claimed .tasks-task-name {
  color: var(--text-muted);
}
.tasks-contract-card {
  background: linear-gradient(180deg, rgba(201,162,39,0.08), rgba(0,0,0,0.08)), var(--bg-panel);
  border-color: rgba(201,162,39,0.28);
}
.tasks-section-daily .tasks-contract-card {
  border-left: 3px solid rgba(201,162,39,0.7);
}
.tasks-section-slayer .tasks-contract-card {
  border-left: 3px solid rgba(194,82,70,0.75);
}
.tasks-contract-type {
  display: inline-block;
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.tasks-contract-type-bounty {
  color: #f0b0a8;
}
.tasks-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.tasks-task-name {
  font-weight: 600;
  font-size: 1em;
  color: var(--text);
}
.tasks-task-progress-wrap {
  flex-shrink: 0;
  margin-left: 0.25rem;
}
.tasks-progress-text {
  font-size: 0.85em;
  font-weight: 500;
  color: var(--accent-soft);
}
.tasks-view .tasks-progress-bar {
  margin-bottom: 0.5rem;
}
.tasks-reward-line {
  margin: 0;
  font-size: 0.85em;
  color: var(--text-dim);
}
.tasks-flavor-line {
  margin: 0 0 0.35rem;
  font-size: 0.82em;
  color: var(--text-muted);
  line-height: 1.3;
}
.tasks-status-line {
  margin: 0 0 0.4rem;
}
.tasks-status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.tasks-status-progress {
  color: #8ec4ff;
  border-color: rgba(91,157,223,0.45);
  background: rgba(44,79,122,0.24);
}
.tasks-status-not-started {
  color: #d9c79c;
  border-color: rgba(181,151,90,0.45);
  background: rgba(98,79,40,0.24);
}
.tasks-status-ready {
  color: #9ee0a2;
  border-color: rgba(92,173,94,0.45);
  background: rgba(40,94,42,0.24);
}
.tasks-status-claimed {
  color: var(--text-muted);
  border-color: var(--border);
  background: rgba(90,90,90,0.2);
}
.tasks-badge-claimed {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.tasks-slayer-card {
  border-left: 3px solid var(--accent);
}
.tasks-slayer-streak {
  font-size: 0.85em;
}
.tasks-empty {
  margin: 0;
  padding: 0.75rem;
  font-size: 0.9em;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.quests-weekly {
  margin-bottom: 0.25rem;
}

.quest-card-weekly {
  border-left: 3px solid var(--accent-soft);
}
.quest-card-weekly.quest-claimed {
  border-left-color: var(--text-muted);
}

.quests-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.quests-filter-tab {
  padding: 0.35rem 0.6rem;
  font-size: 0.85em;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
}
.quests-filter-tab:hover {
  background: var(--bg-hover);
}
.quests-filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.quest-category-badge {
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius);
  background: var(--bg-main);
  color: var(--text-dim);
  margin-right: 0.5rem;
}

.combat-style-info {
  font-size: 0.95em;
  font-weight: 700;
  color: #f6e9c8;
  margin: 0 0 0.4rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(200, 160, 90, 0.55);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(58, 42, 24, 0.9), rgba(38, 28, 16, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 236, 181, 0.08);
}
.combat-style-info.hidden {
  display: none !important;
}
.combat-gear-bonuses {
  font-size: 0.9em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.combat-gear-bonuses.hidden {
  display: none !important;
}

.combat-food-status {
  font-size: 0.92em;
  font-weight: 700;
  color: #f4e3b2;
  margin: 0.25rem 0 0.65rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(212, 170, 89, 0.6);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(62, 45, 26, 0.9), rgba(42, 30, 18, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 236, 181, 0.08);
}
.combat-target-info {
  font-size: 0.9em;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-main);
  border-radius: var(--radius);
}
.combat-target-info.hidden {
  display: none !important;
}
.combat-target-drops {
  color: var(--text-dim);
}
.btn-tiny {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  margin-left: 0.5rem;
}

.combat-rest-panel {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-main);
  border-radius: var(--radius);
  font-size: 0.9em;
}
.combat-rest-panel.hidden {
  display: none !important;
}
.combat-rest-panel #combat-rest-label {
  color: var(--text-dim);
  font-size: 0.95em;
}

.combat-creature-btn.locked {
  opacity: 0.6;
  color: var(--text-dim);
  cursor: not-allowed;
}

/* Info view — Skills list with progress */
.info-skills-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.info-skill-row {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.info-skill-row:last-child {
  border-bottom: none;
}
.info-skill-name {
  display: block;
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.info-skill-xp {
  font-size: 0.9em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.35rem;
}
.info-skill-bar-wrap {
  height: 5px;
  background: var(--bg-main);
  border-radius: 3px;
  overflow: hidden;
}
.info-skill-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

/* Manual view — tabbed layout */
.manual-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
  flex-wrap: wrap;
}
.manual-tabs .manual-tab {
  padding: 0.4rem 0.75rem;
  font-size: 0.9em;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
}
.manual-tabs .manual-tab:hover {
  background: var(--bg-hover);
}
.manual-tabs .manual-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.manual-pane {
  overflow-y: auto;
}
.manual-pane.hidden {
  display: none !important;
}

/* Manual Skills: per-skill tabs */
.manual-skills-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.manual-skill-tab {
  padding: 0.35rem 0.6rem;
  font-size: 0.8em;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.manual-skill-tab:hover {
  background: var(--bg-hover);
}
.manual-skill-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.manual-skill-content {
  overflow-y: auto;
}
.manual-skill-content .manual-action-list li,
.manual-skill-content .manual-creature-list li {
  font-size: 0.9em;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.info-content .info-section {
  margin-bottom: 1.25rem;
}
.info-content .info-section h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
.info-content .info-sub {
  font-size: 0.95em;
  margin: 0.75rem 0 0.35rem;
  font-weight: 600;
}
.info-content .info-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0 0 0.5rem;
}
.info-content .info-list li {
  margin-bottom: 0.25rem;
}
.info-content .info-tips li {
  margin-bottom: 0.5rem;
}

/* Updates / revision list (Manual → Updates) */
.updates-manual-section .updates-intro {
  font-size: 0.9em;
  margin: 0 0 0.85rem;
}
.updates-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
}
.updates-manual-section .updates-pagination + .updates-revisions-stack + .updates-pagination {
  margin-top: 1rem;
  margin-bottom: 0;
}
.updates-page-meta {
  font-size: 0.82rem;
  text-align: center;
  flex: 1 1 12rem;
  min-width: 0;
}
.updates-page-count {
  font-weight: 600;
  color: var(--text);
}
.updates-revisions-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.update-block {
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border-left: 4px solid var(--accent);
}
.update-block-header {
  padding: 0.65rem 0.85rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
}
.update-block-body {
  padding: 0.5rem 0.85rem 0.85rem;
}
.update-version {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: inherit;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: var(--text);
}
.update-version-name {
  display: inline-block;
  padding: 0.15em 0.65em 0.2em;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset;
}
.update-date {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.update-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0.85rem 0 0.35rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.update-block-body > .update-section-title:first-of-type {
  margin-top: 0.35rem;
}
.update-block .updates-list {
  margin-top: 0;
}

/* Admin (Dev Tools) — only visible when devMode */
.admin-view.hidden {
  display: none !important;
}

.admin-hint {
  font-size: 0.85em;
  margin-bottom: 1rem;
}

.admin-sections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: var(--bg-panel);
}

.admin-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.admin-row label {
  min-width: 5rem;
  font-size: 0.9em;
}

.admin-input,
.admin-select {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-main);
  font-size: 0.9em;
}

.admin-input-qty {
  width: 4rem;
}

.admin-select {
  min-width: 12rem;
  max-width: 20rem;
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.btn-admin.hidden {
  display: none !important;
}

/* Regions view: container sized to house full-span Next region background (like Actions panel). */
.regions-view {
  padding: 0 1rem 1rem;
}

.regions-view.hidden {
  display: none !important;
}

.regions-view .rw-panel-inner {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.regions-current {
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.regions-current-card {
  padding: 0.75rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}

.regions-current-name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--text);
}

.regions-current-desc {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-dim);
}

/* Next region: full-span background image (same as Actions/skill panel). */
.regions-next {
  flex: 1;
  min-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 1rem;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.regions-next-content {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.regions-next-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.regions-next-desc {
  margin: 0 0 0.75rem;
  font-size: 0.9em;
  color: var(--text-dim);
}

.regions-progress-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.regions-progress-bar.hidden {
  display: none !important;
}

.regions-progress-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden;
}

.regions-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.regions-progress-pct {
  font-size: 0.85em;
  color: var(--text-dim);
  min-width: 3em;
}

.regions-requirements {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 0.9em;
}

.regions-req-item {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.regions-req-item:last-child {
  border-bottom: none;
}

.regions-req-item.req-met {
  color: var(--success);
}

.regions-req-item.req-pending {
  color: var(--text-dim);
}

.req-symbol {
  font-weight: bold;
  min-width: 1.2em;
}

.req-progress {
  flex: 1 1 100%;
  font-size: 0.9em;
  margin-top: 0.2rem;
  padding-left: 1.5em;
}

.req-progress-wrap {
  height: 4px;
  background: var(--bg-main);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.2rem;
  max-width: 120px;
}

.req-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.req-progress-text {
  display: block;
  font-size: 0.85em;
  color: var(--text-muted);
}

.btn-unlock-region {
  margin-top: 0.5rem;
}

/* House view */
.house-view {
  padding: 0 1rem 1rem;
}

.house-view.hidden {
  display: none !important;
}

.house-level {
  margin: 0 0 0.75rem;
  font-size: 0.95em;
  color: var(--text-dim);
}

.house-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.house-slot {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.house-slot-inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.house-slot-inner .module-name {
  font-weight: 500;
  color: var(--accent);
}

.house-slot-inner .module-effect-desc {
  display: block;
  font-size: 0.85em;
  color: var(--text-dim);
  margin-top: 0.25rem;
  line-height: 1.3;
}

.house-slot-inner .module-select {
  padding: 0.4rem 1.75rem 0.4rem 0.5rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.95em;
  min-width: 160px;
  width: 100%;
  cursor: pointer;
  color-scheme: dark;
  position: relative;
  z-index: 1;
}

.house-slot-inner .module-select option {
  background: var(--bg-panel);
  color: var(--text);
}

.house-farming-plots .panel-title {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
}

.farming-plots-info {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  color: var(--text-dim);
}

.farming-plots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.farming-plot {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.farming-plot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.farming-plot-inner .plot-crop {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.farming-plot-inner .plot-info {
  font-size: 0.85em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.25rem;
}

.farming-plot-inner .plot-info.ready {
  color: var(--accent);
  font-weight: 500;
}

.farming-plot-inner .plot-harvest-info {
  font-size: 0.8em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.farming-plot-inner .plot-yield-tooltip {
  font-size: 0.75em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
  font-style: italic;
  cursor: help;
}

.farming-plot-inner .plot-fertilizer {
  font-size: 0.8em;
  color: #9ece6a;
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.farming-plot-inner .plot-fertilizer-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.farming-plot-inner .plot-fertilizer-buttons label {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.85em;
}

.farming-plot-inner .plot-fertilizer-buttons .btn-select-fert {
  padding: 0.4rem 0.6rem;
  font-size: 0.8em;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.farming-plot-inner .plot-fertilizer-buttons .btn-select-fert:hover {
  opacity: 0.8;
}

.farming-plot-inner .plot-fertilizer-buttons .btn-select-fert.active {
  opacity: 1;
  background: var(--accent);
  color: var(--bg-main);
  font-weight: 600;
}

.farming-plot-inner .plot-crop-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.farming-plot-inner .auto-replant-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85em;
  margin-top: 0.5rem;
  color: var(--text-dim);
  cursor: pointer;
}

.farming-plot-inner .auto-replant-toggle input[type="checkbox"] {
  cursor: pointer;
}

.farming-plot-inner .plot-timer {
  font-size: 0.9em;
  color: var(--text-dim);
}

.farming-plot-inner .plot-plant-select {
  padding: 0.3rem 0.5rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.9em;
  min-width: 120px;
}

.house-menagerie-section,
.house-shrine-section {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.shrine-bones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.house-skill-hint {
  list-style: none;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.house-skill-hint p {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
}

.house-skill-hint .btn-go-house {
  margin-top: 0.25rem;
}

.house-skill-hint .next-unlock {
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  background: var(--bg-main);
  border-left: 3px solid var(--accent);
  font-size: 0.9em;
  color: var(--accent);
}

/* House Projects */
.house-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.house-project {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.house-project.milestone {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.2);
}

.project-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.project-name {
  font-weight: 600;
  font-size: 1.05em;
}

.milestone-badge {
  font-size: 0.7em;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  background: var(--accent);
  color: var(--bg-main);
  border-radius: 3px;
}

.project-desc {
  font-size: 0.9em;
  color: var(--text-dim);
  margin: 0;
}

.project-costs {
  font-size: 0.9em;
  margin: 0;
}

.project-costs .text-dim {
  color: var(--text-dim);
}

.project-reward {
  font-size: 0.9em;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
}

.btn-build-project {
  margin-top: 0.25rem;
}

/* ========== RESPONSIVE ========== */
/* Desktop: >= 1024px - no major changes */
.btn-skills-drawer { display: none; }
.nav-menu-mobile { display: none; }

/* Tablet: 768–1023px - minor tightening */
@media (min-width: 768px) and (max-width: 1023px) {
  .top-bar { padding: 0.5rem 0.75rem; gap: 0.4rem; }
  .top-bar-right { gap: 0.5rem; }
  .left-panel { width: 180px; min-width: 160px; }
  .btn-small, .nav-btn { padding: 0.4rem 0.55rem; font-size: 0.82em; }
  .player-name-title { font-size: 0.9em; }
  .top-badge { font-size: 0.75em; padding: 0.15rem 0.4rem; }
}

/* Mobile + Tablet: single-column layout, skills in drawer (< 992px) */
@media (max-width: 991px) {
  .main-layout {
    flex-direction: row;
    min-width: 0;
  }
  .left-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    max-width: 85vw;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }
  .left-panel.drawer-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
  }
  .center-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 1;
    padding: 0.75rem;
    overflow-x: hidden;
  }
  .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .drawer-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .drawer-overlay.hidden { display: none; }
  body { overflow-x: hidden; }
  .detail-content { overflow-x: hidden; }
  .detail-content-inner { max-width: 100%; }
  /* Show Skills button so user can open drawer */
  .btn-skills-drawer {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 0.6rem;
  }
}

/* ========== MOBILE LAYOUT MODE (body.layout-mobile) ==========
   Treated as a distinct layout mode, not a resized desktop. JS sets body.layout-mobile when viewport <= 768px.
   Single column, overlay drawer, stacked content, no side-by-side panels. */
body.layout-mobile {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
body.layout-mobile .main-layout.rw-main {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  min-width: 0;
}
body.layout-mobile .left-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow-y: auto;
  border-right: none;
  max-width: none;
}
body.layout-mobile .left-panel.drawer-open {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}
body.layout-mobile .center-panel {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.5rem 0.75rem;
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  overflow-x: hidden;
  flex: none;
}
body.layout-mobile .drawer-overlay {
  z-index: 299;
}
body.layout-mobile .skills-drawer-edge-toggle {
  display: none;
}
body.layout-mobile.skills-panel-open .skills-drawer-edge-toggle {
  display: inline-flex;
  left: 0;
  top: 50%;
  z-index: 301;
}
body.layout-mobile .btn-close-drawer {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  margin-left: auto;
}
body.layout-mobile .skill-panel-content {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: unset;
}
body.layout-mobile .skill-panel .actions-panel.rw-panel,
body.layout-mobile .skill-panel .detail-panel.rw-panel {
  position: static;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  flex: none;
}
body.layout-mobile .skill-panel .detail-panel .detail-content {
  margin: 0 0.5rem;
}
body.layout-mobile .two-panel-body {
  display: flex;
  flex-direction: column;
  grid-template-columns: unset;
  gap: 0.75rem;
}
body.layout-mobile .inv-shop-layout .list-panel,
body.layout-mobile .inv-shop-layout .detail-panel,
body.layout-mobile .rw-main .rw-view .list-panel,
body.layout-mobile .rw-main .rw-view .detail-panel.rw-panel {
  position: static;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: none;
}
body.layout-mobile .inv-shop-layout .detail-panel {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* Mobile layout mode: compact top bar, Menu button, touch targets, stacked UI */
body.layout-mobile .top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  padding: 0.5rem 0.6rem;
  gap: 0.4rem;
  padding-left: max(0.6rem, env(safe-area-inset-left));
  padding-right: max(0.6rem, env(safe-area-inset-right));
}
body.layout-mobile .top-action {
  max-width: none;
  flex: 1;
  min-width: 0;
}
body.layout-mobile .top-action-title { font-size: 0.85em; }
body.layout-mobile .top-action-meta { font-size: 0.8em; }
body.layout-mobile .top-bar-right {
  flex-wrap: wrap;
  flex-shrink: 1;
  gap: 0.35rem;
  min-width: 0;
}
body.layout-mobile .player-name-title {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85em;
}
body.layout-mobile .top-badge {
  font-size: 0.75em;
  padding: 0.2rem 0.4rem;
}
body.layout-mobile .gold-display { font-size: 0.9em; }
body.layout-mobile .btn-skills-drawer {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.6rem;
}
body.layout-mobile .nav-primary { display: none; }
body.layout-mobile .nav-menu-mobile { display: block; }
body.layout-mobile .nav-dropdown-menu { min-width: 180px; right: 0; left: auto; }
body.layout-mobile #mainMenuBtn { min-height: 44px; padding: 0.5rem 0.75rem; }
body.layout-mobile .filter-row { flex-wrap: wrap; }
body.layout-mobile .filter-tab { min-height: 44px; padding: 0.5rem 0.6rem; }
body.layout-mobile .action-stats-grid {
  grid-template-columns: 1fr 1fr;
}
body.layout-mobile .loot-table,
body.layout-mobile .loot-table thead,
body.layout-mobile .loot-table tbody,
body.layout-mobile .loot-table tr { display: block; }
body.layout-mobile .loot-table thead { display: none; }
body.layout-mobile .loot-table tr {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
}
body.layout-mobile .loot-table td {
  display: block;
  padding: 0.2rem 0;
}
body.layout-mobile .loot-table td::before {
  content: attr(data-label);
  font-weight: 600;
  color: var(--text-dim);
  margin-right: 0.5rem;
}
body.layout-mobile .loot-table .chance { color: var(--accent-soft); }
body.layout-mobile .btn,
body.layout-mobile .btn-small,
body.layout-mobile .nav-btn,
body.layout-mobile .skill-btn,
body.layout-mobile .action-btn {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
}
body.layout-mobile .skill-list li:not(.skill-list-category) {
  min-height: 44px;
}
body.layout-mobile .skill-list li:not(.skill-list-category) .skill-btn {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
}
body.layout-mobile .action-list li {
  min-height: 44px;
}
body.layout-mobile .action-list .action-btn {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
}
body.layout-mobile .nav-dd-item {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
}
body.layout-mobile .nav-dd-mobile-section-toggle {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9em;
  font-family: inherit;
  cursor: pointer;
}
body.layout-mobile .nav-dd-mobile-section-toggle:hover {
  background: var(--bg-hover);
}
body.layout-mobile .nav-dd-mobile-section .nav-dd-item {
  padding-left: 1.35rem;
}
body.layout-mobile .item-row { min-height: 44px; padding: 0.6rem 0.75rem; }
body.layout-mobile .equipment-tools-grid {
  grid-template-columns: 1fr;
}
body.layout-mobile .equipment-slots .equipment-slot {
  flex-wrap: wrap;
}
body.layout-mobile .combat-layout {
  flex-direction: column;
}
body.layout-mobile .consumable-slots .slot-select,
body.layout-mobile select.slot-select {
  min-height: 44px;
  padding: 0.5rem 0.65rem;
}
body.layout-mobile .rw-hero-banner {
  height: 150px;
}
body.layout-mobile .detail-two-col {
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
body.layout-mobile .detail-col-left,
body.layout-mobile .detail-col-right {
  width: 100%;
  min-width: 0;
}
body.layout-mobile .detail-content .action-log-panel {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
}
body.layout-mobile .detail-content .action-log-filter {
  min-height: 44px;
  align-items: center;
  padding: 0.25rem 0;
}
body.layout-mobile .detail-content .action-log-list {
  max-height: 140px;
  -webkit-overflow-scrolling: touch;
}
body.layout-mobile .detail-content .action-log-line {
  padding: 0.35rem 0;
  min-height: 2.5em;
}
body.layout-mobile .rw-requires-grid {
  grid-template-columns: 1fr;
}
body.layout-mobile .rw-loot-grid {
  grid-template-columns: 1fr;
}
body.layout-mobile .rw-main {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
body.layout-mobile .center-panel,
body.layout-mobile .inv-shop-layout,
body.layout-mobile .detail-content { overflow-x: hidden; }
body.layout-mobile .detail-content-inner { max-width: 100%; }

/* JS adds data-label to loot table cells for mobile card layout */

/* In-game chat */
.rw-chat {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 24px));
  z-index: 850;
  border: 1px solid rgba(201, 160, 35, 0.55);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18, 23, 38, 0.96), rgba(10, 14, 25, 0.96));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}
.rw-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.rw-chat-title {
  color: #d4af37;
  letter-spacing: 0.03em;
  font-size: 0.92rem;
}
.rw-chat-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.rw-chat-status {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.rw-chat-body {
  padding: 0.5rem;
}
.rw-chat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.rw-chat-tab {
  border: 1px solid var(--border);
  background: rgba(22, 28, 45, 0.9);
  color: var(--text);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.rw-chat-tab.active {
  border-color: #d4af37;
  color: #f5e8a8;
}
.rw-chat-unread {
  display: inline-block;
  min-width: 1.2rem;
  text-align: center;
  font-style: normal;
  border-radius: 10px;
  background: #8a1d1d;
  color: #fff;
  font-size: 0.72rem;
  padding: 0.02rem 0.25rem;
}
.rw-chat-messages {
  height: 170px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 10, 18, 0.8);
  font-size: 0.86rem;
}
.rw-chat-line { margin-bottom: 0.3rem; line-height: 1.35; }
.rw-chat-time { color: var(--text-dim); }
.rw-chat-user { color: #f0d77a; font-weight: 600; }
.rw-chat-title-badge {
  color: #9bd1ff;
  font-weight: 700;
  margin-right: 0.2rem;
}
.rw-chat-line.is-admin .rw-chat-user,
.rw-chat-line.is-admin .rw-chat-text { color: #8ed1ff; }
.rw-chat-line.is-emote .rw-chat-text { color: #c6e2a5; font-style: italic; }
.rw-chat-line.is-whisper .rw-chat-user,
.rw-chat-line.is-whisper .rw-chat-text { color: #e6b3ff; }
.rw-chat-inline-delete {
  margin-left: 0.4rem;
  border: 1px solid #7a2e2e;
  background: rgba(120, 20, 20, 0.45);
  color: #f2c5c5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
}
.rw-chat-footer { margin-top: 0.45rem; }
.rw-chat-input-row {
  display: flex;
  gap: 0.45rem;
}
.rw-chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  background: rgba(13, 18, 31, 0.95);
  color: var(--text);
}
.rw-chat-btn {
  border: 1px solid var(--border);
  background: rgba(22, 28, 45, 0.95);
  color: var(--text);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.rw-chat-send {
  border-color: rgba(201, 160, 35, 0.6);
  color: #f4e8b2;
}
.rw-chat-load {
  margin-bottom: 0.4rem;
}
.rw-chat-meta {
  font-size: 0.72rem;
  color: var(--text-dim, #8a93a8);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.rw-chat-settings-btn {
  padding: 0.25rem 0.45rem;
  margin-right: 0.25rem;
}
.rw-chat-settings-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.45rem;
  background: rgba(12, 16, 28, 0.92);
  font-size: 0.8rem;
}
.rw-chat-settings-hint {
  margin: 0 0 0.5rem;
  color: var(--text-dim, #9aa3b5);
  line-height: 1.35;
}
.rw-chat-settings-hint code {
  font-size: 0.72rem;
  word-break: break-all;
}
.rw-chat-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 520px) {
  .rw-chat-settings-grid {
    grid-template-columns: 1fr;
  }
}
.rw-chat-set-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-dim, #9aa3b5);
}
.rw-chat-set-input {
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(22, 28, 45, 0.95);
  color: var(--text);
}
.rw-chat-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* -------------------------------------------------------------------------
   Forum (in-game)
   ------------------------------------------------------------------------- */
.forum-shell { min-height: 62vh; }
.forum-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.forum-topbar-title { font-weight: 700; color: var(--accent-soft); }
.forum-search-input { min-width: 220px; }
.forum-layout {
  display: grid;
  grid-template-columns: 280px 1fr 1.2fr;
  gap: 0.75rem;
}
.forum-col {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.forum-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--accent-soft);
}
.forum-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: auto;
}
.forum-cat-btn,
.forum-topic-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}
.forum-cat-btn.active,
.forum-topic-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(122, 162, 247, 0.25) inset;
}
.forum-cat-name, .forum-topic-title { display: block; font-weight: 600; }
.forum-cat-meta, .forum-topic-meta { display: block; font-size: 0.82em; margin-top: 0.2rem; }
.forum-unread-pill {
  float: right;
  background: rgba(122, 162, 247, 0.18);
  border: 1px solid rgba(122, 162, 247, 0.35);
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.8em;
}
.forum-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.forum-thread-header h3 { margin: 0; }
.forum-admin-controls { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.forum-topic-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: start;
  padding: 0.35rem;
}
.forum-topic-actions {
  display: flex;
  align-items: center;
}
.forum-topic-row.active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(122,162,247,.25) inset; }
.forum-badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78em;
}
.forum-admin-menu-wrap { position: relative; }
.forum-admin-menu {
  position: absolute;
  right: 0;
  top: auto;
  bottom: calc(100% + 0.2rem);
  min-width: 130px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0c1220;
  z-index: 4000;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  opacity: 1;
}
.forum-admin-menu-floating {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: auto !important;
  right: auto !important;
  z-index: 9000 !important;
  background: #0c1220 !important;
  border-color: rgba(255, 224, 160, 0.35);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: translateZ(0);
  pointer-events: auto;
}
.forum-admin-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: var(--text);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}
.forum-admin-menu button:last-child { border-bottom: 0; }
.forum-admin-menu button:hover { background: rgba(255,255,255,0.06); }
.forum-admin-menu button.danger { color: #ff9a9a; }
.forum-topic-row,
.forum-post,
.forum-post-admin,
.forum-admin-menu-wrap {
  position: relative;
  z-index: 1;
}
.forum-thread-posts {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
}
.forum-post {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  margin-bottom: 0.45rem;
  background: rgba(0, 0, 0, 0.2);
}
.forum-post-body {
  white-space: pre-wrap;
  margin-top: 0.35rem;
  line-height: 1.35;
}
.forum-post-admin {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.3rem;
}
.forum-form {
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.forum-input, .forum-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 0.4rem 0.5rem;
  font: inherit;
}
.forum-status-error { color: #ff8f8f; }
.forum-empty { padding: 0.5rem 0.2rem; }
.forum-reports-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  padding: 0.55rem;
  margin-bottom: 0.55rem;
}
.forum-rich-help { font-size: 0.85em; }
.forum-poll-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}
.forum-poll-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.forum-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.forum-attachment img {
  max-width: 180px;
  max-height: 120px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: block;
}
.forum-reports-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.forum-reports-list {
  display: grid;
  gap: 0.35rem;
}
.forum-report-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.4rem 0.45rem;
}
.forum-report-actions { margin-top: 0.3rem; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.forum-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.forum-modal.hidden { display: none; }
.forum-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}
.forum-modal-card {
  position: relative;
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 22, 34, 0.98), rgba(12, 16, 26, 0.98));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}
.forum-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.forum-modal-header h3 {
  margin: 0;
  font-size: 1.02rem;
}
.forum-modal-body {
  padding: 0.75rem;
  overflow: auto;
}
.forum-modal-grid {
  display: grid;
  gap: 0.55rem;
}
.forum-modal-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}
@media (max-width: 1100px) {
  .forum-layout { grid-template-columns: 1fr; }
  .forum-col { min-height: 260px; }
  .forum-topbar { grid-template-columns: 1fr; }
}
