/* PocketDennis. Look and sizes follow the handset in pocketdennis-sample.html. System fonts only (no internet). */
:root {
  --ground: #e7e9ea;
  --panel: #f7f8f8;
  --ink: #16191b;
  --muted: #5d666c;
  --line: #c9cfd2;
  --hivis: #f2b705;
  --hivis-ink: #16191b;
  --steel: #2f5d78;
  --steel-ink: #ffffff;
  --ok: #1f7a45; --warn: #b26a00; --bad: #b3261e;
  --chip: #dfe3e5;
  --f-display: "Avenir Next Condensed", "Roboto Condensed", "sans-serif-condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, "Roboto Mono", "Droid Sans Mono", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.4; }

.screen {
  max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  background: var(--panel); display: flex; flex-direction: column;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: .02em; white-space: nowrap; }
.brand b { color: var(--hivis); -webkit-text-stroke: .5px var(--ink); }
.bar .proj { flex: 1; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: 14px; color: var(--muted); }
.body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.spacer { flex: 1; }
.title { font-family: var(--f-display); font-weight: 800; font-size: 30px; margin: 0; }
.body p { margin: 0; }

label.f { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-display); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; color: var(--muted); }
select, input[type=text] { font: inherit; font-size: 18px; min-height: 56px; padding: 0 12px; border: 2px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); width: 100%; }
input[type=text] { font-family: var(--f-mono); font-size: 24px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
select:focus, input:focus, button:focus-visible, .btn:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }

button, .btn {
  font: inherit; cursor: pointer; border: 0; border-radius: 8px; min-height: 56px; padding: 0 16px;
  font-family: var(--f-display); font-weight: 700; font-size: 21px; letter-spacing: .03em; text-transform: uppercase;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.btn { display: flex; align-items: center; justify-content: center; text-align: center; }
.primary { background: var(--hivis); color: var(--hivis-ink); }
.secondary { background: var(--steel); color: var(--steel-ink); }
.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
button:disabled { opacity: .4; cursor: default; }
button:active:not(:disabled), .btn:active { filter: brightness(.92); }
.wide { width: 100%; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.iconbtn { min-height: 44px; min-width: 44px; padding: 0; font-size: 22px; background: var(--chip); color: var(--ink); }
.linkbtn { background: none; border: 0; min-height: 44px; padding: 0 4px; font-family: var(--f-body); font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--steel); text-decoration: underline; font-weight: 500; align-self: flex-start; }

.greet { font-family: var(--f-display); font-weight: 800; font-size: 36px; line-height: 1.05; margin: 6px 0 0; }

.lotlist { display: flex; flex-direction: column; gap: 8px; }
.lotbtn { display: flex; justify-content: space-between; align-items: center; background: var(--chip); color: var(--ink); text-transform: none; font-size: 23px; min-height: 64px; }
.lotbtn span:last-child { font-family: var(--f-body); font-size: 15px; font-weight: 500; color: var(--muted); }
.lothead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lothead .name { font-family: var(--f-display); font-weight: 800; font-size: 32px; }
.lothead .linkbtn { align-self: center; }

.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.chips2 { display: flex; justify-content: space-between; gap: 6px; }
.chip { min-height: 56px; min-width: 0; padding: 0 6px; background: var(--chip); color: var(--ink); font-family: var(--f-mono); font-size: 19px; }
.chip.bs { min-width: 30%; font-size: 24px; }
.matches { display: flex; flex-direction: column; gap: 6px; }
.matches.scroll { max-height: 420px; overflow: auto; }
.match { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left; background: var(--chip); color: var(--ink); min-height: 60px; padding: 8px 12px; text-transform: none; }
.match .m { font-family: var(--f-mono); font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.match .d { font-family: var(--f-body); font-size: 14px; font-weight: 500; color: var(--muted); grid-column: 1; }
.match .n { grid-row: 1 / 3; grid-column: 2; font-family: var(--f-display); font-size: 23px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key { min-height: 62px; background: var(--chip); color: var(--ink); font-family: var(--f-mono); font-size: 28px; }
.chip:disabled, .key:disabled { opacity: .28; }

.card { border: 2px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.card .m { font-family: var(--f-mono); font-size: 36px; font-weight: 700; line-height: 1.1; }
.card .small { margin-top: -10px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--f-mono); font-size: 20px; font-variant-numeric: tabular-nums; }
.stepper { display: grid; grid-template-columns: 72px 1fr 72px; gap: 8px; align-items: center; }
.stepper button { font-size: 30px; }
.stepper output { text-align: center; font-family: var(--f-mono); font-size: 34px; font-weight: 700; }
.warncard { border-color: var(--warn); }
.cardtitle { font-family: var(--f-display); font-size: 22px; }

.foot { display: flex; gap: 8px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); flex-wrap: wrap; }
.foot:empty { padding-top: 0; border-top: 0; }
.foot button { flex: 1; min-width: 100px; }
.toast { margin: 0 16px 12px; padding: 12px 14px; border-radius: 8px; background: var(--ink); color: var(--panel); font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.toast.bad { background: var(--bad); color: #fff; }
.empty { color: var(--muted); padding: 8px 2px; }
.done { font-family: var(--f-display); font-size: 26px; font-weight: 700; color: var(--ok); }
.today { padding-top: 4px; }

.note { border-left: 6px solid var(--line); background: var(--chip); border-radius: 6px; padding: 10px 12px; }
.note ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.note.ok { border-left-color: var(--ok); }
.note.warn { border-left-color: var(--warn); }
.note.bad { border-left-color: var(--bad); }
.facts2 { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.facts2 h2 { font-family: var(--f-display); font-weight: 800; font-size: 20px; margin: 0; }
.facts2 dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 15px; }
.facts2 dt { color: var(--muted); }
.facts2 dd { margin: 0; }
.mono { font-family: var(--f-mono); }
.wrap { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: pop .18s ease-out; }
  @keyframes pop { from { transform: translateY(6px); opacity: .6; } }
}
