:root {
  --navy: #0C172B; --pink: #DE2B59; --sky: #61B9E7; --white: #FFFFFF; --pale: #FEF1F5;
  --ink: #0C172B; --muted: #4B5568; --line: #D9DEE7; --ok: #13734B; --warn: #8A5300; --bad: #B3123E;
  --bg: #F4F6FA; --card: #FFFFFF; --radius: 14px; --tap: 48px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Naskh Arabic", "Noto Nastaliq Urdu", sans-serif; }
[dir="rtl"] body { font-size: 18px; line-height: 1.9; }
#app { max-width: 760px; margin: 0 auto; padding: 0 0 96px; }
.loading { text-align: center; padding: 40vh 0; color: var(--muted); }
h1 { font-size: 1.35rem; margin: 0 0 .5rem; } h2 { font-size: 1.1rem; margin: 1rem 0 .5rem; } h3 { font-size: 1.02rem; margin: 0; }
p { margin: .35rem 0; }
.small { font-size: .9rem; } .muted { color: var(--muted); } .bad { color: var(--bad); } .warn { color: var(--warn); }
a { color: var(--navy); }

.top { position: relative; z-index: 5; background: var(--white); color: var(--navy); border-bottom: 1px solid var(--line); padding: 6px 12px 8px; }
/* Approved lockup: bird beside the wordmark, visible bird height = lettering height; tagline centred beneath. */
.lockup { display: flex; flex-direction: column; align-items: center; }
.lockup .brand { display: flex; align-items: center; justify-content: center; gap: 2px; }
.lockup .brand img:first-child { width: 59px; height: 59px; margin: -12px 0; }
.lockup .brand img:last-child { width: auto; height: 30px; }
.lockup .tagline { margin: 4px 0 0; font-size: .9rem; color: var(--navy); text-align: center; font-style: normal; }
.tools { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.net { font-size: .8rem; padding: 4px 10px; border-radius: 99px; }
.net.on { background: #E3F3FC; color: #0B5A86; } .net.off { background: var(--pink); color: var(--white); }
.ghost { min-height: var(--tap); background: var(--white); color: var(--navy); border: 1px solid var(--line); }

.banner { margin: 8px 12px 0; padding: 10px 12px; border-radius: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.banner.info { background: #E3F3FC; } .banner.warn { background: var(--pale); border: 1px solid var(--pink); } .banner.muted { background: #ECEFF4; }

.card { display: block; background: var(--card); margin: 12px; padding: 16px; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(12,23,43,.08); text-decoration: none; color: inherit; }
.card.narrow { max-width: 460px; margin: 24px auto; }
.card.ready { display: flex; justify-content: space-between; align-items: center; min-height: var(--tap); border-inline-start: 6px solid var(--bad); }
.card.ready.ok { border-inline-start-color: var(--ok); }
.card.notice, .notice { background: var(--pale); border: 1px solid #F6C3D2; padding: 10px 12px; border-radius: 10px; }
.infobox { background: #F1F7FC; border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; }

button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); min-width: var(--tap);
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); color: var(--navy);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
button.primary, .button.primary { background: var(--pink); border-color: var(--pink); color: var(--white); }
button.big { width: 100%; margin-top: 12px; font-size: 1.05rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.field { display: block; margin: 10px 0; } .field > span { display: block; font-weight: 600; margin-bottom: 4px; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--white); color: var(--ink); }
textarea { min-height: 72px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; padding: 10px 12px; }
legend { font-weight: 700; padding: 0 6px; }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.choice input { width: 24px; height: 24px; min-height: 0; flex: none; accent-color: var(--pink); }
.choice:has(input:checked) { border-color: var(--pink); background: var(--pale); }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--white); border-top: 1px solid var(--line); z-index: 5; padding-bottom: env(safe-area-inset-bottom); }
.tabs a { min-height: 56px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--muted); padding: 4px; }
.tabs a.active { color: var(--pink); box-shadow: inset 0 3px 0 var(--pink); }

.search { margin: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chipbtn { min-height: var(--tap); padding: 6px 12px; border-radius: 99px; font-weight: 500; }
.chipbtn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.merchant, .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.merchant > div, .row > div { min-width: 0; flex: 1; }
.merchant h3 { overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; margin: 2px 0; }
.s-draft, .s-saved { background: #ECEFF4; color: var(--navy); } .s-waiting { background: #FFF2D9; color: var(--warn); }
.s-uploading { background: #E3F3FC; color: #0B5A86; } .s-uploaded { background: #DDF3E8; color: var(--ok); } .s-attention { background: var(--pale); color: var(--bad); }

.steps { display: flex; gap: 6px; margin-bottom: 8px; } .steps span { flex: 1; text-align: center; font-size: .8rem; padding: 4px 0; border-radius: 6px; background: #ECEFF4; }
.steps .done { background: #DDF3E8; } .steps .cur { background: var(--pink); color: var(--white); }
.savestate { font-size: .85rem; color: var(--ok); margin: 0 0 6px; } .savestate.bad { color: var(--bad); font-weight: 700; }
.navrow { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; } .navrow .button { flex: 1; }
.wording { background: var(--pale); border-inline-start: 4px solid var(--pink); padding: 12px; border-radius: 8px; white-space: pre-wrap; font-size: 1.05rem; }
.media .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media figure, .thumbs figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--white); }
.thumb { aspect-ratio: 3/4; background: #ECEFF4 center/cover no-repeat; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
figcaption { font-size: .85rem; margin: 4px 0; display: flex; justify-content: space-between; }
.tbtns { display: flex; flex-wrap: wrap; gap: 4px; } .tbtns button { min-height: var(--tap); min-width: var(--tap); padding: 6px 8px; font-size: .82rem; }
.capture { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.checks { list-style: none; padding: 0; margin: 8px 0 14px; } .checks li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checks li > span { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.checks .ok > span { background: #DDF3E8; color: var(--ok); } .checks .no > span { background: var(--pale); color: var(--bad); }
.checks small { display: block; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 10px 0; }
.stat { padding: 10px; border-radius: 10px; text-align: center; } .stat b { display: block; font-size: 1.5rem; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; } .summary dt { font-weight: 700; } .summary dd { margin: 0; overflow-wrap: anywhere; }
.toast { position: fixed; left: 12px; right: 12px; bottom: 72px; padding: 12px 14px; border-radius: 12px; background: var(--navy); color: var(--white); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; max-width: 736px; margin: 0 auto; }
.toast.show { opacity: 1; } .toast.bad { background: var(--bad); } .toast.warn { background: #6B4100; }
.overlay { position: fixed; inset: 0; background: rgba(12,23,43,.94); z-index: 30; display: flex; flex-direction: column; }
.ovbar { display: flex; gap: 8px; padding: 8px; justify-content: flex-end; } .ovimg { overflow: auto; flex: 1; } .ovimg img { display: block; max-width: none; }
details summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 600; cursor: pointer; }
@media (max-width: 380px) { .card { margin: 8px; padding: 12px; } .merchant { flex-direction: column; align-items: stretch; } }

/* ---- Visit cards: the assigned list is the form (approved simple employee view) ---- */
#app { max-width: 1180px; }
.cards { margin: 0 12px; }
.pad { margin: 12px 0 6px; }
.card.head { margin-bottom: 8px; }
.vcard { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(12,23,43,.08); margin: 10px 0; padding: 14px;
  display: grid; grid-template-columns: 1fr; gap: 12px; min-width: 0; }
.vcard > * { min-width: 0; }
.vinfo h3 { font-size: 1.08rem; overflow-wrap: anywhere; } .vinfo h3 small { font-weight: 500; color: var(--muted); }
.vbtns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.ghostlink { background: transparent; border-style: dashed; }
.vform { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.cf { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cl { font-weight: 700; font-size: .95rem; }
.grid2c { display: grid; grid-template-columns: 1fr; gap: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.segopt { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); cursor: pointer; }
.segopt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segopt:has(input:checked) { background: var(--navy); border-color: var(--navy); color: var(--white); }
.segopt:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.choice.wide { width: 100%; }
.logo { border: 1px solid #F6C3D2; background: var(--pale); border-radius: 12px; padding: 10px; }
.capture .button.disabled { opacity: .45; pointer-events: none; }
.capture button.on { background: var(--pink); color: var(--white); border-color: var(--pink); }
.thumbs.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.thumbs.mini figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: var(--white); }
.thumbs.mini .thumb { aspect-ratio: 3/4; }
.thumbs.mini .tbtns button { min-height: var(--tap); min-width: var(--tap); padding: 4px 6px; font-size: .78rem; }
details.more { border: 1px dashed var(--line); border-radius: 12px; padding: 4px 10px 10px; }
.intro .introbody { overflow: auto; flex: 1; padding: 8px 16px 32px; color: var(--white); max-width: 760px; margin: 0 auto; }
.intro .introbody section { background: var(--white); color: var(--navy); border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
.intro h3 { margin-top: 10px; color: var(--pink); }
@media (min-width: 760px) {
  .vcard.open { grid-template-columns: minmax(220px, 300px) 1fr; }
  .vcard.open .vform { border-top: 0; border-inline-start: 1px solid var(--line); padding-top: 0; padding-inline-start: 14px; }
  .grid2c { grid-template-columns: 1fr 1fr; }
  .vcard.open .vinfo { position: sticky; top: 8px; align-self: start; }
}
@media (max-width: 380px) { .cards { margin: 0 6px; } .vcard { padding: 10px; } }
/* Logos are shown whole (never cropped) on white, so the supplied artwork is judged as it is. */
.cf.logo .thumb { background-size: contain; background-color: var(--white); aspect-ratio: 1; }
