:root {
  --bg: #bfe6ff;
  --surface: #ffffff;
  --surface-soft: #f8fbfe;
  --surface-tint: #eef8ff;
  --ink: #162033;
  --ink-soft: #475569;
  --muted: #657084;
  --line: #e5edf5;
  --line-strong: #b8d7eb;
  --brand: #38b6ff;
  --brand-strong: #1286c9;
  --brand-deep: #0f628f;
  --brand-soft: #eef8ff;
  --accent: #8bcdf5;
  --accent-soft: #edf7ff;
  --warn: #7a5200;
  --warn-soft: #fff2d2;
  --danger: #b42318;
  --danger-soft: #fdecec;
  --shadow-sm: 0 1px 2px rgba(20, 43, 76, 0.06);
  --shadow-md: 0 12px 30px rgba(20, 43, 76, 0.08);
  --shadow-lg: 0 24px 70px rgba(20, 43, 76, 0.18);
  --radius: 22px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.50), rgba(191, 230, 255, 0) 340px),
    linear-gradient(180deg, rgba(56, 182, 255, 0.16), rgba(191, 230, 255, 0) 320px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: inherit;
}

/* topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 12px 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(229, 237, 245, 0.9);
  box-shadow: 0 10px 28px rgba(20, 43, 76, 0.08);
  backdrop-filter: blur(14px);
}

.topbar strong {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0;
}

.topbar strong::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #79d4ff);
  box-shadow: 0 0 0 4px rgba(56, 182, 255, 0.14);
}

.topbar a {
  color: inherit;
  text-decoration: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 18px;
}

.topbar-right a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--brand-strong);
  background: var(--surface-tint);
}

.topbar-right a:hover {
  color: #ffffff;
  background: var(--brand-strong);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.96), rgba(236, 249, 255, 0.9) 42%, rgba(56, 182, 255, 0.24)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(230, 247, 255, 0.92));
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 860;
  box-shadow: 0 10px 24px rgba(20, 43, 76, 0.12);
}

.account-avatar-large {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 45;
  width: min(300px, calc(100vw - 24px));
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(20, 43, 76, 0.18);
}

.account-menu-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px 6px 12px;
  border-bottom: 1px solid rgba(215, 230, 242, 0.86);
}

.account-menu-head strong,
.account-menu-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-head strong {
  color: var(--ink);
  font-size: 14px;
}

.account-menu-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.account-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 12px;
  color: #17466a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 760;
}

.topbar-right .account-menu-item {
  display: flex;
  justify-content: space-between;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 12px;
  background: transparent;
}

.account-menu-item small {
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 820;
}

.account-menu-item.is-disabled {
  color: #7790a3;
  background: rgba(239, 249, 255, 0.62);
}

.account-menu-logout {
  color: #b42318;
}

.account-menu-logout:hover {
  background: #fff1f2;
}

.topbar-right .account-menu-logout:hover {
  color: #b42318;
  background: #fff1f2;
}

.workspace-switcher {
  position: relative;
}

.workspace-switcher summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.workspace-switcher summary::-webkit-details-marker {
  display: none;
}

.workspace-switcher-dot,
.workspace-switcher-option-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--workspace-color) 62%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--workspace-color) 16%, transparent);
}

.workspace-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(310px, calc(100vw - 24px));
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(20, 43, 76, 0.18);
}

.workspace-switcher-label {
  padding: 2px 3px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-switcher-menu form {
  margin: 0;
}

.workspace-switcher-option {
  width: 100%;
  min-height: 42px;
  margin: 0;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  justify-content: stretch;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #17466a;
  text-align: left;
  box-shadow: none;
}

.workspace-switcher-option:hover,
.workspace-switcher-option.is-active {
  border-color: var(--line);
  background: var(--surface-tint);
  color: var(--brand-strong);
}

.workspace-switcher-option small {
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 800;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(215, 230, 242, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 20px rgba(20, 43, 76, 0.06);
  backdrop-filter: blur(12px);
}

.topnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 17px;
  color: #5f6b7d;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.topnav svg,
.topnav i,
.topnav i svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topnav a:hover {
  color: var(--brand-strong);
  background: rgba(239, 249, 255, 0.92);
  transform: translateY(-1px);
}

.topnav a.active {
  color: var(--brand-strong);
  background: var(--surface-tint);
  box-shadow: 0 10px 22px rgba(18, 134, 201, 0.10);
}

.topnav a.active svg {
  stroke-width: 2.8;
}

.app-mobile-nav {
  display: none;
}

.app-mobile-nav a {
  color: var(--muted);
  text-decoration: none;
}

.app-mobile-nav svg,
.app-mobile-nav i,
.app-mobile-nav i svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  width: 100%;
  padding: 22px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(100%, 1320px);
  margin: 0 auto;
  min-width: 0;
}

/* layout */
.grid,
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid > .card:nth-child(n + 3) {
  min-width: 0;
}

.patient-detail-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.clinical-notes-note {
  margin-top: 6px;
  max-width: 620px;
  font-size: 12px;
}

.clinical-empty-state {
  margin-top: 14px;
}

.clinical-note-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.clinical-note-card {
  padding: 16px;
  border: 1px solid rgba(186, 216, 232, 0.8);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(240, 250, 255, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: 0 14px 30px rgba(25, 121, 173, 0.08);
}

.clinical-note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.clinical-note-title {
  margin-top: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 780;
}

.clinical-note-card p {
  margin: 8px 0 14px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.material-response-detail {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
}

.material-response-detail strong {
  color: var(--brand-strong);
  font-size: 12px;
}

.material-response-detail p {
  margin: 6px 0 0;
  white-space: pre-line;
}

.clinical-note-textarea {
  min-height: 220px;
}

.tasks-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tasks-hero h2 {
  margin: 10px 0 8px;
  font-size: 28px;
}

.tasks-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tasks-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

/* Experimental application header */
.app-shell-topbar {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  min-height: 66px;
  padding: 8px 20px;
  gap: 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(196, 221, 236, 0.88);
  box-shadow: 0 7px 22px rgba(30, 92, 126, 0.08);
}

.app-shell-topbar--without-navigation {
  grid-template-columns: minmax(0, 1fr) auto;
}

.app-topbar-left,
.app-topbar-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-topbar-left {
  justify-self: start;
  gap: 10px;
}

.app-topbar-actions {
  justify-self: end;
  gap: 9px;
}

.app-topbar-center {
  align-self: center;
  justify-self: center;
  min-width: 0;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #162033;
  text-decoration: none;
  font-size: 15px;
  font-weight: 820;
}

.app-brand img {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 7px 16px rgba(19, 143, 207, 0.2);
}

.app-topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #d8e8f1;
  border-radius: 8px;
  color: #426177;
  background: rgba(247, 252, 255, 0.92);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.app-topbar-back svg {
  width: 16px;
  height: 16px;
}

.app-shell-topbar .topnav {
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.app-shell-topbar .topnav a {
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #4f6577;
  background: rgba(238, 248, 254, 0.86);
  font-size: 11px;
}

.app-shell-topbar .topnav a:hover,
.app-shell-topbar .topnav a.active {
  color: #047fb9;
  background: #e4f5fd;
  transform: none;
  box-shadow: none;
}

.app-shell-topbar .topnav svg,
.app-shell-topbar .topnav i,
.app-shell-topbar .topnav i svg {
  width: 17px;
  height: 17px;
}

.app-refresh-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid #cfe3ef;
  border-radius: 50%;
  background: #fff;
  color: #078fce;
  box-shadow: 0 5px 14px rgba(24, 111, 158, 0.08);
}

.app-refresh-button:hover {
  border-color: #8fd5f5;
  background: #eef9ff;
  color: #057daf;
  transform: none;
}

.app-refresh-button svg {
  width: 18px;
  height: 18px;
}

.app-shell-topbar .account-menu summary {
  min-height: 40px;
}

.app-shell-topbar .account-avatar {
  width: 38px;
  height: 38px;
  border: 3px solid #fff;
  background: #0a91d1;
  color: #fff;
  box-shadow: 0 0 0 1px #38b6ff, 0 6px 15px rgba(24, 111, 158, 0.16);
}

.app-shell-topbar .account-menu-panel {
  top: calc(100% + 9px);
  width: min(270px, calc(100vw - 24px));
  gap: 2px;
  padding: 12px 9px;
  border-color: #c8dfec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 16px 38px rgba(31, 91, 125, 0.18);
}

.app-shell-topbar .account-menu-head {
  display: block;
  padding: 5px 8px 12px;
  margin-bottom: 4px;
}

.app-shell-topbar .account-menu-head strong {
  min-height: 0;
  font-size: 14px;
}

.app-shell-topbar .account-menu-head strong::before {
  display: none;
}

.app-shell-topbar .account-menu-head small {
  margin-top: 3px;
  color: #728397;
  font-size: 11px;
}

.app-shell-topbar .account-menu-item,
.app-shell-topbar .topbar-right .account-menu-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  justify-content: start;
  min-height: 38px;
  padding: 8px;
  border-radius: 6px;
  color: #086f9f;
  background: transparent;
  font-size: 12px;
  font-weight: 760;
}

.app-shell-topbar .account-menu-item svg {
  width: 16px;
  height: 16px;
}

.app-shell-topbar .account-menu-item:hover {
  color: #047fb9;
  background: #eef9ff;
}

.app-shell-topbar .account-menu-item.is-disabled {
  color: #6f8798;
  opacity: 0.7;
}

.app-shell-topbar .account-menu-logout {
  color: #0875a8;
}

.app-topbar-mobile-nav {
  display: none;
}

@media (max-width: 1180px) and (min-width: 701px) {
  .app-shell-topbar {
    grid-template-columns: minmax(130px, 1fr) auto minmax(100px, 1fr);
    gap: 10px;
    padding-inline: 14px;
  }

  .app-shell-topbar .topnav a {
    width: 36px;
    padding-inline: 0;
  }

  .app-shell-topbar .topnav a span {
    display: none;
  }

  .app-brand span,
  .app-topbar-back span {
    display: none;
  }

  .app-shell-topbar--without-navigation {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 700px) {
  .app-shell-topbar {
    position: sticky;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: auto;
    padding: 8px 10px 9px;
    gap: 8px 10px;
  }

  .app-topbar-left {
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 7px;
  }

  .app-brand img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .app-brand span {
    font-size: 14px;
  }

  .app-topbar-back {
    width: 34px;
    min-height: 34px;
    justify-content: center;
    padding: 0;
  }

  .app-topbar-back span {
    display: none;
  }

  .app-topbar-center {
    display: none;
  }

  .app-topbar-actions {
    position: static;
    justify-self: end;
  }

  .app-refresh-button,
  .app-shell-topbar .account-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .app-topbar-mobile-nav {
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
  }

  .app-shell-topbar .app-mobile-nav {
    margin: 0;
    min-width: 0;
    border-radius: 8px;
    box-shadow: none;
  }

  .app-shell-topbar .app-mobile-nav a {
    min-height: 50px;
    border-radius: 6px;
  }

  .app-shell-topbar .account-menu-panel {
    position: fixed;
    top: 51px;
    right: 10px;
  }
}

/* Patient portal profiles */
.portal-profile-wizard-page,
.portal-profile-manage-page {
  max-width: 1120px;
  margin: 0 auto;
}

.portal-profile-page-heading {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
  color: #fff;
}

.portal-profile-page-heading .btn {
  width: fit-content;
}

.portal-profile-page-heading span {
  font-size: 13px;
  font-weight: 700;
  opacity: .82;
}

.portal-profile-page-heading h1 {
  margin: 4px 0 6px;
  color: #fff;
  font-size: 38px;
  letter-spacing: 0;
}

.portal-profile-page-heading p {
  margin: 0;
  color: rgba(255,255,255,.86);
}

.portal-profile-wizard,
.portal-profile-settings-card,
.portal-profile-link-card,
.portal-profile-access-card {
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 8px;
  background: rgba(247,252,255,.88);
  box-shadow: 0 14px 34px rgba(25,108,153,.11);
}

.portal-profile-wizard {
  padding: 24px;
}

.wizard-progress {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.wizard-progress span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #eaf3f8;
  color: #68788b;
  font-size: 13px;
  font-weight: 800;
}

.wizard-progress span.is-active {
  background: #38b6ff;
  color: #fff;
}

.wizard-step-copy h2,
.wizard-step-copy p {
  margin: 0;
}

.wizard-step-copy p {
  margin-top: 6px;
  color: #617086;
}

.portal-profile-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.portal-profile-type-grid input,
.portal-profile-area-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portal-profile-type-grid label > span {
  display: grid;
  min-height: 124px;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  gap: 5px 14px;
  align-content: center;
  padding: 18px;
  border: 1px solid #c8e2f0;
  border-radius: 8px;
  background: rgba(242,250,254,.82);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.portal-profile-type-grid label > span:hover {
  background: #edf8fe;
}

.portal-profile-type-grid svg {
  grid-row: 1 / 3;
  align-self: center;
  width: 24px;
  color: #0997d4;
}

.portal-profile-type-grid strong,
.portal-profile-type-grid small {
  display: block;
}

.portal-profile-type-grid small {
  color: #627187;
  line-height: 1.45;
}

.portal-profile-type-grid input:checked + span,
.portal-profile-area-grid input:checked + span {
  border-color: #38b6ff;
  background: #eaf7fe;
  box-shadow: 0 0 0 1px rgba(56,182,255,.12);
}

.portal-profile-area-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 22px;
}

.portal-profile-area-grid label > span {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid #cfe3ee;
  border-radius: 8px;
  background: rgba(250,253,255,.78);
  color: #526277;
  cursor: pointer;
  font-weight: 750;
}

.portal-profile-area-grid svg {
  width: 19px;
  color: #0797d4;
}

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

.portal-profile-access-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  margin-bottom: 16px;
}

.portal-profile-access-card .action-icon {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(56, 182, 255, 0.12);
  border-radius: 8px;
  background: rgba(232, 247, 255, 0.92);
  color: #078fce;
  box-shadow: 0 8px 20px rgba(39, 145, 196, 0.09);
}

.portal-profile-access-card .action-icon svg {
  width: 24px;
  height: 24px;
}

.portal-profile-access-card > div {
  min-width: 0;
}

.portal-profile-access-card strong,
.portal-profile-access-card small {
  display: block;
}

.portal-profile-access-card small,
.portal-profile-link-card > small {
  margin-top: 4px;
  color: #66758a;
}

.portal-profile-link-card,
.portal-profile-settings-card {
  padding: 20px;
  margin-bottom: 16px;
}

.portal-profile-material-picker {
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid #d7e7ef;
}

.portal-profile-material-picker h2,
.portal-profile-material-picker p {
  margin: 0;
}

.portal-profile-material-picker p {
  margin-top: 5px;
  color: #65758a;
}

.portal-profile-material-picker > label {
  display: block;
  margin-top: 10px;
}

.portal-profile-material-picker > label > span {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid #d3e5ee;
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.portal-profile-material-picker input:checked + span {
  border-color: #38b6ff;
  background: #edf9ff;
}

.portal-profile-material-picker svg {
  width: 20px;
  color: #0797d4;
}

.portal-profile-material-picker strong,
.portal-profile-material-picker small {
  display: block;
}

.portal-profile-material-picker small {
  margin-top: 3px;
  color: #69778a;
}

.patient-portal-profile-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.patient-portal-profile-list article {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #d4e6ef;
  border-radius: 8px;
  background: rgba(255,255,255,.62);
}

.patient-portal-profile-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(232, 247, 255, 0.92);
  color: #078fce;
  box-shadow: 0 7px 16px rgba(39, 145, 196, 0.08);
}

.patient-portal-profile-icon i,
.patient-portal-profile-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.patient-portal-profile-list article > div:first-of-type {
  min-width: 0;
  align-self: center;
}

.patient-portal-profile-list strong,
.patient-portal-profile-list small {
  display: block;
}

.patient-portal-profile-list small {
  margin-top: 2px;
  color: #68778b;
}

.patient-portal-profile-actions {
  display: flex;
  gap: 8px;
}

.patient-security-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.patient-security-card {
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 8px;
  background: rgba(248,252,255,.94);
  box-shadow: 0 20px 55px rgba(14,78,115,.18);
  text-align: center;
}

.patient-security-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 8px;
  background: #e9f7fe;
  color: #0797d4;
}

.patient-security-card h1 {
  margin: 6px 0 8px;
}

.patient-security-card > p {
  margin: 0 0 20px;
  color: #607087;
}

.patient-security-card form:not(.patient-security-secondary-form) {
  text-align: left;
}

.patient-security-card form .btn {
  width: 100%;
  margin-top: 14px;
}

.patient-security-secondary-form {
  margin-top: 14px;
}

.link-button,
.patient-security-skip {
  border: 0;
  background: transparent;
  color: #087fb9;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.patient-security-skip {
  display: inline-block;
  margin-top: 16px;
}

.portal-professional-preview {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 8px;
  background: rgba(17,130,184,.94);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.portal-professional-preview svg {
  width: 17px;
}

@media (max-width: 700px) {
  .portal-profile-page-heading h1 { font-size: 30px; }
  .portal-profile-wizard { padding: 16px; }
  .portal-profile-type-grid { grid-template-columns: 1fr; }
  .portal-profile-type-grid label > span { min-height: 104px; }
  .portal-profile-area-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portal-profile-area-grid label > span { min-height: 72px; flex-direction: column; font-size: 12px; text-align: center; }
  .portal-profile-access-card { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 15px; }
  .portal-profile-access-card .action-icon { width: 44px; height: 44px; }
  .portal-profile-access-card .action-icon svg { width: 21px; height: 21px; }
  .portal-profile-access-card .btn { grid-column: 1 / -1; width: 100%; }
  .patient-portal-profile-list article { grid-template-columns: 42px minmax(0, 1fr); }
  .patient-portal-profile-actions { grid-column: 1 / -1; }
  .patient-portal-profile-actions .btn { flex: 1; }
  .patient-security-card { padding: 22px 18px; }
}

.tasks-filter-grid--compact {
  grid-template-columns: minmax(220px, 320px) auto;
}

.tasks-filter-panel {
  justify-self: start;
}

.tasks-search-field {
  grid-column: span 2;
}

.tasks-list {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.09);
  backdrop-filter: blur(14px);
}

.task-list-hub {
  display: grid;
  gap: 16px;
}

.task-list-card {
  text-decoration: none;
}

.task-list-card-copy {
  min-width: 0;
}

.task-list-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.task-list-card-stats > span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.15;
}

.task-list-card-stats em {
  color: var(--muted);
  font-style: normal;
  font-weight: 560;
}

.task-list-card-stats .is-done {
  border-color: rgba(145, 205, 168, 0.42);
  background: rgba(225, 247, 234, 0.78);
}

.task-list-card-stats .is-partial {
  border-color: rgba(226, 192, 107, 0.42);
  background: rgba(255, 245, 211, 0.78);
}

.task-list-card-stats .is-progressed {
  border-color: rgba(124, 185, 219, 0.42);
  background: rgba(226, 244, 253, 0.8);
}

.task-list-detail {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.09);
  backdrop-filter: blur(14px);
}

.task-list-detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.task-list-detail-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.task-list-detail-header p,
.task-list-description {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.patient-task-list-board {
  display: grid;
  gap: 12px;
}

.patient-task-list-row {
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 22px;
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.06);
}

.patient-task-list-row.status-pending {
  border-color: rgba(224, 154, 154, 0.5);
  background: linear-gradient(135deg, rgba(255, 249, 249, 0.98), rgba(255, 242, 242, 0.92));
}

.patient-task-list-row.status-partial {
  border-color: rgba(226, 192, 107, 0.5);
  background: linear-gradient(135deg, rgba(255, 253, 245, 0.98), rgba(255, 248, 224, 0.94));
}

.patient-task-list-row.status-done {
  border-color: rgba(145, 205, 168, 0.54);
  background: linear-gradient(135deg, rgba(241, 253, 246, 0.98), rgba(236, 250, 242, 0.96));
}

.patient-task-list-row > form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 0;
  padding: 16px;
}

.patient-task-list-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
}

.patient-task-list-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.patient-task-list-person strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.patient-task-list-person small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.patient-task-progress {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(162, 190, 207, 0.34);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.patient-task-progress button {
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.15;
  cursor: pointer;
}

.patient-task-progress button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  transform: none;
}

.patient-task-progress button.active {
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(20, 43, 76, 0.08);
}

.status-pending .patient-task-progress button.active {
  background: rgba(247, 202, 202, 0.78);
}

.status-partial .patient-task-progress button.active {
  background: rgba(247, 221, 153, 0.8);
}

.status-done .patient-task-progress button.active {
  background: rgba(188, 231, 204, 0.82);
}

.patient-task-list-note {
  grid-column: 1 / -1;
  padding-top: 6px;
}

.patient-task-list-note summary {
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
}

.patient-task-list-note textarea {
  min-height: 88px;
  margin-top: 10px;
}

.patient-task-list-manage {
  grid-column: 1 / -1;
}

.patient-task-list-manage summary {
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.patient-task-list-manage .btn {
  margin-top: 10px;
}

.btn-danger-soft {
  border-color: rgba(209, 84, 84, 0.2);
  color: #b43d3d;
  background: rgba(255, 239, 239, 0.82);
}

.task-list-add-patients {
  overflow: hidden;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 22px;
  background: rgba(244, 251, 255, 0.78);
}

.task-list-add-patients > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  list-style: none;
  cursor: pointer;
}

.task-list-add-patients > summary::-webkit-details-marker {
  display: none;
}

.task-list-add-patients > summary > svg {
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
  transition: transform 160ms ease;
}

.task-list-add-patients[open] > summary > svg {
  transform: rotate(180deg);
}

.task-list-add-patients-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--brand-strong);
  background: rgba(232, 247, 255, 0.96);
}

.task-list-add-patients-icon svg {
  width: 21px;
  height: 21px;
}

.task-list-add-patients strong,
.task-list-add-patients small {
  display: block;
}

.task-list-add-patients small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.task-list-available-patients {
  display: grid;
  gap: 9px;
  padding: 0 16px 16px;
}

.task-list-available-patient {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(198, 222, 235, 0.74);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

.task-list-available-patient > strong {
  color: var(--ink);
  font-size: 14px;
}

.task-list-available-patient > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-list-available-patient form {
  margin: 0;
}

.task-list-no-patients {
  margin: 4px 2px 2px;
  text-align: center;
}

.task-list-treated {
  overflow: hidden;
  border: 1px solid rgba(145, 205, 168, 0.44);
  border-radius: 22px;
  background: rgba(241, 253, 246, 0.64);
}

.task-list-treated > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  list-style: none;
  cursor: pointer;
}

.task-list-treated > summary::-webkit-details-marker {
  display: none;
}

.task-list-treated > summary strong,
.task-list-treated > summary small {
  display: block;
}

.task-list-treated > summary strong {
  color: #277a4c;
}

.task-list-treated > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.task-list-treated > summary > svg {
  width: 18px;
  height: 18px;
  color: #277a4c;
  transition: transform 160ms ease;
}

.task-list-treated[open] > summary > svg {
  transform: rotate(180deg);
}

.task-list-treated > .patient-task-list-board {
  padding: 0 16px 16px;
}

.task-list-feedback {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 13px;
  border: 1px solid rgba(104, 190, 139, 0.32);
  border-radius: 14px;
  color: #276a46;
  background: rgba(237, 252, 243, 0.94);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.task-list-feedback svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.task-list-feedback--moved {
  border-style: dashed;
}

.task-list-create-form {
  display: grid;
  gap: 12px;
}

.task-list-patient-tools {
  display: grid;
  gap: 8px;
}

.task-list-patient-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-list-patient-picker {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.task-list-patient-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 18px;
  background: rgba(248, 253, 255, 0.92);
  cursor: pointer;
}

.task-list-patient-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.task-list-patient-option strong,
.task-list-patient-option small {
  display: block;
}

.task-list-patient-option strong {
  color: var(--ink);
  line-height: 1.2;
}

.task-list-patient-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tasks-quick-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
  backdrop-filter: blur(14px);
}

.tasks-quick-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: #5f6b7d;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tasks-quick-tabs a:hover {
  background: rgba(239, 249, 255, 0.86);
  color: var(--brand-strong);
  box-shadow: 0 10px 22px rgba(20, 43, 76, 0.06);
  transform: translateY(-1px);
}

.tasks-quick-tabs a.active {
  border-color: rgba(215, 230, 242, 0.86);
  background: rgba(239, 249, 255, 0.92);
  color: var(--brand-strong);
  box-shadow: 0 12px 24px rgba(56, 182, 255, 0.10);
}

.tasks-quick-tabs svg,
.tasks-quick-tabs i,
.tasks-quick-tabs i svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(186, 216, 232, 0.8);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(248, 253, 255, 0.98), rgba(240, 250, 255, 0.96));
  box-shadow: var(--shadow-md);
}

.task-card.status-done {
  background: linear-gradient(135deg, rgba(241, 253, 246, 0.98), rgba(236, 250, 242, 0.96));
}

.task-card-top,
.patient-task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.task-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.task-card p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.task-meta,
.task-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-links .tag {
  text-decoration: none;
}

.task-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.task-card-actions form {
  margin: 0;
}

.task-wizard-modal {
  width: min(760px, 100%);
}

.task-wizard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: -6px -6px 18px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid rgba(215, 230, 242, 0.72);
}

.task-wizard-header h2 {
  margin: 0;
}

.task-wizard-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.task-wizard-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.task-wizard-header-actions .btn,
.task-wizard-header-actions .link {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.task-wizard-form {
  display: grid;
  gap: 16px;
}

.task-wizard-steps {
  display: flex;
  gap: 8px;
}

.task-wizard-steps span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.task-wizard-steps span.active {
  background: var(--brand);
  color: #ffffff;
}

.task-wizard-steps span.is-skipped {
  opacity: 0.34;
}

.task-wizard-step {
  display: none;
}

.task-wizard-step.is-active {
  display: grid;
  gap: 14px;
}

.task-wizard-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.task-wizard-choice-grid--priority,
.task-wizard-choice-grid--category {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-wizard-choice,
.task-wizard-mini-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 14px;
  width: 100%;
  min-height: 96px;
  margin: 0;
  padding: 15px 18px;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(248, 253, 255, 0.98), rgba(240, 250, 255, 0.94));
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.06);
  text-align: left;
  white-space: normal;
  overflow: hidden;
}

.task-wizard-choice:hover,
.task-wizard-mini-card:hover,
.task-wizard-choice.is-selected,
.task-wizard-mini-card.is-selected {
  border-color: rgba(56, 182, 255, 0.52);
  background: rgba(239, 249, 255, 0.96);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.task-wizard-choice > i,
.task-wizard-choice > svg,
.task-wizard-mini-card > i,
.task-wizard-mini-card > svg {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px;
  border-radius: 16px;
  background: rgba(239, 249, 255, 0.9);
}

.task-wizard-choice > i,
.task-wizard-mini-card > i {
  width: 42px;
  height: 42px;
}

.task-wizard-choice svg,
.task-wizard-choice i,
.task-wizard-choice i svg,
.task-wizard-mini-card svg,
.task-wizard-mini-card i,
.task-wizard-mini-card i svg {
  width: 24px;
  height: 24px;
  color: var(--brand-strong);
}

.task-priority-badge {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #38b6ff, #1d9fe3);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(18, 134, 201, 0.18);
}

.task-priority-badge svg,
.task-priority-badge i,
.task-priority-badge i svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
  stroke: #ffffff;
}

.task-priority-badge.priority-low {
  background: linear-gradient(135deg, #9bd7cc, #61b9a8);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(82, 166, 151, 0.18);
}

.task-priority-badge.priority-normal {
  background: linear-gradient(135deg, #58c4ff, #1995d8);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(18, 134, 201, 0.18);
}

.task-priority-badge.priority-high {
  background: linear-gradient(135deg, #ffc861, #f59e0b);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.18);
}

.task-priority-badge.priority-urgent {
  background: linear-gradient(135deg, #ff7a70, #ef4444);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.18);
}

.task-wizard-choice strong,
.task-wizard-mini-card strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.18;
  white-space: normal;
}

.task-wizard-choice > span:not(.task-priority-badge),
.task-wizard-mini-card > span {
  min-width: 0;
  overflow: hidden;
}

.task-wizard-choice small,
.task-wizard-mini-card small,
.task-wizard-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.task-wizard-workspace-list,
.task-wizard-patient-list {
  display: grid;
  gap: 10px;
}

.task-wizard-workspace-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-wizard-mini-card {
  align-items: center;
  min-height: 74px;
}

.task-wizard-patient-picker[hidden] {
  display: none;
}

.task-wizard-patient-list {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.task-wizard-optional-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.task-wizard-help {
  margin: 0;
}

.task-wizard-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.page-section-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 2px 2px;
}

.page-section-hero h1,
.page-section-hero h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(42px, 8vw, 72px);
  line-height: 0.98;
  text-shadow: 0 14px 34px rgba(20, 43, 76, 0.13);
}

.page-section-hero p {
  max-width: 680px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  line-height: 1.45;
  text-shadow: 0 2px 14px rgba(20, 43, 76, 0.12);
}

.page-hero-action {
  flex: 0 0 auto;
}

.listing-panel,
.insight-card {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.page-control-panel {
  padding: 4px 2px 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.page-control-panel h2 {
  color: #ffffff;
  font-size: clamp(38px, 7vw, 64px);
  line-height: 0.98;
  text-shadow: 0 14px 34px rgba(20, 43, 76, 0.13);
}

.page-control-panel > .row:first-child .muted {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 2px 14px rgba(20, 43, 76, 0.12);
}

.page-control-panel > .row:first-child {
  align-items: flex-end;
}

.page-control-panel > form,
.page-control-panel > details {
  padding: 14px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.inline-filter-panel {
  margin-top: 14px;
}

.smart-filter-panel {
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
  backdrop-filter: blur(14px);
}

.smart-filter-panel summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 18px;
  color: var(--brand-strong);
  background: rgba(239, 249, 255, 0.88);
  cursor: pointer;
  list-style: none;
}

.smart-filter-panel summary::-webkit-details-marker {
  display: none;
}

.smart-filter-panel summary svg,
.smart-filter-panel summary i,
.smart-filter-panel summary i svg {
  width: 19px;
  height: 19px;
}

.smart-filter-content {
  display: grid;
  gap: 12px;
  padding: 12px 8px 8px;
}

.smart-filter-panel > form {
  margin-top: 12px;
  padding: 8px;
}

.smart-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.smart-filter-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nested-filter-panel {
  padding-top: 2px;
}

.nested-filter-panel summary {
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
}

.nested-filter-panel summary::-webkit-details-marker {
  display: none;
}

.nested-filter-panel form {
  margin-top: 10px;
}

.billing-page-hero {
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  max-width: none;
  gap: 16px;
}

.billing-page-hero > .row:first-child {
  align-items: flex-end;
}

.billing-page-hero > * {
  width: 100%;
}

.billing-page-hero h2 {
  color: #ffffff;
  font-size: clamp(42px, 8vw, 72px);
  line-height: 0.98;
  text-shadow: 0 14px 34px rgba(20, 43, 76, 0.13);
}

.billing-filter-shell {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
  backdrop-filter: blur(14px);
}

.payments-page-hero {
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  max-width: none;
}

.payments-page-hero > .row:first-child {
  align-items: flex-end;
}

.payments-filter-shell {
  display: grid;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
  backdrop-filter: blur(14px);
}

.payments-simple-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-start;
  gap: 12px;
}

.payments-simple-filter > div:first-child {
  flex: 0 0 160px;
}

.payments-simple-filter > div:nth-child(2) {
  flex: 0 0 190px;
}

.payments-simple-filter > .payments-workspace-filter {
  flex: 0 1 260px;
  align-self: end;
}

.payments-simple-filter select {
  width: 100%;
}

.payments-simple-filter > button[type="submit"] {
  display: none;
}

.workspace-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.workspace-tag svg {
  width: 13px;
  height: 13px;
}

.billing-period-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-start;
  gap: 12px;
}

.billing-period-filter > div:first-child {
  flex: 0 0 220px;
}

.billing-period-filter > div:nth-child(2) {
  flex: 0 0 120px;
}

.billing-period-filter > .billing-page-workspace-filter {
  flex: 0 1 260px;
  align-self: end;
}

.billing-period-filter select,
.billing-period-filter input {
  width: 100%;
}

.billing-period-filter > button[type="submit"] {
  display: none;
}

.billing-period-filter > .billing-current-month {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 999px;
  background: rgba(239, 249, 255, 0.88);
  color: var(--brand-strong);
  font-weight: 780;
  text-decoration: none;
}

.billing-summary-panel {
  background: rgba(255, 255, 255, 0.62);
}

.payments-summary-panel {
  background: rgba(255, 255, 255, 0.62);
}

.billing-summary-panel > summary.billing-summary-toggle,
.payments-summary-panel > summary.billing-summary-toggle {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 72px;
  gap: 3px;
  padding: 10px 16px;
  text-align: center;
}

.billing-summary-toggle-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.billing-summary-toggle-main svg,
.billing-summary-toggle-main i,
.billing-summary-toggle-main i svg {
  width: 20px;
  height: 20px;
}

.billing-summary-arrow {
  width: 17px;
  height: 17px;
  color: var(--brand-strong);
}

.billing-summary-label-open,
.billing-summary-arrow-up {
  display: none;
}

.billing-summary-panel[open] .billing-summary-label-closed,
.billing-summary-panel[open] .billing-summary-arrow-down {
  display: none;
}

.billing-summary-panel[open] .billing-summary-label-open,
.billing-summary-panel[open] .billing-summary-arrow-up {
  display: block;
}

.billing-summary-content {
  display: grid;
  gap: 14px;
  padding: 12px 8px 8px;
}

.billing-listing-panel {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
}

.billing-consultations-report {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
}

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

.billing-report-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) auto minmax(360px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(215, 230, 242, 0.82);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 10px 26px rgba(20, 43, 76, 0.06);
}

.billing-hero-actions,
.billing-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.billing-report-actions form { margin: 0; }

.billing-batch-page { display: grid; gap: 18px; }
.billing-batch-hero { display: grid; gap: 16px; color: #ffffff; }
.billing-batch-hero .btn { justify-self: start; }
.billing-batch-hero span { font-size: 13px; font-weight: 800; opacity: 0.86; }
.billing-batch-hero h1 { margin: 5px 0 0; font-size: 48px; line-height: 1.02; }
.billing-batch-hero p { margin: 8px 0 0; font-weight: 500; opacity: 0.9; }
.billing-batch-stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.billing-batch-stepper > span {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.58); border-radius: 14px;
  background: rgba(255, 255, 255, 0.52); color: #527087; font-size: 13px; font-weight: 760;
}
.billing-batch-stepper b {
  display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%;
  background: rgba(225, 241, 250, 0.9); color: #228fc8;
}
.billing-batch-stepper > span.active { background: rgba(244, 251, 255, 0.9); color: #086fa8; }
.billing-batch-stepper > span.active b { background: #38b6ff; color: #ffffff; }
.billing-batch-form { display: grid; gap: 16px; }
.billing-batch-step {
  display: none; padding: 20px; border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 22px; background: rgba(244, 251, 255, 0.72);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08); backdrop-filter: blur(14px);
}
.billing-batch-step.is-active { display: grid; gap: 20px; }
.billing-batch-section-heading, .billing-batch-processing-heading {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px;
}
.billing-batch-section-heading h2, .billing-batch-section-heading p,
.billing-batch-processing-heading h2, .billing-batch-processing-heading p,
.billing-batch-review-heading h2, .billing-batch-review-heading p { margin: 0; }
.billing-batch-section-heading p, .billing-batch-processing-heading p,
.billing-batch-review-heading p { margin-top: 4px; color: #61758b; }
.billing-batch-strategy, .billing-batch-operation-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.billing-batch-strategy label, .billing-batch-operation-grid label { position: relative; cursor: pointer; }
.billing-batch-strategy input, .billing-batch-operation-grid input { position: absolute; opacity: 0; pointer-events: none; }
.billing-batch-strategy label > span, .billing-batch-operation-grid label > span {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 10px;
  min-height: 104px; padding: 15px; border: 1px solid rgba(174, 214, 236, 0.72);
  border-radius: 16px; background: rgba(255, 255, 255, 0.72);
}
.billing-batch-strategy svg, .billing-batch-operation-grid svg { grid-row: 1 / 3; width: 24px; height: 24px; color: #159bdc; }
.billing-batch-strategy strong, .billing-batch-operation-grid strong,
.billing-batch-strategy small, .billing-batch-operation-grid small { display: block; }
.billing-batch-strategy small, .billing-batch-operation-grid small { color: #65788d; font-weight: 400; }
.billing-batch-strategy label:has(input:checked) > span,
.billing-batch-operation-grid label:has(input:checked) > span {
  border-color: #38b6ff; background: rgba(228, 247, 255, 0.94);
  box-shadow: 0 9px 24px rgba(34, 143, 200, 0.1);
}
.billing-batch-date-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.billing-batch-date-grid label { color: #3e5065; font-size: 13px; font-weight: 760; }
.billing-batch-date-grid input { width: 100%; margin-top: 7px; }
.billing-batch-date-grid small { display: block; margin-top: 5px; color: #6e8092; font-weight: 400; }
.billing-batch-review-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.billing-batch-selection-actions { display: flex; gap: 8px; }
.billing-batch-list { display: grid; gap: 10px; }
.billing-batch-row {
  display: grid; grid-template-columns: auto minmax(210px, 1.25fr) minmax(170px, 0.7fr) minmax(120px, 0.45fr) auto;
  align-items: center; gap: 12px; padding: 14px; border: 1px solid rgba(183, 216, 234, 0.75);
  border-radius: 18px; background: rgba(255, 255, 255, 0.74);
}
.billing-batch-select { cursor: pointer; }
.billing-batch-select input { position: absolute; opacity: 0; }
.billing-batch-select span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #bcd9e9; border-radius: 9px; background: #ffffff; color: transparent; }
.billing-batch-select input:checked + span { border-color: #38b6ff; background: #38b6ff; color: #ffffff; }
.billing-batch-select input:disabled + span { border-color: #d8e3ea; background: #edf2f5; cursor: not-allowed; }
.billing-batch-select svg { width: 18px; height: 18px; }
.billing-batch-patient { display: grid; gap: 4px; min-width: 0; }
.billing-batch-patient small { color: #61758b; font-weight: 450; }
.billing-batch-origin { justify-self: start; padding: 3px 7px; border-radius: 999px; background: #e9f7ff; color: #087fbf; font-size: 11px; font-weight: 760; }
.billing-batch-origin.is-warning { background: #fff3cf; color: #936000; }
.billing-batch-service, .billing-batch-amount { color: #46596d; font-size: 12px; font-weight: 760; }
.billing-batch-service select, .billing-batch-amount input { width: 100%; margin-top: 5px; }
.billing-batch-amount { position: relative; }
.billing-batch-amount span { position: absolute; right: 12px; bottom: 12px; color: #688095; }
.billing-batch-existing { display: flex; align-items: center; gap: 9px; color: #15794b; }
.billing-batch-existing svg { width: 24px; height: 24px; flex: 0 0 auto; }
.billing-batch-existing strong, .billing-batch-existing small { display: block; }
.billing-batch-existing small { margin-top: 3px; color: #687c8f; font-weight: 400; }
.billing-batch-capabilities { display: grid; gap: 5px; justify-items: start; }
.billing-batch-capabilities span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 760; }
.billing-batch-capabilities svg { width: 15px; height: 15px; }
.billing-batch-capabilities .is-ok { color: #167b4c; }
.billing-batch-capabilities .is-missing { color: #78899a; }
.billing-batch-capabilities .is-warning { color: #976000; }
.billing-batch-row-result { grid-column: 2 / -1; padding: 8px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.billing-batch-row-result.is-working { background: #eaf7ff; color: #087fbf; }
.billing-batch-row-result.is-ok { background: #e9f9f0; color: #15794b; }
.billing-batch-row-result.is-error { background: #fff0f1; color: #b43743; }
.billing-batch-progress { height: 12px; overflow: hidden; border-radius: 999px; background: rgba(202, 225, 238, 0.75); }
.billing-batch-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: #38b6ff; transition: width 180ms ease; }
.billing-batch-progress-count { color: #52697f; font-size: 13px; font-weight: 760; text-align: center; }
.billing-batch-final-actions, .billing-batch-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.billing-batch-actions {
  position: sticky; bottom: 10px; z-index: 5; padding: 11px; border: 1px solid rgba(181, 216, 235, 0.7);
  border-radius: 16px; background: rgba(249, 253, 255, 0.94); box-shadow: 0 12px 30px rgba(30, 81, 108, 0.13); backdrop-filter: blur(12px);
}

.billing-report-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.billing-report-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.billing-report-dates span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(239, 249, 255, 0.88);
  color: rgba(40, 91, 121, 0.82);
  font-size: 12px;
  font-weight: 760;
}

.billing-report-count {
  display: grid;
  justify-items: center;
  min-width: 86px;
  padding: 8px 10px;
  border-radius: 18px;
  background: rgba(239, 249, 255, 0.86);
  color: var(--brand-strong);
}

.billing-report-count strong {
  font-size: 22px;
  line-height: 1;
}

.billing-report-count span {
  margin-top: 3px;
  color: rgba(40, 91, 121, 0.72);
  font-size: 11px;
  font-weight: 780;
}

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

.billing-report-status {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 58px;
  padding: 8px 6px;
  border: 1px solid rgba(215, 230, 242, 0.82);
  border-radius: 16px;
  background: rgba(239, 249, 255, 0.82);
  color: rgba(40, 91, 121, 0.74);
  font-size: 11px;
  font-weight: 780;
  text-align: center;
}

.billing-report-status svg,
.billing-report-status i,
.billing-report-status i svg {
  width: 19px;
  height: 19px;
}

.billing-report-status.is-ok {
  border-color: rgba(157, 223, 185, 0.78);
  background: rgba(237, 252, 244, 0.88);
  color: #087443;
}

.billing-report-status.is-missing {
  border-color: rgba(255, 225, 161, 0.78);
  background: rgba(255, 248, 226, 0.88);
  color: #8a5d00;
}

.billing-report-no-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(239, 249, 255, 0.7);
  color: rgba(40, 91, 121, 0.62);
  font-size: 12px;
  font-weight: 780;
}

.payments-listing-panel {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
}

.billing-listing-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 4px 2px 0;
}

.billing-listing-heading h2 {
  margin: 0;
  color: #0f6f9f;
  font-size: 22px;
  font-weight: 780;
  line-height: 1.05;
}

.billing-listing-heading p {
  margin: 6px 0 0;
  color: rgba(40, 91, 121, 0.72);
  font-size: 13px;
  font-weight: 400;
}

.billing-listing-heading > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(215, 230, 242, 0.82);
  border-radius: 999px;
  background: rgba(239, 249, 255, 0.84);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.payments-listing-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.payments-listing-meta span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(215, 230, 242, 0.82);
  border-radius: 999px;
  background: rgba(239, 249, 255, 0.84);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.payments-listing-meta small {
  color: rgba(40, 91, 121, 0.72);
  font-size: 12px;
  font-weight: 400;
}

.listing-panel {
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.09);
}

.listing-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.listing-panel-heading h2 {
  margin: 0;
}

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

.materials-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 2px 2px;
}

.materials-header h2 {
  margin: 8px 0 6px;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.02;
  text-shadow: 0 2px 14px rgba(20, 43, 76, 0.12);
}

.materials-header p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  text-shadow: 0 2px 14px rgba(20, 43, 76, 0.12);
}

.materials-header .btn {
  white-space: nowrap;
}

.materials-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  border: 1px solid rgba(215, 230, 242, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.materials-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 19px;
  color: #5f6b7d;
  font-weight: 840;
  text-decoration: none;
}

.materials-tabs a:hover {
  color: var(--brand-strong);
  background: rgba(239, 249, 255, 0.92);
}

.materials-tabs a.active {
  color: var(--brand-strong);
  background: var(--surface-tint);
}

.materials-tabs svg,
.materials-tabs i,
.materials-tabs i svg {
  width: 21px;
  height: 21px;
}

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

.materials-home-card,
.materials-assigned-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 138px;
  padding: 24px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.10);
  backdrop-filter: blur(14px);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.materials-home-card:hover,
.materials-assigned-strip:hover {
  border-color: rgba(56, 182, 255, 0.36);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 22px 54px rgba(20, 43, 76, 0.13);
  transform: translateY(-2px);
}

.materials-home-card-featured {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 249, 255, 0.88));
}

.materials-home-card strong,
.materials-assigned-strip strong,
.materials-home-card small,
.materials-assigned-strip small {
  display: block;
}

.materials-home-card strong,
.materials-assigned-strip strong {
  font-size: 21px;
  line-height: 1.12;
}

.materials-home-card small,
.materials-assigned-strip small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.materials-home-card > svg:last-child,
.materials-assigned-strip > svg:last-child {
  width: 22px;
  height: 22px;
  color: var(--brand-strong);
}

.materials-assigned-strip {
  min-height: 92px;
  margin-top: 4px;
  background: rgba(239, 249, 255, 0.84);
}

.materials-search-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-sm);
}

.materials-search-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.materials-search-main input {
  min-height: 48px;
  margin: 0;
  border-radius: 18px;
}

.materials-advanced-filters {
  border-top: 1px solid rgba(215, 230, 242, 0.76);
  padding-top: 8px;
}

.materials-advanced-filters summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 840;
  cursor: pointer;
  list-style: none;
}

.materials-advanced-filters summary::-webkit-details-marker {
  display: none;
}

.materials-advanced-filters .materials-filter-grid {
  margin-top: 12px;
}

.source-system {
  color: #0f766e;
  background: #dffaf4;
}

.source-mine {
  color: var(--brand-strong);
  background: var(--surface-tint);
}

.source-imported {
  color: #6d28d9;
  background: #f0e7ff;
}

.source-public {
  color: #8a5a00;
  background: #fff1c7;
}

.material-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--brand-strong);
  background: var(--surface-tint);
  box-shadow: 0 12px 24px rgba(18, 134, 201, 0.10);
}

.material-icon svg,
.material-icon i,
.material-icon i svg {
  width: 22px;
  height: 22px;
}

.patient-material-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.patient-material-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(186, 216, 232, 0.72);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.96), rgba(255, 255, 255, 0.96));
}

.patient-material-card strong,
.patient-material-card small {
  display: block;
}

.patient-material-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.patient-material-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-line;
}

.patient-material-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.patient-material-actions form {
  margin: 0;
}

.material-visible-line {
  align-self: end;
  min-height: 46px;
  margin: 0;
}

.form-help {
  margin: -4px 0 10px;
  font-size: 12px;
  line-height: 1.45;
}

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

.material-wizard-modal {
  max-width: 760px;
}

.material-wizard-progress {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.material-wizard-progress span {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(239, 248, 255, 0.86);
  font-size: 12px;
  font-weight: 840;
}

.material-wizard-progress span.active {
  color: #fff;
  background: var(--brand);
}

.material-wizard-step {
  display: none;
}

.material-wizard-step.is-active {
  display: block;
}

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

.material-choice-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.material-choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 106px;
  padding: 14px;
  border: 1px solid rgba(186, 216, 232, 0.78);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(248, 253, 255, 0.98), rgba(240, 250, 255, 0.94));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.material-choice-card strong,
.material-choice-card small {
  display: block;
}

.material-choice-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.material-choice-card > span:last-child {
  min-width: 0;
}

.material-choice-card.is-selected {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(241, 250, 255, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 14px 30px rgba(56, 182, 255, 0.16);
}

.material-choice-card:hover,
.material-choice-card:focus-visible,
.material-choice-card.is-selected:hover,
.material-choice-card.is-selected:focus-visible,
button.material-choice-card:hover,
button.material-choice-card:focus-visible,
button.material-choice-card.is-selected:hover,
button.material-choice-card.is-selected:focus-visible {
  border-color: rgba(56, 182, 255, 0.56);
  background: linear-gradient(135deg, rgba(241, 250, 255, 0.98), rgba(255, 255, 255, 0.98));
  color: var(--ink);
  box-shadow: 0 16px 32px rgba(56, 182, 255, 0.14);
  transform: translateY(-1px);
}

.material-choice-card:hover small,
.material-choice-card:focus-visible small,
.material-choice-card.is-selected small {
  color: var(--muted);
}

.material-choice-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.material-choice-card.is-disabled:hover,
button.material-choice-card.is-disabled:hover {
  border-color: rgba(186, 216, 232, 0.78);
  background: linear-gradient(135deg, rgba(248, 253, 255, 0.98), rgba(240, 250, 255, 0.94));
  box-shadow: none;
  transform: none;
}

.material-wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.material-wizard-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.material-wizard-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--surface-tint);
  font-size: 12px;
  font-weight: 840;
}

.material-wizard-error {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  color: #9f1239;
  background: #ffe4e6;
  font-size: 12px;
  font-weight: 760;
}

.material-patient-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin: 12px 0 14px;
  padding-right: 4px;
}

.material-patient-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(186, 216, 232, 0.78);
  border-radius: 18px;
  background: rgba(248, 253, 255, 0.96);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.material-patient-card[hidden],
.material-selected-patient[hidden] {
  display: none;
}

.material-patient-card strong,
.material-patient-card small {
  display: block;
}

.material-patient-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.material-patient-card.is-selected {
  border-color: var(--brand);
  background: var(--surface-tint);
}

.material-patient-card:hover,
.material-patient-card:focus-visible,
.material-patient-card.is-selected:hover,
.material-patient-card.is-selected:focus-visible,
button.material-patient-card:hover,
button.material-patient-card:focus-visible,
button.material-patient-card.is-selected:hover,
button.material-patient-card.is-selected:focus-visible {
  border-color: rgba(56, 182, 255, 0.52);
  background: var(--surface-tint);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(56, 182, 255, 0.12);
}

.material-patient-card:hover small,
.material-patient-card:focus-visible small,
.material-patient-card.is-selected small {
  color: var(--muted);
}

.material-patient-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-strong);
  background: #ffffff;
  font-weight: 840;
  box-shadow: var(--shadow-sm);
}

.material-selected-patient {
  display: grid;
  gap: 2px;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface-tint);
  color: var(--brand-strong);
}

.material-selected-patient span {
  font-size: 11px;
  font-weight: 760;
}

.task-priority-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #38b6ff;
  box-shadow: 0 0 0 6px rgba(56, 182, 255, 0.12);
}

.priority-low .task-priority-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 6px rgba(148, 163, 184, 0.14);
}

.priority-high .task-priority-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.16);
}

.priority-urgent .task-priority-dot {
  background: #ef4444;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.15);
}

.task-priority-dot.priority-low {
  background: #94a3b8;
  box-shadow: 0 0 0 6px rgba(148, 163, 184, 0.14);
}

.task-priority-dot.priority-high {
  background: #f59e0b;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.16);
}

.task-priority-dot.priority-urgent {
  background: #ef4444;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.15);
}

.patient-task-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.patient-task-card {
  padding: 12px;
  border: 1px solid rgba(186, 216, 232, 0.72);
  border-radius: 18px;
  background: rgba(239, 248, 255, 0.7);
}

.patient-task-card strong,
.patient-task-card small {
  display: block;
}

.patient-task-card strong {
  color: var(--ink);
  font-size: 14px;
}

.patient-task-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* cards */
.card {
  position: relative;
  min-width: 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 237, 245, 0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.card::before {
  display: none;
}

.content > .billing-page-hero {
  align-self: stretch;
  width: 100%;
}

.content > .billing-filter-shell {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  min-width: 100%;
}

.card.billing-listing-panel {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
}

.card.payments-listing-panel {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
}

/* headings */
h1,
h2 {
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.18;
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 760;
}

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

/* forms */
label {
  display: block;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 720;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  box-shadow: 0 1px 0 rgba(23, 32, 27, 0.02);
}

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

input::placeholder,
textarea::placeholder {
  color: #9aa6a0;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.18);
}

input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-soft);
  color: var(--muted);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0 4px;
}

/* buttons */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 42px;
  margin-top: 0;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), #1d9fe3);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 820;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(18, 134, 201, 0.18);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:hover,
.btn:hover {
  opacity: 1;
  background: linear-gradient(135deg, #58c4ff, #1995d8);
  box-shadow: 0 16px 32px rgba(18, 134, 201, 0.22);
  transform: translateY(-1px);
}

button:active,
.btn:active {
  transform: translateY(0);
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

button.task-wizard-choice,
button.task-wizard-mini-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 14px;
  width: 100%;
  min-height: 96px;
  padding: 15px 18px;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(248, 253, 255, 0.98), rgba(240, 250, 255, 0.94));
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.06);
  text-align: left;
  white-space: normal;
  overflow: hidden;
}

button.task-wizard-choice:hover,
button.task-wizard-mini-card:hover,
button.task-wizard-choice.is-selected,
button.task-wizard-mini-card.is-selected {
  border-color: rgba(56, 182, 255, 0.52);
  background: rgba(239, 249, 255, 0.96);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

button.task-wizard-choice > svg,
button.task-wizard-choice > i,
button.task-wizard-mini-card > svg,
button.task-wizard-mini-card > i {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px;
  border-radius: 16px;
  background: rgba(239, 249, 255, 0.9);
  color: var(--brand-strong);
}

button.task-wizard-choice > svg,
button.task-wizard-choice > i {
  grid-row: 1 / span 2;
}

button.task-wizard-choice > span:not(.task-priority-badge),
button.task-wizard-mini-card > span {
  min-width: 0;
  overflow: hidden;
}

button.task-wizard-choice strong,
button.task-wizard-mini-card strong {
  display: block;
  color: var(--ink);
  white-space: normal;
}

button.task-wizard-choice > strong,
button.task-wizard-choice > small {
  grid-column: 2;
  min-width: 0;
}

button.task-wizard-choice small,
button.task-wizard-mini-card small {
  display: block;
  white-space: normal;
}

button.task-wizard-category-choice {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(248, 253, 255, 0.98), rgba(240, 250, 255, 0.94));
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.06);
  text-align: left;
  white-space: normal;
}

button.task-wizard-category-choice:hover,
button.task-wizard-category-choice.is-selected {
  border-color: rgba(56, 182, 255, 0.52);
  background: rgba(239, 249, 255, 0.96);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

button.task-wizard-category-choice > svg,
button.task-wizard-category-choice > i {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 9px;
  border-radius: 16px;
  background: rgba(239, 249, 255, 0.9);
  color: var(--brand-strong);
}

button.task-wizard-category-choice strong {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.18;
  white-space: normal;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-soft {
  border-color: rgba(215, 230, 242, 0.92);
  background: rgba(239, 249, 255, 0.92);
  color: var(--brand-strong);
  box-shadow: 0 8px 18px rgba(20, 43, 76, 0.05);
}

.btn-soft:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--brand-deep);
  box-shadow: 0 10px 22px rgba(20, 43, 76, 0.08);
}

.btn.danger,
button.danger {
  background: var(--danger);
  box-shadow: 0 8px 18px rgba(180, 35, 24, 0.16);
}

.btn.danger:hover,
button.danger:hover {
  background: #842929;
}

form > button,
form > .btn {
  margin-top: 16px;
}

/* helpers */
.row {
  display: flex;
  min-width: 0;
}

.between {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.link {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

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

/* tags */
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.tag.ok {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tag.ok::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-right: 5px;
  border-radius: 999px;
  background: var(--brand-strong);
  flex: 0 0 auto;
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 10px 10px no-repeat;
  mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 10px 10px no-repeat;
}

.tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag a {
  color: inherit;
  text-decoration: none;
}

.tag a:hover {
  text-decoration: underline;
}

/* patient detail */
.topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.topbar-back:hover {
  background: #ffffff;
}

.patient-profile-card {
  padding: 18px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fbff 100%);
}

.patient-profile-row {
  align-items: center;
}

.patient-profile-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
}

.patient-profile-card .muted {
  margin-top: 8px !important;
  line-height: 1.5;
}

.patient-profile-card .row[style*="gap"] {
  width: auto;
}

.patient-profile-card .row[style*="gap"] .btn:first-child {
  display: none;
}

.patient-profile-card .row[style*="gap"] .btn {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-strong);
  box-shadow: none;
  font-size: 12px;
}

.patient-profile-card .row[style*="gap"] .btn::before {
  content: "Edit";
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 9px;
  font-weight: 900;
}

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

.patient-center-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.patient-avatar {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand), #72d2ff);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(56, 182, 255, 0.18);
  font-size: 24px;
  font-weight: 850;
  text-transform: uppercase;
}

.patient-center-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 820;
}

.patient-center-identity h2 {
  margin: 0;
}

.patient-edit-button {
  gap: 7px;
}

.patient-edit-button svg,
.patient-edit-button i,
.patient-edit-button i svg {
  width: 15px;
  height: 15px;
}

.patient-center-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.patient-center-actions {
  align-self: start;
}

.patient-center-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-sm);
  scrollbar-width: none;
}

.patient-center-tabs::-webkit-scrollbar {
  display: none;
}

.patient-center-tabs button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 13px;
  font-weight: 820;
}

.patient-center-tabs button:hover {
  background: var(--surface-tint);
  color: var(--brand-strong);
  transform: none;
}

.patient-center-tabs button.active {
  background: var(--surface-tint);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px rgba(186, 216, 232, 0.72);
}

.patient-action-feedback {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(103, 197, 245, 0.34);
  border-radius: 999px;
  background: rgba(236, 250, 255, 0.9);
  color: var(--brand-strong);
  box-shadow: 0 14px 28px rgba(56, 182, 255, 0.13);
  font-size: 13px;
  font-weight: 750;
}

.patient-action-feedback::before {
  content: "✓";
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(56, 182, 255, 0.15);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
}

.patient-action-feedback[hidden] {
  display: none;
}

.patient-center-tabs svg,
.patient-center-tabs i,
.patient-center-tabs i svg {
  width: 19px;
  height: 19px;
}

.patient-center [data-patient-panel]:not(.is-active) {
  display: none !important;
}

.legacy-patient-profile {
  display: none !important;
}

.patient-data-panel {
  display: grid;
  gap: 16px;
}

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

.patient-data-actions form {
  margin: 0;
}

.patient-data-action-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 86px;
  padding: 16px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  backdrop-filter: blur(14px);
}

.patient-data-action-card:hover {
  background: rgba(239, 249, 255, 0.92);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.patient-data-action-card.is-disabled {
  opacity: 0.62;
  cursor: not-allowed;
  pointer-events: none;
}

.patient-data-action-icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(239, 249, 255, 0.94);
  color: var(--brand-strong);
  box-shadow: 0 10px 24px rgba(20, 43, 76, 0.06);
}

.patient-data-action-icon svg,
.patient-data-action-icon i,
.patient-data-action-icon i svg {
  width: 24px;
  height: 24px;
}

.patient-data-action-card strong {
  display: block;
  font-size: 17px;
  line-height: 1.15;
}

.patient-data-action-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.patient-data-action-card > svg,
.patient-data-action-card > i,
.patient-data-action-card > i svg {
  width: 20px;
  height: 20px;
  color: var(--brand-strong);
}

.patient-data-card {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px);
}

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

.patient-data-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 820;
}

.patient-data-card-header h2 {
  margin: 8px 0 0;
  color: #0f6f9f;
  font-size: 24px;
  line-height: 1.12;
}

.patient-data-edit {
  gap: 7px;
  white-space: nowrap;
}

.patient-data-edit svg,
.patient-data-edit i,
.patient-data-edit i svg {
  width: 15px;
  height: 15px;
}

.patient-data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.patient-data-grid > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(215, 230, 242, 0.76);
  border-radius: 18px;
  background: rgba(239, 249, 255, 0.68);
}

.patient-data-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.patient-data-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.patient-data-notes {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.patient-data-notes p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(239, 249, 255, 0.56);
  color: var(--ink-soft);
  line-height: 1.45;
}

.patient-data-notes span {
  display: block;
  margin-bottom: 3px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.patient-data-card-compact h3 {
  margin: 8px 0 4px;
  color: #0f6f9f;
  font-size: 18px;
}

.patient-data-card-compact .row.between {
  align-items: flex-start;
  gap: 12px;
}

.patients-list-shell {
  display: grid;
  gap: 18px;
}

.patients-list-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 2px 2px;
}

.patients-list-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(42px, 8vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
  text-shadow: 0 14px 34px rgba(20, 43, 76, 0.13);
}

.patients-list-hero p {
  max-width: 520px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  line-height: 1.45;
}

.patients-new-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-strong);
  font-weight: 780;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(20, 43, 76, 0.12);
  backdrop-filter: blur(12px);
}

.patients-new-button:hover {
  background: rgba(255, 255, 255, 0.88);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.patients-new-button svg,
.patients-new-button i,
.patients-new-button i svg {
  width: 19px;
  height: 19px;
}

.patients-search-panel {
  display: grid;
  gap: 10px;
  margin: 0;
}

.patients-search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.10);
  backdrop-filter: blur(14px);
}

.patients-search-field svg,
.patients-search-field i,
.patients-search-field i svg {
  width: 21px;
  height: 21px;
  color: var(--brand-strong);
}

.patients-search-field input {
  width: 100%;
  min-height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.patients-search-field input:focus {
  outline: none;
  box-shadow: none;
}

.patients-workspace-filter {
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  gap: 9px;
  width: fit-content;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-strong);
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.08);
  backdrop-filter: blur(12px);
}

.patients-workspace-filter svg {
  width: 17px;
  height: 17px;
}

.patients-workspace-filter select {
  min-width: 190px;
  min-height: 40px;
  padding: 0 30px 0 0;
  border: 0;
  background-color: transparent;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 780;
  box-shadow: none;
  cursor: pointer;
}

.patients-workspace-filter select:focus {
  outline: none;
  box-shadow: none;
}

.patients-advanced-filters {
  position: relative;
  padding-top: 0;
}

.patients-advanced-filters summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.08);
}

.patients-advanced-filters summary::-webkit-details-marker {
  display: none;
}

.patients-advanced-filters summary svg,
.patients-advanced-filters summary i,
.patients-advanced-filters summary i svg {
  width: 17px;
  height: 17px;
}

.patients-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
  margin-top: 10px;
  padding: 16px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 38px rgba(20, 43, 76, 0.09);
  backdrop-filter: blur(14px);
}

.patients-filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

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

.patient-list-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 94px;
  padding: 18px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.10);
  backdrop-filter: blur(14px);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.patient-list-card:hover {
  border-color: rgba(56, 182, 255, 0.36);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 22px 54px rgba(20, 43, 76, 0.13);
  transform: translateY(-2px);
}

.patient-list-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-weight: 820;
  box-shadow: 0 12px 24px rgba(20, 43, 76, 0.06);
}

.patient-list-avatar svg,
.patient-list-avatar i,
.patient-list-avatar i svg {
  width: 24px;
  height: 24px;
}

.patient-list-content {
  min-width: 0;
}

.patient-list-name-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.patient-list-card .item-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  font-weight: 740;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-list-card .muted {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px !important;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-workspace-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.patient-workspace-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--workspace-color) 24%, rgba(215, 230, 242, 0.9));
  border-radius: 999px;
  background: color-mix(in srgb, var(--workspace-color) 9%, rgba(255, 255, 255, 0.9));
  color: #516174;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.patient-workspace-badge > span {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--workspace-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--workspace-color) 13%, transparent);
}

.patient-workspace-badge.is-unassigned {
  border-color: rgba(160, 174, 192, 0.3);
  background: rgba(244, 247, 250, 0.88);
  color: var(--muted);
}

.patient-list-card > svg:last-child {
  width: 22px;
  height: 22px;
  color: var(--brand-strong);
}

.patients-empty-state,
.patients-list-grid > .muted {
  padding: 20px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  box-shadow: 0 14px 34px rgba(20, 43, 76, 0.08);
}

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

.patient-entry-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 138px;
  padding: 24px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-family: inherit;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.10);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.patient-entry-card:hover {
  border-color: rgba(56, 182, 255, 0.36);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 22px 54px rgba(20, 43, 76, 0.13);
  transform: translateY(-2px);
}

.patient-entry-card.is-disabled {
  opacity: 0.72;
  cursor: default;
}

.patient-entry-card.is-disabled:hover {
  transform: none;
}

.patient-entry-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--surface-tint);
  color: var(--brand-strong);
}

.patient-entry-icon svg,
.patient-entry-card > svg,
.patient-entry-icon i,
.patient-entry-icon i svg {
  width: 28px;
  height: 28px;
}

.patient-entry-card > svg {
  color: var(--brand-strong);
  width: 22px;
  height: 22px;
}

.patient-entry-copy {
  display: grid;
  gap: 0;
  min-width: 0;
}

.patient-entry-copy small {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

.patient-entry-copy strong {
  display: block;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.12;
}

.icon-badge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.icon-badge-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-tint);
  text-decoration: none;
}

.icon-badge-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* billing cards */
.legacy-billing-table,
.card table.legacy-billing-table {
  display: none !important;
}

.billing-card-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.billing-card-list.compact {
  gap: 10px;
}

.patient-detail-stack .is-extra {
  display: none;
}

.patient-detail-stack .card.is-expanded .is-extra {
  display: revert;
}

.patient-detail-stack .card.is-expanded .billing-record-card.is-extra {
  display: grid;
}

.expand-card-button {
  display: flex;
  width: fit-content;
  min-height: 40px;
  margin: 14px auto 0;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-strong);
  box-shadow: 0 10px 22px rgba(20, 43, 76, 0.10);
  font-size: 12px;
  font-weight: 840;
}

.expand-card-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-tint);
}

.billing-record-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 254, 0.98));
  box-shadow: var(--shadow-sm);
}

.billing-record-card.is-paid {
  border-color: #cfe9d7;
  background:
    linear-gradient(135deg, rgba(247, 253, 249, 0.98), rgba(235, 248, 240, 0.98));
}

.billing-record-card.is-paid .billing-card-amount {
  border-color: #cfe9d7;
  background: #f4fbf6;
  color: #277447;
}

.billing-record-card.is-paid .billing-card-date {
  color: #4f8062;
}

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

.billing-card-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.billing-card-patient {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
}

.billing-card-patient-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.billing-card-patient-link:hover {
  color: var(--brand-strong);
  border-bottom-color: rgba(56, 182, 255, 0.38);
}

.billing-card-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.billing-card-subtitle span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
}

.billing-card-amount {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-strong);
  font-size: 16px;
  font-weight: 820;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.billing-card-value-line {
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 760;
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.payment-status-badge.is-paid {
  border: 1px solid #cfe9d7;
  background: #f4fbf6;
  color: #277447;
}

.payment-status-badge.is-unpaid {
  border: 1px solid #f4dfaa;
  background: var(--warn-soft);
  color: var(--warn);
}

.portal-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-manual-payment-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid #f1dfb7;
  border-radius: 20px;
  background: #fffaf0;
  box-shadow: var(--shadow-sm);
}

.portal-manual-payment-card[hidden] {
  display: none;
}

.portal-manual-payment-card strong {
  color: var(--ink);
}

.portal-manual-payment-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.portal-payment-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(221, 232, 241, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.portal-payment-copy-row span {
  min-width: 0;
}

.portal-payment-copy-row small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-payment-copy-row strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.3;
}

.portal-payment-copy-row .btn {
  width: 42px;
  min-height: 38px;
  padding: 0;
}

.portal-payment-copy-row .btn svg,
.portal-payment-copy-row .btn i {
  width: 16px;
  height: 16px;
}

.portal-payment-copy-row .btn.is-copied {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.portal-manual-payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.portal-manual-payment-actions form {
  margin: 0;
}

.portal-manual-payment-actions .btn {
  width: 100%;
}

.billing-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.billing-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.billing-card-quick-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-card-quick-actions form {
  margin: 0;
}

.billing-card-quick-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

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

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

.workspace-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 254, 0.98));
  box-shadow: var(--shadow-sm);
}

.workspace-card.is-inactive {
  opacity: 0.72;
}

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

.workspace-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.2;
}

.workspace-card-meta,
.workspace-card-details,
.workspace-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.workspace-card-meta {
  margin-top: 7px;
}

.workspace-card-meta span,
.workspace-card-details span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
}

.workspace-card-details span {
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.workspace-form {
  display: grid;
  gap: 12px;
}

.brevo-pilot-section {
  padding: 24px 0;
  border-top: 1px solid #c5dfeb;
}
.brevo-pilot-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  margin: 0 0 20px;
}
.brevo-pilot-section h2 svg { width: 22px; height: 22px; flex-shrink: 0; }
.brevo-pilot-controls { display: flex; align-items: flex-end; gap: 16px; }
.brevo-pilot-controls > div { flex: 1; min-width: 0; }
.brevo-pilot-controls select { width: 100%; min-width: 0; }
.brevo-pilot-controls .btn { flex-shrink: 0; }
#brevo-pilot-feedback { min-height: 24px; margin: 12px 0 0; overflow-wrap: anywhere; }
#brevo-pilot-feedback[data-result="success"] { color: #16704d; }
#brevo-pilot-feedback[data-result="error"] { color: #a12d35; }
@media (max-width: 600px) {
  .brevo-pilot-controls { flex-direction: column; align-items: stretch; }
  .brevo-pilot-controls .btn { width: 100%; white-space: normal; }
}

.tenant-profile-shell {
  display: grid;
  gap: 22px;
}

.tenant-profile-card {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.success-banner {
  padding: 11px 13px;
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 16px;
  background: rgba(240, 253, 244, 0.86);
  color: #15803d;
  font-size: 13px;
  font-weight: 800;
}

.workspace-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.workspace-color-choice {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
}

.workspace-color-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.workspace-color-choice span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.workspace-color-choice:has(input:checked) {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 4px rgba(56, 182, 255, 0.13);
}

.workspace-color-choice.is-disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.portal-area-picker {
  display: grid;
  gap: 8px;
  margin: 6px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(239, 249, 255, 0.62);
}

.patient-billing-summary {
  background:
    linear-gradient(135deg, rgba(239, 249, 255, 0.96), rgba(255, 255, 255, 0.92));
}

.patient-billing-summary h3 {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 18px;
}

.patient-billing-fields {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(56, 182, 255, 0.18);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(239, 249, 255, 0.82), rgba(255, 255, 255, 0.78));
}

.patient-billing-toggle {
  margin: 0;
  color: var(--brand-strong);
}

.patient-billing-custom-fields {
  display: grid;
  gap: 8px;
}

.patient-billing-custom-fields[hidden] {
  display: none;
}

.fiz-tax-warning {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fff8e8, rgba(255, 255, 255, 0.92));
  color: var(--ink);
}

.fiz-tax-warning strong {
  color: #92400e;
  font-size: 15px;
}

.fiz-tax-warning p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.billing-note-suggestions {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid rgba(215, 230, 242, 0.82);
  border-radius: 18px;
  background: rgba(239, 249, 255, 0.72);
}

.billing-note-suggestions-title {
  color: rgba(40, 91, 121, 0.78);
  font-size: 12px;
  font-weight: 780;
}

.billing-note-suggestions label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.billing-note-suggestions input {
  width: auto;
  margin: 0;
}

.workspace-select-shell {
  padding-top: 26px;
}

.workspace-select-hero h1 {
  font-size: 28px;
}

.workspace-select-form {
  margin: 0;
}

.workspace-select-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.workspace-select-card:hover {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.workspace-inline-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 850;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 760;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

/* calendar */
.calendar-filter-card {
  display: none;
}

.calendar-filter-strip {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 48px;
  margin: 2px 0 -2px;
}

.calendar-filter-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.calendar-filter-details {
  position: relative;
}

.calendar-filter-details summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid rgba(56, 182, 255, 0.16);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-weight: 850;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.calendar-filter-details-compact summary {
  width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.10);
}

.calendar-filter-details-compact summary:hover {
  color: #ffffff;
  background: var(--brand-strong);
}

.calendar-filter-details summary::-webkit-details-marker {
  display: none;
}

.calendar-filter-details summary svg,
.calendar-filter-details summary i,
.calendar-filter-details summary i svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.calendar-filter-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(229, 237, 245, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
}

.calendar-settings-days {
  display: grid;
  gap: 8px;
}

.calendar-weekday-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekday-toggle {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(239, 249, 255, 0.72);
  color: var(--muted);
  cursor: pointer;
}

.calendar-weekday-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calendar-weekday-toggle span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.calendar-weekday-toggle em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.calendar-weekday-toggle:has(input:checked) {
  border-color: rgba(56, 182, 255, 0.34);
  background: rgba(221, 244, 255, 0.96);
  box-shadow: 0 8px 18px rgba(20, 43, 76, 0.08);
}

.calendar-weekday-toggle:has(input:checked) em {
  color: var(--brand-strong);
}

.calendar-week-nav {
  position: sticky;
  top: 78px;
  z-index: 12;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px auto;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.10);
  backdrop-filter: blur(12px);
}

.calendar-week-nav-button,
.calendar-week-nav-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 850;
}

.calendar-week-nav-button {
  width: 38px;
  color: var(--brand-strong);
  background: var(--surface-tint);
  font-size: 24px;
  line-height: 1;
}

.calendar-week-nav-button:hover,
.calendar-week-nav-today:hover {
  color: #ffffff;
  background: var(--brand-strong);
}

.calendar-week-nav-label {
  min-width: 0;
  text-align: center;
}

.calendar-week-nav-label span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.1;
}

.calendar-week-nav-label strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 870;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-week-nav-today {
  padding: 0 12px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 12px;
}

.calendar-shell {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 14px 0;
  isolation: isolate;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.calendar-shell.is-week-swipe-prev {
  transform: translateX(8px);
}

.calendar-shell.is-week-swipe-next {
  transform: translateX(-8px);
}

.calendar-shell.is-week-swipe-prev::after,
.calendar-shell.is-week-swipe-next::after {
  content: "Semana anterior";
  position: fixed;
  top: 50%;
  left: 18px;
  z-index: 1001;
  transform: translateY(-50%);
  padding: 10px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand-strong);
  font-size: 12px;
  font-weight: 860;
  box-shadow: 0 16px 32px rgba(18, 134, 201, 0.22);
  pointer-events: none;
}

.calendar-shell.is-week-swipe-next::after {
  content: "Semana seguinte";
  right: 18px;
  left: auto;
}

.calendar-week-changing .calendar-shell {
  opacity: 0.74;
}

.calendar-shell.is-cross-week-loading {
  opacity: 0.82;
}

.calendar-floating-heads {
  position: fixed;
  z-index: 13;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  pointer-events: none;
}

.calendar-floating-heads[hidden] {
  display: none;
}

.calendar-floating-hours-spacer {
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: transparent;
}

.calendar-floating-days-viewport {
  overflow: hidden;
}

.calendar-floating-days-track {
  display: grid;
  grid-template-columns: repeat(var(--calendar-day-count, 7), minmax(130px, 1fr));
  gap: 10px;
  will-change: transform;
}

.calendar-floating-day-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(229, 237, 245, 0.92);
  border-radius: var(--radius);
  background: rgba(238, 248, 255, 0.96);
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.10);
  backdrop-filter: blur(12px);
}

.calendar-floating-day-head.is-today {
  border-color: rgba(14, 142, 210, 0.72);
  background: linear-gradient(135deg, rgba(56, 182, 255, 0.26), rgba(248, 253, 255, 0.98));
  box-shadow: 0 18px 34px rgba(18, 134, 201, 0.18), inset 0 0 0 2px rgba(56, 182, 255, 0.24);
}

.calendar-floating-day-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.calendar-floating-day-head strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 860;
}

.calendar-hours {
  position: sticky;
  left: 0;
  z-index: 6;
  display: grid;
  grid-template-rows: 48px repeat(14, 56px);
  gap: 0;
  background: #bde8ff;
}

.calendar-corner {
  min-height: 48px;
  background: #bde8ff;
}

.calendar-hour {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  line-height: 1;
  transform: translateY(-1px);
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(var(--calendar-day-count, 7), minmax(130px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-day {
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.calendar-day.is-today {
  border-color: rgba(14, 142, 210, 0.72);
  background: rgba(229, 247, 255, 0.88);
  box-shadow: inset 0 0 0 3px rgba(56, 182, 255, 0.2), 0 18px 36px rgba(18, 134, 201, 0.14);
}

.calendar-day-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-tint);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 8px 14px rgba(45, 80, 108, 0.06);
}

.calendar-day-head.is-today {
  border-color: rgba(14, 142, 210, 0.72);
  background: linear-gradient(135deg, rgba(56, 182, 255, 0.28), rgba(239, 249, 255, 0.98));
  box-shadow: 0 12px 24px rgba(18, 134, 201, 0.14), inset 0 -2px 0 rgba(56, 182, 255, 0.18);
}

.calendar-day-head.is-today span,
.calendar-floating-day-head.is-today span {
  color: var(--brand-strong);
}

.calendar-day-head.is-today strong,
.calendar-floating-day-head.is-today strong {
  color: var(--brand-strong);
}

.calendar-day-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.calendar-day-head strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 860;
}

.calendar-day-body {
  position: relative;
  display: grid;
  grid-template-rows: repeat(14, 56px);
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
}

.calendar-slot {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid rgba(211, 224, 236, 0.72);
}

.calendar-slot-link {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 10px;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.calendar-slot-link:hover {
  background: rgba(56, 182, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(56, 182, 255, 0.18);
}

.calendar-slot.is-drop-target .calendar-slot-link {
  background: rgba(56, 182, 255, 0.14);
  box-shadow: inset 0 0 0 2px rgba(18, 134, 201, 0.24);
}

.calendar-drop-guide {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 5;
  height: 0;
  border-top: 2px solid var(--brand-strong);
  pointer-events: none;
}

.calendar-drop-guide-label {
  position: absolute;
  left: 3px;
  top: -13px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand-strong);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.1;
  box-shadow: 0 8px 18px rgba(18, 134, 201, 0.2);
}

.calendar-events-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.calendar-event {
  position: absolute;
  left: 6px;
  z-index: 3;
  display: block;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--calendar-event-border, #f4dfaa);
  border-radius: 12px;
  background: var(--calendar-event-bg, #fff8e8);
  color: var(--ink-soft);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
  overflow: hidden;
  box-sizing: border-box;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.calendar-event:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.calendar-event-status-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--calendar-status-dot, var(--brand));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.74);
}

.calendar-event.is-dragging,
.calendar-event.is-saving {
  opacity: 0.65;
  cursor: grabbing;
  touch-action: none;
}

.calendar-event-ghost {
  position: fixed !important;
  z-index: 1000 !important;
  left: 0;
  top: 0;
  right: auto !important;
  margin: 0 !important;
  pointer-events: none;
  opacity: 0.88;
  transform: scale(1.02);
  box-shadow: 0 18px 36px rgba(20, 43, 76, 0.2);
}

.calendar-drag-active,
.calendar-drag-active * {
  cursor: grabbing !important;
  user-select: none !important;
}

.calendar-drag-active .calendar-event {
  opacity: 0.28;
  pointer-events: none;
}

.calendar-drag-active .calendar-event.is-dragging {
  opacity: 0.65;
}

.calendar-event.status-done {
  --calendar-status-dot: #22c55e;
}

.calendar-event.status-scheduled {
  --calendar-status-dot: #38b6ff;
}

.calendar-event.status-no_show {
  --calendar-status-dot: #f59e0b;
}

.calendar-event.status-cancelled {
  --calendar-status-dot: #ef4444;
  opacity: 0.72;
}

.calendar-event-time {
  display: block;
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 840;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event-title {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 840;
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-action-modal {
  max-width: 420px;
}

.calendar-action-summary {
  position: relative;
  display: grid;
  gap: 4px;
  margin: 18px 0;
  min-height: 122px;
  padding: 22px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-tint);
}

.calendar-action-summary-links {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.calendar-action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 999px;
  color: var(--brand-strong);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.calendar-action-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.12);
}

.calendar-action-icon-btn svg {
  width: 14px;
  height: 14px;
}

.calendar-action-summary strong {
  padding-right: 76px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.calendar-action-summary span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.calendar-action-summary em {
  width: fit-content;
  margin-top: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: #eef8ff;
  font-style: normal;
  font-size: 12px;
  font-weight: 820;
}

.calendar-action-card,
.calendar-video-card {
  margin: -2px 0 14px;
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: 20px;
  background: rgba(239, 248, 255, 0.78);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.08);
  overflow: hidden;
}

.calendar-action-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
}

.calendar-action-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.11);
}

.calendar-action-card strong,
.calendar-action-card small {
  display: block;
}

.calendar-action-card strong {
  font-size: 13px;
  font-weight: 850;
}

.calendar-action-card small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.calendar-action-card > svg:last-child {
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
}

.calendar-video-toggle {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.calendar-video-toggle:hover,
.calendar-video-toggle:focus,
.calendar-video-toggle:active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  transform: none;
  outline: none;
}

.calendar-video-card.is-expanded .calendar-video-toggle {
  background: rgba(255, 255, 255, 0.56);
}

.calendar-video-toggle strong,
.calendar-video-toggle small {
  display: block;
}

.calendar-video-toggle strong {
  font-size: 13px;
  font-weight: 850;
}

.calendar-video-toggle small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.calendar-video-toggle > svg:last-child {
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
  transition: transform 0.18s ease;
}

.calendar-video-card.is-expanded .calendar-video-toggle > svg:last-child {
  transform: rotate(180deg);
}

.calendar-action-card-icon,
.calendar-video-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), #79d4ff);
  box-shadow: 0 10px 18px rgba(56, 182, 255, 0.24);
}

.calendar-action-card-icon svg,
.calendar-video-icon svg {
  width: 19px;
  height: 19px;
}

.calendar-video-options {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
}

.calendar-video-options[hidden] {
  display: none;
}

.calendar-video-options form {
  margin: 0;
}

.calendar-video-options .btn {
  width: 100%;
}

.calendar-video-options .btn svg {
  width: 15px;
  height: 15px;
}

.calendar-status-section {
  display: grid;
  gap: 7px;
  margin: 2px 0 0;
}

.calendar-status-section p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.calendar-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: center;
  gap: 8px;
  width: min(360px, 100%);
  margin: 0 auto;
}

.calendar-action-grid form {
  width: 100%;
  margin: 0;
}

.calendar-status-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(14, 165, 233, 0.13);
  border-radius: 14px;
  color: var(--brand-strong);
  background: rgba(239, 248, 255, 0.84);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.055);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.calendar-status-button:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.26);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.1);
}

.calendar-status-button:active,
.calendar-status-button:focus {
  transform: none;
  outline: none;
}

.calendar-status-button-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--status-color, var(--brand));
  box-shadow: 0 0 0 4px var(--status-soft-color, rgba(56, 182, 255, 0.14));
}

.calendar-status-button.status-done {
  --status-color: #22c55e;
  --status-soft-color: rgba(34, 197, 94, 0.14);
}

.calendar-status-button.status-scheduled {
  --status-color: #38b6ff;
  --status-soft-color: rgba(56, 182, 255, 0.16);
}

.calendar-status-button.status-no-show {
  --status-color: #f59e0b;
  --status-soft-color: rgba(245, 158, 11, 0.16);
}

.calendar-status-button.status-cancelled {
  --status-color: #ef4444;
  --status-soft-color: rgba(239, 68, 68, 0.14);
}

.calendar-series-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 30, 50, 0.42);
  backdrop-filter: blur(8px);
}

.calendar-series-dialog[hidden] {
  display: none;
}

.calendar-series-dialog-card {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.calendar-series-dialog-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), #79d4ff);
  color: #ffffff;
  font-size: 24px;
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(56, 182, 255, 0.24);
}

.calendar-series-dialog-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
}

.calendar-series-dialog-card p {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.calendar-series-dialog-actions {
  display: grid;
  gap: 10px;
}

.calendar-series-dialog-actions .btn {
  width: 100%;
  min-height: 48px;
}

.calendar-delete-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.calendar-delete-actions form {
  margin: 0;
}

.calendar-delete-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(255, 251, 235, 0.92);
  color: #a16207;
  font-size: 12px;
  font-weight: 780;
}

.calendar-delete-note svg {
  width: 16px;
  height: 16px;
}

.calendar-edit-scope {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(56, 182, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(239, 249, 255, 0.86);
}

.calendar-edit-scope strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.calendar-edit-scope div span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.calendar-edit-scope label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 182, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 780;
  cursor: pointer;
}

.calendar-edit-scope input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.btn.danger-soft,
button.danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.14);
}

.btn.danger-soft:hover,
button.danger-soft:hover {
  border-color: rgba(180, 35, 24, 0.24);
  box-shadow: 0 10px 20px rgba(180, 35, 24, 0.08);
}

.calendar-new-form {
  margin-top: 16px;
}

.calendar-new-step[hidden] {
  display: none;
}

.calendar-patient-picker {
  display: grid;
  gap: 8px;
  max-height: min(360px, 52vh);
  margin-top: 12px;
  overflow: auto;
  padding-right: 2px;
}

.calendar-patient-option {
  width: 100%;
  justify-content: flex-start;
  min-height: 48px;
  padding: 11px 13px;
  border-color: rgba(56, 182, 255, 0.18);
  border-radius: var(--radius-sm);
  background: #f2f9ff;
  color: #0f5f94;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.calendar-patient-option[hidden],
.calendar-patient-empty[hidden] {
  display: none !important;
}

.calendar-patient-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 820;
}

.calendar-workspace-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.calendar-workspace-option em {
  margin-top: 4px;
  color: var(--brand-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.calendar-patient-option:hover,
.calendar-patient-option.is-selected {
  border-color: rgba(56, 182, 255, 0.42);
  background: #e6f5ff;
  color: #0b4e7c;
}

.calendar-patient-empty {
  margin-top: 12px;
}

.calendar-selected-patient {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
}

.calendar-selected-patient span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.calendar-selected-patient strong {
  grid-column: 1;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-selected-patient .btn {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.calendar-repeat-box {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 13px;
  border: 1px solid rgba(56, 182, 255, 0.18);
  border-radius: var(--radius-sm);
  background: #f5fbff;
}

.calendar-repeat-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  cursor: pointer;
}

.calendar-repeat-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.calendar-repeat-toggle span {
  display: grid;
  gap: 3px;
}

.calendar-repeat-toggle strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.calendar-repeat-toggle em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.calendar-repeat-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.7fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(56, 182, 255, 0.16);
}

.calendar-repeat-fields[hidden] {
  display: none;
}

.calendar-native-patient-label {
  display: none;
}

.patient-portal-card {
  background: rgba(255, 255, 255, 0.92);
}

.portal-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.portal-link-box input {
  margin-top: 0;
  font-size: 13px;
}

.patient-portal-body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), rgba(191, 230, 255, 0) 340px),
    var(--bg);
}

.patient-portal-shell {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 108px;
}

.patient-portal-topbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.patient-portal-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 178px;
  margin-bottom: 12px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: var(--portal-logo-bg, #ffffff);
  box-shadow: var(--shadow-md);
}

.patient-portal-logo-card img {
  width: min(340px, 92%);
  max-height: 146px;
  height: auto;
  display: block;
  object-fit: contain;
}

.patient-portal-header {
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fbff 100%);
  box-shadow: var(--shadow-md);
}

.patient-portal-header h1 {
  margin: 12px 0 6px;
  font-size: 24px;
  line-height: 1.08;
}

.patient-portal-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.patient-portal-identity {
  display: inline-flex;
  margin-top: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 820;
}

.patient-portal-mini-header {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-sm);
}

.patient-portal-mini-header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.portal-tabs {
  position: sticky;
  top: 8px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.portal-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.portal-tabs a.active {
  background: var(--ink);
  color: #ffffff;
}

.portal-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(430px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  padding: 8px 6px 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -12px 30px rgba(20, 43, 76, 0.10);
  backdrop-filter: blur(14px);
}

.portal-bottom-nav a,
.portal-bottom-nav .portal-install-button {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-decoration: none;
}

.portal-bottom-nav .portal-install-button {
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.portal-bottom-nav .portal-install-button[hidden] {
  display: none;
}

.portal-bottom-nav .portal-install-button:hover {
  background: var(--surface-tint);
  color: var(--brand-strong);
}

.portal-bottom-nav a.active {
  background: var(--surface-tint);
  color: var(--brand-strong);
}

.portal-bottom-nav svg,
.portal-bottom-nav i,
.portal-bottom-nav i svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-bottom-nav a.active svg,
.portal-bottom-nav a.active i svg {
  stroke-width: 2.8;
}

.portal-install-dialog {
  width: min(360px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(20, 43, 76, 0.24);
}

.portal-install-dialog::backdrop {
  background: rgba(20, 43, 76, 0.48);
  backdrop-filter: blur(3px);
}

.portal-install-dialog form {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 24px 24px;
  text-align: center;
}

.portal-install-dialog h2,
.portal-install-dialog p {
  margin: 0;
}

.portal-install-dialog p {
  color: var(--muted);
  line-height: 1.55;
}

.portal-install-dialog-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 18px;
  color: var(--brand-strong);
  background: var(--surface-tint);
}

.portal-install-dialog-icon svg {
  width: 28px;
  height: 28px;
}

.portal-install-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.portal-install-dialog-close:hover {
  background: var(--surface-tint);
}

.portal-install-dialog-close svg {
  width: 20px;
  height: 20px;
}

.patient-portal-section {
  scroll-margin-top: 76px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(229, 237, 245, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
}

.payment-result-card {
  display: grid;
  gap: 14px;
  text-align: left;
}

.payment-result-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.18;
}

.payment-result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.patient-portal-home {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.portal-home-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(229, 237, 245, 0.96);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.portal-home-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.portal-home-card .action-content {
  min-width: 0;
}

.portal-home-card .action-arrow {
  grid-column: 3;
  justify-self: end;
  align-self: center;
  line-height: 1;
}

.portal-home-card .action-pill {
  grid-column: 2 / 4;
  justify-self: start;
  margin-top: 2px;
}

.patient-portal-section .patient-portal-billing-list .is-extra {
  display: none;
}

.patient-portal-section.is-expanded .patient-portal-billing-list .is-extra {
  display: grid;
}

.patient-portal-section .expand-card-button {
  display: flex;
  width: fit-content;
  min-height: 40px;
  margin: 14px auto 0;
  padding: 9px 16px;
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--brand-strong);
  font-weight: 840;
  box-shadow: 0 10px 22px rgba(20, 43, 76, 0.10);
}

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

.portal-material-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(186, 216, 232, 0.72);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 252, 242, 0.98), rgba(248, 253, 255, 0.96));
  box-shadow: 0 12px 28px rgba(36, 112, 157, 0.10);
}

.portal-material-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #38b6ff, #60c9f5);
  box-shadow: 0 16px 28px rgba(56, 182, 255, 0.18);
}

.portal-material-icon svg,
.portal-material-icon i,
.portal-material-icon i svg {
  width: 28px;
  height: 28px;
}

.portal-material-content h3 {
  margin: 4px 0 6px;
  font-size: 19px;
  line-height: 1.2;
}

.portal-material-content p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-line;
}

.portal-material-instructions {
  margin: 10px 0;
  padding: 12px;
  border-radius: 16px;
  color: var(--ink-soft);
  background: rgba(239, 248, 255, 0.84);
  white-space: pre-line;
}

.portal-exercise-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fbff 100%);
  box-shadow: var(--shadow-md);
}

.portal-exercise-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.portal-exercise-heading h1 {
  margin: 7px 0 6px;
  font-size: 24px;
  line-height: 1.08;
}

.portal-exercise-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.portal-exercise-progress {
  margin: 18px 0;
}

.portal-exercise-step {
  display: none;
}

.portal-exercise-step.is-active {
  display: block;
}

.portal-exercise-step h2 {
  margin: 0 0 6px;
}

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

.emotion-choice {
  display: block;
  margin: 0;
}

.emotion-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.emotion-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(186, 216, 232, 0.78);
  border-radius: 16px;
  background: rgba(248, 253, 255, 0.96);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 820;
}

.emotion-choice input:checked + span {
  border-color: rgba(56, 182, 255, 0.56);
  background: var(--surface-tint);
  box-shadow: 0 10px 22px rgba(56, 182, 255, 0.12);
}

.portal-range {
  padding: 0;
  accent-color: var(--brand);
  box-shadow: none;
}

.portal-exercise-summary {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-tint);
  color: var(--brand-strong);
}

.portal-exercise-summary span {
  color: var(--muted);
  font-size: 13px;
}

.mood-monitor-card {
  background: linear-gradient(145deg, rgba(255, 254, 249, 0.98), rgba(237, 250, 255, 0.98));
}

.mood-scale-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.mood-scale-list label {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 13px;
  border: 1px solid rgba(186, 216, 232, 0.72);
  border-radius: 18px;
  background: rgba(248, 253, 255, 0.82);
}

.mood-scale-list label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 720;
}

.mood-scale-list strong {
  color: var(--brand-strong);
}

.social-presence-card {
  background: linear-gradient(145deg, rgba(250, 254, 255, 0.99), rgba(236, 249, 246, 0.98));
}

.social-presence-intensity {
  margin-top: 18px;
}

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

.social-presence-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 104px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(186, 216, 232, 0.82);
  border-radius: 20px;
  background: rgba(248, 253, 255, 0.92);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.social-presence-choice:has(input:checked) {
  border-color: rgba(56, 182, 255, 0.62);
  background: var(--surface-tint);
  box-shadow: 0 14px 30px rgba(56, 182, 255, 0.13);
}

.social-presence-choice:has(input:focus-visible) {
  outline: 3px solid rgba(56, 182, 255, 0.22);
  outline-offset: 2px;
}

.social-presence-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.social-presence-choice-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #38b6ff;
  color: #ffffff;
}

.social-presence-choice-icon svg {
  width: 23px;
  height: 23px;
}

.social-presence-choice > span:last-child {
  display: grid;
  gap: 4px;
}

.social-presence-choice strong {
  color: var(--ink);
  font-size: 16px;
}

.social-presence-choice small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.social-presence-follow-up {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(186, 216, 232, 0.72);
  border-radius: 20px;
  background: rgba(248, 253, 255, 0.82);
}

.social-presence-follow-up[hidden] {
  display: none;
}

.social-presence-follow-up p {
  margin: -2px 0 5px;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .social-presence-choice-grid {
    grid-template-columns: 1fr;
  }

  .social-presence-choice {
    min-height: 88px;
    padding: 14px;
  }
}

.rhythm-portal-shell,
.recovery-portal-shell {
  display: grid;
  gap: 14px;
}

.rhythm-exercise-card {
  background: linear-gradient(145deg, rgba(253, 255, 251, 0.99), rgba(239, 249, 255, 0.98));
}

.rhythm-step-heading,
.rhythm-subheading,
.recovery-protocol-intro {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rhythm-step-heading > span,
.rhythm-subheading > span,
.recovery-protocol-intro > span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(226, 245, 255, 0.94);
  color: var(--brand-strong);
}

.rhythm-step-heading svg,
.rhythm-subheading svg,
.recovery-protocol-intro svg {
  width: 21px;
  height: 21px;
}

.rhythm-step-heading h2,
.recovery-protocol-intro h2 {
  margin: 0 0 3px;
  font-size: 19px;
}

.rhythm-step-heading p,
.recovery-protocol-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.rhythm-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.rhythm-mode-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 160px;
  margin: 0;
  padding: 17px 12px;
  border: 1px solid rgba(186, 216, 232, 0.78);
  border-radius: 20px;
  background: rgba(249, 253, 255, 0.94);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.rhythm-mode-card:hover {
  transform: translateY(-1px);
}

.rhythm-mode-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 12px 28px rgba(56, 182, 255, 0.13);
}

.rhythm-mode-card.is-difficult:has(input:checked) {
  border-color: #df9f91;
  background: #fff4f0;
}

.rhythm-mode-card.is-normal:has(input:checked) {
  border-color: #dfbd64;
  background: #fff9e8;
}

.rhythm-mode-card.is-good:has(input:checked) {
  border-color: #79bd9a;
  background: #effaf4;
}

.rhythm-mode-card input,
.rhythm-check-card input,
.rhythm-compact-check input,
.recovery-warning-card input,
.recovery-step-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rhythm-mode-card:has(input:focus-visible),
.rhythm-check-card:has(input:focus-visible),
.rhythm-compact-check:has(input:focus-visible),
.recovery-warning-card:has(input:focus-visible),
.recovery-step-card:has(input:focus-visible) {
  outline: 3px solid rgba(56, 182, 255, 0.22);
  outline-offset: 2px;
}

.rhythm-mode-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #38b6ff;
  color: #ffffff;
}

.rhythm-mode-card.is-difficult .rhythm-mode-icon { background: #cf8172; }
.rhythm-mode-card.is-normal .rhythm-mode-icon { background: #d8ac3d; }
.rhythm-mode-card.is-good .rhythm-mode-icon { background: #5cae82; }

.rhythm-mode-icon svg {
  width: 24px;
  height: 24px;
}

.rhythm-mode-card > span:last-child {
  display: grid;
  gap: 5px;
}

.rhythm-mode-card strong {
  color: var(--ink);
  font-size: 16px;
}

.rhythm-mode-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.rhythm-mode-guidance {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(239, 248, 255, 0.82);
}

.rhythm-mode-guidance[hidden],
.rhythm-mode-guidance [hidden] {
  display: none;
}

.rhythm-guidance-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.rhythm-guidance-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.rhythm-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.rhythm-check-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 18px;
  background: rgba(249, 253, 255, 0.92);
  cursor: pointer;
}

.rhythm-check-card:has(input:checked) {
  border-color: rgba(92, 174, 130, 0.72);
  background: #effaf4;
}

.rhythm-check-icon {
  display: inline-flex;
  width: 39px;
  height: 39px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: rgba(226, 245, 255, 0.94);
  color: var(--brand-strong);
}

.rhythm-check-icon svg {
  width: 20px;
  height: 20px;
}

.rhythm-check-card > span:nth-of-type(2) {
  display: grid;
  gap: 3px;
}

.rhythm-check-card strong,
.rhythm-compact-check strong {
  color: var(--ink);
  font-size: 13px;
}

.rhythm-check-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.rhythm-check-mark {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(186, 216, 232, 0.84);
  border-radius: 50%;
  color: transparent;
}

.rhythm-check-mark svg {
  width: 14px;
  height: 14px;
}

.rhythm-check-card:has(input:checked) .rhythm-check-mark {
  border-color: #5cae82;
  background: #5cae82;
  color: #ffffff;
}

.rhythm-weekly-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(186, 216, 232, 0.55);
}

.rhythm-subheading strong,
.rhythm-subheading small {
  display: block;
}

.rhythm-subheading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.rhythm-weekly-grid,
.rhythm-evening-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

.rhythm-compact-check {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(186, 216, 232, 0.7);
  border-radius: 16px;
  background: rgba(249, 253, 255, 0.9);
  cursor: pointer;
}

.rhythm-compact-check:has(input:checked) {
  border-color: rgba(92, 174, 130, 0.65);
  background: #effaf4;
}

.rhythm-compact-check > span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(226, 245, 255, 0.9);
  color: var(--brand-strong);
}

.rhythm-compact-check svg {
  width: 17px;
  height: 17px;
}

.rhythm-compact-check > svg {
  color: rgba(97, 120, 142, 0.35);
}

.rhythm-compact-check:has(input:checked) > svg {
  color: #5cae82;
}

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

.rhythm-reflection-grid label,
.recovery-next-step,
.recovery-note {
  display: grid;
  gap: 7px;
  margin: 0;
}

.rhythm-kind-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #effaf4;
  color: #357858;
  font-size: 12px;
  font-weight: 700;
}

.rhythm-kind-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.recovery-exercise-card {
  background: linear-gradient(145deg, rgba(255, 253, 249, 0.99), rgba(240, 250, 255, 0.98));
}

.recovery-reminders,
.recovery-avoid-card {
  margin-top: 16px;
  border: 1px solid rgba(186, 216, 232, 0.72);
  border-radius: 18px;
  background: rgba(255, 250, 231, 0.74);
}

.recovery-reminders summary,
.recovery-avoid-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
}

.recovery-reminders summary > span,
.recovery-avoid-card summary > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.recovery-reminders summary svg,
.recovery-avoid-card summary svg {
  width: 18px;
  height: 18px;
  color: #b48d2c;
}

.recovery-reminders ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 20px 15px 36px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.4;
}

.recovery-section {
  margin-top: 18px;
}

.recovery-signal-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 18px;
}

.recovery-signal-status.is-calm {
  background: #effaf4;
  color: #357858;
}

.recovery-signal-status.is-alert {
  background: #fff2ec;
  color: #a65443;
}

.recovery-signal-count {
  display: inline-flex;
  width: 39px;
  height: 39px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  font-weight: 850;
}

.recovery-signal-status strong,
.recovery-signal-status small {
  display: block;
}

.recovery-signal-status small {
  margin-top: 2px;
  color: currentColor;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}

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

.recovery-warning-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(220, 188, 177, 0.62);
  border-radius: 16px;
  background: rgba(255, 250, 247, 0.86);
  cursor: pointer;
}

.recovery-warning-card:has(input:checked) {
  border-color: #d48673;
  background: #fff1eb;
}

.recovery-warning-card > span {
  display: inline-flex;
  width: 35px;
  height: 35px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ffffff;
  color: #b26452;
}

.recovery-warning-card svg {
  width: 18px;
  height: 18px;
}

.recovery-warning-card > svg {
  color: transparent;
}

.recovery-warning-card:has(input:checked) > svg {
  color: #b26452;
}

.recovery-warning-card strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
}

.recovery-protocol {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(186, 216, 232, 0.7);
  border-radius: 20px;
  background: rgba(244, 251, 255, 0.76);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.recovery-protocol.is-suggested {
  border-color: rgba(92, 174, 130, 0.7);
  background: #f0faf4;
  box-shadow: 0 14px 30px rgba(72, 142, 104, 0.11);
}

.recovery-step-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.recovery-step-card {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(186, 216, 232, 0.68);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.recovery-step-card:has(input:checked) {
  border-color: rgba(92, 174, 130, 0.66);
  background: #ffffff;
}

.recovery-step-number {
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #79bd9a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.recovery-step-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #effaf4;
  color: #458665;
}

.recovery-step-icon svg,
.recovery-step-card > svg {
  width: 18px;
  height: 18px;
}

.recovery-step-card > span:nth-of-type(3) {
  display: grid;
  gap: 3px;
}

.recovery-step-card strong {
  color: var(--ink);
  font-size: 13px;
}

.recovery-step-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.recovery-step-card > svg {
  color: rgba(97, 120, 142, 0.32);
}

.recovery-step-card:has(input:checked) > svg {
  color: #5cae82;
}

.recovery-next-step {
  margin-top: 14px;
}

.recovery-avoid-card {
  background: rgba(239, 248, 255, 0.76);
}

.recovery-avoid-card summary svg {
  color: var(--brand-strong);
}

.recovery-avoid-card > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 0 14px 14px;
}

.recovery-avoid-card > div span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.3;
}

.recovery-avoid-card > div svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #b26452;
}

.recovery-note {
  margin-top: 16px;
}

.recovery-kind-note {
  background: #fff9e8;
  color: #896c22;
}

@media (max-width: 700px) {
  .rhythm-mode-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rhythm-mode-card {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    min-height: 0;
    align-items: center;
    padding: 13px;
    text-align: left;
  }

  .rhythm-check-grid,
  .rhythm-weekly-grid,
  .rhythm-reflection-grid,
  .recovery-warning-grid,
  .recovery-avoid-card > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .rhythm-check-card,
  .recovery-warning-card {
    padding: 11px;
  }

  .recovery-protocol {
    padding: 13px;
  }

  .recovery-step-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .recovery-step-number {
    display: none;
  }
}

.portal-exercise-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.routine-config-page,
.rhythm-config-page,
.routine-portal-shell {
  display: grid;
  gap: 16px;
}

.rhythm-config-form { display: grid; gap: 18px; }
.rhythm-config-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rhythm-config-choice > label {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px;
  min-height: 92px; padding: 16px; border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 18px; background: rgba(247, 252, 255, 0.84); cursor: pointer;
}
.rhythm-config-choice input { position: absolute; opacity: 0; pointer-events: none; }
.rhythm-config-choice > label:has(input:checked) {
  border-color: #38b6ff; background: rgba(232, 247, 255, 0.96);
  box-shadow: 0 10px 26px rgba(31, 144, 203, 0.12);
}
.rhythm-config-choice strong, .rhythm-config-choice small { display: block; }
.rhythm-config-choice small { margin-top: 4px; color: #607086; font-weight: 400; }
.rhythm-custom-settings { display: grid; gap: 16px; }
.rhythm-config-card {
  padding: 20px; border: 1px solid rgba(14, 165, 233, 0.18); border-radius: 18px;
  background: rgba(242, 250, 255, 0.88); box-shadow: 0 12px 32px rgba(39, 115, 156, 0.08);
}
.rhythm-config-card h2, .rhythm-config-card p { margin: 0; }
.rhythm-config-card p { color: #607086; }
.rhythm-config-card label { color: #35445a; font-size: 0.82rem; font-weight: 700; }
.rhythm-config-card textarea, .rhythm-config-card select { width: 100%; margin-top: 7px; }
.rhythm-config-card textarea { resize: vertical; line-height: 1.55; }
.rhythm-config-columns, .rhythm-config-pair, .rhythm-week-config-grid {
  display: grid; gap: 14px; margin-top: 18px;
}
.rhythm-config-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rhythm-config-pair, .rhythm-week-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rhythm-config-time {
  display: grid; grid-template-columns: auto 1fr minmax(170px, auto); align-items: center; gap: 14px;
}
.rhythm-config-save {
  position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 12px 14px;
  border: 1px solid rgba(14, 165, 233, 0.22); border-radius: 16px;
  background: rgba(250, 253, 255, 0.94); box-shadow: 0 14px 32px rgba(31, 84, 113, 0.14);
  backdrop-filter: blur(12px);
}
.rhythm-config-save > span { display: flex; align-items: center; gap: 8px; color: #52657a; font-size: 0.84rem; }
.rhythm-save-state {
  display: flex; align-items: center; gap: 11px; margin: 0 0 18px; padding: 11px 14px;
  border-radius: 14px; background: rgba(232, 247, 255, 0.86); color: #087bb8;
}
.rhythm-save-state > svg { width: 22px; height: 22px; flex: 0 0 auto; }
.rhythm-save-state strong, .rhythm-save-state small { display: block; }
.rhythm-save-state small { margin-top: 2px; color: #61758b; font-weight: 400; }
.rhythm-save-state.is-saving { opacity: 0.72; }
.rhythm-save-state.is-complete { background: rgba(225, 248, 236, 0.9); color: #17824e; }

.routine-config-hero {
  display: grid;
  gap: 16px;
  color: #ffffff;
}

.routine-config-hero .btn {
  justify-self: start;
}

.routine-config-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 760;
  opacity: 0.88;
}

.routine-config-hero h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.02;
}

.routine-config-hero p {
  max-width: 720px;
  margin: 9px 0 0;
  line-height: 1.45;
  opacity: 0.92;
}

.routine-config-section,
.routine-add-panel {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 38px rgba(20, 43, 76, 0.09);
  backdrop-filter: blur(14px);
}

.routine-config-section {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.routine-section-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.routine-section-heading h2,
.routine-section-heading p {
  margin: 0;
}

.routine-section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

.routine-configured-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 15px;
  border: 1px solid rgba(186, 216, 232, 0.72);
  border-radius: 18px;
  background: rgba(249, 253, 255, 0.9);
}

.routine-configured-item > div > strong,
.routine-configured-item > div > small {
  display: block;
}

.routine-configured-item > div > small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.routine-configured-item > details {
  min-width: 100px;
}

.routine-configured-item > details > summary {
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  cursor: pointer;
}

.routine-configured-item > details[open] {
  grid-column: 1 / -1;
  width: 100%;
}

.routine-configured-item > details[open] > summary {
  margin-bottom: 12px;
}

.routine-configured-item > details > form:last-child {
  margin-top: 12px;
}

.routine-add-panel {
  overflow: hidden;
}

.routine-add-panel > summary,
.routine-history-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 17px;
  list-style: none;
  cursor: pointer;
}

.routine-add-panel > summary::-webkit-details-marker,
.routine-history-card > summary::-webkit-details-marker,
.routine-plan-card > summary::-webkit-details-marker {
  display: none;
}

.routine-add-panel > summary strong,
.routine-add-panel > summary small,
.routine-history-card > summary strong,
.routine-history-card > summary small {
  display: block;
}

.routine-add-panel > summary small,
.routine-history-card > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.routine-add-panel > summary > svg,
.routine-history-card > summary > svg,
.routine-plan-card > summary > svg {
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
  transition: transform 160ms ease;
}

.routine-add-panel[open] > summary > svg,
.routine-history-card[open] > summary > svg,
.routine-plan-card[open] > summary > svg {
  transform: rotate(180deg);
}

.routine-add-content {
  padding: 0 18px 18px;
}

.routine-config-form {
  display: grid;
  gap: 13px;
}

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

.routine-config-fields > div:last-child:nth-child(3) {
  grid-column: 1 / -1;
}

.routine-schedule-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.routine-schedule-mode label,
.routine-period-grid label,
.routine-weekday-grid label {
  margin: 0;
}

.routine-schedule-mode input,
.routine-period-grid input,
.routine-weekday-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.routine-schedule-mode span {
  display: flex;
  min-height: 60px;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 16px;
  color: var(--ink-soft);
  background: rgba(248, 253, 255, 0.84);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  cursor: pointer;
}

.routine-schedule-mode svg {
  width: 19px;
  height: 19px;
  color: var(--brand-strong);
}

.routine-schedule-mode input:checked + span {
  border-color: rgba(56, 182, 255, 0.58);
  background: rgba(229, 247, 255, 0.96);
  box-shadow: 0 9px 20px rgba(56, 182, 255, 0.1);
}

.routine-schedule-panel {
  padding: 13px;
  border: 1px solid rgba(186, 216, 232, 0.62);
  border-radius: 18px;
  background: rgba(247, 252, 255, 0.7);
}

.routine-schedule-panel[hidden] {
  display: none;
}

.routine-period-grid,
.routine-weekday-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.routine-weekday-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.routine-period-grid span,
.routine-weekday-grid span {
  display: grid;
  min-height: 40px;
  place-items: center;
  padding: 7px;
  border: 1px solid rgba(186, 216, 232, 0.68);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 740;
  cursor: pointer;
}

.routine-period-grid input:checked + span,
.routine-weekday-grid input:checked + span {
  border-color: rgba(56, 182, 255, 0.48);
  color: var(--brand-strong);
  background: rgba(226, 245, 255, 0.96);
}

.routine-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.routine-portal-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  color: #ffffff;
}

.routine-portal-heading h1,
.routine-portal-heading p {
  margin: 0;
}

.routine-portal-heading h1 {
  margin-top: 4px;
  font-size: 29px;
  line-height: 1.05;
}

.routine-portal-heading p {
  margin-top: 5px;
  opacity: 0.86;
}

.routine-safety-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid rgba(255, 222, 143, 0.66);
  border-radius: 17px;
  color: #64501c;
  background: rgba(255, 249, 222, 0.92);
  font-size: 12px;
  line-height: 1.45;
}

.routine-safety-note svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.routine-plan-card,
.routine-history-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 13px 30px rgba(20, 43, 76, 0.08);
}

.routine-plan-card > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  list-style: none;
  cursor: pointer;
}

.routine-plan-card > summary strong,
.routine-plan-card > summary small {
  display: block;
}

.routine-plan-card > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.routine-plan-list,
.routine-history-list {
  display: grid;
  gap: 9px;
  padding: 0 16px 16px;
}

.routine-plan-list article,
.routine-history-list > article {
  padding: 13px;
  border: 1px solid rgba(186, 216, 232, 0.62);
  border-radius: 16px;
  background: rgba(248, 253, 255, 0.8);
}

.routine-plan-list strong,
.routine-plan-list span,
.routine-plan-list small {
  display: block;
}

.routine-plan-list span,
.routine-plan-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.routine-today-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(186, 216, 232, 0.72);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 13px 28px rgba(20, 43, 76, 0.08);
  transition: background 160ms ease, border-color 160ms ease;
}

.routine-today-card.is-completed {
  border-color: rgba(126, 196, 151, 0.58);
  background: rgba(233, 249, 239, 0.94);
}

.routine-time-badge {
  display: grid;
  min-width: 58px;
  min-height: 42px;
  place-items: center;
  padding: 7px 9px;
  border-radius: 14px;
  color: var(--brand-strong);
  background: rgba(229, 247, 255, 0.94);
  font-size: 12px;
  font-weight: 820;
  text-align: center;
}

.routine-today-copy strong,
.routine-today-copy span,
.routine-today-copy small {
  display: block;
}

.routine-today-copy span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.routine-today-copy small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.routine-complete-button {
  display: inline-flex;
  min-height: 42px;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid rgba(56, 182, 255, 0.32);
  border-radius: 14px;
  color: var(--brand-strong);
  background: rgba(235, 248, 255, 0.94);
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.routine-complete-button svg {
  width: 19px;
  height: 19px;
}

.is-completed .routine-complete-button {
  border-color: rgba(78, 168, 111, 0.38);
  color: #277a4c;
  background: rgba(213, 242, 224, 0.96);
}

.routine-history-heading,
.routine-history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.routine-history-heading > span {
  color: #277a4c;
  font-size: 12px;
  font-weight: 760;
}

.routine-history-metrics {
  justify-content: flex-start;
  margin-top: 10px;
}

.routine-history-metrics span {
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(236, 247, 253, 0.84);
  font-size: 11px;
}

.routine-history-metrics .is-missed {
  color: #9d4848;
  background: rgba(255, 236, 236, 0.86);
}

.routine-history-list details {
  margin-top: 10px;
}

.routine-history-list details summary {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.routine-history-list ul {
  margin: 9px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
}

.routine-empty-plan {
  text-align: center;
}

.routine-empty-plan .action-icon {
  margin: 0 auto 10px;
}

.routine-empty-plan h1 {
  margin: 0;
}

.routine-empty-plan p {
  margin: 8px 0 0;
  color: var(--muted);
}

.portal-appointments-timeline {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.portal-appointments-timeline::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 15px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(56, 182, 255, 0.58), rgba(56, 182, 255, 0.08));
}

.portal-appointment-card {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
}

.portal-appointment-marker {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 18px;
  z-index: 1;
}

.portal-appointment-marker span {
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(56, 182, 255, 0.15);
}

.portal-appointment-content {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid #f1dfb7;
  border-radius: 22px;
  background: #fffaf0;
  box-shadow: var(--shadow-sm);
}

.portal-appointment-card.is-next .portal-appointment-content {
  border-color: #efd28f;
  background: linear-gradient(135deg, #fffdf7 0%, #fff4d8 100%);
  box-shadow: 0 16px 34px rgba(20, 43, 76, 0.13);
}

.portal-appointment-card.is-next .portal-appointment-marker span {
  width: 18px;
  height: 18px;
  background: var(--brand-strong);
  box-shadow: 0 0 0 6px rgba(56, 182, 255, 0.16);
}

.portal-appointment-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 850;
}

.portal-appointment-date {
  color: var(--ink);
  font-size: 18px;
  font-weight: 880;
  line-height: 1.15;
}

.portal-appointment-time {
  margin-top: 4px;
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 850;
}

.portal-appointment-title {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.35;
}

.portal-appointment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.portal-appointment-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(239, 248, 255, 0.9);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
}

.portal-directions-button {
  width: fit-content;
  margin-bottom: 8px;
  gap: 7px;
}

.portal-directions-button svg,
.portal-directions-button i,
.portal-directions-button i svg {
  width: 15px;
  height: 15px;
}

.portal-checkin-feedback {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.portal-checkin-feedback.is-ok {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.portal-checkin-feedback.is-warn {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.portal-checkin-area {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.portal-checkin-area form {
  margin: 0;
}

.portal-checkin-area .btn {
  width: 100%;
}

.portal-checkin-area p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.portal-checkin-area .btn i,
.portal-checkin-area .btn svg {
  width: 15px;
  height: 15px;
}

.portal-video-confirm {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: rgba(239, 248, 255, 0.92);
}

.portal-video-confirm[hidden] {
  display: none;
}

.portal-video-confirm strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.portal-video-confirm p {
  margin: 0;
}

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

.section-title-row h2 {
  margin: 0;
}

/* tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  background: var(--surface-soft);
}

th:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

th:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(238, 248, 255, 0.75);
}

td .tag + .tag {
  margin-left: 5px;
}

/* list */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: block;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.list-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 24px rgba(20, 43, 76, 0.08);
  transform: translateY(-1px);
}

.item-title {
  margin-bottom: 3px;
  font-weight: 790;
}

/* form grid */
.form-grid {
  display: grid;
  gap: 12px;
}

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

details {
  padding-top: 2px;
}

summary {
  width: fit-content;
  font-weight: 750;
}

/* modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  background: rgba(22, 32, 51, 0.42);
  backdrop-filter: blur(10px);
}

.modal-backdrop .modal {
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  margin-top: 0;
  overflow-y: auto;
  padding: 22px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.modal-backdrop .modal > .row:first-child {
  position: sticky;
  top: -22px;
  z-index: 2;
  margin: -22px -22px 18px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.modal form + form {
  margin-top: 12px;
}

.modal-action-sections {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.modal-action-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.modal-action-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}

.modal-action-heading strong {
  color: var(--ink);
  font-size: 15px;
}

.modal-action-heading span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.modal-payment-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.8fr) auto;
  align-items: end;
  gap: 10px;
}

.modal-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-action-section .modal-action-row + .modal-action-row,
.modal-action-section form + .modal-action-row,
.modal-action-section .modal-payment-grid + .modal-action-row {
  margin-top: 10px;
}

/* home */
.entry-shell {
  width: min(1020px, 100%);
  margin: 0 auto;
  padding: 42px 22px 48px;
}

.entry-app-logo {
  position: relative;
  display: flex;
  justify-content: center;
  width: fit-content;
  margin: 0 0 22px;
  margin-inline: auto;
}

.entry-app-logo img {
  display: block;
  width: min(260px, 62vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(18, 134, 201, 0.10));
}

.entry-app-logo .entry-app-logo-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter:
    brightness(1.8)
    saturate(0.7)
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 10px rgba(104, 211, 255, 0.72));
  opacity: 0;
  clip-path: polygon(-32% 0, -12% 0, -2% 100%, -22% 100%);
  animation: entry-logo-light-sweep 4.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes entry-logo-light-sweep {
  0%, 18% {
    opacity: 0;
    clip-path: polygon(-32% 0, -12% 0, -2% 100%, -22% 100%);
  }

  24% {
    opacity: 0.9;
  }

  54% {
    opacity: 0.9;
  }

  62%, 100% {
    opacity: 0;
    clip-path: polygon(102% 0, 122% 0, 132% 100%, 112% 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-app-logo .entry-app-logo-shine {
    display: none;
    animation: none;
  }
}

.entry-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-bottom: 22px;
  text-align: center;
}

.entry-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 820;
  box-shadow: 0 8px 18px rgba(20, 43, 76, 0.05);
}

.entry-hero h1 {
  max-width: none;
  margin: 0 auto;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.04;
  font-weight: 760;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow:
    0 10px 26px rgba(16, 92, 140, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.16);
}

.entry-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.entry-home-nav {
  display: none;
  justify-content: center;
  margin: 0 auto 18px;
}

.entry-hero--compact {
  margin-bottom: 28px;
}

.entry-hero--compact h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.entry-hero--compact p {
  max-width: 520px;
  margin: 12px auto 0;
  color: rgba(255, 255, 255, 0.88);
}

.entry-agenda-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 132px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(244, 251, 255, 0.84));
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 18px 44px rgba(24, 82, 116, 0.09);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.entry-agenda-card::before,
.entry-module-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--brand);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.entry-agenda-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 182, 255, 0.38);
  box-shadow: 0 24px 56px rgba(18, 134, 201, 0.16);
}

.entry-agenda-card:hover::before,
.entry-module-card:hover::before {
  opacity: 1;
}

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

.entry-module-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 16px;
  min-height: 132px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(244, 251, 255, 0.84));
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 18px 44px rgba(24, 82, 116, 0.09);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.entry-module-card:hover {
  border-color: rgba(56, 182, 255, 0.38);
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(18, 134, 201, 0.16);
}

.entry-module-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), #64d0ff);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(56, 182, 255, 0.2);
}

.entry-module-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-module-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.entry-module-copy strong {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
}

.entry-module-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
  line-height: 1.4;
}

.entry-module-arrow,
.workspace-choice-arrow {
  color: var(--brand-strong);
  font-size: 28px;
  line-height: 1;
}

.entry-module-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  place-items: center;
  transition: background 0.22s ease, transform 0.22s ease;
}

.entry-module-card:hover .entry-module-arrow {
  background: #e5f6ff;
  transform: translate(2px, -2px);
}

.modal-backdrop .modal.workspace-choice-modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    radial-gradient(circle at 82% 82%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(145deg, #b8e7ff 0%, #aee1fb 48%, #9ed8f5 100%);
  box-shadow: 0 28px 70px rgba(20, 43, 76, 0.24);
  color: #ffffff;
}

.modal-backdrop .modal.patient-form-modal {
  width: min(920px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    radial-gradient(circle at 82% 82%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(145deg, #b8e7ff 0%, #aee1fb 48%, #9ed8f5 100%);
  box-shadow: 0 28px 70px rgba(20, 43, 76, 0.24);
}

.modal-backdrop:has(.patient-form-modal) {
  align-items: center;
}

.modal-backdrop .patient-form-modal > .row:first-child {
  top: -24px;
  margin: -24px -24px 18px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.modal-backdrop .patient-form-modal > .row:first-child h2,
.modal-backdrop .patient-form-modal > .row:first-child .link {
  color: #ffffff;
}

.patient-form-modal form {
  padding: 18px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.10);
}

.modal-backdrop .patient-create-wizard-modal {
  width: min(940px, 100%);
}

.patient-create-wizard-header {
  position: sticky;
  top: -24px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -24px -24px 18px;
  padding: 17px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(150, 215, 248, 0.84);
  color: #ffffff;
  backdrop-filter: blur(16px);
}

.patient-create-wizard-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.patient-create-wizard-heading-icon,
.patient-create-wizard-section-heading > span,
.patient-create-consent-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--brand-strong);
}

.patient-create-wizard-heading-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.1);
}

.patient-create-wizard-heading-icon svg {
  width: 23px;
  height: 23px;
}

.patient-create-wizard-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 760;
}

.patient-create-wizard-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 21px;
  line-height: 1.1;
}

.patient-create-wizard-heading p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.35;
}

.patient-create-wizard-header-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.patient-create-wizard-header-actions .btn {
  min-height: 36px;
}

.patient-create-wizard-close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transition: background 0.2s ease, transform 0.2s ease;
}

.patient-create-wizard-close:hover {
  background: rgba(255, 255, 255, 0.36);
  color: #ffffff;
  transform: translateY(-1px);
}

.patient-create-wizard-close svg {
  width: 18px;
  height: 18px;
}

.patient-create-wizard-form {
  display: grid;
  gap: 18px;
}

.patient-create-wizard-progress {
  display: grid;
  grid-template-columns: repeat(var(--patient-wizard-steps, 5), minmax(0, 1fr));
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(196, 222, 237, 0.82);
  border-radius: 18px;
  background: rgba(243, 250, 254, 0.88);
}

.patient-create-wizard-progress button {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 7px 9px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  white-space: normal;
}

.patient-create-wizard-progress button:hover,
.patient-create-wizard-progress button.is-complete {
  background: rgba(255, 255, 255, 0.68);
  color: var(--brand-strong);
}

.patient-create-wizard-progress button.is-active {
  background: #ffffff;
  color: var(--brand-strong);
  box-shadow: 0 8px 20px rgba(20, 43, 76, 0.08);
}

.patient-create-wizard-progress button > span {
  display: inline-flex;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(232, 247, 255, 0.92);
  color: currentColor;
}

.patient-create-wizard-progress button.is-active > span {
  background: var(--brand);
  color: #ffffff;
}

.patient-create-wizard-progress svg {
  width: 17px;
  height: 17px;
}

.patient-create-wizard-progress small {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.patient-create-wizard-progress--dense button {
  min-height: 62px;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
}

.patient-create-wizard-progress--dense button > span {
  width: 29px;
  height: 29px;
  border-radius: 10px;
}

.patient-create-wizard-progress--dense small {
  width: 100%;
  font-size: 9px;
}

.patient-wizard-label-short {
  display: none;
}

.patient-create-wizard-step {
  display: none;
  gap: 18px;
  min-height: 310px;
}

.patient-create-wizard-step.is-active {
  display: grid;
  align-content: start;
}

.patient-create-wizard-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-create-wizard-section-heading > span,
.patient-create-consent-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(232, 247, 255, 0.92);
}

.patient-create-wizard-section-heading svg,
.patient-create-consent-icon svg {
  width: 21px;
  height: 21px;
}

.patient-create-wizard-section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
}

.patient-create-wizard-section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.patient-create-wizard-field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

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

.patient-create-wizard-field label {
  margin: 0;
}

.patient-create-wizard-field input,
.patient-create-wizard-field select,
.patient-create-wizard-field textarea {
  margin: 0;
}

.patient-create-input-with-icon {
  position: relative;
}

.patient-create-input-with-icon > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: var(--brand-strong);
  pointer-events: none;
  transform: translateY(-50%);
}

.patient-create-input-with-icon > input {
  width: 100%;
  padding-left: 42px;
}

.patient-create-input-with-icon--suffix > input {
  padding-right: 42px;
  padding-left: 14px;
}

.patient-create-input-with-icon--suffix > span {
  position: absolute;
  top: 50%;
  right: 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(-50%);
}

.patient-create-workspace-note,
.patient-create-finish-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(186, 216, 232, 0.68);
  border-radius: 14px;
  background: rgba(239, 249, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.patient-create-workspace-note svg,
.patient-create-finish-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--brand-strong);
}

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

.patient-create-workspace-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(186, 216, 232, 0.82);
  border-radius: 16px;
  background: rgba(247, 252, 255, 0.9);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.patient-create-workspace-card:hover {
  border-color: rgba(56, 182, 255, 0.54);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(20, 43, 76, 0.08);
  transform: translateY(-1px);
}

.patient-create-workspace-card:focus-within,
.patient-create-workspace-card:has(input:checked) {
  border-color: var(--brand);
  background: rgba(235, 248, 255, 0.98);
  box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.12);
}

.patient-create-workspace-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.patient-create-workspace-card-icon,
.patient-create-video-card-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(226, 245, 255, 0.94);
  color: var(--brand-strong);
}

.patient-create-workspace-card-icon svg,
.patient-create-video-card-icon svg {
  width: 22px;
  height: 22px;
}

.patient-create-workspace-card-copy {
  min-width: 0;
}

.patient-create-workspace-card-copy strong,
.patient-create-workspace-card-copy small {
  display: block;
}

.patient-create-workspace-card-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-create-workspace-card-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-create-workspace-card-check {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(186, 216, 232, 0.82);
  border-radius: 50%;
  background: #ffffff;
  color: transparent;
}

.patient-create-workspace-card-check svg {
  width: 15px;
  height: 15px;
}

.patient-create-workspace-card:has(input:checked) .patient-create-workspace-card-check {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.patient-create-video-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(248, 253, 255, 0.98), rgba(235, 248, 255, 0.9));
}

.patient-create-video-card .patient-create-wizard-field > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.patient-create-consent-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 13px 15px;
  border: 1px solid rgba(186, 216, 232, 0.74);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(248, 253, 255, 0.96), rgba(239, 249, 255, 0.88));
  cursor: pointer;
}

.patient-create-consent-card > input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.patient-create-consent-card:has(> input:checked) {
  border-color: rgba(56, 182, 255, 0.58);
  background: rgba(232, 247, 255, 0.96);
  box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.08);
}

.patient-create-consent-card strong,
.patient-create-consent-card small {
  display: block;
}

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

.patient-create-consent-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.patient-create-billing-fields {
  display: grid;
  gap: 15px;
}

.patient-create-billing-custom-fields {
  padding-top: 16px;
  border-top: 1px solid rgba(196, 222, 237, 0.72);
}

.patient-edit-portal-options,
.patient-edit-portal-areas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.patient-edit-portal-areas {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(196, 222, 237, 0.72);
}

.patient-edit-active-card {
  margin-top: 14px;
}

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

.billing-create-filter-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.billing-create-filter-button svg {
  width: 17px;
  height: 17px;
}

.billing-create-workspace-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(196, 222, 237, 0.76);
  border-radius: 15px;
  background: rgba(243, 250, 254, 0.78);
}

.billing-create-workspace-filters[hidden] {
  display: none;
}

.billing-create-workspace-filters button {
  min-height: 34px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid rgba(186, 216, 232, 0.82);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.billing-create-workspace-filters button.is-active {
  border-color: rgba(56, 182, 255, 0.58);
  background: rgba(226, 245, 255, 0.98);
  color: var(--brand-strong);
}

.billing-create-patient-feedback {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.billing-create-patient-feedback.is-success {
  color: #177d62;
}

.billing-create-patient-feedback.is-error {
  color: #b43a48;
}

.billing-create-patient-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 236px;
  overflow: auto;
  padding: 2px 4px 2px 2px;
}

.billing-create-patient-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 76px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(186, 216, 232, 0.76);
  border-radius: 15px;
  background: rgba(248, 253, 255, 0.9);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.billing-create-patient-choice:hover,
.billing-create-patient-choice.is-selected {
  border-color: rgba(56, 182, 255, 0.62);
  background: rgba(232, 247, 255, 0.98);
  box-shadow: 0 8px 18px rgba(20, 43, 76, 0.07);
}

.billing-create-patient-choice[hidden] {
  display: none;
}

.billing-create-patient-choice-icon,
.billing-create-patient-card > span:first-child,
.billing-create-service-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: rgba(226, 245, 255, 0.96);
  color: var(--brand-strong);
}

.billing-create-patient-choice-icon svg,
.billing-create-patient-card > span:first-child svg,
.billing-create-service-icon svg {
  width: 20px;
  height: 20px;
}

.billing-create-patient-choice-copy {
  min-width: 0;
}

.billing-create-patient-choice-copy > strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-create-patient-choice-copy > small {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.billing-create-patient-choice-check {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(186, 216, 232, 0.82);
  border-radius: 50%;
  background: #ffffff;
  color: transparent;
}

.billing-create-patient-choice.is-selected .billing-create-patient-choice-check {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.billing-create-patient-choice-check svg {
  width: 14px;
  height: 14px;
}

.billing-create-patient-empty {
  padding: 18px;
  border: 1px dashed rgba(157, 194, 216, 0.86);
  border-radius: 15px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.billing-create-patient-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(56, 182, 255, 0.48);
  border-radius: 16px;
  background: rgba(232, 247, 255, 0.94);
}

.billing-create-patient-card small,
.billing-create-patient-card strong,
.billing-create-patient-card em {
  display: block;
}

.billing-create-patient-card small,
.billing-create-patient-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.billing-create-patient-card strong {
  margin: 2px 0;
  color: var(--ink);
  font-size: 14px;
}

.billing-create-patient-card > svg {
  width: 21px;
  height: 21px;
  color: var(--brand-strong);
}

.billing-create-service-heading {
  display: grid;
  gap: 3px;
  margin-top: 2px;
}

.billing-create-service-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.billing-create-service-heading span {
  color: var(--muted);
  font-size: 11px;
}

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

.billing-create-service-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(186, 216, 232, 0.8);
  border-radius: 16px;
  background: rgba(248, 253, 255, 0.9);
  cursor: pointer;
}

.billing-create-service-card:hover,
.billing-create-service-card.is-selected,
.billing-create-service-card:has(input:checked) {
  border-color: rgba(56, 182, 255, 0.68);
  background: rgba(232, 247, 255, 0.98);
  box-shadow: 0 8px 20px rgba(20, 43, 76, 0.07);
}

.billing-create-service-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.billing-create-service-card strong,
.billing-create-service-card small {
  display: block;
}

.billing-create-service-card strong {
  color: var(--ink);
  font-size: 13px;
}

.billing-create-service-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.billing-create-service-card > em {
  grid-column: 1 / -1;
  color: var(--brand-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.patient-create-wizard-field > small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  line-height: 1.35;
}

.billing-create-amount input {
  color: var(--brand-strong);
  font-size: 18px;
  font-weight: 800;
}

.billing-create-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(196, 222, 237, 0.8);
  border-radius: 17px;
  background: rgba(240, 249, 254, 0.84);
}

.billing-create-summary > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.billing-create-summary span,
.billing-create-summary strong {
  display: flex;
  align-items: center;
}

.billing-create-summary span {
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.billing-create-summary span svg {
  width: 13px;
  height: 13px;
  color: var(--brand-strong);
}

.billing-create-summary strong {
  min-height: 32px;
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
}

.billing-create-advanced {
  overflow: hidden;
  border: 1px solid rgba(196, 222, 237, 0.78);
  border-radius: 16px;
  background: rgba(248, 253, 255, 0.82);
}

.billing-create-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}

.billing-create-advanced > summary::-webkit-details-marker {
  display: none;
}

.billing-create-advanced > summary > span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.billing-create-advanced > summary svg {
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
}

.billing-create-advanced > summary strong,
.billing-create-advanced > summary small {
  display: block;
}

.billing-create-advanced > summary strong {
  color: var(--ink);
  font-size: 12px;
}

.billing-create-advanced > summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.billing-create-advanced[open] > summary > svg {
  transform: rotate(180deg);
}

.billing-create-advanced-body {
  display: grid;
  gap: 13px;
  padding: 0 15px 15px;
  border-top: 1px solid rgba(215, 230, 242, 0.76);
  padding-top: 14px;
}

.patient-create-wizard-footer {
  position: sticky;
  bottom: -18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px -18px -18px;
  padding: 14px 18px 16px;
  border-top: 1px solid rgba(215, 230, 242, 0.86);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.patient-create-wizard-footer .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.patient-create-wizard-footer .btn svg {
  width: 16px;
  height: 16px;
}

.patient-create-wizard-count {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.modal-backdrop:has(.workspace-choice-modal) {
  align-items: center;
}

.workspace-choice-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.workspace-choice-heading h2 {
  max-width: 480px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(30px, 6vw, 44px);
  line-height: 0.98;
  letter-spacing: 0;
  text-shadow: 0 10px 30px rgba(20, 43, 76, 0.10);
}

.workspace-choice-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(20, 43, 76, 0.10);
}

.workspace-choice-close:hover {
  background: rgba(255, 255, 255, 0.38);
  color: #ffffff;
}

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

.workspace-choice-list form {
  margin: 0;
}

.workspace-choice-card {
  width: 100%;
  min-height: 112px;
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: stretch;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(215, 230, 242, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-family: inherit;
  font-weight: 400;
  text-align: left;
  box-shadow: 0 18px 44px rgba(20, 43, 76, 0.10);
  backdrop-filter: blur(14px);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.workspace-choice-card:hover {
  border-color: rgba(56, 182, 255, 0.36);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 22px 54px rgba(20, 43, 76, 0.13);
  transform: translateY(-2px);
}

.workspace-choice-card > span:nth-child(2) {
  display: grid;
  align-content: center;
  gap: 4px;
}

.workspace-choice-card strong,
.workspace-choice-card small {
  display: block;
}

.workspace-choice-card strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.16;
}

.workspace-choice-card small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

.workspace-choice-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  box-shadow: 0 12px 24px rgba(20, 43, 76, 0.06);
}

.workspace-choice-icon svg,
.workspace-choice-icon i,
.workspace-choice-icon i svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-choice-arrow {
  color: var(--brand-strong);
}

.entry-agenda-icon,
.entry-workspace-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--surface-tint);
  color: var(--brand-strong);
}

.entry-agenda-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--brand), #64d0ff);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(56, 182, 255, 0.2);
}

.entry-workspace-mark {
  flex: 0 0 auto;
  align-self: center;
  width: 48px;
  height: 48px;
  border-radius: 17px;
  background: linear-gradient(135deg, #e6f7ff, #ffffff);
  box-shadow:
    inset 0 0 0 1px rgba(184, 224, 246, 0.72),
    0 10px 18px rgba(20, 43, 76, 0.07);
}

.entry-agenda-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-workspace-mark span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--workspace-color) 42%, white);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--workspace-color) 14%, transparent),
    inset 0 0 0 2px rgba(255, 255, 255, 0.72),
    0 7px 14px rgba(20, 43, 76, 0.14);
}

.entry-agenda-copy {
  display: grid;
  gap: 6px;
}

.entry-agenda-copy strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 850;
}

.entry-agenda-copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.entry-agenda-cta,
.entry-workspace-footer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(0, 123, 201, 0.18);
}

.entry-workspaces {
  margin-top: 28px;
}

.entry-section-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.entry-section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.1;
  font-weight: 850;
}

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

.entry-workspace-form {
  margin: 0;
}

.entry-workspace-mobile-form {
  display: none;
}

.entry-workspace-card {
  position: relative;
  width: 100%;
  min-height: 248px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 26px;
  background:
    linear-gradient(135deg, #fbfeff, #eef9ff);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.entry-workspace-top {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  min-height: 86px;
  padding: 10px 112px 10px 10px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(231, 247, 255, 0.74));
  box-shadow:
    0 12px 26px rgba(20, 43, 76, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.entry-workspace-nameplate {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  padding: 2px 2px 2px 0;
}

.entry-workspace-title {
  display: block;
  color: #17466a;
  font-size: 18px;
  line-height: 1.14;
  font-weight: 820;
}

.entry-workspace-subtitle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.entry-workspace-subtitle em {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.entry-workspace-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.entry-workspace-stats span {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(226, 238, 247, 0.92);
  border-radius: 16px;
  background: rgba(243, 251, 255, 0.76);
}

.entry-workspace-stats strong {
  color: var(--brand-strong);
  font-size: 16px;
  line-height: 1.1;
  font-weight: 880;
  white-space: nowrap;
}

.entry-workspace-stats small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 760;
}

.entry-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.entry-workspace-footer,
.entry-workspace-edit {
  border: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.entry-workspace-edit {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(184, 224, 246, 0.72);
}

.entry-workspace-edit svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-workspace-footer:hover,
.entry-workspace-edit:hover {
  transform: translateY(-1px);
}

.entry-workspace-mobile-enter {
  display: none;
}

.entry-create-workspace-card {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(640px, 100%);
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 18px;
  border: 1.5px dashed rgba(0, 123, 201, 0.34);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.36);
  color: var(--brand-strong);
  text-align: left;
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.entry-create-workspace-card--home {
  margin-top: 18px;
}

.entry-create-workspace-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 123, 201, 0.56);
  background: rgba(255, 255, 255, 0.58);
}

.entry-create-workspace-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(236, 248, 255, 0.96);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px rgba(184, 224, 246, 0.76);
}

.entry-create-workspace-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-create-workspace-card strong,
.entry-create-workspace-card small {
  display: block;
}

.entry-create-workspace-card strong {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 850;
}

.entry-create-workspace-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.home-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 32px 22px 44px;
}

.home-hero {
  min-height: auto;
  display: block;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(135deg, #ffffff 0%, #f0fbff 100%);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.home-kicker {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 780;
}

.home-hero h1 {
  max-width: 100%;
  margin: 14px 0 10px;
  color: var(--ink);
  font-size: 36px;
  line-height: 1.08;
  font-weight: 830;
}

.home-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.action-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 24px;
  align-items: center;
  min-height: 108px;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 34px rgba(20, 43, 76, 0.12);
}

.action-card-primary {
  background:
    linear-gradient(135deg, #ffffff 0%, #f0fbff 100%);
}

.action-card-disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

.action-card-disabled:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

.action-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand), #79d4ff);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(56, 182, 255, 0.25);
}

.action-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-icon i,
.action-icon i svg {
  width: 27px;
  height: 27px;
  stroke-width: 2.2;
}

.action-label {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 820;
}

.action-text {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.action-arrow {
  color: var(--brand-strong);
  font-size: 32px;
  font-weight: 300;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* responsive */
@media (max-width: 900px) {
  .page {
    padding: 16px;
  }

  .grid,
  .grid2 {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px;
  }

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

@media (max-width: 700px) {
  .rhythm-config-choice,
  .rhythm-config-columns,
  .rhythm-config-pair,
  .rhythm-week-config-grid,
  .rhythm-config-time {
    grid-template-columns: 1fr;
  }

  .rhythm-config-card { padding: 16px; }
  .rhythm-config-time > .action-icon { display: none; }
  .rhythm-config-save { align-items: stretch; flex-direction: column; bottom: 8px; }
  .rhythm-config-save .btn { width: 100%; }

  .routine-config-hero h1 {
    font-size: 31px;
  }

  .routine-config-section {
    padding: 14px;
  }

  .routine-config-fields,
  .routine-configured-item {
    grid-template-columns: 1fr;
  }

  .routine-configured-item > details,
  .routine-configured-item > details[open] {
    grid-column: 1;
    width: 100%;
  }

  .routine-configured-item > details > summary {
    text-align: left;
  }

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

  .routine-schedule-mode span {
    min-height: 46px;
    justify-content: flex-start;
  }

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

  .routine-weekday-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .routine-today-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .routine-today-card form {
    grid-column: 1 / -1;
  }

  .routine-complete-button {
    width: 100%;
  }

  .routine-portal-heading h1 {
    font-size: 25px;
  }

  body {
    font-size: 14px;
  }

  .topbar {
    position: sticky;
    min-height: auto;
    padding: 10px 12px;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .topbar-left {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .topbar strong {
    min-height: 28px;
  }

  .topbar-right {
    position: absolute;
    top: 10px;
    right: 12px;
  }

  .topbar-right a {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
  }

  .account-menu summary {
    min-height: 34px;
  }

  .account-avatar {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }

  .account-menu-panel {
    position: fixed;
    top: 52px;
    right: 12px;
  }

  .topbar-right a:not([href="/logout"]),
  .topbar-right .workspace-switcher {
    display: none;
  }

  .workspace-switcher summary {
    min-height: 30px;
    max-width: 150px;
    padding: 5px 9px;
    font-size: 12px;
  }

  .workspace-switcher summary span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-switcher-menu {
    position: fixed;
    top: 54px;
    right: 12px;
  }

  .topnav {
    display: none;
  }

  .app-mobile-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px;
    width: 100%;
    margin-top: 2px;
    padding: 5px;
    border: 1px solid rgba(215, 230, 242, 0.92);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
  }

  .app-mobile-nav a {
    display: flex;
    min-width: 0;
    min-height: 58px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 4px;
    border-radius: 18px;
    color: #5f6b7d;
    font-size: 10px;
    font-weight: 820;
    line-height: 1;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  }

  .app-mobile-nav a:hover {
    color: var(--brand-strong);
    background: rgba(239, 249, 255, 0.92);
    transform: translateY(-1px);
  }

  .app-mobile-nav a.active {
    color: var(--brand-strong);
    background: var(--surface-tint);
  }

  .app-mobile-nav a.active svg {
    color: var(--brand-strong);
    stroke-width: 2.8;
  }

  .app-mobile-nav svg,
  .app-mobile-nav i,
  .app-mobile-nav i svg {
    width: 21px;
    height: 21px;
  }

  .page {
    padding: 12px;
  }

  .content {
    gap: 12px;
  }

  .card {
    padding: 15px;
    box-shadow: 0 6px 18px rgba(19, 33, 27, 0.07);
  }

  .task-wizard-header {
    gap: 10px;
  }

  .task-wizard-header-actions {
    gap: 6px;
  }

  .task-wizard-header-actions .btn,
  .task-wizard-header-actions .link {
    padding: 7px 9px;
  }

  .task-wizard-choice-grid,
  .task-wizard-choice-grid--priority,
  .task-wizard-choice-grid--category,
  .task-wizard-workspace-list {
    grid-template-columns: 1fr;
  }

  .task-wizard-choice {
    min-height: 92px;
  }

  .task-wizard-mini-card {
    min-height: 68px;
  }

  .task-wizard-footer {
    flex-direction: column-reverse;
  }

  .task-wizard-footer .btn {
    width: 100%;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 17px;
  }

  .row {
    flex-wrap: wrap;
  }

  .row.between {
    align-items: flex-start;
  }

  .card .row.between > .row {
    width: 100%;
    align-items: stretch;
  }

  .card .row.between > .row .btn,
  .card .row.between > .btn {
    width: 100%;
  }

  .card .row.between > .btn.btn-soft,
  .card .row.between > .row .btn.btn-soft {
    width: auto;
  }

  .calendar-filter-card {
    display: none;
  }

  .calendar-filter-strip {
    min-height: 44px;
    margin: 0 0 -2px;
    padding-right: 2px;
  }

  .calendar-filter-header {
    align-items: flex-start;
  }

  .calendar-filter-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .calendar-filter-actions > .btn,
  .calendar-filter-details summary {
    min-height: 42px;
    padding: 9px 12px;
    white-space: nowrap;
  }

  .calendar-filter-panel {
    right: 0;
    width: min(320px, calc(100vw - 28px));
  }

  .calendar-filter-details-compact summary {
    width: 44px;
    min-height: 44px;
  }

  .calendar-shell {
    grid-template-columns: 34px minmax(760px, 1fr);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    margin-top: 10px;
    scroll-padding-left: 34px;
  }

  .calendar-week-nav {
    top: 136px;
    grid-template-columns: 38px minmax(0, 1fr) 38px auto;
    gap: 6px;
    width: calc(100% - 34px);
    margin: 8px 0 4px 34px;
    padding: 6px;
  }

  .calendar-week-nav-button,
  .calendar-week-nav-today {
    min-height: 36px;
  }

  .calendar-week-nav-button {
    width: 36px;
  }

  .calendar-week-nav-today {
    padding-inline: 10px;
  }

  .calendar-floating-heads {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 26px rgba(20, 43, 76, 0.10);
    backdrop-filter: blur(12px);
  }

  .calendar-floating-hours-spacer {
    display: none;
  }

  .calendar-floating-days-track {
    display: flex;
    gap: 8px;
  }

  .calendar-floating-day-head {
    flex: 0 0 104px;
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 14px;
    box-shadow: none;
  }

  .calendar-floating-day-head span {
    font-size: 11px;
  }

  .calendar-floating-day-head strong {
    font-size: 16px;
  }

  .calendar-hours {
    display: grid;
    grid-template-rows: 48px repeat(14, 56px);
    left: 0;
    width: 34px;
    z-index: 9;
    background: #bde8ff;
  }

  .calendar-corner,
  .calendar-day-head {
    position: static;
  }

  .calendar-corner {
    width: 34px;
    box-shadow: 8px 0 14px rgba(45, 80, 108, 0.06);
  }

  .calendar-hour {
    padding-right: 5px;
    font-size: 10px;
    transform: translateY(0);
  }

  .calendar-week {
    grid-template-columns: repeat(var(--calendar-day-count, 7), minmax(104px, 1fr));
    overflow: visible;
    gap: 8px;
  }

  .calendar-day {
    min-width: 104px;
  }

  .calendar-day-body {
    display: grid;
    grid-template-rows: repeat(14, 56px);
    min-height: auto;
    padding: 0;
  }

  .calendar-slot {
    display: block;
    min-height: 56px;
    padding: 0;
    border-bottom: 1px solid rgba(211, 224, 236, 0.72);
  }

  .calendar-event {
    min-height: auto !important;
    padding: 5px 6px;
  }

  .calendar-event-time {
    font-size: 9px;
  }

  .calendar-event-title {
    font-size: 10px;
  }

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

  .calendar-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  .calendar-controls > .btn[type="submit"] {
    grid-column: 1 / -1;
  }

  .calendar-controls > div {
    width: auto !important;
  }

  .calendar-controls .btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .tasks-hero,
  .task-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .page-section-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-top: 2px;
  }

  .page-section-hero h1,
  .page-section-hero h2,
  .page-control-panel h2 {
    font-size: 44px;
  }

  .page-section-hero p {
    margin-top: 8px;
    font-size: 14px;
  }

  .page-hero-action {
    width: 100%;
  }

  .listing-panel,
  .insight-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
  }

  .page-control-panel > .row:first-child {
    align-items: stretch;
    flex-direction: column;
  }

  .page-control-panel > .row:first-child .btn {
    width: 100%;
  }

  .page-control-panel > form.row {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px !important;
  }

  .page-control-panel > details form.row {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .smart-filter-grid,
  .smart-filter-grid-compact {
    grid-template-columns: 1fr;
  }

  .smart-filter-panel summary {
    width: 100%;
  }

  .billing-page-hero {
    gap: 14px;
  }

  .billing-page-hero > .row:first-child {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-page-hero > .row:first-child .btn {
    width: 100%;
  }

  .billing-period-filter {
    display: grid;
    grid-template-columns: 1fr 0.55fr;
  }

  .payments-simple-filter {
    display: grid;
    grid-template-columns: 1fr;
  }

  .payments-simple-filter > div:first-child,
  .payments-simple-filter > div:nth-child(2) {
    flex: none;
  }

  .payments-simple-filter > .payments-workspace-filter {
    width: 100%;
  }

  .billing-period-filter > div:first-child,
  .billing-period-filter > div:nth-child(2) {
    flex: none;
  }

  .billing-period-filter > .billing-page-workspace-filter {
    grid-column: 1 / -1;
    width: 100%;
  }

  .billing-period-filter > .billing-current-month {
    grid-column: 1 / -1;
    width: 100%;
  }

  .billing-listing-panel {
    padding: 12px;
    border-radius: 24px;
  }

  .billing-consultations-report {
    padding: 12px;
    border-radius: 24px;
  }

  .billing-report-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .billing-report-count {
    justify-items: start;
    width: max-content;
    min-width: 0;
  }

  .billing-report-row > .btn {
    width: 100%;
  }

  .billing-report-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tasks-hero {
    display: grid;
  }

  .tasks-list {
    padding: 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(12px);
  }

  .tasks-quick-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    padding: 6px;
  }

  .tasks-quick-tabs a {
    min-width: 0;
    min-height: 50px;
    flex-direction: column;
    gap: 4px;
    padding: 7px 4px;
    border-radius: 16px;
    font-size: 10px;
    line-height: 1.05;
    white-space: normal;
    text-align: center;
  }

  .tasks-quick-tabs svg,
  .tasks-quick-tabs i,
  .tasks-quick-tabs i svg {
    width: 17px;
    height: 17px;
  }

  .tasks-filter-panel {
    justify-self: start;
    width: auto;
  }

  .tasks-filter-panel summary {
    width: auto;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12px;
  }

  .tasks-filter-grid {
    grid-template-columns: 1fr;
  }

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

  .tasks-search-field {
    grid-column: auto;
  }

  .task-list-detail {
    padding: 12px;
    border-radius: 24px;
  }

  .task-list-detail-header {
    grid-template-columns: 1fr;
  }

  .task-list-detail-header .btn,
  .task-list-detail-header form,
  .task-list-detail-header form .btn {
    width: 100%;
  }

  .patient-task-list-row > form {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .patient-task-list-check {
    grid-column: 1 / -1;
  }

  .patient-task-list-note {
    grid-column: 1 / -1;
  }

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

  .task-list-available-patient > div {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  }

  .task-list-available-patient .btn {
    width: 100%;
  }

  .material-choice-grid {
    grid-template-columns: 1fr;
  }

  .materials-header {
    display: grid;
    gap: 12px;
  }

  .materials-header h2 {
    font-size: 44px;
    line-height: 0.98;
  }

  .materials-header p {
    margin-top: 8px;
    font-size: 14px;
  }

  .materials-header .btn,
  .materials-search-main .btn {
    width: 100%;
  }

  .materials-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
    border-radius: 22px;
  }

  .materials-home-grid {
    grid-template-columns: 1fr;
  }

  .materials-home-card,
  .materials-assigned-strip {
    min-height: 112px;
    padding: 18px;
    border-radius: 24px;
  }

  .materials-home-card strong,
  .materials-assigned-strip strong {
    font-size: 18px;
  }

  .materials-tabs a {
    justify-content: center;
    gap: 5px;
    min-height: 48px;
    padding: 8px 4px;
    border-radius: 17px;
    font-size: 11px;
  }

  .materials-tabs svg,
  .materials-tabs i,
  .materials-tabs i svg {
    width: 18px;
    height: 18px;
  }

  .materials-search-main {
    grid-template-columns: 1fr;
  }

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

  .material-wizard-actions .btn {
    width: 100%;
  }

  .task-card-actions {
    justify-content: stretch;
  }

  .task-card-actions .btn,
  .task-card-actions form {
    width: 100%;
  }

  .patient-data-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .patient-data-action-card {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 78px;
    padding: 12px 8px;
    border-radius: 22px;
    gap: 8px;
    text-align: center;
  }

  .patient-data-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
  }

  .patient-data-action-icon svg,
  .patient-data-action-icon i,
  .patient-data-action-icon i svg {
    width: 20px;
    height: 20px;
  }

  .patient-data-action-card strong {
    font-size: 14px;
  }

  .patient-data-action-card small {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.25;
  }

  .patient-data-action-card > svg,
  .patient-data-action-card > i,
  .patient-data-action-card > i svg {
    display: none;
  }

  .patient-data-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .patient-data-card-header h2 {
    font-size: 22px;
  }

  .patient-data-edit {
    width: fit-content;
  }

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

  .btn,
  button {
    width: 100%;
    min-height: 42px;
    white-space: normal;
  }

  .btn.btn-sm,
  .icon-badge-link,
  .patient-data-edit {
    width: auto;
  }

  form .row {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
  }

  form .row > div {
    width: 100%;
  }

  .card table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .card table th,
  .card table td {
    padding: 10px 9px;
  }

  .list-item {
    padding: 12px;
  }

  .list-item .row.between {
    flex-wrap: nowrap;
    align-items: center;
  }

  .list-item .tag {
    flex: 0 0 auto;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-backdrop .modal {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .modal-backdrop .modal > .row:first-child {
    top: -16px;
    margin: -16px -16px 16px;
    padding: 14px 16px;
  }

  .modal-backdrop .modal.patient-form-modal {
    padding: 16px;
    border-radius: 28px;
  }

  .modal-backdrop .patient-form-modal > .row:first-child {
    top: -16px;
    margin: -16px -16px 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.18);
  }

  .patient-form-modal form {
    padding: 14px;
    border-radius: 22px;
  }

  .patient-create-wizard-header {
    top: -16px;
    gap: 10px;
    margin: -16px -16px 14px;
    padding: 13px 14px;
  }

  .patient-create-wizard-heading {
    gap: 9px;
  }

  .patient-create-wizard-heading-icon {
    width: 39px;
    height: 39px;
    border-radius: 13px;
  }

  .patient-create-wizard-heading-icon svg {
    width: 20px;
    height: 20px;
  }

  .patient-create-wizard-eyebrow,
  .patient-create-wizard-heading p {
    display: none;
  }

  .patient-create-wizard-heading h2 {
    max-width: 145px;
    font-size: 16px;
    line-height: 1.15;
  }

  .patient-create-wizard-header-actions {
    gap: 6px;
  }

  .patient-create-wizard-header-actions .btn {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .patient-create-wizard-close {
    width: 34px;
    height: 34px;
  }

  .patient-create-wizard-form {
    gap: 14px;
  }

  .patient-create-wizard-progress {
    gap: 3px;
    padding: 5px;
    border-radius: 15px;
  }

  .patient-create-wizard-progress button {
    min-height: 50px;
    flex-direction: column;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 11px;
  }

  .patient-create-wizard-progress button > span {
    width: 29px;
    height: 29px;
    border-radius: 10px;
  }

  .patient-create-wizard-progress svg {
    width: 15px;
    height: 15px;
  }

  .patient-create-wizard-progress small {
    display: none;
  }

  .patient-wizard-label-full {
    display: none;
  }

  .patient-wizard-label-short {
    display: none;
  }

  .patient-create-wizard-step {
    min-height: 0;
    gap: 15px;
  }

  .patient-create-wizard-section-heading {
    align-items: flex-start;
  }

  .patient-create-wizard-section-heading > span {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .patient-create-wizard-section-heading h3 {
    font-size: 15px;
  }

  .patient-create-wizard-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .patient-create-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .patient-edit-portal-options,
  .patient-edit-portal-areas {
    grid-template-columns: minmax(0, 1fr);
  }

  .billing-create-patient-tools {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .billing-create-filter-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
    justify-content: center;
  }

  .billing-create-filter-button span {
    display: none;
  }

  .billing-create-patient-list,
  .billing-create-service-grid,
  .billing-create-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .billing-create-patient-list {
    max-height: 245px;
  }

  .billing-create-service-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px;
  }

  .billing-create-service-card > em {
    grid-column: auto;
  }

  .billing-create-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .patient-create-workspace-card {
    padding: 13px;
  }

  .patient-create-video-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .patient-create-wizard-field--wide {
    grid-column: auto;
  }

  .patient-create-consent-card {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 9px;
    padding: 11px 12px;
  }

  .patient-create-consent-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .patient-create-wizard-footer {
    bottom: -14px;
    gap: 7px;
    margin: 0 -14px -14px;
    padding: 12px 14px 14px;
  }

  .patient-create-wizard-footer .btn {
    min-height: 40px;
    padding: 9px 12px;
  }

  .patient-create-wizard-count {
    font-size: 10px;
  }

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

  .modal-action-row {
    align-items: stretch;
  }

  .modal-action-row form {
    width: 100%;
  }

  .entry-shell {
    width: min(430px, 100%);
    padding: 18px 12px 30px;
  }

  .entry-app-logo {
    margin-bottom: 16px;
  }

  .entry-app-logo img {
    width: min(220px, 64vw);
  }

  .entry-hero {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entry-hero h1 {
    font-size: 32px;
  }

  .entry-home-nav {
    display: flex;
    width: 100%;
    margin-bottom: 16px;
  }

  .entry-agenda-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .entry-agenda-cta {
    grid-column: 2;
    justify-self: start;
  }

  .entry-section-heading {
    display: grid;
    justify-content: stretch;
  }

  .entry-workspace-grid {
    grid-template-columns: 1fr;
  }

  .entry-modules {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .entry-module-card {
    min-height: 110px;
    grid-template-columns: 56px minmax(0, 1fr) 28px;
    padding: 19px;
  }

  .entry-workspace-card {
    min-height: 0;
    padding: 16px;
  }

  .entry-workspace-card .entry-workspace-stats,
  .entry-workspace-card .entry-workspace-actions {
    display: none;
  }

  .entry-workspace-mobile-form {
    display: block;
    position: absolute;
    top: 70px;
    right: 28px;
    z-index: 2;
    margin: 0;
  }

  .entry-workspace-mobile-enter {
    display: inline-flex;
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 7px 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-strong), var(--brand));
    color: #ffffff;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 16px rgba(0, 123, 201, 0.16);
    cursor: pointer;
  }

  .entry-workspace-top {
    position: relative;
    z-index: 1;
    min-height: 112px;
  }

  .entry-workspace-edit {
    z-index: 2;
  }

  .entry-workspace-stats {
    grid-template-columns: 1fr;
  }

  .entry-workspace-stats span {
    min-height: 0;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    align-content: center;
  }

  .entry-workspace-footer {
    justify-self: start;
  }

  .entry-workspace-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .patient-center-header {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 14px;
  }

  .patient-avatar {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    font-size: 18px;
  }

  .patient-center-identity h2 {
    font-size: 21px;
    line-height: 1.12;
  }

  .patient-center-identity .muted {
    display: block;
    max-width: 100%;
    margin-top: 5px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.25;
  }

  .patient-center-badges {
    display: none;
  }

  .patient-center-tabs {
    border-radius: 22px;
    gap: 4px;
    padding: 6px;
    scroll-snap-type: none;
  }

  .patient-center-tabs button {
    width: auto !important;
    min-width: 54px;
    max-width: 68px;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 3px;
    padding: 8px 7px;
    font-size: 10px;
    scroll-snap-align: none;
    white-space: nowrap;
  }

  .patient-center-tabs button span {
    display: block;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .patient-center-tabs svg,
  .patient-center-tabs i,
  .patient-center-tabs i svg {
    width: 18px;
    height: 18px;
  }

  .patients-list-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-top: 2px;
  }

  .patients-list-hero h1 {
    font-size: 44px;
  }

  .patients-list-hero p {
    margin-top: 8px;
    font-size: 14px;
  }

  .patients-new-button {
    width: 100%;
    min-height: 48px;
  }

  .patients-search-field {
    min-height: 54px;
    padding-inline: 16px;
    border-radius: 22px;
  }

  .patients-search-field input {
    min-height: 52px;
    font-size: 15px;
  }

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

  .patients-workspace-filter {
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .patients-workspace-filter select {
    width: 100%;
    min-width: 0;
  }

  .patients-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .patient-list-card {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 86px;
    padding: 15px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 24px rgba(20, 43, 76, 0.08);
    backdrop-filter: none;
    transition: border-color 0.16s ease, background 0.16s ease;
  }

  .patient-list-card:hover {
    box-shadow: 0 12px 28px rgba(20, 43, 76, 0.09);
    transform: none;
  }

  .patient-list-avatar {
    display: none;
  }

  .patient-list-card .item-title {
    font-size: 16px;
  }

  .patient-list-card .muted {
    max-width: 100%;
    font-size: 12px !important;
  }

  .patient-workspace-badges {
    margin-top: 8px;
  }

  .patient-list-card .tag {
    margin-left: 8px;
  }

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

  .patient-entry-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    min-height: 112px;
    padding: 18px;
    border-radius: 24px;
  }

  .patient-entry-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }

  .patient-entry-icon svg,
  .patient-entry-card > svg,
  .patient-entry-icon i,
  .patient-entry-icon i svg {
    width: 24px;
    height: 24px;
  }

  .patient-entry-card > svg {
    width: 22px;
    height: 22px;
  }

  .patient-entry-copy strong {
    font-size: 18px;
  }

  .patient-entry-copy small {
    font-size: 14px;
    line-height: 1.35;
  }

  .entry-create-workspace-card {
    justify-content: flex-start;
  }

  .home-shell {
    padding: 12px;
    width: min(430px, 100%);
  }

  .home-hero {
    min-height: auto;
    padding: 22px;
  }

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

  .action-card {
    min-height: 118px;
  }
}

@media (max-width: 430px) {
  .page {
    padding: 10px;
  }

  .card {
    padding: 13px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .tag {
    font-size: 11px;
    padding-inline: 7px;
  }

  .entry-hero h1 {
    font-size: 30px;
  }

  .entry-agenda-card,
  .entry-workspace-card {
    border-radius: 24px;
    padding: 18px;
  }

  .entry-workspace-top {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 112px;
    padding: 9px 96px 9px 9px;
    border-radius: 20px;
  }

  .entry-agenda-card {
    gap: 14px;
  }

  .entry-agenda-copy strong {
    font-size: 20px;
  }

  .entry-workspace-title {
    font-size: 18px;
  }

  .entry-workspace-edit {
    top: 27px;
    right: 28px;
  }

  .entry-workspace-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
  }

  .entry-workspace-stats strong {
    font-size: 14px;
  }

  .home-hero h1 {
    font-size: 28px;
  }

  .action-card {
    grid-template-columns: 70px minmax(0, 1fr) 20px;
    min-height: 122px;
    gap: 14px;
    padding: 18px;
  }

  .action-icon {
    width: 64px;
    height: 64px;
  }

  .action-label {
    margin-bottom: 8px;
    font-size: 19px;
  }

  .action-text {
    font-size: 14px;
    line-height: 1.55;
  }

  .action-arrow {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    line-height: 1;
  }

  .action-pill {
    grid-column: 2 / 4;
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .billing-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .billing-hero-actions .btn { min-width: 0; }
  .billing-report-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .billing-report-actions .btn, .billing-report-actions form { width: 100%; }
  .billing-batch-hero h1 { font-size: 34px; }
  .billing-batch-stepper > span { justify-content: center; min-width: 0; padding: 7px 5px; font-size: 11px; }
  .billing-batch-stepper b { width: 24px; height: 24px; }
  .billing-batch-step { padding: 14px; border-radius: 18px; }
  .billing-batch-strategy, .billing-batch-operation-grid, .billing-batch-date-grid { grid-template-columns: 1fr; }
  .billing-batch-strategy label > span, .billing-batch-operation-grid label > span { min-height: 82px; }
  .billing-batch-review-heading { align-items: stretch; flex-direction: column; }
  .billing-batch-selection-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-batch-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .billing-batch-service, .billing-batch-amount, .billing-batch-existing, .billing-batch-capabilities, .billing-batch-row-result { grid-column: 2; }
  .billing-batch-capabilities { display: flex; flex-wrap: wrap; }
  .billing-batch-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-batch-actions .btn { width: 100%; }
  .billing-batch-actions [data-batch-run] { grid-column: 1 / -1; }
  .billing-batch-final-actions { align-items: stretch; flex-direction: column; }
  .billing-batch-final-actions .btn { width: 100%; }
}

.billing-payment-panel { margin-bottom: 22px; padding: 18px; border: 1px solid #cce5f2; border-radius: 8px; background: #f2faff; }
.billing-payment-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.billing-payment-heading h3 { margin: 0; font-size: 18px; }
.billing-payment-heading > span:first-child { display: grid; place-items: center; width: 32px; height: 32px; color: #008fcc; }
.billing-payment-panel svg { width: 18px; height: 18px; flex-shrink: 0; }
.billing-payment-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.billing-payment-totals dt { font-size: 12px; color: #587184; }
.billing-payment-totals dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.billing-payment-quick { margin-bottom: 12px; }
.billing-payment-details { border-top: 1px solid #cce5f2; padding-top: 12px; margin-top: 12px; }
.billing-payment-details summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; cursor: pointer; font-weight: 600; }
.billing-payment-details summary::after { content: '+'; margin-left: auto; }
.billing-payment-details[open] summary::after { content: '-'; }
.billing-payment-details summary > span { font-size: 12px; font-weight: 400; color: #587184; }
.billing-payment-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.billing-payment-form label { display: flex; flex-direction: column; min-width: 0; gap: 6px; }
.billing-payment-form .is-wide { grid-column: 1 / -1; }
.billing-payment-form > button { justify-self: start; }
.billing-payment-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #cce5f2; }
.billing-payment-entry > div { min-width: 0; overflow-wrap: anywhere; }
.billing-payment-entry small { display: block; margin-top: 4px; font-weight: 400; color: #587184; }
.billing-payment-entry.is-voided strong { text-decoration: line-through; color: #687988; }
.billing-payment-feedback { padding: 10px 12px; border-radius: 6px; background: #e8f8ed; color: #17653b; font-weight: 400; }
.billing-payment-feedback.is-error { background: #fff1f0; color: #983b32; }
.billing-receipt-payment-options { display: grid; gap: 8px; margin: 12px 0; }
.billing-receipt-payment-options label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.billing-receipt-payment-options input[type="checkbox"] { width: auto; flex-shrink: 0; }
:is(.billing-invoice-details, .billing-action-panel) { margin-bottom: 22px; border: 1px solid #cce5f2; border-radius: 8px; background: #f2faff; }
:is(.billing-invoice-details, .billing-action-panel) > summary { display: flex; align-items: center; gap: 10px; width: 100%; padding: 18px; cursor: pointer; list-style: none; }
:is(.billing-invoice-details, .billing-action-panel) > summary::-webkit-details-marker { display: none; }
.billing-invoice-details-icon, .billing-panel-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; color: #008fcc; }
.billing-invoice-details-title, .billing-panel-title { min-width: 0; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.billing-invoice-details > summary svg, .billing-action-panel svg { width: 18px; height: 18px; flex-shrink: 0; }
:is(.billing-invoice-details, .billing-action-panel) > summary :is(.billing-invoice-details-chevron, .billing-panel-chevron) { margin-left: auto; color: #008fcc; transition: transform 160ms ease; }
:is(.billing-invoice-details, .billing-action-panel)[open] > summary :is(.billing-invoice-details-chevron, .billing-panel-chevron) { transform: rotate(180deg); }
:is(.billing-invoice-details, .billing-action-panel) > summary:focus-visible { outline: 2px solid #008fcc; outline-offset: 3px; border-radius: 8px; }
.billing-invoice-details-body { padding: 0 18px 18px; border-top: 1px solid #cce5f2; }
.billing-invoice-details-body > form + form { margin-top: 14px; }
.billing-panel-body { padding: 18px; border-top: 1px solid #cce5f2; }
.billing-panel-body > .modal-payment-grid { margin: 0; }
.billing-action-panel:last-of-type { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
  :is(.billing-invoice-details, .billing-action-panel) > summary :is(.billing-invoice-details-chevron, .billing-panel-chevron) { transition: none; }
}
@media (max-width: 600px) {
  .billing-payment-panel { padding: 12px; }
  :is(.billing-invoice-details, .billing-action-panel) > summary { padding: 12px; }
  .billing-invoice-details-body { padding: 0 12px 12px; }
  .billing-panel-body { padding: 12px; }
  .billing-payment-form { grid-template-columns: 1fr; }
  .billing-payment-totals { gap: 8px; }
  .billing-payment-totals dd { font-size: 16px; }
}
:is(.appointment-billing-context, .appointment-billing-existing-row) {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.appointment-billing-context {
  padding: 12px 16px;
  background: #f1f9ff;
  border: 1px solid #c9e6fa;
  border-radius: 8px;
}
.appointment-billing-context > svg { width: 24px; height: 24px; flex: 0 0 24px; color: #008bd2; }
:is(.appointment-billing-context, .appointment-billing-existing-row) :is(span, div) { min-width: 0; }
:is(.appointment-billing-context, .appointment-billing-existing-row) :is(strong, small) { display: block; overflow-wrap: anywhere; }
:is(.appointment-billing-context, .appointment-billing-existing-row) small { margin-top: 4px; color: #64748b; font-weight: 400; font-size: 12px; }
.appointment-billing-existing { border-bottom: 1px solid #d5e9f7; padding-bottom: 12px; }
.appointment-billing-existing > summary { display: flex; align-items: center; width: 100%; gap: 8px; color: #0874a8; font-weight: 600; }
.appointment-billing-existing > summary > svg { width: 18px; height: 18px; flex: 0 0 18px; }
.appointment-billing-existing > summary > svg:last-child { margin-left: auto; }
.appointment-billing-existing > p { color: #64748b; font-size: 13px; font-weight: 400; }
.appointment-billing-existing-row { justify-content: space-between; }
.appointment-billing-existing-row .btn { flex: 0 0 auto; }
.appointment-billing-warning { color: #936218; font-size: 13px; font-weight: 400; }
.patient-appointment-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) {
  .patient-appointments-table { display: block; width: 100%; }
  .patient-appointments-table thead { display: none; }
  .patient-appointments-table tbody { display: block; }
  .patient-appointments-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid #d5e9f7; }
  .patient-appointments-table tr:last-child { border-bottom: 0; }
  .patient-detail-stack .patient-appointments-table tr.is-extra { display: none; }
  .patient-detail-stack .card.is-expanded .patient-appointments-table tr.is-extra { display: grid; }
  .patient-appointments-table td { display: block; min-width: 0; border: 0; white-space: normal; overflow-wrap: anywhere; padding: 8px; }
  .patient-appointments-table td[data-label]::before { display: block; content: attr(data-label); font-size: 11px; font-weight: 400; color: #64748b; margin-bottom: 4px; }
  .patient-appointments-table td:last-child { grid-column: 1 / -1; }
  .patient-appointment-actions .btn { width: auto; }
}

/* Payment creation is scoped separately from the patient form wizard. */
.billing-create-wizard-modal .patient-create-wizard-header { background: #edf8ff; color: var(--ink); border-bottom-color: #cfe7f7; backdrop-filter: none; }
.billing-create-wizard-modal .patient-create-wizard-heading h2 { color: var(--ink); font-size: 20px; }
.billing-create-wizard-modal .patient-create-wizard-heading > div { min-width: 0; }
.billing-create-command-short { display: none; }
.billing-create-wizard-modal .patient-create-wizard-eyebrow { color: #1474a7; font-weight: 500; }
.billing-create-wizard-modal .patient-create-wizard-close { color: #1474a7; background: #ffffff; border-color: #c4e2f5; }
.billing-create-wizard-modal .patient-create-wizard-heading-icon { background: #ffffff; border-radius: 8px; box-shadow: none; }
.billing-create-wizard-modal .patient-create-wizard-progress { border-radius: 8px; }
.billing-create-wizard-modal .patient-create-wizard-step { min-height: 0; gap: 18px; }
.billing-create-recipient { display: flex; align-items: center; gap: 10px; min-width: 0; padding-bottom: 14px; border-bottom: 1px solid #e2edf5; }
.billing-create-recipient-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 8px; background: #edf8ff; color: #1689c7; }
.billing-create-recipient-icon svg { width: 19px; height: 19px; }
.billing-create-recipient > div { min-width: 0; flex: 1; }
.billing-create-recipient strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.billing-create-recipient small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.billing-create-recipient-change { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; min-height: 0; margin: 0; padding: 0; background: #ffffff; border: 1px solid #cfe3f0; border-radius: 8px; box-shadow: none; color: #1474a7; }
.billing-create-recipient-change svg { width: 16px; height: 16px; }
.billing-create-services { border: 0; padding: 0; margin: 0; min-width: 0; }
.billing-create-services legend { padding: 0; margin-bottom: 10px; font-size: 13px; font-weight: 650; color: var(--ink-soft); }
.billing-create-wizard-modal .billing-create-service-card { border-radius: 8px; min-height: 96px; }
.billing-create-wizard-modal .billing-create-service-card:has(input:focus-visible) { outline: 2px solid #1286c9; outline-offset: 2px; }
.billing-create-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 220px); gap: 14px; }
.billing-create-wizard-modal .billing-create-amount input { font-size: 22px; font-weight: 650; }
.billing-create-wizard-modal .billing-create-advanced { border-radius: 8px; }
.billing-create-wizard-modal .billing-create-advanced > summary { width: 100%; }
.billing-create-wizard-modal .billing-create-patient-list { grid-auto-rows: max-content; align-content: start; }
.billing-create-wizard-modal .billing-create-patient-choice { height: auto; border-radius: 8px; white-space: normal; }
.billing-create-wizard-modal .billing-create-patient-choice .patient-workspace-badge { overflow-wrap: anywhere; }
.billing-create-wizard-modal .billing-create-patient-choice-copy > strong { white-space: normal; overflow-wrap: anywhere; }
.billing-create-review { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr); gap: 28px; padding: 8px 0 18px; border-bottom: 1px solid #e2edf5; }
.billing-create-review-total { min-width: 0; align-self: start; }
.billing-create-review-total > span { display: flex; align-items: center; gap: 7px; color: #1474a7; font-size: 12px; }
.billing-create-review-total svg { width: 18px; height: 18px; flex: 0 0 18px; }
.billing-create-review-total > strong { display: block; margin: 12px 0 7px; font-size: 30px; line-height: 1.15; font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.billing-create-review-total > small { color: var(--muted); font-size: 12px; font-weight: 400; }
.billing-create-review-data { display: grid; gap: 12px; min-width: 0; margin: 0; }
.billing-create-review-data > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
.billing-create-review-data dt { font-size: 12px; font-weight: 400; color: var(--muted); }
.billing-create-review-data dd { margin: 0; font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.billing-create-review-description > span { font-size: 11px; font-weight: 400; color: var(--muted); }
.billing-create-review-description p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; font-weight: 400; overflow-wrap: anywhere; white-space: pre-wrap; }
.billing-create-review-change { display: inline-flex; align-items: center; justify-self: start; gap: 7px; margin: 0; padding: 6px 0; min-height: 32px; background: transparent; border: 0; border-radius: 0; color: #1474a7; box-shadow: none; font-size: 12px; font-weight: 600; }
.billing-create-review-change svg { width: 15px; height: 15px; }
.billing-create-external-receipt { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.billing-create-external-receipt svg { width: 17px; height: 17px; flex: 0 0 17px; }
.billing-create-wizard-modal .patient-create-wizard-footer { bottom: -24px; margin: 0 -24px -24px; padding: 14px 24px; }
@media (max-width: 600px) {
  .billing-create-command-full { display: none; }
  .billing-create-command-short { display: inline; }
  .billing-create-wizard-modal .patient-create-wizard-heading h2 { font-size: 16px; }
  .billing-create-wizard-modal .patient-create-wizard-progress small { display: block; font-size: 10px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
  .billing-create-wizard-modal .patient-create-wizard-progress button { min-height: 56px; }
  .billing-create-wizard-modal .billing-create-service-card { min-height: 64px; padding: 10px; }
  .billing-create-editor-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .billing-create-review { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .billing-create-review-total > strong { font-size: 28px; }
  .billing-create-review-data > div { grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
  .billing-create-wizard-modal .patient-create-wizard-footer { bottom: -16px; margin: 0 -16px -16px; padding: 12px 16px; }
  .billing-create-wizard-modal .patient-create-wizard-footer .btn { width: auto; flex: 0 0 auto; padding: 9px 10px; font-size: 12px; white-space: nowrap; }
  .billing-create-wizard-modal .patient-create-wizard-count { white-space: nowrap; font-weight: 500; }
}
@media (max-width: 360px) {
  .billing-create-wizard-modal [data-billing-wizard-prev] { width: 36px; padding: 9px; }
  .billing-create-wizard-modal [data-billing-wizard-prev] > span { display: none; }
}

.billing-area-nav { display: flex; gap: 8px; margin: 0 0 20px; }
.billing-area-nav a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid #cfe5f3; border-radius: 8px; background: #f5fbff; color: #1474a7; font-size: 13px; font-weight: 600; text-decoration: none; }
.billing-area-nav a:hover { text-decoration: none; }
.billing-area-nav a.is-active { background: #ffffff; border-color: #8fd2f5; box-shadow: 0 3px 10px #1689c710; }
.billing-area-nav svg { width: 18px; height: 18px; }
.honoraria-page { min-width: 0; }
.honoraria-heading, .honoraria-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.honoraria-heading h1 { font-size: 28px; line-height: 1.2; margin: 0; }
.honoraria-heading p { color: #1474a7; font-size: 14px; margin: 6px 0 0; font-weight: 400; }
.honoraria-heading .btn { width: auto; }
.honoraria-page h2 { font-size: 19px; margin: 0; }
.honoraria-page label { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; font-size: 12px; font-weight: 600; color: #516174; }
.honoraria-page input, .honoraria-page select, .honoraria-page textarea { min-width: 0; max-width: 100%; margin: 0; font-weight: 400; }
.honoraria-page input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; padding: 0; }
.honoraria-page svg { flex-shrink: 0; }
.honoraria-page .btn svg { width: 17px; height: 17px; }
.honoraria-filters { display: grid; grid-template-columns: 170px 100px minmax(200px, 420px); gap: 14px; padding: 20px 0; border-bottom: 1px solid #cfe5f3; }
.honoraria-feedback { padding: 12px 14px; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.honoraria-feedback.is-success { color: #136947; background: #effaf3; border: 1px solid #b9dfc6; }
.honoraria-feedback.is-error { color: #aa3544; background: #fff3f4; border: 1px solid #f1c9ce; }
.honoraria-feedback.is-warning { color: #91600d; background: #fff5df; border: 1px solid #f0dfb7; }
.honoraria-page details > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; font-size: 13px; }
.honoraria-page details > summary svg { width: 17px; height: 17px; }
.honoraria-conditions { padding: 16px 0; border-bottom: 1px solid #cfe5f3; }
.honoraria-conditions > summary > span { margin-left: auto; font-size: 11px; font-weight: 400; color: #516174; }
.honoraria-conditions > summary > svg:last-child { transition: transform .15s; }
.honoraria-conditions[open] > summary > svg:last-child { transform: rotate(180deg); }
.honoraria-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.honoraria-page .honoraria-toggle label, .honoraria-page .honoraria-check { display: flex; flex-direction: row; align-items: center; gap: 7px; }
.honoraria-service-form { display: grid; grid-template-columns: minmax(160px, 1.6fr) minmax(100px, 1fr) minmax(120px, 1.2fr) minmax(100px, 1fr) auto auto; align-items: end; gap: 12px; padding: 18px 0; border-bottom: 1px solid #e1edf5; }
.honoraria-service-form .btn, .honoraria-page .honoraria-check { align-self: end; min-height: 42px; }
.honoraria-add-service { padding-top: 16px; }
.honoraria-archive { margin: 8px 0; }
.honoraria-archive .link-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0; font-size: 11px; }
.honoraria-archive svg { width: 14px; height: 14px; }
.honoraria-month, .honoraria-overview, .honoraria-receipts { padding: 24px 0; }
.honoraria-state { display: inline-flex; align-items: center; padding: 5px 9px; background: #edf7fc; color: #1474a7; border-radius: 6px; font-size: 11px; font-weight: 500; }
.honoraria-state.is-paid { color: #136947; background: #eaf8ef; }
.honoraria-state.is-pending { color: #91600d; background: #fff5df; }
.honoraria-map-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.honoraria-map-actions .btn { width: auto; }
.honoraria-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; padding: 18px 0; border-top: 1px solid #cfe5f3; border-bottom: 1px solid #cfe5f3; }
.honoraria-totals > div { min-width: 0; }
.honoraria-totals dt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #516174; font-weight: 400; }
.honoraria-totals dt svg { width: 13px; height: 13px; }
.honoraria-totals dd { font-size: 24px; margin: 8px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.honoraria-totals > div:nth-child(2) dd { color: #17785d; }
.honoraria-consultations { display: grid; gap: 12px; }
.honoraria-new-consultations { margin-bottom: 16px; }
.honoraria-item { padding: 16px; border: 1px solid #cfe5f3; border-radius: 8px; background: #ffffff; min-width: 0; }
.honoraria-item.is-excluded { background: #f3f6f8; }
.honoraria-item-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.honoraria-item-heading > div { min-width: 0; flex: 1; }
.honoraria-item-heading strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.honoraria-item-heading small { display: block; font-size: 11px; margin-top: 4px; color: #64748b; font-weight: 400; }
.honoraria-item-amount { flex: 0 0 auto; font-size: 19px; font-weight: 650; color: #1474a7; }
.honoraria-item-fields { display: grid; grid-template-columns: minmax(180px, 1.8fr) minmax(120px, 1fr) minmax(130px, 1fr) minmax(100px, 1fr); gap: 12px; margin-top: 16px; }
.honoraria-item-note { margin-top: 14px; }
.honoraria-item-note summary { color: #1474a7; font-size: 12px; }
.honoraria-item-note textarea { margin-top: 10px; }
.honoraria-item-snapshot { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 12px; color: #516174; font-size: 12px; font-weight: 400; }
.honoraria-snapshot-note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; font-size: 12px; font-weight: 400; }
.honoraria-save-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; margin-top: 16px; border-top: 1px solid #cfe5f3; }
.honoraria-save-bar > span { font-size: 12px; font-weight: 400; color: #516174; }
.honoraria-receipts { border-top: 1px solid #cfe5f3; }
.honoraria-receipt-entry { margin: 18px 0; padding: 14px 0; border-top: 1px solid #e1edf5; border-bottom: 1px solid #e1edf5; }
.honoraria-receipt-entry summary svg:last-child { margin-left: auto; }
.honoraria-payment-form { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(160px, 1fr) minmax(200px, 2fr) auto; gap: 12px; align-items: end; padding-top: 16px; }
.honoraria-history { display: grid; gap: 12px; }
.honoraria-payment { padding: 14px; border: 1px solid #cbe5d7; background: #f4fbf7; border-radius: 8px; }
.honoraria-payment > div { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.honoraria-payment p { margin: 8px 0; font-size: 12px; font-weight: 400; overflow-wrap: anywhere; white-space: pre-wrap; }
.honoraria-payment details { margin-top: 12px; }
.honoraria-payment.is-void { background: #f7f8fa; border-color: #dce3eb; color: #64748b; }
.honoraria-void-form { display: flex; align-items: end; gap: 12px; margin-top: 12px; }
.honoraria-void-form label { flex: 1; }
.honoraria-map-link { display: grid; grid-template-columns: minmax(160px, 1.7fr) repeat(3, minmax(100px, 1fr)) auto; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid #cfe5f3; color: var(--ink); }
.honoraria-map-link span { min-width: 0; }
.honoraria-map-link strong, .honoraria-map-link small { display: block; overflow-wrap: anywhere; }
.honoraria-map-link small { font-size: 11px; font-weight: 400; color: #64748b; margin: 4px 0; }
.honoraria-map-link strong { font-size: 14px; }
.honoraria-map-link svg { width: 18px; height: 18px; }
.honoraria-empty { padding: 20px 0; color: #64748b; font-size: 13px; font-weight: 400; }
@media (max-width: 1000px) {
  .honoraria-service-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .honoraria-item-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .honoraria-payment-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .billing-area-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .billing-area-nav a { min-width: 0; padding: 10px; font-size: 12px; }
  .honoraria-heading h1 { font-size: 24px; }
  .honoraria-heading .btn { min-height: 36px; padding: 8px 10px; font-size: 12px; }
  .honoraria-filters { grid-template-columns: minmax(0, 1fr) 100px; }
  .honoraria-filters label:last-child { grid-column: 1 / -1; }
  .honoraria-conditions > summary { flex-wrap: wrap; }
  .honoraria-service-form > label:first-of-type { grid-column: 1 / -1; }
  .honoraria-totals { gap: 8px; }
  .honoraria-totals dt { font-size: 10px; line-height: 1.4; min-height: 28px; }
  .honoraria-totals dd { font-size: 18px; }
  .honoraria-item { padding: 12px; }
  .honoraria-item-heading strong { font-size: 13px; }
  .honoraria-item-amount { font-size: 16px; }
  .honoraria-item-fields { gap: 10px; }
  .honoraria-item-fields > label:first-child { grid-column: 1 / -1; }
  .honoraria-page .honoraria-save-bar .btn { width: auto; font-size: 12px; padding: 8px 12px; }
  .honoraria-save-bar > span { font-size: 11px; }
  .honoraria-void-form { align-items: stretch; flex-direction: column; }
  .honoraria-map-link { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .honoraria-map-link > span:first-child { grid-column: 1 / -1; }
  .honoraria-map-link > svg { display: none; }
}
.prices-page { max-width: 1040px; margin: 0 auto; padding: 24px; }
.prices-back { display: inline-flex; align-items: center; gap: 8px; }
.prices-back svg, .prices-page summary svg, .prices-page h2 svg { width: 20px; height: 20px; flex: 0 0 20px; }
.prices-page summary { width: 100%; box-sizing: border-box; }
.prices-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0; }
.prices-heading h1 { margin: 0; font-size: 28px; }
.prices-heading p { margin: 6px 0 0; color: #526b80; }
.prices-list { display: grid; gap: 12px; }
.prices-service { border: 1px solid #b8dcef; border-radius: 8px; background: #fff; overflow: hidden; }
.prices-service > summary { display: flex; align-items: center; gap: 14px; padding: 18px; cursor: pointer; list-style: none; }
.prices-service-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.prices-service-name strong, .prices-service-name small { display: block; }
.prices-service-name small { margin-top: 5px; color: #66798a; font-weight: 400; }
.prices-service > summary > strong { white-space: nowrap; color: #087bad; }
.prices-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; background: #eaf7ff; color: #008ad0; border-radius: 8px; }
.prices-service form, .prices-add form { padding: 18px; }
.prices-fields { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
.prices-fields label, .prices-copy label { display: grid; gap: 8px; font-size: 13px; color: #42617a; }
.prices-fields input, .prices-fields select { width: 100%; min-width: 0; box-sizing: border-box; font-weight: 400; }
.prices-import { margin-bottom: 18px; }
.prices-import .btn { max-width: 100%; white-space: normal; text-align: left; }
.prices-fields .prices-default { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.prices-default input { width: 17px; height: 17px; }
.prices-share { margin-top: 18px; border-top: 1px solid #dfedf5; padding-top: 16px; }
.prices-share summary, .prices-copy summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-size: 14px; }
.prices-share summary > svg:last-child, .prices-copy summary > svg:last-child { margin-left: auto; }
.prices-fields--share { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.prices-form-footer { display: flex; justify-content: flex-end; margin-top: 18px; }
.prices-service .prices-archive { padding-top: 0; }
.prices-add { margin-top: 28px; border-top: 1px solid #abd4e9; padding-top: 20px; }
.prices-add h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.prices-add form { padding-left: 0; padding-right: 0; }
.prices-copy { margin-top: 24px; border-top: 1px solid #abd4e9; padding-top: 20px; }
.prices-copy form { display: flex; align-items: flex-end; gap: 14px; margin-top: 16px; }
.prices-copy label { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .prices-page { padding: 18px 12px; }
  .prices-fields { grid-template-columns: 1fr; }
  .prices-service > summary { padding: 12px; gap: 8px; font-size: 14px; }
  .prices-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .prices-service form { padding: 14px; }
  .prices-fields--share { grid-template-columns: 1fr 1fr; }
  .prices-copy form { flex-wrap: wrap; }
  .prices-copy label { flex-basis: 100%; }
}
@media (max-width: 380px) {
  .prices-fields--share { grid-template-columns: 1fr; }
}
.honoraria-group-dates { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.honoraria-group-dates span { padding: 4px 8px; border-radius: 5px; font-size: 12px; color: #417089; background: #edf8ff; }
.honoraria-group-mode { display: flex; gap: 0; border: 1px solid #b7d9ed; border-radius: 6px; overflow: hidden; width: fit-content; max-width: 100%; margin: 16px 0; }
.honoraria-group-mode button { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 0; padding: 10px 14px; background: #f6fbff; color: #42657a; font-size: 13px; cursor: pointer; }
.honoraria-group-mode button[aria-pressed="true"] { background: #168fca; color: #fff; }
.honoraria-group-mode svg { width: 17px; height: 17px; flex-shrink: 0; }
.honoraria-group-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.honoraria-group-fields label { display: grid; gap: 7px; font-size: 12px; color: #4e6c81; }
.honoraria-group-fields input, .honoraria-group-fields select { min-width: 0; width: 100%; box-sizing: border-box; font-weight: 400; }
.honoraria-group-details { border-top: 1px solid #d7eaf5; margin-top: 16px; padding-top: 14px; }
.honoraria-group-details > summary { width: 100%; }
.honoraria-group-details > summary > svg:last-child { margin-left: auto; }
.honoraria-group-consultation { padding: 14px 0; border-bottom: 1px solid #e2edf3; }
.honoraria-group-consultation > strong { display: block; font-size: 13px; margin-bottom: 12px; }
.prices-share-enable { display: flex; gap: 8px; align-items: center; margin: 16px 0; font-size: 13px; color: #42617a; }
.prices-share-enable input { width: 17px; height: 17px; }
@media(max-width: 600px) { .honoraria-group-fields { grid-template-columns: 1fr; } .honoraria-group-mode { width: 100%; } .honoraria-group-mode button { flex: 1; padding: 10px 7px; } }
