/* Setup panel styles — scoped under #setup-panel */
#setup-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
#setup-panel.active {
  display: flex;
}
#setup-panel .setup-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px clamp(16px, 4vw, 40px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
#setup-panel .setup-inner {
  max-width: 760px;
  width: 100%;
}
#setup-panel .setup-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
#setup-panel .setup-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
#setup-panel .setup-header p {
  font-size: 13px;
  color: var(--fg-dim);
}

/* Card styles */
#setup-panel .card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
}
#setup-panel .card h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#setup-panel .card p {
  color: var(--fg-dim);
  font-size: 13px;
  margin-bottom: 14px;
}

/* Status dot */
#setup-panel .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
#setup-panel .status-dot.ok { background: var(--green, #9ece6a); }
#setup-panel .status-dot.warn { background: #e0a040; animation: pulse-warn 2s ease-in-out infinite; }
#setup-panel .status-dot.missing { background: var(--yellow, #e0af68); }
@keyframes pulse-warn { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Form elements */
#setup-panel label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
#setup-panel input[type="text"],
#setup-panel input[type="password"],
#setup-panel select,
#setup-panel .setup-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-width: 0;
}
#setup-panel input::placeholder,
#setup-panel .setup-input::placeholder { color: var(--fg-muted, #8b949e); opacity: 1; }
#setup-panel input[type="password"] { font-family: 'SF Mono', Menlo, monospace; }
#setup-panel input:focus,
#setup-panel select:focus { border-color: var(--accent); }

#setup-panel .select-wrap { position: relative; }
#setup-panel .select-wrap::after {
  content: '\25BE';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-dim);
  pointer-events: none;
  font-size: 12px;
}
#setup-panel select option { background: var(--bg-light); }
#setup-panel select optgroup { color: var(--fg-dim); font-size: 11px; font-weight: 600; }

#setup-panel .input-row { margin-bottom: 12px; }

/* Buttons */
#setup-panel .setup-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
#setup-panel .setup-btn-primary { background: var(--accent); color: var(--accent-fg, #0d1117); }
#setup-panel .setup-btn-primary:hover { filter: brightness(1.1); }
#setup-panel .setup-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
#setup-panel .setup-btn-secondary { background: transparent; color: var(--fg-dim); border: 1px solid var(--border); }
#setup-panel .setup-btn-secondary:hover { color: var(--fg); border-color: var(--fg-muted, #8b949e); }
#setup-panel .setup-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
#setup-panel .btn-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
#setup-panel .btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }

/* Error & test result */
#setup-panel .error-msg { color: var(--red, #f7768e); font-size: 12px; display: none; width: 100%; margin-top: 8px; line-height: 1.5; }
#setup-panel .test-result { font-size: 12px; display: none; width: 100%; margin-top: 8px; line-height: 1.5; }
#setup-panel .test-result.ok { color: var(--green, #9ece6a); }
#setup-panel .test-result.fail { color: var(--red, #f7768e); }

/* Provider card */
#setup-panel .provider-card { transition: all 0.15s; }
#setup-panel .provider-card:hover { border-color: var(--fg-dim) !important; }
#setup-panel .provider-config { transition: opacity 0.15s; }

/* Integrations */
#setup-panel .integration {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
#setup-panel .integration:last-child { border-bottom: none; }
#setup-panel .integration-info { display: flex; align-items: center; gap: 12px; }
#setup-panel .integration-icon { font-size: 18px; width: 28px; text-align: center; }
#setup-panel .integration-name { font-weight: 500; font-size: 13px; }
#setup-panel .integration-desc { color: var(--fg-dim); font-size: 12px; }
#setup-panel .integration-action { color: var(--fg-muted, #8b949e); margin-top: 2px; }
#setup-panel .google-account-card {
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
}
#setup-panel .google-account-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#setup-panel .google-account-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#setup-panel .google-account-badges,
#setup-panel .integration-pill-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
#setup-panel .integration-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(139,148,158,0.22);
  background: rgba(139,148,158,0.1);
  color: var(--fg-dim);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}
#setup-panel .integration-pill-success { background: rgba(63,185,80,0.14); border-color: rgba(63,185,80,0.28); color: var(--green, #9ece6a); }
#setup-panel .integration-pill-warning { background: rgba(224,175,104,0.12); border-color: rgba(224,175,104,0.35); color: var(--yellow, #e0af68); }
#setup-panel .integration-pill-info { background: rgba(88,166,255,0.12); border-color: rgba(88,166,255,0.28); color: #7aa2f7; }
#setup-panel .integration-pill-work { background: rgba(187,154,247,0.13); border-color: rgba(187,154,247,0.28); color: #bb9af7; }
#setup-panel .integration-summary {
  margin: 6px 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(122,162,247,0.24);
  border-left: 3px solid #7aa2f7;
  border-radius: 6px;
  background: rgba(122,162,247,0.08);
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}
#setup-panel .integration-summary-title {
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
#setup-panel .integration-summary .integration-desc {
  color: var(--fg-muted, #a9b1d6);
  line-height: 1.4;
}
#setup-panel .google-profile-chooser {
  border-left-color: var(--yellow, #e0af68);
  background: rgba(224,175,104,0.06);
}
#setup-panel .google-profile-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 9px;
}
#setup-panel .google-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(139,148,158,0.14);
}
#setup-panel .google-profile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#setup-panel .google-profile-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  align-items: center;
  max-width: 100%;
}
#setup-panel .google-profile-form .setup-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  font-size: 12px;
}
#setup-panel .google-profile-form .google-profile-config-dir {
  grid-column: span 2;
}
#setup-panel .google-profile-form select.setup-input {
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg-muted, #8b949e) 50%),
    linear-gradient(135deg, var(--fg-muted, #8b949e) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
#setup-panel .google-profile-form .google-profile-save {
  width: 100%;
  min-height: 36px;
  justify-content: center;
  padding: 7px 12px;
}
@media (max-width: 560px) {
  #setup-panel .google-profile-form { grid-template-columns: 1fr; }
  #setup-panel .google-profile-form .google-profile-config-dir { grid-column: auto; }
}
#setup-panel .integration-notice {
  margin: 6px 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(224,175,104,0.35);
  border-left: 3px solid var(--yellow, #e0af68);
  border-radius: 6px;
  background: rgba(224,175,104,0.08);
}
#setup-panel .integration-notice-title {
  color: var(--yellow, #e0af68);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
#setup-panel .google-reauth-alert {
  border-color: rgba(248,81,73,0.38);
  border-left-color: var(--red, #f7768e);
  background: rgba(248,81,73,0.08);
}
#setup-panel .google-reauth-alert .integration-notice-title {
  color: var(--red, #f7768e);
}
#setup-panel .google-reauth-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
#setup-panel .google-reauth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(248,81,73,0.2);
  border-radius: 6px;
  background: rgba(15,23,42,0.18);
}
#setup-panel .google-reauth-body {
  min-width: 0;
}
#setup-panel .google-reauth-email {
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
#setup-panel .google-reauth-button {
  color: var(--red, #f7768e);
  border-color: rgba(248,81,73,0.35);
  flex-shrink: 0;
}
@media (max-width: 560px) {
  #setup-panel .google-reauth-row {
    align-items: stretch;
    flex-direction: column;
  }
  #setup-panel .google-reauth-button {
    justify-content: center;
    width: 100%;
  }
}

#setup-panel .setup-access-status {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 6px;
  background: rgba(139,148,158,0.08);
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#setup-panel .setup-access-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(224,175,104,0.28);
  border-left: 3px solid var(--yellow, #e0af68);
  border-radius: 6px;
  background: rgba(224,175,104,0.08);
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.5;
}
#setup-panel .setup-access-warning code {
  background: var(--bg);
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--fg);
  font-size: 11px;
}
#setup-panel .setup-ms-private-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(247,118,142,0.34);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(247,118,142,0.14), rgba(224,175,104,0.08)),
    rgba(26,27,38,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
#setup-panel .setup-ms-private-warning-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(247,118,142,0.42);
  border-radius: 999px;
  background: rgba(247,118,142,0.14);
  color: var(--red, #f7768e);
  font-weight: 800;
}
#setup-panel .setup-ms-private-warning-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
#setup-panel .setup-ms-private-warning-copy strong {
  color: var(--fg);
  font-size: 13px;
}
#setup-panel .setup-ms-private-warning-copy span {
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.45;
}
#setup-panel .setup-ms-private-warning-action {
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(247,118,142,0.18);
}
#setup-panel .setup-access-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 12px;
  margin: 14px 0 14px;
}
#setup-panel .setup-access-method {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid rgba(122,162,247,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.028);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}
#setup-panel .setup-access-method:hover {
  border-color: rgba(122,162,247,0.52);
  background: rgba(122,162,247,0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 18px rgba(0,0,0,0.12);
}
#setup-panel .setup-access-method[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(122,162,247,0.14);
  box-shadow: inset 0 0 0 1px rgba(122,162,247,0.38), 0 10px 22px rgba(0,0,0,0.14);
}
#setup-panel .setup-access-method:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#setup-panel .setup-access-method-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
#setup-panel .setup-access-method-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#setup-panel .setup-access-method-body {
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.45;
  max-width: 32em;
}
#setup-panel .setup-method-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border: 1px solid rgba(139,148,158,0.22);
  border-radius: 999px;
  background: rgba(139,148,158,0.1);
  color: var(--fg-dim);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
#setup-panel .setup-method-badge.ok {
  background: rgba(63,185,80,0.14);
  border-color: rgba(63,185,80,0.32);
  color: var(--green, #9ece6a);
}
#setup-panel .setup-method-badge.info {
  background: rgba(88,166,255,0.13);
  border-color: rgba(88,166,255,0.32);
  color: #7aa2f7;
}
#setup-panel .setup-method-badge.warn {
  background: rgba(224,175,104,0.12);
  border-color: rgba(224,175,104,0.34);
  color: var(--yellow, #e0af68);
}
#setup-panel .setup-method-badge.missing {
  background: rgba(248,81,73,0.12);
  border-color: rgba(248,81,73,0.28);
  color: var(--red, #f7768e);
}
/* Live-broken (offline / expired / error) — solid red so "Reconnect" stands out. */
#setup-panel .setup-method-badge.error {
  background: rgba(229,72,77,0.18);
  border-color: rgba(229,72,77,0.55);
  color: #ff6b6b;
  font-weight: 700;
}

/* Action-required banner: lists currently-broken connections with a Reconnect button. */
#setup-panel .setup-access-alert {
  margin: 8px 0 4px;
  padding: 8px 12px;
  border: 1px solid rgba(229,72,77,0.45);
  border-radius: 8px;
  background: rgba(229,72,77,0.10);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#setup-panel .setup-access-alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--fg, #c0caf5);
}
#setup-panel .setup-access-alert-row span { flex: 1; }
#setup-panel .setup-access-alert-row strong { color: #ff8a8a; }

/* "Other ways to connect" disclosure for non-recommended methods (declutter). */
#setup-panel .setup-other-methods { margin-top: 10px; }
#setup-panel .setup-other-methods > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--fg-dim, #8b949e);
  padding: 4px 0;
  user-select: none;
}
#setup-panel .setup-other-methods[open] > summary { margin-bottom: 8px; }
#setup-panel .setup-access-panel {
  margin-top: 10px;
  border: 1px solid rgba(122,162,247,0.22);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
#setup-panel .setup-access-panel[open] {
  border-color: rgba(122,162,247,0.35);
  background: rgba(122,162,247,0.035);
}
#setup-panel .setup-access-panel > summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 13px 14px;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
#setup-panel .setup-access-panel > summary::-webkit-details-marker { display: none; }
#setup-panel .setup-access-panel > summary::before {
  content: '\25B8';
  color: var(--fg-dim);
  font-size: 11px;
  line-height: 18px;
  transition: transform 0.15s ease;
}
#setup-panel .setup-access-panel[open] > summary::before {
  transform: rotate(90deg);
}
#setup-panel .setup-access-panel-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#setup-panel .setup-access-panel-title strong {
  font-size: 13px;
  font-weight: 650;
}
#setup-panel .setup-access-panel-title span {
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.4;
}
#setup-panel .setup-access-panel-body {
  padding: 0 14px 14px;
}
#setup-panel .setup-tunnel-quickstart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding-top: 2px;
}
#setup-panel .setup-tunnel-copy {
  min-width: 0;
}
#setup-panel .setup-tunnel-kicker,
#setup-panel .setup-tunnel-command-title {
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
#setup-panel #setup-ms-summary {
  margin-top: 4px;
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.5;
}
#setup-panel .setup-tunnel-account {
  margin-top: 6px;
  color: var(--fg-dim);
  font-size: 11px;
  line-height: 1.35;
}
#setup-panel .setup-tunnel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
#setup-panel .setup-tunnel-primary {
  min-width: 116px;
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
}
#setup-panel .setup-tunnel-secondary {
  min-width: 116px;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
#setup-panel .setup-tunnel-access-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
#setup-panel .setup-tunnel-mode-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 8px;
  background: rgba(139,148,158,0.05);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
#setup-panel .setup-tunnel-mode-option:hover {
  border-color: rgba(122,162,247,0.42);
  background: rgba(122,162,247,0.07);
}
#setup-panel .setup-tunnel-mode-option[aria-pressed="true"] {
  border-color: rgba(122,162,247,0.58);
  background: rgba(122,162,247,0.12);
  box-shadow: inset 0 0 0 1px rgba(122,162,247,0.25);
}
#setup-panel .setup-tunnel-mode-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#setup-panel .setup-tunnel-mode-option strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}
#setup-panel .setup-tunnel-mode-option small {
  display: block;
  margin-top: 4px;
  color: var(--fg-dim);
  font-size: 11px;
  line-height: 1.4;
}
#setup-panel .setup-tunnel-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
#setup-panel .setup-tunnel-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 8px;
  color: var(--fg-dim);
  background: rgba(139,148,158,0.06);
  font-size: 12px;
}
#setup-panel .setup-tunnel-steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(139,148,158,0.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
#setup-panel .setup-tunnel-steps li strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#setup-panel .setup-tunnel-steps li.done {
  border-color: rgba(63,185,80,0.25);
  background: rgba(63,185,80,0.08);
  color: var(--green, #9ece6a);
}
#setup-panel .setup-tunnel-steps li.active {
  border-color: rgba(122,162,247,0.42);
  background: rgba(122,162,247,0.1);
  color: var(--fg);
}
#setup-panel .setup-tunnel-ready {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(122,162,247,0.22);
  border-radius: 8px;
  background: rgba(122,162,247,0.06);
}
#setup-panel .setup-tunnel-ready div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  color: var(--fg-dim);
  font-size: 12px;
}
#setup-panel .setup-tunnel-ready code,
#setup-panel .setup-tunnel-command {
  background: var(--bg);
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 6px;
  color: var(--fg);
}
#setup-panel .setup-tunnel-ready code {
  min-width: 0;
  padding: 2px 6px;
  overflow-wrap: anywhere;
  font-size: 11px;
}
#setup-panel .setup-tunnel-availability {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 8px;
  background: rgba(139,148,158,0.05);
}
#setup-panel .setup-tunnel-availability-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
#setup-panel .setup-tunnel-connectivity {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 8px;
  background: rgba(139,148,158,0.05);
}
#setup-panel .setup-tunnel-connectivity-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
#setup-panel .setup-tunnel-connectivity-head strong {
  display: block;
  color: var(--fg);
  font-size: 12px;
  line-height: 1.35;
}
#setup-panel .setup-tunnel-connectivity-head span,
#setup-panel .setup-tunnel-connectivity-note {
  display: block;
  color: var(--fg-dim);
  font-size: 11px;
  line-height: 1.45;
}
#setup-panel .setup-tunnel-connectivity.status-ok {
  border-color: rgba(63,185,80,0.28);
  background: rgba(63,185,80,0.07);
}
#setup-panel .setup-tunnel-connectivity.status-warn {
  border-color: rgba(224,175,104,0.32);
  background: rgba(224,175,104,0.07);
}
#setup-panel .setup-tunnel-connectivity.status-error {
  border-color: rgba(248,81,73,0.3);
  background: rgba(248,81,73,0.07);
}
#setup-panel .setup-tunnel-availability-head strong {
  display: block;
  color: var(--fg);
  font-size: 12px;
  line-height: 1.35;
}
#setup-panel .setup-tunnel-availability-status {
  display: block;
  margin-top: 2px;
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.45;
}
#setup-panel .setup-tunnel-availability-status.ok {
  color: var(--green, #9ece6a);
}
#setup-panel .setup-tunnel-availability-status.warn {
  color: var(--yellow, #e0af68);
}
#setup-panel .setup-tunnel-availability-status.error {
  color: var(--red, #f7768e);
}
#setup-panel .setup-tunnel-keepawake {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-width: 0;
  margin: 0;
  color: var(--fg);
  cursor: pointer;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
#setup-panel .setup-tunnel-keepawake.disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
#setup-panel .setup-tunnel-keepawake input {
  margin-top: 2px;
}
#setup-panel .setup-tunnel-keepawake strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}
#setup-panel .setup-tunnel-keepawake small,
#setup-panel .setup-tunnel-availability-note {
  display: block;
  color: var(--fg-dim);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}
#setup-panel .setup-access-warning-compact {
  padding: 8px 10px;
}
#setup-panel .setup-tunnel-progress {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(122,162,247,0.24);
  border-radius: 8px;
  background: rgba(122,162,247,0.07);
}
#setup-panel .setup-tunnel-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
#setup-panel .setup-tunnel-progress-head strong {
  color: var(--fg);
  font-size: 12px;
}
#setup-panel .setup-tunnel-progress-head span {
  color: var(--fg-dim);
  font-size: 11px;
  text-align: right;
}
#setup-panel .setup-tunnel-login-fallback {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 8px;
  color: var(--fg-dim);
  font-size: 12px;
}
#setup-panel .setup-tunnel-login-note {
  flex-basis: 100%;
  color: var(--fg);
  font-weight: 650;
  line-height: 1.45;
}
#setup-panel .setup-tunnel-login-fallback a {
  color: var(--accent);
  font-weight: 650;
}
#setup-panel .setup-tunnel-login-fallback code {
  background: var(--bg);
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 4px;
  color: var(--fg);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
  padding: 4px 8px;
}
#setup-panel .setup-tunnel-code-copy {
  padding: 4px 8px;
  border: 1px solid rgba(139,148,158,0.28);
  border-radius: 6px;
  background: rgba(139,148,158,0.08);
  color: var(--fg);
  cursor: pointer;
  font-size: 12px;
}
#setup-panel .setup-tunnel-code-regenerate {
  border-color: rgba(125,162,255,0.45);
  color: var(--accent);
}
#setup-panel .setup-tunnel-progress-log {
  max-height: 150px;
  margin: 0;
  padding: 8px 10px;
  overflow: auto;
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg-dim);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}
#setup-panel .setup-access-subdetails {
  margin-top: 10px;
  border: 1px solid rgba(139,148,158,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.012);
}
#setup-panel .setup-access-subdetails > summary {
  padding: 9px 10px;
  color: var(--fg-dim);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}
#setup-panel .setup-access-subdetails > summary::-webkit-details-marker {
  display: none;
}
#setup-panel .setup-access-subdetails > summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}
#setup-panel .setup-access-subdetails[open] > summary::before {
  transform: rotate(90deg);
}
#setup-panel .setup-access-subdetails-body {
  padding: 0 10px 10px;
}
#setup-panel .setup-tunnel-command {
  display: block;
  margin: 8px 0;
  padding: 8px 10px;
  overflow-x: auto;
  font-size: 11px;
}
#setup-panel .setup-subdetails-copy {
  margin: 0 0 8px;
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.4;
}
#setup-panel .setup-subdetails-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
#setup-panel .setup-phone-guidance {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(122,162,247,0.24);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(122,162,247,0.08);
  font-size: 12px;
  line-height: 1.5;
}
#setup-panel .setup-phone-guidance-title {
  color: var(--fg);
  font-weight: 650;
  margin-bottom: 3px;
}
#setup-panel .setup-phone-guidance-body {
  color: var(--fg-dim);
}

#setup-panel .setup-scope-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}
#setup-panel .setup-scope-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  background: rgba(255,255,255,0.02);
  font-size: 12px;
}
#setup-panel .setup-scope-status {
  min-height: 32px;
  margin: -2px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(86, 95, 137, 0.42);
  border-radius: 8px;
  color: var(--fg-dim);
  background: rgba(15, 20, 31, 0.45);
  font-size: 12px;
  line-height: 1.35;
}
#setup-panel .setup-scope-status.ok {
  border-color: rgba(158, 206, 106, 0.36);
  color: var(--green);
  background: rgba(158, 206, 106, 0.08);
}
#setup-panel .setup-scope-status.warn {
  border-color: rgba(224, 175, 104, 0.42);
  color: var(--yellow);
  background: rgba(224, 175, 104, 0.08);
}
#setup-panel .setup-scope-status.error {
  border-color: rgba(247, 118, 142, 0.42);
  color: var(--red);
  background: rgba(247, 118, 142, 0.08);
}
#setup-panel .setup-qr-panel {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(122,162,247,0.25);
  border-radius: 8px;
  background: rgba(122,162,247,0.06);
}
#setup-panel .setup-qr-panel img {
  width: 132px;
  height: 132px;
  border-radius: 6px;
  background: #fff;
}
#setup-panel .setup-claim-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#setup-panel #setup-device-claim-url {
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#setup-panel .setup-device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}
#setup-panel .setup-device-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 12px;
}
#setup-panel .setup-device-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
#setup-panel .setup-device-label-editor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--fg-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
}
#setup-panel .setup-device-label-editor input {
  width: min(100%, 260px);
  padding: 6px 8px;
  border: 1px solid rgba(86, 95, 137, 0.7);
  border-radius: 6px;
  color: var(--fg);
  background: rgba(15, 20, 31, 0.6);
  font-size: 12px;
}
#setup-panel .setup-device-meta,
#setup-panel .setup-device-duplicate {
  display: block;
}
#setup-panel .setup-device-duplicate {
  color: var(--yellow);
}
#setup-panel .setup-device-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
#setup-panel .setup-device-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(86, 95, 137, 0.65);
  font-size: 11px;
  font-weight: 700;
}
#setup-panel .setup-device-status.connected {
  color: var(--green);
  border-color: rgba(158, 206, 106, 0.45);
  background: rgba(158, 206, 106, 0.08);
}
#setup-panel .setup-device-status.recent {
  color: var(--cyan);
  border-color: rgba(125, 207, 255, 0.4);
  background: rgba(125, 207, 255, 0.08);
}
#setup-panel .setup-device-status.revoked {
  color: var(--red);
  border-color: rgba(247, 118, 142, 0.4);
  background: rgba(247, 118, 142, 0.08);
}
#setup-panel .setup-device-status.offline {
  color: var(--fg-dim);
  background: rgba(86, 95, 137, 0.08);
}
#setup-panel .setup-btn-danger {
  color: var(--red);
  border-color: rgba(247, 118, 142, 0.45);
  background: rgba(247, 118, 142, 0.08);
}
#setup-panel .setup-device-row span,
#setup-panel .setup-device-row > div:last-child,
#setup-panel .setup-device-empty {
  color: var(--fg-dim);
}
#setup-panel .setup-device-archive-note {
  color: var(--fg-dim);
  font-size: 11px;
  padding: 0 2px;
}
#setup-panel .setup-device-row.revoked {
  opacity: 0.55;
}
@media (max-width: 560px) {
  #setup-panel .setup-body {
    padding: 16px 12px 24px;
  }
  #setup-panel .setup-access-method-grid {
    grid-template-columns: 1fr;
  }
  #setup-panel .setup-access-method {
    min-height: auto;
  }
  #setup-panel .setup-tunnel-quickstart,
  #setup-panel .setup-tunnel-access-mode,
  #setup-panel .setup-tunnel-steps {
    grid-template-columns: 1fr;
  }
  #setup-panel .setup-tunnel-primary {
    width: 100%;
  }
  #setup-panel .setup-tunnel-ready div {
    grid-template-columns: 1fr;
  }
  #setup-panel .setup-ms-private-warning {
    grid-template-columns: auto minmax(0, 1fr);
  }
  #setup-panel .setup-ms-private-warning-action {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  #setup-panel .setup-tunnel-availability-head,
  #setup-panel .setup-tunnel-connectivity-head {
    grid-template-columns: 1fr;
  }
  #setup-panel .setup-scope-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #setup-panel .setup-qr-panel {
    grid-template-columns: 1fr;
  }
}

/* Badges */
#setup-panel .badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
#setup-panel .badge-connected { background: rgba(63,185,80,0.15); color: var(--green, #9ece6a); }
#setup-panel .badge-ready { background: rgba(88,166,255,0.1); color: var(--fg-dim); }
#setup-panel .badge-missing { background: rgba(210,153,34,0.15); color: var(--yellow, #e0af68); }
#setup-panel .badge-warn { background: rgba(248,81,73,0.15); color: var(--red, #f7768e); }
#setup-panel .badge-dim { background: rgba(139,148,158,0.12); color: #8b949e; }
#setup-panel .badge-free { background: rgba(63,185,80,0.15); color: var(--green, #9ece6a); font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 600; letter-spacing: 0.03em; }

/* Embedding rows */
#setup-panel .embed-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
#setup-panel .embed-row:last-child { border-bottom: none; }
#setup-panel .embed-row.active { border-left: 3px solid var(--green, #9ece6a); padding-left: 10px; margin-left: -10px; background: rgba(63,185,80,0.04); border-radius: 4px; }
#setup-panel .embed-row-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
#setup-panel .embed-row-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
#setup-panel .embed-row-text { min-width: 0; }
#setup-panel .embed-row-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
#setup-panel .embed-row-desc { font-size: 11px; color: var(--fg-dim); margin-top: 1px; }
#setup-panel .embed-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#setup-panel .embed-count { font-size: 11px; color: var(--fg-dim); }
#setup-panel .embed-auto-panel { margin: 0 0 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: rgba(88,166,255,0.04); }
#setup-panel .embed-auto-panel.embed-auto-cloud_opt_in_available { border-color: rgba(224,175,104,0.35); background: rgba(224,175,104,0.06); }
#setup-panel .embed-auto-panel.embed-auto-off { opacity: 0.9; background: rgba(139,148,158,0.05); }
#setup-panel .embed-auto-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
#setup-panel .embed-auto-title { font-size: 13px; font-weight: 600; color: var(--fg); }
#setup-panel .embed-auto-body { font-size: 12px; line-height: 1.45; color: var(--fg-dim); }
#setup-panel .embed-optin-warning { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: rgba(224,175,104,0.08); border: 1px solid rgba(224,175,104,0.2); color: var(--fg); font-size: 12px; line-height: 1.45; }
#setup-panel .embed-learn-more { margin-top: 8px; color: var(--fg-dim); font-size: 12px; }
#setup-panel .embed-learn-more summary { cursor: pointer; color: var(--accent); }
#setup-panel .embed-learn-more ul { margin: 8px 0 0 18px; padding: 0; line-height: 1.45; }
#setup-panel .embed-policy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#setup-panel .embed-policy-actions .setup-btn.active { color: var(--accent); border-color: rgba(122,162,247,0.55); background: rgba(122,162,247,0.12); }

/* Tab navigation within setup */
#setup-panel .setup-tab {
  transition: color 0.15s, border-color 0.15s;
  background: transparent !important;
  color: var(--fg-dim) !important;
}
#setup-panel .setup-tab.active {
  background: var(--accent) !important;
  color: #0d1117 !important;
}
#setup-panel .setup-tab:not(.active):hover { color: var(--fg) !important; }

/* Version label */
#setup-panel #setup-version-label { text-align: center; font-size: 11px; color: #30363d; margin-top: 8px; padding-bottom: 4px; }

/* ── Provider toggle cards (3b) ─────────────────────────────────────── */
#setup-panel .pcard {
  border-color: #4d5a82 !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#setup-panel .pcard:hover { border-color: #6d7fb3 !important; }
#setup-panel .pcard.is-default { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) inset; }
#setup-panel .pcard[data-disabled="true"] .pcard-body { opacity: 0.6; pointer-events: none; }
#setup-panel .pcard-toggle .pcard-slider {
  background: #465176 !important;
  border: 1px solid #65739f;
  box-sizing: border-box;
}
#setup-panel .pcard-toggle input[type="checkbox"]:checked + .pcard-slider {
  background: var(--accent) !important;
  border-color: var(--accent);
}
#setup-panel .pcard-slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 14px; height: 14px; background: #d7e0ff;
  border-radius: 50%; transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
#setup-panel .pcard-toggle input[type="checkbox"]:checked + .pcard-slider::before { transform: translateX(16px); background: #0d1117; }
#setup-panel .pcard-toggle input[type="checkbox"]:focus-visible + .pcard-slider {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
#setup-panel .pcard-star {
  color: #91a2d4 !important;
  opacity: 1;
  transition: color 0.15s, transform 0.15s, opacity 0.15s;
}
#setup-panel .pcard-star:hover { color: #d6e0ff !important; transform: scale(1.1); }
#setup-panel .pcard-star.is-default { color: #ffd166 !important; }
#setup-panel .pcard-star.is-saving { opacity: 1; cursor: progress; }
#setup-panel .pcard-star:disabled {
  cursor: wait;
  color: #91a2d4 !important;
  -webkit-text-fill-color: #91a2d4;
}
#setup-panel .pcard-star.is-default:disabled {
  color: #ffd166 !important;
  -webkit-text-fill-color: #ffd166;
}
#setup-panel .pcard-auth-row:hover { border-color: var(--fg-dim); }
#setup-panel .pcard-auth-row.is-active {
  border-color: var(--accent); background: rgba(88,166,255,0.06);
}
#setup-panel .pcard-auth-row input[type="radio"] { accent-color: var(--accent); }
#setup-panel .pcard-auth-content { animation: pcardFadeIn 0.2s ease; }
@keyframes pcardFadeIn { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: translateY(0); } }

/* ── Cloudflare Access wizard ──────────────────────────────────────────── */
@keyframes cf-spin { to { transform: rotate(360deg); } }

#setup-panel .cf-step-bar { display: flex; align-items: center; }
#setup-panel .cf-step-item { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
#setup-panel .cf-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--fg-dim);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
#setup-panel .cf-step-item.active .cf-step-num { border-color: var(--accent); color: var(--accent); }
#setup-panel .cf-step-item.done .cf-step-num {
  border-color: var(--green, #9ece6a);
  background: rgba(63,185,80,0.1);
  color: var(--green, #9ece6a);
}
#setup-panel .cf-step-label {
  font-size: 10px; color: var(--fg-dim);
  letter-spacing: 0; text-transform: none; font-weight: 400;
}
#setup-panel .cf-step-item.active .cf-step-label { color: var(--accent); }
#setup-panel .cf-step-line { flex: 1; height: 1px; background: var(--border); margin: 0 4px; margin-bottom: 13px; }

#setup-panel .cf-guide-card {
  display: flex; gap: 12px; padding: 14px;
  border: 1px solid rgba(88,166,255,0.2);
  border-radius: 8px;
  background: rgba(88,166,255,0.04);
}
#setup-panel .cf-guide-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #0d1117;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
#setup-panel .cf-guide-body { flex: 1; min-width: 0; }
#setup-panel .cf-guide-title { font-size: 13px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
#setup-panel .cf-guide-desc { font-size: 12px; color: var(--fg-dim); line-height: 1.45; }

#setup-panel .cf-cmd-block {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px;
  margin-top: 10px; margin-bottom: 2px;
}
#setup-panel .cf-cmd-label {
  font-size: 10px; color: var(--fg-dim);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 5px; font-weight: 500;
}
#setup-panel .cf-cmd-row { display: flex; align-items: center; gap: 8px; }
#setup-panel .cf-cmd-code {
  font-family: 'SF Mono', Menlo, Monaco, 'Cascadia Mono', monospace;
  font-size: 12px; color: var(--fg); flex: 1; word-break: break-all;
}
#setup-panel .cf-login-status {
  display: none;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 1.45;
}
#setup-panel .cf-login-status.is-visible { display: block; }
#setup-panel .cf-login-status.warn {
  border-color: rgba(255,209,102,0.35);
  background: rgba(255,209,102,0.06);
  color: #ffd166;
}
#setup-panel .cf-login-status.ok {
  border-color: rgba(63,185,80,0.32);
  background: rgba(63,185,80,0.06);
  color: var(--green, #9ece6a);
}
#setup-panel .cf-login-status.error {
  border-color: rgba(248,81,73,0.35);
  background: rgba(248,81,73,0.06);
  color: var(--red, #f85149);
}

#setup-panel .cf-field-hint {
  font-size: 11px; color: var(--fg-dim); margin-top: 4px;
  line-height: 1.4; font-weight: 400;
  text-transform: none; letter-spacing: 0;
}

#setup-panel .cf-will-do {
  margin: 14px 0 12px; padding: 10px 12px;
  border: 1px solid rgba(122,162,247,0.18);
  border-radius: 8px; background: rgba(122,162,247,0.04);
}
#setup-panel .cf-will-do-title {
  font-size: 12px; font-weight: 600; color: var(--fg);
  margin-bottom: 6px; text-transform: none; letter-spacing: 0;
}
#setup-panel .cf-will-do-list { display: flex; flex-direction: column; gap: 4px; }
#setup-panel .cf-will-do-item {
  font-size: 12px; color: var(--fg-dim);
  display: flex; align-items: flex-start; gap: 6px;
  line-height: 1.4; font-weight: 400;
  text-transform: none; letter-spacing: 0;
}
#setup-panel .cf-check-icon {
  color: var(--green, #9ece6a); font-weight: 700;
  flex-shrink: 0; font-size: 13px; line-height: 1.3;
}

#setup-panel .cf-success-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: rgba(63,185,80,0.06);
  border: 1px solid rgba(63,185,80,0.2); border-radius: 8px;
}
#setup-panel .cf-success-badge {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(63,185,80,0.15); color: var(--green, #9ece6a);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#setup-panel .cf-success-title { font-size: 13px; font-weight: 600; color: var(--green, #9ece6a); }

/* Access tab: step labels */
#setup-panel .setup-step-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent, #7aa2f7);
  margin-bottom: 10px;
}

/* Access tab: advanced settings collapsible */
#setup-panel .setup-advanced-section {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
#setup-panel .setup-advanced-section > summary {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--fg-dim);
  user-select: none;
  list-style: none;
  background: transparent;
}
#setup-panel .setup-advanced-section > summary::-webkit-details-marker { display: none; }
#setup-panel .setup-advanced-section > summary::before {
  content: '›'; font-size: 14px; font-weight: 700;
  color: var(--fg-dim); transition: transform 0.15s ease;
  display: inline-block; width: 14px; text-align: center;
}
#setup-panel .setup-advanced-section[open] > summary::before { transform: rotate(90deg); }
#setup-panel .setup-advanced-section > summary:hover { color: var(--fg); }
#setup-panel .setup-advanced-body {
  padding: 4px 12px 12px;
  border-top: 1px solid var(--border);
}

html[data-theme="light"] #setup-panel {
  background: var(--bg);
}

html[data-theme="light"] #setup-panel .setup-body,
html[data-theme="light"] #setup-panel .setup-header {
  background: var(--bg);
}

html[data-theme="light"] #setup-panel .card,
html[data-theme="light"] #setup-panel .provider-card,
html[data-theme="light"] #setup-panel .backup-card,
html[data-theme="light"] #setup-panel .config-card {
  background: var(--bg-card);
  box-shadow: 0 8px 24px var(--shadow-color);
}

html[data-theme="light"] #setup-panel .setup-tab.active,
html[data-theme="light"] #setup-panel .setup-btn-primary,
html[data-theme="light"] #setup-panel .provider-action-btn.primary,
html[data-theme="light"] #setup-panel .pcard-default-tag {
  color: var(--accent-fg) !important;
}

html[data-theme="light"] #setup-panel .setup-advanced-body,
html[data-theme="light"] #setup-panel .setup-access-status,
html[data-theme="light"] #setup-panel .setup-phone-guidance,
html[data-theme="light"] #setup-panel .pcard-auth-row,
html[data-theme="light"] #setup-panel .cf-login-status,
html[data-theme="light"] #setup-panel .cf-will-do,
html[data-theme="light"] #setup-panel .cf-success-row {
  background: var(--bg-panel);
}

html[data-theme="light"] #setup-panel .pcard:hover {
  border-color: var(--accent) !important;
}

html[data-theme="light"] #setup-panel .setup-access-method {
  border-color: rgba(15,23,42,0.12);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

html[data-theme="light"] #setup-panel .setup-access-method:hover {
  border-color: rgba(59,102,224,0.36);
  background: #f8faff;
  box-shadow: 0 8px 22px rgba(15,23,42,0.07);
}

html[data-theme="light"] #setup-panel .setup-access-method[aria-pressed="true"] {
  border-color: var(--accent);
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px rgba(59,102,224,0.22), 0 10px 24px rgba(59,102,224,0.10);
}

html[data-theme="light"] #setup-panel .setup-tunnel-mode-option {
  border-color: rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.72);
}

html[data-theme="light"] #setup-panel .setup-tunnel-mode-option:hover {
  border-color: rgba(59,102,224,0.28);
  background: #f8faff;
}

html[data-theme="light"] #setup-panel .setup-tunnel-mode-option[aria-pressed="true"] {
  border-color: rgba(59,102,224,0.44);
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px rgba(59,102,224,0.18);
}

html[data-theme="light"] #setup-panel .setup-access-panel {
  border-color: rgba(59,102,224,0.18);
  background: #ffffff;
}

html[data-theme="light"] #setup-panel .setup-access-panel[open] {
  border-color: rgba(59,102,224,0.28);
  background: #f8faff;
}

html[data-theme="light"] #setup-panel .setup-tunnel-availability,
html[data-theme="light"] #setup-panel .setup-tunnel-connectivity,
html[data-theme="light"] #setup-panel .setup-access-subdetails,
html[data-theme="light"] #setup-panel .setup-scope-status {
  border-color: rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.72);
}

html[data-theme="light"] #setup-panel .setup-ms-private-warning {
  border-color: rgba(190,18,60,0.24);
  background:
    linear-gradient(135deg, rgba(255,228,230,0.96), rgba(255,247,237,0.94)),
    #ffffff;
  box-shadow: 0 12px 28px rgba(190,18,60,0.08);
}

html[data-theme="light"] #setup-panel .setup-ms-private-warning-copy span {
  color: #5f677a;
}

html[data-theme="light"] #setup-panel .cf-login-status.warn {
  color: var(--yellow);
  background: var(--warning-soft);
}

html[data-theme="light"] #setup-panel .cf-login-status.ok,
html[data-theme="light"] #setup-panel .cf-success-title,
html[data-theme="light"] #setup-panel .cf-check-icon {
  color: var(--green);
}

html[data-theme="light"] #setup-panel .cf-login-status.error {
  color: var(--red);
  background: var(--danger-soft);
}

html[data-theme="light"] #setup-panel .pcard-toggle input[type="checkbox"]:checked + .pcard-slider::before {
  background: var(--accent-fg);
}
