:root {
  --navy-950: #102744;
  --navy-900: #12315a;
  --navy-800: #234f83;
  --navy-700: #315c8a;
  --cyan-600: #245fbc;
  --cyan-500: #3974d6;
  --cyan-100: #eaf2ff;
  --blue-50: #f2f5fa;
  --slate-900: #17212b;
  --slate-700: #435365;
  --slate-500: #5f7083;
  --slate-300: #cad5df;
  --slate-200: #dfe7ee;
  --slate-100: #edf3f7;
  --white: #ffffff;
  --green-700: #245fbc;
  --green-100: #eaf2ff;
  --amber-700: #9a5b05;
  --amber-100: #fff0ce;
  --red-700: #a82d38;
  --red-100: #fde7e9;
  --shadow-sm: 0 1px 2px rgba(7, 26, 45, 0.06), 0 8px 24px rgba(7, 26, 45, 0.05);
  --shadow-lg: 0 28px 80px rgba(7, 26, 45, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --sidebar-width: 264px;
  --admin-primary: #245fbc;
  --admin-primary-hover: #194b99;
  --admin-soft: #edf4ff;
  --admin-line: #dbe5f1;
  --primary: var(--admin-primary);
  --line: var(--admin-line);
  --border: var(--admin-line);
  --muted: var(--slate-500);
  --slate-600: #52677f;
  --navy: var(--navy-900);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--slate-900);
  background: var(--blue-50);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--blue-50);
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #245fbc;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan-600);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.brand {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.brand__logo {
  display: block;
  width: min(100%, 258px);
  height: auto;
}

.brand__descriptor {
  padding-left: 2px;
  color: var(--slate-500);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(440px, 0.92fr) minmax(520px, 1.08fr);
  background: var(--white);
}

.auth-panel {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 132px clamp(36px, 5vw, 76px);
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 4% 4%, rgba(57, 116, 214, 0.08), transparent 24%),
    var(--white);
}

.brand--auth {
  position: absolute;
  top: clamp(34px, 5vh, 56px);
  left: 50%;
  width: min(calc(100% - 72px), 500px);
  transform: translateX(-50%);
}

.brand--auth .brand__logo {
  width: min(100%, 280px);
}

.brand--auth .brand__descriptor {
  width: min(100%, 280px);
  padding-left: 0;
  text-align: center;
}

.auth-panel__body {
  width: min(100%, 500px);
  max-width: 500px;
  margin-inline: auto;
}

.auth-panel__intro h1 {
  max-width: 500px;
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(2.15rem, 3.4vw, 3.15rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.auth-title__brand {
  white-space: nowrap;
}

.auth-panel__intro > p:last-child {
  max-width: 500px;
  margin: 18px 0 0;
  color: var(--slate-700);
  line-height: 1.6;
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.field label {
  color: var(--navy-900);
  font-size: 0.84rem;
  font-weight: 750;
}

.field-label-row {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0 13px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  color: var(--slate-900);
  background: var(--white);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input,
.field select {
  min-height: 46px;
}

.field textarea {
  min-height: 76px;
  padding-top: 11px;
  padding-bottom: 11px;
  resize: vertical;
  line-height: 1.5;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #9baebe;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 3px rgba(57, 116, 214, 0.2);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 84px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 68px;
  min-height: 34px;
  padding: 0 9px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: var(--cyan-600);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 800;
}

.password-toggle:hover {
  background: var(--cyan-100);
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(36, 95, 188, 0.45);
  outline-offset: 1px;
}

.field small {
  color: var(--slate-500);
  font-size: 0.76rem;
  line-height: 1.45;
}

.field--compact {
  min-width: 160px;
}

.field--compact label {
  font-size: 0.75rem;
}

.field--compact select {
  min-height: 40px;
}

.field--grow {
  flex: 1;
}

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

.input-suffix {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) auto;
}
.input-suffix input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-suffix span {
  display: grid;
  min-width: 66px;
  padding: 0 12px;
  place-items: center;
  border: 1px solid var(--slate-300);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--slate-600);
  background: var(--slate-50);
  font-size: .78rem;
  font-weight: 750;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f4c3c7;
  border-radius: var(--radius-sm);
  color: var(--red-700);
  background: var(--red-100);
  font-size: 0.84rem;
}

.button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 780;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.button--wide {
  width: 100%;
}

.button--primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  box-shadow: 0 10px 24px rgba(10, 37, 64, 0.18);
}

.button--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--cyan-600), var(--navy-800));
  box-shadow: 0 12px 28px rgba(10, 37, 64, 0.24);
}

.button--secondary {
  border-color: var(--slate-300);
  color: var(--navy-900);
  background: var(--white);
}

.button--secondary:hover {
  border-color: var(--cyan-500);
  color: var(--cyan-600);
}

.button--danger {
  border-color: #efb4bb;
  color: #a82434;
  background: #fff7f8;
}

.button--danger:hover:not(:disabled) {
  border-color: #d74b58;
  color: #861b28;
  background: #ffedef;
}

.auth-recovery-message {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #c5d8f2;
  border-radius: 10px;
  color: #234f83;
  background: #eff5ff;
  font-size: 0.78rem;
  line-height: 1.5;
}

.button--ghost {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
}

.auth-panel .button--ghost,
.confirm-dialog .button--ghost {
  border-color: var(--slate-300);
  color: var(--navy-900);
  background: var(--white);
}

.auth-panel__security {
  display: flex;
  margin-top: 20px;
  align-items: center;
  gap: 8px;
  color: var(--slate-500);
  font-size: 0.78rem;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #80b4ff;
  box-shadow: 0 0 0 4px rgba(128, 180, 255, 0.12);
}

.status-dot--checking {
  background: #dd9a2b;
  box-shadow: 0 0 0 4px rgba(221, 154, 43, 0.12);
}

.status-dot--error {
  background: #d74b58;
  box-shadow: 0 0 0 4px rgba(215, 75, 88, 0.12);
}

.auth-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(52px, 7vw, 108px);
  align-items: center;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 82% 18%, rgba(57, 116, 214, 0.46), transparent 32%),
    radial-gradient(circle at 18% 86%, rgba(57, 116, 214, 0.24), transparent 40%),
    linear-gradient(145deg, #173c6a 0%, #102744 55%, #244d85 100%);
}

.auth-visual::before,
.auth-visual::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.auth-visual::before {
  top: -22vw;
  right: -16vw;
  width: 58vw;
  height: 58vw;
}

.auth-visual::after {
  top: -13vw;
  right: -7vw;
  width: 40vw;
  height: 40vw;
}

.auth-visual__glow {
  position: absolute;
  top: 24%;
  left: 14%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(57, 116, 214, 0.16);
  filter: blur(28px);
}

.auth-visual__brand {
  position: absolute;
  z-index: 0;
  top: clamp(58px, 8vh, 96px);
  left: clamp(48px, 7vw, 108px);
  width: min(64%, 650px);
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.075;
}

.auth-visual__content {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
}

.auth-visual__tag {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #bfd7ff;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-visual h2 {
  max-width: 680px;
  margin: 24px 0 38px;
  font-size: clamp(2.65rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-visual__cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.auth-visual__cards div {
  min-height: 88px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(14px);
}

.auth-visual__cards strong,
.auth-visual__cards span {
  display: block;
}

.auth-visual__cards strong {
  font-size: 0.9rem;
}

.auth-visual__cards span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.72rem;
  line-height: 1.35;
}

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

.sidebar {
  position: fixed;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  padding: 28px 20px 20px;
  flex-direction: column;
  overflow-y: auto;
  background:
    radial-gradient(circle at 80% 8%, rgba(57, 116, 214, 0.18), transparent 30%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
}

.brand--sidebar {
  gap: 10px;
}

.brand--sidebar .brand__logo {
  width: min(100%, 194px);
  filter: brightness(0) invert(1);
  opacity: 0.96;
}

.brand--sidebar .brand__descriptor {
  padding-left: 1px;
  color: rgba(191, 215, 255, 0.74);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
}

.main-nav {
  display: grid;
  gap: 7px;
  margin-top: 36px;
}

.nav-item {
  display: grid;
  min-height: 48px;
  padding: 0 12px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  grid-template-columns: 26px 1fr auto;
  text-align: left;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  border-color: rgba(57, 116, 214, 0.28);
  color: var(--white);
  background: rgba(57, 116, 214, 0.15);
  box-shadow: inset 3px 0 0 var(--cyan-500);
}

.nav-item__icon {
  color: #a8c9ff;
  font-size: 1.05rem;
}

.nav-item__badge {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #ffd8a0;
  background: rgba(221, 154, 43, 0.18);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
}

.sidebar__footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
  min-width: 0;
}

.system-pill {
  display: flex;
  padding: 12px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.system-pill small,
.system-pill strong {
  display: block;
}

.system-pill small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.67rem;
}

.system-pill strong {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.77rem;
}

.workspace {
  min-width: 0;
  margin-left: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 82px;
  padding: 14px clamp(20px, 3vw, 42px);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--slate-200);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  color: var(--navy-900);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.topbar .eyebrow {
  margin-bottom: 3px;
  font-size: 0.62rem;
}

.topbar__context {
  min-width: 0;
}

.user-chip {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 10px;
}

.user-chip__avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--white);
  background: linear-gradient(145deg, var(--cyan-500), var(--navy-800));
  font-size: 0.76rem;
  font-weight: 850;
}

.user-chip strong,
.user-chip small {
  display: block;
}

.user-chip strong {
  color: var(--navy-900);
  font-size: 0.82rem;
}

.user-chip small {
  margin-top: 2px;
  color: var(--slate-500);
  font-size: 0.68rem;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  color: var(--navy-900);
  background: var(--white);
}

.menu-button {
  display: none;
}

.content {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 32px clamp(20px, 3vw, 42px) 56px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.04em;
}

.section-heading > div > p:last-child {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--slate-700);
  line-height: 1.55;
}

.section-heading--compact { align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.section-heading--compact > p { flex: 1 1 320px; margin: 0; color: var(--slate-700); line-height: 1.55; max-width: 850px; }

.section-heading__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

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

.metric-card {
  position: relative;
  min-height: 130px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.metric-card::after {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  content: "";
  border-radius: 11px;
  background: linear-gradient(145deg, var(--cyan-100), rgba(234, 242, 255, 0.25));
}

.metric-card--attention::after {
  background: linear-gradient(145deg, var(--amber-100), rgba(255, 240, 206, 0.25));
}

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

.metric-card span {
  color: var(--slate-700);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-card strong {
  margin-top: 9px;
  color: var(--navy-900);
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.metric-card small {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 0.7rem;
}

.toolbar {
  display: flex;
  margin-top: 18px;
  padding: 13px;
  align-items: flex-end;
  gap: 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
}

.plan-usage-panel {
  display: grid;
  margin-top: 18px;
  padding: 16px 18px;
  gap: 12px;
}

.plan-usage-panel--embedded {
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  background: #f9fbfc;
  box-shadow: none;
}

.plan-usage-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.plan-usage-panel__heading .eyebrow {
  margin-bottom: 3px;
  font-size: 0.63rem;
}

.plan-usage-panel__heading h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 0.93rem;
}

.plan-usage-panel__percentage {
  color: var(--green-700);
  font-size: 1.08rem;
  white-space: nowrap;
}

.plan-usage-panel__placeholder,
.plan-usage-panel__technical {
  margin: 0;
  color: var(--slate-500);
  font-size: 0.72rem;
  line-height: 1.45;
}

.plan-usage-panel__content {
  display: grid;
  gap: 10px;
}

.plan-usage-progress {
  display: block;
  width: 100%;
  height: 10px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--slate-100);
}

.plan-usage-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--slate-100);
}

.plan-usage-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--green-700);
}

.plan-usage-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--green-700);
}

.plan-usage-panel__facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.plan-usage-panel__facts span {
  padding: 9px 11px;
  border: 1px solid var(--slate-200);
  border-radius: 9px;
  color: var(--slate-700);
  background: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35;
}

.plan-usage-panel__technical {
  padding-top: 9px;
  border-top: 1px solid var(--slate-200);
}

.plan-usage-panel[data-level="warning"] .plan-usage-panel__percentage {
  color: #9a6b00;
}

.plan-usage-panel[data-level="warning"] .plan-usage-progress::-webkit-progress-value {
  background: #d5a31a;
}

.plan-usage-panel[data-level="warning"] .plan-usage-progress::-moz-progress-bar {
  background: #d5a31a;
}

.plan-usage-panel[data-level="critical"] .plan-usage-panel__percentage {
  color: #b65b0b;
}

.plan-usage-panel[data-level="critical"] .plan-usage-progress::-webkit-progress-value {
  background: #df751c;
}

.plan-usage-panel[data-level="critical"] .plan-usage-progress::-moz-progress-bar {
  background: #df751c;
}

.plan-usage-panel[data-level="exhausted"] .plan-usage-panel__percentage {
  color: #7c2333;
}

.plan-usage-panel[data-level="exhausted"] .plan-usage-progress::-webkit-progress-value {
  background: #8d2f40;
}

.plan-usage-panel[data-level="exhausted"] .plan-usage-progress::-moz-progress-bar {
  background: #8d2f40;
}

.panel {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.panel__header {
  display: flex;
  min-height: 68px;
  padding: 15px 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--slate-200);
}

.panel__header h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 0.96rem;
}

.panel__header small {
  display: block;
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 0.7rem;
}

.conversation-layout {
  display: grid;
  min-height: 550px;
  margin-top: 18px;
  gap: 18px;
  grid-template-columns: minmax(320px, 0.82fr) minmax(440px, 1.18fr);
}

.conversation-list-panel,
.transcript-panel {
  min-height: 550px;
  overflow: hidden;
}

.conversation-list {
  max-height: 650px;
  overflow-y: auto;
}

.conversation-item {
  width: 100%;
  padding: 15px 17px;
  border: 0;
  border-bottom: 1px solid var(--slate-100);
  color: inherit;
  background: var(--white);
  text-align: left;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.conversation-item:hover {
  background: #f7fbfd;
}

.conversation-item.is-active {
  background: var(--cyan-100);
  box-shadow: inset 3px 0 0 var(--cyan-500);
}

.conversation-item__top,
.conversation-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conversation-item__top strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--navy-900);
  font-size: 0.85rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
}

.conversation-item > p.conversation-item__requester {
  margin-bottom: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.transcript-panel h3,
#transcript-requester {
  overflow-wrap: anywhere;
}

.conversation-item__top time {
  flex: none;
  color: var(--slate-500);
  font-size: 0.66rem;
}

.conversation-item > p {
  margin: 7px 0 10px;
  overflow: hidden;
  color: var(--slate-700);
  font-size: 0.78rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item__meta {
  justify-content: flex-start;
  color: var(--slate-500);
  font-size: 0.66rem;
}

.tag,
.status-badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  align-items: center;
  border-radius: 999px;
  color: var(--navy-700);
  background: var(--slate-100);
  font-size: 0.64rem;
  font-weight: 800;
}

.status-badge[data-status="waiting_human"] {
  color: var(--amber-700);
  background: var(--amber-100);
}

.status-badge[data-status="human_active"],
.status-badge[data-status="ai_active"],
.status-badge[data-status="active"] {
  color: var(--green-700);
  background: var(--green-100);
}

.status-badge[data-status="closed"],
.status-badge[data-status="inactive"] {
  color: var(--slate-700);
  background: var(--slate-100);
}

.empty-state {
  display: flex;
  min-height: 210px;
  padding: 30px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--slate-500);
  text-align: center;
}

.empty-state--large {
  min-height: 100%;
}

.empty-state > span {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 16px;
  color: var(--cyan-600);
  background: var(--cyan-100);
  font-size: 1.35rem;
}

.empty-state strong {
  color: var(--navy-900);
  font-size: 0.9rem;
}

.empty-state p {
  max-width: 330px;
  margin: 7px 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
}

.transcript {
  display: grid;
  min-height: 550px;
  grid-template-rows: auto 1fr auto;
}

.transcript__header {
  display: flex;
  padding: 18px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--slate-200);
}

.transcript__header h3 {
  margin: 7px 0 0;
  color: var(--navy-900);
  font-size: 1.05rem;
}

.transcript__header p {
  margin: 4px 0 0;
  color: var(--slate-500);
  font-size: 0.72rem;
}

.message-list {
  display: flex;
  max-height: 560px;
  padding: 22px;
  overflow-y: auto;
  flex-direction: column;
  gap: 15px;
  background: linear-gradient(180deg, #f8fbfd, #f3f7fa);
}

.transcript-new-messages {
  align-self: center;
  z-index: 2;
  margin: -48px 0 12px;
  border: 1px solid rgba(36, 95, 188, .25);
  border-radius: 999px;
  padding: 8px 13px;
  color: #24548f;
  background: #fff;
  box-shadow: 0 7px 20px rgba(15, 48, 62, .15);
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.message {
  display: flex;
  max-width: 78%;
  flex-direction: column;
  align-self: flex-start;
}

.message--assistant,
.message--user {
  align-self: flex-end;
}

.message__bubble {
  padding: 11px 13px;
  border: 1px solid var(--slate-200);
  border-radius: 4px 14px 14px 14px;
  color: var(--slate-900);
  background: var(--white);
  font-size: 0.81rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message--assistant .message__bubble,
.message--user .message__bubble {
  border-color: transparent;
  border-radius: 14px 4px 14px 14px;
  color: var(--white);
  background: var(--navy-800);
}

.message__meta {
  margin-top: 5px;
  color: var(--slate-500);
  font-size: 0.62rem;
}

.message--assistant .message__meta,
.message--user .message__meta {
  text-align: right;
}

.transcript__notice {
  padding: 12px 18px;
  border-top: 1px solid var(--slate-200);
  color: var(--slate-500);
  background: var(--white);
  font-size: 0.7rem;
  line-height: 1.45;
}

.transcript-operations {
  border-top: 1px solid var(--slate-200);
  background: var(--white);
}

.transcript-operations .transcript__notice {
  border-top: 0;
}

.transcript-operations__actions {
  display: flex;
  padding: 0 18px 14px;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.human-composer {
  display: grid;
  padding: 14px 18px 16px;
  gap: 8px;
  border-top: 1px solid var(--slate-100);
  background: #f7fbfc;
}

.human-composer label {
  color: var(--navy-900);
  font-size: 0.76rem;
  font-weight: 800;
}

.human-composer__row {
  display: grid;
  align-items: stretch;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.human-composer textarea {
  min-height: 66px;
  resize: vertical;
}

.human-composer small {
  color: var(--slate-500);
  font-size: 0.68rem;
}

.plans-layout {
  display: grid;
  margin-top: 25px;
  align-items: start;
  gap: 18px;
  grid-template-columns: minmax(270px, 0.34fr) minmax(540px, 1fr);
}

.clinic-picker {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 130px);
  overflow: hidden;
}

.clinic-picker > .field {
  padding: 16px;
}

.clinic-list {
  max-height: calc(100vh - 315px);
  overflow-y: auto;
  border-top: 1px solid var(--slate-100);
}

.clinic-item {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--slate-100);
  color: inherit;
  background: var(--white);
  text-align: left;
}

.clinic-item:hover,
.clinic-item.is-active {
  background: var(--cyan-100);
}

.clinic-item.is-active {
  box-shadow: inset 3px 0 0 var(--cyan-500);
}

.clinic-item strong,
.clinic-item small {
  display: block;
}

.clinic-item strong {
  overflow: hidden;
  color: var(--navy-900);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clinic-item small {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 0.67rem;
}

.plan-workspace,
#plan-content {
  display: grid;
  gap: 18px;
}

.plan-summary {
  padding: 22px;
}

.plan-summary__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.plan-summary__heading h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.plan-summary__heading > div > p:last-child {
  margin: 4px 0 0;
  color: var(--slate-500);
  font-size: 0.72rem;
}

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

.current-plan > div {
  padding: 17px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  background: #f9fbfc;
}

.current-plan span,
.current-plan strong,
.current-plan small {
  display: block;
}

.current-plan span {
  color: var(--slate-500);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.current-plan strong {
  margin-top: 7px;
  color: var(--navy-900);
  font-size: 1.05rem;
}

.current-plan small {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 0.68rem;
}

.current-plan .plan-state-copy {
  max-width: 46ch;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-size: 0.72rem;
  line-height: 1.45;
}

.active-plan {
  border-color: #c8d9f1 !important;
  background: #f2f6ff !important;
}

.scheduled-plan {
  border-color: #efd29c !important;
  background: #fffaf0 !important;
}

.scheduled-plan__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.scheduled-plan__actions .button {
  min-height: 2.35rem;
  padding: 0.55rem 0.8rem;
}

.scheduled-plan__actions .button--ghost {
  border-color: #c49a4c;
  color: var(--navy-900);
  background: var(--white);
}

.scheduled-plan__actions .button--ghost:hover:not(:disabled) {
  border-color: #9a6d20;
  background: #fff4dc;
}

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

.usage-card {
  padding: 15px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
}

.usage-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.usage-card span {
  color: var(--slate-700);
  font-size: 0.72rem;
  font-weight: 700;
}

.usage-card strong {
  color: var(--navy-900);
  font-size: 0.85rem;
}

.usage-card small {
  display: block;
  margin-top: 8px;
  color: var(--slate-500);
  font-size: 0.64rem;
}

.usage-card--internal {
  background: #f9fbfc;
}

.progress {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 12px;
  border: 0;
  overflow: hidden;
  appearance: none;
  border-radius: 999px;
  background: var(--slate-100);
}

.progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--slate-100);
}

.progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-500), var(--navy-700));
}

.progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-500), var(--navy-700));
}

.change-plan-panel,
.history-panel {
  overflow: hidden;
}

.plan-change-form {
  display: grid;
  padding: 18px;
  gap: 16px;
  grid-template-columns: minmax(230px, 0.8fr) minmax(340px, 1.2fr);
  align-items: start;
}

.plan-change-form .audit-reference-note {
  grid-column: 1 / -1;
}

.plan-change-submit {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 260px;
  min-height: 46px;
}

.plan-change-form .form-error {
  grid-column: 1 / -1;
}

.timeline {
  display: grid;
  padding: 6px 18px 18px;
}

.history-panel .empty-state {
  min-height: 150px;
}

.timeline-item {
  position: relative;
  display: grid;
  padding: 16px 0 16px 24px;
  gap: 5px;
  border-bottom: 1px solid var(--slate-100);
  grid-template-columns: 1fr auto;
}

.timeline-item::before {
  position: absolute;
  top: 20px;
  left: 2px;
  width: 9px;
  height: 9px;
  content: "";
  border: 3px solid var(--cyan-100);
  border-radius: 50%;
  background: var(--cyan-600);
}

.timeline-item strong {
  color: var(--navy-900);
  font-size: 0.8rem;
}

.timeline-item span,
.timeline-item small {
  color: var(--slate-500);
  font-size: 0.68rem;
}

.timeline-item span {
  grid-column: 1;
}

.timeline-item time {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--slate-500);
  font-size: 0.66rem;
}

.confirm-dialog {
  width: min(92vw, 560px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 27px;
  border: 0;
  border-radius: var(--radius-lg);
  color: var(--slate-900);
  box-shadow: var(--shadow-lg);
}

.confirm-dialog::backdrop {
  background: rgba(7, 26, 45, 0.68);
  backdrop-filter: blur(5px);
}

.confirm-dialog form {
  position: relative;
}

.confirm-dialog h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 1.5rem;
  letter-spacing: -0.035em;
}

.confirm-dialog form > p:not(.eyebrow, .confirm-dialog__notice) {
  color: var(--slate-700);
  line-height: 1.55;
}

.confirm-dialog__close {
  position: absolute;
  top: -10px;
  right: -10px;
}

.confirm-list {
  display: grid;
  margin: 20px 0;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
}

.confirm-list div {
  display: grid;
  padding: 11px 14px;
  border-bottom: 1px solid var(--slate-100);
  grid-template-columns: 0.7fr 1.3fr;
}

.confirm-list div:last-child {
  border-bottom: 0;
}

.confirm-list dt {
  color: var(--slate-500);
  font-size: 0.72rem;
}

.confirm-list dd {
  margin: 0;
  color: var(--navy-900);
  font-size: 0.76rem;
  font-weight: 750;
  text-align: right;
}

.confirm-dialog__notice {
  padding: 11px 13px;
  border-radius: 10px;
  color: var(--navy-700);
  background: var(--cyan-100);
  font-size: 0.73rem;
  line-height: 1.5;
}

.confirm-dialog__notice.is-warning {
  color: #7a3312;
  background: #fff1dc;
  box-shadow: inset 0 0 0 1px #edb875;
}

.confirm-reason-field {
  margin-bottom: 14px;
}

.confirm-reason-field textarea {
  min-height: 72px;
  resize: vertical;
}

.confirm-over-limit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid #e7a65c;
  border-radius: 10px;
  color: #6f2e0f;
  background: #fff8ec;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.45;
}

.confirm-over-limit input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.confirm-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 20px;
  justify-content: flex-end;
  gap: 10px;
}

.button--small {
  min-height: 36px;
  padding-inline: 13px;
  font-size: 0.75rem;
}

.button--text {
  min-height: 32px;
  padding-inline: 9px;
  border-color: transparent;
  color: var(--red-700);
  background: transparent;
  font-size: 0.72rem;
}

.button--text:hover {
  background: var(--red-100);
}

.lia-layout {
  display: grid;
  margin-top: 25px;
  align-items: start;
  gap: 18px;
  grid-template-columns: minmax(240px, 0.32fr) minmax(0, 1fr);
}

.lia-clinic-picker {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 130px);
  overflow: hidden;
}

.lia-clinic-picker > .field {
  padding: 16px;
}

.lia-clinic-picker .clinic-list {
  max-height: calc(100vh - 315px);
}

.lia-workspace,
.lia-content,
.lia-profile-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.lia-placeholder {
  min-height: 330px;
}

.lia-overview {
  padding: 22px;
}

.lia-overview__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.lia-overview__heading h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 1.45rem;
  letter-spacing: -0.035em;
}

.lia-overview__heading > div > p:last-child {
  margin: 5px 0 0;
  color: var(--slate-500);
  font-size: 0.72rem;
}

.lia-status-grid {
  display: grid;
  margin-top: 20px;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-link-box {
  display: grid;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  gap: 12px;
  background: #f8fbfc;
}

.public-link-box > div:first-child {
  display: grid;
  gap: 4px;
}

.public-link-box strong {
  color: var(--navy-900);
  font-size: 0.82rem;
}

.public-link-box small {
  color: var(--slate-600);
  font-size: 0.72rem;
  line-height: 1.45;
}

.public-link-box__actions {
  display: grid;
  align-items: center;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.public-link-box__actions input {
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  color: var(--slate-700);
  background: var(--white);
}

.lia-status-grid article {
  padding: 15px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  background: #f9fbfc;
}

.lia-status-grid span,
.lia-status-grid strong,
.lia-status-grid small {
  display: block;
}

.lia-status-grid span {
  color: var(--slate-500);
  font-size: 0.67rem;
  font-weight: 750;
  text-transform: uppercase;
}

.lia-status-grid strong {
  margin-top: 7px;
  overflow: hidden;
  color: var(--navy-900);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lia-status-grid small {
  margin-top: 5px;
  color: var(--slate-500);
  font-size: 0.65rem;
  line-height: 1.4;
}

.lia-progress {
  margin-top: 18px;
}

.lia-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lia-progress strong {
  color: var(--navy-900);
  font-size: 0.77rem;
}

.lia-progress span {
  color: var(--cyan-600);
  font-size: 0.76rem;
  font-weight: 800;
}

.lia-progress progress {
  display: block;
  width: 100%;
  height: 9px;
  margin-top: 9px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--slate-100);
}

.lia-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--slate-100);
}

.lia-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-500), var(--green-700));
}

.lia-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-500), var(--green-700));
}

.lia-form-card,
.lia-optional-card {
  overflow: hidden;
}

.lia-form-card__body {
  display: grid;
  padding: 20px;
  gap: 18px;
  min-width: 0;
  container-type: inline-size;
}

.lia-collapsible > .panel__header {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-left: 5px solid var(--cyan-500);
  background: linear-gradient(90deg, #f4f7ff 0, #fff 34%);
}
.lia-collapsible > .panel__header:hover {
  background: #edf4ff;
}
.expand-hint {
  color: var(--cyan-700);
  font-weight: 800;
}
.lia-collapsible.is-expanded > .panel__header,
.lia-collapsible:has(.lia-section-toggle[aria-expanded="true"]) > .panel__header {
  background: #f5f8ff;
  box-shadow: inset 0 -1px 0 var(--cyan-100);
}
.lia-collapsible > .panel__header > div { min-width: 0; }
.lia-collapsible > .panel__header .lia-section-toggle {
  justify-self: end;
  margin-left: auto;
  min-height: 44px;
  padding: 10px 14px;
  white-space: nowrap;
  color: #7b3508;
  background: linear-gradient(180deg, #fff1df, #ffd5a6);
  border: 1px solid #e8a15c;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(110, 57, 10, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}
.lia-collapsible > .panel__header .lia-section-toggle:hover { background: #ffd09b; border-color: #d47d2b; color: #642600; }
.lia-collapsible > .panel__header .lia-section-toggle:focus-visible { outline: 3px solid #8a3700; outline-offset: 3px; }
.lia-section-actions { justify-content: flex-end; }
@media (max-width: 600px) {
  .lia-collapsible > .panel__header { padding: 14px 12px; gap: 10px; }
  .lia-collapsible > .panel__header .lia-section-toggle { font-size: 0.65rem; padding: 8px; }
}
.lia-section-toggle::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 0.7rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 180ms ease;
}
.lia-section-toggle[aria-expanded="true"]::after {
  transform: rotate(135deg);
}

.lia-field-grid {
  display: grid;
  align-items: start;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.policy-callout,
.appointment-policy-grid {
  display: grid;
  align-items: start;
  gap: 16px;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, .7fr);
}
.policy-callout {
  padding: 16px;
  border: 1px solid #c8d9f1;
  border-radius: var(--radius-sm);
  background: #f2f6ff;
}
.switch-field {
  display: flex;
  min-height: 64px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
}
.switch-field span { display: grid; gap: 4px; }
.switch-field small { color: var(--slate-500); font-size: .72rem; line-height: 1.4; }
.switch-field input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--primary); }
.policy-callout--booking { align-items: stretch; }
.policy-callout--booking > .field-label-row { width: 100%; min-width: 0; align-items: stretch; }
.policy-callout--booking .switch-field { min-width: 0; flex: 1; }
.policy-callout--booking > .field-label-row > .help-trigger { align-self: center; flex: 0 0 auto; }
.policy-callout--booking > .field { align-content: space-between; }
.switch-field--featured {
  margin-bottom: 16px;
  border-color: #90b5ec;
  background: #edf4ff;
  box-shadow: 0 8px 22px rgba(36, 95, 188, .08);
}
.switch-field--featured strong { color: var(--navy-900); }

.lia-business-hours { margin: 0; padding: 0; border: 0; }
.lia-business-hours legend { margin-bottom: 10px; color: var(--navy-900); font-size: .84rem; font-weight: 800; }
.business-hours-editor { display:grid; gap:10px; container:business-hours / inline-size; }
.business-hours-row {
  display:grid;
  grid-template-columns:150px minmax(0,1fr) auto;
  align-items:start;
  gap:12px 18px;
  padding:12px;
  border:1px solid var(--slate-200);
  border-radius:10px;
  background:#fff;
  min-width:0;
}
.business-hours-row.is-disabled { background:var(--slate-50); }
.business-day-toggle { display:flex; align-items:center; gap:9px; min-height:42px; margin-top:23px; font-size:.84rem; }
.business-day-toggle input { width:18px; height:18px; margin:0; accent-color:var(--primary); }
.business-hours-periods { display:grid; gap:12px; min-width:0; }
.business-hours-range { display:grid; grid-template-columns:repeat(2,minmax(100px,160px)) auto; align-items:end; justify-content:start; gap:12px; }
.business-hours-range > label { display:grid; min-width:0; gap:5px; color:var(--slate-700); font-size:.78rem; font-weight:700; }
.business-hours-range > label > span { line-height:18px; }
.business-hours-range input[type="time"] { width:100%; min-width:0; min-height:42px; padding:0 10px; border:1px solid var(--slate-300); border-radius:9px; }
.business-hours-add { margin-top:23px; }
.business-hours-row .button { min-height:42px; white-space:normal; }
.business-hours-row.is-disabled .business-hours-range { color:var(--slate-500); }
@container business-hours (max-width:720px) {
  .business-hours-row { grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; }
  .business-day-toggle { grid-column:1 / -1; margin-top:0; min-height:30px; }
}
@container business-hours (max-width:500px) {
  .business-hours-row { grid-template-columns:minmax(0,1fr); }
  .business-hours-add { margin-top:0; justify-self:start; }
  .business-hours-range { grid-template-columns:repeat(2,minmax(0,1fr)); justify-content:stretch; }
  .business-hours-remove { grid-column:1 / -1; justify-self:end; }
}

.lia-field-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lia-field-grid--branding {
  grid-template-columns: 1fr;
}

.logo-field__row {
  display: grid;
  align-items: stretch;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.field-status {
  min-height: 1.1em;
  margin: 3px 0 0;
  color: var(--slate-500);
  font-size: 0.7rem;
}

.field-status[data-status="success"] { color: var(--green-700); font-weight: 800; }
.field-status[data-status="error"] { color: #b4232f; font-weight: 800; }
.field-status[data-status="info"] { color: var(--cyan-700); }


.knowledge-panel { gap: 16px; }
.knowledge-notice {
  padding: 14px 16px;
  border: 1px solid #f0c66a;
  border-left: 4px solid #d99b18;
  border-radius: var(--radius-sm);
  background: #fff9e9;
}
.knowledge-notice strong { color: var(--navy-900); }
.knowledge-notice p { margin: 5px 0 0; color: var(--slate-600); font-size: 0.78rem; line-height: 1.5; }
.knowledge-upload-grid { align-items: start; }
.knowledge-confirmation { display: flex; align-items: flex-start; gap: 10px; color: var(--slate-700); font-size: 0.78rem; line-height: 1.45; }
.knowledge-confirmation input { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; }
.knowledge-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.knowledge-list { display: grid; margin-top: 10px; gap: 8px; }
.knowledge-item { display: grid; padding: 11px 13px; gap: 4px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); background: #f7fafb; }
.knowledge-item__top { display: flex; justify-content: space-between; gap: 12px; }
.knowledge-item__actions { display: flex; align-items: center; gap: 10px; }
.knowledge-item small { color: var(--slate-500); }
.knowledge-state { color: var(--green-700); font-size: 0.7rem; font-weight: 800; }

.conversation-protocol {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--navy-800);
  background: #edf4ff;
  font-size: 0.64rem;
  font-weight: 750;
}
.conversation-protocol--continuation {
  margin-left: 0;
  color: #6b4b05;
  background: #fff2cf;
}

.lia-days {
  display: flex;
  margin: 0;
  padding: 14px;
  flex-wrap: wrap;
  gap: 9px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
}

.lia-days legend {
  padding: 0 6px;
  color: var(--navy-900);
  font-size: 0.78rem;
  font-weight: 750;
}

.lia-days label {
  display: inline-flex;
  min-height: 34px;
  padding: 0 10px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  color: var(--slate-700);
  background: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
}

.lia-days label:has(input:checked) {
  border-color: var(--cyan-500);
  color: var(--navy-900);
  background: var(--cyan-100);
}

.lia-days input {
  accent-color: var(--cyan-600);
}

.lia-repeatable-list {
  display: grid;
  gap: 13px;
  min-width: 0;
}

.lia-repeatable-row {
  padding: 15px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  background: #f9fbfc;
  min-width: 0;
  container-type: inline-size;
}

.lia-repeatable-row__header {
  display: flex;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lia-repeatable-row__header strong {
  color: var(--navy-900);
  font-size: 0.78rem;
}

.lia-service-fields {
  display: grid;
  min-width: 0;
  gap: 14px 12px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 104px 156px 184px 112px;
}

.lia-service-fields input, .lia-service-fields select { min-width: 0; padding-inline: 10px; }
.lia-service-fields > .field > label { display:flex; align-items:center; gap:6px; min-height:20px; line-height:20px; }
.lia-service-price-toggle {
  display: flex;
  min-height: 46px;
  align-self: start;
  margin-top: 27px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: var(--navy-900);
  background: #fff;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.lia-service-price-toggle:has(input:checked) { background: #edf4ff; border-color: #c5d8f1; }
.lia-service-price-toggle:focus-within { outline: 2px solid var(--cyan-600); outline-offset: 2px; }
.lia-service-price-toggle input { width: 18px; height: 18px; flex-shrink: 0; margin: 0; accent-color: var(--cyan-600); }

.lia-service-description {
  grid-column: 1 / -1;
}

.lia-service-fields > .lia-service-description:not(.lia-service-preparation) textarea {
  min-height: 88px;
}

.lia-service-preparation {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #c8d9f1;
  border-radius: var(--radius-sm);
  background: #f4f7fd;
}

.lia-service-preparation__body {
  display: grid;
  align-items: start;
  gap: 12px;
  grid-template-columns: minmax(0, .6fr) repeat(2, minmax(0, 1fr));
}

.lia-service-preparation__body textarea { min-height: 72px; }

.appointment-toolbar {
  display: grid;
  align-items: start;
  gap: 18px;
  grid-template-columns: minmax(220px, .72fr) auto minmax(360px, 1.35fr);
  margin-bottom: 18px;
  padding: 18px;
}

.appointment-toolbar .field { width: 100%; margin: 0; max-width: none; }
.appointment-clinic-fixed {
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid #cfe0e6;
  border-radius: 10px;
  color: var(--navy);
  background: #f4f9fb;
  font-weight: 800;
}
.appointment-policy { margin: 22px 0 18px; padding: 0 20px 18px; }
.appointment-policy .panel__header { margin: 0 -20px 17px; }
.appointment-policy-grid { grid-template-columns: minmax(0, 1.6fr) minmax(220px, .7fr); }
.appointment-month-field { display: grid; gap: 6px; }
.appointment-toolbar-label,
.appointment-search > label {
  min-height: 17px;
  color: var(--slate-700);
  font-size: .74rem;
  font-weight: 800;
}
.appointment-month-controls { display: flex; gap: 8px; }
.appointment-month-controls .button,
.appointment-search__row .button,
.appointment-toolbar select,
.appointment-clinic-fixed { min-height: 44px; }
.appointment-search {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.appointment-search__row { display: flex; gap: 8px; }
.appointment-search input,
.appointment-search select,
.appointment-search-results {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--slate-300);
  border-radius: 9px;
  color: var(--navy-900);
  background: #fff;
  font: inherit;
}
.appointment-search__row input { flex: 1 1 auto; min-width: 140px; }
.appointment-search > small { min-height: 16px; color: var(--muted); }
.appointment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.appointment-calendar-panel { overflow: hidden; }
.appointment-weekdays,
.appointment-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.appointment-weekdays {
  padding: 0 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.appointment-weekdays span { padding: 8px 4px; }
.appointment-calendar {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.appointment-day {
  min-height: 118px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.appointment-day:focus-visible { outline: 3px solid rgba(36, 95, 188, .32); outline-offset: -3px; }
.appointment-day.is-outside { color: #a6b1b8; background: #f7f9fb; }
.appointment-day.is-today { box-shadow: inset 0 0 0 2px rgba(36, 95, 188, .38); }
.appointment-day__number {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-bottom: 5px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
}
.appointment-day.is-today .appointment-day__number { color: #fff; background: var(--primary); }
.appointment-day__empty { display: block; color: #9aa8af; font-size: 10px; }
.appointment-pill {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 6px 7px;
  overflow: hidden;
  border: 1px solid #bfd3f2;
  border-radius: 7px;
  color: #244e85;
  background: #edf4ff;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
  display: -webkit-box;
  min-height: 32px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  cursor: pointer;
}
.appointment-pill:hover,
.appointment-pill:focus-visible { border-color: var(--primary); background: #dceaff; outline: none; }
.appointment-pill[data-status="cancelled"] { border-color: #e1c3c6; color: #8f2d36; background: #fff1f2; text-decoration: line-through; }
.appointment-pill[data-status="completed"] { border-color: #86b9df; color: #124d78; background: #eaf5fd; }
.appointment-pill[data-status="no_show"] { border-color: #e09aa0; color: #932631; background: #fdebed; }
.appointment-pill[data-status="needs_review"] { border-color: #aab5bc; color: #46545c; background: #edf1f3; }
.appointment-pill--block { border-color: #d9c18a; color: #765318; background: #fff8e6; }
.appointment-detail { position: sticky; top: 88px; }
.appointment-detail-list { display: grid; gap: 0; margin: 0; padding: 6px 20px 14px; }
.appointment-detail-list > div { min-width: 0; padding: 7px 0; border-bottom: 1px solid var(--slate-200); font-size: 14px; line-height: 1.45; }
.appointment-detail-list dt { display: inline; margin: 0 4px 0 0; color: var(--slate-900); font: inherit; font-weight: 700; text-transform: none; }
.appointment-detail-list dt::after { content: ':'; }
.appointment-detail-list dd { display: inline; margin: 0; overflow-wrap: anywhere; font: inherit; font-weight: 400; }
.appointment-detail-list .appointment-detail-text dt { display: block; margin: 0 0 4px; }
.appointment-detail-list .appointment-detail-text dd { display: block; white-space: pre-line; }
.appointment-detail-actions { display: grid; gap: 8px; padding: 0 20px 20px; }
.appointment-detail-actions .button { width: 100%; }
.audit-reference-note {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 11px 14px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: var(--slate-600);
  background: var(--slate-50);
}
.audit-reference-note strong { color: var(--navy-900); font-size: .76rem; }
.audit-reference-note small { font-size: .68rem; line-height: 1.35; }

#appointment-search-status:empty {
  display: none;
}

@media (max-width: 1060px) {
  .appointment-layout { grid-template-columns: 1fr; }
  .appointment-detail { position: static; }
  .appointment-toolbar { grid-template-columns: minmax(220px, 1fr) auto; }
  .appointment-search { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .appointment-toolbar { grid-template-columns: 1fr; }
  .appointment-search { grid-column: auto; }
  .appointment-month-controls { justify-content: space-between; }
  .appointment-search__row { align-items: stretch; flex-direction: column; }
  .appointment-search__row .button { width: 100%; }
  .appointment-day { min-height: 82px; padding: 4px; }
  .appointment-pill { padding: 4px; font-size: 9px; }
  .appointment-day__empty { display: none; }
}

.lia-optional-card summary {
  padding: 18px 20px;
  cursor: pointer;
  color: var(--navy-900);
  font-size: 0.9rem;
  font-weight: 800;
  list-style-position: inside;
}

.lia-optional-card[open] summary {
  border-bottom: 1px solid var(--slate-200);
}

.lia-summary-badges {
  display: inline-flex;
  margin: 7px 0 0;
  flex-wrap: wrap;
  vertical-align: middle;
  gap: 7px;
}

.lia-summary-badges .status-badge {
  font-size: 0.63rem;
  font-weight: 800;
}

.lia-optional-block + .lia-optional-block {
  padding-top: 18px;
  border-top: 1px solid var(--slate-100);
}

.lia-optional-block h3 {
  margin: 0 0 13px;
  color: var(--navy-900);
  font-size: 0.84rem;
}

.lia-optional-heading {
  display: flex;
  margin-bottom: 13px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.lia-optional-heading h3 { margin-bottom: 4px; }

.lia-optional-heading p {
  margin: 0;
  color: var(--slate-500);
  font-size: 0.72rem;
  line-height: 1.45;
}

.lia-validation-card {
  display: grid;
  padding: 22px;
  align-items: start;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
}

.lia-validation-card h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 1rem;
}

.lia-validation-card > div > p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--slate-700);
  font-size: 0.78rem;
  line-height: 1.5;
}

.lia-validation-card ul {
  display: grid;
  margin: 13px 0 0;
  padding-left: 19px;
  gap: 5px;
  color: var(--amber-700);
  font-size: 0.72rem;
  line-height: 1.45;
}

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

.lia-form-actions > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.lia-onboard-dialog {
  width: min(92vw, 620px);
}

.lia-onboard-fields {
  margin-top: 20px;
  gap: 14px;
}

.lia-team-header {
  gap: 18px;
}

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

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

.staff-card {
  display: grid;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  align-items: center;
  gap: 14px;
  grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 1.2fr) auto;
  background: var(--slate-50);
}

.staff-card__identity,
.staff-card__details {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.staff-card__identity strong {
  overflow: hidden;
  color: var(--navy-900);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-card__identity span,
.staff-card__details small {
  overflow-wrap: anywhere;
  color: var(--slate-600);
  font-size: 0.7rem;
}

.staff-card__details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.staff-card__details small {
  flex-basis: 100%;
}

.staff-card__actions {
  display: flex;
  max-width: 340px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.recovery-card {
  display: grid;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--slate-200);
  gap: 12px;
}

.recovery-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.recovery-card__heading h4,
.recovery-card__heading p {
  margin: 0;
}

.recovery-card__heading h4 {
  color: var(--navy-900);
  font-size: 0.86rem;
}

.recovery-card__heading p,
.muted-copy {
  margin-top: 5px;
  color: var(--slate-600);
  font-size: 0.72rem;
  line-height: 1.5;
}

.recovery-list {
  display: grid;
  gap: 8px;
}

.recovery-item {
  display: flex;
  padding: 12px;
  border: 1px solid var(--slate-200);
  border-radius: 11px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--slate-50);
}

.recovery-item > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.recovery-item__actions { display: flex !important; align-items: center; gap: 8px; }

.recovery-item strong {
  color: var(--navy-900);
  font-size: 0.8rem;
}

.recovery-item span,
.recovery-item small {
  overflow-wrap: anywhere;
  color: var(--slate-600);
  font-size: 0.7rem;
}

.password-admin-row {
  display: grid;
  align-items: center;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.tag--primary {
  color: var(--cyan-700);
  background: var(--cyan-100);
}

.portal-dialog {
  width: min(92vw, 610px);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--slate-800);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

.check-row input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--cyan-600);
}

.help-trigger {
  display: inline-grid;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 1px solid var(--cyan-400);
  border-radius: 50%;
  place-items: center;
  color: var(--cyan-700);
  background: var(--cyan-50);
  box-shadow: 0 2px 5px rgba(8, 85, 116, 0.12);
  font: 800 0.7rem/1 system-ui, sans-serif;
  vertical-align: middle;
  cursor: help;
}

[hidden] + .help-trigger { display: none !important; }

.help-trigger:hover,
.help-trigger:focus-visible,
.help-trigger[aria-expanded="true"] {
  border-color: var(--cyan-700);
  color: var(--white);
  background: var(--cyan-700);
  outline: none;
}

.help-trigger:focus-visible {
  box-shadow: 0 0 0 3px var(--cyan-100);
}

.help-tooltip {
  position: fixed;
  z-index: 200;
  width: min(470px, calc(100vw - 20px));
  max-height: min(78vh, 620px);
  padding: 18px 20px 20px;
  overflow-y: auto;
  border: 1px solid var(--slate-200);
  border-left: 5px solid var(--cyan-700);
  border-radius: 0 0 16px 16px;
  color: var(--slate-700);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  font-size: 0.78rem;
  line-height: 1.55;
  pointer-events: auto;
}

.help-tooltip__eyebrow {
  display: block;
  color: var(--cyan-700);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.help-tooltip h3 {
  margin: 3px 0 10px;
  color: var(--navy-900);
  font-size: 1rem;
}

.help-tooltip__section {
  padding: 7px 0;
}

.help-tooltip__section + .help-tooltip__section {
  margin-top: 8px;
}

.help-tooltip__section strong {
  display: block;
  color: var(--navy-900);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.055em;
}

.help-tooltip__section p {
  margin: 2px 0 0;
  color: var(--slate-600);
}

.help-tooltip__section--source,
.help-tooltip__section--importance,
.help-tooltip__section--action,
.help-tooltip__section--objective {
  padding: 10px 12px;
  border: 1px solid #c9ddea;
  border-left: 3px solid #5a9ec4;
  border-radius: 10px;
  background: #f4f9fc;
}

.help-tooltip__section--importance {
  border-color: #d5e0e8;
  border-left-color: #5d94b8;
  background: #f5f8fa;
}

.help-tooltip__section--action {
  border-color: #b9dcf2;
  border-left-color: var(--cyan-700);
  background: #eaf6ff;
}

.help-tooltip__section--action strong { color: var(--cyan-700); }

.help-tooltip__section--objective {
  border-color: #c5d8f1;
  border-left-color: #3974d6;
  background: #f1f6ff;
}

.help-tooltip__section--objective strong { color: #245fbc; }

.help-tooltip[hidden] {
  display: none;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: min(380px, calc(100vw - 48px));
  gap: 10px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--cyan-500);
  border-radius: 12px;
  color: var(--slate-900);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  font-size: 0.78rem;
  line-height: 1.45;
}

.toast--error {
  border-left-color: var(--red-700);
}

.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.loading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 17px;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

  .auth-panel {
    width: 100%;
  }

  .auth-visual {
    display: none;
  }
}

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

  .conversation-layout,
  .plans-layout,
  .lia-layout {
    grid-template-columns: 1fr;
  }

  .clinic-picker,
  .lia-clinic-picker {
    position: static;
    max-height: none;
  }

  .clinic-list,
  .lia-clinic-picker .clinic-list {
    max-height: 280px;
  }

  .lia-service-description {
    grid-column: 1 / -1;
  }

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

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

  .plan-change-form .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  :root {
    --sidebar-width: 246px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    width: 100%;
  }

  .auth-visual {
    display: none;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .workspace {
    margin-left: 0;
    grid-column: 1 / -1;
  }

  .menu-button {
    display: grid;
  }

  .clinic-picker {
    position: static;
    max-height: none;
  }

  .lia-clinic-picker {
    position: static;
    max-height: none;
  }

  .clinic-list {
    max-height: 280px;
  }

  .lia-clinic-picker .clinic-list {
    max-height: 280px;
  }
}

@media (max-width: 680px) {
  .auth-panel {
    padding: 138px 24px 40px;
  }

  .brand--auth {
    top: 24px;
    right: 24px;
    left: 24px;
    width: auto;
    transform: none;
  }

  .brand--auth .brand__logo {
    width: min(100%, 228px);
  }

  .auth-panel__intro h1 {
    font-size: clamp(2rem, 11vw, 2.65rem);
  }

  .auth-title__brand {
    white-space: normal;
  }

  .topbar {
    min-height: 72px;
    padding: 10px 16px;
  }

  .topbar > div:nth-child(2) .eyebrow,
  .user-chip > span:last-child {
    display: none;
  }

  .content {
    padding: 24px 15px 40px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading__actions { justify-content: stretch; }
  .section-heading__actions .button { flex: 1 1 180px; }

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

  .metric-card {
    min-height: 115px;
    padding: 15px;
  }

  .metric-card strong {
    font-size: 1.65rem;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .plan-usage-panel__facts {
    grid-template-columns: 1fr;
  }

  .field--compact {
    width: 100%;
  }

  .conversation-layout {
    min-height: auto;
  }

  .conversation-list-panel,
  .transcript-panel,
  .transcript {
    min-height: 480px;
  }

  .message {
    max-width: 90%;
  }

  .current-plan,
  .plan-change-form,
  .lia-status-grid,
  .lia-field-grid,
  .lia-field-grid--three,
  .lia-field-grid--branding,
  .lia-validation-card {
    grid-template-columns: 1fr;
  }

  .policy-callout,
  .appointment-policy-grid,
  .lia-service-preparation__body {
    grid-template-columns: 1fr;
  }


  .logo-field__row,
  .human-composer__row {
    grid-template-columns: 1fr;
  }

  .lia-optional-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .lia-form-card .panel__header,
  .lia-overview__heading,
  .lia-validation-card {
    align-items: stretch;
  }

  .lia-form-card .panel__header,
  .lia-overview__heading {
    flex-direction: column;
  }

  .lia-form-card .panel__header .button {
    width: 100%;
  }

  .lia-team-actions,
  .staff-card {
    width: 100%;
  }

  .lia-team-actions,
  .staff-card,
  .public-link-box__actions,
  .password-admin-row {
    grid-template-columns: 1fr;
  }

  .lia-team-actions .button,
  .staff-card .button,
  .public-link-box__actions .button,
  .password-admin-row .button {
    width: 100%;
  }

  .staff-card__actions,
  .recovery-card__heading,
  .recovery-item {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .staff-card__actions {
    max-width: none;
  }

  .lia-form-actions > div,
  .confirm-dialog__actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .lia-form-actions .button,
  .confirm-dialog__actions .button {
    width: 100%;
  }

  .plan-change-form .button {
    grid-column: auto;
  }

  .plan-change-submit {
    justify-self: stretch;
    min-width: 0;
    margin-top: 0;
  }

  .confirm-dialog {
    padding: 22px;
  }

  .confirm-list div {
    gap: 6px;
    grid-template-columns: 1fr;
  }

  .confirm-list dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Published clinic identity; platform administrators retain platform branding. */
.sidebar-clinic-name { color: #fff; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.brand--sidebar.is-clinic-brand .brand__logo { filter: none; opacity: 1; max-width: 100%; width: 100%; height: auto; object-fit: contain; padding: 0; background: transparent; border: 1px solid #fff; border-radius: 2px; box-sizing: border-box; box-shadow: none; }
.platform-attribution { display: grid; place-items: center; padding: 8px 12px 4px; min-width: 0; }
.platform-attribution img { display: block; width: min(100%, 170px); height: auto; margin: 0; padding: 0; border: 0; object-fit: contain; filter: brightness(0) invert(1); opacity: .85; }
.platform-attribution[hidden], .sidebar-clinic-name[hidden], .brand__logo[hidden] { display: none; }

.confirm-dialog__actions .button { min-height: 44px; height: auto; white-space: normal; line-height: 1.35; padding-block: 10px; }

/* Brand fills its available width; a fine frame follows the image itself. */
.brand--sidebar.is-clinic-brand { padding: 0; background: transparent; border: 0; box-shadow: none; }
#lia-price-message-preview { white-space: pre-line; }
.lia-price-message-settings { display: grid; gap: 12px; min-width: 0; }
.lia-price-message-settings[hidden] { display: none; }
.lia-care-team { display: grid; gap: 12px; margin-bottom: 20px; }
.lia-care-team h4, .lia-care-team p { margin: 0; }
.lia-care-team p { line-height: 1.5; }
.lia-care-team > button { justify-self: start; }
.lia-care-professional { display: grid; gap: 14px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--border, #d7e2eb); border-radius: 12px; }
.lia-care-professional__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.lia-price-preview { border: 1px solid var(--slate-200); border-radius: var(--radius-sm); }
.lia-price-preview > summary { padding: 12px 14px; cursor: pointer; color: var(--navy-900); font-size: .85rem; font-weight: 700; }
.lia-price-preview > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }
.lia-price-preview__body { display: grid; gap: 12px; padding: 0 14px 14px; overflow-wrap: anywhere; }
.lia-price-preview__body p { margin: 0; }
.lia-price-preview__body .status-badge { justify-self: start; }
.lia-price-preview__body small { color: var(--slate-500); line-height: 1.5; }

/* Fit the editor to its panel, including the narrower desktop column. */
@container (max-width: 860px) {
  .lia-service-fields { grid-template-columns: minmax(90px, .85fr) minmax(130px, 1.4fr) minmax(184px, 1.4fr) minmax(104px, 1fr); }
  .lia-service-name { grid-column: 1 / -1; }
}
@container (max-width: 620px) {
  .policy-callout, .appointment-policy-grid, .lia-service-preparation__body, .staff-card { grid-template-columns: minmax(0, 1fr); }
  .lia-service-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 520px) {
  .lia-field-grid, .lia-field-grid--three { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 460px) {
  .lia-service-fields { grid-template-columns: minmax(0, 1fr); }
  .lia-service-price-toggle { justify-content: flex-start; margin-top: 0; }
}


.lia-answer-preview-result { white-space: pre-wrap; line-height: 1.65; margin: 18px 0 12px; }
.lia-answer-preview-sources { font-size: 0.85rem; overflow-wrap: anywhere; }
[data-program-terms] .field { margin-top: 12px; }

/* R91: meios de pagamento e regras publicados por clínica/serviço. */
.lia-payment-editor { border: 1px solid var(--border, #d5e0e7); border-radius: 12px; padding: 16px; margin: 12px 0; min-width: 0; }
.lia-payment-methods { display: grid; gap: 8px; }
.lia-payment-method { border: 1px solid var(--border, #d5e0e7); border-radius: 8px; padding: 10px 12px; }
.lia-payment-method > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.lia-payment-method > .lia-field-grid { margin-top: 12px; }
.lia-payment-specific { grid-column: 1 / -1; width: 100%; min-width: 0; }
.lia-payment-editor [hidden] { display: none !important; }
.lia-payment-editor input, .lia-payment-editor select, .lia-payment-editor textarea { max-width: 100%; }
@media (max-width: 600px) { .lia-payment-editor { padding: 12px; } .lia-payment-specific { grid-template-columns: 1fr; } }
/* R165: clinic-scoped patient records and notes-only editing. */
.patients-toolbar{display:flex;align-items:end;gap:14px;padding:18px;flex-wrap:wrap}
.patients-toolbar>.field{min-width:180px}
.patients-toolbar>.field--grow{flex:1}
.patients-layout{display:grid;grid-template-columns:minmax(280px,.9fr) minmax(360px,1.3fr);gap:20px;align-items:start}
.patients-list{display:flex;flex-direction:column}
.patients-list-item{display:flex;flex-direction:column;gap:6px;text-align:left;border:0;border-bottom:1px solid #d8e2ea;background:transparent;color:#172b3b;padding:15px 18px;cursor:pointer;overflow-wrap:anywhere;width:100%}
.patients-list-item:hover,.patients-list-item:focus-visible{background:#edf4ff;outline:2px solid #3974d6;outline-offset:-2px}
.patients-list-item>span{font-size:13px;color:#465b6a}.patients-list-item>small{font-size:12px;color:#496a95}
.patients-empty,.patients-detail{padding:18px}.patients-detail{overflow-wrap:anywhere}
.patients-detail .appointment-detail-list{padding:0;margin-bottom:18px}
.patients-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px}
.patients-history-entry,.patients-audit-entry{border-bottom:1px solid #d8e2ea;padding:12px 0}
.patients-history-entry p,.patients-audit-entry p{margin:5px 0;font-size:13px;white-space:pre-wrap}
.patients-detail details{margin:16px 0}.patients-detail summary,#appointment-notes-dialog summary{cursor:pointer;font-weight:700;padding:8px 0}
.patients-reconcile-form,.patients-supplement-form{margin-top:12px}
.patients-confirmation{display:flex;align-items:start;gap:10px;font-size:13px}.patients-confirmation input{margin-top:3px;flex:none}
.appointment-edit-notes{margin:0 20px 14px;width:calc(100% - 40px)}
#appointment-notes-dialog{max-height:90vh;overflow:auto}#appointment-notes-dialog .field-help{font-size:13px;color:#4b6171}
.patients-audit{font-size:13px;max-height:260px;overflow:auto}
@media(max-width:850px){.patients-layout{grid-template-columns:1fr}.patients-list{max-height:330px;overflow:auto}}
@media(max-width:480px){.patients-toolbar{padding:14px;gap:12px}.patients-toolbar>.field{width:100%;min-width:0}.patients-toolbar button{flex:1}.patients-detail{padding:14px}}

/* R171: directory grouped by job, independently of access rights. */
.team-segment { margin-bottom: 18px; }
.team-segment h3 { margin: 0 0 14px; font-size: 1.1rem; }
.team-segment-list { display: grid; gap: 10px; }
.team-segment .team-user-card { margin: 0; background: #f8faff; box-shadow: none; flex-direction: column; align-items: stretch; gap: 14px; }
.team-segment .team-user-card > .team-actions { justify-content: flex-start; }
.team-user-card > div:first-child { min-width: 0; flex: 1; }
.team-user-card p { overflow-wrap: anywhere; white-space: pre-line; }
.team-presentation { margin-top: 22px; }
.team-presentation .panel__header { align-items: flex-start; gap: 16px; }
.team-presentation .team-actions { margin-top: 16px; }
.team-presentation .lia-care-professional__actions { display: flex; }
@media(max-width:600px){.team-segment {padding:16px}.team-presentation .panel__header {flex-wrap:wrap}.team-segment .team-actions {width:100%}}

.lia-layout.lia-layout--single {grid-template-columns:minmax(0,1fr)}

/* Password visibility stays local to the credential field. */
.credential-field { position:relative; min-width:0; width:100%; }
.credential-field input { width:100%; padding-right:48px; }
.credential-eye { position:absolute; right:4px; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:40px; height:40px; border:0; border-radius:8px; color:#245a9d; background:transparent; cursor:pointer; }
.credential-eye:hover { background:#eaf2ff; }
.credential-eye:focus-visible { outline:2px solid #316bce; outline-offset:1px; }
.password-eye-slash[hidden] { display:none; }

.team-health-fields { display:grid; gap:14px; min-width:0; border:1px solid #d3e2f5; border-radius:12px; padding:16px; }
.team-health-fields[hidden] { display:none; }
.team-health-fields legend { font-weight:700; padding:0 6px; }

/* R175: compact registration menu and explicit patient selection. */
.team-create-menu { position:relative; }
.team-create-menu > summary { list-style:none; display:flex; align-items:center; gap:10px; cursor:pointer; }
.team-create-menu > summary::-webkit-details-marker { display:none; }
.team-create-menu .team-create-options { position:absolute; right:0; top:calc(100% + 8px); min-width:245px; max-width:calc(100vw - 44px); max-height:var(--team-create-max-height,440px); overflow-y:auto; overscroll-behavior:contain; box-sizing:border-box; z-index:35; display:grid; gap:4px; padding:8px; border:1px solid #c6d9ef; border-radius:12px; background:#fff; box-shadow:0 10px 30px #193c6429; }
.team-create-menu.team-create-menu--above .team-create-options { top:auto; bottom:calc(100% + 8px); }
.team-create-options button { display:flex; align-items:center; gap:12px; width:100%; padding:12px; border:0; border-radius:8px; background:#fff; color:#183f6d; text-align:left; font:inherit; cursor:pointer; }
.team-create-options button:hover,.team-create-options button:focus-visible { background:#eaf2ff; outline:2px solid #6299db; outline-offset:-2px; }
.team-create-options button span { width:20px; text-align:center; color:#235fab; }
.appointment-patient-results { display:grid; max-height:250px; overflow-y:auto; border:1px solid #bfd3ef; border-radius:10px; padding:4px; gap:4px; background:#fff; }
.appointment-patient-results[hidden] { display:none; }
.appointment-patient-option { display:grid; gap:4px; width:100%; padding:10px 12px; background:#f5f8fd; border:1px solid transparent; border-radius:7px; text-align:left; color:#183f6d; font:inherit; cursor:pointer; overflow-wrap:anywhere; }
.appointment-patient-option span { font-size:13px; }
.appointment-patient-option:hover,.appointment-patient-option[aria-selected="true"] { background:#e4efff; border-color:#6397dc; }
#appointment-patient-new { justify-self:start; }
#appointment-patient-phone[readonly],#appointment-patient-birth-date[readonly] { background:#f5f8fd; }
@media(max-width:600px) {
  .team-create-menu .team-create-options { left:0; right:auto; min-width:0; width:245px; max-width:calc(100vw - 64px); }
}
