:root {
  --bg: #f5f6fa;
  --bg-glow: radial-gradient(1200px 500px at 10% -10%, #e4e2ff 0%, transparent 60%),
             radial-gradient(900px 400px at 100% 0%, #ffe3f1 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f0f1f6;
  --text: #12131a;
  --muted: #676a7c;
  --line: #e3e5ee;
  --brand: #6d4aff;
  --brand-2: #e64ba6;
  --brand-soft: #efeaff;
  --buy: #c2620c;
  --buy-soft: #fff1e2;
  --sell: #0f8a55;
  --sell-soft: #e3f7ed;
  --shadow: 0 1px 2px rgb(16 18 35 / .04), 0 4px 16px rgb(16 18 35 / .06);
  --shadow-lg: 0 10px 40px rgb(16 18 35 / .14);
  --radius: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c12;
    --bg-glow: radial-gradient(1200px 500px at 10% -10%, #2a1f66 0%, transparent 60%),
               radial-gradient(900px 400px at 100% 0%, #4a1640 0%, transparent 55%);
    --surface: #14151e;
    --surface-2: #1c1e2a;
    --text: #eceef6;
    --muted: #9497aa;
    --line: #262838;
    --brand: #9b85ff;
    --brand-2: #ff6fbf;
    --brand-soft: #241e45;
    --buy: #ffaa5c;
    --buy-soft: #33230f;
    --sell: #4fdc9a;
    --sell-soft: #10301f;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
    --shadow-lg: 0 12px 48px rgb(0 0 0 / .5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
}
input, select, button { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }

/* --- Barre du haut ------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, calc((100vw - 1200px) / 2));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; padding: 5px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.on .dot { background: var(--sell); box-shadow: 0 0 0 0 var(--sell); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sell) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* --- Hero + recherche ------------------------------------------------------ */
.hero { max-width: 1200px; margin: 0 auto; padding: 44px 16px 20px; text-align: center; }
h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 10px; font-weight: 800; }
.grad { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 0 auto 26px; color: var(--muted); max-width: 520px; }

.searchbar {
  display: flex; align-items: center; gap: 8px;
  max-width: 720px; margin: 0 auto;
  padding: 7px 7px 7px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-lg);
  transition: border-color .15s, box-shadow .15s;
}
.searchbar:focus-within { border-color: var(--brand); box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.searchbar svg { color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 8px 0; }
.searchbar input::-webkit-search-cancel-button { cursor: pointer; }

.seg { display: inline-flex; gap: 4px; margin-top: 18px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 100%; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--text); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.pip { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pip.buy { background: var(--buy); }
.pip.sell { background: var(--sell); }

/* --- Boutons ------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--brand-2))); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.primary:hover { box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 50%, transparent); }
.btn.primary.dirty { position: relative; }
.btn.primary.dirty::after { content: ""; position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--brand-2); border: 2px solid var(--surface); }
.btn.primary[aria-busy="true"] { opacity: .75; cursor: progress; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.wa { background: var(--sell-soft); color: var(--sell); }
.btn.wa:hover { border-color: var(--sell); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }

/* --- Mise en page ---------------------------------------------------------- */
.layout { max-width: 1200px; margin: 0 auto; padding: 16px 16px 64px; display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }

.panel { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 92px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.panel-head h2 { font-size: 16px; margin: 0; }
.panel-head .icon-btn { display: none; }
.fields { padding: 8px 18px 16px; display: grid; gap: 14px; overflow-y: auto; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field input, .field select {
  width: 100%; min-width: 0; height: 40px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; outline: 0;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus { border-color: var(--brand); background: var(--surface); }
.field input[type=date] { padding: 0 8px; font-size: 14px; }
.suffix { position: relative; }
.suffix em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); pointer-events: none; }
.suffix input { padding-right: 28px; }

.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

.panel-foot { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }

/* --- Résultats ------------------------------------------------------------- */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.count { font-size: 15px; }
.count strong { font-size: 18px; letter-spacing: -.01em; }
#timing { color: var(--muted); font-size: 13px; }
.results-tools { display: flex; gap: 8px; align-items: center; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sort select { height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; color: var(--text); }
.filters-btn { display: none; }
.filters-btn b { background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }
.filters-btn b:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 500; border: 0; cursor: pointer; }
.chip svg { width: 16px; height: 16px; padding: 3px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 15%, transparent); }
.chip:hover svg { background: var(--brand); color: #fff; }

.list { display: grid; gap: 12px; }

.card {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  animation: rise .3s ease-out both;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.tile { display: grid; justify-items: center; align-content: center; min-height: 70px; border-radius: 12px; text-align: center; line-height: 1.05; }
.card.WTS .tile { background: var(--sell-soft); color: var(--sell); }
.card.WTB .tile { background: var(--buy-soft); color: var(--buy); }
.tile .wd { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.tile .d { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.tile .mo { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.tile .q { font-size: 24px; font-weight: 700; }
.tile .lots { margin-top: 4px; padding: 0 7px; border: 1.5px solid currentColor; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.4; }

.body { min-width: 0; display: grid; gap: 6px; }
.line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.card.WTB .badge { background: var(--buy-soft); color: var(--buy); }
.card.WTS .badge { background: var(--sell-soft); color: var(--sell); }
.ago { font-size: 12.5px; color: var(--muted); }
.artist { font-size: 18px; font-weight: 700; letter-spacing: -.015em; margin: 0; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.tag.warn { background: var(--buy-soft); color: var(--buy); font-weight: 600; }
.excerpt { margin: 0; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.who .grp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spread { font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; cursor: help; }
.also { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.also b { font-weight: 600; color: var(--brand); margin-right: 4px; }

.side { display: grid; justify-items: end; gap: 10px; text-align: right; }
.price { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.price small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.price.none { font-size: 14px; font-weight: 500; color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

details.raw { grid-column: 2 / -1; font-size: 13px; }
details.raw summary { cursor: pointer; color: var(--brand); font-weight: 500; list-style: none; width: fit-content; }
details.raw summary::-webkit-details-marker { display: none; }
details.raw pre { white-space: pre-wrap; font: inherit; background: var(--surface-2); padding: 12px; border-radius: 10px; margin: 8px 0 0; max-height: 320px; overflow: auto; }

.skeleton { height: 112px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; color: var(--muted); padding: 56px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p { margin: 4px 0; }
.empty strong { color: var(--text); }
.empty-icon { font-size: 34px; margin-bottom: 8px; }
.more { display: flex; margin: 18px auto 0; }

.fresh {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 30;
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  color: #fff; font-weight: 600; font-size: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-lg);
  animation: drop .3s ease-out;
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -10px); } }

.scrim { display: none; }

/* --- Mobile ---------------------------------------------------------------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding-top: 8px; }
  .filters-btn { display: inline-flex; }
  .panel {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 40;
    max-height: 88vh; border-radius: 22px 22px 0 0;
    transform: translateY(105%); transition: transform .25s ease-out;
  }
  .panel.open { transform: none; }
  .panel-head .icon-btn { display: grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(0 0 0 / .45); }
  .hero .seg { width: 100%; }
  .hero .seg label { flex: 1; }
  .hero .seg span { justify-content: center; padding: 7px 8px; }
}
@media (max-width: 560px) {
  .hero { padding-top: 28px; }
  .searchbar { padding-left: 14px; }
  .searchbar .search-btn { padding: 10px 14px; }
  .sort span { display: none; }
  .card { grid-template-columns: 56px 1fr; gap: 12px; padding: 14px; }
  .tile { min-height: 62px; }
  .tile .d { font-size: 22px; }
  .side { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; justify-items: start; text-align: left; }
  .side .actions { justify-content: flex-end; }
  .price small { display: inline; margin-left: 4px; }
  details.raw { grid-column: 1 / -1; }
  .status-text { display: none; }
}

/* --- Nombre de places : Tout · 1 … 6+ ----------------------------------------- */
.pills { display: grid; grid-template-columns: 1.6fr repeat(6, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.pills label { cursor: pointer; min-width: 0; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span { display: grid; place-items: center; height: 32px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.pills label:hover span { color: var(--text); }
.pills input:checked + span { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.pills input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }

/* --- Dates précises (liste à cocher) -------------------------------------------- */
.multi { border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; }
.multi[open], .multi.has-value { border-color: var(--brand); background: var(--surface); }
.multi summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; padding: 0 12px; cursor: pointer; }
.multi summary::-webkit-details-marker { display: none; }
.multi summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi.has-value summary span { color: var(--brand); font-weight: 600; }
.multi summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.multi[open] summary svg { transform: rotate(180deg); }
.multi-body { border-top: 1px solid var(--line); }
.multi-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.multi-tools .link { background: none; border: 0; color: var(--brand); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.multi-list { max-height: 260px; overflow-y: auto; padding: 0 6px 8px; overscroll-behavior: contain; }
.multi-month { position: sticky; top: 0; z-index: 1; padding: 8px 6px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface); }
.multi-month::first-letter { text-transform: uppercase; }
.opt { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.opt:hover { background: var(--surface-2); }
.opt input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; flex: none; }
.opt span { flex: 1; }
.opt span::first-letter { text-transform: uppercase; }
.opt em { font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.multi-empty { margin: 4px 6px 8px; font-size: 13px; color: var(--muted); }

/* Auteur dont WhatsApp cache le numéro : pas de lien direct possible. */
.btn.masked { background: var(--surface-2); color: var(--muted); cursor: help; font-weight: 500; }
.btn.masked:hover { border-color: var(--line); }

/* --- Onglets ---------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-right: auto; margin-left: 16px; }
.tabs a { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--text); color: var(--bg); }
.tabs b { background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }
.tabs b:empty { display: none; }

/* --- Pages Opportunités / Alertes ------------------------------------------------------- */
.page { max-width: 1100px; margin: 0 auto; padding: 32px 16px 64px; }
.page-head h1 { font-size: clamp(26px, 4vw, 36px); text-align: left; margin-bottom: 6px; }
.page-head .sub { margin: 0 0 22px; text-align: left; max-width: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.toolbar .field { min-width: 200px; flex: 1; }
.section-title { font-size: 19px; margin: 30px 0 4px; letter-spacing: -.01em; }
.section-help { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.muted { color: var(--muted); font-weight: 500; }
.empty-line { color: var(--muted); font-size: 14px; padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); margin: 0; }

.opps { display: grid; gap: 12px; }
.opp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 14px; animation: rise .3s ease-out both; }
.opp.resale { border-color: color-mix(in srgb, var(--sell) 45%, var(--line)); }
.opp-head { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; }
.opp .tile { background: var(--brand-soft); color: var(--brand); }
.opp-meta { font-size: 13px; color: var(--muted); }
.opp-meta b { color: var(--text); }
.vr { color: var(--buy); }
.gain { text-align: right; font-size: 24px; font-weight: 800; letter-spacing: -.03em; color: var(--sell); line-height: 1; }
.gain small { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.opp-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.opp-side { background: var(--surface-2); border-radius: 12px; padding: 12px; display: grid; gap: 4px; align-content: start; justify-items: start; min-width: 0; }
.opp-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.opp-price { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.opp-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.opp-side .excerpt { width: 100%; margin: 2px 0 6px; }

/* Position par rapport au marché, sous le prix d'une annonce */
.mkt { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.mkt.good { color: var(--sell); }
.mkt.bad { color: var(--buy); }

/* --- Alertes ---------------------------------------------------------------------------------- */
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-box h2 { font-size: 17px; margin: 0 0 4px; }
.webhook-state { font-size: 14px; margin: 0 0 12px; }
.webhook-state.ok { color: var(--sell); }
.webhook-state.warn { color: var(--buy); }
.webhook-state code { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.row-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.row-inline input { flex: 1; min-width: 240px; height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); outline: 0; }
.row-inline input:focus { border-color: var(--brand); }
.alerts-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.alert-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; }
.alert-card.off { opacity: .6; }
.alert-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.alert-top h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.alert-stats { font-size: 12.5px; color: var(--muted); }
.alert-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.danger:hover { border-color: #d64545; color: #d64545; }
.chip.static { cursor: default; padding: 5px 12px; }
.chip.cond { background: var(--sell-soft); color: var(--sell); }

/* --- Fenêtre de création d'alerte ----------------------------------------------------------------- */
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgb(0 0 0 / .5); backdrop-filter: blur(2px); }
dialog form { display: grid; gap: 14px; padding: 22px; }
dialog h2 { margin: 0; font-size: 20px; }
dialog .section-help { margin: 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.form-error { color: #d64545; font-size: 13.5px; margin: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: drop .25s ease-out; max-width: calc(100vw - 32px); }
.toast.error { background: #d64545; color: #fff; }

@media (max-width: 860px) {
  .brand span { display: none; }
  .tabs { margin-left: 8px; overflow-x: auto; }
  .tabs a { padding: 6px 10px; font-size: 13px; }
  #new-alert { order: 3; }
}
@media (max-width: 560px) {
  .opp-head { grid-template-columns: 56px 1fr; }
  .gain { grid-column: 1 / -1; text-align: left; }
  .results-tools { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .topbar .brand { display: none; }
  .tabs { margin-left: 0; }
  .tabs a { padding: 6px 9px; }
}

/* --- Nouvelle alerte : choix de la sorte -------------------------------------------- */
#kind-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.kinds { display: grid; gap: 8px; }
.kind { cursor: pointer; }
.kind input { position: absolute; opacity: 0; pointer-events: none; }
.kind span { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); transition: border-color .15s, background .15s; }
.kind b { font-size: 15px; }
.kind small { font-size: 12.5px; color: var(--muted); }
.kind:hover span { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.kind input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.kind input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.kind-fields { display: grid; gap: 14px; }
.opt-hint { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; }
.pills-8 { grid-template-columns: repeat(8, 1fr); }

.kind-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-bottom: 6px; background: var(--surface-2); color: var(--muted); }
.kind-badge.opportunity { background: color-mix(in srgb, #f5b301 18%, transparent); color: #c98f00; }
.kind-badge.stock { background: var(--brand-soft); color: var(--brand); }
.kind-badge.request { background: color-mix(in srgb, #2f8fd8 16%, transparent); color: #2f8fd8; }
.alert-top { align-items: flex-start; }

/* --- Catégories à cocher -------------------------------------------------------------- */
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat { cursor: pointer; }
.cat input { position: absolute; opacity: 0; pointer-events: none; }
.cat span { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface-2); border: 1px solid transparent; color: var(--muted); transition: background .15s, color .15s, border-color .15s; }
.cat:hover span { color: var(--text); }
.cat input:checked + span { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); font-weight: 600; }
.cat input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.pills-3 { grid-template-columns: repeat(3, 1fr); }

/* --- Estimer -------------------------------------------------------------------------- */
.est-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.est-wide { grid-column: 1 / -1; }
.est-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
#est-result { margin-top: 20px; }
.est-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat:first-child { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--brand-2))); color: #fff; border-color: transparent; }
.stat:first-child .stat-label, .stat:first-child .stat-sub { color: rgb(255 255 255 / .85); }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sub-title { font-size: 15px; margin: 22px 0 8px; }
.est-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14px; font-variant-numeric: tabular-nums; }
.est-table th, .est-table td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.est-table th:first-child, .est-table td:first-child { text-align: left; }
.est-table th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.est-table tr:last-child td { border-bottom: 0; }

/* Estimation dans le formulaire d'alerte */
.est-inline-box { display: grid; gap: 8px; justify-items: start; }
.est-inline { font-size: 13.5px; background: var(--brand-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; width: 100%; display: grid; gap: 8px; }
.est-inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .est-table { display: block; overflow-x: auto; }
}

/* Cases à cocher / boutons radio invisibles : ancrés sur leur pastille (sinon ils
   se placent hors de l'écran et créent un défilement horizontal). */
.cat, .pills label, .seg label, .kind, .switch { position: relative; }
.cat input, .pills input, .seg input, .kind input, .switch input { top: 0; left: 0; width: 1px; height: 1px; margin: 0; }

/* Pastilles d'annonce : VR accepté par l'acheteur, jour imposé */
.tag.vr-ok { background: var(--sell-soft); color: var(--sell); font-weight: 600; }
.tag.day { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* Boutons à choix (Sans / Seulement / Peu importe…) : toujours sur une ligne */
.pills span { white-space: nowrap; padding: 0 8px; }
.pills-3 { grid-template-columns: auto auto auto; }
.pills-3 span { font-size: 13px; }

/* --- Tableau détaillé de l'estimation (tri par colonne) -------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.est-table th .th { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.est-table th.txt .th { justify-content: flex-start; }
.est-table th.txt, .est-table td.txt { text-align: left; }
.sort-btns { display: inline-flex; flex-direction: column; line-height: 1; }
.sort-btn { border: 0; background: none; padding: 0 2px; font-size: 9px; color: var(--muted); opacity: .45; cursor: pointer; line-height: 1.1; }
.sort-btn:hover { opacity: 1; color: var(--text); }
.sort-btn.on { opacity: 1; color: var(--brand); }
.est-table tbody tr:hover td { background: var(--surface-2); }

/* --- Pastilles de catégories : lignes équilibrées et centrées -------------------- */
.cat-chips { justify-content: center; margin-inline: auto; }
.other-cat { display: block; width: 100%; margin-top: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); outline: 0; font-size: 14px; }
.other-cat:focus { border-color: var(--brand); background: var(--surface); }

/* --- Estimer : options centrées ----------------------------------------------------- */
#est-form .field { justify-items: center; text-align: center; }
#est-form .field > span { justify-self: center; }
#est-form .field input[type=text], #est-form .field select, #est-form .other-cat { text-align: center; text-align-last: center; }
#est-form .multi, #est-form .pills, #est-form .other-cat { width: 100%; }
#est-form .multi summary { justify-content: center; position: relative; }
#est-form .multi summary svg { position: absolute; right: 12px; }
#est-form .est-actions { justify-content: center; }

/* Tableau : écart de prix sous le prix moyen */
.est-table .range { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }

/* Estimer : 2 champs sur la 1re ligne, catégories pleine largeur, 3 champs ensuite */
@media (min-width: 700px) {
  #est-form .est-grid { grid-template-columns: repeat(6, 1fr); }
  #est-form .est-grid > * { grid-column: span 2; }
  #est-form .est-grid > .est-half { grid-column: span 3; }
  #est-form .est-grid > .est-wide { grid-column: 1 / -1; }
}

/* --- Tableau d'estimation : centré, lignes cliquables -------------------------------- */
.est-table th, .est-table td, .est-table th.txt, .est-table td.txt { text-align: center; }
.est-table th .th, .est-table th.txt .th { justify-content: center; }
.est-table tr.row { cursor: pointer; }
.est-table tr.row td:first-child::before { content: "▸"; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.est-table tr.row.open td:first-child::before { transform: rotate(90deg); color: var(--brand); }
.est-table tr.row.open td { background: var(--brand-soft); }
.est-table tr.detail td { background: var(--surface-2); text-align: left; padding: 12px; white-space: normal; }
.src-list { display: grid; gap: 10px; }
.src-msg { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.src-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); }
.src-head b { color: var(--text); font-size: 15px; }
.src-head .btn { margin-left: auto; }
.src-msg pre { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 8px 0 0; max-height: 260px; overflow: auto; color: var(--text); }
.src-msg mark { background: color-mix(in srgb, var(--brand) 25%, transparent); color: var(--text); border-radius: 4px; padding: 0 2px; }
.tag.sold { background: #d64545; color: #fff; font-weight: 700; letter-spacing: .04em; }
.top-right { display: flex; align-items: center; gap: 8px; }

/* --- Graphique d'évolution des prix -------------------------------------------------- */
.chart { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px 4px; box-shadow: var(--shadow); }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow-lg); font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; white-space: nowrap; }
.chart-tip b { color: var(--text); }
.chart-tip > b:first-child::first-letter { text-transform: uppercase; }

/* --- Opportunités et alertes : paramètres centrés (comme Estimer) -------------------- */
#opps-form { justify-content: center; align-items: flex-end; }
#opps-form .field, #kind-form .field, #alert-form .field, #webhook-form { justify-items: center; text-align: center; }
#opps-form .field > span, #kind-form .field > span, #alert-form .field > span { justify-self: center; }
#opps-form input, #opps-form select,
#kind-form .field input, #kind-form .field select, #kind-form .other-cat,
#alert-form .field input, #alert-form .field select,
#webhook-form input { text-align: center; text-align-last: center; }
#kind-form .multi, #kind-form .pills, #kind-form .other-cat, #kind-form .field input, #kind-form .field select,
#alert-form .field input, #alert-form .field select { width: 100%; }
#kind-form .multi summary { justify-content: center; position: relative; }
#kind-form .multi summary svg { position: absolute; right: 12px; }
#kind-form .kind span { text-align: center; }
#kind-form .switch, #alert-form .switch { justify-content: center; text-align: center; }
#kind-form .est-inline-box { justify-items: center; }
#kind-form .est-inline, #kind-form .est-inline-actions { text-align: center; justify-content: center; }
#kind-form h2, #alert-form h2, #kind-form > .section-help, #alert-form > .section-help { text-align: center; }
#alert-form > .chips { justify-content: center; }
#kind-form .dialog-foot, #alert-form .dialog-foot { justify-content: center; }
#webhook-form h2, #webhook-form .section-help, #webhook-form .webhook-state { text-align: center; }
#webhook-form .row-inline { justify-content: center; }
#kind-form .form-error, #alert-form .form-error { text-align: center; }
/* Titres, sous-titres et sections centrés sur Opportunités, Estimer et Alertes */
.page .page-head h1, .page .page-head .sub, .page .section-title, .page .section-help, .page .sub-title { text-align: center; }
.page .alerts-head { flex-direction: column; justify-content: center; }
#kind-form .suffix, #alert-form .suffix { width: 100%; }
#kind-form .switch span, #alert-form .switch span { flex: 0 1 auto; }
#opps-form .field { flex: 0 1 320px; }
/* Cartes d'alerte centrées, interrupteur en haut à droite */
.alert-card { position: relative; text-align: center; justify-items: center; }
.alert-card .alert-top { justify-content: center; width: 100%; padding: 0 44px; }
.alert-card .alert-top .switch { position: absolute; top: 14px; right: 14px; }
.alert-card .chips, .alert-card .alert-actions { justify-content: center; }
.tag.place { background: color-mix(in srgb, #2f8fd8 14%, transparent); color: #2f8fd8; font-weight: 600; }
.who .venue { white-space: nowrap; }

/* Opportunités : fiabilité et avertissement */
.conf { letter-spacing: 1px; font-weight: 700; }
.conf.c3 { color: var(--sell); }
.conf.c2 { color: #c98f00; }
.conf.c1 { color: var(--buy); }
.opp-warn { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #d64545; }

/* --- Legit Check ----------------------------------------------------------------------- */
.lc-search { margin: 0 auto 10px; max-width: 640px; }
.lc-help { text-align: center; }
.lc-results { display: grid; gap: 12px; max-width: 860px; margin: 0 auto; }
.lc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; animation: rise .3s ease-out both; }
.lc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lc-who { font-size: 14px; color: var(--text); }
.lc-who .avatar { width: 34px; height: 34px; font-size: 14px; }
.lc-name { display: grid; min-width: 0; }
.lc-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-name em { font-style: normal; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lc-count { display: grid; justify-items: center; line-height: 1; padding: 8px 14px; border-radius: 14px; background: var(--sell-soft); color: var(--sell); flex: none; }
.lc-count b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lc-count span { font-size: 11px; font-weight: 700; letter-spacing: .06em; margin-top: 3px; }
.lc-count.zero { background: var(--surface-2); color: var(--muted); }
.lc-meta { margin: 0; font-size: 13px; color: var(--muted); }
.lc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lc-actions:empty { display: none; }
.lc-list .est-table { margin-top: 4px; }
.lc-table td a { color: var(--brand); text-decoration: none; font-variant-numeric: tabular-nums; }
.lc-table .lc-grp { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lc-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; background: var(--sell-soft); color: var(--sell); font-weight: 700; font-size: 12px; text-decoration: none; white-space: nowrap; }
.lc-badge:hover { outline: 1px solid var(--sell); }
@media (max-width: 640px) {
  .lc-list { overflow-x: auto; }
  .tabs a { padding: 6px 10px; }
}

/* Recherche dans l'historique (écran de chargement) */
.lc-scan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 20px 22px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.lc-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: lc-spin .9s linear infinite; margin-bottom: 6px; }
@keyframes lc-spin { to { transform: rotate(360deg); } }
.lc-scan-body { display: grid; justify-items: center; gap: 6px; width: 100%; }
.lc-scan-count { display: flex; align-items: baseline; gap: 8px; color: var(--sell); }
.lc-scan-count b { font-size: 56px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.lc-scan-count span { font-size: 16px; font-weight: 700; }
.lc-scan-count.bump b { animation: lc-bump .45s ease-out; }
@keyframes lc-bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.lc-scan-who { margin: 0; font-size: 14px; color: var(--muted); }
.lc-scan-who b { color: var(--text); }
.lc-scan-meta { margin: 4px 0 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lc-scan-groups { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 560px; display: grid; gap: 4px; font-size: 13px; }
.lc-scan-groups li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); text-align: left; }
.lc-scan-groups li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-scan-groups li em { font-style: normal; color: var(--muted); text-align: right; }
.lc-scan-groups li.scanning { outline: 1px solid var(--brand); }
.lc-scan-groups li.scanning em { color: var(--brand); }
.lc-scan-groups li.done em { color: var(--sell); }
.lc-scan-groups li.no-anchor em, .lc-scan-groups li.timeout em, .lc-scan-groups li.throttled em { color: #d97706; }
.lc-scan-help { margin: 8px 0 6px; font-size: 12.5px; color: var(--muted); max-width: 480px; }
.lc-warn { margin: 0; font-size: 13px; color: #b45309; background: color-mix(in srgb, #f59e0b 12%, transparent); border-radius: 10px; padding: 10px 12px; }

/* Annonces contactées, message complet surligné, bouton alerte */
.contacted { font: inherit; font-size: 12px; font-weight: 700; color: var(--sell); background: var(--sell-soft); border: 0; padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.contacted:hover { text-decoration: line-through; }
.card.is-contacted { opacity: .72; }
.card.is-contacted:hover { opacity: 1; }
details.raw pre mark { background: color-mix(in srgb, var(--brand) 32%, transparent); color: inherit; border-radius: 4px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 32%, transparent); font-weight: 600; }
.btn.icon-only { padding-inline: 9px; }

/* Comptes */
.me-name { font: inherit; font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.me-name:hover { color: var(--text); background: var(--surface-2); }
.invite-link { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--brand-soft); display: grid; gap: 8px; }
.invite-link code { word-break: break-all; font-size: 13px; }
.users { display: grid; gap: 10px; margin-top: 18px; }
.user-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.user-row .who { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.user-row .who b { font-size: 15px; }
.user-row .who small { color: var(--muted); font-size: 12.5px; }
.user-row .role { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.user-row .pending { color: var(--buy); }
