:root {
  color-scheme: light;
  --bg: #f3f7f9;
  --surface: #ffffff;
  --surface-muted: #f7fafb;
  --line: #d5e1e6;
  --line-strong: #b8cbd3;
  --text: #16324a;
  --muted: #64798a;
  --brand-navy: #063b6f;
  --brand-blue: #129cc0;
  --accent: #00a99d;
  --accent-strong: #007f83;
  --accent-hover: #006872;
  --accent-soft: #e7f7f5;
  --cyan-soft: #eaf7fb;
  --danger: #b93832;
  --warn: #a96500;
  --ok: #18845f;
  --shadow: 0 8px 24px rgba(6, 59, 111, 0.08);
  --shadow-strong: 0 20px 55px rgba(6, 59, 111, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

::selection {
  background: #bcebea;
  color: var(--brand-navy);
}

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

button {
  min-height: 38px;
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  background: var(--accent-strong);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

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

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(18, 156, 192, 0.24);
  outline-offset: 2px;
}

button.save-success {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary,
.tab-button,
.icon-button {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

button.secondary:hover,
.tab-button:hover,
.tab-button.active,
.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.icon-button {
  width: 40px;
  min-height: 40px;
  padding: 0;
  font-weight: 800;
}

.copy-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: #fff;
}

.copy-icon::before {
  left: 1px;
  top: 5px;
}

.copy-icon::after {
  left: 5px;
  top: 1px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(18, 156, 192, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 82px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 3px 16px rgba(6, 59, 111, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.platform-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.platform-logo-frame {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.platform-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.platform-brand-copy {
  min-width: 0;
}

.topbar h1,
.topbar p,
.section-head h2,
.section-head p {
  margin: 0;
}

.topbar h1 {
  color: var(--brand-navy);
  font-size: 23px;
  line-height: 1.1;
}

.topbar p,
.section-head p,
label,
.muted {
  color: var(--muted);
}

.token-box {
  width: min(460px, 100%);
  display: flex;
  gap: 8px;
}

.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-actions .token-box {
  flex: 1 1 auto;
}

.notification-center {
  position: relative;
  flex: 0 0 auto;
}

.notification-button {
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  border-color: #bfd9e5;
  background: #f4fbfe;
  color: var(--brand-navy);
  padding: 0;
}

.notification-symbol {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 850;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(380px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 110px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-strong);
  padding: 10px;
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--line);
}

.notification-panel-head button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.notification-list {
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border-color: transparent;
  background: #f6fafc;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.notification-item:hover {
  border-color: #b8dce8;
  background: #eef9fb;
}

.notification-item-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dff3f7;
  color: var(--brand-blue);
  font-size: 11px;
  font-weight: 900;
}

.notification-item.severity-warning .notification-item-mark {
  background: #fff0cc;
  color: #8a5a00;
}

.notification-item.severity-danger .notification-item-mark {
  background: #fde8e6;
  color: var(--danger);
}

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

.notification-item strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.notification-item small,
.notification-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.notification-empty {
  padding: 20px 10px;
  text-align: center;
}

.token-box input {
  background: var(--surface-muted);
}

.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: calc(100vh - 83px);
}

.sidebar {
  position: sticky;
  top: 83px;
  align-self: start;
  height: calc(100vh - 83px);
  overflow-y: auto;
  border-right: 0;
  padding: 22px 14px;
  background: var(--brand-navy);
}

.tab-button {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  margin-bottom: 6px;
  border-color: transparent;
  background: transparent;
  color: #dceaf3;
  text-align: left;
  font-weight: 650;
}

.sidebar .tab-button:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.sidebar .tab-button.active {
  border-color: #fff;
  background: #fff;
  color: var(--brand-navy);
  box-shadow: 0 8px 22px rgba(0, 24, 52, 0.2), inset 4px 0 0 var(--accent);
}

.sidebar .tab-button.plan-locked,
.sidebar .tab-button.plan-locked:hover {
  border-color: transparent;
  background: transparent;
  color: rgba(220, 234, 243, 0.48);
  cursor: not-allowed;
  box-shadow: none;
}

.nav-group {
  margin-bottom: 20px;
}

.nav-group-title {
  margin: 0 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.content {
  min-width: 0;
  padding: 28px 32px 40px;
}

.tab-panel {
  display: none;
  width: min(100%, 1440px);
  margin: 0 auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.tab-panel.active {
  display: block;
}

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

.section-head h2 {
  color: var(--brand-navy);
  font-size: 24px;
  line-height: 1.2;
}

.notice {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-blue);
  border-radius: 6px;
  background: var(--cyan-soft);
  color: var(--brand-navy);
  padding: 12px 14px;
}

.notice.error {
  border-left-color: var(--danger);
  background: #fff4f3;
  color: #8f2924;
}

.whatsapp-settings {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

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

.whatsapp-connection-row {
  width: 100%;
  min-height: 64px;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  box-shadow: 0 2px 10px rgba(6, 59, 111, 0.04);
}

.whatsapp-connection-row:hover {
  border-color: var(--brand-blue);
  background: var(--cyan-soft);
  box-shadow: var(--shadow);
}

.whatsapp-connection-row > span:first-child {
  display: grid;
  gap: 4px;
}

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

.connection-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.connection-status-connected {
  border-color: #a9d8bd;
  background: #eefaf3;
  color: var(--ok);
}

.connection-status-error,
.connection-status-expired,
.connection-status-logged_out {
  border-color: #f0b9b4;
  background: #fff4f3;
  color: var(--danger);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  text-align: center;
}

.whatsapp-connection-modal-panel {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 20px;
}

.whatsapp-qr-area {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.whatsapp-qr-frame {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #fff;
}

.whatsapp-qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.danger-button {
  border-color: var(--danger);
  background: #fff;
  color: var(--danger);
}

.danger-button:hover {
  background: #fff1f0;
}

.client-auth-panel {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 20px;
}

body.panel-locked {
  background: #f3f8fa;
}

body.panel-locked #client-auth-modal {
  background: #f3f8fa;
  backdrop-filter: none;
}

.client-auth-brand {
  display: inline-block;
  width: 205px;
  margin-bottom: 18px;
}

.client-auth-brand img {
  width: 100%;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.whatsapp-connection-modal-panel .modal-head,
.client-auth-panel .modal-head {
  position: relative;
  padding-right: 52px;
}

.whatsapp-connection-modal-panel .modal-head > .icon-button,
.client-auth-panel .modal-head > .icon-button {
  position: absolute;
  top: 0;
  right: 0;
}

.auth-mode-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-mode-control button {
  width: 100%;
}

.client-auth-form {
  margin-bottom: 12px;
}

.client-auth-form .actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

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

.auth-form-link {
  display: flex;
  justify-content: flex-end;
  margin-top: -3px;
}

button.link-button {
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 3px 0;
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.link-button:hover {
  border: 0;
  background: transparent;
  color: var(--brand-navy);
}

@media (max-width: 760px) {
  #client-auth-modal {
    align-items: center;
    overflow-y: auto;
  }

  #client-auth-modal .client-auth-panel {
    flex: 0 0 auto;
  }

  .whatsapp-qr-area {
    grid-template-columns: 1fr;
  }

  .whatsapp-qr-frame {
    width: min(100%, 340px);
    margin: 0 auto;
  }
}

.save-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  border: 1px solid #b7dcc7;
  border-left: 5px solid var(--ok);
  border-radius: 8px;
  background: #f0fbf4;
  color: #155c38;
  box-shadow: var(--shadow-strong);
  padding: 13px 16px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.save-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.status-item {
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-blue);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(6, 59, 111, 0.05);
}

.status-item:nth-child(3n + 2) {
  border-top-color: var(--accent);
}

.status-item:nth-child(3n) {
  border-top-color: var(--brand-navy);
}

.status-item strong {
  display: block;
  margin-bottom: 7px;
}

.status-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.usage-value {
  display: block;
  color: var(--brand-navy);
  font-size: 1.28rem;
  font-weight: 800;
}

.subscription-panel {
  max-width: 920px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-blue);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 3px 14px rgba(6, 59, 111, 0.05);
}

.subscription-panel .section-head {
  margin-bottom: 16px;
}

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

.subscription-billing-summary > div:not(.subscription-change-notice) {
  display: grid;
  gap: 6px;
  min-width: 0;
  border-left: 2px solid #b7dbe8;
  padding: 5px 10px;
}

.subscription-billing-summary span {
  color: var(--muted);
  font-size: 11px;
}

.subscription-billing-summary strong {
  overflow-wrap: anywhere;
  color: var(--brand-navy);
  font-size: 13px;
}

.subscription-change-notice {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #f0cf86;
  border-radius: 6px;
  background: #fff8e8;
  padding: 10px 12px;
}

.subscription-change-notice span {
  color: #694800;
}

.subscription-billing-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.button-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-strong);
}

.recurring-card-overlay {
  z-index: 86;
}

.recurring-card-modal-panel {
  width: min(680px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-strong);
}

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

.recurring-card-form label {
  display: grid;
  gap: 6px;
}

.recurring-card-form .span-2 {
  grid-column: 1 / -1;
}

.recurring-card-actions {
  justify-content: flex-end;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.credit-balance-panel {
  display: flex;
  max-width: 620px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(6, 59, 111, 0.05);
}

.credit-balance-panel h2 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 1rem;
}

.credit-balance-value {
  margin-top: 8px;
}

.credit-balance-number {
  display: block;
  color: var(--brand-navy);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.credit-purchase-overlay {
  z-index: 70;
}

.credit-purchase-modal-panel {
  display: grid;
  width: min(660px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow-strong);
}

.credit-purchase-modal-panel .modal-head {
  margin-bottom: 0;
}

.token-purchase-total .status-item {
  margin: 0;
}

.credit-purchase-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.assistant-card-output-list {
  display: grid;
  gap: 10px;
}

.assistant-card-output {
  border: 1px solid #c9d5e2;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.assistant-card-output summary {
  cursor: pointer;
  font-weight: 800;
}

.assistant-card-output p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.assistant-card-output-empty {
  padding: 10px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 2px 10px;
  background: #edf3f6;
  color: var(--muted);
}

.pill.ok {
  background: #e9f7ef;
  color: var(--ok);
}

.pill.warn {
  background: #fff5d9;
  color: var(--warn);
}

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

.form-grid.compact {
  margin-bottom: 22px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
}

label small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}

label.check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
}

label.check input {
  width: auto;
}

.span-2 {
  grid-column: span 2;
}

.split {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  min-height: 620px;
}

.assistant-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.assistant-list {
  min-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(6, 59, 111, 0.05);
}

.assistant-list-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-list button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 12px 14px;
}

.assistant-list button:hover {
  background: var(--cyan-soft);
  color: var(--brand-navy);
}

.assistant-list button.active {
  background: var(--accent-soft);
  color: var(--brand-navy);
  box-shadow: inset 4px 0 0 var(--accent);
}

.assistant-list button strong {
  display: block;
  margin-bottom: 5px;
}

.assistant-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.assistant-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.assistant-status.active {
  border-color: #8bd6cf;
  background: var(--accent-soft);
  color: #006d69;
}

.assistant-status.inactive {
  border-color: #f2c7c2;
  background: #fff4f2;
  color: var(--danger);
}

.assistant-list-full .assistant-list-card {
  display: grid;
  min-height: 98px;
  align-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 15px;
  box-shadow: 0 3px 14px rgba(6, 59, 111, 0.05);
}

.assistant-list-full .assistant-list-card:hover {
  border-color: #8fcfdb;
  background: #f8fdff;
  box-shadow: 0 7px 18px rgba(6, 59, 111, 0.1);
}

.assistant-list-full .assistant-list-card.active {
  border-color: #7ccfc8;
  background: #f4fcfb;
  box-shadow: inset 4px 0 0 var(--accent), 0 7px 18px rgba(6, 59, 111, 0.08);
}

.assistant-card-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assistant-card-heading strong {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  color: var(--brand-navy);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-card-id {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.assistant-create-form {
  max-width: 940px;
}

.assistant-edit-form {
  max-width: none;
}

.assistant-edit-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.assistant-options-panel,
.assistant-accordion-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 14px;
}

.assistant-options-panel {
  position: sticky;
  top: 0;
}

.assistant-accordion-panel {
  background: #fff;
  box-shadow: 0 3px 14px rgba(6, 59, 111, 0.05);
}

.assistant-accordion-head {
  margin-bottom: 12px;
}

.assistant-accordion-head h3,
.assistant-accordion-head p {
  margin: 0;
}

.assistant-accordion-head p {
  color: var(--muted);
}

.assistant-help-row {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px 0;
}

.assistant-create-head {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.assistant-create-head h3 {
  margin: 0 0 4px;
}

.assistant-create-head p {
  margin: 0;
  color: var(--muted);
}

.assistant-create-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.assistant-option {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.assistant-create-accordions {
  display: grid;
  gap: 10px;
}

.assistant-accordion,
.assistant-output-accordion {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.assistant-accordion summary,
.assistant-output-accordion summary {
  min-height: 46px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  background: #f1f7f9;
  color: var(--brand-navy);
}

.assistant-accordion[open] summary,
.assistant-output-accordion[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--cyan-soft);
}

.assistant-accordion label,
.assistant-output-accordion label,
.assistant-output-settings {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.assistant-accordion small,
.assistant-output-accordion small,
.assistant-output-settings small {
  color: var(--muted);
  line-height: 1.4;
}

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

.assistant-transfer-guidance {
  border-left: 4px solid var(--accent);
  background: #f2faf9;
  padding: 11px 12px;
}

.assistant-transfer-guidance strong {
  color: var(--brand-navy);
}

.assistant-transfer-guidance p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.assistant-configuration-fields {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.assistant-configuration-fields label {
  display: grid;
  gap: 8px;
}

.assistant-configuration-fields .assistant-agendaflow-option {
  border: 1px solid #cce2e7;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #f3fafb;
  padding: 12px;
}

.assistant-agendaflow-option .check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--brand-navy);
  font-size: 12px;
  font-weight: 750;
}

.runtime-config-form {
  max-width: 980px;
}

.runtime-config-form label {
  display: grid;
  gap: 8px;
}

.runtime-config-form small {
  color: var(--muted);
  line-height: 1.4;
}

.assistant-create-actions {
  margin-top: 16px;
}

.flow-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.flow-sidebar,
.properties-panel {
  max-height: calc(100vh - 180px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.flow-sidebar {
  order: 2;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-areas:
    "title form"
    "list form";
  gap: 10px 14px;
  max-height: none;
}

.flow-workspace {
  order: 1;
}

.panel-title {
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 700;
}

.flow-sidebar .panel-title {
  grid-area: title;
  margin-bottom: 0;
}

.flow-sidebar .form-grid,
.properties-panel .card-editor {
  grid-template-columns: 1fr;
}

.flow-sidebar #flow-form {
  grid-area: form;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  margin-bottom: 0;
}

.flow-sidebar .span-2,
.properties-panel .span-2 {
  grid-column: span 1;
}

.flow-sidebar #flow-form .span-2 {
  grid-column: span 2;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(6, 32, 59, 0.56);
  backdrop-filter: blur(3px);
}

.card-modal-panel {
  width: min(430px, 100%);
  max-height: min(860px, calc(100vh - 56px));
  overflow: auto;
  background: #fff;
  box-shadow: var(--shadow-strong);
}

.assistant-modal-panel {
  width: min(1120px, 100%);
  max-height: min(880px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-strong);
  box-shadow: 0 22px 60px rgba(31, 41, 51, 0.22);
}

.assistant-status-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 4px 0 20px;
}

.assistant-status-separator {
  height: 1px;
  background: var(--line);
}

.assistant-active-control {
  min-height: 38px;
  padding: 0 4px;
  color: var(--brand-navy);
  font-weight: 750;
}

.assistant-information-section,
.assistant-add-information-section,
.assistant-information-list {
  display: grid;
  gap: 10px;
}

.assistant-information-section {
  margin-bottom: 14px;
}

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

.assistant-information-block {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(6, 59, 111, 0.05);
}

.assistant-information-block.required {
  border-color: #9cd8d2;
  background: #f4fcfb;
}

.assistant-information-card-head {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.assistant-information-block.required .assistant-information-card-head {
  background: #eaf9f7;
}

.assistant-information-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assistant-information-card-actions button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 2px 0;
  font-size: 0.75rem;
  font-weight: 750;
}

.assistant-information-card-actions button:hover {
  background: transparent;
  color: var(--brand-navy);
}

.assistant-information-card-actions .assistant-information-remove {
  color: var(--danger);
}

.assistant-information-open {
  display: grid;
  min-width: 0;
  min-height: 78px;
  align-content: center;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
}

.assistant-information-open:hover {
  background: var(--cyan-soft);
  color: var(--text);
}

.assistant-information-open strong {
  color: var(--brand-navy);
}

.assistant-information-open small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.assistant-add-information-section {
  position: relative;
  justify-items: stretch;
  margin: 4px 0 14px;
}

#assistant-add-information {
  justify-self: start;
}

.assistant-add-information-menu {
  display: grid;
  width: 100%;
  max-height: 520px;
  gap: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 10px;
}

.assistant-standard-information-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.assistant-custom-information-creator {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 12px;
}

.assistant-standard-information-options .assistant-custom-information-option {
  border-style: dashed;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.assistant-custom-information-creator > div,
.assistant-custom-information-creator label {
  display: grid;
  gap: 4px;
}

.assistant-custom-information-creator > div {
  grid-column: 1 / -1;
}

.assistant-custom-information-creator small {
  color: var(--muted);
  line-height: 1.4;
}

.assistant-custom-information-creator label span {
  color: var(--brand-navy);
  font-size: 0.78rem;
  font-weight: 700;
}

.assistant-custom-information-creator [data-create-custom-assistant-field] {
  grid-column: 1 / -1;
  justify-self: start;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.assistant-add-information-menu button {
  min-height: 38px;
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--text);
  text-align: left;
}

.assistant-add-information-menu button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.assistant-field-overlay {
  z-index: 70;
}

.assistant-field-panel {
  width: min(680px, 100%);
  max-height: min(820px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 22px 60px rgba(31, 41, 51, 0.24);
}

.assistant-field-form,
.assistant-field-content,
.assistant-field-content > label,
.assistant-output-editor-item {
  display: grid;
  gap: 8px;
}

.assistant-field-content small,
.assistant-output-editor-item small {
  color: var(--muted);
  line-height: 1.45;
}

.assistant-field-content textarea {
  min-height: 164px;
  resize: vertical;
}

.assistant-field-content .assistant-configuration-fields,
.assistant-field-content .assistant-output-settings {
  padding: 0;
}

.assistant-field-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 18px;
}

.assistant-help-overlay {
  z-index: 80;
}

.assistant-help-panel {
  width: min(620px, 100%);
  max-height: min(780px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 22px 60px rgba(31, 41, 51, 0.24);
}

.assistant-diagnosis-overlay {
  z-index: 90;
}

#assistant-diagnosis-result-modal {
  z-index: 100;
}

.assistant-diagnosis-panel {
  width: min(760px, 100%);
  max-height: min(840px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 22px 60px rgba(31, 41, 51, 0.24);
}

.assistant-diagnosis-form,
.assistant-diagnosis-form label {
  display: grid;
  gap: 8px;
}

.assistant-diagnosis-form {
  gap: 14px;
}

.assistant-diagnosis-form small,
.diagnosis-summary p,
.diagnosis-analysis p,
.diagnosis-suggestion p {
  color: var(--muted);
  line-height: 1.5;
}

.diagnosis-token-warning {
  border: 1px solid #f3d3a2;
  border-radius: 6px;
  background: #fff8eb;
  color: #7a4d0c;
  padding: 10px 12px;
}

.assistant-diagnosis-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 4px;
}

.assistant-diagnosis-history {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.diagnosis-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.diagnosis-history-head h4,
.assistant-diagnosis-result h4 {
  margin: 0;
}

.assistant-diagnosis-history-list {
  display: grid;
  gap: 8px;
}

.assistant-diagnosis-history-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
}

.assistant-diagnosis-history-item:hover {
  border-color: #8bb9d9;
  background: #f4f9fc;
}

.assistant-diagnosis-history-item span,
.assistant-diagnosis-history-item small {
  color: var(--muted);
}

.assistant-diagnosis-result {
  display: grid;
  gap: 16px;
}

.diagnosis-summary,
.diagnosis-analysis,
.diagnosis-suggestions,
.diagnosis-tests,
.diagnosis-missing {
  display: grid;
  gap: 8px;
}

.diagnosis-summary,
.diagnosis-analysis {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.diagnosis-summary p,
.diagnosis-analysis p {
  margin: 0;
  color: var(--text);
}

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

.diagnosis-scope {
  border: 1px solid #9bcfd0;
  border-radius: 999px;
  background: #edfafa;
  color: #075d65;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.diagnosis-evidence,
.diagnosis-checklist ol,
.diagnosis-checklist ul,
.diagnosis-missing ul {
  margin: 2px 0 0;
  padding-left: 20px;
}

.diagnosis-evidence li,
.diagnosis-checklist li,
.diagnosis-missing li {
  margin: 4px 0;
  line-height: 1.4;
}

.diagnosis-application-note {
  border-left: 3px solid #d69a12;
  border-radius: 4px;
  background: #fff8e6;
  color: #684700;
  padding: 10px 12px;
  line-height: 1.45;
}

.diagnosis-suggestions {
  gap: 10px;
}

.diagnosis-suggestion {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 12px;
}

.diagnosis-suggestion-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.diagnosis-suggestion-head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.diagnosis-suggestion .diagnosis-target {
  color: #345368;
  font-size: 13px;
}

.diagnosis-checklist {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.diagnosis-checklist > strong {
  font-size: 13px;
}

.diagnosis-checklist.verification {
  border-top-style: dashed;
}

.diagnosis-tests {
  gap: 10px;
}

.diagnosis-test {
  border-left: 3px solid #0b8f91;
  background: #f4fbfb;
  padding: 10px 12px;
}

.diagnosis-test p {
  margin: 6px 0 0;
  line-height: 1.4;
}

.diagnosis-diff {
  margin-top: 8px;
  display: grid;
  gap: 5px;
  border-left: 3px solid;
  border-radius: 4px;
  padding: 9px 10px;
  white-space: pre-wrap;
}

.diagnosis-diff strong {
  font-size: 12px;
  text-transform: uppercase;
}

.diagnosis-diff span {
  line-height: 1.45;
}

.diagnosis-diff.removed {
  border-color: #c62828;
  background: #fff1f1;
  color: #9b1c1c;
}

.diagnosis-diff.added {
  border-color: #1d6fa5;
  background: #eff8ff;
  color: #0b517e;
}

.diagnosis-final-text {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  color: var(--muted);
}

.diagnosis-final-text summary {
  cursor: pointer;
  font-weight: 700;
}

.diagnosis-final-text div {
  margin-top: 8px;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
}

.token-warning-overlay {
  z-index: 35;
}

.plan-feature-overlay {
  z-index: 95;
}

.plan-feature-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-strong);
}

.plan-feature-badge {
  display: inline-flex;
  margin-bottom: 7px;
  border: 1px solid #8fd8cf;
  border-radius: 999px;
  background: #eaf9f6;
  color: #087b70;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

.plan-feature-callout {
  margin: 18px 0;
  border-left: 4px solid var(--accent);
  background: #f2faf9;
  padding: 14px 16px;
}

.plan-feature-callout strong {
  color: var(--brand-navy);
}

.plan-feature-callout p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.plan-feature-actions {
  justify-content: flex-end;
}

.token-warning-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 22px 60px rgba(31, 41, 51, 0.24);
}

.token-warning-panel > p {
  margin: 14px 0 18px;
  color: var(--text);
}

.token-warning-actions {
  justify-content: flex-end;
}

.assistant-help-form,
.assistant-help-questions {
  display: grid;
  gap: 12px;
}

.assistant-help-questions label {
  display: grid;
  gap: 7px;
}

.assistant-help-questions span {
  font-weight: 700;
}

.assistant-help-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

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

.modal-head h3,
.modal-head p {
  margin: 0;
}

.modal-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-navy);
  font-size: 18px;
}

.assistant-modal-actions {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

.card-modal-icon {
  font-size: 19px;
  line-height: 1;
}

.card-modal-panel .card-editor,
.card-editor-body,
.card-type-section {
  display: grid;
  gap: 14px;
}

.card-editor-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.card-initial-toggle {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--text);
}

.card-type-section[hidden] {
  display: none;
}

.editor-label {
  color: var(--text);
  font-size: 14px;
}

.rich-field {
  overflow: hidden;
  border: 1px solid #d8c8ff;
  border-radius: 8px;
  background: #fbfbff;
}

.rich-field:focus-within {
  border-color: #9b7bff;
  box-shadow: 0 0 0 3px rgba(155, 123, 255, 0.12);
}

.rich-field textarea {
  min-height: 94px;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: vertical;
}

.rich-toolbar {
  display: flex;
  gap: 12px;
  padding: 8px 12px 10px;
}

.rich-toolbar button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #39434d;
  font-weight: 800;
}

.radio-stack {
  display: grid;
  gap: 8px;
}

.radio-stack label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.radio-stack input {
  width: auto;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.ghost-card-button {
  width: 100%;
  min-height: 40px;
  border-style: dashed;
  background: #fbfcfd;
}

.ghost-card-button.purple {
  border-color: #cbb8ff;
  background: #f3edff;
  color: #6d3fd7;
}

.ghost-card-button.yellow {
  border-color: #f5d18a;
  background: #fff8e8;
  color: #f59e0b;
}

.ghost-card-button.green {
  border-color: #a8ddb2;
  background: #edf9ef;
  color: #22a440;
}

.ghost-card-button.cyan {
  border-color: #9ddfec;
  background: #edfaff;
  color: #0ea5c8;
}

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

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 0.8fr) 30px;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.randomizer-row {
  grid-template-columns: minmax(0, 1.2fr) 68px minmax(0, 0.8fr) 30px;
}

.option-row input {
  min-height: 34px;
  padding: 7px 8px;
}

.option-remove {
  min-height: 30px;
  height: 30px;
  padding: 0;
  border-color: #efd1d1;
  background: #fff7f7;
  color: var(--danger);
}

.randomizer-warning {
  border-radius: 8px;
  background: #fff5f5;
  color: #ef4444;
  padding: 10px 12px;
  font-size: 13px;
}

.condition-grid {
  display: grid;
  gap: 8px;
}

.card-meta-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.card-meta-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.card-meta-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.card-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.card-modal-panel .span-2 {
  grid-column: span 2;
}

.flow-list {
  max-height: 170px;
  margin-bottom: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-sidebar .flow-list {
  grid-area: list;
}

.flow-list button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.flow-list button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.flow-workspace {
  position: relative;
  min-width: 0;
}

.canvas-head {
  min-height: 58px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.canvas-head h3,
.canvas-head p {
  margin: 0;
}

.canvas-head h3 {
  font-size: 17px;
}

.flow-canvas-wrap {
  position: relative;
  min-height: 720px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-canvas {
  position: relative;
  width: 1700px;
  height: 1000px;
  background-color: #ffffff;
  background-image:
    linear-gradient(#eef1f4 1px, transparent 1px),
    linear-gradient(90deg, #eef1f4 1px, transparent 1px);
  background-size: 28px 28px;
}

.connection-layer,
#flow-nodes {
  position: absolute;
  inset: 0;
}

.connection-layer {
  z-index: 1;
  pointer-events: none;
}

#flow-nodes {
  z-index: 2;
  pointer-events: none;
}

.connection-path {
  fill: none;
  stroke: #4f6373;
  stroke-width: 3;
  stroke-linecap: round;
  cursor: pointer;
  pointer-events: stroke;
}

.connection-path:hover {
  stroke: var(--danger);
  stroke-width: 4;
}

.connection-path.draft {
  stroke: var(--accent);
  stroke-dasharray: 8 7;
}

.flow-card-node {
  --card-color: #3d6f8e;
  --card-bg: #f5f8fb;
  --card-badge-bg: #eef3f7;
  --card-badge-text: #405466;
  position: absolute;
  width: 132px;
  height: 64px;
  min-height: 56px;
  border: 1px solid #cfd7e1;
  border-left: 5px solid var(--card-color);
  border-radius: 8px;
  background:
    linear-gradient(180deg, var(--card-bg), #fff 72%),
    #fff;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.12);
  cursor: grab;
  overflow: visible;
  pointer-events: auto;
  user-select: none;
}

.flow-card-node.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 156, 192, 0.18), 0 12px 28px rgba(6, 59, 111, 0.14);
}

.flow-card-node.type-menu {
  --card-color: var(--accent);
  --card-bg: #edf8f5;
  --card-badge-bg: #dff1ec;
  --card-badge-text: #1f5c54;
  border-color: #b9d7cf;
}

.flow-card-node.type-content {
  --card-color: #2d5d88;
  --card-bg: #edf4fa;
  --card-badge-bg: #dbeafa;
  --card-badge-text: #28557b;
  border-color: #bdd0e2;
}

.flow-card-node.type-action {
  --card-color: #9a4d27;
  --card-bg: #fff4eb;
  --card-badge-bg: #f7dfcf;
  --card-badge-text: #7b3e20;
  border-color: #e7c1a9;
}

.flow-card-node.type-condition {
  --card-color: #5b6ee1;
  --card-bg: #f0f2ff;
  --card-badge-bg: #e0e4ff;
  --card-badge-text: #4253b8;
  border-color: #c5cbf5;
}

.flow-card-node.type-connection {
  --card-color: #6d5a8f;
  --card-bg: #f5f1fb;
  --card-badge-bg: #e7def5;
  --card-badge-text: #594776;
  border-color: #d0c2e3;
}

.flow-card-node.type-randomizer {
  --card-color: #0d8ca8;
  --card-bg: #edfaff;
  --card-badge-bg: #d6f1f8;
  --card-badge-text: #0d6e84;
  border-color: #bce1ea;
}

.flow-card-node.type-delay {
  --card-color: #4d6f58;
  --card-bg: #f1f7f3;
  --card-badge-bg: #deebe1;
  --card-badge-text: #3f5d49;
  border-color: #c6d8ca;
}

.flow-card-node.type-assistant {
  --card-color: #1f7a4d;
  --card-bg: #effaf3;
  --card-badge-bg: #d8f1e2;
  --card-badge-text: #1e6843;
  border-color: #b7dcc7;
}

.node-head {
  display: grid;
  gap: 2px;
  padding: 8px 50px 8px 10px;
}

.node-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-type {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.node-input,
.node-output,
.node-resize,
.node-delete,
.node-duplicate,
.add-card-button {
  display: inline-grid;
  place-items: center;
}

.node-input,
.node-output {
  position: absolute;
  top: 50%;
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  border-radius: 999px;
  transform: translateY(-50%);
}

.node-input {
  left: -10px;
  border: 2px solid #4f6373;
  background: #fff;
}

.node-output {
  right: -10px;
  border: 2px solid var(--accent-strong);
  background: var(--accent);
  cursor: crosshair;
}

.node-output-option {
  top: 50%;
}

.node-delete,
.node-duplicate {
  position: absolute;
  top: 6px;
  width: 20px;
  min-height: 20px;
  height: 20px;
  padding: 0;
  border-radius: 5px;
  border-color: #d8e0e8;
  background: #fff;
  color: #7c8794;
  font-size: 11px;
  font-weight: 800;
}

.node-delete {
  right: 6px;
}

.node-duplicate {
  right: 30px;
}

.node-duplicate:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.node-delete:hover {
  border-color: var(--danger);
  background: #fff3f1;
  color: var(--danger);
}

.node-resize {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 0 45%, #8b98a6 45% 55%, transparent 55%),
    linear-gradient(135deg, transparent 0 62%, #8b98a6 62% 72%, transparent 72%);
  cursor: nwse-resize;
}

.node-resize:hover {
  background:
    linear-gradient(135deg, transparent 0 45%, var(--accent) 45% 55%, transparent 55%),
    linear-gradient(135deg, transparent 0 62%, var(--accent) 62% 72%, transparent 72%);
}

.add-card-button {
  position: absolute;
  top: 74px;
  right: 16px;
  z-index: 4;
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.18);
}

.simulate-flow-button {
  position: absolute;
  top: 74px;
  right: 68px;
  z-index: 4;
  min-height: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fff;
  color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.14);
}

.add-card-menu {
  position: absolute;
  top: 124px;
  right: 16px;
  z-index: 4;
  width: 214px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.add-card-menu button {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 6px;
  background: #fff;
  color: var(--text);
  border-color: var(--line);
  text-align: left;
  cursor: grab;
}

.add-card-menu button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.add-card-menu button:active {
  cursor: grabbing;
}

.empty-canvas {
  position: absolute;
  left: 80px;
  top: 90px;
  width: 320px;
  border: 1px dashed #b8c3ce;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 18px;
}

.simulator-panel {
  width: min(760px, 100%);
  max-height: min(840px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid #c7dee7;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 28px rgba(6, 59, 111, 0.08);
}

.simulator-panel-embedded {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  box-shadow: none;
}

#tab-simulator.active {
  display: grid;
  height: calc(100dvh - 151px);
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

#tab-simulator .simulator-section-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
}

#tab-simulator .simulator-controls {
  width: min(360px, 100%);
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 10px;
}

#tab-simulator .simulator-panel .modal-head {
  margin-bottom: 10px;
}

.simulator-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.simulator-controls label[hidden] {
  display: none;
}

.simulator-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 420px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #eff6f8;
  background-image: linear-gradient(rgba(18, 156, 192, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(18, 156, 192, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  padding: 16px;
}

#tab-simulator .simulator-thread {
  min-height: 0;
  max-height: none;
}

.simulator-empty {
  margin: auto;
  max-width: 320px;
  color: var(--muted);
  text-align: center;
}

.simulator-message {
  width: fit-content;
  max-width: min(78%, 520px);
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  box-shadow: 0 5px 14px rgba(31, 41, 51, 0.08);
}

.simulator-message.patient {
  align-self: flex-end;
  border-color: #9bd9d3;
  background: var(--accent-soft);
}

.simulator-message.bot {
  align-self: flex-start;
  border-color: #bdd7e2;
}

.simulator-message.typing {
  color: var(--muted);
  font-style: italic;
}

.simulator-message span {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-navy);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.simulator-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  line-height: 1.45;
}

.simulator-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.simulator-options button {
  min-height: 34px;
  border-color: #77cfc7;
  background: #f3fbfa;
  color: var(--brand-navy);
  font-weight: 700;
}

.simulator-options button:hover {
  border-color: var(--accent);
  background: #dff5f2;
}

.simulator-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

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

.chatbox-conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 62px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 10px rgba(6, 59, 111, 0.04);
}

.chatbox-conversation-row:hover {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow);
}

.chatbox-row-main {
  display: grid;
  min-width: 0;
  min-height: 60px;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 9px 12px;
  text-align: left;
}

.chatbox-row-main:hover {
  border-color: transparent;
  background: var(--cyan-soft);
  color: var(--text);
}

.chatbox-row-head,
.chatbox-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.chatbox-row-identity {
  display: flex;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.chatbox-row-identity strong {
  color: var(--brand-navy);
  font-size: 0.84rem;
}

.chatbox-row-identity > span {
  color: var(--muted);
  font-size: 0.76rem;
}

.chatbox-row-preview {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbox-row-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 0.7rem;
}

.chatbox-row-control {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.7rem;
}

.chatbox-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-right: 10px;
}

.chatbox-row-edit {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.7rem;
}

.chatbox-modal-panel {
  display: grid;
  width: min(820px, 100%);
  max-height: min(860px, calc(100vh - 56px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-strong);
}

.chatbox-modal-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.lead-edit-modal-panel {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-strong);
}

.lead-edit-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.lead-export-modal-panel {
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-strong);
}

.lead-export-form,
.lead-export-options {
  display: grid;
  gap: 10px;
}

.lead-export-options {
  margin: 0;
  border: 0;
  padding: 0;
}

.lead-export-options legend {
  margin-bottom: 10px;
  color: var(--brand-navy);
  font-size: 0.82rem;
  font-weight: 750;
}

.lead-export-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 10px 12px;
  cursor: pointer;
}

.lead-export-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.lead-export-option input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.lead-export-option span {
  color: var(--brand-navy);
  font-weight: 700;
}

.lead-export-actions {
  justify-content: flex-end;
  margin-top: 6px;
}

.field-error {
  margin: 0;
  color: #b42318;
  font-size: 0.8rem;
  font-weight: 650;
}

.chatbox-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 360px;
  max-height: 620px;
  overflow: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #eff6f8;
  background-image: linear-gradient(rgba(18, 156, 192, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(18, 156, 192, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  padding: 16px;
}

.chatbox-message {
  width: fit-content;
  max-width: min(78%, 580px);
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  box-shadow: 0 5px 14px rgba(31, 41, 51, 0.08);
}

.chatbox-message.inbound {
  align-self: flex-end;
  border-color: #9bd9d3;
  background: var(--accent-soft);
}

.chatbox-message span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.chatbox-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.file-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #fbfcfd;
}

.file-list button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.file-list button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.editor {
  min-height: 620px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.actions {
  display: flex;
  gap: 8px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(6, 59, 111, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #edf5f8;
  color: var(--brand-navy);
  font-weight: 700;
}

tbody tr:hover {
  background: #f5fbfc;
}

td button {
  margin-right: 6px;
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .subscription-billing-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    position: relative;
    padding: 14px 16px;
  }

  .platform-brand {
    align-self: flex-start;
  }

  .platform-logo-frame {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .topbar-actions {
    width: 100%;
  }

  .token-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
  }

  .layout {
    min-height: 0;
  }

  .layout,
  .split,
  .assistant-layout,
  .assistant-edit-layout,
  .flow-builder,
  .card-editor,
  .form-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .assistant-options-panel {
    position: static;
  }

  .flow-sidebar,
  .properties-panel {
    max-height: none;
  }

  .flow-sidebar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "list"
      "form";
  }

  .flow-sidebar #flow-form {
    grid-template-columns: 1fr;
  }

  .flow-sidebar #flow-form .span-2 {
    grid-column: span 1;
  }

  .flow-canvas-wrap {
    min-height: 560px;
  }

  .simulate-flow-button {
    top: 124px;
    right: 16px;
  }

  .add-card-menu {
    top: 174px;
  }

  .modal-overlay {
    align-items: stretch;
    padding: 14px;
  }

  .modal-head {
    flex-direction: column;
  }

  .assistant-modal-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .card-modal-panel .card-editor {
    grid-template-columns: 1fr;
  }

  .card-modal-panel .span-2 {
    grid-column: span 1;
  }

  .option-row,
  .randomizer-row {
    grid-template-columns: 1fr;
  }

  .card-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .simulator-thread {
    min-height: 320px;
    max-height: none;
  }

  #tab-simulator.active {
    height: calc(100dvh - 260px);
  }

  #tab-simulator .simulator-thread {
    min-height: 0;
  }

  .simulator-message {
    max-width: 92%;
  }

  .simulator-compose {
    grid-template-columns: 1fr;
  }

  .simulator-controls {
    grid-template-columns: 1fr;
  }

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

  .diagnosis-suggestion-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .credit-balance-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .credit-balance-panel button {
    width: 100%;
  }

  .assistant-list-full {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 18;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid #0b4d83;
    padding: 10px 12px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    display: flex;
    gap: 8px;
    width: max-content;
    margin: 0;
  }

  .sidebar .tab-button {
    width: auto;
    min-height: 40px;
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .content {
    padding: 20px 16px 32px;
  }

  .section-head h2 {
    font-size: 22px;
  }

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 560px) {
  .token-box {
    grid-template-columns: 1fr 1fr;
  }

  .token-box input {
    grid-column: 1 / -1;
  }

  .token-box button {
    width: 100%;
  }

  .platform-brand-copy p {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .content {
    padding-right: 12px;
    padding-left: 12px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .actions {
    flex-wrap: wrap;
  }

  .assistant-custom-information-creator {
    grid-template-columns: 1fr;
  }

  #tab-simulator.active {
    height: calc(100dvh - 320px);
  }

  #tab-simulator .simulator-compose {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chatbox-conversation-row {
    gap: 4px;
  }

  .chatbox-row-control {
    padding: 0 8px;
  }

  .chatbox-row-actions {
    margin-right: 6px;
  }
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.plan-option {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-blue);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 5px 18px rgba(6, 59, 111, 0.06);
}

.plan-option.plan-plus {
  border-color: #79cfc7;
  border-top-color: var(--accent);
  box-shadow: 0 9px 26px rgba(0, 127, 131, 0.13);
}

.plan-option.plan-selected {
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(0, 127, 131, 0.16);
}

.plan-option.plan-recommended {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(21, 148, 199, 0.16), 0 12px 30px rgba(6, 59, 111, 0.14);
}

.plan-option.plan-pending {
  border-color: #e2a62f;
  box-shadow: 0 8px 24px rgba(170, 111, 0, 0.13);
}

.plan-payment-status {
  margin: 0 0 16px;
  border: 1px solid #f0cf86;
  border-radius: 6px;
  background: #fff8e8;
  color: #785100;
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 700;
}

.plan-payment-overlay {
  z-index: 84;
}

.plan-payment-modal-panel {
  width: min(620px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-strong);
}

.plan-quote-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.plan-quote-summary > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px;
}

.plan-quote-summary span,
.plan-quote-summary small {
  color: var(--muted);
  font-size: 12px;
}

.plan-quote-summary strong {
  color: var(--brand-navy);
  font-size: 18px;
}

.plan-quote-summary > small {
  grid-column: 1 / -1;
}

.plan-exchange-warning {
  margin: 15px 0;
  border-left: 3px solid #e2a62f;
  background: #fff8e8;
  color: #694800;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.plan-payment-form,
.plan-boleto-customer-fields {
  display: grid;
  gap: 12px;
}

.plan-payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.credit-payment-methods {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-payment-methods legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.plan-payment-methods label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
}

.plan-payment-methods label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.plan-payment-methods input {
  width: auto;
  margin-top: 3px;
}

.plan-payment-methods span {
  display: grid;
  gap: 4px;
}

.plan-payment-methods small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.plan-boleto-customer-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.plan-boleto-customer-fields label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.plan-payment-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.plan-option.plan-light {
  border-top-color: var(--ok);
}

.plan-option.plan-plus {
  border-top-color: var(--accent);
}

.plan-option header {
  position: relative;
}

.plan-option header span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.plan-popular-badge {
  position: absolute;
  top: -2px;
  right: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 7px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-option h3 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 24px;
}

.plan-option header p {
  min-height: 42px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.plan-price-placeholder {
  margin: 17px 0 15px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.plan-price-placeholder small {
  font-size: 12px;
  font-weight: 700;
}

.plan-option ul {
  display: grid;
  align-content: start;
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.plan-option li {
  position: relative;
  min-height: 20px;
  padding-left: 24px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.plan-option li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ok);
  font-weight: 900;
}

.plan-credit-feature {
  margin-top: 4px;
  color: var(--brand-navy) !important;
}

.plan-credit-feature small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.plan-option > button {
  width: 100%;
}

.plan-option > button:disabled {
  border-color: var(--ok);
  background: #edf8f3;
  color: var(--ok);
  opacity: 1;
}

button.plan-locked,
button.plan-locked:hover {
  border-color: var(--line-strong);
  background: #eef3f5;
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.plan-control-locked {
  color: var(--muted);
  opacity: 0.65;
}

.plans-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.agenda-subtabs {
  display: flex;
  gap: 4px;
  align-self: flex-end;
  margin: 0 0 -21px;
  border-bottom: 0;
}

.agenda-section-head {
  align-items: flex-end;
  min-height: 86px;
}

.agenda-section-title {
  min-width: 230px;
}

.agenda-subtab {
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  box-shadow: none;
}

.agenda-subtab:hover,
.agenda-subtab.active {
  border-bottom-color: var(--accent);
  background: #f2fafb;
  color: var(--brand-navy);
  box-shadow: none;
}

.agenda-filterbar {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(140px, .8fr) minmax(140px, .8fr) minmax(210px, 1.2fr) auto;
  align-items: end;
  gap: 9px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
}

.agenda-filterbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.agenda-filterbar select,
.agenda-filterbar input {
  min-height: 38px;
  padding: 7px 9px;
}

.agenda-filterbar > button {
  min-height: 38px;
  white-space: nowrap;
}

.agenda-client-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.agenda-management-form,
.agenda-directory {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.agenda-management-form.compact {
  align-content: start;
  padding: 16px;
}

.agenda-management-form label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.agenda-management-form label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.agenda-management-form .check {
  display: flex;
}

.agenda-form-head,
.agenda-directory-head,
.agenda-pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agenda-form-head h3,
.agenda-directory-head h3,
.agenda-pane-head h4 {
  margin: 0;
  color: var(--brand-navy);
}

.agenda-form-head p,
.agenda-directory-head p,
.agenda-pane-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.agenda-directory {
  min-height: 440px;
}

.agenda-directory-head input {
  width: min(300px, 44vw);
}

.agenda-directory-list,
.agenda-config-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.agenda-directory-item,
.agenda-config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 12px 14px;
}

.agenda-directory-item.inactive,
.agenda-config-item.inactive {
  background: #f5f7f8;
  opacity: 0.7;
}

.agenda-directory-item > div:first-child,
.agenda-config-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.agenda-directory-item strong,
.agenda-config-item strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.agenda-directory-item span,
.agenda-config-item span,
.agenda-config-item small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.agenda-item-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.agenda-item-actions button,
.agenda-config-item > button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.danger-link {
  border-color: #efc2be;
  background: #fff7f6;
  color: var(--danger);
  box-shadow: none;
}

.danger-link:hover {
  border-color: var(--danger);
  background: #fdeceb;
  color: var(--danger);
  box-shadow: none;
}

.agenda-settings-overlay {
  z-index: 75;
}

.agenda-settings-panel {
  width: min(1180px, 100%);
  height: min(820px, calc(100vh - 42px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow-strong);
}

.agenda-settings-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.agenda-settings-tabs {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.agenda-settings-tabs button {
  min-height: 40px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 9px 11px;
  text-align: left;
  box-shadow: none;
}

.agenda-settings-tabs button:hover,
.agenda-settings-tabs button.active {
  border-left-color: var(--accent);
  background: #edf9fa;
  color: var(--brand-navy);
  box-shadow: none;
}

.agenda-settings-content {
  min-width: 0;
  overflow: auto;
  padding: 0 4px 10px 0;
}

.agenda-settings-pane {
  display: grid;
  gap: 16px;
}

.agenda-settings-pane[hidden] {
  display: none;
}

.agenda-pane-head {
  display: grid;
}

.agenda-pane-head h4 {
  font-size: 18px;
}

.agenda-config-split {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.agenda-config-list {
  min-height: 180px;
  padding: 2px;
}

.agenda-hours-list {
  display: grid;
  gap: 7px;
}

.agenda-hours-list.compact {
  margin-top: 8px;
}

.agenda-hours-row {
  border-bottom: 1px solid #e7eef1;
  padding: 9px 0;
}

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

.agenda-hours-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.agenda-hours-day-head .agenda-add-interval {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 10px;
}

.agenda-hours-intervals {
  display: grid;
  gap: 6px;
  padding-left: 28px;
}

.agenda-hours-interval {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) minmax(105px, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.agenda-hours-row label,
.agenda-hours-interval label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.agenda-hours-day-head .check {
  align-self: center;
  display: flex;
  color: var(--text);
  font-size: 12px;
}

.agenda-hours-interval input[type="time"] {
  min-height: 36px;
  padding: 6px 8px;
}

.agenda-hours-row.disabled .agenda-hours-intervals {
  opacity: 0.55;
}

.agenda-remove-interval {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 10px;
}

.agenda-weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.agenda-weekday-picker legend {
  color: var(--brand-navy);
  font-size: 11px;
  font-weight: 800;
  padding: 0 4px;
}

.agenda-weekday-picker label {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #d5e2e7;
  border-radius: 5px;
  background: #f8fbfc;
  padding: 6px 8px;
}

.agenda-field-title {
  display: block;
  color: var(--brand-navy);
  font-size: 12px;
}

.agenda-plan-note {
  margin: 0;
  border-left: 3px solid var(--brand-blue);
  background: #eff8fc;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 11px;
}

.agenda-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px 9px;
}

.agenda-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-navigation .icon-button {
  min-width: 34px;
  min-height: 34px;
  font-size: 24px;
  line-height: 1;
}

.agenda-navigation .secondary {
  min-height: 34px;
  padding: 6px 13px;
}

.agenda-date-control,
.agenda-status-control {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 750;
}

.agenda-date-control {
  width: 150px;
}

.agenda-status-control {
  width: 210px;
}

.agenda-toolbar h3 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 14px;
  text-align: center;
}

.agenda-calendar-modes {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  overflow: hidden;
  border: 1px solid #cfdce3;
  border-radius: 6px;
  background: #fff;
}

.agenda-calendar-modes button {
  min-height: 34px;
  border: 0;
  border-left: 1px solid #dbe5ea;
  border-radius: 0;
  background: #fff;
  color: var(--brand-navy);
  padding: 6px 13px;
  font-size: 11px;
  font-weight: 750;
  box-shadow: none;
}

.agenda-calendar-modes button:first-child {
  border-left: 0;
}

.agenda-calendar-modes button:hover {
  background: #eff8fa;
}

.agenda-calendar-modes button.active {
  background: var(--accent);
  color: #fff;
}

.agenda-conflict-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin: 0 0 10px;
  border: 1px solid #e9a7a2;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  background: #fff5f4;
  color: #7e2925;
  padding: 10px 11px;
}

.appointment-conflict-alert {
  margin-top: 12px;
}

.agenda-conflict-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.agenda-conflict-alert strong {
  display: block;
  margin-bottom: 2px;
  color: #7e2925;
  font-size: 12px;
}

.agenda-conflict-alert p {
  margin: 0;
  color: #8f3b36;
  font-size: 11px;
  line-height: 1.45;
}

.agenda-conflict-alert .icon-button {
  min-width: 28px;
  min-height: 28px;
  border-color: transparent;
  background: transparent;
  color: #7e2925;
  padding: 3px;
}

.agenda-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.agenda-metrics > div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 12px;
}

.agenda-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.agenda-metrics strong {
  color: var(--brand-navy);
  font-size: 19px;
}

.agenda-period-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.agenda-period-head h3 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 17px;
}

.agenda-week {
  min-height: 470px;
  max-height: min(720px, calc(100vh - 238px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.agenda-calendar-grid {
  display: grid;
  grid-template-columns: 70px repeat(var(--agenda-day-count, 7), minmax(138px, 1fr));
  min-width: var(--agenda-grid-min-width, 980px);
  position: relative;
}

.agenda-calendar-grid.day-mode {
  --agenda-grid-min-width: 520px;
}

.agenda-calendar-corner,
.agenda-calendar-day {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 48px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.agenda-calendar-corner {
  left: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.agenda-calendar-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
}

.agenda-calendar-day span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.agenda-calendar-day strong {
  color: var(--text);
  font-size: 13px;
}

.agenda-calendar-day.today {
  background: var(--accent-soft);
  box-shadow: inset 0 3px 0 var(--accent);
}

.agenda-time-label {
  position: sticky;
  left: 0;
  z-index: 1;
  min-height: 48px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  color: var(--muted);
  padding: 6px 7px;
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.agenda-time-cell {
  min-width: 0;
  min-height: 48px;
  display: grid;
  align-content: start;
  gap: 5px;
  border-right: 1px solid #e5ecef;
  border-bottom: 1px solid #e5ecef;
  background: #fff;
  padding: 4px;
  cursor: pointer;
}

.agenda-time-cell:hover {
  background: #f0fafb;
}

.agenda-time-cell.closed {
  background: #f5f6f7;
  cursor: default;
}

.agenda-time-cell.agenda-drag-target {
  position: relative;
  z-index: 5;
  border-bottom-color: transparent;
  transition: background 100ms ease, box-shadow 100ms ease;
}

.agenda-time-cell.agenda-drag-valid {
  background: #e5f7ef;
  box-shadow: inset 0 0 0 2px #1a9b70;
}

.agenda-time-cell.agenda-drag-invalid {
  background: #fff0ef;
  box-shadow: inset 0 0 0 2px #d94b45;
}

.agenda-time-cell.agenda-drag-target-start::after {
  content: attr(data-agenda-drag-label);
  position: absolute;
  top: 4px;
  left: 5px;
  z-index: 2;
  border-radius: 4px;
  background: #fff;
  color: var(--brand-navy);
  padding: 2px 5px;
  font-size: 9px;
  font-weight: 850;
  box-shadow: 0 1px 4px rgba(7, 59, 102, 0.16);
  pointer-events: none;
}

.agenda-calendar-day.agenda-drag-day.agenda-drag-valid,
.agenda-time-label.agenda-drag-time.agenda-drag-valid {
  background: #dff4e9;
  color: #14704f;
}

.agenda-calendar-day.agenda-drag-day.agenda-drag-invalid,
.agenda-time-label.agenda-drag-time.agenda-drag-invalid {
  background: #fde8e6;
  color: #9e302b;
}

.agenda-appointment {
  width: 100%;
  min-height: 30px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 2px;
  border: 1px solid #b9d8e8;
  border-left: 4px solid var(--brand-blue);
  border-radius: 6px;
  background: #f4fbfe;
  color: var(--text);
  padding: 4px 5px;
  text-align: left;
  box-shadow: none;
  z-index: 1;
  align-self: start;
  justify-self: start;
  overflow: hidden;
}

.agenda-appointment:hover {
  border-color: var(--brand-blue);
  background: #eaf7fb;
  z-index: 4;
}

.agenda-appointment[draggable="true"] {
  cursor: grab;
}

.agenda-appointment[draggable="true"]:active {
  cursor: grabbing;
}

.agenda-appointment.is-dragging {
  opacity: 0.42;
  border-style: dashed;
}

.agenda-appointment.compact {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.agenda-appointment.compact small,
.agenda-appointment.compact .agenda-appointment-footer {
  display: none;
}

.agenda-appointment.status-completed {
  border-color: #a8d9c2;
  border-left-color: var(--ok);
  background: #f0faf5;
}

.agenda-appointment.status-cancelled {
  border-color: #efc1bd;
  border-left-color: var(--danger);
  background: #fff6f5;
}

.agenda-appointment.status-no_show {
  border-color: #efd6aa;
  border-left-color: var(--warn);
  background: #fffaf0;
}

.agenda-appointment-time {
  color: var(--brand-navy);
  font-size: 9px;
  font-weight: 850;
}

.agenda-appointment strong {
  overflow-wrap: anywhere;
  font-size: 9px;
  line-height: 1.3;
}

.agenda-appointment small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

.agenda-appointment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.agenda-recurrence-badge {
  width: fit-content;
  border-radius: 999px;
  background: rgba(7, 59, 102, 0.09);
  color: var(--brand-navy);
  padding: 2px 5px;
  font-size: 7px;
  font-weight: 850;
  white-space: nowrap;
}

.agenda-confirmation {
  border-radius: 999px;
  background: #e7edf2;
  color: #526b7b;
  padding: 3px 5px;
  white-space: nowrap;
}

.agenda-confirmation.confirmed {
  background: #dff4e9;
  color: #14704f;
}

.agenda-confirmation.declined {
  background: #fde8e6;
  color: #9e302b;
}

.agenda-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(126px, 1fr));
  min-width: 900px;
  background: #fff;
}

.agenda-month-weekday {
  position: sticky;
  top: 0;
  z-index: 2;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  padding: 9px;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.agenda-month-day {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 6px;
}

.agenda-month-day.outside {
  background: #f7f9fa;
  color: #9badb7;
}

.agenda-month-day.today {
  box-shadow: inset 0 3px 0 var(--accent);
}

.agenda-month-date {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-navy);
  font-size: 10px;
  font-weight: 850;
}

.agenda-month-day.today .agenda-month-date {
  background: var(--accent);
  color: #fff;
}

.agenda-month-appointment {
  width: 100%;
  min-height: 0;
  border: 1px solid #c5ddea;
  border-left: 3px solid var(--brand-blue);
  border-radius: 4px;
  background: #f3fafc;
  color: var(--text);
  padding: 4px 5px;
  font-size: 9px;
  line-height: 1.25;
  text-align: left;
  box-shadow: none;
}

.agenda-month-appointment.status-cancelled {
  border-left-color: var(--danger);
  background: #fff5f4;
}

.agenda-month-more {
  color: var(--muted);
  padding: 2px 4px;
  font-size: 9px;
  font-weight: 750;
}

.agenda-list-view {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.agenda-list-day {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.agenda-list-date {
  color: var(--brand-navy);
  font-size: 11px;
  font-weight: 850;
}

.agenda-list-items {
  display: grid;
  gap: 6px;
}

.agenda-list-appointment {
  display: grid;
  grid-template-columns: 105px minmax(150px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-blue);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  padding: 7px 9px;
  font-size: 10px;
  text-align: left;
  box-shadow: none;
}

.agenda-list-appointment.status-cancelled {
  border-left-color: var(--danger);
}

.agenda-list-appointment strong,
.agenda-list-appointment small {
  overflow-wrap: anywhere;
}

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

.agenda-loading,
.agenda-error {
  align-self: start;
  margin: 18px;
}

.appointment-modal-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-strong);
}

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

.appointment-form .span-2 {
  grid-column: 1 / -1;
}

.appointment-form label {
  display: grid;
  align-content: start;
  gap: 7px;
}

.appointment-notification-control {
  align-self: end;
  min-height: 43px;
  display: flex !important;
  align-items: center;
}

.appointment-form-actions {
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.appointment-recurrence {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfc;
  padding: 12px;
}

.appointment-recurrence-toggle {
  width: fit-content;
  display: flex !important;
  align-items: center;
  color: var(--brand-navy);
  font-weight: 800;
}

.appointment-recurrence-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.appointment-recurrence-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.appointment-delete-panel {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow-strong);
}

#appointment-delete-modal {
  z-index: 80;
}

.appointment-delete-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.appointment-action-spacer {
  flex: 1;
}

.agenda-calendar-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.agenda-calendar-range label {
  display: grid;
  gap: 6px;
}

.agenda-room-picker {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}

.agenda-room-picker legend {
  color: var(--brand-navy);
  padding: 0 5px;
  font-size: 12px;
  font-weight: 800;
}

.agenda-checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.agenda-checkbox-list .check {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfc;
  padding: 8px;
}

.registration-pending-label {
  width: fit-content;
  border-radius: 999px;
  background: #fff0cc;
  color: #785000 !important;
  padding: 3px 7px;
  font-weight: 800;
}

.pending-registration {
  border-left: 3px solid var(--warn) !important;
}

.support-ticket-form {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid #cfe0e8;
  border-radius: 8px;
  background: #fff;
}

.support-message-field,
.support-ticket-actions {
  grid-column: 1 / -1;
}

.support-history-head {
  margin-top: 28px;
}

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

.support-ticket-row {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 14px;
  border: 1px solid #d6e3e9;
  border-radius: 7px;
  color: #143a56;
  background: #fff;
  text-align: left;
}

.support-ticket-row:hover {
  border-color: #13a6a1;
  background: #f3fbfa;
}

.support-ticket-row > span {
  display: grid;
  gap: 4px;
}

.support-ticket-row > span:last-child {
  justify-items: end;
}

.support-ticket-row small {
  color: #667c8b;
  font-size: 11px;
}

.support-status {
  color: #0b4d83;
  font-size: 11px;
}

.support-status.waiting_customer,
.support-status.resolved {
  color: #087a61;
}

.support-ticket-modal-panel {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(7, 59, 102, .2);
}

.support-ticket-thread {
  min-height: 220px;
  max-height: 520px;
  overflow-y: auto;
  padding-top: 18px;
}

.support-ticket-message {
  width: min(82%, 560px);
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #d6e3e9;
  border-radius: 8px;
  background: #f5f8fa;
}

.support-ticket-message.platform {
  margin-left: auto;
  border-color: #9edbd5;
  background: #edf9f7;
}

.support-ticket-message span {
  display: block;
  margin-bottom: 6px;
  color: #657b89;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.support-ticket-message p {
  margin: 0;
  color: #183649;
  white-space: pre-wrap;
}

.support-ticket-reply-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #d6e3e9;
}

.support-ticket-reply-form label {
  display: grid;
  gap: 7px;
}

.support-ticket-reply-form .actions {
  justify-content: flex-end;
}

.support-ticket-closed-message {
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid #d6e3e9;
  border-radius: 7px;
  color: #526c7b;
  background: #f5f8fa;
}

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

@media (max-width: 900px) {
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .plan-option header p {
    min-height: 0;
  }

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

  .appointment-form .span-2 {
    grid-column: 1 / -1;
  }

  .agenda-section-head {
    flex-wrap: wrap;
  }

  .agenda-subtabs {
    order: 3;
    width: 100%;
    margin-top: 4px;
  }

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

  .agenda-search-control {
    grid-column: 1 / -1;
  }

  .agenda-client-layout,
  .agenda-config-split {
    grid-template-columns: 1fr;
  }

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

  .agenda-settings-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .agenda-settings-tabs button {
    border-left: 0;
    border-bottom: 3px solid transparent;
    text-align: center;
  }

  .agenda-settings-tabs button:hover,
  .agenda-settings-tabs button.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 680px) {
  .subscription-panel .section-head,
  .subscription-change-notice {
    align-items: stretch;
    flex-direction: column;
  }

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

  .recurring-card-form {
    grid-template-columns: 1fr;
  }

  .recurring-card-form .span-2 {
    grid-column: auto;
  }

  .plan-quote-summary,
  .plan-payment-methods,
  .credit-payment-methods,
  .plan-boleto-customer-fields {
    grid-template-columns: 1fr;
  }

  .plan-quote-summary > small,
  .plan-payment-methods legend {
    grid-column: auto;
  }

  .agenda-navigation {
    align-items: stretch;
    flex-wrap: wrap;
  }

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

  .agenda-toolbar h3 {
    grid-row: 1;
  }

  .agenda-filterbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agenda-calendar-modes {
    width: 100%;
    justify-self: stretch;
  }

  .agenda-calendar-modes button {
    flex: 1;
    padding-inline: 8px;
  }

  .agenda-search-control {
    grid-column: auto;
  }

  .agenda-filterbar > button {
    width: 100%;
  }

  .agenda-date-control,
  .agenda-status-control {
    width: 100%;
    margin-left: 0;
  }

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

  .agenda-conflict-alert {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .agenda-conflict-alert .icon-button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .agenda-list-day,
  .agenda-list-appointment {
    grid-template-columns: 1fr;
  }

  .agenda-subtabs {
    overflow-x: auto;
  }

  .agenda-subtab {
    flex: 0 0 auto;
  }

  .agenda-directory-head,
  .agenda-directory-item,
  .agenda-config-item {
    align-items: stretch;
    flex-direction: column;
  }

  .agenda-directory-head input {
    width: 100%;
  }

  .agenda-item-actions {
    width: 100%;
  }

  .agenda-item-actions button {
    flex: 1;
  }

  .agenda-settings-overlay {
    padding: 10px;
  }

  .agenda-settings-panel {
    height: calc(100vh - 20px);
    padding: 12px;
  }

  .agenda-settings-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agenda-settings-tabs button {
    font-size: 11px;
  }

  .agenda-form-row,
  .agenda-hours-row {
    grid-template-columns: 1fr;
  }

  .agenda-calendar-range,
  .agenda-checkbox-list {
    grid-template-columns: 1fr;
  }

  .agenda-hours-interval {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agenda-remove-interval {
    grid-column: 1 / -1;
  }

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

  .appointment-form .span-2,
  .appointment-form-actions {
    grid-column: auto;
  }

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

  .appointment-recurrence-options,
  .appointment-delete-options {
    grid-template-columns: 1fr;
  }

  .appointment-action-spacer {
    display: none;
  }

  .support-ticket-form {
    grid-template-columns: 1fr;
  }

  .support-message-field,
  .support-ticket-actions {
    grid-column: auto;
  }
}
