:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #121417;
  --muted: #667085;
  --border: #d9dee7;
  --accent: #ff7a1a;
  --accent-strong: #e45f00;
  --good: #12a150;
  --bad: #d92d20;
  --shadow: 0 22px 60px rgba(18, 20, 23, 0.08);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
  white-space: normal;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

button.secondary {
  background: #eef1f5;
  color: var(--ink);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.14);
}

label {
  display: block;
  margin: 16px 0 8px;
  color: #394150;
  font-size: 0.88rem;
  font-weight: 700;
}

code {
  background: #eef1f5;
  border-radius: 6px;
  padding: 2px 5px;
}

.shell {
  width: calc(100% - 32px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 24px;
  align-items: end;
  padding: 38px 0 28px;
}

.hero > *,
.grid > *,
.panel,
.status-card {
  min-width: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero p {
  max-width: 690px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.panel,
.status-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.panel + .panel,
.grid + .panel {
  margin-top: 18px;
}

.panel-heading,
.status-card,
.inline,
.actions,
.toggle-row {
  display: flex;
  align-items: center;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel h2 {
  margin: 0;
  font-size: 1.15rem;
}

.status-card {
  gap: 14px;
  padding: 18px;
}

.status-card strong,
.status-card span {
  display: block;
}

.status-card span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--bad);
  box-shadow: 0 0 0 6px rgba(217, 45, 32, 0.12);
}

.status-dot.ok {
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(18, 161, 80, 0.12);
}

.inline {
  gap: 10px;
}

.inline button {
  flex: 0 0 auto;
}

.hint,
.muted {
  color: var(--muted);
}

.hint {
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.toggle-row {
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row strong,
.toggle-row span {
  display: block;
}

.toggle-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch {
  margin: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  display: block;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cfd6e0;
  position: relative;
  transition: 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.actions {
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
}

.events {
  display: grid;
  gap: 10px;
}

.usage-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.usage-row > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.usage-row strong,
.usage-row span {
  display: block;
}

.usage-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.price-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.price-card.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.12);
}

.price-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.price strong {
  font-size: 2.1rem;
  line-height: 1;
}

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

.feature-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
  color: #394150;
  font-size: 0.92rem;
  line-height: 1.35;
}

.feature-list li::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

.event {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.event strong {
  display: block;
  margin-bottom: 4px;
}

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

.amount {
  font-weight: 800;
  color: var(--accent-strong);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(16px);
  min-width: min(420px, calc(100% - 32px));
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 820px) {
  .hero,
  .grid,
  .event,
  .usage-row,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    width: calc(100% - 24px);
    padding-top: 18px;
  }

  .hero {
    gap: 18px;
    padding-top: 26px;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.02;
  }

  .hero p {
    font-size: 1rem;
  }

  .panel {
    padding: 20px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

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

  .inline button,
  .actions button,
  .panel-heading button {
    width: 100%;
  }
}
