/*
 * Neutral by design. Colour and logo come from tenant branding at runtime:
 * the patient screen carries the partner's or pharmacy's marks and the
 * platform stays underneath. No brand palette is hardcoded here.
 */

:root {
  --ink: #16181d;
  --muted: #5c6270;
  --line: #d9dce3;
  --surface: #ffffff;
  --page: #f6f7f9;
  --primary: #1f2a37;   /* overridden per tenant */
  --accent: #2f6f5e;    /* overridden per tenant */
  --radius: 10px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #eceef2;
    --muted: #a3a9b6;
    --line: #333844;
    --surface: #1b1e24;
    --page: #121419;
  }
}

* { box-sizing: inherit; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.bar img { height: 26px; max-width: 160px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.tab[aria-selected='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

main { max-width: 620px; margin: 0 auto; padding: 22px 18px 64px; }

h1 { font-size: 22px; line-height: 1.3; margin: 0 0 10px; }
p { margin: 0 0 16px; color: var(--muted); }
.progress { font-size: 14px; letter-spacing: 0.02em; }

.stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.row { display: flex; gap: 10px; align-items: center; }

button {
  padding: 12px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* One question per screen: the choices are the whole screen, not a dropdown. */
.choice, .big {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 17px;
}

.choice.chosen { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.big { font-weight: 600; }

input[type='text'], input[type='number'], #chat-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.photo {
  display: block;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
}

.photo input { display: none; }

dl { margin: 0 0 20px; }
dt { font-size: 14px; color: var(--muted); margin-top: 14px; }
dd { margin: 3px 0 0; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.consent input { margin-top: 4px; }

.notices { padding-left: 18px; }
.notices li { margin-bottom: 8px; }

.chat { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; margin-bottom: 14px; }
.msg { margin: 0; padding: 10px 13px; border-radius: var(--radius); max-width: 85%; color: var(--ink); }
.msg.you { align-self: flex-end; background: var(--primary); color: #fff; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }

/* Staff workspace */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.sev { padding: 2px 8px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); }
.sev-emergency, .sev-urgent { border-color: #b4402f; color: #b4402f; }
.sev-same_day { border-color: #b07d22; color: #b07d22; }
.met { color: var(--accent); }
.unanswered { color: var(--muted); font-style: italic; }
.scroll { overflow-x: auto; }
