.account-page {
  min-height: 100vh;
  background: var(--page);
}

.account-topbar,
.account-footer,
.account-layout {
  width: min(1040px, calc(100% - 48px));
  margin-inline: auto;
}

.account-topbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
}

.account-topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.notification-center { position: relative; }

.notification-button {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
}

.notification-button:hover,
.notification-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.notification-button svg { width: 18px; height: 18px; }

.notification-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--page);
  border-radius: 50%;
  background: var(--accent);
}

.notification-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(26, 22, 18, 0.14);
}

[data-theme="dark"] .notification-popover {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}

.notification-heading,
.notification-actions,
.device-row {
  display: flex;
  align-items: center;
}

.notification-heading {
  justify-content: space-between;
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.82rem;
}

.notification-heading span { color: var(--tertiary); }
.notification-list { display: grid; gap: 10px; padding-top: 10px; }
.notification-empty { margin: 10px 2px; color: var(--tertiary); font-size: 0.8rem; }

.notification-request {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--page);
}

.notification-request p { margin: 0; color: var(--secondary); font-size: 0.78rem; }
.notification-request strong { overflow-wrap: anywhere; font-size: 0.9rem; }
.notification-actions { gap: 7px; }

.notification-actions button,
.device-row button {
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.notification-actions button.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf0;
}

.account-topbar-actions > a,
.account-footer a {
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.account-layout {
  display: grid;
  min-height: calc(100vh - 136px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: clamp(48px, 8vw, 112px);
  padding-block: 64px 88px;
}

.account-intro {
  position: relative;
  max-width: 500px;
  padding-left: 32px;
}

.account-index,
.account-status {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.account-intro h1 {
  margin: 18px 0 24px;
  font-size: clamp(2.9rem, 5.8vw, 5rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 1.02;
}

.account-intro p {
  max-width: 460px;
  margin: 0;
  color: var(--secondary);
  font-size: 1.02rem;
  line-height: 1.75;
}

.account-spine {
  position: absolute;
  inset: 4px auto 4px 0;
  display: grid;
  width: 4px;
  grid-template-rows: 1fr 0.34fr 0.12fr;
  gap: 7px;
}

.account-spine span {
  background: var(--accent);
}

.account-spine span:nth-child(2) { opacity: 0.48; }
.account-spine span:nth-child(3) { opacity: 0.2; }

.account-panel {
  align-self: start;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(26, 22, 18, 0.09);
}

[data-theme="dark"] .account-panel {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.account-message {
  margin: 0 0 22px;
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.88rem;
}

.account-message.is-error {
  border-left-color: var(--danger);
}

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.account-tabs button {
  position: relative;
  padding: 0 0 13px;
  border: 0;
  background: transparent;
  color: var(--tertiary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.account-tabs button.is-active {
  color: var(--text);
}

.account-tabs button.is-active::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.account-form {
  display: grid;
  gap: 18px;
}

.form-heading {
  margin-bottom: 6px;
}

.form-heading h2 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.form-heading p,
.compact-form > p {
  margin: 8px 0 0;
  color: var(--secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

.account-form label {
  display: grid;
  gap: 7px;
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 650;
}

.account-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--page);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.account-primary,
.account-secondary,
.account-danger,
.account-actions button {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.account-primary {
  background: var(--accent);
  color: #fffaf0;
}

.account-secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.account-secondary:hover { background: var(--page); }

.account-primary:hover { background: var(--accent-strong); }
.account-primary:disabled,
.account-secondary:disabled,
.account-danger:disabled { cursor: wait; opacity: 0.55; }

.account-link-button {
  justify-self: center;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.account-link-button:hover { color: var(--text); text-decoration: underline; }

.turnstile-slot:empty { display: none; }

.account-dashboard {
  display: grid;
  gap: 18px;
}

.account-dashboard-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.account-dashboard .form-heading h2 {
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.account-public-id {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.administrator-link {
  flex: none;
  padding: 9px 12px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.account-setting {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--page);
}

.setting-heading {
  display: grid;
  gap: 4px;
}

.setting-heading strong { font-size: 0.9rem; }
.setting-heading span,
.setting-toggle small {
  color: var(--secondary);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.5;
}

.setting-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 20px !important;
  color: var(--text) !important;
}

.setting-toggle span { display: grid; gap: 4px; }
.setting-toggle input { width: 18px; min-height: 18px; accent-color: var(--accent); }

.device-list { display: grid; gap: 10px; margin-top: 14px; }
.device-list > p { margin: 0; color: var(--tertiary); font-size: 0.8rem; }
.device-row { justify-content: space-between; gap: 12px; }
.device-row span { display: grid; gap: 3px; min-width: 0; }
.device-row strong { overflow-wrap: anywhere; font-size: 0.84rem; }
.device-row small { color: var(--tertiary); font-size: 0.72rem; }
.device-row button { flex: none; }

.compact-form {
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-actions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--secondary);
}

.danger-zone {
  border-top: 1px solid var(--line-soft);
  padding-top: 20px;
}

.danger-zone summary {
  color: var(--secondary);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}

.danger-zone[open] summary { margin-bottom: 20px; }

.account-danger {
  background: var(--danger);
  color: #fff;
}

.account-footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--tertiary);
  font-size: 0.76rem;
}

.account-footer span { margin-left: auto; }

@media (max-width: 760px) {
  .account-topbar,
  .account-footer,
  .account-layout { width: min(100% - 32px, 520px); }

  .account-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 44px;
    padding-block: 54px 72px;
  }

  .account-intro h1 { font-size: clamp(2.65rem, 13vw, 4rem); }
  .account-panel { padding: 26px 22px; border-radius: 18px; }
  .account-dashboard-heading { display: grid; }
  .administrator-link { justify-self: start; }
  .account-actions { grid-template-columns: 1fr; }
  .account-footer { flex-wrap: wrap; padding-block: 20px; }
  .account-footer span { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .account-form input { transition: none; }
}
