/* Poche app layout — mobile first, centred column on desktop. */
body { background: var(--surface); }
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; background: var(--bg); padding: 16px 16px 112px; position: relative; }
@media (min-width: 600px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding: 24px 24px 120px; } }

.top { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 20px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 22px; letter-spacing: -.04em; color: var(--ink); text-decoration: none; }
.logo i { width: 28px; height: 28px; border-radius: 10px; background: var(--lime); display: grid; place-items: center; font-style: normal; color: var(--forest); font-size: 16px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--lime); color: var(--forest); display: grid; place-items: center; font-weight: 800; border: 0; cursor: pointer; }

/* Bottom tab bar */
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; background: var(--bg); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 20; }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none; font-size: 12px; font-weight: 700; color: var(--faint); border-radius: 16px; position: relative; }
.tabs a b { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--lime-soft); }
.tabs a[aria-current="page"] b { filter: none; opacity: 1; }
.tabs .dot { position: absolute; top: 4px; right: calc(50% - 22px); width: 10px; height: 10px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }

/* Hero total */
.total { position: relative; overflow: hidden; }
.total .big { color: var(--lime); }
.total .blob { position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(159, 232, 112, .12); }
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 16px; }
.bar > i { display: block; height: 100%; background: var(--lime); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.light { background: var(--surface); }
.bar.light > i { background: var(--forest); }

/* Score ring */
.ring { --p: 50; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lime) calc(var(--p) * 1%), var(--surface) 0); flex: none; }
.ring > span { width: 60px; height: 60px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 900; font-size: 20px; }

/* Lists */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface); }
.item .ic { width: 48px; height: 48px; border-radius: 16px; background: var(--surface); display: grid; place-items: center; font-size: 24px; flex: none; }
.item .main { flex: 1; min-width: 0; }
.item .main b { display: block; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .main small { color: var(--faint); font-size: 14px; }
.item .end { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .end small { display: block; font-weight: 600; color: var(--faint); font-size: 13px; }
.item.off { opacity: .55; }
.item.off .end { text-decoration: line-through; }

.section { margin: 28px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section h2 { margin: 0; }

/* Missions */
.mission { display: flex; gap: 14px; align-items: flex-start; }
.mission .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--lime-soft); display: grid; place-items: center; font-size: 22px; flex: none; }
.mission .save { margin-left: auto; }
.mission p { margin: 2px 0 12px; color: var(--muted); font-size: 15px; }

/* Chips row (filters, catalogue) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--lime); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { border: 2px solid var(--line); background: var(--card); border-radius: 20px; padding: 14px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; text-align: center; min-height: 96px; justify-content: center; position: relative; }
.tile span { font-size: 28px; }
.tile[aria-pressed="true"] { border-color: var(--forest); background: var(--lime-soft); }
.tile[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--forest); color: var(--lime); font-size: 13px; display: grid; place-items: center; }

/* Bottom sheet */
.scrim { position: fixed; inset: 0; background: rgba(14, 15, 12, .45); z-index: 40; animation: fade .2s ease; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 12px 20px calc(28px + env(safe-area-inset-bottom)); z-index: 41; animation: up .28s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
.sheet .close { position: sticky; top: 0; float: right; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); font-size: 20px; cursor: pointer; z-index: 2; }
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { background: var(--surface); border-radius: var(--radius-s); padding: 12px 14px; }
.fact small { display: block; color: var(--faint); font-size: 13px; font-weight: 600; }
.fact b { font-size: 17px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 10px 0; }
.steps li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--forest); font-weight: 900; display: grid; place-items: center; }
.law { border-left: 4px solid var(--lime); padding: 12px 16px; background: var(--surface); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.letter { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; white-space: pre-wrap; background: var(--surface); border-radius: var(--radius-s); padding: 16px; max-height: 280px; overflow: auto; border: 0; width: 100%; min-height: 280px; }

/* Le Tri — swipe cards */
.deck { position: relative; height: 420px; margin: 8px 0 16px; }
.swipe { position: absolute; inset: 0; background: var(--card); border: 1px solid var(--line); border-radius: 32px; box-shadow: var(--shadow); padding: 28px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; touch-action: pan-y; user-select: none; transition: transform .3s ease, opacity .3s ease; }
.swipe.under { transform: scale(.94) translateY(16px); opacity: .7; }
.swipe .emo { font-size: 64px; line-height: 1; margin-bottom: 12px; }
.swipe .price { font-size: 32px; font-weight: 900; letter-spacing: -.03em; }
.swipe .stamp { position: absolute; top: 24px; padding: 6px 14px; border: 4px solid; border-radius: 12px; font-weight: 900; font-size: 22px; transform: rotate(-12deg); opacity: 0; }
.swipe .stamp.yes { left: 20px; color: var(--forest); border-color: var(--lime); background: var(--lime); }
.swipe .stamp.no { right: 20px; color: var(--danger); border-color: var(--danger); transform: rotate(12deg); }
.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.answer { border: 2px solid var(--line); border-radius: 20px; background: var(--card); padding: 12px 4px; cursor: pointer; font-weight: 750; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 84px; justify-content: center; }
.answer span { font-size: 28px; }
.answer:hover { border-color: var(--forest); }
.stepper { display: flex; align-items: center; gap: 16px; justify-content: center; margin: 12px 0; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface); font-size: 24px; font-weight: 800; cursor: pointer; }
.stepper output { font-size: 36px; font-weight: 900; min-width: 56px; text-align: center; }

/* Celebration */
.party { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--forest); color: #fff; text-align: center; padding: 24px; animation: fade .25s ease; }
.party .big { color: var(--lime); font-size: clamp(40px, 13vw, 88px); }
.party > div { width: 100%; max-width: 420px; position: relative; }
.party canvas { position: fixed; inset: 0; pointer-events: none; }

/* Toast */
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 70; animation: up2 .25s ease; max-width: calc(100% - 32px); text-align: center; }
@keyframes up2 { from { opacity: 0; transform: translate(-50%, -12px); } }
.btn-block { white-space: normal; text-align: center; }
.mission .row-between { flex-wrap: wrap; gap: 6px; }

/* Drop zone */
.drop { border: 3px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer; display: block; }
.drop:hover, .drop.on { border-color: var(--forest); background: var(--lime-soft); }
.drop input { display: none; }

.empty { text-align: center; padding: 32px 16px; }
.empty .emo { font-size: 56px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { text-align: center; padding: 14px 6px; border-radius: 20px; background: var(--surface); font-size: 12px; font-weight: 700; }
.badge span { display: block; font-size: 30px; margin-bottom: 4px; }
.badge.locked { opacity: .35; filter: grayscale(1); }
.plans { display: grid; gap: 12px; }
.plan { border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; background: var(--card); }
.plan.best { border-color: var(--forest); }
.plan .tag { position: absolute; top: -12px; left: 20px; }
.plan ul { padding: 0; margin: 12px 0 16px; list-style: none; }
.plan li { padding: 4px 0 4px 28px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: var(--forest); font-size: 12px; font-weight: 900; display: grid; place-items: center; top: 6px; }
.loading { display: grid; place-items: center; min-height: 60dvh; font-size: 40px; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.card-flat .btn-ghost { background: var(--card); border: 1px solid var(--line); }
/* Explainer film */
.film-thumb { position: relative; display: block; width: 100%; aspect-ratio: 9 / 10; border: 0; padding: 0; border-radius: var(--radius); overflow: hidden; cursor: pointer; background: var(--surface); box-shadow: var(--shadow); }
.film-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.film-thumb .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; background: var(--lime); color: var(--forest); display: grid; place-items: center; font-size: 26px; box-shadow: 0 10px 30px rgba(22, 51, 0, .3); transition: transform .2s var(--ease); }
.film-thumb:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.film-thumb b { position: absolute; left: 16px; bottom: 16px; background: var(--forest); color: var(--lime); padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.film-sheet { border-radius: 24px; overflow: hidden; background: var(--surface); aspect-ratio: 9 / 16; max-height: 64dvh; margin: 12px auto 0; }
.film-sheet video { width: 100%; height: 100%; object-fit: contain; display: block; }
