:root {
  --red: #DA291C; --red-deep: #B3201A; --navy: #112337; --choco: #6E3333;
  --cream: #FFFBF4; --cream2: #FFF5E0; --ink: #2B2B2B; --soft: #5E5650; --muted: #8E847A; --rule: #EADFCF;
  --wa: #1FA855; --wa-deep: #168A45; --ok: #1E7B34;
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
main { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff;
  border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; padding-top: calc(14px + env(safe-area-inset-top)); }
.top-logo { width: 54px; height: auto; }
.top-title { font-weight: 800; font-size: 20px; }
.top-sub { color: var(--muted); font-size: 15px; }

.panel { background: #fff; border-radius: var(--radius); padding: 20px 16px; margin-top: 16px;
  box-shadow: 0 6px 24px rgba(110, 51, 51, .08); }
.step { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 21px; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 18px; flex: none; }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  border: 0; border-radius: 14px; font: inherit; font-weight: 800; cursor: pointer; text-align: center;
  min-height: 56px; padding: 12px 16px; user-select: none; }
.btn:active { transform: scale(.985); }
.btn-big { min-height: 68px; font-size: 22px; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:active { background: var(--red-deep); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--soft); border: 2px solid var(--rule); font-weight: 700; }
.btn-wa { background: var(--wa); color: #fff; font-size: 21px; min-height: 64px; }
.btn-wa:active { background: var(--wa-deep); }
.btn-wa.sent { background: #E8F5EC; color: var(--ok); border: 2px solid #BFE3CB; }
.btn-wa:disabled { opacity: .55; }
.ico { width: 28px; height: 28px; flex: none; }
.ico-s { width: 18px; height: 18px; vertical-align: -3px; flex: none; }
.link { background: none; border: 0; color: var(--soft); font: inherit; text-decoration: underline; padding: 10px; }

.hint { color: var(--soft); font-size: 16px; margin: 10px 2px 6px; }
.status { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.status li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--cream); font-size: 17px; }
.status .dot { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 2px solid var(--rule); color: #fff; font-size: 15px; font-weight: 900; }
.status .ok .dot { background: var(--ok); border-color: var(--ok); }
.status .name { font-weight: 800; }
.status .meta { color: var(--muted); font-size: 15px; }
.status .bar-ppto { border-left: 6px solid var(--red); }
.status .bar-cw { border-left: 6px solid var(--navy); }
.status .bar-num { border-left: 6px solid var(--choco); }

.error { background: #FDECEA; color: #8A1F14; border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 16px; }
.error b { display: block; margin-bottom: 2px; }
.warn { background: #FFF4D6; color: #6B4A00; border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 16px; }

.progress { margin-top: 14px; }
.progress-text { font-weight: 700; margin-bottom: 8px; }
.progress-bar { height: 12px; background: var(--cream2); border-radius: 6px; overflow: hidden; }
.progress-bar div { height: 100%; width: 0; background: var(--red); transition: width .2s; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.tab { min-height: 54px; border-radius: 12px; border: 2px solid var(--rule); background: #fff; font: inherit;
  font-weight: 800; color: var(--soft); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { width: 100%; min-height: 54px; border-radius: 12px; border: 2px solid var(--rule); padding: 0 16px;
  font: inherit; background: #fff; }
.counter { color: var(--muted); font-size: 15px; margin: 10px 2px; }

.clients { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.client { border: 2px solid var(--rule); border-radius: var(--radius); padding: 16px; background: #fff; }
.client.is-sent { border-color: #BFE3CB; background: #FBFEFC; }
.client-name { font-weight: 800; font-size: 20px; line-height: 1.25; }
.client-code { color: var(--muted); font-size: 15px; margin-top: 2px; }
.thumbs { display: flex; gap: 10px; margin: 14px 0; overflow-x: auto; }
.thumb { flex: none; width: 92px; border: 0; padding: 0; background: none; text-align: center; font: inherit; }
.thumb img { width: 92px; height: 115px; object-fit: cover; object-position: top; border-radius: 10px;
  border: 1px solid var(--rule); display: block; }
.thumb span { display: block; font-size: 13px; color: var(--soft); margin-top: 4px; line-height: 1.2; }
.wa-icon { width: 28px; height: 28px; flex: none; }
.card-gap { height: 14px; }
.card-links { display: flex; justify-content: center; gap: 18px; margin-top: 4px; }
.card-links .link { font-size: 17px; }

.foot { text-align: center; margin-top: 28px; }
.private { color: var(--soft); font-size: 15px; display: flex; gap: 8px; justify-content: center; align-items: flex-start; }
.version { color: var(--muted); font-size: 13px; }
.foot .btn-ghost { max-width: 320px; margin: 14px auto 8px; }

.install { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.install-text { font-size: 17px; }
.install-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.install .link { color: #C9D3E0; }

.modal { position: fixed; inset: 0; background: #111; z-index: 20; display: flex; flex-direction: column; }
.modal-bar { display: flex; align-items: center; justify-content: space-between; color: #fff;
  padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top)); }
.modal-title { font-weight: 800; font-size: 17px; }
.modal-close { background: #333; color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 22px; }
.modal-body { flex: 1; overflow: auto; padding: 0 12px 12px; display: grid; gap: 12px; align-content: start; }
.modal-body img { width: 100%; height: auto; border-radius: 8px; display: block; }
.modal-body p { color: #ddd; font-size: 16px; margin: 4px 2px; }
.modal-body a { color: #fff; }
.modal-actions { padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 14px; font-weight: 700; z-index: 30;
  max-width: calc(100% - 32px); text-align: center; }
