:root {
  --paper: rgba(255, 252, 245, 0.93);
  --line: #cbbfa8;
  --ink: #2f261d;
  --muted: #6f6252;
  --accent: #b4531e;
  --accent-strong: #8b3f14;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Iowan Old Style", Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 240, 204, 0.85), transparent 30%),
    linear-gradient(130deg, #e8decd 0%, #f6f2ea 55%, #e4ecdf 100%);
}

/* ── Shared panel ───────────────────────────────────── */
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 14px 28px rgba(48, 31, 15, 0.12);
  padding: 16px;
}

h1, h2 { margin: 0 0 10px; }

label {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

input, button { font: inherit; }

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.88);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  color: #fff8ef;
  background: var(--accent);
  cursor: pointer;
}
button:hover { background: var(--accent-strong); }

.hint { color: var(--muted); margin: 8px 0 0; font-size: 0.84rem; }
.status { color: var(--muted); margin: 0; font-size: 0.88rem; min-height: 1.2em; }

/* ── Auth screen ────────────────────────────────────── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}
.auth-screen.hidden { display: none; }

.auth-card {
  width: min(520px, 100%);
  padding: 26px 28px 20px;
}

#auth-screen .hidden { display: none !important; }

.auth-hero { text-align: center; margin-bottom: 18px; }
.auth-hero h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.02em;
}
.auth-tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.92rem;
}

/* Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
}
.auth-tab {
  border-radius: 999px;
  padding: 8px 0;
  background: transparent;
  color: var(--muted);
}
.auth-tab:hover { background: rgba(180, 83, 30, 0.1); color: var(--ink); }
.auth-tab.active {
  background: var(--accent);
  color: #fff8ef;
}

.primary-button {
  width: 100%;
  padding: 11px 18px;
  font-weight: 700;
  margin-top: 4px;
}

.link-button {
  background: transparent;
  color: var(--accent);
  padding: 4px 8px;
  font-size: 0.85rem;
}
.link-button:hover { background: rgba(180, 83, 30, 0.1); }

.ghost-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.ghost-button:hover { background: rgba(47, 38, 29, 0.06); color: var(--ink); }

.danger-button { background: #a83232; }
.danger-button:hover { background: #7f2222; }

.auth-advanced {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}
.auth-advanced summary { cursor: pointer; user-select: none; }
.auth-advanced label { margin-top: 8px; }

.auth-subheader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.auth-subheader h2 { margin: 0; font-size: 1.15rem; }

/* Character selection */
.character-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.character-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 11px 12px;
  min-height: 66px;
}
.character-card.selectable { cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.character-card.selectable:hover {
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(180, 83, 30, 0.18);
}

.character-portrait {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff8ef;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.18);
}
.character-portrait.male { background: linear-gradient(140deg, #4870d0, #2c4d9e); }
.character-portrait.female { background: linear-gradient(140deg, #c05787, #933860); }

.character-info { flex: 1; min-width: 0; }
.character-name {
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.character-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.enter-button {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.84rem;
}

.character-delete {
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px 9px;
  font-size: 1.05rem;
  line-height: 1.4;
}
.character-delete:hover { background: rgba(168, 50, 50, 0.12); color: #a83232; }

.character-card.confirming {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  border-color: #a83232;
  background: rgba(168, 50, 50, 0.06);
}
.character-delete-label { font-size: 0.9rem; font-weight: 700; }
.character-delete-row { display: flex; gap: 8px; justify-content: flex-end; }
.character-delete-row button { padding: 6px 14px; font-size: 0.82rem; }

.character-card-new {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  cursor: pointer;
  padding: 12px;
  font: inherit;
}
.character-card-new:hover { background: rgba(180, 83, 30, 0.07); color: var(--ink); }
.character-new-plus { font-size: 1.3rem; line-height: 1; color: var(--accent); }
.character-slots { font-size: 0.72rem; }

/* Character creation */
.char-create-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 560px) {
  .char-create-layout { grid-template-columns: 1fr; }
}

.char-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 240, 204, 0.9), transparent 65%),
    linear-gradient(180deg, #eef3ea 0%, #dfe8f2 100%);
}
.char-preview canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.model-picker-label {
  font-size: 0.95rem;
  margin-bottom: 5px;
}
.model-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.model-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 0;
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
}
.model-option:hover { background: rgba(180, 83, 30, 0.08); color: var(--ink); }
.model-option.active {
  border-color: var(--accent);
  background: rgba(180, 83, 30, 0.12);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(180, 83, 30, 0.35);
}

/* ── Game screen ────────────────────────────────────── */
.game-screen {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 14px;
  padding: 14px;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.game-screen.hidden { display: none; }

@media (min-width: 1440px) {
  .game-screen { grid-template-columns: 340px minmax(0, 1fr) 340px; }
}
@media (min-width: 2560px) {
  .game-screen {
    grid-template-columns: 420px minmax(0, 1fr) 420px;
    gap: 20px;
    padding: 20px;
  }
}

/* ── Sidebars ───────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
}

.sidebar-right {
  gap: 10px;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

/* ── World panel ────────────────────────────────────── */
.world-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding: 14px;
}

.world-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.world {
  flex: 1;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(81, 68, 53, 0.22);
  background: #d4e5f4;
}

.world canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chat-compose {
  flex-shrink: 0;
}

.chat-compose.hidden {
  display: none;
}

.chat-compose input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
}

/* ── Hotbar ─────────────────────────────────────────── */
.hotbar {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  flex-shrink: 0;
}

.hotbar-slot {
  position: relative;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  cursor: pointer;
  user-select: none;
}

.hotbar-slot .key {
  position: absolute;
  top: 2px;
  left: 3px;
  right: 3px;
  max-width: calc(100% - 6px);
  padding: 1px 3px;
  border: none;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.06);
  font: inherit;
  font-size: 0.6rem;
  line-height: 1.2;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hotbar-slot .key:hover {
  background: rgba(180, 83, 30, 0.16);
  color: var(--ink);
}

.hotbar-slot.rebinding {
  border-color: #67c8ff;
  box-shadow: inset 0 0 0 1px rgba(103, 200, 255, 0.6);
}

.hotbar-slot .name {
  font-size: 0.74rem;
  line-height: 1.1;
}

.hotbar-slot.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(180, 83, 30, 0.4);
}

.hotbar-slot.aiming {
  border-color: #67c8ff;
  background: rgba(103, 200, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(103, 200, 255, 0.5), 0 0 8px rgba(103, 200, 255, 0.35);
}

.hotbar-slot .cooldown {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.56);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.88rem;
  border-radius: 10px;
}

/* ── Spellbook ──────────────────────────────────────── */
.spellbook {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.spellbook-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.spellbook-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spellbook-assign {
  flex: 0 0 auto;
  max-width: 46%;
  font-size: 0.74rem;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
}

.spellbook-empty {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 4px 2px;
}

/* ── Equipment & Inventory grids ────────────────────── */
.equipment-grid,
.inventory-grid {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}
.equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inventory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Fixed-height slots so layout never shifts */
.item-slot {
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  overflow: hidden;
  user-select: none;
  flex-shrink: 0;
}
.item-slot.empty { opacity: 0.72; }
.item-slot.filled { cursor: grab; }

.item-chip {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--item-color, var(--accent));
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6),
              0 0 10px color-mix(in srgb, var(--item-color, var(--accent)) 50%, transparent);
}

.item-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.22));
}

.item-name {
  font-size: 0.8rem;
  line-height: 1.15;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.item-stats {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-empty {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.item-resist-color {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.18rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.25);
  background: var(--resist-color, #ffffff);
  vertical-align: text-bottom;
}

/* ── Stats panel (right sidebar) ────────────────────── */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Merchant trade window ──────────────────────────── */
.trade-panel {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  min-height: 0;
  max-height: 55%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trade-panel.hidden { display: none; }

.trade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trade-header h3 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.trade-close {
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.4;
  flex-shrink: 0;
}
.trade-close:hover { background: rgba(47, 38, 29, 0.08); color: var(--ink); }

.trade-scroll {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.trade-section-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.trade-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trade-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 6px 8px;
}

.trade-row-info { flex: 1; min-width: 0; }

.trade-row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trade-row-name .item-icon { width: 18px; height: 18px; }

.trade-row-stats {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-button {
  padding: 5px 11px;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.trade-button:disabled {
  background: var(--muted);
  opacity: 0.55;
  cursor: not-allowed;
}

.trade-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Quest window ───────────────────────────────────── */
.quest-panel {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  min-height: 0;
  max-height: 55%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quest-panel.hidden { display: none; }

.quest-scroll {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.quest-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 5px;
}
.quest-card.ready { border-color: #c9a227; }

.quest-card-name {
  font-size: 0.86rem;
  font-weight: 600;
}

.quest-card-desc {
  font-size: 0.72rem;
  color: var(--muted);
}

.quest-objectives {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quest-objective {
  font-size: 0.74rem;
}
.quest-objective.done {
  color: #4a8f3c;
  text-decoration: line-through;
}

.quest-card-rewards {
  font-size: 0.72rem;
  color: var(--muted);
}

.quest-button {
  align-self: flex-end;
  margin-top: 2px;
}

.chat-history-panel {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-history-panel h3 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-history-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-history-empty {
  color: var(--muted);
  font-size: 0.75rem;
}

.chat-history-entry {
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--ink);
  word-break: break-word;
}

.chat-history-name {
  font-weight: 700;
  margin-right: 4px;
}

.chat-history-message {
  color: var(--ink);
}

.stats-empty {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.char-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.char-name {
  font-size: 1.05rem;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.char-level-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  margin-left: 8px;
}

.stat-bar-section { margin-bottom: 11px; }

.stat-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.hp-bar .stat-bar-fill  { background: linear-gradient(90deg, #d83030, #ff5858); }
.xp-bar .stat-bar-fill  { background: linear-gradient(90deg, #4870d0, #78a0ff); }

.stat-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 10px 0 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}

.stat-toggle-row {
  margin-top: 10px;
  padding: 8px 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}

.stat-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.stat-toggle-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 0.92rem;
  font-weight: 600;
}

.stat-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.stat-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  gap: 8px;
}

.stat-color-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.stat-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.stat-color-name {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stat-color-value {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Death overlay ──────────────────────────────────── */
.death-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 4, 4, 0.72);
  z-index: 1000;
  pointer-events: none;
}
.death-overlay.hidden { display: none; }

.death-overlay-text {
  color: #ffe0e0;
  font-size: 2.6rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.65);
  letter-spacing: 0.02em;
  padding: 0 24px;
}

/* ── Asset preload progress (js/ui/loading.js) ──────── */
.asset-progress { margin-top: 10px; }
.asset-progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.asset-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease-out;
}
.asset-progress-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── "New version available" banner (js/net/version.js) ── */
.update-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-size: 0.9rem;
}
.update-banner .primary-button {
  width: auto;
  margin-top: 0;
  padding: 6px 14px;
}
