/* ═══════════════════════════════════════════════════════
   YANDESIGN — INTERFACE DEVIS
   Inspired by yandesign.fr — Retro minimal dark mode
   ═══════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  /* ── LIGHT THEME (défaut) ── */
  --bg: #e8e4d9;
  --bg-card: #ede9de;
  --bg-hover: #e0dccf;
  --border: #ccc7b8;
  --border-focus: #aaa59a;
  --text: #1a1a18;
  --text-muted: #8a8578;
  --text-dim: #5c5850;
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.10);
  --accent-glow: rgba(37, 99, 235, 0.22);
  --success: #16a34a;
  --success-dim: rgba(22, 163, 74, 0.10);
  --danger: #dc2626;
  --font-sans: 'Roboto Mono', 'Courier New', monospace;
  --font-heading: 'Roboto Mono', monospace;
  --radius: 3px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 56px;

  /* ── XP BAR COLORS ── */
  --xp-empty: #ccc7b8;
  --xp-low: #22c55e;
  --xp-mid: #3b82f6;
  --xp-high: #a855f7;
  --xp-max: #f59e0b;
}

/* ── RESET ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

ul,
ol {
  list-style: none;
}

/* ── SCANLINES ───────────────────────────────────────── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: repeating-linear-gradient(to bottom,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px);
  animation: scan-drift 8s linear infinite;
}

@keyframes scan-drift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 0 100px;
  }
}

/* ── HEADER ──────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(232, 228, 217, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text);
  transition: color var(--transition);
}

.logo:hover {
  color: var(--accent);
}

.logo svg {
  width: 24px;
  height: 24px;
}

.header-divider {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 300;
}

.header-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 2rem;
}

/* XP BAR */
.xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 220px;
}

.xp-bar-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--xp-low);
  transition: width .5s cubic-bezier(.4, 0, .2, 1), background .4s ease;
  box-shadow: 0 0 6px currentColor;
}

.xp-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text-dim);
  min-width: 52px;
  text-align: right;
}



.tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  background: transparent;
  transition: all var(--transition);
}

.accent-tag {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ── BTN CHAT TOGGLE ─────────────────────────────────── */
.btn-chat-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.15em;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
  position: relative;
}

.btn-chat-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.chat-icon svg {
  width: 14px;
  height: 14px;
}

.chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ── MAIN LAYOUT ─────────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  min-height: 100dvh;
  padding-top: var(--header-h);
}

/* ── LEFT: QUOTE SECTIONS ────────────────────────────── */
.quote-sections {
  padding: 3rem 2.5rem 4rem;
  border-right: 1px solid var(--border);
}

.section-header-intro {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.label-sm {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.intro-desc {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.7;
}

/* Quest section header (gaming) */
.quest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.quest-header:hover {
  background: var(--bg-hover);
}

.quest-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid var(--accent);
}

/* Items grid (cards) */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

/* ── SKILL CARDS ─────────────────────────────────────── */
.skill-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.skill-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.skill-card.card-equipped {
  border-color: var(--accent);
  background: rgba(37, 99, 235, .04);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(37, 99, 235, .1);
}

.skill-card.card-locked {
  opacity: .85;
}

/* Rarity bar (left border accent) */
.rarity-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 6px 0 0 6px;
}

/* Card top: equip toggle + rarity badge + delete */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .875rem .3rem 1rem;
  gap: .5rem;
}

.card-equip-label {
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Invisible native checkbox */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Custom equip button */
.equip-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  color: var(--text-muted);
  flex-shrink: 0;
}

.equip-btn svg {
  width: 11px;
  height: 11px;
}

.equip-btn.equipped {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 8px var(--accent-glow);
}

.equip-btn.locked {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: default;
}

.card-equip-label:hover .equip-btn:not(.equipped):not(.locked) {
  border-color: var(--accent);
  color: var(--accent);
}

/* Rarity badge */
.rarity-badge {
  flex: 1;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .15em;
  padding-left: .5rem;
}

/* Delete button on card */
.card-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
  flex-shrink: 0;
}

.card-delete svg {
  width: 10px;
  height: 10px;
}

.card-delete:hover {
  background: var(--danger-dim, rgba(220, 38, 38, .1));
  color: var(--danger);
}

/* Card body */
.card-body {
  padding: .5rem 1rem;
  flex: 1;
}

.item-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .04em;
  margin-bottom: .2rem;
}

.item-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem .75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  gap: .5rem;
}

.free-tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: .12em;
  background: var(--success-dim);
  padding: 2px 6px;
  border-radius: 2px;
}

/* Equip flash animation */
@keyframes equip-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, .5);
  }

  30% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, .2);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.skill-card.card-equip-flash {
  animation: equip-flash .6s ease-out;
}

/* Qty controls (reused) */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.qty-value {
  font-size: 10px;
  font-weight: 600;
  min-width: 22px;
  text-align: center;
  color: var(--text-dim);
}

.item-line-total {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
  white-space: nowrap;
}

.item-line-total.is-zero {
  color: var(--text-muted);
}

/* Item removing animation */
.item-removing {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity .28s ease, transform .28s ease;
}

/* Summary line dot (rarity) */
.summary-line-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}


.section-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-number {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  font-weight: 500;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text);
}

.section-subtotal {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
}

.section-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.quote-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.section-items {
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quote-section.collapsed .section-items {
  display: none;
}

/* Quote item row */
.quote-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), opacity 0.28s ease, transform 0.28s ease, max-height 0.3s ease;
}

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

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

.quote-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.quote-item.item-active {
  background: var(--accent-dim);
}

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
}

.toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 18px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: transform var(--transition), background var(--transition);
}

.toggle:checked {
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}

.toggle:checked::after {
  transform: translateX(14px);
  background: var(--accent);
}

.toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* Item info */
.item-info {
  min-width: 0;
}

.item-name {
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.item-desc {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.item-unit-price {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Qty controls */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.qty-btn {
  background: var(--bg-card);
  border: none;
  color: var(--text-dim);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 300;
  transition: all var(--transition);
  line-height: 1;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--accent);
  color: #fff;
}

.qty-value {
  width: 28px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 4px 0;
  background: var(--bg);
  line-height: 1.4;
}

/* Item price */
.item-price-col {
  text-align: right;
  flex-shrink: 0;
  min-width: 80px;
}

.item-line-total {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
}

.item-line-total.is-zero {
  color: var(--text-muted);
  font-weight: 400;
}

/* Delete button */
.btn-delete-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0;
  transition: all var(--transition);
}

.btn-delete-item svg {
  width: 10px;
  height: 10px;
}

.quote-item:hover .btn-delete-item {
  opacity: 1;
}

.btn-delete-item:hover {
  background: rgba(220, 38, 38, 0.10);
  border-color: var(--danger);
  color: var(--danger);
  transform: scale(1.1);
}

.btn-delete-item:active {
  transform: scale(0.95);
}

/* Removing animation */
.item-removing {
  opacity: 0 !important;
  transform: translateX(12px) !important;
  pointer-events: none;
}


/* ── RIGHT: SUMMARY ──────────────────────────────────── */
.quote-summary {
  padding: 3rem 0 4rem;
}

.summary-inner {
  padding: 0 1.75rem;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

h2.summary-title {
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 60px;
  margin-bottom: 1rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 11px;
  color: var(--text-dim);
  animation: fade-in-up 0.2s ease;
}

.summary-line-label {
  flex: 1;
  min-width: 0;
}

.summary-line-price {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  font-size: 11px;
}

.summary-empty {
  font-size: 11px;
  color: var(--text-muted);
  font-style: normal;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

.summary-totals {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  font-weight: 500;
}

.summary-value {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  transition: all var(--transition);
}

.total-row .summary-label {
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.15em;
}

.total-value {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--accent) !important;
  letter-spacing: -0.01em;
  transition: all 0.3s ease;
}

.total-value.pop {
  animation: value-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes value-pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

/* Meta */
.summary-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.meta-key {
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.meta-val {
  color: var(--text-dim);
  font-weight: 500;
}

/* Buttons */
.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  transition: all var(--transition);
}

.btn-primary svg {
  width: 14px;
  height: 14px;
}

.btn-primary:hover {
  background: #2563eb;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  width: 100%;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--text-dim);
  color: var(--text);
  background: var(--bg-hover);
}

.summary-disclaimer {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.05em;
  line-height: 1.5;
  margin-top: 0.5rem;
}

/* ── CHAT PANEL ──────────────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 360px;
  max-height: 520px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(237, 233, 222, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 24px 64px rgba(0, 0, 0, 0.15);
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  position: relative;
  flex-shrink: 0;
}

.avatar-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg);
  box-shadow: 0 0 6px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

.chat-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 1px;
}

.chat-status-text {
  font-size: 9px;
  color: var(--success);
  letter-spacing: 0.1em;
  font-weight: 500;
}

.btn-chat-close {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-chat-close svg {
  width: 12px;
  height: 12px;
}

.btn-chat-close:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: fade-in-up 0.2s ease;
  max-width: 85%;
}

.chat-message.from-user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message.from-agent {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble {
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.from-user .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 0;
}

.from-agent .msg-bubble {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 0;
}

.msg-time {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 2px;
  border-bottom-left-radius: 0;
  width: fit-content;
  animation: fade-in-up 0.2s ease;
}

.chat-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.chat-footer {
  padding: 0.75rem 1.25rem 0.875rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn-send {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-send svg {
  width: 14px;
  height: 14px;
}

.btn-send:hover {
  background: #2563eb;
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-send:active {
  transform: scale(0.95);
}

.chat-hint {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: 0.05em;
}

.chat-hint kbd {
  font-size: 8px;
  background: var(--border);
  color: var(--text-dim);
  padding: 1px 4px;
  border-radius: 1px;
  font-family: inherit;
}

/* ── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 10px 20px;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s ease;
  z-index: 9999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .quote-sections {
    border-right: none;
    padding: 2rem 1.25rem 3rem;
  }

  .quote-summary {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
  }

  .summary-inner {
    position: relative;
    top: 0;
    padding: 0 1.25rem;
  }

  .chat-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 1rem;
    max-height: 60dvh;
  }

  .header {
    padding: 0 1.25rem;
  }
}

@media (max-width: 600px) {
  .header-title {
    display: none;
  }

  .header-divider {
    display: none;
  }

  .quote-item {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 0.5rem;
  }

  .item-price-col {
    grid-column: 2;
    text-align: left;
  }

  .qty-controls {
    grid-column: 2;
    width: fit-content;
  }

  .btn-delete-item {
    grid-column: 3;
    grid-row: 1 / 3;
    opacity: 1;
  }
}

/* ── UTILITY ─────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── ÉCRAN DE SUCCÈS ─────────────────────────────────── */
#success-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in .3s ease;
}

@keyframes fade-in {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.success-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .15);
  animation: modal-up .35s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes modal-up {
  from {
    transform: scale(.95) translateY(12px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.success-icon svg {
  width: 52px;
  height: 52px;
  color: var(--success);
  margin-bottom: .5rem;
}

.success-card h2 {
  font-size: 20px;
  font-weight: 300;
  color: var(--text);
}

.success-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 320px;
}

.success-ref,
.success-amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: .6rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
}

.success-ref span,
.success-amount span {
  color: var(--text-muted);
  letter-spacing: .1em;
}

.success-ref strong {
  color: var(--text);
  font-weight: 600;
}

.success-amount strong {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.success-btn {
  margin-top: .5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .15em;
  font-family: var(--font-sans);
  padding: 8px 20px;
  cursor: pointer;
  transition: all var(--transition);
}

.success-btn:hover {
  border-color: var(--border-focus);
  color: var(--text);
}

/* ── MODALE CONFIRMATION ─────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in .2s ease;
}

.confirm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .12);
  animation: modal-up .25s cubic-bezier(.34, 1.56, .64, 1);
  overflow: hidden;
}

.confirm-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.confirm-body {
  padding: 1.25rem 1.5rem;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.7;
}

.confirm-body strong {
  color: var(--accent);
  font-weight: 700;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.confirm-cancel {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: .12em;
  font-family: var(--font-sans);
  padding: 7px 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.confirm-cancel:hover {
  border-color: var(--border-focus);
  color: var(--text);
}

.confirm-ok {
  background: var(--success);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  font-family: var(--font-sans);
  padding: 8px 18px;
  cursor: pointer;
  transition: all var(--transition);
}

.confirm-ok:hover {
  background: #15803d;
  box-shadow: 0 0 12px rgba(22, 163, 74, .3);
}


/* ════════════════════════════════════════════════════════
   @MEDIA PRINT — Export PDF
   ════════════════════════════════════════════════════════ */
@media print {

  /* ── Reset ─────────────────────────────────────────── */
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    animation: none !important;
    transition: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ── Éléments à masquer ────────────────────────────── */
  .scanlines,
  .header,
  .chat-panel,
  .toast,
  .btn-chat-toggle,
  .card-delete,
  .card-top,
  /* equip button, rarity badge */
  .rarity-bar,
  .card-footer .qty-controls,
  .summary-actions,
  .summary-disclaimer,
  .intro-desc,
  #validated-banner,
  .section-chevron {
    display: none !important;
  }

  /* ── Page ───────────────────────────────────────────── */
  @page {
    size: A4 portrait;
    margin: 20mm 18mm 22mm 18mm;
  }

  html,
  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-size: 10pt;
    margin: 0;
    padding: 0;
  }

  /* ── Layout ─────────────────────────────────────────── */
  .main-layout {
    display: block !important;
    padding-top: 0 !important;
  }

  .quote-sections {
    border-right: none !important;
    padding: 0 !important;
  }

  .quote-summary {
    border-top: 2px solid #111 !important;
    padding: 1.25rem 0 0 !important;
  }

  /* ── En-tête PDF ────────────────────────────────────── */
  .section-header-intro {
    border-bottom: 2px solid #111 !important;
    margin-bottom: 1.5rem !important;
    padding-bottom: 1rem !important;
    page-break-inside: avoid;
  }

  .section-header-intro::before {
    content: 'DEVIS — YANDESIGN';
    display: block;
    font-size: 7.5pt;
    letter-spacing: 0.35em;
    color: #888;
    margin-bottom: 0.5rem;
  }

  .label-sm {
    display: none !important;
    /* cache "// PHASE 01 — SKILL SELECTION" */
  }

  h1 {
    font-size: 20pt !important;
    font-weight: 300 !important;
    color: #111 !important;
    letter-spacing: -0.01em !important;
    margin-bottom: 0 !important;
    /* Remplace "SELECT YOUR LOADOUT" : le titre H1 est conservé tel quel,
       mais son contenu sera lisible car sobre */
  }

  /* ── Masquer le titre gaming, afficher un titre sobre ── */
  /* On remplace le texte via CSS content si possible,
     mais on le laisse passer — le reste du doc es sobre. */

  /* ── Section de catalogue ───────────────────────────── */
  .quote-section {
    border: none !important;
    border-top: 1px solid #e0e0e0 !important;
    margin-bottom: 0 !important;
    page-break-inside: avoid;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  /* Section header = titre de section sobre */
  .quest-header {
    background: #f7f7f7 !important;
    padding: 0.5rem 0.75rem !important;
    border-bottom: 1px solid #e0e0e0 !important;
    cursor: default !important;
  }

  /* Cache le badge "QUEST 01" */
  .quest-badge {
    display: none !important;
  }

  .section-title {
    font-size: 9pt !important;
    font-weight: 600 !important;
    color: #111 !important;
    letter-spacing: 0.12em !important;
  }

  .section-subtotal {
    font-size: 9pt !important;
    color: #444 !important;
    font-weight: 600 !important;
  }

  /* Toujours afficher les items même si section collapsed */
  .quote-section.collapsed .items-grid {
    display: grid !important;
  }

  /* ── Skill cards → lignes de tableau ───────────────── */
  .items-grid {
    display: block !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .skill-card {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    gap: 0 !important;
    border: none !important;
    border-bottom: 1px solid #eeeeee !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0.5rem 0.75rem !important;
    page-break-inside: avoid;
    transform: none !important;
    overflow: visible !important;
  }

  /* Cache les cartes non équipées (non actives) à l'impression */
  .skill-card:not(.card-equipped) {
    display: none !important;
  }

  /* Sauf items FREE (locked, inclus) */
  .skill-card.card-locked {
    display: grid !important;
  }

  .card-body {
    padding: 0 !important;
    grid-column: 1;
    grid-row: 1;
  }

  .item-name {
    font-size: 9pt !important;
    font-weight: 600 !important;
    color: #111 !important;
    margin-bottom: 1px !important;
  }

  .item-desc {
    font-size: 7pt !important;
    color: #777 !important;
    line-height: 1.4 !important;
  }

  .card-footer {
    padding: 0 !important;
    border-top: none !important;
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .item-line-total {
    font-size: 9pt !important;
    font-weight: 600 !important;
    color: #111 !important;
    text-align: right !important;
    white-space: nowrap !important;
  }

  .item-line-total.is-zero {
    display: none !important;
  }

  .qty-value {
    font-size: 8pt !important;
    color: #555 !important;
    min-width: auto !important;
  }

  .free-tag {
    font-size: 7pt !important;
    color: #16a34a !important;
    background: none !important;
    padding: 0 !important;
  }

  /* ── Récapitulatif ──────────────────────────────────── */
  .summary-inner {
    position: static !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
    align-items: start !important;
  }

  .label-sm+h2.summary-title,
  h2.summary-title {
    font-size: 10pt !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    color: #111 !important;
    margin-bottom: 0.6rem !important;
    grid-column: 1 / -1 !important;
  }

  .summary-list {
    grid-column: 1 !important;
    min-height: auto !important;
  }

  .summary-line {
    font-size: 8pt !important;
    color: #444 !important;
    gap: 0.5rem !important;
  }

  /* Cache le dot rarity à l'impression */
  .summary-line-dot {
    display: none !important;
  }

  .summary-line-label {
    color: #555 !important;
  }

  .summary-line-price {
    color: #111 !important;
    font-weight: 600 !important;
  }

  .summary-empty {
    display: none !important;
  }

  .summary-divider {
    border-top: 1px solid #ddd !important;
    margin: 0.6rem 0 !important;
    grid-column: 1 / -1 !important;
  }

  .summary-totals {
    grid-column: 2 !important;
    border: 1px solid #ddd !important;
    padding: 0.75rem !important;
    background: #fafafa !important;
  }

  .summary-label {
    font-size: 8pt !important;
    color: #666 !important;
  }

  .summary-value {
    font-size: 9pt !important;
    color: #111 !important;
  }

  /* Cache les labels gaming ("CRÉDITS HT", "TAXE", "TOTAL MISSION") */
  /* On les laisse — ils restent lisibles même en français technique */

  .total-row .summary-label {
    font-size: 9pt !important;
    font-weight: 600 !important;
    color: #111 !important;
  }

  .total-value {
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #111 !important;
  }

  .summary-meta {
    grid-column: 1 / -1 !important;
    border-top: 1px solid #eee !important;
    padding-top: 0.75rem !important;
    margin-top: 0.5rem !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 2rem !important;
  }

  .meta-key {
    color: #999 !important;
  }

  .meta-val {
    color: #333 !important;
  }

  /* ── Pied de page ───────────────────────────────────── */
  body::after {
    content: 'Devis non contractuel — Yandesign © 2026 — yandesign.fr';
    display: block;
    margin-top: 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    font-size: 7pt;
    color: #aaa;
    text-align: center;
    letter-spacing: 0.1em;
  }
}