:root {
  color-scheme: light;
  --red: #a90909;
  --red-dark: #760000;
  --ink: #241c18;
  --muted: #756b65;
  --cream: #f7f1e8;
  --paper: #fffdf9;
  --line: #e4d8ca;
  --green: #176b47;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--cream); }
header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .8rem;
  padding: .9rem max(1rem, env(safe-area-inset-left)); color: white;
  background: linear-gradient(110deg, var(--red-dark), var(--red)); box-shadow: 0 2px 16px #4d000033;
}
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid #fff; border-radius: 12px; font: 800 1.4rem Georgia, serif; }
header h1, header p { margin: 0; }
header h1 { font: 700 1.2rem Georgia, serif; }
.privacy { margin-left: auto; padding: .25rem .55rem; border: 1px solid #ffffff80; border-radius: 99px; font-size: .75rem; }
main { width: min(100% - 2rem, 560px); margin: 0 auto 5rem; }
.hero { padding: 2.4rem .25rem 1.2rem; }
.hero h2 { margin: .3rem 0 .7rem; font: 700 clamp(2.1rem, 9vw, 3.7rem)/.98 Georgia, serif; letter-spacing: -.035em; }
.hero > p:last-child { color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0 0 .25rem; text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; font-weight: 800; }
.card { margin: 1rem 0; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px #5c351310; }
#photo { position: absolute; width: 1px; height: 1px; opacity: 0; }
.camera-button { display: flex; align-items: center; gap: .9rem; padding: 1rem; border: 1.5px dashed #c9a88d; border-radius: 14px; background: #fff7ec; cursor: pointer; }
.camera-icon { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border-radius: 50%; color: white; background: var(--red); font-size: 1.8rem; }
.camera-button span:last-child { display: grid; gap: .2rem; }
.camera-button small, .status { color: var(--muted); }
#preview { width: 100%; max-height: 360px; object-fit: contain; margin-top: 1rem; border-radius: 12px; background: #eee; }
.status { margin: .7rem .2rem 0; font-size: .82rem; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.section-title h3 { margin: 0; font: 700 1.35rem Georgia, serif; }
.pill, .count { padding: .3rem .6rem; border-radius: 99px; background: #eee8df; color: var(--muted); font-size: .72rem; font-weight: 700; }
.pill.good { color: var(--green); background: #dff2e8; }
label { display: grid; gap: .4rem; margin: .8rem 0; font-size: .78rem; font-weight: 750; }
input, select { width: 100%; min-height: 48px; padding: .7rem .8rem; border: 1px solid #cfc2b7; border-radius: 10px; background: white; color: var(--ink); font: inherit; font-size: 1rem; }
input:focus, select:focus { outline: 3px solid #a9090922; border-color: var(--red); }
.two-columns { display: grid; grid-template-columns: 1fr 1.25fr; gap: .75rem; }
.money-input { position: relative; display: block; }
.money-input span { position: absolute; top: 14px; left: 12px; color: var(--muted); font-weight: 500; }
.money-input input { padding-left: 1.7rem; }
.primary { width: 100%; min-height: 52px; margin-top: .4rem; border: 0; border-radius: 12px; color: white; background: var(--red); font-weight: 800; font-size: 1rem; box-shadow: 0 6px 14px #a909092b; }
.secondary { width: 100%; min-height: 46px; border: 1px solid var(--red); border-radius: 12px; color: var(--red); background: white; font-weight: 800; }
.primary:active { transform: translateY(1px); }
.error { min-height: 1.2em; color: #a40000; font-size: .82rem; }
.empty { padding: 1.4rem 0; color: var(--muted); text-align: center; }
.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-list li { display: flex; justify-content: space-between; align-items: center; padding: .8rem 0; border-top: 1px solid var(--line); }
.ticket-list li > div:first-child { display: grid; gap: .2rem; }
.ticket-meta { color: var(--muted); font-size: .75rem; }
.fiscal-meta { color: var(--red); font-size: .72rem; font-weight: 750; }
.ticket-amount { font: 700 1.1rem Georgia, serif; }
.settings summary { cursor: pointer; font-weight: 750; }
.check-row { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.check-row input { width: 20px; min-height: 20px; margin: 0; }
@media (max-width: 370px) { .two-columns { grid-template-columns: 1fr; } }
@media (max-width: 470px) { .fiscal-columns { grid-template-columns: 1fr; gap: 0; } }
