/* Taubmans Trade Counter. Brand tokens from taubmans.com.au; layout follows the Pipelabs colour picker prototype. */
:root {
  --teal: #188577;
  --teal-dark: #224e60;
  --red: #aa3d38;
  --beige: #f3f3eb;
  --ink: #25282a;
  --ink-2: #4a4f52;
  --ink-3: #8e8d8d;
  --keyline: #d9dce0;
  --paper: #ffffff;
  --ok: #188577;
  --warn: #e6ae0d;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "Roboto", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--beige);
  color: var(--ink);
  font: 400 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.screen-body { flex: 1; padding: 16px 16px 120px; }

/* Header */
.bar {
  background: var(--teal);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.bar-back {
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.bar-title { font: 700 17px/1.2 var(--font); flex: 1; min-width: 0; }
.bar-title small { display: block; font: 400 12px/1.3 var(--font); opacity: 0.85; }
.bar-logo { height: 18px; width: auto; display: block; }
.bar-step { font: 500 12px/1 var(--font); background: rgba(255,255,255,.16); border-radius: 999px; padding: 6px 10px; }

/* Hero (home) */
.hero { background: var(--teal); color: #fff; padding: calc(28px + env(safe-area-inset-top)) 20px 28px; }
.hero img { height: 26px; display: block; margin-bottom: 18px; }
.hero h1 { margin: 0; font: 900 26px/1.1 var(--font); letter-spacing: -0.01em; }
.hero p { margin: 6px 0 0; opacity: 0.85; }

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--keyline);
  border-radius: var(--radius);
  padding: 0 14px;
  height: 48px;
}
.search input { border: 0; outline: 0; flex: 1; background: transparent; font-size: 16px; }
.search svg { color: var(--ink-3); flex: none; }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(37, 40, 42, 0.04);
}
.card + .card { margin-top: 12px; }
.card-title { font: 700 16px/1.25 var(--font); margin: 0; }
.card-sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.section-label { font: 700 11px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 22px 2px 10px; }

.account-card { display: block; width: 100%; text-align: left; border: 1px solid rgba(0,0,0,.05); transition: transform 160ms var(--ease); }
.account-card:active { transform: scale(0.99); }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: var(--teal-dark); color: #fff; display: grid; place-items: center;
  font: 700 15px/1 var(--font);
}

/* Pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill { font: 500 12px/1 var(--font); padding: 6px 10px; border-radius: 999px; background: var(--beige); color: var(--ink-2); }
.pill.teal { background: rgba(24, 133, 119, 0.12); color: var(--teal); }
.pill.dark { background: var(--teal-dark); color: #fff; }
.pill.warn { background: rgba(230, 174, 13, 0.18); color: #7a5b00; }

/* Credit meter */
.meter { height: 8px; border-radius: 999px; background: var(--beige); overflow: hidden; margin-top: 10px; }
.meter span { display: block; height: 100%; background: var(--teal); border-radius: 999px; transition: width 300ms var(--ease); }
.meter.over span { background: var(--red); }
.meter-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; border-radius: var(--radius); border: 0;
  font: 700 16px/1 var(--font); transition: transform 120ms var(--ease), opacity 120ms;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--keyline); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

/* Sticky footer */
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--keyline);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.footer .btn { flex: 1; }
.footer-sum { min-width: 0; }
.footer-sum strong { display: block; font: 900 18px/1.1 var(--font); }
.footer-sum span { font-size: 12px; color: var(--ink-3); }

/* Chips (filters, sheen, size) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--keyline); background: var(--paper);
  font: 500 14px/1 var(--font); display: inline-flex; align-items: center; gap: 8px;
}
.chip .dot { width: 14px; height: 14px; border-radius: 999px; border: 1px solid rgba(0,0,0,.1); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.big { height: 48px; padding: 0 18px; font-size: 15px; border-radius: var(--radius); }
.chip.big.on { background: var(--teal); border-color: var(--teal); }

/* Swatch grid (after the Pipelabs colour picker) */
.grid-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin: 14px 2px 10px; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(6, 1fr); } }
.swatch {
  background: var(--paper); border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 8px;
  overflow: hidden; padding: 0; text-align: left; display: flex; flex-direction: column;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.swatch:active { transform: scale(0.97); }
.swatch.selected { box-shadow: 0 0 0 2px var(--teal); }
.swatch-colour { aspect-ratio: 1 / 1.05; display: block; position: relative; }
.swatch-badge {
  position: absolute; right: 6px; top: 6px; background: rgba(255,255,255,.92); color: var(--ink);
  font: 500 9px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 999px;
}
.swatch-meta { padding: 8px 9px 9px; display: flex; flex-direction: column; gap: 2px; }
.swatch-name { font: 500 12.5px/1.2 var(--font); }
.swatch-code { font: 400 10.5px/1.2 var(--font); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Colour hero band */
.colour-band { border-radius: var(--radius); padding: 18px 16px; min-height: 140px; display: flex; flex-direction: column; justify-content: flex-end; }
.colour-band h2 { margin: 0; font: 900 24px/1.1 var(--font); }
.colour-band p { margin: 4px 0 0; font-size: 13px; opacity: .85; }
.colour-band .pills { margin-top: 12px; }
.colour-band .pill { background: rgba(255,255,255,.85); color: var(--ink); }

/* Product list */
.product { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; }
.product + .product { margin-top: 10px; }
.product img { width: 64px; height: 64px; object-fit: contain; background: var(--beige); border-radius: 8px; flex: none; }
.product .price { margin-left: auto; text-align: right; flex: none; }
.product .price strong { display: block; font: 700 15px/1.2 var(--font); }
.product .price span { font-size: 11px; color: var(--ink-3); }

/* Stepper */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper-ctl { display: flex; align-items: center; border: 1px solid var(--keyline); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.stepper-ctl button { width: 52px; height: 52px; border: 0; background: transparent; font: 500 22px/1 var(--font); }
.stepper-ctl output { width: 56px; text-align: center; font: 700 20px/1 var(--font); }

/* Rows (totals, ticket) */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.kv.muted { color: var(--ink-3); }
.kv.total { font: 900 20px/1.2 var(--font); padding-top: 12px; border-top: 1px solid var(--keyline); margin-top: 6px; }
.kv.saving span:last-child { color: var(--teal); font-weight: 700; }

.ticket-line { display: flex; gap: 12px; align-items: center; padding: 12px 0; }
.ticket-line + .ticket-line { border-top: 1px dashed var(--keyline); }
.ticket-swatch { width: 48px; height: 48px; border-radius: 8px; flex: none; border: 1px solid rgba(0,0,0,.06); }
.ticket-main { flex: 1; min-width: 0; }
.ticket-main strong { display: block; font: 700 14px/1.25 var(--font); }
.ticket-main span { display: block; font-size: 12px; color: var(--ink-3); }
.ticket-amt { text-align: right; flex: none; }
.ticket-amt strong { display: block; font: 700 15px/1.2 var(--font); }
.ticket-amt span { font-size: 11px; color: var(--teal); }
.ticket-remove { background: none; border: 0; color: var(--ink-3); font-size: 12px; padding: 4px 0 0; text-decoration: underline; }

.job-row { display: flex; gap: 8px; }
.job-row .search { flex: 1; }
.job-row .btn { width: auto; padding: 0 18px; height: 48px; }

.banner { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin-top: 12px; }
.banner.ok { background: rgba(24, 133, 119, 0.12); color: var(--teal-dark); }
.banner.bad { background: rgba(170, 61, 56, 0.12); color: var(--red); }

.empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
.demo-note { text-align: center; color: var(--ink-3); font-size: 11px; margin-top: 18px; }

/* Done */
.done { text-align: center; padding-top: 24px; }
.done-icon { width: 72px; height: 72px; border-radius: 999px; background: var(--teal); color: #fff; display: grid; place-items: center; margin: 0 auto 16px; }
.done h2 { font: 900 24px/1.15 var(--font); margin: 0; }
.done p { color: var(--ink-2); margin: 8px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 50;
  animation: toast 2.4s var(--ease) forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

@media (min-width: 760px) {
  .screen-body { max-width: 980px; margin: 0 auto; width: 100%; padding: 24px 24px 120px; }
  .footer { padding-left: max(24px, calc((100vw - 980px) / 2 + 24px)); padding-right: max(24px, calc((100vw - 980px) / 2 + 24px)); }
}
