:root {
  --bg: #f3f5f1;
  --bg-accent: #e9eee8;
  --panel: rgba(253, 253, 250, 0.96);
  --panel-strong: #ffffff;
  --ink: #18251f;
  --ink-soft: #304139;
  --muted: #66736c;
  --line: rgba(28, 55, 43, 0.12);
  --line-strong: rgba(28, 55, 43, 0.2);
  --brand: #17664d;
  --brand-strong: #0d4937;
  --brand-soft: #e7f1ec;
  --warm: #a96832;
  --warm-soft: #f6ece1;
  --danger: #b93e43;
  --shadow: 0 18px 50px rgba(27, 48, 38, 0.09);
  --shadow-soft: 0 8px 24px rgba(27, 48, 38, 0.06);
  --radius: 20px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Century Gothic", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(22, 61, 46, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 61, 46, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 4% 4%, rgba(23, 102, 77, 0.11), transparent 26%),
    radial-gradient(circle at 96% 94%, rgba(169, 104, 50, 0.09), transparent 25%),
    linear-gradient(145deg, #f7f8f5, var(--bg) 52%, var(--bg-accent));
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  min-height: 100vh;
}

.sidebar {
  min-width: 0;
  padding: 32px 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 248, 236, 0.62);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.main {
  width: 100%;
  min-width: 0;
  max-width: 1720px;
  margin: 0 auto;
  padding: 30px clamp(20px, 2.5vw, 42px) 56px;
}

body.doctor-mode .shell {
  grid-template-columns: minmax(0, 1fr);
}

body.doctor-mode .sidebar {
  display: none;
}

body.logged-out .shell {
  grid-template-columns: minmax(0, 1fr);
}

body.logged-out .sidebar {
  display: none;
}

body.logged-out .main {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 32px 20px;
}

body.logged-out #loginSection {
  width: min(560px, 100%);
  padding: 28px;
}

body.logged-out #loginSection h1 {
  margin-bottom: 22px;
}

body.logged-out #loginForm {
  grid-template-columns: 1fr;
  gap: 16px;
}

body.logged-out #loginForm button,
body.logged-out #loginForm label,
body.logged-out #loginForm .full {
  grid-column: span 1;
}

body:not(.doctor-mode) .shell {
  grid-template-columns: minmax(0, 1fr);
}

body:not(.doctor-mode) .sidebar {
  border-right: none;
  border-bottom: 1px solid var(--line);
  padding: 24px 28px 22px;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  min-height: auto;
}

body:not(.doctor-mode) .sidebar > div:first-child {
  max-width: 760px;
  padding: 8px 0;
}

body:not(.doctor-mode) .sidebar .card {
  min-width: 310px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--warm);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.4rem;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.input-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.small {
  font-size: 0.92rem;
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.subpanel {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.76);
}

.top-gap {
  margin-top: 18px;
}

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

.card {
  padding: 18px;
}

.card-soft {
  background: rgba(255, 250, 241, 0.84);
}

.sidebar-session-card {
  align-self: center;
  padding: 20px 20px 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(31, 122, 91, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 233, 218, 0.9));
}

body:not(.doctor-mode) #workspaceTitle {
  margin-bottom: 10px;
  font-size: clamp(2rem, 2.6vw, 2.8rem);
  line-height: 1.02;
}

body:not(.doctor-mode) #workspaceDescription {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.65;
}

.label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.credential {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f2eadf;
  overflow-wrap: anywhere;
}

.session-status {
  display: grid;
  gap: 10px;
  font-weight: 700;
}

.session-status__row {
  display: grid;
  gap: 4px;
}

.session-status__label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-status strong,
.session-status__email,
.session-status__state {
  display: block;
}

.session-status strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.session-status__email {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.session-status__state {
  justify-self: start;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(31, 122, 91, 0.12);
  color: var(--brand-strong);
  font-size: 0.85rem;
  font-weight: 800;
}

.doctor-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 24px;
}

.doctor-hero__content {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 26px 30px;
  border-radius: 26px;
  border: 1px solid rgba(58, 75, 58, 0.1);
  background:
    radial-gradient(circle at top right, rgba(31, 122, 91, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 238, 224, 0.92));
  box-shadow: 0 18px 40px rgba(80, 62, 34, 0.07);
}

.doctor-hero__content h2 {
  margin: 0;
  font-size: clamp(2.15rem, 3vw, 2.95rem);
  line-height: 1;
}

.doctor-hero__content .muted {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.doctor-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.doctor-hero__pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(31, 122, 91, 0.12);
  color: var(--brand-strong);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doctor-hero__pill--soft {
  background: rgba(180, 108, 42, 0.12);
  color: #8b531f;
}

.doctor-session-badge {
  min-width: 0;
  max-width: none;
  padding: 20px 20px 20px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 233, 218, 0.88));
  box-shadow: 0 12px 28px rgba(80, 62, 34, 0.08);
  display: grid;
  align-content: center;
  gap: 10px;
}

.doctor-session-badge .label {
  margin-bottom: 0;
}

.doctor-session-badge .button {
  margin-top: 4px;
  justify-self: start;
  min-width: 0;
  padding-inline: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.grid.two-cols {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.doctor-workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

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

.vital-signs-panel {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(239, 248, 244, 0.9), rgba(255, 252, 246, 0.92));
}

.vital-signs-panel legend {
  padding: 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.vital-signs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.vital-signs-grid > label,
.vital-signs-pressure {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.clinical-input-with-unit,
.blood-pressure-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.clinical-input-with-unit input,
.blood-pressure-inputs input {
  min-width: 0;
  width: 100%;
}

.clinical-input-with-unit > span,
.blood-pressure-inputs > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.blood-pressure-inputs label {
  min-width: 0;
  flex: 1 1 0;
}

.clinical-input-with-unit--readonly input {
  background: rgba(226, 238, 232, 0.72);
  color: var(--green-900);
  font-weight: 700;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1000px) {
  .vital-signs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .vital-signs-panel {
    padding: 16px;
  }

  .vital-signs-grid {
    grid-template-columns: 1fr;
  }
}

.form-mode-banner {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(31, 122, 91, 0.16);
  background: linear-gradient(135deg, rgba(31, 122, 91, 0.12), rgba(180, 108, 42, 0.08));
  color: var(--ink);
  font-weight: 700;
}

.specialty-selector {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
}

.specialty-selector legend {
  padding: 0 6px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.specialty-selector p {
  margin: 0;
}

.specialty-selector__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.specialty-selector__option {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.specialty-selector__option input {
  min-height: auto;
  margin: 0;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.93rem;
  color: var(--muted);
}

.form-grid label span {
  color: var(--ink);
  font-weight: 600;
}

.encounter-option-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(58, 75, 58, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.encounter-option-toggle span {
  color: var(--ink);
  font-weight: 600;
}

.encounter-option-toggle select {
  min-width: 96px;
}

.diagnosis-builder {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(58, 75, 58, 0.12);
  background: rgba(255, 255, 255, 0.58);
}

.encounter-tabs {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 250, 247, 0.94);
  box-shadow: 0 10px 24px rgba(27, 48, 38, 0.06);
  backdrop-filter: blur(12px);
}

.encounter-tab {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  min-width: 128px;
  padding: 9px 13px;
  border: 1px solid rgba(28, 55, 43, 0.12);
  border-radius: 18px;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 800;
  cursor: pointer;
  transition: 180ms ease;
}

.encounter-tab:hover,
.encounter-tab.is-active {
  border-color: rgba(23, 102, 77, 0.34);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 20px rgba(23, 102, 77, 0.16);
}

.clinical-tab-label {
  line-height: 1.05;
}

.clinical-tab-progress {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6b7a71;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
}

.clinical-tab-progress::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9c5be;
}

.encounter-tab[data-progress-tone="complete"] .clinical-tab-progress::before,
.dentistry-tab[data-progress-tone="complete"] .clinical-tab-progress::before {
  background: #1d775b;
}

.encounter-tab[data-progress-tone="partial"] .clinical-tab-progress::before,
.dentistry-tab[data-progress-tone="partial"] .clinical-tab-progress::before {
  background: #c78435;
}

.encounter-tab[data-progress-tone="pending"] .clinical-tab-progress::before,
.dentistry-tab[data-progress-tone="pending"] .clinical-tab-progress::before {
  background: #bf4747;
}

.encounter-tab.is-active .clinical-tab-progress,
.dentistry-tab.is-active .clinical-tab-progress {
  color: rgba(255, 255, 255, 0.82);
}

.encounter-tab.is-active .clinical-tab-progress::before,
.dentistry-tab.is-active .clinical-tab-progress::before {
  background: #fff;
}

.encounter-tab-panel {
  align-content: start;
  min-height: 360px;
  padding: 18px;
  border: 1px solid rgba(58, 75, 58, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 247, 0.7));
}

.encounter-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin: 4px -2px -2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 0 -12px 28px rgba(27, 48, 38, 0.08);
  backdrop-filter: blur(12px);
}

#encounterSaveStatus {
  flex: 1 1 auto;
  margin: 0;
}

#encounterSubmitButton {
  flex: 0 0 auto;
  min-width: min(100%, 280px);
  box-shadow: 0 14px 28px rgba(23, 102, 77, 0.18);
}

.encounter-mid-ai {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(23, 102, 77, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(23, 102, 77, 0.12), transparent 34%),
    linear-gradient(135deg, #f7fbf8, #eef7f2);
}

.encounter-mid-ai h4 {
  margin: 0 0 6px;
}

.encounter-mid-ai .eyebrow {
  margin-bottom: 6px;
}

.encounter-mid-ai__button {
  min-width: 150px;
  box-shadow: 0 12px 24px rgba(23, 102, 77, 0.16);
}

.encounter-mid-ai > .small {
  grid-column: 1 / -1;
  margin: 0;
}

.validation-summary {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(192, 65, 65, 0.24);
  background: linear-gradient(180deg, rgba(255, 247, 247, 0.98), rgba(252, 235, 235, 0.95));
}

.validation-summary strong {
  color: var(--danger);
}

.validation-summary ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
}

.validation-summary li + li {
  margin-top: 6px;
}

.diagnosis-builder__header > div > span {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.96rem;
}

.diagnosis-builder__header p {
  margin: 8px 0 0;
}

.diagnosis-builder__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.diagnosis-builder .form-actions-row {
  justify-content: flex-start;
}

.modal-section-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(58, 75, 58, 0.1);
  background: rgba(255, 255, 255, 0.68);
}

.modal-section-card__header > div > span {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.modal-section-card__header p {
  margin: 6px 0 0;
}

.diagnosis-search-results {
  display: grid;
  gap: 8px;
}

.diagnosis-search-result {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid rgba(58, 75, 58, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
}

.diagnosis-search-result.is-selected {
  border-color: rgba(31, 122, 91, 0.4);
  box-shadow: 0 8px 18px rgba(31, 122, 91, 0.08);
}

.diagnosis-pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.diagnosis-pill-row__content {
  display: grid;
  gap: 4px;
}

.diagnosis-pill-row__remove {
  min-width: 48px;
  padding-inline: 0;
  font-weight: 800;
}

.medication-row__grid {
  display: grid;
  grid-template-columns: minmax(130px, 1.05fr) minmax(130px, 1.05fr) minmax(90px, 0.7fr) minmax(80px, 0.55fr) minmax(140px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.medication-row__grid p {
  margin: 6px 0 0;
}

.medication-row__grid--editor label {
  display: grid;
  gap: 8px;
}

.medication-row__grid--editor input {
  width: 100%;
  min-width: 0;
}

.medication-row__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.medication-row__title {
  display: grid;
  gap: 4px;
}

.medication-row__title strong {
  color: var(--ink);
  font-size: 1rem;
}

.patient-history-preview {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(31, 122, 91, 0.22);
  background: rgba(255, 255, 255, 0.58);
}

.patient-history-preview span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.patient-history-preview strong {
  color: var(--ink);
  font-size: 1rem;
}

.schedule-builder {
  display: grid;
  gap: 16px;
}

.schedule-builder__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.schedule-composer {
  grid-column: span 2;
  display: grid;
  gap: 18px;
  padding: 20px 22px 22px;
  border-radius: 24px;
  border: 1px solid rgba(58, 75, 58, 0.12);
  background:
    radial-gradient(circle at top right, rgba(31, 122, 91, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(246, 238, 225, 0.95));
}

.schedule-composer__header {
  display: grid;
  grid-template-columns: minmax(320px, 1.5fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: end;
}

.schedule-composer__header h3 {
  margin-bottom: 8px;
}

.schedule-composer__intro {
  max-width: 780px;
}

.schedule-composer__controls {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 12px;
  align-items: end;
}

.schedule-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.button-ghost {
  padding: 10px 12px;
  border: 1px solid rgba(35, 61, 43, 0.12);
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.office-composer,
.office-editor-card,
.office-schedule-grid {
  display: grid;
  gap: 16px;
}

.setup-payment-composer {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(183, 93, 43, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(226, 240, 232, 0.72), rgba(255, 248, 236, 0.82));
}

.setup-payment-composer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.setup-payment-composer__header h3 {
  margin: 2px 0 5px;
}

.setup-payment-composer__body {
  display: grid;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(58, 75, 58, 0.12);
}

.office-editor-card {
  padding: 20px;
}

.office-schedule-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.office-schedule-day {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.office-schedule-day__header,
.office-schedule-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.office-schedule-day__header {
  justify-content: space-between;
  margin-bottom: 10px;
}

.office-schedule-block {
  flex-wrap: wrap;
  margin-top: 8px;
}

.office-schedule-block input[type="time"] {
  width: 116px;
}

.office-schedule-block label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.office-schedule-block label input {
  width: 76px;
}

.office-check,
.current-office-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-office-picker select {
  min-width: min(320px, 65vw);
}

.schedule-card {
  border: 1px solid rgba(58, 75, 58, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  padding: 16px;
  display: grid;
  gap: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  align-content: start;
}

.schedule-card.is-enabled {
  border-color: rgba(31, 122, 91, 0.34);
  box-shadow: 0 14px 24px rgba(31, 122, 91, 0.08);
  transform: translateY(-1px);
}

.schedule-card__top {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-card__day {
  font-size: 0.98rem;
  font-weight: 800 !important;
  color: var(--ink) !important;
}

.schedule-card__top input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}

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

.schedule-card:not(.is-enabled) .schedule-card__times {
  opacity: 0.42;
}

.schedule-slot-field {
  max-width: none;
}

.schedule-slot-field span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 600;
}

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.login-inline-actions {
  display: flex;
  justify-content: flex-end;
}

.button-link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

.button-link:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.schedule-days {
  display: grid;
  gap: 12px;
}

.schedule-day {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
  display: grid;
  gap: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.schedule-day.is-enabled {
  border-color: rgba(31, 122, 91, 0.35);
  box-shadow: 0 10px 24px rgba(31, 122, 91, 0.08);
}

.schedule-day__toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink) !important;
}

.schedule-day__toggle span {
  font-size: 1rem;
}

.schedule-day__toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}

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

.schedule-day:not(.is-enabled) .schedule-day__times {
  opacity: 0.56;
}

.form-grid button,
.form-grid label:last-of-type,
.form-grid .full {
  grid-column: span 2;
}

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

input,
select,
textarea {
  border-radius: 16px;
  border: 1px solid rgba(35, 61, 43, 0.14);
  background: rgba(255, 255, 255, 0.74);
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 122, 91, 0.6);
  box-shadow: 0 0 0 4px rgba(31, 122, 91, 0.12);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

#encounterAiNarrative {
  min-height: 170px;
}

.button {
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: white;
  padding: 13px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 140ms ease, opacity 140ms ease;
}

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

.button-secondary {
  background: #ebe1d0;
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.plan-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.96), rgba(246, 238, 225, 0.92));
  border: 1px solid var(--line);
}

.plan-price {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 6px 0;
}

.plan-features {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.doctors-list {
  display: grid;
  gap: 14px;
}

.payment-summary,
.payment-terms-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(226, 240, 232, 0.78), rgba(255, 248, 236, 0.82));
}

.payment-summary div,
.payment-terms-summary div {
  min-width: 0;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.payment-summary span,
.payment-summary strong,
.payment-terms-summary span,
.payment-terms-summary strong {
  display: block;
}

.payment-summary span,
.payment-terms-summary span {
  color: var(--muted);
  font-size: 0.78rem;
}

.payment-summary strong,
.payment-terms-summary strong {
  margin-top: 5px;
  color: var(--brand-strong);
  font-size: 1.12rem;
}

.payment-form {
  margin-top: 18px;
}

.payment-terms-form {
  margin-top: 18px;
}

.payment-summary,
.payment-terms-summary {
  margin: 22px 0 14px;
}

.payment-list,
.contract-alerts-list {
  display: grid;
  gap: 12px;
}

.payment-item,
.contract-alert-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr);
  gap: 18px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.payment-item h4 {
  margin: 10px 0 3px;
  color: var(--brand-strong);
  font-size: 1.35rem;
}

.payment-item p,
.contract-alert-item span {
  margin: 3px 0;
  color: var(--muted);
}

.payment-item__detail p {
  line-height: 1.45;
}

.contract-alerts-panel {
  border-color: rgba(185, 102, 53, 0.28);
  background: linear-gradient(135deg, rgba(255, 249, 238, 0.98), rgba(248, 235, 217, 0.92));
}

#superadminSection {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 22px;
}

.admin-section-nav {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(28, 55, 43, 0.12);
  border-radius: 22px;
  background: rgba(250, 250, 246, 0.9);
  box-shadow: 0 14px 34px rgba(27, 48, 38, 0.1);
  backdrop-filter: blur(18px);
}

.admin-section-nav__button {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.admin-section-nav__button:hover {
  transform: translateY(-1px);
  background: rgba(23, 102, 77, 0.07);
}

.admin-section-nav__button span,
.admin-section-nav__button small {
  display: block;
}

.admin-section-nav__button span {
  font-size: 0.92rem;
  font-weight: 800;
}

.admin-section-nav__button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-section-nav__button.is-active {
  border-color: rgba(23, 102, 77, 0.2);
  color: white;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  box-shadow: 0 8px 18px rgba(13, 73, 55, 0.2);
}

.admin-section-nav__button.is-active small {
  color: rgba(255, 255, 255, 0.7);
}

.admin-dashboard {
  display: grid;
  gap: 18px;
}

.admin-dashboard__hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid rgba(23, 102, 77, 0.22);
  border-radius: 28px;
  color: white;
  background:
    radial-gradient(circle at 86% 35%, rgba(222, 182, 128, 0.25), transparent 24%),
    linear-gradient(125deg, #0d4937 0%, #17664d 62%, #285b48 100%);
  box-shadow: var(--shadow);
}

.admin-dashboard__hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -125px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.admin-dashboard__hero > * {
  position: relative;
  z-index: 1;
}

.admin-dashboard__hero h2 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  color: white;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
}

.admin-dashboard__hero .muted {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.7);
}

.admin-dashboard__hero .button-secondary {
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

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

.admin-metric-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(253, 253, 250, 0.95);
  box-shadow: var(--shadow-soft);
}

.admin-metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

.admin-metric-card--warm::before {
  background: var(--warm);
}

.admin-metric-card--danger::before {
  background: var(--danger);
}

.admin-metric-card span,
.admin-metric-card strong,
.admin-metric-card small {
  display: block;
}

.admin-metric-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-metric-card strong {
  margin: 14px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  line-height: 1;
}

.admin-metric-card small {
  color: var(--muted);
  line-height: 1.4;
}

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

.admin-insight-card {
  margin: 0;
  box-shadow: var(--shadow-soft);
}

.admin-insight-card--wide {
  grid-column: 1 / -1;
}

.admin-insight-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.admin-insight-card__header h3 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.button-compact {
  min-height: 38px;
  padding: 8px 13px;
}

.admin-plan-list,
.admin-finance-list {
  display: grid;
  gap: 10px;
}

.admin-plan-row,
.admin-finance-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 250, 247, 0.76);
}

.admin-plan-row {
  grid-template-columns: minmax(130px, 1fr) minmax(100px, 1.3fr) auto;
}

.admin-plan-row__track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(23, 102, 77, 0.1);
}

.admin-plan-row__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #66a98c);
}

.admin-plan-row strong,
.admin-plan-row small {
  display: block;
}

.admin-plan-row small {
  margin-top: 3px;
  color: var(--muted);
}

.admin-finance-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

button.admin-finance-row {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button.admin-finance-row:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 102, 77, 0.28);
  box-shadow: var(--shadow-soft);
}

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

.admin-finance-row span,
.admin-finance-row small {
  margin-top: 3px;
  color: var(--muted);
}

.admin-finance-row__amount {
  color: var(--brand-strong);
  font-weight: 800;
  text-align: right;
}

.admin-finance-row--overdue .admin-finance-row__amount {
  color: var(--danger);
}

.admin-empty-state {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.company-legal-panel {
  border-color: rgba(31, 122, 91, 0.24);
  background:
    radial-gradient(circle at 95% 5%, rgba(185, 102, 53, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(249, 253, 249, 0.98), rgba(244, 238, 226, 0.88));
}

.company-profile-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(185, 102, 53, 0.24);
  border-radius: 999px;
  color: #7b451f;
  background: #fff4df;
  font-size: 0.78rem;
  font-weight: 800;
}

.company-profile-status.is-complete {
  border-color: rgba(31, 122, 91, 0.26);
  color: #0d6044;
  background: #e4f1eb;
}

.company-profile-actions {
  display: flex;
  justify-content: flex-end;
}

.contract-alerts-panel.is-collapsed .panel-header {
  margin-bottom: 0;
}

.contract-alerts-panel.is-collapsed .contract-alerts-description,
.contract-alerts-panel.is-collapsed .contract-alerts-list {
  display: none;
}

.contract-alert-item {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.8fr) auto;
  border-color: rgba(185, 102, 53, 0.2);
}

.contract-alert-item > div strong,
.contract-alert-item > div span {
  display: block;
}

.contract-alert-item.is-expired {
  border-color: rgba(168, 59, 63, 0.28);
  background: rgba(255, 241, 239, 0.82);
}

.contract-remaining {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.contract-renewal-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 16px 19px;
  border: 1px solid rgba(185, 102, 53, 0.3);
  border-radius: 16px;
  color: #70411f;
  background: #fff4df;
}

.contract-renewal-alert strong,
.contract-renewal-alert span {
  display: block;
}

.contract-renewal-alert.is-expired {
  border-color: rgba(168, 59, 63, 0.3);
  color: #843437;
  background: #fff1ef;
}

.doctor-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.doctor-toolbar--patients {
  margin-bottom: 0;
  grid-template-columns: minmax(0, 1.5fr) auto;
}

.doctor-patients-shell {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 236, 222, 0.64));
}

.doctor-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.doctor-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.doctor-search span {
  color: var(--ink);
  font-weight: 600;
}

.doctor-search-meta {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.doctor-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  display: grid;
  gap: 12px;
}

.doctor-card:hover {
  border-color: rgba(31, 122, 91, 0.18);
  box-shadow: 0 14px 30px rgba(80, 62, 34, 0.08);
}

.doctor-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.doctor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #efe6d7;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.pill-success {
  background: rgba(31, 122, 91, 0.14);
  color: var(--brand-strong);
}

.pill-warning {
  background: rgba(180, 108, 42, 0.16);
  color: #8b531f;
}

.pill-danger {
  background: rgba(192, 65, 65, 0.14);
  color: #8e2e2e;
}

.doctor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.appointment-actions .button {
  padding: 10px 12px;
}

.doctor-schedule {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  color: var(--muted);
}

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

.stack-item {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.stack-item--history {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 239, 226, 0.9));
}

.stack-item h4 {
  margin: 0 0 6px;
}

.history-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.history-item-body {
  min-width: 0;
}

.history-item-date {
  margin-bottom: 12px;
}

.history-item-date h4 {
  margin-bottom: 4px;
}

.history-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.encounter-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.encounter-status--finalized {
  color: #155b48;
  background: #dcefe7;
  border: 1px solid #b9dccc;
}

.encounter-status--draft {
  color: #84501c;
  background: #f7e9d2;
  border: 1px solid #e8cfaa;
}

.history-item-summary {
  display: grid;
  gap: 14px;
}

.history-item-block {
  display: grid;
  gap: 4px;
}

.history-item-block span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-item-block p {
  margin: 0;
  line-height: 1.55;
}

.signature-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.signature-status-head h4 {
  margin-bottom: 4px;
}

.signature-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
}

.signature-status-grid p {
  margin-bottom: 0;
}

.history-item-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(58, 75, 58, 0.08);
}

.history-item-actions .button {
  width: 100%;
  min-height: 48px;
}

.history-item-status {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
}

.history-addendum-button {
  grid-column: 1 / -1;
}

.encounter-addenda {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.encounter-addenda__title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.encounter-addendum {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(233, 242, 237, 0.72);
  border-left: 3px solid var(--brand);
}

.encounter-addendum p {
  margin: 0 0 6px;
  line-height: 1.5;
}

.encounter-addendum small {
  color: var(--muted);
}

.dentistry-alerts {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 18px;
  padding: 14px 18px;
  border-radius: 16px;
  color: #5e3519;
  background: linear-gradient(135deg, #fff4df, #f8e5c6);
  border: 1px solid #e9cfa5;
}

.dentistry-alerts.has-alerts {
  color: #7b2e25;
  background: linear-gradient(135deg, #fff0e9, #f5d8cf);
  border-color: #e5b4a6;
}

.dental-cie10-picker {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(22, 111, 83, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 248, 244, 0.9), rgba(255, 255, 255, 0.88));
}

.dental-cie10-picker .diagnosis-search-results {
  position: static;
  max-height: 240px;
}

.dental-cie10-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--brand-strong);
  background: rgba(216, 239, 229, 0.82);
  border: 1px solid rgba(22, 111, 83, 0.2);
}

.dental-cie10-selected strong {
  display: block;
}

.dental-cie10-selected .button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
}

.dentistry-history-list {
  margin-bottom: 18px;
}

.dentistry-tabs {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 6px 0 14px;
  scrollbar-width: thin;
}

.dentistry-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.dental-ai-launcher {
  box-shadow: 0 10px 22px rgba(20, 104, 78, 0.18);
}

.dental-ai-panel {
  margin: 20px 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid #b9d9cd;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(185, 217, 205, 0.42), transparent 38%),
    #f8fcfa;
}

.dental-ai-panel__header,
.dental-ai-panel__actions,
.dental-ai-suggestion__header,
.dental-ai-suggestion__actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dental-ai-panel__header h4,
.dental-ai-suggestion h5 {
  margin: 0;
}

.dental-ai-panel__header .muted {
  max-width: 760px;
  margin: 6px 0 0;
}

.dental-ai-narrative {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.dental-ai-narrative > span {
  font-weight: 700;
}

.dental-ai-narrative textarea,
.dental-ai-suggestion textarea,
.dental-ai-suggestion input,
.dental-ai-suggestion select {
  width: 100%;
}

.dental-ai-narrative small {
  color: var(--muted);
}

.dental-ai-panel__actions {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dental-ai-suggestions {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.dental-ai-suggestion-group {
  display: grid;
  gap: 12px;
}

.dental-ai-suggestion-group > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d5e5df;
}

.dental-ai-suggestion-group h5 {
  margin: 0;
  font-size: 1rem;
}

.dental-ai-suggestion {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cfe1da;
  border-left: 5px solid #2d8065;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.dental-ai-suggestion--reference {
  border-left-color: #b4813c;
  background: rgba(255, 250, 241, 0.94);
}

.dental-ai-suggestion__value,
.dental-ai-suggestion__notice {
  margin: 0;
}

.dental-ai-suggestion__value {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.5;
}

.dental-ai-suggestion__notice {
  padding: 10px 12px;
  border-radius: 12px;
  color: #6f4b1e;
  background: rgba(230, 194, 139, 0.2);
  font-size: 0.86rem;
}

.dentistry-form .dental-ai-filled-field {
  border-color: #4d9a7f;
  box-shadow: 0 0 0 3px rgba(77, 154, 127, 0.12);
  background: linear-gradient(180deg, #ffffff, #f3faf7);
}

.dental-ai-suggestion.is-reviewed {
  border-left-color: #9aa9a2;
  opacity: 0.74;
}

.dental-ai-suggestion__badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #155a45;
  background: #dff1e9;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dental-ai-suggestion__evidence {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.dental-ai-suggestion__editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dental-ai-suggestion__editor .full {
  grid-column: 1 / -1;
}

.dental-ai-suggestion__actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.dental-ai-suggestion__actions .button {
  min-height: 40px;
}

.dental-ai-empty {
  padding: 18px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 720px) {
  .dentistry-header-actions,
  .dental-ai-panel__header {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .dentistry-header-actions .button,
  .dental-ai-panel__header .button,
  .dental-ai-panel__actions .button,
  .dental-ai-suggestion__actions .button {
    width: 100%;
  }

  .dental-ai-suggestion__editor {
    grid-template-columns: 1fr;
  }

  .dental-ai-suggestion__editor .full {
    grid-column: auto;
  }
}

.dentistry-tab {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  min-width: 132px;
  padding: 9px 13px;
  border-radius: 18px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.dentistry-tab.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.dentistry-tab.has-ai-content::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: #2d8065;
  box-shadow: 0 0 0 3px rgba(45, 128, 101, 0.13);
  vertical-align: middle;
}

.dentistry-tab.is-active.has-ai-content::after {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.dentistry-tab--future {
  opacity: 0.52;
  cursor: not-allowed;
}

.dentistry-clinical-dashboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}

.dentistry-clinical-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(22, 111, 83, 0.16);
  border-radius: 20px;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(222, 242, 232, 0.9), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 245, 0.86));
  box-shadow: 0 10px 26px rgba(30, 48, 38, 0.08);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dentistry-clinical-card::before {
  content: "";
  position: absolute;
  inset: auto 14px 12px 14px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #166f53, #c48842);
  opacity: 0.34;
}

.dentistry-clinical-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 111, 83, 0.34);
  box-shadow: 0 16px 34px rgba(30, 48, 38, 0.13);
}

.dentistry-clinical-card span {
  color: #a45d24;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dentistry-clinical-card strong {
  display: -webkit-box;
  min-height: 2.4em;
  overflow: hidden;
  color: #183327;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.98rem, 1.1vw, 1.16rem);
  line-height: 1.2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dentistry-clinical-card small {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.25;
}

.dental-treatment-care-card {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid rgba(22, 111, 83, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(216, 239, 229, 0.55), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 247, 0.82));
}

.dentistry-prescription-preview {
  margin-top: 4px;
}

.dentistry-prescription-preview__paper {
  display: grid;
  gap: 14px;
  max-width: 760px;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid #e0d2bc;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(22, 111, 83, 0.07) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, #fffdf7, #fffaf0);
  box-shadow:
    0 18px 36px rgba(64, 45, 22, 0.12),
    inset 0 0 0 7px rgba(255, 255, 255, 0.52);
}

.dentistry-prescription-preview__paper header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8dcc8;
}

.dentistry-prescription-preview__paper header p,
.dentistry-prescription-preview__paper dt {
  margin: 0;
  color: #166f53;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dentistry-prescription-preview__paper h5 {
  margin: 5px 0 0;
  color: #1d3328;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.dentistry-prescription-preview__paper header span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid #cfded6;
  border-radius: 999px;
  color: #166f53;
  background: #eef7f2;
  font-size: 0.75rem;
  font-weight: 850;
}

.dentistry-prescription-preview__paper dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.dentistry-prescription-preview__paper dd {
  margin: 4px 0 0;
  color: var(--ink);
  line-height: 1.35;
}

.dentistry-prescription-preview__paper ol {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 22px;
}

.dentistry-prescription-preview__paper li {
  color: var(--muted);
  line-height: 1.45;
}

.dentistry-prescription-preview__paper li strong {
  display: block;
  color: var(--ink);
}

.dentistry-prescription-preview__paper li span {
  display: block;
}

.dentistry-prescription-preview__paper footer {
  padding-top: 10px;
  border-top: 1px dashed #e3d6bf;
  color: #806b4d;
  font-size: 0.82rem;
}

.dentistry-form {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 16px;
}

.dentistry-section {
  min-width: 0;
  max-width: 100%;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.dental-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(232, 241, 235, 0.58);
}

.dental-checkbox-grid--symptoms {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dental-checkbox-grid--symptoms .dental-checkbox-grid__other-symptom {
  grid-column: 6;
}

.dental-checkbox-grid label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: auto;
}

.dental-checkbox-grid input {
  width: 18px;
  height: 18px;
  margin: 0;
}

@media (max-width: 1100px) {
  .dentistry-clinical-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dental-checkbox-grid--symptoms {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .dental-checkbox-grid--symptoms .dental-checkbox-grid__other-symptom {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .dentistry-clinical-dashboard,
  .dentistry-prescription-preview__paper dl {
    grid-template-columns: 1fr;
  }
}

.dentistry-actions {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(252, 249, 242, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(30, 48, 38, 0.12);
  backdrop-filter: blur(12px);
}

.dentistry-actions .muted {
  margin-right: auto;
}

/* Clinical density polish: lighter, calmer workspaces without changing behavior. */
body.doctor-mode .main {
  max-width: 1840px;
  padding: 18px clamp(14px, 1.8vw, 30px) 42px;
}

body.doctor-mode .panel {
  padding: clamp(18px, 1.6vw, 26px);
  border-radius: 22px;
}

body.doctor-mode .panel-header {
  margin-bottom: 18px;
}

body.doctor-mode .form-grid {
  gap: 14px 16px;
}

body.doctor-mode .form-grid label {
  gap: 6px;
}

body.doctor-mode input,
body.doctor-mode select,
body.doctor-mode textarea {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
}

body.doctor-mode textarea {
  min-height: 92px;
}

body.doctor-mode .button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
}

body.doctor-mode .subpanel,
body.doctor-mode .diagnosis-builder,
body.doctor-mode .encounter-upload-box,
body.doctor-mode .dentistry-section {
  padding: clamp(14px, 1.35vw, 20px);
  border-radius: 18px;
}

body.doctor-mode .encounter-tabs,
body.doctor-mode .dentistry-tabs {
  position: sticky;
  top: 8px;
  z-index: 12;
  gap: 7px;
  margin-inline: -2px;
  padding: 7px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.93), rgba(246, 250, 246, 0.88));
  box-shadow:
    0 14px 34px rgba(20, 51, 39, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(16px);
}

body.doctor-mode .encounter-tab,
body.doctor-mode .dentistry-tab {
  min-width: 112px;
  min-height: 46px;
  padding: 8px 11px;
  border-radius: 15px;
  box-shadow: none;
}

body.doctor-mode .clinical-tab-label {
  max-width: 150px;
  overflow: hidden;
  font-size: 0.91rem;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.doctor-mode .clinical-tab-progress {
  max-width: 155px;
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.doctor-mode .encounter-tab-panel {
  min-height: 260px;
  padding: clamp(14px, 1.35vw, 20px);
  border-radius: 18px;
}

body.doctor-mode .encounter-action-bar,
body.doctor-mode .dentistry-actions {
  bottom: 10px;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(247, 250, 247, 0.9));
  box-shadow: 0 -14px 30px rgba(22, 50, 39, 0.08);
}

body.doctor-mode #encounterSaveStatus,
body.doctor-mode #dentistryDraftStatus {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0 auto 0 0;
  padding: 6px 10px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
}

body.doctor-mode .dentistry-clinical-dashboard {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 12px;
}

body.doctor-mode .dentistry-clinical-card {
  min-height: 82px;
  gap: 3px;
  padding: 11px 12px 14px;
  border-radius: 17px;
  box-shadow: 0 8px 20px rgba(30, 48, 38, 0.06);
}

body.doctor-mode .dentistry-clinical-card::before {
  inset: auto 12px 9px 12px;
  height: 2px;
}

body.doctor-mode .dentistry-clinical-card strong {
  min-height: auto;
  font-size: 0.98rem;
  -webkit-line-clamp: 1;
}

body.doctor-mode .dentistry-clinical-card small {
  display: none;
}

body.doctor-mode .dental-ai-panel {
  margin: 14px 0;
  padding: clamp(16px, 1.7vw, 22px);
  border-radius: 22px;
}

body.doctor-mode .dental-chart-grid {
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
}

body.doctor-mode .dental-arch-row {
  min-width: 760px;
}

body.doctor-mode .dental-arch-row__teeth {
  grid-template-columns: repeat(var(--dental-row-columns), minmax(42px, 1fr));
  gap: 5px;
}

body.doctor-mode .dental-tooth-graphic {
  min-height: 98px;
  padding: 6px 4px;
  border-width: 1px;
  border-radius: 14px;
}

body.doctor-mode .dental-tooth-svg {
  width: min(58px, 100%);
}

body.doctor-mode .dental-symbol-guide summary {
  padding: 9px 12px;
}

body.doctor-mode .dental-symbol-guide__grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

@media (max-width: 1200px) {
  body.doctor-mode .dentistry-clinical-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body.doctor-mode .main {
    padding: 14px 10px 34px;
  }

  body.doctor-mode .encounter-tabs,
  body.doctor-mode .dentistry-tabs {
    top: 4px;
    padding: 6px;
  }

  body.doctor-mode .encounter-tab,
  body.doctor-mode .dentistry-tab {
    min-width: 104px;
  }

  body.doctor-mode .dentistry-clinical-dashboard {
    grid-template-columns: 1fr;
  }

  body.doctor-mode .encounter-action-bar,
  body.doctor-mode .dentistry-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body.doctor-mode #encounterSaveStatus,
  body.doctor-mode #dentistryDraftStatus {
    width: 100%;
    border-radius: 14px;
  }
}

.dentistry-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.dentistry-field-note {
  margin: -4px 0 2px;
  font-size: 0.82rem;
}

.dental-chart-section {
  --dental-existing: #25688e;
  --dental-existing-soft: #e1eef6;
  --dental-pathology: #b73535;
  --dental-pathology-soft: #f9e3e1;
  --dental-proposed: #b73535;
  --dental-proposed-soft: #f9e3e1;
  --dental-completed: #25688e;
  --dental-completed-soft: #e1eef6;
  display: grid;
  gap: 18px;
}

.dental-chart-heading {
  align-items: end;
  gap: 20px;
}

.dental-chart-heading .muted {
  margin: 5px 0 0;
}

.dental-chart-view-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  min-width: min(100%, 480px);
}

.dental-chart-view-controls label,
.dental-entry-editor > label {
  display: grid;
  gap: 6px;
}

.dental-chart-view-controls span,
.dental-entry-editor label > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dental-chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dental-chart-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.dental-chart-status i {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: currentColor;
}

.dental-chart-status--pending {
  color: var(--dental-pathology);
  background: var(--dental-pathology-soft);
}

.dental-chart-status--completed {
  color: var(--dental-completed);
  background: var(--dental-completed-soft);
}

.dental-chart-legend__hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.dental-symbol-guide {
  border: 1px solid #d6dfda;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.dental-symbol-guide summary {
  padding: 11px 14px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.dental-symbol-guide__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 0 14px 14px;
}

.dental-symbol-guide__item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid #dce4df;
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
}

.dental-symbol-guide__item b {
  min-width: 42px;
  color: currentColor;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  text-align: center;
}

.dental-symbol-guide__item em {
  display: grid;
  gap: 1px;
  color: var(--ink);
  font-style: normal;
  font-weight: 750;
  line-height: 1.2;
}

.dental-symbol-guide__item small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
}

.dental-symbol-guide__item--pending b { color: var(--dental-pathology); }
.dental-symbol-guide__item--completed b { color: var(--dental-completed); }
.dental-symbol-guide__item--existing b { color: var(--dental-existing); }

.dental-guide-loss-other {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-inline: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
  line-height: 1;
}

.dental-category {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.035em;
}

.dental-category--existing {
  color: var(--dental-existing);
  background: repeating-linear-gradient(45deg, var(--dental-existing-soft), var(--dental-existing-soft) 5px, #fff 5px, #fff 8px);
}

.dental-category--pathology {
  color: var(--dental-pathology);
  background: repeating-linear-gradient(-45deg, var(--dental-pathology-soft), var(--dental-pathology-soft) 4px, #fff 4px, #fff 7px);
}

.dental-category--proposed {
  color: var(--dental-proposed);
  border-style: dashed;
  background: var(--dental-proposed-soft);
}

.dental-category--completed {
  color: var(--dental-completed);
  border-style: double;
  background: var(--dental-completed-soft);
}

.dental-chart-grid {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #cfdad4;
  border-radius: 20px;
  overflow-x: auto;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(30, 76, 59, 0.15) 50%, transparent calc(50% + 1px)),
    linear-gradient(180deg, rgba(239, 246, 242, 0.94), rgba(255, 252, 246, 0.9));
}

.dental-arch-row {
  display: grid;
  gap: 6px;
  min-width: 880px;
}

.dental-arch-row:nth-child(2) {
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(30, 76, 59, 0.18);
}

.dental-arch-row__label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.dental-arch-row__teeth {
  display: grid;
  grid-template-columns: repeat(var(--dental-row-columns), minmax(48px, 1fr));
  gap: 7px;
}

.dental-arch-row--primary .dental-arch-row__teeth {
  width: 62.5%;
  margin-inline: auto;
}

.dental-tooth-graphic {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 122px;
  padding: 7px 5px 8px;
  border: 2px solid #c9d5cf;
  border-radius: 16px;
  color: var(--ink);
  background: #fffefb;
  box-shadow: 0 7px 16px rgba(35, 57, 46, 0.07);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.dental-tooth-graphic:hover,
.dental-tooth-graphic:focus-visible,
.dental-tooth-graphic.is-selected {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 10px 22px rgba(24, 99, 73, 0.17);
  outline: none;
}

.dental-tooth-graphic__code {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.94rem;
  font-weight: 800;
}

.dental-tooth-graphic__type {
  color: var(--muted);
  font-size: 0.58rem;
}

.dental-tooth-svg {
  width: min(72px, 100%);
  aspect-ratio: 1;
  overflow: visible;
}

.dental-chart-surface {
  stroke: #83958c;
  stroke-width: 1.5;
  fill: #fff;
  cursor: pointer;
  transition: fill 120ms ease, stroke 120ms ease, filter 120ms ease;
}

.dental-chart-surface:hover,
.dental-chart-surface:focus-visible,
.dental-chart-surface.is-selected {
  stroke: var(--brand);
  stroke-width: 3;
  filter: brightness(0.97);
  outline: none;
}

.dental-chart-surface--pending {
  stroke: var(--dental-pathology);
  stroke-width: 2.5;
  fill: var(--dental-pathology-soft);
}

.dental-chart-surface--completed {
  stroke: var(--dental-completed);
  stroke-width: 2.5;
  fill: var(--dental-completed);
}

.dental-symbol {
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 800;
}

.dental-symbol--pending { color: var(--dental-pathology); }
.dental-symbol--completed { color: var(--dental-completed); }
.dental-symbol--existing { color: var(--dental-existing); }
.dental-symbol--contrast {
  color: #fff;
  filter: drop-shadow(0 1px 1px rgba(12, 42, 32, 0.72));
}
.dental-symbol .is-dashed { stroke-dasharray: 5 5; }

.dental-tooth-dialog {
  width: min(780px, 100%);
  background: linear-gradient(145deg, rgba(248, 252, 249, 0.98), rgba(255, 249, 240, 0.95));
}

.dental-tooth-panel__header,
.dental-entry-actions,
.dental-entry-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dental-entry-editor__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dental-entry-editor__fields label {
  padding: 10px 12px 12px;
  border: 1px solid #d3ded8;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
}

.dental-entry-editor__fields label > span {
  display: block;
  margin-bottom: 6px;
}

.dental-entry-editor__fields select {
  width: 100%;
}

.dental-entry-editor,
.dental-tooth-clinical-state {
  display: grid;
  align-content: start;
  gap: 14px;
}

.dental-tooth-panel__header .muted {
  margin: 4px 0 0;
}

.dental-tooth-history-disclosure {
  margin-top: 18px;
  border: 1px solid #d1ddd7;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.dental-tooth-history-disclosure summary {
  padding: 13px 15px;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.dental-tooth-history-disclosure .dental-tooth-clinical-state {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 15px 15px;
}

.dental-surface-fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.dental-surface-fieldset legend {
  padding: 0 7px;
  font-weight: 800;
}

.dental-surface-selector {
  display: grid;
  grid-template: repeat(3, 52px) / repeat(3, 52px);
  justify-content: center;
  gap: 5px;
  margin: 4px auto 10px;
}

.dental-surface-button {
  border: 2px solid #aebdb5;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.dental-surface-button[data-surface="V"] { grid-area: 1 / 2; }
.dental-surface-button[data-surface="M"] { grid-area: 2 / 1; }
.dental-surface-button[data-surface="O"],
.dental-surface-button[data-surface="I"] { grid-area: 2 / 2; }
.dental-surface-button[data-surface="D"] { grid-area: 2 / 3; }
.dental-surface-button[data-surface="L"] { grid-area: 3 / 2; }

.dental-surface-button.is-selected {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(25, 112, 82, 0.14);
}

.dental-surface-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.dental-entry-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.dental-entry-card {
  padding: 13px 14px;
  border-left: 4px solid #9aaba2;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(193, 207, 200, 0.72);
}

.dental-entry-card[data-category="EXISTING"] { border-left-color: var(--dental-existing); }
.dental-entry-card[data-category="PATHOLOGY"] { border-left-color: var(--dental-pathology); }
.dental-entry-card[data-category="PROPOSED"] { border-left-color: var(--dental-proposed); border-left-style: dashed; }
.dental-entry-card[data-category="COMPLETED"] { border-left-color: var(--dental-completed); border-left-style: double; }

.dental-entry-card p {
  margin: 5px 0 0;
  line-height: 1.45;
}

.dental-entry-card small {
  color: var(--muted);
}

.dental-entry-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.dental-entry-card__buttons .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.75rem;
}

.dental-treatment-section {
  display: grid;
  gap: 18px;
  background:
    radial-gradient(circle at 95% 5%, rgba(194, 220, 207, 0.42), transparent 34%),
    rgba(255, 255, 255, 0.76);
}

.dental-treatment-heading {
  align-items: end;
  gap: 18px;
}

.dental-treatment-heading .muted {
  max-width: 760px;
  margin: 5px 0 0;
}

.dental-treatment-composer,
.dental-session-composer,
.dental-session-clinical-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 12px;
}

.dental-treatment-composer {
  padding: 18px;
  border: 1px solid #cad8d1;
  border-radius: 20px;
  background: rgba(248, 252, 249, 0.9);
}

.dental-treatment-composer > *,
.dental-session-composer > *,
.dental-session-clinical-fields > *,
.dental-session-appointment > * {
  min-width: 0;
  max-width: 100%;
}

.dental-treatment-composer select,
.dental-session-composer select,
.dental-session-clinical-fields select,
.dental-session-appointment select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.dental-treatment-composer label,
.dental-session-composer label,
.dental-session-clinical-fields label,
.dental-session-appointment label {
  display: grid;
  gap: 6px;
}

.dental-treatment-composer label > span,
.dental-session-composer label > span,
.dental-session-clinical-fields label > span,
.dental-session-appointment label > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.dental-treatment-composer .full,
.dental-session-clinical-fields .full {
  grid-column: 1 / -1;
}

.dental-treatment-surfaces {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.dental-treatment-surfaces legend {
  padding: 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.dental-treatment-surface-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.dental-treatment-surface-options label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 42px;
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 11px;
  background: #fff;
}

.dental-treatment-surface-options input {
  width: 18px;
  height: 18px;
}

.dental-treatment-composer__actions,
.dental-treatment-plan-actions,
.dental-session-actions,
.dental-session-appointment {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.dental-treatment-plan-list,
.dental-treatment-session-list,
.dental-treatment-items {
  display: grid;
  gap: 12px;
}

.dental-treatment-plan-card,
.dental-session-card {
  padding: 18px;
  border: 1px solid #ccd8d2;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 9px 22px rgba(30, 56, 43, 0.06);
}

.dental-treatment-plan-card.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(25, 112, 82, 0.1), 0 12px 26px rgba(30, 56, 43, 0.08);
}

.dental-treatment-plan-card > header,
.dental-session-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dental-treatment-plan-card h5,
.dental-session-card h5 {
  margin: 5px 0 0;
  font-size: 1.08rem;
}

.dental-treatment-items {
  margin: 14px 0;
}

.dental-treatment-item {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-left: 4px solid #9a6515;
  border-radius: 13px;
  background: #fbf7ee;
}

.dental-treatment-item > div:first-child {
  display: grid;
  gap: 3px;
}

.dental-treatment-item small,
.dental-treatment-item span {
  color: var(--muted);
}

.dental-treatment-status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid #c5d2cb;
  border-radius: 999px;
  color: #40534a;
  background: #edf2ef;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dental-treatment-status[data-status="IN_PROGRESS"],
.dental-treatment-status[data-status="PARTIALLY_ACCEPTED"] { color: #7a5216; border-color: #ddc58f; background: #fbefcf; }
.dental-treatment-status[data-status="COMPLETED"],
.dental-treatment-status[data-status="ACCEPTED"] { color: #17634c; border-color: #acd0c0; background: #e2f2eb; }
.dental-treatment-status[data-status="REJECTED"],
.dental-treatment-status[data-status="CANCELLED"] { color: #8a332d; border-color: #e1b0aa; background: #f8e5e2; }

.dental-partial-choice,
.dental-consent-exception {
  display: flex !important;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 750;
}

.dental-partial-choice input,
.dental-consent-exception input {
  width: 18px;
  height: 18px;
}

.dental-consent-signed {
  color: #17634c !important;
  font-size: 0.75rem;
  font-weight: 800;
}

.dental-session-composer {
  grid-template-columns: repeat(3, minmax(190px, 1fr)) auto;
  align-items: end;
  padding: 16px;
  border-radius: 18px;
  background: #eef5f1;
}

.dental-session-clinical-fields {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  margin: 14px 0;
}

.dental-session-appointment {
  justify-content: flex-start;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

@media (max-width: 720px) {
  .dentistry-alerts,
  .dentistry-history-item,
  .dentistry-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dentistry-actions {
    position: static;
  }

  .dentistry-actions .button {
    width: 100%;
  }

  .dentistry-history-actions {
    justify-content: stretch;
    width: 100%;
  }

  .dentistry-history-actions .button {
    flex: 1 1 180px;
  }

  .dentistry-section {
    padding: 14px;
  }

  .dental-chart-heading,
  .dental-tooth-panel__header,
  .dental-entry-actions,
  .dental-treatment-heading,
  .dental-treatment-plan-card > header,
  .dental-session-card > header {
    align-items: stretch;
    flex-direction: column;
  }

  .dental-chart-view-controls,
  .dental-entry-editor__fields,
  .dental-tooth-history-disclosure .dental-tooth-clinical-state,
  .dental-treatment-composer,
  .dental-session-composer,
  .dental-session-clinical-fields {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .dental-chart-grid {
    padding: 12px;
  }

  .dental-tooth-graphic {
    min-height: 112px;
  }

  .dental-symbol-guide__grid {
    grid-template-columns: 1fr;
  }

  .dental-treatment-item {
    grid-template-columns: 1fr;
  }

  .dental-treatment-composer__actions,
  .dental-treatment-plan-actions,
  .dental-session-actions,
  .dental-session-appointment {
    align-items: stretch;
    flex-direction: column;
  }

  .dental-treatment-composer__actions .button,
  .dental-treatment-plan-actions .button,
  .dental-session-actions .button,
  .dental-session-appointment .button {
    width: 100%;
  }
}

@media (min-width: 721px) and (max-width: 1080px) {
  .dental-treatment-composer,
  .dental-session-composer,
  .dental-session-clinical-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dental-arch-row {
    min-width: 820px;
  }
}

#doctorPatientsList .stack-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 241, 230, 0.88));
}

.patient-card-head {
  position: relative;
  min-height: 156px;
}

.patient-card-body {
  min-width: 0;
  padding-right: 210px;
}

.patient-card-details {
  display: grid;
  gap: 8px;
}

.patient-card-details p {
  margin: 0;
}

.patient-card-details strong {
  color: var(--ink);
}

.patient-card-actions {
  position: absolute;
  top: 8px;
  right: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}

.patient-card-actions .button {
  width: auto;
  min-width: 128px;
}

.patient-created-actions {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(236, 246, 239, 0.9));
  display: grid;
  gap: 12px;
}

.encounter-upload-box {
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed rgba(58, 75, 58, 0.2);
  background: rgba(255, 255, 255, 0.54);
}

.dental-attachments-box {
  display: grid;
  gap: 16px;
}

.dental-attachments-box .attachment-guideline {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  line-height: 1.5;
}

.dental-attachment-file-picker input {
  width: 100%;
  max-width: 100%;
}

.is-invalid {
  border-color: rgba(192, 65, 65, 0.5) !important;
  box-shadow: 0 0 0 4px rgba(192, 65, 65, 0.08);
}

.diagnosis-builder.is-invalid,
.encounter-upload-box.is-invalid,
.validation-summary.is-invalid,
.patient-history-preview.is-invalid {
  border-style: solid;
  background: linear-gradient(180deg, rgba(255, 249, 249, 0.98), rgba(251, 238, 238, 0.94));
}

.attachment-guideline {
  display: inline-flex;
  align-items: center;
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 122, 91, 0.16);
  background: linear-gradient(180deg, rgba(236, 246, 239, 0.95), rgba(247, 241, 230, 0.95));
  color: var(--brand-strong);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.pending-attachment-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 236, 222, 0.88));
}

.pending-attachment-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.pending-attachment-remove {
  min-width: 48px;
  padding-inline: 0;
  font-weight: 800;
}

.encounter-top-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.encounter-top-panels--single {
  grid-template-columns: 1fr;
}

.encounter-top-panel {
  min-height: 100%;
}

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

.doctor-notifications {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(247, 241, 228, 0.72), rgba(255, 255, 255, 0.92));
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.74);
}

.notification-item--unread {
  border-color: rgba(23, 102, 77, 0.24);
  background: rgba(231, 241, 236, 0.82);
}

.notification-item__marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.notification-item--unread .notification-item__marker {
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(23, 102, 77, 0.1);
}

.notification-item h4,
.notification-item p {
  margin: 0 0 4px;
}

.notification-item p,
.notification-item small {
  color: var(--muted);
}

.doctor-absence-assistant {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 96% 2%, rgba(169, 104, 50, 0.1), transparent 24rem),
    rgba(255, 255, 255, 0.72);
}

.assistant-launcher {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 8px 16px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--brand-strong), #0b4938);
  box-shadow: 0 18px 46px rgba(12, 61, 47, 0.28);
  cursor: pointer;
  animation: assistant-launcher-in 0.45s ease both;
}

.assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(12, 61, 47, 0.34);
}

.assistant-launcher__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-strong);
  background: var(--paper);
}

.assistant-launcher__icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-launcher__label {
  display: grid;
  gap: 2px;
  text-align: left;
}

.assistant-launcher__label small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
}

.assistant-launcher--doctor .assistant-launcher__label {
  text-align: center;
}

@media (min-width: 721px) {
  .assistant-launcher {
    justify-content: center;
    padding: 10px 24px;
  }

  .assistant-launcher .assistant-launcher__icon {
    display: none;
  }

  .assistant-launcher .assistant-launcher__label {
    text-align: center;
  }
}

.assistant-widget,
.assistant-floating-panel {
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 95;
  width: min(460px, calc(100vw - 32px));
  height: min(740px, calc(100vh - 40px));
  border: 1px solid rgba(23, 63, 50, 0.16);
  border-radius: 26px;
  background: var(--panel-strong);
  box-shadow: 0 28px 80px rgba(5, 31, 23, 0.3);
  animation: assistant-panel-in 0.32s ease both;
}

.assistant-widget {
  display: flex;
  overflow: hidden;
  flex-direction: column;
}

.assistant-widget__header {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: white;
  background:
    radial-gradient(circle at 88% 10%, rgba(183, 113, 55, 0.34), transparent 12rem),
    var(--brand-strong);
}

.assistant-widget__identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.assistant-widget__identity > span:last-child {
  display: grid;
  gap: 3px;
}

.assistant-widget__identity small {
  color: rgba(255, 255, 255, 0.74);
}

.assistant-widget__identity i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #87d9a2;
  box-shadow: 0 0 0 4px rgba(135, 217, 162, 0.12);
}

.assistant-widget__avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px 14px 14px 4px;
  font-family: Georgia, serif;
  font-size: 1.1rem;
}

.assistant-widget iframe {
  width: 100%;
  flex: 1;
  border: 0;
  background: var(--paper);
}

.assistant-panel-close {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.assistant-panel-close--light {
  color: white;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
}

.assistant-floating-panel {
  max-height: calc(100vh - 40px);
  height: min(720px, calc(100vh - 36px));
  overflow: hidden;
  margin: 0;
  padding: 20px;
}

.doctor-absence-assistant.assistant-floating-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 12px;
}

.assistant-floating-panel > .panel-header:first-child {
  position: sticky;
  top: -20px;
  z-index: 2;
  margin: -20px -20px 2px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
}

@keyframes assistant-launcher-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes assistant-panel-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.absence-chat {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.absence-chat__message {
  display: flex;
  gap: 11px;
  width: min(82%, 720px);
}

.absence-chat__message > div {
  padding: 10px 13px;
  border-radius: 6px 18px 18px 18px;
  background: var(--brand-soft);
}

.absence-chat__message p {
  margin: 4px 0 0;
  line-height: 1.5;
  white-space: pre-line;
}

.absence-chat__message--user {
  justify-self: end;
}

.absence-chat__message--user > div {
  color: white;
  background: var(--brand-strong);
  border-radius: 18px 6px 18px 18px;
}

.absence-chat__message--user p,
.absence-chat__message--user strong {
  color: #fff;
}

.absence-chat__choices {
  display: grid;
  gap: 8px;
  margin-left: 45px;
}

.absence-chat__choice {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--brand-strong);
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.absence-chat__choice:hover,
.absence-chat__choice:focus-visible {
  border-color: var(--brand-strong);
  background: var(--brand-soft);
}

.absence-chat__choice:disabled {
  cursor: default;
  opacity: 0.55;
}

.absence-chat__message--thinking {
  opacity: 0.7;
}

.absence-chat__avatar {
  flex: 0 0 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  color: white;
  background: var(--brand-strong);
  font-family: Georgia, serif;
  font-weight: 700;
}

.absence-chat__suggestions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.absence-chat__suggestions::-webkit-scrollbar {
  display: none;
}

.absence-chat__suggestions button {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-strong);
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  font-size: 0.86rem;
  white-space: nowrap;
}

.absence-chat__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 2px;
}

.absence-chat__composer textarea {
  resize: vertical;
  min-height: 58px;
  max-height: 118px;
}

.doctor-absence-assistant .absence-chat__composer {
  grid-template-columns: minmax(0, 1fr) auto;
}

.doctor-absence-assistant .absence-chat__composer textarea {
  width: 100%;
  min-height: 68px;
}

.doctor-absence-assistant .absence-chat__composer .button {
  min-width: 96px;
  height: 48px;
  justify-self: end;
}

.absence-time-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.absence-preview {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(169, 104, 50, 0.28);
  border-radius: 18px;
  background: var(--warm-soft);
}

.assistant-message-inline p {
  margin: 6px 0 0;
  color: var(--muted);
}

.absence-affected-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.absence-affected-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.absence-affected-item strong,
.absence-affected-item span {
  display: block;
}

.absence-affected-item span,
.absence-affected-item small {
  color: var(--muted);
}

.absence-confirmation {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0;
}

.absence-confirmation input {
  min-height: auto;
  width: auto;
  margin-top: 3px;
}

.absence-item--active {
  border-color: rgba(23, 102, 77, 0.22);
}

.absence-item__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.absence-status {
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--bg-accent);
  color: var(--muted);
}

.absence-status--active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

@media (max-width: 720px) {
  body:has(#dentistryWorkspace:not(.hidden)) .assistant-launcher--doctor {
    display: none;
  }

  .assistant-launcher {
    right: 14px;
    bottom: 14px;
    min-height: 58px;
  }
  .assistant-launcher__label {
    display: none;
  }
  .assistant-launcher {
    width: 58px;
    padding: 6px;
  }
  .assistant-widget,
  .assistant-floating-panel {
    inset: 10px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 22px;
  }
  .assistant-floating-panel {
    overflow-y: auto;
  }
  .absence-chat__message {
    width: 92%;
  }
  .absence-chat__composer {
    grid-template-columns: 1fr;
  }
  .absence-time-fields {
    grid-template-columns: 1fr;
  }
  .absence-affected-item {
    display: grid;
  }
}

.summary-card {
  min-height: 132px;
  padding: 18px 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(245, 236, 222, 0.94));
  border: 1px solid var(--line);
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.summary-card--interactive {
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.summary-card--interactive:hover,
.summary-card--interactive:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(31, 122, 91, 0.25);
  box-shadow: 0 14px 30px rgba(80, 62, 34, 0.08);
  outline: none;
}

.summary-card strong {
  display: block;
  font-size: clamp(2rem, 2.4vw, 2.35rem);
  line-height: 1;
  margin-top: 0;
}

.doctor-hero-schedule {
  padding-top: 2px;
}

.doctor-hero-schedule__header {
  margin-bottom: 14px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 340px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #19352c;
  color: white;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--danger);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 28, 24, 0.38);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 120;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(82vh, 900px);
  overflow: auto;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(244, 235, 222, 0.96));
  box-shadow: 0 34px 90px rgba(25, 34, 27, 0.22);
}

.modal-card--compact {
  width: min(620px, 100%);
}

.modal-card--ai-draft {
  width: min(760px, 100%);
}

.modal-card--history {
  width: min(1180px, 100%);
}

.modal-card--payments {
  width: min(980px, 100%);
}

#doctorPaymentsPanel {
  z-index: 100;
}

#doctorPaymentTermsPanel {
  z-index: 100;
}

.modal-card__header {
  position: sticky;
  top: 0;
  background: inherit;
  padding-bottom: 10px;
  z-index: 2;
}

.history-modal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.history-modal-summary__item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(58, 75, 58, 0.1);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 6px;
}

.history-modal-summary__item span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-modal-summary__item strong {
  color: var(--ink);
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.history-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.86fr);
  gap: 18px;
  align-items: start;
}

.history-modal-panel {
  min-height: 100%;
}

.history-modal-panel--attachments {
  position: sticky;
  top: 96px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

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

.document-actions .button {
  width: 100%;
  min-height: 50px;
}

.medical-exam-order-document-actions {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(31, 122, 91, 0.2);
  border-radius: 20px;
  background: rgba(235, 247, 241, 0.76);
}

.medical-exam-order-document-actions.hidden {
  display: none;
}

.compact-field {
  min-width: 190px;
  max-width: 240px;
}

.compact-field span {
  display: block;
  margin-bottom: 0.35rem;
}

.modal-card--exam-order {
  width: min(900px, 100%);
}

.medical-exam-order-editor {
  display: grid;
  gap: 18px;
  padding-top: 14px;
}

.medical-exam-order-details {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.medical-exam-order-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.medical-exam-order-item__content {
  display: grid;
  gap: 4px;
}

.medical-exam-order-item__content p,
.medical-exam-order-item__content small {
  margin: 0;
}

.medical-exam-order-status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(31, 122, 91, 0.12);
  color: var(--green-900);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.medical-exam-order-status--cancelled {
  background: rgba(192, 65, 65, 0.12);
  color: var(--danger);
}

#certificateRestDaysField.is-disabled {
  opacity: 0.56;
}

.ai-prompt-guide {
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  background: rgba(255, 255, 255, 0.74);
  display: grid;
  gap: 14px;
}

.ai-prompt-guide__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ai-prompt-guide__panel {
  display: grid;
  gap: 12px;
}

.ai-prompt-guide__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-prompt-guide__actions .button {
  width: 100%;
}

.ai-prompt-guide__button {
  flex-shrink: 0;
}

.ai-prompt-guide__content {
  margin: 0;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(35, 61, 43, 0.1);
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.92), rgba(247, 240, 228, 0.9));
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
  line-height: 1.58;
  white-space: pre-wrap;
}

.ai-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 10px;
}

.ai-dictation-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.ai-dictation-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(185, 39, 39, 0.1);
  color: #9f1f1f;
  font-size: 0.84rem;
  font-weight: 700;
}

.ai-dictation-live__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cf2f2f;
  box-shadow: 0 0 0 0 rgba(207, 47, 47, 0.45);
  animation: ai-dictation-pulse 1.2s ease-out infinite;
}

.ai-dictation-toolbar__button {
  padding: 10px 14px;
}

.ai-dictation-toolbar__button--active {
  background: linear-gradient(135deg, #b83535, #d14b4b);
  color: white;
  animation: ai-dictation-button-pulse 1.4s ease-in-out infinite;
}

.ai-dictation-toolbar__button--active:hover {
  transform: translateY(-1px);
}

.ai-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.ai-processing-status {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(31, 122, 91, 0.16);
  background: linear-gradient(180deg, rgba(239, 248, 243, 0.96), rgba(227, 240, 232, 0.9));
  display: grid;
  gap: 4px;
}

.ai-processing-status strong,
.ai-processing-status p {
  margin: 0;
}

.ai-processing-status strong {
  color: var(--brand-strong);
  font-size: 0.92rem;
}

.ai-processing-progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 122, 91, 0.12);
}

.ai-processing-progress__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  transition: width 260ms ease;
}

.ai-processing-progress__percent {
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

@keyframes ai-dictation-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(207, 47, 47, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(207, 47, 47, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(207, 47, 47, 0);
  }
}

@keyframes ai-dictation-button-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(184, 53, 53, 0.16);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(184, 53, 53, 0.04);
  }
}

.certificate-signing-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
}

.certificate-signing-preview {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 240, 228, 0.92));
  padding: 20px;
  min-height: 420px;
  display: grid;
  gap: 16px;
}

.certificate-preview-sheet-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.certificate-preview-card {
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.certificate-preview-card h4,
.certificate-preview-card p {
  margin: 0;
}

.certificate-preview-highlight {
  border: 2px dashed rgba(31, 122, 91, 0.4);
  border-radius: 20px;
  padding: 18px;
  background: rgba(31, 122, 91, 0.06);
  display: grid;
  gap: 8px;
}

.certificate-preview-highlight strong {
  font-size: 1.1rem;
}

.certificate-preview-highlight .signature-line {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(31, 122, 91, 0.22);
}

.doctor-calendar-panel {
  padding: 24px;
  border: 1px solid rgba(23, 91, 70, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 96% 4%, rgba(220, 145, 78, 0.11), transparent 34%),
    rgba(255, 255, 252, 0.84);
}

.doctor-calendar-panel .panel-header {
  align-items: center;
}

.calendar-connections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.calendar-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(23, 91, 70, 0.14);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
}

.calendar-connection--default {
  border-color: rgba(18, 112, 82, 0.42);
  box-shadow: inset 3px 0 0 #167252;
}

.calendar-connection__identity,
.calendar-connection__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-connection__identity {
  min-width: 0;
}

.calendar-connection__identity > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.calendar-connection__identity span,
.calendar-connection__identity small {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.calendar-provider-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-weight: 800;
}

.calendar-provider-icon--google {
  background: linear-gradient(145deg, #4285f4, #1b64ce);
}

.calendar-default-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: #dfeee8;
  color: #0e5e43;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-connection__error {
  color: #a33b3b !important;
}

@media (max-width: 1100px) {
  .calendar-connections {
    grid-template-columns: 1fr;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .grid.two-cols,
  .doctor-workspace-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .encounter-top-panels {
    grid-template-columns: 1fr;
  }

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

  .doctor-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .doctor-hero__content {
    padding: 22px 20px;
  }

  .doctor-hero__content h2 {
    font-size: 2rem;
  }

  .schedule-day__times {
    grid-template-columns: 1fr;
  }

  .schedule-composer__header {
    grid-template-columns: 1fr;
  }

  .setup-payment-composer__header {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-payment-composer__header .button {
    width: 100%;
  }

  .schedule-composer__controls,
  .schedule-card__times {
    grid-template-columns: 1fr;
  }

  .diagnosis-builder__search {
    grid-template-columns: 1fr;
  }

  .medication-row__grid {
    grid-template-columns: 1fr;
  }

  .doctor-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .doctor-toolbar--patients {
    grid-template-columns: 1fr;
  }

  .doctor-session-badge {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .doctor-toolbar-actions {
    justify-content: flex-start;
  }

  .modal-actions {
    justify-content: stretch;
  }

  .modal-actions .button {
    width: 100%;
  }

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

  .certificate-signing-layout {
    grid-template-columns: 1fr;
  }

  .history-modal-summary {
    grid-template-columns: 1fr 1fr;
  }

  .history-modal-layout {
    grid-template-columns: 1fr;
  }

  .history-modal-panel--attachments {
    position: static;
    top: auto;
  }

  .patient-card-head {
    min-height: 0;
  }

  .patient-card-body {
    padding-right: 0;
  }

  .patient-card-actions {
    position: static;
    width: 100%;
  }

  .history-item-head {
    grid-template-columns: 1fr;
  }

  .history-item-actions {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .doctor-search-meta {
    white-space: normal;
  }

  .form-grid button,
  .form-grid label:last-of-type,
  .form-grid .full {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  body.logged-out .main {
    padding: 20px 14px;
    align-content: start;
  }

  body.logged-out #loginSection {
    padding: 22px 18px;
  }

  .history-modal-summary {
    grid-template-columns: 1fr;
  }
}

/* Visual system: sober clinical workspace */
html {
  font-size: 85%;
  scroll-behavior: smooth;
}

body,
input,
select,
textarea,
button {
  font-feature-settings: "kern" 1, "liga" 1;
}

h1,
h2,
h3,
h4 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  color: var(--ink);
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  line-height: 1.1;
}

h3 {
  font-size: clamp(1.2rem, 1.5vw, 1.55rem);
  line-height: 1.2;
}

h4 {
  font-size: 1.08rem;
}

p {
  color: var(--ink-soft);
}

::selection {
  background: rgba(23, 102, 77, 0.18);
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--warm);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.muted {
  color: var(--muted);
}

.panel,
.card {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.modal-card__header + .form-grid,
.modal-card__header + .history-modal-summary,
.modal-card__header + .certificate-signing-layout {
  padding-top: 8px;
}

.panel {
  padding: clamp(22px, 2.2vw, 34px);
  border-radius: 24px;
}

.card {
  border-radius: 18px;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h1,
.panel-header h2,
.panel-header h3 {
  margin-bottom: 0;
}

.subpanel {
  padding: clamp(18px, 1.7vw, 26px);
  border-radius: 18px;
  border-color: var(--line);
  background: #f8faf7;
}

.top-gap {
  margin-top: 24px;
}

body:not(.doctor-mode):not(.logged-out) .sidebar {
  position: relative;
  overflow: hidden;
  padding: 28px clamp(26px, 3.2vw, 54px);
  border: 0;
  background:
    radial-gradient(circle at 78% 20%, rgba(224, 190, 145, 0.15), transparent 24%),
    linear-gradient(120deg, #0f4636, #173f33 58%, #253c34);
  box-shadow: 0 14px 40px rgba(11, 47, 35, 0.14);
}

body:not(.doctor-mode):not(.logged-out) .sidebar::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: -72px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.025), 0 0 0 68px rgba(255, 255, 255, 0.018);
}

body:not(.doctor-mode):not(.logged-out) .sidebar > * {
  position: relative;
  z-index: 1;
}

body:not(.doctor-mode):not(.logged-out) #workspaceTitle,
body:not(.doctor-mode):not(.logged-out) #workspaceDescription {
  color: #f8fbf8;
}

body:not(.doctor-mode):not(.logged-out) #workspaceDescription {
  color: rgba(247, 251, 248, 0.72);
}

body:not(.doctor-mode):not(.logged-out) .sidebar .eyebrow {
  color: #deb680;
}

body:not(.doctor-mode):not(.logged-out) .sidebar-session-card {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  backdrop-filter: blur(20px);
}

body:not(.doctor-mode):not(.logged-out) .sidebar-session-card .label,
body:not(.doctor-mode):not(.logged-out) .sidebar-session-card .session-status__label {
  color: rgba(255, 255, 255, 0.58);
}

body:not(.doctor-mode):not(.logged-out) .sidebar-session-card strong,
body:not(.doctor-mode):not(.logged-out) .sidebar-session-card .session-status__email {
  color: white;
}

body:not(.doctor-mode):not(.logged-out) .sidebar-session-card .session-status__state {
  background: rgba(221, 239, 228, 0.14);
  color: #dff4e8;
}

body:not(.doctor-mode):not(.logged-out) .sidebar-session-card .button-secondary {
  margin-top: 10px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

body.logged-out {
  background:
    radial-gradient(circle at 18% 14%, rgba(23, 102, 77, 0.16), transparent 30%),
    radial-gradient(circle at 85% 86%, rgba(169, 104, 50, 0.11), transparent 26%),
    linear-gradient(145deg, #eef3ee, #f9faf7 48%, #eff1eb);
}

body.logged-out #loginSection {
  position: relative;
  width: min(520px, 100%);
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid rgba(25, 73, 54, 0.13);
  border-radius: 28px;
  background: rgba(255, 255, 252, 0.94);
  box-shadow: 0 34px 90px rgba(24, 58, 43, 0.15);
  animation: interface-rise 480ms ease both;
}

body.logged-out #loginSection::after {
  content: "Acceso clinico seguro";
  display: block;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

body.logged-out #loginSection .panel-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  justify-content: start;
  gap: 16px;
  margin-bottom: 30px;
}

body.logged-out #loginSection .panel-header::before {
  content: "SM";
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 17px 17px 17px 6px;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  color: white;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 24px rgba(23, 102, 77, 0.2);
}

body.logged-out #loginSection h2 {
  font-size: 2rem;
}

body.logged-out #loginForm {
  gap: 18px;
}

body.logged-out #loginForm .button[type="submit"] {
  min-height: 52px;
  margin-top: 4px;
}

.doctor-hero {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 16px;
  margin-bottom: 28px;
}

.doctor-hero__content {
  min-height: 220px;
  padding: clamp(28px, 3.3vw, 48px);
  border: 0;
  border-radius: 26px;
  background:
    radial-gradient(circle at 88% 14%, rgba(226, 189, 135, 0.2), transparent 25%),
    linear-gradient(125deg, #0e4937, #195b46 60%, #254f42);
  box-shadow: 0 24px 50px rgba(17, 68, 50, 0.17);
}

.doctor-hero__content::after {
  content: "";
  position: absolute;
  right: -44px;
  bottom: -86px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.025), 0 0 0 68px rgba(255, 255, 255, 0.016);
}

.doctor-hero__content > * {
  position: relative;
  z-index: 1;
}

.doctor-hero__content h2,
.doctor-hero__content .muted {
  color: white;
}

.doctor-hero__content .muted {
  color: rgba(255, 255, 255, 0.72);
}

.doctor-hero__content .eyebrow {
  color: #e4bd88;
}

.doctor-hero__pill {
  min-height: 34px;
  padding-inline: 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.12);
  color: #e7f5ed;
  font-size: 0.76rem;
  backdrop-filter: blur(10px);
}

.doctor-hero__pill--soft {
  background: rgba(224, 184, 128, 0.14);
  color: #f4d5aa;
}

.doctor-session-badge {
  padding: 24px;
  border-radius: 26px;
  background: rgba(255, 255, 252, 0.95);
  box-shadow: var(--shadow-soft);
}

.doctor-session-badge .session-status__state {
  border: 1px solid rgba(23, 102, 77, 0.12);
  background: var(--brand-soft);
}

.summary-grid {
  gap: 12px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  padding: 20px 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}

.summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), rgba(23, 102, 77, 0.16));
}

.summary-card span,
.summary-card p {
  color: var(--muted);
}

.summary-card strong {
  color: var(--ink);
  font-family: "Iowan Old Style", Georgia, serif;
  font-weight: 700;
}

.summary-card--interactive:hover,
.summary-card--interactive:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(23, 102, 77, 0.24);
  box-shadow: 0 14px 30px rgba(27, 48, 38, 0.08);
}

.doctor-hero-schedule {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.grid.two-cols,
.doctor-workspace-grid {
  gap: 18px;
}

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

.form-grid {
  gap: 18px 16px;
}

.form-grid label {
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.form-grid label span,
.doctor-search span,
.schedule-slot-field span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

input,
select,
textarea {
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea {
  min-height: 104px;
  line-height: 1.58;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(23, 102, 77, 0.32);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 102, 77, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #8b958f;
  background: #f0f3ef;
  cursor: not-allowed;
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--brand);
  padding: 11px 17px;
  box-shadow: 0 7px 16px rgba(23, 102, 77, 0.12);
  font-size: 0.88rem;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, opacity 150ms ease;
}

.button:hover {
  transform: translateY(-2px);
  background: var(--brand-strong);
  box-shadow: 0 10px 22px rgba(23, 102, 77, 0.18);
}

.button:focus-visible,
.button-link:focus-visible,
.summary-card--interactive:focus-visible {
  outline: 3px solid rgba(23, 102, 77, 0.24);
  outline-offset: 3px;
}

.button:disabled {
  transform: none;
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.button-secondary {
  border-color: var(--line);
  background: #eef1ec;
  color: var(--ink-soft);
  box-shadow: none;
}

.button-secondary:hover {
  border-color: rgba(23, 102, 77, 0.2);
  background: #e3e9e3;
  color: var(--ink);
  box-shadow: none;
}

.button-danger {
  border-color: rgba(149, 48, 48, 0.22);
  background: #9b3838;
  color: #fff;
  box-shadow: 0 7px 16px rgba(128, 37, 37, 0.14);
}

.button-danger:hover {
  background: #7f2929;
  box-shadow: 0 10px 22px rgba(128, 37, 37, 0.2);
}

.doctor-card--inactive {
  border-color: rgba(149, 48, 48, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 242, 239, 0.9));
}

.doctor-lifecycle-modal {
  width: min(680px, 100%);
}

.doctor-lifecycle-summary {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(149, 48, 48, 0.16);
  border-radius: 16px;
  background: rgba(255, 250, 246, 0.82);
}

.doctor-lifecycle-summary span,
.doctor-lifecycle-appointment span {
  color: var(--muted);
  line-height: 1.5;
}

.doctor-lifecycle-appointments {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.doctor-lifecycle-appointment {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.doctor-lifecycle-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(149, 48, 48, 0.07);
}

.doctor-lifecycle-confirmation input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.button-link {
  color: var(--brand);
  font-size: 0.84rem;
}

.form-actions-row {
  gap: 10px;
  padding-top: 4px;
}

.pill {
  border: 1px solid rgba(28, 55, 43, 0.08);
  background: #eef1ec;
  color: var(--ink-soft);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pill-success {
  border-color: rgba(23, 102, 77, 0.12);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.pill-warning {
  border-color: rgba(169, 104, 50, 0.14);
  background: var(--warm-soft);
  color: #865126;
}

.pill-danger {
  border-color: rgba(185, 62, 67, 0.14);
  background: #f8e9e9;
  color: #922f34;
}

.doctor-patients-shell,
.diagnosis-builder,
.modal-section-card,
.encounter-upload-box,
.ai-prompt-guide {
  border-radius: 16px;
  border-color: var(--line);
  background: #f8faf7;
}

.doctor-patients-shell {
  padding: 18px;
  background: #f4f7f3;
}

.doctor-toolbar {
  gap: 12px;
  margin-bottom: 20px;
}

.doctor-toolbar--patients {
  margin-bottom: 0;
}

.doctor-card,
.stack-item {
  border-radius: 16px;
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
}

.doctor-card {
  padding: 20px;
}

.doctor-card:hover,
#doctorPatientsList .stack-item:hover {
  border-color: rgba(23, 102, 77, 0.24);
  box-shadow: 0 12px 26px rgba(27, 48, 38, 0.07);
}

#doctorPatientsList .stack-item,
.stack-item--history {
  background: #fff;
}

.patient-card-head {
  min-height: 146px;
}

.patient-card-details {
  gap: 7px;
}

.patient-card-details p {
  color: var(--muted);
  line-height: 1.45;
}

.patient-card-actions {
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  gap: 8px;
}

.patient-card-actions .button {
  min-width: 120px;
}

.patient-history-preview {
  border-radius: 14px;
  border-style: solid;
  border-color: rgba(23, 102, 77, 0.13);
  background: var(--brand-soft);
}

.schedule-composer {
  padding: clamp(20px, 2vw, 30px);
  border-radius: 20px;
  background: #f6f8f5;
}

.schedule-card,
.schedule-day {
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.schedule-card.is-enabled,
.schedule-day.is-enabled {
  border-color: rgba(23, 102, 77, 0.35);
  background: linear-gradient(180deg, #fbfefc, #edf6f1);
  box-shadow: inset 0 3px 0 rgba(23, 102, 77, 0.7);
  transform: none;
}

.schedule-card__top input[type="checkbox"],
.schedule-day__toggle input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

.form-mode-banner,
.patient-created-actions {
  border-radius: 16px;
  border-color: rgba(23, 102, 77, 0.16);
  background: linear-gradient(135deg, #eef7f2, #f8f5ee);
}

.encounter-option-toggle {
  border-radius: 14px;
  background: #fff;
}

.encounter-option-toggle select {
  min-width: 104px;
}

#encounterWorkspace {
  position: relative;
  overflow: hidden;
  border-top: 4px solid var(--brand);
  box-shadow: 0 24px 60px rgba(27, 48, 38, 0.1);
  animation: interface-rise 380ms ease both;
}

#encounterWorkspace > .panel-header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

#encounterWorkspace .subpanel {
  background: #f8faf7;
}

#encounterWorkspace .diagnosis-builder,
#encounterWorkspace .encounter-upload-box {
  background: #fff;
}

.attachment-guideline {
  border-radius: 10px;
  background: var(--brand-soft);
  font-size: 0.82rem;
}

.diagnosis-search-result {
  border-radius: 12px;
}

.diagnosis-search-result:hover,
.diagnosis-search-result.is-selected {
  border-color: rgba(23, 102, 77, 0.34);
  background: #f2f8f4;
}

.medication-row__head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.summary-card,
.doctor-card,
.stack-item,
.schedule-card,
.history-modal-summary__item {
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.empty-state {
  border-radius: 14px;
  border-color: rgba(28, 55, 43, 0.16);
  background: #fafbf9;
  line-height: 1.55;
}

.validation-summary {
  border-radius: 14px;
  background: #fff5f5;
}

.toast {
  right: 28px;
  bottom: 108px;
  z-index: 110;
  max-width: 390px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #133f31;
  box-shadow: 0 18px 44px rgba(14, 42, 32, 0.24);
  line-height: 1.45;
  animation: toast-arrive 220ms ease both;
}

.modal-overlay {
  padding: clamp(14px, 2.5vw, 32px);
  background: rgba(14, 31, 24, 0.48);
  backdrop-filter: blur(7px);
}

.modal-card {
  max-height: min(88vh, 960px);
  padding: clamp(20px, 2.5vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  background: #fdfdf9;
  box-shadow: 0 40px 100px rgba(9, 29, 21, 0.3);
  animation: modal-arrive 240ms ease both;
}

.modal-card__header {
  top: -1px;
  margin: calc(clamp(20px, 2.5vw, 34px) * -1) calc(clamp(20px, 2.5vw, 34px) * -1) 24px;
  padding: 24px clamp(20px, 2.5vw, 34px) 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(253, 253, 249, 0.96);
  backdrop-filter: blur(18px);
}

.history-modal-summary {
  gap: 10px;
}

.history-modal-summary__item {
  border-radius: 14px;
  background: #fff;
}

.history-modal-layout {
  gap: 14px;
}

.history-item-head {
  gap: 16px;
}

.history-item-actions {
  border-radius: 14px;
  background: #f4f7f3;
}

.history-item-actions .button {
  min-height: 44px;
}

.ai-processing-status {
  border-radius: 14px;
  background: #edf7f1;
}

.ai-processing-progress {
  height: 7px;
}

.ai-processing-progress__bar {
  background: linear-gradient(90deg, #b9894e, var(--brand));
}

.ai-prompt-guide__content {
  border-radius: 14px;
  background: #f7f8f4;
}

.ai-dictation-live {
  border: 1px solid rgba(185, 62, 67, 0.13);
  background: #fff1f1;
}

.certificate-signing-preview,
.certificate-preview-card,
.certificate-preview-highlight {
  border-radius: 16px;
}

@keyframes interface-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-arrive {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .admin-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-section-nav {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-plan-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-plan-row__track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .main {
    padding: 22px 18px 44px;
  }

  .doctor-workspace-grid {
    grid-template-columns: 1fr;
  }

  .patient-card-actions {
    transform: none;
  }

  body:not(.doctor-mode):not(.logged-out) .sidebar {
    padding: 24px;
  }

  body:not(.doctor-mode):not(.logged-out) .sidebar > div:first-child {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .shell,
  .main,
  .sidebar,
  #superadminSection,
  #doctorSection,
  .panel,
  .card,
  .form-grid,
  .form-grid > *,
  input,
  select,
  textarea {
    min-width: 0;
    max-width: 100%;
  }

  body:not(.doctor-mode):not(.logged-out) .sidebar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 20px 16px;
  }

  body:not(.doctor-mode):not(.logged-out) .sidebar > div:first-child {
    max-width: none;
    padding: 0;
  }

  body:not(.doctor-mode):not(.logged-out) .sidebar .card,
  body:not(.doctor-mode):not(.logged-out) .sidebar-session-card {
    width: 100%;
    min-width: 0;
  }

  body:not(.doctor-mode):not(.logged-out) #workspaceTitle {
    font-size: clamp(1.8rem, 9vw, 2.35rem);
  }

  body:not(.doctor-mode):not(.logged-out) #workspaceDescription {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .main {
    padding: 16px 12px 38px;
  }

  .admin-section-nav {
    display: flex;
    overflow-x: auto;
    padding: 7px;
    border-radius: 18px;
    scrollbar-width: thin;
  }

  .admin-section-nav__button {
    flex: 0 0 145px;
  }

  .admin-dashboard__hero,
  .admin-insight-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-dashboard__hero .button {
    width: 100%;
  }

  .admin-dashboard__hero {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .admin-metric-grid,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-insight-card--wide {
    grid-column: auto;
  }

  .admin-plan-row {
    grid-template-columns: 1fr auto;
  }

  .admin-plan-row__track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .admin-finance-row,
  .admin-plan-row {
    min-width: 0;
  }

  .admin-finance-row > span:first-child,
  .admin-plan-row > div:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .panel:not(.modal-card) > .panel-header,
  .doctor-calendar-panel > .panel-header,
  .subpanel-header,
  .schedule-builder__header,
  .office-schedule-day__header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel:not(.modal-card) > .panel-header > .button,
  .doctor-calendar-panel > .panel-header > .button,
  .subpanel-header > .button,
  .schedule-builder__header > .button {
    width: 100%;
  }

  .doctor-top,
  .calendar-connection,
  .current-office-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .current-office-picker select,
  .calendar-connection__actions,
  .calendar-connection__actions .button {
    width: 100%;
    min-width: 0;
  }

  .calendar-connection__actions {
    justify-content: stretch;
  }

  .doctor-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doctor-actions .button {
    width: 100%;
    min-width: 0;
  }

  .schedule-composer,
  .setup-payment-composer,
  .office-editor-card,
  .doctor-patients-shell {
    padding: 16px 14px;
    border-radius: 16px;
  }

  .office-schedule-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .office-schedule-block input[type="time"],
  .office-schedule-block label,
  .office-schedule-block label input {
    width: 100%;
  }

  .office-schedule-block label {
    align-items: stretch;
    flex: 1 1 130px;
    flex-direction: column;
  }

  .medication-row__head,
  .diagnosis-pill-row,
  .absence-item__header {
    align-items: stretch;
    flex-direction: column;
  }

  .diagnosis-pill-row__remove,
  .medication-row__head .button {
    width: 100%;
  }

  .notification-item {
    grid-template-columns: 9px minmax(0, 1fr);
    align-items: start;
  }

  .notification-item > small {
    grid-column: 2;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .payment-summary,
  .payment-terms-summary {
    grid-template-columns: 1fr 1fr;
  }

  .payment-item,
  .contract-alert-item {
    grid-template-columns: 1fr;
  }

  .contract-alert-item .button {
    width: 100%;
  }

  .contract-renewal-alert {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .doctor-hero__content,
  .doctor-session-badge {
    border-radius: 20px;
  }

  .doctor-hero__content {
    min-height: 0;
    padding: 28px 22px;
  }

  .doctor-hero__content h2 {
    font-size: 2rem;
  }

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

  .summary-card {
    min-height: 108px;
  }

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

  .modal-card {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 18px 14px;
    border-radius: 19px;
  }

  .modal-overlay {
    align-items: stretch;
    padding: 8px;
  }

  .modal-card__header {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    margin: -18px -14px 18px;
    padding: 18px 14px 14px;
  }

  .modal-card__header > div {
    min-width: 0;
  }

  .modal-card__header h2,
  .modal-card__header h3 {
    overflow-wrap: anywhere;
  }

  .modal-card__header > .button {
    width: auto;
    flex: 0 0 auto;
  }

  .assistant-widget,
  .assistant-floating-panel {
    inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    max-height: none;
    height: auto;
  }

  .ai-toolbar,
  .ai-prompt-guide__header {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-toolbar__actions,
  .ai-dictation-toolbar {
    justify-content: flex-start;
  }

  .history-item-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .toast {
    right: 14px;
    bottom: 86px;
    max-width: calc(100vw - 28px);
  }

  body.logged-out .main {
    padding: 14px;
  }

  body.logged-out #loginSection {
    padding: 26px 20px;
    border-radius: 22px;
  }

  body.logged-out #loginSection .panel-header {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  body.logged-out #loginSection .panel-header::before {
    width: 48px;
    height: 48px;
    border-radius: 14px 14px 14px 5px;
  }

  body.logged-out #loginSection h2 {
    font-size: 1.7rem;
  }

  .form-actions-row,
  .doctor-toolbar-actions,
  .ai-toolbar__actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .form-actions-row .button,
  .doctor-toolbar-actions .button,
  .ai-toolbar__actions .button {
    width: 100%;
  }

  .doctor-actions,
  .payment-summary,
  .payment-terms-summary,
  .admin-finance-row {
    grid-template-columns: 1fr;
  }

  .admin-finance-row__amount {
    text-align: left;
  }

  .admin-section-nav__button {
    flex-basis: 132px;
    padding: 11px 12px;
  }

  .panel {
    padding: 18px 14px;
  }

  .toast {
    right: 14px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 620px) {
  html {
    font-size: 100%;
  }

  .encounter-mid-ai {
    grid-template-columns: 1fr;
  }

  .encounter-mid-ai__button {
    width: 100%;
  }

  .encounter-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  #encounterSubmitButton {
    width: 100%;
  }

  .medical-exam-order-item {
    align-items: stretch;
    flex-direction: column;
  }

  .medical-exam-order-item .button,
  .medical-exam-order-document-actions .button {
    width: 100%;
  }
}

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