/* The Screen — rep app. Tablet/Chromebook-first, big tap targets, no print styles ever. */
:root {
  --blue: #0a5cd6;
  --blue-dark: #084aad;
  --ink: #17202c;
  --muted: #5b6878;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #dde4ee;
  --green: #178a4c;
  --amber: #c77700;
  --red: #c62f2f;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .9rem; background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 1.05rem; letter-spacing: .01em; }
.brand b { color: var(--blue); }
.spacer { flex: 1; }
.chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; max-width: 46vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.netdot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); display: inline-block; }
.netdot.off { background: var(--muted); }
.pending {
  font-size: .78rem; background: var(--amber); color: #fff;
  border-radius: 999px; padding: .15rem .55rem;
}

/* ambient timer */
.timerbar { height: 6px; background: var(--line); position: sticky; top: 0; z-index: 30; }
.timerfill { height: 100%; width: 0%; background: var(--green); transition: width 1s linear, background 2s; }

/* main view */
.view { flex: 1; overflow-y: auto; padding: 1rem .9rem 7.5rem; max-width: 1024px; width: 100%; margin: 0 auto; }
h2 { font-size: 1.15rem; margin: .2rem 0 .8rem; }
.hint { color: var(--muted); font-size: .9rem; }

/* bottom tabs */
.tabs {
  display: flex; gap: .5rem; padding: .5rem .9rem calc(.5rem + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
}
.tab {
  flex: 1; min-height: 52px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font-size: 1rem;
}
.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* floating customer button */
.customerbtn {
  position: fixed; right: 1rem; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 25;
  min-height: 58px; padding: 0 1.3rem; border-radius: 999px; border: none;
  background: var(--green); color: #fff; font-size: 1.05rem; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.customerbtn.active { background: var(--red); }

/* cards */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem; text-align: left; display: flex; flex-direction: column; gap: .35rem;
}
button.card { min-height: 84px; }
.card h3 { margin: 0; font-size: 1.02rem; }
.card .headline { color: var(--muted); font-size: .9rem; }
.badge {
  display: inline-block; background: #fff3e0; color: var(--amber);
  border-radius: 6px; padding: .1rem .45rem; font-size: .78rem; font-weight: 600;
}
.price { font-weight: 700; }
.price .was { color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: .4rem; font-size: .88rem; }
.price .sale { color: var(--red); }
.stale { color: var(--muted); font-size: .75rem; }
.points { margin: .3rem 0 0; padding-left: 1.1rem; }
.points li { margin: .18rem 0; }
.linkbtn {
  display: inline-block; margin-top: .5rem; background: var(--blue); color: #fff;
  border: none; border-radius: 10px; padding: .55rem .9rem; text-decoration: none;
  font-size: .92rem;
}
.linkbtn[aria-disabled="true"] { background: var(--muted); pointer-events: none; }
.seg { display: flex; gap: .5rem; margin-bottom: .9rem; }
.seg button {
  flex: 1; min-height: 48px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card);
}
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.back { background: none; border: none; color: var(--blue); font-size: .95rem; padding: .3rem 0; }

/* wizard */
.wizq { font-size: 1.35rem; margin: 1.2rem 0; }
.wizopts { display: grid; gap: .8rem; }
.wizopts button {
  min-height: 64px; font-size: 1.1rem; border-radius: var(--radius);
  border: 2px solid var(--line); background: var(--card);
}
.wizopts button:active { border-color: var(--blue); }

/* sheet (modal) */
.sheet {
  position: fixed; inset: 0; z-index: 40; background: rgba(15,23,33,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden], .login[hidden] { display: none; }
.sheet-inner {
  background: var(--card); width: 100%; max-width: 640px;
  border-radius: 18px 18px 0 0; padding: 1.1rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto;
}
.sheet h3 { margin: .1rem 0 .8rem; }
.bigopts { display: grid; gap: .7rem; }
.bigopts button { min-height: 60px; font-size: 1.08rem; border-radius: var(--radius); border: 2px solid var(--line); background: var(--bg); }
.bigopts .sold { background: var(--green); border-color: var(--green); color: #fff; }
.bigopts .walked { background: var(--bg); }
.row { display: flex; gap: .6rem; align-items: center; margin: .45rem 0; }
.row input[type="text"], .row input[type="email"], .row input[type="number"], .row select {
  flex: 1; font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; min-width: 0;
}
.itemrow { display: flex; gap: .5rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.itemrow .t { flex: 1; }
.itemrow .t small { color: var(--muted); display: block; }
.qty { width: 3.2rem; text-align: center; }
.accbtn { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: .35rem .5rem; font-size: .8rem; }
.accbtn.on { background: var(--amber); color: #fff; border-color: var(--amber); }
.primary { background: var(--blue); color: #fff; border: none; border-radius: var(--radius); min-height: 54px; font-size: 1.05rem; width: 100%; margin-top: .8rem; }
.ghost { background: none; border: none; color: var(--muted); width: 100%; min-height: 44px; }

/* login overlay */
.login {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.login-inner { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem 1.3rem; }
.login-inner h1 { font-size: 1.3rem; margin: 0 0 .3rem; }
.login-inner .err { color: var(--red); font-size: .9rem; min-height: 1.2em; margin: .4rem 0; }
.codeinput { font-size: 1.6rem; letter-spacing: .35em; text-align: center; }

/* recap */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; text-align: center; }
.stat .n { font-size: 1.5rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .8rem; }
.ilist { display: flex; flex-direction: column; gap: .5rem; }
.irow { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; display: flex; gap: .7rem; align-items: center; }
.irow .out { font-weight: 600; min-width: 5.2rem; }
.irow .out.sold { color: var(--green); }
.irow .out.walked, .irow .out.expired { color: var(--muted); }
.irow .out.no_sale { color: var(--amber); }
.scorepill { margin-left: auto; background: var(--bg); border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; }
textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; min-height: 70px; }
.offline-note { background: #fff8e6; border: 1px solid #f2dfa6; border-radius: 10px; padding: .5rem .8rem; font-size: .88rem; margin-bottom: .8rem; }
