/* Vie access gate */
html.vie-auth-pending,
html.vie-auth-locked { overflow: hidden; }
html.vie-auth-pending .vie-viewport,
html.vie-auth-locked .vie-viewport { visibility: hidden; pointer-events: none; }
html.vie-auth-ready #vie-access-gate { display: none; }

#vie-access-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.86), transparent 28%),
    radial-gradient(circle at 82% 82%, rgba(204,215,235,.38), transparent 30%),
    #f3f4f6;
  color: #171719;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
}
.vie-gate-shell {
  width: min(100%, 390px);
  display: grid;
  gap: 15px;
}
.vie-gate-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.vie-gate-mark {
  width: 66px;
  height: 66px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}
.vie-gate-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.vie-gate-brand h1 { margin: 0; font-size: 23px; line-height: 1.18; font-weight: 650; letter-spacing: -.03em; }
.vie-gate-brand p { margin: 0; color: #85858b; font-size: 12px; line-height: 1.55; }
.vie-gate-card {
  overflow: hidden;
  border: 1px solid rgba(115,115,122,.15);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
  backdrop-filter: blur(24px) saturate(1.15);
}
.vie-gate-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px; padding: 4px; border-radius: 10px; background: rgba(118,118,128,.10); }
.vie-gate-tabs button { min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: #77777d; font: inherit; font-size: 13px; font-weight: 600; }
.vie-gate-tabs button.is-active { background: #fff; color: #1d1d1f; }
.vie-gate-view { padding: 8px 16px 17px; }
.vie-gate-view[hidden] { display: none !important; }
.vie-gate-view-title { margin: 6px 2px 14px; text-align: center; }
.vie-gate-view-title strong { display: block; font-size: 16px; line-height: 1.35; font-weight: 650; }

.vie-gate-fields { overflow: hidden; border: 1px solid rgba(116,116,122,.13); border-radius: 10px; background: rgba(255,255,255,.74); }
.vie-gate-field { min-height: 52px; display: grid; grid-template-columns: 90px minmax(0,1fr); align-items: center; gap: 8px; padding: 0 13px; position: relative; }
.vie-gate-field + .vie-gate-field::before { content: ""; position: absolute; top: 0; left: 13px; right: 13px; height: .5px; background: rgba(60,60,67,.15); }
.vie-gate-field span { color: #55555b; font-size: 12px; }
.vie-gate-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #151517; font: inherit; font-size: 14px; text-align: right; }
.vie-gate-field input::placeholder { color: #b3b3b8; }
.vie-gate-field input[data-activation] { letter-spacing: .04em; text-transform: uppercase; }
.vie-gate-primary,
.vie-gate-secondary,
.vie-gate-text-button { width: 100%; min-height: 46px; border: 0; font: inherit; cursor: pointer; }
.vie-gate-primary { margin-top: 12px; border-radius: 10px; background: #151517; color: #fff; font-size: 14px; font-weight: 650; }
.vie-gate-primary:disabled { opacity: .42; }
.vie-gate-secondary { margin-top: 9px; border-radius: 10px; background: rgba(118,118,128,.10); color: #2c2c2e; font-size: 13px; font-weight: 600; }
.vie-gate-text-button { min-height: 34px; margin-top: 4px; background: transparent; color: #6c6c72; font-size: 12px; }
.vie-gate-status { min-height: 18px; margin: 10px 3px 0; color: #85858b; font-size: 11px; line-height: 1.5; text-align: center; }
.vie-gate-status.is-error { color: #d34b4b; }
.vie-gate-status.is-success { color: #248a3d; }
.vie-gate-security { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 22px; background: rgba(244,244,246,.93); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.vie-gate-security[hidden] { display: none; }
.vie-gate-security-card { width: min(100%, 330px); text-align: center; }
.vie-gate-security-card .vie-gate-mark { margin: 0 auto 16px; }
.vie-gate-security-card h2 { margin: 0 0 8px; font-size: 20px; }
.vie-gate-security-card p { margin: 0; color: #77777d; font-size: 12px; line-height: 1.7; }

/* Real account/admin settings surfaces */
.vie-auth-summary { display: grid; gap: 8px; padding: 14px; }
.vie-auth-summary-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.vie-auth-summary-line span { color: var(--vie-text-muted); font-size: calc(11px * var(--vie-font-scale)); }
.vie-auth-summary-line strong { min-width: 0; color: var(--vie-text-primary); font-size: calc(12px * var(--vie-font-scale)); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.vie-auth-device-list,.vie-admin-account-list,.vie-admin-code-list { display: grid; gap: 9px; margin-top: 10px; }
.vie-auth-device,.vie-admin-account,.vie-admin-code { border: .5px solid var(--vie-page-divider-soft); border-radius: 14px; background: var(--vie-page-surface-strong); padding: 11px 12px; }
.vie-auth-device-head,.vie-admin-account-head,.vie-admin-code-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vie-auth-device strong,.vie-admin-account strong,.vie-admin-code strong { font-size: calc(12px * var(--vie-font-scale)); font-weight: 620; }
.vie-auth-device small,.vie-admin-account small,.vie-admin-code small { display: block; margin-top: 4px; color: var(--vie-text-muted); font-size: calc(9px * var(--vie-font-scale)); line-height: 1.5; overflow-wrap: anywhere; }
.vie-auth-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb,var(--logo-color) 10%,transparent); color: var(--logo-color); font-size: calc(8px * var(--vie-font-scale)); }
.vie-auth-inline-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.vie-auth-inline-actions button { min-height: 30px; border: .5px solid var(--vie-page-divider); border-radius: 9px; padding: 0 10px; background: var(--vie-page-soft-surface); color: var(--vie-text-primary); font: inherit; font-size: calc(9px * var(--vie-font-scale)); }
.vie-auth-inline-actions button.is-danger { color: #d65a55; }
.vie-auth-help { margin: 8px 2px 0; color: var(--vie-text-muted); font-size: calc(9px * var(--vie-font-scale)); line-height: 1.55; }
.vie-auth-status { min-height: 18px; margin-top: 8px; color: var(--vie-text-muted); font-size: calc(9px * var(--vie-font-scale)); line-height: 1.5; }
.vie-auth-status.is-error { color: #d65a55; }
.vie-auth-status.is-success { color: #248a3d; }
.vie-admin-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 12px; }
.vie-admin-metric { padding: 12px; border: .5px solid var(--vie-page-divider-soft); border-radius: 14px; background: var(--vie-page-surface-strong); }
.vie-admin-metric span { display: block; color: var(--vie-text-muted); font-size: calc(9px * var(--vie-font-scale)); }
.vie-admin-metric strong { display: block; margin-top: 4px; font-size: calc(18px * var(--vie-font-scale)); font-weight: 650; }
.vie-admin-code-output { margin-top: 10px; padding: 13px; border: .5px dashed var(--vie-page-divider); border-radius: 13px; background: var(--vie-page-soft-surface); text-align: center; }
.vie-admin-code-output strong { display: block; font-size: calc(14px * var(--vie-font-scale)); letter-spacing: .04em; overflow-wrap: anywhere; }
.vie-admin-code-copy-list { display:grid; gap:7px; }
.vie-admin-code-copy { width:100%; border:0; border-radius:9px; padding:8px 10px; background:transparent; color:var(--vie-text-primary); font:inherit; font-size:calc(13px * var(--vie-font-scale)); font-weight:620; letter-spacing:.04em; overflow-wrap:anywhere; cursor:pointer; }
.vie-admin-code-copy:active { background:color-mix(in srgb,var(--logo-color) 8%,transparent); }

@media (prefers-color-scheme: dark) {
  #vie-access-gate { background: radial-gradient(circle at 18% 12%, rgba(70,70,74,.45), transparent 28%), #151516; color: #f5f5f7; }
  .vie-gate-card { background: rgba(36,36,38,.78); border-color: rgba(255,255,255,.08); }
  .vie-gate-tabs { background: rgba(118,118,128,.20); }
  .vie-gate-tabs button.is-active { background: #3a3a3c; color: #fff; }
  .vie-gate-fields { background: rgba(44,44,46,.72); border-color: rgba(255,255,255,.07); }
  .vie-gate-field + .vie-gate-field::before { background: rgba(255,255,255,.10); }
  .vie-gate-field span { color: #c2c2c7; }
  .vie-gate-field input { color: #f5f5f7; }
  .vie-gate-primary { background: #f5f5f7; color: #111; }
  .vie-gate-secondary { background: rgba(118,118,128,.24); color: #f2f2f7; }
  .vie-gate-security { background: rgba(21,21,22,.95); }
}
.vie-admin-device-detail { padding: 8px 0; border-top: .5px solid var(--vie-page-divider-soft); }
.vie-admin-device-detail:first-child { border-top: 0; padding-top: 2px; }
.vie-admin-device-detail + .vie-admin-device-detail { margin-top: 4px; }
.vie-admin-device-detail strong { font-size: calc(10px * var(--vie-font-scale)); }
.vie-admin-device-detail small { margin-top: 2px; }

/* Account/admin authority group */
.vie-authority-group:not(.has-admin) .settings-row[data-settings-page="account"]::after { display:none; }
.settings-item-icon[data-icon="admin"] i {
  color:#fff;
  font-size:18px;
  line-height:1;
}
