/* edgeplat.ai/account — dark theme matching index.html (Geist + Newsreader italic, #0E0E0F, #17130F, #F3E9DC, #E8A268). */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/newsreader-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0E0E0F;
  --surface: #17130F;
  --surface-hover: #1E1915;
  --field: #13100D;
  --line: rgba(243, 233, 220, .10);
  --line-strong: rgba(243, 233, 220, .18);
  --line-hover: rgba(232, 162, 104, .45);
  --text: #F3E9DC;
  --muted: rgba(243, 233, 220, .62);
  --accent: #E8A268;
  --accent-hover: #F0B482;
  --on-accent: #18100A;
  --accent-tint: rgba(232, 162, 104, .14);
  --good: #7BD4A0;
  --good-bg: rgba(123, 212, 160, .11);
  --bad: #F28B82;
  --bad-bg: rgba(242, 139, 130, .11);
  --gutter: 64px;
  --r-card: 22px;
  --r-field: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15.5px/1.55 Geist, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 18% 0%, rgba(232, 162, 104, .16), transparent 70%),
    radial-gradient(50vw 40vh at 100% 30%, rgba(130, 88, 60, .12), transparent 70%);
  z-index: -1;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

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

.num {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.eph-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.eph-wrap.scrolled {
  background: rgba(14, 14, 15, .92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.eph {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px var(--gutter) 18px;
}

.brand {
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
  flex: none;
}

.eph-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.eph-nav a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background-color 180ms var(--ease);
}

.eph-nav a:hover,
.eph-nav a[aria-current="page"] {
  border-color: var(--line-hover);
  color: var(--accent);
  background: var(--surface-hover);
}

.eph-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.eph-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.eph-email {
  font-size: 14px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eph-credits {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 162, 104, .28);
  background: var(--accent-tint);
  color: var(--accent);
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.eph-credits:hover {
  border-color: var(--line-hover);
  background: rgba(232, 162, 104, .2);
}

/* Controls */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background-color 180ms var(--ease);
}

.pill:hover:not(:disabled) {
  border-color: var(--line-hover);
  color: var(--accent);
  background: var(--surface-hover);
}

.pill.on,
.pill[aria-pressed="true"] {
  background: var(--accent-tint);
  border-color: var(--line-hover);
  color: var(--accent);
}

.pill:disabled {
  opacity: .42;
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn:disabled {
  opacity: .42;
  cursor: default;
}

.btn.sm {
  padding: 8px 16px;
  font-size: 14px;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 4px 2px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color 180ms var(--ease);
}

.link:hover {
  color: var(--text);
}

.link.quiet {
  color: var(--muted);
}

.link.quiet:hover {
  color: var(--accent);
}

.field {
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-field);
  background: var(--field);
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.field::placeholder {
  color: var(--muted);
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.field:disabled {
  opacity: .45;
  cursor: default;
}

/* Main shell & surfaces */
.shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px var(--gutter) 72px;
  flex: 1 0 auto;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

em {
  font-family: Newsreader, Georgia, serif;
  font-style: italic;
  font-weight: 500;
}

/* Gate */
.account-gate {
  max-width: 520px;
  padding: 36px 32px;
  margin: 36px auto;
}

.account-gate h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.025em;
}

.account-gate p {
  margin: 12px 0 24px;
  color: var(--muted);
}

/* Notices */
.notice {
  padding: 12px 16px;
  border-radius: var(--r-field);
  border: 1px solid var(--line-hover);
  background: var(--accent-tint);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 18px;
}

.notice.error {
  border-color: rgba(242, 139, 130, .32);
  background: var(--bad-bg);
  color: var(--bad);
}

.notice.ok {
  border-color: rgba(123, 212, 160, .28);
  background: var(--good-bg);
  color: var(--good);
}

/* Summary card */
.summary-card {
  padding: 28px 30px 24px;
}

.summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.summary-id h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.plan-status {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.summary-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.summary-balance {
  text-align: right;
  flex: none;
}

.balance-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.balance-value {
  margin-top: 4px;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.bucket-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.bucket-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bucket-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.bucket-val {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Account sections */
.acct-sec {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.acct-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.acct-sec-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.acct-sec h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}

.acct-sec h2 em {
  font-size: 1.08em;
}

.billing-off-note {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}

/* Monthly plans grid */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.plan-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.plan-card.current {
  border-color: var(--line-hover);
  background: var(--surface-hover);
}

.plan-name {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
}

.plan-price {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.025em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.plan-credits {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.plan-action {
  margin-top: auto;
  padding-top: 18px;
}

.plan-action .pill,
.plan-action .btn {
  width: 100%;
  white-space: normal;
  text-align: center;
}

.plan-note-label {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding: 8px 0;
}

.plan-note-label.muted {
  color: var(--muted);
  font-weight: 500;
}

/* Credit top-up row */
.buy-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.buy-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.buy-input {
  width: 152px;
  font-variant-numeric: tabular-nums;
}

.inline-note {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.inline-note.error {
  color: var(--bad);
}

/* Segmented filter */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Credit activity table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tbl th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.tbl th.right,
.tbl td.right {
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
}

.tbl tbody tr:hover td {
  background: rgba(232, 162, 104, .05);
}

.amt-pos {
  font-weight: 600;
  color: var(--good);
}

.amt-neg {
  font-weight: 600;
  color: var(--text);
}

.ledger-more-wrap {
  margin-top: 16px;
}

/* Info tooltips (hover, focus, and tap) */
.info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}

.info-btn:hover,
.info-btn:focus-visible,
.info-wrap.open .info-btn {
  border-color: var(--line-hover);
  color: var(--accent);
}

.info-tip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 260px;
  max-width: calc(100vw - 32px);
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-field);
  background: var(--surface-hover);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 18px 36px -12px rgba(0, 0, 0, .65);
}

.info-wrap.tip-right .info-tip {
  left: auto;
  right: 0;
  transform: none;
}

.info-wrap.tip-left .info-tip {
  left: 0;
  right: auto;
  transform: none;
}

.info-wrap:hover .info-tip,
.info-wrap:focus-within .info-tip,
.info-wrap.open .info-tip {
  display: block;
}

/* Confirmation dialog */
dialog.ep-dlg {
  width: min(440px, calc(100vw - 32px));
  padding: 26px 26px 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 28px 60px -18px rgba(0, 0, 0, .72);
}

dialog.ep-dlg::backdrop {
  background: rgba(0, 0, 0, .62);
}

.ep-dlg h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.ep-dlg p {
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--muted);
}

.ep-dlg-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Footer */
.epf {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px var(--gutter) 34px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.epf-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Responsive */
@media (max-width: 960px) {
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eph-email {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 16px;
  }

  .eph {
    flex-wrap: wrap;
    padding: 16px var(--gutter) 14px;
    gap: 10px;
  }

  .brand {
    margin-right: auto;
  }

  .eph-auth {
    order: 2;
    gap: 6px;
  }

  .eph-nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    gap: 6px;
  }

  .eph-nav a,
  .eph-credits,
  .pill {
    padding: 7px 12px;
    font-size: 13.5px;
  }

  .shell {
    padding: 16px var(--gutter) 52px;
  }

  .summary-card {
    padding: 22px 20px 20px;
  }

  .summary-top {
    flex-direction: column;
    gap: 18px;
  }

  .summary-balance {
    text-align: left;
  }

  .bucket-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .field,
  .buy-input {
    font-size: 16px;
  }

  .buy-input {
    width: 100%;
    max-width: 180px;
  }

  .info-wrap .info-tip,
  .info-wrap.tip-right .info-tip {
    left: 0;
    right: auto;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eph-wrap,
  .eph-nav a,
  .eph-credits,
  .pill,
  .btn,
  .link,
  .field,
  .plan-card,
  .info-btn {
    transition: none;
  }
}
