:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --page: #f5f3ef;
  --surface: #fff;
  --text: #252525;
  --muted: #77766f;
  --border: #dedbd4;
  --accent: #ffd49e;
  --accent-hover: #efbd7f;
  --input: #f7f6f3;
  --success: #2e8058;
  --error: #b43d3d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #17191a;
    --surface: #202426;
    --text: #f0efec;
    --muted: #aaa9a4;
    --border: #393d3f;
    --accent: #ffd49e;
    --accent-hover: #f2c183;
    --input: #292c2e;
    --success: #72c495;
    --error: #ff8585;
  }
}

* { box-sizing: border-box; }

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

.page-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.account-card {
  width: min(100%, 480px);
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 54px rgb(0 0 0 / 8%);
}

.brand { display: inline-block; margin-bottom: 38px; }
.brand img { display: block; width: min(210px, 60vw); height: auto; }
.eyebrow { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
h1 { margin: 0; font-size: clamp(27px, 6vw, 34px); letter-spacing: -.035em; line-height: 1.15; }
.intro { margin: 12px 0 28px; color: var(--muted); line-height: 1.55; }
form { display: grid; gap: 10px; }
label { font-size: 13px; font-weight: 650; }
input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--input);
  color: var(--text);
  font: inherit;
}
input:focus { border-color: #c99d62; box-shadow: 0 0 0 3px rgb(201 157 98 / 20%); }
button { min-height: 44px; border: 0; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; }
.primary-button { margin-top: 6px; padding: 0 18px; background: var(--accent); color: #171717; }
.primary-button:hover { background: var(--accent-hover); }
button:disabled { cursor: wait; opacity: .65; }
.secondary-button { padding: 0 18px; border: 1px solid var(--border); background: var(--input); color: var(--text); }
.text-button { justify-self: start; padding: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.status { min-height: 22px; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status[data-kind="error"] { color: var(--error); }
.status[data-kind="success"] { color: var(--success); }
.privacy-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.55; }
.dashboard-placeholder { margin: 24px 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--input); }
.dashboard-placeholder h2 { margin: 0 0 6px; font-size: 16px; }
.dashboard-placeholder p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.overview-list { margin-top: 16px; }
.overview-list h3 { margin: 0 0 8px; font-size: 13px; }
.overview-list ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.overview-list li { padding-top: 8px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.45; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.device-row > div { display: grid; min-width: 0; gap: 3px; }
.device-row strong { font-size: 13px; font-weight: 600; }
.device-row small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.device-row button { min-height: 32px; padding: 0 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; }
.overview-error { margin-top: 12px !important; color: var(--error) !important; }
.purchase-controls { display: grid; gap: 10px; margin: 24px 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--input); }
.purchase-controls h2 { margin: 0; font-size: 16px; }
.purchase-controls > p:not(.status) { margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.purchase-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.purchase-actions .primary-button { margin-top: 0; }
.purchase-controls .status { margin: 0; }
footer { display: flex; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 12px; }
footer a { color: inherit; }
.hidden { display: none !important; }

@media (max-width: 480px) {
  .account-card { padding: 28px 22px; }
  .brand { margin-bottom: 30px; }
}
