@font-face {
  font-family: Vazir;
  src: url("vazir-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Vazir;
  src: url("vazir-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Vazir;
  src: url("vazir-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #192d35;
  --muted: #52666a;
  --page: #f1f5f3;
  --paper: #fff;
  --line: #d8e3df;
  --teal: #14695d;
  --teal-dark: #173b3a;
  --teal-tint: #e6f3ee;
  --error: #912c22;
  --error-tint: #fff1ef;
  font: 400 16px/1.65 Vazir, Tahoma, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); line-height: 1.45; }
h2 { font-size: 1.14rem; line-height: 1.55; }
:focus-visible { outline: 3px solid #168b7a; outline-offset: 3px; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.skip-link:focus { position: fixed; z-index: 3; inset-block-start: 8px; inset-inline-start: 10px; padding: 10px; background: var(--paper); color: var(--ink); }
.topbar { background: var(--teal-dark); color: #fff; }
.topbar-inner {
  max-width: 1240px;
  margin-inline: auto;
  min-height: 82px;
  padding: 12px clamp(14px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand, .session-controls { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 48px;
  height: 48px;
  padding: 5px;
  object-fit: contain;
  border-radius: 10px;
  background: white;
}
.brand span, .brand strong { display: block; }
.brand span { color: #d4e8e2; font-size: .72rem; white-space: nowrap; }
.brand strong { font-size: 1.04rem; }
#doctor-name { font-size: .82rem; overflow-wrap: anywhere; }
#content { max-width: 1240px; margin: 0 auto; padding: clamp(18px, 4vw, 38px) clamp(13px, 4vw, 32px) 42px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 4px 18px #173b3a0b; }
.login { display: grid; gap: 19px; width: min(100%, 430px); margin: clamp(27px, 8vh, 95px) auto; padding: clamp(18px, 5vw, 32px); }
.login-intro, .form { display: grid; gap: 10px; }
.login-intro p, .workspace-intro p, .hint { color: var(--muted); font-size: .9rem; }
.form label { font-weight: 700; font-size: .9rem; }
input, textarea, .button { font: inherit; }
input, textarea {
  min-height: 46px;
  min-width: 0;
  width: 100%;
  border: 1px solid #b9cbc4;
  border-radius: 10px;
  background: #fcfefc;
  color: var(--ink);
  padding: 8px 12px;
}
textarea { resize: vertical; }
#phone, #code { text-align: center; font-size: 1.2rem; letter-spacing: .13em; }
.button {
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: .87rem;
  font-weight: 700;
}
.button:disabled { opacity: .62; cursor: default; }
.button.primary { background: var(--teal); color: white; }
.button.secondary { border-color: #adccc2; background: #f6fbf8; color: var(--teal-dark); }
.button.quiet { border-color: #60938a; background: transparent; color: white; }
.button.plain { background: transparent; color: var(--teal); }
.button:not(:disabled):hover { filter: brightness(.96); }
.auth-actions, .workspace-intro { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.workspace-intro { margin-block-end: 16px; }
.workspace-intro p { margin-block-start: 3px; }
.workspace-grid { display: grid; gap: 15px; align-items: start; }
.queue, .detail { padding: clamp(12px, 3vw, 20px); }
.queue-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px; background: var(--page); border-radius: 12px; }
.queue-tabs .button { border: 0; background: transparent; color: var(--muted); }
.queue-tabs .button[aria-pressed=true] { background: var(--teal-dark); color: white; }
.queue-header, .detail-heading { display: grid; gap: 10px; margin-block: 12px; }
.detail-heading { margin-block-start: 0; }
.detail-heading .button { justify-self: start; }
.queue-items, .messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.queue-item {
  min-height: 56px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 2px;
  background: #f9fcfa;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.queue-item[aria-current=true] { border-color: var(--teal); background: var(--teal-tint); }
.queue-item .hint { font-size: .78rem; }
.detail-status, .notice, .empty { border-radius: 10px; padding: 9px 12px; font-size: .88rem; }
.notice { background: var(--teal-tint); color: var(--teal-dark); }
.notice.error { background: var(--error-tint); color: var(--error); }
#workspace-status, #detail-status { margin-block-end: 12px; }
.empty { background: var(--page); color: var(--muted); }
.messages { margin-block: 14px; }
.message { padding: 12px; border-radius: 12px; background: #eff4f1; border: 1px solid var(--line); }
.message.doctor { background: var(--teal-tint); }
.message header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 7px; align-items: center; }
.message time { color: var(--muted); font-size: .76rem; }
.message p { white-space: pre-wrap; overflow-wrap: anywhere; margin-block-start: 5px; }
.reply { border-top: 1px solid var(--line); padding-block-start: 13px; }
.reply .button { justify-self: start; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; font-size: .87rem; border-collapse: collapse; }
th, td { padding: 9px 6px; text-align: start; border-block-end: 1px solid var(--line); vertical-align: top; }
th { color: var(--teal-dark); background: var(--teal-tint); }
.reading { display: inline-grid; gap: 0; white-space: nowrap; }
.unit { color: var(--muted); font-size: .69rem; }
@media (min-width: 770px) {
  .workspace-grid { grid-template-columns: minmax(250px, .78fr) minmax(420px, 1.7fr); }
  .detail-heading { grid-template-columns: 1fr auto; align-items: center; }
}
@media (max-width: 370px) {
  .topbar-inner, .brand, .session-controls { gap: 6px; }
  .brand-mark { width: 38px; height: 38px; }
  .button.quiet { padding-inline: 8px; }
  .workspace-intro { align-items: start; }
  .workspace-intro .button { flex-shrink: 0; }
  th, td { font-size: .75rem; }
}

.topbar-inner { flex-wrap: wrap; }
#install-help { max-width: min(28rem, 90vw); margin: auto; }
#install-help::backdrop { background: #122b2a80; }
