/* Shippr Mini App. Стиль C, варіант e1 за вибором Павла 13.10: кремовий фон, товстий контур, жорстка тінь,
   фіолетовий лише головною площею, решта яскравими акцентами. Шрифти Dela Gothic One + Onest. */
:root {
  --paper: #FBF6EA;
  --panel: #FFFFFF;
  --ink: #25212F;
  --muted: #6A6274;
  --hint: #6A6274;
  --purple: #8054C7;
  --purple-d: #5E3A9E;
  --purple-l: #D9CBF3;
  --peach: #F7AE8C;
  --yellow: #FFD84D;
  --pink: #F6B1DC;
  --mint: #A8E6CB;
  --sky: #A9D2F2;
  --lime: #CDEB6A;
  --err: #B0263A;
  --line: 2.5px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-s: 2px 2px 0 var(--ink);
  --disp: "Dela Gothic One", "Onest", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--paper); color: var(--ink); overflow-x: clip; }
body {
  font: 15px/1.45 "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
b, strong { font-weight: 700; }

/* полоса прототипу поза Telegram */
.proto { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 520px; margin: 0 auto;
  padding: 8px 16px 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.proto select { max-width: 55%; font-size: 12px; padding: 4px 8px; border: 2px solid var(--ink); border-radius: 10px; background: var(--panel); }

/* шапка */
.hdr { display: flex; justify-content: space-between; align-items: center; gap: 10px; max-width: 520px; margin: 0 auto; padding: 12px 16px 0; }
.wordmark { font-family: var(--disp); font-size: 25px; line-height: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: var(--line); border-radius: 100px;
  padding: 3px 12px 3px 3px; box-shadow: var(--shadow-s); font-size: 13px; font-weight: 700; min-height: 40px; }
.coin { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: var(--yellow);
  font-family: var(--disp); font-size: 12px; font-variant-numeric: tabular-nums; }

main { max-width: 520px; margin: 0 auto; padding: 14px 16px 24px; }
h1 { font-family: var(--disp); font-weight: 400; font-size: 26px; line-height: 1.12; margin: 6px 0 10px; overflow-wrap: anywhere; }
h2 { font-family: var(--disp); font-weight: 400; font-size: 18px; line-height: 1.2; margin: 0 0 6px; }
h3 { font-family: var(--disp); font-weight: 400; font-size: 17px; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); }
.box { background: var(--panel); border: var(--line); box-shadow: var(--shadow); padding: 16px; border-radius: 18px; margin: 16px 0; }
.box.hl { background: var(--purple-l); }
.box.peach { background: var(--peach); }
.box.mint { background: var(--mint); }
.box > :last-child { margin-bottom: 0; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 7px 0; }
.line > * { min-width: 0; }
.tag { display: inline-block; background: var(--panel); border: 2px solid var(--ink); font-size: 11px; font-weight: 700; border-radius: 100px; padding: 2px 9px; }
.tag.ph { background: var(--peach); }
.tag.ok { background: var(--lime); }
.sticker { display: inline-block; background: var(--panel); border: 2px solid var(--ink); border-radius: 100px; padding: 1px 7px;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; transform: rotate(-6deg); }
.progress { background: var(--panel); border: 2px solid var(--ink); height: 14px; border-radius: 14px; margin: 12px 0; overflow: hidden; }
.progress > i { display: block; height: 100%; min-width: 6px; border-radius: inherit; background: var(--yellow); border-right: 2px solid var(--ink); transition: width .4s cubic-bezier(.2,.8,.2,1); }
.big { font-family: var(--disp); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 11px 16px; border-radius: 100px;
  font-weight: 700; margin-top: 12px; text-align: center; border: var(--line); background: var(--panel); box-shadow: var(--shadow-s);
  transition: transform .08s cubic-bezier(.2,.8,.2,1), box-shadow .08s cubic-bezier(.2,.8,.2,1); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn.pri { background: var(--purple); color: #fff; }
.btn.yel { background: var(--yellow); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.sm { display: inline-flex; width: auto; min-height: 36px; padding: 5px 14px; margin: 0; font-size: 13.5px; }
a.btn { text-decoration: none; color: var(--ink); }
.link { color: var(--purple-d); font-weight: 700; min-height: 40px; padding: 8px 0; }
.menu { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 14px; text-align: left; font-weight: 600;
  padding: 14px 16px; min-height: 52px; background: var(--panel); border: var(--line); border-radius: 14px; margin: 10px 0; box-shadow: var(--shadow-s); }
.menu span:last-child { color: var(--muted); white-space: nowrap; }
.row { border-bottom: 2px dashed #D8D0C2; padding: 12px 0; }
.row:last-child { border-bottom: 0; }
.note { color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.err { color: var(--err); font-size: 13px; font-weight: 600; min-height: 1em; margin-top: 8px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.seg button { border: var(--line); background: var(--panel); border-radius: 100px; padding: 6px 14px; min-height: 40px; font-size: 13.5px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--yellow); box-shadow: var(--shadow-s); }
ol { padding-left: 21px; margin: 10px 0 14px; } li { margin-bottom: 7px; }

/* форми */
.form label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 700; }
.form input, .form select, .form textarea { display: block; width: 100%; border: var(--line); background: var(--panel);
  border-radius: 14px; padding: 11px 12px; font-size: 16px; }
.form textarea { min-height: 100px; resize: vertical; }
.form .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 0; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--purple); }

/* дії запуску */
.acts { border: var(--line); border-radius: 18px; overflow: hidden; margin: 14px 0 6px; background: var(--panel); box-shadow: var(--shadow); }
.act { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 14px; border-top: 2px solid var(--ink); }
.act:first-child { border-top: 0; }
.act .chk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.act.done .chk { background: var(--lime); }
.act.review .chk { background: var(--yellow); }
.act .lbl b { display: block; }
.act .lbl span { color: var(--muted); font-size: 12.5px; }
.act .pts { font-family: var(--disp); font-size: 15px; }
.act.missed { opacity: .5; }

/* головна: дія дня */
.day { position: relative; overflow: hidden; background: var(--purple); color: #fff; border: var(--line); box-shadow: var(--shadow);
  border-radius: 22px; padding: 18px 18px 18px; margin: 16px 0 0; min-height: 230px; }
.day .eyebrow { color: #fff; opacity: .85; }
.day h1 { width: 64%; font-size: 24px; margin: 4px 0 6px; }
.day p { width: 60%; font-size: 13px; font-weight: 600; opacity: .92; margin: 0; }
.day .pal { position: absolute; right: -14px; top: 18px; }
.day .btn { margin-top: 20px; position: relative; color: var(--ink); background: var(--yellow); justify-content: space-between; padding: 0 20px; min-height: 56px; font-size: 16px; }
.day .btn em { font-style: normal; font-family: var(--disp); font-size: 20px; }

/* інструменти */
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.sec h2 { margin: 0; }
.tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.tool { position: relative; display: block; text-align: left; border: var(--line); border-radius: 16px; padding: 12px; min-height: 96px; }
.tool .ti { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); }
.tool .ti img, .tool .ti svg { width: 19px; height: 19px; }
.tool b { display: block; margin-top: 9px; font-size: 13.5px; line-height: 1.2; }
.tool small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.tool .sticker { position: absolute; right: 8px; top: 9px; }
.tool.on { grid-column: span 2; display: flex; align-items: center; gap: 12px; min-height: 0; padding: 14px; background: var(--peach); box-shadow: var(--shadow); }
.tool.on b { margin: 0; font-family: var(--disp); font-weight: 400; font-size: 18px; }
.tool.on .ti { width: 46px; height: 46px; }
.tool.on .ti img { width: 24px; height: 24px; }
.tool.on .sticker { position: static; margin-left: auto; background: var(--lime); }
.tool.soon { opacity: .96; }
.tools.list { grid-template-columns: minmax(0, 1fr); }
.tools.list .tool.on { grid-column: auto; }

/* герой і успіх */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; margin: 4px 0 2px; }
.bubble { background: var(--panel); border: var(--line); box-shadow: var(--shadow-s); border-radius: 18px 18px 18px 4px; padding: 11px 13px; font-size: 14px; }
.bubble b { display: block; }
.center { display: grid; justify-items: center; text-align: center; padding-top: 12px; }
.center h1 { margin-top: 6px; }

/* створення: шит */
.choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: var(--line); border-radius: 18px; padding: 14px; margin: 12px 0; box-shadow: var(--shadow); }
.choice .ti { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); flex: none; }
.choice b { display: block; font-family: var(--disp); font-weight: 400; font-size: 17px; }
.choice span span { display: block; font-size: 12.5px; font-weight: 600; }

/* рейтинг */
.lb { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 2px dashed #D8D0C2; }
.lb.me { background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; padding: 10px 8px; margin: 4px -8px; }
.lb .rk { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.lb .nm span { display: block; color: var(--muted); font-size: 12px; }
.lb .p { font-family: var(--disp); font-variant-numeric: tabular-nums; }
.lb .p.low { color: var(--muted); }
.thr { font-size: 11px; color: var(--purple-d); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 10px 0 2px; border-bottom: 2.5px dashed var(--purple); }

/* таб-бар з центральною кнопкою */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: var(--line); }
#nav[hidden] { display: none; }
#nav button { color: var(--muted); padding: 6px 2px; display: flex; align-items: center; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; min-height: 52px; }
#nav button svg { width: 22px; height: 22px; }
#nav button[aria-current="page"] { color: var(--purple-d); }
#nav .fab { justify-self: center; width: 62px; height: 62px; min-height: 0; margin-top: -34px; padding: 0; justify-content: center; border-radius: 50%;
  border: var(--line); background: var(--purple); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
#nav .fab svg { width: 28px; height: 28px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 700; padding: 4px 12px; min-height: 36px; margin-bottom: 6px;
  border: 2px solid var(--ink); border-radius: 100px; background: var(--panel); }

.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; border: 2px solid var(--ink);
  max-width: calc(100% - 32px); box-shadow: 4px 4px 0 var(--purple); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.mascot-bob { transform-origin: 50% 100%; animation: bob 3.2s ease-in-out infinite;
  filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink)); }
@keyframes bob { 50% { transform: translateY(-2px); } }
@media (max-width: 360px) { main { padding: 12px 12px 20px; } .hdr { padding-left: 12px; padding-right: 12px; } .day h1 { font-size: 21px; } }

/* ── анімації ── */
.enter > *, .enter .tools > *, .enter .home-side > * { animation: rise .42s cubic-bezier(.2,.9,.25,1.15) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.day { animation: pop .5s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes pop { from { transform: scale(.94) rotate(-1deg); opacity: 0; } }
.day .btn { animation: nudge 2.8s ease-in-out 1.2s infinite; }
@keyframes nudge { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-2deg) scale(1.03); } 95% { transform: rotate(2deg) scale(1.03); } }
.day .btn:active { animation: none; }
.tool { transition: transform .18s cubic-bezier(.2,.9,.3,1.4), box-shadow .18s; }
.tool:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 6px 6px 0 var(--ink); }
.tool:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.tool .ti { transition: transform .3s cubic-bezier(.2,.9,.3,1.6); }
.tool:hover .ti { transform: rotate(-12deg) scale(1.12); }
.tool.on .sticker { animation: wob 2.4s ease-in-out infinite; }
@keyframes wob { 50% { transform: rotate(4deg) scale(1.08); } }
.menu, .choice { transition: transform .15s cubic-bezier(.2,.9,.3,1.4), box-shadow .15s; }
.menu:hover, .choice:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
#nav .fab { transition: transform .25s cubic-bezier(.2,.9,.3,1.6); }
#nav .fab:hover { transform: rotate(90deg) scale(1.06); }
#nav .fab:active { transform: rotate(90deg) scale(.92); }
#nav button[data-tab] svg { transition: transform .25s cubic-bezier(.2,.9,.3,1.6); }
#nav button[aria-current="page"] svg { transform: translateY(-2px) scale(1.12); }
.pill.bump { animation: bump .6s cubic-bezier(.2,.9,.3,1.5); }
.pill.bump .coin { animation: spin .7s cubic-bezier(.2,.8,.2,1); }
@keyframes bump { 40% { transform: scale(1.12) rotate(-3deg); } }
@keyframes spin { to { transform: rotateY(360deg); } }
.act.done .chk { animation: tick .45s cubic-bezier(.2,.9,.3,1.8); }
@keyframes tick { from { transform: scale(.3); } }
.confetti { position: fixed; z-index: 30; width: 9px; height: 13px; border: 1.5px solid var(--ink); border-radius: 2px; pointer-events: none;
  animation: fly 1.1s cubic-bezier(.15,.7,.3,1) both; }
@keyframes fly { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  60% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 160px)) rotate(calc(var(--r) * 1.6)); opacity: 0; } }
.nav-brand, .fab-t { display: none; }

/* ── десктоп: дашборд із боковим меню (лише браузер, у Telegram завжди мобільний вигляд) ── */
@media (min-width: 900px) {
  body.web { padding-bottom: 0; padding-left: 248px; }
  body.web .hdr { max-width: 1160px; padding: 26px 40px 0; }
  body.web .hdr .wordmark { visibility: hidden; }
  body.web main { max-width: 1160px; padding: 18px 40px 48px; }
  body.web #nav { top: 0; bottom: 0; right: auto; width: 248px; display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    padding: 26px 18px; border-top: 0; border-right: var(--line); background: var(--panel); }
  body.web .nav-brand { display: block; font-family: var(--disp); font-size: 28px; line-height: 1; margin: 0 8px 26px; }
  body.web #nav button[data-tab] { flex-direction: row; gap: 12px; font-size: 15px; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 2.5px solid transparent; }
  body.web #nav button[data-tab]:hover { background: var(--paper); }
  body.web #nav button[aria-current="page"] { color: var(--ink); background: var(--yellow); border-color: var(--ink); box-shadow: var(--shadow-s); }
  body.web #nav button[aria-current="page"] svg { transform: none; }
  body.web #nav .fab { order: 10; width: auto; height: 54px; margin: auto 0 0; border-radius: 100px; flex-direction: row; gap: 10px; font-size: 16px; font-weight: 700; justify-content: center; }
  body.web #nav .fab:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
  body.web #nav .fab:hover svg { transform: rotate(90deg); transition: transform .25s; }
  body.web .fab-t { display: inline; }
  body.web .home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
  body.web .home-side { position: sticky; top: 24px; }
  body.web .home-side > .box:first-child { margin-top: 16px; }
  body.web .day { min-height: 300px; padding: 30px 32px; }
  body.web .day h1 { font-size: 40px; width: 62%; }
  body.web .day p { font-size: 16px; }
  body.web .day .pal svg { width: 230px; height: 230px; }
  body.web .day .pal { right: 10px; top: 14px; }
  body.web .day .btn { width: 60%; }
  body.web .tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.web .tool { min-height: 120px; }
  body.web main > :not(.home):not(.tools):not(.back) { max-width: 720px; }
  body.web main > .tools { max-width: none; }
  body.web h1 { font-size: 34px; }
  body.web .toast { bottom: 32px; left: calc(50% + 124px); }
}
.lb-mini h2 { margin: 0; }
.lb-mini .lb:last-child { border-bottom: 0; }
@media (min-width: 900px) {
  body.web.login { padding-left: 0; }
  body.web.login #nav { display: none; }  /* desktop-правило nav перебиває [hidden] */
  body.web.login main, body.web.login .hdr { max-width: 520px; }
  body.web.login .hdr .wordmark { visibility: visible; }
}
.home .tools > :nth-child(n+6) { display: none; }  /* на телефоні 4 «скоро», на десктопі 6, щоб ряди були повні */
@media (min-width: 900px) { body.web .home .tools > :nth-child(n+6) { display: block; } }
