/* ============================================================
   Tickets Festival Le Labo M — Bourse aux tickets
   Design system sur-mesure — éditorial associatif moderne
   ============================================================ */

:root {
  /* Palette */
  --cream:      #fafaf7;
  --paper:      #f3f1ea;
  --white:      #ffffff;
  --ink:        #1c1c1c;
  --ink-soft:   #2c2a27;
  --terra:      #c14a2b;
  --terra-dark: #a23c22;
  --terra-tint: #f7e9e3;
  --sage:       #3d6b58;
  --sage-dark:  #2f5446;
  --sage-tint:  #e7efe9;
  --line:       #e8e6df;
  --line-soft:  #efede6;
  --muted:      #6b6b6b;
  --muted-soft: #8c8a83;

  /* Badge tones */
  --b-green-bg:#e3f0e4; --b-green-fg:#1f5b34;
  --b-orange-bg:#fbeccd; --b-orange-fg:#8a5510;
  --b-red-bg:#f8e3df; --b-red-fg:#9a3417;
  --b-gray-bg:#eceae3; --b-gray-fg:#4a4843;
  --b-sage-bg:#e3efe7; --b-sage-fg:#2f5446;
  --b-blue-bg:#e2ebf0; --b-blue-fg:#2b5878;

  /* Type */
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Radius / shadow */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(28,28,28,.04), 0 6px 18px -10px rgba(28,28,28,.14);
  --shadow-lg: 0 12px 40px -12px rgba(28,28,28,.28);

  --maxw: 760px;
  --maxw-wide: 1080px;
  --header-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[x-cloak] { display: none !important; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--terra); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 540; line-height: 1.12; margin: 0; color: var(--ink); letter-spacing: -.01em; }
p { margin: 0; }
::selection { background: var(--terra); color: var(--cream); }

/* ---------- Layout shell ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
main { flex: 1 0 auto; padding: 28px 0 64px; }
.view { animation: viewIn .32s cubic-bezier(.2,.7,.3,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce){ .view{ animation:none; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250,250,247,.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-bar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  max-width: var(--maxw-wide); margin: 0 auto; padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--terra); display: grid; place-items: center; color: var(--cream);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { font-family: var(--serif); font-weight: 560; font-size: 16px; color: var(--ink); line-height: 1.05; letter-spacing: -.01em; }
.brand-name small { display: block; font-family: var(--sans); font-weight: 500; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--terra); }

.nav-desktop { display: none; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  padding: 8px 13px; border-radius: 999px; position: relative; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--paper); text-decoration: none; }
.nav-link.active { color: var(--terra); }
.nav-link .pip {
  position: absolute; top: 3px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--terra); color: var(--cream);
  font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1;
}

.header-actions { display: flex; align-items: center; gap: 9px; }

/* Lang switch */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--white); }
.lang-switch button {
  border: 0; background: transparent; padding: 5px 11px; font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: .03em; transition: background .15s, color .15s;
}
.lang-switch button.on { background: var(--ink); color: var(--cream); }

/* Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: var(--sage); color: var(--cream);
  font-family: var(--serif); font-weight: 600; font-size: 16px;
  display: grid; place-items: center; flex: none;
}
.avatar.ghost { background: var(--white); border: 1px solid var(--line); color: var(--muted); }
.avatar-wrap { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 70;
}
.menu-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.menu-pop .who b { display: block; font-family: var(--serif); font-size: 15px; }
.menu-pop .who span { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 9px 10px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--ink); transition: background .12s;
}
.menu-item:hover { background: var(--paper); }
.menu-item.danger { color: var(--terra); }
.menu-item svg { width: 17px; height: 17px; flex: none; opacity: .8; }

/* Burger */
.burger { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--white); }
.burger svg { width: 19px; height: 19px; }
.nav-mobile {
  border-top: 1px solid var(--line); background: var(--cream);
  max-width: var(--maxw-wide); margin: 0 auto; padding: 8px 12px 14px;
}
.nav-mobile .nav-link { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--r-sm); font-size: 15.5px; }
.nav-mobile .nav-link.active { background: var(--terra-tint); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 560; line-height: 1;
  padding: 13px 22px; border-radius: var(--r-sm); border: 1.5px solid transparent;
  transition: background .16s, color .16s, border-color .16s, transform .06s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--terra); color: var(--cream); }
.btn-primary:hover { background: var(--terra-dark); }
.btn-secondary { background: var(--white); border-color: var(--terra); color: var(--terra); }
.btn-secondary:hover { background: var(--terra-tint); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--paper); }
.btn-danger { background: var(--white); border-color: #d9b3a8; color: var(--terra-dark); }
.btn-danger:hover { background: #f8e3df; }
.btn-sage { background: var(--sage); color: var(--cream); }
.btn-sage:hover { background: var(--sage-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 15px; font-size: 13.5px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-link { background: none; border: 0; color: var(--terra); padding: 4px 0; font-weight: 560; font-size: 14px; }
.btn-link:hover { text-decoration: underline; }

/* CTA stack — column on mobile, row on larger */
.cta-stack { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 720px){ .cta-stack.row-md { flex-direction: row; } .cta-stack.row-md .btn { flex: 1; } }

/* ---------- Page intro / sections ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--terra); }
.eyebrow.sage { color: var(--sage); }
.page-title { font-size: clamp(30px, 7vw, 44px); margin: 10px 0 0; font-optical-sizing: auto; }
.lede { color: var(--muted); font-size: 16.5px; margin-top: 14px; max-width: 56ch; }
.lede strong { color: var(--ink-soft); font-weight: 600; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title { font-size: 22px; }
.section-count { font-size: 13px; color: var(--muted); font-weight: 500; }
.hr { height: 1px; background: var(--line); border: 0; margin: 40px 0; }

/* Prose info blocks */
.prose { color: var(--ink-soft); font-size: 15.5px; }
.prose p + p { margin-top: 12px; }
.note-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.note-card h3 { font-size: 17px; margin-bottom: 10px; }
.note-card ul { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 15px; }
.note-card li { margin: 6px 0; }
.note-soft { background: var(--paper); border-radius: var(--r); padding: 14px 16px; font-size: 13.5px; color: var(--muted); border: 1px solid var(--line-soft); }
.note-soft strong { color: var(--ink-soft); }

/* Steps list */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 13px; font-size: 15px; color: var(--ink-soft); }
.steps li::before {
  content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--terra-tint); color: var(--terra); font-weight: 700; font-size: 13px;
  display: grid; place-items: center; font-family: var(--mono);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden; margin-top: 24px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  aspect-ratio: 16/8; background: var(--clay, #a23c22);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px; background: linear-gradient(transparent 35%, rgba(40,18,12,.62));
}
.hero-overlay .eyebrow { color: #f3d9a0; }
.hero-overlay h2 { color: var(--cream); font-size: clamp(20px, 4.5vw, 30px); margin-top: 6px; max-width: 20ch; }

/* ---------- Cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }

/* Ticket row card (Mes tickets) */
.ticket-card {
  display: flex; align-items: center; gap: 15px; width: 100%; text-align: left;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; box-shadow: var(--shadow); transition: border-color .15s, transform .08s, box-shadow .15s;
}
button.ticket-card:hover { border-color: #d9d6cc; box-shadow: 0 4px 20px -10px rgba(28,28,28,.22); }
.ticket-card .thumb { width: 60px; height: 60px; border-radius: 50%; flex: none; object-fit: cover; border: 1px solid var(--line); }
.ticket-card .tc-body { min-width: 0; flex: 1; }
.tc-num { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.tc-title { font-family: var(--serif); font-size: 16.5px; font-weight: 540; margin: 1px 0 3px; line-height: 1.18; }
.tc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-price { font-weight: 600; font-size: 14px; }
.tc-fest { font-size: 12.5px; color: var(--muted); }
.tc-chevron { color: var(--muted-soft); flex: none; }
.tc-chevron svg { width: 20px; height: 20px; }
.ticket-card.muted { background: var(--paper); opacity: .92; }
.ticket-card.muted .thumb { filter: grayscale(.7); opacity: .8; }

/* dim / kebab actions */
.tc-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.kebab { width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--muted); }
.kebab:hover { background: var(--paper); border-color: var(--line); }
.kebab svg { width: 18px; height: 18px; }

/* Bourse card grid */
.bourse-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px){ .bourse-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px){ .bourse-grid { grid-template-columns: 1fr 1fr 1fr; } }
.bourse-card { display: flex; flex-direction: column; padding: 20px; text-align: center; position: relative; }
.bourse-card .b-thumb { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 4px auto 14px; border: 1px solid var(--line); }
.bourse-card .b-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sage); line-height: 1.5; }
.bourse-card .b-title { font-family: var(--serif); font-size: 18px; font-weight: 540; margin: 8px 0; line-height: 1.18; }
.bourse-card .b-art { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bourse-card .b-msg { font-size: 14px; color: var(--ink-soft); margin: 10px 0 16px; text-align: left; background: var(--paper); border-radius: var(--r-sm); padding: 11px 13px; line-height: 1.5; }
.bourse-card .b-msg .q { color: var(--muted); font-style: italic; }
.bourse-card .btn { margin-top: auto; }
.demand-pill {
  position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 5px;
  background: var(--sage-tint); color: var(--sage-dark); font-size: 11.5px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px;
}
.demand-pill svg { width: 12px; height: 12px; }
.demand-pill.zero { background: var(--paper); color: var(--muted); }

/* Request card (demandes) */
.req-group { margin-bottom: 26px; }
.req-group .req-ticket { font-size: 13px; color: var(--muted); margin-bottom: 10px; font-weight: 500; }
.req-group .req-ticket b { color: var(--ink-soft); }
.req-card { padding: 20px; }
.req-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; }
.req-icon svg { width: 26px; height: 26px; }
.req-icon.wait { background: var(--b-orange-bg); color: var(--b-orange-fg); }
.req-icon.ok { background: var(--b-green-bg); color: var(--b-green-fg); }
.req-icon.no { background: var(--b-red-bg); color: var(--b-red-fg); }
.req-icon.done { background: var(--b-sage-bg); color: var(--b-sage-fg); }
.req-eyebrow { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); }
.req-status { text-align: center; font-weight: 600; font-size: 15.5px; margin: 8px 0 12px; }
.req-coords { background: var(--sage-tint); border-radius: var(--r-sm); padding: 11px 14px; font-size: 13.5px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 3px; }
.req-coords .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sage-dark); font-weight: 700; }
.req-coords a { word-break: break-all; }
.req-body { background: var(--paper); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; color: var(--ink-soft); white-space: pre-line; line-height: 1.55; }
.req-sign { text-align: right; font-style: italic; color: var(--muted); font-size: 13px; margin-top: 6px; }
.req-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
@media (min-width: 480px){ .req-actions.two { flex-direction: row; } .req-actions.two .btn { flex: 1; } }

/* Segmented tabs */
.segmented { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.segmented button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 560; color: var(--muted); transition: background .15s, color .15s; display: inline-flex; align-items: center; gap: 7px; }
.segmented button.on { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.segmented .seg-count { background: var(--terra); color: var(--cream); font-size: 10.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
.segmented button:not(.on) .seg-count { background: var(--line); color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; line-height: 1.5; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge.green { background: var(--b-green-bg); color: var(--b-green-fg); }
.badge.orange { background: var(--b-orange-bg); color: var(--b-orange-fg); }
.badge.red { background: var(--b-red-bg); color: var(--b-red-fg); }
.badge.gray { background: var(--b-gray-bg); color: var(--b-gray-fg); }
.badge.sage { background: var(--b-sage-bg); color: var(--b-sage-fg); }
.badge.blue { background: var(--b-blue-bg); color: var(--b-blue-fg); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.field label { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.field .req-mark { font-size: 11.5px; color: var(--terra); font-weight: 600; letter-spacing: .02em; }
.field .opt-mark { font-size: 11.5px; color: var(--muted); }
.field .hint { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=search], textarea, select {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-tint); }
input::placeholder, textarea::placeholder { color: var(--muted-soft); }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.field.invalid input, .field.invalid textarea { border-color: var(--terra); }
.field .err { font-size: 13px; color: var(--terra-dark); margin-top: 5px; font-weight: 500; }

/* PIN input */
.pin-input { font-family: var(--mono); font-size: 26px; letter-spacing: .5em; text-align: center; padding-left: .5em; }

/* search + filter bar */
.toolbar { display: flex; gap: 10px; margin: 22px 0 4px; }
.search-wrap { position: relative; flex: 1; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-soft); pointer-events: none; }
.search-wrap input { padding-left: 40px; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--ink-soft); transition: all .14s; }
.chip:hover { border-color: #d9d6cc; }
.chip.on { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* Toggle switch */
.toggle-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--white); }
.toggle-row.armed { border-color: var(--sage); background: var(--sage-tint); }
.toggle-row .tr-text { flex: 1; font-size: 14px; color: var(--ink-soft); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .18s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + .track { background: var(--sage); }
.switch input:checked + .track + .knob { transform: translateX(20px); }

/* ---------- Modal / Sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(28,24,20,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal { background: var(--cream); border-radius: var(--r-lg); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .26s cubic-bezier(.2,.7,.3,1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--cream); position: sticky; top: 0; }
.modal-bar h3 { font-size: 17px; flex: 1; min-width: 0; }
.modal-bar .icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper); display: grid; place-items: center; color: var(--ink); flex: none; }
.modal-bar .icon-btn:hover { background: var(--line); }
.modal-bar .icon-btn svg { width: 19px; height: 19px; }
.modal-bar .bar-act { font-size: 14.5px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--line); background: var(--cream); }

/* Full-screen form header (mobile form views) */
.form-topbar { display: flex; align-items: center; gap: 12px; background: var(--terra); color: var(--cream); margin: -28px -20px 24px; padding: 0 16px; height: 56px; border-radius: 0; }
.form-topbar h2 { color: var(--cream); font-size: 17px; flex: 1; text-align: center; font-family: var(--sans); font-weight: 600; }
.form-topbar button { border: 0; background: transparent; color: var(--cream); font-size: 14.5px; font-weight: 600; padding: 8px; }
.form-topbar .icon-btn { display: grid; place-items: center; width: 38px; }
.form-topbar svg { width: 20px; height: 20px; }
.form-topbar button:disabled { opacity: .5; }

/* detail definition table */
.deftable { width: 100%; border-collapse: collapse; }
.deftable td { padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; vertical-align: top; }
.deftable tr:last-child td { border-bottom: 0; }
.deftable td.lbl { color: var(--muted); width: 45%; padding-right: 16px; }
.deftable td.val { color: var(--ink); font-weight: 500; text-align: right; word-break: break-word; }
.detail-head { display: flex; gap: 16px; margin-bottom: 8px; }
.detail-head img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.detail-head .dh-num { font-family: var(--mono); font-size: 12px; color: var(--sage); font-weight: 600; }
.detail-head .dh-title { font-family: var(--serif); font-size: 19px; margin: 3px 0; }
.detail-head .dh-price { font-weight: 600; }
.detail-section-title { font-family: var(--serif); font-size: 16px; margin: 22px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.detail-section-title:first-of-type { border-top: 0; }
.privacy-note { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--sage-dark); background: var(--sage-tint); padding: 11px 13px; border-radius: var(--r-sm); margin-top: 16px; }
.privacy-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; z-index: 200; padding: 0 16px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 11px; background: var(--ink); color: var(--cream);
  padding: 13px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); font-size: 14.5px; font-weight: 500;
  max-width: 440px; pointer-events: auto; animation: toastIn .3s cubic-bezier(.2,.8,.3,1);
}
.toast.success { background: var(--sage-dark); }
.toast.error { background: var(--terra-dark); }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 48px 24px; background: var(--white); border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty .emoji-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--terra-tint); color: var(--terra); display: grid; place-items: center; margin: 0 auto 18px; }
.empty .emoji-mark svg { width: 30px; height: 30px; }
.empty h3 { font-size: 21px; margin-bottom: 8px; }
.empty p { color: var(--muted); font-size: 15px; max-width: 42ch; margin: 0 auto 20px; }

/* ---------- Skeleton ---------- */
.skel { background: linear-gradient(100deg, var(--line-soft) 30%, var(--paper) 50%, var(--line-soft) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-card { padding: 14px; display: flex; gap: 15px; align-items: center; }
.skel-circle { width: 60px; height: 60px; border-radius: 50%; flex: none; }
.skel-line { height: 12px; }

/* Network error retry */
.neterr { text-align: center; padding: 40px 20px; }
.neterr .emoji-mark { background: var(--b-red-bg); color: var(--b-red-fg); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; margin-top: 40px; background: var(--cream); }
.site-footer .container { text-align: center; }
.site-footer p { font-size: 13px; color: var(--muted); }
.site-footer p + p { margin-top: 7px; }
.site-footer .signature { font-size: 11px; opacity: .5; transition: opacity .2s; }
.site-footer .signature:hover { opacity: 1; }
.site-footer .lang-note { font-size: 11px; color: var(--muted-soft); margin-top: 12px; font-style: italic; }

/* ---------- Helpers ---------- */
.mono { font-family: var(--mono); }
.center { text-align: center; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.muted { color: var(--muted); }
.hide { display: none !important; }

/* ---------- Bourse: clarity additions ---------- */
/* Collapsible "how it works" */
details.howto { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-top: 22px; overflow: hidden; }
details.howto > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 15px 18px; font-family: var(--serif); font-size: 17px; color: var(--ink); }
details.howto > summary::-webkit-details-marker { display: none; }
details.howto > summary .chev { margin-left: auto; transition: transform .2s; color: var(--muted); display: inline-flex; }
details.howto[open] > summary .chev { transform: rotate(180deg); }
details.howto > summary .htico { width: 30px; height: 30px; border-radius: 50%; background: var(--terra-tint); color: var(--terra); display: grid; place-items: center; flex: none; }
details.howto > summary .htico svg { width: 17px; height: 17px; }
details.howto .howto-body { padding: 0 18px 18px; }

/* Bourse grouping */
.bourse-group { margin-top: 30px; }
.bourse-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.bourse-group-head h3 { font-size: 19px; flex: 1; min-width: 0; }
.bourse-group-head .gcount { font-size: 12px; font-weight: 700; color: var(--sage-dark); background: var(--sage-tint); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

/* Card: availability + recency + prominent price */
.b-avail { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--sage-dark); }
.b-avail .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px var(--sage-tint); }
.b-recency { position: absolute; top: 14px; right: 14px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.b-by { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.b-price { font-family: var(--serif); font-size: 26px; font-weight: 560; color: var(--terra); margin: 6px 0 2px; line-height: 1; }
.b-price .unit { font-size: 17px; }
.b-price-note { font-size: 11px; color: var(--muted-soft); margin-bottom: 8px; }
.b-pricenote { font-size: 11.5px; font-weight: 600; margin: 2px 0 8px; }
.b-pricenote.face { color: var(--sage-dark); }
.b-pricenote.below { color: var(--muted); font-weight: 500; }
.b-hot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--b-orange-fg); background: var(--b-orange-bg); padding: 3px 9px; border-radius: 999px; margin: 0 auto 10px; }
.b-hot svg { width: 12px; height: 12px; }
.bourse-group-head .ghint { font-size: 12px; color: var(--muted); font-weight: 500; font-style: italic; }
@media (max-width: 560px){ .bourse-group-head { flex-wrap: wrap; } .bourse-group-head .ghint { flex-basis: 100%; } }

/* Eligible ticket card actions */
.ticket-actions { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.ticket-actions .btn { flex: 1; }
@media (max-width: 380px){ .ticket-actions { flex-direction: column; } }

/* On-sale (seller) card */
.onsale-stat { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; }
.onsale-stat .pill-n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--terra); color: var(--cream); font-weight: 700; font-size: 12px; }
.onsale-stat .pill-n.zero { background: var(--paper); color: var(--muted); }

/* ---------- Responsive ---------- */
@media (min-width: 1024px){
  .nav-desktop { display: flex; }
  .burger { display: none; }
  main { padding-top: 36px; }
  .container.wide { max-width: var(--maxw-wide); }
}
@media (max-width: 1023px){
  .nav-desktop { display: none; }
}
@media (max-width: 400px){
  .container { padding: 0 16px; }
  .header-bar { padding: 0 14px; gap: 10px; }
  .brand-name { font-size: 14.5px; }
  .form-topbar { margin-left: -16px; margin-right: -16px; }
}
