/* ═══════════════════════════════════════════════════
   HOME TAB — start screen + in-app library. Left rail (create + open-a-share)
   · right = Recent strip + My Characters / My Maps library grids. The card
   look is ported from the My Library page (styles/features/characters.css
   `.char-card*`), scoped under `.tab-home` so nothing leaks. Uses shell tokens.
   ═══════════════════════════════════════════════════ */

.maker .tab-home .home-body { display: flex; height: 100%; min-height: 0; }

/* ── Left rail — create / open-a-share ── */
.maker .tab-home .home-rail {
  flex: 0 0 var(--rail-left);
  width: var(--rail-left);
  border-right: 1px solid var(--border);
  padding: var(--sp-6) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  overflow-y: auto;
  background: var(--tab-active);
}
.maker .tab-home .home-rail-title {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.maker .tab-home .home-create-btn {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; box-sizing: border-box;
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--chrome-hi);
  cursor: pointer; text-align: left; color: var(--text);
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.maker .tab-home .home-create-btn:hover { border-color: var(--accent); background: var(--accent-glow); transform: translateY(-1px); }
.maker .tab-home .home-create-ic { width: 38px; height: 42px; flex: 0 0 auto; display: flex; align-items: flex-end; justify-content: center; font-size: 22px; line-height: 1; }
.maker .tab-home .home-create-ic .home-create-img { max-width: 38px; max-height: 42px; object-fit: contain; image-rendering: pixelated; }
.maker .tab-home .home-create-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.maker .tab-home .home-create-tx strong { font-size: var(--fs-4); }
.maker .tab-home .home-create-tx small { font-size: var(--fs-2); color: var(--text-dim); }
/* New Scene card — the snoozing-snail island diorama: straight at rest,
   scales up + tips playfully on hover, pivoting from the island's base.
   (Derek rev: rotation 0 static, rotate+scale on hover.) */
.maker .tab-home .home-scene-img {
  max-width: 40px; max-height: 42px;
  image-rendering: pixelated;
  transform-origin: 50% 88%;
  transition: transform 0.16s ease;
}
.maker .tab-home .home-create-btn:hover .home-scene-img { transform: rotate(-6deg) scale(1.1); }
/* New Character card — same treatment, tipping the other way at the feet. */
.maker .tab-home #home-new-character .home-create-img {
  transform-origin: 50% 96%;
  transition: transform 0.16s ease;
}
.maker .tab-home #home-new-character:hover .home-create-img { transform: rotate(5deg) scale(1.08); }
/* Import File card — dual-logo composition (BS4 + MapleSim), slightly rotated
   + overlapping. The tilts straighten on hover for a little life. */
.maker .tab-home .home-import-ic { position: relative; }
.maker .tab-home .home-import-logo {
  position: absolute; width: 24px; height: 24px;
  object-fit: contain; border-radius: var(--r);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  background: #fff;
  transition: transform 0.15s ease;
}
.maker .tab-home .home-import-logo-bs  { left: 0;    bottom: 12px; transform: rotate(-9deg); z-index: 1; }
.maker .tab-home .home-import-logo-sim { left: 13px; bottom: 3px;  transform: rotate(7deg);  z-index: 2; }
/* Hover: straighten AND pop, matching the character/scene card icons
   (char = rotate(5deg) scale(1.08), scene = rotate(-6deg) scale(1.1)). */
.maker .tab-home .home-create-btn:hover .home-import-logo-bs  { transform: rotate(-4deg) scale(1.12); }
.maker .tab-home .home-create-btn:hover .home-import-logo-sim { transform: rotate(3deg) scale(1.12); }
/* Import modal — dropzone step → detected-file preview → fork options. */
.home-import-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1);
  width: 100%; box-sizing: border-box; padding: 34px 16px;
  border: 2px dashed var(--border); border-radius: var(--r);
  background: var(--chrome-lo); color: var(--text); cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.home-import-drop:hover, .home-import-drop.is-drag { border-color: var(--accent); background: var(--accent-glow); }
.home-import-drop strong { font-size: var(--fs-4); }
.home-import-drop small { font-size: var(--fs-2); color: var(--text-dim); }
.home-import-detect {
  display: flex; flex-direction: column; gap: 3px;
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5);
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--chrome-lo);
}
.home-import-detect strong { font-size: var(--fs-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-import-detect small { font-size: var(--fs-2); color: var(--text-dim); line-height: 1.4; }
.home-import-hint { margin: 0 0 var(--sp-5); font-size: var(--fs-3); color: var(--text-mid); line-height: 1.5; }
.home-import-opt {
  display: flex; flex-direction: column; gap: 3px;
  width: 100%; box-sizing: border-box; text-align: left;
  padding: var(--sp-5) var(--sp-6); margin-bottom: var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--chrome-hi); color: var(--text); cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.home-import-opt:hover { border-color: var(--accent); background: var(--accent-glow); }
.home-import-opt strong { font-size: var(--fs-4); }
.home-import-opt small { font-size: var(--fs-2); color: var(--text-dim); line-height: 1.4; }
.home-import-rows { display: flex; flex-direction: column; gap: var(--sp-2); max-height: 300px; overflow-y: auto; }
.home-import-row {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--r);
  background: var(--chrome-hi);
}
.home-import-row-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-3); font-weight: 600; }
.home-import-row-btn { flex: 0 0 auto; }
/* One import dialog (I3): two top-level checkboxes + per-character name rows. */
.home-import-check {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--r); background: var(--chrome-hi); cursor: pointer;
}
.home-import-check:hover { border-color: var(--accent); }
.home-import-check input { margin-top: 3px; flex: 0 0 auto; }
.home-import-check span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.home-import-check strong { font-size: var(--fs-4); }
.home-import-check small { font-size: var(--fs-2); color: var(--text-dim); line-height: 1.4; }
.home-import-char { cursor: pointer; padding: var(--sp-2) var(--sp-3); }
.home-import-char input[type="checkbox"] { flex: 0 0 auto; }
.home-import-name {
  flex: 1 1 auto; min-width: 0; padding: 5px 8px; font: inherit; font-size: var(--fs-3); font-weight: 600;
  border: 1px solid var(--border); border-radius: 6px; background: var(--input-bg, var(--chrome)); color: var(--text);
}
.home-import-name:focus { outline: none; border-color: var(--accent); }
.home-import-dup { flex: 0 0 auto; font-size: var(--fs-1, 10px); font-weight: 700; color: var(--amber); white-space: nowrap; }
.home-import-rows.is-off { opacity: 0.45; pointer-events: none; }
.home-import-actions { display: flex; gap: var(--sp-3); justify-content: flex-end; margin-top: var(--sp-5); }
.home-import-actions .btn { width: auto; }
.maker .tab-home .home-rail-sep { height: 1px; background: var(--border); margin: var(--sp-1) 0; }
.maker .tab-home .home-auth-nudge { margin: 0; font-size: var(--fs-3); color: var(--text-mid); line-height: 1.5; }

/* Open-a-share input */
.maker .tab-home .home-open-share { display: flex; gap: var(--sp-2); }
.maker .tab-home .home-open-input {
  flex: 1 1 auto; min-width: 0;
  padding: 5px var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--input-bg); font-size: var(--fs-3); color: var(--text);
}
.maker .tab-home .home-open-input:focus { outline: none; border-color: var(--accent); }
.maker .tab-home .home-open-btn { width: auto; padding: var(--sp-2) var(--sp-6); font-size: var(--fs-3); flex: 0 0 auto; }
.maker .tab-home .home-open-hint { margin: 0; font-size: var(--fs-2); color: var(--text-dim); line-height: 1.45; }

/* Open-a-share resolved preview + add-to-library */
.maker .tab-home .home-open-preview {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--chrome-hi);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.maker .tab-home .home-open-preview[hidden] { display: none; }
.maker .tab-home .hop-dismiss {
  position: absolute; top: 4px; right: 6px;
  appearance: none; border: none; background: transparent;
  font-size: 15px; line-height: 1; color: var(--text-dim); cursor: pointer; padding: 2px;
}
.maker .tab-home .hop-dismiss:hover { color: var(--text); }
.maker .tab-home .hop-head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding-right: var(--sp-3); }
.maker .tab-home .hop-thumb {
  flex: 0 0 auto; width: 52px; height: 52px;
  border: 1px solid var(--border-lo); border-radius: var(--r);
  background: var(--chrome-lo); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.maker .tab-home .hop-thumb--map { width: 72px; height: 46px; }   /* maps are landscape */
.maker .tab-home .hop-thumb-img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.maker .tab-home .hop-thumb-ph { font-size: 22px; line-height: 1; }
.maker .tab-home .hop-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.maker .tab-home .hop-name { font-size: var(--fs-4); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maker .tab-home .hop-kind { font-size: var(--fs-2); color: var(--text-dim); }
.maker .tab-home .hop-add { width: 100%; }
.maker .tab-home .hop-add.is-owned {
  background: var(--chrome-lo); color: var(--text-mid);
  border: 1px solid var(--border); cursor: default;
}

/* ── Right — sections ── */
.maker .tab-home .home-main {
  flex: 1 1 auto; min-width: 0; overflow-y: auto;
  padding: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-6);
}
.maker .tab-home .home-section-head { margin-bottom: var(--sp-3); }
.maker .tab-home .home-section-head h3 { margin: 0; font-size: var(--fs-4); font-weight: 700; color: var(--text); }
.maker .tab-home .home-empty { margin: 0; font-size: var(--fs-3); color: var(--text-dim); padding: var(--sp-2) 0; }

/* Recent = horizontal scroll strip; uniform compact cards (same as the grids) */
.maker .tab-home .home-strip { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); scrollbar-width: thin; }
.maker .tab-home .home-strip .char-card { flex: 0 0 128px; }

/* My Characters / My Maps = wrapping grids — UNIFORM, compact card size for both */
.maker .tab-home .home-grid { display: grid; gap: var(--sp-2); align-content: start; }
.maker .tab-home .home-grid-character,
.maker .tab-home .home-grid-map,
.maker .tab-home .home-grid-scene { grid-template-columns: repeat(auto-fill, 128px); }
/* Fixed column width (not minmax..1fr) so grid cards match the Recent strip
   exactly instead of stretching when a row is sparse (Derek 2026-07-26). */

/* ── Card — MAKER skin: a padded chrome-hi card with a rounded chrome-lo thumb
   inside + lift-on-hover (like the Map Maker / roster cells), NOT the flush-image
   bordered-toolbar library-page look. Uses the shell tokens throughout. ── */
.maker .tab-home .char-card {
  background: var(--chrome-hi);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--sp-2);
  display: flex; flex-direction: column; gap: var(--sp-1);
  cursor: pointer;
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.maker .tab-home .char-card:hover { border-color: var(--accent); box-shadow: 0 3px 12px rgba(0,0,0,0.10); transform: translateY(-2px); }
.maker .tab-home .char-card-image {
  aspect-ratio: 1 / 1;   /* UNIFORM square thumb for both kinds (compact) */
  border-radius: var(--r);
  background: var(--chrome-lo);
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden;   /* char foot-anchored (like the char library) */
}
/* Characters render at 1× (natural size), foot-anchored but nudged UP off the
   bottom edge so a short sprite reads more centered in the square. */
.maker .tab-home .char-card-preview { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center bottom; image-rendering: pixelated; }
.maker .tab-home .char-card:not(.is-map-card):not(.is-scene-card) .char-card-preview { margin-bottom: 15%; }
.maker .tab-home .char-card-preview-placeholder { font-size: 1.7rem; opacity: 0.3; margin: auto; }
/* Maps + Scenes — same-size thumb, cover-CROPPED so the card is always
   filled (a 16:9 scene zooms/crops instead of letterboxing). */
.maker .tab-home .char-card.is-map-card .char-card-image { background: var(--dark-bg, #0b0e13); align-items: center; }
.maker .tab-home .char-card.is-scene-card .char-card-image { align-items: center; }
.maker .tab-home .char-card.is-map-card .char-card-preview,
.maker .tab-home .char-card.is-scene-card .char-card-preview { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.maker .tab-home .char-card-footer { display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 0; }
.maker .tab-home .char-card-name { font-size: var(--fs-3); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maker .tab-home .char-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin-top: 2px; }

/* Type badge + share-code chip */
.maker .tab-home .card-type-badge {
  font-size: var(--fs-1); font-weight: 700; padding: 1px var(--sp-2); border-radius: var(--r);
  background: var(--chrome-lo); border: 1px solid var(--border); line-height: 1.5; white-space: nowrap;
}
.maker .tab-home .card-type-badge.type-char { color: var(--accent-text); }
.maker .tab-home .card-type-badge.type-map { color: #5a6acc; border-color: #c4caf0; background: rgba(90,106,204,0.08); }
.maker .tab-home .card-type-badge.type-scene { color: #b8791f; border-color: #ecd3a6; background: rgba(184,121,31,0.09); }
.maker .tab-home .home-card-code {
  font: inherit; font-size: var(--fs-1); font-weight: 600; letter-spacing: 0.02em;
  padding: 1px var(--sp-2); border-radius: var(--r); cursor: pointer;
  border: 1px solid var(--border); background: var(--chrome-lo); color: var(--text-mid);
  white-space: nowrap;
}
.maker .tab-home .home-card-code:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-glow); }

/* Action row — compact maker buttons (no hard dividers) */
.maker .tab-home .char-card-actions {
  display: flex; gap: 2px; margin-top: var(--sp-1);
  border-top: 1px solid var(--border); padding-top: var(--sp-1);
}
.maker .tab-home .char-action-btn {
  flex: 1; padding: var(--sp-1) 0; font-size: var(--fs-4); line-height: 1;
  border: none; border-radius: var(--r);
  background: transparent; color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.maker .tab-home .char-action-btn:hover { background: var(--chrome-lo); color: var(--text); }
.maker .tab-home .char-action-btn.is-fav-active { color: #f0c040; }
.maker .tab-home .btn-home-del:hover { color: var(--red); }
.maker .tab-home .btn-home-del.is-confirm { color: #fff; background: var(--red); font-size: var(--fs-2); font-weight: 700; }

/* "+ New" leading tile (a .char-card) */
.maker .tab-home .home-card-new {
  align-items: center; justify-content: center; gap: var(--sp-2);
  border-style: dashed; border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent-text); background: var(--accent-glow);
}
.maker .tab-home .home-strip .home-card-new { flex-basis: 150px; }
.maker .tab-home .home-card-new:hover { background: color-mix(in srgb, var(--accent) 16%, var(--chrome-hi)); box-shadow: none; }
.maker .tab-home .home-card-new .home-card-plus { font-size: 30px; line-height: 1; }
.maker .tab-home .home-card-new .char-card-name { text-align: center; font-weight: 600; }

/* Drag-to-reorder */
.maker .tab-home .char-card[draggable="true"] { cursor: grab; }
.maker .tab-home .char-card[draggable="true"]:active { cursor: grabbing; }
.maker .tab-home .char-card.drag-source { opacity: 0.35; }

/* ═══ Library batch — folders · bulk-select · saved (signed-in only) ═══
   Ported from styles/features/characters.css (.lib-*, select-mode, saved),
   scoped under .tab-home. */

.maker .tab-home .home-lib-toolbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.maker .tab-home .home-lib-toolbar[hidden] { display: none; }

/* Folder chips */
.maker .tab-home .lib-folders { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; flex: 1 1 auto; }
.maker .tab-home .lib-folder-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  border: 1px solid var(--border); border-radius: 999px; padding: var(--sp-1) var(--sp-4);
  background: var(--chrome-hi); font-size: var(--fs-3); color: var(--text-mid); cursor: pointer;
}
.maker .tab-home .lib-folder-chip:hover { border-color: var(--accent); }
.maker .tab-home .lib-folder-chip.is-active { border-color: var(--accent); background: rgba(74,158,192,0.12); color: var(--text); font-weight: 600; }
.maker .tab-home .lib-folder-del { font-size: 13px; opacity: 0.45; }
.maker .tab-home .lib-folder-del:hover { opacity: 1; color: var(--red); }
.maker .tab-home .lib-folder-new { border: 1px dashed var(--border); border-radius: 999px; padding: var(--sp-1) var(--sp-4); background: transparent; font-size: var(--fs-3); color: var(--text-mid); cursor: pointer; }
.maker .tab-home .lib-folder-new:hover { border-color: var(--accent); color: var(--accent-text); }

/* Select toggle + bulk bar */
/* Base look = .btn.btn--sm (consolidation 2026-08-11); only the
   select-mode active tint stays local. */
.maker .tab-home .lib-select-toggle { flex: 0 0 auto; }
.maker .tab-home .lib-select-toggle.is-active { border-color: var(--accent); background: rgba(74,158,192,0.12); color: var(--text); }
.maker .tab-home .lib-bulkbar { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; padding: var(--sp-3) var(--sp-6); border: 1px solid var(--accent); border-radius: var(--r); background: rgba(74,158,192,0.08); }
.maker .tab-home .lib-bulkbar[hidden] { display: none; }
.maker .tab-home .lib-bulk-count { font-size: var(--fs-4); font-weight: 600; }
.maker .tab-home .lib-bulk-select { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--r); background: var(--input-bg); font-size: var(--fs-3); color: var(--text); }
/* .lib-bulk-btn base = .btn.btn--sm (consolidation 2026-08-11). */
.maker .tab-home .lib-bulk-del { color: var(--red); border-color: #e6b8b0; }
.maker .tab-home .lib-bulk-del:hover { background: rgba(192,57,43,0.08); }

/* Select-mode checkbox overlay (owned grids only) */
.maker .tab-home .home-main.select-mode #home-characters .char-card:not(.home-card-new),
.maker .tab-home .home-main.select-mode #home-tilemaps .char-card:not(.home-card-new) { position: relative; cursor: pointer; }
.maker .tab-home .home-main.select-mode #home-characters .char-card:not(.home-card-new)::after,
.maker .tab-home .home-main.select-mode #home-tilemaps .char-card:not(.home-card-new)::after {
  content: ''; position: absolute; top: 8px; left: 8px; width: 18px; height: 18px;
  border: 2px solid #9aa; border-radius: var(--r); background: rgba(255,255,255,0.9); z-index: 3;
}
.maker .tab-home .home-main.select-mode .char-card.is-selected::after { border-color: var(--accent); background: var(--accent); }
.maker .tab-home .home-main.select-mode .char-card.is-selected { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Saved (view-only) cards */
.maker .tab-home .char-card.is-saved-card { border-style: dashed; cursor: default; }
.maker .tab-home .char-card.is-saved-card .char-card-image { opacity: 0.94; position: relative; }
.maker .tab-home .saved-badge {
  position: absolute; top: 6px; left: 6px; font-size: var(--fs-1); font-weight: 700;
  padding: 2px var(--sp-2); border-radius: var(--r); color: #fff; background: rgba(40,44,64,0.78);
  border: 1px solid rgba(255,255,255,0.18);
}
.maker .tab-home .card-origin-badge {
  font-size: var(--fs-1); font-weight: 600; padding: 1px var(--sp-2); border-radius: var(--r);
  background: var(--chrome-lo); color: var(--text-mid); border: 1px solid var(--border);
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Empty-state cards (UX-polish P6) — replace the ragged narrow text
   columns with a compact card + a real create CTA. ── */
.maker .tab-home .home-empty-card {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: 26px 20px;
  border: 1px dashed var(--border-lo);
  border-radius: var(--r);
  background: var(--chrome);
}
.maker .tab-home .home-empty-title { font-size: var(--fs-4, 12px); font-weight: 600; color: var(--text-mid); }
.maker .tab-home .home-empty-cta { flex: 0 0 auto; width: auto; align-self: center; }

/* ── Card redesign (Derek 2026-07-26, rev 2): thumbnail · name · code ·
   actions. Kind reads from a SUBTLE GRADIENT WASH (edges retired):
   characters = teal-tinted corner, scenes = maple-amber corner. Refs are
   marked by the bookmark chip alone. */
.maker .tab-home .char-card:not(.is-map-card) {
  background: linear-gradient(155deg, var(--chrome-hi) 55%, color-mix(in srgb, var(--accent) 13%, var(--chrome-hi)));
}
.maker .tab-home .char-card.is-scene-card {
  background: linear-gradient(155deg, var(--chrome-hi) 55%, color-mix(in srgb, #e8963e 15%, var(--chrome-hi)));
}
/* Default (primary) character — chip badge in the bookmark's style (top-LEFT
   so a copied-origin bookmark can coexist top-right) + action-row toggle. */
.maker .tab-home .primary-badge {
  position: absolute; top: 4px; left: 4px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--chrome-hi) 82%, transparent);
  color: var(--accent-btn);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  pointer-events: auto;
}
.maker .tab-home .btn-home-primary.is-primary-active { color: var(--accent-btn); }

/* ── Default-character onboarding wizard (Derek 2026-07-27) ── */
.pw-modal { position: fixed; inset: 0; z-index: 10015; display: flex; align-items: center; justify-content: center; }
.pw-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.pw-dialog {
  position: relative; width: min(560px, calc(100vw - 40px)); max-height: min(620px, calc(100vh - 60px));
  overflow: auto; background: var(--chrome-hi); border: 1px solid var(--border-lo);
  border-radius: var(--r); box-shadow: 0 12px 40px rgba(20,24,40,0.28); padding: 16px 18px 18px;
}
.pw-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.pw-header h2 { font-size: 16px; font-weight: 800; margin: 0; }
.pw-close { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--text-dim); padding: 2px var(--sp-2); }
.pw-close:hover { color: var(--text); }
.pw-copy { font-size: 13px; color: var(--text-mid); line-height: 1.6; }
.pw-done-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.pw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-4); margin-top: var(--sp-4); }
.pw-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2); background: var(--chrome); border: 1px solid var(--border);
  border-radius: var(--r); cursor: pointer; font: inherit;
  transition: border-color 0.12s, transform 0.12s;
}
.pw-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.pw-card img { height: 64px; width: auto; image-rendering: pixelated; }
.pw-card-ph { height: 64px; display: flex; align-items: center; color: var(--text-dim); font-size: 24px; }
.pw-card-name { font-size: var(--fs-3); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-empty { text-align: center; padding: 18px 0 var(--sp-2); }
.pw-empty .btn { width: auto; margin: var(--sp-4) auto 0; }
.pw-preview { display: flex; align-items: center; justify-content: center; min-height: 130px; margin: var(--sp-3) 0; }
.pw-loading { color: var(--text-dim); font-size: var(--fs-4); }
.pw-actions { display: flex; gap: var(--sp-3); justify-content: flex-end; margin-top: var(--sp-4); }
.pw-actions .btn { width: auto; padding: var(--sp-3) 16px; }
/* Profile icon editor (SF2_PFP) styles are SELF-INJECTED by
   js/features/pfp-editor.js so the module mounts on any page. */

.maker .tab-home .ref-bookmark {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--chrome-hi) 82%, transparent);
  color: var(--accent-btn);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  pointer-events: auto;   /* keep the title tooltip hoverable */
}
.maker .tab-home .char-card-image { position: relative; }
