:root {
  --patient-bg: #f3faf8;
  --patient-surface: #ffffff;
  --patient-ink: #173331;
  --patient-muted: #657c79;
  --patient-green: #126e69;
  --patient-green-dark: #0a5350;
  --patient-mint: #d9f1ec;
  --patient-yellow: #f4b85e;
  --patient-yellow-soft: #fff3d9;
  --patient-border: #d8e8e4;
  --staff-bg: #f4f6f8;
  --staff-ink: #172330;
  --staff-muted: #6e7882;
  --staff-navy: #17324d;
  --staff-cyan: #27a7a1;
  --danger: #b64a52;
  --shadow-soft: 0 26px 70px rgba(21, 81, 76, 0.12);
  --shadow-card: 0 12px 32px rgba(26, 58, 54, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--patient-ink);
  background: var(--patient-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: #111;
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.demo-ribbon {
  position: relative;
  z-index: 30;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 7px 16px;
  color: #3d4b49;
  background: #ffefc9;
  border-bottom: 1px solid #f1d99f;
  font-size: 12px;
}

.demo-ribbon span {
  padding: 2px 7px;
  color: #fff;
  background: #9a6a22;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.demo-ribbon p {
  margin: 0;
}

body[data-mode="patient"] .staff-app,
body[data-mode="staff"] .patient-app {
  display: none;
}

/* Patient view */
.patient-app {
  min-height: calc(100vh - 34px);
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 16%, rgba(180, 229, 219, 0.42) 0, rgba(180, 229, 219, 0) 26%),
    radial-gradient(circle at 12% 82%, rgba(246, 201, 128, 0.22) 0, rgba(246, 201, 128, 0) 25%),
    var(--patient-bg);
}

.patient-shell {
  position: relative;
  width: min(1120px, 100%);
  min-height: calc(100vh - 34px);
  margin: 0 auto;
  padding: 0 44px;
}

.clinic-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  border-bottom: 1px solid rgba(18, 110, 105, 0.12);
}

.clinic-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.clinic-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--patient-green);
  background: #fff;
  border: 1px solid var(--patient-border);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(24, 111, 106, 0.1);
}

.clinic-symbol svg {
  width: 30px;
  height: 30px;
}

.clinic-brand strong,
.clinic-brand small {
  display: block;
}

.clinic-brand strong {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 20px;
  letter-spacing: 0.06em;
}

.clinic-brand small {
  margin-top: 1px;
  color: var(--patient-muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.open-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  color: var(--patient-green-dark);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--patient-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.open-status i {
  width: 8px;
  height: 8px;
  background: #39a274;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(57, 162, 116, 0.13);
}

.open-status.is-closed i {
  background: #a5aaa9;
  box-shadow: 0 0 0 4px rgba(90, 97, 95, 0.1);
}

.patient-visual {
  position: absolute;
  inset: 100px 0 auto 0;
  height: 280px;
  pointer-events: none;
}

.visual-orb {
  position: absolute;
  display: block;
  border-radius: 48% 52% 56% 44% / 42% 45% 55% 58%;
}

.visual-orb-one {
  top: 28px;
  right: 34px;
  width: 178px;
  height: 150px;
  background: rgba(188, 231, 221, 0.58);
  transform: rotate(-13deg);
}

.visual-orb-two {
  top: 126px;
  right: 186px;
  width: 72px;
  height: 65px;
  background: rgba(244, 184, 94, 0.36);
  transform: rotate(18deg);
}

.visual-line {
  position: absolute;
  top: 40px;
  right: -10px;
  width: 520px;
  height: 180px;
  color: rgba(18, 110, 105, 0.23);
}

.patient-content {
  position: relative;
  z-index: 3;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 48px 0 60px;
}

.live-board {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--patient-border);
  border-radius: 26px;
  box-shadow: var(--shadow-card);
}

.live-board::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -55px;
  width: 170px;
  height: 145px;
  background: rgba(217, 241, 236, 0.72);
  border-radius: 48% 52% 56% 44%;
  transform: rotate(16deg);
  pointer-events: none;
}

.live-board-header {
  position: relative;
  z-index: 1;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--patient-border);
}

.live-board-header .kicker {
  margin: 0 0 2px;
  font-size: 9px;
}

.live-board-header h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 21px;
  line-height: 1.35;
}

.live-board-header > span {
  color: var(--patient-muted);
  font-size: 11px;
}

.live-board-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 160px;
}

.current-number-card {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 24px;
  color: #fff;
  background: var(--patient-green-dark);
}

.current-number-card > span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
}

.current-number-card p {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 2px 0 0;
  line-height: 1;
}

.current-number-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 51px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.current-number-card b {
  font-size: 15px;
}

.waiting-number-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 24px 28px;
}

.waiting-number-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.waiting-number-title > span {
  font-size: 13px;
  font-weight: 750;
}

.waiting-number-title small {
  color: var(--patient-muted);
  font-size: 10px;
}

.waiting-number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.waiting-number-chip {
  min-width: 74px;
  min-height: 44px;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  padding: 8px 11px;
  color: var(--patient-green-dark);
  background: #edf8f5;
  border: 1px solid #cce7e1;
  border-radius: 12px;
}

.waiting-number-chip strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.03em;
}

.waiting-number-chip small {
  color: var(--patient-muted);
  font-size: 9px;
}

.waiting-empty {
  color: var(--patient-muted);
  font-size: 12px;
}

.lookup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: center;
  gap: 76px;
  min-height: 480px;
  margin-top: 52px;
}

.kicker,
.staff-kicker {
  margin: 0 0 16px;
  color: var(--patient-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.intro-copy h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(38px, 5.2vw, 62px);
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: 0.025em;
}

.intro-copy > p:last-child {
  margin: 28px 0 0;
  color: var(--patient-muted);
  font-size: 15px;
  line-height: 1.9;
}

.lookup-card {
  padding: 34px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(209, 231, 226, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.lookup-card > label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
}

.code-input-wrap {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  min-height: 72px;
  padding: 0 18px;
  background: #f8fbfa;
  border: 2px solid #cbded9;
  border-radius: 16px;
  transition: 160ms ease;
}

.code-input-wrap:focus-within {
  background: #fff;
  border-color: var(--patient-green);
  box-shadow: 0 0 0 4px rgba(18, 110, 105, 0.11);
}

.code-input-wrap span {
  color: #8ca29f;
  font-size: 25px;
  font-weight: 400;
}

.code-input-wrap input {
  width: 100%;
  padding: 10px 0;
  color: var(--patient-ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-input-wrap input::placeholder {
  color: #afbfbc;
  font-weight: 500;
}

.patient-primary-button,
.staff-primary-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 18px;
  padding: 12px 20px;
  color: #fff;
  background: var(--patient-green);
  border: 0;
  border-radius: 14px;
  font-weight: 750;
  box-shadow: 0 11px 24px rgba(18, 110, 105, 0.18);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.patient-primary-button:hover,
.staff-primary-button:hover {
  background: var(--patient-green-dark);
  box-shadow: 0 13px 28px rgba(18, 110, 105, 0.25);
  transform: translateY(-1px);
}

.patient-primary-button:disabled,
.staff-primary-button:disabled,
.advance-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.sample-button {
  width: 100%;
  margin-top: 13px;
  padding: 6px;
  color: var(--patient-muted);
  background: transparent;
  border: 0;
  font-size: 12px;
}

.sample-button strong {
  color: var(--patient-green-dark);
}

.form-error {
  margin: 10px 0 0;
  color: #ac3d48;
  font-size: 13px;
  font-weight: 650;
}

.result-panel {
  width: min(660px, 100%);
  margin: 0 auto;
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--patient-muted);
  font-size: 12px;
}

.back-button {
  padding: 6px 0;
  color: var(--patient-green-dark);
  background: transparent;
  border: 0;
  font-weight: 700;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 34px 38px 38px;
  background: #fff;
  border: 1px solid var(--patient-border);
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
}

.result-card::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -65px;
  width: 220px;
  height: 180px;
  background: var(--patient-mint);
  border-radius: 45% 55% 52% 48%;
  transform: rotate(18deg);
}

.result-status-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-status {
  display: inline-flex;
  padding: 6px 11px;
  color: var(--patient-green-dark);
  background: var(--patient-mint);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.result-code {
  color: var(--patient-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.result-main {
  position: relative;
  padding: 38px 0 28px;
  text-align: center;
}

.result-caption {
  margin: 0 0 7px;
  color: var(--patient-muted);
  font-size: 12px;
}

.result-main h2 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(30px, 6vw, 43px);
  line-height: 1.35;
}

.result-message {
  margin: 12px 0 0;
  color: var(--patient-muted);
  font-size: 14px;
}

.wait-box {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--patient-yellow-soft);
  border: 1px solid #f3dfb7;
  border-radius: 18px;
}

.clock-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: #8b5a16;
  background: #fff;
  border-radius: 50%;
}

.clock-icon svg {
  width: 34px;
  height: 34px;
}

.wait-box span,
.wait-box strong,
.wait-box small {
  display: block;
}

.wait-box span {
  color: #6c5a3a;
  font-size: 12px;
}

.wait-box strong {
  color: #5c3b0d;
  font-size: 25px;
  line-height: 1.4;
}

.wait-box small {
  color: #8d7955;
  font-size: 10px;
}

.queue-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding-top: 20px;
}

.queue-dot {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #80aaa5;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.queue-dot.is-you {
  width: 34px;
  height: 34px;
  margin-left: 7px;
  background: var(--patient-green);
  box-shadow: 0 0 0 5px rgba(18, 110, 105, 0.12);
}

.queue-dot-more {
  color: var(--patient-muted);
  font-size: 12px;
  font-weight: 700;
}

.refresh-button {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  color: var(--patient-green-dark);
  background: #f8fbfa;
  border: 1px solid var(--patient-border);
  border-radius: 13px;
  font-size: 13px;
  font-weight: 750;
}

.patient-note {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding: 18px 20px;
  color: var(--patient-muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(204, 226, 221, 0.9);
  border-radius: 16px;
}

.patient-note > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--patient-green);
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

.patient-note strong {
  color: var(--patient-ink);
  font-size: 13px;
}

.patient-note p {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.7;
}

.public-notice {
  margin: 18px 0 0;
  color: var(--patient-green-dark);
  text-align: center;
  font-size: 13px;
  font-weight: 750;
}

.not-found-panel {
  width: min(520px, 100%);
  margin: 60px auto;
  padding: 48px;
  background: #fff;
  border: 1px solid var(--patient-border);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.not-found-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  color: var(--patient-green);
  background: var(--patient-mint);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 27px;
}

.not-found-panel h2 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 27px;
}

.not-found-panel p {
  margin: 12px 0 24px;
  color: var(--patient-muted);
  font-size: 14px;
}

.patient-footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 32px;
  color: var(--patient-muted);
  border-top: 1px solid rgba(18, 110, 105, 0.11);
  font-size: 11px;
}

.patient-footer p {
  margin: 0;
}

.patient-footer small {
  white-space: nowrap;
  letter-spacing: 0.08em;
}

/* Staff view */
.staff-app {
  min-height: calc(100vh - 34px);
  color: var(--staff-ink);
  background: var(--staff-bg);
}

.staff-login {
  min-height: calc(100vh - 34px);
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    linear-gradient(135deg, rgba(23, 50, 77, 0.96), rgba(16, 88, 92, 0.93)),
    var(--staff-navy);
}

.login-card {
  width: min(410px, 100%);
  padding: 40px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(6, 24, 40, 0.3);
}

.login-mark,
.staff-logo {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--staff-navy);
  border-radius: 12px;
  font-family: Georgia, serif;
  font-weight: 700;
}

.login-card .staff-kicker {
  margin: 24px 0 8px;
  color: var(--staff-cyan);
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
}

.login-card > p:not(.staff-kicker) {
  margin: 10px 0 26px;
  color: var(--staff-muted);
  font-size: 13px;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid #cfd6dc;
  border-radius: 10px;
  outline: 0;
  font-size: 20px;
  letter-spacing: 0.18em;
}

.login-card input:focus {
  border-color: var(--staff-cyan);
  box-shadow: 0 0 0 3px rgba(39, 167, 161, 0.13);
}

.login-card .staff-primary-button {
  background: var(--staff-navy);
  box-shadow: none;
}

.login-card > a {
  display: block;
  margin-top: 20px;
  color: var(--staff-muted);
  text-align: center;
  font-size: 12px;
}

.staff-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  color: #fff;
  background: var(--staff-navy);
}

.staff-header > div,
.staff-header-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.staff-logo {
  width: 38px;
  height: 38px;
  color: var(--staff-navy);
  background: #fff;
  border-radius: 9px;
}

.staff-header strong,
.staff-header small {
  display: block;
}

.staff-header strong {
  font-size: 14px;
}

.staff-header small {
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.staff-header-actions {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.staff-subtle-button {
  padding: 7px 11px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 11px;
}

.staff-layout {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.staff-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.staff-title-row .staff-kicker {
  margin-bottom: 6px;
  color: var(--staff-cyan);
}

.staff-title-row h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.25;
}

.advance-button {
  min-width: 190px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px 13px 10px 20px;
  color: #fff;
  background: var(--staff-cyan);
  border: 0;
  border-radius: 11px;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(39, 167, 161, 0.19);
}

.advance-button b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--staff-cyan);
  background: #fff;
  border-radius: 8px;
}

.staff-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.summary-item {
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #e3e7ea;
  border-radius: 13px;
}

.summary-item span,
.summary-item strong,
.summary-item small {
  display: block;
}

.summary-item span {
  color: var(--staff-muted);
  font-size: 11px;
}

.summary-item strong {
  margin-top: 4px;
  color: var(--staff-navy);
  font-size: 27px;
  line-height: 1.35;
}

.summary-item small {
  color: #929aa2;
  font-size: 10px;
}

.staff-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 20px;
  margin-top: 20px;
}

.staff-panel {
  background: #fff;
  border: 1px solid #e1e6e9;
  border-radius: 15px;
}

.staff-panel-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
  border-bottom: 1px solid #e8ecee;
}

.staff-panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.staff-panel-header p {
  margin: 2px 0 0;
  color: var(--staff-muted);
  font-size: 10px;
}

.add-entry-form {
  display: flex;
  gap: 7px;
}

.add-entry-form input {
  width: 130px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ccd4d9;
  border-radius: 8px;
  text-transform: uppercase;
}

.add-entry-form button {
  padding: 0 13px;
  color: #fff;
  background: var(--staff-navy);
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

.queue-list {
  padding: 8px 20px 14px;
}

.queue-row {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) 100px 88px minmax(210px, auto);
  align-items: center;
  gap: 12px;
  min-height: 65px;
  border-bottom: 1px solid #edf0f2;
}

.queue-row:last-child {
  border-bottom: 0;
}

.queue-code strong,
.queue-code small {
  display: block;
}

.queue-code strong {
  color: var(--staff-navy);
  font-size: 15px;
  letter-spacing: 0.05em;
}

.queue-code small {
  color: var(--staff-muted);
  font-size: 9px;
}

.queue-status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  color: #46535e;
  background: #eef1f3;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

.queue-status.status-in-progress {
  color: #08716b;
  background: #daf3f0;
}

.queue-status.status-waiting {
  color: #73540f;
  background: #fff1c7;
}

.queue-status.status-hold {
  color: #855d4b;
  background: #f7e6de;
}

.queue-time {
  color: var(--staff-muted);
  font-size: 11px;
}

.queue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.queue-action {
  min-height: 31px;
  padding: 4px 8px;
  color: #42505c;
  background: #fff;
  border: 1px solid #d9dfe3;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 650;
}

.queue-action.is-primary {
  color: #fff;
  background: var(--staff-navy);
  border-color: var(--staff-navy);
}

.staff-side {
  display: grid;
  gap: 16px;
}

.settings-panel form {
  padding: 18px 20px 22px;
}

.staff-field {
  display: block;
  margin-bottom: 16px;
}

.staff-field > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: #53606b;
  font-size: 11px;
  font-weight: 700;
}

.staff-field input,
.staff-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cfd6db;
  border-radius: 8px;
  outline: 0;
  resize: vertical;
  font-size: 12px;
}

.staff-field input:focus,
.staff-field textarea:focus {
  border-color: var(--staff-cyan);
  box-shadow: 0 0 0 3px rgba(39, 167, 161, 0.1);
}

.number-suffix {
  display: grid !important;
  grid-template-columns: 1fr 38px;
  align-items: center;
  margin: 0 !important;
  border: 1px solid #cfd6db;
  border-radius: 8px;
  overflow: hidden;
}

.number-suffix input {
  border: 0;
  border-radius: 0;
}

.number-suffix b {
  color: var(--staff-muted);
  font-size: 11px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 14px 0;
}

.switch-row span strong,
.switch-row span small {
  display: block;
}

.switch-row span strong {
  font-size: 11px;
}

.switch-row span small {
  color: var(--staff-muted);
  font-size: 9px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-row i {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  background: #ccd2d6;
  border-radius: 999px;
  transition: 160ms ease;
}

.switch-row i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(20, 32, 42, 0.2);
  transition: 160ms ease;
}

.switch-row input:checked + i {
  background: var(--staff-cyan);
}

.switch-row input:checked + i::after {
  transform: translateX(16px);
}

.settings-panel .staff-primary-button {
  min-height: 43px;
  margin-top: 20px;
  background: var(--staff-navy);
  border-radius: 9px;
  box-shadow: none;
  font-size: 11px;
}

.demo-panel {
  padding: 18px 20px;
}

.demo-panel p {
  margin: 0;
  color: var(--staff-muted);
  font-size: 10px;
}

.demo-panel p span {
  display: inline-block;
  margin-right: 5px;
  padding: 2px 6px;
  color: #815715;
  background: #fff0c5;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.danger-text-button {
  margin-top: 10px;
  padding: 0;
  color: var(--danger);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 700;
}

.staff-empty {
  padding: 40px 20px;
  color: var(--staff-muted);
  text-align: center;
  font-size: 12px;
}

/* Shared feedback */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  color: var(--patient-ink);
  background: rgba(244, 250, 248, 0.84);
  backdrop-filter: blur(6px);
}

.loading-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid #cce4df;
  border-top-color: var(--patient-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  max-width: 360px;
  padding: 13px 17px;
  color: #fff;
  background: #153b39;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(12, 31, 30, 0.25);
  font-size: 12px;
  font-weight: 650;
}

.toast.is-error {
  background: #9d3e47;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .patient-shell {
    padding: 0 28px;
  }

  .lookup-panel {
    grid-template-columns: 1fr;
    gap: 42px;
    width: min(580px, 100%);
    margin: 0 auto;
  }

  .intro-copy {
    text-align: center;
  }

  .patient-visual {
    opacity: 0.62;
  }

  .staff-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .staff-grid {
    grid-template-columns: 1fr;
  }

  .staff-side {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .demo-ribbon {
    align-items: flex-start;
    gap: 7px;
    padding: 7px 10px;
    font-size: 10px;
    line-height: 1.5;
  }

  .demo-ribbon span {
    flex: 0 0 auto;
    margin-top: 1px;
  }

  .patient-shell {
    padding: 0 18px;
  }

  .clinic-header {
    min-height: 82px;
  }

  .clinic-symbol {
    width: 40px;
    height: 40px;
  }

  .clinic-symbol svg {
    width: 25px;
    height: 25px;
  }

  .clinic-brand strong {
    font-size: 16px;
  }

  .clinic-brand small {
    font-size: 9px;
  }

  .open-status {
    padding: 6px 9px;
    font-size: 10px;
  }

  .patient-content {
    padding: 28px 0 38px;
  }

  .live-board {
    border-radius: 20px;
  }

  .live-board-header {
    min-height: 68px;
    padding: 14px 16px;
  }

  .live-board-header h1 {
    font-size: 18px;
  }

  .live-board-grid {
    grid-template-columns: 1fr;
  }

  .current-number-card {
    min-height: 126px;
    padding: 20px;
  }

  .current-number-card strong {
    font-size: 46px;
  }

  .waiting-number-card {
    gap: 13px;
    padding: 18px 16px 20px;
  }

  .waiting-number-title {
    align-items: flex-start;
  }

  .waiting-number-title > span {
    font-size: 12px;
  }

  .waiting-number-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .waiting-number-chip {
    min-width: 0;
    min-height: 41px;
    padding: 6px 5px;
  }

  .waiting-number-chip strong {
    font-size: 18px;
  }

  .lookup-panel {
    margin-top: 42px;
  }

  .lookup-panel {
    display: block;
    min-height: auto;
  }

  .intro-copy h1 {
    font-size: 34px;
  }

  .intro-copy > p:last-child {
    margin-top: 20px;
    font-size: 13px;
  }

  .desktop-break {
    display: none;
  }

  .lookup-card {
    margin-top: 34px;
    padding: 25px 20px;
    border-radius: 22px;
  }

  .code-input-wrap {
    min-height: 66px;
  }

  .code-input-wrap input {
    font-size: 21px;
  }

  .result-panel {
    margin-top: -4px;
  }

  .result-card {
    padding: 24px 20px 26px;
    border-radius: 23px;
  }

  .result-main {
    padding: 34px 0 24px;
  }

  .result-main h2 {
    font-size: 31px;
  }

  .wait-box {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 17px;
  }

  .clock-icon {
    width: 44px;
    height: 44px;
  }

  .wait-box strong {
    font-size: 22px;
  }

  .patient-note {
    padding: 15px;
  }

  .not-found-panel {
    margin: 18px auto;
    padding: 38px 22px;
  }

  .patient-footer {
    display: block;
    text-align: center;
  }

  .patient-footer small {
    display: block;
    margin-top: 12px;
  }

  .patient-visual {
    top: 76px;
    right: -120px;
    opacity: 0.42;
  }

  .staff-header {
    padding: 0 16px;
  }

  .staff-header-actions > span {
    display: none;
  }

  .staff-layout {
    width: min(100% - 28px, 1180px);
    padding-top: 28px;
  }

  .staff-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .advance-button {
    width: 100%;
  }

  .staff-summary {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .summary-item {
    padding: 15px;
  }

  .summary-item strong {
    font-size: 22px;
  }

  .staff-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .add-entry-form input {
    width: 100%;
  }

  .queue-list {
    padding: 4px 14px 12px;
  }

  .queue-row {
    grid-template-columns: 1fr auto;
    gap: 7px;
    padding: 13px 0;
  }

  .queue-status {
    justify-self: end;
  }

  .queue-time {
    font-size: 10px;
  }

  .queue-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .staff-side {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 32px 24px;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
