
html,
body {
  height: auto;
  min-height: 100%;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

main#accountMain {
  overflow: visible;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

body {
  overflow-x: hidden;
}

main {
  padding: calc(6px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.header-link-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .18s ease, transform .12s ease, border-color .18s ease;
}

.header-link-btn:hover {
  background: rgba(255, 255, 255, .14);
}

.signed-in-header-actions {
  display: none;
}

body.account-signed-in .signed-in-header-actions {
  display: flex;
}

.header-privacy-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  opacity: .92;
}

.header-privacy-link:hover,
.header-privacy-link:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

.pull-refresh-indicator {
  position: fixed;
  top: calc(var(--header) + env(safe-area-inset-top) + 6px);
  left: 50%;
  z-index: 1025;
  margin: 0;
  width: fit-content;
  max-width: calc(100% - 28px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(19, 37, 60, .92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
  transform: translate(-50%, calc(-100% - 14px));
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
}

.pull-refresh-indicator.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.pull-refresh-indicator.is-armed {
  border-color: rgba(247, 178, 103, .46);
}

.pull-refresh-indicator.is-refreshing {
  pointer-events: none;
}

.pull-refresh-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .24);
  border-top-color: #f7b267;
}

.pull-refresh-indicator.is-refreshing .pull-refresh-spinner {
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-intro-loader {
  position: fixed;
  inset: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 16, 28, .14);
  backdrop-filter: blur(1px);
  opacity: 1;
  visibility: visible;
  transition: opacity .18s ease, visibility .18s ease;
  pointer-events: none;
}

.page-intro-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2.5px solid rgba(255,255,255,.22);
  border-top-color: #f7b267;
  animation: spin .72s linear infinite;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
}

body.page-ready #pageIntroLoader {
  opacity: 0;
  visibility: hidden;
}

.account-shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.public-resource-card {
  gap: 12px;
}

.compact-head {
  margin-bottom: 12px;
}

.public-resource-body {
  display: grid;
  gap: 12px;
}

.public-resource-link,
.inline-delete-link {
  color: var(--text);
  text-decoration: none;
}

.public-resource-link {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  word-break: break-all;
}

.public-resource-link:hover,
.inline-delete-link:hover {
  color: var(--accent);
}

.inline-delete-link {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1.2fr .88fr;
  gap: 16px;
}

.stack-col {
  display: grid;
  gap: 16px;
  align-content: start;
}

.card {
  position: relative;
  background: rgba(19, 37, 60, .82);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
  padding: 18px;
  box-sizing: border-box;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 16px;
  align-items: center;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.08;
}

.subcopy {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 64ch;
}

.hero-meta {
  display: flex;
  justify-content: flex-end;
}

.meta-label,
.label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.status-pills,
.action-group,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill,
.state-pill,
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.pill.ghost,
.state-pill.ghost {
  background: transparent;
}

.role-badge {
  background: rgba(247, 178, 103, .16);
  color: var(--accent);
  border-color: rgba(247, 178, 103, .28);
}

.alert-box {
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.alert-box.info {
  background: rgba(59, 130, 246, .12);
  border-color: rgba(96, 165, 250, .25);
}

.alert-box.success {
  background: rgba(16, 185, 129, .12);
  border-color: rgba(52, 211, 153, .28);
}

.alert-box.warn {
  background: rgba(245, 158, 11, .14);
  border-color: rgba(251, 191, 36, .28);
}

.alert-box.error {
  background: rgba(239, 68, 68, .14);
  border-color: rgba(248, 113, 113, .28);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.card-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.auth-tab,
.btn,
.filter-chip,
.mini-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  font: inherit;
  cursor: pointer;
  transition: transform .14s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease;
}

.auth-tab {
  min-height: 42px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

.auth-tab.is-active {
  background: rgba(247, 178, 103, .16);
  border-color: rgba(247, 178, 103, .28);
  color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.search-field span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  outline: none;
  font: inherit;
}

textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

select,
input[readonly] {
  cursor: default;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(247, 178, 103, .45);
  box-shadow: 0 0 0 3px rgba(247, 178, 103, .14);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, .42);
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  color: var(--text);
}

.btn:hover,
.auth-tab:hover,
.filter-chip:hover,
.mini-btn:hover,
.header-link-btn:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.auth-tab:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.filter-chip:disabled,
.mini-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(135deg, rgba(247, 178, 103, .95), rgba(255, 211, 143, .95));
  color: #1d1306;
  font-weight: 800;
}

.btn.soft {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12);
}

.btn.danger {
  background: rgba(255, 0, 0, 0.514);
  border-color: rgba(248, 113, 113, .28);
}

.btn.compact {
  min-height: 38px;
  padding-inline: 12px;
}

.form-note,
.session-note,
.micro-note,
.helper-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.identity-grid,
.session-grid,
.admin-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
}

.metric-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.metric-value {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.entitlement-list {
  display: grid;
  gap: 10px;
}

.ent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
}

.state-pill.active {
  color: #b7ffd3;
  border-color: rgba(16, 185, 129, .34);
  background: rgba(16, 185, 129, .18);
}

.state-pill.inactive {
  color: #ffe1b8;
  border-color: rgba(245, 158, 11, .34);
  background: rgba(245, 158, 11, .16);
}

.state-pill.cached {
  color: #c4ddff;
  border-color: rgba(96, 165, 250, .34);
  background: rgba(59, 130, 246, .16);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.admin-search-field {
  display: grid;
  gap: 8px;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12);
}

.filter-chip.is-active {
  background: rgba(247, 178, 103, .18);
  color: var(--accent);
  border-color: rgba(247, 178, 103, .32);
}

.admin-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid transparent;
}

.admin-feedback.success {
  color: #8ef7b4;
  border-color: rgba(52, 211, 153, .28);
  background: rgba(16, 185, 129, .08);
}

.admin-feedback.error {
  color: #ffb4b4;
  border-color: rgba(248, 113, 113, .28);
  background: rgba(239, 68, 68, .08);
}

.admin-list-wrap {
  margin-top: 16px;
}

.admin-list-head {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.admin-pagination {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-page-info {
  font-size: 13px;
  color: var(--muted);
  min-width: 118px;
  text-align: center;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: 14px;
}

.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: rgba(255, 255, 255, .06);
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.user-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.user-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.status-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.active {
  background: rgba(16, 185, 129, .12);
  color: #8ef7b4;
}

.status-pill.blocked {
  background: rgba(245, 158, 11, .14);
  color: #ffd38f;
}

.status-pill.deleted {
  background: rgba(239, 68, 68, .14);
  color: #ffb4b4;
}

.status-pill.self {
  background: rgba(96, 165, 250, .14);
  color: #bfd8ff;
}

.status-pill.role {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-btn {
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
}

.mini-btn-danger {
  background: rgba(239, 68, 68, .12);
  color: #ffb4b4;
}

.mini-btn-warning {
  background: rgba(245, 158, 11, .12);
  color: #ffd38f;
}

.mini-btn-success {
  background: rgba(16, 185, 129, .12);
  color: #8ef7b4;
}

.mini-btn-muted {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}


.admin-global-access {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}

.admin-global-copy {
  flex: 1 1 320px;
}

.admin-global-copy strong {
  display: block;
  margin-bottom: 4px;
}

.admin-global-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-global-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.switch-wrap-inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
}

.switch-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
}

.switch-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
  transition: .2s;
  cursor: pointer;
}

.switch-slider:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 4px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.switch input:checked + .switch-slider {
  background: rgba(247, 178, 103, .9);
}

.switch input:checked + .switch-slider:before {
  transform: translateX(22px);
}

.switch input:disabled + .switch-slider {
  opacity: .45;
  cursor: not-allowed;
}

.switch-caption {
  font-size: 12px;
  color: var(--muted);
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .layout-grid,
  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .auth-tabs,
  .field-grid.two,
  .identity-grid,
  .session-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .card {
    border-radius: 18px;
    padding: 16px;
  }

  .header-link-btn {
    padding-inline: 12px;
    font-size: 12px;
  }
}

:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder {
  color: rgba(15, 23, 42, .42);
}

:root[data-theme="light"] .card {
  background: rgba(255, 255, 255, .9);
}

:root[data-theme="light"] .btn.soft,
:root[data-theme="light"] .auth-tab,
:root[data-theme="light"] .metric,
:root[data-theme="light"] .ent-item,
:root[data-theme="light"] .filter-chip,
:root[data-theme="light"] .table-wrap,
:root[data-theme="light"] .pill,
:root[data-theme="light"] .state-pill.ghost,
:root[data-theme="light"] .mini-btn-muted,
:root[data-theme="light"] .status-pill.role {
  background: rgba(15, 23, 42, .04);
  border-color: rgba(15, 23, 42, .1);
}

:root[data-theme="light"] .header-link-btn,
:root[data-theme="light"] .pull-refresh-indicator {
  background: rgba(19, 37, 60, .94);
  color: #fff;
  border-color: rgba(255, 255, 255, .14);
}

:root[data-theme="light"] .state-pill.active {
  color: #0b6b36;
  background: rgba(16, 185, 129, .16);
  border-color: rgba(16, 185, 129, .34);
}

:root[data-theme="light"] .state-pill.inactive {
  color: #975a00;
  background: rgba(245, 158, 11, .18);
  border-color: rgba(245, 158, 11, .34);
}

:root[data-theme="light"] .state-pill.cached {
  color: #0f4fa8;
  background: rgba(59, 130, 246, .15);
  border-color: rgba(59, 130, 246, .3);
}

:root[data-theme="light"] .status-pill.active,
:root[data-theme="light"] .mini-btn-success {
  color: #0b6b36;
  background: rgba(16, 185, 129, .14);
}

:root[data-theme="light"] .status-pill.blocked,
:root[data-theme="light"] .mini-btn-warning {
  color: #975a00;
  background: rgba(245, 158, 11, .16);
}

:root[data-theme="light"] .status-pill.deleted,
:root[data-theme="light"] .mini-btn-danger {
  color: #b42318;
  background: rgba(239, 68, 68, .14);
}

:root[data-theme="light"] .status-pill.self {
  color: #0f4fa8;
  background: rgba(59, 130, 246, .14);
}

:root[data-theme="light"] .admin-table th {
  background: rgba(15, 23, 42, .05);
}

:root[data-theme="light"] .admin-table th,
:root[data-theme="light"] .admin-table td {
  border-bottom-color: rgba(15, 23, 42, .08);
}


/* ===== Account polish pass ===== */
body {
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

.layout-grid,
.stack-col,
.card,
.table-wrap,
.admin-list-wrap {
  min-width: 0;
}

.layout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.admin-full-span {
  grid-column: 1 / -1;
  width: 100%;
}

.account-shell {
  opacity: .92;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
  width: min(100%, 1180px);
  overflow-x: clip;
}

body.page-ready .account-shell {
  opacity: 1;
  transform: translateY(0);
}

.hero-card h1,
.card-head h2,
.metric-value,
.user-name,
.header-link-btn,
.brand span {
  font-weight: 600 !important;
  letter-spacing: 0;
}

.btn,
.auth-tab,
.filter-chip,
.mini-btn,
.pill,
.state-pill,
.role-badge,
.status-pill {
  font-weight: 500 !important;
  letter-spacing: 0;
}

.btn.primary {
  font-weight: 600 !important;
}

.card-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(247, 178, 103, .14);
  border: 1px solid rgba(247, 178, 103, .24);
  color: var(--accent);
  flex: 0 0 auto;
}

.card-icon svg {
  width: 18px;
  height: 18px;
}

.pill.online {
  color: #b7ffd3;
  background: rgba(16, 185, 129, .18);
  border-color: rgba(16, 185, 129, .3);
}

.pill.offline {
  color: #ffe1b8;
  background: rgba(245, 158, 11, .16);
  border-color: rgba(245, 158, 11, .3);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f7b267' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  padding-right: 42px;
}

:root[data-theme="dark"] select {
  color-scheme: dark;
}

:root[data-theme="dark"] select option {
  background: #13243b;
  color: #f7f9fc;
}

:root[data-theme="light"] select {
  color-scheme: light;
}

:root[data-theme="light"] select option {
  background: #ffffff;
  color: #13243b;
}

.btn,
.auth-tab,
.filter-chip,
.mini-btn,
.header-link-btn,
.password-toggle {
  position: relative;
  --spinner-color: var(--text);
}

.btn.primary { --spinner-color: #1d1306; }
.btn.danger { --spinner-color: #ffb4b4; }
.btn.soft { --spinner-color: var(--text); }
.filter-chip { --spinner-color: var(--text); }
.mini-btn-danger { --spinner-color: #ffb4b4; }
.mini-btn-warning { --spinner-color: #ffd38f; }
.mini-btn-success { --spinner-color: #8ef7b4; }
.header-link-btn { --spinner-color: #ffffff; }


.btn.is-loading,
.auth-tab.is-loading,
.filter-chip.is-loading,
.mini-btn.is-loading,
.header-link-btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after,
.auth-tab.is-loading::after,
.filter-chip.is-loading::after,
.mini-btn.is-loading::after,
.header-link-btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  border-radius: 999px;
  border: 2px solid var(--spinner-color);
  border-right-color: transparent;
  animation: spin .78s linear infinite;
}


.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .14s ease;
}

.password-toggle:hover {
  background: rgba(255,255,255,.08);
  color: var(--text);
}

.password-toggle:active {
  transform: translateY(-50%) scale(.98);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(247, 178, 103, .14);
}

.password-toggle.is-active {
  color: var(--accent);
}

.password-toggle .eye-icon {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.password-toggle .eye-off {
  display: none;
}

.password-toggle.is-active .eye-open {
  display: none;
}

.password-toggle.is-active .eye-off {
  display: block;
}

@media (min-width: 761px) and (max-width: 1180px) {
  .layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .stack-col {
    min-width: 0;
  }

  #adminPanel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .layout-grid,
  .hero-card {
    grid-template-columns: 1fr;
  }

  .admin-full-span {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-shell {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .btn,
  .auth-tab,
  .filter-chip,
  .mini-btn,
  .header-link-btn,
  .password-toggle,
  .pull-refresh-indicator {
    transition: none !important;
  }
}

:root[data-theme="light"] .password-toggle {
  color: rgba(15,23,42,.68);
}

:root[data-theme="light"] .password-toggle:hover {
  background: rgba(15,23,42,.06);
}

:root[data-theme="light"] 
:root[data-theme="light"] .state-pill.active,
:root[data-theme="light"] .state-pill.inactive {
  font-weight: 600 !important;
}

:root[data-theme="light"] .card-icon {
  background: rgba(247, 178, 103, .16);
  border-color: rgba(247, 178, 103, .26);
}

:root[data-theme="light"] .public-resource-link {
  background: rgba(15, 23, 42, .04);
  border-color: rgba(15, 23, 42, .1);
}

:root[data-theme="light"] .pill.online {
  color: #0b6b36;
  background: rgba(16, 185, 129, .16);
  border-color: rgba(16, 185, 129, .28);
}

:root[data-theme="light"] .pill.offline {
  color: #975a00;
  background: rgba(245, 158, 11, .18);
  border-color: rgba(245, 158, 11, .32);
}

:root[data-theme="light"] select {
  background-color: rgba(255,255,255,.9);
}


@media (min-width: 761px) and (max-width: 1080px) {
  .account-shell {
    max-width: 100%;
  }

  .layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-primary-col,
  .account-secondary-col,
  .admin-full-span,
  .table-wrap {
    min-width: 0;
  }
}



/* === Guest-first account flow refinements === */
main {
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

.pull-refresh-slot {
  height: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: height .18s ease;
  pointer-events: none;
}

.pull-refresh-slot.is-visible {
  pointer-events: none;
}

.pull-refresh-indicator {
  position: static;
  inset: auto;
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 24px);
  transform: translateY(-6px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease, border-color .18s ease;
}

.pull-refresh-indicator.is-visible {
  transform: translateY(0);
  opacity: 1;
}

body.account-guest #heroCard,
body.account-guest #accountSecondaryCol {
  display: none !important;
}

body.account-guest #layoutGrid {
  grid-template-columns: 1fr;
}

body.account-guest .account-primary-col {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}

body.account-guest #alertBox {
  max-width: 560px;
  margin-inline: auto;
}

#heroCard {
  margin-top: 0;
}

.guest-card-head {
  margin-bottom: 18px;
}

.guest-card-head .card-title {
  margin-bottom: 8px;
}

.auth-panels {
  display: grid;
}

.auth-view {
  animation: authFade .18s ease;
}

.auth-links {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.auth-links p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.text-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  line-height: inherit;
  cursor: pointer;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@keyframes authFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .pull-refresh-slot {
    height: 12px;
  }

  body.account-guest .account-primary-col,
  body.account-guest #alertBox {
    max-width: none;
  }
}



.account-footer-link {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}

.footer-text-link {
  color: var(--muted);
  
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.footer-text-link:hover {
  color: var(--text);
  border-color: currentColor;
}

:root[data-theme="light"] .footer-text-link {
     color: #eba449;
}


/* === Scroll fix pass === */
html, body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body {
  overscroll-behavior-y: auto !important;
  touch-action: pan-y;
}

main,
main#accountMain {
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  overscroll-behavior-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.pull-refresh-slot {
  height: 0 !important;
  min-height: 0 !important;
}


/* === Hard disable custom pull-to-refresh and restore native scrolling === */
/* Pastikan ini TIDAK tersembunyi */
#pullRefreshIndicator {
  position: fixed;
  top: calc(var(--header) + env(safe-area-inset-top) + 12px);
  left: 50%;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Padding disamakan agar menjadi lingkaran */
  padding: 10px; 
  border-radius: 50%; 
  background: rgba(19, 37, 60, .95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
  
  /* Animasi transisi */
  transform: translate(-50%, -60px);
  opacity: 0;
  transition: transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity .2s ease;
  pointer-events: none;
}

#pullRefreshIndicator.is-visible {
  opacity: 1;
}

/* Spinner Animasi */
.pull-refresh-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: #f7b267; /* Warna aksen sesuai tema Anda */
}

/* Hanya berputar saat status is-refreshing aktif */
#pullRefreshIndicator.is-refreshing .pull-refresh-spinner {
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== White page backend refresh ===== */
body {
  background: #ffffff;
}

main#accountMain {
  --text: #162033;
  --muted: #5b6880;
  --border: rgba(15, 23, 42, .10);
  color: var(--text);
}

#accountMain .card,
#accountMain .table-wrap,
#accountMain .admin-list-wrap,
#accountMain .metric,
#accountMain .ent-item,
#accountMain .pill,
#accountMain .state-pill.ghost,
#accountMain .status-pill.role,
#accountMain .mini-btn-muted,
#accountMain .auth-tab,
#accountMain .btn.soft,
#accountMain .filter-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, .10);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

#accountMain .card {
  backdrop-filter: none;
}

#accountMain input,
#accountMain select,
#accountMain textarea {
  background: #ffffff;
  color: #162033;
  border-color: rgba(15, 23, 42, .12);
}

#accountMain input::placeholder,
#accountMain textarea::placeholder {
  color: rgba(15, 23, 42, .42);
}

#accountMain .public-resource-link {
  background: #ffffff;
  border-color: rgba(15, 23, 42, .10);
}

#accountMain .pill.ghost,
#accountMain .state-pill.ghost {
  background: transparent;
  box-shadow: none;
}

#accountMain .admin-table th {
  background: #f7f9fc;
}

#accountMain .admin-table th,
#accountMain .admin-table td {
  border-bottom-color: rgba(15, 23, 42, .08);
}

.page-intro-loader {
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(2px);
}

.header-link-btn,
.pull-refresh-indicator {
  background: rgba(19, 37, 60, .94);
  color: #ffffff;
  border-color: rgba(255, 255, 255, .14);
}


/* ===== Light theme readability polish ===== */
:root[data-theme="light"] .alert-box { color: #162033; }
:root[data-theme="light"] .alert-box.info { color: #0f4fa8; background: rgba(59, 130, 246, .10); border-color: rgba(59, 130, 246, .22); }
:root[data-theme="light"] .alert-box.success { color: #0b6b36; background: rgba(16, 185, 129, .10); border-color: rgba(16, 185, 129, .24); }
:root[data-theme="light"] .alert-box.warn { color: #975a00; background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .24); }
:root[data-theme="light"] .alert-box.error { color: #b42318; background: rgba(239, 68, 68, .10); border-color: rgba(239, 68, 68, .22); }
:root[data-theme="light"] .admin-feedback.success { color: #0b6b36; background: rgba(16, 185, 129, .10); border-color: rgba(16, 185, 129, .24); }
:root[data-theme="light"] .admin-feedback.error { color: #b42318; background: rgba(239, 68, 68, .10); border-color: rgba(239, 68, 68, .22); }
:root[data-theme="light"] #accountMain input[readonly] { background: #f7f9fc; color: #314055; font-weight: 600; }
:root[data-theme="light"] #accountMain .metric,
:root[data-theme="light"] #accountMain .ent-item,
:root[data-theme="light"] #accountMain .auth-tab,
:root[data-theme="light"] #accountMain .btn.soft,
:root[data-theme="light"] #accountMain .filter-chip,
:root[data-theme="light"] #accountMain .table-wrap,
:root[data-theme="light"] #accountMain .admin-list-wrap { box-shadow: 0 10px 28px rgba(15, 23, 42, .06); }


.profile-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 14px;
}

.profile-edit-note {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(247, 178, 103, .22);
  background: rgba(247, 178, 103, .10);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

.privacy-link {
  margin-top: 6px;
  text-align: left;
}

.privacy-link a {
  font-size: 13px;
  color: #eba449;
  text-decoration: none;
}

.privacy-link a:hover {
  text-decoration: underline;
}























