/* JekkaGO shell: minimal, no admin sidebar (same idea as the Terminal shell). Also used by the #/apps launcher. */
body.jekkago-app { background: var(--bg, #faf9f5); color: var(--text, #111); }
.jg-shell { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding: 1rem 1rem 2rem; padding-top: max(1rem, env(safe-area-inset-top)); }
.jg-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.jg-header h1 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.jg-muted { color: var(--muted, #6b7280); font-size: .85rem; }
.jg-bar { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.jg-tabs { display: flex; gap: .35rem; margin-bottom: 1rem; }
.jg-tab { flex: 1; text-align: center; padding: .55rem .75rem; border-radius: 999px; border: 1px solid var(--border, #e5e2d9); color: inherit; text-decoration: none; font-weight: 600; font-size: .9rem; }
.jg-tab[aria-selected="true"] { background: var(--chip-bg, #e8f3ec); color: var(--primary-text, #175D31); border-color: transparent; }
.jg-tab:focus-visible, .jg-app-card:focus-visible { outline: 2px solid var(--primary, #175D31); outline-offset: 1px; }
.jg-panel { border: 1px solid var(--border, #e5e2d9); border-radius: 12px; padding: 1rem; }
.jg-panel h2 { margin: 0 0 .15rem; font-size: 1rem; }
.jg-empty { margin: .9rem 0 0; color: var(--muted, #6b7280); text-align: center; }
.jg-apps { display: grid; gap: .6rem; }
.jg-app-card { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border: 1px solid var(--border, #e5e2d9); border-radius: 12px; color: inherit; text-decoration: none; }
.jg-app-card strong { font-size: 1rem; }

.jg-card { border: 1px solid var(--border, #e5e2d9); border-radius: 10px; padding: .75rem; margin-top: .75rem; display: flex; flex-direction: column; gap: .3rem; }
.jg-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.jg-lines { font-size: .95rem; }
.jg-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.jg-pin { display: flex; flex-direction: column; gap: .3rem; margin-top: .35rem; }
.jg-sub { display: flex; gap: .35rem; margin: .75rem 0 0; overflow-x: auto; }
.jg-tabn:not(:empty) { margin-left: .35rem; padding: 0 .4rem; border-radius: 999px; background: var(--primary, #175D31); color: #fff; font-size: .75rem; }
.jg-tile-go { cursor: pointer; }
.jg-subtab { flex: 1 0 auto; white-space: nowrap; padding: .4rem .6rem; border-radius: 8px; border: 1px solid var(--border, #e5e2d9); background: none; color: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.jg-subtab[aria-selected="true"] { background: var(--chip-bg, #e8f3ec); color: var(--primary-text, #175D31); border-color: transparent; }

/* ---- Dispatch & Delivery (build 193): JekkaGO page, shipping and pick-up editors, guest checkout ---- */
.jg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jg-note { font-size: .85rem; margin: .25rem 0 .75rem; }
.jg-empty-line { margin: .25rem 0 0; font-size: .9rem; }
.jg-page .card { margin-top: 1rem; }
.jg-page .card:first-child { margin-top: 0; }
.jg-add-btns { display: grid; gap: .5rem; }
.jg-add-btns .btn { width: 100%; }
.jg-trow { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--border, #e5e7eb); }
.jg-trow:first-of-type { border-top: none; padding-top: .25rem; }
.jg-trow.is-off { opacity: .65; }
.jg-trow-main { min-width: 0; display: flex; flex-direction: column; gap: .1rem; overflow-wrap: anywhere; }
.jg-trow-sub { font-size: .85rem; color: var(--muted, #6b7280); }
.jg-badge { font-size: .7rem; font-weight: 600; padding: .05rem .4rem; border-radius: 999px; border: 1px solid var(--border, #e5e7eb); color: var(--muted, #6b7280); vertical-align: middle; }

.jg-scope { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.jg-scope-opt { position: relative; display: block; cursor: pointer; }
.jg-scope-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.jg-scope-opt span { display: block; padding: .65rem .8rem; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; font-weight: 600; }
.jg-scope-opt small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted, #6b7280); }
.jg-scope-opt input:checked + span { border-color: var(--primary, #0f766e); background: var(--chip-bg, #e8f3ec); color: var(--primary-text, #175D31); }
.jg-scope-opt input:focus-visible + span { outline: 2px solid var(--primary, #0f766e); outline-offset: 2px; }

.jg-switch { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.jg-switch input { width: 1.15rem; height: 1.15rem; margin: 0; flex: none; accent-color: var(--primary, #0f766e); }
.jg-switch-top { margin-bottom: .5rem; }

.jg-group { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border, #e5e7eb); }
.jg-group-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.jg-group-title { margin: 0; font-size: 1rem; }
.jg-rate { padding: .6rem; margin-bottom: .5rem; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }
.jg-rate-fields { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem; gap: .5rem; }
.jg-rate-fields input { width: 100%; min-height: 2.5rem; padding: .45rem .6rem; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; font: inherit; background: var(--surface, #fff); color: inherit; box-sizing: border-box; }
.jg-rate-fields input:focus-visible { outline: 2px solid var(--primary, #0f766e); outline-offset: 1px; }
.jg-rate-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .5rem; }
.jg-link-danger { appearance: none; border: none; background: none; color: var(--danger, #b91c1c); font: inherit; font-size: .85rem; cursor: pointer; padding: .25rem; }
.jg-add-group { margin-top: 1rem; }
.jg-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.jg-geo { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: .75rem; margin: 0 0 1rem; }
.jg-geo legend { font-size: .9rem; font-weight: 600; padding: 0 .3rem; }
.jg-geo-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.jg-geo-f span { display: block; font-size: .8rem; color: var(--muted, #6b7280); margin-bottom: .15rem; }
.jg-geo-f input { width: 100%; min-height: 2.5rem; padding: .45rem .6rem; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; font: inherit; background: var(--surface, #fff); color: inherit; box-sizing: border-box; }

/* Guest checkout: delivery choice inside the order sheet, and the catalog delivery card */
.dl-box { margin: .9rem 0 0; padding-top: .9rem; border-top: 1px solid var(--border, #e5e7eb); }
.dl-box h3 { margin: 0 0 .5rem; font-size: 1rem; }
.dl-methods { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .6rem; }
.dl-method { position: relative; cursor: pointer; }
.dl-method input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dl-method span { display: block; padding: .6rem .7rem; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; font-weight: 600; font-size: .95rem; }
.dl-method small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted, #6b7280); }
.dl-method input:checked + span { border-color: var(--primary, #0f766e); background: var(--chip-bg, #e8f3ec); color: var(--primary-text, #175D31); }
.dl-method input:focus-visible + span { outline: 2px solid var(--primary, #0f766e); outline-offset: 2px; }
.dl-sel { width: 100%; min-height: 2.6rem; padding: .45rem .6rem; margin-bottom: .5rem; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; font: inherit; background: var(--surface, #fff); color: inherit; box-sizing: border-box; }
.dl-pickups { display: grid; gap: .4rem; margin-bottom: .4rem; }
.dl-pu { position: relative; cursor: pointer; display: block; }
.dl-pu input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dl-pu span { display: block; padding: .55rem .7rem; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; font-size: .9rem; }
.dl-pu small { display: block; color: var(--muted, #6b7280); font-size: .8rem; }
.dl-pu input:checked + span { border-color: var(--primary, #0f766e); background: var(--chip-bg, #e8f3ec); }
.dl-pu input:focus-visible + span { outline: 2px solid var(--primary, #0f766e); outline-offset: 2px; }
.dl-group { margin: .5rem 0 .2rem; font-size: .8rem; font-weight: 600; color: var(--muted, #6b7280); }
.dl-near { margin: 0 0 .5rem; }
.dl-msg { font-size: .85rem; color: var(--muted, #6b7280); margin: .2rem 0 0; }
.dl-err { font-size: .85rem; color: var(--danger, #b91c1c); margin: .4rem 0 0; }
.dl-fee-row { display: flex; justify-content: space-between; gap: .5rem; margin-top: .4rem; font-size: .95rem; }
.jg-dest { margin-top: .35rem; padding: .45rem .6rem; border-radius: 8px; background: var(--chip-bg, #e8f3ec); font-size: .9rem; overflow-wrap: anywhere; }
@media (max-width: 380px) { .jg-rate-fields { grid-template-columns: 1fr; } }

/* ---- Locations and JekkaGO terminals (build 194) ---- */
.jg-side { padding: .5rem 0; border-top: 1px solid var(--border, #e5e7eb); }
.jg-side:first-of-type { border-top: none; padding-top: 0; }
.jg-rate[data-loc] .jg-rate-foot { flex-wrap: wrap; }

/* Build 201: "How it works" block inside the terminal panel */
.jg-how { margin-top: .75rem; padding: .25rem .75rem; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: var(--surface-2, rgba(127,127,127,.06)); }
.jg-how .jg-side:first-child { border-top: none; }

/* ---- Sync popup and clear address labels (build 203) ---- */
.jg-kind { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b7280); margin-bottom: .1rem; }
.jg-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0,0,0,.45); }
.jg-modal-card { background: var(--card-bg, var(--bg, #fff)); color: inherit; border-radius: 12px; width: 100%; max-width: 30rem; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.jg-modal-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1rem .5rem; }
.jg-modal-x { background: none; border: 0; font-size: 1.6rem; line-height: 1; padding: .1rem .5rem; cursor: pointer; color: inherit; }
.jg-modal-body { padding: .25rem 1rem; overflow-y: auto; flex: 1 1 auto; }
.jg-modal-foot { padding: .75rem 1rem 1rem; margin: 0; border-top: 1px solid var(--border, #e5e7eb); }

/* ---- Staff list (build 221): flat rows instead of cards, search + sort on top, big tap targets ---- */
@media (min-width: 700px) { .jg-shell { max-width: 640px; } }
.jg-panel.jg-flat { border: none; border-radius: 0; padding: 0; }
.jg-tools { position: sticky; top: 0; z-index: 5; margin: .75rem -1rem 0; padding: .6rem 1rem .5rem; background: var(--bg, #faf9f5); border-bottom: 1px solid var(--border, #e5e2d9); }
.jg-search { width: 100%; min-height: 2.9rem; padding: .5rem .85rem; font: inherit; font-size: 1rem; border: 1px solid var(--border, #e5e2d9); border-radius: 10px; background: var(--surface, #fff); color: inherit; }
.jg-search:focus-visible, .jg-sort select:focus-visible { outline: 2px solid var(--primary, #175D31); outline-offset: 1px; }
.jg-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: .5rem; }
.jg-sort { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted, #6b7280); }
.jg-sort select { min-height: 2.4rem; padding: .3rem .5rem; font: inherit; font-size: .95rem; border: 1px solid var(--border, #e5e2d9); border-radius: 8px; background: var(--surface, #fff); color: var(--text, #111); }
.jg-types { display: inline-flex; gap: .35rem; margin-left: auto; }
.jg-chip { min-height: 2.4rem; padding: .3rem .8rem; font: inherit; font-size: .9rem; font-weight: 600; border: 1px solid var(--border, #e5e2d9); border-radius: 999px; background: none; color: inherit; cursor: pointer; }
.jg-chip[aria-pressed="true"] { background: var(--chip-bg, #e8f3ec); color: var(--primary-text, #175D31); border-color: transparent; }
.jg-count { margin-top: .35rem; font-size: .8rem; color: var(--muted, #6b7280); min-height: 1.1em; }

.jg-item { display: flex; flex-direction: column; gap: .3rem; padding: .9rem .25rem .9rem .75rem; border-left: 4px solid transparent; border-bottom: 1px solid var(--border, #e5e2d9); }
.jg-item.is-action { border-left-color: var(--primary, #175D31); }
.jg-item.is-fresh { background: var(--chip-bg, #e8f3ec); }
.jg-item-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem .6rem; }
.jg-code { font-size: 1.15rem; letter-spacing: .01em; }
.jg-kindtag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); }
.jg-newtag { font-size: .7rem; font-weight: 700; text-transform: uppercase; padding: .05rem .45rem; border-radius: 999px; background: var(--primary, #175D31); color: #fff; }
.jg-ago { margin-left: auto; font-size: .85rem; color: var(--muted, #6b7280); }
.jg-main { font-size: 1.05rem; line-height: 1.35; }
.jg-sub-line { font-size: .95rem; }
.jg-sub-line a { color: inherit; }
.jg-status { font-size: .85rem; font-weight: 700; color: var(--primary-text, #175D31); }
.jg-warn { font-size: .9rem; color: var(--warn, #b45309); }
.jg-item .jg-actions { gap: .5rem; margin-top: .4rem; }
.jg-item .jg-actions .btn, .jg-item .jg-pin .btn, .jg-more { min-height: 2.9rem; font-size: 1rem; flex: 1 1 8rem; }
.jg-item .jg-pin input { min-height: 2.9rem; font-size: 1.1rem; }
.jg-more { display: block; width: 100%; margin-top: 1rem; }
.jg-tools + #jg-list .jg-empty { margin-top: 1.5rem; }

/* Build 226: JekkaGO bottom nav (Dashboard, Activity, Me) and Home tiles */
.jg-shell { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
.jg-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-top: .75rem; }
.jg-tile { border: 1px solid var(--border, #e5e2d9); border-radius: 10px; padding: .75rem .9rem; }
.jg-tile.is-action { border-left: 4px solid var(--primary, #175D31); }
.jg-tile-n { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.jg-shell [hidden] { display: none !important; }

/* ---- Guest checkout (build 231): Pick-up / Delivery, On premises / Off premises, table or room number popup ---- */
.dl-sub { margin-top: 0; }
.dl-picked { margin: .3rem 0 .4rem; font-size: .9rem; overflow-wrap: anywhere; }
.dl-link { appearance: none; border: none; background: none; padding: .25rem; margin-left: .25rem; font: inherit; font-size: .85rem; color: var(--primary, #0f766e); text-decoration: underline; cursor: pointer; }
.dl-num-modal { z-index: 500; }
.dl-num-help { margin: .2rem 0 .7rem; font-size: .95rem; }
.dl-num-foot { display: grid; gap: .5rem; }
.dl-num-ok { background: var(--primary, #0f766e); border-color: var(--primary, #0f766e); color: var(--on-primary, #fff); font-weight: 600; }

/* Dashboard / Activity / Me nav */
.jg-me-badge.hidden { display: none; }
.jg-drop { border: 1px solid var(--border, #e5e2d9); border-radius: 10px; padding: .2rem .75rem .75rem; margin: .5rem 0; }
.jg-drop > summary { cursor: pointer; font-weight: 600; min-height: 2.6rem; display: flex; align-items: center; }

/* ETA entry (Dispatch: preparation time; Delivery: delivery time) */
.jg-eta { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.jg-eta-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.jg-eta-chip { border: 1px solid var(--border, #d0d7de); background: transparent; color: inherit; border-radius: 999px; padding: .35rem .7rem; font-size: .9rem; min-height: 2.4rem; }
.jg-eta-row { display: flex; gap: .4rem; }
.jg-eta-row input { flex: 1 1 5rem; min-height: 2.9rem; font-size: 1.1rem; }
.jg-eta-row select { flex: 0 0 6.5rem; min-height: 2.9rem; font-size: 1rem; }
.jg-eta-line { font-size: .95rem; }

.jg-actions .btn[disabled], .jg-actions .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* Dashboard: Recent activity */
.jg-recent-title { margin: 1.25rem 0 .25rem; font-size: .85rem; font-weight: 700; letter-spacing: .02em; color: var(--muted, #6b7280); }
.jg-recent-row { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .25rem; border-bottom: 1px solid var(--border, #e5e2d9); }

/* Build 319: Me is a profile icon (top left); Exit is the only bottom-nav item; Orders opens from the Dashboard */
.jg-head-left { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.jg-icon-btn { position: relative; flex: none; width: 2.5rem; height: 2.5rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border, #e5e2d9); border-radius: 50%; background: var(--surface, transparent); color: var(--text, #111); text-decoration: none; cursor: pointer; }
.jg-icon-btn .i { width: 20px; height: 20px; }
.jg-icon-btn:focus-visible { outline: 2px solid var(--primary, #175D31); outline-offset: 2px; }
.jg-icon-back .i { transform: rotate(180deg); }
.jg-icon-btn .jg-me-badge { position: absolute; top: -.25rem; right: -.25rem; min-width: 1rem; line-height: 1rem; padding: 0 .3rem; text-align: center; font-size: .65rem; }
.jg-back { margin: 0 0 .75rem; }
.jg-quick { margin: .75rem 0 1rem; }
.jg-quick .btn { width: 100%; }

/* Build 334: the Terminals card (Retire, Terminal settings, Reload) reuses the JekkaPay .pos-* styles; the Profile icon sits far right */
body.jekkago-app { --term-bg: var(--bg); --term-surface: var(--surface); --term-text: var(--text); --term-muted: var(--muted); --term-accent: var(--primary-text, var(--primary)); --term-danger: var(--danger); }
.jg-header .jg-bar { margin-left: auto; align-items: center; }
.jg-icon-btn[aria-current="page"] { border-color: var(--primary-text, var(--primary, #175D31)); color: var(--primary-text, var(--primary, #175D31)); }
.pos-card-tools .pos-tools-note { font-size: .8rem; }
.pos-foot { padding-top: .25rem; padding-bottom: .25rem; }
.pos-showret { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .9rem; cursor: pointer; }

/* Build 336: the one global header Back; hidden until a screen is one level deep */
.jg-icon-btn[hidden] { display: none; }
