/* ==========================================================================
   PrintHub — public app styles
   Theme colours come from :root vars injected by PHP (--p, --p-dark, --a …)
   ========================================================================== */

:root {
  --bg: #F5F8FF;
  --surface: #FFFFFF;
  --text: #0B1530;
  --muted: #5B6680;
  --muted-2: #8A94AD;
  --line: #E4E9F5;
  --line-2: #D4DBEC;
  --ok: #16A34A;
  --ok-bg: #E8F8EE;
  --warn: #D97706;
  --warn-bg: #FFF4E0;
  --danger: #DC2626;
  --danger-bg: #FDECEC;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 6px 20px -12px rgba(var(--p-rgb), .18), 0 1px 3px rgba(11,21,48,.04);
  --shadow-lg: 0 24px 60px -20px rgba(var(--p-rgb), .35);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --ease: cubic-bezier(.22,.9,.3,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; line-height: 1.45; min-height: 100dvh; font-size: 15px;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(var(--p-rgb), .14), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(var(--a-rgb), .12), transparent 60%);
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
a { color: var(--p); text-decoration: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px; text-align: center; }

/* Layout --------------------------------------------------------------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
@media (min-width: 720px) {
  .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px rgba(var(--p-rgb), .3); background: var(--surface); margin: 24px auto 0; min-height: calc(100dvh - 24px); border-radius: 32px 32px 0 0; overflow: hidden; }
}
.view { flex: 1; display: flex; flex-direction: column; animation: viewIn .45s var(--ease) both; }
.view.has-bar { padding-bottom: 120px; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.container { padding: 0 16px; }
.section { padding: 6px 16px 0; }
.section-title { font-size: 18px; font-weight: 800; margin: 22px 0 12px; letter-spacing: -.02em; }
.section-sub { color: var(--muted); margin: -8px 0 16px; }

/* Top bar --------------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 10px; position: sticky; top: 0; z-index: 20; background: rgba(245,248,255,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
@media (min-width:720px) { .topbar { background: rgba(255,255,255,.92); } }
.loc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.loc-logo { width: 36px; height: 36px; border-radius: 11px; background: var(--p); color: var(--p-fg); display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; overflow: hidden; box-shadow: 0 6px 16px -6px rgba(var(--p-rgb), .6); }
.loc-logo img { width: 100%; height: 100%; object-fit: contain; }
.loc-name { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 14px; box-shadow: 0 4px 12px -6px rgba(11,21,48,.15); transition: transform .2s var(--spring), box-shadow .2s; }
.pill-btn:active { transform: scale(.95); }
.pill-btn svg { width: 18px; height: 18px; }
.pill-btn.primary { background: var(--p); color: var(--p-fg); border-color: transparent; }

/* Hero ------------------------------------------------------------------ */
.hero { position: relative; padding: 10px 18px 0; overflow: hidden; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(var(--p-rgb), .07) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--p-rgb), .07) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(ellipse at 50% 30%, #000 40%, transparent 80%); -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 40%, transparent 80%); pointer-events: none; }
.brand { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 6px; }
.brand-word { font-size: 32px; font-weight: 800; letter-spacing: -.045em; display: flex; align-items: center; gap: 4px; }
.brand-word img { height: 38px; width: auto; }
.brand-word .b1 { color: var(--p); }
.brand-word .b2 { color: var(--text); }
.brand-badge { font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 8px; border-radius: 8px; border: 2px dashed var(--p); color: var(--p-dark); background: var(--p-50); animation: badgePop .6s var(--spring) .3s both; }
@keyframes badgePop { from { transform: scale(.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-art { position: relative; height: 200px; margin: 0 auto; }
.hero-art svg { width: 100%; height: 100%; overflow: visible; }
.float { animation: float 4s ease-in-out infinite; transform-origin: center; }
.float.d1 { animation-delay: -1s; } .float.d2 { animation-delay: -2.2s; } .float.d3 { animation-delay: -3.1s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-10px) rotate(var(--r, 0deg)); } }
.spark { animation: spark 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.spark.s2 { animation-delay: -.8s; } .spark.s3 { animation-delay: -1.6s; }
@keyframes spark { 0%,100% { transform: scale(.6); opacity: .4; } 50% { transform: scale(1.15); opacity: 1; } }
.paper-plane { animation: plane 6s ease-in-out infinite; }
@keyframes plane { 0% { transform: translate(0,0) rotate(0); } 50% { transform: translate(10px,-8px) rotate(6deg); } 100% { transform: translate(0,0) rotate(0); } }
.kiosk-screen { animation: screenGlow 3s ease-in-out infinite; }
@keyframes screenGlow { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
.print-sheet { animation: printOut 3.2s var(--ease) infinite; }
@keyframes printOut { 0%, 20% { transform: translateY(0); opacity: 0; } 35% { opacity: 1; } 70% { transform: translateY(26px); opacity: 1; } 100% { transform: translateY(30px); opacity: 0; } }

/* Cards ----------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); position: relative; }
.card + .card { margin-top: 12px; }
.card-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.card-sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.upload-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px; border-radius: var(--radius); border: 1.5px dashed var(--p); background: var(--p-50); color: var(--p-dark); font-weight: 800; font-size: 17px; transition: transform .25s var(--spring), background .2s, box-shadow .25s; position: relative; overflow: hidden; }
.upload-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%); transform: translateX(-100%); animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.upload-btn:hover { background: var(--p-100); box-shadow: 0 10px 24px -14px rgba(var(--p-rgb), .6); }
.upload-btn:active { transform: scale(.98); }
.upload-btn.drag { background: var(--p-100); border-style: solid; transform: scale(1.01); }
.upload-btn svg { width: 20px; height: 20px; }
.formats { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 0; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.tile { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); min-height: 160px; display: flex; flex-direction: column; text-align: left; transition: transform .25s var(--spring), box-shadow .25s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile:active { transform: scale(.98); }
.tile h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; padding-right: 54px; position: relative; z-index: 1; }
.tile ul { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.tile li::before { content: '• '; }
.tile ul { position: relative; z-index: 1; }
.tile .tile-cta { position: relative; z-index: 1; margin-top: auto; align-self: flex-start; padding: 7px 13px; border-radius: 999px; background: var(--p-100); color: var(--p-dark); font-weight: 700; font-size: 13px; }
.tile .tile-art { position: absolute; right: 4px; top: 4px; width: 56px; height: 56px; opacity: .85; }
.tile.disabled { opacity: .55; filter: grayscale(.3); pointer-events: none; }
.tile.disabled .tile-cta { background: var(--line); color: var(--muted); }

.trust { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: 13px; margin: 22px 0 18px; }
.trust svg { width: 18px; height: 18px; color: var(--ok); }
.track-link { text-align: center; margin: -10px 0 30px; }
.track-link a { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.track-link svg, .footer-note svg, .trust svg, .empty p svg { width: 18px; height: 18px; flex: none; }

/* File thumbs ----------------------------------------------------------- */
.thumb { position: relative; background: #fff; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; box-shadow: 0 6px 20px -10px rgba(11,21,48,.3); }
.thumb img, .thumb canvas { width: 100%; height: 100%; object-fit: contain; transition: transform .45s var(--spring), filter .3s; }
.thumb.bw img { filter: grayscale(1) contrast(1.05); }
/* "paper" thumbs: the frame is the sheet (A4 ratio) in the chosen orientation; the page sits upright inside it */
.thumb.paper { background: #fff; padding: 6%; }
.thumb.paper-portrait { aspect-ratio: 1 / 1.414 !important; }
.thumb.paper-landscape { aspect-ratio: 1.414 / 1 !important; }
.thumb.paper img { object-fit: contain; box-shadow: 0 1px 4px rgba(11,21,48,.15); }
.slide .thumb { transition: aspect-ratio .4s var(--ease); }
.preview-hint { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted-2); font-size: 12px; margin: 12px 16px 0; }
.preview-hint svg { width: 14px; height: 14px; }
.paper-sheet { background: #fff; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); display: grid; place-items: center; padding: 3%; }
.paper-sheet { flex: none; }
.paper-sheet canvas { box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.paper-sheet.bw canvas { filter: grayscale(1); }
.upload-list li { flex-wrap: wrap; }
.upload-list li .pct { font-size: 12px; color: var(--muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.upload-list li .mini { flex-basis: 100%; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.upload-list li .mini b { display: block; height: 100%; width: 0; background: var(--p); transition: width .2s; }
.preview-modal header small { display: block; color: rgba(255,255,255,.65); font-size: 12px; }
.thumb .ext-icon { display: grid; place-items: center; gap: 8px; color: var(--muted); font-weight: 800; font-size: 14px; }
.thumb .ext-icon svg { width: 44px; height: 44px; }
.thumb .ext-icon .lbl { padding: 3px 10px; border-radius: 6px; color: #fff; font-size: 12px; }
.lbl.pdf { background: #E53935; } .lbl.doc, .lbl.docx { background: #1E6FD9; } .lbl.jpg, .lbl.jpeg, .lbl.png { background: #2E9E44; }
.file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.file-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--surface); animation: popIn .5s var(--spring) both; }
.file-card .thumb { aspect-ratio: 3/4; }
.file-card .fname { font-size: 13px; font-weight: 600; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.file-card .fmeta { font-size: 12px; color: var(--muted); }
.file-card .del { position: absolute; top: 2px; right: 2px; width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--danger); display: grid; place-items: center; border: 1px solid var(--line); box-shadow: 0 4px 10px -4px rgba(0,0,0,.2); z-index: 2; }
.file-card .del svg { width: 18px; height: 18px; }
@keyframes popIn { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }

/* Settings carousel ----------------------------------------------------- */
.carousel-wrap { position: relative; padding: 10px 0 0; }
.carousel { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 18px 20px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 66%; scroll-snap-align: center; background: #fff; border-radius: 22px; padding: 14px; border: 1px solid var(--line); box-shadow: 0 20px 50px -24px rgba(var(--p-rgb), .5); transition: transform .35s var(--ease), opacity .35s; opacity: .55; transform: scale(.94); position: relative; }
.slide.active { opacity: 1; transform: scale(1); }
.slide .thumb { aspect-ratio: 3/4; border-radius: 12px; border: 2px dashed var(--line-2); }
.slide .preview-btn { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 11px; border-radius: 10px; font-size: 13px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border: 1px solid var(--line); font-weight: 800; letter-spacing: .08em; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text); }
.slide .preview-btn svg { width: 20px; height: 20px; }
.slide .del { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--danger); border: 2px solid var(--danger); display: grid; place-items: center; z-index: 2; }
.slide .del svg { width: 20px; height: 20px; }
.slide .pages-badge { position: absolute; top: 8px; left: 8px; background: var(--text); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; z-index: 2; }
.dots { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: -8px; }
.dots .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--line-2); transition: all .3s var(--spring); }
.dots .dot.active { width: auto; height: 32px; background: var(--text); color: #fff; padding: 0 14px; font-size: 13px; font-weight: 700; display: grid; place-items: center; border-radius: 999px; }

.settings-card { margin: 8px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.row { padding: 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row h4 { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.row-head h4 { margin: 0; }
.stepper { display: inline-flex; align-items: center; background: var(--p); color: var(--p-fg); border-radius: 11px; padding: 3px; }
.stepper button { width: 36px; height: 36px; display: grid; place-items: center; color: inherit; border-radius: 8px; font-size: 20px; transition: background .15s; }
.stepper button:hover { background: rgba(255,255,255,.18); }
.stepper button:disabled { opacity: .4; }
.stepper .val { min-width: 32px; text-align: center; font-weight: 800; font-size: 17px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seg-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; transition: all .22s var(--ease); min-height: 60px; min-width: 0; }
.seg-btn > span:first-child { min-width: 0; }
.seg-btn .t { font-weight: 800; font-size: 15px; color: var(--text); white-space: nowrap; }
.seg-btn .s { color: var(--muted); font-size: 12px; }
.seg-btn svg { width: 24px; height: 24px; color: var(--muted-2); flex: none; }
.seg-btn.on { border-color: var(--p); background: var(--p-50); box-shadow: 0 0 0 3px rgba(var(--p-rgb), .10); }
.seg-btn.on .t { color: var(--p-dark); } .seg-btn.on svg { color: var(--p); }
.seg-btn:disabled { opacity: .5; }
.more-btn { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 15px; background: var(--surface); }
.more-btn svg { width: 20px; height: 20px; transition: transform .3s var(--spring); }
.more-btn.open svg.chev { transform: rotate(180deg); }
.more-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.more-panel.open { grid-template-rows: 1fr; }
.more-panel > div { overflow: hidden; }
.field { margin-top: 16px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--muted); }
.input { width: 100%; padding: 12px 14px; border-radius: 11px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 16px; outline: none; transition: border .2s, box-shadow .2s; }
.input:focus { border-color: var(--p); box-shadow: 0 0 0 4px rgba(var(--p-rgb), .15); }
textarea.input { min-height: 80px; resize: vertical; }
.apply-all { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin: 12px 16px 0; background: var(--a-light); border-radius: 12px; font-weight: 600; font-size: 13px; color: var(--text); }
.switch { position: relative; width: 42px; height: 26px; border-radius: 999px; background: var(--line-2); transition: background .25s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s var(--spring); }
.switch.on { background: var(--p); } .switch.on::after { transform: translateX(16px); }

/* Blank sheets ---------------------------------------------------------- */
.product-hero { position: relative; padding: 22px 18px 70px; text-align: center; }
.product-hero::before { content: ''; position: absolute; left: -30%; right: -30%; top: 0; bottom: 0; background: radial-gradient(ellipse at 50% 0%, rgba(var(--p-rgb), .16), transparent 70%); border-radius: 0 0 50% 50%; z-index: -1; }
.product-row { display: flex; align-items: center; gap: 18px; text-align: left; }
.product-art { width: 130px; height: 130px; flex: none; position: relative; }
.product-art .a4 { position: absolute; left: 12px; top: 10px; width: 96px; height: 110px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px -12px rgba(11,21,48,.4); border: 1px dashed var(--p); display: grid; place-items: center; font-weight: 800; font-size: 28px; color: var(--muted-2); animation: popIn .6s var(--spring) both; }
.product-art .a4.b { left: 20px; top: 2px; z-index: -1; opacity: .7; }
.product-art .check { position: absolute; right: 4px; bottom: 8px; width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; animation: popIn .5s var(--spring) .3s both; }
.product-row h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.product-row ul { margin: 0; padding: 0; list-style: none; color: var(--muted); }
.product-row li::before { content: '• '; }
.price-pill { display: inline-flex; margin: 20px auto 0; padding: 11px 28px; border-radius: 999px; background: var(--p); color: var(--p-fg); font-size: 22px; font-weight: 800; outline: 2px dashed var(--p); outline-offset: 5px; animation: popIn .5s var(--spring) .2s both; }
.qty-box { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 18px; padding: 10px; }
.qty-box .big { text-align: center; } .qty-box .big b { font-size: 30px; display: block; line-height: 1; } .qty-box .big span { color: var(--muted); font-size: 14px; }
.qty-btn { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; border: 1px solid var(--line); background: var(--surface); transition: transform .15s; }
.qty-btn:active { transform: scale(.92); }
.qty-btn.plus { background: var(--p); color: var(--p-fg); border-color: transparent; }
.chips { display: flex; gap: 10px; margin-top: 14px; }
.chip { flex: 1; padding: 10px 0; font-size: 14px; border-radius: 999px; border: 1px solid var(--line-2); font-weight: 700; background: var(--surface); transition: all .2s; }
.chip.on, .chip:hover { background: var(--p-50); border-color: var(--p); color: var(--p-dark); }
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.eco { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.eco svg { width: 72px; height: 72px; flex: none; }
.eco h4 { margin: 0 0 4px; color: var(--ok); font-size: 16px; }
.eco p { margin: 0; color: var(--muted); font-size: 13px; }

/* Bottom bar ------------------------------------------------------------ */
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; pointer-events: none; }
.bottom-bar-inner { pointer-events: auto; width: 100%; max-width: 560px; background: rgba(255,255,255,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; animation: barUp .5s var(--ease) both; }
@media (min-width:720px) { .bottom-bar-inner { border-radius: 24px 24px 0 0; } }
@keyframes barUp { from { transform: translateY(100%); } to { transform: none; } }
.bar-total .l { color: var(--muted); font-size: 13px; } .bar-total .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 800; font-size: 16px; transition: transform .2s var(--spring), box-shadow .2s, opacity .2s; white-space: nowrap; }
.btn.primary { background: var(--p); color: var(--p-fg); box-shadow: 0 12px 24px -10px rgba(var(--p-rgb), .7); }
.btn.primary:hover { box-shadow: 0 14px 30px -10px rgba(var(--p-rgb), .8); transform: translateY(-1px); }
.btn.primary:active { transform: scale(.97); }
.btn.ghost { background: var(--surface); border: 1.5px solid var(--line-2); color: var(--text); }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 22px; font-size: 17px; border-radius: 14px; }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.btn .spinner { width: 20px; height: 20px; }
.secure-strip { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 14px; background: var(--ok-bg); border-radius: 10px 10px 0 0; margin-bottom: -2px; }
.secure-strip svg { width: 18px; height: 18px; }

/* Review ---------------------------------------------------------------- */
.page-head { text-align: center; padding: 12px 16px 4px; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.panel { margin: 12px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; gap: 10px; }
.panel-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.panel-head .actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; background: var(--surface); color: var(--muted); transition: transform .3s var(--spring), background .2s; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.open { transform: rotate(180deg); }
.edit-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px; font-size: 14px; border: 1px solid var(--line-2); font-weight: 700; white-space: nowrap; }
.panel-head h3 { min-width: 0; }
.edit-btn svg { width: 16px; height: 16px; }
.collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s var(--ease); }
.collapse.closed { grid-template-rows: 0fr; }
.collapse > div { overflow: hidden; }
.rfile { display: flex; gap: 12px; margin: 0 12px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.rfile .thumb { width: 62px; height: 80px; flex: none; }
.rfile .info { min-width: 0; flex: 1; }
.rfile .name { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rfile .name { font-weight: 700; font-size: 14px; word-break: break-word; }
.rfile .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.rfile .tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rfile .tags .tag { display: inline-flex; align-items: center; gap: 4px; }
.rfile .tags .tag svg { width: 16px; height: 16px; }
.rfile .tags .sep { display: none; }
.rfile .side { display: flex; flex-direction: column; gap: 8px; }
.rfile .side button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.rfile .side button.danger { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.rfile .side button svg { width: 16px; height: 16px; }
.rfile .amount { font-weight: 800; color: var(--text); margin-top: 8px; }
.phone-row { margin: 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; display: flex; align-items: center; justify-content: space-between; background: var(--surface); box-shadow: var(--shadow); }
.phone-row .num { font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.phone-row .sub { color: var(--muted); font-size: 12px; }
.bill { padding: 4px 16px 16px; }
.bill-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); font-size: 14px; }
.bill-row .dashed { border-bottom: 1px dashed var(--line-2); }
.bill-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; color: var(--text); font-weight: 800; font-size: 17px; }
.bill-row .free { color: var(--ok); font-weight: 700; }

/* Sheets & modals ------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(11,21,48,.55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .25s both; }
.overlay.center { align-items: center; padding: 20px; }
.overlay.closing { animation: fadeOut .25s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: sheetUp .45s var(--ease) both; max-height: 92dvh; overflow: auto; }
.overlay.closing .sheet { animation: sheetDown .3s var(--ease) both; }
.overlay.center .sheet { border-radius: 28px; animation: popIn .4s var(--spring) both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { from { transform: none; } to { transform: translateY(100%); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 999px; background: var(--line-2); margin: -8px auto 18px; }
.sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; text-align: center; letter-spacing: -.02em; }
.sheet .lead { text-align: center; color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.sheet .field { margin-top: 18px; }
.phone-input { display: flex; border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden; transition: border .2s, box-shadow .2s; }
.phone-input:focus-within { border-color: var(--p); box-shadow: 0 0 0 4px rgba(var(--p-rgb), .15); }
.phone-input .cc { padding: 12px 14px; background: var(--bg); border-right: 1px solid var(--line); font-weight: 700; display: grid; place-items: center; }
.phone-input input { flex: 1; border: 0; padding: 12px 14px; font-size: 17px; letter-spacing: .04em; outline: none; min-width: 0; }
.sheet .btn { margin-top: 18px; }

.success-wrap { text-align: center; padding: 10px 0 6px; }
.success-ring { width: 130px; height: 130px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(var(--p-rgb), .18), transparent 70%); }
.success-check { width: 96px; height: 96px; }
.success-check circle { fill: var(--p); transform-origin: center; animation: popIn .5s var(--spring) both; }
.success-check path { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .5s var(--ease) .35s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success-wrap h2 { margin: 0 0 8px; }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 12px 0; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--p), var(--a)); border-radius: 999px; transition: width .3s var(--ease); }
.progress.indet > i { width: 40%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.upload-list { margin: 10px 0 0; padding: 0; list-style: none; }
.upload-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.upload-list li .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.upload-list li .st { color: var(--muted); font-size: 12px; }
.upload-list li .st.ok { color: var(--ok); } .upload-list li .st.err { color: var(--danger); }

.preview-modal { position: fixed; inset: 0; z-index: 110; background: #0B1530; display: flex; flex-direction: column; animation: fadeIn .25s both; }
.preview-modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; color: #fff; background: rgba(255,255,255,.05); }
.preview-modal header b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-modal header button { color: #fff; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.preview-modal header button svg { width: 20px; height: 20px; }
.preview-body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.preview-body img { max-width: 100%; height: auto; background: #fff; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.preview-body .msg { color: #fff; opacity: .8; text-align: center; padding: 40px 20px; }

/* Order / tracking ------------------------------------------------------ */
.order-hero { text-align: center; padding: 20px 18px 10px; }
.order-code { display: inline-flex; flex-direction: column; align-items: center; padding: 14px 26px; border-radius: 18px; background: var(--text); color: #fff; margin: 14px 0; animation: popIn .5s var(--spring) .2s both; position: relative; overflow: hidden; }
.order-code::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%); transform: translateX(-100%); animation: shine 4s ease-in-out 1s infinite; }
.order-code small { font-size: 11px; letter-spacing: .14em; opacity: .7; font-weight: 700; }
.order-code b { font-size: 30px; letter-spacing: .06em; font-weight: 800; }
.status-banner { margin: 8px 16px 0; padding: 14px 16px; border-radius: 16px; display: flex; align-items: center; gap: 12px; background: var(--p-50); border: 1px solid var(--p-200); }
.status-banner .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--p); color: var(--p-fg); display: grid; place-items: center; flex: none; }
.status-banner .ic svg { width: 20px; height: 20px; }
.status-banner.ready { background: var(--ok-bg); border-color: #BBE9CB; } .status-banner.ready .ic { background: var(--ok); color: #fff; }
.status-banner.cancelled { background: var(--danger-bg); border-color: #F7C6C6; } .status-banner.cancelled .ic { background: var(--danger); color: #fff; }
.status-banner b { display: block; font-size: 16px; } .status-banner span { color: var(--muted); font-size: 13px; }
.timeline { margin: 18px 16px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 10%; right: 10%; top: 15px; height: 3px; background: var(--line); border-radius: 2px; }
.timeline .fill { position: absolute; left: 10%; top: 15px; height: 3px; background: var(--p); border-radius: 2px; transition: width .8s var(--ease); }
.tstep { text-align: center; position: relative; font-size: 11px; color: var(--muted); font-weight: 600; }
.tstep .dot { width: 32px; height: 32px; margin: 0 auto 6px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); display: grid; place-items: center; transition: all .4s var(--spring); }
.tstep .dot svg { width: 16px; height: 16px; color: #fff; opacity: 0; transform: scale(.5); transition: all .3s var(--spring); }
.tstep.done .dot { background: var(--p); border-color: var(--p); } .tstep.done .dot svg { opacity: 1; transform: none; }
.tstep.now .dot { border-color: var(--p); box-shadow: 0 0 0 6px rgba(var(--p-rgb), .18); animation: pulse 1.8s ease-in-out infinite; }
.tstep.now { color: var(--p-dark); font-weight: 800; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(var(--p-rgb), .15); } 50% { box-shadow: 0 0 0 10px rgba(var(--p-rgb), .05); } }
.pay-card { margin: 16px 16px 0; text-align: center; }
.pay-card .qr { width: 200px; height: 200px; margin: 12px auto; padding: 10px; background: #fff; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: center; }
.pay-card .qr img, .pay-card .qr canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.pay-card .amt { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.pay-card .upi-id { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--bg); font-weight: 700; font-size: 14px; margin-top: 6px; }
.pay-card .upi-id button { color: var(--p); font-weight: 700; }
.pay-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pay-badge.unpaid { background: var(--warn-bg); color: var(--warn); }
.pay-badge.claimed { background: var(--p-100); color: var(--p-dark); }
.pay-badge.paid { background: var(--ok-bg); color: var(--ok); }
.pay-badge.refunded { background: var(--line); color: var(--muted); }
.pay-actions { display: grid; gap: 10px; margin-top: 16px; }
.events { margin: 0 18px; padding: 0; list-style: none; }
.events li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.events li .t { color: var(--muted); font-size: 12px; white-space: nowrap; }
.footer-note { text-align: center; color: var(--muted-2); font-size: 12px; padding: 24px 16px; }

/* Track lookup ---------------------------------------------------------- */
.track-tabs { display: flex; gap: 8px; background: var(--bg); padding: 6px; border-radius: 14px; margin-bottom: 18px; }
.track-tabs button { flex: 1; padding: 10px; font-size: 14px; border-radius: 10px; font-weight: 700; color: var(--muted); transition: all .25s; }
.track-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 4px 12px -6px rgba(0,0,0,.2); }
.order-list { display: grid; gap: 10px; margin-top: 18px; }
.order-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; transition: transform .2s var(--spring); }
.order-item:active { transform: scale(.98); }
.order-item b { font-size: 16px; letter-spacing: .04em; }
.order-item .m { color: var(--muted); font-size: 13px; }
.status-chip { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--p-100); color: var(--p-dark); white-space: nowrap; }
.status-chip.ready { background: var(--ok-bg); color: var(--ok); }
.status-chip.delivered { background: var(--line); color: var(--muted); }
.status-chip.cancelled { background: var(--danger-bg); color: var(--danger); }

/* Toasts ---------------------------------------------------------------- */
.toasts { position: fixed; top: 14px; left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 14px; background: var(--text); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); animation: toastIn .4s var(--spring) both; max-width: 520px; display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--ok); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(-20px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-20px); opacity: 0; } }

/* Misc ------------------------------------------------------------------ */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(var(--p-rgb), .2); border-top-color: var(--p); animation: spin .8s linear infinite; display: inline-block; }
.btn.primary .spinner { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, #f3f6fc 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty svg { width: 64px; height: 64px; margin: 0 auto 12px; color: var(--line-2); }
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; padding: 8px 0; }
.back-btn svg { width: 18px; height: 18px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: confetti 2.6s var(--ease) forwards; }
@keyframes confetti { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
