/* ============================================================
   Stationery stock — a shop's card-index ledger.
   Sage and olive, with one yellow that acts. Each screen in the flow sits on
   its own step of that ladder, so you can tell where you are.
   ============================================================ */

:root{
  color-scheme:light;

  /* sampled from the reference: a sage page, olive bands, one yellow */
  --sage:#C1C4B1;       /* the page */
  --sage-dim:#ABAF9E;   /* the darker sage it sits on */
  --olive-1:#495142;    /* deepest band */
  --olive-2:#545C4F;
  --olive-3:#646F5F;
  --olive-4:#6F7A69;    /* lightest band */
  --yellow:#DCCA68;     /* the one bright colour, and the only one that acts */

  /* four more steps mixed along the same ladder */
  --lift:#D6D9C8;       /* cards, raised above the page */
  --field:#E8EAE0;      /* what you type into */
  --sunken:#B5B9A6;     /* table heads, toggle tracks, resting tabs */
  --hairline:#C9CCBA;   /* lines inside a card */
  --edge:#A3A791;       /* a border that has to be seen on a card */
  --mark:#4C5745;       /* a figure the shop worked out, not one you typed */

  --paper:var(--sage); --card:var(--lift); --pop:var(--yellow);
  --ink:#1C211A; --label:#333A2D; --muted:#454D3C;
  --rule:var(--edge); --hair:var(--hairline); --rule-strong:var(--olive-4);

  /* this palette has no alarm colour, so one tone comes from outside it */
  --bad:#A62617; --bad-soft:rgba(166,38,23,.10); --on-accent-bad:#FFAE9F;

  /* every screen paints itself from these three */
  --accent:var(--olive-1); --accent-soft:rgba(73,81,66,.13); --accent-ink:#EFF0E7;

  /* --- foundations, straight off the system sheet --- */
  --r-4:4px; --r-8:8px; --r-12:12px; --r-16:16px; --r-24:24px; --r-pill:999px;
  --b-thin:1px; --b-reg:2px; --b-thick:4px;
  --s-8:8px; --s-15:15px; --s-16:16px; --s-24:24px;

  /* the two lights every soft surface is lit by */
  --soft-hi:rgba(255,255,255,.72);
  --soft-lo:rgba(34,39,31,.17);

  --e1:none;                                                       /* flat */
  --e2:-2px -2px 6px var(--soft-hi), 3px 3px 8px var(--soft-lo);   /* hover */
  --e3:-3px -3px 9px var(--soft-hi), 5px 5px 12px var(--soft-lo);  /* raised */
  --e4:0 18px 44px -20px rgba(34,39,31,.5);                        /* modal */
  --e5:0 10px 26px -12px rgba(34,39,31,.38);                       /* popover */
  --inset:inset 2px 2px 6px var(--soft-lo), inset -2px -2px 6px var(--soft-hi);
  --pressed:inset 4px 4px 10px var(--soft-lo), inset -3px -3px 8px var(--soft-hi);

  --tabbar:0px;                      /* room kept for the phone tab bar + tally strip */
  --safe:env(safe-area-inset-bottom,0px);
}
/* The reference stacks its categories in bands of one hue; the screens do the same. */
body.s-buy{ --accent:var(--olive-2); --accent-soft:rgba(84,92,79,.14)}
body.s-move{--accent:var(--olive-3); --accent-soft:rgba(100,111,95,.16)}
body.s-sell{--accent:var(--olive-1); --accent-soft:rgba(73,81,66,.13)}

*{box-sizing:border-box}
body{
  margin:0; background:var(--paper); color:var(--ink);
  font-family:'IBM Plex Sans',system-ui,sans-serif; font-size:16px; line-height:1.5;
  background-image:repeating-linear-gradient(to bottom,transparent 0 31px,rgba(34,39,31,.05) 31px 32px);
  -webkit-text-size-adjust:100%;
}
a{color:var(--accent)}
.wrap{max-width:1080px; margin:0 auto; padding:30px 16px 64px}

/* ---------- masthead, with the nav as index-card dividers ---------- */
header.bar{display:flex; align-items:center; justify-content:space-between; gap:16px;
  flex-wrap:wrap; padding-bottom:16px}
.mark{width:44px; height:44px; border-radius:15px; background:var(--pop); color:var(--ink);
  display:grid; place-items:center; font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:16px;
  letter-spacing:.04em; flex:0 0 auto}
/* the heading is read out, not drawn */
.vh{position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0}

.topnav{margin-bottom:var(--s-24); display:flex; gap:2px; align-items:stretch;
  background:var(--card); border-radius:var(--r-16); box-shadow:var(--e3); padding:5px;
  overflow-x:auto; scrollbar-width:none}
.topnav::-webkit-scrollbar{display:none}
.topnav a{position:relative; display:flex; align-items:center; padding:10px 16px 11px;
  text-decoration:none; color:var(--muted); font-size:14.5px; font-weight:700; white-space:nowrap;
  border-radius:var(--r-12); transition:color .12s, background .12s}
.topnav a:hover{color:var(--ink)}
.topnav a.on{color:var(--accent)}
.topnav a.on::after{content:''; position:absolute; left:14px; right:14px; bottom:4px;
  height:var(--b-reg); border-radius:2px; background:var(--accent)}

/* ---------- the pipeline, drawn as the sheet's 4-step process ---------- */
.steps{position:relative; display:grid; grid-template-columns:repeat(4,1fr);
  margin:0 0 var(--s-24); background:var(--card); border-radius:var(--r-24);
  box-shadow:var(--e3); padding:18px 10px 14px}
.steps.three{grid-template-columns:repeat(3,1fr)}
/* the line the nodes sit on, drawn behind them */
.steps::before{content:''; position:absolute; left:16%; right:16%; top:34px; height:var(--b-reg);
  background:var(--edge); border-radius:2px}
.steps .leg{position:relative; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:0 6px; text-decoration:none; color:inherit; min-width:0; text-align:center}
.node{width:32px; height:32px; border-radius:50%; display:grid; place-items:center;
  font-family:'IBM Plex Mono',monospace; font-size:14px; font-weight:600;
  background:var(--card); color:var(--muted); box-shadow:var(--inset); position:relative; z-index:1;
  transition:box-shadow .14s}
.steps .leg:hover .node{box-shadow:var(--e2)}
.steps .leg.here .node{background:var(--accent); color:var(--accent-ink); box-shadow:var(--e3)}
.steps .k{font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.08em;
  text-transform:uppercase; font-weight:600; color:var(--muted); margin-top:7px}
.steps .leg.here .k{color:var(--accent)}
.steps .v{font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums;
  font-size:20px; font-weight:600; line-height:1.15}
.steps .v small{font-size:12.5px; color:var(--muted); font-weight:400; margin-left:3px}
.steps .leg.here .v{color:var(--accent)}
/* the tooltip the sheet puts over the current step */
.tip{position:absolute; top:-26px; left:50%; transform:translateX(-50%);
  background:var(--ink); color:var(--paper); border-radius:var(--r-8); padding:5px 10px;
  font-size:12px; font-weight:600; white-space:nowrap; box-shadow:var(--e5)}
.tip::after{content:''; position:absolute; bottom:-4px; left:50%; margin-left:-4px;
  border:4px solid transparent; border-top-color:var(--ink); border-bottom:0}

/* ---------- notices ---------- */
.flash{display:flex; align-items:center; gap:11px; background:var(--accent); color:var(--accent-ink);
  border-radius:var(--r-12); padding:14px 18px; margin-bottom:var(--s-24); font-weight:500;
  box-shadow:var(--e3)}
.flash .ico{flex:0 0 auto; width:22px; height:22px; border-radius:50%;
  background:var(--pop); color:var(--ink); display:grid; place-items:center;
  font-size:14px; font-weight:700}
.errors{background:var(--card); border-left:var(--b-thick) solid var(--bad); color:#7A1C10;
  padding:14px 18px; border-radius:0 var(--r-12) var(--r-12) 0; margin-bottom:var(--s-24);
  font-size:15px; box-shadow:var(--e3)}
.errors ul{margin:6px 0 0; padding-left:18px}
.warn{background:var(--card); border-left:var(--b-thick) solid var(--bad); color:#7A1C10;
  padding:14px 18px; border-radius:0 var(--r-12) var(--r-12) 0; margin-bottom:var(--s-24);
  font-size:15px; display:flex; flex-wrap:wrap; gap:10px; align-items:baseline;
  box-shadow:var(--e3)}
.warn a{color:#7A1C10; font-weight:600}

/* ---------- forms ---------- */
.cols{display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:26px; align-items:start}
form.card{background:var(--card); border:0; border-radius:var(--r-24); padding:var(--s-24);
  box-shadow:var(--e3)}
fieldset{border:0; margin:0 0 18px; padding:0}
legend{font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.1em;
  text-transform:uppercase; color:var(--accent); font-weight:700; padding:0 0 12px}
.row{display:grid; gap:14px; grid-template-columns:1fr 1fr}
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:16px}
label{font-size:14px; font-weight:700; color:var(--label)}
.hint{font-size:13px; color:var(--muted); font-weight:400}
input,select{font:inherit; color:var(--ink); background:var(--field);
  border:var(--b-reg) solid transparent; border-radius:var(--r-12); padding:13px 14px; width:100%;
  box-shadow:var(--inset); transition:border-color .12s, box-shadow .12s}
input[type=number]{font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums}
select{appearance:none; background-image:
  linear-gradient(45deg,transparent 50%,var(--muted) 50%),
  linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 19px) 51%, calc(100% - 14px) 51%;
  background-size:5px 5px, 5px 5px; background-repeat:no-repeat; padding-right:38px}
input:focus,select:focus{outline:0; border-color:var(--accent); box-shadow:var(--inset)}
.field.bad input{border-color:var(--bad)}
.helper{font-size:13px; color:var(--muted); margin-top:2px}
.helper.bad{color:var(--bad)}
.money{position:relative}
.money input{padding-left:46px}
.money .cur{position:absolute; left:12px; top:50%; transform:translateY(-50%);
  font-family:'IBM Plex Mono',monospace; font-size:14px; color:var(--muted)}
.asmuch{margin:7px 0 0; min-height:1.1em; font-family:'IBM Plex Mono',monospace;
  font-size:13px; color:var(--muted)}

.submit{background:var(--pop); color:var(--ink)}
.actions{display:flex; gap:12px; align-items:center; flex-wrap:wrap;
  border-top:1px solid var(--rule); padding-top:19px}
button{font:inherit; font-weight:600; background:var(--accent); color:var(--accent-ink); border:0;
  border-radius:var(--r-pill); padding:13px 26px; cursor:pointer; box-shadow:var(--e3);
  transition:box-shadow .12s, filter .12s}
button:hover{box-shadow:var(--e2)}
button:active{box-shadow:var(--pressed); filter:brightness(.96)}
button[disabled]{background:var(--sunken); color:var(--muted); box-shadow:none; cursor:default}
.reset{background:none; color:var(--muted); font-weight:500; padding:11px 6px}
.reset:hover{background:none; color:var(--ink); filter:none}
.danger{color:var(--bad); margin-left:auto}
.danger:hover{color:var(--bad); text-decoration:underline}
.submit.small{padding:9px 18px; font-size:15px}
.stamp{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--muted); margin-left:auto;
  letter-spacing:.04em}

/* one-tap chips */
.chips{display:flex; flex-wrap:wrap; gap:7px; margin-top:8px}
.chip{background:var(--card); color:var(--accent); border:0; box-shadow:var(--e3);
  border-radius:var(--r-12); padding:10px 15px; font-size:14px; font-weight:600; line-height:1.1}
.chip:hover{box-shadow:var(--e2)}
.chip:active{box-shadow:var(--pressed)}

/* minus / plus counters */
.stepper{display:grid; grid-template-columns:46px minmax(0,1fr) 46px; align-items:stretch; gap:6px}
.stepper input{text-align:center; font-size:18px; font-weight:600}
.step{background:var(--card); color:var(--accent); border:0; border-radius:var(--r-16);
  padding:0; font-size:21px; font-weight:600; line-height:1; display:grid; place-items:center;
  box-shadow:var(--e3)}
.step:hover{box-shadow:var(--e2); background:var(--card)}
.step:active{box-shadow:var(--pressed); background:var(--card)}

/* pieces / packs toggle, and the ledger's three views */
.segmented{display:grid; grid-template-columns:1fr 1fr; gap:6px; background:var(--paper);
  border:0; border-radius:var(--r-pill); padding:5px; margin-bottom:11px; box-shadow:var(--inset)}
.segmented.wide{grid-template-columns:repeat(3,1fr); margin-bottom:22px; max-width:420px}
.seg{position:relative; display:grid; place-items:center; padding:10px 6px; border-radius:999px;
  font-size:14.5px; font-weight:600; color:var(--muted); cursor:pointer; text-decoration:none;
  transition:background .12s, color .12s}
.seg input{position:absolute; opacity:0; pointer-events:none}
.seg:hover{color:var(--ink)}
.seg.on{background:var(--card); color:var(--accent); box-shadow:var(--e3)}
.seg:focus-within{outline:2px solid var(--accent); outline-offset:1px}
.segmented.subnav{display:none}   /* phones only: see the media query */

/* ---------- the tally slip ---------- */
.slip{background:var(--accent); color:var(--accent-ink); border:0; border-radius:26px;
  position:sticky; top:24px; overflow:visible}
.slip h2{margin:0; font-family:'Fraunces',Georgia,serif; font-size:18px; padding:20px 22px 14px;
  font-weight:500}
.slip .body{padding:4px 22px 22px}
/* the tear: a dashed line with a notch bitten out of each edge */
.tear{position:relative; height:0; margin:2px 22px 4px; border-top:2px dashed rgba(239,240,231,.38)}
.tear::before,.tear::after{content:''; position:absolute; top:-13px; width:26px; height:26px;
  border-radius:50%; background:var(--paper)}
.tear::before{left:-35px}
.tear::after{right:-35px}

.line{display:flex; justify-content:space-between; align-items:baseline; gap:10px;
  padding:14px 0; border-bottom:1px dashed rgba(239,240,231,.22)}
.line:last-child{border-bottom:0}
.line .k{font-size:14px; font-weight:500; color:rgba(239,240,231,.86)}
.line .v{font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums;
  font-weight:600; font-size:18px; color:var(--accent-ink)}
.line.big .v{font-size:28px; letter-spacing:-.01em}
.line.unit .v{color:var(--yellow)}
.line .v.neg{color:var(--on-accent-bad)}
.formula{font-family:'IBM Plex Mono',monospace; font-size:12px; color:rgba(239,240,231,.64);
  display:block; margin-top:3px}
.perf{display:none}   /* the tear line above does this job now */

/* ---------- last-whatever feed ---------- */
.recent{margin-top:26px}
.recent h3{font-family:'Fraunces',Georgia,serif; font-size:16px; margin:0 0 10px}
.feed{list-style:none; margin:0; padding:6px; background:var(--card); border:0;
  border-radius:var(--r-16); box-shadow:var(--e3)}
.feed li{display:flex; align-items:center; gap:11px; padding:10px 11px; border-radius:var(--r-12)}
.feed li + li{margin-top:2px}
.feed li:nth-child(odd){background:rgba(34,39,31,.035)}
.feed .ftile{flex:0 0 auto; width:34px; height:34px; border-radius:var(--r-8);
  background:var(--paper); box-shadow:var(--inset); color:var(--accent); display:grid; place-items:center;
  font-family:'IBM Plex Mono',monospace; font-size:12.5px; font-weight:600}
.feed .ftext{min-width:0; flex:1; display:flex; flex-direction:column; gap:1px}
.feed .ftext .when{margin-left:0; font-size:13px}
.feed .fname{font-weight:700; font-size:14.5px; white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis}
.feed .when{color:var(--muted); font-size:13.5px; margin-left:auto}
.feed .pcs{margin-left:auto; font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums;
  font-weight:600; font-size:15px}
.feed .pcs small{color:var(--muted); font-weight:400; font-size:12.5px}

/* ---------- figure tiles ---------- */
.totals,.today{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:22px}
.totals.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.totals.trade{margin-top:-8px}
.stat{background:var(--card); border:0; border-radius:var(--r-16); padding:var(--s-16) 18px;
  box-shadow:var(--e3)}
.stat .k{font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.08em;
  text-transform:uppercase; font-weight:600; color:var(--muted)}
.stat .at{font-weight:400; text-transform:none; letter-spacing:0; opacity:.8}
.stat .v{font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums;
  font-size:23px; font-weight:600; color:var(--accent); margin-top:5px}
.stat .v small{font-size:13.5px; color:var(--muted); font-weight:400}
.stat .v.neg{color:var(--bad)}
.today .v{font-size:20px}

/* ---------- tables ---------- */
table{width:100%; border-collapse:collapse; font-size:14.5px; background:var(--card);
  border:0; border-radius:22px; overflow:hidden}
th{text-align:left; font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.08em;
  text-transform:uppercase; font-weight:700; color:var(--muted); padding:13px 12px; border:0;
  white-space:nowrap; background:var(--paper)}
thead tr{box-shadow:var(--inset)}
th:first-child{border-radius:var(--r-12) 0 0 var(--r-12)}
th:last-child{border-radius:0 var(--r-12) var(--r-12) 0}
td{padding:11px 12px; border-bottom:1px solid var(--hair); vertical-align:middle; font-weight:500}
tr:last-child td{border-bottom:0}
td.num,th.num{font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums; text-align:right}
td.strong{font-weight:700}
td.dim{color:var(--muted)}
td.unit{color:var(--mark); font-weight:700}
td.num.neg{color:var(--bad)}
.when{color:var(--muted); font-size:14px; white-space:nowrap}
.tag{display:inline-block; background:var(--accent-soft); color:var(--accent);
  border-radius:var(--r-pill); padding:4px 11px; font-size:13px; font-weight:600;
  white-space:nowrap; line-height:1.3}
.scroll{overflow-x:auto; border:0; border-radius:var(--r-24); background:var(--card);
  box-shadow:var(--e3)}
.scroll table{border:0; min-width:760px}
.scroll::-webkit-scrollbar{height:9px}
.scroll::-webkit-scrollbar-thumb{background:var(--rule); border-radius:9px}

/* stock rows: name, pack size, and where the pieces actually sit */
.stockt td.item{min-width:220px}
.stockt .name{display:flex; align-items:baseline; gap:8px; flex-wrap:wrap}
.per{font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--muted)}
.lowtag{background:var(--bad); color:#FBEDE9; border-radius:20px; padding:2px 8px;
  font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.07em}
.split{display:flex; height:7px; margin-top:8px; border-radius:4px; overflow:hidden;
  background:repeating-linear-gradient(45deg,#C6CAB6 0 3px,#BCC0AC 3px 6px)}
.split i{display:block; height:100%}
.split .in-store{background:var(--accent); opacity:.4}
.split .on-shelf{background:var(--accent)}
.splitkey{display:flex; gap:12px; margin-top:6px; font-family:'IBM Plex Mono',monospace;
  font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted)}
.splitkey b{color:var(--ink); font-weight:600}
tr.lowrow td{background:rgba(166,38,23,.06)}
td.act,th.act{white-space:nowrap; text-align:right}
.mini{display:inline-block; background:var(--card); color:var(--accent); box-shadow:var(--e3);
  border:0; border-radius:var(--r-pill); padding:8px 15px; font-size:13.5px;
  font-weight:600; text-decoration:none; margin-left:6px}
.mini:hover{box-shadow:var(--e2)}
.mini:active{box-shadow:var(--pressed)}

/* ---------- items screen ---------- */
.itemgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(272px,1fr)); gap:16px}
.itemcard{background:var(--card); border:0; border-radius:var(--r-24); padding:19px;
  box-shadow:var(--e3)}
.itemcard .field{margin-bottom:13px}
.itemcard .row{gap:10px}
.itemfacts{display:flex; flex-wrap:wrap; gap:4px 14px; border-top:1px dashed var(--rule);
  padding-top:12px; font-size:13.5px; color:var(--muted)}
.itemfacts b{font-family:'IBM Plex Mono',monospace; color:var(--ink); font-weight:600}
.itemactions{display:flex; align-items:center; gap:8px; margin-top:13px}

/* ---------- odds and ends ---------- */
.empty{color:var(--muted); font-size:14.5px; background:transparent;
  border:var(--b-reg) dashed var(--edge); border-radius:var(--r-16); padding:18px}
.empty.big{padding:40px 24px; text-align:center; font-size:16px; display:flex;
  flex-direction:column; align-items:center; gap:4px}
.empty.big .glyph{width:56px; height:56px; border-radius:var(--r-16); background:var(--card);
  box-shadow:var(--e3); display:grid; place-items:center; margin-bottom:10px; color:var(--muted)}
.empty.big .glyph svg{width:26px; height:26px; fill:none; stroke:currentColor; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round}
.empty.big a{display:inline-block; margin-top:12px; font-weight:600; background:var(--accent);
  color:var(--accent-ink); text-decoration:none; border-radius:var(--r-pill);
  padding:11px 22px; box-shadow:var(--e3)}
.empty.big a:hover{box-shadow:var(--e2)}
.footnote{color:var(--muted); font-size:14px; margin-top:18px; max-width:68ch}
.footnote.top{margin:0 0 18px}

footer{margin-top:40px; color:var(--muted); font-size:13.5px; border-top:1px solid var(--rule);
  padding-top:14px; font-family:'IBM Plex Mono',monospace; letter-spacing:.03em}

/* phone-only furniture, off on wide screens */
.tabbar,.tally{display:none}

@media (max-width:860px){
  .cols,.cols.till{grid-template-columns:1fr}   /* .cols.till would otherwise out-rank this */
  .slip{position:static}
}

/* ================= phones ================= */
@media (max-width:620px){
  body{font-size:17px}
  .wrap{padding:0 14px calc(var(--tabbar) + 28px)}

  /* sticky masthead: title line, then the dividers scroll under it */
  header.bar{position:sticky; top:0; z-index:30; margin:0 -14px 16px; padding:9px 14px;
    background:var(--paper); border-bottom:1px solid var(--rule); flex-wrap:nowrap}
  .sub,.stamp,footer{display:none}
  /* the bottom tab bar and the rail cover navigation; the dividers would only repeat them */
  .topnav{display:none}
  .segmented.subnav{display:grid; margin-bottom:16px}


  /* the rail turns into three small cards across */
  .rail{grid-template-columns:repeat(4,1fr); margin-bottom:18px}
  .rail .arw{display:none}
  .rail .leg{padding:11px 10px; border-right:1px solid var(--hair)}
  .rail .leg:last-child{border-right:0}
  .rail .leg .k{font-size:9px; letter-spacing:.08em}
  .rail .leg .v{font-size:18px}

  .flash,.errors,.warn{margin-bottom:16px; font-size:15.5px}

  /* the form is the page: no card chrome, full-bleed fields */
  form.card{background:none; border:0; border-radius:0; padding:0; box-shadow:none}
  fieldset{margin-bottom:8px}
  legend{display:none}
  .field{gap:7px; margin-bottom:19px}
  label{font-size:15px; color:var(--ink)}
  .row{grid-template-columns:1fr; gap:0}
  input,select{font-size:18px; padding:14px; border-radius:12px; border-width:1.5px}
  select{background-position:calc(100% - 21px) 53%, calc(100% - 16px) 53%}
  .money input{padding-left:56px}
  .money .cur{left:14px; font-size:15px}
  .stepper{grid-template-columns:54px minmax(0,1fr) 54px; gap:8px}
  .step{font-size:25px; border-radius:12px; border-width:1.5px}
  .chip{padding:10px 16px; font-size:15px}
  .segmented{margin-bottom:13px}
  .segmented.wide{max-width:none; margin-bottom:18px}
  .seg{padding:12px 6px; font-size:16px}

  .actions{flex-direction:column; align-items:stretch; gap:4px; border-top:0; padding-top:4px}
  .submit{width:100%; padding:17px; font-size:18px; border-radius:13px;
    box-shadow:0 8px 18px -12px rgba(34,39,31,.18)}
  .reset{padding:12px; font-size:15.5px}

  /* the desktop slip folds away; the strip above the tab bar does its job */
  .slip{display:none}
  .recent{margin-top:22px}
  .recent h3{font-size:17px}
  .feed li{padding:13px}
  .feed .pcs{font-size:16px}

  .totals,.today{grid-template-columns:1fr 1fr; gap:10px; margin-bottom:18px}
  .totals.four{grid-template-columns:1fr 1fr}
  .stat{padding:12px 13px}
  .stat.wide,.today .stat:first-child,.totals.trade .stat:last-child{grid-column:1 / -1}
  .stat .v{font-size:20px}
  .totals.trade{margin-top:-6px}

  /* table rows become cards */
  .scroll{overflow:visible; border:0; background:none; border-radius:0}
  .scroll table,.scroll tbody,.scroll tr,.scroll td{display:block; width:auto}
  .scroll thead{display:none}
  .scroll table{min-width:0}
  .ledger tr{background:var(--card); border:1px solid var(--rule); border-radius:14px;
    padding:13px 15px 7px; margin-bottom:12px;
    display:grid; grid-template-columns:1fr 1fr; gap:0 14px;
    box-shadow:0 1px 0 rgba(34,39,31,.05)}
  .ledger td{border:0; padding:8px 0; display:flex; justify-content:space-between; align-items:baseline;
    gap:8px; font-size:16px; border-bottom:1px dashed var(--hair)}
  .ledger td::before{content:attr(data-label); color:var(--muted); font-size:13.5px; font-weight:500}
  .ledger td.num{text-align:left}
  .ledger td:last-child{border-bottom:0}
  /* the head line of each card */
  .ledger td.type,.ledger td.item{grid-column:1 / -1; order:-3; display:block; border-bottom:0;
    padding-top:0}
  .ledger td.type::before,.ledger td.item::before{display:none}
  .ledger td.type .tag,.ledger td.item .tag{font-size:14px; padding:4px 12px}
  .ledger td.item{border-bottom:1px solid var(--rule); padding-bottom:11px}
  .ledger td.when{grid-column:1; order:-2; border-bottom:1px solid var(--rule); font-size:14px}
  .ledger td.when::before{display:none}
  .ledger td.id{grid-column:2; order:-1; border-bottom:1px solid var(--rule);
    justify-content:flex-end; font-size:14px}
  .ledger td.id::before{display:none}
  .ledger td.act{grid-column:1 / -1; justify-content:flex-start; gap:10px; padding-top:12px;
    border-top:1px solid var(--rule); border-bottom:0}
  .ledger td.act::before{display:none}
  .mini{margin:0; padding:11px 18px; font-size:15px}

  .itemgrid{grid-template-columns:1fr; gap:14px}
  .itemcard{padding:15px}
  .itemcard .row{grid-template-columns:1fr 1fr; gap:10px}
  .itemfacts{font-size:14px}
  .submit.small{width:auto; padding:13px 22px; font-size:16px}

  .empty.big{padding:28px 20px}
  .pager{justify-content:space-between; margin-top:6px}
  

  /* running total, parked above the tab bar */
  .tally{display:grid; grid-template-columns:repeat(3,1fr); gap:2px;
    position:fixed; left:0; right:0; bottom:calc(60px + var(--safe)); z-index:40;
    background:var(--accent); color:var(--accent-ink); padding:9px 12px 10px;
    box-shadow:0 -10px 24px -18px rgba(34,39,31,.16)}
  .tally[hidden]{display:none}
  .tally .t{display:flex; flex-direction:column; gap:1px; min-width:0}
  .tally .k{font-family:'IBM Plex Mono',monospace; font-size:9.5px; letter-spacing:.1em;
    text-transform:uppercase; opacity:.75}
  .tally .v{font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums;
    font-weight:600; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .tally .v.neg{color:var(--on-accent-bad)}
  .tally .t:nth-child(3) .v{opacity:.9}

  /* four-thumb tab bar */
  /* a pill that floats clear of the bottom edge, the shop badge at its left end */
  .tabbar{display:grid; grid-template-columns:repeat(4,1fr); align-items:center; gap:2px;
    position:fixed; left:12px; right:12px; bottom:calc(10px + var(--safe)); z-index:50;
    background:var(--card); border:0; border-radius:999px; padding:7px 9px;
    box-shadow:0 10px 26px -14px rgba(34,39,31,.5)}
  .tabbar.two{grid-template-columns:repeat(2,1fr)}
  .tabbar a{display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
    padding:3px 0 5px; text-decoration:none; color:var(--muted); font-size:11.5px; font-weight:700;
    position:relative}
  .ticon{display:grid; place-items:center; width:38px; height:28px; border-radius:12px;
    transition:background .14s}
  .tabbar svg{width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:2;
    stroke-linecap:round; stroke-linejoin:round}
  .tabbar a.on{color:var(--accent)}
  .tabbar a.on .ticon{background:var(--accent); color:var(--accent-ink)}
  .tabbar a.on svg{stroke-width:2.4}
  /* the dot under the active label */
  .tabbar a.on::after{content:''; position:absolute; bottom:-1px; width:4px; height:4px;
    border-radius:50%; background:var(--accent)}
  .tlabel{line-height:1.2}
}

/* phones with the tally strip need extra bottom room */
@media (max-width:620px){ :root{--tabbar:146px} }

@media (prefers-reduced-motion:reduce){ *{transition:none !important} }

/* ============================================================
   Signing in, and who is signed in
   ============================================================ */

.who-bar{display:flex; align-items:center; gap:11px; margin-left:auto}
.whoami{display:flex; align-items:center; gap:9px; min-width:0}
.whoname{font-weight:600; font-size:14.5px}
.whouser{font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--muted); margin-top:2px}
.roletag{border-radius:20px; padding:3px 10px; font-size:12px; font-weight:600;
  letter-spacing:.08em; text-transform:uppercase; white-space:nowrap}
.roletag.manager{background:var(--accent-soft); color:var(--accent)}
.roletag.sales{background:rgba(100,111,95,.18); color:var(--olive-2)}
.youtag{font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted); font-weight:600}
.signout{font-size:14px; font-weight:600; color:var(--muted); text-decoration:none;
  border:1px solid var(--rule); border-radius:8px; padding:6px 13px; white-space:nowrap}
.signout:hover{color:var(--ink); border-color:var(--steel)}

/* the gate itself */
body.gate{display:grid; place-items:center; min-height:100vh; padding:24px 16px}
.gatebox{width:100%; max-width:402px}
.gatehead{display:flex; align-items:center; gap:13px; margin-bottom:20px}
.gatehead h1{font-family:'Fraunces',Georgia,serif; font-weight:700; font-size:24px; margin:0;
  letter-spacing:-.015em; line-height:1.1}
.gatehead .sub{color:var(--muted); font-size:14px; margin-top:2px}
.gatebox form.card{padding:22px}
.gatebox .submit{width:100%; padding:14px; font-size:17px; margin-top:4px}
.gatenote{color:var(--muted); font-size:14px; margin-top:16px; text-align:center; line-height:1.45}

/* staff cards */
.sectionhead{font-family:'Fraunces',Georgia,serif; font-size:17px; margin:0 0 14px}
.who{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:12px}
.itemcard.off{opacity:.5}
.itemcard.off .roletag{filter:grayscale(1)}
.stack{display:flex; flex-direction:column; gap:10px; margin-top:12px}
.row.tight{display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center}
.row.tight .submit{white-space:nowrap}
td.by{color:var(--muted); font-size:14px; white-space:nowrap}

/* a salesperson's chrome is narrower */
.rail.three{grid-template-columns:1fr auto 1fr auto 1fr}
.segmented.wide.four{grid-template-columns:repeat(4,1fr)}

@media (max-width:620px){
  .who-bar{gap:8px}
  .signout{padding:6px 11px; font-size:13.5px}
  .rail.three{grid-template-columns:repeat(3,1fr)}
  .tabbar.two{grid-template-columns:1fr 1fr}
  .tally.two{grid-template-columns:1fr 1fr}
  .topnav{margin-bottom:0}
  .gatehead h1{font-size:21px}
  .segmented.wide.four{grid-template-columns:repeat(2,1fr); gap:6px}
  .segmented.wide.four .seg{padding:11px 6px}
}

/* ============================================================
   Two languages
   ============================================================ */

.langswitch{display:flex; gap:3px; background:var(--sunken); border:1px solid var(--rule);
  border-radius:9px; padding:3px}
.lg{padding:5px 10px; border-radius:6px; font-size:13px; font-weight:600; line-height:1.3;
  color:var(--muted); text-decoration:none; white-space:nowrap}
.lg:hover{color:var(--ink)}
.lg.on{background:var(--rule); color:var(--accent)}
.gate .langswitch{width:max-content; margin:0 auto 18px}

/* Amharic: Ethiopic faces, no letter-spacing to stretch the syllables apart,
   and a little more room between lines for the taller glyphs. */
html[lang=am] body{font-family:'Noto Sans Ethiopic',system-ui,sans-serif; line-height:1.65}
html[lang=am] .slip h2,
html[lang=am] .recent h3,
html[lang=am] .sectionhead,
html[lang=am] .gatehead h1{font-family:'Noto Serif Ethiopic',Georgia,serif}
html[lang=am] .v,
html[lang=am] .stat .k,
html[lang=am] .rail .leg .k,
html[lang=am] th,
html[lang=am] legend,
html[lang=am] .per,
html[lang=am] .asmuch,
html[lang=am] .formula,
html[lang=am] .stamp,
html[lang=am] .whouser,
html[lang=am] .lowtag,
html[lang=am] .roletag,
html[lang=am] .youtag,
html[lang=am] footer{font-family:'IBM Plex Mono','Noto Sans Ethiopic',monospace; letter-spacing:0}
html[lang=am] .tabbar a{font-size:12px}
/* Ethiopic sets smaller than Latin at the same size: the unit suffixes need a notch back */
html[lang=am] .steps .v small,
html[lang=am] .stat .v small,
html[lang=am] .hero .v small,
html[lang=am] .feed .pcs small{font-size:13.5px}

/* ============================================================
   Meshed from the three references: a hero amount card and
   slider rows, leading tiles on every listed thing.
   ============================================================ */

/* the hero: the one figure that matters, with the next step inside it */
.topgrid{display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1.4fr); gap:14px; margin-bottom:22px}
.hero{background:var(--pop); color:var(--ink); border-radius:24px; padding:22px 24px 20px;
  display:flex; flex-direction:column; gap:4px}
.hero .k{font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.08em;
  text-transform:uppercase; font-weight:600; color:rgba(28,33,26,.68)}
.hero .at{font-weight:400; text-transform:none; letter-spacing:0}
.hero .v{font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums;
  font-size:38px; font-weight:600; line-height:1.05; letter-spacing:-.02em; margin-top:2px}
.hero .v small{font-size:14px; font-weight:500; color:rgba(28,33,26,.72); margin-left:4px}
.herorow{display:flex; gap:18px; margin-top:10px; font-size:14px; color:rgba(28,33,26,.8)}
.herorow b{font-family:'IBM Plex Mono',monospace; color:var(--ink); font-weight:600}
.heroact{align-self:flex-start; margin-top:16px; background:var(--ink); color:var(--pop);
  border-radius:999px; padding:11px 20px; font-size:14.5px; font-weight:600; text-decoration:none}
.heroact:hover{filter:brightness(.94)}
.totals.three{grid-template-columns:1fr; gap:10px; margin-bottom:0}
.totals.three .stat{display:flex; align-items:baseline; justify-content:space-between; gap:12px}
.totals.three .stat .v{margin-top:0; font-size:21px}

/* a tile leads every listed thing, the way the budget app leads a transaction */
.itemhead{display:flex; align-items:center; gap:13px}
.itemtext{min-width:0; flex:1}
.itile{width:42px; height:42px; border-radius:var(--r-12); background:var(--paper);
  box-shadow:var(--inset); color:var(--accent);
  display:grid; place-items:center; flex:0 0 auto;
  font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:14px; letter-spacing:.02em}
.stockt tbody tr:nth-child(even) td{background:rgba(34,39,31,.028)}
.stockt td.item{padding-top:14px; padding-bottom:14px}
.iname{font-weight:600; font-size:15.5px; letter-spacing:-.01em}
.isub{display:flex; align-items:center; gap:8px; margin-top:2px}

/* the slider: a wide track with a knob you can push with a thumb */
.dial{-webkit-appearance:none; appearance:none; width:100%; height:34px; margin:2px 0 0;
  background:none; cursor:pointer; --fill:0%}
.dial::-webkit-slider-runnable-track{height:14px; border-radius:999px;
  background:linear-gradient(to right, var(--accent) 0 var(--fill), var(--sunken) var(--fill) 100%)}
.dial::-webkit-slider-thumb{-webkit-appearance:none; width:30px; height:30px; border-radius:50%;
  background:var(--accent); border:4px solid var(--card); margin-top:-8px;
  box-shadow:0 2px 8px -2px rgba(34,39,31,.45)}
.dial::-moz-range-track{height:14px; border-radius:999px;
  background:linear-gradient(to right, var(--accent) 0 var(--fill), var(--sunken) var(--fill) 100%)}
.dial::-moz-range-thumb{width:30px; height:30px; border-radius:50%; background:var(--accent);
  border:4px solid var(--card); box-shadow:0 2px 8px -2px rgba(34,39,31,.45)}
.dial:focus{outline:0}
.dial:focus::-webkit-slider-thumb{box-shadow:0 0 0 4px var(--accent-soft)}
.dial[disabled]{opacity:.4; cursor:default}
.dialwrap{position:relative; padding-top:26px}
.bubble{position:absolute; top:0; transform:translateX(-50%); background:var(--ink); color:var(--paper);
  border-radius:var(--r-8); padding:4px 9px; font-family:'IBM Plex Mono',monospace; font-size:12.5px;
  font-weight:600; white-space:nowrap; box-shadow:var(--e5); pointer-events:none; opacity:0;
  transition:opacity .12s}
.bubble.on{opacity:1}
.bubble::after{content:''; position:absolute; bottom:-4px; left:50%; margin-left:-4px;
  border:4px solid transparent; border-top-color:var(--ink); border-bottom:0}
.dialrow{display:flex; align-items:center; justify-content:space-between; gap:10px;
  font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.1em;
  text-transform:uppercase; color:var(--muted); margin-top:2px}

@media (max-width:620px){
  .topgrid{grid-template-columns:1fr; gap:12px; margin-bottom:18px}
  .hero{padding:20px; border-radius:22px}
  .hero .v{font-size:33px}
  .totals.three{grid-template-columns:1fr; gap:8px}
  .itile{width:38px; height:38px; border-radius:13px; font-size:13.5px}
  .ledger td.item{padding-bottom:12px}
  .dial{height:38px}
}

/* ---------- pagination, numbered the way the sheet numbers it ---------- */
.pager{margin-top:var(--s-24); display:flex; gap:6px; align-items:center; justify-content:center;
  font-size:14.5px; color:var(--muted); flex-wrap:wrap}
.pg{background:none; border:0; color:var(--muted); font-weight:600; text-decoration:none;
  padding:9px 14px; border-radius:var(--r-8)}
.pg:hover{color:var(--ink)}
.pgnum{min-width:38px; height:38px; display:grid; place-items:center; border-radius:var(--r-8);
  text-decoration:none; color:var(--muted); font-weight:600; font-family:'IBM Plex Mono',monospace}
.pgnum:hover{color:var(--ink); box-shadow:var(--e2)}
.pgnum.on{background:var(--accent); color:var(--accent-ink); box-shadow:var(--e3)}
.pgdots{color:var(--muted); padding:0 2px}

/* ---------- the modal the sheet uses before something destructive ---------- */
.scrim{position:fixed; inset:0; z-index:90; background:rgba(34,39,31,.55);
  display:grid; place-items:center; padding:20px}
.scrim[hidden]{display:none}
.modal{background:var(--card); border-radius:var(--r-24); box-shadow:var(--e4);
  padding:26px 24px 22px; width:100%; max-width:330px; text-align:center}
.modal h3{font-family:'Fraunces',Georgia,serif; font-size:18px; margin:0 0 16px}
.modal .glyph{width:74px; height:74px; margin:0 auto 14px; border-radius:var(--r-24);
  background:var(--pop); color:var(--ink); display:grid; place-items:center; box-shadow:var(--e3)}
.modal .glyph svg{width:36px; height:36px; fill:none; stroke:currentColor; stroke-width:2.2;
  stroke-linecap:round; stroke-linejoin:round}
.modal p{color:var(--muted); font-size:14.5px; margin:0 0 20px}
.modalacts{display:flex; gap:10px; justify-content:center}
.modalacts .ghost{background:var(--card); color:var(--muted); box-shadow:var(--e3)}
.modalacts .ghost:hover{box-shadow:var(--e2)}
.modalacts .danger{background:var(--bad); color:#FBEDE9; margin:0; box-shadow:var(--e3)}
.modalacts .danger:hover{box-shadow:var(--e2); text-decoration:none}

@media (max-width:620px){
  .steps{padding:16px 6px 12px}
  .steps::before{left:14%; right:14%; top:32px}
  .node{width:30px; height:30px; font-size:13.5px}
  .steps .k{font-size:9px; letter-spacing:.06em}
  .steps .v{font-size:17px}
  .tip{display:none}
  .topnav{display:none}
  .pager{gap:4px}
  .pgnum{min-width:40px; height:40px}
}

/* ============================================================
   The till: a counter of goods on the left, a basket on the right
   ============================================================ */

.cols.till{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr)}
.counter .sectionhead{margin-bottom:12px}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px}

/* one tile per thing on the shelf */
.goods{display:flex; flex-direction:column; align-items:flex-start; gap:7px; text-align:left;
  background:var(--card); color:var(--ink); border:0; border-radius:var(--r-16);
  padding:14px; box-shadow:var(--e3); font-weight:500}
.goods:hover{box-shadow:var(--e2)}
.goods:active{box-shadow:var(--pressed)}
.gtile{width:36px; height:36px; border-radius:var(--r-12); background:var(--paper);
  box-shadow:var(--inset); color:var(--accent); display:grid; place-items:center;
  font-family:'IBM Plex Mono',monospace; font-size:13px; font-weight:600}
.gname{font-weight:600; font-size:15px; line-height:1.25; letter-spacing:-.01em}
.gfoot{display:flex; align-items:baseline; justify-content:space-between; gap:8px; width:100%;
  font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--muted)}
.gprice{color:var(--accent); font-weight:600; font-size:13.5px}

/* the basket, inside the receipt */
.basket{list-style:none; margin:0 0 6px; padding:0}
.basket li{padding:11px 0; border-bottom:1px dashed rgba(239,240,231,.24)}
.bline{display:flex; align-items:center; justify-content:space-between; gap:8px}
.bname{font-weight:600; font-size:15px}
.bdrop{background:none; box-shadow:none; color:rgba(239,240,231,.6); border:0; font-size:19px;
  line-height:1; padding:0 2px; cursor:pointer}
.bdrop:hover{color:var(--accent-ink); box-shadow:none}
.bqty{display:flex; align-items:center; gap:7px; margin-top:8px}
.bstep{width:30px; height:30px; padding:0; border-radius:var(--r-8); background:rgba(239,240,231,.14);
  color:var(--accent-ink); box-shadow:none; font-size:18px; display:grid; place-items:center}
.bstep:hover{background:rgba(239,240,231,.24); box-shadow:none}
.bn{min-width:26px; text-align:center; font-family:'IBM Plex Mono',monospace;
  font-variant-numeric:tabular-nums; font-weight:600; font-size:16px}
.bpack{padding:7px 10px; border-radius:var(--r-8); background:rgba(239,240,231,.14);
  color:var(--accent-ink); box-shadow:none; font-size:12.5px;
  font-family:'IBM Plex Mono',monospace}
.bpack:hover{background:rgba(239,240,231,.24); box-shadow:none}
.bprice{width:84px; padding:7px 8px; border-radius:var(--r-8); background:rgba(239,240,231,.12);
  border:0; box-shadow:none; color:var(--accent-ink); font-size:14px; text-align:right}
.bprice:focus{background:rgba(239,240,231,.2); box-shadow:none; border:0}
.btotal{margin-left:auto; font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums;
  font-weight:600; font-size:16px}
.basketempty{color:rgba(239,240,231,.6); font-size:14px; text-align:center; padding:18px 0 22px;
  margin:0; border-bottom:1px dashed rgba(239,240,231,.24)}
.basketempty[hidden]{display:none}

.charge{width:100%; margin-top:16px; padding:15px; font-size:17px}
.charge[disabled]{background:rgba(239,240,231,.16); color:rgba(239,240,231,.5); box-shadow:none}

@media (max-width:620px){
  .grid{grid-template-columns:1fr 1fr; gap:10px}
  .goods{padding:12px; border-radius:var(--r-12)}
  .gname{font-size:14.5px}
  .counter{margin-bottom:18px}
  /* the phone strip carries the total and the one button */
  .tally.till{grid-template-columns:1fr auto; align-items:center; gap:10px; padding:10px 12px 11px}
  .tally.till .charge{width:auto; margin:0; padding:12px 22px; font-size:16px;
    background:var(--pop); color:var(--ink); box-shadow:none}
  .tally.till .v{font-size:18px}
}

/* the till is declared after the shared breakpoints, so its stacking rule goes last */
@media (max-width:860px){ .cols.till{grid-template-columns:1fr} }


/* ============================================================
   ነጋድ ራስ — the opening frame. Five seconds, so it has to keep moving:
   the name resolves, a rule draws, the corners close, light crosses the
   letters twice, and a meter says how long is left.
   ============================================================ */
.splash{position:fixed; inset:0; z-index:200; display:grid; place-items:center; overflow:hidden;
  background:
    radial-gradient(112% 76% at 50% 34%, rgba(220,202,104,.11) 0%, transparent 60%),
    radial-gradient(135% 105% at 50% -5%, #3C4433 0%, #242B1D 44%, #11150E 100%);
  transition:opacity .6s ease, transform .6s ease, filter .6s ease}
.splash[hidden]{display:none}   /* a class beats [hidden]'s UA rule; no JS, no curtain */
.splash.out{opacity:0; transform:scale(1.035); filter:blur(7px); pointer-events:none}
html.splashing, html.splashing body{overflow:hidden}

/* the app's ruled paper, under a film of grain that will not sit still */
.sgrain{position:absolute; inset:0; pointer-events:none;
  background:repeating-linear-gradient(to bottom,transparent 0 31px,rgba(255,255,255,.021) 31px 32px)}
.sgrain::after{content:''; position:absolute; inset:-60%; opacity:.42; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.36'/%3E%3C/svg%3E");
  animation:s-grain 1.2s steps(2) infinite}
@keyframes s-grain{
  0%{transform:translate(0,0)} 25%{transform:translate(-1.5%,1%)}
  50%{transform:translate(1%,-1.5%)} 75%{transform:translate(-1%,-1%)} 100%{transform:translate(0,0)}}

/* the first letter of the name, blown up as a watermark and breathing */
.sghost{position:absolute; left:84%; top:50%; z-index:0; pointer-events:none; user-select:none;
  font-family:'Noto Serif Ethiopic',Georgia,serif; font-weight:700; line-height:1;
  font-size:min(96vh,820px); color:rgba(220,202,104,.045);
  transform:translate(-50%,-50%); animation:s-ghost 10s ease-in-out infinite alternate}
@keyframes s-ghost{
  from{transform:translate(-50%,-50%) scale(1); opacity:.75}
  to{transform:translate(-50%,-53%) scale(1.05); opacity:1}}

.splashinner{position:relative; z-index:2; display:flex; flex-direction:column; align-items:center}

/* two corners, not four — a frame that is implied rather than drawn */
.sframe{position:relative; padding:40px clamp(30px,7vw,76px) 34px; text-align:center}
.sframe::before,.sframe::after{content:''; position:absolute; width:36px; height:36px;
  border:1px solid rgba(220,202,104,.5); animation:s-corner 1s ease 1.6s both}
.sframe::before{top:0; left:0; border-right:0; border-bottom:0}
.sframe::after{bottom:0; right:0; border-left:0; border-top:0}
@keyframes s-corner{from{opacity:0; width:8px; height:8px} to{opacity:1; width:36px; height:36px}}

.wordmark{display:flex; align-items:baseline; justify-content:center; gap:.3em;
  font-family:'Noto Serif Ethiopic',Georgia,serif; font-weight:700;
  font-size:clamp(44px,10vw,90px); line-height:1.16; letter-spacing:.012em}
.wordmark span{display:inline-block;
  background:linear-gradient(100deg,#E9EBDD 0%,#E9EBDD 34%,#FFF7CD 45%,#DCCA68 52%,#E9EBDD 63%,#E9EBDD 100%);
  background-size:260% 100%; background-position:118% 0;
  -webkit-background-clip:text; background-clip:text; color:transparent;
  animation:s-rise 1.1s cubic-bezier(.16,.84,.26,1) .22s both,
            s-sheen 3.3s ease-in-out 1.5s 2 both}
.wordmark .w2{animation-delay:.38s, 1.72s}
@keyframes s-rise{from{opacity:0; transform:translateY(30px)} to{opacity:1; transform:none}}
@keyframes s-sheen{from{background-position:118% 0} to{background-position:-52% 0}}

.sweep{height:1px; width:0; margin:27px auto 19px; border-radius:2px;
  background:linear-gradient(90deg,transparent,rgba(220,202,104,.92) 50%,transparent);
  animation:s-draw 1.15s cubic-bezier(.16,.84,.26,1) .6s both}
@keyframes s-draw{from{width:0; opacity:0} to{width:min(300px,56vw); opacity:1}}

.byline{font-family:'IBM Plex Mono',monospace; font-size:12.5px; text-transform:uppercase;
  color:#EFF0E7; animation:s-byline 1.1s ease 1.1s both}
@keyframes s-byline{from{opacity:0; letter-spacing:.46em} to{opacity:.6; letter-spacing:.3em}}

/* the wait, made legible */
.sprog{width:150px; height:2px; margin-top:46px; border-radius:2px; overflow:hidden;
  background:rgba(239,240,231,.12); animation:s-fade .7s ease 1.6s both}
.sprog i{display:block; height:100%; width:0; border-radius:2px;
  background:linear-gradient(90deg,rgba(220,202,104,.45),#DCCA68);
  animation:s-meter 4.55s cubic-bezier(.33,0,.2,1) .35s both}
@keyframes s-meter{from{width:0} to{width:100%}}
@keyframes s-fade{from{opacity:0} to{opacity:1}}

@media (max-width:620px){
  .sframe{padding:36px 26px 30px}
  .byline{font-size:11px}
  .sprog{width:124px; margin-top:38px}
}

@media (prefers-reduced-motion:reduce){
  .sgrain::after,.sghost,.sframe::before,.sframe::after,
  .wordmark span,.sweep,.byline,.sprog,.sprog i{animation:none}
  .wordmark span{color:#E9EBDD; -webkit-text-fill-color:#E9EBDD}
  .sweep{width:min(300px,56vw)}
  .byline{opacity:.6; letter-spacing:.3em}
  .sprog i{width:100%}
}

/* the gate wears the name the splash just showed */
.gatehead{display:block; text-align:center; margin-bottom:22px}
.gatehead .gatemark{font-family:'Noto Serif Ethiopic',Georgia,serif; font-weight:700; font-size:43px;
  line-height:1.18; margin:0; letter-spacing:.012em; color:var(--ink)}
/* the hairline the splash drew, kept as a seal under the name */
.gatehead .gatemark::after{content:''; display:block; width:96px; height:2px; margin:13px auto 0; border-radius:2px;
  background:linear-gradient(90deg,transparent,var(--yellow) 20%,var(--yellow) 80%,transparent)}
.gatehead .sub{margin-top:12px}
/* the wordmark names its own face wherever it appears, so Ethiopic never falls back to tofu */
.fbrand{font-family:'Noto Serif Ethiopic',Georgia,serif; font-weight:700; letter-spacing:0}
.poweredby{font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:.2em;
  text-transform:uppercase; color:var(--muted); opacity:.75; text-align:center; margin:22px 0 0}

/* the APK download page */
.getsub{color:var(--muted); font-size:13px; margin-top:9px; letter-spacing:.01em}

/* ---------- the logo on the gate and in the opening frame ---------- */
.gatelogo{display:block; width:min(292px,76%); height:auto; margin:0 auto}
.gatehead .sub{margin-top:16px}

.sseal{display:block; width:clamp(86px,17vw,124px); height:auto; margin:0 auto 26px;
  filter:drop-shadow(0 16px 30px rgba(0,0,0,.45));
  animation:s-seal 1.05s cubic-bezier(.16,.84,.26,1) both}
@keyframes s-seal{
  from{opacity:0; transform:translateY(16px) scale(.9)}
  to{opacity:1; transform:none}}
@media (max-width:620px){ .sseal{margin-bottom:20px} }
@media (prefers-reduced-motion:reduce){ .sseal{animation:none} }
