:root {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #253c33;
  background: #f6f7f5;
  font-synthesis: none;
  --muted: #66736b;
  --line: #e3e8e2;
  --green: #244c3f;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, textarea, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a[aria-disabled="true"] { pointer-events: none; opacity: .45; }
button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 2px solid #4d806b; outline-offset: 4px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.topbar, main { width: min(100% - 48px, 760px); margin: 0 auto; }
.topbar { padding: 36px 0 24px; }
h1 { font-size: 25px; letter-spacing: -.025em; font-weight: 650; margin: 0; }
main { padding-bottom: 48px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 18px; }
h2 { font-size: 17px; font-weight: 650; margin: 0 0 10px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; }
.small { font-size: 12px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 17px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; line-height: 1.6; font-weight: 550; }
.primary { color: #fff; background: var(--green); }
.primary:hover { background: #183c30; }
.secondary { background: #fff; color: var(--green); border-color: #cbd6ce; }
.secondary:hover { background: #f2f5f1; }
.text-button { color: var(--muted); padding: 6px 0; border: 0; background: none; font-size: 12px; white-space: nowrap; }
.text-button:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.login-actions { margin-top: 22px; }
.identity { display: flex; align-items: center; gap: 14px; }
.identity-name { min-width: 0; }
.avatar { width: 45px; height: 45px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #edf3ee; color: #476d57; font-size: 20px; }
.user-name { font-size: 21px; font-weight: 600; margin: 0 0 3px; overflow-wrap: anywhere; }
.account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0 0; }
dt { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
dd { margin: 0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.connections { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
.count { margin-left: 6px; font-size: 12px; }
.connections-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; }
.empty { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 15px 0 0; }
.agent-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.agent-row:last-child { border: 0; padding-bottom: 0; }
.agent-row > div { min-width: 0; }
.agent-name { font-size: 14px; margin: 0 0 5px; overflow-wrap: anywhere; }
.agent-meta { color: var(--muted); font-size: 12px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.revoked .agent-name { color: var(--muted); }
.client-picker { border: 0; padding: 0; margin: 22px 0 12px; display: flex; gap: 8px; }
.client-picker label { position: relative; cursor: pointer; }
.client-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.client-picker span { display: block; padding: 7px 13px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); }
.client-picker input:checked + span { color: var(--green); background: #edf3ee; border-color: #bacfc0; }
.client-picker input:focus-visible + span { outline: 2px solid #4d806b; outline-offset: 3px; }
#install-prompt { display: block; width: 100%; min-height: 112px; resize: vertical; padding: 15px 16px; border: 1px solid var(--line); border-radius: 7px; color: #42564a; background: #f8faf7; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.install-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.copy-status { color: var(--muted); font-size: 12px; line-height: 1.7; }
.notice, .alert, .setup-note, .result { padding: 12px 16px; border-radius: 7px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.notice { background: #f8f0df; color: #7c6335; margin-bottom: 18px; }
.alert { background: #fff0ea; color: #974936; margin-bottom: 18px; }
.setup-note { background: #faf3e7; color: #7c6335; margin: 18px 0 0; }
.loading { padding: 50px 0; color: var(--muted); text-align: center; font-size: 14px; }
.device-name { margin: 22px 0 12px; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.user-code { padding: 17px; border-radius: 7px; background: #f2f6f0; font-family: Consolas, monospace; font-size: 26px; text-align: center; letter-spacing: .15em; }
.scope { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 18px 0; }
.connect-actions { display: flex; gap: 12px; }
.result { background: #edf5ea; color: #44663a; margin: 18px 0 0; }
@media (max-width: 520px) {
  .topbar, main { width: calc(100% - 32px); }
  .topbar { padding: 28px 0 22px; }
  h1 { font-size: 23px; }
  .panel { padding: 22px 20px; }
  .account-fields { grid-template-columns: 1fr; }
  #install-prompt { min-height: 195px; }
  .install-actions .button { width: 100%; }
}
