:root {
  --green: #1f6f43;
  --red: #b3261e;
  --yellow: #fff3a0;
  --gray: #eee;
  --text: #111;
  font-size: 16px; /* přepisuje app.js podle volby A−/A+ */
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #fafafa;
  padding-bottom: env(safe-area-inset-bottom);
}
#statusbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: calc(4px + env(safe-area-inset-top)) 8px 4px;
  background: #fff; border-bottom: 1px solid #ddd;
  font-size: 0.75rem;
}
.chip {
  border: 1px solid #ccc; border-radius: 999px; padding: 4px 10px;
  background: #fff; font: inherit; color: inherit;
}
.zoom-ctl { margin-left: auto; display: flex; gap: 4px; }
#st-queue { margin-left: auto; }
#st-queue:not([hidden]) + .zoom-ctl { margin-left: 0; }
#st-queue:disabled { color: #555; }
#banner.clickable { cursor: pointer; text-decoration: underline; }
.banner { padding: 10px 14px; font-weight: 600; font-size: 0.9rem; }
.banner.error, #banner { background: var(--red); color: #fff; }
.banner.warn { background: #ffe08a; color: #000; margin: 8px 0; border-radius: 8px; }
.banner.info { background: #d8ecff; color: #000; margin: 8px 0; border-radius: 8px; }
main { padding: 12px; max-width: 640px; margin: 0 auto; }
.view { display: flex; flex-direction: column; gap: 12px; }
.view[hidden] { display: none; }
h1 { font-size: 1.4rem; margin: 8px 0; }
.btn {
  display: block; width: 100%; padding: 0.8em; border-radius: 12px;
  border: 2px solid var(--green); background: #fff; color: var(--green);
  font-size: 1.05rem; font-weight: 600; font: inherit; font-weight: 600;
}
.btn.primary { background: var(--green); color: #fff; }
.btn.danger { border-color: #d98a85; background: #fdf0ef; color: var(--red); }
.btn.huge { padding: 2rem 1rem; font-size: 5rem; line-height: 1; }
.btn.small { display: inline-block; width: auto; padding: 6px 12px; }
.btn:active { opacity: 0.7; }
.big-input { font-size: 1.3rem; padding: 12px; border-radius: 10px; border: 2px solid #999; }
.preview { width: 100%; max-height: 40vh; object-fit: contain; background: var(--gray); border-radius: 8px; }
.preview.small { max-height: 22vh; }
.processing { font-size: 1.3rem; text-align: center; }
.error-text { color: var(--red); font-weight: 700; font-size: 1.1rem; }
#proc-error { display: flex; flex-direction: column; gap: 12px; }
#proc-error[hidden] { display: none; }
.spinner {
  display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em;
  border: 3px solid #ccc; border-top-color: var(--green); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#items { width: 100%; border-collapse: collapse; }
#items th { font-size: 0.7rem; text-align: left; color: #555; font-weight: 500; }
#items td { padding: 4px 2px; border-bottom: 1px solid #ddd; vertical-align: middle; }
#items tr.low td { background: var(--yellow); }
#items .note { font-size: 0.75rem; color: #444; }
#items input {
  width: 4.2em; font-size: 1.3rem; padding: 8px 4px; text-align: right;
  border: 1px solid #aaa; border-radius: 8px; background: #fff;
}
#items .sub { text-align: right; font-weight: 600; white-space: nowrap; }
#items .del { border: 0; background: none; font-size: 1.4rem; color: var(--red); padding: 8px; }
.total { font-size: 1.3rem; text-align: center; padding: 8px; }
.total strong { font-size: 2.6rem; display: block; }
.overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center;
}
.overlay[hidden] { display: none; }
.overlay img { max-width: 100%; max-height: 100%; }
.panel { align-items: flex-end; background: rgba(0, 0, 0, 0.5); }
.sheet {
  background: #fff; width: 100%; max-width: 640px; border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.sheet h2 { font-size: 1.1rem; margin: 4px 0; }
#history h2 { font-size: 0.9rem; color: #555; font-weight: 500; margin: 8px 0 4px; }
#history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: grid; grid-template-columns: 3rem auto 1fr auto; align-items: center; gap: 10px;
  width: 100%; padding: 6px 10px; border: 1px solid #ddd; border-radius: 10px;
  background: #fff; font: inherit; color: inherit; text-align: left;
}
.history-item img { width: 3rem; height: 2.4rem; object-fit: cover; border-radius: 4px; background: var(--gray); }
.history-item .h-time { color: #555; font-size: 0.85rem; }
.history-item .h-sum { text-align: right; }
.history-item .h-state { font-size: 0.8rem; color: var(--green); }
