:root {
  --blue: #1e3a5f; --blue2: #2c5282; --red: #c0392b; --green: #1e8449; --amber: #d68910;
  --bg: #eef1f5; --card: #fff; --text: #1a202c; --muted: #64748b; --line: #d8dee6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 19px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg);
  touch-action: manipulation; -webkit-user-select: none; user-select: none; overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; user-select: text; -webkit-user-select: text; }

#app { min-height: 100%; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
header.top {
  position: sticky; top: 0; z-index: 5; background: var(--blue); color: #fff; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; min-height: 64px;
}
header.top h1 { font-size: 21px; margin: 0; flex: 1; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
header.top h1 small { display: block; font-weight: 400; font-size: 14px; opacity: .8; }
.hbtn { min-width: 48px; height: 48px; border-radius: 12px; background: rgba(255, 255, 255, .15); color: #fff; font-weight: 700; padding: 0 12px; font-size: 18px; }
.hbtn.on { background: #fff; color: var(--blue); }
.lang { display: flex; gap: 4px; }
.lang .hbtn { min-width: 44px; padding: 0 8px; font-size: 16px; }

main { flex: 1; padding: 14px 12px 120px; }
.banner { background: #fff3cd; color: #7a5b00; padding: 8px 12px; font-size: 15px; text-align: center; }
.banner.q { background: #dbeafe; color: #1e40af; }
h2.sec { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 4px 8px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative; background: var(--card); border-radius: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); overflow: hidden;
  display: flex; flex-direction: column; text-align: left; min-height: 92px;
}
.tile:active { transform: scale(.97); }
.tile .img { aspect-ratio: 4/3; background-size: cover; background-position: center; display: grid; place-items: center; color: #fff; font-size: 34px; font-weight: 800; }
.tile .nm { padding: 8px 10px 10px; font-weight: 700; font-size: 17px; line-height: 1.2; }
.tile .nm small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.badge {
  position: absolute; top: 8px; right: 8px; min-width: 38px; height: 38px; padding: 0 9px; border-radius: 19px; background: var(--red); color: #fff;
  font-weight: 800; display: grid; place-items: center; font-size: 19px; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.badge.ret { background: var(--green); }
.minus { position: absolute; top: 8px; left: 8px; width: 38px; height: 38px; border-radius: 19px; background: #fff; color: var(--text); font-size: 26px; font-weight: 800; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }

.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 14px 16px; min-height: 76px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12); text-align: left; width: 100%;
}
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-size: 21px; }
.row .grow span { color: var(--muted); font-size: 15px; }
.thumb { width: 56px; height: 56px; border-radius: 12px; background-size: cover; background-position: center; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; }
.row.site { border-left: 8px solid var(--blue2); }
.avatar { width: 64px; height: 64px; border-radius: 32px; display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 800; flex: none; }

.bigbtns { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.big { border-radius: 20px; min-height: 120px; color: #fff; font-size: 30px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); }
.big small { font-size: 16px; font-weight: 500; opacity: .9; }
.big.red { background: var(--red); } .big.green { background: var(--green); } .big.blue { background: var(--blue2); }
.big:active { transform: scale(.98); filter: brightness(.92); }
.btn { border-radius: 14px; min-height: 60px; padding: 0 20px; font-weight: 700; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); font-size: 19px; }
.btn.primary { background: var(--blue2); color: #fff; } .btn.red { background: var(--red); color: #fff; } .btn.green { background: var(--green); color: #fff; }
.btn.wide { width: 100%; } .btn.ghost { background: transparent; box-shadow: none; color: var(--blue2); }
.navrow { display: flex; gap: 10px; margin: 12px 0 0; flex-wrap: wrap; }
.navrow .btn { flex: 1; min-width: 140px; }
.info { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.info .addr { font-size: 19px; }
.info .note { margin-top: 8px; padding: 8px 10px; background: #fff7e0; border-radius: 10px; font-size: 16px; }

.search { width: 100%; height: 56px; border-radius: 14px; border: 2px solid var(--line); padding: 0 16px; font-size: 20px; margin-bottom: 12px; background: #fff; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center; box-shadow: 0 -2px 8px rgba(0, 0, 0, .12);
}
.bar .sum { flex: 1; font-weight: 700; }
.bar .btn { min-width: 150px; }

.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper button { width: 56px; height: 56px; border-radius: 14px; background: #e5e9ef; font-size: 30px; font-weight: 800; }
.stepper button.plus { background: var(--blue2); color: #fff; }
.stepper .q { min-width: 58px; text-align: center; font-size: 26px; font-weight: 800; }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { height: 46px; padding: 0 14px; border-radius: 12px; background: #e5e9ef; font-weight: 800; font-size: 20px; }
.line { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.line .top { display: flex; align-items: center; gap: 12px; }
.line .max { color: var(--muted); font-size: 14px; }

#sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; }
#sheet[hidden] { display: none; }
#sheet .panel { background: var(--bg); width: 100%; max-height: 88vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); }
#sheet h3 { margin: 0 4px 12px; font-size: 22px; }

.center { text-align: center; padding: 40px 20px; }
.check { width: 150px; height: 150px; border-radius: 75px; background: var(--green); color: #fff; font-size: 92px; display: grid; place-items: center; margin: 20px auto; }
.check.wait { background: var(--amber); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 340px; margin: 16px auto; }
.pad button { height: 76px; border-radius: 18px; background: #fff; font-size: 32px; font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.dots { display: flex; justify-content: center; gap: 14px; margin: 16px 0; }
.dots i { width: 22px; height: 22px; border-radius: 11px; background: #cbd5e1; } .dots i.f { background: var(--blue2); }
.err { color: var(--red); font-weight: 700; text-align: center; min-height: 28px; }
.hist { opacity: 1; } .hist.void { opacity: .45; text-decoration: line-through; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 14px; font-weight: 700; color: #fff; }
.tag.entnahme { background: var(--red); } .tag.retour { background: var(--green); } .tag.q { background: var(--amber); }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: #111; color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 30; font-weight: 700; }

header.top.hred { background: var(--red); } header.top.hgreen { background: var(--green); }
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
a.btn.primary { color: #fff; }
button:disabled { opacity: .6; }
