/* Reseller app layout: phone first, bottom tab bar. */
.app { max-width: 720px; margin: 0 auto; padding: 0 1rem calc(96px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 50; margin: 0 -1rem; padding: .45rem 1rem; padding-top: calc(.45rem + env(safe-area-inset-top, 0px)); background: rgba(252, 250, 253, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .6rem; }
.topbar .brand { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--plum-700); flex: 1; }
.topbar .back { background: none; border: 0; font-size: 1.6rem; color: var(--plum-700); width: 40px; height: 40px; cursor: pointer; margin-left: -8px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: var(--safe-b); box-shadow: 0 -6px 20px -12px rgba(46,16,48,.3); }
.tabbar-in { display: flex; width: 100%; max-width: 720px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 800; position: relative; min-height: 58px; }
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--plum-700); } .tab.on::before { content: ''; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 4px 4px; background: var(--gold); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--ruby); color: #fff; font-size: .7rem; display: grid; place-items: center; }

/* auth */
.auth { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-hero { background: var(--plum-700); color: #fff; padding: calc(2.2rem + env(safe-area-inset-top, 0px)) 1.4rem 3.2rem; position: relative; }
.auth-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px; background:
  linear-gradient(135deg, var(--paper) 25%, transparent 25%) -11px 0 / 22px 22px, linear-gradient(225deg, var(--paper) 25%, transparent 25%) -11px 0 / 22px 22px; }
.auth-hero h1 { font-size: 2rem; color: #fff; } .auth-hero p { color: #F3D9A4; margin-top: .4rem; font-size: 1.02rem; }
.auth-body { flex: 1; max-width: 480px; width: 100%; margin: 0 auto; padding: 1.4rem 1.2rem 2.5rem; }
.auth-card { margin-top: -0.4rem; }
.switch { text-align: center; margin-top: 1rem; }

/* wallet hero */
.wallet-card { background: linear-gradient(150deg, var(--plum-700), var(--plum-900)); color: #fff; border-radius: 20px; padding: 1.2rem 1.2rem 1rem; position: relative; overflow: hidden; }
.wallet-card::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 22px solid rgba(232, 163, 61, .16); }
.wallet-card .lbl { color: #E4C8E3; font-size: .88rem; font-weight: 700; }
.wallet-card .amt { font-family: var(--display); font-size: 2.5rem; font-weight: 700; line-height: 1.1; margin: .1rem 0 .3rem; font-variant-numeric: tabular-nums; }
.wallet-card .amt.pos { color: #7BE0B0; } .wallet-card .amt.neg { color: #FF9AAA; } .wallet-card .amt.zero { color: #fff; }
.wallet-card .sub { color: #E4C8E3; font-size: .86rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .8rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .4rem; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 1.35rem; } .stat span { font-size: .72rem; color: var(--muted); font-weight: 700; }

/* products */
.search { position: relative; } .search input { padding-left: 2.6rem; }
.search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; stroke: var(--muted); fill: none; stroke-width: 2; }
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .1rem 0 .4rem; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: .42rem .95rem; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: .88rem; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--plum-700); border-color: var(--plum-700); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; text-align: left; padding: 0; display: block; width: 100%; box-shadow: var(--shadow); }
.pcard:active { transform: scale(.985); }
.pimg { aspect-ratio: 4/5; background: var(--plum-50) center/cover no-repeat; position: relative; }
.pimg .tag { position: absolute; left: 8px; bottom: 8px; background: rgba(46,16,48,.82); color: #fff; font-size: .72rem; font-weight: 800; padding: .15rem .55rem; border-radius: 99px; }
.pinfo { padding: .6rem .7rem .75rem; }
.pinfo .t { font-weight: 700; font-size: .92rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.pinfo .cost { margin-top: .3rem; font-weight: 800; color: var(--plum-700); }
.pinfo .was { font-size: .78rem; color: var(--muted); }
.gallery { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -1.1rem .7rem; padding: 0 1.1rem; }
.gallery img { height: 250px; border-radius: 14px; scroll-snap-align: start; flex: none; background: var(--plum-50); }
.sizes { display: flex; flex-wrap: wrap; gap: .5rem; }
.size { min-width: 58px; padding: .5rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 800; cursor: pointer; text-align: center; }
.size small { display: block; font-weight: 600; font-size: .7rem; color: var(--muted); }
.size.on { border-color: var(--plum-700); background: var(--plum-50); color: var(--plum-700); }
.size[disabled] { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--plum-50); font-size: 1.3rem; font-weight: 800; color: var(--plum-700); cursor: pointer; }
.qty b { min-width: 38px; text-align: center; }

/* cart / order form */
.line { display: flex; gap: .7rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); } .line:last-child { border-bottom: 0; }
.line .thumb { width: 54px; height: 66px; border-radius: 10px; background: var(--plum-50) center/cover; flex: none; }
.sum-row { display: flex; justify-content: space-between; padding: .28rem 0; font-size: .96rem; }
.sum-row.total { border-top: 2px dashed var(--line); margin-top: .4rem; padding-top: .65rem; font-weight: 800; font-size: 1.12rem; color: var(--plum-700); }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.outcome { border-radius: 12px; padding: .65rem .75rem; } .outcome b { display: block; font-size: 1.15rem; font-family: var(--display); }
.outcome.win { background: var(--jade-bg); color: var(--jade); } .outcome.lose { background: var(--ruby-bg); color: var(--ruby); }
.outcome span { font-size: .78rem; font-weight: 700; }
.margin-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: calc(58px + var(--safe-b)); z-index: 55; padding: .6rem 1rem; background: rgba(252, 250, 253, .96); border-top: 1px solid var(--line); }
.sticky-cta > div { max-width: 720px; margin: 0 auto; }
.cartbar { position: fixed; left: 50%; transform: translateX(-50%); width: calc(100% - 2rem); max-width: 688px; bottom: calc(70px + var(--safe-b)); z-index: 55; background: var(--plum-700); color: #fff; border: 0; border-radius: 14px; padding: .8rem 1rem; display: flex; justify-content: space-between; font-weight: 800; box-shadow: 0 10px 24px -8px rgba(46, 16, 48, .55); cursor: pointer; }

/* orders */
.ocard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem .95rem; display: block; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.ocard + .ocard { margin-top: .65rem; }
.ocard .top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.ocard .no { font-weight: 800; } .ocard .who { color: var(--muted); font-size: .9rem; margin: .1rem 0 .5rem; }
.ocard .bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem; }
.trk { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; letter-spacing: .02em; }
.profit { font-family: var(--display); font-weight: 700; font-size: 1.15rem; text-align: right; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .3rem; }
.timeline li { position: relative; padding: 0 0 .9rem 1.4rem; border-left: 2px solid var(--line); margin-left: .3rem; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); border: 2px solid #fff; }
.timeline li:first-child::before { background: var(--plum-700); } .timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: .3rem .8rem; font-size: .93rem; } .kv dt { color: var(--muted); font-weight: 700; } .kv dd { margin: 0; word-break: break-word; }

/* wallet page */
.entry { display: flex; justify-content: space-between; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.entry:last-child { border-bottom: 0; } .entry .amt { font-family: var(--display); font-weight: 700; font-size: 1.12rem; white-space: nowrap; }
.entry .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; flex: none; }
.entry .ic.pos { background: var(--jade-bg); } .entry .ic.neg { background: var(--ruby-bg); } .entry .ic.pay { background: var(--gold-soft); color: var(--amber); }
.menu a, .menu button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: .95rem .2rem; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; text-decoration: none; color: var(--ink); font-weight: 700; cursor: pointer; }
.menu > :last-child { border-bottom: 0; }
.center-msg { min-height: 60dvh; display: grid; place-items: center; text-align: center; padding: 1rem; }
.success-mark { width: 74px; height: 74px; border-radius: 50%; background: var(--jade-bg); color: var(--jade); display: grid; place-items: center; font-size: 2.2rem; margin: 0 auto .8rem; }
.tn-big { font-family: ui-monospace, Menlo, monospace; font-size: 1.35rem; font-weight: 800; letter-spacing: .04em; background: var(--plum-50); border-radius: 12px; padding: .7rem; margin: .6rem 0; word-break: break-all; }

/* brand logo */
.hero-logo { display: block; height: 78px; width: auto; margin: 0 0 1rem -4px; }
.auth-hero h1 { margin-top: .2rem; }
.topbar .brand .logo { height: 46px; width: auto; display: block; }
