:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e2ec;
  --primary: #146c94;
  --primary-dark: #0f4f6d;
  --accent: #d97706;
  --success: #13795b;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.green-theme {
  --bg: #f0fdf4;
  --surface: #ffffff;
  --surface-strong: #ecfdf3;
  --text: #14231b;
  --muted: #52665a;
  --line: #bbf7d0;
  --primary: #15803d;
  --primary-dark: #166534;
  --accent: #4d7c0f;
  --success: #15803d;
  --shadow: 0 18px 45px rgba(20, 83, 45, 0.10);
  background:
    linear-gradient(135deg, rgba(21, 128, 61, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(77, 124, 15, 0.10), transparent 32%),
    var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(20, 108, 148, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(217, 119, 6, 0.10), transparent 32%),
    var(--bg);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

fieldset {
  min-width: 0;
  margin: 0;
}

.app-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.welcome-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 24px;
}

.corner-links {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  gap: 10px;
}

.corner-links .secondary-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.home-dashboard {
  position: relative;
  min-height: 100vh;
  padding-top: 76px;
  background:
    linear-gradient(135deg, rgba(20, 108, 148, 0.18) 0%, rgba(20, 108, 148, 0) 36%),
    linear-gradient(315deg, rgba(217, 119, 6, 0.15) 0%, rgba(217, 119, 6, 0) 34%),
    linear-gradient(180deg, #ffffff 0%, #eef6f8 48%, #f8fafc 100%),
    var(--bg);
  overflow-x: hidden;
}

.home-dashboard::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.52), transparent 72%);
}

.mac-taskbar {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 30;
  width: min(1080px, calc(100% - 28px));
  min-height: 54px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.mac-window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.10);
}

.mac-dot.red {
  background: #ff5f57;
}

.mac-dot.amber {
  background: #ffbd2e;
}

.mac-dot.green {
  background: #28c840;
}

.mac-taskbar-title {
  color: #24313d;
  font-size: 0.92rem;
  white-space: nowrap;
}

.mac-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.mac-nav-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 12px;
  color: #0f4f6d;
  background: linear-gradient(180deg, #ffffff, #eef7fa);
  border: 1px solid rgba(20, 108, 148, 0.15);
  font-size: 0.94rem;
  font-family: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.mac-nav-button:hover {
  border-color: rgba(20, 108, 148, 0.34);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
}

.home-welcome {
  min-height: calc(100vh - 76px);
  width: min(1040px, calc(100% - 32px));
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 32px 0 48px;
}

.home-welcome-window {
  position: relative;
  width: min(860px, 100%);
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
    #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  text-align: center;
}

.home-welcome-window::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, rgba(238, 246, 248, 0.9), rgba(255, 255, 255, 0));
}

.home-welcome-window > * {
  position: relative;
}

.home-welcome-window h1 {
  max-width: 820px;
  margin: 0 auto;
  font-size: clamp(2.15rem, 5vw, 4.6rem);
  white-space: normal;
}

.home-welcome-window .intro-text {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.home-status-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.home-status-row span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
}

.home-footer-note {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  color: rgba(36, 49, 61, 0.62);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.home-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(8px);
}

.home-modal[hidden] {
  display: none;
}

.home-modal-card {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.home-modal-card h2 {
  margin: 0 0 16px;
  color: #16384a;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.nested-home-modal {
  z-index: 70;
  background: rgba(15, 23, 42, 0.18);
}

.change-detail-card {
  width: min(520px, 100%);
}

.change-detail-text {
  margin: 0;
  color: #334155;
  font-size: 1rem;
  line-height: 1.55;
}

.home-modal-close {
  float: right;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(20, 108, 148, 0.18);
  border-radius: 10px;
  color: #0f4f6d;
  background: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
}

.home-modal-close:hover {
  background: #eef7fa;
}

.whats-new-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.whats-new-list li {
  padding: 0;
}

.whats-new-list button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(20, 108, 148, 0.14);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f5fbfc);
  color: #334155;
  cursor: pointer;
  font: inherit;
  line-height: 1.45;
  text-align: left;
}

.whats-new-list button:hover {
  border-color: rgba(20, 108, 148, 0.34);
  background: #eef7fa;
}

.whats-new-list strong {
  color: #0f4f6d;
}

.intro {
  margin-bottom: 24px;
}

.welcome-intro {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 100%;
  font-size: clamp(1.05rem, 5.4vw, 4.2rem);
  white-space: nowrap;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.intro-text {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.compact-intro {
  grid-template-columns: 1fr;
}

.welcome-panel {
  max-width: 820px;
}

.welcome-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.welcome-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.welcome-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
}

.welcome-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.patient-login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 34%),
    linear-gradient(145deg, #f7f9fc 0%, #e8edf5 46%, #f9fafb 100%);
}

.patient-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.patient-login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 22px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(22px);
}

.patient-login-orb {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 22px;
  color: #ffffff;
  background: linear-gradient(145deg, #111827, #475569);
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.24);
}

.patient-login-heading {
  text-align: center;
}

.patient-login-heading h1 {
  font-size: clamp(2rem, 8vw, 3.1rem);
  white-space: normal;
}

.patient-login-heading .intro-text {
  margin: 12px auto 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

.patient-login-form {
  display: grid;
  gap: 14px;
}

.registered-patient-form {
  gap: 12px;
}

.registered-toggle-button {
  min-height: 46px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 800;
}

.registered-login-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 122, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.registered-login-panel[hidden] {
  display: none;
}

.registered-actions {
  display: grid;
  gap: 10px;
}

.registered-actions .primary-button,
.registered-actions .secondary-button {
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.94rem;
}

.patient-login-message {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, 0.26);
  border-radius: 14px;
  color: #991b1b;
  background: rgba(254, 242, 242, 0.92);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.patient-login-message[data-type="success"] {
  border-color: rgba(34, 197, 94, 0.28);
  color: #166534;
  background: rgba(240, 253, 244, 0.94);
}

.patient-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.patient-login-divider::before,
.patient-login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(148, 163, 184, 0.28);
}

.patient-login-form label {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 800;
}

.patient-login-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 14px;
  color: #111827;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 1rem;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.patient-login-form input:focus {
  border-color: #007aff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.14);
}

.patient-login-form input::placeholder {
  color: #94a3b8;
}

.patient-login-form .field-invalid input {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.patient-login-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.patient-login-actions .primary-button,
.patient-login-actions .secondary-button {
  min-height: 48px;
  border-radius: 999px;
  font-size: 0.96rem;
}

.patient-login-actions .primary-button {
  border-color: #007aff;
  background: #007aff;
  box-shadow: 0 14px 26px rgba(0, 122, 255, 0.24);
}

.patient-login-actions .secondary-button {
  color: #1f2937;
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(148, 163, 184, 0.34);
}

.test-picker-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.test-picker-card {
  width: min(720px, 100%);
  display: grid;
  gap: 22px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(22px);
}

.test-picker-heading {
  text-align: center;
}

.test-picker-heading h1 {
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  white-space: normal;
}

.test-picker-heading .intro-text {
  margin: 12px auto 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

.test-picker-page .test-list-panel {
  gap: 10px;
}

.test-picker-page .patient-greeting {
  margin: 16px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.test-picker-page .test-list-item {
  min-height: 78px;
  padding: 14px 16px;
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
}

.test-picker-page .test-list-item:hover {
  border-color: rgba(0, 122, 255, 0.45);
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.test-picker-page .test-list-item b {
  border-radius: 999px;
  background: #007aff;
  box-shadow: 0 10px 18px rgba(0, 122, 255, 0.2);
}

.test-picker-page.test-gender-masculino {
  background:
    radial-gradient(circle at 50% 0%, rgba(240, 249, 255, 0.98), rgba(240, 249, 255, 0) 34%),
    linear-gradient(145deg, #eff8ff 0%, #dff0ff 46%, #f8fbff 100%);
}

.test-picker-page.test-gender-masculino .patient-login-orb,
.test-picker-page.test-gender-masculino .test-list-item b {
  background: #0ea5e9;
  box-shadow: 0 10px 18px rgba(14, 165, 233, 0.22);
}

.test-picker-page.test-gender-masculino .test-picker-card {
  border-color: rgba(125, 211, 252, 0.62);
  background: rgba(240, 249, 255, 0.86);
}

.test-picker-page.test-gender-masculino .patient-greeting {
  color: #075985;
  border-color: rgba(14, 165, 233, 0.28);
  background: rgba(224, 242, 254, 0.86);
}

.test-picker-page.test-gender-masculino .test-list-item:hover {
  border-color: rgba(14, 165, 233, 0.48);
}

.test-picker-page.test-gender-femenino {
  background:
    radial-gradient(circle at 50% 0%, rgba(253, 242, 248, 0.98), rgba(253, 242, 248, 0) 34%),
    linear-gradient(145deg, #fdf2f8 0%, #fce7f3 46%, #fff7fb 100%);
}

.test-picker-page.test-gender-femenino .patient-login-orb,
.test-picker-page.test-gender-femenino .test-list-item b {
  background: #db2777;
  box-shadow: 0 10px 18px rgba(219, 39, 119, 0.2);
}

.test-picker-page.test-gender-femenino .test-picker-card {
  border-color: rgba(244, 114, 182, 0.48);
  background: rgba(253, 242, 248, 0.86);
}

.test-picker-page.test-gender-femenino .patient-greeting {
  color: #9d174d;
  border-color: rgba(219, 39, 119, 0.24);
  background: rgba(252, 231, 243, 0.86);
}

.test-picker-page.test-gender-femenino .test-list-item:hover {
  border-color: rgba(219, 39, 119, 0.42);
}

.test-picker-back {
  justify-self: center;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.page-link-button {
  min-height: 46px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.page-link-button:hover {
  background: #f1f5f9;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.test-list-panel {
  display: grid;
  gap: 12px;
}

.patient-greeting {
  width: fit-content;
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary-dark);
  background: var(--surface-strong);
  font-weight: 800;
}

.test-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-strong);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.test-list-item:hover {
  border-color: var(--primary);
  background: #ffffff;
  transform: translateY(-1px);
}

.test-list-item span {
  display: grid;
  gap: 5px;
}

.test-list-item strong {
  font-size: 1.05rem;
}

.test-list-item small {
  color: var(--muted);
  font-weight: 700;
}

.test-list-item b {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-size: 0.9rem;
}

.reference-figure {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.reference-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.score-preview,
.form-panel,
.result-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.score-preview {
  position: sticky;
  top: 10px;
  z-index: 10;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 18px;
  border-radius: 8px;
}

.score-preview span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.score-preview strong {
  color: var(--primary);
  font-size: 2.2rem;
  line-height: 1;
}

.neuro-scorebar {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.profile-score-pill {
  min-height: 74px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(20, 108, 148, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(238, 247, 250, 0.86));
  text-align: center;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.profile-score-pill span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.profile-score-pill strong {
  color: var(--primary-dark);
  font-size: 1.7rem;
  line-height: 1;
}

.form-panel,
.result-panel {
  border-radius: 8px;
  padding: 24px;
}

.questions {
  display: grid;
  gap: 18px;
}

.patient-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.patient-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.patient-grid input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
}

.field-invalid input {
  border-color: #dc2626;
  background: #fff7f7;
}

.field-error {
  color: #991b1b;
  font-size: 0.82rem;
  font-weight: 800;
}

.question-block {
  scroll-margin-top: 92px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.question-block-error {
  border-color: #dc2626;
  background: #fff7f7;
}

.question-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 800;
}

.question-error {
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  background: #fee2e2;
  font-size: 0.92rem;
  font-weight: 800;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.binary-question-list {
  grid-template-columns: 1fr;
}

.option-pair {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.option-pair-title {
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.binary-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 140px));
  gap: 10px;
}

.option {
  position: relative;
}

.option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.option-content {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.compact-option .option-content {
  min-height: 58px;
}

.option input:focus-visible + .option-content {
  outline: 3px solid rgba(20, 108, 148, 0.22);
  outline-offset: 2px;
}

.option input:checked + .option-content {
  border-color: var(--primary);
  background: #e6f3f8;
  transform: translateY(-1px);
}

.option-label {
  font-weight: 700;
}

.option-points {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #d5edf5;
  font-size: 0.82rem;
  font-weight: 800;
}

.sam-page .options {
  grid-template-columns: 1fr;
}

.sam-page .option-content {
  min-height: 54px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
}

.sam-page .option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sam-page .option-points {
  flex: 0 0 auto;
}

/* El contenido clínico debe leerse completo dentro de cada control. */
.sam-page .intro,
.sam-page .form-panel,
.sam-page .question-block,
.sam-page .option,
.sam-page .option-content,
.sam-page .patient-grid label {
  min-width: 0;
}

.sam-page .intro h1,
.sam-page .intro-text,
.sam-page .question-title,
.sam-page .patient-grid label span,
.sam-page .page-link-button {
  overflow-wrap: anywhere;
}

.sam-page .option-content {
  align-items: flex-start;
}

.sam-page .option-label {
  display: block;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.38;
}

.sam-page .option-points {
  align-self: center;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .sam-page .option-content {
    gap: 8px;
    padding: 11px 12px;
  }

  .sam-page .option-points {
    padding: 3px 6px;
    font-size: 0.74rem;
  }
}

.green-theme .option-pair {
  padding: 14px;
  border-color: #a7f3d0;
  background: #f7fef9;
}

.green-theme .option-pair-title {
  margin-bottom: 12px;
  width: 100%;
  font-size: 1.12rem;
  text-align: center;
}

.green-theme .binary-options {
  grid-template-columns: repeat(2, minmax(118px, 1fr));
}

.green-theme .compact-option {
  cursor: pointer;
}

.green-theme .compact-option .option-content {
  min-height: 64px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid #86efac;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(21, 128, 61, 0.08);
  color: var(--primary-dark);
  text-align: center;
}

.green-theme .compact-option .option-content::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid #86efac;
  border-radius: 50%;
  background: #ffffff;
}

.green-theme .compact-option:hover .option-content {
  border-color: var(--primary);
  background: #ecfdf3;
  transform: translateY(-1px);
}

.green-theme .option input:focus-visible + .option-content {
  outline-color: rgba(21, 128, 61, 0.28);
}

.green-theme .option input:checked + .option-content {
  border-color: var(--primary);
  background: #dcfce7;
  box-shadow: 0 12px 24px rgba(21, 128, 61, 0.16);
  color: #14532d;
}

.green-theme .option input:checked + .option-content::before {
  border-color: var(--primary);
  background: radial-gradient(circle, var(--primary) 0 45%, #ffffff 48% 100%);
}

.green-theme .compact-option .option-label {
  font-size: 1rem;
  font-weight: 800;
}

.green-theme .compact-option .option-points {
  color: #14532d;
  background: #bbf7d0;
}

.green-theme .hiperlaxitud-part-b {
  border-color: #fed7aa;
  background: #fff7ed;
}

.green-theme .hiperlaxitud-part-b .question-title {
  color: #9a3412;
}

.green-theme .hiperlaxitud-part-b .option-pair {
  border-color: #fdba74;
  background: #fffaf3;
}

.green-theme .hiperlaxitud-part-b .compact-option .option-content {
  border-color: #fdba74;
  color: #9a3412;
}

.green-theme .hiperlaxitud-part-b .compact-option:hover .option-content,
.green-theme .hiperlaxitud-part-b .option input:checked + .option-content {
  border-color: #ea580c;
  background: #ffedd5;
  color: #7c2d12;
}

.green-theme .hiperlaxitud-part-b .compact-option .option-content::before {
  border-color: #fdba74;
}

.green-theme .hiperlaxitud-part-b .option input:checked + .option-content::before {
  border-color: #ea580c;
  background: radial-gradient(circle, #ea580c 0 45%, #ffffff 48% 100%);
}

.neuro-page {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --accent: #0f766e;
  --line: #ddd6fe;
  --surface-strong: #f5f3ff;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(15, 118, 110, 0.10), transparent 32%),
    var(--bg);
}

.neuro-profile {
  display: grid;
  gap: 16px;
}

.neuro-group {
  display: grid;
  gap: 10px;
}

.neuro-group h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1rem;
}

.frequency-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.frequency-prompt {
  font-weight: 800;
  line-height: 1.35;
}

.frequency-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 8px;
}

.frequency-option {
  position: relative;
  cursor: pointer;
}

.frequency-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.frequency-option span,
.frequency-option small {
  display: block;
}

.frequency-option span {
  font-size: 1.1rem;
  font-weight: 800;
}

.frequency-option small {
  font-size: 0.72rem;
  font-weight: 800;
}

.frequency-option > span,
.frequency-option > small {
  pointer-events: none;
}

.frequency-option {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--primary-dark);
  background: var(--surface-strong);
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.frequency-option:hover {
  border-color: var(--primary);
  background: #ffffff;
  transform: translateY(-1px);
}

.frequency-option:has(input:checked) {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary);
}

.pots-page {
  --primary: #0e7490;
  --primary-dark: #155e75;
  --accent: #b45309;
  --line: #bae6fd;
  --surface-strong: #f0f9ff;
  background:
    linear-gradient(135deg, rgba(14, 116, 144, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.10), transparent 32%),
    var(--bg);
}

.report-page {
  --primary: #2563eb;
  --primary-dark: #1e3a8a;
  --accent: #0f766e;
  --line: #bfdbfe;
  --surface-strong: #eff6ff;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(15, 118, 110, 0.10), transparent 32%),
    var(--bg);
}

.report-form {
  display: grid;
  gap: 18px;
}

.report-section {
  display: grid;
  gap: 14px;
}

.report-section h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.16rem;
}

.report-section label,
.report-wide-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.report-section input,
.report-section textarea,
.patient-grid select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

.report-section textarea {
  resize: vertical;
  line-height: 1.45;
}

.report-vitals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.report-vitals-grid textarea,
.report-vitals-grid label:first-child textarea {
  min-height: 86px;
}

.report-radio-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-preview {
  margin-top: 16px;
}

.report-preview-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.report-preview-card h3 {
  margin: 0 0 6px;
  color: var(--primary-dark);
}

.report-preview-card p {
  margin: 0;
}

.report-preview-fields {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.report-preview-fields div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.report-preview-fields strong {
  color: var(--primary-dark);
}

.info-block h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-grid label,
.mini-radio {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.info-grid input,
.info-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

.wide-field {
  grid-column: 1 / -1;
}

.mini-radio {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.mini-radio legend {
  grid-column: 1 / -1;
  color: var(--muted);
}

.mini-radio label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.criteria-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary-dark);
  background: var(--surface-strong);
  font-weight: 800;
}

.notes-panel {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  background: #fffbeb;
}

.notes-panel h2 {
  margin: 0 0 12px;
  color: #92400e;
  font-size: 1.25rem;
}

.notes-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #78350f;
  font-weight: 800;
}

.pots-row .binary-options {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.pots-row .compact-option .option-content {
  min-height: 58px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  color: var(--text);
  border-color: var(--line);
  background: #ffffff;
}

.secondary-button:hover {
  background: #f1f5f9;
}

.result-panel {
  margin-top: 24px;
  border-left: 6px solid var(--success);
}

.result-panel p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.result-details {
  margin: 18px 0 0;
  color: var(--text);
}

.neuro-result-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #ffffff;
}

.neuro-result-table th,
.neuro-result-table td {
  padding: 12px 14px;
  border: 1px solid #1f2937;
  color: #17202a;
  vertical-align: middle;
}

.neuro-result-table th {
  background: #f8fafc;
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.neuro-result-table td:first-child {
  width: 42%;
  font-weight: 900;
}

.neuro-result-table td:nth-child(2) {
  width: 14%;
  color: var(--primary-dark);
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
}

.neuro-result-table td:nth-child(3) {
  width: 44%;
}

.clinical-considerations {
  margin-top: 28px;
  color: #17202a;
}

.clinical-considerations h3 {
  margin: 0 0 18px;
  font-size: 1.35rem;
}

.clinical-considerations p {
  margin: 0 0 16px;
  max-width: 760px;
  line-height: 1.55;
}

.clinical-considerations ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 28px;
}

.clinical-considerations li {
  padding-left: 8px;
}

#resultScore {
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 800;
}

.save-status {
  color: var(--success) !important;
  font-weight: 800;
}

.records-panel {
  display: grid;
  gap: 18px;
}

.search-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.search-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
}

.records-summary,
.muted-text,
.empty-state {
  color: var(--muted);
}

.records-list,
.consultations-list {
  display: grid;
  gap: 14px;
}

.patient-record {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.patient-record-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.patient-record h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.record-actions .primary-button,
.record-actions .secondary-button {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.comparison-target:not(:empty) {
  margin-bottom: 14px;
}

.comparison-box {
  padding: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}

.comparison-box h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.comparison-box p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.comparison-grid div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #ffffff;
}

.comparison-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.consultation-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.consultation-item summary {
  display: grid;
  gap: 6px;
  cursor: pointer;
  font-weight: 800;
}

.consultation-item p {
  margin: 12px 0 0;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 1040px);
    padding: 28px 0;
  }

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

  .score-preview {
    top: 8px;
    min-height: 58px;
  }

  .neuro-scorebar {
    grid-template-columns: repeat(5, minmax(118px, 1fr));
    overflow-x: auto;
  }

  .profile-score-pill {
    min-height: 66px;
    padding: 10px;
  }

  .result-details {
    overflow-x: auto;
  }

  .neuro-result-table {
    min-width: 640px;
  }

  .form-panel,
  .result-panel,
  .question-block {
    padding: 16px;
  }

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

  .welcome-form {
    grid-template-columns: 1fr;
  }

  .welcome-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .corner-links {
    position: static;
    width: min(100% - 24px, 1040px);
    margin: 12px auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .home-dashboard {
    padding-top: 100px;
  }

  .mac-taskbar {
    top: 10px;
    width: calc(100% - 20px);
    grid-template-columns: 1fr;
    gap: 8px;
    border-radius: 16px;
  }

  .mac-window-controls {
    justify-content: center;
    padding-left: 0;
  }

  .mac-taskbar-title {
    text-align: center;
  }

  .mac-nav {
    grid-template-columns: 1fr;
  }

  .mac-nav-button {
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .home-welcome {
    min-height: calc(100vh - 100px);
    width: min(100% - 24px, 1040px);
    padding-top: 20px;
  }

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

  .actions {
    flex-direction: column-reverse;
  }

  .download-actions {
    flex-direction: column;
  }

  .intro-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .test-list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .frequency-row {
    grid-template-columns: 1fr;
  }

  .frequency-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .patient-record-header,
  .record-actions,
  .comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

/* Optional reversible Material Design lilac skin. */
body.material-lilac-theme {
  --bg: #f7f2fa;
  --surface: #fffbfe;
  --surface-strong: #f3edf7;
  --text: #1d1b20;
  --muted: #625b71;
  --line: #cac4d0;
  --primary: #6750a4;
  --primary-dark: #4f378b;
  --accent: #7d5260;
  --success: #386a20;
  --shadow: 0 10px 28px rgba(73, 54, 95, 0.14);
  color: #1d1b20;
  background: #f7f2fa !important;
}

body.material-lilac-theme::before {
  opacity: 0.35;
  background-image: linear-gradient(rgba(103, 80, 164, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(103, 80, 164, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

body.material-lilac-theme .mac-taskbar,
body.material-lilac-theme .home-welcome-window,
body.material-lilac-theme .login-card,
body.material-lilac-theme .intro,
body.material-lilac-theme .patient-login-card,
body.material-lilac-theme .test-picker-card,
body.material-lilac-theme .form-panel,
body.material-lilac-theme .result-panel,
body.material-lilac-theme .question-block,
body.material-lilac-theme .score-preview,
body.material-lilac-theme .notes-panel,
body.material-lilac-theme .chat-window,
body.material-lilac-theme .chat-sidebar,
body.material-lilac-theme .chat-panel,
body.material-lilac-theme .chat-personal-panel,
body.material-lilac-theme .sql-sidebar,
body.material-lilac-theme .sql-results,
body.material-lilac-theme .admin-card,
body.material-lilac-theme .consultador-card,
body.material-lilac-theme .home-modal-card {
  color: #1d1b20;
  border-color: #cac4d0 !important;
  background: #fffbfe !important;
  box-shadow: 0 10px 28px rgba(73, 54, 95, 0.14) !important;
  backdrop-filter: none;
}

body.material-lilac-theme .mac-taskbar,
body.material-lilac-theme .chat-sidebar {
  background: #f3edf7 !important;
}

body.material-lilac-theme .mac-taskbar-title,
body.material-lilac-theme h1,
body.material-lilac-theme h2,
body.material-lilac-theme h3,
body.material-lilac-theme .question-title,
body.material-lilac-theme .test-list-item strong {
  color: #1d1b20 !important;
}

body.material-lilac-theme .eyebrow,
body.material-lilac-theme .welcome-title-user,
body.material-lilac-theme .profile-score-pill,
body.material-lilac-theme .chat-typing-status {
  color: #6750a4 !important;
}

body.material-lilac-theme .intro-text,
body.material-lilac-theme .muted-text,
body.material-lilac-theme label,
body.material-lilac-theme small,
body.material-lilac-theme time {
  color: #625b71;
}

body.material-lilac-theme button,
body.material-lilac-theme .primary-button,
body.material-lilac-theme .secondary-button,
body.material-lilac-theme .page-link-button,
body.material-lilac-theme .link-button,
body.material-lilac-theme .mac-nav-button,
body.material-lilac-theme .test-list-item,
body.material-lilac-theme .chat-file-actions a,
body.material-lilac-theme .chat-history-open {
  border-color: #79747e;
  border-radius: 20px;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.material-lilac-theme .primary-button,
body.material-lilac-theme button[type="submit"],
body.material-lilac-theme .chat-personal-tab.is-active,
body.material-lilac-theme .chat-days-list button.is-active {
  color: #ffffff !important;
  border-color: #6750a4 !important;
  background: #6750a4 !important;
  box-shadow: 0 4px 12px rgba(103, 80, 164, 0.28) !important;
}

body.material-lilac-theme .secondary-button,
body.material-lilac-theme .page-link-button,
body.material-lilac-theme .link-button,
body.material-lilac-theme .mac-nav-button,
body.material-lilac-theme .chat-history-button,
body.material-lilac-theme .chat-panel-toggle,
body.material-lilac-theme .chat-attach-button {
  color: #6750a4 !important;
  border-color: #79747e !important;
  background: #fffbfe !important;
}

body.material-lilac-theme button:hover,
body.material-lilac-theme .page-link-button:hover,
body.material-lilac-theme .mac-nav-button:hover {
  background: #eaddff !important;
  color: #21005d !important;
}

body.material-lilac-theme input,
body.material-lilac-theme textarea,
body.material-lilac-theme select {
  color: #1d1b20 !important;
  border: 1px solid #79747e !important;
  border-radius: 12px !important;
  background: #fffbfe !important;
}

body.material-lilac-theme input:focus,
body.material-lilac-theme textarea:focus,
body.material-lilac-theme select:focus {
  border-color: #6750a4 !important;
  box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.18) !important;
  outline: 0;
}

body.material-lilac-theme .option-content,
body.material-lilac-theme .frequency-option,
body.material-lilac-theme .option-pair,
body.material-lilac-theme .test-list-item,
body.material-lilac-theme .chat-message,
body.material-lilac-theme .chat-file-card,
body.material-lilac-theme .chat-personal-file,
body.material-lilac-theme .chat-day-reader,
body.material-lilac-theme .chat-days-list button,
body.material-lilac-theme tbody tr {
  border-color: #cac4d0 !important;
  background: #f7f2fa !important;
}

body.material-lilac-theme th,
body.material-lilac-theme thead {
  color: #21005d !important;
  background: #eaddff !important;
}

body.material-lilac-theme .theme-toggle-button,
body.material-lilac-theme .floating-home-button,
body.material-lilac-theme .floating-scroll-top-button {
  color: #ffffff !important;
  border-color: #6750a4 !important;
  background: #6750a4 !important;
}

body.material-lilac-theme .material-style-button {
  color: #ffffff !important;
  border-color: #6750a4 !important;
  background: #6750a4 !important;
}

body.material-lilac-theme.genia-dark-theme {
  --bg: #1d1b20;
  --surface: #211f26;
  --surface-strong: #2b2930;
  --text: #e6e1e5;
  --muted: #cac4d0;
  --line: #49454f;
  color: #e6e1e5;
  background: #1d1b20 !important;
}

body.material-lilac-theme.genia-dark-theme .mac-taskbar,
body.material-lilac-theme.genia-dark-theme .home-welcome-window,
body.material-lilac-theme.genia-dark-theme .login-card,
body.material-lilac-theme.genia-dark-theme .intro,
body.material-lilac-theme.genia-dark-theme .patient-login-card,
body.material-lilac-theme.genia-dark-theme .test-picker-card,
body.material-lilac-theme.genia-dark-theme .form-panel,
body.material-lilac-theme.genia-dark-theme .result-panel,
body.material-lilac-theme.genia-dark-theme .question-block,
body.material-lilac-theme.genia-dark-theme .chat-window,
body.material-lilac-theme.genia-dark-theme .chat-sidebar,
body.material-lilac-theme.genia-dark-theme .chat-panel,
body.material-lilac-theme.genia-dark-theme .chat-personal-panel,
body.material-lilac-theme.genia-dark-theme .home-modal-card {
  color: #e6e1e5;
  border-color: #49454f !important;
  background: #211f26 !important;
}

body.material-lilac-theme.genia-dark-theme h1,
body.material-lilac-theme.genia-dark-theme h2,
body.material-lilac-theme.genia-dark-theme h3,
body.material-lilac-theme.genia-dark-theme .question-title {
  color: #e6e1e5 !important;
}

body.material-lilac-theme.genia-dark-theme input,
body.material-lilac-theme.genia-dark-theme textarea,
body.material-lilac-theme.genia-dark-theme select,
body.material-lilac-theme.genia-dark-theme .secondary-button,
body.material-lilac-theme.genia-dark-theme .page-link-button,
body.material-lilac-theme.genia-dark-theme .mac-nav-button {
  color: #e6e1e5 !important;
  border-color: #938f99 !important;
  background: #2b2930 !important;
}

.chat-days-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
  gap: 14px;
}

.chat-days-list {
  min-height: 0;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-days-list button {
  width: 100%;
  min-height: 58px;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 11px;
  color: #17202a;
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  text-align: left;
}

.chat-days-list button span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-days-list button.is-active {
  color: #ffffff;
  border-color: #007aff;
  background: #075ab8;
}

.chat-days-list button.is-active span {
  color: #dbeafe;
}

.chat-day-reader {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.chat-day-reader > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.chat-day-reader h3 {
  margin: 0;
  font-size: 1.05rem;
  text-transform: capitalize;
}

.chat-day-reader > header span {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 800;
}

.chat-day-messages {
  padding: 4px;
}

body.genia-dark-theme.chat-page .chat-day-reader,
body.genia-dark-theme.chat-page .chat-days-list button {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.20);
  background: rgba(15, 23, 42, 0.72);
}

body.genia-dark-theme.chat-page .chat-days-list button.is-active {
  color: #ffffff;
  border-color: #60a5fa;
  background: #075ab8;
}

@media (max-width: 760px) {
  .chat-days-overlay {
    padding: 10px;
  }

  .chat-days-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }

  .chat-days-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(145px, 42vw);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 5px;
  }

  .chat-days-list button {
    min-height: 52px;
  }

  .chat-day-reader {
    padding: 8px;
  }

  .chat-day-reader > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

/* Minimal chat layout with an independent navigation sidebar. */
.chat-page .chat-shell {
  padding: clamp(10px, 2vw, 22px);
}

.chat-page .chat-window {
  width: min(1480px, 100%);
  max-height: none;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.chat-sidebar {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px 14px 14px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 16px;
  background: rgba(246, 248, 252, 0.88);
  overflow: hidden;
}

.chat-page .chat-header {
  display: block;
}

.chat-page .chat-header h1 {
  margin: 2px 0 0;
  font-size: 2rem;
}

.chat-sidebar-menu {
  display: grid;
  gap: 7px;
}

.chat-sidebar-menu > * {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 0 12px;
  border-radius: 10px;
  text-align: left;
}

.chat-page .chat-layout,
.chat-page .chat-layout.is-personal-collapsed {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.chat-page .chat-panel {
  gap: 8px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
}

.chat-page .chat-channel-heading {
  min-height: 48px;
}

.chat-page .chat-channel-heading h2 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.chat-page .chat-messages {
  padding: 6px 8px;
}

.chat-page .chat-message {
  max-width: min(760px, 92%);
}

.chat-page .chat-message:nth-child(even) {
  justify-self: end;
}

.chat-page .chat-personal-panel {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.chat-page .chat-personal-panel.is-collapsed {
  align-self: end;
}

.chat-menu-button,
.chat-sidebar-backdrop {
  display: none;
}

body.genia-dark-theme.chat-page .chat-sidebar {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.84);
}

@media (max-width: 760px) {
  .chat-page .chat-shell {
    padding: 0;
  }

  .chat-page .chat-window {
    width: 100%;
    height: 100%;
    display: block;
    padding: 6px;
    border: 0;
    border-radius: 0;
    background: rgba(248, 250, 253, 0.94);
  }

  .chat-menu-button {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: 12px;
    z-index: 45;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 50%;
    color: #075ab8;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    font-size: 1.15rem;
  }

  .chat-sidebar-backdrop {
    position: absolute;
    inset: 0;
    z-index: 48;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(2px);
  }

  .chat-sidebar-backdrop[hidden] {
    display: none;
  }

  .chat-sidebar {
    position: absolute;
    inset: 6px auto 6px 6px;
    z-index: 50;
    width: min(84vw, 310px);
    padding: 20px 14px 14px;
    border-radius: 18px;
    box-shadow: 18px 0 44px rgba(15, 23, 42, 0.22);
    transform: translateX(calc(-100% - 18px));
    transition: transform 220ms ease;
  }

  .chat-sidebar.is-open {
    transform: translateX(0);
  }

  .chat-page .chat-layout,
  .chat-page .chat-layout.is-personal-collapsed {
    width: 100%;
    height: 100%;
    display: block;
  }

  .chat-page .chat-panel {
    width: 100%;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 8px;
    padding-top: 56px;
    border-radius: 16px;
  }

  .chat-page .chat-channel-heading {
    min-height: 36px;
    display: block;
    padding-left: 2px;
  }

  .chat-page .chat-channel-heading .eyebrow {
    display: none;
  }

  .chat-page .chat-channel-heading h2 {
    font-size: 1.1rem;
  }

  .chat-page .chat-message {
    max-width: 94%;
    padding: 10px 11px;
  }

  .chat-page .chat-message header {
    align-items: flex-start;
  }

  .chat-page .chat-form {
    gap: 6px;
    padding-top: 5px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
  }

  .chat-page .chat-input-label > span:first-child {
    display: none;
  }

  .chat-page .chat-form textarea {
    min-height: 52px;
    max-height: 84px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .chat-page .chat-send-tools {
    min-height: 46px;
  }

  .chat-page .chat-personal-panel,
  .chat-page .chat-personal-panel.is-collapsed {
    min-height: 0;
    align-self: stretch;
  }

  .chat-page .chat-personal-panel.is-collapsed {
    display: flex;
  }

  .chat-page .chat-history-overlay {
    z-index: 70;
  }

  body.genia-dark-theme.chat-page .chat-window {
    background: rgba(7, 17, 31, 0.98);
  }

  body.genia-dark-theme.chat-page .chat-menu-button {
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(15, 23, 42, 0.94);
  }
}

/* Home-only day/night redesign. */
.home-dashboard.home-day {
  color: #111827;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 78% 12%, rgba(191, 219, 254, 0.62), rgba(191, 219, 254, 0) 32%),
    radial-gradient(circle at 50% 92%, rgba(204, 251, 241, 0.52), rgba(204, 251, 241, 0) 36%),
    linear-gradient(145deg, #f8fbff 0%, #eef5ff 46%, #ffffff 100%);
}

.home-dashboard.home-night {
  --text: #f8fafc;
  --muted: #cbd5e1;
  --line: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
  background:
    radial-gradient(circle at 18% 8%, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0) 31%),
    radial-gradient(circle at 82% 16%, rgba(45, 212, 191, 0.14), rgba(45, 212, 191, 0) 30%),
    linear-gradient(145deg, #07111f 0%, #101827 50%, #172033 100%);
}

.home-dashboard.home-night::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  opacity: 0.38;
}

.home-dashboard .mac-taskbar {
  width: min(980px, calc(100% - 28px));
  grid-template-columns: auto auto 1fr;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.home-dashboard.home-night .mac-taskbar {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.68);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.home-dashboard.home-night .mac-taskbar-title {
  color: #e5eefb;
}

.home-dashboard .mac-nav {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.home-dashboard .mac-nav-button {
  border-color: rgba(148, 163, 184, 0.20);
  border-radius: 14px;
  color: #0f4f6d;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.home-dashboard.home-night .mac-nav-button {
  color: #dbeafe;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.76);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.home-dashboard.home-night .mac-nav-button:hover {
  background: rgba(51, 65, 85, 0.86);
}

.home-dashboard .home-welcome {
  min-height: calc(100vh - 76px);
  align-items: center;
}

.home-dashboard .home-welcome-window {
  width: min(920px, 100%);
  padding: clamp(34px, 7vw, 78px);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.66)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.home-dashboard .home-welcome-window::after {
  content: "";
  position: absolute;
  right: clamp(-42px, -3vw, -18px);
  top: clamp(76px, 12vw, 108px);
  width: clamp(180px, 26vw, 310px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.44;
  filter: blur(0.2px);
}

.home-dashboard.home-day .home-welcome-window::after {
  background:
    radial-gradient(circle at 50% 50%, #fff7ad 0 28%, #fbbf24 29% 43%, rgba(251, 191, 36, 0.18) 44% 61%, transparent 62%),
    conic-gradient(from 0deg, transparent 0 8%, rgba(251, 191, 36, 0.34) 8% 12%, transparent 12% 25%, rgba(251, 191, 36, 0.30) 25% 30%, transparent 30% 100%);
  box-shadow: 0 0 80px rgba(251, 191, 36, 0.28);
}

.home-dashboard.home-night .home-welcome-window::after {
  background:
    radial-gradient(circle at 42% 46%, #dbeafe 0 34%, transparent 35%),
    radial-gradient(circle at 58% 36%, rgba(15, 23, 42, 0.92) 0 33%, transparent 34%);
  box-shadow: 0 0 84px rgba(147, 197, 253, 0.22);
  opacity: 0.36;
}

.home-dashboard.home-night .home-welcome-window {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.84), rgba(15, 23, 42, 0.70)),
    rgba(15, 23, 42, 0.76);
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.home-dashboard .home-welcome-window::before {
  height: 76px;
  background:
    linear-gradient(90deg, rgba(0, 122, 255, 0.10), rgba(45, 212, 191, 0.09), rgba(255, 255, 255, 0));
}

.home-dashboard.home-night .home-welcome-window::before {
  background:
    linear-gradient(90deg, rgba(96, 165, 250, 0.16), rgba(45, 212, 191, 0.10), rgba(255, 255, 255, 0));
}

.home-dashboard .home-welcome-window .eyebrow {
  color: #007aff;
}

.home-dashboard.home-night .home-welcome-window .eyebrow {
  color: #93c5fd;
}

.home-dashboard .home-welcome-window h1 {
  display: grid;
  gap: 12px;
  color: #111827;
  font-size: clamp(2.28rem, 5.7vw, 4.75rem);
  letter-spacing: 0;
}

.welcome-title-main,
.welcome-title-user {
  display: block;
}

.welcome-title-main {
  font-weight: 900;
}

.welcome-title-user {
  max-width: 100%;
  color: #007aff;
  font-size: clamp(1.65rem, 4vw, 3.15rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.home-dashboard.home-night .home-welcome-window h1 {
  color: #f8fafc;
}

.home-dashboard.home-night .welcome-title-user {
  color: #93c5fd;
}

.home-dashboard .home-welcome-window .intro-text {
  width: fit-content;
  margin: 24px auto 0;
  padding: 16px 24px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  color: #475569;
  background:
    radial-gradient(circle at 16% 50%, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0) 34%),
    rgba(255, 255, 255, 0.70);
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 800;
}

.home-time-card {
  position: relative;
  display: grid;
  min-width: min(360px, 100%);
  gap: 4px;
  overflow: hidden;
  text-align: center;
}

.home-time-card::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 58px;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.52;
}

.home-dashboard.home-day .home-time-card::before {
  background: radial-gradient(circle, #fde68a 0 38%, #f59e0b 39% 57%, rgba(245, 158, 11, 0.10) 58% 100%);
  box-shadow: 0 0 34px rgba(245, 158, 11, 0.34);
}

.home-dashboard.home-night .home-time-card::before {
  background:
    radial-gradient(circle at 42% 48%, #dbeafe 0 47%, transparent 48%),
    radial-gradient(circle at 58% 38%, rgba(15, 23, 42, 0.96) 0 42%, transparent 43%);
  box-shadow: 0 0 34px rgba(147, 197, 253, 0.22);
  opacity: 0.44;
}

.home-time-card span,
.home-time-card strong {
  position: relative;
}

.home-time-card span {
  color: #64748b;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.home-time-card strong {
  color: #0f172a;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  line-height: 1;
}

.home-dashboard.home-night .home-welcome-window .intro-text {
  color: #dbeafe;
  border-color: rgba(147, 197, 253, 0.18);
  background:
    radial-gradient(circle at 16% 50%, rgba(147, 197, 253, 0.15), rgba(147, 197, 253, 0) 34%),
    rgba(15, 23, 42, 0.42);
}

.home-dashboard.home-night .home-time-card span {
  color: #bfdbfe;
}

.home-dashboard.home-night .home-time-card strong {
  color: #f8fafc;
}

.home-root-sessions {
  width: min(760px, 100%);
  margin: 22px auto 0;
  padding: 14px;
  border: 1px solid rgba(125, 156, 210, 0.28);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 55px rgba(41, 75, 128, 0.12);
  backdrop-filter: blur(18px);
}

.home-dashboard.home-night .home-root-sessions {
  background: rgba(12, 22, 42, 0.62);
  border-color: rgba(155, 184, 230, 0.2);
}

.home-root-sessions-head,
.home-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-root-sessions-head span,
.home-session-item span,
.home-session-item label span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
}

.home-root-sessions-head strong {
  display: block;
  color: #2563eb;
  font-size: 2rem;
}

.home-root-sessions button {
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.8);
  color: #1d4ed8;
  font-weight: 800;
  cursor: pointer;
}

.home-sessions-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.home-session-item {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.74);
}

.home-dashboard.home-night .home-session-item,
.home-dashboard.home-night .home-root-sessions button {
  background: rgba(15, 23, 42, 0.74);
  color: #bfdbfe;
}

.home-session-item strong {
  display: block;
  color: #0f172a;
}

.home-dashboard.home-night .home-session-item strong {
  color: #f8fafc;
}

.home-session-item label {
  display: grid;
  gap: 4px;
  min-width: min(240px, 45vw);
}

.home-session-item input {
  width: 100%;
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-weight: 700;
}

.home-dashboard .home-footer-note {
  color: rgba(36, 49, 61, 0.60);
}

.home-dashboard.home-night .home-footer-note {
  color: rgba(226, 232, 240, 0.66);
}

@media (max-width: 760px) {
  .home-dashboard .mac-taskbar {
    grid-template-columns: 1fr;
  }

  .home-dashboard .mac-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-dashboard .home-welcome-window {
    padding: 30px 22px;
    border-radius: 28px;
  }

  .home-dashboard .home-welcome-window h1 {
    gap: 10px;
  }

  .home-dashboard .home-welcome-window::after {
    right: -68px;
    top: 96px;
    width: 190px;
    opacity: 0.26;
  }

  .home-dashboard .home-welcome-window .intro-text {
    width: 100%;
    border-radius: 18px;
  }

  .home-time-card::before {
    left: 14px;
    width: 46px;
  }
}

/* iCloud-style refresh for the patient test flow and all test pages. */
.patient-login-page,
.test-picker-page,
.sam-page,
.green-theme,
.neuro-page,
.pots-page,
.report-page {
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.68);
  --text: #111827;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --primary: #007aff;
  --primary-dark: #075ab8;
  --success: #0f766e;
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 82% 0%, rgba(191, 219, 254, 0.62), rgba(191, 219, 254, 0) 32%),
    linear-gradient(145deg, #f7f9fd 0%, #eaf0f8 48%, #fbfcff 100%);
}

.green-theme {
  --primary: #34c759;
  --primary-dark: #188038;
  --success: #188038;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 82% 0%, rgba(187, 247, 208, 0.68), rgba(187, 247, 208, 0) 34%),
    linear-gradient(145deg, #f5fff8 0%, #e8f8ee 48%, #fbfffc 100%);
}

.neuro-page {
  --primary: #8b5cf6;
  --primary-dark: #6d28d9;
  --success: #7c3aed;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 82% 0%, rgba(221, 214, 254, 0.76), rgba(221, 214, 254, 0) 34%),
    linear-gradient(145deg, #fbfaff 0%, #efeafd 48%, #ffffff 100%);
}

.pots-page {
  --primary: #0ea5e9;
  --primary-dark: #0369a1;
  --success: #0284c7;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 82% 0%, rgba(186, 230, 253, 0.72), rgba(186, 230, 253, 0) 34%),
    linear-gradient(145deg, #f6fbff 0%, #e8f6ff 48%, #ffffff 100%);
}

.report-page {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #2563eb;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 82% 0%, rgba(191, 219, 254, 0.78), rgba(191, 219, 254, 0) 34%),
    linear-gradient(145deg, #f8fbff 0%, #eaf1ff 48%, #ffffff 100%);
}

.sam-page .app-shell,
.green-theme .app-shell,
.neuro-page .app-shell,
.pots-page .app-shell,
.report-page .app-shell {
  width: min(1120px, calc(100% - 32px));
  padding: clamp(22px, 4vw, 44px) 0;
}

.sam-page .intro,
.green-theme .intro,
.neuro-page .intro,
.pots-page .intro,
.report-page .intro {
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.sam-page .intro h1,
.green-theme .intro h1,
.neuro-page .intro h1,
.pots-page .intro h1,
.report-page .intro h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  white-space: normal;
}

.sam-page .intro-text,
.green-theme .intro-text,
.neuro-page .intro-text,
.pots-page .intro-text,
.report-page .intro-text {
  max-width: 780px;
  color: #526173;
}

.sam-page .intro-actions,
.green-theme .intro-actions,
.neuro-page .intro-actions,
.pots-page .intro-actions,
.report-page .intro-actions {
  margin-top: 18px;
}

.page-link-button,
.primary-button,
.secondary-button {
  border-radius: 999px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.page-link-button {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.page-link-button:hover,
.secondary-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 26px rgba(0, 122, 255, 0.20);
}

.secondary-button {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.score-preview,
.form-panel,
.result-panel,
.question-block,
.reference-figure,
.notes-panel {
  border-color: rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.form-panel,
.result-panel {
  padding: clamp(18px, 3vw, 30px);
}

.score-preview {
  top: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
}

.score-preview strong {
  color: var(--primary-dark);
}

.patient-grid,
.info-grid,
.report-vitals-grid {
  gap: 12px;
}

.patient-grid label,
.info-grid label,
.report-section label,
.report-wide-field,
.search-field,
.mini-radio {
  color: #526173;
}

.patient-grid input,
.patient-grid select,
.info-grid input,
.info-grid textarea,
.report-section input,
.report-section textarea,
.patient-login-form input,
.search-field input {
  min-height: 50px;
  border-color: rgba(148, 163, 184, 0.30);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  outline: none;
}

.patient-grid input:focus,
.patient-grid select:focus,
.info-grid input:focus,
.info-grid textarea:focus,
.report-section input:focus,
.report-section textarea:focus,
.search-field input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.questions {
  gap: 16px;
}

.question-block {
  padding: clamp(16px, 2.4vw, 24px);
}

.question-title,
.report-section h2,
.info-block h2 {
  color: #1f2937;
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  text-align: center;
}

.option-content,
.frequency-option,
.option-pair,
.mini-radio,
.report-preview-card,
.report-preview-fields div,
.criteria-box {
  border-color: rgba(148, 163, 184, 0.26);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.option input:checked + .option-content,
.frequency-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 62%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 15%, white), #ffffff);
  color: var(--primary-dark);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--primary) 18%, transparent);
}

.frequency-option:has(input:checked) {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #ffffff;
}

.option-points {
  color: var(--primary-dark);
  background: color-mix(in srgb, var(--primary) 16%, white);
}

.profile-score-pill {
  border-color: rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.test-picker-shell,
.patient-login-shell {
  padding: clamp(18px, 4vw, 38px);
}

.patient-login-card,
.test-picker-card {
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.patient-login-orb {
  border-radius: 24px;
  background: linear-gradient(145deg, #f8fafc, #dbeafe);
  color: #0f172a;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.14);
}

.test-picker-page .test-list-item {
  border-color: rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.test-picker-page .test-list-item b {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

@media (max-width: 760px) {
  .sam-page .app-shell,
  .green-theme .app-shell,
  .neuro-page .app-shell,
  .pots-page .app-shell,
  .report-page .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 18px 0 28px;
  }

  .sam-page .intro,
  .green-theme .intro,
  .neuro-page .intro,
  .pots-page .intro,
  .report-page .intro,
  .form-panel,
  .result-panel {
    border-radius: 22px;
  }

  .intro-actions,
  .actions,
  .download-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .score-preview {
    align-items: center;
    border-radius: 18px;
  }

  .patient-login-card,
  .test-picker-card {
    padding: 24px;
    border-radius: 26px;
  }

  .test-picker-page .test-list-item {
    min-height: auto;
    border-radius: 20px;
  }
}

/* Final responsive and home celestial polish. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

.home-dashboard .home-welcome-window {
  display: grid;
  place-items: center;
  isolation: isolate;
}

.home-dashboard .home-welcome-window > * {
  z-index: 1;
}

.home-dashboard .home-welcome-window::after {
  right: clamp(18px, 5vw, 72px);
  top: 50%;
  width: clamp(170px, 22vw, 270px);
  opacity: 0.30;
  transform: translateY(-46%);
  z-index: 0;
}

.home-dashboard.home-day .home-welcome-window::after {
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.96) 0 7%, transparent 8%),
    radial-gradient(circle at 62% 64%, rgba(251, 146, 60, 0.34) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 50%, #fff7ad 0 29%, #fbbf24 30% 45%, rgba(251, 191, 36, 0.30) 46% 58%, transparent 59%),
    conic-gradient(from 8deg, rgba(251, 191, 36, 0.10), rgba(251, 191, 36, 0.36) 8%, transparent 13%, transparent 24%, rgba(251, 191, 36, 0.28) 30%, transparent 36%, transparent 100%);
  box-shadow:
    0 0 54px rgba(251, 191, 36, 0.38),
    0 0 110px rgba(251, 191, 36, 0.18);
}

.home-dashboard.home-night .home-welcome-window::after {
  background:
    radial-gradient(circle at 31% 32%, rgba(241, 245, 249, 0.34) 0 4%, transparent 5%),
    radial-gradient(circle at 58% 62%, rgba(148, 163, 184, 0.30) 0 6%, transparent 7%),
    radial-gradient(circle at 45% 52%, #d6dee9 0 38%, #9aa8ba 39% 50%, rgba(148, 163, 184, 0.22) 51% 60%, transparent 61%),
    radial-gradient(circle at 62% 42%, rgba(15, 23, 42, 0.92) 0 32%, transparent 33%);
  box-shadow:
    inset -22px -18px 32px rgba(15, 23, 42, 0.24),
    0 0 66px rgba(147, 197, 253, 0.18);
  opacity: 0.28;
}

.home-dashboard .home-welcome-window h1 {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: center;
}

.home-dashboard .home-welcome-window .eyebrow {
  margin-bottom: 18px;
  text-align: center;
}

.welcome-title-main {
  text-wrap: balance;
}

.welcome-title-user {
  text-align: center;
  text-wrap: balance;
}

.home-time-card {
  align-items: center;
  justify-items: center;
  padding-left: 86px !important;
  padding-right: 30px !important;
}

.home-time-card::before {
  left: 24px;
  width: 48px;
}

.home-dashboard.home-day .home-time-card::before {
  background:
    radial-gradient(circle at 37% 34%, rgba(255, 255, 255, 0.95) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, #fff3a4 0 35%, #f59e0b 36% 58%, rgba(245, 158, 11, 0.14) 59% 100%);
}

.home-dashboard.home-night .home-time-card::before {
  background:
    radial-gradient(circle at 30% 32%, rgba(255, 255, 255, 0.36) 0 5%, transparent 6%),
    radial-gradient(circle at 56% 62%, rgba(148, 163, 184, 0.35) 0 7%, transparent 8%),
    radial-gradient(circle at 45% 52%, #dbe4f0 0 48%, #8da0b8 49% 62%, transparent 63%),
    radial-gradient(circle at 62% 40%, rgba(15, 23, 42, 0.96) 0 42%, transparent 43%);
}

.patient-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.patient-grid label:nth-child(2) {
  grid-column: span 2;
}

.report-vitals-grid,
.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.frequency-row {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.15fr);
}

.frequency-options {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.table-wrap,
.result-details,
.neuro-result-table {
  max-width: 100%;
}

.result-details {
  overflow-x: auto;
}

.neuro-result-table {
  table-layout: fixed;
}

.neuro-result-table th,
.neuro-result-table td {
  overflow-wrap: anywhere;
}

.report-section textarea,
.info-grid textarea {
  min-width: 0;
}

@media (max-width: 1180px) {
  .home-dashboard .mac-taskbar {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .home-dashboard .mac-nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-dashboard .home-welcome {
    padding-top: 72px;
  }
}

@media (max-width: 900px) {
  .frequency-row {
    grid-template-columns: 1fr;
  }

  .patient-grid label:nth-child(2) {
    grid-column: auto;
  }

  .home-dashboard .home-welcome-window::after {
    right: -24px;
    top: 48%;
    width: 190px;
    opacity: 0.18;
  }

  .home-dashboard .home-welcome-window h1 {
    width: 100%;
    font-size: clamp(2rem, 8vw, 3.9rem);
  }
}

@media (max-width: 640px) {
  .home-dashboard {
    padding-top: 0;
  }

  .home-dashboard .mac-taskbar {
    position: static;
    width: calc(100% - 20px);
    margin: 10px auto 0;
    transform: none;
  }

  .home-dashboard .mac-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-dashboard .mac-nav-button {
    min-height: 42px;
    padding: 0 8px;
    white-space: normal;
  }

  .home-dashboard .home-welcome {
    min-height: auto;
    padding: 18px 10px 64px;
  }

  .home-dashboard .home-welcome-window {
    padding: 28px 18px;
  }

  .home-dashboard .home-welcome-window h1 {
    font-size: clamp(2rem, 12vw, 3.25rem);
  }

  .welcome-title-user {
    font-size: clamp(1.45rem, 9vw, 2.25rem);
  }

  .home-dashboard .home-welcome-window::after {
    right: -58px;
    top: 132px;
    width: 170px;
    opacity: 0.14;
  }

  .home-time-card {
    min-width: 0;
    width: 100%;
    padding-left: 70px !important;
    padding-right: 16px !important;
  }

  .home-time-card::before {
    left: 16px;
    width: 40px;
  }

  .options,
  .binary-options,
  .frequency-options,
  .report-radio-row,
  .info-grid,
  .report-vitals-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .home-dashboard .mac-nav {
    grid-template-columns: 1fr;
  }

  .home-dashboard .home-welcome-window h1 {
    font-size: clamp(1.82rem, 13vw, 2.7rem);
  }

  .home-time-card strong {
    font-size: clamp(1.15rem, 10vw, 1.8rem);
  }
}

/* Shared theme toggle and floating test-home control. */
.theme-toggle-button {
  position: fixed;
  top: auto;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 50%;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.theme-toggle-button:hover {
  transform: translateY(-1px);
}

.genia-dark-theme .theme-toggle-button {
  color: #fde68a;
  border-color: rgba(147, 197, 253, 0.20);
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.floating-home-button {
  position: fixed;
  left: 14px;
  top: 50%;
  z-index: 110;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  transform: translateY(-50%);
}

.floating-home-button::before {
  content: "‹";
  margin-right: 6px;
  font-size: 1.35rem;
  line-height: 1;
}

.floating-home-button:hover {
  background: #ffffff;
}

.floating-scroll-top-button {
  position: fixed;
  right: 14px;
  top: 50%;
  z-index: 110;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.floating-scroll-top-button::before {
  content: "\2191";
  margin-right: 6px;
  font-size: 1rem;
  line-height: 1;
}

.floating-scroll-top-button:hover {
  background: #ffffff;
}

.genia-dark-theme.floating-home-button,
.genia-dark-theme .floating-home-button,
.genia-dark-theme .floating-scroll-top-button {
  color: #dbeafe;
  border-color: rgba(147, 197, 253, 0.18);
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

body.genia-dark-theme:not(.home-dashboard) {
  --bg: #0f172a;
  --surface: rgba(15, 23, 42, 0.82);
  --surface-strong: rgba(30, 41, 59, 0.72);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --line: rgba(148, 163, 184, 0.25);
  color: #f8fafc;
  background:
    radial-gradient(circle at 18% 8%, rgba(59, 130, 246, 0.20), rgba(59, 130, 246, 0) 31%),
    radial-gradient(circle at 82% 16%, rgba(45, 212, 191, 0.12), rgba(45, 212, 191, 0) 30%),
    linear-gradient(145deg, #07111f 0%, #101827 50%, #172033 100%);
}

body.genia-dark-theme:not(.home-dashboard) .intro,
body.genia-dark-theme:not(.home-dashboard) .patient-login-card,
body.genia-dark-theme:not(.home-dashboard) .test-picker-card,
body.genia-dark-theme:not(.home-dashboard) .form-panel,
body.genia-dark-theme:not(.home-dashboard) .result-panel,
body.genia-dark-theme:not(.home-dashboard) .question-block,
body.genia-dark-theme:not(.home-dashboard) .score-preview,
body.genia-dark-theme:not(.home-dashboard) .reference-figure,
body.genia-dark-theme:not(.home-dashboard) .notes-panel,
body.genia-dark-theme:not(.home-dashboard) .test-list-item,
body.genia-dark-theme:not(.home-dashboard) .patient-greeting,
body.genia-dark-theme:not(.home-dashboard) .option-content,
body.genia-dark-theme:not(.home-dashboard) .frequency-option,
body.genia-dark-theme:not(.home-dashboard) .option-pair,
body.genia-dark-theme:not(.home-dashboard) .profile-score-pill,
body.genia-dark-theme:not(.home-dashboard) .criteria-box {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.20);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.genia-dark-theme:not(.home-dashboard) .intro-text,
body.genia-dark-theme:not(.home-dashboard) .muted-text,
body.genia-dark-theme:not(.home-dashboard) .test-list-item small,
body.genia-dark-theme:not(.home-dashboard) .patient-login-form label,
body.genia-dark-theme:not(.home-dashboard) .patient-grid label,
body.genia-dark-theme:not(.home-dashboard) .info-grid label,
body.genia-dark-theme:not(.home-dashboard) .report-section label,
body.genia-dark-theme:not(.home-dashboard) .report-wide-field,
body.genia-dark-theme:not(.home-dashboard) .frequency-prompt {
  color: #cbd5e1;
}

body.genia-dark-theme:not(.home-dashboard) h1,
body.genia-dark-theme:not(.home-dashboard) h2,
body.genia-dark-theme:not(.home-dashboard) .question-title,
body.genia-dark-theme:not(.home-dashboard) .report-section h2,
body.genia-dark-theme:not(.home-dashboard) .info-block h2,
body.genia-dark-theme:not(.home-dashboard) .test-list-item strong,
body.genia-dark-theme:not(.home-dashboard) .option-label {
  color: #f8fafc;
}

body.genia-dark-theme:not(.home-dashboard) input,
body.genia-dark-theme:not(.home-dashboard) textarea,
body.genia-dark-theme:not(.home-dashboard) select {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.82);
}

body.genia-dark-theme:not(.home-dashboard) input::placeholder,
body.genia-dark-theme:not(.home-dashboard) textarea::placeholder {
  color: #94a3b8;
}

body.genia-dark-theme:not(.home-dashboard) .secondary-button,
body.genia-dark-theme:not(.home-dashboard) .page-link-button,
body.genia-dark-theme:not(.home-dashboard) .link-button {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.82);
}

@media (max-width: 900px) {
  .theme-toggle-button {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
  }

  .floating-home-button {
    left: 10px;
    padding: 0 11px;
    font-size: 0.82rem;
  }

  .floating-scroll-top-button {
    right: 10px;
    padding: 0 11px;
    font-size: 0.82rem;
  }
}

@media (max-width: 640px) {
  .theme-toggle-button {
    bottom: 68px;
  }

  .floating-home-button {
    top: auto;
    bottom: 16px;
    left: 14px;
    min-height: 40px;
    transform: none;
  }

  .floating-scroll-top-button {
    top: auto;
    right: 14px;
    bottom: 16px;
    min-height: 40px;
    transform: none;
  }
}

/* Keep live score panels following the scroll in test forms. */
html,
body {
  overflow-x: clip;
}

.sam-page .score-preview,
.green-theme .score-preview,
.neuro-page .score-preview,
.pots-page .score-preview {
  position: sticky !important;
  top: 12px;
  z-index: 95;
}

@media (max-width: 640px) {
  .sam-page .score-preview,
  .green-theme .score-preview,
  .neuro-page .score-preview,
  .pots-page .score-preview {
    top: 8px;
  }
}

/* Smooth day/night transition and clean home background. */
body,
.home-dashboard,
.home-dashboard::before,
.mac-taskbar,
.mac-nav-button,
.home-welcome-window,
.home-welcome-window::before,
.home-time-card,
.theme-toggle-button,
.floating-home-button,
.floating-scroll-top-button,
.intro,
.patient-login-card,
.test-picker-card,
.form-panel,
.result-panel,
.question-block,
.score-preview,
.option-content,
.frequency-option,
input,
textarea,
select,
button,
a {
  transition:
    background-color 520ms ease,
    background 520ms ease,
    color 520ms ease,
    border-color 520ms ease,
    box-shadow 520ms ease,
    opacity 360ms ease,
    transform 180ms ease;
}

.genia-theme-changing body {
  animation: genia-theme-wash 680ms ease both;
}

@keyframes genia-theme-wash {
  0% {
    filter: saturate(1) brightness(1);
  }
  45% {
    filter: saturate(1.14) brightness(1.08);
  }
  100% {
    filter: saturate(1) brightness(1);
  }
}

.home-dashboard .home-welcome-window::after,
.home-dashboard.home-day .home-welcome-window::after,
.home-dashboard.home-night .home-welcome-window::after,
.home-time-card::before,
.home-dashboard.home-day .home-time-card::before,
.home-dashboard.home-night .home-time-card::before {
  display: none !important;
}

.home-dashboard .home-welcome-window .intro-text,
.home-dashboard.home-night .home-welcome-window .intro-text {
  padding-left: 24px;
  background: rgba(255, 255, 255, 0.70);
}

.home-dashboard.home-night .home-welcome-window .intro-text {
  background: rgba(15, 23, 42, 0.42);
}

.floating-home-button::before {
  content: "\2039";
}

/* Internal chat page. */
.chat-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 82% 0%, rgba(191, 219, 254, 0.62), rgba(191, 219, 254, 0) 32%),
    linear-gradient(145deg, #f7f9fd 0%, #eaf0f8 48%, #fbfcff 100%);
}

.chat-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 42px);
}

.chat-window {
  position: relative;
  width: min(1120px, 100%);
  height: 100%;
  min-height: 0;
  max-height: 920px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(22px);
}

.chat-header,
.chat-channel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chat-header h1 {
  font-size: clamp(2.2rem, 6vw, 4.3rem);
  white-space: normal;
}

.chat-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chat-layout {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
}

.chat-layout.is-personal-collapsed {
  grid-template-columns: minmax(0, 1fr) 54px;
}

.chat-tab {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.chat-tab.is-active {
  color: #ffffff;
  border-color: #007aff;
  background: linear-gradient(180deg, #007aff, #075ab8);
  box-shadow: 0 14px 28px rgba(0, 122, 255, 0.18);
}

.chat-panel {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: clamp(14px, 2.2vw, 22px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
}

.chat-drop-overlay {
  position: absolute;
  inset: 10px;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  border: 2px dashed #007aff;
  border-radius: 18px;
  color: #075ab8;
  background: rgba(239, 246, 255, 0.96);
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.20);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

.chat-drop-overlay strong {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
}

.chat-drop-overlay span {
  color: #526173;
  font-size: 0.88rem;
  font-weight: 700;
}

.chat-panel.is-dragging-file .chat-drop-overlay {
  opacity: 1;
  transform: scale(1);
}

.chat-personal-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: clamp(14px, 2.2vw, 20px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.chat-personal-topbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.chat-panel-toggle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 50%;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 220ms ease, background 220ms ease;
}

.chat-personal-panel.is-collapsed {
  padding: 10px 8px;
}

.chat-personal-panel.is-collapsed .chat-panel-toggle {
  transform: rotate(180deg);
}

.chat-personal-panel.is-collapsed .chat-personal-heading,
.chat-personal-panel.is-collapsed .chat-personal-body {
  display: none;
}

.chat-personal-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}

.chat-personal-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.chat-personal-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chat-personal-tab {
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
}

.chat-personal-tab.is-active {
  color: #ffffff;
  border-color: #007aff;
  background: linear-gradient(180deg, #007aff, #075ab8);
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.16);
}

.chat-history-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 12px;
  color: #075ab8;
  background: rgba(239, 246, 255, 0.76);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
}

.chat-history-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: clamp(18px, 3vw, 30px);
  border-radius: inherit;
  background: rgba(247, 250, 255, 0.96);
  backdrop-filter: blur(24px);
}

.chat-history-overlay[hidden] {
  display: none;
}

.chat-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chat-history-header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.chat-history-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 2px 6px 12px 2px;
}

.chat-history-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 132px minmax(68px, auto) 36px;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.chat-history-preview {
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #eef4fb;
  text-decoration: none;
}

.chat-history-preview img,
.chat-history-preview embed,
.chat-history-preview iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
  border: 0;
}

.chat-history-file-type {
  width: 72px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(180deg, #3b82f6, #075ab8);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
  font-size: 0.9rem;
  font-weight: 900;
}

.chat-history-meta {
  min-width: 0;
}

.chat-history-meta strong,
.chat-history-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history-meta span {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-history-open {
  display: grid;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.chat-personal-files {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.chat-personal-file {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 16px;
  background: rgba(239, 246, 255, 0.70);
}

.chat-personal-file strong,
.chat-personal-file span {
  display: block;
  overflow-wrap: anywhere;
}

.chat-personal-file span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.chat-personal-file a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 999px;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.chat-channel-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.chat-header-actions,
.chat-document-tools,
.chat-upload-form,
.chat-reference-tool {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.chat-document-tools {
  justify-content: space-between;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.chat-upload-strip {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.chat-upload-strip label {
  display: grid;
  gap: 5px;
  min-width: min(340px, 100%);
  color: #526173;
  font-size: 0.78rem;
  font-weight: 900;
}

.chat-upload-strip input {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #111827;
  font: inherit;
}

.chat-upload-form {
  display: none;
}

.chat-documents-active .chat-upload-form {
  display: flex;
}

.chat-document-tools label {
  display: grid;
  gap: 5px;
  min-width: min(300px, 100%);
  color: #526173;
  font-size: 0.78rem;
  font-weight: 900;
}

.chat-document-tools input,
.chat-document-tools select {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #111827;
  font: inherit;
}

.chat-messages {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 8px;
}

.chat-typing-status {
  min-height: 22px;
  margin: -6px 8px 0;
  color: #2563eb;
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-typing-status[hidden] {
  display: block !important;
  visibility: hidden;
}

.chat-message,
.chat-empty {
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.chat-message header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.chat-message time,
.chat-empty {
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 800;
}

.chat-message p {
  margin: 0;
  color: #17202a;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.chat-file-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.20);
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.78);
}

.chat-file-preview {
  position: relative;
  width: min(320px, 100%);
  height: 170px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.20);
  border-radius: 10px;
  background: #eaf2fc;
}

.chat-file-preview img,
.chat-file-preview iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: cover;
  pointer-events: none;
}

.chat-file-preview.is-pdf span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #ffffff;
  background: #dc2626;
  font-size: 0.72rem;
  font-weight: 900;
}

.chat-file-card strong,
.chat-file-card span {
  display: block;
}

.chat-file-card span,
.chat-file-events {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 800;
}

.chat-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-file-actions a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 999px;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.chat-file-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-file-events span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.chat-send-tools {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.chat-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.chat-attach-button {
  width: 52px;
  min-width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.30);
  border-radius: 50%;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.10);
  cursor: pointer;
  font: inherit;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1;
}

.chat-attach-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.chat-enter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #526173;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}

.chat-enter-toggle input {
  width: 17px;
  height: 17px;
  accent-color: #007aff;
}

.chat-input-label {
  display: grid;
  gap: 7px;
  color: #526173;
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-message-field {
  position: relative;
  display: block;
  min-width: 0;
}

.chat-message-field textarea {
  width: 100%;
}

.chat-mention-suggestions {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 7px);
  z-index: 25;
  width: min(390px, calc(100% - 16px));
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.chat-mention-suggestions[hidden] {
  display: none;
}

.chat-mention-suggestions button {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: #17202a;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.chat-mention-suggestions button:hover,
.chat-mention-suggestions button[aria-selected="true"] {
  color: #075ab8;
  background: #eaf3ff;
}

.chat-mention-suggestions span {
  overflow: hidden;
  color: #64748b;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-input-area {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.chat-mention-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #526173;
  font-size: 0.8rem;
  font-weight: 800;
}

.chat-mention-picker[hidden] {
  display: none !important;
}

.chat-mention-picker select {
  width: min(250px, 100%);
  min-height: 34px;
  padding: 0 34px 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.30);
  border-radius: 10px;
  color: #111827;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
}

.chat-mention-chip {
  width: fit-content;
  display: inline-flex;
  margin: 0 0 7px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #075ab8;
  background: #dbeafe;
  font-size: 0.8rem;
  font-weight: 900;
}

.mac-nav-button.has-chat-mention {
  position: relative;
  color: #7c2d12;
  border-color: #f59e0b;
  background: #fef3c7;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.mac-nav-button.has-chat-mention::after {
  content: "@";
  position: absolute;
  top: -9px;
  right: -8px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  background: #e11d48;
  font-size: 0.8rem;
  font-weight: 900;
}

.chat-form textarea {
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.30);
  border-radius: 16px;
  color: #111827;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  resize: vertical;
}

.chat-form .primary-button {
  min-width: 128px;
  min-height: 52px;
}

body.genia-dark-theme.chat-page .chat-window,
body.genia-dark-theme.chat-page .chat-panel,
body.genia-dark-theme.chat-page .chat-personal-panel,
body.genia-dark-theme.chat-page .chat-personal-file,
body.genia-dark-theme.chat-page .chat-message,
body.genia-dark-theme.chat-page .chat-empty {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.20);
  background: rgba(15, 23, 42, 0.72);
}

body.genia-dark-theme.chat-page .chat-history-overlay {
  color: #f8fafc;
  background: rgba(7, 17, 31, 0.96);
}

body.genia-dark-theme.chat-page .chat-history-item,
body.genia-dark-theme.chat-page .chat-history-preview {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.20);
  background: rgba(15, 23, 42, 0.78);
}

body.genia-dark-theme.chat-page .chat-panel-toggle,
body.genia-dark-theme.chat-page .chat-history-button,
body.genia-dark-theme.chat-page .chat-history-open {
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, 0.24);
  background: rgba(30, 41, 59, 0.82);
}

body.genia-dark-theme.chat-page .chat-message p,
body.genia-dark-theme.chat-page .chat-header h1,
body.genia-dark-theme.chat-page .chat-channel-heading h2,
body.genia-dark-theme.chat-page .chat-personal-heading h2 {
  color: #f8fafc;
}

body.genia-dark-theme.chat-page .chat-tab:not(.is-active),
body.genia-dark-theme.chat-page .chat-personal-tab:not(.is-active),
body.genia-dark-theme.chat-page .chat-form textarea,
body.genia-dark-theme.chat-page .chat-attach-button,
body.genia-dark-theme.chat-page .chat-mention-picker select,
body.genia-dark-theme.chat-page .chat-upload-strip input,
body.genia-dark-theme.chat-page .chat-document-tools input,
body.genia-dark-theme.chat-page .chat-document-tools select {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.82);
}

body.genia-dark-theme.chat-page .chat-enter-toggle {
  color: #cbd5e1;
}

body.genia-dark-theme.chat-page .chat-drop-overlay {
  color: #bfdbfe;
  border-color: #60a5fa;
  background: rgba(15, 23, 42, 0.96);
}

body.genia-dark-theme.chat-page .chat-drop-overlay span {
  color: #cbd5e1;
}

body.genia-dark-theme.chat-page .chat-mention-suggestions {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(15, 23, 42, 0.98);
}

body.genia-dark-theme.chat-page .chat-mention-suggestions button {
  color: #f8fafc;
}

body.genia-dark-theme.chat-page .chat-mention-suggestions button:hover,
body.genia-dark-theme.chat-page .chat-mention-suggestions button[aria-selected="true"] {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.22);
}

.chat-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 10020;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.chat-toast {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(96, 165, 250, 0.38);
  border-radius: 16px;
  color: #17202a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(18px);
  text-decoration: none;
  pointer-events: auto;
  animation: chat-toast-in 240ms ease-out both;
}

.chat-toast strong,
.chat-toast span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-toast span {
  color: #64748b;
  font-size: 0.88rem;
}

.chat-toast.is-leaving {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.chat-toast.is-mention {
  border-color: rgba(225, 29, 72, 0.48);
  box-shadow: 0 18px 42px rgba(225, 29, 72, 0.18);
}

body.genia-dark-theme .chat-toast {
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.30);
  background: rgba(15, 23, 42, 0.94);
}

body.genia-dark-theme .chat-toast span {
  color: #cbd5e1;
}

@keyframes chat-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

body.genia-dark-theme.chat-page .chat-document-tools,
body.genia-dark-theme.chat-page .chat-upload-strip,
body.genia-dark-theme.chat-page .chat-file-card {
  border-color: rgba(148, 163, 184, 0.20);
  background: rgba(15, 23, 42, 0.52);
}

body.genia-dark-theme.chat-page .chat-file-actions a,
body.genia-dark-theme.chat-page .chat-personal-file a,
body.genia-dark-theme.chat-page .chat-file-events span {
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, 0.22);
  background: rgba(15, 23, 42, 0.72);
}

body.genia-dark-theme.chat-page .chat-typing-status {
  color: #93c5fd;
}

@media (max-width: 760px) {
  .home-dashboard .mac-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-window {
    width: 100%;
    min-height: 0;
    max-height: none;
    gap: 10px;
    padding: 10px;
    border-radius: 20px;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(132px, 24vh);
    gap: 8px;
  }

  .chat-layout.is-personal-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 54px;
  }

  .chat-personal-panel.is-collapsed {
    display: flex;
    justify-content: flex-start;
    padding: 7px;
  }

  .chat-history-overlay {
    padding: 14px;
    border-radius: 20px;
  }

  .chat-history-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .chat-history-item {
    grid-template-rows: 110px minmax(64px, auto) 36px;
  }

  .chat-header,
  .chat-channel-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chat-shell {
    padding: 8px;
  }

  .chat-header h1 {
    font-size: 2rem;
  }

  .chat-header .eyebrow,
  .chat-channel-heading .eyebrow {
    margin-bottom: 4px;
  }

  .chat-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .chat-header-actions > *,
  .chat-channel-heading .secondary-button {
    width: 100%;
    min-height: 42px;
  }

  .chat-panel,
  .chat-personal-panel {
    padding: 10px;
    border-radius: 18px;
  }

  .chat-form {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chat-mention-picker {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .chat-mention-picker select {
    width: 100%;
  }

  .chat-tabs {
    grid-template-columns: 1fr;
  }

  .chat-document-tools,
  .chat-upload-strip,
  .chat-upload-form,
  .chat-reference-tool,
  .chat-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-form textarea {
    min-height: 60px;
    max-height: 96px;
    resize: none;
  }

  .chat-send-tools {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: stretch;
    gap: 8px;
  }

  .chat-enter-toggle span {
    max-width: none;
  }

  .chat-action-row {
    justify-content: flex-end;
  }

  .chat-attach-button {
    width: 46px;
    min-width: 46px;
    height: 46px;
  }

  .chat-form .primary-button {
    min-width: 96px;
    min-height: 46px;
  }

  .chat-messages {
    padding: 4px;
  }

  .chat-message,
  .chat-empty {
    padding: 11px 12px;
    border-radius: 14px;
  }

  .chat-file-preview {
    width: 100%;
    height: 150px;
  }

  .chat-toast-stack {
    right: 12px;
    bottom: 72px;
    width: calc(100vw - 24px);
  }

  .home-session-item,
  .home-root-sessions-head {
    align-items: stretch;
    flex-direction: column;
  }

  .home-session-item label {
    min-width: 100%;
  }
}

/* Final chat sidebar rules: kept last to override the legacy responsive chat. */
.chat-page .chat-window {
  width: min(1480px, 100%);
  max-height: none;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.chat-page .chat-sidebar {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.chat-page .chat-layout,
.chat-page .chat-layout.is-personal-collapsed {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.chat-page .chat-panel {
  min-width: 0;
}

@media (max-width: 1050px) {
  .chat-page .chat-window {
    display: block;
  }

  .chat-page .chat-menu-button {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 45;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 50%;
    color: #075ab8;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    font-size: 1.15rem;
  }

  .chat-page .chat-sidebar-backdrop {
    position: absolute;
    inset: 0;
    z-index: 48;
    border: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(2px);
  }

  .chat-page .chat-sidebar-backdrop:not([hidden]) {
    display: block;
  }

  .chat-page .chat-sidebar {
    position: absolute;
    inset: 12px auto 12px 12px;
    z-index: 50;
    width: min(360px, calc(100% - 24px));
    padding: 20px 14px 14px;
    border-radius: 18px;
    box-shadow: 18px 0 44px rgba(15, 23, 42, 0.22);
    transform: translateX(calc(-100% - 26px));
    transition: transform 220ms ease;
  }

  .chat-page .chat-sidebar.is-open {
    transform: translateX(0);
  }

  .chat-page .chat-layout,
  .chat-page .chat-layout.is-personal-collapsed {
    width: 100%;
    height: 100%;
    display: block;
  }

  .chat-page .chat-panel {
    width: 100%;
    height: 100%;
    padding-top: 58px;
  }

  body.genia-dark-theme.chat-page .chat-menu-button {
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(15, 23, 42, 0.94);
  }
}

@media (max-width: 760px) {
  .chat-page .chat-shell { padding: 0; }

  .chat-page .chat-window {
    width: 100%;
    height: 100%;
    display: block;
    padding: 6px;
    border: 0;
    border-radius: 0;
  }

  .chat-page .chat-menu-button { display: grid; }
  .chat-page .chat-sidebar-backdrop:not([hidden]) { display: block; }

  .chat-page .chat-sidebar {
    position: absolute;
    inset: 6px auto 6px 6px;
    z-index: 50;
    width: min(84vw, 310px);
    padding: 20px 14px 14px;
    border-radius: 18px;
    transform: translateX(calc(-100% - 18px));
  }

  .chat-page .chat-sidebar.is-open { transform: translateX(0); }

  .chat-page .chat-layout,
  .chat-page .chat-layout.is-personal-collapsed {
    width: 100%;
    height: 100%;
    display: block;
  }

  .chat-page .chat-panel {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 56px 8px 8px;
    border-radius: 16px;
  }

  .chat-page .chat-channel-heading {
    min-height: 36px;
    display: block;
  }

  .chat-page .chat-channel-heading .eyebrow,
  .chat-page .chat-input-label > span:first-child { display: none; }

  .chat-page .chat-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .chat-page .chat-send-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: stretch;
  }

  .chat-page .chat-form textarea {
    min-height: 52px;
    max-height: 84px;
    resize: none;
  }

  .chat-page .chat-message { max-width: 94%; }

  .chat-page .chat-personal-panel,
  .chat-page .chat-personal-panel.is-collapsed {
    min-height: 0;
    align-self: stretch;
  }
}

/* Material lilac final priority for late page-specific rules. */
body.material-lilac-theme.home-dashboard,
body.material-lilac-theme.home-dashboard.home-day,
body.material-lilac-theme.home-dashboard.home-night,
body.material-lilac-theme.chat-page {
  color: #1d1b20 !important;
  background: #f7f2fa !important;
}

body.material-lilac-theme.home-dashboard .mac-taskbar,
body.material-lilac-theme.home-dashboard .home-welcome-window,
body.material-lilac-theme.home-dashboard.home-day .home-welcome-window,
body.material-lilac-theme.home-dashboard.home-night .home-welcome-window,
body.material-lilac-theme.chat-page .chat-window,
body.material-lilac-theme.chat-page .chat-sidebar,
body.material-lilac-theme.chat-page .chat-panel {
  color: #1d1b20 !important;
  border-color: #cac4d0 !important;
  background: #fffbfe !important;
  box-shadow: 0 10px 28px rgba(73, 54, 95, 0.14) !important;
}

body.material-lilac-theme.home-dashboard .home-welcome-window::before,
body.material-lilac-theme.home-dashboard .home-welcome-window::after,
body.material-lilac-theme.home-dashboard .home-time-card::before {
  display: none !important;
}

body.material-lilac-theme.home-dashboard .home-time-card {
  border: 1px solid #cac4d0;
  border-radius: 16px;
  background: #f3edf7;
}

body.material-lilac-theme.home-dashboard .welcome-title-user,
body.material-lilac-theme.home-dashboard .home-time-card strong {
  color: #6750a4 !important;
}

body.material-lilac-theme.genia-dark-theme.home-dashboard,
body.material-lilac-theme.genia-dark-theme.chat-page {
  color: #e6e1e5 !important;
  background: #1d1b20 !important;
}

body.material-lilac-theme.genia-dark-theme.home-dashboard .mac-taskbar,
body.material-lilac-theme.genia-dark-theme.home-dashboard .home-welcome-window,
body.material-lilac-theme.genia-dark-theme.chat-page .chat-window,
body.material-lilac-theme.genia-dark-theme.chat-page .chat-sidebar,
body.material-lilac-theme.genia-dark-theme.chat-page .chat-panel {
  color: #e6e1e5 !important;
  border-color: #49454f !important;
  background: #211f26 !important;
}

.sql-patient-results {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 3px;
}

.sql-patient-result {
  width: 100%;
  min-height: 62px;
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid rgba(20, 108, 148, 0.22);
  border-radius: 12px;
  color: #17202a;
  background: #f7fbff;
  cursor: pointer;
  text-align: left;
}

.sql-patient-result:hover,
.sql-patient-result:focus-visible {
  border-color: #146c94;
  background: #eaf6fb;
  box-shadow: 0 0 0 3px rgba(20, 108, 148, 0.12);
  outline: 0;
}

.sql-patient-result strong,
.sql-patient-result span {
  overflow-wrap: anywhere;
}

.sql-patient-result span,
.sql-patient-loading {
  margin: 0;
  color: #667085;
  font-size: 0.8rem;
  font-weight: 700;
}

.sql-patient-loading {
  padding: 10px 2px;
}

body.material-lilac-theme .sql-patient-result {
  color: #1d1b20;
  border-color: #cac4d0;
  background: #f7f2fa;
}

body.material-lilac-theme .sql-patient-result:hover,
body.material-lilac-theme .sql-patient-result:focus-visible {
  color: #21005d !important;
  border-color: #6750a4 !important;
  background: #eaddff !important;
}

body.genia-dark-theme .sql-patient-result {
  color: #e6e1e5;
  border-color: rgba(148, 163, 184, 0.28);
  background: #2b2930;
}

@media (max-width: 560px) {
  .sql-patient-results {
    max-height: 230px;
  }

  .registered-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Outlook calendar */
.calendar-page { min-height: 100vh; margin: 0; overflow: hidden; background: #eef5fb; color: #172033; }
.calendar-shell { height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 20px; box-sizing: border-box; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 4px 18px; }
.calendar-header h1 { margin: 4px 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; }
.calendar-account { margin: 0; color: #596b80; font-weight: 700; }
.calendar-header-actions, .calendar-editor-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.calendar-workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; border: 1px solid #cbd9e8; background: #fff; box-shadow: 0 18px 44px rgba(31, 57, 82, .1); }
.calendar-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); padding: 18px; }
.calendar-toolbar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.calendar-toolbar h2 { margin: 0 auto 0 8px; text-transform: capitalize; font-size: 22px; }
.calendar-icon-button { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1px solid #b8c8da; border-radius: 50%; background: #fff; color: #12689a; font: 700 28px/1 Arial, sans-serif; cursor: pointer; }
.calendar-status { min-height: 22px; margin: 14px 0 8px; color: #64758a; font-weight: 700; }
.calendar-status.is-error { color: #b42318; }
.calendar-event-list { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 8px; padding-right: 5px; }
.calendar-event { width: 100%; display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; padding: 14px; border: 1px solid #d4dfeb; border-left: 4px solid #1780b4; border-radius: 6px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.calendar-event:hover { background: #f3f8fc; border-color: #9bbbd1; }
.calendar-event time, .calendar-event span { min-width: 0; display: grid; gap: 4px; }
.calendar-event time { color: #52667d; text-transform: capitalize; }
.calendar-event small { overflow: hidden; color: #68798c; text-overflow: ellipsis; white-space: nowrap; }
.calendar-empty { padding: 48px 20px; border: 1px dashed #bdcad8; color: #64758a; text-align: center; }
.calendar-editor { min-height: 0; overflow: auto; padding: 22px; border-left: 1px solid #d6e0ea; background: #f8fbfd; }
.calendar-editor form { display: grid; gap: 16px; }
.calendar-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-editor-heading h2 { margin: 0; font-size: 24px; }
.calendar-editor label { display: grid; gap: 7px; color: #3c4f65; font-weight: 800; }
.calendar-editor input, .calendar-editor textarea { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid #afc0d2; border-radius: 6px; background: #fff; color: #172033; font: inherit; resize: vertical; }
.calendar-danger-button { min-height: 44px; padding: 0 18px; border: 1px solid #d92d20; border-radius: 6px; background: #fff; color: #b42318; font: inherit; font-weight: 800; cursor: pointer; }
body.luna-xp-theme.calendar-page .calendar-workspace,
body.luna-xp-theme.calendar-page .calendar-editor,
body.luna-xp-theme.calendar-page .calendar-event,
body.luna-xp-theme.outlook-config-page .outlook-config-card {
  color: #000 !important;
  border-color: #0054e3 !important;
  background: #ece9d8 !important;
  box-shadow: 3px 4px 10px rgba(0, 32, 96, .34) !important;
}
body.luna-xp-theme.calendar-page .calendar-toolbar,
body.luna-xp-theme.calendar-page .calendar-header { color: #fff; }
body.luna-xp-theme.calendar-page .calendar-account { color: #eaf3ff; }
body.luna-xp-theme.calendar-page .calendar-main { background: #f7f5e9; }
body.luna-xp-theme.calendar-page .calendar-event:hover { background: #fff !important; }
body.luna-xp-theme.calendar-page .calendar-icon-button { border-radius: 3px; }
@media (max-width: 900px) {
  .calendar-page { overflow: auto; }
  .calendar-shell { min-height: 100vh; height: auto; padding: 12px; }
  .calendar-header { align-items: flex-start; }
  .calendar-workspace { grid-template-columns: 1fr; min-height: 70vh; }
  .calendar-editor { position: fixed; inset: 0; z-index: 50; display: none; border: 0; padding: 24px; }
  .calendar-editor.is-open { display: block; }
}
@media (max-width: 600px) {
  .calendar-header { display: grid; }
  .calendar-header-actions { width: 100%; }
  .calendar-header-actions > * { flex: 1; justify-content: center; }
  .calendar-toolbar { flex-wrap: wrap; }
  .calendar-toolbar h2 { order: -1; width: 100%; margin: 0 0 6px; }
  .calendar-toolbar .primary-button { margin-left: auto; }
  .calendar-event { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
}

/* Reversible Windows XP Luna skin. */
body.luna-xp-theme {
  --bg: #3a78c2;
  --surface: #ece9d8;
  --surface-strong: #f7f5e9;
  --text: #000000;
  --muted: #4b4b4b;
  --line: #7f9db9;
  --primary: #245edb;
  --primary-dark: #003caa;
  --accent: #3c8f2f;
  --success: #2f7d21;
  --shadow: 3px 4px 10px rgba(0, 32, 96, 0.34);
  color: #000000;
  background: linear-gradient(155deg, #64a7e8 0%, #2d6cb5 48%, #6da83d 100%) fixed !important;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif !important;
}

body.luna-xp-theme::before {
  opacity: 0 !important;
}

body.luna-xp-theme .mac-taskbar,
body.luna-xp-theme .home-welcome-window,
body.luna-xp-theme .login-card,
body.luna-xp-theme .intro,
body.luna-xp-theme .patient-login-card,
body.luna-xp-theme .test-picker-card,
body.luna-xp-theme .form-panel,
body.luna-xp-theme .result-panel,
body.luna-xp-theme .chat-window,
body.luna-xp-theme .chat-sidebar,
body.luna-xp-theme .chat-panel,
body.luna-xp-theme .chat-personal-panel,
body.luna-xp-theme .sql-sidebar,
body.luna-xp-theme .sql-results,
body.luna-xp-theme .admin-card,
body.luna-xp-theme .consultador-card,
body.luna-xp-theme .home-modal-card {
  color: #000000;
  border: 3px solid #0054e3 !important;
  border-radius: 8px !important;
  background: #ece9d8 !important;
  box-shadow: 3px 4px 10px rgba(0, 32, 96, 0.34) !important;
  backdrop-filter: none !important;
}

body.luna-xp-theme .mac-taskbar {
  color: #ffffff !important;
  border-width: 0 0 2px !important;
  border-color: #003caa !important;
  border-radius: 0 !important;
  background: linear-gradient(#3f8cf3 0%, #0b5bd3 48%, #0645ad 100%) !important;
  box-shadow: 0 2px 5px rgba(0, 32, 96, 0.4) !important;
}

body.luna-xp-theme .mac-taskbar-title,
body.luna-xp-theme .mac-taskbar .welcome-session,
body.luna-xp-theme .mac-taskbar > strong {
  color: #ffffff !important;
  text-shadow: 1px 1px #00337f;
}

body.luna-xp-theme h1,
body.luna-xp-theme h2,
body.luna-xp-theme h3,
body.luna-xp-theme .question-title,
body.luna-xp-theme .test-list-item strong {
  color: #003399 !important;
}

body.luna-xp-theme .eyebrow,
body.luna-xp-theme .welcome-title-user,
body.luna-xp-theme .profile-score-pill,
body.luna-xp-theme .chat-typing-status {
  color: #2f7d21 !important;
}

body.luna-xp-theme .question-block,
body.luna-xp-theme .score-preview,
body.luna-xp-theme .notes-panel,
body.luna-xp-theme .option-content,
body.luna-xp-theme .frequency-option,
body.luna-xp-theme .option-pair,
body.luna-xp-theme .test-list-item,
body.luna-xp-theme .chat-message,
body.luna-xp-theme .chat-file-card,
body.luna-xp-theme .chat-personal-file,
body.luna-xp-theme .chat-day-reader,
body.luna-xp-theme .chat-days-list button,
body.luna-xp-theme tbody tr {
  color: #000000 !important;
  border: 1px solid #7f9db9 !important;
  border-radius: 3px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body.luna-xp-theme button,
body.luna-xp-theme .primary-button,
body.luna-xp-theme .secondary-button,
body.luna-xp-theme .page-link-button,
body.luna-xp-theme .link-button,
body.luna-xp-theme .mac-nav-button,
body.luna-xp-theme .chat-file-actions a,
body.luna-xp-theme .chat-history-open {
  min-height: 28px;
  color: #000000 !important;
  border: 1px solid #003caa !important;
  border-radius: 3px !important;
  background: linear-gradient(#ffffff 0%, #f2f0e4 45%, #d7d2bc 100%) !important;
  box-shadow: inset 1px 1px #ffffff, inset -1px -1px #aca899 !important;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif !important;
}

body.luna-xp-theme button:hover,
body.luna-xp-theme .page-link-button:hover,
body.luna-xp-theme .mac-nav-button:hover {
  color: #000000 !important;
  border-color: #ff8c00 !important;
  background: #fff4ce !important;
}

body.luna-xp-theme .primary-button,
body.luna-xp-theme button[type="submit"],
body.luna-xp-theme .chat-personal-tab.is-active,
body.luna-xp-theme .chat-days-list button.is-active {
  color: #ffffff !important;
  border-color: #1d690f !important;
  background: linear-gradient(#73c85b 0%, #3c9b2f 48%, #24751d 100%) !important;
  box-shadow: inset 1px 1px rgba(255, 255, 255, 0.65), inset -1px -1px #165611 !important;
  text-shadow: 1px 1px #165611;
}

body.luna-xp-theme .luna-style-button {
  color: #ffffff !important;
  border-color: #1d690f !important;
  background: linear-gradient(#73c85b, #24751d) !important;
  font-weight: 700;
}

body.luna-xp-theme input,
body.luna-xp-theme textarea,
body.luna-xp-theme select {
  color: #000000 !important;
  border: 2px inset #ffffff !important;
  border-radius: 2px !important;
  background: #ffffff !important;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.18) !important;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif !important;
}

body.luna-xp-theme input:focus,
body.luna-xp-theme textarea:focus,
body.luna-xp-theme select:focus {
  border-color: #245edb !important;
  outline: 1px dotted #000000;
  outline-offset: 1px;
}

body.luna-xp-theme th,
body.luna-xp-theme thead {
  color: #ffffff !important;
  border-color: #003caa !important;
  background: #245edb !important;
}

body.luna-xp-theme .theme-toggle-button,
body.luna-xp-theme .floating-home-button,
body.luna-xp-theme .floating-scroll-top-button {
  color: #ffffff !important;
  border-color: #003caa !important;
  background: linear-gradient(#3f8cf3, #0645ad) !important;
}

body.luna-xp-theme.home-dashboard .home-welcome-window::before,
body.luna-xp-theme.home-dashboard .home-welcome-window::after,
body.luna-xp-theme.home-dashboard .home-time-card::before {
  display: none !important;
}

body.luna-xp-theme.home-dashboard .home-time-card {
  border: 1px solid #7f9db9;
  border-radius: 3px;
  background: #ffffff;
}

body.luna-xp-theme.genia-dark-theme {
  --surface: #24344f;
  --surface-strong: #314767;
  color: #ffffff;
  background: #152238 !important;
}

body.luna-xp-theme.genia-dark-theme .home-welcome-window,
body.luna-xp-theme.genia-dark-theme .login-card,
body.luna-xp-theme.genia-dark-theme .intro,
body.luna-xp-theme.genia-dark-theme .patient-login-card,
body.luna-xp-theme.genia-dark-theme .test-picker-card,
body.luna-xp-theme.genia-dark-theme .form-panel,
body.luna-xp-theme.genia-dark-theme .result-panel,
body.luna-xp-theme.genia-dark-theme .chat-window,
body.luna-xp-theme.genia-dark-theme .chat-sidebar,
body.luna-xp-theme.genia-dark-theme .chat-panel,
body.luna-xp-theme.genia-dark-theme .chat-personal-panel {
  color: #ffffff;
  border-color: #4f83cc !important;
  background: #24344f !important;
}

body.luna-xp-theme.genia-dark-theme h1,
body.luna-xp-theme.genia-dark-theme h2,
body.luna-xp-theme.genia-dark-theme h3,
body.luna-xp-theme.genia-dark-theme .question-title {
  color: #ffffff !important;
}

/* Informe SAM: composición clínica equivalente al cuestionario impreso. */
.sam-clinical-report {
  max-width: 920px;
  margin: 28px auto 0;
  padding: clamp(22px, 4vw, 48px) !important;
  color: #102b35 !important;
  border: 1px solid #9ccfd2 !important;
  border-radius: 2px !important;
  background: #ffffff !important;
  box-shadow: 0 16px 38px rgba(29, 78, 85, 0.13) !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

body.luna-xp-theme .sam-clinical-report,
body.luna-xp-theme.genia-dark-theme .sam-clinical-report {
  color: #102b35 !important;
  border: 1px solid #9ccfd2 !important;
  border-radius: 2px !important;
  background: #ffffff !important;
}

body.luna-xp-theme .sam-clinical-report h2,
body.luna-xp-theme .sam-clinical-report h3,
body.luna-xp-theme.genia-dark-theme .sam-clinical-report h2,
body.luna-xp-theme.genia-dark-theme .sam-clinical-report h3 {
  color: #102b35 !important;
}

.sam-report-header { display: flex; justify-content: flex-end; }

.sam-report-brand { display: inline-flex; align-items: center; gap: 10px; color: #166f7c; text-align: left; }
.sam-report-brand-mark { display: grid; width: 34px; height: 34px; place-items: center; color: #ffffff; border-radius: 50%; background: #43a4ad; font-size: 0.68rem; font-weight: 800; }
.sam-report-brand strong, .sam-report-brand small { display: block; }
.sam-report-brand strong { font-size: 0.82rem; }
.sam-report-brand small { font-size: 0.62rem; }

.sam-report-rule { height: 3px; margin: 12px 0 24px; background: #49b0b8; }
.sam-report-kicker { margin: 0 0 6px !important; color: #527983 !important; font-size: 0.73rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.sam-clinical-report #resultTitle { margin: 0 0 26px; color: #102b35 !important; font-size: clamp(1.28rem, 3.5vw, 2rem); line-height: 1.22; text-align: center; text-decoration: underline; text-underline-offset: 5px; }

.sam-report-patient { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #77bcc2; border-left: 1px solid #77bcc2; }
.sam-report-patient div { display: grid; gap: 4px; min-height: 64px; padding: 11px 13px; border-right: 1px solid #77bcc2; border-bottom: 1px solid #77bcc2; }
.sam-report-patient span, .sam-report-total span, .sam-report-section-heading > span { color: #47727a; font-size: 0.69rem; font-weight: 700; letter-spacing: 0.035em; text-transform: uppercase; }
.sam-report-patient strong { color: #102b35; font-size: 0.98rem; }

.sam-report-total { display: grid; grid-template-columns: minmax(170px, 0.42fr) 1fr; margin-top: 24px; border: 1px solid #77bcc2; }
.sam-report-total p { margin: 0 !important; padding: 16px 18px; }
.sam-report-total #resultScore { display: grid; gap: 5px; border-right: 1px solid #77bcc2; background: #ebf8f8; }
.sam-report-total #resultScore strong { color: #12707b; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.sam-report-total #resultMessage { display: grid; gap: 5px; font-size: 0.88rem; line-height: 1.45; }
.sam-report-total #resultMessage strong { color: #102b35; }
.sam-report-total #resultMessage span { color: #415e66; }

.sam-report-details { margin-top: 28px; }
.sam-report-section-heading { padding-bottom: 10px; border-bottom: 2px solid #49b0b8; }
.sam-report-section-heading h3 { margin: 4px 0 0; color: #102b35 !important; font-size: 1.18rem; }
.sam-report-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.sam-report-section { overflow: hidden; border: 1px solid #a7d0d3; border-radius: 2px; }
.sam-report-section h3 { margin: 0; padding: 10px 12px; color: #153f48 !important; background: #eaf7f7; font-size: 0.84rem; }
.sam-report-note { margin: 0 !important; padding: 7px 12px !important; color: #5a666a !important; border-bottom: 1px solid #d1e7e8; font-size: 0.73rem; font-style: italic; }
.sam-report-section ul { margin: 0; padding: 0; list-style: none; }
.sam-report-section li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px 12px; color: #20383d; border-top: 1px solid #dceced; font-size: 0.8rem; line-height: 1.32; }
.sam-report-section li:first-child { border-top: 0; }
.sam-report-section li strong { min-width: 28px; color: #14707b; text-align: right; }
.sam-report-section .sam-report-empty { color: #718488; font-style: italic; }
.sam-clinical-report .save-status { margin: 20px 0 0 !important; color: #51666c !important; font-size: 0.78rem; }
.sam-clinical-report .download-actions { margin-top: 16px; }
.sam-clinical-report .download-actions .secondary-button { color: #0d5962 !important; border-color: #4aa8b0 !important; border-radius: 2px !important; background: #eefafa !important; box-shadow: none !important; }
.sam-report-footer { margin-top: 28px; padding-top: 10px; color: #60777b; border-top: 3px solid #49b0b8; font-size: 0.68rem; line-height: 1.4; }

@media (max-width: 680px) {
  .sam-clinical-report { padding: 20px !important; }
  .sam-report-header { justify-content: flex-start; }
  .sam-report-patient, .sam-report-sections { grid-template-columns: 1fr; }
  .sam-report-total { grid-template-columns: 1fr; }
  .sam-report-total #resultScore { border-right: 0; border-bottom: 1px solid #77bcc2; }
}

/* Complete Luna coverage for tests, records, reports and chat. */
body.luna-xp-theme .app-shell,
body.luna-xp-theme .patient-login-shell,
body.luna-xp-theme .test-picker-shell,
body.luna-xp-theme .chat-shell {
  width: min(1180px, calc(100% - 24px));
}

body.luna-xp-theme .intro,
body.luna-xp-theme .patient-login-heading,
body.luna-xp-theme .test-picker-heading,
body.luna-xp-theme .chat-header,
body.luna-xp-theme .chat-channel-heading {
  position: relative;
  overflow: hidden;
}

body.luna-xp-theme .intro::before,
body.luna-xp-theme .patient-login-heading::before,
body.luna-xp-theme .test-picker-heading::before,
body.luna-xp-theme .chat-header::before,
body.luna-xp-theme .chat-channel-heading::before {
  content: "Genia Clinic";
  display: block;
  margin: -24px -24px 18px;
  padding: 6px 12px;
  color: #ffffff;
  background: linear-gradient(90deg, #0a55d7 0%, #3c8bf0 74%, #76a9f5 100%);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 1px 1px #00337f;
}

body.luna-xp-theme .patient-grid,
body.luna-xp-theme .criteria-box,
body.luna-xp-theme .reference-figure,
body.luna-xp-theme .notes-panel,
body.luna-xp-theme .info-block,
body.luna-xp-theme .report-section,
body.luna-xp-theme .report-preview,
body.luna-xp-theme .records-summary,
body.luna-xp-theme .patient-greeting,
body.luna-xp-theme .registered-login-panel,
body.luna-xp-theme .sql-patient-results,
body.luna-xp-theme .chat-form,
body.luna-xp-theme .chat-history-overlay,
body.luna-xp-theme .chat-history-dialog,
body.luna-xp-theme .chat-days-layout,
body.luna-xp-theme .chat-personal-body,
body.luna-xp-theme .chat-history-grid {
  color: #000000 !important;
  border: 1px solid #7f9db9 !important;
  border-radius: 3px !important;
  background: #f7f5e9 !important;
  box-shadow: none !important;
}

body.luna-xp-theme .question-block,
body.luna-xp-theme .test-list-item,
body.luna-xp-theme .record-item,
body.luna-xp-theme .chat-message,
body.luna-xp-theme .chat-file-card,
body.luna-xp-theme .chat-personal-file {
  transition: border-color 120ms ease, background-color 120ms ease;
}

body.luna-xp-theme .question-block:hover,
body.luna-xp-theme .test-list-item:hover,
body.luna-xp-theme .record-item:hover {
  border-color: #245edb !important;
  background: #fffef8 !important;
}

body.luna-xp-theme .frequency-option:has(input:checked),
body.luna-xp-theme .option-pair:has(input:checked),
body.luna-xp-theme .option-content:has(input:checked) {
  color: #ffffff !important;
  border-color: #003caa !important;
  background: #245edb !important;
}

body.luna-xp-theme .score-preview,
body.luna-xp-theme .neuro-scorebar {
  top: 10px;
  z-index: 35;
  border: 2px solid #0054e3 !important;
  background: #fffbe8 !important;
}

body.luna-xp-theme .chat-sidebar-menu,
body.luna-xp-theme .chat-personal-tabs,
body.luna-xp-theme .intro-actions,
body.luna-xp-theme .actions,
body.luna-xp-theme .download-actions {
  gap: 8px;
}

body.luna-xp-theme .chat-messages,
body.luna-xp-theme .records-list,
body.luna-xp-theme .questions {
  scrollbar-color: #245edb #ece9d8;
}

body.luna-xp-theme .chat-menu-button,
body.luna-xp-theme .chat-panel-toggle,
body.luna-xp-theme .chat-attach-button {
  color: #ffffff !important;
  background: linear-gradient(#3f8cf3, #0645ad) !important;
}

body.luna-xp-theme.genia-dark-theme .patient-grid,
body.luna-xp-theme.genia-dark-theme .criteria-box,
body.luna-xp-theme.genia-dark-theme .reference-figure,
body.luna-xp-theme.genia-dark-theme .notes-panel,
body.luna-xp-theme.genia-dark-theme .info-block,
body.luna-xp-theme.genia-dark-theme .report-section,
body.luna-xp-theme.genia-dark-theme .report-preview,
body.luna-xp-theme.genia-dark-theme .records-summary,
body.luna-xp-theme.genia-dark-theme .patient-greeting,
body.luna-xp-theme.genia-dark-theme .registered-login-panel,
body.luna-xp-theme.genia-dark-theme .sql-patient-results,
body.luna-xp-theme.genia-dark-theme .chat-form,
body.luna-xp-theme.genia-dark-theme .chat-history-overlay,
body.luna-xp-theme.genia-dark-theme .chat-history-dialog,
body.luna-xp-theme.genia-dark-theme .chat-days-layout,
body.luna-xp-theme.genia-dark-theme .chat-personal-body,
body.luna-xp-theme.genia-dark-theme .chat-history-grid,
body.luna-xp-theme.genia-dark-theme .question-block,
body.luna-xp-theme.genia-dark-theme .test-list-item,
body.luna-xp-theme.genia-dark-theme .record-item,
body.luna-xp-theme.genia-dark-theme .chat-message,
body.luna-xp-theme.genia-dark-theme .chat-file-card,
body.luna-xp-theme.genia-dark-theme .chat-personal-file {
  color: #ffffff !important;
  border-color: #4f83cc !important;
  background: #1b2940 !important;
}

body.luna-xp-theme.genia-dark-theme .score-preview,
body.luna-xp-theme.genia-dark-theme .neuro-scorebar {
  color: #ffffff !important;
  background: #24344f !important;
}

@media (max-width: 720px) {
  body.luna-xp-theme .app-shell,
  body.luna-xp-theme .patient-login-shell,
  body.luna-xp-theme .test-picker-shell,
  body.luna-xp-theme .chat-shell {
    width: min(100% - 12px, 1180px);
  }

  body.luna-xp-theme .intro::before,
  body.luna-xp-theme .patient-login-heading::before,
  body.luna-xp-theme .test-picker-heading::before,
  body.luna-xp-theme .chat-header::before,
  body.luna-xp-theme .chat-channel-heading::before {
    margin: -16px -16px 14px;
  }

  body.luna-xp-theme .patient-grid,
  body.luna-xp-theme .report-vitals-grid,
  body.luna-xp-theme .info-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Flujo e informe clínico para el cuestionario de hiperlaxitud. */
.test-transition-card {
  margin: 20px 0;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid #86c9cf;
  border-radius: 8px;
  background: #f0fbfb;
  box-shadow: 0 10px 24px rgba(22, 112, 123, 0.1);
}

.test-transition-card h2 { margin: 4px 0 8px; color: #153f48; font-size: clamp(1.25rem, 3vw, 1.7rem); }
.test-transition-card p:not(.eyebrow) { margin: 0; color: #45656c; }
.test-transition-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.hiperlaxitud-clinical-report {
  max-width: 920px;
  margin: 28px auto 0;
  padding: clamp(22px, 4vw, 48px) !important;
  color: #102b35 !important;
  border: 1px solid #9ccfd2 !important;
  border-radius: 2px !important;
  background: #ffffff !important;
  box-shadow: 0 16px 38px rgba(29, 78, 85, 0.13) !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

body.luna-xp-theme .hiperlaxitud-clinical-report,
body.luna-xp-theme.genia-dark-theme .hiperlaxitud-clinical-report { color: #102b35 !important; border: 1px solid #9ccfd2 !important; border-radius: 2px !important; background: #ffffff !important; }

.clinical-report-header { display: flex; justify-content: flex-end; }
.clinical-report-brand { display: inline-flex; align-items: center; gap: 10px; color: #166f7c; text-align: left; }
.clinical-report-brand-mark { display: grid; width: 34px; height: 34px; place-items: center; color: #ffffff; border-radius: 50%; background: #43a4ad; font-size: 0.68rem; font-weight: 800; }
.clinical-report-brand strong, .clinical-report-brand small { display: block; }
.clinical-report-brand strong { font-size: 0.82rem; }
.clinical-report-brand small { font-size: 0.62rem; }
.clinical-report-rule { height: 3px; margin: 12px 0 24px; background: #49b0b8; }
.clinical-report-kicker { margin: 0 0 6px !important; color: #527983 !important; font-size: 0.73rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.hiperlaxitud-clinical-report #resultTitle { margin: 0 0 26px; color: #102b35 !important; font-size: clamp(1.28rem, 3.5vw, 2rem); line-height: 1.22; text-align: center; text-decoration: underline; text-underline-offset: 5px; }
.clinical-report-patient { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #77bcc2; border-left: 1px solid #77bcc2; }
.clinical-report-patient div { display: grid; gap: 4px; min-height: 64px; padding: 11px 13px; border-right: 1px solid #77bcc2; border-bottom: 1px solid #77bcc2; }
.clinical-report-patient span, .clinical-report-total span, .clinical-report-section-heading > span { color: #47727a; font-size: 0.69rem; font-weight: 700; letter-spacing: 0.035em; text-transform: uppercase; }
.clinical-report-patient strong { color: #102b35; font-size: 0.98rem; }

.clinical-report-total { display: grid; grid-template-columns: minmax(170px, 0.42fr) 1fr; margin-top: 24px; border: 1px solid #77bcc2; }
.clinical-report-total p { margin: 0 !important; padding: 16px 18px; }
.clinical-report-total #resultScore { display: grid; gap: 5px; border-right: 1px solid #77bcc2; background: #ebf8f8; }
.clinical-report-total #resultScore strong { color: #12707b; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.clinical-report-total #resultMessage { display: grid; gap: 5px; font-size: 0.88rem; line-height: 1.45; }
.clinical-report-total #resultMessage strong { color: #102b35; }
.clinical-report-total #resultMessage span { color: #415e66; }

.clinical-report-details { margin-top: 28px; }
.clinical-report-section-heading { padding-bottom: 10px; border-bottom: 2px solid #49b0b8; }
.clinical-report-section-heading h3 { margin: 4px 0 0; color: #102b35 !important; font-size: 1.18rem; }
.clinical-answer-sections { display: grid; gap: 14px; margin-top: 16px; }
.clinical-answer-section { overflow: hidden; border: 1px solid #a7d0d3; border-radius: 2px; }
.clinical-answer-section h3 { margin: 0; padding: 10px 12px; color: #153f48 !important; background: #eaf7f7; font-size: 0.9rem; }
.clinical-answer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; gap: 12px; align-items: center; padding: 9px 12px; color: #20383d; border-top: 1px solid #dceced; font-size: 0.84rem; line-height: 1.35; }
.clinical-answer-row.is-positive { background: #f3fcf7; }
.clinical-answer-choice { padding: 3px 6px; color: #537176; border: 1px solid #bfdbde; font-size: 0.72rem; white-space: nowrap; }
.clinical-answer-row.is-positive .clinical-answer-choice, .clinical-answer-row.is-positive > strong { color: #14707b; border-color: #65bac2; }
.clinical-answer-row > strong { color: #526e74; text-align: right; }
.hiperlaxitud-clinical-report .save-status { margin: 20px 0 0 !important; color: #51666c !important; font-size: 0.78rem; }
.hiperlaxitud-clinical-report .download-actions { margin-top: 16px; }
.hiperlaxitud-clinical-report .download-actions .secondary-button { color: #0d5962 !important; border-color: #4aa8b0 !important; border-radius: 2px !important; background: #eefafa !important; box-shadow: none !important; }
.clinical-report-footer { margin-top: 28px; padding-top: 10px; color: #60777b; border-top: 3px solid #49b0b8; font-size: 0.68rem; line-height: 1.4; }

@media (max-width: 680px) {
  .test-transition-actions { display: grid; grid-template-columns: 1fr; }
  .hiperlaxitud-clinical-report { padding: 20px !important; }
  .clinical-report-header { justify-content: flex-start; }
  .clinical-report-patient, .clinical-report-total { grid-template-columns: 1fr; }
  .clinical-report-total #resultScore { border-right: 0; border-bottom: 1px solid #77bcc2; }
  .clinical-answer-row { grid-template-columns: minmax(0, 1fr) auto; }
  .clinical-answer-row > strong { grid-column: 2; }
}

/* Sala de voz del chat: se integra al lado de la conversación y ocupa su lugar en móvil. */
.chat-page .chat-layout.is-voice-open {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 12px;
}

.voice-room-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  color: #17202a;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.voice-room-panel[hidden] { display: none; }

.voice-room-header,
.voice-room-status,
.voice-section-heading,
.voice-participant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voice-room-header h2,
.voice-section-heading h3 { margin: 0; color: #17202a; }
.voice-room-header h2 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.voice-section-heading h3 { font-size: 0.9rem; }

.voice-close-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 50%;
  color: #075ab8;
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.voice-room-status {
  justify-content: flex-start;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 11px;
  background: rgba(239, 246, 255, 0.78);
}

.voice-room-status p { margin: 0; color: #526173; font-size: 0.84rem; font-weight: 800; }
.voice-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.voice-status-dot.is-connected { background: #16a34a; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16); }

.voice-participants-section { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 9px; }
.voice-section-heading span { min-width: 26px; display: grid; place-items: center; border-radius: 999px; color: #075ab8; background: #dbeafe; font-size: 0.8rem; font-weight: 900; }
.voice-participants { min-height: 0; display: grid; align-content: start; gap: 8px; overflow: auto; padding-right: 3px; }
.voice-empty { margin: 4px 0; color: #64748b; font-size: 0.85rem; font-weight: 700; }

.voice-participant {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 9px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.88);
}

.voice-participant.is-connected { border-color: rgba(34, 197, 94, 0.42); }
.voice-avatar { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #075ab8; background: #dbeafe; font-size: 0.84rem; font-weight: 900; }
.voice-participant strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.voice-participant > span:last-child { color: #64748b; font-size: 0.74rem; font-weight: 700; }

.voice-controls { display: grid; gap: 9px; padding-top: 2px; }
.voice-mode-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; color: #526173; font-size: 0.8rem; font-weight: 800; }
.voice-mode-picker select { min-width: 0; min-height: 38px; padding: 0 28px 0 10px; border: 1px solid rgba(148, 163, 184, 0.30); border-radius: 10px; color: #17202a; background: #ffffff; font: inherit; }
.voice-controls .primary-button,
.voice-controls .secondary-button,
.voice-transmit-button,
.voice-ptt-button { width: 100%; min-height: 44px; }
.voice-transmit-button,
.voice-ptt-button { border: 1px solid rgba(37, 99, 235, 0.30); border-radius: 12px; color: #075ab8; background: #eff6ff; cursor: pointer; font: inherit; font-weight: 900; }
.voice-transmit-button:disabled,
.voice-ptt-button:disabled { cursor: not-allowed; opacity: 0.5; }
.voice-transmit-button.is-live,
.voice-ptt-button.is-live { color: #ffffff; border-color: #15803d; background: #16a34a; box-shadow: 0 10px 22px rgba(22, 163, 74, 0.22); }

body.genia-dark-theme.chat-page .voice-room-panel,
body.genia-dark-theme.chat-page .voice-participant { color: #f8fafc; border-color: rgba(148, 163, 184, 0.22); background: rgba(15, 23, 42, 0.80); }
body.genia-dark-theme.chat-page .voice-room-header h2,
body.genia-dark-theme.chat-page .voice-section-heading h3 { color: #f8fafc; }
body.genia-dark-theme.chat-page .voice-room-status { border-color: rgba(96, 165, 250, 0.24); background: rgba(30, 41, 59, 0.82); }
body.genia-dark-theme.chat-page .voice-room-status p,
body.genia-dark-theme.chat-page .voice-participant > span:last-child { color: #cbd5e1; }
body.genia-dark-theme.chat-page .voice-mode-picker { color: #cbd5e1; }
body.genia-dark-theme.chat-page .voice-mode-picker select { color: #e2e8f0; border-color: rgba(148, 163, 184, 0.24); background: rgba(30, 41, 59, 0.82); }
body.genia-dark-theme.chat-page .voice-close-button { color: #bfdbfe; border-color: rgba(96, 165, 250, 0.28); background: rgba(30, 41, 59, 0.82); }

body.luna-xp-theme .voice-room-panel,
body.luna-xp-theme .voice-participant { color: #000000 !important; border: 1px solid #7f9db9 !important; border-radius: 3px !important; background: #f7f5e9 !important; box-shadow: none !important; }
body.luna-xp-theme .voice-room-header h2,
body.luna-xp-theme .voice-section-heading h3 { color: #003399 !important; }
body.luna-xp-theme .voice-room-status { border: 1px solid #7f9db9 !important; border-radius: 3px !important; background: #ffffff !important; }
body.luna-xp-theme .voice-room-status p,
body.luna-xp-theme .voice-mode-picker { color: #000000 !important; }
body.luna-xp-theme .voice-transmit-button,
body.luna-xp-theme .voice-ptt-button { color: #000000 !important; border: 1px solid #003caa !important; border-radius: 3px !important; background: linear-gradient(#ffffff 0%, #f2f0e4 45%, #d7d2bc 100%) !important; box-shadow: inset 1px 1px #ffffff, inset -1px -1px #aca899 !important; }
body.luna-xp-theme .voice-transmit-button.is-live,
body.luna-xp-theme .voice-ptt-button.is-live { color: #ffffff !important; border-color: #1d690f !important; background: linear-gradient(#73c85b, #24751d) !important; }

@media (max-width: 1050px) {
  .chat-page .chat-layout.is-voice-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(272px, 320px); gap: 10px; }
}

@media (max-width: 760px) {
  .chat-page .chat-layout.is-voice-open { display: block; }
  .chat-page .chat-layout.is-voice-open .chat-panel { display: none; }
  .chat-page .voice-room-panel { width: 100%; height: 100%; padding: 58px 12px 12px; border-radius: 16px; }
  .voice-room-header { padding-right: 36px; }
  .voice-close-button { position: absolute; top: 17px; right: 14px; }
  .voice-participants { max-height: none; }
}

/* Outlook calendar administration */
.outlook-config-page { min-height: 100vh; margin: 0; background: #eef5fb; color: #172033; }
.outlook-config-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; box-sizing: border-box; }
.outlook-config-card { width: min(680px, 100%); padding: clamp(28px, 5vw, 52px); box-sizing: border-box; border: 1px solid #cbd9e8; border-radius: 8px; background: #fff; box-shadow: 0 20px 50px rgba(31, 57, 82, .12); }
.outlook-config-card h1 { margin: 6px 0 14px; font-size: clamp(32px, 6vw, 54px); line-height: 1.05; }
.outlook-config-status { min-height: 24px; margin: 0 0 24px; color: #53657a; font-weight: 700; }
.outlook-config-status.is-warning { color: #955d00; }
.outlook-config-status.is-error { color: #b42318; }
.outlook-config-status.is-success { color: #167446; }
.outlook-config-form { display: grid; gap: 18px; }
.outlook-config-form label { display: grid; gap: 8px; color: #35465b; font-weight: 800; }
.outlook-config-form input { width: 100%; min-height: 48px; padding: 10px 12px; box-sizing: border-box; border: 1px solid #aebfd2; border-radius: 6px; background: #fff; color: #172033; font: inherit; }
.outlook-config-form input:focus { border-color: #1675ae; outline: 3px solid rgba(22, 117, 174, .16); }
.outlook-config-form .primary-button { justify-self: start; min-width: 210px; }
.outlook-config-back { display: inline-flex; margin-top: 18px; }
@media (max-width: 560px) {
  .outlook-config-shell { padding: 0; }
  .outlook-config-card { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .outlook-config-form .primary-button { width: 100%; }
}
