/* Barcode Studio — colour-forward mobile app.
   Phone-width column, gradient covers per section, tinted stat tiles,
   chunky rounded rows, a floating scan button and a glass tab bar.
   Every class the engine, the login form and the admin page emit is
   styled here. */

:root {
  --bg: #0b0716;
  --bg-2: #140d26;
  --surface: #ffffff;
  --surface-2: #f7f5ff;
  --ink: #171325;
  --ink-soft: #4b4763;
  --ink-mute: #7c7894;
  --line: rgba(23, 19, 37, .1);
  --violet: #7c5cff;
  --indigo: #4a7bff;
  --teal: #17d6b5;
  --mint: #7bf3c6;
  --amber: #ffb020;
  --rose: #ff5d8f;
  --lime: #b7f34a;
  --sky: #57c8ff;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Archivo Black", "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;
  --ease: cubic-bezier(.2, .85, .25, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --shadow: 0 18px 40px -22px rgba(8, 4, 20, .8), 0 2px 0 rgba(8, 4, 20, .35);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- colour field ---------------------------------------------------------- */

.mesh,
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.mesh {
  background:
    radial-gradient(60% 42% at 12% -6%, rgba(124, 92, 255, .55), transparent 70%),
    radial-gradient(52% 40% at 96% 4%, rgba(255, 93, 143, .4), transparent 70%),
    radial-gradient(70% 45% at 50% 108%, rgba(23, 214, 181, .34), transparent 72%),
    linear-gradient(180deg, #0c0819, #0b0716 55%, #0a0f16);
  animation: meshShift 24s ease-in-out infinite alternate;
}

.mesh::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(38% 30% at 70% 60%, rgba(87, 200, 255, .22), transparent 70%);
  animation: meshFloat 18s ease-in-out infinite alternate;
}

@keyframes meshShift {
  from { filter: hue-rotate(0deg) saturate(1); }
  to   { filter: hue-rotate(18deg) saturate(1.15); }
}

@keyframes meshFloat {
  from { transform: translate3d(-4%, -2%, 0) scale(1); }
  to   { transform: translate3d(5%, 4%, 0) scale(1.08); }
}

.stars {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .55) 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255, 255, 255, .28) 1px, transparent 1.4px);
  background-size: 130px 130px, 210px 210px;
  background-position: 10px 30px, 70px 90px;
  opacity: .45;
  animation: starsDrift 160s linear infinite;
}

@keyframes starsDrift {
  from { background-position: 10px 30px, 70px 90px; }
  to   { background-position: 140px 160px, 280px 300px; }
}

/* --- app frame ------------------------------------------------------------- */

.app {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 0 14px calc(112px + env(safe-area-inset-bottom));
  min-height: 100svh;
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 4px;
  background: linear-gradient(180deg, rgba(11, 7, 22, .92), rgba(11, 7, 22, .55) 70%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.brand-badge {
  display: grid;
  grid-auto-flow: column;
  gap: 2px;
  align-items: end;
  width: 36px;
  height: 36px;
  padding: 8px 7px;
  border-radius: 12px;
  background: linear-gradient(150deg, #fff, #e9e4ff);
  box-shadow: 0 6px 18px -8px rgba(124, 92, 255, .9);
}

.brand-badge i { display: block; width: 4px; height: 100%; border-radius: 3px; background: var(--ink); }
.brand-badge i:nth-child(2) { height: 66%; }
.brand-badge i:nth-child(3) { height: 84%; }

.brand-word {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-size: 14px;
  line-height: .95;
  letter-spacing: -.02em;
  text-transform: uppercase;
}

.brand-word b { color: var(--mint); }

.app-bar-right { display: flex; align-items: center; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s var(--ease), background .2s;
}

.chip:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; border: 1.5px solid currentColor; opacity: .5; }
.dot.ok { background: var(--mint); border-color: var(--mint); opacity: 1; box-shadow: 0 0 0 3px rgba(123, 243, 198, .18); animation: dotPulse 2.4s ease-in-out infinite; }
.dot.on { background: var(--mint); border-color: var(--mint); opacity: 1; }

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(123, 243, 198, .14); }
  50%      { box-shadow: 0 0 0 5px rgba(123, 243, 198, .05); }
}

/* --- document / card ------------------------------------------------------- */

main { display: block; }

.doc,
.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: docIn .55s var(--ease) both;
}

.card { margin-bottom: 14px; padding: 20px; }
.card + .card { animation-delay: .06s; }

@keyframes docIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { transform: translateY(0) scale(1); }
}

/* Each section gets its own gradient: set --a / --b on .doc or .card. */
.cover {
  position: relative;
  padding: 22px 20px 20px;
  background:
    radial-gradient(120% 90% at 88% 0%, var(--b, var(--rose)) 0%, transparent 62%),
    linear-gradient(140deg, var(--a, var(--violet)), var(--a, var(--violet)) 30%, var(--b, var(--indigo)));
  color: #fff;
  overflow: hidden;
}

.cover::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .32), transparent 66%);
  transform: translate(30%, -40%);
  animation: coverGlow 9s ease-in-out infinite alternate;
}

@keyframes coverGlow {
  from { transform: translate(30%, -40%) scale(1); }
  to   { transform: translate(10%, -20%) scale(1.25); }
}

.cover-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tile {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .8);
  font-size: 24px;
  line-height: 1;
  flex: 0 0 auto;
  animation: tileBob 6s ease-in-out infinite;
}

@keyframes tileBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-3px) rotate(-3deg); }
}

.cover-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}

.doc-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.pill.gold { background: rgba(255, 176, 32, .3); border-color: rgba(255, 209, 128, .7); }
.pill.mint { background: rgba(123, 243, 198, .26); border-color: rgba(166, 255, 219, .7); }
.pill.rose { background: rgba(255, 93, 143, .3); border-color: rgba(255, 160, 189, .7); }
.pill.sky  { background: rgba(87, 200, 255, .3); border-color: rgba(160, 224, 255, .7); }

.display {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(32px, 9vw, 44px);
  line-height: .92;
  letter-spacing: -.035em;
  text-transform: uppercase;
  color: #fff;
  text-wrap: balance;
}

.doc-body { padding: 18px 18px 22px; }

.lead,
.prose,
.card-body { font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); }

.lead { margin: 0 0 14px; }

.prose { margin: 0 0 16px; }
.prose:empty { display: none; }

.card h1 { margin: 0 0 8px; font-family: var(--display); font-size: clamp(26px, 6.4vw, 34px); line-height: .95; letter-spacing: -.03em; text-transform: uppercase; }

.card-body > b:first-child,
.card-body > div > b:first-child {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.card-body br + br { display: none; }

/* --- stat tiles ------------------------------------------------------------ */

.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0 0 18px;
}

.strip > div {
  padding: 12px 13px 13px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  animation: rowIn .5s var(--ease) both;
}

.strip > div:nth-child(1) { background: linear-gradient(160deg, rgba(124, 92, 255, .14), rgba(74, 123, 255, .08)); }
.strip > div:nth-child(2) { background: linear-gradient(160deg, rgba(23, 214, 181, .16), rgba(87, 200, 255, .08)); }
.strip > div:nth-child(3) { background: linear-gradient(160deg, rgba(255, 176, 32, .18), rgba(255, 93, 143, .08)); }

.strip span {
  display: block;
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.strip b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.1;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* --- rows ------------------------------------------------------------------ */

.grid { display: grid; gap: 9px; margin-top: 4px; }

.row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 9px; }
.row.single { grid-auto-flow: row; }
.row .action { min-width: 0; }

.action {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 18px -16px rgba(23, 19, 37, .9);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
  animation: rowIn .42s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(9px); }
  to   { transform: translateY(0); }
}

.action::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .35;
  transition: transform .22s var(--ease), opacity .22s;
  flex: 0 0 auto;
}

.action:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -18px rgba(23, 19, 37, .8); border-color: rgba(124, 92, 255, .4); }
.action:hover::after { transform: translateX(2px) rotate(45deg); opacity: .8; }
.action:active { transform: scale(.985); }

.action:disabled { opacity: .5; cursor: progress; }

.action .icon-slot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(124, 92, 255, .14), rgba(74, 123, 255, .1));
  color: var(--violet);
}

.action:nth-child(2n) .icon-slot { background: linear-gradient(150deg, rgba(23, 214, 181, .2), rgba(87, 200, 255, .1)); color: #0d9d86; }
.action:nth-child(3n) .icon-slot { background: linear-gradient(150deg, rgba(255, 176, 32, .24), rgba(255, 93, 143, .1)); color: #b06b00; }

.action .icon-slot svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9; }

.action.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--indigo) 60%, var(--sky));
  box-shadow: 0 14px 28px -16px rgba(124, 92, 255, .9);
}

.action.primary::after { opacity: .75; }

.action.primary .icon-slot { background: rgba(255, 255, 255, .2); color: #fff; }

.action.primary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -45%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .3), transparent);
  transform: skewX(-16deg);
  transition: transform .75s var(--ease);
}

.action.primary:hover::before { transform: translateX(380%) skewX(-16deg); }

.btn-row { display: grid; gap: 9px; }

/* --- segmented control (login) --------------------------------------------- */

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.seg button {
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-mute);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}

.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 16px -12px rgba(23, 19, 37, .9);
}

/* --- forms ----------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 8px; }

.field label,
.scanner-manual label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.field input,
.field textarea,
.searchbar input,
.scanner-manual input,
.field-inline input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.field input:focus,
.field textarea:focus,
.searchbar input:focus,
.scanner-manual input:focus {
  background: #fff;
  border-color: rgba(124, 92, 255, .65);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, .14);
}

.field input::placeholder,
.searchbar input::placeholder { color: #a5a1b8; }

.field .action { margin-top: 6px; }

.searchbar { display: flex; gap: 8px; margin: 2px 0 12px; }
.searchbar input { flex: 1; }
.searchbar .action { width: auto; min-width: 92px; justify-content: center; animation: none; padding: 12px 14px; }
.searchbar .action::after { content: none; }

.error {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 93, 143, .12);
  border: 1px solid rgba(255, 93, 143, .35);
  color: #b4164a;
  font-size: 13.5px;
  font-weight: 600;
}

.divider {
  position: relative;
  margin: 20px 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--line);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.brand-lockup { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(140deg, var(--violet), var(--sky)); color: #fff; font-family: var(--mono); font-size: 12px; letter-spacing: -2px; }
.brand-name { font-family: var(--display); font-size: 16px; text-transform: uppercase; }

/* --- media & meta ---------------------------------------------------------- */

.label-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 2px 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  animation: labelIn .5s var(--ease) both;
}

@keyframes labelIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { transform: translateY(0) scale(1); }
}

.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  margin: 0 0 14px;
  border-radius: 14px;
  background: var(--surface-2);
  overflow: hidden;
}

.meta:empty { display: none; }

.meta dt,
.meta dd {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.meta dt { color: var(--ink-mute); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; align-self: center; }
.meta dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.meta dt:nth-last-of-type(1),
.meta dd:nth-last-of-type(1) { border-bottom: 0; }

.product-name { margin: 0 0 6px; font-family: var(--display); text-transform: uppercase; font-size: 26px; letter-spacing: -.02em; }

/* --- scanner --------------------------------------------------------------- */

.scanner { margin-top: 14px; animation: docIn .45s var(--ease) both; }

.scanner-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: radial-gradient(circle at 50% 38%, #1b2a44, #060812);
  aspect-ratio: 4 / 3;
  max-height: min(50vh, 340px);
  border: 1px solid rgba(255, 255, 255, .1);
}

.scanner-view { width: 100%; height: 100%; object-fit: cover; display: block; }

.scanner-frame::before {
  content: "";
  position: absolute;
  inset: 13%;
  border: 1.5px dashed rgba(255, 255, 255, .45);
  border-radius: 16px;
  pointer-events: none;
}

.scanner-frame::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 12%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  box-shadow: 0 0 26px 5px rgba(123, 243, 198, .45);
  animation: scan 2.8s var(--ease) infinite;
  pointer-events: none;
}

@keyframes scan {
  0%, 100% { top: 12%; }
  50%      { top: 86%; }
}

.scanner-status { margin: 12px 2px 0; color: var(--ink-mute); font-size: 13px; }

.scanner-manual { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.scanner-manual .searchbar { margin: 0; }
.scanner-manual .action { width: auto; min-width: 90px; justify-content: center; animation: none; }
.scanner-manual .action::after { content: none; }

.scanner-progress { margin-top: 10px; }
.scanner-tray { margin-top: 16px; }

.scanner-result {
  padding: 14px;
  border-radius: var(--r-lg);
  background: linear-gradient(170deg, #fff, #f6f2ff);
  border: 1px solid var(--line);
  animation: docIn .4s var(--ease) both;
}

.scanner-result-head { margin-bottom: 10px; font-family: var(--display); font-size: 19px; text-transform: uppercase; letter-spacing: -.02em; }

.pipeline {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: #a5a1b8;
}

.pipeline li { display: flex; align-items: center; gap: 9px; transition: color .3s; }
.pipeline .dot { width: 8px; height: 8px; }
.pipeline li.run { color: var(--ink); }
.pipeline li.run .dot { background: var(--sky); border-color: var(--sky); opacity: 1; animation: dotPulse 1.2s ease-in-out infinite; }
.pipeline li.done { color: var(--ink-soft); }
.pipeline li.done .dot { background: var(--teal); border-color: var(--teal); opacity: 1; }

/* --- legal & meta links ---------------------------------------------------- */

.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin: 16px 2px 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}

.legal button { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.legal button:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.admin-link {
  display: block;
  width: fit-content;
  margin: 12px auto 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
  color: rgba(255, 255, 255, .78);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}

.admin-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(460px, calc(100vw - 28px));
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(20, 13, 38, .94);
  color: #fff;
  font-size: 13.5px;
  font-weight: 550;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px -22px rgba(0, 0, 0, .9);
  animation: toastIn .3s var(--ease-pop) both;
}

.toast.bad { border-color: rgba(255, 93, 143, .55); color: #ffd7e3; }

@keyframes toastIn {
  from { transform: translate(-50%, 10px); }
  to   { transform: translate(-50%, 0); }
}

.skeleton {
  height: 200px;
  border-radius: var(--r-lg);
  background: linear-gradient(100deg, rgba(255, 255, 255, .06) 20%, rgba(255, 255, 255, .16) 40%, rgba(255, 255, 255, .06) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from { background-position: 180% 0; }
  to   { background-position: -80% 0; }
}

/* --- tab bar --------------------------------------------------------------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 55;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  width: min(420px, calc(100% - 24px));
  padding: 8px 10px;
  border-radius: 26px;
  background: rgba(17, 11, 30, .96);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 22px 48px -20px rgba(0, 0, 0, .95);
  backdrop-filter: blur(18px);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: rgba(255, 255, 255, .55);
  font: inherit;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .2s, background .2s, transform .2s;
}

.tab svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.tab:hover { color: #fff; }
.tab.on { color: #fff; background: rgba(255, 255, 255, .14); }
.tab.on svg { stroke: var(--mint); filter: drop-shadow(0 0 8px rgba(123, 243, 198, .45)); }

.tab-scan { padding-top: 2px; }

.tab-fab {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1px;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--violet), var(--sky));
  box-shadow: 0 14px 26px -14px rgba(124, 92, 255, .95);
  color: #fff;
  transition: transform .25s var(--ease-pop);
}

.tab-scan:hover .tab-fab { transform: translateY(-3px) scale(1.04); }
.tab-fab svg { width: 22px; height: 22px; }

/* --- notification prompt --------------------------------------------------- */

.notify {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 58;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(460px, calc(100vw - 24px));
  padding: 10px 10px 10px 16px;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .9);
  animation: toastIn .32s var(--ease-pop) both;
}

.notify p { margin: 0; font-size: 12.5px; line-height: 1.35; font-weight: 600; flex: 1; }

.notify-go {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), var(--sky));
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.notify-x {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-mute);
  font-size: 11px;
  cursor: pointer;
}

/* --- admin ---------------------------------------------------------------- */

.main-wide { width: min(1040px, 100%); margin: 0 auto; padding: 0 16px calc(40px + env(safe-area-inset-bottom)); }
.main-wide .app-bar { padding-left: 0; padding-right: 0; }

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 5px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
}

.admin-tab {
  flex: 1 1 auto;
  padding: 9px 10px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: rgba(255, 255, 255, .6);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.admin-tab:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.admin-tab.on { background: #fff; color: var(--ink); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 9px;
  margin: 0 0 14px;
}

.stat {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: transform .2s var(--ease), background .2s;
}

.stat:nth-child(1) { background: linear-gradient(160deg, rgba(124, 92, 255, .35), rgba(124, 92, 255, .12)); }
.stat:nth-child(2) { background: linear-gradient(160deg, rgba(23, 214, 181, .3), rgba(23, 214, 181, .1)); }
.stat:nth-child(3) { background: linear-gradient(160deg, rgba(255, 176, 32, .3), rgba(255, 176, 32, .1)); }
.stat:nth-child(4) { background: linear-gradient(160deg, rgba(255, 93, 143, .3), rgba(255, 93, 143, .1)); }

.stat:hover { transform: translateY(-2px); }

.stat-num { display: block; font-family: var(--display); font-size: 26px; line-height: 1; color: #fff; margin-bottom: 5px; }

.stat-label { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .65); }

.sub { margin: 18px 0 8px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }

.list { display: grid; gap: 8px; }

.list-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 13.5px;
}

.list-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.member {
  padding: 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  animation: docIn .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}

.member + .member { margin-top: 8px; }

.member-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.member-names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.member-name { font-weight: 750; font-size: 14.5px; }
.member-id, .member-meta, .member-ip { font-family: var(--mono); font-size: 10px; color: rgba(255, 255, 255, .55); }
.member-head .pill { margin-left: auto; }

.member-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.member-actions button { width: auto; padding: 8px 12px; font-size: 12.5px; border-radius: 11px; animation: none; }
.member-actions button::after { content: none; }

.fields { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 12px; }
.field-inline { display: flex; flex-direction: column; gap: 5px; color: #fff; }

.picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }

.pick, .tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .78);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.pick:has(input:checked), .tool:has(input:checked) { background: #fff; color: var(--ink); border-color: #fff; }
.pick input, .tool input { accent-color: var(--violet); margin: 0; }

.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

.notice {
  padding: 11px 13px;
  margin: 0 0 12px;
  border-radius: 14px;
  background: rgba(87, 200, 255, .12);
  border: 1px dashed rgba(87, 200, 255, .45);
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
}

.fresh { margin: 10px 0; }
.codes-scroll { max-height: 300px; overflow: auto; margin: 0 0 10px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.codes { width: 100%; border-collapse: collapse; font-size: 12.5px; color: #fff; }
.codes th, .codes td { padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); text-align: left; }
.codes th { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.code { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }

.codes-out, .compose {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(10, 7, 20, .6);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

.log {
  max-height: 220px;
  overflow: auto;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(10, 7, 20, .55);
  border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .7);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
}

.log-line { white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- responsive ------------------------------------------------------------ */

@media (min-width: 720px) {
  .doc-body { padding: 22px 22px 26px; }
  .cover { padding: 26px 24px 22px; }
  .display { font-size: clamp(36px, 5.2vw, 48px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --- admin content sits on white cards ------------------------------------- */

.card .stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
}

.card .stat:nth-child(1) { background: linear-gradient(160deg, rgba(124, 92, 255, .16), rgba(124, 92, 255, .05)); }
.card .stat:nth-child(2) { background: linear-gradient(160deg, rgba(23, 214, 181, .18), rgba(23, 214, 181, .05)); }
.card .stat:nth-child(3) { background: linear-gradient(160deg, rgba(255, 176, 32, .2), rgba(255, 176, 32, .05)); }
.card .stat:nth-child(4) { background: linear-gradient(160deg, rgba(255, 93, 143, .18), rgba(255, 93, 143, .05)); }

.card .stat-num { color: var(--ink); }
.card .stat-label { color: var(--ink-mute); }

.card .sub { color: var(--ink-mute); }

.card .list-row,
.card .member {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
}

.card .member-id,
.card .member-meta,
.card .member-ip { color: var(--ink-mute); }

.card .pill {
  border-color: rgba(23, 19, 37, .18);
  background: var(--surface-2);
  color: var(--ink);
}

.card .pill.gold { background: rgba(255, 176, 32, .22); border-color: rgba(197, 133, 0, .4); }
.card .pill.mint { background: rgba(23, 214, 181, .18); border-color: rgba(9, 154, 128, .4); }
.card .pill.rose { background: rgba(255, 93, 143, .16); border-color: rgba(190, 30, 78, .35); }

.card .field-inline { color: var(--ink); }

.card .pick,
.card .tool {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.card .pick:has(input:checked),
.card .tool:has(input:checked) {
  background: linear-gradient(135deg, var(--violet), var(--indigo));
  border-color: transparent;
  color: #fff;
}

.card .pick input,
.card .tool input { accent-color: var(--violet); }

.card .notice {
  background: rgba(87, 200, 255, .12);
  border: 1px dashed rgba(30, 130, 190, .4);
  color: var(--ink-soft);
}

.card .codes-scroll { background: var(--surface-2); }

.card .codes { color: var(--ink); }
.card .codes th { color: var(--ink-mute); }
.card .codes td { border-bottom: 1px solid var(--line); }
.card .codes th { border-bottom: 1px solid var(--line); }

.card .codes-out,
.card .compose {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
}

.card .log {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-mute);
}

.card .member-actions button { background: #fff; }

/* --- phone body ------------------------------------------------------------ */

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  height: 100svh;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 10, 30, .35), rgba(11, 7, 22, .1));
  position: relative;
}

.app-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 14px calc(104px + env(safe-area-inset-bottom));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.app-body::-webkit-scrollbar { display: none; }

.status-bar { display: none; }

.tabbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: auto;
  transform: none;
}

.toast {
  bottom: calc(96px + env(safe-area-inset-bottom));
}

/* Desktop: show it as an actual handset, centred on the colour field. */
@media (min-width: 760px) {
  .phone-stage {
    display: grid;
    place-items: center;
    padding: 24px;
    min-height: 100svh;
  }

  .app {
    width: 420px;
    height: min(868px, calc(100svh - 48px));
    min-height: 0;
    max-width: 420px;
    border: 9px solid #16111f;
    border-radius: 50px;
    box-shadow:
      0 60px 120px -50px rgba(0, 0, 0, .95),
      0 0 0 1px rgba(255, 255, 255, .08),
      inset 0 0 0 1px rgba(255, 255, 255, .06);
  }

  .status-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 34px;
    padding: 4px 22px 0;
    color: #fff;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    background: linear-gradient(180deg, rgba(11, 7, 22, .95), rgba(11, 7, 22, .4));
  }

  .status-notch {
    width: 96px;
    height: 22px;
    border-radius: 0 0 16px 16px;
    background: #0a0712;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06);
  }

  .status-icons { display: inline-flex; align-items: flex-end; gap: 3px; }
  .status-icons i { display: block; width: 3px; border-radius: 1px; background: #fff; opacity: .85; }
  .status-icons i:nth-child(1) { height: 5px; }
  .status-icons i:nth-child(2) { height: 8px; }
  .status-icons i:nth-child(3) { height: 11px; }

  .app-bar { padding: max(18px, env(safe-area-inset-top)) 16px 12px; }
}

@media (max-width: 759px) {
  .app { height: 100svh; }
  .app-bar { padding: 12px 16px; }
}

/* Admin inside the same handset: three tabs to a row, two rows. */
.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 4px 0 12px;
}

.admin-tab {
  padding: 9px 6px;
  font-size: 11.5px;
  border-radius: 13px;
  text-align: center;
}

.main-wide {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.main-wide.app-body { padding: 0 14px 28px; }

.main-wide .app-bar { padding: 12px 16px; }

.card .member-actions button.primary,
.card .action.primary {
  background: linear-gradient(135deg, var(--violet), var(--indigo));
  color: #fff;
  border-color: transparent;
}

/* --- phone shell: fit the chrome at real handset widths -------------------- */

.app-bar {
  gap: 8px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.app-bar-right { min-width: 0; }

.chip { min-height: 30px; display: inline-flex; align-items: center; }

@media (max-width: 440px) {
  .app-bar { padding-left: 12px; padding-right: 12px; gap: 6px; }
  .app-bar-right { gap: 5px; }
  .chip { padding: 6px 9px; font-size: 9.5px; letter-spacing: .09em; }
  .brand-word { font-size: 13px; }
  .brand-word b { font-size: 10px; }
}

@media (max-width: 400px) {
  .main-wide .brand-word { display: none; }
  .main-wide .brand-badge { margin-right: 0; }
}

@media (max-width: 370px) {
  .brand-word { display: none; }
  #adminlink { display: none; }
  .main-wide .app-bar-right > a.chip { display: none; }
}

/* Toast must clear the floating dock, not sit on it. */
.toast { bottom: calc(122px + env(safe-area-inset-bottom)); }

/* Admin: one 14px gutter for header, tabs and card. */
.main-wide.app-body { padding: 0 0 28px; }
.main-wide #app { padding: 0 14px; }
.main-wide .app-bar { padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }

.admin-tab { min-height: 40px; }
.member-actions button, .card .action { min-height: 38px; }

/* AA contrast for the small labels on light tinted tiles and dark glass. */
.strip span, .card .stat-label { color: #635f7c; }
.legal { color: rgba(255, 255, 255, .66); }

/* Dock fade: content scrolling under the tab bar dissolves instead of peeking. */
.app-stage .app::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100px;
  background: linear-gradient(180deg, rgba(11, 7, 22, 0) 0, rgba(11, 7, 22, .88) 10px, #0b0716 22px);
  pointer-events: none;
  z-index: 2;
}

.tabbar { z-index: 3; }

/* --- overlays live inside the handset, not on the desktop behind it -------- */

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  max-width: none;
  transform: none;
  animation: toastInApp .3s var(--ease-pop) both;
}

.app-stage .toast { bottom: calc(112px + env(safe-area-inset-bottom)); }

@keyframes toastInApp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.notify {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(112px + env(safe-area-inset-bottom));
  width: auto;
  max-width: none;
  transform: none;
  animation: toastInApp .32s var(--ease-pop) both;
}

/* Dock shelf: solid only where the bar actually is. */
.app-stage .app::after {
  height: 106px;
  background: linear-gradient(180deg, rgba(11, 7, 22, 0) 0, rgba(11, 7, 22, .95) 12px, #0b0716 26px);
}

@media (max-width: 400px) {
  .main-wide .brand::after {
    content: "CR";
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    color: #fff;
  }
}

/* --- codes table becomes stacked rows on a phone --------------------------- */

@media (max-width: 480px) {
  .codes-scroll { max-height: none; overflow: visible; background: transparent; border-radius: 0; }
  .codes, .codes tbody, .codes tr, .codes td { display: block; width: 100%; }
  .codes thead { display: none; }
  .codes tr {
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(124, 92, 255, .07);
  }
  .codes td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    border: 0;
    text-align: right;
  }
  .codes td::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #6b6786;
    text-align: left;
  }
  .codes td.code { font-size: 13px; letter-spacing: .08em; }
  .codes td:last-child { padding-top: 8px; }
  .codes td:last-child::before { content: ""; }
}

.codes td:empty { display: none; }
.codes td:last-child .action { min-height: 34px; font-size: 12.5px; padding: 6px 12px; }
/* --- motion pass ----------------------------------------------------------- */

/* The cover leads, the headline follows, then the paper lifts in behind it. */
.doc .cover-top { animation: riseIn .5s var(--ease) both .04s; }
.doc .display { animation: riseIn .58s var(--ease) both .1s; }
.doc .doc-body > .prose,
.doc .doc-body > .lead,
.doc .doc-body > .card-body,
.doc .doc-body > .field { animation: riseIn .5s var(--ease) both .14s; }
.doc .doc-body > .strip { animation: riseIn .5s var(--ease) both .2s; }
.doc .doc-body > .meta { animation: riseIn .5s var(--ease) both .24s; }
.doc .doc-body > .label-img { animation: labelIn .6s var(--ease) both .16s; }
.legal { animation: riseIn .45s var(--ease) both .3s; }
.admin-link { animation: riseIn .45s var(--ease) both .34s; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* A slow band of light crosses the cover, like light over a laminated card. */
.cover::before {
  content: "";
  position: absolute;
  top: -70%;
  left: 0;
  width: 42%;
  height: 240%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .2), transparent);
  transform: translateX(-140%) rotate(16deg);
  animation: coverSheen 8.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes coverSheen {
  0%, 58%  { transform: translateX(-140%) rotate(16deg); opacity: 0; }
  63%      { opacity: 1; }
  88%, 100% { transform: translateX(420%) rotate(16deg); opacity: 0; }
}

/* Tiles land one after another. */
.strip > div:nth-child(1) { animation-delay: .22s; }
.strip > div:nth-child(2) { animation-delay: .28s; }
.strip > div:nth-child(3) { animation-delay: .34s; }

/* Everything gives a little under a finger. */
.action { transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s, background .2s; }
.action:active { transform: scale(.955); transition-duration: .09s; }
.action:active .icon-slot { transform: scale(.88); }
.icon-slot { transition: transform .18s var(--ease), background .2s; }
.action:not(.primary)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 140% at 20% 50%, rgba(124, 92, 255, .18), transparent 62%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.action:not(.primary):active::before { opacity: 1; }

.chip:active { transform: scale(.93); }
.admin-tab:active, .seg button:active { transform: scale(.96); }

/* The dock answers every tab change. */
.tab:active { transform: scale(.9); }
.tab.on svg { animation: tabPop .45s var(--ease-pop) both; }
@keyframes tabPop {
  0%   { transform: scale(.8); }
  60%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* The scan button breathes so the middle of the dock never sits still. */
.tab-fab { animation: fabFloat 6s ease-in-out infinite; }
@keyframes fabFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* Header hairline and a small brand tilt once the paper scrolls under it. */
.app-bar::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: scaleX(0);
  transition: transform .35s var(--ease);
}
.app.scrolled .app-bar::after { transform: scaleX(1); }
.brand-badge { transition: transform .3s var(--ease); }
.app.scrolled .brand-badge { transform: scale(.88) rotate(-3deg); }

/* Admin cards cascade; the active tab pops. */
.card:nth-of-type(1) { animation-delay: .04s; }
.card:nth-of-type(2) { animation-delay: .1s; }
.card:nth-of-type(3) { animation-delay: .16s; }
.card:nth-of-type(4) { animation-delay: .22s; }
.card:nth-of-type(5) { animation-delay: .28s; }
.admin-tab.on { animation: tabPop .4s var(--ease-pop) both; }

/* The handset lands on the desktop. */
@media (min-width: 760px) and (prefers-reduced-motion: no-preference) {
  .app { animation: handsetIn .7s var(--ease) both; }
}
@keyframes handsetIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
