:root {
  --p: #087F8C;
  --p-ink: #06616B;
  --p-soft: #E6F4F4;
  --ink: #10201F;
  --muted: #5B6B6A;
  --line: #DCE5E4;
  --bg: #F6F8F8;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); display: flex; flex-direction: column; }
[hidden] { display: none !important; }
.bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--p); color: #fff; display: grid; place-items: center; font-weight: 800; }
nav { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.clinic { font-weight: 600; margin-right: 8px; color: var(--p-ink); }
button { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 7px 12px; cursor: pointer; }
button:hover { border-color: var(--p); color: var(--p-ink); }
button.primary { background: var(--p); border-color: var(--p); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--p-ink); color: #fff; }
.setup { flex: 1; display: grid; place-items: start center; padding: 40px 16px; }
.card { width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 22px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input:not([type=radio]) { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; width: 100%; }
input:focus { outline: 2px solid var(--p); outline-offset: 0; border-color: var(--p); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 18px; align-items: center; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.radio { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.note { margin-top: 22px; background: var(--p-soft); border-radius: 12px; padding: 14px 16px; font-size: 14px; }
code { background: #fff; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.stage { flex: 1; position: relative; min-height: 0; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.loader-card { max-width: 420px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.loader-card h2 { margin: 10px 0 6px; font-size: 20px; }
.muted { color: var(--muted); font-size: 13px; }
.spinner { width: 36px; height: 36px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--p-soft); border-top-color: var(--p); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--p-soft); border-radius: 99px; overflow: hidden; margin: 14px 0; }
.progress span { display: block; height: 100%; width: 3%; background: var(--p); transition: width 0.4s; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 10; }
button:disabled { opacity: .45; cursor: default; pointer-events: none; }
