/* Share It : même famille visuelle que Flow (blanc cassé chaud, encre, filets fins),
   avec une typo plus affirmée : Bricolage Grotesque pour les titres et les prix,
   Instrument Sans pour le texte. */

@font-face { font-family: "Bricolage"; src: url(/fonts/bricolage-grotesque-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url(/fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url(/fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Instrument"; src: url(/fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument"; src: url(/fonts/instrument-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Instrument"; src: url(/fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --raised: #ffffff; --sunken: #f1f0eb;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --hair: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,.08);
  --hot: #ff5a1f; --good: #0b8a3e; --warn: #b7791f; --crit: #d03b3b;
  --shadow: 0 1px 2px rgba(11,11,11,.04), 0 8px 24px rgba(11,11,11,.06);
  --drawer-shadow: -24px 0 60px rgba(11,11,11,.14);
  --display: "Bricolage", "Instrument", system-ui, sans-serif;
  --text: "Instrument", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #161615; --raised: #1f1f1d; --sunken: #232321;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --hair: #2a2a28; --axis: #3a3a37; --ring: rgba(255,255,255,.08);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --drawer-shadow: -24px 0 60px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 var(--text);
  background: var(--page); color: var(--ink);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.wrap {
  max-width: 1200px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 36px) 32px calc(env(safe-area-inset-bottom) + 80px);
}

/* ---------- En-tête ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--page); font: 800 17px/1 var(--display); letter-spacing: -.04em;
}
.brand h1 { margin: 0; font: 700 15px/1.2 var(--display); letter-spacing: -.01em; }
.brand p { margin: 0; font-size: 12.5px; color: var(--muted); }
.top-r { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--ring); color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--axis); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.handle { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-2); }

.hero { margin: 48px 0 28px; }
.hero h2 { margin: 0; font: 800 clamp(30px, 5vw, 44px)/1.02 var(--display); letter-spacing: -.035em; }
.hero h2 em { font-style: normal; color: var(--hot); }
.hero p { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; }

/* ---------- Tuiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.tile { background: var(--surface); border: 1px solid var(--ring); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.tile .k { font-size: 12.5px; color: var(--muted); }
.tile .v { font: 700 28px/1.1 var(--display); letter-spacing: -.03em; margin-top: 4px; }
.tile .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Barre d'onglets ---------- */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--hair); margin-bottom: 22px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border: 0; background: none; white-space: nowrap;
  font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab .n { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--sunken); }
.tools { display: flex; gap: 8px; padding-bottom: 8px; }
.select {
  height: 32px; border-radius: 10px; border: 1px solid var(--hair); background: var(--surface); padding: 0 30px 0 12px;
  font-size: 13px; font-weight: 500; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23898781' stroke-width='1.6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select:hover { border-color: var(--axis); }

/* ---------- Grille de deals ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.deal {
  position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer;
  background: var(--surface); border: 1px solid var(--ring); border-radius: 16px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.deal:hover { border-color: var(--axis); box-shadow: var(--shadow); transform: translateY(-1px); }
.deal .pic { position: relative; aspect-ratio: 1; background: #fff; border-bottom: 1px solid var(--ring); overflow: hidden; }
.deal .pic img { position: absolute; inset: 22px; width: calc(100% - 44px); height: calc(100% - 44px); object-fit: contain; }
.off {
  position: absolute; top: 12px; left: 12px; background: var(--ink); color: var(--page);
  font: 800 15px/1 var(--display); letter-spacing: -.02em; padding: 6px 9px 7px; border-radius: 9px;
}
.flash { position: absolute; top: 12px; right: 12px; background: var(--hot); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 4px 8px; border-radius: 7px; }
.deal .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.deal .brandname { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.deal .name { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal .prices { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 10px; }
.deal .prices b { font: 800 22px/1 var(--display); letter-spacing: -.03em; }
.deal .prices s { color: var(--muted); font-size: 13px; }
.deal .when { margin-left: auto; font-size: 12px; color: var(--muted); }

.empty { color: var(--muted); font-size: 14px; padding: 80px 0; text-align: center; }
.empty b { display: block; color: var(--ink); font: 700 20px/1.2 var(--display); letter-spacing: -.02em; margin-bottom: 6px; }

/* ---------- Panneau latéral ---------- */
.scrim { position: fixed; inset: 0; background: rgba(11,11,11,.28); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); z-index: 11;
  background: var(--page); box-shadow: var(--drawer-shadow); overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.drawer.open { transform: none; }
.d-head {
  position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: calc(env(safe-area-inset-top) + 22px) 28px 18px; border-bottom: 1px solid var(--hair);
  display: flex; gap: 16px; align-items: flex-start;
}
.d-head .who { flex: 1; min-width: 0; }
.d-head .brandname { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.d-head h2 { margin: 2px 0 0; font: 700 22px/1.15 var(--display); letter-spacing: -.025em; }
.d-head .full { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--hair); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none;
}
.icon-btn:hover { color: var(--ink); border-color: var(--axis); }
.d-body { padding: 22px 28px 28px; display: flex; flex-direction: column; gap: 14px; }
.section { background: var(--surface); border: 1px solid var(--ring); border-radius: 14px; padding: 18px 20px; }
.section h4 { margin: 0 0 14px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section h4 span { font-weight: 400; color: var(--muted); font-size: 12px; }
.pricebar { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pricebar b { font: 800 34px/1 var(--display); letter-spacing: -.04em; }
.pricebar s { color: var(--muted); font-size: 15px; }
.pricebar .off-inline { font: 800 15px/1 var(--display); background: var(--ink); color: var(--page); padding: 5px 8px 6px; border-radius: 8px; }
.check { margin-top: 10px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.check i { width: 7px; height: 7px; border-radius: 50%; background: var(--axis); flex: none; }
.check.ok i { background: var(--good); }
.check.warn { color: var(--warn); }
.check.warn i { background: var(--warn); }

.visuals { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.visuals .x { grid-column: 1 / -1; }
.visuals figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.frame { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--ring); background: var(--sunken); }
.frame img { width: 100%; display: block; }
/* Même place sur tous les formats : coin bas droit, laissé libre dans chaque visuel. */
.overlay { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.ov {
  width: 34px; height: 34px; border-radius: 10px; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(11,11,11,.72); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .15s, transform .15s;
}
.ov:hover { background: rgba(11,11,11,.9); transform: translateY(-1px); }
.ov:active { transform: scale(.94); }
.visuals figcaption { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.visuals figcaption span { font-weight: 400; color: var(--muted); margin-left: 4px; }
.section h4 span.over { color: var(--crit); }
@media (max-width: 640px) {
  .visuals { grid-template-columns: 1fr; }
  .visuals .story .frame { align-self: center; }
  .visuals .story img { max-height: 60vh; width: auto; max-width: 100%; }
}
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.tweet {
  margin: 0 0 12px; white-space: pre-wrap; word-break: break-word; font: 14px/1.55 var(--text);
  background: var(--page); border: 1px solid var(--hair); border-radius: 10px; padding: 12px 14px;
}

.btn {
  height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--hair); background: var(--surface);
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--ink);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--axis); }
.btn.primary { background: var(--ink); color: var(--page); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn.quiet { border-color: transparent; background: none; color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { flex: none; }

.d-foot {
  position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  padding: 14px 28px calc(env(safe-area-inset-bottom) + 14px); border-top: 1px solid var(--hair);
  background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.d-foot .grow { flex: 1; }

@media (max-width: 640px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .hero { margin-top: 32px; }
  .d-head, .d-body { padding-left: 18px; padding-right: 18px; }
  .d-foot { padding-left: 18px; padding-right: 18px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .deal .pic img { inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); }
  .deal .body { padding: 12px; }
  .deal .prices b { font-size: 19px; }
  .deal .when { display: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translate(-50%, 12px);
  background: var(--ink); color: var(--page); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
  opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; z-index: 30; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Connexion ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--ring); border-radius: 18px;
  box-shadow: var(--shadow); padding: 36px 32px 32px;
}
.login-card .mark { width: 44px; height: 44px; border-radius: 13px; font-size: 21px; }
.login-card h1 { margin: 22px 0 4px; font: 800 26px/1.1 var(--display); letter-spacing: -.03em; }
.login-card .sub { margin: 0 0 26px; color: var(--ink-2); }
.login-card label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.login-card input {
  width: 100%; height: 44px; border-radius: 11px; border: 1px solid var(--hair); background: var(--page); color: var(--ink);
  font: inherit; font-size: 15px; padding: 0 14px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.login-card input:focus { border-color: var(--axis); box-shadow: 0 0 0 4px var(--ring); }
.login-card .go { width: 100%; height: 44px; margin-top: 16px; justify-content: center; font-weight: 600; font-size: 14.5px; border-radius: 11px; }
.login-card .err { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--crit); }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
