/* Practice portal styles, matched to the Shield Command practice dashboard (Replit). Shield Command is
   Tailwind + shadcn/ui on an 18px root, so sizes here are rem on the same 18px root and follow
   Tailwind's scale (text-sm = .875rem, p-5 = 1.25rem, rounded-lg = .5rem, ...). */
:root {
  --ink: #020817;            /* foreground */
  --muted: #64748b;          /* muted-foreground */
  --line: #e2e8f0;           /* border / input */
  --soft: #f1f5f9;           /* muted */
  --teal: #0a737a;           /* tab / chart teal */
  --primary: #0a737b;        /* primary (hsl 184 85% 26%) */
  --teal-dark: #08626a;
  --purple: #7c3aed;         /* violet-600 */
  --violet-700: #6d28d9;
  --enroll: #10b981;
  --drop: #ef4444;
  --card-line: #f3f4f6;      /* gray-100: Shield Command's card border */
  --radius-sm: calc(.5rem - 4px);
  --radius-md: calc(.5rem - 2px);
  --radius-lg: .5rem;
  --radius-xl: .75rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --ring: 0 0 0 2px #fff, 0 0 0 4px var(--primary);
}

html { font-size: 18px; }

.practice-body {
  background: #fff;
  color: var(--ink);
  font-family: Montserrat, sans-serif;
  line-height: 1.5;
}

.muted { color: var(--muted); }
.text-teal { color: var(--teal); }

/* Lucide icon font glyphs sit on the text baseline like Shield Command's inline SVGs. */
[class^="icon-"], [class*=" icon-"] { line-height: 1; display: inline-block; vertical-align: -.125em; }

/* Header: fixed teal rounded bar, like Shield Command */
.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0 1rem;
  margin-top: 1rem;
}
.portal-header-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 4rem;
  padding: 0 1.5rem;
  border-radius: 2rem;
  background: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transition: box-shadow .15s;
}
.portal-header-bar:hover { box-shadow: var(--shadow-md); }

.portal-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}
.portal-brand:hover { color: #fff; }
.portal-brand-icon {
  width: 2.28rem;
  height: 2.28rem;
  flex-shrink: 0;
  border-radius: var(--radius-xl);
  display: grid;
  place-items: center;
  background: #1a8a91;
}
.portal-brand-icon img { width: 1.56rem; height: 1.56rem; object-fit: contain; }
.portal-brand-text { display: flex; flex-direction: column; min-width: 0; }
.portal-brand-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.portal-brand-sub {
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.25;
  color: rgb(255 255 255 / .6);
}

.portal-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.portal-nav-link {
  display: flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-xl);
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: rgb(255 255 255 / .7);
  text-decoration: none;
  transition: all .2s;
}
.portal-nav-link:hover { color: #fff; background: rgb(255 255 255 / .1); }
.portal-nav-link.active { color: #fff; background: rgb(255 255 255 / .15); }
span.portal-nav-link:hover { color: rgb(255 255 255 / .7); background: none; }
.portal-nav-link [class*="icon-"] { font-size: 1rem; }

/* Page: Shield Command's header spacer (pt-24 sm:pt-28 md:pt-24), Tailwind's container (px-4, pb-24 xl:pb-8)
   and the dashboard's max-w-[1600px] p-6 md:p-8 pt-24 space-y-6, folded into one box. */
.practice-page {
  width: 100%;
  margin: 0 auto;
  padding: 12rem 2.5rem 7.5rem;
}
@media (min-width: 640px) { .practice-page { max-width: 640px; padding-top: 13rem; } }
@media (min-width: 768px) { .practice-page { max-width: 768px; padding: 8rem 3rem; } }
@media (min-width: 1024px) { .practice-page { max-width: 1024px; } }
@media (min-width: 1280px) { .practice-page { max-width: 1280px; padding-bottom: 4rem; } }
@media (min-width: 1536px) { .practice-page { max-width: 1536px; } }
.practice-page.narrow { max-width: 720px; }
.practice-page > * { margin-top: 0; margin-bottom: 0; }
.practice-page > * + * { margin-top: 1.5rem; }
.practice-page > [hidden] + * { margin-top: 1.5rem; }

/* Page header: icon, title and the scope / provider / period pickers */
.practice-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
@media (min-width: 768px) {
  .practice-header { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
}
.practice-title { display: flex; align-items: center; gap: .75rem; min-width: 0; max-width: 100%; }
.practice-icon {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: #fff;
  font-size: 1.5rem;
}
.practice-page h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  letter-spacing: -.025em;
}
@media (min-width: 768px) { .practice-page h1 { font-size: 1.875rem; line-height: 2.25rem; } }
/* Dual logo (Shield + practice), Shield Command's h-20 rounded-xl tile. */
.practice-logo-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 5rem;
  flex-shrink: 0;
  padding: 0 1rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.practice-logo-shield { height: 3.5rem; width: auto; object-fit: contain; }
.practice-logo-divider { width: 1px; height: 3rem; background: #e2e8f0; }
.practice-logo-practice { height: 4rem; width: auto; max-width: 10rem; object-fit: contain; }
.practice-subtitle { margin-top: .25rem; font-size: .875rem; line-height: 1.25rem; color: var(--muted); }

.practice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* Pickers. Shield Command uses outline combobox buttons (ChevronsUpDown) and a Select (ChevronDown);
   these are native selects drawn the same way. */
.practice-select {
  height: 2.5rem;
  width: 100%;
  padding: .5rem 2.5rem .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23020817' stroke-opacity='.5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E") no-repeat right 1rem center / 1rem;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 400;
  appearance: none;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all .2s;
}
.practice-select:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }
.practice-select:active { transform: scale(.98); }
.practice-select:focus-visible { outline: none; box-shadow: var(--ring); }
.practice-select.chevron {
  padding: .5rem 2.25rem .5rem .75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23020817' stroke-opacity='.5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right .75rem center;
}
.practice-select.chevron:hover, .practice-select.chevron:active { transform: none; box-shadow: none; }
@media (min-width: 640px) {
  .practice-select.scope { width: 340px; }
  .practice-select.provider { width: 230px; }
  .practice-select.referring { width: 14rem; }
}
.practice-select.period { width: 180px; }
/* Download CSV sits with the pickers, only while the Patient Status & Drops tab is open. */
.practice-button.header-csv { display: none; }
.practice-page:has(> section[data-tab="status"]:not([hidden])) .practice-button.header-csv { display: inline-flex; }

/* Analytics | Resources */
.top-tabs { border-bottom: 1px solid var(--line); }
/* Scrolls sideways on narrow screens; no vertical scroll (the tabs' -1px margin would otherwise make one)
   and no visible scrollbar. */
.top-tabs-inner { display: flex; gap: .25rem; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: 1px; margin-bottom: -1px; }
.top-tabs-inner::-webkit-scrollbar { display: none; }
.top-tabs a {
  padding: .625rem 1rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.top-tabs a:hover { color: var(--ink); border-bottom-color: var(--soft); }
.top-tabs a.active { color: var(--violet-700); border-bottom-color: var(--purple); }

/* KPI strip */
.kpi-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 640px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid rgb(226 232 240 / .8);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-.125rem); }
.kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; min-height: 2rem; }
.kpi-label {
  margin: 0;
  font-size: .75rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-value { margin: .5rem 0 0; font-size: 1.5rem; line-height: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-top: .75rem;
  font-size: .75rem;
  line-height: 1rem;
  font-weight: 500;
}
.kpi-delta.up { color: #047857; }
.kpi-delta.down { color: #be123c; }
.kpi-delta [class*="icon-"] { font-size: .75rem; }
.kpi-delta .muted { font-weight: 500; }
.kpi-none { margin-top: .75rem; font-size: .75rem; line-height: 1rem; color: var(--muted); }

/* Info bubble: Shield Command's (i) with a tooltip */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: .25rem;
  background: none;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1;
  cursor: help;
}
.info-tip:hover { color: var(--ink); }
.info-tip:focus-visible { outline: none; box-shadow: var(--ring); }
.info-tip[data-tip]:hover::after,
.info-tip[data-tip]:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: max-content;
  max-width: 20rem;
  padding: .375rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-family: Montserrat, sans-serif;
  font-size: .75rem;
  line-height: 1.625;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  white-space: normal;
}

/* Analytics section tabs (TabsList) */
.subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: .25rem;
  width: 100%;
  max-width: 100%;
  padding: .375rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgb(241 245 249 / .7);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}
@media (min-width: 1280px) { .subtabs { display: inline-flex; width: auto; } }
.practice-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  flex-shrink: 0;
  padding: .5rem 1rem;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: inherit;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.practice-tab:hover { color: inherit; }
.practice-tab:focus-visible { outline: none; box-shadow: var(--ring); }
.practice-tab.active { background: var(--teal); color: #fff; box-shadow: var(--shadow); }
.practice-tab [class*="icon-"] { font-size: 1rem; }

/* Card (shadcn Card as Shield Command styles it) */
.card {
  display: block;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.panel { padding: 1.25rem; }
.card-title { margin: 0; font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.card-desc { margin: 0; font-size: .75rem; line-height: 1rem; color: var(--muted); }

/* Buttons (shadcn Button + Shield Command's .button hover lift) */
.practice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  height: 2.5rem;
  padding: .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
}
.practice-button:hover { color: var(--ink); transform: scale(1.02); box-shadow: var(--shadow-md); }
.practice-button:active { transform: scale(.98); }
.practice-button:focus-visible { outline: none; box-shadow: var(--ring); }
.practice-button:disabled, .practice-button.disabled { opacity: .5; pointer-events: none; }
.practice-button [class*="icon-"] { font-size: 1rem; }
.practice-button.small-button { height: 2.25rem; padding: 0 .75rem; }
.practice-button.primary { border-color: transparent; background: var(--primary); color: #fafafa; }
.practice-button.primary:hover { color: #fafafa; }
.practice-button.approve-all { border-color: transparent; background: #10b981; color: #fff; box-shadow: var(--shadow-sm); }
.practice-button.approve-all:hover { background: #059669; color: #fff; box-shadow: var(--shadow-md); }
.practice-button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.practice-button.ghost:hover { color: var(--ink); }
.link-button {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  padding: 0 .5rem;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .75rem;
  line-height: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.link-button:hover { color: var(--ink); transform: scale(1.02); box-shadow: var(--shadow-md); }
.link-button:active { transform: scale(.98); }

/* Text input (shadcn Input) */
.practice-input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  line-height: 1.25rem;
}
.practice-input::placeholder { color: var(--muted); }
.practice-input:focus-visible { outline: none; box-shadow: var(--ring); }

/* Checkbox (shadcn Checkbox) */
.practice-check {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: #fff;
  appearance: none;
  vertical-align: middle;
  cursor: pointer;
}
.practice-check:checked {
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fafafa' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / .75rem;
}
.practice-check:focus-visible { outline: none; box-shadow: var(--ring); }

/* Badges */
.badge-gold {
  display: inline-flex;
  align-items: center;
  padding: .125rem .625rem;
  border: 1px solid #fde68a;
  border-radius: 9999px;
  background: #fef3c7;
  color: #78350f;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 600;
}
.decision {
  display: inline-flex;
  align-items: center;
  padding: .125rem .625rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: .75rem;
  line-height: 1rem;
  font-weight: 600;
}
.decision.approved { background: #d1fae5; color: #065f46; }
.decision.rejected { background: #fee2e2; color: #991b1b; }

/* Tables (text-sm, uppercase xs headers, row dividers) */
.practice-table { width: 100%; border-collapse: collapse; font-size: .875rem; line-height: 1.25rem; }
.practice-table thead tr {
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: .75rem;
  line-height: 1rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.practice-table th { padding: .5rem .75rem .5rem 0; font-weight: 600; }
.practice-table td { padding: .625rem .75rem .625rem 0; }
.practice-table th:last-child, .practice-table td:last-child { padding-right: 0; }
.practice-table tbody tr { border-bottom: 1px solid var(--line); }
.practice-table tbody tr:last-child { border-bottom: 0; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none; }
.sort-link:hover { color: var(--ink); }
.sort-link [class*="icon-"] { margin-left: .25rem; font-size: .75rem; }
.sort-link .icon-arrow-up-down { opacity: .5; }

/* Pager */
.pager { display: flex; justify-content: center; align-items: center; gap: .75rem; margin-top: 1rem; }
.pager > span { font-size: .875rem; line-height: 1.25rem; color: var(--muted); }

/* Notice rows */
.alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
  font-size: .875rem;
  line-height: 1.25rem;
}
.alert-row.info { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }

/* Approve Patients, like Shield Command's ReferPatientsTab */
.approve-header {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: .25rem;
}
@media (min-width: 640px) {
  .approve-header { flex-direction: row; align-items: center; justify-content: space-between; }
}
.approve-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.approve-search { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
@media (min-width: 640px) {
  .approve-search { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .approve-search .practice-input { width: 20rem; flex-shrink: 0; }
}
.pill-toggle {
  display: inline-flex;
  margin: .75rem 0 .5rem;
  padding: .125rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgb(241 245 249 / .4);
}
.pill-toggle a {
  padding: .375rem .75rem;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.25rem;
  text-decoration: none;
  transition: color .15s, background-color .15s;
}
.pill-toggle a:hover { color: var(--ink); }
.pill-toggle a.active { background: #fff; color: var(--ink); font-weight: 500; box-shadow: var(--shadow); }
.approval-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin: .5rem 0 .75rem;
}
.approval-summary { margin: 0; font-size: .875rem; line-height: 1.25rem; font-weight: 500; color: var(--muted); }
.approval-empty { margin: 1rem 0 0; color: var(--muted); font-style: italic; }
.bulk-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
  padding: .625rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar-count { font-size: .875rem; line-height: 1.25rem; font-weight: 500; }
.bulk-bar-actions { display: flex; align-items: center; gap: .5rem; }
.approve-table-wrap { display: none; overflow-x: auto; }
.approve-cards { display: grid; gap: .75rem; }
@media (min-width: 768px) {
  .approve-table-wrap { display: block; }
  .approve-cards { display: none; }
}
.approve-table th:first-child { width: 2rem; padding-right: .5rem; }
.approve-table td:first-child { padding-right: .5rem; }
.approve-table .emr { font-weight: 500; }
.approve-table .nowrap { white-space: nowrap; }
.approve-table .approval-cell { text-align: right; white-space: nowrap; }
.approval-buttons { display: inline-flex; align-items: center; gap: .375rem; }
.approve-card {
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: color .15s, background-color .15s, border-color .15s;
}
.approve-card:has(.practice-check:checked) { border-color: rgb(10 115 123 / .5); background: rgb(10 115 123 / .05); }
.approve-card-row { display: flex; align-items: flex-start; gap: .75rem; }
.approve-card-row .practice-check { margin-top: .125rem; }
.approve-card-body { flex: 1; min-width: 0; }
.approve-card-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.approve-card-line { margin-top: .125rem; font-size: .75rem; line-height: 1rem; color: var(--muted); }
.approve-card-actions { display: flex; flex-direction: column; gap: .375rem; flex-shrink: 0; }
.approve-card-actions .link-button { height: 2.25rem; justify-content: center; padding: 0 .75rem; font-size: .875rem; }
.table-scroll { overflow-x: auto; }
.history-summary { margin: .5rem 0 .75rem; font-size: .75rem; line-height: 1rem; color: var(--muted); }

/* In-app confirm (confirm_dialog), like Shield Command's alert dialog: dimmed backdrop, white card,
   Cancel + action buttons; red for rejecting. */
.confirm-dialog {
  width: min(32rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.confirm-dialog::backdrop { background: rgb(0 0 0 / .5); }
.confirm-dialog[open] { animation: confirm-in .15s ease-out; }
@keyframes confirm-in { from { opacity: 0; transform: scale(.96); } }
.confirm-dialog-body { display: grid; gap: 1.25rem; margin: 0; padding: 1.5rem; }
.confirm-dialog-head { display: flex; align-items: flex-start; gap: 1rem; }
.confirm-dialog-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: rgb(10 115 123 / .1);
  color: var(--teal);
  font-size: 1.25rem;
}
.confirm-dialog .confirm-icon-danger, .confirm-dialog.danger .confirm-icon-default { display: none; }
.confirm-dialog.danger .confirm-icon-danger { display: inline-block; }
.confirm-dialog.danger .confirm-dialog-icon { background: #fee2e2; color: #dc2626; }
.confirm-dialog-title { margin: 0; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
.confirm-dialog-message { margin: .25rem 0 0; font-size: .875rem; line-height: 1.25rem; color: var(--muted); }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.confirm-dialog.danger .confirm-dialog-ok { background: #dc2626; color: #fff; }

/* Page loading: Turbo sets aria-busy on tfMain while a page loads. After 250ms (so fast loads don't flash)
   the page dims and Shield Command's breathing ShieldCheck + label shows. */
turbo-frame#tfMain { display: block; position: relative; }
turbo-frame#tfMain[aria-busy="true"] > * { opacity: .45; transition: opacity .2s ease .25s; pointer-events: none; }
.page-loading {
  position: fixed;
  top: 40%;
  left: 50%;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 3rem;
  padding: .5rem 1.25rem;
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / .9);
  color: var(--teal);
  font-size: .875rem;
  transform: translateX(-50%);
  opacity: 0;
}
turbo-frame#tfMain[aria-busy="true"] ~ .page-loading { display: flex; animation: shield-loading-in .2s ease .25s forwards; }
.page-loading [class*="icon-"] { font-size: 1.75rem; animation: practice-shield-breathe 1.8s ease-in-out infinite; }
@keyframes shield-loading-in { to { opacity: 1; } }
@keyframes practice-shield-breathe {
  0%, 100% { opacity: .5; transform: scale(.94); }
  50% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .page-loading [class*="icon-"] { animation: none; }
}

/* A page that couldn't load: the last page stays on screen under this banner (below the fixed header). */
.frame-error {
  position: fixed;
  top: 5.75rem;
  left: 50%;
  z-index: 45;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  width: min(1400px, calc(100% - 2rem));
  padding: .75rem 1rem;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  background: #fef2f2;
  color: #b91c1c;
  font-size: .875rem;
  line-height: 1.25rem;
  transform: translateX(-50%);
}
.frame-error[hidden] { display: none; }

/* Development sign-in: the practice picker list. */
.dev-practice-list { max-height: 420px; overflow-y: auto; display: grid; gap: 6px; }

/* Sign-in and signed-out page (Home/SignIn), like Shield Command's practice-auth-page: soft teal gradient,
   one centered card, Microsoft sign-in only. */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 7rem 1rem 3rem;
  background: linear-gradient(to bottom right, #f0fbfb, #fff, #e7f6f7);
}
.auth-card {
  width: 100%;
  max-width: 28rem;
  padding: 2rem;
  border: 1px solid rgb(10 115 122 / .15);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .auth-card { padding: 2.5rem; } }
.auth-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 2rem; }
.auth-logo { height: 4rem; width: auto; max-width: 100%; object-fit: contain; margin-bottom: 1rem; }
.auth-title-row { display: flex; align-items: center; gap: .5rem; }
.auth-title-icon { font-size: 1.25rem; color: var(--teal); }
.auth-title { margin: 0; font-size: 1.5rem; line-height: 2rem; font-weight: 700; color: #1e293b; }
.auth-subtitle { margin: .5rem 0 0; font-size: .875rem; line-height: 1.25rem; color: var(--muted); text-align: center; }
.auth-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .15s;
}
.auth-microsoft:hover { background: var(--soft); color: var(--ink); }
.auth-microsoft svg { width: 1rem; height: 1rem; }
.auth-footnote { margin: 1.5rem 0 0; font-size: .75rem; line-height: 1rem; color: var(--muted); text-align: center; }
