:root {
  color-scheme: light;
  --ink: #0d1612;
  --muted: #607069;
  --green: #1f8a5e;
  --green-dark: #176c4a;
  --mint: #e0f1e6;
  --background: #f3f7f3;
  --canvas: #ffffff;
  --line: #d8e3da;
  --danger: #a33429;
  --danger-surface: #fbe9e2;
  --shadow: 0 24px 70px rgba(21, 49, 37, .13), 0 2px 8px rgba(21, 49, 37, .06);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(123, 217, 168, .25), transparent 27rem),
    radial-gradient(circle at 86% 94%, rgba(31, 138, 94, .12), transparent 31rem),
    var(--background);
  font-family: Inter, Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.shell {
  display: grid;
  place-items: center;
  width: min(100% - 32px, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
}

.shell.shell-wide { width: min(100% - 32px, 720px); }

.card {
  width: 100%;
  padding: clamp(25px, 6vw, 38px);
  border: 1px solid rgba(13, 22, 18, .08);
  border-radius: 24px;
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 7px 16px rgba(31, 138, 94, .22);
}

.brand-name { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.brand-subtitle { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }

h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0 0 9px; font-size: clamp(24px, 6vw, 30px); line-height: 1.13; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.lead { margin: 0 0 26px; color: var(--muted); font-size: 14px; line-height: 1.58; }

.field-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 750; }
.account-input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid #cbd8ce;
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fbfdfb;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 17px;
  letter-spacing: .12em;
  transition: border-color .15s, box-shadow .15s;
}
.account-input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(31, 138, 94, .12); }
.field-hint { margin: 8px 0 19px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.button {
  display: inline-grid;
  place-items: center;
  min-height: 49px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { color: #fff; background: var(--green); box-shadow: 0 8px 18px rgba(31, 138, 94, .17); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--ink); background: transparent; }
.button-danger { color: #fff; background: var(--danger); }
.button-full { width: 100%; }
.button:focus-visible, a:focus-visible, .scope-check:focus-visible { outline: 3px solid rgba(31, 138, 94, .3); outline-offset: 2px; }

.secure-note {
  display: flex;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e4ebe5;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.secure-icon, .permission-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--mint);
}
.secure-icon { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }
.domain { color: var(--green-dark); font-weight: 750; }

.alert, .status {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
}
.alert { color: var(--danger); background: var(--danger-surface); }
.status { color: var(--green-dark); background: var(--mint); }

.client {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 14px;
  border-radius: 15px;
  background: var(--background);
}
.client-icon { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 12px; color: #fff; background: #1f2522; font-size: 12px; font-weight: 850; }
.client-copy { min-width: 0; }
.client-name { display: block; font-size: 13px; }
.client-detail { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.verified { margin-left: auto; padding: 5px 8px; border-radius: 999px; color: var(--green-dark); background: var(--mint); font-size: 9px; font-weight: 800; white-space: nowrap; }

.section-title { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.permission {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 11px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid #e5ece6;
}
.permission:last-of-type { border-bottom: 1px solid #e5ece6; }
.permission-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.permission strong { display: block; margin: 1px 0 4px; font-size: 12px; }
.permission p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.required { padding-top: 3px; color: var(--muted); font-size: 9px; font-weight: 750; }
.scope-check { width: 19px; height: 19px; margin: 6px 2px 0 0; accent-color: var(--green); cursor: pointer; }

.disclosure { margin: 16px 0; padding: 12px 13px; border-radius: 12px; color: #536159; background: var(--background); font-size: 10.5px; line-height: 1.5; }
.actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }

.connections-intro { margin-bottom: 22px; }
.connection-list { display: grid; gap: 14px; }
.connection-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdfb; }
.connection-card-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.connection-status { padding: 4px 8px; border-radius: 999px; color: var(--green-dark); background: var(--mint); font-size: 9px; font-weight: 800; text-transform: capitalize; }
.connection-meta { display: grid; grid-template-columns: 95px 1fr; gap: 8px 14px; margin: 0 0 18px; font-size: 11px; line-height: 1.45; }
.connection-meta dt { color: var(--muted); }
.connection-meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.empty { padding: 32px 20px; border: 1px dashed #cbd8ce; border-radius: 16px; color: var(--muted); text-align: center; }
.back-link { color: var(--green-dark); font-size: 12px; font-weight: 700; }

@media (max-width: 560px) {
  .shell, .shell.shell-wide { width: min(100% - 20px, 720px); padding: 18px 0; }
  .card { padding: 25px 21px; border-radius: 20px; }
  .brand { margin-bottom: 25px; }
  .verified { display: none; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .actions .button-primary { grid-row: 1; }
  .connection-meta { grid-template-columns: 1fr; gap: 2px; }
  .connection-meta dd { margin-bottom: 7px; }
}

@media (prefers-reduced-motion: no-preference) {
  .card { animation: card-in .28s ease-out; }
  @keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
}
