@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Lilita+One&display=swap');

/* ── Jetons : tirés du logo TimeToEat ─────────────────────────────────────── */
:root {
  --grape:   #5B18B0;   /* fond */
  --grape-2: #6522BE;   /* rayons du fond */
  --plum:    #2A0D42;   /* contours, encre */
  --plum-2:  #3B1259;   /* panneaux */
  --plum-3:  #4C1A73;   /* panneaux survolés, champs */
  --bun:     #FFC22E;   /* actions */
  --cap:     #F2553D;   /* en attente, erreurs */
  --cream:   #F7EBCD;   /* texte sur violet */
  --paper:   #FFF6DF;   /* tickets */
  --lettuce: #6BCB3D;   /* livrée */
  --muted:   #CDB6EA;   /* texte secondaire */
  --ink-soft: #6B4E86;  /* texte secondaire sur papier */

  --emoji:   'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif, var(--emoji);
  --body:    'Fredoka', 'Trebuchet MS', system-ui, sans-serif, var(--emoji);

  --stroke: 3px;
  --hard:   4px 5px 0 var(--plum);
}

*, *::before, *::after { box-sizing: border-box; }

/* Les règles display des composants (.btn, .panel…) écrasent sinon l'attribut hidden */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 17px/1.5 var(--body);
  color: var(--cream);
  background-color: var(--grape);
  background-image: repeating-conic-gradient(from -3deg at 50% -8%, var(--grape) 0deg 7deg, var(--grape-2) 7deg 14deg);
}

img { max-width: 100%; display: block; }
a { color: var(--bun); text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--bun); outline-offset: 3px; border-radius: 6px; }

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

/* ── Titres façon lettrage du logo ────────────────────────────────────────── */
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.02;
  color: var(--cream);
  -webkit-text-stroke: 7px var(--plum);
  paint-order: stroke fill;
  text-shadow: 4px 5px 0 var(--plum);
  margin: 0;
}
h1.display { font-size: clamp(40px, 7.4vw, 76px); }
h2.display { font-size: clamp(30px, 4.4vw, 42px); -webkit-text-stroke-width: 6px; }
h3 { font: 600 21px/1.25 var(--body); margin: 0; }

.lead { font-size: 20px; line-height: 1.45; color: var(--cream); max-width: 34ch; margin: 0; }
.muted { color: var(--muted); }

/* ── Structure ────────────────────────────────────────────────────────────── */
.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }
main.wrap { padding: 24px 0 72px; }

.site-header { padding: 16px 0; }
.site-header .wrap { display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--cream); margin-right: auto; }
.brand img {
  width: 58px; height: 58px; border-radius: 50%;
  border: var(--stroke) solid var(--cream); box-shadow: var(--hard);
}
.brand span { font-family: var(--display); font-size: 26px; -webkit-text-stroke: 5px var(--plum); paint-order: stroke fill; }

.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: var(--cream); text-decoration: none; font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--plum-2); }
.nav a[aria-current="page"] { background: var(--plum); color: var(--bun); }

.user-chip { display: flex; align-items: center; gap: 8px; }
.user-chip img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--cream); }
.user-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.user-chip button:hover { color: var(--cream); }

@media (max-width: 720px) {
  .brand span { display: none; }
  .site-header .wrap { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; }
}

/* ── Boutons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 18px/1 var(--body);
  padding: 15px 26px;
  border-radius: 999px;
  border: var(--stroke) solid var(--plum);
  background: var(--bun);
  color: var(--plum);
  text-decoration: none;
  box-shadow: 0 5px 0 var(--plum);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s;
}
.btn:hover { background: #FFCD52; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--plum); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: default; transform: none; box-shadow: 0 5px 0 var(--plum); }
.btn--quiet { background: var(--plum-2); color: var(--cream); }
.btn--quiet:hover { background: var(--plum-3); }
.btn--small { font-size: 15px; padding: 10px 18px; box-shadow: 0 4px 0 var(--plum); }
.btn svg { width: 22px; height: 22px; flex: none; }

/* ── Panneaux et champs ───────────────────────────────────────────────────── */
.panel {
  background: var(--plum-2);
  border: var(--stroke) solid var(--plum);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--hard);
}

.field { display: grid; gap: 7px; }
.field label { font-weight: 500; }
.field .hint { font-size: 14px; color: var(--muted); }
.input, .textarea {
  width: 100%;
  background: var(--plum);
  border: 2px solid #5A2B85;
  border-radius: 14px;
  padding: 13px 15px;
  color: var(--cream);
}
.input::placeholder, .textarea::placeholder { color: #9B82B8; }
.input:focus, .textarea:focus { outline: none; border-color: var(--bun); }
.textarea { resize: vertical; min-height: 88px; }
.input--big { font-size: 18px; padding: 16px 18px; }
.row { display: grid; grid-template-columns: 1fr 140px; gap: 14px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

.form { display: grid; gap: 18px; }
.form-error {
  background: var(--cap); color: var(--plum); font-weight: 500;
  border: var(--stroke) solid var(--plum); border-radius: 14px; padding: 12px 16px;
}

/* ── Accueil ──────────────────────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 32px;
  padding: 24px 0 56px;
}
.hero-copy { display: grid; gap: 26px; justify-items: start; }
.hero-logo {
  width: min(420px, 100%); aspect-ratio: 1; justify-self: center;
  border-radius: 50%; border: 6px solid var(--cream); box-shadow: 10px 12px 0 var(--plum);
  transform: rotate(-4deg);
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-logo { width: 240px; order: -1; }
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; }
.steps li::before {
  content: counter(step);
  font-family: var(--display); font-size: 30px; line-height: 1;
  width: 54px; height: 54px; display: grid; place-items: center;
  background: var(--bun); color: var(--plum);
  border: var(--stroke) solid var(--plum); border-radius: 50%; box-shadow: 3px 4px 0 var(--plum);
}
.steps p { margin: 0; color: var(--muted); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.section { margin-top: 48px; display: grid; gap: 22px; }

/* ── Ticket (l'élément signature) ─────────────────────────────────────────── */
.ticket-shadow { filter: drop-shadow(5px 6px 0 var(--plum)); }
.ticket {
  --tear: 92px;
  position: relative;
  background: var(--paper);
  color: var(--plum);
  border-radius: 18px;
  -webkit-mask:
    radial-gradient(circle 14px at 0 var(--tear), #0000 13.5px, #000 14px) left / 51% 100% no-repeat,
    radial-gradient(circle 14px at 100% var(--tear), #0000 13.5px, #000 14px) right / 51% 100% no-repeat;
          mask:
    radial-gradient(circle 14px at 0 var(--tear), #0000 13.5px, #000 14px) left / 51% 100% no-repeat,
    radial-gradient(circle 14px at 100% var(--tear), #0000 13.5px, #000 14px) right / 51% 100% no-repeat;
}
.ticket-head {
  height: var(--tear);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  border-bottom: 3px dashed #D9C79E;
}
.ticket-head img {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: none;
  border: var(--stroke) solid var(--plum); background: var(--bun);
}
.ticket-head h3 { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.05; }
.ticket-head .ref { font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ticket-body { padding: 18px 22px 22px; display: grid; gap: 12px; }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: baseline; }
.item .qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.item .price { font-weight: 600; font-variant-numeric: tabular-nums; }
.item .opts { grid-column: 2 / 4; font-size: 14px; color: var(--ink-soft); line-height: 1.35; }
.item img { display: none; }

.total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid #E8D9B4; padding-top: 12px;
  font-weight: 600;
}
.total strong { font-family: var(--display); font-weight: 400; font-size: 28px; font-variant-numeric: tabular-nums; }
.ticket-meta { font-size: 15px; color: var(--ink-soft); display: grid; gap: 2px; }
.ticket a { color: var(--grape); font-weight: 500; }   /* le moutarde manque de contraste sur le papier */
.ticket-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Tampon de statut */
.stamp {
  --c: var(--cap);
  justify-self: start;
  display: inline-block;
  font-family: var(--display); font-size: 19px; line-height: 1;
  color: var(--c);
  padding: 8px 14px 7px;
  border: 3px solid var(--c);
  outline: 2px solid var(--c); outline-offset: 3px;
  border-radius: 8px;
  transform: rotate(-6deg);
  margin: 6px 4px 4px;
  opacity: .92;
}
.stamp[data-status="accepted"]  { --c: #C98A00; }
.stamp[data-status="ordered"]   { --c: var(--grape); }
.stamp[data-status="delivered"] { --c: #3F8F1F; }
.stamp[data-status="cancelled"] { --c: #8A7A99; }
.stamp.is-new { animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp {
  0%   { transform: rotate(-6deg) scale(2.2); opacity: 0; }
  60%  { transform: rotate(-6deg) scale(.94); opacity: 1; }
  100% { transform: rotate(-6deg) scale(1); opacity: .92; }
}

.ticket-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; align-items: start; }
.ticket-link { text-decoration: none; color: inherit; display: block; border-radius: 18px; }
.ticket-link:hover .ticket { background: #FFFAEB; }

/* ── Commander ────────────────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.preview-empty {
  border: 3px dashed #8B5CC4; border-radius: 20px; padding: 36px 26px;
  color: var(--muted); text-align: center; display: grid; gap: 8px; justify-items: center;
}
.preview-empty strong { color: var(--cream); font-weight: 600; }
.help-link { font-size: 15px; }

/* ── Suivi de commande ────────────────────────────────────────────────────── */
.progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.progress li { display: grid; gap: 8px; justify-items: center; text-align: center; font-size: 14px; color: var(--muted); }
.progress li::before {
  content: ''; width: 100%; height: 10px; border-radius: 999px;
  background: var(--plum); border: 2px solid #5A2B85;
}
.progress li.done { color: var(--cream); }
.progress li.done::before { background: var(--bun); border-color: var(--plum); }
.progress li.current { color: var(--bun); font-weight: 600; }

.detail { display: grid; grid-template-columns: 380px 1fr; gap: 30px; align-items: start; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.detail-side { display: grid; gap: 22px; }

/* ── Chat ─────────────────────────────────────────────────────────────────── */
.chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: min(78vh, 760px); padding: 0; overflow: hidden; }
.chat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 2px solid var(--plum); }
.chat-top h2 { margin: 0; font: 600 21px/1.2 var(--body); }
.chat-top a { font-size: 15px; }
.chat-log { overflow-y: auto; padding: 14px 20px; display: grid; align-content: start; gap: 4px; overscroll-behavior: contain; }
.msg { display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; padding: 8px 0; }
.msg + .msg.same-author { padding-top: 0; }
.msg.same-author .msg-avatar, .msg.same-author .msg-head { visibility: hidden; height: 0; }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--plum); grid-row: span 2; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg-name { font-weight: 600; }
.msg-name.is-bot { color: var(--bun); }
.msg-time { font-size: 13px; color: var(--muted); }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--plum); color: var(--muted); }
.badge--bot { background: var(--bun); color: var(--plum); }
.msg-body { min-width: 0; overflow-wrap: anywhere; }
.msg-body p { margin: 2px 0; white-space: pre-wrap; }
.msg-body code { background: var(--plum); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.msg-body pre { background: var(--plum); padding: 10px 12px; border-radius: 10px; margin: 6px 0; white-space: pre-wrap; font-size: 14px; }
.msg-body .md-h { font-weight: 700; font-size: 18px; margin: 6px 0 2px; }
.msg-body .md-small { font-size: 13px; color: var(--muted); }
.msg-body blockquote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--muted); color: var(--muted); }
.note {
  background: var(--plum); border-left: 4px solid var(--bun); border-radius: 10px;
  padding: 10px 14px; margin: 6px 0; display: grid; gap: 4px; max-width: 560px;
}
.note-field strong { display: block; font-size: 14px; color: var(--muted); font-weight: 500; }
.msg-img { max-width: min(320px, 100%); border-radius: 12px; margin-top: 6px; border: 2px solid var(--plum); cursor: zoom-in; }

.chat-empty { color: var(--muted); text-align: center; padding: 40px 10px; }
.chat-closed { padding: 14px 20px; background: var(--plum); color: var(--muted); text-align: center; }
.composer { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: end; padding: 14px 16px; border-top: 2px solid var(--plum); background: var(--plum-2); }
.composer .textarea { min-height: 48px; max-height: 160px; resize: none; padding: 12px 14px; }
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid #5A2B85; background: var(--plum); color: var(--cream); cursor: pointer;
}
.icon-btn:hover { border-color: var(--bun); }
.icon-btn svg { width: 22px; height: 22px; }
.attach-preview { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.attach-preview img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; }

/* ── Espace cuistot ───────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 8px; }
.tabs button {
  background: var(--plum-2); border: var(--stroke) solid var(--plum); color: var(--cream);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--bun); color: var(--plum); }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; margin-left: 6px; border-radius: 999px; background: var(--cap); color: var(--plum); font-size: 14px; }
.tabs button[aria-selected="true"] .count { background: var(--plum); color: var(--bun); }

.arrive { animation: arrive .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes arrive { from { transform: translateY(-14px) rotate(-1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }

.empty-state { padding: 46px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty-state p { margin: 0; color: var(--muted); max-width: 42ch; }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }

/* ── Notifications ────────────────────────────────────────────────────────── */
.toasts { position: fixed; inset: auto 16px 16px auto; display: grid; gap: 10px; z-index: 50; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  background: var(--paper); color: var(--plum); font-weight: 500;
  border: var(--stroke) solid var(--plum); border-radius: 14px; padding: 12px 16px; box-shadow: var(--hard);
}
.toast--error { background: var(--cap); }

.loading { color: var(--muted); padding: 30px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══ Chargements ═══════════════════════════════════════════════════════════ */
@keyframes shimmer { from { background-position: -320px 0; } to { background-position: 320px 0; } }
.skeleton {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(42,13,66,.10) 0, rgba(42,13,66,.20) 40%, rgba(42,13,66,.10) 80%) 0 0 / 640px 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton--dark { background-image: linear-gradient(90deg, rgba(247,235,205,.07) 0, rgba(247,235,205,.16) 40%, rgba(247,235,205,.07) 80%); }
.sk-line { height: 14px; }
.sk-line + .sk-line { margin-top: 10px; }
.sk-title { height: 22px; width: 60%; }
.sk-avatar { width: 54px; height: 54px; border-radius: 50%; flex: none; }
.w-40 { width: 40%; } .w-55 { width: 55%; } .w-70 { width: 70%; } .w-85 { width: 85%; }

.ticket--loading .ticket-head > div { flex: 1; display: grid; gap: 8px; }

.msg-skeleton { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 10px 0; }
.msg-skeleton .skeleton:first-child { width: 40px; height: 40px; border-radius: 50%; }


/* Spinner dans les boutons occupés */
.spinner {
  width: 18px; height: 18px; flex: none;
  border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn .spinner { margin-left: -4px; }

/* Apparition douce du menu une fois la session connue */
.nav, .user-chip { animation: fadein .25s ease both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ── Aperçu du panier (page Commander) ───────────────────────────────────── */
.reveal { animation: reveal .28s ease-out both; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.loading-status { text-align: center; color: var(--muted); margin: 14px 0 0; }

/* ══ Espace cuistot : la cuisine ═══════════════════════════════════════════ */
body.kitchen {
  background-color: #1C0830;
  background-image:
    linear-gradient(rgba(247,235,205,.045) 2px, transparent 2px),
    linear-gradient(90deg, rgba(247,235,205,.045) 2px, transparent 2px);
  background-size: 52px 52px;
  background-position: -1px -1px;
}
.kitchen .site-header { background: rgba(28, 8, 48, .85); border-bottom: 3px solid var(--plum); }

.mode-switch { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--plum); border: 2px solid #4A2270; }
.mode-switch a { padding: 7px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.mode-switch a[aria-current="true"] { background: var(--bun); color: var(--plum); }
.mode-switch a:not([aria-current="true"]):hover { color: var(--cream); }

.kitchen-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.kitchen-head p { margin: 6px 0 0; color: var(--muted); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--plum-2); border: 2px solid #4A2270; font-weight: 600; }
.chip strong { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1; color: var(--bun); }
.chip--alert strong { color: var(--cap); }

.kitchen-section { margin-top: 40px; }
.kitchen-section > h2 { font: 600 22px/1.2 var(--body); margin: 0 0 6px; }
.kitchen-section > p { margin: 0 0 18px; color: var(--muted); }

/* Rail à bons : les commandes à prendre pendent sous une barre d'inox */
.rail { position: relative; padding-top: 22px; }
.rail::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 16px; border-radius: 8px;
  background: linear-gradient(#EDE4F5, #A898B8 55%, #6F5F82);
  box-shadow: 0 4px 0 #0E0418, inset 0 2px 0 rgba(255,255,255,.7);
}
.rail-track {
  display: flex; gap: 22px; align-items: flex-start;
  overflow-x: auto; padding: 18px 6px 26px; scroll-snap-type: x mandatory;
  scrollbar-color: var(--plum-3) transparent;
}
.rail-slot { position: relative; flex: 0 0 min(320px, 84vw); scroll-snap-align: start; }
.rail-slot::before {                        /* pince qui tient le bon */
  content: ''; position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 30px; z-index: 2;
  background: linear-gradient(#D9CFE3, #8C7C9E); border-radius: 0 0 8px 8px;
  box-shadow: 0 3px 0 #0E0418;
}
.rail-slot .ticket-shadow { transform-origin: 50% -30px; }
.rail-slot.arrive .ticket-shadow { animation: swing .9s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes swing {
  0%   { transform: translateX(60px) rotate(8deg); opacity: 0; }
  55%  { transform: translateX(0) rotate(-3deg); opacity: 1; }
  100% { transform: rotate(0); }
}
.rail-empty {
  border: 3px dashed #4A2270; border-radius: 20px; padding: 34px 24px; margin-top: 18px;
  display: grid; gap: 8px; justify-items: center; text-align: center; color: var(--muted);
}
.rail-empty strong { color: var(--cream); font-size: 19px; }

.waiting-time { font-weight: 600; color: var(--cap); }
.waiting-time.is-ok { color: var(--ink-soft); }

/* Tickets gérés : lignes de travail, pas des bons papier */
.work-list { display: grid; gap: 12px; }
.work-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 18px; border-radius: 18px; text-decoration: none; color: var(--cream);
  background: var(--plum-2); border: 3px solid var(--plum); box-shadow: var(--hard);
  transition: transform .12s ease, background-color .12s ease;
}
.work-row:hover { background: var(--plum-3); transform: translateX(3px); }
.work-row img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 3px solid var(--cream); }
.work-row h3 { font-size: 18px; }
.work-row .sub { font-size: 15px; color: var(--muted); }
.work-row .end { display: grid; justify-items: end; gap: 6px; }
.work-row .amount { font-family: var(--display); font-size: 22px; color: var(--bun); line-height: 1; }
.pill { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bun); color: var(--plum); white-space: nowrap; }
.pill[data-status="ordered"]   { background: #B28CF0; }
.pill[data-status="delivered"] { background: var(--lettuce); }

/* Poste de travail d'un ticket */
.station { display: grid; grid-template-columns: 400px 1fr; gap: 28px; align-items: start; }
@media (max-width: 1000px) { .station { grid-template-columns: 1fr; } }
.station-side { display: grid; gap: 20px; }
.station-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.station-bar h1 { font-size: clamp(30px, 4.6vw, 46px); }
.back-link { color: var(--muted); text-decoration: none; font-weight: 500; }
.back-link:hover { color: var(--cream); }
.client-card { display: grid; gap: 10px; }
.client-card h2 { font: 600 19px/1.2 var(--body); margin: 0; color: var(--muted); }
.client-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.client-card dt { color: var(--muted); }
.client-card dd { margin: 0; overflow-wrap: anywhere; }

/* ── Actions de fin de ticket ────────────────────────────────────────────── */
.btn--danger { background: var(--cap); color: var(--plum); }
.btn--danger:hover { background: #F4705D; }
.actions-card { display: grid; gap: 14px; }
.actions-card h2 { font: 600 19px/1.2 var(--body); margin: 0; color: var(--muted); }
.action { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; padding-top: 14px; border-top: 2px solid var(--plum); }
.action:first-of-type { border-top: 0; padding-top: 0; }
.action p { margin: 0; font-size: 14px; color: var(--muted); grid-column: 1; }
.action strong { font-weight: 600; }
.action .btn { grid-row: 1 / span 2; grid-column: 2; }
.actions-note { margin: 0; font-size: 14px; color: var(--muted); }

dialog.confirm {
  width: min(460px, calc(100vw - 32px));
  border: var(--stroke) solid var(--plum); border-radius: 22px; padding: 26px;
  background: var(--paper); color: var(--plum); box-shadow: 8px 10px 0 var(--plum);
}
dialog.confirm::backdrop { background: rgba(14, 4, 24, .72); }
dialog.confirm h2 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 0 0 10px; line-height: 1.1; }
dialog.confirm p { margin: 0 0 8px; }
dialog.confirm ul { margin: 6px 0 18px; padding-left: 20px; color: var(--ink-soft); }
dialog.confirm .btn--quiet { background: #EADFC4; color: var(--plum); }
dialog.confirm[open] { animation: pop .22s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Commander : confirmation de l'adresse du lien ───────────────────────── */
.step-title { font: 600 21px/1.25 var(--body); margin: 0; }
/* Ordre de lecture : lien, panier, adresse. Sur ordinateur, le panier occupe la colonne
   de droite ; sur mobile il s'intercale entre le lien et la confirmation d'adresse. */
.order-flow { grid-template-areas: "link preview" "address preview"; grid-template-rows: auto 1fr; row-gap: 26px; }
.order-flow > #link-panel { grid-area: link; }
.order-flow > #address-step { grid-area: address; align-self: start; }
.order-flow > .preview-col { grid-area: preview; align-self: start; }
@media (max-width: 900px) {
  .order-flow { grid-template-areas: "link" "preview" "address"; grid-template-rows: auto; }
}
.address-label {
  display: flex; align-items: center; gap: 14px;
  background: var(--paper); color: var(--plum);
  border: var(--stroke) solid var(--plum); border-radius: 16px; padding: 14px 18px;
  box-shadow: var(--hard);
}
.address-label strong { display: block; font-size: 19px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.address-caption { font-size: 14px; color: var(--ink-soft); }
.address-pin { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--cap); color: var(--paper); border: var(--stroke) solid var(--plum); }
.address-pin svg { width: 22px; height: 22px; }
.address-label.is-confirmed .address-pin { background: var(--lettuce); }
.fix-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; color: var(--cream); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--bun); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }
.link-btn:hover { color: #FFD76A; }
