#armx9-automation {
  --a9a-card: var(--a9-panel, #1c1c27);
  --a9a-line: var(--a9-line, #343444);
  --a9a-text: var(--a9-text, #f4f1fb);
  --a9a-muted: var(--a9-muted, #a5a3b5);
  --a9a-accent: var(--a9-lavender, #c9bcff);
  display: grid;
  gap: 18px;
}
#account-dialog #armx9-automation :is(h2, h3, p) { margin: 0; }
#account-dialog #armx9-automation h2 {
  color: var(--a9a-text);
  font: 700 clamp(21px, 2.3vw, 27px)/1.2 system-ui, sans-serif;
  letter-spacing: -.025em;
}
#account-dialog #armx9-automation h3 { color: var(--a9a-text); font: 650 16px/1.3 system-ui, sans-serif; letter-spacing: 0; }
#account-dialog #armx9-automation p, #account-dialog #armx9-automation small { color: var(--a9a-muted); line-height: 1.5; }
#account-dialog .a9a-heading p { padding-top: 5px; }
.a9a-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.a9a-connection { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; font-size: .85rem; }
.a9a-connection span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--a9a-line); }
.a9a-connection span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e9b985; }
.a9a-connection[data-connected="true"] span::before { background: var(--a9-green, #a9e7cf); }
.a9a-connection a, .a9a-connect-help button {
  color: var(--a9a-accent);
  text-decoration: underline;
  text-underline-offset: .18em;
}
.a9a-connect-help { padding: 12px 14px; background: var(--a9a-card); border: 1px solid var(--a9a-line); border-radius: 10px; }
.a9a-connect-help button { padding: 0; background: none; border: 0; cursor: pointer; font: inherit; }
.a9a-connect-help code { color: var(--a9a-text); }
.a9a-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.a9a-card {
  display: grid;
  min-width: 0;
  align-content: start;
  grid-template-rows: auto auto minmax(3em, 1fr) auto;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--a9a-line);
  border-radius: 13px;
  background: var(--a9a-card);
}
.a9a-card header { display: flex; justify-content: space-between; align-items: center; }
.a9a-card small { font-size: .75rem; }
.a9a-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #50436c;
  border-radius: 9px;
  background: #302641;
  color: var(--a9a-accent);
}
.a9a-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.a9a-switch { display: grid; position: relative; cursor: pointer; place-items: center; min-width: 44px; min-height: 36px; }
.a9a-switch input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: inherit; }
.a9a-switch span { width: 38px; height: 22px; border-radius: 22px; border: 1px solid var(--a9a-line); background: #282735; }
.a9a-switch span::after { content: ""; display: block; width: 14px; height: 14px; margin: 3px; border-radius: 50%; background: #9a97ad; }
.a9a-switch input:checked + span { background: #6c569a; border-color: var(--a9a-accent); }
.a9a-switch input:checked + span::after { transform: translateX(16px); background: #f7efff; }
.a9a-switch input:focus-visible + span { outline: 2px solid var(--a9a-accent); outline-offset: 3px; }
.a9a-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.a9a-field { display: grid; gap: 5px; min-width: 0; font-size: .82rem; color: var(--a9a-muted); }
.a9a-field input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 39px;
  border: 1px solid var(--a9a-line);
  border-radius: 7px;
  padding: 7px 10px;
  background: var(--a9-bg, #101016);
  color: var(--a9a-text);
  font: inherit;
}
.a9a-field input:disabled { opacity: .5; }
.a9a-footer { display: flex; justify-content: flex-end; padding-top: 14px; }
.a9a-state { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.a9a-state:has(> p:empty):has(> button[hidden]) { display: none; }
#account-dialog #armx9-automation .a9a-state [data-error="true"] { color: #f0abbd; }
@media (max-width: 550px) {
  .a9a-footer button { width: 100%; }
}
