/* Gree Partner app – phone first */
body.portal { padding-bottom: calc(76px + env(safe-area-inset-bottom)); background: #f3f5f4; }
.p-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; background: var(--brand); color: #fff; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.p-back { color: #fff; font-size: 28px; line-height: 1; padding: 0 6px 2px 0; }
.p-back:hover { text-decoration: none; }
.p-brand { color: #fff; font-weight: 700; font-size: 17px; }
.p-brand:hover { text-decoration: none; }
.p-who { flex: 1; text-align: right; font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-top .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.p-main { max-width: 720px; margin: 0 auto; padding: 14px 16px; }
.p-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.p-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px; color: var(--muted); font-weight: 600; font-size: 11px; }
.p-nav a:hover { text-decoration: none; }
.p-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.p-nav a.on { color: var(--brand); }
.p-h { font-size: 18px; margin: 6px 0 10px; }
.small { font-size: 12.5px; }
.center { text-align: center; }
.empty { color: var(--muted); background: #fff; border: 1px dashed var(--line2); border-radius: 12px; padding: 16px; text-align: center; margin-bottom: 10px; }

/* home tiles */
.hello { font-size: 20px; font-weight: 700; margin: 4px 0 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.htile { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-height: 132px; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.htile:hover, .htile:active { text-decoration: none; border-color: var(--brand); }
.htile b { font-size: 15px; margin-top: 6px; }
.htile .big { font-size: 22px; font-weight: 700; margin-top: auto; font-variant-numeric: tabular-nums; }
.htile .sub { font-size: 12px; color: var(--muted); }
.htile.alert { border-color: #f1a7a7; background: #fff6f6; }
.htile.alert .big { color: #c92a2a; }
.htile.hot .big { color: var(--brand); }
.htile .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.htile .ic svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.acc { background: #0b7285; } .ic.stk { background: #e8590c; } .ic.job { background: #0b6e5b; } .ic.chk { background: #5f3dc4; } .ic.ord { background: #1971c2; }
.quick { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.quick a { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-weight: 600; color: var(--ink); }
.quick a:hover { text-decoration: none; border-color: var(--brand); }

/* cards and rows */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card.bad { border-color: #f1a7a7; background: #fff6f6; }
.card.good { border-left: 4px solid #2b8a3e; }
.card h2 { font-size: 16px; margin: 0 0 8px; }
.hero .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lrow { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow .grow, .grow { flex: 1; min-width: 0; color: var(--ink); }
.lrow a.grow:hover { text-decoration: none; }
.r { text-align: right; font-variant-numeric: tabular-nums; }
.r .b { margin-top: 3px; }
.linkbtn { background: none; border: 0; color: var(--brand); font-weight: 600; font-size: 12.5px; padding: 4px 0 0; cursor: pointer; }
.btn.block { display: block; width: 100%; text-align: center; margin-bottom: 8px; }
.btn.big { padding: 13px; font-size: 15px; }
.b.brand { background: #e3f1ee; color: var(--brand); }
.chip { display: inline-block; border: 1px solid var(--line2); border-radius: 20px; padding: 5px 10px; margin: 6px 6px 0 0; font-family: ui-monospace, Menlo, monospace; }

/* job tiles */
.tile { display: block; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 14px; margin-bottom: 10px; color: var(--ink); text-align: left; }
.tile:hover { text-decoration: none; }
.tile .t1 { font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; gap: 8px; }
.tile .when { font-weight: 500; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tile .row2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.tile .row2 > div:first-child { flex: 1; }
.tile.red { border-left-color: #c92a2a; }
.callbtn { border: 1px solid var(--brand); color: var(--brand); border-radius: 8px; padding: 8px 14px; font-weight: 600; white-space: nowrap; }
.donebtn { background: var(--brand); color: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 600; white-space: nowrap; }
.tile-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; text-align: center; }
.t1 { font-weight: 700; font-size: 16px; }

/* segmented control and bars */
.seg { display: flex; background: #eef1f0; border-radius: 10px; padding: 3px; margin-bottom: 12px; gap: 2px; }
.seg a, .seg label { flex: 1; text-align: center; padding: 7px 4px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg a:hover { text-decoration: none; }
.seg .on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg input { display: none; }
.seg.two label { font-size: 14px; padding: 10px 4px; }
.pbars { display: flex; align-items: flex-end; gap: 3px; height: 170px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.pbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.pbar .col { width: 72%; max-width: 30px; background: var(--brand); border-radius: 4px 4px 0 0; }
.pbar .lbl { font-size: 10px; color: var(--muted); margin: 4px 0 -18px; height: 14px; }
.pbar .amt { font-size: 9.5px; color: var(--ink); font-weight: 600; margin-bottom: 2px; white-space: nowrap; }
.pbars + .muted { margin-top: 22px; }

/* stock */
.stockrow { padding: 0; }
.stockrow summary { display: flex; align-items: center; gap: 10px; padding: 14px; cursor: pointer; list-style: none; }
.stockrow summary::-webkit-details-marker { display: none; }
.stockrow.red { border-left: 4px solid #c92a2a; }
.stockrow .qty { font-size: 22px; font-weight: 700; }
.serials { border-top: 1px solid var(--line); }
.serials a { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); font-family: ui-monospace, Menlo, monospace; }
.serials a:last-child { border-bottom: 0; }
.serials .k { font-family: inherit; font-size: 11px; color: var(--muted); width: 54px; }
.serials .go { margin-left: auto; color: var(--brand); font-family: system-ui, sans-serif; font-size: 13px; font-weight: 600; }

/* serial checker */
.card dl.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 10px; margin: 12px 0 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }
input[data-scan] { font-family: ui-monospace, Menlo, monospace; letter-spacing: .03em; }
.scan-field { display: flex; gap: 6px; }
.scan-field input { flex: 1; }
.scan-ov { position: fixed; inset: 0; background: #000; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.scan-ov video { width: 100%; max-height: 75vh; object-fit: cover; }
.scan-frame { position: absolute; width: 84%; height: 22%; border: 3px solid #4ade80; border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.scan-ov .hint { position: relative; z-index: 2; color: #fff; font-size: 14px; }
.scan-ov .btn { position: relative; z-index: 2; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }

/* ordering */
.step { display: flex; align-items: center; gap: 0; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; flex: none; }
.step button { width: 38px; height: 38px; border: 0; background: #f3f5f4; font-size: 20px; color: var(--brand); cursor: pointer; }
.step input { width: 44px; height: 38px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; padding: 0; font-weight: 700; }
.orow.picked { background: #eef7f4; }
.ok-t { color: #2b8a3e; } .warn-t { color: #b35c00; }
.cartbar { position: fixed; left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 9; max-width: 700px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.08); margin-top: 12px; font-weight: 600; }
.cartbar .btn:disabled { opacity: .5; }

.scan-btn { display: inline-flex; align-items: center; gap: 6px; }
.scan-ctl { position: relative; z-index: 2; display: flex; gap: 8px; align-items: center; }
.scan-cam { max-width: 60vw; background: #222; color: #fff; border: 1px solid #555; border-radius: 8px; padding: 8px; }

/* sign-in branding */
.brandbox { text-align: center; margin: 18px 0 16px; }
.brandlogo { display: block; margin: 0 auto 14px; width: 132px; height: auto; }
.brandword { display: block; margin: 0 auto 8px; width: 78%; max-width: 300px; height: auto; }
.wordmark { display: inline-block; font-size: 30px; font-weight: 800; letter-spacing: -.01em; color: var(--brand); }
.brandname { font-weight: 700; font-size: 16px; margin-top: 6px; }
.brandname:empty { display: none; }
.apptag { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: #e3f1ee; border-radius: 20px; padding: 3px 10px; }

ol.steps { padding-left: 20px; margin: 6px 0; } ol.steps li { margin-bottom: 6px; }
.card svg { width: 100%; height: auto; }

.has-cart { padding-bottom: 90px; }
.cartbar span { flex: 1; }
.p-nav { min-height: 60px; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg[hidden] { display: none; }
.sheet { background: #f3f5f4; width: 100%; max-width: 720px; max-height: 85vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sheet-h h2 { margin: 0; }

.scan-err { position: relative; z-index: 2; max-width: 520px; margin: 0 16px; background: #fff4f3; color: #8a1c12; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.scan-ctl { flex-wrap: wrap; justify-content: center; }
.scan-photo { cursor: pointer; }
.also-due { border: 1px solid var(--brand); border-radius: 10px; padding: 10px 12px; margin: 10px 0 14px; background: rgba(11,110,91,.05); }
.check-row { display: block; padding: 8px 0; border-top: 1px solid rgba(0,0,0,.06); font-weight: 500; }
.check-row:first-of-type { border-top: 0; }
.check-row input { width: auto; margin-right: 6px; transform: scale(1.2); }
