:root { color-scheme: light; --bg: #f4f4f5; --surface: #fff; --text: #27272a; --muted: #62626b; --border: #d4d4d8; --accent: #3376dd; --accent-text: #fff; --brand: #e85200; --notice: #ddedfc; font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif; }
@media (prefers-color-scheme: dark) { :root { color-scheme: dark; --bg: oklch(26.6% .006 286); --surface: oklch(27.4% .006 286.033); --text: oklch(87.1% .006 286.286); --muted: oklch(70.5% .015 286.067); --border: #45454d; --accent: #6bb1ef; --accent-text: #27272a; --brand: #ff8a52; --notice: #293b4d; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
.site-header { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px max(24px, calc((100vw - 1160px) / 2)); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; flex-shrink: 0; }
.brand img { display: block; width: 48px; height: 48px; object-fit: contain; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
main { width: min(1160px, calc(100% - 48px)); margin: 48px auto; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.18; letter-spacing: -1px; margin: 8px 0 16px; }
h2 { font-size: 21px; margin: 0 0 8px; }
p { margin: 0 0 24px; }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; }
.auth-card { max-width: 500px; margin: 80px auto; padding: 40px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
input[type=email], select { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 12px; font: inherit; min-height: 48px; }
.button { display: inline-block; padding: 12px 20px; border: 1px solid transparent; border-radius: 9px; background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 650; cursor: pointer; min-height: 48px; text-align: center; }
.auth-card .button { width: 100%; margin-top: 20px; }
.secondary { background: var(--surface); color: var(--text); border-color: var(--border); margin: 16px 0; }
.text-button { background: transparent; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 12px 0; min-height: 44px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.page-heading > form { flex-shrink: 0; }
.page-heading > form .button { white-space: nowrap; }
.page-heading > .button { flex-shrink: 0; white-space: nowrap; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.company-id { font-size: 13px; overflow-wrap: anywhere; }
.billing-card { margin-bottom: 24px; }
.billing-card p { margin-bottom: 0; }
.plan-price { margin: 20px 0 0; }
.plan-description { min-height: 3.2em; }
.plan-choice { margin: 16px 0; }
.billing-terms { margin-top: 24px; }
.invoice-lines > div { display: flex; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.invoice-lines dd { margin: 0; white-space: nowrap; }
.notice { padding: 16px 20px; margin-bottom: 24px; border-radius: 10px; background: var(--notice); }
.empty-state { text-align: center; padding: 64px 24px; }
@media (max-width: 600px) { main { width: calc(100% - 32px); margin: 24px auto; } .site-header { padding: 12px 16px; min-height: 68px; } .auth-card { margin: 32px auto; padding: 24px; } .page-heading { display: block; } .page-heading .button { width: 100%; } .card { padding: 24px; } }
@media (max-width: 600px) { .site-header { flex-wrap: wrap; gap: 8px; } .site-header nav { gap: 8px; } .plan-description { min-height: 0; } }

.approval-data {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 28rem;
  overflow: auto;
  font-size: .875rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: 1rem;
}

.billing-period { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.billing-period .button { margin: 0; text-decoration: none; }
.period-saving { display: inline-block; font-size: .75em; margin-left: 8px; padding: 2px 8px; border: 1px solid currentColor; border-radius: 20px; }


.icon-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--accent); cursor: pointer; }
.icon-button:hover { background: var(--notice); }

.icon-button::after { content: attr(aria-label); position: absolute; top: 100%; right: 0; z-index: 10; width: max-content; max-width: min(280px, calc(100vw - 32px)); padding: 6px 10px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 13px; font-weight: 400; line-height: 1.4; box-shadow: 0 2px 8px #0003; visibility: hidden; }
.icon-button:hover::after, .icon-button:focus-visible::after { visibility: visible; }

.connection-card { padding: 24px; }
.disconnect-button { color: #b42318; }
@media (prefers-color-scheme: dark) { .disconnect-button { color: #fda29b; } }

.connection-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.connection-identity p { margin: 0; font-size: 14px; }
.connection-toolbar { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.access-toggle { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--border); border-radius: 9px; padding: 3px; background: var(--bg); }
.access-option { width: 100%; position: relative; border: 0; background: transparent; color: var(--muted); border-radius: 6px; padding: 10px 12px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.access-option[aria-pressed=true] { color: var(--text); cursor: default; }
.connection-menu { position: relative; }
.connection-menu summary { list-style: none; cursor: pointer; font-size: 24px; width: 44px; height: 44px; text-align: center; border-radius: 8px; }
.connection-menu summary::-webkit-details-marker { display: none; }
.connection-menu summary:hover { background: var(--notice); }
.connection-menu-items { position: absolute; right: 0; top: 100%; z-index: 5; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; box-shadow: 0 4px 16px #0002; }
.connection-menu-items button { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; }
.connection-menu-items svg { flex-shrink: 0; }
.access-option.saving { color: transparent; }
.access-option.saving::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid var(--muted); border-right-color: transparent; border-radius: 50%; animation: access-spin .7s linear infinite; }
.access-error { margin: 0; max-width: 240px; color: var(--text); font-size: 14px; }
@keyframes access-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .access-option.saving::after { animation: none; } }

.access-toggle::before { content: ""; position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 2); border-radius: 6px; background: var(--surface); box-shadow: 0 1px 4px #0002; transition: transform 240ms cubic-bezier(.22, 1, .36, 1); }
.access-toggle:has([data-mode="read_write"][aria-pressed="true"])::before { transform: translateX(100%); }
@media (prefers-reduced-motion: reduce) { .access-toggle::before { transition: none; } }

.connection-identity { min-width: 0; overflow-wrap: anywhere; }
.access-toggle > form { min-width: 0; }
.connection-menu { flex-shrink: 0; }
@media (max-width: 800px) {
  main { margin-top: 28px; }
  .page-heading { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .page-heading p { margin-bottom: 0; }
  .page-heading > form .button { width: 100%; }
  .connection-card { padding: 20px; gap: 20px; }
  .connection-identity { width: 100%; }
  .connection-toolbar { width: 100%; margin-left: 0; gap: 8px; flex-wrap: wrap; }
  .access-toggle { flex: 1; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-toggle > form { display: flex; }
  .access-option { padding: 10px 6px; font-size: 13px; overflow-wrap: anywhere; }
  .access-error { order: 3; flex-basis: 100%; max-width: none; }
}

.current-plan { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-card { position: relative; }
.current-plan-label { position: absolute; top: 0; right: 20px; margin: 0; padding: 6px 14px; transform: translateY(-50%); border-radius: 999px; background: var(--accent); color: var(--accent-text); text-align: center; font-weight: 600; font-size: 12px; line-height: 1.4; white-space: nowrap; }
.plan-choice:disabled { cursor: default; color: var(--muted); }

.checkout-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.checkout-actions > form { margin: 0; }
