@import url("/css/tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--sand); color: var(--navy);
  font-family: var(--ui); font-size: 17px; line-height: 1.5;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--coral-dk); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--coral-dk); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot { min-height: 100dvh; margin: 0; display: grid; place-items: center; align-content: center; gap: 10px;
  font-family: var(--display); font-size: 1.6rem; }
.boot-error { min-height: 100dvh; max-width: 420px; margin: 0 auto; padding: 24px 16px; display: grid; align-content: center; }
.error-card p { margin: 0; }
.error-card .btn { margin-top: 16px; }

/* layout */
.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.screen { padding: 18px 16px 28px; }
.screen h1, .screen h2 { font-family: var(--display); font-weight: 400; line-height: 1.05; margin: 0 0 10px; }
.screen h1 { font-size: 2rem; }
.screen h2 { font-size: 1.4rem; }
.lede { color: var(--ink-2); margin: 0 0 18px; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; }

/* header */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--sand-glass);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 2px solid var(--navy-hairline);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy);
  font-family: var(--display); font-size: 1.4rem; }
.brand img { width: 44px; height: auto; }
.coin-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px;
  border: 2.5px solid var(--navy); background: var(--foam); box-shadow: var(--pop-sm); font-weight: 800;
  text-decoration: none; color: var(--navy); min-height: 44px;
}
.coin { width: 26px; height: 26px; flex: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.home-chip {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 2.5px solid var(--navy); background: var(--foam); box-shadow: var(--pop-sm); color: var(--navy);
}
.home-icon { width: 22px; height: 22px; }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: var(--foam); border-top: 2.5px solid var(--navy); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar nav { width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(4, 1fr); }
.tab {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 9px 4px 8px; text-decoration: none;
  color: var(--muted); font-size: .78rem; font-weight: 800;
}
.tab span { font-size: .82rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.tab svg { width: 28px; height: 28px; }
.tab[aria-current="page"] { color: var(--coral-dk); }
.tab-badge {
  position: absolute; top: 4px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--coral); color: var(--white); font-size: .72rem; display: grid; place-items: center; border: 2px solid var(--foam);
}

/* controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border-radius: 999px; border: 2.5px solid var(--navy); background: var(--foam); color: var(--navy);
  font-weight: 800; font-size: 1rem; text-decoration: none; cursor: pointer; box-shadow: var(--pop-sm);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--navy); }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--coral-dk); color: var(--white); }
.btn-navy { background: var(--navy); color: var(--foam); box-shadow: 4px 4px 0 var(--mustard); }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: 0; box-shadow: none; padding: 0; color: var(--coral-dk); text-decoration: underline;
  display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; cursor: pointer; /* a full-size touch target */
}
.field { display: grid; gap: 6px; font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 16px; border: 2.5px solid var(--navy);
  background: var(--foam); font-weight: 600;
}
.field textarea { min-height: 96px; resize: vertical; }
.field small { font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--navy); background: var(--foam);
  font-weight: 700; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--navy); color: var(--foam); }

/* cards, notices, sheets, toasts */
.card { background: var(--foam); border: 2.5px solid var(--navy); border-radius: 22px; box-shadow: var(--pop-sm); padding: 16px; }
.notice { border-radius: 18px; padding: 14px 16px; background: var(--mint); border: 2px solid var(--navy); font-weight: 600; }
.notice.warn { background: var(--mustard-lt); }
.notice.stack > p { margin: 0; }
.empty { text-align: center; padding: 34px 12px; color: var(--ink-2); }
.empty img { width: 110px; margin: 0 auto 12px; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: var(--navy-scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; background: var(--foam); border-radius: 26px 26px 0 0; border: 2.5px solid var(--navy);
  border-bottom: 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 14px;
}
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: var(--navy); color: var(--foam);
  font-weight: 700; box-shadow: 4px 4px 0 var(--mustard);
}
.skeleton { background: linear-gradient(90deg, var(--sand-2), var(--foam), var(--sand-2)); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite; border-radius: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- frame, sign-in, profile ---------- */
/* The chevron is a data: URI, which can't read custom properties: its stroke is --navy (#1D2B4F) spelled out. */
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231D2B4F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 42px;
}

/* Sign-in and the first profile screen sit outside .shell (no header, no tab bar), so each is its own
   column, centred both ways in the window on phones and computers alike. Their way back is pinned to the
   column's top-left corner, out of the flow, so it never pushes the content off centre; the padding is
   the same top and bottom for the same reason. */
.signin, .profile {
  position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 100dvh;
  margin: 0 auto; padding-block: calc(64px + env(safe-area-inset-top)) calc(64px + env(safe-area-inset-bottom));
}
.signin { max-width: 440px; text-align: center; gap: 2px; }
.profile { max-width: 560px; }
.screen-back { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 16px; font-weight: 800; }
.signin-hero { position: relative; display: grid; place-items: center; min-height: 168px; margin: 0 0 6px; }
.signin-hero::before {
  content: ""; position: absolute; width: 168px; height: 168px; border-radius: 50%;
  background: var(--blush); z-index: -1;
}
.signin-crab { width: 128px; height: auto; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.signin h1 { text-align: center; }
.signin .lede { text-align: center; max-width: 32ch; margin: 0 auto 24px; }
.signin form { text-align: left; }
.signin-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 2px; }
.signin-links .btn-link { font-size: .92rem; }
.signin-links > :only-child { margin: 0 auto; } /* a lone link (demo mode) sits under the button's centre */
.signin-foot { display: flex; justify-content: center; margin: 18px 0 0; }
.signin-foot .btn-link { font-size: .92rem; color: var(--ink-2); }

.error-text { margin: -6px 0 0; color: var(--coral-dk); font-weight: 700; font-size: .92rem; }

.profile .lede { max-width: 44ch; }

.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-danger { background: var(--brick); color: var(--white); }

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

/* ---------- plage, pièce ---------- */
.feed-weather {
  display: inline-flex; align-items: center; margin: -4px 0 16px; padding: 6px 14px; border-radius: 999px;
  background: var(--sky-2); border: 2px solid var(--navy); font-weight: 700; font-size: .88rem;
}

.filter-scope { margin-bottom: 4px; }
.filter-row {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 10px; padding: 2px 16px 6px; scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row .chip { flex: none; white-space: nowrap; }

.feed-size-field { max-width: 240px; margin: 2px 0 22px; }

.feed-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 4px; }
.feed-card { display: grid; padding: 0; overflow: hidden; text-decoration: none; color: var(--navy); }
.feed-card.skeleton { aspect-ratio: 3 / 4.3; }
.feed-thumb {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--sand-2);
  border-bottom: 2.5px solid var(--navy);
}
.feed-thumb-empty { display: grid; place-items: center; }
.feed-thumb-empty img { width: 38%; opacity: .45; }
.feed-card-body { display: grid; gap: 4px; padding: 10px 12px 12px; }
.feed-card-title {
  margin: 0; font-weight: 800; font-size: .94rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feed-card-size { margin: 0; font-size: .82rem; }
.feed-card-where { margin: 0; font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.price-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; margin-top: 2px;
  background: var(--mustard); font-size: .88rem; cursor: default;
}
.coin-sm { width: 17px; height: 17px; flex: none; }

.empty[data-t="feed-empty"] img { animation: bob 2.6s ease-in-out infinite; }

.piece-back { margin: 0 0 2px; font-weight: 800; }

.piece-carousel-wrap { position: relative; margin: 0 -16px 18px; }
.piece-carousel {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-top: 2.5px solid var(--navy); border-bottom: 2.5px solid var(--navy); background: var(--sand-2);
}
.piece-carousel::-webkit-scrollbar { display: none; }
.piece-photo { flex: 0 0 100%; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; scroll-snap-align: start; }
.piece-skeleton-photo { aspect-ratio: 1 / 1; }
.piece-skeleton-line { height: 18px; border-radius: 8px; }
/* The strip lets swipes through to the carousel underneath; only the dots themselves catch taps. */
.piece-dots { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; pointer-events: none; }
/* Each dot is a 44px touch target; the visible dot is drawn inside it. */
.piece-dot {
  pointer-events: auto; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center;
}
.piece-dot::before {
  content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--navy); background: var(--foam);
  box-shadow: 1px 1px 0 var(--navy);
}
.piece-dot[aria-current="true"]::before { background: var(--coral-dk); }
.piece-dot:focus-visible { outline: none; }
.piece-dot:focus-visible::before { outline: 3px solid var(--coral-dk); outline-offset: 3px; }

.piece-title { margin-top: 2px; }
.piece-category { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-weight: 800; color: var(--ink-2); }
.piece-garment { width: 42px; height: auto; color: var(--navy); flex: none; }

.piece-meta { margin: 0 0 16px; }
.piece-description { margin: 0 0 18px; max-width: 60ch; }
.piece-by { margin: 0 0 22px; font-weight: 700; color: var(--ink-2); }
.piece-where { margin: -6px 0 14px; font-weight: 700; color: var(--ink-2); }

.piece-reserve {
  padding: 18px; background: var(--foam); border: 2.5px solid var(--navy); border-radius: var(--r-md);
  box-shadow: var(--pop-sm);
}
.piece-price { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--display); font-size: 2.1rem; }
.piece-price .coin { width: 30px; height: 30px; flex: none; }
.piece-suggested { margin: -8px 0 0; }
.piece-reserve .error-text { margin: 0; text-align: center; }
.reserve-mine { margin: 0; text-align: center; font-weight: 700; }

@media (min-width: 720px) {
  .piece-carousel-wrap { margin-left: 0; margin-right: 0; border-radius: var(--r-md); overflow: hidden; }
  .piece-carousel { border-radius: var(--r-md); }
}

/* ---------- donner ---------- */
.give-section { margin: 0 0 22px; }
.give-section h2 { font-size: 1.15rem; margin: 0 0 10px; }
.give .field { margin: 0 0 22px; }

/* photo picker */
.photo-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.photo-tile {
  position: relative; width: 96px; height: 96px; flex: none; border-radius: 18px; overflow: hidden;
  border: 2.5px solid var(--navy); background: var(--sand-2); box-shadow: var(--pop-sm);
}
.photo-tile.is-error { border-color: var(--coral-dk); background: var(--blush); }
.photo-tile-img { width: 100%; height: 100%; object-fit: cover; }
.photo-cover {
  position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 999px; background: var(--mustard);
  border: 1.5px solid var(--navy); font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
}
.photo-tile-msg {
  position: absolute; inset: 0; padding: 8px 8px 36px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; text-align: center; color: var(--coral-dk); background: var(--blush-veil);
}
.photo-tile-msg-icon { width: 17px; height: 17px; flex: none; }
.photo-tile-msg-text {
  margin: 0; font-size: .66rem; font-weight: 700; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.photo-ring { position: absolute; inset: 0; margin: auto; width: 36px; height: 36px; transform: rotate(-90deg); }
.photo-ring-bg, .photo-ring-fg { fill: none; stroke-width: 3.5; }
.photo-ring-bg { stroke: var(--foam-track); }
.photo-ring-fg { stroke: var(--foam); stroke-linecap: round; transition: stroke-dashoffset .15s var(--ease-out); }
/* A 44px touch target in the tile's corner; the visible round button is drawn inside it. */
.photo-remove {
  position: absolute; right: 0; bottom: 0; width: 44px; height: 44px; padding: 0; border: 0; background: none;
  color: var(--navy); display: grid; place-items: center; cursor: pointer;
}
.photo-remove::before {
  content: ""; grid-area: 1 / 1; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--navy);
  background: var(--foam); box-shadow: 1px 1px 0 var(--navy);
}
.photo-remove svg { grid-area: 1 / 1; position: relative; width: 13px; height: 13px; }
.photo-remove:focus-visible { outline: none; }
.photo-remove:focus-visible::before { outline: 3px solid var(--coral-dk); outline-offset: 2px; }
.photo-actions { display: flex; gap: 10px; }
.photo-btn { flex: 1; }
.photo-btn svg { width: 20px; height: 20px; }

/* category grid */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.category-tile {
  display: grid; justify-items: center; gap: 6px; padding: 14px 4px 10px; border-radius: 18px;
  border: 2.5px solid var(--navy); background: var(--foam); box-shadow: var(--pop-sm); cursor: pointer;
  font-size: .78rem; font-weight: 700; text-align: center; color: var(--navy);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background .12s var(--ease-out);
}
.category-tile:active { transform: translate(2px, 2px); box-shadow: none; }
.category-tile-icon { width: 34px; height: auto; color: var(--navy); }
.category-tile[aria-pressed="true"] {
  background: var(--navy); color: var(--foam); box-shadow: 4px 4px 0 var(--mustard); transform: translate(-1px, -1px);
}
.category-tile[aria-pressed="true"] .category-tile-icon { color: var(--foam); }

/* tier / condition hint chips */
.hint-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hint-chip {
  display: grid; gap: 3px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--navy);
  background: var(--foam); text-align: left; cursor: pointer;
}
.hint-chip-label { font-weight: 800; }
.hint-chip-hint { font-size: .78rem; color: var(--muted); }
.hint-chip[aria-pressed="true"] { background: var(--navy); color: var(--foam); }
.hint-chip[aria-pressed="true"] .hint-chip-hint { color: var(--sky-2); }

/* live value */
.give-value { text-align: center; }
.give-value-amount {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0;
  font-family: var(--display); font-size: 2.4rem;
}
.give-value-amount .coin { width: 30px; height: 30px; flex: none; }
.give-value-hint { margin: 2px 0 16px; }
.give-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0;
}
.give-slider::-webkit-slider-runnable-track {
  height: 10px; border-radius: 999px; background: var(--sand-2); border: 2px solid var(--navy);
}
.give-slider::-moz-range-track {
  height: 10px; border-radius: 999px; background: var(--sand-2); border: 2px solid var(--navy);
}
.give-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%;
  background: var(--coral-dk); border: 2.5px solid var(--navy); box-shadow: var(--pop-sm); cursor: pointer;
}
.give-slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%; background: var(--coral-dk); border: 2.5px solid var(--navy);
  box-shadow: var(--pop-sm); cursor: pointer;
}

.give-missing { margin: 4px 0 14px; text-align: center; }

/* welcome progress (also used by Moi, Task 7) */
.welcome-card { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--mint); border: 2px solid var(--navy); }
.welcome-card.welcome-done { background: var(--blush); text-align: center; font-weight: 700; }
.welcome-card p { margin: 0; }
.welcome-bar { height: 12px; border-radius: 999px; background: var(--foam); border: 2px solid var(--navy); overflow: hidden; }
.welcome-bar-fill { height: 100%; background: var(--coral-dk); transition: width .2s var(--ease-out); }
.welcome-progress-text { font-weight: 800; }
.welcome-message { color: var(--ink-2); }

@media (min-width: 720px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- échanges ---------- */

/* Échanges list */
.swaps-empty-cta[data-t] { margin-top: 14px; }
.swap-row {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); position: relative;
}
.swap-row-garment { width: 44px; height: auto; flex: none; color: var(--navy); }
.swap-row-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.swap-row-title {
  margin: 0; font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swap-row-sub { margin: 0; font-size: .84rem; }
.swap-row-step { margin: 2px 0 0; font-size: .9rem; font-weight: 600; }
.badge-turn {
  flex: none; background: var(--coral-dk); color: var(--white); cursor: default; min-height: 30px; padding: 0 12px;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .02em;
}

/* Échange header */
.swap-header { display: grid; gap: 10px; }
.swap-header-top { display: flex; align-items: center; gap: 12px; }
.swap-garment { width: 46px; height: auto; flex: none; color: var(--navy); }
.swap-header-info { display: grid; gap: 2px; min-width: 0; flex: 1; }
.swap-listing-title {
  margin: 0; font-family: var(--display); font-size: 1.3rem; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swap-step { margin: 2px 0 0; font-weight: 700; }
.swap-expires { margin: 0; font-size: .86rem; }
.swap-back { margin: 0 0 2px; font-weight: 800; }
.swap-giver-warning { margin: -6px 0 16px; }

/* Spots, offers */
.spot-group + .spot-group { margin-top: 14px; }
.spot-group-title { font-family: var(--ui); font-size: .95rem; font-weight: 800; margin: 0 0 8px; }
.spot-more { margin-top: 14px; }
.spot-more > summary { cursor: pointer; font-weight: 800; color: var(--coral-dk); min-height: 44px; display: flex; align-items: center; }
.spot-more[open] > summary { margin-bottom: 8px; }
.offer-card {
  display: block; width: 100%; text-align: left; background: var(--foam); border: 2px solid var(--navy);
  border-radius: var(--r-md); padding: 14px 16px; cursor: default;
}
.offer-choice { cursor: pointer; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out); }
.offer-choice:active { transform: translate(2px, 2px); }
.offer-choice[aria-pressed="true"] { background: var(--navy); color: var(--foam); box-shadow: var(--pop-sm); border-color: var(--navy); }
.offer-choice[aria-pressed="true"] .muted { color: var(--sky-2); }
.offer-spot { margin: 0; font-weight: 800; }

/* Slot picker */
.slot-picker { display: grid; gap: 10px; }
.slot-days { margin-bottom: 0; }
.slot-day { flex: none; white-space: nowrap; position: relative; }
.slot-day.has-picks::after {
  content: ""; position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--coral-dk);
}
.slot-count { margin: 0; font-size: .84rem; }
.slot-empty { margin-top: 4px; }
.slot-times .chip[aria-pressed="true"] { background: var(--coral-dk); color: var(--white); border-color: var(--coral-dk); }

/* Meeting card */
.meet-card { text-align: center; display: grid; gap: 4px; padding: 20px 16px; }
.meet-spot { margin: 0; font-family: var(--display); font-size: 1.5rem; }
.meet-countdown {
  justify-self: center; margin-top: 8px; background: var(--mustard); cursor: default; min-height: 32px;
}

/* Quick messages + log */
.quick-messages { margin: 16px 0 0; }
.swap-messages { margin-top: 18px; }
.swap-messages h2 { font-size: 1.05rem; }
.message-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.message-log li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; padding: 10px 14px; border-radius: 14px;
  background: var(--foam); border: 2px solid var(--navy);
}
.message-who { font-weight: 800; }
.message-text { flex: 1; }
.message-time { font-size: .8rem; }

/* Code entry (giver types the receiver's code) */
.code-entry { display: grid; gap: 14px; margin-top: 16px; }
.code-input {
  text-align: center; font-family: var(--display); font-size: 1.7rem; letter-spacing: .35em; text-indent: .35em;
}

/* Code reveal (receiver's full-screen "show my code" moment) */
.code-reveal {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 30%, var(--navy-2), var(--navy) 70%); color: var(--foam); text-align: center;
}
.code-reveal-close {
  position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 2px solid var(--foam); background: transparent; color: var(--foam); display: grid;
  place-items: center; cursor: pointer;
}
.code-reveal-body { display: grid; gap: 14px; max-width: 340px; }
.code-reveal-label { margin: 0; font-family: var(--display); font-size: 1.5rem; }
.code-reveal-digits { margin: 0; display: flex; justify-content: center; gap: 8px; }
.code-reveal-digits span {
  display: grid; place-items: center; width: 44px; height: 58px; border-radius: 14px; background: var(--foam);
  color: var(--navy); font-family: var(--display); font-size: 2rem; box-shadow: 3px 3px 0 var(--mustard);
}
.code-reveal-hint { margin: 6px 0 0; color: var(--sky-2); font-weight: 600; }

/* Handover success + done summaries */
.swap-celebrate, .swap-done { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 26px 16px; }
.swap-celebrate { background: var(--mint); }
.celebrate-title { margin: 0; font-size: 1.3rem; }
.celebrate-coin { width: 46px; height: 46px; color: var(--coral-dk); animation: bob 2.6s ease-in-out infinite; }
.celebrate-amount { margin: 0; font-family: var(--display); font-size: 2rem; }
.swap-done-garment { width: 46px; height: auto; color: var(--muted); }

.swap-cancel { margin-top: 8px; }

@media (min-width: 720px) {
  .code-reveal-digits span { width: 50px; height: 66px; font-size: 2.2rem; }
}

/* ---------- moi ---------- */
.me-section { margin: 0 0 30px; }
.me-section:last-child { margin-bottom: 0; }
.me-section h2 { font-size: 1.15rem; margin: 0 0 12px; }

/* Bernis card */
.wallet-card { display: grid; gap: 6px; padding: 22px 16px; text-align: center; }
.wallet-amount {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0;
  font-family: var(--display); font-size: 2.6rem;
}
.wallet-amount .coin { width: 34px; height: 34px; flex: none; }
.wallet-caption { margin: 0; font-weight: 700; }
.wallet-held { margin: 10px 0 0; padding-top: 10px; border-top: 2px solid var(--sand-2); font-weight: 700; }

.history-block { margin-top: 18px; }
.history-block > p { margin: 0; } /* the grid gap already spaces the empty state from its heading */
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border-radius: 16px; background: var(--foam); border: 2px solid var(--navy);
}
.history-info { display: grid; gap: 1px; min-width: 0; }
.history-kind { margin: 0; font-weight: 800; }
.history-time { margin: 0; font-size: .82rem; }
.history-amount { margin: 0; flex: none; font-weight: 800; font-family: var(--display); font-size: 1.05rem; }
.history-amount.plus { color: var(--leaf); }
.history-amount.minus { color: var(--navy); }

/* Mes pièces */
.piece-row { display: flex; gap: 14px; align-items: flex-start; }
.piece-row-thumb {
  width: 64px; height: 64px; flex: none; border-radius: 16px; object-fit: cover;
  border: 2px solid var(--navy); background: var(--sand-2);
}
.piece-row-thumb-empty { display: grid; place-items: center; }
.piece-row-garment { width: 60%; height: auto; color: var(--muted); }
.piece-row-body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.piece-row-title {
  margin: 0; font-weight: 800; font-size: 1rem; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-chip { cursor: default; }
.status-available { background: var(--mint); }
.status-reserved { background: var(--sky-2); }
.status-given { background: var(--sand-2); color: var(--muted); }
.piece-row-actions { display: flex; gap: 18px; }
.piece-row-edit { color: var(--navy); }
.piece-row-withdraw { color: var(--coral-dk); }
.piece-row.skeleton { height: 92px; }

/* Edit-piece sheet reuses .give-value / .give-slider / .sheet-actions from Donner */

/* Account actions */
.me-account { display: grid; gap: 14px; margin-top: 4px; text-align: center; }
.me-delete-link { justify-self: center; color: var(--coral-dk); font-size: .92rem; }
.me-privacy-link { justify-self: center; color: var(--ink-2); font-size: .92rem; margin-top: -10px; }

/* ---------- profils ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 50%;
  border: 2px solid var(--navy); background: var(--sand-2);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 100%; height: 100%; }
.avatar-sm { width: 30px; height: 30px; border-width: 1.5px; }
.avatar-md { width: 52px; height: 52px; }
.avatar-lg { width: 96px; height: 96px; border-width: 2.5px; }
.avatar-blush { background: var(--blush); }
.avatar-mint { background: var(--mint); }
.avatar-sky { background: var(--sky); }
.avatar-mustard { background: var(--mustard-lt); }
.avatar-gone { border-color: var(--muted); }

.person-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: inherit; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}

.member-back { margin: 0 0 2px; font-weight: 800; }
.profile-header { display: flex; align-items: center; gap: 16px; margin: 4px 0 12px; }
.profile-id { display: grid; gap: 2px; min-width: 0; }
.profile-id p { margin: 0; }
.screen .profile-name { margin: 0; overflow-wrap: anywhere; }
.profile-where { font-weight: 700; }
.profile-since { font-size: .9rem; }
.profile-verified { font-size: .88rem; font-weight: 700; color: var(--leaf); }
.profile-facts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; font-weight: 600; color: var(--ink-2); }
.profile-bio { margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; background: var(--foam); border: 2px solid var(--navy-hairline); }
.screen .profile-sizes h2 { font-size: 1.05rem; margin: 0 0 8px; }
.member-dressing { margin-top: 22px; }
.screen .member-dressing h2 { font-size: 1.15rem; margin: 0 0 12px; }

.me-profile-actions { display: grid; gap: 4px; justify-items: center; margin-top: 4px; }

/* « Modifier mon profil »: the form is taller than a phone screen, so the sheet scrolls.
   max-height is set twice on purpose: vh first as a fallback for iOS < 15.4 (no dvh support),
   then dvh, which wins in every browser that understands it. */
.sheet { max-height: 92vh; max-height: 92dvh; overflow-y: auto; }
.profile-editor h2 { margin: 0; }
.editor-photo { display: flex; align-items: center; gap: 16px; }
.editor-photo-actions { display: grid; gap: 4px; justify-items: start; }
.editor-hint { margin: 0; font-size: .85rem; }
.avatar-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-choice { padding: 3px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.avatar-choice[aria-pressed="true"] { outline: 3px solid var(--coral-dk); outline-offset: 1px; }
.editor-size-row { display: flex; gap: 8px; }
.editor-size-row input { flex: 1; min-width: 0; }
.bio-count.over { color: var(--coral-dk); }
.size-chip { cursor: pointer; }

/* Parrainage */
.invite-card { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start; background: var(--blush); }
.invite-card h2 { margin: 0; font-size: 1.1rem; }
.invite-card p { margin: 0; }
.invite-garment { width: 72px; height: 84px; color: var(--sky); }
.invite-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.invite-link { width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--navy); border-radius: 12px; background: var(--foam); }
.parrain-note { margin: 0 0 14px; }

/* Buying bernis */
.buy-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.buy-pack { display: grid; gap: 4px; justify-items: center; padding: 14px 8px; cursor: pointer; font: inherit; color: inherit; }
.buy-pack[aria-checked="true"] { background: var(--mustard-lt); box-shadow: 4px 4px 0 var(--navy); }
.buy-pack:disabled { opacity: .45; cursor: not-allowed; }
.buy-pack-bernis { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1.2rem; }
.buy-pack-price { color: var(--ink-2); font-weight: 700; }
.buy-sheet h2, .buy-sheet p { margin: 0; }
