:root {
  color-scheme: light;
  --bg: #F4F6F2;
  --ink: #17211B;
  --ink-2: #3D4842;
  --ink-3: #56625A;
  --line: #DCE3DC;
  --green: #1F7A46;
  --green-dark: #17603A;
  --tray: #DFE5DF;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }

main {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 28px) calc(env(safe-area-inset-right) + 16px)
           calc(env(safe-area-inset-bottom) + 32px) calc(env(safe-area-inset-left) + 16px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

button { font: inherit; }

.loading { margin: auto; color: var(--ink-3); }

/* --- the bags -------------------------------------------------------------------------------- */

.top { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.top img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); flex: none; }
.top h1 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em; }

.line {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #E6EAE7;
  color: #2F3A33;
  font-size: 14px;
  line-height: 20px;
}
.line svg { flex: none; }

.bags {
  list-style: none;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: 26px;
  background: var(--tray);
}

.bag {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1.5px solid #E1E6DF;
}
.bag .fill { position: absolute; left: 0; right: 0; bottom: 0; transition: height 0.6s ease; }
.bag .inner {
  position: relative;
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.bag .head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bag .kind {
  width: 32px; height: 32px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px; background: #EEF2EE;
}
.bag .names { display: flex; flex-direction: column; min-width: 0; }
.bag .name { font-size: 16px; line-height: 20px; font-weight: 700; }
.bag .number { font-size: 12px; line-height: 16px; color: var(--ink-2); }
.bag .pct { font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bag .status { display: flex; align-items: center; gap: 5px; min-height: 17px; font-size: 13px; line-height: 17px; font-weight: 700; }
.bag .status svg { flex: none; }

.bag.now { border-color: #E3A29B; }
.bag.now .fill { background: #F6C7C2; }
.bag.now .pct, .bag.now .status { color: #A1231B; }
.bag.now .kind { background: #FFFFFF; }

.bag.soon { border-color: #EBC98A; }
.bag.soon .fill { background: #F9E0B4; }
.bag.soon .status { color: #7A4500; }
.bag.soon .kind { background: #FFFFFF; }

.bag.ok .fill { background: #D6ECDD; }
.bag.ok .status { color: #1F6B3E; }

.bag.unknown { border-style: dashed; border-color: #A9B3AB; }
.bag.unknown .pct { color: #6B766E; }
.bag.unknown .status { color: var(--ink-2); }

@media (max-width: 340px) {
  .bag .pct { font-size: 30px; line-height: 34px; }
  .bag .inner { padding: 10px; }
}

/* --- the screens seen once ----------------------------------------------------------------- */

.once { margin: auto 0; display: flex; flex-direction: column; gap: 18px; padding: 0 8px; }
.once .badge { align-self: center; }
.once .logo { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line); }
.once .bell {
  width: 88px; height: 88px; border-radius: 44px; background: #DCEBDF; color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.once h1 { margin: 0; text-align: center; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.01em; }
.once .lead { margin: -6px 0 4px; text-align: center; color: var(--ink-2); font-size: 16px; line-height: 23px; }

.primary {
  width: 100%; padding: 15px 16px; border: 0; border-radius: 14px;
  background: var(--green); color: #FFFFFF; font-size: 17px; font-weight: 700; cursor: pointer;
}
.primary:active { background: var(--green-dark); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: 16px; background: #FFFFFF; border: 1px solid #E1E6DF; font-size: 16px; line-height: 23px;
}
.steps .n {
  width: 30px; height: 30px; flex: none; border-radius: 15px; background: #DCEBDF; color: var(--green);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
/* An iOS control named in a step: its icon, then its label, as on the phone */
.steps .ui { white-space: nowrap; }
.steps .ui svg { vertical-align: -4px; margin-right: 4px; color: #0A66D8; }
