/* Theme after kalberer.dev: black with the olive cube background, white Arial, yellow accents. */
:root {
  --bg: #000; --card: rgba(8, 8, 4, .82); --ink: #fff; --muted: #c9c49a; --line: #4a4512;
  --accent: #fde711; --accent-soft: rgba(253, 231, 17, .14); --link: #ffff33;
  --warn: #ffcc33; --warn-soft: rgba(255, 204, 51, .13); --danger: #ff6f61; --radius: 4px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #000 url("theme/background.png") repeat;
  font: 16px/1.45 Arial, Helvetica, Geneva, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { color: #fff; }
/* header: the comet banner with the title written into it, NetObjects-style plate buttons below */
.top { max-width: 760px; margin: 0 auto; padding: 12px 16px 4px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.banner { display: block; position: relative; width: 100%; max-width: 600px; aspect-ratio: 600 / 60;
  background: url("theme/banner.png") left center / 100% 100% no-repeat; }
.banner span { position: absolute; left: 1.6%; top: 50%; transform: translateY(-50%);
  color: #cccc66; font-size: clamp(18px, 4.6vw, 28px); letter-spacing: .5px; white-space: nowrap; }
.top nav { display: flex; gap: 6px; margin-top: 10px; }
.plate { flex: 0 1 140px; min-width: 0; aspect-ratio: 140 / 32; position: relative;
  background: url("theme/button.png") left top / 100% 100% no-repeat;
  color: #000 !important; font-weight: 700; font-size: clamp(11px, 3.4vw, 14px); }
.plate > span { position: absolute; right: 6%; bottom: 8%; max-width: 64%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.plate:hover { filter: brightness(1.12); }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }
h1 { font-size: 1.35rem; margin: 4px 0 12px; }
h2 { font-size: 1.05rem; margin: 24px 0 8px; color: var(--muted); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: .9rem; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; text-align: right; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 14px; border-radius: 10px; font: inherit; cursor: pointer; }
.btn { background: #111; border-color: #5a5420; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
input, select, textarea { background-color: #0d0c05 !important; border-color: #5a5420 !important; }
.btn.small { padding: 6px 10px; font-size: .9rem; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: .85rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 40vw; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem;
  background: var(--line); color: var(--muted); margin: 2px 4px 0 0; }
.tag.me { background: var(--accent-soft); color: var(--accent); }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 6px; background: var(--line); color: var(--muted); }
.badge.draft, .warnbox { background: var(--warn-soft); color: var(--warn); }
.warnbox { padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.search { position: sticky; top: 62px; z-index: 2; margin-bottom: 10px; font-size: 1.05rem; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-bottom: 1px solid var(--line); color: var(--ink); }
.list > *:last-child { border-bottom: 0; }
.list > a:active, .item:active { background: var(--accent-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.item { cursor: pointer; user-select: none; }
.item .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line);
  flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; }
.item.mine .box { background: var(--accent); border-color: var(--accent); }
.item.mine .box::after { content: "✓"; }
.item.busy { opacity: .5; }
.sticky-foot { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card);
  border-top: 1px solid var(--line); padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
.sticky-foot > div { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.thumb { max-height: 180px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.edit-row { display: grid; grid-template-columns: 1fr 110px 40px; gap: 6px; margin-bottom: 6px; }
.edit-row input.price { text-align: right; }
.split { display: grid; gap: 16px; }
@media (min-width: 900px) { main.wide { max-width: 1200px; } .split { grid-template-columns: 1fr 1.2fr; }
  .split .imgcol img { position: sticky; top: 70px; max-height: calc(100vh - 90px); } }
.imgcol img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
details pre { white-space: pre-wrap; font-size: .8rem; max-height: 300px; overflow: auto; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#toast.err { background: var(--danger); color: #fff; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 30; overflow: auto;
  display: grid; place-items: start center; padding: 16px; }
.lightbox img { max-width: 100%; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---- mobile fixes ---- */
input, select, textarea { min-width: 0; }
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-height: 46px; }
.search { top: var(--hh, 62px); }
.edit-row { grid-template-columns: minmax(0, 1fr) 88px 40px; }
.edit-row input { padding: 9px 10px; }
.receipt-head { display: flex; gap: 12px; align-items: flex-start; }
.receipt-head .thumb { width: 76px; max-height: 110px; object-fit: cover; object-position: top; flex: none; }
.imgcol img { max-height: 55vh; object-fit: contain; background: var(--card); cursor: zoom-in; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .primary { flex: 1 1 100%; }
.actions .btn:not(.primary) { flex: 1 1 0; }
.sticky-foot { box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
@media (min-width: 900px) { .imgcol img { max-height: calc(100vh - 90px); }
  .actions .primary { flex: 2 1 0; } }
@media (max-width: 480px) {
  .stack-sm { flex-direction: column; align-items: stretch; gap: 0; }
  main { padding-left: 12px; padding-right: 12px; }
  .card { padding: 12px; }
}
@media (max-width: 380px) {
  .brand-text { display: none; }
  .top nav { gap: 6px; }
}

/* ---- quantities ---- */
.edit-row { grid-template-columns: minmax(0, 1fr) 62px 88px 40px; align-items: center; }
.qtywrap { position: relative; display: block; }
.qtywrap input { text-align: right; padding-right: 22px; }
.qtywrap span { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
@media (max-width: 480px) {
  .edit-row { grid-template-columns: 62px minmax(0, 1fr) 40px; grid-template-areas: "name name name" "qty price del";
    padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .edit-row .name { grid-area: name; } .edit-row .qtywrap { grid-area: qty; }
  .edit-row .price { grid-area: price; } .edit-row button { grid-area: del; }
}
.item.multi .box { color: #fff; font-size: .95rem; }
.item.multi.mine .box::after { content: none; }
.stepper { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.stepper .btn { width: 38px; height: 34px; padding: 0; font-size: 1.2rem; }

/* ---- kalberer.dev theme details ---- */
.search { top: env(safe-area-inset-top, 0px); box-shadow: 0 6px 12px #000; }
h1 { color: #fff; }
h2 { color: #cccc66; }
.list > a:active, .item:active { background: rgba(253, 231, 17, .1); }
.item .box { border-color: #6b6420; }
.item.mine .box { color: #000; }
.item.multi .box { color: #000; }
.tag { background: #1d1b08; color: var(--muted); border: 1px solid #3a360c; }
.tag.me { border-color: transparent; }
.badge { background: #1d1b08; }
.chip { color: var(--accent); }
.avatar { border: 1px solid #5a5420; }
.sticky-foot { background: rgba(0, 0, 0, .94); box-shadow: 0 -4px 16px rgba(0, 0, 0, .7); }
#toast { background: var(--accent); color: #000; font-weight: 700; }
#toast.err { background: var(--danger); color: #000; }
.thumb, .imgcol img { border-color: #5a5420; }
.spinner { border-color: #3a360c; border-top-color: var(--accent); }
code { color: var(--accent); }
::selection { background: var(--accent); color: #000; }
.plate { font-size: clamp(10px, 2.9vw, 13px); line-height: 1; }
.plate > span { bottom: 13%; }
@media (max-width: 600px) { body { background-size: 460px auto; background-position: right -60px top 120px; } }
.plate > span { max-width: 68%; }
@media (max-width: 520px) {
  .top nav { flex-wrap: wrap; gap: 6px 10px; }
  .plate { flex: 0 0 calc(50% - 5px); max-width: 160px; font-size: 13px; }
}
