/* LAYOUT: one column on phones; on desktop, plan + usage side by side, setups full width,
     then assistant history + perks side by side, then account settings.
     Same dark-gothic single-theme world as the other five pages. */
  :root {
    --bg: #0c0813;
    --line: #2f2246;
    --panel: rgba(23,16,36,0.88);
    --slot: #120a1e;
    --purple: #7a3fc4;
    --purple-soft: #b795ee;
    --text-main: #f3ecf4;
    --text-dim: #9a8ca8;
    --crimson: #cc1a30;
    --crimson-dim: #7a1020;
    --gold: #f2b94b;
    --gold-dim: #b8892f;
    color-scheme: dark;
  }
  * { box-sizing: border-box; }

  body {
    margin: 0;
    color: var(--text-main);
    font-family: 'Space Mono', ui-monospace, Menlo, Consolas, monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
      radial-gradient(ellipse 90% 55% at 50% 28%, rgba(122,63,196,0.34), transparent 70%),
      radial-gradient(ellipse 100% 40% at 50% 100%, rgba(70,24,110,0.40), transparent 70%),
      var(--bg);
  }

  /* ---------- STARS (same three layers as every other page) ---------- */
  body::before {
    content: "";
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
      radial-gradient(1px 1px at 12px 18px,  rgba(255,245,250,0.55), transparent 60%),
      radial-gradient(1px 1px at 61px 88px,  rgba(255,245,250,0.45), transparent 60%),
      radial-gradient(1px 1px at 104px 41px, rgba(255,245,250,0.50), transparent 60%),
      radial-gradient(1px 1px at 143px 121px,rgba(255,245,250,0.40), transparent 60%),
      radial-gradient(1px 1px at 37px 119px, rgba(255,245,250,0.50), transparent 60%);
    background-size: 151px 149px, 173px 167px, 197px 181px, 211px 199px, 131px 137px;
  }
  body::after {
    content: "";
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
      radial-gradient(1.5px 1.5px at 45px 30px,   rgba(255,250,255,0.95), transparent 60%),
      radial-gradient(1.5px 1.5px at 130px 95px,  rgba(255,250,255,0.85), transparent 60%),
      radial-gradient(1.5px 1.5px at 210px 160px, rgba(255,250,255,0.90), transparent 60%);
    background-size: 257px 233px, 293px 271px, 331px 307px;
    animation: twinkle 5s ease-in-out infinite alternate;
  }
  .stars-gold {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
      radial-gradient(2px 2px at 80px 60px,   rgba(242,185,75,0.95), transparent 60%),
      radial-gradient(2px 2px at 190px 140px, rgba(242,185,75,0.80), transparent 60%);
    background-size: 389px 353px, 431px 397px;
    animation: twinkle 7s ease-in-out infinite alternate;
    animation-delay: -3s;
  }
  @keyframes twinkle { from { opacity: 0.45; } to { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) {
    body::after, .stars-gold { animation: none; }
  }

  header, main, footer { position: relative; z-index: 1; }
  .pixel { font-family: 'Press Start 2P', ui-monospace, Menlo, monospace; }

  a:focus-visible, button:focus-visible, summary:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
  }

  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
  }
  .logo { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: 1px; }
  .login-link {
    font-size: 12px;
    color: var(--purple-soft);
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: 3px;
    text-decoration: none;
    background: rgba(122,63,196,0.12);
  }

  main {
    flex: 1;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 20px 56px;
  }
  .back { display: inline-block; font-size: 12px; color: var(--text-dim); text-decoration: none; margin-bottom: 22px; }

  .heading { text-align: center; margin-bottom: 22px; }
  h1.pixel {
    font-size: 16px;
    line-height: 1.9;
    margin: 0 0 14px;
    text-shadow: 0 0 14px rgba(204,26,48,0.55);
    text-wrap: balance;
  }
  .sub { font-size: 13px; color: var(--text-dim); margin: 0; line-height: 1.6; }

  .example-note {
    margin: 0 0 24px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--gold);
    border: 1px dashed var(--gold-dim);
    border-radius: 4px;
    background: rgba(242,185,75,0.06);
    text-align: center;
  }

  /* ---------- LAYOUT ---------- */
  .grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
  .grid > * { min-width: 0; }
  .full { grid-column: 1 / -1; }

  .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 20px 18px;
  }
  .panel-title {
    font-family: 'Press Start 2P', ui-monospace, Menlo, monospace;
    font-size: 11px;
    line-height: 1.7;
    margin: 0 0 16px;
    letter-spacing: 0.5px;
  }
  .panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin-bottom: 4px;
  }
  .panel-head .panel-title { margin: 0; }
  .panel-note { font-size: 12px; color: var(--text-dim); margin: 0 0 8px; line-height: 1.6; }

  /* ---------- BUTTONS & CHIPS ---------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    font-family: 'Space Mono', ui-monospace, Menlo, monospace;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
  }
  .btn-primary {
    background: var(--crimson);
    color: #fff5f6;
    box-shadow: 0 0 0 1px var(--crimson-dim), 0 0 14px rgba(204,26,48,0.45);
  }
  .btn-secondary { background: rgba(12,8,19,0.5); color: var(--gold); border-color: var(--gold-dim); }
  .btn-ghost { background: transparent; color: var(--purple-soft); border-color: var(--line); }

  .chip {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--purple-soft);
    border: 1px solid var(--line);
    background: rgba(122,63,196,0.12);
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
  }
  .status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); white-space: nowrap; }
  .dot { width: 8px; height: 8px; background: var(--text-dim); flex: none; }
  .dot.gold { background: var(--gold); }
  .dot.purple { background: var(--purple-soft); }

  /* ---------- SEGMENTED METER (usage + setup progress share this) ---------- */
  .meter {
    --n: 10;
    --done: 5;
    position: relative;
    height: 16px;
    background: var(--slot);
    border: 2px solid var(--gold-dim);
    border-radius: 3px;
    overflow: hidden;
  }
  .meter > .fill {
    position: absolute; inset: 0 auto 0 0;
    width: calc(100% * var(--done) / var(--n));
    background: var(--gold);
    box-shadow: 0 0 10px rgba(242,185,75,0.45);
  }
  .meter::after {
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(90deg,
      transparent 0, transparent calc(100% / var(--n) - 2px),
      var(--slot) calc(100% / var(--n) - 2px), var(--slot) calc(100% / var(--n)));
  }
  .meter.small { height: 10px; border-width: 1px; border-color: var(--line); }
  .meter.small > .fill { background: var(--purple-soft); box-shadow: none; }

  /* ---------- PLAN + USAGE ---------- */
  .plan-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
  .slot {
    flex: none;
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    background: var(--slot);
    border: 2px solid var(--gold-dim);
    border-radius: 4px;
    box-shadow: inset 0 0 0 2px var(--bg);
  }
  .slot svg { width: 38px; height: 32px; }
  .plan-name { font-family: 'Press Start 2P', ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.7; margin: 0 0 6px; color: var(--gold); }
  .plan-price { font-size: 13px; margin: 0; color: var(--text-main); }
  .facts { margin: 0 0 20px; display: grid; gap: 10px; }
  .facts div { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 10px; }
  .facts dt { color: var(--text-dim); }
  .facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
  .btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

  .usage-num {
    font-family: 'Press Start 2P', ui-monospace, Menlo, monospace;
    font-size: 22px;
    line-height: 1.4;
    margin: 0 0 4px;
    font-variant-numeric: tabular-nums;
  }
  .usage-num span { font-size: 12px; color: var(--text-dim); }
  .usage-label { font-size: 12px; color: var(--text-dim); margin: 0 0 16px; }
  .usage-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin: 6px 0 16px; font-variant-numeric: tabular-nums; }
  .usage-hint { font-size: 12px; line-height: 1.7; color: var(--text-dim); margin: 0; }

  /* ---------- LISTS (setups, chats, perks, account) ---------- */
  .rows { list-style: none; margin: 0; padding: 0; }
  .rows > li { border-top: 1px solid var(--line); padding: 16px 0; }
  .rows > li:first-child { border-top: 0; padding-top: 12px; }
  .rows > li:last-child { padding-bottom: 0; }
  .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
  .row-main { flex: 1 1 260px; min-width: 0; }
  .row-title { font-size: 14px; font-weight: 700; line-height: 1.5; margin: 8px 0 0; overflow-wrap: anywhere; }
  .row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
  .row-desc { font-size: 12px; line-height: 1.6; color: var(--text-dim); margin: 4px 0 0; }
  .progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; max-width: 360px; }
  .progress .meter { flex: 1; }
  .progress-text { font-size: 12px; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .row-side { flex: none; }
  .row-date { font-size: 12px; color: var(--text-dim); }

  .panel-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
  .panel-foot p { margin: 0; font-size: 12px; color: var(--text-dim); line-height: 1.6; }
  .text-link { font-size: 12px; color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold-dim); }

  /* account rows */
  .acct-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin: 0 0 4px; }
  .acct-value { font-size: 13px; margin: 0; overflow-wrap: anywhere; }

  /* cancel: two-step confirm built into the page, no scripting */
  .cancel { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
  .cancel summary {
    display: inline-block;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-dim);
    border-bottom: 1px dotted var(--line);
    list-style: none;
  }
  .cancel summary::-webkit-details-marker { display: none; }
  .cancel[open] summary { color: var(--text-main); }
  .cancel-body { margin-top: 14px; padding: 14px; border: 1px solid var(--crimson-dim); border-radius: 4px; background: rgba(204,26,48,0.08); }
  .cancel-body p { margin: 0 0 12px; font-size: 12px; line-height: 1.7; color: var(--text-main); }
  .btn-danger { background: transparent; color: #ff8d9b; border-color: var(--crimson); }

  /* preview switch: mockup only, lets you flip between the two account views */
  [hidden] { display: none !important; }
  .preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    margin: 0 0 24px;
  }
  .preview-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
  .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
  .seg button {
    min-height: 40px;
    padding: 8px 16px;
    font-family: 'Space Mono', ui-monospace, Menlo, monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    background: transparent;
    border: 0;
    cursor: pointer;
  }
  .seg button + button { border-left: 1px solid var(--line); }
  .seg button[aria-pressed="true"] { color: var(--gold); background: rgba(242,185,75,0.10); box-shadow: inset 0 -3px 0 var(--crimson); }

  /* free-view upgrade card: quiet on purpose */
  .adds { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
  .adds li { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.6; }
  .adds li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; background: var(--purple-soft); }
  .upgrade-lead { font-size: 13px; line-height: 1.7; color: var(--text-dim); margin: 0 0 16px; }
  .upgrade-foot { font-size: 12px; line-height: 1.7; color: var(--text-dim); margin: 14px 0 0; }

  footer {
    border-top: 1px solid var(--line);
    padding: 22px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
    font-size: 12px;
  }
  footer a { color: var(--text-dim); text-decoration: none; border-bottom: 1px dotted var(--line); }

  .assist-btn {
    position: fixed;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    right: 18px;
    z-index: 2;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: #1a0f2a;
    border: 2px solid var(--gold-dim);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 1px var(--crimson-dim), 0 0 20px rgba(204,26,48,0.45);
    cursor: pointer;
    padding: 0;
  }
  .assist-btn svg { width: 30px; height: 30px; }

  @media (min-width: 760px) {
    main { padding-top: 40px; }
    h1.pixel { font-size: 20px; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .panel { padding: 24px 22px; }
  }
  @media (max-width: 420px) {
    .row-side .btn { width: 100%; }
    .row-side { flex: 1 1 100%; }
  }

.soon { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.soon li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--text-main); padding: 10px 12px; background: var(--slot); border: 1px solid var(--line); border-radius: 4px; }
.soon .tag { font-size: 10px; font-weight: 400; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 3px; padding: 2px 6px; text-transform: uppercase; letter-spacing: .06em; }
.bds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.bd { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--slot); border: 1px solid var(--line); border-radius: 6px; opacity: .45; filter: grayscale(.8); }
.bd.on { opacity: 1; filter: none; border-color: var(--gold-dim); }
.bd[hidden] { display: none; }
.bd-ic { flex: none; width: 36px; height: 36px; padding: 5px; box-sizing: border-box; border: 1px solid var(--gold-dim); border-radius: 4px; background: #0e0916; }
.bd-ic svg { width: 100%; height: 100%; display: block; }
.bd-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd-t b { font-size: 12.5px; color: var(--text-main); }
.bd-t small { font-size: 11px; color: var(--text-dim); line-height: 1.4; }
.name-line { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.name-line .del-input { flex: 1; min-width: 160px; margin: 0; }
.name-line .btn { width: auto; }
.del-label { display: block; margin: 14px 0 6px; font-size: 12px; color: var(--text-dim); }
.del-input { width: 100%; box-sizing: border-box; background: var(--slot); border: 1px solid var(--line); color: var(--text-main); font: inherit; font-size: 13px; padding: 11px 12px; border-radius: 3px; margin-bottom: 4px; }
#del-form .btn { margin-top: 14px; }
