* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #172126;
  background: #eef3f5;
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: #146c78;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 22px;
  background: #132a32;
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: #1aa0a9;
  box-shadow: 0 0 0 4px rgba(26, 160, 169, 0.15);
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.topbar nav a,
.topbar nav .nav-link {
  color: #d8eef2;
  background: transparent;
  border: 0;
  min-height: 0;
  padding: 0;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
}

.topbar nav form {
  margin: 0;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: #d8eef2;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

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

.account-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 7px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.account-menu[open] summary,
.account-menu summary:hover {
  color: #fff;
}

.account-menu-list {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 180px;
  overflow: hidden;
  border: 1px solid #c7d7db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(23, 33, 38, 0.18);
}

.topbar nav .account-menu-list a,
.topbar nav .account-menu-list .nav-link {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #172126;
  padding: 9px 12px;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-weight: 650;
}

.topbar nav .account-menu-list a:hover,
.topbar nav .account-menu-list .nav-link:hover {
  background: #f2f8f9;
  color: #174f59;
}

.topbar nav a:hover,
.topbar nav .nav-link:hover {
  color: #fff;
}

.topbar nav .account-menu-list a:hover,
.topbar nav .account-menu-list .nav-link:hover,
.topbar nav .account-menu-list a:focus-visible,
.topbar nav .account-menu-list .nav-link:focus-visible {
  background: #f2f8f9;
  color: #174f59;
}

.shell {
  width: min(1240px, calc(100vw - 28px));
  margin: 22px auto 46px;
}

.login-panel {
  min-height: calc(100vh - 136px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: #fff;
  border: 1px solid #cfdcdf;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(23, 33, 38, 0.08);
}

.login-card label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
}

.login-password-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.login-password-row a {
  color: #236b77;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.login-password-row a:hover,
.login-password-row a:focus-visible {
  color: #174f59;
  text-decoration: underline;
}

.signup-layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(280px, 1fr);
  align-items: start;
  gap: 18px;
  max-width: 920px;
  margin: 42px auto;
}

.signup-card {
  width: 100%;
}

.terms-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #52676f;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.terms-check input {
  width: auto;
  margin-top: 3px;
}

.plan-card {
  display: grid;
  gap: 15px;
  border: 1px solid #cfdcdf;
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 14px 36px rgba(23, 33, 38, 0.08);
}

.compact-plan {
  box-shadow: none;
}

.plan-price {
  margin: 0;
  color: #132a32;
  font-size: 38px;
  font-weight: 850;
  line-height: 1;
}

.plan-price span {
  color: #52676f;
  font-size: 14px;
  font-weight: 750;
}

.plan-list,
.billing-meta {
  display: grid;
  gap: 12px;
  margin: 0;
}

.plan-list div {
  border-top: 1px solid #d8e4e7;
  padding-top: 12px;
}

.plan-list dd {
  margin-bottom: 0;
}

.form-link {
  margin: 0;
  color: #52676f;
  font-size: 13px;
}

.terms-page {
  max-width: 860px;
  margin: 42px auto;
}

.terms-page h1 {
  margin-bottom: 8px;
}

.terms-page h2 {
  margin: 24px 0 8px;
  color: #172126;
  font-size: 18px;
}

.terms-page p {
  color: #465c64;
  line-height: 1.65;
}

.billing-page,
.profile-page {
  max-width: 1040px;
  margin: 0 auto;
}

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

.billing-summary {
  background: #fff;
}

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

.profile-grid label,
.preferences-card label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 126px);
  border: 1px solid #cfdcdf;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 36px rgba(23, 33, 38, 0.08);
}

.admin-sidebar {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: calc(100vh - 126px);
  border-right: 1px solid #d8e4e7;
  background: #132a32;
  color: #fff;
  padding: 20px;
}

.admin-sidebar .eyebrow {
  color: #9fd6dd;
}

.admin-sidebar h1 {
  font-size: 22px;
}

.admin-menu {
  display: grid;
  gap: 6px;
}

.admin-menu a {
  display: block;
  border-radius: 6px;
  color: #d8eef2;
  padding: 9px 10px;
  text-decoration: none;
  font-weight: 750;
}

.admin-menu a:hover,
.admin-menu a.active {
  background: #1d3c47;
  color: #fff;
}

.admin-content {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.meta-ads-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-note-period {
  margin: -.35rem 0 1rem;
}

.meta-ads-table-wrap .admin-table th:not(:first-child),
.meta-ads-table-wrap .admin-table td:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.analytics-stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 1.2rem;
}

.analytics-stat span {
  display: block;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: .4rem;
}

.analytics-stat strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.analytics-note { margin: 1rem 0 0; }

@media (max-width: 780px) {
  .analytics-summary,
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) and (min-width: 781px) {
  .meta-ads-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.admin-form {
  background: #fff;
}

.admin-clear-secret {
  align-self: end;
}

.admin-test-row {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  align-items: end;
  gap: 12px;
}

.admin-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.analytics-table-wrap {
  overflow-x: visible;
}

.analytics-table-wrap .admin-table {
  min-width: 0;
  table-layout: fixed;
}

.analytics-table-wrap .admin-table th:nth-child(n + 2),
.analytics-table-wrap .admin-table td:nth-child(n + 2) {
  width: 64px;
  text-align: right;
}

.analytics-table-wrap code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #edf1f2;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #52676f;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-table td {
  overflow-wrap: anywhere;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  min-height: calc(100vh - 126px);
  border: 1px solid #cfdcdf;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 36px rgba(23, 33, 38, 0.08);
}

.chat-setup-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 14px;
  border: 1px solid #b8d9dd;
  border-radius: 8px;
  background: #eaf7f8;
  padding: 14px 16px;
  color: #163f47;
}

.chat-setup-banner div {
  display: grid;
  gap: 3px;
}

.chat-setup-banner strong {
  color: #123c44;
  font-size: 15px;
}

.chat-setup-banner span {
  color: #45636a;
  font-size: 14px;
}

.chat-setup-banner .primary {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .chat-setup-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-setup-banner .primary {
    width: 100%;
  }
}

.assistant-sidebar {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
  border-left: 1px solid #d8e4e7;
  background: #f8fbfb;
  padding: 24px;
}

.chat-panel {
  grid-column: 1;
  grid-row: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: #166b75;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
}

.assistant-sidebar h1 {
  font-size: 30px;
}

.lede {
  margin: 14px 0 0;
  color: #52676f;
  font-size: 16px;
}

.connection-list {
  margin: 0;
}

dt {
  color: #687c84;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 16px;
}

.sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.history-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  border-top: 1px solid #d8e4e7;
  padding-top: 18px;
}

.settings-panel {
  display: grid;
  gap: 22px;
}

.preferences-card {
  display: grid;
  gap: 16px;
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  background: #f8fbfb;
  padding: 16px;
}

.preferences-card h2 {
  font-size: 20px;
}

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

.model-picker {
  display: grid;
  gap: 12px;
}

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

.model-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid #d8e4e7;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.model-option:hover,
.model-option:focus-within {
  border-color: #1aa0a9;
  box-shadow: 0 0 0 3px rgba(26, 160, 169, 0.1);
}

.model-option.is-active {
  border-color: #1aa0a9;
  background: #f2f8f9;
}

.model-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  flex: 0 0 auto;
  accent-color: #146c78;
}

.model-option-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.model-option-heading,
.model-option-pricing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.model-option-pricing {
  font-size: 0.94rem;
}

.model-option code {
  width: fit-content;
  font-size: 0.82rem;
}

@media (max-width: 780px) {
  .ai-routing-grid { grid-template-columns: 1fr; }
}

.preferences-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid #d8e4e7;
  padding-top: 16px;
}

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

.preferences-actions {
  display: flex;
  justify-content: flex-start;
}

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

.settings-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 84px;
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  background: #fff;
  color: #172126;
  padding: 14px;
  text-decoration: none;
}

.settings-card-form {
  width: 100%;
  margin: 0;
}

.settings-card-form .settings-card {
  width: 100%;
  justify-content: stretch;
  background: #fff;
  color: #172126;
  font: inherit;
  font-weight: 400;
  text-align: left;
}

.settings-card:hover,
.settings-card-form:hover {
  border-color: #8eb7bf;
  background: #f7fbfc;
}

.settings-card-form .settings-card:hover {
  background: #f7fbfc;
  color: #172126;
}

.settings-card:active,
.settings-card-form:active {
  border-color: #126b78;
  background: #126b78;
  color: #fff;
}

.settings-card:active small,
.settings-card:active .settings-icon,
.settings-card-form:active small,
.settings-card-form:active .settings-icon {
  color: #d8eef2;
}

.settings-card:active .settings-icon,
.settings-card-form:active .settings-icon {
  background: rgba(255, 255, 255, 0.14);
}

.settings-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #e8f4f6;
  color: #126b78;
  font-weight: 800;
}

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

.settings-card strong {
  margin-bottom: 4px;
}

.settings-card small {
  color: #52676f;
}

.settings-signout {
  margin: 0;
}

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

.report-task {
  display: grid;
  gap: 14px;
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.report-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.report-task-head h2 {
  font-size: 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #e8f4f6;
  color: #126b78;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill.failed {
  background: #fff0ee;
  color: #a22a20;
}

.status-pill.sent {
  background: #eef8ee;
  color: #2e7335;
}

.report-task-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.report-task-meta div {
  min-width: 0;
}

.report-task-meta dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.report-prompt {
  border-left: 3px solid #8eb7bf;
  background: #f8fbfb;
  padding: 10px 12px;
  color: #344b53;
}

.report-error {
  color: #9b251b;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-actions form {
  margin: 0;
}

.danger-button:hover {
  border-color: #c63a2e;
  background: #fff5f4;
  color: #9b251b;
}

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

.history-head h2 {
  font-size: 18px;
}

.history-new {
  min-height: 32px;
  padding: 6px 10px;
}

.history-scope {
  margin: 0;
  color: #52676f;
  font-size: 13px;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.history-list form {
  margin: 0;
}

.history-load-more {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  font-size: 13px;
}

.history-row {
  position: relative;
  display: block;
}

.history-select-form {
  min-width: 0;
}

.history-item {
  display: grid;
  width: 100%;
  min-height: 48px;
  justify-content: stretch;
  gap: 3px;
  border: 1px solid #d8e4e7;
  border-radius: 7px;
  background: #fff;
  color: #172126;
  padding: 9px 10px;
  text-align: left;
}

.history-menu-button {
  position: absolute;
  top: 9px;
  right: 8px;
  z-index: 2;
  width: 30px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #64777f;
  opacity: 0;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.history-row:hover .history-menu-button,
.history-row:focus-within .history-menu-button,
.history-row.menu-open .history-menu-button {
  opacity: 1;
}

.history-menu-button:hover,
.history-row.menu-open .history-menu-button {
  border-color: #c7d7db;
  background: #eef6f7;
  color: #174f59;
}

.history-delete-form {
  display: none;
  position: absolute;
  top: 9px;
  right: 8px;
  z-index: 3;
}

.history-row.menu-open .history-delete-form {
  display: flex;
}

.history-row.menu-open .history-menu-button {
  opacity: 0;
  pointer-events: none;
}

.history-delete-button {
  min-height: 30px;
  border: 1px solid #efb0aa;
  background: #fff5f4;
  color: #9b251b;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 750;
}

.history-delete-button:hover {
  border-color: #c63a2e;
  background: #c63a2e;
  color: #fff;
}

.history-item:hover {
  border-color: #8eb7bf;
  background: #f2f8f9;
  color: #172126;
}

.history-item:active {
  border-color: #126b78;
  background: #126b78;
  color: #fff;
}

.history-item:active .history-meta {
  color: #d8eef2;
}

.history-item.active {
  border-color: #126b78;
  background: #e8f4f6;
}

.history-title,
.history-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-title {
  font-size: 13px;
  font-weight: 600;
}

.history-meta {
  color: #64777f;
  font-size: 12px;
  font-weight: 600;
}

.primary,
.secondary,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.primary,
button {
  background: #126b78;
  color: #fff;
}

.secondary {
  border: 1px solid #c7d7db;
  background: #fff;
  color: #174f59;
}

.secondary:hover {
  border-color: #8eb7bf;
  background: #f7fbfc;
  color: #174f59;
}

.secondary:active {
  border-color: #126b78;
  background: #126b78;
  color: #fff;
}

button:not(.secondary):not(.history-item):not(.history-menu-button):not(.history-delete-button):hover,
.primary:hover {
  background: #0d5660;
}

[hidden],
.chat-input button[hidden] {
  display: none !important;
}

.settings-card-form .settings-card:hover {
  border-color: #8eb7bf;
  background: #f7fbfc !important;
  color: #172126 !important;
}

.settings-card-form .settings-card:hover strong,
.settings-card-form .settings-card:focus-visible strong {
  color: #172126;
}

.settings-card-form .settings-card:hover small,
.settings-card-form .settings-card:focus-visible small {
  color: #52676f;
}

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

.chat-panel {
  display: grid;
  grid-template-rows: auto auto auto;
  align-self: start;
  min-width: 0;
  background: #ffffff;
}

.chat-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d8e4e7;
  padding: 18px 20px;
}

.chat-titlebar h2 {
  font-size: 20px;
}

.chat-titlebar form {
  flex: 0 0 auto;
  margin: 0;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 150px;
  overflow-y: visible;
  padding: 20px;
}

.message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  max-width: 820px;
}

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

.message.user {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.message.user .avatar {
  grid-column: 2;
  grid-row: 1;
  background: #243b43;
}

.message.user .bubble {
  grid-column: 1;
  grid-row: 1;
  background: #e9f4f6;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #126b78;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.bubble {
  min-width: 0;
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}

.bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.message.pending-response .bubble {
  position: relative;
  padding-left: 46px;
}

.message.pending-response .bubble::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 15px;
  width: 17px;
  height: 17px;
  border: 3px solid #cfe0e4;
  border-top-color: #126b78;
  border-radius: 50%;
  animation: jagger-spin 0.8s linear infinite;
}

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

.progress-bar {
  display: grid;
  gap: 6px;
  margin: 12px 0 2px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2ecef;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #126b78;
  transition: width 180ms ease;
}

.progress-label {
  color: #62777f;
  font-size: 12px;
  font-weight: 650;
}

.markdown-body {
  display: grid;
  gap: 10px;
  overflow-wrap: anywhere;
}

.markdown-body p,
.markdown-body ul,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: #172126;
  letter-spacing: 0;
  line-height: 1.2;
}

.markdown-body h1 {
  font-size: 1.24rem;
  font-weight: 780;
}

.markdown-body h2 {
  font-size: 1.08rem;
  font-weight: 750;
}

.markdown-body h3 {
  font-size: 0.98rem;
  font-weight: 720;
}

.markdown-body ul {
  padding-left: 20px;
}

.markdown-body li + li {
  margin-top: 4px;
}

.markdown-body strong {
  font-weight: 600;
}

.markdown-body a {
  color: #115c47;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-body a:hover {
  color: #0b3f31;
}

.markdown-body code {
  border: 1px solid #d8e4e7;
  border-radius: 5px;
  background: #f6fafb;
  padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.markdown-body .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.markdown-body .chart-figure {
  position: relative;
  margin: 10px 0 4px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  border: 1px solid #dce7e9;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(10, 48, 46, 0.08);
  cursor: zoom-in;
}

.markdown-body .chart-figure img {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  border-radius: 16px;
  background: #fff;
}

.markdown-body .chart-figure:focus-visible {
  outline: 3px solid rgba(18, 107, 120, 0.32);
  outline-offset: 3px;
}

.chart-expand-label {
  position: sticky;
  right: 10px;
  bottom: 10px;
  float: right;
  margin: -42px 10px 10px 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(10, 48, 46, 0.9);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

body.chart-viewer-open {
  overflow: hidden;
}

.chart-viewer[hidden] {
  display: none;
}

.chart-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100vw;
  height: 100dvh;
  background: #071c1d;
  color: #fff;
}

.chart-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  font-weight: 800;
}

.chart-viewer-toolbar button {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.chart-viewer-canvas {
  display: flex;
  align-items: center;
  overflow: auto;
  padding: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.chart-viewer-canvas img {
  display: block;
  flex: 0 0 auto;
  width: 760px;
  max-width: none;
  height: auto;
  margin: auto 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}

.chart-viewer-hint {
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 620px) {
  .markdown-body .chart-figure {
    margin-left: -6px;
    margin-right: -6px;
    border-radius: 14px;
  }

  .markdown-body .chart-figure img {
    width: 620px;
    max-width: none;
    border-radius: 14px;
  }
}

.markdown-body table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.markdown-body th,
.markdown-body td {
  border-bottom: 1px solid #edf1f2;
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.markdown-body th {
  color: #52676f;
  font-weight: 800;
}

.bubble small {
  display: block;
  margin-top: 8px;
  color: #6b7d84;
}


.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.suggestions button {
  min-height: 32px;
  border: 1px solid #c7d7db;
  background: #f8fbfb;
  color: #174f59;
  padding: 6px 10px;
  font-size: 13px;
}

.bubble .suggestions button:hover,
.bubble .suggestions button:focus-visible {
  border-color: #0d5660;
  background: #0d5660;
  color: #fff;
}

.suggestions-edit {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #52676f;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.suggestions-edit:hover {
  color: #174f59;
  text-decoration: underline;
}

.quick-prompts-card {
  scroll-margin-top: 18px;
}

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

.quick-prompt-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.quick-prompt-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 700;
}

.quick-prompt-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c7d7db;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  color: #172126;
  font: inherit;
}

.quick-prompt-row input:focus {
  border-color: #126b78;
  outline: 3px solid rgba(18, 107, 120, 0.14);
}

.quick-prompt-row input[type="text"],
.quick-prompt-row input:not([type]) {
  width: 100%;
}

.delete-check {
  min-height: 38px;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  color: #7a3030;
}

.delete-check input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.chat-input {
  display: grid;
  gap: 10px;
  border-top: 1px solid #d8e4e7;
  background: #f8fbfb;
  padding: 16px;
}

.composer {
  display: grid;
  grid-template-rows: minmax(92px, auto) auto;
  gap: 12px;
  border: 1px solid #cbd9dd;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 2px rgb(22 52 58 / 4%);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer:focus-within {
  border-color: #7eacb4;
  box-shadow: 0 0 0 3px rgb(18 107 120 / 10%);
}

.composer > textarea {
  min-height: 92px;
  max-height: 260px;
  border: 0;
  border-radius: 0;
  outline: 0;
  padding: 2px 3px;
  resize: none;
  color: #18314d;
  font-size: 17px;
  line-height: 1.5;
}

.composer > textarea::placeholder {
  color: #687a91;
  opacity: 1;
}

.composer-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.file-control {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.file-control input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.file-button {
  display: inline-flex;
  min-height: 44px;
  gap: 9px;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
}

.file-button svg,
.send-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-control input[type="file"]:disabled + .file-button {
  cursor: not-allowed;
  opacity: 0.55;
}

.send-button {
  flex: 0 0 auto;
  width: 46px;
  min-height: 46px;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 5px 12px rgb(18 107 120 / 20%);
}

.stop-button {
  flex: 0 0 auto;
  min-height: 46px;
  border-radius: 12px;
  border-color: #e2aaa5;
  color: #9a2c24;
}

.stop-button:hover {
  border-color: #c96d65;
  background: #fff6f5;
  color: #84251e;
}

.attachment-name {
  max-width: min(320px, 36vw);
  color: #5d7078;
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  width: 100%;
  min-height: 48px;
  max-height: 150px;
  resize: vertical;
  border: 1px solid #c7d7db;
  border-radius: 6px;
  padding: 10px 12px;
  color: #172126;
  font: inherit;
  font-size: 16px;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c7d7db;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  color: #172126;
  font: inherit;
  font-size: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #52676f;
  font-size: 13px;
  font-weight: 750;
}

.panel,
.workflow {
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  background: #fff;
  padding: 20px;
}

.muted {
  color: #5d7078;
}

.warning-text {
  color: #9b251b;
}

.flash {
  margin: 0 0 16px;
  border-radius: 6px;
  padding: 12px 14px;
  background: #e8f4f6;
  color: #164b55;
}

.flash.error {
  background: #fdeceb;
  color: #8f1f17;
}

.flash.success {
  background: #eef8ee;
  color: #2e7335;
}

.flash.warning {
  background: #fff5db;
  color: #704a00;
}

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

.file-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  padding: 14px;
}

.file-choice span,
.file-choice small {
  display: block;
  color: #5d7078;
}

code {
  border-radius: 4px;
  background: #edf2f3;
  padding: 2px 5px;
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

input[type="file"] {
  min-height: 38px;
  border: 1px solid #c7d7db;
  border-radius: 6px;
  background: #fff;
  padding: 7px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.badge {
  border-radius: 999px;
  background: #e5eef0;
  padding: 5px 10px;
  color: #24434b;
  font-size: 13px;
  font-weight: 750;
}

.detected-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.detected-grid div {
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  padding: 12px;
}

.detected-grid strong,
.detected-grid span {
  display: block;
}

.detected-grid span {
  color: #5d7078;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid #edf1f2;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #52676f;
  font-size: 12px;
  text-transform: uppercase;
}

.warn-text {
  color: #8f5600;
  font-weight: 750;
}

.memory-settings {
  display: grid;
  gap: 18px;
}

.memory-add,
.memory-card {
  display: grid;
  gap: 12px;
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  background: #f8fbfb;
  padding: 14px;
}

.memory-add {
  grid-template-columns: 180px minmax(0, 1fr) auto;
  align-items: end;
}

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

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

.guide-editor,
.playbook-editor {
  display: grid;
  gap: 14px;
}

.guide-editor textarea,
.playbook-editor textarea {
  width: 100%;
  min-height: max(620px, calc(100vh - 330px));
  max-height: none;
  resize: vertical;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.endpoint-settings {
  display: grid;
  gap: 18px;
}

.endpoint-form,
.endpoint-group {
  display: grid;
  gap: 16px;
}

.endpoint-group {
  border-top: 1px solid #edf1f2;
  padding-top: 16px;
}

.endpoint-group h2 {
  font-size: 18px;
}

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

.endpoint-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  background: #f8fbfb;
  padding: 12px;
  color: #172126;
}

.endpoint-card input {
  margin-top: 3px;
}

.endpoint-main,
.endpoint-title,
.endpoint-desc {
  display: block;
  min-width: 0;
}

.endpoint-title {
  font-weight: 800;
}

.endpoint-title code {
  display: inline-block;
  margin-left: 4px;
  font-weight: 650;
}

.endpoint-desc {
  margin-top: 5px;
  color: #5d7078;
  font-size: 13px;
  font-weight: 500;
}

.endpoint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid #edf1f2;
  padding-top: 16px;
}

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

.function-card {
  display: grid;
  gap: 12px;
  border: 1px solid #d8e4e7;
  border-radius: 8px;
  background: #f8fbfb;
  padding: 14px;
}

.function-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.function-card h2 {
  font-size: 18px;
}

.function-card p {
  margin: 6px 0 0;
  color: #52676f;
}

.function-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0;
}

.function-meta div {
  min-width: 110px;
}

.function-card pre {
  max-height: 340px;
  overflow: auto;
  border: 1px solid #d8e4e7;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  white-space: pre-wrap;
}

.revision-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.revision-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  border: 1px solid #d8e4e7;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.revision-list em {
  color: #52676f;
  font-style: normal;
}

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

  .signup-layout,
  .billing-layout,
  .profile-grid,
  .admin-layout,
  .admin-test-row {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid #d8e4e7;
  }

  .chat-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .assistant-sidebar {
    grid-column: 1;
    grid-row: 2;
    border-top: 1px solid #d8e4e7;
    border-left: 0;
  }
}

@media (hover: none) {
  .history-menu-button {
    opacity: 1;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }

  .topbar nav {
    gap: 12px;
  }

  .topbar nav a,
  .topbar nav .nav-link {
    font-size: 14px;
  }

  .shell {
    width: min(100vw - 16px, 1240px);
    margin-top: 8px;
  }

  .chat-layout {
    min-height: calc(100vh - 146px);
  }

  .chat-input {
    padding: 10px;
  }

  .composer {
    grid-template-rows: minmax(76px, auto) auto;
    border-radius: 12px;
    padding: 13px;
  }

  .composer > textarea {
    min-height: 76px;
    font-size: 16px;
  }

  .file-button {
    min-height: 42px;
    padding: 8px 11px;
  }

  .attachment-name {
    max-width: 34vw;
  }

  .send-button {
    width: 44px;
    min-height: 44px;
  }

  .assistant-sidebar {
    padding: 18px;
  }

  .assistant-sidebar h1 {
    font-size: 25px;
  }

  .preferences-grid,
  .settings-grid,
  .report-task-meta {
    grid-template-columns: 1fr;
  }

  .chat-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-input {
    grid-template-columns: 1fr;
  }

  .quick-prompt-row {
    grid-template-columns: 1fr;
  }

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

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

  .memory-add {
    grid-template-columns: 1fr;
  }

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

.topbar nav .account-menu-list form .nav-link:hover,
.topbar nav .account-menu-list form .nav-link:focus-visible,
.topbar nav .account-menu-list form .nav-link:active {
  background: #f2f8f9 !important;
  color: #174f59 !important;
}

.plan-choice-row,
.scope-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan-choice {
  display: flex;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d3dee2;
  border-radius: 12px;
}

.plan-choice:has(input:checked) {
  border-color: #126b78;
  background: #f4fafb;
}

.plan-choice span,
.plan-choice strong,
.plan-choice small,
.team-member-head small {
  display: block;
}

.plan-choice small,
.team-member-head small {
  color: #607078;
  margin-top: 3px;
}

.plan-choice.disabled {
  opacity: .62;
}

.scope-check-grid {
  margin: 14px 0 18px;
}

.scope-check-grid label {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d3dee2;
  border-radius: 10px;
  background: #fff;
}

.team-name-form {
  display: flex;
  gap: 12px;
  align-items: end;
}

.team-name-form label {
  flex: 1;
}

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

.team-member-card {
  padding: 16px;
  border: 1px solid #d3dee2;
  border-radius: 14px;
}

.team-member-card form + form {
  margin-top: 10px;
}

@media (max-width: 720px) {
  .plan-choice-row,
  .scope-check-grid {
    grid-template-columns: 1fr;
  }
  .team-name-form {
    align-items: stretch;
    flex-direction: column;
  }
}

.permission-picker {
  width: min(920px, 100%);
  margin: 34px auto;
  padding: clamp(24px, 4vw, 44px);
}

.permission-picker-heading {
  max-width: 700px;
}

.permission-picker-heading h1 {
  margin: 6px 0 10px;
}

.permission-picker-heading p,
.permission-picker-footer p {
  color: #607078;
}

/* Signup */
.signup-page {
  width: min(960px, 100%);
  margin: 38px auto 64px;
}

.signup-intro {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.signup-intro h1 {
  max-width: 720px;
  margin: 7px auto 12px;
  color: #10272f;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -.04em;
  line-height: 1.04;
}

.signup-intro > p:last-child {
  max-width: 700px;
  margin: 0 auto;
  color: #52676f;
  font-size: 18px;
  line-height: 1.55;
}

.signup-form {
  display: grid;
  gap: 18px;
}

.signup-section {
  margin: 0;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid #cbdadd;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(23, 33, 38, .07);
}

fieldset.signup-section {
  min-width: 0;
}

.plan-picker h2 {
  margin: 0 0 4px;
  color: #172126;
  font-size: 22px;
  font-weight: 800;
}

.section-help {
  margin: 0 0 14px;
  color: #607078;
}

.plan-trial-banner {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid #a9d8d4;
  border-radius: 12px;
  background: #eaf8f6;
  color: #244f53;
}

.plan-trial-banner strong {
  color: #08756f;
  font-size: 16px;
}

.plan-trial-banner span {
  font-size: 14px;
}

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

.signup-plan {
  position: relative;
  display: block;
  min-height: 220px;
  padding: 23px;
  overflow: hidden;
  border: 2px solid #d3dfe2;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.signup-plan:hover {
  border-color: #82aeb4;
  transform: translateY(-1px);
}

.signup-plan:has(input:checked),
.signup-plan.is-selected {
  border-color: #087a86;
  background: linear-gradient(145deg, #fff 35%, #f1fafb);
  box-shadow: 0 0 0 3px rgba(8, 122, 134, .1);
}

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

.plan-select-indicator {
  position: absolute;
  top: 21px;
  right: 21px;
  width: 22px;
  height: 22px;
  border: 2px solid #9eb0b5;
  border-radius: 50%;
  background: #fff;
}

.signup-plan:has(input:checked) .plan-select-indicator {
  border: 6px solid #087a86;
}

.signup-plan-content,
.plan-heading,
.signup-plan-price {
  display: block;
}

.plan-heading {
  padding-right: 38px;
}

.plan-heading strong {
  display: block;
  color: #14282f;
  font-size: 21px;
}

.plan-heading > span {
  display: block;
  margin-top: 1px;
  color: #6b7c82;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.signup-plan-price {
  margin: 24px 0 17px;
}

.plan-trial-label {
  display: inline-block;
  margin-top: 18px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dff5f1;
  color: #08756f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}

.plan-trial-label + .signup-plan-price {
  margin-top: 12px;
}

.signup-plan-price b {
  color: #0b3440;
  font-size: 34px;
  line-height: 1;
}

.signup-plan-price small {
  display: block;
  margin-top: 5px;
  color: #52676f;
  font-weight: 700;
}

.plan-description {
  display: block;
  max-width: 340px;
  color: #475c64;
  line-height: 1.5;
}

.plan-tax-note {
  margin: 14px 2px 0;
  color: #6a7b81;
  font-size: 13px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0 0 4px;
  color: #172126;
  font-size: 22px;
}

.section-heading p {
  margin: 0;
  color: #607078;
}

.section-heading > p {
  padding-top: 5px;
  font-size: 14px;
  white-space: nowrap;
}

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

.signup-fields label {
  display: grid;
  gap: 7px;
  color: #314950;
  font-weight: 750;
}

.signup-fields .password-field {
  grid-column: 1 / -1;
}

.signup-fields input {
  width: 100%;
  min-height: 52px;
  border-color: #bdcdd1;
  border-radius: 9px;
  background: #fbfdfd;
  font-size: 16px;
}

.signup-fields input:focus {
  border-color: #087a86;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(8, 122, 134, .1);
}

.signup-terms {
  max-width: 760px;
  margin: 22px 0 18px;
}

.signup-submit {
  width: 100%;
  min-height: 54px;
  font-size: 17px;
}

.signup-submit span {
  display: inline-block;
  margin-left: 7px;
  transition: transform .15s ease;
}

.signup-submit:hover span {
  transform: translateX(3px);
}

.checkout-note {
  margin: 12px 0 0;
  color: #6a7b81;
  font-size: 13px;
  text-align: center;
}

.checkout-note span {
  color: #178776;
  font-size: 10px;
}

@media (max-width: 700px) {
  .plan-trial-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .signup-page {
    margin-top: 24px;
  }

  .signup-intro {
    margin-bottom: 22px;
    text-align: left;
  }

  .signup-intro h1 {
    margin-left: 0;
    font-size: 37px;
  }

  .signup-intro > p:last-child {
    font-size: 16px;
  }

  .signup-plan-grid,
  .signup-fields {
    grid-template-columns: 1fr;
  }

  .signup-plan {
    min-height: 0;
  }

  .signup-fields .password-field {
    grid-column: auto;
  }

  .section-heading {
    display: grid;
    gap: 8px;
  }

  .section-heading > p {
    padding: 0;
  }
}

.permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 16px;
}

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

.permission-option {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  min-width: 0;
  padding: 17px;
  border: 1px solid #d3dee2;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.permission-option:has(input:checked) {
  border-color: #126b78;
  box-shadow: 0 0 0 2px rgba(18, 107, 120, .12);
  background: #f7fbfb;
}

.permission-option input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: #126b78;
  flex: 0 0 auto;
}

.permission-option span,
.permission-option strong,
.permission-option small {
  display: block;
}

.permission-option small {
  margin-top: 5px;
  color: #607078;
  line-height: 1.4;
}

.permission-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 24px;
}

.permission-picker-footer p {
  max-width: 560px;
  margin: 0;
  font-size: 14px;
}

.connection-cta-stack {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 9px;
}

.connection-cta-stack > a {
  color: #527078;
  font-size: 12px;
  font-weight: 700;
}

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

  .permission-picker-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .permission-picker-footer .primary {
    width: 100%;
  }

  .connection-cta-stack {
    align-items: stretch;
    width: 100%;
    text-align: center;
  }
}
.invoice-list-card{padding:0;overflow:hidden}
.invoice-list-head,.invoice-list-row{display:grid;grid-template-columns:1.2fr 1fr 1fr .7fr auto;gap:1rem;align-items:center;padding:1rem 1.25rem}
.invoice-list-head{background:#edf6f6;color:#126b78;font-size:.78rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
.invoice-list-row{border-top:1px solid #e4eaed}
.invoice-list-row:first-of-type{border-top:0}
.invoice-download{white-space:nowrap;text-align:center}
@media (max-width:760px){
  .invoice-list-head{display:none}
  .invoice-list-row{grid-template-columns:1fr auto;gap:.45rem 1rem}
  .invoice-list-row .status-pill{justify-self:start}
  .invoice-download{grid-column:2;grid-row:1 / span 4;align-self:center}
}

.app-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 24px 28px;
  color: #607078;
  font-size: 13px;
  text-align: center;
}

.app-footer a {
  color: #126b78;
  font-weight: 700;
}
.company-file-list{display:grid;gap:12px;margin:22px 0}.company-file-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;border:1px solid var(--line,#d8e2e5);border-radius:14px;background:#fff}.company-file-row.active{border-color:#1aa0a9;background:#eefafa}.company-file-row div{display:grid;gap:4px}.company-file-row small{color:#5d7279}.company-file-row form{margin:0}@media(max-width:640px){.company-file-row{align-items:flex-start;flex-direction:column}.company-file-row form,.company-file-row button{width:100%}}
.trial-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 9px 20px;
  background: #e6f7f5;
  border-bottom: 1px solid #b8e2de;
  color: #123f45;
  font-size: 14px;
}
.trial-countdown a { color: #08756f; font-weight: 750; }
.trial-countdown span { color: #526b72; }
@media (max-width: 640px) {
  .trial-countdown { align-items: flex-start; flex-direction: column; gap: 2px; }
}
.trial-plan-picker {
  display: grid;
  gap: 16px;
  width: 100%;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border, #d8e5e8);
}
.trial-plan-picker h3,
.trial-plan-card h4,
.trial-plan-card p { margin: 0; }
.trial-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.trial-plan-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border: 1px solid #cbdde1;
  border-radius: 8px;
  background: #f8fbfb;
}
.trial-plan-card.is-selected {
  border-color: #16938f;
  box-shadow: inset 0 0 0 1px #16938f;
  background: #effaf8;
}
.trial-plan-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
.trial-plan-card strong { color: #132a32; }
.trial-plan-card p { color: #526b72; line-height: 1.45; }
@media (max-width: 700px) {
  .trial-plan-grid { grid-template-columns: 1fr; }
}
