/* Mini-screens: small replicas of the real product. Light, like the product itself, against the
   dark page. Sized in em, so one rule scales a whole screen. Till colours follow libs/cashier-ui. */

.screen {
  --s-bg: #f1f5f9;
  --s-card: #ffffff;
  --s-ink: #0f172a;
  --s-muted: #64748b;
  --s-line: #e2e8f0;
  --s-blue: #4285f4;
  --s-blue-deep: #1967d2;
  --s-blue-tint: #eff6ff;
  --s-green: #15803d;
  --s-green-tint: #dcfce7;
  --s-amber: #b45309;
  --s-amber-tint: #fef3c7;
  overflow: hidden;
  border-radius: 1em;
  background: var(--s-bg);
  color: var(--s-ink);
  font-family: Roboto, "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .8125rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1.5rem 3.5rem rgba(2, 6, 20, .55);
}
.screen b, .screen strong { font-weight: 700; }
.screen i { font-style: normal; }

.scr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .75em; padding: .85em 1.15em; background: var(--s-card); border-bottom: 1px solid var(--s-line); font-size: 1.08em; }
.scr-muted { color: var(--s-muted); font-size: .92em; }
.scr-pill--end { margin-left: auto; }
.scr-body { display: flex; flex-direction: column; gap: .85em; padding: .95em; }
.scr-chips { display: flex; flex-wrap: wrap; gap: .4em; }
.scr-chip { padding: .3em .8em; border-radius: 99em; border: 1px solid var(--s-line); background: var(--s-card); color: var(--s-muted); }
.scr-chip.is-on { background: var(--s-blue-tint); border-color: var(--s-blue); color: var(--s-blue-deep); font-weight: 600; }
.scr-tabs { display: flex; gap: 1.3em; border-bottom: 1px solid var(--s-line); }
.scr-tabs span { padding-bottom: .5em; color: var(--s-muted); }
.scr-tabs .is-on { color: var(--s-blue-deep); font-weight: 600; box-shadow: inset 0 -2px 0 var(--s-blue); }
.scr-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55em; }
.scr-btn { display: inline-flex; align-items: center; min-height: 2.5em; padding: .4em 1em; border-radius: .6em; border: 1px solid var(--s-line); background: var(--s-card); font-weight: 600; white-space: nowrap; }
.scr-btn--primary { background: var(--s-blue); border-color: var(--s-blue); color: #fff; }
.scr-btn--sm { min-height: 2.1em; padding: .2em .8em; background: #fff; }
.scr-pill { display: inline-flex; align-items: center; gap: .4em; align-self: flex-start; padding: .2em .7em; border-radius: 99em; font-size: .92em; font-weight: 600; white-space: nowrap; }
.scr-pill::before { content: ""; width: .45em; height: .45em; border-radius: 50%; background: currentColor; }
.scr-pill--blue { background: var(--s-blue-tint); color: var(--s-blue-deep); }
.scr-pill--green { background: var(--s-green-tint); color: var(--s-green); }
.scr-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4em .8em; padding: .55em .85em; border-radius: .7em; }
.scr-note--warn { background: var(--s-amber-tint); color: var(--s-amber); font-weight: 600; }
.scr-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75em; }
.scr-card { display: flex; flex-direction: column; gap: .3em; min-width: 0; padding: .85em 1em; background: var(--s-card); border-radius: .85em; border: 1px solid var(--s-line); }
.scr-label { color: var(--s-muted); font-size: .85em; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.scr-big { font-size: 1.1em; font-weight: 700; }
.scr-kv { display: flex; justify-content: space-between; gap: .75em; }
.scr-kv > span { color: var(--s-muted); }

.tbl { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--s-card); border: 1px solid var(--s-line); border-radius: .85em; }
.tbl col.c-wide { width: 42%; }
.tbl col.c-mid { width: 25%; }
.tbl th { padding: .6em .55em; text-align: left; color: var(--s-muted); font-size: .88em; font-weight: 600; border-bottom: 1px solid var(--s-line); }
.tbl td { padding: .6em .55em; border-bottom: 1px solid #f1f5f9; vertical-align: middle; overflow-wrap: anywhere; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; }
.tbl__name { display: block; font-weight: 500; }
.tbl__sku, .mono-cell { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .88em; color: var(--s-muted); }
.tbl tr.is-hot td { background: var(--s-blue-tint); }
.tbl tr.is-warn td { background: #fffbeb; }
.tbl tr.is-warn td b { color: var(--s-amber); }

.cost { display: flex; gap: .85em; align-items: stretch; padding: .85em 1em; background: var(--s-card); border: 1px solid var(--s-line); border-radius: .85em; }
.cost__rows { display: flex; flex-direction: column; gap: .35em; flex: 1; min-width: 0; }
.cost__rows > div { display: flex; justify-content: space-between; gap: .75em; }
.cost__rows span { color: var(--s-muted); }
.cost__total { margin-top: .2em; padding-top: .45em; border-top: 1px solid var(--s-line); }
.cost__total span { color: var(--s-ink); font-weight: 600; }
.cost__total b { font-size: 1.25em; color: var(--s-blue-deep); }
.qr-tag { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3em; flex: none; padding: .5em .55em; background: #fff; border: 1px dashed #94a3b8; border-radius: .4em; transform: rotate(-2.5deg); }
.qr-tag img { width: 3.9em; height: 3.9em; display: block; }
.qr-tag span { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .85em; font-weight: 600; }

/* Till */
.pos { padding: .65em; display: flex; flex-direction: column; gap: .65em; }
.pos__head { display: flex; flex-wrap: wrap; align-items: center; gap: .55em .85em; padding: .65em .85em; background: var(--s-card); border-radius: 1em; }
.pos__badge { display: grid; place-items: center; width: 2.6em; height: 2.6em; flex: none; border-radius: .7em; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; font-weight: 800; }
.pos__reg { display: flex; flex-direction: column; min-width: 0; flex: 1 1 12em; }
.pos__reg span { color: var(--s-muted); font-size: .88em; }
.pos__rev { display: flex; flex-direction: column; text-align: right; }
.pos__rev span { color: var(--s-muted); font-size: .85em; }
.pos__rev strong { color: #10b981; font-size: 1.3em; font-weight: 800; line-height: 1.15; }
.pos__seg { display: inline-flex; padding: .2em; background: #f1f5f9; border-radius: .7em; }
.pos__seg span { padding: .3em .7em; border-radius: .55em; color: var(--s-muted); }
.pos__seg .is-on { background: var(--s-card); color: var(--s-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .15); }
.pos__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: .65em; }
.pos__card { display: flex; flex-direction: column; gap: .65em; min-width: 0; padding: .85em; background: var(--s-card); border-radius: 1em; }
.pos__title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .3em .6em; }
.pos__modes { display: inline-flex; gap: .15em; padding: .15em; background: #f1f5f9; border-radius: .55em; font-size: .88em; }
.pos__modes i { padding: .15em .5em; border-radius: .4em; color: var(--s-muted); }
.pos__modes .is-on { background: var(--s-card); color: var(--s-ink); font-weight: 600; }
.pos__input { padding: .55em .8em; border: 1.5px solid var(--s-blue); border-radius: .65em; font-family: "JetBrains Mono", ui-monospace, monospace; }
.pos__item { display: flex; justify-content: space-between; gap: .75em; padding: .75em; border: 1px solid var(--s-line); border-radius: .85em; }
.pos__info { display: flex; flex-direction: column; gap: .35em; min-width: 0; }
.pos__tags { display: flex; flex-wrap: wrap; gap: .3em; }
.pos__tags i { padding: .05em .45em; border-radius: .35em; font-size: .85em; }
.pos__sku { font-family: "JetBrains Mono", ui-monospace, monospace; background: #f1f5f9; }
.pos__brand { background: #e0e7ff; color: #3730a3; font-weight: 600; }
.pos__cell { background: var(--s-green-tint); color: var(--s-green); font-weight: 600; }
.pos__stock { display: inline-flex; align-items: center; gap: .4em; color: var(--s-muted); font-size: .92em; }
.pos__dot { width: .55em; height: .55em; border-radius: 50%; background: #22c55e; }
.pos__buy { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: .4em; flex: none; }
.pos__buy strong { font-size: 1.3em; font-weight: 800; }
.pos__add { display: grid; place-items: center; width: 2.9em; height: 2.9em; border-radius: .8em; background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; font-size: 1.15em; font-weight: 700; }
.pos__chip { align-self: flex-start; padding: .25em .75em; border-radius: 99em; background: var(--s-amber-tint); color: var(--s-amber); font-weight: 600; }
.pos__analogs { display: flex; flex-direction: column; gap: .35em; margin-top: auto; padding-top: .65em; border-top: 1px solid var(--s-line); }
.pos__analog { display: flex; justify-content: space-between; gap: .75em; }
.pos__analog b { flex: none; }
.pos__count { color: var(--s-muted); font-size: .9em; }
.pos__line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35em .5em; align-items: center; padding-bottom: .65em; border-bottom: 1px solid var(--s-line); }
.pos__lname { grid-column: 1 / -1; font-weight: 500; }
.pos__stepper { display: inline-flex; align-items: center; gap: .55em; justify-self: start; padding: .1em .35em; border: 1px solid var(--s-line); border-radius: .5em; }
.pos__stepper i { color: var(--s-muted); padding: 0 .2em; }
.pos__totals { display: flex; flex-direction: column; gap: .25em; margin-top: auto; }
.pos__totals > div { display: flex; justify-content: space-between; align-items: baseline; color: var(--s-muted); }
.pos__total { color: var(--s-ink) !important; font-weight: 600; }
.pos__total strong { font-size: 2em; font-weight: 800; line-height: 1.1; }
.pos__pay { display: grid; grid-template-columns: 1fr 1fr; gap: .3em; font-size: .9em; }
.pos__pay span { padding: .35em .3em; text-align: center; border: 1px solid var(--s-line); border-radius: .5em; color: var(--s-muted); }
.pos__pay .is-on { border-color: #3b82f6; background: var(--s-blue-tint); color: var(--s-blue-deep); font-weight: 600; }
.pos__cta { padding: .75em; text-align: center; border-radius: .8em; background: linear-gradient(135deg, #10b981, #34d399); color: #fff; font-size: 1.1em; font-weight: 700; }

/* Workshop */
.job { display: flex; flex-direction: column; gap: .75em; padding: .95em 1.05em; background: var(--s-card); border: 1px solid var(--s-line); border-radius: .85em; }
.job__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .4em .75em; }
.job__plate { display: inline-block; margin-left: .55em; padding: .05em .5em; border: 1.5px solid var(--s-ink); border-radius: .3em; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .88em; font-weight: 600; white-space: nowrap; }
.job__rows { display: flex; flex-direction: column; }
.job__rows > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75em; padding: .5em 0; border-top: 1px solid var(--s-line); }
.job__rows b { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.job__issued { color: var(--s-muted); font-size: .9em; }
.job__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5em; }

/* Money */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65em; }
.kpi { display: flex; flex-direction: column; gap: .15em; padding: .75em .95em; background: var(--s-card); border: 1px solid var(--s-line); border-radius: .85em; }
.kpi span { color: var(--s-muted); font-size: .92em; }
.kpi strong { font-size: 1.35em; font-weight: 800; line-height: 1.2; }
.kpi .is-green { color: var(--s-green); }
.kpi--fx { background: var(--s-amber-tint); border-color: #fde68a; }
.kpi--fx strong { color: var(--s-amber); }
.ai { display: flex; flex-direction: column; gap: .55em; padding: .95em 1.05em; background: #0f172a; border-radius: .85em; color: #e2e8f0; }
.ai .scr-label { color: #7da7f7; }
.ai__q { align-self: flex-end; max-width: 85%; padding: .4em .85em; border-radius: .85em .85em .15em .85em; background: var(--s-blue); color: #fff; font-weight: 500; }
.ai__a { max-width: 95%; padding: .5em .85em; border-radius: .85em .85em .85em .15em; background: #1e293b; }

/* One entrance per screen. Keyframes only define the "from" state, so the resting state is always visible. */
@keyframes rise { from { opacity: 0; transform: translateY(.55em); } }
.js .step.is-active [data-in] { animation: rise .55s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: var(--d, 0s); }

@media (max-width: 480px) {
  .tbl .hide-sm { display: none; }
  .scr-body { padding: .7em; }
  .tbl th, .tbl td { padding: .55em .3em; }
  .tbl col.c-wide { width: 36%; }
  .pos__grid { grid-template-columns: minmax(0, 1fr); }
  .pos__pay { grid-template-columns: repeat(4, 1fr); }
  .pos__rev { text-align: left; }
}

@media (min-width: 900px) and (min-height: 540px) {
  .screen { font-size: 1rem; }
  .screen.pos { font-size: 1.1rem; }
  .kiosk .step__screen { margin-right: 10rem; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi--fx { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
