/* The app for everyone: one prescription photo, submit, the result. Phone first. */
:root {
  --paper: #FAFAF7;
  --sheet: #FFFFFF;
  --ink: #24272C;
  --ink-soft: #5B616B;
  --rule: #DCDFE4;
  --ballpoint: #2747A6;
  --ballpoint-dark: #1E3A8C;
  --ballpoint-wash: #E8ECF8;
  --check: #A86A12;
  --check-wash: #FBF1DF;
  --wrong: #B3261E;
  --wrong-wash: #FBE7E5;
  --match: #1E7548;
  --match-wash: #E3F2E9;
  --radius: 10px;
  --font: "Noto Sans Bengali", "Nirmala UI", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--font);
  /* the phone app (Capacitor 8) also gives --safe-area-inset-*, for Android WebViews whose env() is 0 */
  padding: var(--safe-area-inset-top, env(safe-area-inset-top)) var(--safe-area-inset-right, env(safe-area-inset-right))
           var(--safe-area-inset-bottom, env(safe-area-inset-bottom)) var(--safe-area-inset-left, env(safe-area-inset-left));
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ballpoint); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--sheet); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: inherit; text-decoration: none; }
a.brand:hover { color: var(--ballpoint); }
.brand img { border-radius: 6px; }
.grow { flex: 1; }
.lang { border: 1px solid var(--rule); background: var(--sheet); border-radius: 99px; padding: 4px 12px; cursor: pointer; }

main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 16px 32px; }
/* the bottom row, edge to edge: who is signed in at the left corner, the privacy policy in the middle,
   the office sign-in at the right corner (each keeps its own column whichever of the others is hidden) */
.foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px 12px; padding: 12px 16px 18px; color: var(--ink-soft); font-size: 13px; width: 100%; }
.foot a { color: var(--ink-soft); }
.foot #who { grid-column: 1; justify-self: start; text-align: left; overflow-wrap: anywhere; }
.foot #privacy-link { grid-column: 2; text-align: center; }
.foot #staff-link { grid-column: 3; justify-self: end; text-align: right; }

/* the privacy policy inside the phone app, over the screen that was open */
.policy {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto; background: var(--paper);
  padding: var(--safe-area-inset-top, env(safe-area-inset-top)) var(--safe-area-inset-right, env(safe-area-inset-right))
           var(--safe-area-inset-bottom, env(safe-area-inset-bottom)) var(--safe-area-inset-left, env(safe-area-inset-left));
}
body.policy-on { overflow: hidden; }
.policy-bar { position: sticky; top: 0; padding: 10px 16px; background: var(--sheet); border-bottom: 1px solid var(--rule); }
.policy-back { border: 1px solid var(--rule); background: var(--sheet); color: var(--ballpoint); font-weight: 700;
  border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.policy-text { max-width: 560px; margin: 0 auto; padding: 16px 16px 32px; }

h1 { font-size: 22px; line-height: 1.3; margin: 4px 0 8px; }
h2 { font-size: 17px; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.lead { color: var(--ink-soft); }
.small { font-size: 13px; color: var(--ink-soft); }

.big { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 64px;
  padding: 14px 18px; margin: 10px 0; border-radius: var(--radius); border: 2px solid var(--ballpoint);
  background: var(--sheet); color: var(--ballpoint); font-size: 18px; font-weight: 700; cursor: pointer; }
.big.primary { background: var(--ballpoint); color: #fff; }
.big.primary:active { background: var(--ballpoint-dark); }
.big:disabled { opacity: .5; cursor: not-allowed; }
.big svg { width: 28px; height: 28px; flex: none; }
.quiet { display: inline-block; border: 0; background: none; color: var(--ballpoint); text-decoration: underline; padding: 8px 0; cursor: pointer; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.tips { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; margin: 18px 0 0; }
.tips ul { margin: 6px 0 0; padding-left: 20px; }
.tips li { margin: 2px 0; }

.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.notice { border-left: 4px solid var(--ballpoint); }
.notice.warn { border-left-color: var(--check); background: var(--check-wash); }
.notice.bad { border-left-color: var(--wrong); background: var(--wrong-wash); }
.notice.ok { border-left-color: var(--match); background: var(--match-wash); }

.drop { border: 2px dashed var(--rule); border-radius: var(--radius); padding: 26px 16px; text-align: center; color: var(--ink-soft); margin: 10px 0; }
.drop.over { border-color: var(--ballpoint); background: var(--ballpoint-wash); }

.preview { display: block; width: 100%; max-height: 55vh; object-fit: contain; background: #2A2D31; border-radius: var(--radius); }

.progress { height: 8px; background: var(--ballpoint-wash); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.progress span { display: block; height: 100%; width: 0; background: var(--ballpoint); transition: width .3s; }
.progress.busy span { width: 35% !important; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 5px solid var(--ballpoint-wash); border-top-color: var(--ballpoint);
  animation: spin 1s linear infinite; margin: 18px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }

.status { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius); padding: 12px 14px; margin: 6px 0 14px; font-weight: 600; }
.status.ok { background: var(--match-wash); color: var(--match); }
.status.wait { background: var(--check-wash); color: var(--check); }
.status small { display: block; font-weight: 400; color: var(--ink); margin-top: 2px; }

.med { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.med-name { font-size: 18px; font-weight: 700; }
.med-name .form { color: var(--ink-soft); font-weight: 600; margin-right: 4px; }
.generic { color: var(--ink-soft); font-size: 14px; }
/* the fourth line: quantity, price of one, a strip, a pack */
.prices { margin-top: 6px; font-size: 14px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; }
.prices b { color: var(--ink); font-weight: 600; }
.prices .dot { color: var(--rule); }
.how { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.pill { background: var(--ballpoint-wash); color: var(--ballpoint); border-radius: 99px; padding: 2px 10px; font-size: 14px; font-weight: 600; }
.pill.muted { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--rule); }
.as-written { font-size: 13px; color: var(--ink-soft); align-self: center; }
.facts p { margin: 2px 0; }
.label { color: var(--ink-soft); font-size: 13px; display: block; }
ul.plain { margin: 4px 0; padding-left: 20px; }
.disclaimer { font-size: 13px; color: var(--ink-soft); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  .spinner, .progress.busy span { animation: none; }
}
