:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #182033;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #2458d3;
  --primary-hover: #1f49ad;
  --secondary-hover: #eef3ff;
  --success: #116149;
  --error: #a83434;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.intro,
.account-panel,
.topup-panel,
.admin-panel,
.status-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(24, 32, 51, 0.08);
}

.intro,
.account-panel,
.topup-panel,
.admin-panel {
  padding: 44px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.15;
}

.copy {
  max-width: 680px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1.05rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.status-text {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}

.status-text.is-ok,
.is-ok {
  color: var(--success);
}

.status-text.is-error,
.is-error {
  color: var(--error);
}

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

.info-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcff;
}

.info-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.bank-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 1rem;
}

.bank-line strong {
  color: var(--text);
  font-size: 1.1rem;
}

dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 700;
}

.deposit-name {
  color: var(--primary);
  letter-spacing: 0;
}

.package-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 18px;
}

.package-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcff;
}

.package-item span,
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 12px;
}

.inline-form label {
  display: grid;
  flex: 1;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.row-form {
  display: flex;
  gap: 8px;
  min-width: 260px;
}

.row-form select {
  min-width: 160px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.button-primary {
  background: var(--primary);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--primary-hover);
}

.button-disabled {
  border: 1px solid #cfd6e2;
  background: #e7ebf2;
  color: #596273;
  cursor: not-allowed;
}

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

.button-secondary:hover {
  background: var(--secondary-hover);
  border-color: #c6d3ea;
}

.status-panel {
  margin-top: 18px;
  padding: 24px;
}

.account-panel,
.topup-panel,
.admin-panel {
  margin-top: 18px;
}

.admin-search-form {
  margin-top: 18px;
}

.status-panel h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

#healthText {
  margin-bottom: 0;
  color: var(--muted);
}

#healthText.is-ok {
  color: var(--success);
}

#healthText.is-error {
  color: var(--error);
}

.policy {
  display: grid;
  gap: 12px;
}

.policy h2 {
  margin-top: 12px;
}

.policy h2:first-child {
  margin-top: 0;
}

.policy p {
  margin-bottom: 0;
  color: var(--muted);
}

.policy-updated {
  color: #7b8794;
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 920px);
    padding: 32px 0;
  }

  .intro {
    padding: 28px;
  }

  .account-panel,
  .topup-panel,
  .admin-panel {
    padding: 24px;
  }

  .section-heading,
  .inline-form,
  .row-form {
    display: grid;
  }

  .status-text {
    max-width: none;
    text-align: left;
  }

  .info-grid,
  .info-grid.compact,
  .package-list {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
