/*
 * RARI Präzisionsinstrument — Desktop visual system
 * Loaded after app.css so existing page behavior remains intact while the
 * complete authenticated surface shares one coherent visual language.
 */

:root {
  --bg-deep: #031015;
  --bg: #06151b;
  --surface: #091b22;
  --surface-raised: #0d242c;
  --surface-quiet: #07171d;
  --surface-inset: #051218;
  --line: #17323b;
  --line-strong: #28505a;
  --line-focus: #3aa774;
  --text: #f2f8f7;
  --text-soft: #c5d4d5;
  --muted: #89a1a8;
  --muted-strong: #a5b8bd;
  --petrol: #1e6064;
  --green: #35ac73;
  --green-bright: #3cc578;
  --green-soft: #9be5bf;
  --warning: #f3c75b;
  --danger: #ff7474;
  --danger-bg: #2a151a;
  --info: #73c2df;
  --brand-gradient: linear-gradient(
    96deg,
    #194f61 0%,
    #1e6064 18%,
    #2e966e 52%,
    #35ac73 72%,
    #3cc578 100%
  );
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  --shadow-float: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 15px;
  --sidebar-width: 216px;
  --content-max: 1680px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: dark;
}

/* Patientenportal-Ausbau 0.42: klare Übergaben statt zusätzlicher Dashboard-Kacheln. */
.onboarding-workspace { display: grid; gap: 1.1rem; }
.onboarding-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr); gap: 1.25rem; }
.onboarding-grid > form,
.onboarding-grid > div { display: grid; align-content: start; gap: .8rem; }
.access-link-result { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1.25rem; align-items: center; padding: 1rem; background: var(--surface-quiet); border-radius: var(--radius-lg); }
.access-link-result img { width: 180px; height: 180px; background: var(--text); }
.access-link-result > div { display: grid; gap: .55rem; }
.access-link-result p,
.access-link-result small { margin: 0; }
.access-link-result input { width: 100%; }
.recovery-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.recovery-row div { display: grid; gap: .2rem; }
.availability-summary { display: flex; flex-wrap: wrap; gap: .55rem; }
.availability-summary span { padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 12px; }
.policy-confirm { display: flex !important; align-items: flex-start; gap: .55rem !important; }
.policy-confirm input { flex: 0 0 auto; margin-top: .2rem; }
.system-notice-workspace { opacity: .86; }
.cancellation-escalations { display: grid; gap: .9rem; margin-bottom: 1.25rem; padding: 1.15rem; background: var(--danger-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.cancellation-escalations > p { max-width: 75ch; margin: 0; }
.cancellation-escalation-row { display: grid; grid-template-columns: minmax(200px, .8fr) auto minmax(320px, 1fr); gap: 1rem; align-items: center; padding-top: .9rem; border-top: 1px solid var(--line); }
.cancellation-escalation-row > div { display: grid; gap: .25rem; }
.cancellation-escalation-row form { display: grid; grid-template-columns: 1fr auto; gap: .6rem; }
@media (max-width: 900px) { .onboarding-grid, .cancellation-escalation-row { grid-template-columns: 1fr; } .access-link-result { grid-template-columns: 130px minmax(0, 1fr); } .access-link-result img { width: 130px; height: 130px; } }
@media (max-width: 560px) { .access-link-result { grid-template-columns: 1fr; } .cancellation-escalation-row form { grid-template-columns: 1fr; } }

/* Tauschtage: datumsbezogene Arbeitszeit und Termine als ein prüfbarer Vorgang. */
.swap-row-head,
.swap-row {
  grid-template-columns: minmax(10rem, 1.15fr) minmax(12rem, 1.35fr) .55fr 1fr .65fr 1.25rem;
}

.swap-form-shell {
  max-width: 68rem;
}

.swap-proposals {
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.swap-proposal-list article {
  grid-template-columns: minmax(12rem, 1fr) 2rem minmax(12rem, 1fr);
  align-items: center;
}

.swap-proposal-list article > div {
  display: grid;
  gap: .35rem;
}

.swap-arrow {
  color: var(--green);
  font-size: 1.04rem;
  text-align: center;
}

.swap-review-note {
  padding: .65rem .75rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--warning) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--line));
  border-radius: var(--radius-sm);
}

.swap-confirm-form {
  grid-template-columns: minmax(0, 1fr);
}

.confirm-absence .swap-confirm-number {
  grid-template-columns: minmax(0, 1fr);
  gap: .35rem;
}

.confirm-absence .swap-confirm-number input {
  width: 100%;
  height: auto;
  min-height: 2.75rem;
  margin: 0;
}

@media (max-width: 760px) {
  .swap-row-head { display: none; }
  .swap-row { grid-template-columns: 1fr auto; }
  .swap-row > span:not(:first-child):not(:last-child) { grid-column: 1 / -1; }
  .swap-proposal-list article { grid-template-columns: 1fr; }
  .swap-arrow { transform: rotate(90deg); text-align: left; }
}

/* Terminerinnerungen: fällige Freigaben bleiben als bewusste Praxisaktion sichtbar. */
.reminder-workspace {
  display: grid;
  gap: 1rem;
}

.reminder-summary {
  justify-content: space-between;
}

.reminder-summary span {
  color: var(--muted);
}

.reminder-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.reminder-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1.1fr) minmax(9rem, 1fr) minmax(10rem, 1fr) minmax(9rem, 0.9fr) minmax(11rem, 1.15fr);
  gap: 0.8rem;
  align-items: center;
  min-height: 78px;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

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

.reminder-row > span {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.reminder-row strong,
.reminder-row small {
  overflow-wrap: anywhere;
}

.reminder-row small {
  color: var(--muted);
}

.reminder-row .reminder-field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reminder-row-head {
  min-height: 42px;
  color: var(--muted);
  background: var(--surface-raised);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reminder-row.is-due {
  background: rgba(53, 172, 115, 0.07);
  outline: 1px solid rgba(53, 172, 115, 0.34);
  outline-offset: -1px;
}

.reminder-action form,
.reminder-action .button {
  width: 100%;
}

@media (max-width: 1120px) {
  .reminder-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reminder-row-head {
    display: none;
  }

  .reminder-row .reminder-field-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: normal;
  }

  .reminder-action {
    grid-column: 1 / -1;
  }
}

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

  .reminder-action {
    grid-column: auto;
  }
}

html {
  background: var(--bg-deep);
}

body {
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 74% -24%, rgba(46, 150, 110, 0.1), transparent 36rem),
    linear-gradient(135deg, #06151b 0%, #051319 55%, #06171c 100%);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI Variable",
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
strong {
  text-wrap: pretty;
}

h1 {
  margin-bottom: 4px;
  font-size: 1.82rem;
  font-weight: 730;
  line-height: 1.12;
  letter-spacing: -0.026em;
}

h2 {
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.012em;
}

h3 {
  font-size: 0.92rem;
}

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

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

a {
  color: var(--green-soft);
  transition: color 140ms ease;
}

a:hover {
  color: #d8f8e6;
}

:focus-visible {
  outline: 2px solid rgba(60, 197, 120, 0.82);
  outline-offset: 3px;
}

/* Application frame */

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  width: var(--sidebar-width);
  padding: 15px 11px 13px;
  background:
    linear-gradient(180deg, rgba(17, 50, 57, 0.22), transparent 9rem),
    #041117;
  border-right-color: #173038;
}

.brand {
  min-height: 94px;
  align-items: center;
  padding: 3px 10px 13px;
  border-bottom-color: #173038;
}

.brand img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.brand span {
  margin-top: 5px;
  color: #7e99a1;
  font-size: 0.64rem;
  font-weight: 720;
  letter-spacing: 0.17em;
}

.primary-nav {
  gap: 2px;
  margin-top: 15px;
  padding-right: 3px;
  scrollbar-color: #28505a transparent;
  scrollbar-width: thin;
}

.primary-nav::-webkit-scrollbar {
  width: 6px;
}

.primary-nav::-webkit-scrollbar-track {
  background: transparent;
}

.primary-nav::-webkit-scrollbar-thumb {
  background: #28505a;
  border-radius: 999px;
}

.primary-nav::-webkit-scrollbar-thumb:hover {
  background: #3a6a70;
}

.nav-section-label {
  display: block;
  padding: 7px 10px 5px;
  color: #638089;
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav-section-label-spaced {
  margin-top: 8px;
}

.primary-nav a,
.nav-pending {
  min-height: 39px;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  padding: 0 10px;
  color: #adbec2;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 560;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    transform 120ms var(--ease-out);
}

.primary-nav a:hover {
  color: var(--text);
  background: #0a2028;
  border-color: #173740;
}

.primary-nav a:active {
  transform: scale(0.98);
}

.primary-nav a[aria-current="page"] {
  color: #ecfff5;
  background:
    linear-gradient(90deg, rgba(46, 150, 110, 0.24), rgba(18, 63, 65, 0.2)),
    #0a2228;
  border-color: #245847;
}

.primary-nav a[aria-current="page"]::before {
  inset: 9px auto 9px 0;
  width: 1px;
  background: var(--green-bright);
  border-radius: 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  color: #7fc5a1;
  stroke-width: 1.65;
}

.account-panel {
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  gap: 9px;
  padding: 12px 5px 3px;
  border-top: 1px solid #173038;
}

.account-panel .avatar {
  width: 34px;
  height: 34px;
  border-color: #28505a;
  background: #0b252b;
  font-size: 0.76rem;
}

.account-panel strong {
  font-size: 0.76rem;
}

.account-panel > div > span {
  font-size: 0.68rem;
}

.workspace {
  grid-column: 2;
  width: 100%;
  max-width: none;
  padding: 0 clamp(20px, 2.45vw, 40px) 44px;
}

.utility-strip {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 calc(clamp(20px, 2.45vw, 40px) * -1);
  padding: 0 clamp(20px, 2.45vw, 40px);
  color: var(--muted);
  background: rgba(4, 17, 23, 0.78);
  border-bottom: 1px solid #153038;
}

.utility-context,
.quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 0.68rem;
}

.utility-context strong {
  color: var(--text-soft);
}

.utility-context > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-pulse {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--green-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(60, 197, 120, 0.1);
}

.quick-actions {
  justify-content: flex-end;
}

.quick-actions a,
.quick-actions > span {
  padding: 4px 8px;
  color: #95aeb4;
  border-radius: var(--radius-xs);
}

.quick-actions a:hover {
  color: var(--text);
  background: #0c2229;
}

.quick-actions > span {
  color: var(--green-soft);
  background: #0b2926;
  border: 1px solid #1f4b3f;
}

.topbar {
  min-height: 110px;
  align-items: flex-end;
  gap: 26px;
  margin: 0 auto 20px;
  padding: 24px 0 18px;
  border-bottom: 1px solid #17323a;
}

.topbar > div:first-child {
  display: grid;
  align-content: end;
}

.topbar p {
  max-width: 76ch;
  color: #9db0b5;
  font-size: 0.76rem;
}

.breadcrumb {
  margin-bottom: 7px !important;
  color: #68858d;
  font-size: 0.68rem;
  font-weight: 650;
}

.breadcrumb a {
  color: #9eb2b7;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

/* Controls and interaction */

.button {
  min-height: 39px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: -0.004em;
  transition:
    transform 120ms var(--ease-out),
    box-shadow 180ms ease,
    color 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease;
}

.button:hover {
  transform: none;
}

.button:active {
  transform: scale(0.975);
}

.button-primary {
  color: #03140d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent 46%),
    var(--brand-gradient);
  border-color: rgba(166, 234, 194, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 16px rgba(4, 35, 26, 0.28);
}

.button-primary:hover {
  color: #020d09;
  border-color: rgba(196, 245, 218, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 9px 22px rgba(4, 43, 31, 0.34);
}

.button-primary:active {
  box-shadow:
    inset 0 1px 2px rgba(2, 24, 17, 0.2),
    0 3px 9px rgba(4, 35, 26, 0.22);
}

.appointment-create-button {
  min-height: 42px;
  gap: 10px;
  padding: 5px 15px 5px 6px;
  border-radius: var(--radius-sm);
  font-weight: 760;
  letter-spacing: -0.008em;
}

.button-leading {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: #062219;
  background: rgba(3, 20, 13, 0.11);
  border: 1px solid rgba(3, 31, 21, 0.14);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.button-leading svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-secondary {
  color: #b6ecd0;
  background: #0a252a;
  border-color: #28584f;
}

.button-secondary:hover {
  color: #effff6;
  background: #0d2f32;
  border-color: #39806b;
}

.button-quiet {
  color: #c0d0d3;
  background: #071920;
  border-color: #28434b;
}

.button-quiet:hover {
  color: var(--text);
  background: #0c222a;
  border-color: #41626b;
}

.button-danger {
  background: #2a171b;
  border-color: #75363f;
}

.button-danger:hover {
  background: #381b20;
  border-color: #a84d58;
}

.button:disabled,
button:disabled {
  transform: none;
  opacity: 0.46;
  cursor: not-allowed;
}

.icon-button {
  width: 36px;
  height: 36px;
  color: #a9bdc1;
  background: #071920;
  border-color: #28434b;
  border-radius: var(--radius-sm);
  transition:
    transform 120ms var(--ease-out),
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

.icon-button:hover {
  color: var(--text);
  background: #0d252d;
  border-color: #3a5a63;
}

.icon-button:active {
  transform: scale(0.96);
}

input,
select,
textarea {
  min-height: 41px;
  padding: 9px 11px;
  color: var(--text);
  background: #05151b;
  border-color: #284750;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 170ms ease;
}

textarea {
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: #6f8a91;
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  background: #071a21;
  border-color: #3b5e67;
}

input:focus,
select:focus,
textarea:focus {
  background: #071a20;
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px rgba(53, 172, 115, 0.14);
}

.date-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  color: var(--text);
  background: #05151b;
  border: 1px solid #284750;
  border-radius: var(--radius-sm);
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 170ms ease;
}

.date-entry:hover {
  background: #071a21;
  border-color: #3b5e67;
}

.date-entry:focus-within {
  background: #071a20;
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px rgba(53, 172, 115, 0.14);
}

.date-entry.date-entry-invalid {
  border-color: var(--danger);
}

.date-entry .date-text-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

.date-entry .date-text-input:hover,
.date-entry .date-text-input:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}

.date-picker-trigger {
  display: grid;
  width: 44px;
  min-height: 42px;
  place-items: center;
  color: var(--green-soft);
  background: rgba(30, 96, 100, 0.13);
  border-left: 1px solid #284750;
  cursor: pointer;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.date-picker-trigger:hover,
.date-picker-trigger:focus-visible {
  color: var(--text);
  background: rgba(30, 96, 100, 0.3);
  outline: 0;
}

.date-picker-trigger svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.date-picker-native {
  position: fixed;
  left: -100vw;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.date-entry.is-disabled {
  opacity: 0.58;
}

.date-entry.is-disabled .date-picker-trigger,
.date-picker-native:disabled {
  cursor: not-allowed;
}

label > span,
fieldset > legend {
  color: #b5c6c9;
}

/* Shared surfaces */

:where(
  .metric-primary,
  .status-panel,
  .phase-panel,
  .activity-panel,
  .patient-directory,
  .directory-panel,
  .calendar-shell,
  .form-section,
  .record-focus,
  .master-data,
  .alert-composer,
  .audit-panel,
  .backup-guidance,
  .backup-list,
  .task-directory,
  .absence-directory,
  .prescription-directory,
  .treatment-directory,
  .finding-directory,
  .cockpit-work-context,
  .treatment-continuity,
  .cockpit-attention,
  .intake-snapshot,
  .communication-snapshot,
  .prescription-focus,
  .prescription-data,
  .treatment-detail-main,
  .finding-map-panel,
  .finding-tools,
  .finding-details,
  .waitlist-summary-card,
  .waitlist-contact-card,
  .waitlist-actions-card,
  .waitlist-history-card,
  .appointment-hero,
  .cancelled-record,
  .booking-summary,
  .booking-boundaries
) {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.panel-heading {
  gap: 16px;
  margin-bottom: 17px;
}

.panel-heading h2 {
  color: var(--text);
  font-size: 1rem;
}

.kicker {
  margin-bottom: 4px;
  color: #7c9aa1;
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.live-indicator,
.prototype-badge,
.status-chip,
.warning-count,
.attention-total,
.marker-count {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 720;
}

.live-indicator,
.prototype-badge,
.marker-count {
  color: #a9e5c4;
  background: #0a2926;
  border-color: #245344;
}

.empty-state,
.cockpit-empty,
.calendar-empty {
  color: var(--text-soft);
  background: var(--surface-inset);
  border: 1px dashed #29444c;
  border-radius: var(--radius-sm);
}

.empty-state p,
.cockpit-empty span,
.calendar-empty p {
  color: var(--muted);
}

.surface-note {
  padding: .8rem .9rem;
  border: 1px solid rgba(87, 180, 145, .24);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(55, 159, 122, .055);
  font-size: 0.82rem;
  line-height: 1.45;
}

.catalog-register {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.catalog-register-head,
.catalog-register-row {
  display: grid;
  grid-template-columns:
    minmax(15rem, 2.25fr)
    minmax(7.3rem, .95fr)
    minmax(5.5rem, .7fr)
    minmax(7.2rem, .85fr)
    minmax(4.8rem, .58fr)
    minmax(6.5rem, .72fr)
    minmax(8rem, 1fr)
    auto;
  gap: .85rem;
  align-items: center;
}

.catalog-register-head {
  min-height: 2.7rem;
  padding: .65rem 1rem;
  color: var(--muted);
  background: rgba(4, 20, 25, .44);
  border-bottom: 1px solid var(--line);
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.catalog-register-row {
  min-height: 7.4rem;
  padding: 1rem;
}

.catalog-register-row + .catalog-register-row {
  border-top: 1px solid var(--line);
}

.catalog-register-row:hover {
  background: rgba(55, 159, 122, .025);
}

.catalog-service,
.catalog-register-status,
.catalog-register-value {
  min-width: 0;
}

.catalog-service h2 {
  margin: .15rem 0 0;
  font-size: 1rem;
  line-height: 1.3;
}

.catalog-service .kicker {
  font-size: 0.64rem;
}

.catalog-calendar-key {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.catalog-calendar-key svg {
  display: block;
  width: 5px;
  height: 1.25rem;
  flex: 0 0 auto;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(208, 232, 222, .2);
}

.catalog-calendar-key strong {
  color: var(--text-soft);
  font-size: 0.68rem;
}

.catalog-calendar-fields {
  align-items: start;
}

.catalog-color-input {
  width: 100%;
  min-height: 43px;
}

.catalog-service .catalog-note {
  display: -webkit-box;
  margin: .45rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-status {
  display: inline-flex;
  width: fit-content;
  padding: .35rem .6rem;
  border: 1px solid rgba(86, 190, 146, .3);
  border-radius: 999px;
  color: var(--green-soft);
  background: rgba(54, 173, 121, .09);
  font-size: 0.72rem;
  font-weight: 700;
}

.catalog-status-provisional .catalog-status {
  color: #e4b85d;
  border-color: rgba(228, 184, 93, .3);
  background: rgba(228, 184, 93, .08);
}

.catalog-status-inactive {
  opacity: .72;
}

.catalog-register-status,
.catalog-register-value {
  display: grid;
  gap: .25rem;
}

.catalog-register-status small,
.catalog-register-value small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.catalog-register-value strong {
  font-size: 0.82rem;
}

.catalog-register-qualification strong {
  overflow-wrap: anywhere;
}

.catalog-register-action {
  justify-self: end;
}

.catalog-register-action .button {
  min-height: 34px;
  padding-inline: .75rem;
}

.catalog-cell-label {
  display: none;
}

.catalog-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1050px) {
  .catalog-form-grid {
    grid-template-columns: 1fr;
  }

  .catalog-register-head {
    display: none;
  }

  .catalog-register {
    display: grid;
    gap: .7rem;
    background: transparent;
    border: 0;
    overflow: visible;
  }

  .catalog-register-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .catalog-register-row + .catalog-register-row {
    border-top: 1px solid var(--line);
  }

  .catalog-service {
    grid-column: 1 / 4;
  }

  .catalog-register-status {
    grid-column: 4;
    justify-self: end;
  }

  .catalog-register-action {
    grid-column: 4;
  }

  .catalog-cell-label {
    display: block;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 720;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
}

@media (max-width: 620px) {
  .catalog-register-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-service {
    grid-column: 1 / -1;
  }

  .catalog-register-status,
  .catalog-register-action {
    grid-column: auto;
    justify-self: stretch;
  }

  .catalog-register-action {
    align-self: end;
  }

  .catalog-register-action .button {
    width: 100%;
  }
}

.flash-stack {
  top: 16px;
  right: 18px;
  gap: 7px;
}

.flash {
  padding: 12px 14px;
  background: #0b252b;
  border: 1px solid #2d5c51;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float);
  transition:
    opacity 180ms ease,
    transform 180ms var(--ease-out);
}

/* Dashboard */

.dashboard-command {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.82fr);
  gap: 13px;
}

.day-board,
.attention-board,
.team-flow,
.waitlist-pulse,
.activity-compact,
.billing-focus,
.billing-boundary {
  min-width: 0;
  background: #07181e;
  border: 1px solid #1a3740;
  border-radius: var(--radius);
}

.day-board {
  overflow: hidden;
}

.command-heading {
  display: flex;
  min-height: 68px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px 14px;
}

.command-heading h2,
.command-heading p {
  margin-bottom: 0;
}

.command-heading h2 {
  font-size: 1rem;
  letter-spacing: -0.012em;
}

.command-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  color: #a6e4c2;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 130ms ease,
    background-color 130ms ease,
    border-color 130ms ease,
    transform 130ms var(--ease-out);
}

.command-link:hover {
  color: #eafff3;
  background: #0d2f32;
  border-color: #28584f;
}

.command-link:active {
  transform: scale(0.975);
}

.day-statline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #05151b;
  border-top: 1px solid #17333b;
  border-bottom: 1px solid #17333b;
}

.day-statline > div {
  display: grid;
  min-height: 91px;
  align-content: center;
  gap: 3px;
  padding: 13px 15px;
}

.day-statline > div + div {
  border-left: 1px solid #17333b;
}

.day-statline span {
  color: #89a1a8;
  font-size: 0.68rem;
}

.day-statline strong {
  color: var(--text);
  font-size: 1.48rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.day-statline small {
  overflow: hidden;
  color: #a5b8bd;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-statline .is-critical strong {
  color: #ffabab;
}

.day-statline .is-warning strong {
  color: #f5dda0;
}

.day-schedule {
  display: grid;
}

.day-appointment {
  display: grid;
  min-height: 62px;
  grid-template-columns: 54px 6px minmax(190px, 1fr) minmax(120px, 0.58fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  color: var(--text-soft);
  border-top: 1px solid #17343c;
  text-decoration: none;
  transition:
    color 130ms ease,
    background-color 130ms ease,
    transform 130ms var(--ease-out);
}

.day-appointment:first-child {
  border-top: 0;
}

.day-appointment:hover {
  color: var(--text);
  background: #0b232a;
}

.day-appointment:active {
  transform: scale(0.995);
}

.day-appointment time {
  color: #9bc9b3;
  font-size: 0.82rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.day-appointment-color {
  display: block;
  width: 6px;
  height: 36px;
}

.day-patient {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.day-patient strong,
.day-team {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-patient strong {
  color: var(--text);
  font-size: 0.82rem;
}

.day-patient small,
.day-team {
  color: #a5b8bd;
  font-size: 0.76rem;
}

.day-safety {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  color: #ffc7c7;
  background: #351b20;
  border: 1px solid #82434c;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 760;
  white-space: nowrap;
}

.attention-board {
  overflow: hidden;
}

.attention-groups {
  display: grid;
}

.attention-group {
  padding: 0 17px 10px;
  border-top: 1px solid #17333b;
}

.attention-group h3 {
  display: flex;
  min-height: 47px;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.attention-group h3 > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #a6e4c2;
  background: #0b2b27;
  border: 1px solid #285747;
  border-radius: var(--radius-precise);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
}

.attention-group.is-critical h3 > span {
  color: #ffc7c7;
  background: #351b20;
  border-color: #82434c;
}

.attention-group.is-warning h3 > span {
  color: #f5dda0;
  background: #312919;
  border-color: #6c592d;
}

.attention-group > a {
  display: grid;
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  color: var(--text-soft);
  border-top: 1px solid #17333b;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition:
    color 130ms ease,
    background-color 130ms ease,
    transform 130ms var(--ease-out);
}

.attention-group > a:hover {
  color: var(--text);
  background: #0b232a;
}

.attention-group > a:active {
  transform: scale(0.97);
}

.attention-group > a > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.attention-group strong,
.attention-group small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-group strong {
  color: var(--text);
  font-size: 0.76rem;
}

.attention-group small {
  color: var(--muted);
  font-size: 0.72rem;
}

.attention-group b {
  color: #8bd1aa;
  font-size: 0.92rem;
  text-align: center;
}

.dashboard-empty {
  display: grid;
  min-height: 118px;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 18px;
  color: var(--text-soft);
  text-align: center;
}

.dashboard-empty p {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
}

.dashboard-empty a {
  margin-top: 5px;
  color: #9be5bf;
  font-weight: 720;
}

.dashboard-empty.is-positive {
  min-height: 170px;
  margin: 0 17px 17px;
  color: #b9efd2;
  background: #0b2b27;
  border: 1px solid #285747;
  border-radius: var(--radius-sm);
}

.dashboard-support {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) minmax(250px, 0.78fr) minmax(280px, 0.9fr);
  gap: 13px;
  margin-top: 13px;
}

.dashboard-support.is-therapist {
  grid-template-columns: minmax(360px, 1.35fr) minmax(300px, 0.8fr);
}

.team-flow,
.waitlist-pulse,
.activity-compact {
  overflow: hidden;
}

.team-flow-list {
  display: grid;
}

.team-flow-list > a {
  display: grid;
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--text-soft);
  border-top: 1px solid #17333b;
  text-decoration: none;
  transition:
    color 130ms ease,
    background-color 130ms ease,
    transform 130ms var(--ease-out);
}

.team-flow-list > a:hover {
  color: var(--text);
  background: #0b232a;
}

.team-flow-list > a:active {
  transform: scale(0.985);
}

.team-flow-list > a.is-absent {
  background: rgba(53, 27, 32, 0.42);
}

.team-flow-list > a > span:nth-child(2),
.team-load {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.team-flow-list strong,
.team-flow-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-flow-list > a > span:nth-child(2) strong {
  color: var(--text);
  font-size: 0.76rem;
}

.team-flow-list > a > span:nth-child(2) small {
  color: var(--muted);
  font-size: 0.68rem;
}

.team-load {
  text-align: right;
}

.team-load strong {
  color: #b9efd2;
  font-size: 0.92rem;
}

.team-load small {
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.waitlist-stages {
  display: grid;
}

.waitlist-stages > * {
  display: grid;
  min-height: 78px;
  grid-template-columns: 46px minmax(0, 1fr);
  align-content: center;
  gap: 2px 10px;
  padding: 11px 16px;
  color: var(--text-soft);
  border-top: 1px solid #17333b;
  text-decoration: none;
  transition:
    color 130ms ease,
    background-color 130ms ease,
    transform 130ms var(--ease-out);
}

.waitlist-stages > a:hover {
  color: var(--text);
  background: #0b232a;
}

.waitlist-stages > a:active {
  transform: scale(0.985);
}

.waitlist-stages strong {
  grid-row: span 2;
  align-self: center;
  color: #b9efd2;
  font-size: 1.48rem;
  font-variant-numeric: tabular-nums;
}

.waitlist-stages span {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 720;
}

.waitlist-stages small {
  color: var(--muted);
  font-size: 0.68rem;
}

.activity-compact ul {
  display: grid;
  margin: 0;
  padding: 0 16px 10px;
  list-style: none;
}

.activity-compact li {
  display: grid;
  min-height: 59px;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #17333b;
}

.activity-compact li div {
  display: grid;
  gap: 3px;
}

.activity-compact li strong {
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.35;
}

.activity-compact li small {
  color: var(--muted);
  font-size: 0.68rem;
}

.billing-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 13px;
}

.billing-focus,
.billing-boundary {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 21px;
}

.billing-focus > div:first-child p:last-child,
.billing-boundary p:last-child {
  max-width: 62ch;
  color: var(--muted);
}

.billing-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background: #05151b;
  border: 1px solid #17333b;
  border-radius: var(--radius-sm);
}

.billing-metrics span {
  display: grid;
  min-height: 96px;
  align-content: center;
  gap: 5px;
  padding: 14px;
}

.billing-metrics span + span {
  border-left: 1px solid #17333b;
}

.billing-metrics strong {
  font-size: 1.48rem;
  font-variant-numeric: tabular-nums;
}

.billing-metrics small {
  color: var(--muted);
}

.billing-metrics .is-warning strong {
  color: #f5dda0;
}

/* Directories and data tables */

:where(
  .patient-directory,
  .directory-panel,
  .calendar-shell,
  .task-directory,
  .absence-directory,
  .prescription-directory,
  .treatment-directory,
  .finding-directory
) {
  padding: 13px;
}

.directory-tools,
.calendar-toolbar {
  margin-bottom: 13px;
  padding: 4px;
  background: #07171d;
  border: 1px solid #17333b;
  border-radius: 8px;
}

.calendar-context-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 12px 14px;
  background: linear-gradient(110deg, rgba(24, 91, 88, 0.28), rgba(7, 24, 30, 0.92) 58%);
  border: 1px solid #23625f;
  border-radius: 8px;
}

.calendar-context-banner > div,
.calendar-context-banner nav {
  display: flex;
  align-items: center;
  gap: 11px;
}

.calendar-context-banner > div > span:last-child {
  display: grid;
  gap: 2px;
}

.calendar-context-banner small {
  color: var(--muted);
}

.calendar-context-banner nav {
  gap: 18px;
}

.calendar-context-banner nav a {
  color: var(--green-soft);
  font-size: 0.76rem;
  font-weight: 720;
}

.directory-tools {
  align-items: center;
  gap: 7px;
}

.search-field > svg {
  top: 11px;
  color: #769098;
}

:where(
  .patient-table,
  .team-directory,
  .prescription-list,
  .treatment-list,
  .absence-list,
  .task-list,
  .finding-list,
  .waitlist-table
) {
  overflow: hidden;
  background: #07181e;
  border: 1px solid #1a3740;
  border-radius: 8px;
}

.patient-row,
.team-row,
.prescription-row,
.treatment-row,
.absence-row,
.finding-list > a {
  min-height: 62px;
  padding-top: 8px;
  padding-bottom: 8px;
  color: #b9c9cc;
  border-top-color: #17333b;
  transition:
    color 130ms ease,
    background-color 130ms ease;
}

.patient-row:not(.patient-row-head):hover,
.team-row:not(.team-row-head):hover,
.prescription-row:hover,
.treatment-row:hover,
.absence-row:hover,
.finding-list > a:hover {
  color: var(--text);
  background: #0b222a;
}

.patient-row:active,
.team-row:active,
.prescription-row:active,
.treatment-row:active,
.absence-row:active,
.finding-list > a:active {
  background: #0d2830;
}

.patient-row-head,
.team-row-head,
.prescription-row-head,
.treatment-row-head,
.absence-row-head {
  min-height: 38px;
  color: #759098;
  background: #06151b;
  font-size: 0.64rem;
  letter-spacing: 0.02em;
}

.patient-identity strong,
.identity-cell strong {
  font-size: 0.82rem;
}

.patient-identity small,
.identity-cell small {
  font-size: 0.68rem;
}

.avatar {
  border-color: #2a535d;
  background: #0b2930;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.avatar.patient-photo {
  overflow: hidden;
  padding: 0;
  background: #0b2930;
}

.avatar.patient-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.avatar-soft {
  color: #d8f6e7;
  background: #12322f;
}

.row-action,
.row-arrow {
  color: #8bd1aa;
}

.row-action {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding-inline: 4px;
}

.status-active,
.status-confirmed,
.status-completed {
  color: #b9efd2;
  background: #0e3027;
}

.status-inactive,
.status-archived,
.status-deceased,
.status-draft,
.status-planned {
  color: #c2d0d3;
  background: #1b2c33;
}

.status-warning,
.warning-count {
  color: #f5dda0;
  background: #312919;
}

.warning-count.is-critical,
.status-critical,
.status-cancelled,
.status-no_show {
  color: #ffc7c7;
  background: #351b20;
}

/* Patient record */

.patient-title {
  gap: 12px;
}

.patient-title .avatar-large {
  width: 48px;
  height: 48px;
  border-color: #3b6a65;
  background:
    linear-gradient(145deg, rgba(60, 197, 120, 0.23), rgba(25, 79, 97, 0.18)),
    #0a242a;
}

.patient-title .avatar-large.patient-photo {
  background: #0b2930;
}

.patient-title small {
  margin-top: 3px;
  font-size: 0.68rem;
}

.patient-headline-meta {
  gap: 8px;
  margin-top: 7px;
  font-size: 0.72rem;
}

.record-tabs {
  position: sticky;
  z-index: 12;
  top: 0;
  gap: 2px;
  margin-bottom: 13px;
  padding: 5px;
  overflow-x: auto;
  background: rgba(5, 18, 24, 0.94);
  border: 1px solid #1a3740;
  border-radius: 8px;
  backdrop-filter: blur(12px);
}

.record-tabs a,
.record-tabs > span {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.72rem;
}

.record-tabs a[aria-current="page"] {
  color: #edfff5;
  background: #0d2b2d;
}

.record-tabs a[aria-current="page"]::after {
  right: 10px;
  bottom: 2px;
  left: 10px;
  height: 1px;
}

.alert-ribbon {
  margin-bottom: 13px;
  padding: 15px;
  background: #241519;
  border-color: #60323a;
  border-radius: var(--radius);
}

.alert-ribbon-heading {
  min-width: 230px;
}

.alert-strip {
  gap: 8px;
}

.alert-item {
  background: #2b171b;
  border-color: #66353e;
  border-radius: var(--radius-sm);
}

.patient-cockpit {
  gap: 13px;
}

.patient-cockpit-main,
.patient-cockpit-side {
  gap: 13px;
}

.cockpit-work-context,
.treatment-continuity,
.cockpit-attention,
.master-data,
.intake-snapshot,
.communication-snapshot,
.audit-panel {
  padding: 19px;
}

.care-snapshot {
  gap: 12px;
}

.next-appointment-block,
.prescription-block {
  padding: 15px;
  background: #07181e;
  border: 1px solid #183740;
  border-radius: 8px;
}

.next-appointment-link {
  background: #0a2329;
  border-color: #245247;
  border-radius: 8px;
}

.next-appointment-link time {
  color: #a6e4c2;
  font-size: 0.72rem;
}

.cockpit-prescription {
  background: #071a20;
  border-color: #1b3941;
  border-radius: 8px;
}

.progress-track {
  height: 5px;
}

.treatment-continuity-list li > a {
  min-height: 58px;
  border-top-color: #17343c;
}

.master-data dl > div {
  border-top-color: #17343c;
}

.master-data dt {
  color: #78939a;
  font-size: 0.64rem;
}

.master-data dd {
  color: #d7e1e2;
  font-size: 0.76rem;
}

/* Forms */

.patient-form,
.record-form,
.intake-form {
  max-width: 1320px;
  gap: 12px;
}

.form-section,
.intake-section {
  padding: 20px;
}

.form-section-heading {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.form-section-heading > span {
  width: 30px;
  height: 30px;
  color: #b9efd2;
  background: #0b2b27;
  border: 1px solid #285747;
  border-radius: 8px;
  font-size: 0.68rem;
}

.form-section-heading h2 {
  margin-bottom: 3px;
  font-size: 1rem;
}

.form-section-heading p {
  font-size: 0.72rem;
}

.field-grid {
  gap: 13px 11px;
}

.field-grid label,
.stacked-form label {
  gap: 5px;
}

.field-grid label > span,
.stacked-form label > span {
  color: #aabdc1;
  font-size: 0.68rem;
  font-weight: 680;
}

.form-actions {
  position: sticky;
  z-index: 11;
  bottom: 12px;
  min-height: 58px;
  margin-top: 4px;
  padding: 9px 10px;
  background: rgba(5, 18, 24, 0.94);
  border: 1px solid #23434b;
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.form-error-summary {
  padding: 14px 16px;
  background: #2a171b;
  border-color: #82434c;
  border-radius: var(--radius-sm);
}

.field-error {
  color: #ffabab;
}

.appointment-phase-disclosure {
  min-width: 0;
  border-top: 1px solid #19353d;
  border-bottom: 1px solid #19353d;
}

.appointment-phase-disclosure > summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 2px;
  color: var(--text-soft);
  cursor: pointer;
  list-style: none;
}

.appointment-phase-disclosure > summary::-webkit-details-marker {
  display: none;
}

.appointment-phase-disclosure > summary > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.appointment-phase-disclosure > summary strong {
  font-size: 0.76rem;
}

.appointment-phase-disclosure > summary small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.appointment-phase-disclosure > summary > span:last-child {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #9bcfba;
  border: 1px solid #285048;
  border-radius: 50%;
  transition: transform 120ms ease;
}

.appointment-phase-disclosure[open] > summary > span:last-child {
  transform: rotate(45deg);
}

.appointment-phase-fields {
  display: grid;
  gap: 14px;
  padding: 5px 0 16px;
}

.appointment-phase-fields > label {
  display: grid;
  gap: 7px;
}

.appointment-phase-fields > label[hidden] {
  display: none;
}

.appointment-phase-fields > label > span {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 680;
}

.check-line {
  border-radius: var(--radius-sm);
}

.check-line input {
  accent-color: var(--green-bright);
}

/* Calendar */

.calendar-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.calendar-secondary-controls {
  display: contents;
}

.calendar-mobile-filter-toggle,
.calendar-mobile-scroll-hint,
.calendar-appointment-touch-trigger {
  display: none;
}

.date-navigation,
.view-switch,
.team-filter {
  min-height: 39px;
}

.view-switch {
  padding: 3px;
  background: #05151b;
  border-color: #28434b;
  border-radius: var(--radius-sm);
}

.view-switch a {
  min-height: 31px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 0.68rem;
}

.view-switch a[aria-current="page"] {
  color: #eafff3;
  background: #12342f;
}

.calendar-toolbar .team-filter {
  display: flex;
  grid-column: 1 / -1;
  align-items: end;
  justify-self: stretch;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: #06151b;
  border: 1px solid #1d3d45;
  border-radius: var(--radius-sm);
}

.team-filter fieldset {
  min-width: 0;
  flex: 1;
  padding: 0;
  margin: 0;
  border: 0;
}

.team-filter legend {
  padding: 0;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.team-filter-option {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: var(--text-soft);
  background: #091d24;
  border: 1px solid #24434b;
  border-radius: 6px;
  cursor: pointer;
}

.team-filter-option:has(input:checked) {
  color: var(--text);
  background: #0c2929;
  border-color: #337260;
}

.team-filter-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--green-bright);
}

.team-filter-option i {
  width: 7px;
  height: 18px;
  flex: 0 0 auto;
  background: var(--member-color);
  border-radius: 999px;
}

.team-filter-option span {
  font-size: 0.76rem;
  font-weight: 680;
  white-space: nowrap;
}

.team-filter-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.calendar-command {
  gap: 12px;
}

.agenda-board {
  gap: 9px;
}

.agenda-day {
  overflow: hidden;
  background: #07181e;
  border-color: #1a3740;
  border-radius: 8px;
}

.agenda-day.is-selected {
  border-color: #316b58;
  box-shadow: inset 0 1px 0 rgba(60, 197, 120, 0.14);
}

.agenda-day > header {
  min-height: 52px;
  padding: 10px 12px;
  background: #06151b;
  border-bottom-color: #19353d;
}

.appointment-line {
  min-height: 51px;
  padding: 7px 10px;
  border-top-color: #16333b;
  transition:
    color 130ms ease,
    background-color 130ms ease;
}

.appointment-line:hover {
  background: #0b232a;
}

.appointment-line time {
  display: grid;
  gap: 2px;
  color: #9bc9b3;
  font-weight: 680;
}

.appointment-line time span {
  white-space: nowrap;
}

.appointment-line time small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 620;
  white-space: nowrap;
}

.appointment-line > .appointment-treatment-marker {
  display: block;
  box-shadow: 0 0 0 1px rgba(208, 232, 222, .2);
}

.appointment-service-label {
  color: var(--muted-strong);
  font-weight: 720;
  letter-spacing: .025em;
}

.agenda-board:not(.is-week) .appointment-line {
  grid-template-columns: 112px 8px minmax(220px, 1fr) minmax(140px, 0.65fr) auto;
}

.appointment-main strong {
  font-size: 0.76rem;
}

.appointment-main small,
.appointment-team {
  font-size: 0.76rem;
  line-height: 1.35;
}

.calendar-rail {
  background: #07181e;
  border-color: #1a3740;
  border-radius: 8px;
}

.calendar-rail li {
  grid-template-columns: 8px minmax(0, 1fr) 32px;
  border-top-color: #17333b;
}

.calendar-rail li > a {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius-sm);
}

@media (pointer: coarse) {
  :where(.button, .icon-button, .command-link, .row-action) {
    min-height: 44px;
  }

  :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select) {
    min-height: 44px;
  }

  .calendar-rail li {
    grid-template-columns: 8px minmax(0, 1fr) 44px;
  }

  .calendar-rail li > a {
    width: 44px;
    height: 44px;
  }
}

.safety-note {
  background: #0a2526;
  border-color: #245044;
  border-radius: 8px;
}

.calendar-command.is-week {
  grid-template-columns: minmax(0, 1fr);
}

.agenda-board.is-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 6px;
  overflow-x: auto;
  scrollbar-color: #28505a #07171d;
}

.agenda-board.is-week .agenda-day {
  min-width: 132px;
}

.agenda-board.is-week .agenda-day > header {
  min-height: 58px;
  align-items: flex-start;
  padding: 9px;
}

.agenda-board.is-week .agenda-day > header div {
  display: grid;
  gap: 2px;
}

.agenda-board.is-week .agenda-day > header span {
  font-size: 0.72rem;
}

.agenda-board.is-week .agenda-day > header strong,
.agenda-board.is-week .agenda-day > header small {
  font-size: 0.68rem;
}

.agenda-board.is-week .agenda-lines {
  max-height: calc(100vh - 285px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #28505a transparent;
}

.agenda-board.is-week .appointment-line {
  min-height: 88px;
  grid-template-columns: 6px minmax(0, 1fr);
  grid-template-areas:
    "marker time"
    "marker patient"
    "marker team"
    "marker status";
  align-content: center;
  gap: 2px 8px;
  padding: 8px;
}

.agenda-board.is-week .appointment-line time {
  grid-area: time;
  font-size: 0.72rem;
}

.agenda-board.is-week .appointment-line time small {
  font-size: 0.64rem;
}

.agenda-board.is-week .appointment-line > .appointment-treatment-marker {
  width: 6px;
  height: 100%;
  min-height: 50px;
  grid-area: marker;
}

.agenda-board.is-week .appointment-main {
  grid-area: patient;
}

.agenda-board.is-week .appointment-main strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-board.is-week .appointment-main small,
.agenda-board.is-week .appointment-team {
  font-size: 0.72rem;
}

.agenda-board.is-week .appointment-team {
  overflow: hidden;
  grid-area: team;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-board.is-week .status-chip {
  width: max-content;
  max-width: 100%;
  grid-area: status;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-command.is-week .calendar-rail {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 280px;
  gap: 18px;
}

.calendar-command.is-week .calendar-rail ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 16px;
  margin-top: 0;
}

.calendar-command.is-week .calendar-rail .safety-note {
  margin-top: 0;
  padding-top: 0;
  padding-left: 16px;
  border-top: 0;
  border-left: 1px solid var(--line);
}

/* Calendar time grid */

.calendar-toolbar {
  grid-template-columns: auto minmax(250px, 1fr) auto auto;
  align-items: center;
}

.calendar-period-navigation {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.calendar-period-navigation .icon-button {
  width: 36px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--text-soft);
  border: 1px solid #28434b;
}

.calendar-period-navigation .icon-button:hover,
.calendar-period-navigation .icon-button:focus-visible {
  color: #eafff3;
  background: #12302f;
  border-color: #337260;
}

.calendar-period-label {
  display: grid;
  min-width: 220px;
  place-content: center;
  padding: 4px 14px;
  text-align: center;
  background: #06151b;
  border: 1px solid #28434b;
  border-radius: 6px;
}

.calendar-period-label strong {
  color: var(--text);
  font-size: 0.82rem;
}

.calendar-period-label span {
  color: #9bc9b3;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.calendar-secondary-controls > .date-picker {
  justify-self: end;
}

.calendar-today {
  align-self: center;
}

.calendar-legend {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  margin-top: 10px;
  color: var(--text-soft);
  background: #06151b;
  border: 1px solid #1d3d45;
  border-radius: 8px;
  font-size: 0.72rem;
}

.calendar-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.calendar-legend i {
  width: 20px;
  height: 12px;
  border: 1px solid #41616a;
  border-radius: 6px;
}

.calendar-legend i.is-free {
  background: rgba(57, 187, 118, .16);
  border-color: rgba(72, 205, 135, .56);
}

.calendar-legend i.is-booked {
  background: rgba(63, 143, 168, .42);
  border-color: #3f8fa8;
}

.calendar-legend i.is-unavailable {
  background-color: #0b1b21;
  /* impeccable-disable-next-line repeating-stripes-gradient: semantic unavailable-time pattern in the scheduling legend */
  background-image: repeating-linear-gradient(135deg, rgba(111, 139, 147, .16) 0 2px, transparent 2px 7px);
}

.calendar-legend small {
  margin-left: auto;
  color: var(--muted);
  text-align: right;
}

.calendar-grid-viewport {
  position: relative;
  max-height: min(70vh, 780px);
  min-height: 520px;
  margin-top: 10px;
  overflow: auto;
  background: #06151b;
  border: 1px solid #1d3d45;
  border-radius: 8px;
  scrollbar-color: #28505a #07171d;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.calendar-grid-viewport:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
}

.calendar-grid-table {
  --calendar-slot-unit: 8px;
  --calendar-quarter-height: calc(var(--calendar-slot-unit) * 3);
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  color: var(--text-soft);
  background: #07181e;
}

.calendar-grid-table th,
.calendar-grid-table td {
  padding: 0;
  border-right: 1px solid #17333b;
  border-bottom: 1px solid rgba(23, 51, 59, .28);
}

.calendar-grid-table thead th {
  position: sticky;
  z-index: 8;
  background: #06151b;
}

.calendar-time-corner {
  top: 0;
  left: 0;
  z-index: 12 !important;
  width: 72px;
  min-width: 72px;
  vertical-align: middle;
  border-right-color: #2b4d56 !important;
}

.calendar-time-corner span,
.calendar-time-corner small {
  display: block;
}

.calendar-time-corner span {
  color: var(--text-soft);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.calendar-time-corner small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
}

.calendar-day-heading {
  top: 0;
  height: 40px;
  color: var(--text-soft);
  border-bottom-color: #28434b !important;
}

.calendar-day-heading strong,
.calendar-day-heading span {
  display: inline;
  font-size: 0.72rem;
}

.calendar-day-heading span {
  margin-left: 5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.calendar-day-heading.is-today {
  box-shadow: inset 0 2px 0 var(--green-bright);
}

.calendar-member-heading {
  top: 40px;
  width: 152px;
  min-width: 152px;
  height: 48px;
  padding: 6px 8px !important;
  text-align: left;
  border-bottom-color: #2b4d56 !important;
}

.calendar-member-heading > i {
  display: inline-block;
  width: 5px;
  height: 28px;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--member-color);
  border-radius: 999px;
}

.calendar-member-heading > span {
  display: inline-grid;
  max-width: 126px;
  vertical-align: middle;
}

.calendar-member-heading strong,
.calendar-member-heading small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-member-heading strong {
  color: var(--text);
  font-size: 0.68rem;
}

.calendar-member-heading small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 560;
}

.calendar-grid-table tbody tr {
  height: var(--calendar-slot-unit);
  line-height: 0;
}

.calendar-grid-table tbody tr.is-quarter-hour > th,
.calendar-grid-table tbody tr.is-quarter-hour > td {
  border-top: 1px solid rgba(41, 70, 80, .58);
}

.calendar-grid-table tbody tr.is-half-hour > th,
.calendar-grid-table tbody tr.is-half-hour > td {
  border-top: 1px solid #294650;
}

.calendar-time-label {
  position: sticky;
  left: 0;
  z-index: 6;
  width: 72px;
  min-width: 72px;
  padding: 0 9px 0 4px !important;
  color: #90aab1;
  background: #06151b;
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
  height: var(--calendar-slot-unit);
  line-height: 0;
  vertical-align: top;
  border-right-color: #2b4d56 !important;
}

.calendar-time-label span {
  position: absolute;
  top: 0;
  right: 9px;
  line-height: 1;
  transform: translateY(-50%);
}

.calendar-slot {
  position: relative;
  width: 152px;
  min-width: 152px;
  height: var(--calendar-slot-unit);
  overflow: visible;
  vertical-align: top;
}

.calendar-slot:not(.calendar-slot-appointment)::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  /* impeccable-disable-next-line repeating-stripes-gradient: real quarter-hour measurement lines in the calendar grid */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 calc(var(--calendar-quarter-height) - 1px),
    rgba(41, 70, 80, .58) calc(var(--calendar-quarter-height) - 1px) var(--calendar-quarter-height)
  );
  background-position-y: var(--calendar-quarter-shift, 0);
  content: "";
  pointer-events: none;
}

.calendar-quarter-phase-1 {
  --calendar-quarter-shift: calc(var(--calendar-slot-unit) * -1);
}

.calendar-quarter-phase-2 {
  --calendar-quarter-shift: calc(var(--calendar-slot-unit) * -2);
}

.calendar-slot > .calendar-slot-copy,
.calendar-slot > .calendar-appointment {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.calendar-slot-copy {
  display: grid;
  min-height: 100%;
  align-content: start;
  gap: 2px;
  padding: 6px 8px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.2;
}

a.calendar-slot-copy:hover,
a.calendar-slot-copy:focus-visible {
  color: #eafff3;
  background: rgba(57, 187, 118, .13);
  outline: 2px solid rgba(72, 205, 135, .76);
  outline-offset: -2px;
}

.calendar-slot-copy strong {
  font-size: 0.64rem;
  font-weight: 720;
}

.calendar-slot-copy span {
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
}

.calendar-slot-free {
  background: rgba(57, 187, 118, .075);
  box-shadow: inset 0 0 0 1px rgba(72, 205, 135, .16);
}

.calendar-slot-free .calendar-slot-copy {
  color: #8fd8b0;
}

.calendar-slot-outside,
.calendar-slot-unknown,
.calendar-slot-absence {
  background-color: #09181e;
  /* impeccable-disable-next-line repeating-stripes-gradient: semantic unavailable-time pattern in the scheduling grid */
  background-image: repeating-linear-gradient(135deg, rgba(111, 139, 147, .11) 0 2px, transparent 2px 8px);
}

.calendar-slot-provisional,
.calendar-slot-absence-draft {
  background: rgba(211, 164, 74, .075);
  box-shadow: inset 0 0 0 1px rgba(211, 164, 74, .18);
}

.calendar-slot-provisional .calendar-slot-copy,
.calendar-slot-absence-draft .calendar-slot-copy {
  color: #d3b77d;
}

.calendar-slot-absence {
  background-color: rgba(134, 69, 78, .12);
  /* impeccable-disable-next-line repeating-stripes-gradient: semantic absence pattern distinguishes unavailable clinical time */
  background-image: repeating-linear-gradient(135deg, rgba(192, 109, 126, .18) 0 2px, transparent 2px 8px);
}

.calendar-slot-absence .calendar-slot-copy {
  color: #dfa3ad;
}

.calendar-slot-busy {
  background: #10262d;
  box-shadow: inset 4px 0 0 #71858a;
}

.calendar-slot-busy .calendar-slot-copy {
  color: #aabfc5;
}

.calendar-appointment {
  position: relative;
  z-index: 2;
  min-height: 100%;
  color: #f4fffa;
  background: #10272e;
  box-shadow: inset 0 0 0 1px rgba(226, 243, 236, .2), 0 2px 8px rgba(0, 0, 0, .18);
}

.calendar-appointment:hover,
.calendar-appointment:focus-within,
.calendar-appointment.is-actions-open {
  z-index: 28;
}

.calendar-appointment.has-warning {
  box-shadow: inset 0 0 0 2px rgba(230, 189, 103, .78), 0 2px 8px rgba(0, 0, 0, .18);
}

.calendar-appointment-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.calendar-appointment-main {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100%;
  align-content: start;
  gap: 1px;
  padding: 4px 10px 3px;
  color: #f4fffa;
  line-height: 1.2;
}

.calendar-appointment-main:hover,
.calendar-appointment-main:focus-visible {
  color: #fff;
  outline: 2px solid #d9fff0;
  outline-offset: -2px;
}

.calendar-appointment-main time,
.calendar-appointment-main span {
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
}

.calendar-appointment-main time {
  font-weight: 740;
}

.calendar-appointment-main strong {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-appointment-touch-trigger {
  position: absolute;
  z-index: 4;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text);
  background: rgba(5, 18, 24, .9);
  border: 1px solid #41616a;
  border-radius: 6px;
  touch-action: manipulation;
}

.calendar-appointment-touch-trigger svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-appointment-touch-trigger[aria-expanded="true"] {
  color: #06150f;
  background: var(--green-soft);
  border-color: var(--green-soft);
}

.calendar-appointment-main span {
  overflow: hidden;
  color: rgba(244, 255, 250, .83);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-action-shell {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.calendar-action-palette svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-action-palette {
  position: fixed;
  z-index: 120;
  top: var(--calendar-actions-top, -10000px);
  left: var(--calendar-actions-left, -10000px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(332px, calc(100vw - 16px));
  gap: 4px;
  padding: 4px;
  box-sizing: border-box;
  visibility: hidden;
  background: #06151b;
  border: 1px solid #3b6870;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .38);
  opacity: 0;
  pointer-events: none;
}

.calendar-action-palette.is-viewport-positioned {
  isolation: isolate;
}

.calendar-action-palette.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.calendar-action-group {
  position: static;
  min-width: 0;
}

.calendar-action-group > button,
.calendar-action-group > a {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 5px 4px 4px;
  gap: 4px;
  overflow: hidden;
  box-sizing: border-box;
  color: #d9eee6;
  background: #102a31;
  border: 1px solid #31555c;
  border-radius: 6px;
  cursor: pointer;
}

.calendar-action-label {
  display: block;
  width: 100%;
  overflow: hidden;
  font-size: 0.64rem;
  font-weight: 720;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-action-group > button:hover,
.calendar-action-group > button:focus-visible,
.calendar-action-group > button[aria-expanded="true"],
.calendar-action-group > a:hover,
.calendar-action-group > a:focus-visible {
  color: #06150f;
  background: #bdf4d5;
  border-color: #bdf4d5;
}

.calendar-action-group > button:disabled {
  color: #71878a;
  background: #102027;
  cursor: not-allowed;
  opacity: .58;
}

.calendar-cancel-action > a:hover,
.calendar-cancel-action > a:focus-visible {
  color: #fff;
  background: #8f3544;
  border-color: #df8291;
}

.calendar-action-panel,
.calendar-action-hint {
  position: absolute;
  z-index: 34;
  top: var(--calendar-panel-top, calc(100% - 1px));
  left: var(--calendar-panel-left, 0);
  max-width: var(--calendar-panel-max-width, calc(100vw - 16px));
  max-height: var(--calendar-panel-max-height, calc(100vh - 16px));
  overflow-y: auto;
  box-sizing: border-box;
  visibility: hidden;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
}

.calendar-action-group:hover > .calendar-action-panel,
.calendar-action-group:focus-within > .calendar-action-panel,
.calendar-action-group.is-panel-open > .calendar-action-panel,
.calendar-action-group:hover > .calendar-action-hint,
.calendar-action-group:focus-within > .calendar-action-hint {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.calendar-action-palette.is-previewing
  [data-calendar-action-group="info"] > .calendar-action-panel {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.calendar-action-palette:has(.calendar-action-group:hover)
  .calendar-action-group:not(:hover) > .calendar-action-panel,
.calendar-action-palette:has(.calendar-action-group:hover)
  .calendar-action-group:not(:hover) > .calendar-action-hint {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.calendar-edit-panel {
  display: grid;
  width: 248px;
  overflow-y: auto;
  gap: 6px;
  padding: 7px;
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float);
}

.calendar-edit-section {
  display: grid;
  gap: 1px;
}

.calendar-edit-section + .calendar-edit-section {
  padding-top: 6px;
  border-top: 1px solid #24434b;
}

.calendar-edit-panel a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  color: var(--text-soft);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 680;
  line-height: 1.35;
  white-space: normal;
}

.calendar-edit-panel a:hover,
.calendar-edit-panel a:focus-visible {
  color: #06150f;
  background: #bdf4d5;
}

.calendar-status-panel {
  display: grid;
  width: min(260px, calc(100vw - 16px));
  overflow-y: auto;
  gap: 6px;
  padding: 7px;
  color: var(--text-soft);
  background: #06151b;
  border: 1px solid #3b6870;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
}

.calendar-status-panel a,
.calendar-status-panel form > button {
  display: grid;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  gap: 2px;
  color: var(--text-soft);
  text-align: left;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.calendar-status-panel strong {
  color: var(--text);
  font-size: 14px;
}

.calendar-status-panel small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.calendar-status-panel a:hover,
.calendar-status-panel a:focus-visible {
  color: #102a1d;
  background: var(--green-soft);
  border-color: var(--green-soft);
}

.calendar-status-panel a:hover strong,
.calendar-status-panel a:focus-visible strong,
.calendar-status-panel a:hover small,
.calendar-status-panel a:focus-visible small {
  color: #102a1d;
}

.calendar-status-panel form > button:not(:disabled):hover,
.calendar-status-panel form > button:not(:disabled):focus-visible {
  color: var(--warning);
  background: #33260a;
  border-color: var(--warning);
}

.calendar-status-panel form > button:disabled {
  color: var(--muted);
  background: var(--surface-quiet);
  cursor: not-allowed;
  opacity: .64;
}

.calendar-action-hint {
  width: min(220px, calc(100vw - 16px));
  padding: 9px 11px;
  color: #ffd6dc;
  background: #28151a;
  border: 1px solid #8f4a55;
  border-radius: 6px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .4);
  font-size: 0.68rem;
  font-weight: 680;
}

.calendar-appointment-peek {
  display: grid;
  width: min(320px, calc(100vw - 16px));
  max-height: var(
    --calendar-panel-max-height,
    min(520px, calc(100vh - 16px))
  );
  overflow-y: auto;
  padding: 12px;
  color: var(--text-soft);
  background: #06151b;
  border: 1px solid #3b6870;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
  line-height: 1.35;
}

.calendar-appointment-peek header {
  display: grid;
  gap: 2px;
  padding-bottom: 9px;
  border-bottom: 1px solid #24434b;
}

.calendar-appointment-peek header span {
  color: #8fd8b0;
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.calendar-appointment-peek header strong {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.25;
}

.calendar-appointment-peek dl {
  display: grid;
  gap: 0;
  margin: 7px 0;
}

.calendar-appointment-peek dl div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(36, 67, 75, .62);
}

.calendar-appointment-peek dt,
.calendar-appointment-peek dd {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
}

.calendar-appointment-peek dl .calendar-peek-warning dt,
.calendar-appointment-peek dl .calendar-peek-warning dd {
  color: #e6bd67;
}

.calendar-appointment-peek dt {
  color: var(--muted);
}

.calendar-appointment-peek dd {
  color: var(--text-soft);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.calendar-appointment-peek nav {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.calendar-appointment-peek nav a {
  min-height: 32px;
  padding: 7px 9px;
  color: #bdf4d5;
  background: #0d2b2a;
  border: 1px solid #337260;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 720;
}

.calendar-appointment-peek nav a:hover,
.calendar-appointment-peek nav a:focus-visible {
  color: #06150f;
  background: #bdf4d5;
}

.calendar-cancelled-overview {
  margin-top: 10px;
  background: #06151b;
  border: 1px solid #1d3d45;
  border-radius: 8px;
}

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

  .calendar-period-navigation {
    grid-column: 1 / -1;
  }

  .calendar-secondary-controls > .date-picker {
    justify-self: start;
  }

  .calendar-legend {
    flex-wrap: wrap;
  }

  .calendar-legend small {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

@media (max-width: 680px), (max-height: 520px) and (max-width: 900px) {
  .route-appointments .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .route-appointments .topbar-actions .button {
    width: 100%;
    min-height: 44px;
    padding-inline: 9px;
    text-align: center;
  }

  .calendar-period-navigation {
    width: 100%;
  }

  .calendar-period-navigation .icon-button {
    width: 44px;
    height: 44px;
  }

  .calendar-period-label {
    min-width: 0;
    flex: 1;
    padding-inline: 6px;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr;
    padding: 10px;
    background: var(--surface-quiet);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }

  .calendar-mobile-filter-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    min-height: 48px;
    align-items: center;
    gap: 8px;
    text-align: left;
  }

  .calendar-mobile-filter-toggle small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 620;
    white-space: nowrap;
  }

  .calendar-secondary-controls {
    display: none;
  }

  .calendar-toolbar.is-mobile-expanded .calendar-secondary-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .calendar-secondary-controls > .date-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    justify-self: stretch;
  }

  .calendar-secondary-controls > .date-picker input,
  .calendar-secondary-controls > .date-picker .button,
  .calendar-today,
  .view-switch a,
  .team-filter-option,
  .team-filter-actions .button {
    min-height: 44px;
  }

  .calendar-today,
  .view-switch {
    width: 100%;
  }

  .view-switch a {
    flex: 1;
  }

  .calendar-grid-viewport {
    height: clamp(360px, 62dvh, 620px);
    min-height: 0;
    max-height: none;
    scroll-padding-left: 72px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-member-heading,
  .calendar-slot {
    scroll-snap-align: start;
  }

  .calendar-mobile-scroll-hint {
    display: flex;
    min-height: 38px;
    align-items: center;
    padding: 8px 10px;
    margin: 10px 0 0;
    color: var(--text-soft);
    background: var(--surface-quiet);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .72rem;
  }

  .calendar-legend {
    gap: 9px 12px;
  }

  .calendar-legend small {
    display: none;
  }

  .calendar-legend > span {
    width: calc(50% - 8px);
    white-space: normal;
  }
}

@media (max-height: 520px) and (max-width: 900px) {
  .calendar-grid-viewport {
    height: calc(100dvh - 96px);
    min-height: 260px;
  }
}

@media (max-width: 820px), (max-height: 520px) and (max-width: 900px), (hover: none), (pointer: coarse) {
  body.calendar-actions-touch-open::before {
    position: fixed;
    z-index: 110;
    inset: 0;
    background: rgba(3, 16, 21, .66);
    content: "";
  }

  .calendar-appointment {
    touch-action: manipulation;
  }

  .calendar-appointment-main {
    padding-right: 49px;
  }

  .calendar-appointment-touch-trigger {
    display: flex;
  }

  .calendar-action-palette.is-touch-sheet {
    top: auto;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    padding: 6px;
    gap: 6px;
    border-radius: 12px;
    box-shadow: 0 -14px 38px rgba(0, 0, 0, .5);
  }

  .calendar-action-palette.is-touch-sheet .calendar-action-group > button,
  .calendar-action-palette.is-touch-sheet .calendar-action-group > a {
    min-height: 54px;
  }

  .calendar-action-palette.is-touch-sheet .calendar-action-panel,
  .calendar-action-palette.is-touch-sheet .calendar-action-hint {
    position: fixed;
    top: auto;
    right: 8px;
    bottom: calc(76px + max(8px, env(safe-area-inset-bottom)));
    left: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 100px - env(safe-area-inset-bottom));
    border-radius: 12px 12px 8px 8px;
    box-shadow: 0 -18px 46px rgba(0, 0, 0, .54);
  }

  .calendar-action-palette.is-touch-sheet
    .calendar-action-group:not(.is-panel-open) > .calendar-action-panel,
  .calendar-action-palette.is-touch-sheet
    .calendar-action-group:not(.is-panel-open) > .calendar-action-hint {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .calendar-action-palette.is-touch-sheet
    .calendar-action-group.is-panel-open > .calendar-action-panel,
  .calendar-action-palette.is-touch-sheet
    .calendar-action-group.is-panel-open > .calendar-action-hint {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .calendar-appointment-peek dl div {
    grid-template-columns: minmax(86px, .42fr) minmax(0, 1fr);
  }

  .calendar-appointment-peek nav a,
  .calendar-edit-panel a,
  .calendar-status-panel a,
  .calendar-status-panel form > button {
    min-height: 44px;
  }
}

@media (pointer: coarse) {
  .calendar-action-group > button,
  .calendar-action-group > a {
    min-height: 48px;
  }

  .calendar-action-palette {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(332px, calc(100vw - 16px));
  }
}

.prescription-intake-section {
  scroll-margin-top: 16px;
}

.prescription-intake-status {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  padding: 9px 11px;
  margin-bottom: 12px;
  color: var(--text-soft);
  background: var(--surface-quiet);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.prescription-intake-status strong {
  flex: 0 0 auto;
  color: var(--green-bright);
}

.prescription-intake-status span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.prescription-intake-status.is-unavailable strong {
  color: var(--warning);
}

.prescription-intake-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  align-items: stretch;
  gap: 13px;
}

.prescription-photo-picker {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 14px;
  background: var(--surface-quiet);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.prescription-photo-picker input[type="file"] {
  width: 100%;
}

.prescription-photo-picker > strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.prescription-photo-confirmation {
  margin-top: 12px;
}

@media (max-width: 820px) {
  .prescription-intake-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .prescription-intake-status {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Treatment, prescription, findings, waitlists and workflow detail pages */

.prescription-detail-grid,
.treatment-detail-layout,
.finding-detail-layout,
.waitlist-detail-grid,
.appointment-detail-layout,
.backup-layout,
.booking-confirmation {
  gap: 13px;
}

.backup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.backup-actions form {
  margin: 0;
}

.backup-actions .button {
  min-height: 34px;
  padding-inline: 10px;
}

.appointment-patient-link {
  display: grid;
  gap: 2px;
  color: var(--green-soft);
}

.appointment-patient-link small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 560;
}

.appointment-phases {
  grid-column: 1 / -1;
}

.appointment-phase-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.appointment-phase-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(240px, 1.3fr);
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.appointment-phase-row > span {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.appointment-phase-row strong {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.appointment-phase-row small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.appointment-context-links {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(5, minmax(130px, 1fr));
  overflow: hidden;
  background: #07181e;
  border: 1px solid #1a3740;
  border-radius: 8px;
}

.appointment-context-links > div,
.appointment-context-links > a {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 76px;
  padding: 13px 15px;
}

.appointment-context-links > a {
  color: var(--text-soft);
  border-left: 1px solid #17333b;
  transition: background-color 130ms ease, color 130ms ease;
}

.appointment-context-links > a:hover {
  color: var(--text);
  background: rgba(36, 164, 129, 0.1);
}

.appointment-context-links > a span {
  color: var(--green-soft);
  font-size: 0.82rem;
  font-weight: 760;
}

.appointment-context-links > a small {
  color: var(--muted);
  font-size: 0.68rem;
}

@media (max-width: 1280px) {
  .appointment-context-links {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .appointment-context-links > a:nth-child(4) {
    border-left: 0;
  }
}

.prescription-focus,
.prescription-data,
.treatment-detail-main,
.finding-map-panel,
.finding-readout,
.waitlist-summary-card,
.waitlist-contact-card,
.waitlist-actions-card,
.waitlist-history-card,
.appointment-hero,
.cancelled-record,
.booking-summary,
.booking-boundaries {
  padding: 19px;
}

.treatment-detail-steps,
.treatment-form-steps {
  gap: 10px;
}

.treatment-step {
  background: #07191f;
}

.detail-tags span,
.complaint-option,
.result-option,
.marker-type-option {
  border-radius: 8px;
}

.finding-workspace {
  gap: 12px;
}

.finding-tools,
.finding-details {
  padding: 16px;
  background: #081a21;
  border-color: #1b3942;
}

.finding-map-panel {
  background:
    radial-gradient(circle at 50% 35%, rgba(50, 117, 109, 0.1), transparent 26rem),
    #07181e;
}

.body-map-card {
  background: #05151b;
  border-color: #1c3a43;
  border-radius: 8px;
}

.body-silhouette {
  filter: saturate(0.88) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.16));
}

.body-figure-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.body-figure-title strong,
.body-figure-title small {
  display: block;
}

.body-anatomy-image {
  opacity: 0.88;
  filter:
    brightness(0.88)
    contrast(1.08)
    sepia(0.08)
    hue-rotate(126deg)
    saturate(0.72);
  pointer-events: none;
  transition:
    opacity 140ms ease,
    filter 140ms ease;
}

.body-hit-zone {
  fill: transparent;
  pointer-events: all;
  cursor: crosshair;
}

.body-figure:hover .body-anatomy-image {
  opacity: 0.96;
  filter:
    brightness(0.96)
    contrast(1.1)
    sepia(0.08)
    hue-rotate(126deg)
    saturate(0.78);
}

.body-head,
.body-neck,
.body-torso,
.body-pelvis,
.body-arm,
.body-hand,
.body-thigh,
.body-lower-leg {
  transition:
    fill 140ms ease,
    stroke 140ms ease;
}

.body-hand {
  stroke-width: 1.05;
}

.body-digits {
  opacity: 0.44;
  stroke-width: 0.78;
}

.body-pelvis {
  fill-opacity: 0.96;
}

.body-figure:hover .body-anatomy {
  stroke: #75949e;
}

.finding-integrity-note {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 14px;
  color: var(--text-soft);
  background: var(--surface-raised);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
}

.finding-integrity-note strong {
  color: var(--green-soft);
  font-size: 0.76rem;
  line-height: 1.35;
}

.finding-integrity-note span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.marker-editor {
  background: #07191f;
  border-color: #1d3a43;
  border-radius: 8px;
}

.waitlist-stage-switch,
.intake-progress,
.treatment-stepper {
  background: #07181e;
  border-color: #1b3941;
  border-radius: 8px;
}

.timeline li {
  border-color: #17333b;
}

.timeline i,
.activity-mark {
  background: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(60, 197, 120, 0.08);
}

.immutable-note,
.draft-note,
.safety-check,
.truth-note {
  border-radius: var(--radius-sm);
}

/* Authentication */

.auth-shell {
  background:
    radial-gradient(circle at 18% 18%, rgba(53, 172, 115, 0.12), transparent 30rem),
    linear-gradient(135deg, #041117, #071b21 58%, #06151b);
}

.auth-card {
  background: rgba(7, 24, 30, 0.96);
  border-color: #24464f;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}

.auth-brand img {
  width: 104px;
  height: 104px;
  object-fit: contain;
}

/* Responsive safety */

@media (max-width: 1240px) {
  :root {
    --sidebar-width: 202px;
  }

  .dashboard-command {
    grid-template-columns: 1fr;
  }

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

  .team-flow {
    grid-column: 1 / -1;
  }

  .dashboard-grid {
    grid-template-columns: minmax(200px, 0.7fr) minmax(360px, 1.3fr);
  }

  .phase-panel {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .build-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
  }

  .build-path li:not(:last-child)::after {
    display: none;
  }

  .activity-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1040px) {
  .utility-context > span:last-child,
  .quick-actions a {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .dashboard-support,
  .dashboard-support.is-therapist,
  .billing-dashboard {
    grid-template-columns: 1fr;
  }

  .team-flow {
    grid-column: auto;
  }

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

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

  .activity-panel,
  .phase-panel {
    grid-column: auto;
  }

  .build-path {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 0 15px 92px;
  }

  .utility-strip {
    margin: 0 -15px;
    padding: 0 15px;
  }

  .topbar {
    min-height: auto;
    padding: 18px 0 15px;
  }

  .mobile-nav {
    background: rgba(4, 17, 23, 0.96);
    border-top-color: #224049;
    backdrop-filter: blur(14px);
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .form-actions {
    bottom: 78px;
  }

  .record-tabs {
    top: 0;
  }

  .backup-actions {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .appointment-phase-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .date-navigation {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 67px;
    width: 100%;
  }

  .date-navigation .date-picker {
    display: contents;
  }

  .date-navigation .date-picker label {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .calendar-toolbar .date-picker input {
    width: 100%;
    min-width: 0;
  }

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

  .view-switch {
    width: 100%;
  }

  .calendar-toolbar .team-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

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

  .team-filter-actions {
    display: grid;
    grid-template-columns: 0.65fr 1.35fr;
  }

  .team-filter-actions .button {
    width: 100%;
  }

  .agenda-board:not(.is-week) .appointment-line {
    grid-template-columns: 102px 6px minmax(0, 1fr);
  }

  .date-navigation > .icon-button:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .date-navigation > .icon-button:nth-of-type(2) {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .date-navigation .date-picker .button {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .date-navigation > .button {
    grid-column: 3;
    grid-row: 2;
    width: 100%;
  }

  h1 {
    font-size: 1.48rem;
  }

  .utility-context > span:last-child {
    display: none;
  }

  .status-panel,
  .activity-list,
  .build-path {
    grid-template-columns: 1fr;
  }

  .command-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

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

  .day-statline > div + div {
    border-left: 0;
  }

  .day-statline > div:nth-child(even) {
    border-left: 1px solid #17333b;
  }

  .day-statline > div:nth-child(n + 3) {
    border-top: 1px solid #17333b;
  }

  .day-appointment {
    grid-template-columns: 46px 5px minmax(0, 1fr) auto;
    gap: 9px;
    padding-inline: 12px;
  }

  .day-team {
    display: none;
  }

  .day-safety,
  .day-appointment .status-chip {
    padding-inline: 7px;
  }

  .billing-metrics {
    grid-template-columns: 1fr;
  }

  .billing-metrics span + span {
    border-top: 1px solid #17333b;
    border-left: 0;
  }

  .status-row:nth-child(even) {
    border-left: 0;
  }

  .status-row:nth-child(n + 2) {
    border-top: 1px solid var(--line);
  }

  .directory-tools {
    padding: 7px;
  }

  .form-section,
  .intake-section,
  .cockpit-work-context,
  .treatment-continuity,
  .cockpit-attention,
  .master-data,
  .intake-snapshot,
  .communication-snapshot,
  .audit-panel {
    padding: 15px;
  }

  .form-actions {
    align-items: stretch;
  }

  .appointment-form .form-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointment-form .form-actions .button {
    width: 100%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .button-primary:hover {
    transform: translateY(-1px);
  }

  .button-primary:active {
    transform: scale(0.975);
  }
}

/* Mehrseitige Praxissteuerung: ein Register, eine Aufgabe pro Seite. */
.settings-shell {
  display: grid;
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
  gap: 19px;
  align-items: start;
  width: 100%;
  max-width: 84rem;
}

.settings-register {
  position: sticky;
  top: 76px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-quiet);
}

.settings-register-intro {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 19px;
  border-bottom: 1px solid var(--line);
}

.settings-register-intro svg {
  width: 2rem;
  height: 2rem;
  padding: 7px;
  color: var(--green-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.settings-register-intro div,
.settings-switch > span:nth-of-type(1) {
  display: grid;
  gap: 7px;
}

.settings-register-intro span,
.settings-register > p,
.settings-field small,
.settings-choice-group small,
.settings-switch small,
.settings-section-head p,
.settings-form-actions p {
  color: var(--muted);
}

.settings-register > a {
  display: flex;
  min-height: 2.75rem;
  padding: 0 19px;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 650;
}

.settings-register > a:hover,
.settings-register > a:focus-visible {
  color: var(--text);
  background: var(--surface-raised);
}

.settings-register > a[aria-current="page"] {
  color: var(--green-soft);
  background: color-mix(in srgb, var(--green) 12%, var(--surface-quiet));
}

.settings-register > p {
  margin: 0;
  padding: 19px;
  max-width: 75ch;
  color: #9fb4b9;
  font-size: .75rem;
  line-height: 1.55;
}

.settings-workspace {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
}

.settings-section-head {
  display: flex;
  justify-content: space-between;
  gap: 19px;
  align-items: start;
  margin-bottom: 24px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
}

.settings-section-head h2,
.settings-section-head h3,
.settings-section-head p {
  margin: 0;
}

.settings-section-head h2 {
  margin-top: 7px;
  font-size: 1.04rem;
}

.settings-section-head p:not(.kicker) {
  margin-top: 7px;
  max-width: 75ch;
}

.settings-status-register,
.settings-runtime-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.settings-status-register > div,
.settings-runtime-list > div {
  display: grid;
  grid-template-columns: minmax(10rem, .65fr) minmax(0, 1.35fr);
  gap: 19px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.settings-status-register dt,
.settings-runtime-list dt {
  color: var(--muted);
}

.settings-status-register dd,
.settings-runtime-list dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-weight: 650;
}

.settings-readiness {
  margin-top: 24px;
}

.settings-readiness h3,
.settings-readiness p {
  margin: 0;
}

.settings-readiness h3 {
  margin-top: 7px;
  font-size: 1.04rem;
}

.settings-readiness ul {
  display: grid;
  margin: 19px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.settings-readiness li {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.settings-readiness li > div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.settings-readiness li span:last-child {
  color: var(--muted);
}

.settings-state-dot {
  width: 13px;
  height: 13px;
  margin-top: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-inset);
}

.settings-state-dot.is-ready {
  border-color: var(--green);
  background: var(--green);
}

.settings-state-dot.is-blocked {
  border-color: var(--warning);
  background: var(--warning);
}

.settings-boundary {
  margin-top: 19px;
  padding: 13px;
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
}

.settings-boundary.is-warning {
  border-color: var(--warning);
}

.settings-boundary p {
  margin: 7px 0 0;
  max-width: 75ch;
  color: var(--muted);
}

.settings-form,
.settings-field,
.settings-choice-group,
.settings-switch {
  display: grid;
}

.settings-form {
  gap: 24px;
}

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

.settings-field {
  gap: 7px;
  min-width: 0;
}

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

.settings-field > span,
.settings-choice-group legend {
  color: #d9e8e9;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.settings-field small,
.settings-choice-group small,
.settings-switch small,
.settings-section-head p,
.settings-form-actions p {
  color: #9fb4b9;
  font-size: .75rem;
  line-height: 1.5;
}

.settings-field input,
.settings-field select {
  width: 100%;
}

.settings-choice-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-choice-group legend {
  grid-column: 1 / -1;
  margin-bottom: 7px;
}

.settings-choice-group label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  min-height: 4.5rem;
  padding: 13px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  cursor: pointer;
}

.settings-choice-group label:has(input:checked) {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 9%, var(--surface-inset));
}

.settings-choice-group label > span {
  display: grid;
  gap: 7px;
}

.settings-input-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-input-unit input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.settings-input-unit > span {
  display: flex;
  padding: 0 13px;
  align-items: center;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-raised);
}

.settings-switch {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 3rem;
  gap: 19px;
  align-items: center;
  min-height: 4.75rem;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  cursor: pointer;
}

.settings-switch > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 3rem;
  height: 1.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-raised);
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--muted);
  content: "";
  transition: transform 180ms var(--ease-out), background 180ms var(--ease-out);
}

.settings-switch > input:checked ~ .switch-track {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 18%, var(--surface-raised));
}

.settings-switch > input:checked ~ .switch-track::after {
  background: var(--green-bright);
  transform: translateX(1.35rem);
}

.settings-switch > input:focus-visible ~ .switch-track {
  outline: 3px solid color-mix(in srgb, var(--green-bright) 55%, transparent);
  outline-offset: 3px;
}

.settings-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 19px;
  align-items: center;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.settings-form-actions p {
  margin: 0;
}

.density-compact .workspace {
  --row-density-padding: 7px;
}

.density-compact .directory-row,
.density-compact .catalog-register-row,
.density-compact .status-row {
  padding-block: var(--row-density-padding);
}

@media (max-width: 1080px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-register {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-register-intro,
  .settings-register > p {
    grid-column: 1 / -1;
  }

  .settings-register > a {
    min-height: 3rem;
  }
}

@media (max-width: 620px) {
  .settings-workspace {
    padding: 16px;
  }

  .settings-register,
  .settings-field-grid,
  .settings-choice-group {
    grid-template-columns: 1fr;
  }

  .settings-field-wide,
  .settings-choice-group legend,
  .settings-register-intro,
  .settings-register > p {
    grid-column: 1;
  }

  .settings-section-head,
  .settings-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-form-actions .button {
    width: 100%;
  }

  .settings-field input,
  .settings-field select,
  .settings-input-unit > span {
    min-height: 44px;
    font-size: 1rem;
  }

  .settings-switch {
    min-height: 5.25rem;
  }

  .settings-status-register > div,
  .settings-runtime-list > div {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

@media (max-width: 820px) {
  .calendar-action-palette {
    width: calc(100vw - 16px);
  }

  .calendar-action-label {
    font-size: .7rem;
  }
}

/* Mitarbeiter-Zeiterfassung */

.timekeeping-shell {
  display: grid;
  gap: 13px;
}

.timekeeping-clock,
.timekeeping-register,
.manual-time-entry {
  border: 1px solid #1a3a42;
  border-radius: var(--radius);
  background: #07181e;
}

.timekeeping-clock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 84% 14%, rgba(46, 150, 110, .14), transparent 34%),
    #07181e;
}

.timekeeping-clock.is-running {
  border-color: #2d755c;
}

.timekeeping-clock h2 {
  margin: 2px 0 8px;
  font-size: 1.48rem;
}

.clock-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bcebd0;
}

.clock-state.is-idle {
  color: var(--muted-strong);
}

.clock-facts {
  display: flex;
  gap: 22px;
  margin-top: 16px;
}

.clock-facts div {
  display: grid;
  gap: 3px;
}

.clock-facts dt,
.timekeeping-metrics span,
.timekeeping-metrics small {
  color: var(--muted);
  font-size: 0.68rem;
}

.clock-facts dd {
  color: var(--text);
  font-weight: 720;
}

.clock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.clock-main-action {
  min-width: 172px;
}

.timekeeping-register {
  padding: 15px;
}

.month-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-switcher a {
  display: grid;
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  place-items: center;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timekeeping-filter {
  display: flex;
}

.timekeeping-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.timekeeping-metrics > div {
  display: grid;
  gap: 3px;
  min-height: 78px;
  padding: 12px;
  align-content: center;
  background: var(--surface-inset);
  border: 1px solid #18353d;
  border-radius: 8px;
}

.timekeeping-metrics > div.is-illness {
  border-color: rgba(208, 166, 81, .36);
  background: rgba(123, 86, 27, .1);
}

.timekeeping-metrics strong {
  color: var(--text);
  font-size: 1.16rem;
}

.time-entry-list {
  overflow: hidden;
  border: 1px solid #1a3740;
  border-radius: 8px;
}

.time-entry-row {
  display: grid;
  grid-template-columns: minmax(145px, 1.15fr) minmax(150px, 1.2fr) minmax(150px, 1.2fr) minmax(90px, .7fr) minmax(90px, .7fr) minmax(130px, .85fr);
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 9px 12px;
  border-top: 1px solid #17333b;
}

.time-entry-row.is-personal {
  grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1.2fr) minmax(90px, .7fr) minmax(90px, .7fr) minmax(130px, .85fr);
}

.time-entry-head {
  min-height: 38px;
  color: var(--muted);
  background: #06141a;
  border-top: 0;
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.time-entry-row > span {
  display: grid;
  gap: 3px;
}

.time-entry-row small {
  color: var(--muted);
}

.time-entry-row .row-action {
  margin-top: 4px;
  font-size: 0.72rem;
}

.illness-overview {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #1a3740;
}

.illness-overview h3 {
  font-size: 1rem;
}

.illness-list {
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid #273a3d;
  border-radius: 8px;
}

.illness-list > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 9px 12px;
  border-top: 1px solid #243439;
}

.illness-list > div:first-child {
  border-top: 0;
}

.illness-list > div > span {
  display: grid;
  gap: 3px;
}

.illness-list small {
  color: var(--muted);
}

.illness-list .empty-inline {
  padding: 16px;
}

.manual-time-entry {
  overflow: hidden;
}

.manual-time-entry > summary {
  padding: 15px 18px;
  color: var(--green-soft);
  cursor: pointer;
  font-weight: 720;
}

.manual-time-entry[open] > summary {
  border-bottom: 1px solid var(--line);
}

.manual-time-entry .form-section,
.time-correction-form .form-section {
  margin: 0;
  border: 0;
}

.time-correction-history {
  margin-top: 13px;
  padding: 18px;
  border: 1px solid #1a3a42;
  border-radius: var(--radius);
  background: #07181e;
}

.time-correction-history .timeline p {
  margin-top: 5px;
  color: var(--muted-strong);
  font-size: 0.76rem;
}

.time-entry-form-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.time-entry-form-grid .form-span {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .time-entry-row,
  .time-entry-row.is-personal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .time-entry-head {
    display: none;
  }

  .time-entry-row > span::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 740;
    text-transform: uppercase;
  }

  .time-entry-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .timekeeping-clock {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .clock-facts,
  .clock-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .clock-actions,
  .clock-actions form,
  .clock-actions .button {
    width: 100%;
  }

  .timekeeping-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .time-entry-row,
  .time-entry-row.is-personal,
  .illness-list > div,
  .time-entry-form-grid {
    grid-template-columns: 1fr;
  }

  .timekeeping-register {
    padding: 10px;
  }
}

/* Persönliche Konten und widerrufbare Praxissitzungen */

.security-boundary {
  display: grid;
  grid-template-columns: minmax(180px, .55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 13px;
  padding: 15px 17px;
  color: var(--text-soft);
  background: linear-gradient(110deg, rgba(28, 94, 90, .24), rgba(7, 24, 30, .94) 58%);
  border: 1px solid #24524f;
  border-radius: 8px;
}

.security-boundary strong {
  color: #c8f5dc;
}

.security-boundary p {
  max-width: 72ch;
  color: var(--muted);
}

.access-link-delivery,
.credential-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 15px;
  padding: 18px;
  background: linear-gradient(112deg, rgba(46, 150, 110, .18), #07191f 56%);
  border: 1px solid #2b6650;
  border-radius: var(--radius);
}

.access-link-delivery h2,
.credential-control h2 {
  margin: 2px 0 5px;
}

.access-link-delivery p,
.credential-control p {
  max-width: 68ch;
  color: var(--muted-strong);
  font-size: 0.76rem;
}

.access-link-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.access-link-copy > label {
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 690;
}

.access-link-copy > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.access-link-copy input {
  min-width: 0;
  font-variant-numeric: normal;
}

.access-link-copy small {
  color: var(--green-soft);
}

.invitation-explainer {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 65px;
  padding: 11px 13px;
  background: var(--surface-inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.invitation-explainer strong {
  color: #c8f5dc;
  font-size: 0.76rem;
}

.invitation-explainer small {
  line-height: 1.45;
}

.credential-control {
  grid-template-columns: minmax(0, 1fr) auto;
  background: #07181e;
  border-color: #1a3740;
}

.credential-control-action {
  display: grid;
  gap: 9px;
  justify-items: end;
}

.credential-control-action form {
  margin: 0;
}

.access-password-card strong {
  color: var(--green-soft);
}

.account-register,
.session-ledger {
  overflow: hidden;
  background: #07181e;
  border: 1px solid #1a3740;
  border-radius: var(--radius);
}

.account-register-head,
.account-register-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) minmax(120px, .75fr) minmax(95px, .55fr) minmax(110px, .62fr) auto;
  gap: 16px;
  align-items: center;
}

.account-register-head {
  min-height: 42px;
  padding: 0 17px;
  color: #78939a;
  background: #06151b;
  border-bottom: 1px solid #1a3740;
  font-size: 0.64rem;
  font-weight: 720;
}

.account-register-row {
  min-height: 72px;
  padding: 11px 17px;
  color: var(--text-soft);
  border-top: 1px solid #17333b;
}

.account-register-row:first-of-type {
  border-top: 0;
}

.account-register-row.is-inactive {
  background: rgba(12, 25, 30, .7);
}

.account-register-row > div {
  display: grid;
  gap: 3px;
}

.account-register-row small,
.session-row small,
.session-ended {
  color: var(--muted);
  font-size: 0.72rem;
}

.account-cell-label {
  display: none;
  color: #78939a;
  font-size: 0.64rem;
  font-weight: 720;
}

.security-account-form {
  grid-template-columns: 1fr;
  margin-bottom: 20px;
}

.security-account-form > .form-section,
.security-account-form > .form-actions,
.personal-security-grid > .record-form > .form-section,
.personal-security-grid > .record-form > .form-actions {
  grid-column: 1 / -1;
}

.personal-security-grid > .record-form {
  grid-template-columns: 1fr;
}

.account-state-control {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 41px;
  padding: 8px 11px;
  background: var(--surface-inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.account-state-control input {
  width: 18px;
  height: 18px;
}

.account-state-control > span {
  display: grid;
  gap: 2px;
}

.account-state-control small {
  color: var(--muted);
  font-weight: 400;
}

.session-ledger {
  padding: 17px;
}

.session-ledger > .panel-heading > span {
  color: #a9e5c4;
  font-size: 0.72rem;
  font-weight: 720;
}

.session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 11px 0;
  border-top: 1px solid #17333b;
}

.session-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.session-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-row.is-revoked,
.session-row.is-expired {
  opacity: .7;
}

.personal-security-grid {
  display: grid;
  grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr);
  gap: 15px;
  align-items: start;
}

.personal-security-grid,
.personal-security-grid > *,
.personal-security-grid .form-section-heading > div,
.security-account-form,
.security-account-form > * {
  min-width: 0;
}

.personal-security-grid .topbar p,
.personal-security-grid .form-section-heading p,
.personal-security-grid label > span {
  overflow-wrap: anywhere;
}

.account-panel strong a {
  color: inherit;
  text-decoration: none;
}

.account-panel strong a:hover {
  color: var(--green-soft);
}

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

  .account-register-head {
    display: none;
  }

  .account-register-row {
    grid-template-columns: minmax(0, 1fr) minmax(120px, .7fr) auto;
  }

  .account-register-row > div:nth-child(3),
  .account-register-row > div:nth-child(4) {
    grid-row: 2;
  }

  .account-register-row > .button {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .account-cell-label {
    display: block;
  }
}

@media (max-width: 640px) {
  .security-boundary,
  .access-link-delivery,
  .credential-control,
  .account-register-row,
  .session-row {
    grid-template-columns: 1fr;
  }

  .access-link-copy > div {
    grid-template-columns: 1fr;
  }

  .access-link-copy .button,
  .credential-control-action,
  .credential-control-action form,
  .credential-control-action .button {
    width: 100%;
  }

  .credential-control-action {
    justify-items: stretch;
  }

  .account-register-row > div:nth-child(3),
  .account-register-row > div:nth-child(4),
  .account-register-row > .button {
    grid-column: auto;
    grid-row: auto;
  }

  .account-register-row > .button,
  .session-row .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .icon-button,
  .primary-nav a,
  .patient-row,
  .team-row,
  .appointment-line,
  .flash {
    transition:
      color 80ms linear,
      background-color 80ms linear,
      border-color 80ms linear,
      opacity 80ms linear;
  }

  .button:active,
  .icon-button:active,
  .primary-nav a:active {
    transform: none;
  }
}

/* Anatomischer Befundarbeitsplatz */

.finding-workspace {
  grid-template-columns: minmax(680px, 1.55fr) minmax(340px, 0.64fr);
  gap: 13px;
}

.finding-tools {
  position: static;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(180px, 0.42fr) minmax(500px, 1.15fr) minmax(520px, 1.3fr);
  gap: 18px;
  align-items: end;
}

.finding-control-intro {
  align-self: stretch;
  padding-right: 18px;
  border-right: 1px solid #1b3942;
}

.finding-control-intro .tool-intro {
  max-width: 38ch;
  margin: 10px 0 0;
}

.finding-tools .marker-palette {
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  gap: 7px;
  margin: 0;
}

.finding-tools .marker-palette legend {
  margin-bottom: 7px;
}

.finding-tools .marker-choice {
  grid-template-columns: 18px 22px minmax(0, 1fr);
  min-height: 39px;
  padding: 6px 8px;
  border-radius: 8px;
}

.finding-tools .marker-choice > span {
  font-size: 1rem;
}

.finding-tools .marker-choice b {
  font-size: 0.72rem;
}

.finding-placement-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 8px;
  align-items: end;
}

.anatomy-catalog-heading {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 9px;
  align-items: baseline;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #1b3942;
}

.anatomy-catalog-heading .kicker {
  grid-row: 1 / span 2;
  margin: 0;
}

.anatomy-catalog-heading strong {
  color: #dcebe9;
  font-size: 0.76rem;
}

.anatomy-catalog-heading small,
.anatomy-catalog-help {
  color: #78949a;
  font-size: 0.64rem;
  line-height: 1.42;
}

.placement-heading {
  display: grid;
  grid-column: 1 / -1;
  gap: 2px;
}

.placement-heading strong {
  font-size: 0.82rem;
}

.placement-heading small {
  color: #769197;
  font-size: 0.64rem;
}

.finding-placement-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.finding-placement-controls label > span {
  color: #aabdc1;
  font-size: 0.64rem;
  font-weight: 700;
}

.finding-placement-controls select {
  min-height: 38px;
  padding: 0 28px 0 9px;
  font-size: 0.68rem;
}

.finding-placement-controls input[type="search"] {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 0.68rem;
}

.finding-placement-controls label:has([data-marker-structure]) {
  grid-column: span 3;
}

.finding-placement-controls [data-marker-structure] {
  min-height: 238px;
  padding: 5px;
  overflow: auto;
  background-image: none;
  line-height: 1.35;
}

.finding-placement-controls [data-marker-structure] option {
  padding: 4px 6px;
}

.finding-placement-controls [data-marker-structure] optgroup {
  color: #a7c0c4;
  font-size: 0.68rem;
}

.anatomy-catalog-help {
  grid-column: 1 / -1;
  min-height: 1.42em;
  margin: -1px 0 0;
}

.finding-placement-controls .button {
  grid-column: 1 / -1;
  min-height: 36px;
  justify-self: end;
  padding-inline: 15px;
}

.finding-map-panel {
  grid-column: 1;
}

.finding-details {
  grid-column: 2;
  top: 14px;
}

.finding-map-panel > .panel-heading p:not(.kicker) {
  max-width: 60ch;
  margin: 3px 0 0;
  color: #769197;
  font-size: 0.68rem;
}

.anatomy-2d-workbench,
.anatomy-2d-readonly {
  margin-top: 14px;
  padding: 13px;
  background:
    radial-gradient(circle at 50% 42%, rgba(48, 138, 115, 0.09), transparent 28rem),
    rgba(5, 21, 27, 0.76);
  border: 1px solid #193740;
  border-radius: 8px;
}

.anatomy-2d-workbench > .anatomy-layer-controls {
  margin: 0 0 10px;
}

.anatomy-2d-workbench > .body-map-pair,
.anatomy-2d-readonly > .body-map-pair {
  margin-top: 0;
}

.anatomy-2d-readonly-note {
  max-width: 72ch;
  margin: 0 0 12px;
  color: #829ba1;
  font-size: 0.68rem;
  line-height: 1.5;
}

.anatomy-layer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 11px 0 15px;
  padding: 0;
  border: 0;
}

.anatomy-layer-controls legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.anatomy-layer-controls > small {
  flex: 1 1 300px;
  margin-left: 5px;
  color: #829ba1;
  font-size: 0.68rem;
  line-height: 1.4;
}

.anatomy-layer-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  color: #b9cdd0;
  background: #06171d;
  border: 1px solid #1b3942;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 680;
  cursor: pointer;
  transition:
    color 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease;
}

.anatomy-layer-chip:hover {
  color: #eef8f6;
  background: #0a2027;
  border-color: #2b525c;
}

.anatomy-layer-chip:has(input:focus-visible) {
  border-color: #4dd39a;
  box-shadow: 0 0 0 3px rgba(77, 211, 154, 0.17);
}

.anatomy-layer-chip input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #3cc578;
}

.anatomy-layer-chip > span {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.anatomy-layer-muscle {
  color: #9be5bf;
}

.anatomy-layer-connective {
  color: #f4d18a;
}

.anatomy-layer-lymph {
  color: #c5a9ff;
}

.anatomy-zone {
  color: #58e2a8;
  cursor: pointer;
  pointer-events: all;
}

.anatomy-zone[hidden] {
  display: none;
}

.anatomy-shape {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.15;
  vector-effect: non-scaling-stroke;
  transition:
    fill 130ms ease,
    stroke 130ms ease,
    filter 130ms ease;
}

.anatomy-shape-secondary {
  opacity: 0.78;
}

.anatomy-detail,
.anatomy-fibre,
.lymph-route {
  fill: none;
  stroke: transparent;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 0.72;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  transition: stroke 130ms ease;
}

.lymph-node {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
  transition:
    fill 130ms ease,
    stroke 130ms ease,
    filter 130ms ease;
}

.anatomy-zone:focus {
  outline: none;
}

.anatomy-zone-muscle:hover .anatomy-shape,
.anatomy-zone-muscle:focus .anatomy-shape {
  fill: rgba(42, 213, 148, 0.43);
  stroke: #73edb7;
  filter: drop-shadow(0 2px 4px rgba(29, 196, 132, 0.5));
}

.anatomy-zone-muscle .anatomy-shape {
  fill: rgba(88, 226, 168, 0.07);
  stroke: rgba(115, 237, 183, 0.2);
}

.anatomy-zone-muscle:hover .anatomy-detail,
.anatomy-zone-muscle:focus .anatomy-detail {
  stroke: rgba(220, 255, 239, 0.76);
}

.anatomy-zone-tendon {
  color: #ffd077;
}

.anatomy-zone-tendon .anatomy-shape {
  fill: rgba(255, 208, 119, 0.09);
  stroke: rgba(255, 224, 162, 0.24);
}

.anatomy-zone-tendon:hover .anatomy-shape,
.anatomy-zone-tendon:focus .anatomy-shape {
  fill: rgba(255, 190, 77, 0.5);
  stroke: #ffe0a2;
  filter: drop-shadow(0 2px 4px rgba(240, 170, 55, 0.48));
}

.anatomy-zone-tendon:hover .anatomy-fibre,
.anatomy-zone-tendon:focus .anatomy-fibre {
  stroke: rgba(255, 250, 226, 0.86);
}

.anatomy-zone-fascia {
  color: #74c4ff;
}

.anatomy-zone-fascia .anatomy-shape {
  fill: rgba(116, 196, 255, 0.07);
  stroke: rgba(156, 214, 255, 0.22);
}

.anatomy-zone-fascia:hover .anatomy-shape,
.anatomy-zone-fascia:focus .anatomy-shape {
  fill: rgba(84, 180, 255, 0.36);
  stroke: #9cd6ff;
  filter: drop-shadow(0 2px 4px rgba(74, 173, 255, 0.46));
}

.anatomy-zone-fascia:hover .anatomy-detail,
.anatomy-zone-fascia:focus .anatomy-detail {
  stroke: rgba(225, 245, 255, 0.8);
}

.anatomy-zone-lymph {
  color: #c5a9ff;
}

.anatomy-zone-lymph .lymph-route {
  stroke: rgba(208, 187, 255, 0.26);
}

.anatomy-zone-lymph .lymph-node {
  fill: rgba(197, 169, 255, 0.25);
  stroke: rgba(240, 232, 255, 0.46);
}

.anatomy-zone-lymph:hover .lymph-route,
.anatomy-zone-lymph:focus .lymph-route {
  stroke: rgba(208, 187, 255, 0.82);
  stroke-width: 1.05;
}

.anatomy-zone-lymph:hover .lymph-node,
.anatomy-zone-lymph:focus .lymph-node {
  fill: #c5a9ff;
  stroke: #f0e8ff;
  filter: drop-shadow(0 2px 3px rgba(173, 132, 255, 0.58));
}

.anatomy-hover-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  margin: 4px 0 0;
  padding: 5px 9px;
  color: #829ca2;
  background: #071c22;
  border: 1px solid #183740;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 650;
  text-align: center;
}

.anatomy-hover-label > span {
  margin-right: 5px;
  color: #59dba2;
}

.anatomy-hover-label.is-active {
  color: #dff9eb;
  background: #0a2927;
  border-color: #2f715b;
}

/* Körperstatus direkt in der Patientenakte */

.patient-body-overview {
  padding: 19px;
  background:
    radial-gradient(circle at 38% 42%, rgba(39, 146, 122, 0.1), transparent 25rem),
    #06171d;
  border: 1px solid #1b3942;
  border-radius: var(--radius);
}

.patient-body-overview > .panel-heading p:not(.kicker) {
  margin: 3px 0 0;
  color: #78949a;
  font-size: 0.68rem;
}

.patient-body-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.patient-body-actions > a:not(.button) {
  color: #a8dec1;
  font-size: 0.68rem;
  font-weight: 700;
}

.patient-body-actions .button {
  min-height: 34px;
  padding-inline: 11px;
}

.patient-body-content {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(180px, 0.55fr);
  gap: 12px;
  margin-top: 14px;
}

.patient-body-map-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.patient-body-map-pair .body-figure {
  padding: 10px;
  background: rgba(4, 20, 26, 0.88);
  border-radius: 8px;
}

.patient-body-map-pair .body-figure figcaption span {
  max-width: 16ch;
  font-size: 0.64rem;
}

.patient-body-map-pair .body-silhouette {
  height: 296px;
  margin: 2px auto;
}

.patient-body-map-pair .body-click-help {
  display: none;
}

.patient-body-summary {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  background: rgba(7, 27, 34, 0.9);
  border: 1px solid #1b3942;
  border-radius: 8px;
}

.patient-body-summary > strong {
  font-size: 1rem;
}

.patient-body-summary > p,
.patient-body-summary > small {
  margin: 0;
  color: #829ba1;
  font-size: 0.68rem;
  line-height: 1.48;
}

.patient-body-summary ul {
  display: grid;
  gap: 3px;
  padding: 8px 0 0;
  margin: 0;
  border-top: 1px solid #1b3942;
  list-style: none;
}

.patient-body-summary li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  padding: 6px 0;
}

.patient-body-summary li > span:last-child {
  display: grid;
  gap: 1px;
}

.patient-body-summary li b {
  font-size: 0.72rem;
}

.patient-body-summary li small {
  color: #78949a;
  font-size: 0.64rem;
}

@media (min-width: 1421px) {
  .finding-workspace {
    grid-template-columns:
      minmax(286px, 0.46fr)
      minmax(620px, 1.24fr)
      minmax(310px, 0.52fr);
    align-items: start;
  }

  .finding-tools {
    position: sticky;
    top: 14px;
    display: grid;
    grid-column: 1;
    grid-template-columns: 1fr;
    gap: 14px;
    max-height: calc(100vh - 28px);
    overflow: auto;
    align-items: start;
  }

  .finding-control-intro {
    padding-right: 0;
    padding-bottom: 13px;
    border-right: 0;
    border-bottom: 1px solid #1b3942;
  }

  .finding-tools .marker-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finding-placement-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finding-placement-controls .placement-heading,
  .finding-placement-controls .anatomy-catalog-heading,
  .finding-placement-controls label:has([data-marker-structure]),
  .finding-placement-controls .anatomy-catalog-help,
  .finding-placement-controls .button {
    grid-column: 1 / -1;
  }

  .finding-placement-controls [data-marker-structure] {
    min-height: 190px;
  }

  .finding-map-panel {
    grid-column: 2;
  }

  .finding-details {
    grid-column: 3;
  }
}

@media (max-width: 1420px) {
  .finding-tools {
    grid-template-columns: minmax(170px, 0.4fr) minmax(430px, 1fr);
  }

  .finding-placement-controls {
    grid-column: 1 / -1;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    padding-top: 12px;
    border-top: 1px solid #1b3942;
  }

  .finding-placement-controls .placement-heading,
  .finding-placement-controls .button {
    grid-column: auto;
  }

  .finding-placement-controls .anatomy-catalog-heading,
  .finding-placement-controls label:has([data-marker-structure]),
  .finding-placement-controls .anatomy-catalog-help {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .finding-workspace {
    grid-template-columns: 1fr;
  }

  .finding-map-panel,
  .finding-details {
    grid-column: 1;
    position: static;
  }

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

  .patient-body-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .patient-body-summary ul {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .finding-tools {
    grid-template-columns: 1fr;
  }

  .finding-control-intro {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid #1b3942;
  }

  .finding-placement-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finding-placement-controls .placement-heading,
  .finding-placement-controls .button,
  .finding-placement-controls .anatomy-catalog-heading,
  .finding-placement-controls label:has([data-marker-structure]),
  .finding-placement-controls .anatomy-catalog-help {
    grid-column: 1 / -1;
  }

  .patient-body-map-pair {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 560px) {
  .finding-tools .marker-palette,
  .patient-body-map-pair,
  .patient-body-summary,
  .patient-body-summary ul {
    grid-template-columns: 1fr;
  }

  .patient-body-map-pair .body-silhouette {
    height: 340px;
  }

  .anatomy-2d-workbench > .body-map-pair,
  .anatomy-2d-readonly > .body-map-pair {
    grid-template-columns: 1fr;
  }
}

/* BodyParts3D · interaktives anatomisches Instrument */

.anatomy-3d-workbench {
  overflow: hidden;
  margin-top: 14px;
  background:
    linear-gradient(180deg, rgba(17, 48, 56, 0.58), rgba(5, 20, 26, 0.92)),
    #06171d;
  border: 1px solid #21434c;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(201, 255, 236, 0.035);
}

.anatomy-3d-toolbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 10px 12px 10px 16px;
  background: rgba(5, 22, 28, 0.78);
  border-bottom: 1px solid #1b3b44;
}

.anatomy-3d-layer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 10px 14px;
  background: #06171d;
  border: 0;
  border-bottom: 1px solid #1b3b44;
}

.anatomy-3d-layer-controls legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.anatomy-layer-control-heading {
  display: grid;
  flex: 1 1 250px;
  gap: 2px;
  min-width: 210px;
}

.anatomy-layer-control-heading strong {
  color: #dceee9;
  font-size: 0.68rem;
}

.anatomy-layer-control-heading small {
  color: #78949a;
  font-size: 0.64rem;
  line-height: 1.35;
}

.anatomy-3d-layer-controls .anatomy-layer-chip {
  display: grid;
  grid-template-columns: 15px 7px minmax(82px, auto);
  grid-template-rows: auto auto;
  gap: 0 7px;
  min-height: 42px;
  padding: 6px 10px;
}

.anatomy-3d-layer-controls .anatomy-layer-chip input,
.anatomy-3d-layer-controls .anatomy-layer-chip > span {
  grid-row: 1 / 3;
  align-self: center;
}

.anatomy-3d-layer-controls .anatomy-layer-chip b,
.anatomy-3d-layer-controls .anatomy-layer-chip small {
  grid-column: 3;
}

.anatomy-3d-layer-controls .anatomy-layer-chip b {
  font-size: 0.64rem;
  line-height: 1.25;
}

.anatomy-3d-layer-controls .anatomy-layer-chip small {
  color: #718d93;
  font-size: 0.64rem;
  font-weight: 520;
  line-height: 1.25;
}

.anatomy-3d-layer-controls .anatomy-layer-chip.is-empty {
  cursor: not-allowed;
  filter: saturate(0.5);
  opacity: 0.56;
}

.anatomy-3d-layer-controls-readonly {
  border-top: 1px solid #1b3b44;
}

.anatomy-3d-mode {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.anatomy-3d-mode > div {
  display: grid;
  gap: 2px;
}

.anatomy-3d-mode strong {
  color: #edf8f4;
  font-size: 0.76rem;
}

.anatomy-3d-mode small {
  overflow: hidden;
  max-width: 44ch;
  color: #78959c;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anatomy-live-dot {
  width: 8px;
  height: 8px;
  background: #47d593;
  border: 1px solid #a2f3c8;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(71, 213, 147, 0.08);
}

.anatomy-view-buttons {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: #06161c;
  border: 1px solid #193841;
  border-radius: 8px;
}

.anatomy-view-buttons button {
  min-width: 50px;
  min-height: 31px;
  padding: 5px 9px;
  color: #91a9ae;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 720;
  cursor: pointer;
}

.anatomy-view-buttons button:hover {
  color: #eaf9f2;
  background: #102930;
}

.anatomy-view-buttons button:focus-visible {
  outline: 2px solid #4dd39a;
  outline-offset: 1px;
}

.anatomy-view-buttons button[aria-pressed="true"] {
  color: var(--green-soft);
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.anatomy-view-buttons button:last-child {
  min-width: 34px;
  color: #8ce5ba;
  border-left: 1px solid #193841;
  border-radius: 0 6px 6px 0;
}

.anatomy-3d-grid {
  display: grid;
  grid-template-columns: minmax(390px, 1fr) minmax(236px, 0.36fr);
  min-height: 650px;
}

/* impeccable-disable-next-line codex-grid-background: spatial reference grid belongs to the interactive anatomy measurement canvas */
.anatomy-3d-stage {
  position: relative;
  min-width: 0;
  min-height: 650px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 47%, rgba(61, 143, 126, 0.07), transparent 35%),
    linear-gradient(90deg, rgba(64, 119, 111, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(64, 119, 111, 0.035) 1px, transparent 1px),
    #04141a;
  background-size: auto, 36px 36px, 36px 36px, auto;
  border-right: 1px solid #1b3b44;
}

.anatomy-3d-stage::after {
  position: absolute;
  right: 8%;
  bottom: 5.8%;
  left: 8%;
  height: 7%;
  background: radial-gradient(ellipse, rgba(15, 48, 52, 0.42), transparent 68%);
  content: "";
  filter: blur(8px);
  pointer-events: none;
}

.anatomy-3d-stage::before {
  position: absolute;
  z-index: 0;
  top: 5%;
  bottom: 5%;
  left: 50%;
  width: 1px;
  background: linear-gradient(
    transparent,
    rgba(137, 161, 168, 0.1) 18%,
    rgba(137, 161, 168, 0.1) 82%,
    transparent
  );
  content: "";
  pointer-events: none;
}

.anatomy-3d-stage canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.anatomy-3d-stage canvas:active {
  cursor: grabbing;
}

.anatomy-3d-stage canvas:focus-visible {
  outline: 2px solid #4dd39a;
  outline-offset: -4px;
}

.anatomy-loading {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  width: min(360px, calc(100% - 42px));
  height: max-content;
  gap: 7px;
  place-self: center;
  padding: 20px;
  color: #dff5eb;
  background: rgba(5, 24, 30, 0.94);
  border: 1px solid #28504f;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  text-align: center;
}

.anatomy-loading[hidden] {
  display: none;
}

.anatomy-loading-mark {
  width: 36px;
  height: 36px;
  margin: 0 auto 4px;
  border: 2px solid rgba(65, 209, 143, 0.2);
  border-top-color: #41d18f;
  border-radius: 50%;
  animation: anatomy-loading-turn 920ms linear infinite;
}

.anatomy-loading strong {
  font-size: 0.82rem;
}

.anatomy-loading span:not(.anatomy-loading-mark) {
  color: #86a1a6;
  font-size: 0.68rem;
}

.anatomy-loading progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  margin-top: 5px;
  accent-color: #3cc578;
  border: 0;
  border-radius: 999px;
}

.anatomy-loading.is-error {
  border-color: #814b4f;
}

.anatomy-loading.is-error .anatomy-loading-mark {
  animation: none;
  border-color: #ef6f77;
}

.anatomy-hover-readout {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  max-width: min(360px, calc(100% - 28px));
  padding: 7px 10px;
  color: #78959c;
  background: rgba(4, 20, 26, 0.82);
  border: 1px solid #183740;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 680;
  pointer-events: none;
}

.anatomy-hover-readout.is-active {
  color: #e4fff1;
  background: rgba(8, 43, 38, 0.91);
  border-color: #34765d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.anatomy-orbit-hint {
  position: absolute;
  z-index: 3;
  right: 13px;
  bottom: 12px;
  display: flex;
  gap: 6px 12px;
  color: #6e898f;
  font-size: 0.64rem;
  pointer-events: none;
}

.anatomy-3d-inspector {
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  gap: 16px;
  align-content: start;
  min-width: 0;
  padding: 19px;
  background:
    linear-gradient(180deg, rgba(11, 35, 42, 0.86), rgba(6, 23, 29, 0.94)),
    #07191f;
}

.anatomy-3d-inspector h3 {
  overflow-wrap: anywhere;
  margin: 3px 0 6px;
  color: #f0faf6;
  font-size: 1rem;
  line-height: 1.28;
}

.anatomy-3d-inspector [data-anatomy-selection-copy] {
  margin: 0;
  color: #829ba1;
  font-size: 0.68rem;
  line-height: 1.52;
}

.anatomy-search {
  display: grid;
  gap: 5px;
}

.anatomy-search span {
  color: #a9bfc2;
  font-size: 0.64rem;
  font-weight: 720;
}

.anatomy-search input {
  min-height: 39px;
  padding: 8px 10px;
  font-size: 0.68rem;
}

.anatomy-hit-stack {
  min-width: 0;
  overflow: hidden;
  background: #06171d;
  border: 1px solid #21414a;
  border-radius: 8px;
}

.anatomy-hit-stack-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border-bottom: 1px solid #1a3841;
}

.anatomy-hit-stack-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.anatomy-hit-stack-heading strong {
  color: #dff5eb;
  font-size: 0.68rem;
}

.anatomy-hit-stack-heading small {
  color: #78949a;
  font-size: 0.64rem;
}

.anatomy-hit-stack-heading > span {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #a9e8c8;
  background: #0b2a28;
  border: 1px solid #255247;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 720;
}

.anatomy-hit-stack-list {
  display: grid;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-color: #28505a #06171d;
}

.anatomy-hit-option {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 7px 10px;
  color: #c5d4d5;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #15323a;
  border-radius: 0;
  cursor: pointer;
}

.anatomy-hit-option:last-child {
  border-bottom: 0;
}

.anatomy-hit-option:hover,
.anatomy-hit-option:focus-visible,
.anatomy-hit-option[aria-pressed="true"] {
  color: #f2f8f7;
  background: #0b292d;
}

.anatomy-hit-option:focus-visible {
  outline: 2px solid #3cc578;
  outline-offset: -2px;
}

.anatomy-hit-option[aria-pressed="true"] {
  box-shadow: inset 2px 0 #3cc578;
}

.anatomy-hit-depth {
  color: #7ca099;
  font-size: 0.64rem;
  font-weight: 750;
}

.anatomy-hit-names {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.anatomy-hit-names strong,
.anatomy-hit-names small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anatomy-hit-names strong {
  font-size: 0.64rem;
}

.anatomy-hit-names small {
  color: #7f999f;
  font-size: 0.64rem;
  font-style: italic;
}

.anatomy-hit-names small.is-missing,
.anatomy-scientific-name.is-missing {
  color: #647e84;
  font-style: normal;
}

.anatomy-selection-facts {
  display: grid;
  margin: 0;
  border-top: 1px solid #1b3a43;
}

.anatomy-selection-facts > div {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #17343d;
}

.anatomy-selection-facts dt {
  color: #718d93;
  font-size: 0.64rem;
}

.anatomy-selection-facts dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: #d6e9e4;
  font-size: 0.64rem;
  font-weight: 690;
  text-align: right;
}

.anatomy-isolate-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  padding: 11px;
  background: #06171d;
  border: 1px solid #1b3942;
  border-radius: 8px;
  cursor: pointer;
}

.anatomy-isolate-toggle input {
  grid-row: 1 / 3;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #3cc578;
}

.anatomy-isolate-toggle span {
  color: #c7dad6;
  font-size: 0.68rem;
  font-weight: 710;
}

.anatomy-isolate-toggle small {
  color: #708b91;
  font-size: 0.64rem;
  line-height: 1.4;
}

.anatomy-depth-control {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #06171d;
  border: 1px solid #1b3942;
  border-radius: 8px;
}

.anatomy-scientific-name {
  display: block;
  margin-top: 3px;
  color: #78939a;
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.015em;
  line-height: 1.35;
}

.anatomy-depth-heading {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.anatomy-depth-heading > div {
  display: grid;
  gap: 3px;
}

.anatomy-depth-heading strong {
  color: #cfe2dd;
  font-size: 0.68rem;
}

.anatomy-depth-heading small {
  max-width: 27ch;
  color: #708b91;
  font-size: 0.64rem;
  line-height: 1.4;
}

.anatomy-depth-heading output {
  flex: 0 0 auto;
  min-height: 23px;
  padding: 4px 7px;
  color: #a8e8c7;
  background: #0b2b29;
  border: 1px solid #255447;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 730;
  white-space: nowrap;
}

.anatomy-depth-control input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: #3cc578;
  cursor: ew-resize;
}

.anatomy-depth-control input[type="range"]:focus-visible {
  outline: 2px solid #4dd39a;
  outline-offset: 3px;
}

.anatomy-depth-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -8px;
  color: #607c83;
  font-size: 0.64rem;
}

.anatomy-head-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 9px;
  color: #a9c1be;
  border-top: 1px solid #17343d;
  font-size: 0.64rem;
  font-weight: 690;
  cursor: pointer;
}

.anatomy-head-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #3cc578;
}

.anatomy-3d-readonly {
  margin-top: 16px;
}

.anatomy-3d-readonly .anatomy-3d-stage {
  min-height: min(68vh, 720px);
  border-right: 0;
}

.anatomy-readonly-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 10px 14px;
  background: var(--instrument-inset, #051218);
  border-bottom: 1px solid var(--line);
}

.anatomy-readonly-controls > label:first-child {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(150px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 0;
}

.anatomy-readonly-controls > label:first-child > span {
  display: grid;
  gap: 2px;
}

.anatomy-readonly-controls strong {
  color: var(--text-soft);
  font-size: 0.68rem;
}

.anatomy-readonly-controls small {
  color: var(--muted);
  font-size: 0.64rem;
}

.anatomy-readonly-controls input[type="range"] {
  width: 100%;
  min-width: 150px;
  margin: 0;
  accent-color: var(--green-bright);
}

.anatomy-readonly-controls output {
  min-width: 86px;
  color: var(--green-soft);
  font-size: 0.64rem;
  font-weight: 720;
  text-align: right;
}

.anatomy-readonly-controls .anatomy-head-toggle {
  padding-top: 0;
  border-top: 0;
  white-space: nowrap;
}

.finding-map-readonly > .anatomy-2d-fallback {
  margin-top: 12px;
}

.finding-map-readonly > .anatomy-2d-fallback .body-map-pair {
  margin-top: 13px;
}

.anatomy-apply-button {
  min-height: 44px;
  white-space: normal;
}

.anatomy-apply-button:disabled {
  color: #668087;
  background: #0b2429;
  border-color: #1e3d43;
  box-shadow: none;
  cursor: not-allowed;
}

.anatomy-selection-note {
  align-self: end;
  margin: 0;
  color: #6f8a90;
  font-size: 0.64rem;
  line-height: 1.55;
}

.anatomy-2d-fallback {
  margin-top: 11px;
  background: rgba(5, 21, 27, 0.74);
  border: 1px solid #193740;
  border-radius: 8px;
}

.anatomy-2d-fallback > summary {
  display: flex;
  gap: 6px 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 9px 13px;
  color: #a9c0c3;
  cursor: pointer;
  list-style-position: inside;
}

.anatomy-2d-fallback > summary span {
  font-size: 0.72rem;
  font-weight: 720;
}

.anatomy-2d-fallback > summary small {
  color: #708a90;
  font-size: 0.64rem;
  text-align: right;
}

.anatomy-2d-fallback[open] > summary {
  border-bottom: 1px solid #193740;
}

.anatomy-2d-fallback > .anatomy-layer-controls,
.anatomy-2d-fallback > .body-map-pair {
  margin-right: 13px;
  margin-left: 13px;
}

.anatomy-2d-fallback > .body-map-pair {
  margin-bottom: 13px;
}

@keyframes anatomy-loading-turn {
  to { transform: rotate(360deg); }
}

@media (max-width: 1420px) {
  .anatomy-3d-grid {
    grid-template-columns: minmax(360px, 1fr) minmax(220px, 0.42fr);
  }
}

@media (max-width: 920px) {
  .anatomy-3d-grid {
    grid-template-columns: 1fr;
  }

  .anatomy-3d-stage {
    min-height: 580px;
    border-right: 0;
    border-bottom: 1px solid #1b3b44;
  }

  .anatomy-3d-inspector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .anatomy-selection-note {
    align-self: center;
  }

  .anatomy-3d-readonly .anatomy-3d-stage {
    min-height: 620px;
  }
}

@media (max-width: 640px) {
  .anatomy-3d-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .anatomy-view-buttons {
    overflow-x: auto;
  }

  .anatomy-view-buttons button {
    flex: 1 0 auto;
  }

  .anatomy-3d-stage {
    min-height: 510px;
  }

  .anatomy-readonly-controls {
    grid-template-columns: 1fr;
  }

  .anatomy-readonly-controls > label:first-child {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .anatomy-readonly-controls output {
    text-align: left;
  }

  .anatomy-3d-inspector {
    grid-template-columns: 1fr;
  }

  .anatomy-orbit-hint {
    left: 12px;
    justify-content: space-between;
  }

  .anatomy-2d-fallback > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .anatomy-2d-fallback > summary small {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .anatomy-loading-mark {
    animation-duration: 1800ms;
  }
}

/* Temporäre 3D-Vorführung · getrennt von Patienten- und Befunddaten */

.anatomy-demo-boundary {
  border-color: var(--line-strong);
}

.anatomy-demo-panel {
  padding: 19px;
}

.anatomy-demo-panel > .panel-heading {
  align-items: flex-start;
}

.anatomy-demo-fallback-copy {
  margin: 0;
  padding: 13px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.55;
}

.anatomy-demo-attribution {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 11px 13px;
  color: var(--muted);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.64rem;
  line-height: 1.5;
}

.anatomy-demo-attribution strong {
  color: var(--text-soft);
  font-size: 0.64rem;
}

/* Körperbefund · ruhiger Arbeitsmodus */

.finding-workspace .panel-heading {
  margin-bottom: 11px;
}

.finding-workspace .panel-heading h2 {
  font-size: 1rem;
  line-height: 1.25;
}

.finding-workspace .kicker {
  margin-bottom: 3px;
  font-size: 0.64rem;
  letter-spacing: 0.055em;
}

.finding-workspace .tool-intro,
.finding-map-panel > .panel-heading p:not(.kicker) {
  color: #8aa2a7;
  font-size: 0.76rem;
  line-height: 1.48;
}

.finding-control-intro {
  padding-bottom: 12px;
}

.finding-tools .marker-palette {
  gap: 6px;
  margin: 0;
}

.finding-tools .marker-palette legend {
  margin-bottom: 5px;
  font-size: 0.72rem;
}

.finding-tools .marker-choice {
  position: relative;
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 38px;
  padding: 7px 9px;
  border-color: transparent;
  background: rgba(6, 23, 29, 0.62);
}

.finding-tools .marker-choice:hover {
  background: #0a2229;
}

.finding-tools .marker-choice:has(input:checked) {
  background: #0c292d;
  border-color: #2c625b;
}

.finding-tools .marker-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.finding-tools .marker-choice:has(input:focus-visible) {
  outline: 2px solid var(--line-focus);
  outline-offset: 2px;
}

.finding-tools .marker-choice > span {
  font-size: 0.92rem;
}

.finding-tools .marker-choice b {
  font-size: 0.72rem;
}

.finding-placement-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.finding-control-disclosure,
.finding-general-disclosure {
  min-width: 0;
  border-top: 1px solid #19353d;
}

.finding-control-disclosure > summary,
.finding-general-disclosure > summary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 51px;
  padding: 9px 2px;
  color: #d9e8e6;
  cursor: pointer;
  list-style: none;
}

.finding-control-disclosure > summary::-webkit-details-marker,
.finding-general-disclosure > summary::-webkit-details-marker,
.marker-advanced-fields > summary::-webkit-details-marker {
  display: none;
}

.finding-control-disclosure > summary > span:first-child,
.finding-general-disclosure > summary > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.finding-control-disclosure > summary strong,
.finding-general-disclosure > summary strong {
  font-size: 0.76rem;
}

.finding-control-disclosure > summary small,
.finding-general-disclosure > summary small {
  overflow: hidden;
  color: #789399;
  font-size: 0.64rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finding-control-disclosure > summary > span:last-child,
.finding-general-disclosure > summary > span:last-child {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #8eb2aa;
  border: 1px solid #285048;
  border-radius: 50%;
  transition: transform 120ms ease;
}

.finding-control-disclosure[open] > summary > span:last-child,
.finding-general-disclosure[open] > summary > span:last-child {
  transform: rotate(45deg);
}

.finding-control-disclosure-body {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 9px;
  padding: 4px 0 13px;
}

.finding-control-disclosure-body > label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.finding-control-disclosure-body label > span {
  color: #aabdc1;
  font-size: 0.68rem;
  font-weight: 680;
}

.finding-control-disclosure-body input,
.finding-control-disclosure-body select {
  font-size: 0.72rem;
}

.finding-control-disclosure-body .anatomy-catalog-heading,
.finding-control-disclosure-body .anatomy-structure-select,
.finding-control-disclosure-body .anatomy-catalog-help {
  grid-column: 1 / -1;
}

.finding-control-disclosure-body .anatomy-catalog-heading {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin: 0;
  padding: 0 0 3px;
  border: 0;
}

.finding-control-disclosure-body [data-marker-structure] {
  min-height: 168px;
}

.manual-placement-grid {
  grid-template-columns: 1fr;
}

.manual-placement-grid .button {
  width: 100%;
  min-height: 38px;
  margin-top: 2px;
}

.anatomy-2d-workbench {
  margin-top: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.anatomy-2d-workbench > .anatomy-layer-controls {
  gap: 4px;
  margin: 0 0 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid #19353d;
}

.anatomy-layer-chip {
  min-height: 30px;
  padding: 4px 8px;
  background: transparent;
  border-color: transparent;
  font-size: 0.68rem;
}

.anatomy-layer-chip:hover,
.anatomy-layer-chip:has(input:checked) {
  background: #0a2228;
  border-color: #25454d;
}

.anatomy-layer-chip input {
  width: 13px;
  height: 13px;
}

.anatomy-2d-workbench .body-map-pair {
  gap: 0;
}

.anatomy-2d-workbench .body-figure {
  padding: 10px 18px 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.anatomy-2d-workbench .body-figure:first-child {
  border-right: 1px solid #19353d;
}

.anatomy-2d-workbench .body-silhouette {
  height: min(59vh, 640px);
  margin-block: 3px;
}

.anatomy-2d-workbench .body-click-help {
  display: none;
}

.anatomy-zoom-button {
  min-height: 30px;
  padding: 4px 7px;
  color: #8eaaa9;
  background: transparent;
  border-color: transparent;
}

.anatomy-zoom-button:hover {
  color: #dff4ed;
  background: #0a2228;
  border-color: #25454d;
}

.anatomy-hover-label {
  min-height: 28px;
  margin-top: 0;
  background: transparent;
  border-color: transparent;
  font-size: 0.64rem;
}

.finding-details .marker-editor-list {
  max-height: none;
  margin-top: 4px;
  overflow: visible;
}

.finding-details .marker-list-empty {
  padding: 8px 1px;
  background: transparent;
  border: 0;
  font-size: 0.76rem;
}

.finding-details .marker-editor {
  background: transparent;
  border-color: #1b3942;
}

.marker-detail-fields {
  gap: 8px;
  padding: 10px;
}

.marker-detail-fields input {
  min-height: 38px;
}

.marker-advanced-fields {
  border-top: 1px solid #19353d;
}

.marker-advanced-fields > summary {
  padding: 10px 0 7px;
  color: #95b0b2;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.marker-advanced-fields > summary::after {
  float: right;
  content: "+";
}

.marker-advanced-fields[open] > summary::after {
  content: "−";
}

.marker-advanced-fields > div {
  display: grid;
  gap: 8px;
}

.finding-general-disclosure {
  margin-top: 12px;
}

.finding-general {
  margin: 0;
  padding: 0 0 4px;
  border: 0;
}

.finding-actions {
  padding: 11px 15px;
  background: transparent;
}

@media (min-width: 1421px) {
  .finding-workspace {
    grid-template-columns: 300px minmax(760px, 1fr) 320px;
    gap: 16px;
  }

  .finding-tools,
  .finding-details {
    max-height: none;
    overflow: visible;
  }

  .finding-map-panel {
    padding: 18px;
  }
}

@media (max-width: 560px) {
  .anatomy-2d-workbench .body-figure:first-child {
    border-right: 0;
    border-bottom: 1px solid #19353d;
  }
}

/* Befunddetail · die Körperkarte nutzt zuerst die volle Arbeitsbreite */

.finding-detail-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
}

.finding-detail-layout > .finding-map-panel {
  grid-column: 1 / -1;
}

.finding-detail-layout > .finding-readout {
  grid-column: 1;
}

.finding-detail-layout > .finding-audit {
  grid-column: 2;
  align-self: start;
}

.finding-detail-layout .anatomy-2d-readonly {
  padding: 15px;
}

.finding-detail-layout .body-map-pair {
  gap: 12px;
}

.finding-detail-layout .body-figure {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: start;
  padding: 15px 18px 12px;
}

.finding-detail-layout .body-silhouette {
  height: clamp(620px, 72vh, 820px);
  margin-block: 10px 4px;
}

@media (max-width: 1180px) {
  .finding-detail-layout {
    grid-template-columns: 1fr;
  }

  .finding-detail-layout > .finding-map-panel,
  .finding-detail-layout > .finding-readout,
  .finding-detail-layout > .finding-audit {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .finding-detail-layout .anatomy-2d-readonly {
    padding: 10px;
  }

  .finding-detail-layout .body-figure {
    padding-inline: 10px;
  }

  .finding-detail-layout .body-silhouette {
    height: min(72vh, 620px);
  }
}

/* Geschützte Dokumentablage · ruhiges Register statt Dateimanager */

.document-boundary {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--green-soft);
  background: #08201f;
  border: 1px solid #234b40;
  border-radius: var(--radius-sm);
}

.document-boundary > span {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1.35;
}

.document-boundary p {
  max-width: 92ch;
  margin: 2px 0 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.document-upload-panel,
.document-list,
.document-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.document-upload-panel {
  position: sticky;
  top: 74px;
  padding: 16px;
}

.document-upload-panel form {
  display: grid;
  gap: 12px;
}

.document-upload-panel label,
.document-review-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.document-upload-panel label > span,
.document-review-form label > span {
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 680;
}

.document-upload-panel input[type="file"],
.document-new-version input[type="file"] {
  width: 100%;
  min-width: 0;
  padding: 8px;
  color: var(--text-soft);
  background: var(--surface-inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
}

.document-upload-panel input[type="file"]::file-selector-button,
.document-new-version input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.document-list {
  padding: 16px;
}

.document-card + .document-card {
  margin-top: 12px;
}

.document-card > header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px 16px;
}

.document-card > header h3 {
  margin: 0 0 3px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1rem;
}

.document-card > header span:not(.status-chip) {
  color: var(--muted);
  font-size: 0.72rem;
}

.document-version-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.document-version-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  padding: 14px 16px;
}

.document-version-list > li + li {
  border-top: 1px solid var(--line);
}

.document-version-meta,
.document-version-actions {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.document-version-meta strong,
.document-version-meta span,
.document-version-meta small {
  overflow-wrap: anywhere;
}

.document-version-meta span {
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.document-version-meta small {
  font-size: 0.68rem;
}

.document-version-actions {
  justify-items: end;
  align-content: start;
}

.document-review-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px dashed #29444c;
}

.document-new-version {
  border-top: 1px solid var(--line);
}

.document-new-version > summary {
  padding: 11px 16px;
  color: var(--green-soft);
  font-size: 0.72rem;
  font-weight: 680;
  cursor: pointer;
}

.document-new-version > form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 0 16px 14px;
}

.document-managed-note {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  color: var(--muted-strong);
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}

.document-managed-note a {
  color: var(--green-soft);
  font-weight: 690;
  white-space: nowrap;
}

.document-list > .cockpit-empty {
  padding: 20px;
}

@media (max-width: 1100px) {
  .document-workspace {
    grid-template-columns: 1fr;
  }

  .document-upload-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .document-card > header,
  .document-version-list > li {
    grid-template-columns: 1fr;
  }

  .document-card > header {
    flex-direction: column;
  }

  .document-version-actions {
    justify-items: start;
  }

  .document-review-form,
  .document-new-version > form {
    grid-template-columns: 1fr;
  }

  .document-managed-note {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Terminserien: Planung, Vorschau und klar begrenzte Serienaktionen. */
.series-form {
  display: grid;
  gap: 24px;
}

.series-form .appointment-form-grid {
  align-items: start;
}

@media (min-width: 981px) {
  .series-form .appointment-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.choice-group {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.choice-group legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.choice-group label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.choice-group input {
  width: auto;
  margin-top: 3px;
}

.series-preview,
.series-scope-panel {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.series-preview > p,
.series-scope-panel > div > p {
  margin: 0;
  color: var(--muted);
}

.series-preview .form-actions {
  position: static;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.series-form > .form-actions {
  position: static;
}

.series-preview-list,
.series-appointment-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.series-preview-row,
.series-appointment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 15px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.series-preview-row > label {
  display: flex;
  gap: 11px;
  align-items: center;
}

.series-preview-row input {
  width: auto;
}

.series-preview-row span,
.series-appointment-row span {
  display: grid;
  gap: 2px;
}

.series-preview-row small,
.series-appointment-row small {
  color: var(--muted);
}

.series-preview-row.has-conflict {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.series-conflict {
  display: grid;
  gap: 2px;
  max-width: 34rem;
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 650;
}

.series-conflict small {
  color: var(--muted);
  font-weight: 500;
}

.confirmation-check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 14px;
  background: var(--surface-inset);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
}

.confirmation-check input {
  width: auto;
  margin-top: 3px;
}

.confirmation-check span {
  display: grid;
  gap: 3px;
}

.confirmation-check small {
  color: var(--muted);
}

.series-detail-shell {
  display: grid;
  gap: 18px;
}

.series-state-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.76rem;
}

.series-state-summary span {
  white-space: nowrap;
}

.series-state-summary strong {
  color: var(--text);
}

.series-delete-panel,
.series-delete-complete {
  width: 100%;
}

.series-delete-boundary {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-inset));
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  border-radius: var(--radius-sm);
}

.series-delete-boundary p,
.series-delete-complete p {
  margin: 0;
}

.series-delete-confirmation {
  border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
}

.series-delete-complete {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  color: var(--muted);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.series-delete-complete strong {
  color: var(--text);
}

.series-appointment-row {
  grid-template-columns: 0.8fr minmax(0, 1.3fr) minmax(0, 1fr) auto auto;
  color: inherit;
  text-decoration: none;
}

.series-appointment-row:hover {
  border-color: var(--green);
}

.series-planning-section {
  padding: clamp(18px, 3vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.series-planning-section .panel-heading > a {
  color: var(--green-soft);
  font-size: 0.76rem;
  font-weight: 720;
}

.series-planning-row {
  grid-template-columns: 0.8fr minmax(0, 1.2fr) minmax(0, 1.5fr) auto;
}

/* Offene Terminplanung: erhaltene Konflikte und geprüfte Alternativen. */
.planning-directory,
.planning-detail-shell {
  display: grid;
  gap: 16px;
}

.planning-directory {
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.planning-tools {
  display: flex;
  flex-wrap: wrap;
}

.planning-tools label {
  min-width: min(260px, 100%);
}

.planning-tools .tool-summary {
  margin-left: auto;
}

.planning-register {
  overflow: hidden;
  background: #07181e;
  border: 1px solid #1a3740;
  border-radius: 8px;
}

.planning-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.15fr) minmax(130px, 0.8fr) minmax(220px, 1.4fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 10px 13px;
  color: var(--text-soft);
  text-decoration: none;
  border-top: 1px solid #17333b;
  transition: background-color 130ms ease, color 130ms ease;
}

.planning-row:first-child {
  border-top: 0;
}

.planning-row:not(.planning-row-head):hover {
  color: var(--text);
  background: #0a2229;
}

.planning-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.planning-row strong,
.planning-row small {
  overflow-wrap: anywhere;
}

.planning-row small {
  color: var(--muted);
  font-size: 0.68rem;
}

.planning-row > span:last-child {
  grid-template-columns: auto auto;
  align-items: center;
}

.planning-row-head {
  min-height: 38px;
  color: var(--muted);
  background: #06151a;
  font-size: 0.64rem;
  font-weight: 740;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.planning-request,
.planning-alternatives,
.planning-resolution,
.planning-conflict-note,
.planning-audit {
  padding: clamp(18px, 3vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.planning-request {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.planning-request h2 {
  margin: 0 0 8px;
  font-size: clamp(1.16rem, 2vw, 1.82rem);
}

.planning-request p:not(.kicker),
.planning-alternatives > p,
.planning-resolution p,
.planning-conflict-note p {
  margin: 0;
  color: var(--muted);
}

.planning-request dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.planning-request dl > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.planning-request dl > div:first-child {
  border-top: 0;
}

.planning-request dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.planning-request dd {
  display: grid;
  gap: 2px;
  margin: 0;
  overflow-wrap: anywhere;
}

.planning-request dd small {
  color: var(--muted);
}

.planning-conflict-note {
  display: grid;
  gap: 5px;
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--warning) 32%, var(--line));
}

.planning-alternatives {
  display: grid;
  gap: 14px;
}

.planning-slot-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.planning-slot-list > a {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  color: var(--text-soft);
  background: var(--surface-inset);
  border-top: 1px solid var(--line);
}

.planning-slot-list > a:first-child {
  border-top: 0;
}

.planning-slot-list > a:hover {
  color: var(--text);
  background: #0a2229;
}

.planning-slot-list > a > span {
  display: grid;
  gap: 2px;
}

.planning-slot-list small {
  color: var(--muted);
}

.planning-slot-list b {
  color: var(--green-soft);
  font-size: 0.76rem;
  white-space: nowrap;
}

.planning-resolution {
  display: grid;
  gap: 6px;
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
}

.planning-resolution.is-cancelled {
  border-color: var(--line);
}

.planning-form-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line));
  border-radius: var(--radius);
}

.planning-form-banner > div,
.locked-planning-value {
  display: grid;
  gap: 4px;
}

.planning-form-banner p {
  margin: 0;
}

.planning-form-banner > a {
  flex: 0 0 auto;
  color: var(--green-soft);
  font-size: 0.76rem;
  font-weight: 720;
}

.locked-planning-value {
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.locked-planning-value small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .series-preview-row,
  .series-appointment-row {
    grid-template-columns: 1fr;
  }

  .series-conflict {
    max-width: none;
  }

  .series-planning-row,
  .planning-row,
  .planning-request {
    grid-template-columns: 1fr;
  }

  .planning-row-head {
    display: none;
  }

  .planning-row > span:last-child {
    justify-content: start;
  }

  .planning-tools .tool-summary {
    margin-left: 0;
  }

  .planning-slot-list > a {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Therapiebericht · klinische Schreibstation mit belegtem Quellenrand */

.therapy-report-heading {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 18px 20px;
  background: #071a20;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.therapy-report-heading h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 1.16rem;
}

.therapy-report-heading p:not(.kicker) {
  max-width: 78ch;
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
}

.therapy-report-state {
  display: grid;
  flex: 0 0 min(290px, 35%);
  gap: 7px;
  justify-items: end;
  text-align: right;
}

.therapy-report-state small {
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.68rem;
}

.status-in_review {
  color: #f9dd91;
  background: #2c250f;
  border-color: #6f5b22;
}

.therapy-report-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 16px;
  align-items: start;
}

.therapy-report-editor,
.therapy-report-context {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.therapy-report-form-panel,
.therapy-report-decision,
.therapy-report-context > .panel {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.therapy-report-form-panel > .panel-heading,
.therapy-report-decision > .panel-heading,
.therapy-report-context > .panel > .panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

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

.therapy-report-form fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.therapy-report-form label,
.therapy-report-review-actions label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.therapy-report-form label > span,
.therapy-report-review-actions label > span {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 690;
}

.therapy-report-form label > span small {
  font-weight: 500;
}

.therapy-report-form .field-span-2 {
  grid-column: 1 / -1;
}

.therapy-report-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.therapy-report-form fieldset:disabled :is(input, textarea) {
  color: var(--text-soft);
  background: #07161b;
  border-color: var(--line);
  opacity: 0.84;
}

.therapy-report-form-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.therapy-report-form-actions p {
  max-width: 66ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.therapy-report-review-note {
  margin-bottom: 16px;
  padding: 11px 13px;
  color: #f9dd91;
  background: #211d0d;
  border: 1px solid #625120;
  border-radius: var(--radius-sm);
}

.therapy-report-review-note strong,
.therapy-report-review-note p,
.therapy-report-review-note small {
  display: block;
}

.therapy-report-review-note p {
  margin: 4px 0;
  color: #e9d7a6;
  font-size: 0.76rem;
}

.therapy-report-decision > p {
  max-width: 76ch;
  margin: 0 0 15px;
  color: var(--muted-strong);
  font-size: 0.76rem;
}

.therapy-report-review-actions {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.82fr);
  gap: 18px;
}

.therapy-report-review-actions > form {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.confirmation-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.confirmation-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.confirmation-check span {
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.therapy-report-key-data {
  display: grid;
  margin: 0;
}

.therapy-report-key-data > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.therapy-report-key-data dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 680;
}

.therapy-report-key-data dd {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.therapy-report-key-data dd small {
  color: var(--muted);
  font-size: 0.68rem;
}

.count-badge {
  min-width: 25px;
  min-height: 24px;
  padding: 3px 8px;
  color: var(--muted-strong);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 720;
  text-align: center;
}

.therapy-report-source-list {
  display: grid;
  margin: 0 -18px -18px;
  border-top: 1px solid var(--line);
}

.therapy-report-source-list article,
.therapy-report-source-list > .empty-state {
  padding: 12px 18px;
}

.therapy-report-source-list article + article {
  border-top: 1px solid var(--line);
}

.therapy-report-source-list article > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.therapy-report-source-list article strong {
  color: var(--text);
  font-size: 0.76rem;
}

.therapy-report-source-list article span {
  overflow: hidden;
  color: var(--green-soft);
  font-size: 0.68rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.therapy-report-source-list article p {
  margin: 5px 0 3px;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.therapy-report-source-list article small {
  font-size: 0.64rem;
}

.therapy-report-source-list > .empty-state {
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.72rem;
}

.context-boundary {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.68rem;
}

.therapy-report-versions > article {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.therapy-report-versions > article > div {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.therapy-report-versions > article p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.therapy-report-versions > article small {
  overflow-wrap: anywhere;
  font-size: 0.64rem;
}

.therapy-report-versions .button {
  width: max-content;
  margin-top: 5px;
}

@media (max-width: 1280px) {
  .therapy-report-workspace {
    grid-template-columns: 1fr;
  }

  .therapy-report-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .therapy-report-context > .panel:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .therapy-report-heading {
    display: grid;
  }

  .therapy-report-state {
    justify-items: start;
    text-align: left;
  }

  .therapy-report-form fieldset,
  .therapy-report-review-actions,
  .therapy-report-context {
    grid-template-columns: 1fr;
  }

  .therapy-report-form .field-span-2,
  .therapy-report-context > .panel:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .therapy-report-form-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Review feedback – isolated from patient documentation */

.review-boundary {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: linear-gradient(110deg, rgba(30, 96, 100, 0.2), rgba(7, 23, 29, 0.94));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.review-boundary > span {
  color: var(--green-soft);
  font-size: 1rem;
}

.review-boundary p,
.review-management p {
  margin: 2px 0 0;
  font-size: 0.76rem;
}

.review-directory {
  padding: 13px;
}

.review-tools {
  display: flex;
  flex-wrap: wrap;
}

.review-tools label {
  display: grid;
  gap: 3px;
}

.review-tools label > span {
  padding-left: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.review-tools .tool-summary {
  margin-left: auto;
}

.review-list {
  display: grid;
  gap: 8px;
}

.review-card {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 14px 16px;
  color: var(--text);
  background: var(--surface-quiet);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.review-card:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}

.review-card-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.review-card-main strong,
.review-card-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-card-meta {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.review-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.review-category-bug,
.review-priority-critical {
  color: #ffb4b4;
  border-color: rgba(255, 116, 116, 0.38);
}

.review-category-domain_change,
.review-priority-high {
  color: #f7d986;
  border-color: rgba(243, 199, 91, 0.35);
}

.review-category-usability {
  color: #9fdaf0;
  border-color: rgba(115, 194, 223, 0.36);
}

.review-category-later_wish,
.review-priority-low {
  color: #b7c5c8;
}

.review-form {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin-inline: auto;
  padding: 18px;
}

.review-form fieldset {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.review-form legend {
  padding: 0 7px;
  color: var(--text);
  font-weight: 720;
}

.review-form label,
.review-management label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.review-form label > span,
.review-management label > span {
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 700;
}

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

.review-form-context {
  align-items: end;
}

.review-context-readout {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.review-context-readout > span,
.review-context-readout small {
  color: var(--muted);
  font-size: 0.64rem;
}

.review-confirmation {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  padding: 12px 14px;
  background: rgba(53, 172, 115, 0.07);
  border: 1px solid rgba(53, 172, 115, 0.3);
  border-radius: var(--radius-sm);
}

.review-confirmation input {
  width: 17px;
  min-height: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.review-confirmation span {
  min-width: 0;
  color: var(--text-soft) !important;
  overflow-wrap: anywhere;
}

.review-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.review-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(270px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.review-detail,
.review-management {
  display: grid;
  gap: 18px;
  padding: 18px;
}

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

.review-metadata > div,
.review-observation article {
  padding: 13px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.review-metadata dt,
.review-observation article > span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 720;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.review-metadata dd {
  display: grid;
  gap: 3px;
  margin: 0;
  overflow-wrap: anywhere;
}

.review-observation p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.review-screenshot {
  display: grid;
  gap: 7px;
  margin: 0;
}

.review-screenshot img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #020b0f;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.review-screenshot figcaption {
  color: var(--muted);
  font-size: 0.64rem;
}

.review-management form {
  display: grid;
  gap: 12px;
}

@media (max-width: 980px) {
  .review-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .review-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-tools .tool-summary {
    width: 100%;
    margin-left: 0;
  }

  .review-form-grid,
  .review-form-context,
  .review-observation,
  .review-metadata {
    grid-template-columns: 1fr;
  }

  .review-form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}
/* Patienten-App: klar getrennte Freigaben, Inhalte und Widerrufe. */
.portal-boundary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
  border-radius: var(--radius);
  background: var(--surface-quiet);
}

.portal-boundary > span {
  color: var(--green);
  font-size: 1.48rem;
}

.portal-boundary p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.portal-access-panel,
.portal-composer,
.portal-history {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.portal-access-panel {
  margin-bottom: 1.5rem;
}

.portal-grant-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-quiet);
}

.portal-grant-card > header,
.portal-content-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-grant-card header div,
.portal-content-card header div {
  display: grid;
  gap: 0.25rem;
}

.portal-grant-card small,
.portal-content-card small {
  display: block;
  color: var(--muted);
}

.portal-scope-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0;
  border: 0;
}

.portal-scope-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 0.25rem;
  font-weight: 750;
}

.portal-scope-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.portal-scope-grid input {
  width: 1.1rem;
  height: 1.1rem;
}

.portal-scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.portal-scope-list li {
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(340px, 1.15fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.portal-video-workspace {
  padding-top: 1.5rem;
  border-top: 2px solid var(--line);
}

.portal-composer form,
.portal-revoke-form {
  display: grid;
  gap: 0.9rem;
}

.portal-composer form > label,
.portal-form-row label {
  display: grid;
  gap: 0.35rem;
}

.portal-composer input,
.portal-composer textarea,
.portal-composer select,
.portal-revoke-form input {
  width: 100%;
}

.portal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.portal-content-card {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.portal-content-card h3 {
  margin: 0.4rem 0 0;
}

.portal-content-card p {
  white-space: pre-line;
}

.portal-revoke-form {
  grid-template-columns: 1fr auto;
  margin-top: 0.9rem;
}

.catalog-assignment-card {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.catalog-assignment-card > header,
.catalog-video-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.catalog-assignment-card > header p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.catalog-assignment-card > header > span {
  flex: none;
  color: var(--muted);
  font-size: 0.68rem;
}

.catalog-assignment-card form {
  margin-top: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-quiet);
}

.catalog-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.catalog-video-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-quiet);
}

.catalog-video-card h3 {
  margin: 0.45rem 0 0;
}

.catalog-video-card > small {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
}

@media (max-width: 880px) {
  .portal-content-grid,
  .portal-scope-grid {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .portal-content-grid,
  .portal-scope-grid,
  .portal-form-row,
  .portal-revoke-form {
    grid-template-columns: 1fr;
  }

  .portal-grant-card > header,
  .portal-content-card > header,
  .catalog-assignment-card > header,
  .catalog-video-card > header {
    flex-direction: column;
  }
}
