:root {
  --c-yellow: #FFBC0D; --c-yellow-hover: #E5A80C; --c-brown: #6A4A25; --c-brown-hover: #52381B;
  --bg: #FAF9F6; --card: #fff; --ink: #1a1a1a; --mut: #6c6c6c; --line: #ecece6; --ok: #1f7a3d; --bad: #b3261e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Nunito', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; padding-bottom: env(safe-area-inset-bottom); }
h1, h2 { font-family: 'Montserrat', sans-serif; letter-spacing: -.02em; }
h1 { font-size: 1.45rem; margin-bottom: 10px; }
h2 { font-size: 1.1rem; margin-bottom: 10px; }
a { color: var(--c-brown); }

.top { background: var(--c-brown); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { color: #fff; text-decoration: none; font-family: 'Montserrat', sans-serif; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.brand small { font-weight: 600; opacity: .8; font-family: 'Nunito', sans-serif; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c-yellow); }
.who { font-size: .8rem; opacity: .85; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.lead { color: var(--mut); margin-bottom: 12px; }
.muted { color: var(--mut); font-size: .92rem; }
.fine { color: var(--mut); font-size: .8rem; margin-top: 12px; }
.msg { margin-top: 10px; min-height: 1.2em; font-weight: 700; font-size: .92rem; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }

.perks { margin: 0 0 16px 18px; display: flex; flex-direction: column; gap: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 0; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; width: 100%; }
.btn.primary { background: var(--c-yellow); color: #111; }
.btn.primary:active { background: var(--c-yellow-hover); }
.btn.ghost { background: #f1ede4; color: #111; width: auto; }
.btn.danger { background: #fde0dd; color: var(--bad); width: auto; }
.btn.google { background: #fff; color: #111; border: 1px solid #ddd; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.or { text-align: center; color: var(--mut); font-size: .85rem; margin: 14px 0; position: relative; }
.or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { position: relative; background: var(--card); padding: 0 10px; }

.field { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9rem; margin-bottom: 12px; }
.field input { font: inherit; min-height: 48px; padding: 0 12px; border: 1px solid #d8d8d0; border-radius: 12px; background: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: .95rem; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--c-brown); }

.card-id { background: linear-gradient(160deg, var(--c-yellow), #ffd666); border-radius: 22px; padding: 18px; text-align: center; box-shadow: 0 6px 18px rgba(106, 74, 37, .18); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; font-family: 'Montserrat', sans-serif; }
.card-top b { font-size: 1.1rem; text-align: left; overflow-wrap: anywhere; }
.pill { background: var(--c-brown); color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.card-id canvas { width: min(260px, 70vw); height: min(260px, 70vw); background: #fff; border-radius: 16px; padding: 4px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .12em; margin-top: 10px; font-size: 1.05rem; }
.hint { font-size: .82rem; margin-top: 6px; color: #4a3714; }

.pts-big { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 2.4rem; line-height: 1; }
.pts-big small { font-size: 1rem; font-weight: 700; color: var(--mut); }
.bar { height: 12px; background: #efeadf; border-radius: 99px; overflow: hidden; margin: 12px 0 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--c-yellow); border-radius: 99px; transition: width .5s; }
.rewards { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rewards li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #f6f2e9; font-weight: 700; }
.rewards li.on { background: #dff3e4; color: #14532d; }

.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row small { display: block; color: var(--mut); font-weight: 500; font-size: .8rem; }
.sw { position: relative; width: 52px; height: 30px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 2; }
.sw i { position: absolute; inset: 0; background: #d5d0c5; border-radius: 99px; transition: background .2s; }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sw input:checked + i { background: var(--c-brown); }
.sw input:checked + i::after { transform: translateX(22px); }
form.inline { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
form.inline .field { flex: 1; margin-bottom: 0; }

.history { display: flex; flex-direction: column; }
.history .h { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
.history .h:hover, .history .h:focus-visible { background: #faf6ec; outline: none; }
.history .h .tag { justify-self: end; align-self: start; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #efe9da; color: var(--c-brown); border-radius: 99px; padding: 2px 10px; }
.history .h .items { grid-column: 1 / -1; }
#h-more, #h-web-retry { margin-top: 10px; }
#h-web-err .btn { margin-left: 6px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 4px 0 6px; }
.facts dt { color: var(--mut); font-size: .8rem; font-weight: 700; }
.facts dd { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.15rem; }
.profile { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.profile dt { color: var(--mut); font-size: .85rem; font-weight: 700; }
.profile dd { overflow-wrap: anywhere; }

/* účtenka v okně + tisk */
.receipt-dlg { border: 0; border-radius: 16px; padding: 0; margin: auto; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.receipt-dlg::backdrop { background: rgba(0,0,0,.45); }
.rc { padding: 22px 20px 6px; font-variant-numeric: tabular-nums; }
.rc h3 { font-family: 'Montserrat', sans-serif; font-size: 1.1rem; margin-bottom: 2px; }
.rc .meta { color: var(--mut); font-size: .85rem; margin-bottom: 12px; }
.rc .ln, .rc .sum { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.rc .ln { border-bottom: 1px dashed var(--line); }
.rc .ln small { display: block; color: var(--mut); }
.rc .sum.total { border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 8px; font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.15rem; }
.rc .sum.neg { color: var(--ok); }
.rc .note { color: var(--mut); font-size: .78rem; margin-top: 12px; }
.rc-actions { padding: 8px 20px 20px; }
@media print {
  body > header.top, body > main, #toast { display: none !important; }
  .receipt-dlg { position: static !important; width: auto !important; max-height: none !important; box-shadow: none !important; border-radius: 0 !important; overflow: visible !important; }
  .receipt-dlg::backdrop { display: none; }
  .rc-actions { display: none !important; }
}
.history .h b { font-family: 'Montserrat', sans-serif; }
.history .h small { color: var(--mut); }
.history .h .pt { color: var(--ok); font-weight: 800; text-align: right; }
.history .h .pt.neg { color: var(--bad); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 20; max-width: 90vw; font-weight: 700; }
.toast.err { background: var(--bad); }

.center { text-align: center; }

/* ---------- páginas de la tarjeta ---------- */
.tab[hidden] { display: none !important; }
.hello .muted { margin-bottom: 0; }
.hello-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 14px; }
.hello-row h1 { margin: 0; overflow-wrap: anywhere; }
.btn.big { min-height: 56px; font-size: 1.02rem; gap: 10px; }
@media (max-width: 480px) {
  .brand { white-space: nowrap; }
  .brand small { display: none; }
}
/* El menú inferior y la ventana del QR están en /assets/appmenu.css (compartidos con la tienda). */

/* ---------- tarjeta de sellos: 1 bod = 1 kapsa, N bodů = kapsa zdarma ---------- */
.stamps { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 12px; }
.stamps i { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid #d5cdb8; background: #faf6ea; display: flex; align-items: center; justify-content: center; transition: background .3s, border-color .3s; }
.stamps i.on { background: var(--c-yellow); border-color: var(--c-brown); }
.stamps i.on::after { content: ''; width: 9px; height: 17px; border: solid var(--c-brown); border-width: 0 3.5px 3.5px 0; transform: translateY(-2px) rotate(45deg); }
.free-ready { background: #dff3e4; color: #14532d; border-radius: 12px; padding: 12px 14px; font-weight: 800; margin: 4px 0 12px; }

/* Sin tienda física (window.DK_CUENTA.tienda = false en /fb/firebase-config.js): se esconde lo de QR, puntos y recibos de tienda;
   con tienda se esconde lo que solo vale sin ella. ucet.js pone la clase no-tienda en <body>. */
body.no-tienda .only-tienda { display: none !important; }
body:not(.no-tienda) .only-sin-tienda { display: none !important; }

/* Firemní účet (B2B) */
.b2-line { font-family: 'Montserrat', sans-serif; font-weight: 800; margin-bottom: 4px; overflow-wrap: anywhere; }
.b2-line.ok { color: var(--ok); }
.b2-line.wait { color: var(--c-brown); }
.b2-line.no { color: var(--bad); }
#form-b2b { margin-top: 12px; }
#ob-b2b-fields { margin: 4px 0 10px; }
#b2-edit { margin-top: 8px; }

/* ================= Diseño de la cuenta (30-oct): acceso, cabecera, empresa, cifras y pedidos ================= */
main { padding-top: 14px; }
.box { border-color: #eee7d9; border-radius: 20px; box-shadow: 0 1px 2px rgba(74, 50, 15, .05), 0 10px 26px rgba(74, 50, 15, .06); }
.box h2 { font-size: 1.08rem; }

/* Acceso (sin cuenta) */
.login { padding: 0; overflow: hidden; }
.login-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, #6A4A25, #8d6531); color: #fff; padding: 26px 22px 24px; }
.login-hero::after { content: ''; position: absolute; right: -34px; top: -34px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 188, 13, .16); }
.login-hero h1 { color: #fff; margin: 14px 0 4px; font-size: 1.55rem; position: relative; z-index: 1; }
.login-hero .lead { color: rgba(255, 255, 255, .86); margin: 0; position: relative; z-index: 1; }
.logo-dot { display: block; width: 46px; height: 46px; border-radius: 50%; background: var(--c-yellow); box-shadow: 0 0 0 7px rgba(255, 188, 13, .25); position: relative; z-index: 1; }
.login-body { padding: 20px 20px 22px; }
.perks2 { list-style: none; display: flex; flex-direction: column; gap: 14px; margin: 0 0 20px; padding: 0; }
.perks2 li { display: flex; gap: 12px; align-items: flex-start; }
.perks2 .pk { flex: none; width: 42px; height: 42px; border-radius: 13px; background: #FFF1C7; color: var(--c-brown); display: flex; align-items: center; justify-content: center; }
.perks2 li.biz .pk { background: var(--c-yellow); color: #111; }
.perks2 b { display: block; font-family: 'Montserrat', sans-serif; font-size: .95rem; }
.perks2 .t { display: block; color: var(--mut); font-size: .88rem; line-height: 1.4; }
.btn.google { gap: 10px; min-height: 50px; }
.btn.primary { box-shadow: 0 4px 12px rgba(255, 188, 13, .35); }

/* Cabecera de la cuenta */
.hero-card { position: relative; overflow: hidden; background: linear-gradient(150deg, #6A4A25, #8d6531); border: 0; color: #fff; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center; padding: 22px 20px; }
.hero-card::after { content: ''; position: absolute; right: -36px; top: -36px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 188, 13, .16); pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .avatar { width: 62px; height: 62px; border-radius: 50%; background: var(--c-yellow); color: #3a2a12; display: flex; align-items: center; justify-content: center; font: 900 1.7rem 'Montserrat', sans-serif; box-shadow: 0 0 0 5px rgba(255, 255, 255, .2); }
.hero-card .muted { color: rgba(255, 255, 255, .78); font-size: .85rem; }
.hero-card h1 { color: #fff; font-size: 1.45rem; margin: 0; }
.hero-card .hello-row { margin: 0; }
.who-mail { font-size: .8rem; color: rgba(255, 255, 255, .72); overflow-wrap: anywhere; }
.chip { display: inline-block; margin-top: 8px; padding: 3px 12px; border-radius: 999px; font: 800 .74rem 'Montserrat', sans-serif; background: rgba(255, 255, 255, .2); color: #fff; }
.chip.ok { background: var(--c-yellow); color: #3a2a12; }
.chip.wait { background: rgba(255, 255, 255, .3); }
.hero-cta { grid-column: 1 / -1; margin-top: 14px; }

/* Firemní účet (B2B) */
.b2b { border-color: #f1dd9b; background: linear-gradient(180deg, #fff9e6, #fff 70%); }
.b2b-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.b2b-head h2 { margin: 0; }
.muted.sm { font-size: .82rem; }
.ico-circle { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--c-yellow); color: #111; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(255, 188, 13, .4); }
.b2-line { display: inline-block; padding: 5px 14px; border-radius: 999px; background: #efe9da; margin-bottom: 8px; }
.b2-line.ok { background: #dff3e4; }
.b2-line.wait { background: #fff0c2; }
.b2-line.no { background: #fde0dd; }

/* Cifras: tres azulejos */
.facts { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.facts > div { background: #faf6ec; border-radius: 14px; padding: 12px 10px; min-width: 0; }
.facts dt { font-size: .72rem; line-height: 1.25; }
.facts dd { font-size: 1.02rem; overflow-wrap: anywhere; }

/* Pedidos */
.history { gap: 0; margin-top: 10px; }
.history .h { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(74, 50, 15, .04); align-items: center; }
.history .h:hover, .history .h:focus-visible { background: #fffaf0; }
.history .h b { font-size: 1.05rem; }
.history .h .tags { display: flex; gap: 6px; justify-self: end; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.history .h .tag { justify-self: auto; align-self: auto; }
.history .h .tag.st.ok { background: #dff3e4; color: #14532d; }
.history .h .tag.st.info { background: #e3edff; color: #1e3a8a; }
.history .h .tag.st.bad { background: #fde0dd; color: var(--bad); }
.history .h .tag.st.wait { background: #fff0c2; color: var(--c-brown); }
.history .h small { grid-column: 1 / -1; }
.history .h .items { color: var(--ink); font-size: .9rem; margin-top: 2px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 22px 14px; border: 2px dashed #e4dac3; border-radius: 16px; background: #fffdf7; margin-top: 10px; }
.empty b { font-family: 'Montserrat', sans-serif; }
.empty span { color: var(--mut); font-size: .9rem; margin-bottom: 8px; }
.empty .btn { width: auto; }
.msg:empty { min-height: 0; margin-top: 0; }
