:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --page: #F5F5F0;
  --surface: #EAEAE4;
  --card: #FAF9F6;
  --text: #0E1015;
  --muted: #4A505C;
  --border: #D4D4CC;
  --orange: #FF9900;
  --orange-hover: #E68A00;
  --blue: #0073BB;
  --green: #10B981;
  --red: #EF4444;
  --dark: #0E1015;
  --dark-surface: #181B23;
  --dark-border: #272B36;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
}

button, a { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.topbar {
  min-height: 76px;
  padding: 0 clamp(18px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--orange);
  color: var(--text);
  font-size: 23px;
  font-weight: 900;
}

.brand-name { font-size: 17px; font-weight: 850; letter-spacing: -.04em; }
.brand-divider { width: 1px; height: 22px; background: var(--border); }
.brand-parent { color: var(--muted); font-size: 12px; font-weight: 700; }

.language-toggle {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.language-toggle:hover { border-color: var(--blue); }

.page-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 43px 0 22px;
}

.page-heading, .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.page-heading { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .08em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.04em; }
.page-subtitle { margin-bottom: 0; color: var(--muted); font-size: 14px; }

.back-link {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.back-link:hover { border-color: var(--blue); }

.state-card {
  min-height: 150px;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
}

.state-card h2 { margin-bottom: 5px; font-size: 17px; }
.state-card p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.spinner { width: 28px; height: 28px; flex: 0 0 auto; border: 3px solid var(--border); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { align-items: flex-start; border-color: #F3B4B4; }
.error-state h2 { color: var(--red); }
.error-state p { margin-bottom: 16px; }
.state-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #FEE2E2; color: #B91C1C; font-weight: 900; }
.button { min-height: 40px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; text-decoration: none; font-size: 12px; font-weight: 800; }
.button-dark { background: var(--dark); color: #F5F5F0; }

.welcome-card {
  min-height: 190px;
  padding: clamp(24px, 5vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--dark-border);
  border-radius: 24px;
  background: var(--dark);
  color: #F5F5F0;
}

.welcome-card::after {
  width: 250px;
  height: 250px;
  position: absolute;
  inset-inline-end: 20%;
  top: -160px;
  border-radius: 50%;
  background: #FF9900;
  content: "";
  opacity: .12;
  filter: blur(1px);
}

.welcome-copy { position: relative; z-index: 1; }
.eyebrow-on-dark { color: var(--orange); }
.welcome-card h2 { margin-bottom: 8px; font-size: clamp(22px, 4vw, 30px); letter-spacing: -.03em; }
.welcome-card p:last-child { margin-bottom: 0; color: #9CA3AF; font-size: 13px; }
.status-pill { position: relative; z-index: 1; padding: 9px 13px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #285B4B; border-radius: 999px; background: #10251F; color: #A7F3D0; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #10B98124; }

.section-block { margin-top: 34px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.025em; }
.section-caption { color: var(--muted); font-size: 11px; font-weight: 700; }

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

.data-card, .details-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}

.data-card { min-height: 128px; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.card-label { color: var(--muted); font-size: 11px; font-weight: 750; }
.data-card strong { font-size: clamp(15px, 2vw, 20px); line-height: 1.3; overflow-wrap: anywhere; }
.muted-value { color: var(--muted); font-size: 11px; }
.remaining-card { border-color: #F2B84B; background: #FFF8E9; }
.remaining-card strong { color: #713F00; }

.details-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.details-card { min-width: 0; padding: 22px; }
.compact-heading { align-items: center; margin-bottom: 15px; }
.details-list { margin: 0; }
.details-list > div { min-height: 43px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); }
.details-list dt { color: var(--muted); font-size: 12px; }
.details-list dd { margin: 0; font-size: 12px; font-weight: 750; text-align: end; overflow-wrap: anywhere; }
.features-list { margin: 0; padding-inline-start: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 11px 22px; color: var(--text); font-size: 12px; }
.features-list li::marker { color: var(--blue); }
.empty-note { margin: 0; color: var(--muted); font-size: 12px; }

.tools-section { padding-top: 4px; }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool-card { min-height: 92px; padding: 15px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.tool-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--blue); font-size: 10px; font-weight: 900; }
.tool-card h3 { margin-bottom: 4px; font-size: 13px; }
.tool-card p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.tool-state { margin-inline-start: auto; padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }

.footer { padding: 30px 0 12px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.footer span:first-child { color: var(--text); font-weight: 850; }

@media (max-width: 850px) {
  .subscription-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .topbar { min-height: 64px; padding-inline: 16px; }
  .page-shell { width: min(100% - 28px, 500px); padding-top: 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .back-link { min-height: 38px; }
  .welcome-card { min-height: 165px; align-items: flex-start; flex-direction: column; gap: 18px; }
  .subscription-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .data-card { min-height: 112px; padding: 14px; }
  .details-layout, .tools-grid { grid-template-columns: 1fr; }
  .features-list { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .section-caption { max-width: 110px; text-align: end; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0E1015;
    --surface: #181B23;
    --card: #181B23;
    --text: #F5F5F0;
    --muted: #9CA3AF;
    --border: #272B36;
  }

  .remaining-card { border-color: #70511D; background: #2A2418; }
  .remaining-card strong { color: #FCD34D; }
  .error-state { border-color: #713232; }
  .error-state h2 { color: #FCA5A5; }
}
