:root {
  --bg: #0b0e14;
  --panel: #111827;
  --panel-2: #0f172a;
  --panel-3: #020617;
  --border: rgba(148, 163, 184, .35);
  --border-soft: rgba(148, 163, 184, .18);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, .14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, .16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.pd-dark {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  background:
    radial-gradient(1200px 600px at 0% 0%, rgba(249,115,22,.18), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(96,165,250,.20), transparent 55%),
    var(--bg);
  color: var(--text);
}

/* ===== Layout ===== */

.container {
  max-width: 1400px;
  margin: 82px auto 40px;
  padding: 0 18px 36px;
}

.pd-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.card {
  background:
    linear-gradient(180deg, rgba(15,23,42,.92), rgba(15,23,42,.88));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 20px 22px;
  box-shadow: 0 18px 45px rgba(15,23,42,.65);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.2;
}

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

.account-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px 24px 26px;
}

.account-hero__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fdba74;
  margin-bottom: 10px;
}

.account-hero__title {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.04;
  color: #f8fafc;
}

.account-hero__sub {
  margin-top: 10px;
  max-width: 720px;
  font-size: 14px;
  color: #cbd5e1;
}

.account-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.account-panel {
  min-width: 0;
}

.account-panel--full {
  grid-column: 1 / -1;
}

.account-panel--danger {
  border-color: rgba(239, 68, 68, .35);
  background:
    linear-gradient(180deg, rgba(30, 10, 10, .82), rgba(15,23,42,.90));
}

.account-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148,163,184,.12);
}

/* ===== Buttons / inputs ===== */

.pd-input {
  height: 42px;
  width: 100%;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--text);
  outline: none;
  font-size: 15px;
}

.pd-input::placeholder {
  color: var(--muted);
}

.pd-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #111827;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}

.btn:hover {
  background: #1f2937;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}

.btn-primary {
  background: linear-gradient(135deg, #fb923c, #f97316);
  border-color: rgba(248,250,252,.1);
  color: #0b0f19;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: #020617;
  border-color: var(--border);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: rgba(248,250,252,.12);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.04);
}

/* ===== Info grids ===== */

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.account-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 12px;
  background: rgba(2,6,23,.42);
}

.account-grid strong {
  color: #cbd5e1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.account-grid span {
  color: #f8fafc;
  text-align: right;
  word-break: break-word;
}

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

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

/* ===== Forms ===== */

.account-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 560px);
  gap: 12px 16px;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.account-form .pd-input,
.account-form .password-field {
  width: 100%;
  max-width: 560px;
}

.account-form label {
  display: contents;
}

.account-form span {
  justify-self: end;
  color: #cbd5e1;
  font-size: 14px;
}

.account-form .btn-primary {
  grid-column: 2;
  width: max-content;
  justify-self: start;
  margin-top: 4px;
}

.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.4;
}

#editPwErr {
  grid-column: 2;
  font-size: 13px;
  margin-top: -6px;
  margin-bottom: 4px;
  color: #f87171;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.password-field .pd-input {
  width: 100%;
  padding-right: 42px;
}

.password-field .reveal {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  opacity: .6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.password-field .reveal:hover {
  opacity: 1;
}

/* ===== Storage ===== */

.storage-box {
  padding: 14px 14px 12px;
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 14px;
  background: rgba(2,6,23,.44);
}

.storage-line {
  font-size: 14px;
  color: #e5e7eb;
}

.storage-remaining {
  margin-top: 4px;
  color: #cbd5e1;
}

.storage-bar {
  margin-top: 14px;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(148,163,184,.14);
}

.storage-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #f97316);
  transition: width .25s ease;
}

/* ===== Notifications ===== */

.notifications-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 14px;
  background: rgba(2,6,23,.46);
}

.notifications-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

.notifications-table th,
.notifications-table td {
  padding: .75rem .8rem;
  border-bottom: 1px solid rgba(148,163,184,.12);
  text-align: left;
  vertical-align: top;
}

.notifications-table th {
  background: rgba(15,23,42,.88);
  font-weight: 700;
  color: #f8fafc;
}

.notifications-table tr:nth-child(even) td {
  background: rgba(2,6,23,.35);
}

.notifications-table .muted {
  text-align: center;
  color: #9ca3af;
}

.notifications-table .notif-dismissed-yes {
  color: #22c55e;
  font-weight: 700;
}

.notifications-table .notif-dismissed-no {
  color: #f97316;
  font-weight: 700;
}

/* ===== Danger ===== */

.danger-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 340px) auto;
  gap: 12px 16px;
  align-items: center;
  width: 100%;
}

.danger-form span {
  justify-self: end;
  color: #fecaca;
}

#deactivateBtn {
  justify-self: start;
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(15,23,42,.85);
  max-width: 340px;
  z-index: 60;
}

/* ===== Responsive ===== */

@media (max-width: 1180px) {
  .container {
    max-width: 1120px;
  }

  .account-panels {
    grid-template-columns: 1fr;
  }

  .account-panel--full {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .container {
    margin-top: 70px;
    padding: 0 12px 28px;
  }

  .account-hero {
    padding: 20px 18px;
  }

  .account-grid,
  .account-grid--wide,
  .account-grid--stats {
    grid-template-columns: 1fr;
  }

  .account-form,
  .danger-form {
    grid-template-columns: 1fr;
  }

  .account-form span,
  .danger-form span {
    justify-self: start;
  }

  .account-form .btn-primary,
  #editPwErr,
  #deactivateBtn {
    grid-column: 1;
  }

  .notifications-table {
    min-width: 760px;
  }
}

.account-stat-link{
  color:#60a5fa;
  font-weight:700;
  text-decoration:none;
  border-bottom:1px solid transparent;
  transition:color .15s ease, border-color .15s ease, opacity .15s ease;
}

.account-stat-link:hover{
  color:#93c5fd;
  border-bottom-color:rgba(147,197,253,.55);
}

.account-stat-link:focus-visible{
  outline:none;
  border-bottom-color:#93c5fd;
}