:root {
  --panel-bg: #ffffff;
  --ink: #263347;
  --soft-ink: #2e86c8;
  --danger: #d84c3e;
  --sheet-line: #d7dbe2;
  --sheet-accent: #f6f7f9;
  --display-bg: #020202;
  --display-on: #27ef54;
  --display-off: #0b4a24;
  --button-border: #1b1b1b;
  --success: #70b845;
  --panel-shadow: 0 26px 80px rgba(83, 132, 184, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
}

.reading-page {
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 246, 211, 0.8) 0, transparent 16rem),
    radial-gradient(circle at 78% 80%, rgba(185, 233, 255, 0.45) 0, transparent 18rem),
    linear-gradient(180deg, #ffffff 0%, #eff6fd 100%);
}

.reading-layout {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.panel {
  width: min(100%, 1240px);
  background: var(--panel-bg);
  border-radius: 34px;
  padding: 2rem clamp(1.25rem, 3vw, 2.75rem);
  box-shadow: var(--panel-shadow);
  border: 10px solid rgba(255, 255, 255, 0.8);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: #748093;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-logo {
  display: block;
  width: clamp(10rem, 18vw, 15rem);
  max-width: 100%;
  height: auto;
  margin: 0 0 0.9rem;
  object-fit: contain;
}

.welcome-line {
  margin: 0 0 0.45rem;
  color: #4c5a6d;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 700;
}

.reading-panel h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 700;
  color: #253248;
}

.dashboard-shell {
  position: relative;
  overflow: hidden;
}

.dashboard-glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.5;
}

.dashboard-glow-top {
  top: 0;
  right: 12%;
  width: 20rem;
  height: 12rem;
  background: rgba(135, 236, 255, 0.45);
}

.dashboard-glow-bottom {
  right: 1rem;
  bottom: -2rem;
  width: 22rem;
  height: 10rem;
  background: rgba(160, 229, 255, 0.3);
}

.dashboard-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.7rem;
}

.hero-art {
  position: relative;
  min-height: 220px;
  min-width: 0;
}

.hero-wave {
  position: absolute;
  right: 0;
  border-radius: 999px 999px 0 999px;
  opacity: 0.88;
}

.hero-wave-one {
  top: 0;
  width: 100%;
  height: 140px;
  background: linear-gradient(90deg, rgba(234, 246, 255, 0.2), rgba(179, 228, 255, 0.85));
}

.hero-wave-two {
  top: 32px;
  width: 90%;
  height: 120px;
  background: linear-gradient(90deg, rgba(227, 247, 255, 0.1), rgba(133, 218, 255, 0.75));
}

.hero-wave-three {
  top: 74px;
  width: 72%;
  height: 96px;
  background: linear-gradient(90deg, rgba(236, 250, 255, 0.08), rgba(162, 227, 255, 0.7));
}

.power-badge {
  position: absolute;
  top: 10px;
  right: 18px;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
}

.power-badge-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #8be7ff 0%, #1c74c8 100%);
  box-shadow:
    0 16px 30px rgba(31, 108, 184, 0.32),
    inset 0 0 0 10px rgba(255, 255, 255, 0.35);
}

.power-badge-core {
  position: relative;
  width: 142px;
  height: 142px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #e7fbff 44%, #bdeafe 100%);
  box-shadow: inset 0 0 0 8px rgba(35, 122, 198, 0.52);
}

.power-badge-core::before,
.power-badge-core::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 28px;
  height: 6px;
  border-radius: 999px;
  background: #2f86cb;
}

.power-badge-core::before {
  left: 16px;
}

.power-badge-core::after {
  right: 16px;
}

.power-bolt {
  position: absolute;
  inset: 24px 44px 24px 44px;
  background: linear-gradient(180deg, #39ace8 0%, #2036a9 100%);
  clip-path: polygon(38% 0, 78% 0, 58% 42%, 78% 42%, 22% 100%, 40% 55%, 18% 55%);
}

.dashboard-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.95fr);
  gap: 1.65rem;
  align-items: start;
}

.dashboard-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.meter-display {
  --digit-gap: clamp(0.2rem, 0.8vw, 0.85rem);
  --visible-digit-count: 3;
  --decimal-point-space: clamp(0.8rem, 1.4vw, 1.4rem);
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: center;
  gap: var(--digit-gap);
  width: 100%;
  margin-bottom: 1.2rem;
  padding: 1.25rem 1.25rem 1rem;
  background: linear-gradient(180deg, rgba(244, 251, 255, 0.98) 0%, rgba(227, 244, 255, 0.95) 100%);
  border-radius: 22px;
  border: 1px solid rgba(155, 205, 245, 0.55);
  box-shadow:
    inset 0 -16px 34px rgba(120, 181, 236, 0.18),
    0 10px 30px rgba(69, 138, 194, 0.12);
  overflow: clip;
}

.meter-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(108, 187, 255, 0.12));
  pointer-events: none;
}

.meter-digit {
  position: relative;
  flex: 0 0 auto;
  width: min(
    7.4rem,
    calc(
      (100% - (((var(--visible-digit-count) - 1) * var(--digit-gap)) + var(--decimal-point-space))) /
      var(--visible-digit-count)
    )
  );
  min-width: 1rem;
  aspect-ratio: 0.58;
  height: auto;
}

.meter-digit-decimal {
  width: min(
    7.4rem,
    calc(
      (100% - (((var(--visible-digit-count) - 1) * var(--digit-gap)) + var(--decimal-point-space))) /
      var(--visible-digit-count)
    )
  );
}

.segment {
  position: absolute;
  background: linear-gradient(135deg, #eef8ff 0%, #d7efff 46%, #fcfeff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(175, 221, 255, 0.4),
    0 0 10px rgba(115, 201, 255, 0.12);
}

.segment.is-on {
  background: linear-gradient(180deg, #38baff 0%, #176fce 38%, #173899 100%);
  box-shadow:
    0 0 14px rgba(73, 198, 255, 0.45),
    inset 0 0 0 1px rgba(209, 245, 255, 0.3);
}

.segment.is-on.is-decimal {
  background: linear-gradient(180deg, #ff8675 0%, #e24b3c 42%, #b32016 100%);
  box-shadow:
    0 0 12px rgba(235, 87, 70, 0.38),
    inset 0 0 0 1px rgba(255, 219, 214, 0.35);
}

.segment-a,
.segment-d,
.segment-g {
  left: 15%;
  width: 70%;
  height: 8%;
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
}

.segment-a {
  top: 0;
}

.segment-g {
  top: 46%;
}

.segment-d {
  bottom: 0;
}

.segment-b,
.segment-c,
.segment-e,
.segment-f {
  width: 16%;
  height: 40%;
  clip-path: polygon(0 10%, 55% 0, 100% 10%, 100% 90%, 45% 100%, 0 90%);
}

.segment-b,
.segment-c {
  right: 0;
}

.segment-e,
.segment-f {
  left: 0;
}

.segment-f,
.segment-b {
  top: 4%;
}

.segment-e,
.segment-c {
  bottom: 4%;
}

.meter-decimal-point {
  flex: 0 0 auto;
  width: var(--decimal-point-space);
  text-align: center;
  align-self: center;
  color: #d94f42;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(235, 87, 70, 0.28);
}

.status-grid {
  margin: 0 0 1.7rem;
}

.dashboard-details {
  padding: 0.2rem 0 0.3rem;
}

.status-grid div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-bottom: 1rem;
}

.status-grid dt {
  color: #55667f;
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.status-grid dd {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.status-grid .danger {
  color: var(--danger);
}

.status-highlight.status-blue {
  color: #2d8bd0;
}

.status-highlight.status-green {
  color: var(--success);
}

.status-highlight.status-red {
  color: #e15a4b;
}

.live-indicator {
  margin: 0;
  color: #95a3b4;
  font-size: 0.95rem;
  font-weight: 500;
}

.live-indicator.is-error {
  color: var(--danger);
}

.dashboard-sync {
  margin-top: 1.1rem;
  font-size: 1rem;
}

.summary-panel {
  display: grid;
  gap: 1rem;
}

.summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  box-shadow: 0 12px 26px rgba(154, 190, 223, 0.14);
  border: 1px solid rgba(215, 235, 249, 0.9);
}

.summary-copy h2 {
  margin: 0 0 0.45rem;
  color: #2b3a50;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 400;
}

.status-chip {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.status-blue {
  color: #2d8bd0;
}

.status-green {
  color: #07b14a;
}

.status-red {
  color: #dd5647;
}

.status-dot {
  width: 0.82rem;
  height: 0.82rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-dot-blue {
  background: #18aacd;
}

.status-dot-green {
  background: #06b863;
}

.status-green .status-dot {
  background: #06b863;
}

.status-red .status-dot {
  background: #dd5647;
}

.summary-icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
}

.summary-icon-green {
  background: #79bf4c;
}

.summary-icon-red {
  background: #dd5647;
}

.summary-icon-orange {
  background: #f2a02e;
}

.summary-card-units {
  align-items: flex-end;
}

.units-figure {
  margin: 0;
  color: #d95844;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  font-weight: 700;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  margin-top: 1rem;
}

.buy-form {
  display: grid;
  gap: 0.8rem;
}

.buy-label {
  color: #5c6f79;
  font-weight: 700;
}

.buy-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 3px solid #0b0b0b;
  border-radius: 16px;
  font-size: 1rem;
}

.outline-button-submit {
  cursor: pointer;
}

.outline-button {
  min-width: 0;
  width: 100%;
  padding: 1.1rem 1.5rem;
  border: 0;
  border-radius: 24px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: clamp(1.5rem, 2.7vw, 2.1rem);
  font-weight: 700;
  box-shadow: 0 16px 28px rgba(69, 120, 192, 0.22);
}

.button-buy {
  background: linear-gradient(180deg, #3d7cd8 0%, #173f9c 100%);
}

.button-history {
  background: linear-gradient(90deg, #218db7 0%, #45d0b5 100%);
}

.button-meter-history {
  background: linear-gradient(90deg, #f2992e 0%, #ef6c4f 100%);
}

.transactions-page {
  background:
    linear-gradient(var(--sheet-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--sheet-line) 1px, transparent 1px),
    #fbfbfb;
  background-size: 48px 48px;
}

.transactions-layout {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.sheet-card {
  position: relative;
  margin-bottom: 2rem;
  padding: 0.25rem 0 0.5rem;
}

.sheet-header {
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr);
  width: fit-content;
  min-width: min(100%, 520px);
}

.sheet-title,
.sheet-subtitle {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--sheet-line);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
}

.grid-table {
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.88);
}

.grid-table th,
.grid-table td {
  min-width: 88px;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--sheet-line);
  font-size: 0.92rem;
  text-align: left;
  font-weight: 400;
}

.grid-table thead th {
  background: var(--sheet-accent);
  font-weight: 700;
}

.grid-table th:first-child,
.grid-table td:first-child {
  min-width: 48px;
}

.summary-box {
  position: absolute;
  top: 3.4rem;
  right: 0;
  min-width: 235px;
  padding: 0.2rem 0.35rem;
  color: #434343;
}

.summary-box p {
  margin: 0.8rem 0;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .dashboard-header,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    order: -1;
    min-height: 150px;
  }

  .power-badge {
    top: 0;
    right: 0;
    width: 128px;
    height: 128px;
  }

  .power-badge-core {
    width: 108px;
    height: 108px;
  }

  .power-badge-core::before,
  .power-badge-core::after {
    width: 18px;
    height: 5px;
  }

  .power-bolt {
    inset: 18px 34px 18px 34px;
  }

  .meter-display {
    --digit-gap: clamp(0.15rem, 0.7vw, 0.45rem);
    --decimal-point-space: clamp(0.55rem, 1vw, 0.9rem);
    padding: 0.95rem 0.75rem 0.8rem;
  }

  .summary-box {
    position: static;
    padding: 0.75rem 0 0;
  }
}

@media (max-height: 940px) and (min-width: 861px) {
  .reading-layout {
    padding: 0.9rem 1rem;
  }

  .panel {
    padding: 1.1rem 1.5rem 1.2rem;
    border-width: 7px;
  }

  .brand-logo {
    width: clamp(8rem, 12vw, 11rem);
    margin-bottom: 0.45rem;
  }

  .welcome-line {
    font-size: clamp(1.7rem, 2.3vw, 2.2rem);
    margin-bottom: 0.2rem;
  }

  .eyebrow {
    font-size: 0.82rem;
    margin-bottom: 0.18rem;
  }

  .dashboard-header {
    margin-bottom: 0.8rem;
    gap: 1rem;
  }

  .hero-art {
    min-height: 130px;
  }

  .hero-wave-one {
    height: 88px;
  }

  .hero-wave-two {
    top: 20px;
    height: 74px;
  }

  .hero-wave-three {
    top: 48px;
    height: 58px;
  }

  .power-badge {
    width: 112px;
    height: 112px;
    top: 0;
    right: 6px;
  }

  .power-badge-core {
    width: 94px;
    height: 94px;
    box-shadow: inset 0 0 0 6px rgba(35, 122, 198, 0.52);
  }

  .power-badge-core::before,
  .power-badge-core::after {
    width: 15px;
    height: 4px;
  }

  .power-badge-core::before {
    left: 12px;
  }

  .power-badge-core::after {
    right: 12px;
  }

  .power-bolt {
    inset: 15px 30px 15px 30px;
  }

  .dashboard-grid {
    gap: 1rem;
  }

  .meter-display {
    --digit-gap: clamp(0.1rem, 0.35vw, 0.32rem);
    --decimal-point-space: clamp(0.45rem, 0.7vw, 0.7rem);
    padding: 0.75rem 0.7rem 0.6rem;
    margin-bottom: 0.7rem;
  }

  .meter-digit,
  .meter-digit-decimal {
    width: min(
      4.9rem,
      calc(
        (100% - (((var(--visible-digit-count) - 1) * var(--digit-gap)) + var(--decimal-point-space))) /
        var(--visible-digit-count)
      )
    );
  }

  .meter-decimal-point {
    font-size: 1.8rem;
  }

  .status-grid {
    margin-bottom: 0.8rem;
  }

  .status-grid div {
    margin-bottom: 0.55rem;
  }

  .status-grid dt,
  .status-grid dd,
  .summary-copy h2,
  .status-chip {
    font-size: 0.92rem;
  }

  .dashboard-sync {
    margin-top: 0.45rem;
    font-size: 0.9rem;
  }

  .summary-panel {
    gap: 0.75rem;
  }

  .summary-card {
    padding: 0.9rem 1rem;
    border-radius: 18px;
  }

  .summary-copy h2 {
    margin-bottom: 0.25rem;
  }

  .summary-icon {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.95rem;
  }

  .units-figure {
    font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  }

  .dashboard-actions {
    margin-top: 3.7rem;
    gap: 0.75rem;
  }

  .outline-button {
    padding: 0.85rem 1.1rem;
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
    border-radius: 20px;
  }
}

@media (max-width: 640px) {
  .reading-layout {
    padding: 1rem 0.5rem;
  }

  .panel {
    border-radius: 20px;
    border-width: 6px;
    padding: 1.1rem 0.8rem 1.25rem;
  }

  .welcome-line {
    font-size: 1.9rem;
  }

  .eyebrow {
    font-size: 0.82rem;
  }

  .brand-logo {
    width: clamp(8rem, 44vw, 11rem);
    margin-bottom: 0.7rem;
  }

  .dashboard-header {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .hero-art {
    min-height: 118px;
  }

  .hero-wave-one {
    height: 90px;
  }

  .hero-wave-two {
    top: 18px;
    height: 78px;
  }

  .hero-wave-three {
    top: 44px;
    height: 64px;
  }

  .power-badge {
    width: 96px;
    height: 96px;
  }

  .power-badge-core {
    width: 82px;
    height: 82px;
    box-shadow: inset 0 0 0 5px rgba(35, 122, 198, 0.52);
  }

  .power-badge-core::before,
  .power-badge-core::after {
    width: 12px;
    height: 4px;
  }

  .power-badge-core::before {
    left: 11px;
  }

  .power-badge-core::after {
    right: 11px;
  }

  .power-bolt {
    inset: 14px 27px 14px 27px;
  }

  .dashboard-grid {
    gap: 1rem;
  }

  .meter-display {
    --digit-gap: clamp(0.08rem, 0.5vw, 0.22rem);
    --decimal-point-space: 0.45rem;
    padding: 0.8rem 0.45rem 0.65rem;
    margin-bottom: 0.85rem;
  }

  .status-grid div {
    margin-bottom: 0.7rem;
  }

  .status-grid dt,
  .status-grid dd,
  .status-chip,
  .summary-copy h2 {
    font-size: 0.98rem;
  }

  .sheet-header {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .grid-table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }

  .dashboard-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 0.85rem;
    gap: 0.75rem;
    width: 100%;
  }

  .outline-button {
    min-width: 0;
    width: 100%;
    flex: 0 0 auto;
  }

  .button-history {
    min-width: 0;
  }

  .button-meter-history {
    min-width: 0;
  }

  .summary-card {
    padding: 0.95rem 0.9rem;
    border-radius: 16px;
  }

  .units-figure {
    font-size: 2rem;
  }
}

/* Shared dashboard styling for Buy Units and Payment History */
.subpage-layout {
  align-items: start;
}

.subpage-shell {
  position: relative;
  overflow: hidden;
  margin: auto;
}

.subpage-header,
.subpage-intro,
.purchase-grid,
.history-card {
  position: relative;
  z-index: 1;
}

.subpage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5eef6;
}

.subpage-header .brand-logo {
  width: clamp(9rem, 16vw, 13rem);
  margin: 0;
}

.subpage-brand {
  display: inline-flex;
}

.subpage-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.back-link,
.compact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  color: #31516f;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  background: #eef7fd;
}

.compact-action {
  color: #fff;
  background: linear-gradient(180deg, #3d7cd8 0%, #173f9c 100%);
  box-shadow: 0 10px 20px rgba(40, 91, 170, 0.2);
}

.subpage-intro {
  margin: 2.2rem 0 1.6rem;
}

.subpage-intro h1 {
  margin: 0.15rem 0 0.45rem;
  color: #253248;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 1.08;
}

.subpage-intro > p:last-child,
.history-intro > div > p:last-child {
  margin: 0;
  color: #64758a;
  font-size: 1.05rem;
}

.purchase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 1.4rem;
  align-items: stretch;
}

.purchase-card,
.purchase-help-card,
.history-card,
.meter-summary {
  border: 1px solid rgba(215, 235, 249, 0.95);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 35px rgba(95, 145, 190, 0.13);
}

.purchase-card {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 24px;
}

.purchase-card-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.purchase-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 auto;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #31b4df, #2454b7);
  font-size: 1.5rem;
  box-shadow: 0 10px 22px rgba(36, 105, 183, 0.24);
}

.purchase-card h2,
.purchase-help-card h2,
.history-card h2 {
  margin: 0;
  color: #29384e;
}

.purchase-card-heading p,
.purchase-help-card > p {
  margin: 0.3rem 0 0;
  color: #718095;
  line-height: 1.6;
}

.buy-form {
  gap: 1.1rem;
}

.form-field {
  display: grid;
  gap: 0.5rem;
}

.buy-label span {
  color: #91a0b0;
  font-weight: 500;
}

.buy-input {
  min-height: 54px;
  padding: 0.9rem 1rem;
  border: 2px solid #d9e7f2;
  border-radius: 15px;
  color: #263347;
  background: #fafdff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.buy-input:focus {
  border-color: #3f94d4;
  box-shadow: 0 0 0 4px rgba(63, 148, 212, 0.13);
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-top: 0.35rem;
  padding: 0.9rem 1.2rem;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(90deg, #218db7 0%, #35bda7 100%);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 13px 25px rgba(37, 151, 161, 0.22);
}

.form-message {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-weight: 600;
}

.form-message-success {
  color: #16733c;
  background: #eaf8ef;
}

.form-message-error {
  color: #a83c32;
  background: #fff0ee;
}

.purchase-help-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.35rem, 3vw, 2rem);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(240, 250, 255, 0.95), rgba(231, 252, 247, 0.96));
}

.purchase-help-card .status-chip {
  margin-bottom: 1.2rem;
}

.purchase-help-card a {
  margin-top: 1.4rem;
  color: #2477ad;
  font-weight: 700;
  text-decoration: none;
}

.history-shell {
  padding-bottom: 2.5rem;
}

.history-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.meter-summary {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.15rem 0.9rem;
  min-width: 210px;
  padding: 1rem 1.2rem;
  border-radius: 18px;
}

.meter-summary span,
.meter-summary small {
  color: #738397;
}

.meter-summary strong {
  grid-row: span 2;
  align-self: center;
  color: #2c8bbb;
  font-size: 1.55rem;
}

.history-card {
  overflow: hidden;
  margin-bottom: 1.25rem;
  padding: 0;
  border-radius: 22px;
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid #e4edf4;
}

.section-kicker {
  margin: 0 0 0.2rem;
  color: #2b96bd;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.history-frequency {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: #287699;
  background: #eaf7fb;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.88);
}

.history-table th,
.history-table td {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid #edf2f6;
  text-align: left;
  white-space: nowrap;
}

.history-table th {
  color: #718095;
  background: #f8fbfd;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-table tbody tr:hover {
  background: #f8fcff;
}

.reading-pill {
  display: inline-flex;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: #13824a;
  background: #eaf8ef;
  font-weight: 700;
}

.empty-row td {
  padding: 2rem;
  color: #7b8999;
  text-align: center;
}

@media (max-width: 760px) {
  .subpage-layout {
    padding: 0.65rem;
  }

  .subpage-shell {
    padding: 1rem;
  }

  .purchase-grid {
    grid-template-columns: 1fr;
  }

  .history-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .meter-summary {
    width: 100%;
  }

  .history-table th,
  .history-table td {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 520px) {
  .subpage-header {
    align-items: flex-start;
  }

  .subpage-header .brand-logo {
    width: 8.2rem;
  }

  .subpage-nav {
    align-items: flex-end;
    flex-direction: column;
    gap: 0.35rem;
  }

  .back-link,
  .compact-action {
    min-height: 40px;
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
  }

  .subpage-intro {
    margin: 1.5rem 0 1.2rem;
  }

  .purchase-card,
  .purchase-help-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .purchase-card-heading {
    align-items: flex-start;
  }

  .primary-action {
    width: 100%;
  }

  .history-card {
    border-radius: 17px;
  }

  .history-card-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
  }

  .history-frequency {
    white-space: normal;
  }
}

.login-help p {
  margin: 0.2rem 0;
}

.admin-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.admin-stats {
  display: flex;
  gap: 0.75rem;
}

.admin-stats > div {
  display: grid;
  min-width: 120px;
  padding: 0.9rem 1rem;
  border: 1px solid #d8ebf7;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 25px rgba(95, 145, 190, 0.1);
}

.admin-stats strong {
  color: #287faa;
  font-size: 1.55rem;
}

.admin-stats span {
  color: #738397;
  font-size: 0.82rem;
}

.admin-users-card,
.admin-detail-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(215, 235, 249, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 35px rgba(95, 145, 190, 0.13);
}

.admin-search-bar {
  display: flex;
  align-items: end;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0;
}

.admin-search-field {
  display: grid;
  flex: 1 1 auto;
  gap: 0.45rem;
}

.admin-search-field input {
  width: 100%;
  min-height: 52px;
  padding: 0.9rem 1rem;
  border: 1px solid #cfe4f3;
  border-radius: 16px;
  background: #fbfeff;
  color: #2d3b50;
  font-size: 1rem;
}

.admin-search-field input:focus {
  outline: 2px solid rgba(51, 146, 190, 0.18);
  border-color: #57b8dc;
}

.admin-search-button {
  min-width: 140px;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
}

.admin-user-list {
  display: grid;
}

.admin-user-row {
  display: grid;
  grid-template-columns: auto minmax(150px, 1.3fr) minmax(110px, 0.7fr) auto auto;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid #edf2f6;
  color: #2d3b50;
  text-decoration: none;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.admin-user-row:last-child {
  border-bottom: 0;
}

.admin-user-row:hover,
.admin-user-row:focus-visible,
.admin-user-row.is-selected {
  background: #f0f9fd;
  box-shadow: inset 4px 0 #2c9ec2;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #3baed1, #315ab4);
  font-size: 1.1rem;
  font-weight: 800;
}

.user-main,
.user-meter {
  display: grid;
  gap: 0.2rem;
}

.admin-user-meta {
  color: #4b6f88;
}

.user-main small,
.user-meter,
.admin-detail-heading p {
  color: #768698;
}

.row-arrow {
  color: #3995b8;
  font-size: 1.25rem;
}

.admin-empty {
  padding: 2rem;
  color: #7a8999;
  text-align: center;
}

.admin-detail-card {
  margin-top: 1.4rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  scroll-margin-top: 1rem;
}

.admin-detail-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-detail-heading h2,
.admin-detail-heading p {
  margin: 0.15rem 0;
}

.user-avatar-large {
  width: 4rem;
  height: 4rem;
  font-size: 1.55rem;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.admin-detail-grid article {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 1rem;
  border-radius: 15px;
  background: #f7fbfd;
}

.admin-detail-grid span {
  color: #758598;
  font-size: 0.82rem;
}

.admin-detail-grid strong {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .admin-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-stats > div {
    flex: 1;
    min-width: 0;
  }

  .admin-search-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0.9rem 0;
  }

  .admin-search-button {
    width: 100%;
    min-width: 0;
  }

  .admin-user-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
  }

  .admin-user-row .user-meter {
    grid-column: 2;
  }

  .admin-user-row .status-chip {
    grid-column: 2;
  }

  .admin-user-row .row-arrow {
    grid-column: 3;
    grid-row: 1 / span 3;
  }

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

  .pagination-bar {
    padding: 1rem 0.9rem;
  }
}

@media (max-width: 430px) {
  .admin-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .admin-detail-grid {
    grid-template-columns: 1fr;
  }
}

.admin-history-section h3 {
  margin: 0.15rem 0 0.8rem;
  color: #2d3b50;
}

.admin-history-section {
  overflow: hidden;
  margin-top: 1.25rem;
  border: 1px solid #e0ecf3;
  border-radius: 18px;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid #edf2f6;
}

.pagination-bar-inline {
  padding-top: 1.1rem;
  border-top: 0;
}

.pagination-summary {
  color: #70859a;
  font-size: 0.92rem;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pagination-links a,
.pagination-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid #d6e8f4;
  border-radius: 999px;
  background: #fff;
  color: #2d6f96;
  text-decoration: none;
  font-weight: 700;
}

.pagination-links .is-active {
  border-color: #2d8db7;
  background: linear-gradient(135deg, #2da7ce, #315eb5);
  color: #fff;
}

/* Clear numeric meter display */
.meter-display {
  gap: clamp(0.05rem, 0.25vw, 0.22rem);
  padding: clamp(1rem, 3vw, 1.6rem);
}

.meter-display .meter-digit,
.meter-display .meter-digit-decimal {
  width: auto;
  min-width: 0.58em;
  height: auto;
  aspect-ratio: auto;
  color: #1765b5;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: clamp(2.7rem, 8.5vw, 6.8rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 3px 8px rgba(23, 101, 181, 0.16);
}

.meter-display .meter-digit-decimal {
  color: #df493c;
  text-shadow: 0 3px 8px rgba(223, 73, 60, 0.16);
}

.meter-display .meter-decimal-point {
  width: auto;
  margin: 0 0.05em;
  color: #df493c;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: clamp(2.7rem, 8.5vw, 6.8rem);
  font-weight: 700;
  line-height: 0.8;
}

.dashboard-logout-row {
  display: flex;
  justify-content: flex-end;
  padding: 0.1rem 0.25rem 0;
}

.dashboard-logout-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid #f0c8c3;
  border-radius: 50%;
  color: #c34538;
  background: #fff8f7;
  box-shadow: 0 8px 18px rgba(185, 71, 59, 0.13);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.dashboard-logout-icon:hover,
.dashboard-logout-icon:focus-visible {
  color: #fff;
  background: #d55245;
  transform: translateY(-2px);
}


.account-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  border: 1px solid #f0c8c3;
  border-radius: 12px;
  color: #b9473b;
  background: #fff8f7;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(185, 71, 59, 0.08);
}

.account-link:hover,
.account-link:focus-visible {
  color: #b9473b;
  border-color: #e6a69f;
  background: #fff0ee;
}

.dashboard-header .account-link {
  margin-bottom: 0.6rem;
}

.login-layout {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
  width: min(100%, 1040px);
  min-height: 650px;
  overflow: hidden;
  border: 10px solid rgba(255, 255, 255, 0.82);
  border-radius: 34px;
  background: #fff;
  box-shadow: var(--panel-shadow);
}

.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 85% 15%, rgba(128, 222, 255, 0.5), transparent 15rem),
    linear-gradient(150deg, #eef9ff 0%, #e6f8f3 100%);
}

.login-brand-panel .brand-logo {
  position: relative;
  z-index: 1;
  width: clamp(10rem, 18vw, 14rem);
}

.login-brand-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
}

.login-brand-copy h1 {
  margin: 0.5rem 0 1rem;
  color: #253248;
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 0.98;
}

.login-brand-copy > p:last-child {
  max-width: 30rem;
  margin: 0;
  color: #5f7185;
  font-size: 1.05rem;
  line-height: 1.7;
}

.login-energy-mark {
  position: absolute;
  right: -3rem;
  bottom: -3rem;
  width: 12rem;
  height: 12rem;
  display: grid;
  place-items: center;
}

.login-energy-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(52, 176, 221, 0.35), rgba(52, 178, 142, 0.2));
}

.login-energy-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #36aed9, #2457b5);
  font-size: 3rem;
  box-shadow: 0 18px 34px rgba(38, 105, 180, 0.25);
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 3.5rem);
}

.login-form {
  display: grid;
  gap: 1.15rem;
  width: min(100%, 390px);
}

.login-heading {
  margin-bottom: 0.6rem;
}

.login-heading h2 {
  margin: 0.2rem 0 0.45rem;
  color: #253248;
  font-size: clamp(2rem, 4vw, 3rem);
}

.login-heading > p:last-child {
  margin: 0;
  color: #718095;
  line-height: 1.55;
}

.password-field {
  position: relative;
}

.password-field .buy-input {
  padding-right: 4.5rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  min-width: 3.5rem;
  min-height: 36px;
  padding: 0.35rem;
  border: 0;
  border-radius: 9px;
  color: #2c7eac;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #eaf7fb;
}

.login-submit {
  margin-top: 0.25rem;
}

.login-help {
  margin: 0;
  color: #8190a1;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 780px) {
  .login-layout {
    padding: 0.65rem;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    border-width: 6px;
    border-radius: 22px;
  }

  .login-brand-panel {
    min-height: 220px;
    padding: 1.4rem;
  }

  .login-brand-copy {
    margin-top: 2rem;
  }

  .login-brand-copy h1 {
    font-size: clamp(2.25rem, 10vw, 3.2rem);
  }

  .login-brand-copy > p:last-child {
    display: none;
  }

  .login-energy-mark {
    width: 8rem;
    height: 8rem;
  }

  .login-energy-core {
    width: 4.8rem;
    height: 4.8rem;
    font-size: 2rem;
  }

  .login-form-panel {
    padding: 1.5rem 1.1rem 1.8rem;
  }
}

@media (max-width: 520px) {
  .subpage-nav .account-link {
    min-height: 36px;
    padding: 0.35rem 0.65rem;
    font-size: 0.88rem;
  }
}
