/* ==========================================================================
   Calopic account — ChatGPT-like settings shell.
   One surface, restrained, no card-in-card stacking.
   ========================================================================== */

:root {
  --a-bg: #0c0d10;
  --a-rail: #111215;
  --a-panel: #16181c;
  --a-hover: #1d2025;
  --a-line: #26292f;
  --a-text: #f2f3f5;
  --a-dim: #a2a6ae;
  --a-mute: #6f747d;
  --a-accent: #e8702a;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

.a-body {
  background: var(--a-bg);
  color: var(--a-text);
  font: 14.5px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04";
}

/* ------------------------------------------------------------------ gate */
.a-gate {
  height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: var(--a-bg);
}
.a-gate[hidden] { display: none; }
.a-gate-card {
  width: min(420px, 100%);
  padding: 36px 32px 30px;
  border: 1px solid var(--a-line);
  border-radius: 20px;
  background: var(--a-panel);
}
.a-gate-brand {
  display: flex; align-items: center; gap: 9px; margin-bottom: 26px;
  color: var(--a-text); font-size: 16px; font-weight: 600; text-decoration: none;
}
.a-gate-card h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.02em; }
.a-gate-sub { margin: 0 0 24px; color: var(--a-dim); font-size: 13.5px; }
.a-field { display: block; margin-bottom: 12px; }
.a-field > span { display: block; font-size: 12.5px; color: var(--a-dim); margin-bottom: 5px; }
.a-field input, .a-input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--a-line); border-radius: 10px;
  background: var(--a-bg); color: var(--a-text);
  font-family: inherit; font-size: 14px;
  transition: border-color 120ms;
}
.a-field input:focus, .a-input:focus { outline: none; border-color: #3b3f47; }
.a-field input:disabled { color: var(--a-mute); }
.a-link {
  display: block; width: 100%; margin-top: 14px; padding: 6px; border: 0;
  background: none; color: var(--a-dim); font-family: inherit; font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.a-link:hover { color: var(--a-text); }

/* --------------------------------------------------------------- buttons */
.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 15px; border-radius: 9px;
  border: 1px solid var(--a-line); background: var(--a-panel);
  color: var(--a-text); font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 120ms, border-color 120ms;
}
.a-btn:hover { background: var(--a-hover); border-color: #34383f; }
.a-btn-solid { background: #f2f3f5; border-color: #f2f3f5; color: #0c0d10; font-weight: 600; }
.a-btn-solid:hover { background: #fff; border-color: #fff; }
.a-btn-accent { background: var(--a-accent); border-color: var(--a-accent); color: #fff; font-weight: 600; }
.a-btn-accent:hover { background: #f0812f; border-color: #f0812f; }
.a-btn-quiet { background: transparent; border-color: transparent; color: var(--a-dim); }
.a-btn-quiet:hover { background: var(--a-hover); color: var(--a-text); }
.a-btn-danger { color: #e5786f; border-color: #3a2422; background: transparent; }
.a-btn-danger:hover { background: #2a1a18; border-color: #4a2c28; }
.a-btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.a-btn-block { width: 100%; height: 42px; font-size: 14.5px; margin-top: 6px; }

/* ------------------------------------------------------------------ shell */
.a-shell {
  display: grid; grid-template-columns: 264px minmax(0, 1fr);
  height: 100dvh; background: var(--a-bg);
}
.a-shell[hidden] { display: none; }

/* rail */
.a-rail {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px;
  background: var(--a-rail);
  border-inline-end: 1px solid var(--a-line);
  overflow-y: auto;
}
.a-rail-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 2px 8px 16px; color: var(--a-text);
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.a-rail-label {
  padding: 14px 10px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--a-mute);
}
.a-nav {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--a-dim);
  font-family: inherit; font-size: 13.5px; font-weight: 450;
  text-align: start; text-decoration: none; cursor: pointer; width: 100%;
  transition: background 110ms, color 110ms;
}
.a-nav:hover { background: var(--a-hover); color: var(--a-text); }
.a-nav.is-on { background: var(--a-hover); color: var(--a-text); font-weight: 550; }
.a-nav svg { flex: none; opacity: 0.85; }
.a-rail-spacer { flex: 1; }
.a-rail-user {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 8px 10px; border-radius: 9px;
  background: transparent; cursor: pointer; border: 0; width: 100%;
  font-family: inherit; text-align: start;
}
.a-rail-user:hover { background: var(--a-hover); }
.a-avatar {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: 50%; background: #2a2d33; color: var(--a-text);
  font-size: 12px; font-weight: 600;
}
.a-rail-email {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12.5px; color: var(--a-dim);
}

/* content */
.a-content { overflow-y: auto; }
.a-content::-webkit-scrollbar { width: 10px; }
.a-content::-webkit-scrollbar-thumb { background: #26292f; border-radius: 5px; }

.a-page { max-width: 760px; margin: 0 auto; padding: 56px 44px 96px; }
.a-page[hidden] { display: none; }
.a-title { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 8px; }
.a-sub { margin: 0 0 36px; color: var(--a-dim); font-size: 14px; }

/* section: hairline separators, no nested cards */
.a-section { padding: 26px 0; border-top: 1px solid var(--a-line); }
.a-section:first-of-type { border-top: 0; padding-top: 0; }
.a-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.a-section-head h2 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.a-section-head p { margin: 4px 0 0; color: var(--a-mute); font-size: 12.5px; }

/* rows */
.a-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--a-line);
}
.a-row:last-child { border-bottom: 0; }
.a-row-main { min-width: 0; }
.a-row-label { font-size: 14px; font-weight: 500; }
.a-row-hint { margin-top: 3px; font-size: 12.5px; color: var(--a-mute); }

/* stat strip */
.a-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--a-line);
  border: 1px solid var(--a-line); border-radius: 12px; overflow: hidden;
}
.a-stat { padding: 20px 22px; background: var(--a-panel); }
.a-stat dt { margin: 0; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--a-mute); }
.a-stat dd {
  margin: 8px 0 0; font-size: 26px; font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.1;
}
.a-stat-note { display: block; margin-top: 4px; font-size: 12px; color: var(--a-mute); font-weight: 400; letter-spacing: 0; }

/* balance hero */
.a-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 24px 26px; border-radius: 14px;
  border: 1px solid var(--a-line);
  background: linear-gradient(135deg, rgba(232, 112, 42, 0.06), transparent 60%), var(--a-panel);
  margin-bottom: 30px;
}
.a-hero-amount { font-size: 34px; font-weight: 650; letter-spacing: -0.035em; line-height: 1; }
.a-hero-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--a-mute); margin-bottom: 8px; }

/* pack list */
.a-packs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.a-pack {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 14px; border: 1px solid var(--a-line); border-radius: 11px;
  background: transparent;
}
.a-pack:hover { border-color: #3a3e46; background: rgba(255,255,255,0.015); }
.a-pack-name { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--a-mute); }
.a-pack-price { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.a-pack-credits { font-size: 12.5px; color: var(--a-dim); margin-bottom: 10px; }
.a-pack .a-btn { width: 100%; }

/* table */
.a-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.a-table th {
  text-align: start; padding: 0 12px 10px 0;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--a-mute);
  border-bottom: 1px solid var(--a-line);
}
.a-table td {
  padding: 13px 12px 13px 0; border-bottom: 1px solid var(--a-line);
  color: var(--a-dim);
}
.a-table tbody tr:last-child td { border-bottom: 0; }
.a-empty { padding: 28px 0 !important; text-align: center; color: var(--a-mute); }

.a-tag {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500;
}
.a-tag-ok { background: rgba(88, 178, 132, 0.14); color: #7ac9a1; }
.a-tag-wait { background: rgba(232, 112, 42, 0.14); color: var(--a-accent); }
.a-tag-bad { background: rgba(229, 120, 111, 0.13); color: #e5786f; }

/* chart */
.a-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.a-bar {
  flex: 1; min-width: 2px; min-height: 2px; border-radius: 2px 2px 0 0;
  background: #3a3e46; transition: background 120ms;
}
.a-bar:hover { background: var(--a-accent); }

/* form bits */
.a-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.a-key-box {
  margin: 0 0 16px; padding: 14px 16px;
  border: 1px solid #3a3e46; border-radius: 10px; background: var(--a-bg);
}
.a-key-box p { margin: 0 0 8px; font-size: 12.5px; color: var(--a-dim); }
.a-key-box code {
  display: block; padding: 10px 12px; border-radius: 7px; background: #08090b;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  word-break: break-all;
}
.a-msg { margin: 10px 0 0; font-size: 12.5px; }
.a-msg[hidden] { display: none; }
.a-msg-ok { color: #7ac9a1; }
.a-msg-bad { color: #e5786f; }

/* ----------------------------------------------------------------- phone */
@media (max-width: 860px) {
  .a-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .a-rail {
    flex-direction: row; align-items: center; gap: 4px;
    padding: 9px 10px; border-inline-end: 0; border-bottom: 1px solid var(--a-line);
    overflow-x: auto;
  }
  .a-rail-brand { padding: 0 6px 0 2px; }
  .a-rail-brand span { display: none; }
  .a-rail-label { display: none; }
  .a-rail-spacer { display: none; }
  .a-nav { width: auto; height: 32px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
  .a-nav span { display: none; }
  .a-nav.is-on span { display: inline; }
  .a-rail-user { margin-top: 0; padding: 4px; width: auto; }
  .a-rail-email { display: none; }
  .a-page { padding: 26px 18px 64px; }
  .a-title { font-size: 23px; }
  .a-stats { grid-template-columns: 1fr; }
  .a-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-grid-2 { grid-template-columns: 1fr; }
  .a-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
}
