/* ============================================================
   DESIGN SYSTEM — Dark Fantasy / Nordic / Arcane
   Inspirations: D&D Beyond, Baldur's Gate 3, Diablo, MTG
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* --- 1. PALETTE --- */
  /* Backgrounds */
  --bg:             #080b11;
  --bg-panel:       rgba(14,18,26,0.82);
  --bg-hover:       rgba(28,34,48,0.5);
  --bg-elevated:    rgba(32,40,58,0.65);
  --bg-inset:       rgba(0,0,0,0.3);

  /* Arcane violet */
  --arcane:         #8b7fd4;
  --arcane-bright:  #a99ae8;
  --arcane-dim:     #5c5290;
  --arcane-soft:    rgba(139,127,212,0.10);

  /* Ancient gold */
  --gold:           #c9a84c;
  --gold-bright:    #e2c56a;
  --gold-dim:       #8a7235;
  --gold-soft:      rgba(201,168,76,0.10);

  /* Semantic */
  --success:        #3d9960;
  --danger:         #c94040;
  --ice:            #5ba4c9;

  /* Text */
  --text:           #a8a4b0;
  --text-dim:       #56525e;
  --text-bright:    #e8e5ee;
  --text-title:     #d4cfe0;

  /* Borders: barely visible on dark, ornamental on focus */
  --border:         rgba(255,255,255,0.05);
  --border-subtle:  rgba(255,255,255,0.03);
  --border-accent:  rgba(139,127,212,0.2);
  --border-gold:    rgba(201,168,76,0.25);

  /* --- 2. TYPOGRAPHY --- */
  --font-ui:        'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-title:     'Cinzel', 'Georgia', serif;
  --font-display:   'Cinzel Decorative', 'Cinzel', serif;

  /* --- 3. RADII --- */
  --radius-sm:      4px;
  --radius:         8px;
  --radius-lg:      12px;
  --radius-pill:    99px;

  /* --- TYPOGRAPHY SCALE (8 sizes only) --- */
  --fs-xs:    0.6rem;    /* 8.4px — micro labels */
  --fs-sm:    0.72rem;   /* 10px — secondary text, notes */
  --fs-base:  0.85rem;   /* 12px — body text, list items */
  --fs-md:    0.95rem;   /* 13px — spell names, weapon names */
  --fs-lg:    1.1rem;    /* 15px — stat values, counters */
  --fs-xl:    1.4rem;    /* 20px — HP, big stat numbers */
  --fs-2xl:   1.8rem;    /* 25px — hero stat (CA/Init) */
  --fs-hero:  2.5rem;    /* 35px — HP current */

  /* --- 4. SHADOWS & LIGHTS --- */
  --shadow-sm:      0 1px 4px rgba(0,0,0,0.5);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-inset:   inset 0 1px 4px rgba(0,0,0,0.4);
  --glow-arcane:    0 0 12px rgba(139,127,212,0.2), 0 0 4px rgba(139,127,212,0.1);
  --glow-gold:      0 0 12px rgba(201,168,76,0.15), 0 0 4px rgba(201,168,76,0.1);
  --glow-danger:    0 0 10px rgba(201,64,64,0.2);

  /* --- 5. SPACING --- */
  --sp-xs: 0.25rem;   /* 4px */
  --sp-sm: 0.5rem;    /* 8px */
  --sp-md: 0.75rem;   /* 12px */
  --sp-lg: 1rem;      /* 16px */
  --sp-xl: 1.5rem;    /* 24px */
  --sp-2xl: 2rem;     /* 32px */

  /* Legacy aliases (for existing code compat) */
  --accent: var(--gold);
  --accent-soft: var(--gold-soft);
  --accent2: var(--arcane);
  --accent2-soft: var(--arcane-soft);
}

/* --- BODY --- */
body {
  font-family: var(--font-ui);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 10% 90%, rgba(139,127,212,0.05) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 10%, rgba(40,70,120,0.04) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(201,168,76,0.015) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 60px;
  font-size: 14px;
}

/* Utilities and materials moved to components.css */


/* Component library moved to components.css — see that file.
/* === PORTRAIT (used by sheet + combat) ===
   Panneaux de contenu avec effet verre + bordure métal ancien.
   Variantes: default, elevated, arcane, gold
*/
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-md) var(--sp-lg);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.card:hover {
  border-color: rgba(255,255,255,0.08);
  box-shadow: var(--shadow-md);
}
/* Elevated — more prominent */
.card-elevated {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}
/* Arcane — violet accent border */
.card-arcane {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm), var(--glow-arcane);
}
.card-arcane:hover {
  border-color: rgba(139,127,212,0.35);
  box-shadow: var(--shadow-md), 0 0 20px rgba(139,127,212,0.15);
}
/* Gold — for important sections */
.card-gold {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-sm), var(--glow-gold);
}
.card-gold:hover {
  border-color: rgba(201,168,76,0.4);
  box-shadow: var(--shadow-md), 0 0 20px rgba(201,168,76,0.1);
}
/* Card ornate — glassmorphism (frame images removed) */
.card-ornate {
  background: rgba(10,12,18,0.85);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1.4rem 1.2rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
/* Card title */
.card-title {
  font-family: var(--font-title);
  font-size: 0.72rem; font-weight: 600; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding-left: 0.5rem; margin-bottom: var(--sp-sm);
  border-left: 2px solid var(--gold-dim);
  text-shadow: 0 0 10px rgba(201,168,76,0.15);
}


/* --- 1. GLOW MAGIQUE --- */

/* Panel-framed hover glow (frame images removed) */
.panel-framed:hover {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Ability block hover glow — handled in components.css */

/* Gold shimmer on proficiency box hover */
.proficiency-box::after {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(90deg, transparent 0%, rgba(201,168,76,0.04) 50%, transparent 100%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.proficiency-box { position: relative; }
.proficiency-box:hover::after { opacity: 1; }

/* Skill row glow on proficient hover */
.list-row.proficient:hover {
  background: rgba(201,168,76,0.04);
}
.list-row.expertise:hover {
  background: rgba(139,127,212,0.04);
}

/* Resource row glow when low */
.resource-current { transition: color 0.3s, text-shadow 0.3s; }


/* --- 2. BARRES ANIMÉES --- */

/* SP bar pulse when low */
@keyframes barPulseLow {
  0%, 100% { box-shadow: 0 0 8px rgba(201,64,64,0.2); }
  50% { box-shadow: 0 0 16px rgba(201,64,64,0.4); }
}
.sp-bar-wrap.sp-low .sp-bar {
  background: linear-gradient(90deg, #a03030, var(--danger), #e06050);
  animation: barPulseLow 2s ease-in-out infinite;
}

/* HP bar background color transition */
.hp-panel { transition: border-color 0.5s ease; }

/* HP current value color animation */
@keyframes hpFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.hp-current.flash {
  animation: hpFlash 0.3s ease;
}


/* --- 3. MICRO-INTERACTIONS --- */

/* Dice roll button wiggle */
@keyframes diceWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}
.clickable:hover {
  background: rgba(255,255,255,0.04);
}

/* Weapon attack/damage hover glow */
.weapon-attack:hover {
  background: var(--gold);
  color: var(--bg);
  box-shadow: 0 0 10px rgba(201,168,76,0.3);
}
.weapon-damage:hover {
  background: var(--arcane);
  color: #fff;
  box-shadow: 0 0 10px rgba(139,127,212,0.3);
}

/* Button press ripple */
.btn-spell::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(139,127,212,0.15) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none; border-radius: inherit;
}
.btn-spell:hover::before { opacity: 1; }
.btn-spell { position: relative; overflow: hidden; }

/* Badge pulse when condition active */
.combat-cond-chip.active {
  animation: badgePulse 2.5s ease-in-out infinite;
}

/* Notification slide in */
@keyframes notifSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.notification {
  animation: notifSlide 0.25s ease-out;
}

/* Sort row entrance on fold open */
.fold-body .list-row,
.fold-body .spell-row,
.fold-body .feature-item,
.fold-body .resource-row {
  animation: rowFadeIn 0.2s ease both;
}
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}
/* Stagger rows */
.fold-body > *:nth-child(1) { animation-delay: 0s; }
.fold-body > *:nth-child(2) { animation-delay: 0.02s; }
.fold-body > *:nth-child(3) { animation-delay: 0.04s; }
.fold-body > *:nth-child(4) { animation-delay: 0.06s; }
.fold-body > *:nth-child(5) { animation-delay: 0.08s; }
.fold-body > *:nth-child(6) { animation-delay: 0.1s; }
.fold-body > *:nth-child(n+7) { animation-delay: 0.12s; }


/* --- 4. CADRES AMÉLIORÉS --- */

/* Frame subtle inner glow */
.stat-block-framed::after {
  border-radius: 0;
}

/* card-ornate — frame removed, no pseudo-elements needed */

/* Gold border accent on section headers */
.spell-level-header {
  position: relative;
}
.spell-level-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,127,212,0.2), transparent);
}

/* Metamagic item border glow on hover */
.metamagic-item:hover {
  box-shadow: var(--shadow-sm), 0 0 8px rgba(139,127,212,0.1);
}

/* Feature item subtle highlight */
.feature-item[open] {
  background: rgba(139,127,212,0.03);
  border-radius: 6px;
}
.feature-item[open] summary {
  color: var(--text-bright);
}


/* --- 5. LISIBILITÉ --- */

/* Better text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--arcane);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

/* Spell name weight hierarchy */
.spell-name {
  font-weight: 500;
  color: var(--text-bright);
  transition: color 0.15s;
}
.spell-row:hover .spell-name,
.spell-item:hover .spell-name {
  color: #fff;
}

/* Prof dot color enhancement */
.prof-dot {
  transition: text-shadow 0.2s;
}
.proficient .prof-dot {
  text-shadow: 0 0 6px rgba(201,168,76,0.3);
}
.expertise .prof-dot {
  text-shadow: 0 0 6px rgba(139,127,212,0.4);
}

/* Bonus value subtle glow on hover */
.row-bonus:hover {
  text-shadow: 0 0 8px rgba(255,255,255,0.2);
}

/* Better input styling */
.inline-input {
  transition: border-color 0.2s, background 0.2s;
}
.inline-input:hover {
  border-bottom-color: rgba(255,255,255,0.15);
}
.inline-input:focus {
  background: rgba(139,127,212,0.05);
}

/* Text input focus glow */
.text-input:focus {
  border-color: var(--arcane-dim);
  box-shadow: 0 0 8px rgba(139,127,212,0.1);
}


/* --- 6. BANNER POLISH --- */

/* Avatar ring pulse */
@keyframes avatarRingPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
  50% { box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 12px rgba(139,127,212,0.15); }
}
.portrait-arcane {
  animation: avatarRingPulse 4s ease-in-out infinite;
}


/* --- 7. COMBAT FAB POLISH --- */
.combat-fab {
  transition: all 0.3s ease;
}
.combat-fab:hover {
  box-shadow: 0 4px 20px rgba(139,127,212,0.3), var(--glow-arcane);
}
@keyframes fabIdle {
  0%, 100% { box-shadow: var(--shadow-md); }
  50% { box-shadow: var(--shadow-md), 0 0 8px rgba(139,127,212,0.1); }
}
.combat-fab { animation: fabIdle 3s ease-in-out infinite; }
.combat-fab:hover { animation: none; }


/* --- 8. SCROLL POLISH --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(139,127,212,0.15);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139,127,212,0.3);
}

/* === END AAA POLISH === */

/* === HEADER === */
header {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  height: 44px;
  background: rgba(10, 14, 20, 0.7);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  gap: 0.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.header-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.header-nav + .header-right { margin-left: 0.5rem; }
.header-logo {
  display: flex; align-items: center; gap: 0.35rem;
  text-decoration: none; color: var(--text-bright);
  white-space: nowrap;
}
.logo-icon { font-size: 1rem; color: var(--gold); }
.logo-text { font-family: var(--font-title); font-size: 0.8rem; font-weight: 600; color: var(--text-title); letter-spacing: 0.04em; }
h1 { font-family: var(--font-title); font-size: 0.95rem; color: var(--text-title); font-weight: 600; line-height: 1.2; letter-spacing: 0.03em; }
.header-sub { font-size: 0.6rem; color: var(--text-dim); letter-spacing: 0.02em; white-space: nowrap; }
.header-char { display: flex; align-items: center; gap: 0.5rem; }
.save-indicator {
  font-size: 0.8rem; color: var(--success);
  opacity: 0; transition: opacity 0.3s;
}
.save-indicator.show { opacity: 1; }

/* === LOGIN PAGE === */
.page-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding-bottom: 0; }
.login-container { width: 100%; max-width: 360px; padding: 1rem; }
.login-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; text-align: center;
}
.login-title { font-size: 1.8rem; color: var(--accent); margin-bottom: 0.3rem; }
.login-sub { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 1.5rem; }
.login-input { width: 100%; font-size: 1.1rem; text-align: center; margin-bottom: 1rem; padding: 0.7rem; }
.login-btn { width: 100%; font-size: 1rem; padding: 0.7rem; }
.login-error { color: var(--danger); font-size: 0.85rem; margin-bottom: 0.8rem; padding: 0.4rem; background: rgba(200,60,60,0.1); border-radius: 4px; }
.login-switch { font-size: 0.8rem; color: var(--text-dim); margin-top: 1rem; }
.login-switch a { color: var(--arcane); text-decoration: none; }
.login-switch a:hover { text-decoration: underline; }

/* Player badge */
.player-badge {
  font-size: 0.65rem; padding: 0.15rem 0.6rem; border-radius: 99px;
  background: linear-gradient(135deg, var(--accent2), #6a5db8);
  color: #fff; font-weight: 600;
  box-shadow: 0 1px 4px rgba(139,127,212,0.3);
}
.player-menu { display: flex; align-items: center; gap: 0.2rem; }
.player-logout {
  font-size: 0.7rem; color: var(--text-dim); text-decoration: none;
  padding: 0.2rem; border-radius: 50%; transition: all 0.15s;
}
.player-logout:hover { color: var(--danger); background: var(--bg-hover); }
.player-chip {
  display: inline-block; padding: 0.3rem 0.8rem; margin: 0.2rem;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 99px; font-size: 0.85rem; color: var(--text);
}
.players-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.player-chip--mj { border-color: var(--gold-dim); color: var(--gold); background: var(--gold-soft); }
.player-chip--mj small { opacity: 0.7; }

/* Invite code box */
.invite-box {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.6rem 1rem; margin-bottom: 0.5rem;
  background: var(--arcane-soft); border: 1px solid var(--arcane-dim);
  border-radius: var(--radius); font-size: 0.85rem;
}
.invite-label { color: var(--text-dim); }
.invite-code {
  font-size: 1.1rem; font-weight: 700; color: var(--arcane-bright);
  letter-spacing: 0.15em; cursor: pointer; padding: 0.2rem 0.5rem;
  background: rgba(0,0,0,0.3); border-radius: 4px; transition: all 0.15s;
}
.invite-code:hover { background: rgba(139,127,212,0.2); }
.invite-code.copied { color: var(--success); }
.invite-hint { font-size: 0.7rem; color: var(--text-dim); }
.mj-hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.5rem; font-style: italic; }

/* Read-only badge */
.readonly-badge {
  font-size: 0.6rem; padding: 0.15rem 0.5rem; border-radius: 99px;
  background: rgba(200,60,60,0.15); border: 1px solid rgba(200,60,60,0.3);
  color: var(--danger); font-weight: 600; white-space: nowrap;
}

/* Read-only card style */
.char-card--readonly { opacity: 0.75; display: flex; flex-direction: column; }
.char-card--readonly:hover { opacity: 1; }
.char-card--unassigned { display: flex; flex-direction: column; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg-panel); }
.char-card-link { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem; text-decoration: none; color: inherit; }
.char-card--readonly .char-card-link,
.char-card--unassigned .char-card-link { flex: 1; }

/* Assign controls */
.char-card-assign {
  display: flex; gap: 0.3rem; padding: 0.3rem 0.5rem; align-items: center;
  border-top: 1px solid var(--border); background: rgba(0,0,0,0.15);
  border-radius: 0 0 var(--radius) var(--radius);
}
.assign-select {
  flex: 1; font-size: 0.75rem; padding: 0.25rem 0.4rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-bright); cursor: pointer;
}
.assign-select option {
  background: #1a1f2e; color: var(--text-bright);
}
.assign-btn {
  font-size: 0.7rem; padding: 0.25rem 0.5rem;
  background: var(--arcane-soft); border: 1px solid var(--arcane-dim);
  border-radius: 4px; color: var(--arcane-bright); cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.assign-btn:hover { background: rgba(139,127,212,0.25); }

/* Breadcrumb - unused, kept for compat */
.breadcrumb-back {
  display: block; font-size: 0.6rem; color: var(--text-dim);
  text-decoration: none; line-height: 1;
}
.breadcrumb-back:hover { color: var(--accent); }

/* Header nav - shown on desktop only */
.header-nav {
  display: none; align-items: center; gap: 0.15rem; margin-left: auto;
}
.nav-item {
  padding: 0.25rem 0.7rem; font-size: 0.78rem; color: var(--text-dim);
  text-decoration: none; border-radius: 6px; cursor: pointer;
  transition: all 0.2s ease; position: relative;
  font-weight: 500;
}
.nav-item:hover { color: var(--text-bright); background: rgba(255,255,255,0.05); }
.nav-item.active { color: var(--gold-bright); }
.nav-item.active::after {
  content: ''; position: absolute; bottom: -4px; left: 25%; right: 25%;
  height: 2px; background: var(--gold); border-radius: 2px;
  box-shadow: 0 0 6px rgba(201,168,76,0.3);
}

/* Desktop nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--bg-elevated); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); min-width: 180px;
  box-shadow: var(--shadow-lg); z-index: 160;
  overflow: hidden; padding-top: 0.3rem;
  backdrop-filter: blur(12px);
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-item {
  display: block; padding: 0.5rem 1rem; font-size: 0.85rem;
  color: var(--text); text-decoration: none; transition: background 0.1s;
}
.nav-dropdown-item:hover { background: var(--bg-hover); }
.nav-dropdown-action { color: var(--accent2); font-weight: 600; border-top: 1px solid var(--border); }

/* Char switcher in header */
.char-switcher {
  background: transparent; color: var(--text-title); border: none;
  padding: 0.1rem 0.2rem; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; max-width: 160px;
  font-family: var(--font-title); appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236e6a65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  padding-right: 1rem;
}
.char-switcher:focus { outline: none; }
.char-switcher option { background: var(--bg-panel); color: var(--text); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle { font-size: 1.1rem; padding: 0.3rem 0.5rem; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: 100%;
  background: var(--bg-elevated); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); min-width: 160px; z-index: 150;
  overflow: hidden; margin-top: 0.3rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: block; width: 100%; padding: 0.6rem 1rem;
  font-size: 0.85rem; color: var(--text); background: none;
  border: none; text-align: left; cursor: pointer; text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger); color: #fff; }

/* === TAGS === */
.header-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag {
  font-size: 0.65rem; padding: 0.2rem 0.55rem;
  border-radius: 99px; background: rgba(255,255,255,0.05); color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.04);
}
.tag.accent { background: var(--accent-soft); color: var(--accent); font-weight: 600; border: 1px solid rgba(226,176,74,0.2); }
.tag.accent2 { background: var(--accent2-soft); color: var(--accent2); border: 1px solid rgba(139,127,212,0.2); }

/* === BUTTONS === */
.btn {
  background: var(--bg-hover); color: var(--text);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.35rem 0.8rem; border-radius: 8px; cursor: pointer;
  font-size: 0.8rem; transition: all 0.15s ease; min-height: 30px;
  font-family: inherit;
}
.btn:hover { background: var(--bg-elevated); border-color: rgba(255,255,255,0.12); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; min-height: 34px; }
.btn-tiny { padding: 0.25rem 0.55rem; font-size: 0.88rem; min-height: 30px; min-width: 30px; }
.btn-round {
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; border: none;
  cursor: pointer; transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn-round:hover { transform: scale(1.08); box-shadow: var(--shadow-md); }
.btn-round:active { transform: scale(0.95); }
.btn-damage { background: linear-gradient(135deg, #d44040, #b83030); color: #fff; }
.btn-damage:hover { background: linear-gradient(135deg, #e04545, #c03535); }
.btn-heal { background: linear-gradient(135deg, #3d9960, #2d7a4a); color: #fff; }
.btn-heal:hover { background: linear-gradient(135deg, #45a868, #359055); }
.btn-cast {
  background: linear-gradient(135deg, rgba(139,127,212,0.2), rgba(139,127,212,0.1));
  color: var(--accent2); font-weight: 600;
  border: 1px solid rgba(139,127,212,0.25);
}
.btn-cast:hover {
  background: linear-gradient(135deg, rgba(139,127,212,0.35), rgba(139,127,212,0.2));
  box-shadow: 0 0 16px rgba(139,127,212,0.2), var(--shadow-sm);
  border-color: rgba(139,127,212,0.4);
}
.btn-cast:hover { background: var(--accent2); color: #fff; }
.btn-tag {
  padding: 0.15rem 0.6rem; font-size: 0.7rem; border-radius: 99px;
  background: var(--accent2); color: #fff; border: none;
}
.btn-rest { padding: 0.5rem 1.2rem; border-radius: var(--radius); }
.btn-long { background: var(--accent2); color: #fff; border-color: var(--accent2); }

.clickable { cursor: pointer; }
.clickable:hover { background: var(--bg-hover); }

/* === REST BAR === */
.rest-bar { display: flex; gap: 0.5rem; justify-content: center; }
.btn-rest { font-size: 0.85rem; padding: 0.45rem 1rem; }
.btn-long {
  background: linear-gradient(135deg, rgba(139,127,212,0.15), rgba(139,127,212,0.08));
  color: var(--accent2); border-color: rgba(139,127,212,0.25);
}
.btn-long:hover {
  background: linear-gradient(135deg, var(--accent2), #6a5db8);
  color: #fff;
  box-shadow: 0 0 12px rgba(139,127,212,0.3);
}

/* === MAIN LAYOUT === */
main {
  padding: 0.8rem;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tab-content { display: none; flex-direction: column; gap: 0.4rem; }
.tab-content.active { display: flex; }

/* === PANEL === */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px) saturate(1.3);
}

/* Framed panels */
.panel-framed {
  position: relative;
  background: rgba(12,14,20,0.85);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1.4rem 1.2rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.panel-title {
  font-family: var(--font-title);
  font-size: 0.7rem; font-weight: 600; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 0.5rem; padding-left: 0.5rem;
  border-left: 2px solid var(--gold-dim);
  text-shadow: 0 0 10px rgba(201,168,76,0.15);
}
.panel-title-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem;
}
.panel-title-row .panel-title { margin-bottom: 0; }

/* Foldable panels */
.fold-panel {
  border: none; background: none;
}
.fold-panel > .fold-title {
  font-family: var(--font-title);
  font-size: 0.68rem; font-weight: 600; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.6rem 2rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.4rem;
  list-style: none; user-select: none;
  transition: color 0.2s;
  position: relative;
  justify-content: center;
  text-shadow: 0 0 8px rgba(201,168,76,0.12);
  border-top: 1px solid rgba(201,168,76,0.1);
  border-bottom: 1px solid rgba(201,168,76,0.1);
  background: rgba(201,168,76,0.02);
}
.fold-panel > .fold-title:hover { color: var(--gold-bright); }
.fold-panel > .fold-title::before {
  content: ''; width: 0; height: 0;
  border-left: 4px solid var(--text-dim);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: transform 0.2s ease;
  display: inline-block;
}
.fold-panel[open] > .fold-title::before { transform: rotate(90deg); }
.fold-panel[open] > .fold-title { color: var(--text); }
.fold-panel > .fold-title::-webkit-details-marker { display: none; }
.fold-body { padding-top: 0.3rem; animation: fadeIn 0.2s ease; }
.fold-body.panel { padding: 0.5rem 0.8rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.fold-badge {
  margin-left: auto; font-size: 0.6rem; font-weight: 500;
  color: var(--accent); letter-spacing: 0; text-transform: none;
}

/* === INLINE INPUT === */
.inline-input {
  width: 3.5rem; text-align: center; font-size: 1.1rem; font-weight: 700;
  background: transparent; border: none;
  border-bottom: 2px solid var(--border); color: var(--text-bright);
  border-radius: 0;
}
.inline-input:focus { outline: none; border-bottom-color: var(--accent); }

/* === COUNTER ROW === */
.counter-row {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-size: 1rem;
}
.counter-label { font-size: 0.85rem; color: var(--text-dim); }
.counter-sep { color: var(--text-dim); font-size: 1.2rem; }
.counter-value { font-size: 1.5rem; font-weight: 700; color: var(--text-bright); }

/* === COMBAT STATS === */
.combat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
}
.combat-stat {
  position: relative;
  background: rgba(12,14,20,0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 0.8rem 0.6rem; text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.combat-stat:hover {
  border-color: rgba(139,127,212,0.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.combat-stat .stat-label {
  font-family: var(--font-title);
  font-size: 0.62rem; color: var(--gold-dim); text-transform: uppercase; letter-spacing: 0.1em;
}
.combat-stat .stat-value {
  font-family: var(--font-title);
  font-size: 2rem; font-weight: 700; color: var(--text-bright);
  text-shadow: 0 0 12px rgba(139,127,212,0.15);
}
.combat-stat .stat-value-sm {
  font-size: 1.2rem; font-weight: 600; color: var(--text-bright);
}
.combat-stat .stat-detail { font-size: 0.7rem; color: var(--text-dim); }

/* === HP === */
.hp-panel {
  background: linear-gradient(135deg, rgba(35,42,56,0.8) 0%, rgba(18,22,30,0.85) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px) saturate(1.3);
}
.hp-display {
  display: flex; align-items: center; justify-content: center; gap: 0.8rem;
  margin-bottom: 0.5rem;
}
.hp-current-wrap { display: flex; align-items: baseline; gap: 0.2rem; }
.hp-current {
  font-family: var(--font-title);
  width: 4rem; text-align: center; font-size: 2.5rem; font-weight: 700;
  background: transparent; border: none; color: var(--text-bright);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-shadow: 0 0 12px rgba(61,153,96,0.2);
}
.hp-current:focus { outline: none; border-bottom-color: var(--accent); }
.hp-separator { font-size: 1.5rem; color: var(--text-dim); }
.hp-max { font-size: 1.5rem; color: var(--text-dim); }
.hp-temp {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--text-dim);
}
.hp-temp .inline-input { width: 2.5rem; font-size: 0.9rem; }
.hp-quick {
  display: flex; gap: 0.4rem; justify-content: center;
  align-items: center; margin-top: 0.5rem; flex-wrap: wrap;
}
.hp-quick .inline-input { width: 4.5rem; font-size: 1rem; }

/* === DEATH SAVES === */
.death-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.death-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.9rem;
}
.death-dots { display: flex; gap: 0.4rem; }
.death-dot {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer; transition: all 0.15s;
}
.death-dot:hover { border-color: var(--text); }
.death-dot.success.filled { background: var(--success); border-color: var(--success); }
.death-dot.failure.filled { background: var(--danger); border-color: var(--danger); }

/* === WEAPONS === */
.weapon-row {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0;
  font-size: 0.9rem;
}
.weapon-name { flex: 1; font-weight: 600; }
.weapon-attack, .weapon-damage {
  padding: 0.35rem 0.7rem; border-radius: 6px; font-weight: 600;
  font-size: 0.95rem; transition: background 0.15s;
}
.weapon-attack { color: var(--accent); }
.weapon-attack:hover { background: var(--accent); color: var(--bg); }
.weapon-damage { color: var(--accent2); }
.weapon-damage:hover { background: var(--accent2); color: #fff; }

/* === RESOURCES === */
.resource-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.resource-row:last-child { border-bottom: none; }
.resource-name { flex: 1; font-weight: 500; }
.resource-counter { display: flex; align-items: center; gap: 0.35rem; }
.resource-current { font-weight: 700; color: var(--text-bright); min-width: 1.4rem; text-align: center; font-size: 1rem; }
.resource-max { color: var(--text-dim); }

/* === SORCERY POINTS === */
.spell-header {
  background: linear-gradient(135deg, rgba(35,42,56,0.8) 0%, var(--bg-panel) 100%);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.spell-stats-row {
  display: flex; justify-content: center; gap: 2.5rem; margin-bottom: 0.8rem;
}
.spell-stat { text-align: center; }
.spell-stat .stat-label { font-family: var(--font-title); font-size: 0.62rem; color: var(--gold-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.spell-stat .stat-value { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; color: var(--text-bright); text-shadow: 0 0 10px rgba(139,127,212,0.15); }

.sp-section { margin-top: 0.5rem; }
.sp-bar-wrap {
  height: 8px; background: rgba(0,0,0,0.4); border-radius: 99px;
  overflow: hidden; margin-bottom: 0.5rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.sp-bar {
  height: 100%; border-radius: 99px; transition: width 0.4s ease, background 0.4s;
  background: linear-gradient(90deg, var(--arcane-dim), var(--arcane), var(--arcane-bright));
  box-shadow: 0 0 10px rgba(139,127,212,0.35), 0 0 20px rgba(139,127,212,0.1);
}
.sp-info {
  display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-dim);
  margin-top: 0.3rem;
}
.sp-info strong { color: var(--accent2); }
.sp-max-input { color: var(--text-dim) !important; }

/* === METAMAGICS === */
.metamagic-list { display: flex; flex-direction: column; gap: 0.3rem; }
.metamagic-item {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  border-left: 3px solid var(--accent2);
  transition: all 0.15s ease;
}
.metamagic-item:hover { border-left-color: #a594e8; box-shadow: var(--shadow-sm); }
.metamagic-item summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.8rem; cursor: pointer; list-style: none;
  font-size: 0.88rem; transition: background 0.15s;
}
.metamagic-item summary:hover { background: rgba(255,255,255,0.03); }
.metamagic-item summary::-webkit-details-marker { display: none; }
.meta-name { font-weight: 600; color: var(--text-bright); }
.meta-cost {
  font-size: 0.72rem; color: var(--accent2); font-weight: 600;
  background: var(--accent2-soft); padding: 0.15rem 0.5rem; border-radius: 99px;
}
.meta-desc {
  font-size: 0.8rem; color: var(--text-dim); padding: 0.5rem 0.8rem;
  line-height: 1.5; border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(0,0,0,0.15);
}
.meta-tag {
  display: inline-block; padding: 0.4rem 0.8rem;
  background: var(--accent2); color: #fff; border-radius: 99px;
  font-size: 0.8rem; font-weight: 600;
}

/* === SPELLS === */
.spell-level-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(139,127,212,0.15);
}
.spell-level-header .panel-title {
  margin-bottom: 0;
  border-left-color: var(--accent2);
}
.spell-cost-tag {
  font-size: 0.72rem; font-weight: 600; color: var(--accent2);
  background: var(--accent2-soft); padding: 0.2rem 0.6rem; border-radius: 99px;
}
.spell-list { display: flex; flex-direction: column; }
.spell-item { border-bottom: 1px solid var(--border); }
.spell-item:last-child { border-bottom: none; }
.spell-item summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0.3rem; cursor: pointer; list-style: none;
  font-size: 0.9rem; border-radius: 6px;
}
.spell-item summary::-webkit-details-marker { display: none; }
.spell-item summary:hover { background: var(--bg-hover); }
.spell-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0.3rem; font-size: 0.9rem; border-bottom: 1px solid var(--border);
}
.spell-row:last-child { border-bottom: none; }
.spell-row:hover { background: var(--bg-hover); border-radius: 6px; }
.spell-name { font-weight: 500; }
.spell-row-right { display: flex; align-items: center; gap: 0.5rem; }
.spell-note { font-size: 0.75rem; color: var(--text-dim); font-style: italic; }
.spell-desc {
  font-size: 0.8rem; color: var(--text-dim); padding: 0.4rem 0.8rem 0.6rem;
  line-height: 1.4; border-left: 2px solid var(--accent2); margin: 0 0 0.3rem 0.5rem;
}

/* === ABILITIES === (styles moved to components.css — .ability-block, .ability-stat, .ask-row) */

/* Skill crosses */
.skill-row-edit { position: relative; }
.skill-crosses {
  display: flex; align-items: center; gap: 0.2rem;
  cursor: pointer; margin-left: auto; padding: 0.2rem 0.3rem;
  border-radius: 4px; transition: background 0.15s;
}
.skill-crosses:hover { background: var(--bg-hover); }
.crosses-display {
  color: var(--accent); font-size: 0.75rem; letter-spacing: 0.1em;
  min-width: 0.5rem;
}
.crosses-permanent {
  font-size: 0.7rem; color: var(--success); font-weight: 700;
  margin-right: 0.1rem;
}
.crosses-add {
  font-size: 0.65rem; color: var(--text-dim);
  opacity: 0; transition: opacity 0.15s;
}
.skill-row-edit:hover .crosses-add { opacity: 1; }

/* proficiency-box — styles in components.css */

/* === LIST ROWS (saves, skills) === */
.list-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.4rem; border-radius: 6px; font-size: 0.82rem;
  transition: background 0.15s ease;
}
.list-row:hover { background: rgba(255,255,255,0.03); }
.prof-dot { font-size: 0.75rem; width: 1.5rem; color: var(--text-dim); }
.proficient .prof-dot { color: var(--accent); }
.expertise .prof-dot { color: var(--accent2); }
.row-bonus { font-weight: 700; width: 2rem; text-align: right; color: var(--text-bright); }
.row-name { flex: 1; }
.row-sub { font-size: 0.7rem; color: var(--text-dim); }

.passive-row { font-size: 0.9rem; color: var(--text-dim); padding: 0.3rem 0; }
.passive-row strong { color: var(--text-bright); }

/* === FEATURES === */
.feature-item { border-bottom: 1px solid rgba(255,255,255,0.03); }
.feature-item:last-child { border-bottom: none; }
.feature-item summary {
  cursor: pointer; font-size: 0.9rem; padding: 0.5rem 0.3rem;
  list-style: none; display: flex; align-items: center; gap: 0.5rem;
  border-radius: 6px; transition: background 0.15s ease;
}
.feature-item summary:hover { background: rgba(255,255,255,0.03); }
.feature-item summary::-webkit-details-marker { display: none; }
.feature-item summary::before {
  content: ''; width: 0; height: 0;
  border-left: 4px solid var(--accent2); border-top: 3px solid transparent; border-bottom: 3px solid transparent;
  transition: transform 0.2s ease;
}
.feature-item[open] summary::before { transform: rotate(90deg); }
.feature-level {
  font-size: 0.62rem; color: var(--accent); font-weight: 700;
  background: var(--accent-soft); padding: 0.1rem 0.4rem; border-radius: 4px;
}
.feature-source {
  font-size: 0.6rem; color: var(--accent2); background: var(--accent2-soft);
  padding: 0.1rem 0.45rem; border-radius: 99px; margin-left: 0.3rem;
  font-weight: 500;
}
.feature-desc {
  font-size: 0.8rem; color: var(--text-dim);
  padding: 0.3rem 0 0.5rem 1.5rem; line-height: 1.4;
}

/* === EQUIPMENT & INVENTORY === */
.equip-row {
  display: flex; gap: 0.5rem; font-size: 0.9rem; padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.equip-row:last-child { border-bottom: none; }
.equip-slot { font-weight: 600; color: var(--text-dim); min-width: 5.5rem; }
.equip-item { color: var(--text); }
.inventory-add {
  display: flex; gap: 0.4rem; margin-bottom: 0.6rem;
}
.text-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 0.5rem 0.7rem; border-radius: var(--radius);
  font-size: 0.85rem;
}
.text-input:focus { outline: none; border-color: var(--accent); }
.text-input::placeholder { color: var(--text-dim); }

/* Inventory add form */
.inventory-add {
  display: flex; gap: 0.3rem; margin-bottom: 0.5rem; align-items: center;
}
.inv-add-name { flex: 2; }
.inv-add-qty { width: 3rem; flex: 0 0 3rem; text-align: center; padding: 0.5rem 0.3rem; }
.inv-add-desc { flex: 1.5; }

/* Inventory list */
.inventory-list { list-style: none; font-size: 0.85rem; }

.inv-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0; border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.inv-row:last-child { border-bottom: none; }
.inv-row:hover { background: rgba(255,255,255,0.025); }

.inv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.inv-edit-name {
  font-weight: 500; color: var(--text-bright); font-size: 0.85rem;
  background: transparent; border: none; border-bottom: 1px solid transparent;
  padding: 0.05rem 0; outline: none; font-family: inherit; width: 100%;
}
.inv-edit-name:hover, .inv-edit-name:focus {
  border-bottom-color: var(--border-light, rgba(255,255,255,0.1));
}
.inv-edit-desc {
  font-size: 0.72rem; color: var(--text-dim); font-style: italic;
  background: transparent; border: none; border-bottom: 1px solid transparent;
  padding: 0.05rem 0; outline: none; font-family: inherit; width: 100%;
}
.inv-edit-desc:hover, .inv-edit-desc:focus {
  border-bottom-color: var(--border-light, rgba(255,255,255,0.1));
}
.inv-edit-desc::placeholder { color: var(--text-dim); opacity: 0.4; }

.inv-qty {
  display: flex; align-items: center; gap: 0.15rem; flex-shrink: 0;
}
.inv-qty-btn {
  width: 1.2rem; height: 1.2rem; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; border-radius: 50%;
  opacity: 0; transition: opacity 0.12s;
}
.inv-row:hover .inv-qty-btn { opacity: 0.6; }
.inv-qty-btn:hover { opacity: 1 !important; }
.inv-qty-input {
  width: 2.2rem; text-align: center; font-weight: 700;
  font-size: 0.85rem; color: var(--accent);
  background: transparent; border: none; border-bottom: 1px solid transparent;
  padding: 0; outline: none; font-family: inherit;
  -moz-appearance: textfield;
}
.inv-qty-input::-webkit-inner-spin-button,
.inv-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.inv-qty-input:hover, .inv-qty-input:focus {
  border-bottom-color: var(--accent);
}

.inv-actions { display: flex; gap: 0.15rem; flex-shrink: 0; opacity: 0.3; transition: opacity 0.12s; }
.inv-row:hover .inv-actions { opacity: 1; }
.btn-danger-subtle { color: var(--danger); }
.btn-danger-subtle:hover { background: var(--danger); color: #fff; }

.panel-company { border-color: var(--accent2); }
.company-title { color: var(--accent2); border-left-color: var(--accent2); }

/* === MODALS === */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 200;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; width: 100%;
  max-width: 400px; max-height: 85vh; overflow-y: auto;
  animation: popIn 0.2s ease-out;
}
@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Cast modal */
.modal h3 {
  font-size: 1.1rem; color: var(--text-bright); margin-bottom: 0.8rem;
  padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.cast-levels { margin-bottom: 0.6rem; }
.cast-level-buttons { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.3rem; }
.cast-level-btn { transition: all 0.15s; }
.cast-level-btn.active { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.cast-cost { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 0.8rem; }
.cast-cost strong { color: var(--text-bright); }
.cast-metas { margin-bottom: 0.8rem; }
.cast-meta-option { border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; margin-bottom: 0.3rem; }
.cast-meta-option:last-child { border-bottom: none; }
.meta-check-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0; cursor: pointer; font-size: 0.9rem;
}
.meta-check-row input[type="checkbox"] { accent-color: var(--accent2); width: 1.1rem; height: 1.1rem; }
.cast-total {
  padding-top: 0.6rem; border-top: 1px solid var(--border);
  font-size: 1rem;
}
.cast-total strong { color: var(--text-bright); font-size: 1.2rem; }
.cast-remaining { font-size: 0.8rem; color: var(--text-dim); margin-left: 0.4rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

/* Dice modal */
.dice-modal { text-align: center; }
.dice-label { font-size: 1rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.dice-rolls { font-size: 0.9rem; color: var(--accent2); margin-bottom: 0.4rem; }
.dice-total { font-size: 2.5rem; font-weight: 700; color: var(--text-bright); margin-bottom: 1rem; }
.dice-total.crit { color: var(--accent); text-shadow: 0 0 12px var(--accent); }
.dice-total.fumble { color: var(--danger); }
.crit-roll { color: var(--accent); font-weight: 700; }
.fumble-roll { color: var(--danger); font-weight: 700; }

/* === DICE LOG === */
.dice-log-toggle {
  position: fixed; bottom: 80px; right: 12px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text); font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.dice-log-toggle:hover { background: var(--bg-hover); }
.log-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--accent); color: var(--bg); font-size: 0.65rem;
  font-weight: 700; width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.dice-log {
  position: fixed; bottom: 130px; right: 12px; z-index: 89;
  width: 280px; max-height: 250px; overflow-y: auto;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.8rem;
}
.dice-log-entries { font-size: 0.8rem; }
.dice-log-entry {
  padding: 0.3rem 0; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between;
}
.dice-log-entry:last-child { border-bottom: none; }
.log-label { color: var(--text-dim); }
.log-result { font-weight: 700; color: var(--text-bright); }

/* === BOTTOM NAV (mobile) === */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; background: var(--bg-panel);
  border-top: 1px solid var(--border); align-items: stretch;
}
.bnav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.05rem; padding: 0.25rem 0;
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 0.6rem; text-decoration: none;
  min-height: 44px; transition: color 0.15s;
  border-top: 2px solid transparent;
}
.bnav-btn:hover { color: var(--text); }
.bnav-btn.active { color: var(--accent); border-top-color: var(--accent); }
.bnav-icon { font-size: 1rem; line-height: 1; }
.bnav-label { font-weight: 600; font-size: 0.58rem; }
.bnav-center {
  background: var(--accent); color: var(--bg) !important;
  border-radius: 50%; width: 38px; height: 38px; min-height: auto;
  flex: 0 0 38px; margin: -6px 0.2rem 2px;
  box-shadow: 0 2px 6px rgba(212,168,67,0.3);
  border-top: none;
}
.bnav-center:hover { background: #b8973f; }
.bnav-plus { font-size: 1.5rem; font-weight: 700; }

/* === QUICK ACTIONS PANEL === */
.quick-panel {
  display: none; position: fixed; bottom: 64px; left: 50%;
  transform: translateX(-50%); z-index: 150;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 220px; overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  animation: slideUp 0.2s ease-out;
}
.quick-panel.show { display: block; }
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(10px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.quick-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1rem; color: var(--text); text-decoration: none;
  font-size: 0.9rem; transition: background 0.1s;
}
.quick-item:hover { background: var(--bg-hover); }
.quick-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }

/* === SHEET TABS (pills, mobile only) === */
/* === SHEET BANNER === */
/* === SHEET BANNER === */
.sheet-banner {
  position: relative; width: 100%; height: 200px; overflow: hidden;
}
.sheet-banner-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  display: block; transition: transform 8s ease-out;
}
.sheet-banner:hover .sheet-banner-img { transform: scale(1.03); }
.sheet-banner-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(8,11,17,0.5) 40%, rgba(8,11,17,0.1) 70%, rgba(8,11,17,0.25) 100%),
    linear-gradient(to right, rgba(8,11,17,0.4) 0%, transparent 40%);
}
.sheet-banner-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1rem 1.5rem;
  display: flex; align-items: flex-end; gap: 1rem;
  z-index: 2;
}

/* Identity block */
.sheet-identity {
  flex: 1; min-width: 0;
}
.sheet-banner-name {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700; color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7), 0 0 20px rgba(139,127,212,0.12);
  letter-spacing: 0.04em; line-height: 1.2;
}
.sheet-banner-sub {
  font-family: var(--font-title);
  font-size: 0.72rem; color: rgba(255,255,255,0.55);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

/* Core stats row — directly under name */
/* Old core-stat styles removed — replaced by .header-stat in components.css */

.sheet-tabs {
  display: flex; gap: 0.3rem; padding: 0.5rem 0.8rem;
  background: var(--bg); position: sticky; top: 44px; z-index: 90;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.stab {
  padding: 0.4rem 1rem; border-radius: 99px; font-size: 0.82rem;
  font-weight: 600; background: var(--bg-panel); color: var(--text-dim);
  border: 1px solid var(--border); cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.stab:hover { color: var(--text); border-color: var(--text-dim); }
.stab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* === SHORTCUTS MODAL === */
.shortcuts-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1rem; }
.shortcuts-table td { padding: 0.4rem 0.5rem; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.shortcuts-table td:first-child { white-space: nowrap; color: var(--text-dim); }
.shortcuts-sep td { font-weight: 600; color: var(--accent); padding-top: 0.8rem; border-bottom: none; }
kbd {
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.1rem 0.4rem; font-size: 0.75rem;
  font-family: inherit;
}

/* === HOME PAGE === */
.home-link { text-decoration: none; color: inherit; }
.home-main { padding: 1.5rem; max-width: 800px; margin: 0 auto; }
.home-section { margin-bottom: 2rem; }
.home-section h2 {
  font-size: 1rem; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 0.8rem;
  padding-left: 0.5rem; border-left: 3px solid var(--accent);
}

.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; }
.char-card-wrap { position: relative; }
.char-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; text-decoration: none;
  color: var(--text); transition: all 0.15s; display: flex;
  align-items: center; gap: 0.8rem; min-height: 80px;
}
.char-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.char-card-initial {
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  background: var(--accent); color: var(--bg); display: flex;
  align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}
.char-card-body { flex: 1; min-width: 0; }
.char-card-name { font-size: 1rem; font-weight: 700; color: var(--text-bright); }
.char-card-info { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.2rem; }
.char-card-new {
  border-style: dashed; border-color: var(--text-dim);
  justify-content: center; text-align: center;
}
.char-card-new:hover { border-color: var(--accent); }
.char-card-plus { font-size: 1.5rem; color: var(--text-dim); line-height: 1; }
.char-card-new .char-card-name { color: var(--text-dim); font-size: 0.82rem; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.8rem; }
.tool-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; text-decoration: none;
  color: var(--text); text-align: center; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.tool-card:hover { border-color: var(--accent2); transform: translateY(-2px); }
.tool-icon { font-size: 1.8rem; }
.tool-label { font-size: 0.85rem; font-weight: 600; }
.tool-sub { font-size: 0.7rem; color: var(--text-dim); }

/* === MAPS PAGE === */
.maps-main { padding: 1rem; max-width: 1200px; margin: 0 auto; }

.maps-toolbar {
  display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap;
}
.maps-toggle {
  display: flex; align-items: center; gap: 0.3rem; font-size: 0.82rem;
  color: var(--text-dim); cursor: pointer; margin-left: auto;
}
.maps-toggle input { accent-color: var(--accent); }
.maps-empty { text-align: center; color: var(--text-dim); padding: 3rem 1rem; }

/* === MAP VIEW === */
.map-view { display: flex; gap: 1rem; }
.map-container {
  flex: 1; position: relative; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); background: var(--bg-panel);
}
.map-image { width: 100%; display: block; }
.map-pins { position: absolute; inset: 0; }

.map-pin {
  position: absolute; transform: translate(-50%, -50%);
  cursor: pointer; z-index: 10; transition: all 0.15s;
}
.map-pin:hover { z-index: 20; transform: translate(-50%, -50%) scale(1.2); }
.pin-dot {
  display: block; border-radius: 50%;
  margin: 0 auto 0.15rem;
  border: 2px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.pin-label {
  display: block; font-size: 0.6rem; font-weight: 700;
  color: var(--text-bright); text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 6px rgba(0,0,0,0.6);
  white-space: nowrap;
}

/* Pin sizes */
.pin-region .pin-dot { width: 12px; height: 12px; background: var(--accent); }
.pin-region .pin-label { font-size: 0.72rem; color: var(--accent); }
.pin-place .pin-dot { width: 8px; height: 8px; background: var(--accent2); }
.pin-place .pin-label { font-size: 0.55rem; }

/* Pin states */
.pin-selected .pin-dot { background: #fff; box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent); }
.pin-selected .pin-label { color: #fff; }
.map-pin.unvisited { opacity: 0.4; }
.map-pin.unvisited:hover { opacity: 0.8; }

/* Edit mode */
.map-container.edit-mode { cursor: default; }
.map-container.edit-mode .map-pin { cursor: grab; }
.map-container.edit-mode .map-pin:active { cursor: grabbing; }
.map-container.edit-mode .draggable-pin .pin-dot {
  animation: pinPulse 1.5s infinite;
}
@keyframes pinPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(201,168,76,0.3); }
  50% { box-shadow: 0 0 12px rgba(201,168,76,0.8); }
}
#btn-edit-mode.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Sidebar */
.map-sidebar {
  width: 260px; flex-shrink: 0; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.8rem; max-height: 70vh; overflow-y: auto;
}
.map-sidebar-title { font-size: 0.85rem; color: var(--text-dim); text-align: center; padding: 1rem 0; }

.sidebar-loc { }
.sidebar-loc-name { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 0.3rem; }
.sidebar-loc-parent { font-size: 0.75rem; color: var(--accent2); margin-bottom: 0.3rem; }
.sidebar-loc-status { font-size: 0.8rem; margin-bottom: 0.5rem; }
.sidebar-loc-status { color: var(--success); }
.sidebar-loc-desc { font-size: 0.85rem; color: var(--text); margin-bottom: 0.4rem; line-height: 1.4; }
.sidebar-loc-notes { font-size: 0.8rem; color: var(--text-dim); font-style: italic; margin-bottom: 0.5rem; }
.sidebar-actions { display: flex; gap: 0.3rem; margin-top: 0.5rem; }

.sidebar-children-title {
  font-size: 0.75rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; margin-top: 0.8rem; margin-bottom: 0.3rem;
  padding-top: 0.5rem; border-top: 1px solid var(--border);
}
.sidebar-child {
  padding: 0.35rem 0.4rem; font-size: 0.85rem; cursor: pointer;
  border-radius: 4px; transition: background 0.1s;
}
.sidebar-child:hover { background: var(--bg-hover); }
.sidebar-child.unvisited { color: var(--text-dim); }
.sidebar-child-dot { font-size: 0.75rem; margin-right: 0.2rem; }

/* Mobile: stack map and sidebar */
@media (max-width: 700px) {
  .map-view { flex-direction: column; }
  .map-sidebar { width: 100%; max-height: none; }
  .pin-label { font-size: 0.5rem; }
  .pin-region .pin-label { font-size: 0.6rem; }
}

.locations-tree { display: flex; flex-direction: column; gap: 0.2rem; }

.loc-node { transition: margin 0.15s; }
.loc-row {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.7rem 0.8rem; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all 0.15s;
}
.loc-row:hover { border-color: var(--accent); transform: translateX(2px); }

.loc-visited-icon {
  font-size: 1.1rem; min-width: 1.5rem; text-align: center;
  cursor: pointer; padding-top: 0.1rem;
}
.loc-node.visited .loc-visited-icon { color: var(--success); }
.loc-node.unvisited .loc-visited-icon { color: var(--text-dim); }
.loc-node.unvisited .loc-row { opacity: 0.7; }
.loc-node.unvisited .loc-row:hover { opacity: 1; }

.loc-info { flex: 1; min-width: 0; }
.loc-name { font-weight: 600; color: var(--text-bright); font-size: 0.95rem; }
.loc-child-count { font-size: 0.72rem; color: var(--text-dim); font-weight: 400; }
.loc-preview { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.15rem; }
.loc-notes-preview {
  font-size: 0.75rem; color: var(--accent2); font-style: italic;
  margin-top: 0.1rem;
}

.loc-depth-badge {
  font-size: 0.65rem; color: var(--text-dim); background: var(--bg);
  padding: 0.1rem 0.4rem; border-radius: 99px; white-space: nowrap;
  align-self: center;
}

/* === IMPORT PAGE === */
.import-main { padding: 1rem; max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.8rem; }

.import-drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer; transition: all 0.15s;
  margin-top: 0.5rem;
}
.import-drop:hover, .import-drop.dragover { border-color: var(--accent); background: var(--bg-hover); }
.import-drop-content { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; color: var(--text-dim); }
.import-drop-icon { font-size: 2.5rem; }

.import-status { margin-top: 0.5rem; font-size: 0.85rem; text-align: center; }
.import-status.loading { color: var(--accent); }
.import-status.error { color: var(--danger); }
.import-status.success { color: var(--success); }

.import-abilities { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.imp-ability {
  background: var(--bg-hover); border-radius: var(--radius); padding: 0.5rem 0.8rem;
  text-align: center; min-width: 4rem;
}
.imp-ab-name { display: block; font-size: 0.65rem; font-weight: 700; color: var(--text-dim); letter-spacing: 0.1em; }
.imp-ab-score { display: block; font-size: 0.85rem; color: var(--text); }
.imp-ab-mod { display: block; font-size: 1.2rem; font-weight: 700; color: var(--accent); }

.imp-skill { font-size: 0.85rem; padding: 0.2rem 0; color: var(--text); }
.imp-feature { font-size: 0.82rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.imp-feature:last-child { border-bottom: none; }
.imp-feature strong { color: var(--accent); }

.import-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }

/* === NOTES PAGE === */
.notes-main { padding: 1rem; max-width: 1100px; margin: 0 auto; }

.notes-toolbar {
  display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center;
}
.notes-toolbar .text-input { flex: 1; min-width: 120px; }
.view-toggle { display: flex; gap: 0.2rem; }
.view-btn { border-radius: 99px; font-size: 0.75rem; padding: 0.3rem 0.8rem; }
.view-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.notes-list { }
.notes-empty { text-align: center; color: var(--text-dim); padding: 3rem 1rem; font-size: 0.9rem; }

/* === SESSION MODE === */
.session-panel {
  background: var(--bg-panel); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 0.8rem;
}
.session-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.6rem;
}
.session-header .panel-title { margin-bottom: 0; }
.session-date { font-size: 0.8rem; color: var(--text-dim); }

.session-quick { display: flex; flex-direction: column; gap: 0.4rem; }
.session-input {
  font-size: 1rem; line-height: 1.5; min-height: 60px; resize: vertical;
  border-color: var(--accent);
}
.session-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(201,168,76,0.15); }
.session-actions {
  display: flex; gap: 0.4rem; align-items: center;
}
.session-type-select { width: auto; font-size: 0.8rem; }

.session-log { margin-top: 0.8rem; }
.session-empty { text-align: center; color: var(--text-dim); padding: 1.5rem; font-size: 0.9rem; }

.session-entry {
  display: flex; align-items: flex-start; gap: 0.4rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.session-entry:last-child { border-bottom: none; }
.session-time {
  font-size: 0.72rem; color: var(--text-dim); font-family: monospace;
  min-width: 3.5rem; padding-top: 0.1rem;
}
.session-type-icon { font-size: 0.85rem; }
.session-text { flex: 1; color: var(--text); line-height: 1.4; }

/* === TREE VIEW === */
.notes-tree { display: flex; gap: 1rem; }

/* Table of contents (sidebar) */
.notes-toc {
  width: 200px; flex-shrink: 0; position: sticky; top: 60px;
  max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.6rem;
}
.toc-title {
  font-size: 0.75rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; margin-bottom: 0.4rem;
  padding-bottom: 0.3rem; border-bottom: 1px solid var(--border);
}
.toc-type {
  display: block; padding: 0.35rem 0.4rem; font-size: 0.8rem;
  color: var(--text); text-decoration: none; font-weight: 600;
  border-left: 3px solid var(--border); margin-top: 0.3rem;
  border-radius: 0 4px 4px 0; transition: background 0.1s;
}
.toc-type:hover { background: var(--bg-hover); }
.toc-count { font-size: 0.7rem; color: var(--text-dim); float: right; }
.toc-sub {
  display: block; padding: 0.2rem 0.4rem 0.2rem 1.2rem;
  font-size: 0.75rem; color: var(--text-dim); text-decoration: none;
  transition: color 0.1s;
}
.toc-sub:hover { color: var(--text); }

/* Content area */
.notes-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.8rem; }

.note-group { }
.note-group-header {
  font-size: 1rem; font-weight: 700; color: var(--text-bright);
  padding: 0.5rem 0.6rem; border-left: 3px solid var(--accent);
  margin-bottom: 0.3rem;
}
.note-group-icon { margin-right: 0.3rem; }

.note-subgroup {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 0.4rem; overflow: hidden;
}
.note-subgroup-header {
  font-size: 0.82rem; font-weight: 600; color: var(--accent2);
  padding: 0.5rem 0.8rem; background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}
.note-subgroup-items { }
.note-tree-item {
  padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.note-tree-item:last-child { border-bottom: none; }
.note-tree-item:hover { background: var(--bg-hover); }
.note-tree-title { font-size: 0.88rem; font-weight: 500; color: var(--text); }
.note-tree-preview { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.1rem; }

.note-links {
  font-size: 0.65rem; color: var(--accent2); background: var(--bg);
  padding: 0.1rem 0.4rem; border-radius: 99px; margin-left: 0.3rem;
}

/* === GRAPH VIEW === */
.graph-canvas {
  width: 100%; border-radius: var(--radius);
  background: var(--bg-panel); border: 1px solid var(--border);
  cursor: grab;
}
.graph-canvas:active { cursor: grabbing; }

/* Note shared/owner badges */
.note-shared-badge { font-size: 0.7rem; margin-left: 0.2rem; }
.note-owner-badge {
  font-size: 0.6rem; padding: 0.05rem 0.4rem; border-radius: 99px;
  background: var(--accent2); color: #fff; margin-left: 0.3rem;
  font-weight: 600;
}
.note-shared-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--text-dim); cursor: pointer;
}
.note-shared-toggle input { accent-color: var(--accent2); width: 1.1rem; height: 1.1rem; }

/* Note editor modal */
.note-modal { max-width: 600px; display: flex; flex-direction: column; gap: 0.6rem; }
.note-title-input { font-size: 1.1rem; font-weight: 600; }
.note-meta-row { display: flex; gap: 0.4rem; }
.note-meta-row .text-input { flex: 1; }
.note-content-input { min-height: 200px; font-family: inherit; line-height: 1.6; resize: vertical; }

/* Linked notes chips */
.note-link-chip {
  display: inline-block; padding: 0.2rem 0.6rem; margin: 0.2rem;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 99px; font-size: 0.75rem; color: var(--accent2);
  cursor: pointer; transition: all 0.15s;
}
.note-link-chip:hover { background: var(--accent2); color: #fff; }

/* Mobile: hide TOC sidebar, stack */
@media (max-width: 700px) {
  .notes-tree { flex-direction: column; }
  .notes-toc { width: 100%; position: static; max-height: none; }
}

/* === CREATE / WIZARD === */
.create-main { padding: 1rem; max-width: 700px; margin: 0 auto; }

.wizard-progress {
  display: flex; gap: 0.3rem; margin-bottom: 1rem; overflow-x: auto;
}
.wizard-step {
  flex: 1; text-align: center; padding: 0.5rem 0.3rem;
  font-size: 0.75rem; font-weight: 600; color: var(--text-dim);
  border-bottom: 3px solid var(--border); cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.wizard-step.active { color: var(--accent); border-bottom-color: var(--accent); }
.wizard-step.done { color: var(--success); border-bottom-color: var(--success); }

.wizard-panel { display: none; flex-direction: column; gap: 0.8rem; }
.wizard-panel.active { display: flex; }

.wizard-nav {
  display: flex; gap: 0.5rem; margin-top: 1rem; padding: 1rem 0;
  position: sticky; bottom: 0; background: var(--bg);
  border-top: 1px solid var(--border);
}
.wizard-nav-spacer { flex: 1; }

/* Form elements */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.8rem; }
.form-group { display: flex; flex-direction: column; gap: 0.2rem; }
.form-group.span-2 { grid-column: span 2; }
.form-group label { font-size: 0.75rem; color: var(--text-dim); font-weight: 600; }
.form-hint { font-size: 0.72rem; color: var(--text-dim); font-style: italic; margin-top: 0.2rem; }
.textarea { resize: vertical; min-height: 2.5rem; font-family: inherit; }

/* Ability form */
.abilities-form { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
.ability-form-row {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem;
  border-radius: 6px;
}
.ability-form-row:hover { background: var(--bg-hover); }
.ability-form-name { width: 6rem; font-weight: 500; font-size: 0.9rem; }
.ability-score-input { width: 3.5rem !important; text-align: center; }
.ability-form-mod { font-weight: 700; color: var(--accent); width: 2.5rem; text-align: center; font-size: 1.1rem; }

/* Save & skill form rows */
.save-form-row, .skill-form-row {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.4rem;
  font-size: 0.9rem; border-radius: 6px;
}
.save-form-row:hover, .skill-form-row:hover { background: var(--bg-hover); }
.save-form-row input[type="checkbox"], .skill-form-row input[type="checkbox"] {
  accent-color: var(--accent); width: 1rem; height: 1rem;
}
.save-bonus, .skill-bonus { font-weight: 700; color: var(--text-bright); width: 2rem; text-align: right; }
.save-form-name, .skill-form-name { flex: 1; }
.skill-form-ability { font-size: 0.7rem; color: var(--text-dim); }

/* Dynamic rows */
.dynamic-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0; border-bottom: 1px solid var(--border);
}
.dynamic-row:last-child { border-bottom: none; }
.dynamic-row .text-input { flex: 1; }
.dynamic-col { flex-direction: column; align-items: stretch; }
.dynamic-row-inner { display: flex; gap: 0.4rem; align-items: center; }
.dynamic-row-inner .text-input { flex: 1; }

/* Spell add */
.spell-add-row { display: flex; gap: 0.3rem; margin-top: 0.5rem; align-items: center; flex-wrap: wrap; }
.spell-group-header { font-size: 0.8rem; font-weight: 600; color: var(--accent2); margin-top: 0.5rem; }
.spell-created-name { flex: 1; font-weight: 500; }
.spell-created-note { font-size: 0.75rem; color: var(--text-dim); font-style: italic; }

@media (max-width: 500px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span-2 { grid-column: span 1; }
}

/* === COMBAT MODE === */
#combat-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 180; background: var(--bg); overflow-y: auto;
  padding: 0 0.8rem 1rem; flex-direction: column; gap: 0.6rem;
}
#combat-overlay[style*="flex"] { display: flex; }

.combat-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0; position: sticky; top: 0; background: var(--bg); z-index: 5;
  border-bottom: 1px solid var(--border);
}
.combat-bar-name { font-weight: 700; color: var(--text-bright); font-size: 1rem; }
.combat-bar-class { font-size: 0.8rem; color: var(--text-dim); flex: 1; }

/* Vitals */
.combat-vitals {
  display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem;
  align-items: center;
}
.combat-stat-block {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.6rem; text-align: center;
}
.combat-hp-block { border-color: var(--accent); text-align: left; }
.combat-sp-block { border-color: var(--accent2); }
.combat-stat-label { font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; }
.combat-stat-big { font-size: 2rem; font-weight: 700; color: var(--text-bright); }
.combat-hp-row { display: flex; align-items: center; gap: 0.4rem; }
.combat-hp-value { font-size: 2rem; font-weight: 700; color: var(--text-bright); }
.combat-hp-sep { font-size: 1rem; color: var(--text-dim); }
.combat-hp-btn { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
.combat-hp-quick { display: flex; gap: 0.3rem; margin-top: 0.3rem; }
.combat-hp-quick .inline-input { width: 3rem; font-size: 0.85rem; }
.combat-sp-bar-wrap { height: 4px; background: var(--bg); border-radius: 99px; margin-top: 0.3rem; overflow: hidden; }
.combat-sp-bar { height: 100%; background: var(--accent2); border-radius: 99px; transition: width 0.3s; }

/* Action Economy Tracker */
.combat-actions-tracker {
  display: flex; gap: 0.4rem; align-items: center;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.5rem 0.6rem;
}
.combat-action-slot {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 0.2rem; cursor: pointer; padding: 0.3rem;
  border-radius: 6px; transition: background 0.15s;
}
.combat-action-slot:hover { background: var(--bg-hover); }
.action-label { font-size: 0.65rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; }
.action-dot {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 2px solid var(--success); transition: all 0.15s;
}
.action-dot.used { background: var(--text-dim); border-color: var(--text-dim); opacity: 0.4; }
.action-dot.blocked { background: var(--danger); border-color: var(--danger); opacity: 0.6; }
.action-dot:not(.used):not(.blocked) { background: var(--success); }
.action-label-extra {
  font-size: 0.55rem; color: var(--danger); font-style: italic;
  min-height: 0.7rem;
}

/* Spell disabled state */
.combat-spell-btn.spell-disabled {
  opacity: 0.3; pointer-events: none;
}
.combat-new-turn {
  white-space: nowrap; font-size: 0.72rem; padding: 0.3rem 0.6rem;
}

/* Concentration */
.combat-concentration {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--accent2); color: #fff; padding: 0.5rem 0.8rem;
  border-radius: var(--radius); font-size: 0.85rem;
}

/* Concentration prompt toast */
.conc-prompt {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--accent2); color: #fff; padding: 0.4rem 0.8rem;
  border-radius: var(--radius); font-size: 0.8rem;
  animation: slideDown 0.2s ease;
}
.conc-prompt .btn { background: rgba(255,255,255,0.2); color: #fff; border: none; font-size: 0.75rem; }
.conc-prompt .btn:hover { background: rgba(255,255,255,0.35); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Conditions */
.combat-conditions {
  display: flex; gap: 0.3rem; flex-wrap: wrap;
}
.combat-cond-chip {
  padding: 0.3rem 0.6rem; border-radius: 99px; font-size: 0.72rem;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; transition: all 0.15s;
}
.combat-cond-chip:hover { border-color: var(--text); }
.combat-cond-chip.active { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Resources */
.combat-resources {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem;
}
.combat-res-btn {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.5rem 0.6rem; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: all 0.15s;
}
.combat-res-btn:hover { border-color: var(--accent); }
.combat-res-btn:active { transform: scale(0.97); }
.combat-res-name { font-size: 0.75rem; color: var(--text); }
.combat-res-count { font-weight: 700; color: var(--accent); font-size: 0.9rem; }

/* Abilities */
.combat-abilities { display: flex; flex-direction: column; gap: 0.3rem; }
.combat-ability-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
/* Action type tags */
.action-type-tag {
  font-size: 0.6rem; font-weight: 700; padding: 0.1rem 0.4rem;
  border-radius: 99px; margin-right: 0.3rem; text-transform: uppercase;
}
.action-type-tag.action { background: var(--accent); color: var(--bg); }
.action-type-tag.bonus { background: var(--accent2); color: #fff; }
.action-type-tag.reaction { background: var(--danger); color: #fff; }
.action-type-tag.free { background: var(--success); color: #fff; }

.combat-ability-card summary {
  padding: 0.5rem 0.8rem; cursor: pointer; list-style: none;
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
}
.combat-ability-card summary::-webkit-details-marker { display: none; }
.combat-ability-card p {
  padding: 0.4rem 0.8rem 0.5rem; font-size: 0.78rem;
  color: var(--text-dim); border-top: 1px solid var(--border); line-height: 1.4;
}

/* Metamagics */
.combat-metamagics { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.combat-meta-chip {
  padding: 0.3rem 0.7rem; border-radius: 99px; font-size: 0.75rem;
  background: var(--accent2); color: #fff; font-weight: 600; cursor: help;
}

/* Spells quick-cast */
.combat-spells { display: flex; flex-direction: column; gap: 0.5rem; }
.combat-spell-group { }
.combat-spell-level {
  font-size: 0.72rem; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: 0.2rem;
}
.combat-spell-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.3rem; }
.combat-spell-btn {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.5rem; cursor: pointer;
  font-size: 0.8rem; color: var(--text); text-align: center;
  transition: all 0.15s; min-height: 40px;
}
.combat-spell-btn:hover { border-color: var(--accent2); color: var(--text-bright); }
.combat-spell-btn:active { transform: scale(0.97); background: var(--bg-hover); }
.combat-spell-btn.cantrip { border-color: var(--border); color: var(--text-dim); font-size: 0.75rem; }
.combat-spell-btn.spell-reaction { border-color: var(--danger); }
.combat-spell-btn.spell-reaction:hover { background: var(--danger); color: #fff; }
.combat-spell-btn.spell-bonus { border-color: var(--accent2); }
.combat-spell-btn.spell-bonus:hover { background: var(--accent2); color: #fff; }
.spell-cost-mini { font-size: 0.65rem; color: var(--text-dim); }
.spell-free-tag {
  display: block; font-size: 0.6rem; color: var(--success); font-weight: 700;
}
.spell-source-mini {
  display: block; font-size: 0.55rem; color: var(--text-dim); font-style: italic;
}
.combat-spell-btn.spell-free { border-color: var(--success); }
.combat-spell-btn.spell-free:hover { background: var(--success); color: #fff; }

.combat-meta-reminder {
  background: var(--bg-hover); border: 1px dashed var(--accent2);
  border-radius: var(--radius); padding: 0.5rem 0.7rem;
  font-size: 0.78rem; color: var(--text-dim); line-height: 1.4;
}
.combat-meta-reminder strong { color: var(--accent2); }
.combat-meta-reminder em { display: block; margin-top: 0.2rem; font-size: 0.72rem; }

/* Weapons */
.combat-weapons { display: flex; flex-direction: column; gap: 0.3rem; }
.combat-weapon-row {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.4rem 0.6rem;
}
.combat-weapon-name { flex: 1; font-weight: 600; font-size: 0.85rem; }

/* Death saves in combat */
.combat-death {
  background: var(--bg-panel); border: 1px solid var(--danger);
  border-radius: var(--radius); padding: 0.8rem;
}
.combat-death .death-dot { width: 1.8rem; height: 1.8rem; }

/* FAB */
.combat-fab {
  position: fixed; bottom: 72px; left: 12px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none;
  font-size: 1.4rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(217,83,79,0.4);
  transition: all 0.15s;
}
.combat-fab:hover { transform: scale(1.1); }
/* Add pin mode */
.map-container.add-pin-mode { cursor: crosshair; }
.map-container.add-pin-mode .map-pin { pointer-events: none; }
#btn-add-pin-mode.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Map upload */
.maps-upload-btn { cursor: pointer; }
.map-empty-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px; background: var(--bg-panel);
}
.map-upload-zone {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  cursor: pointer; color: var(--text-dim); padding: 2rem;
  border: 2px dashed var(--border); border-radius: var(--radius);
}
.map-upload-zone:hover { border-color: var(--accent); color: var(--text); }
.map-upload-icon { font-size: 3rem; }

body.combat-active .combat-fab { display: none; }
body.combat-active .bottom-nav { display: none; }
body.combat-active .sheet-tabs { display: none; }

@media (min-width: 900px) {
  .combat-fab { bottom: 16px; }
  #combat-overlay { max-width: 600px; margin: 0 auto; left: 0; right: 0; }
  .combat-spell-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === INLINE EDIT (sheet) === */
.btn-delete-inline {
  opacity: 0; transition: opacity 0.15s;
  font-size: 1rem; padding: 0 0.3rem; line-height: 1;
}
.weapon-row:hover .btn-delete-inline,
.resource-row:hover .btn-delete-inline,
.spell-row:hover .btn-delete-inline,
.spell-item:hover > summary .btn-delete-inline,
.feature-item:hover > summary .btn-delete-inline,
.bond-row:hover .btn-delete-inline {
  opacity: 1;
}
.inline-add-form {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  padding: 0.5rem 0; border-top: 1px solid var(--border);
  margin-top: 0.3rem;
}
.inline-add-form .text-input,
.inline-add-form .inline-input,
.inline-add-form select {
  flex: 1; min-width: 60px;
}
.text-input-sm { max-width: 120px; }
.btn-add-row {
  margin-top: 0.4rem; width: 100%;
  border: 1px dashed var(--border); color: var(--text-dim);
  background: transparent; padding: 0.3rem;
}
.btn-add-row:hover { border-color: var(--accent); color: var(--accent); }

/* Equipment editable inputs */
.equip-input {
  flex: 1; background: transparent; border: 1px solid transparent;
  color: var(--text); padding: 0.2rem 0.4rem; border-radius: 4px;
  font-size: inherit;
}
.equip-input:hover { border-color: var(--border); }
.equip-input:focus { border-color: var(--accent); background: var(--bg-hover); }

/* Bonds */
.bond-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
}
.bond-row:last-child { border-bottom: none; }
.bond-info {
  flex: 1; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0;
}
.bond-edit-name {
  font-weight: 600; font-size: 1rem; color: var(--text-bright);
  background: transparent; border: none; border-bottom: 1px solid transparent;
  padding: 0.1rem 0; outline: none; font-family: inherit;
}
.bond-edit-name:hover, .bond-edit-name:focus {
  border-bottom-color: var(--border-light);
}
.bond-edit-relation {
  font-size: 0.8rem; color: var(--text-dim); font-style: italic;
  background: transparent; border: none; border-bottom: 1px solid transparent;
  padding: 0.1rem 0; outline: none; font-family: inherit;
}
.bond-edit-relation:hover, .bond-edit-relation:focus {
  border-bottom-color: var(--border-light);
}
.bond-controls {
  display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0;
}
.bond-edit-num {
  width: 2.2rem; text-align: center; font-weight: 700; font-size: 1.1rem;
  color: var(--accent); background: transparent; border: none;
  border-bottom: 1px solid transparent; padding: 0; font-family: inherit;
  -moz-appearance: textfield;
}
.bond-edit-num::-webkit-inner-spin-button,
.bond-edit-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bond-edit-num:hover, .bond-edit-num:focus {
  border-bottom-color: var(--accent); outline: none;
}
.bond-score-display {
  display: flex; align-items: baseline; gap: 0;
}
.bond-btn-minus, .bond-btn-plus {
  width: 1.3rem; height: 1.3rem; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; border-radius: 50%;
  opacity: 0; transition: opacity 0.15s;
}
.bond-row:hover .bond-btn-minus,
.bond-row:hover .bond-btn-plus { opacity: 0.7; }
.bond-btn-minus:hover, .bond-btn-plus:hover { opacity: 1 !important; }
.bond-btn-minus { color: var(--blood); }
.bond-btn-plus { color: var(--heal); }
.bond-plus-display {
  min-width: 1rem; text-align: center; font-weight: 700;
  font-size: 0.85rem; color: var(--heal); letter-spacing: -1px;
}

/* === INPUTS === */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* === GLOBAL TRANSITIONS === */
* { -webkit-tap-highlight-color: rgba(201, 168, 76, 0.15); }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* === DESKTOP === */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .quick-panel { bottom: auto; top: 52px; right: 1rem; left: auto; transform: none; }
  @keyframes slideUp {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  .header-nav { display: flex; }
  .sheet-tabs { display: none; }

  .page-sheet main {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 0.8rem; padding: 0.8rem 1.5rem;
    max-width: 1200px;
  }
  .page-sheet .tab-content { display: flex !important; }

  /* 2-col: left + center stacked, right below center */
  #tab-left { grid-column: 1; grid-row: 1 / 3; }
  #tab-center { grid-column: 2; grid-row: 1; align-self: start; }
  #tab-right { grid-column: 2; grid-row: 2; align-self: start; }
  #tab-inventaire { grid-column: 1 / 3; grid-row: 3; }

  .dice-log-toggle { bottom: 16px; }
  .dice-log { bottom: 72px; }
}

@media (min-width: 1300px) {
  .page-sheet main {
    grid-template-columns: 270px 1fr 1fr;
    max-width: 1600px;
  }
  /* 3-col: left | center | right */
  #tab-left { grid-column: 1; grid-row: 1; align-self: start; }
  #tab-center { grid-column: 2; grid-row: 1; align-self: start; }
  #tab-right { grid-column: 3; grid-row: 1; align-self: start; }
  #tab-inventaire { grid-column: 1 / 4; grid-row: 2; }
}

/* Split inventaire into 2 columns on wide screens */
@media (min-width: 1300px) {
  #tab-inventaire {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
  }
  #tab-inventaire > .fold-panel { min-width: 0; }
}
