/* ================================================================
   API keys
   ================================================================ */

.keys-overview {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.keys-overview-main { display: flex; align-items: center; gap: 13px; }
.keys-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--forest), var(--forest-2));
  color: var(--lime);
}
.keys-overview-main strong { font-family: var(--font-mono); font-size: 25px; letter-spacing: -0.04em; line-height: 1; font-weight: 550; }
.keys-overview-main strong span { font-size: 12px; color: var(--muted-light); }
.keys-overview-main p { font-size: 10px; color: var(--muted); margin-top: 3px; }
.keys-overview-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10.5px; }
.keys-overview-note .icon { color: var(--green); }
.keys-create { margin-left: auto; }

.keys-panel { margin-bottom: 17px; }
.key-list { display: flex; flex-direction: column; }
.key-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 17px 22px;
  border-top: 1px solid var(--line);
  transition: background 0.14s ease;
}
.key-row:hover { background: rgba(214, 255, 114, 0.05); }
.key-row.is-revoked { opacity: 0.55; }
.key-main { display: flex; align-items: center; gap: 12px; min-width: 240px; flex: 1.1; }
.key-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: var(--paper); color: var(--muted); flex: none; }
.key-icon.is-active { background: rgba(214, 255, 114, 0.4); color: var(--forest); }
.key-identity { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.key-identity > div { display: flex; align-items: center; gap: 7px; }
.key-identity strong { font-size: 12.5px; font-weight: 650; }
.key-identity code { font-size: 9.5px; color: var(--muted); letter-spacing: 0.02em; }
.key-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 26px; }
.key-stats > div { display: flex; flex-direction: column; gap: 2px; }
.key-stats span { font-size: 8.5px; color: var(--muted-light); white-space: nowrap; }
.key-stats strong { font-family: var(--font-mono); font-size: 10.5px; font-weight: 550; white-space: nowrap; }
.key-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.revoked-label { font-size: 9px; color: var(--muted-light); }
.keys-bottom-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; }

.secret-success { text-align: center; display: flex; flex-direction: column; align-items: center; }
.secret-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(214, 255, 114, 0.6);
  color: var(--forest);
  margin-bottom: 14px;
}
.secret-success h3 { font-size: 17px; letter-spacing: -0.02em; }
.secret-success > p { color: var(--muted); font-size: 12px; margin: 5px 30px 20px; }
.secret-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 11px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: var(--paper);
  text-align: left;
}
.secret-box code { flex: 1; font-size: 11px; color: var(--forest); overflow-x: auto; white-space: nowrap; }
.secret-warning {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  color: #9b4a26;
  background: #fff5e9;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 10.5px;
  text-align: left;
  line-height: 1.6;
}

/* ================================================================
   Usage logs
   ================================================================ */

.usage-stats .stat-value { font-size: clamp(1.4rem, 2.1vw, 1.75rem); }
.logs-panel { overflow: hidden; }
.logs-panel .pagination { border-top: 1px solid var(--line); }
.log-detail { display: flex; flex-direction: column; gap: 16px; }
.log-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.log-detail-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.log-detail-head span { font-size: 9px; color: var(--muted-light); }
.log-detail-head strong { font-size: 16px; letter-spacing: -0.02em; }
.log-detail-head code { font-size: 9.5px; color: var(--muted); }
.log-detail-status { display: flex; align-items: center; gap: 8px; }
.log-detail-status > span:last-child { font-family: var(--font-mono); font-size: 9px; color: var(--muted); }
.log-error {
  display: flex;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff0ec;
  color: #9f3420;
}
.log-error > div { display: flex; flex-direction: column; gap: 2px; }
.log-error strong { font-size: 11px; }
.log-error p { font-size: 10.5px; line-height: 1.6; word-break: break-word; }

/* ================================================================
   Billing
   ================================================================ */

.wallet-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 30px;
  align-items: center;
  min-height: 192px;
  margin-bottom: 18px;
  padding: 28px 32px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 6%, rgba(214, 255, 114, 0.16), transparent 36%),
    radial-gradient(circle at 0% 100%, rgba(255, 107, 74, 0.14), transparent 42%),
    linear-gradient(145deg, #0b2f27, #061c17);
  color: var(--paper);
  overflow: hidden;
}
.wallet-label { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.45); }
.wallet-amount { margin-top: 9px; font-size: clamp(2.7rem, 4.8vw, 3.7rem); line-height: 1; letter-spacing: -0.06em; font-weight: 750; font-variant-numeric: tabular-nums; }
.wallet-amount small { font-size: 0.45em; font-weight: 500; color: var(--lime); margin-right: 4px; vertical-align: 0.25em; }
.wallet-main > p { color: rgba(255, 255, 255, 0.4); font-size: 10px; margin-top: 7px; }
.wallet-actions { display: flex; gap: 8px; margin-top: 19px; }
.wallet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 14px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  z-index: 2;
}
.wallet-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 0 14px; border-right: 1px solid rgba(255, 255, 255, 0.09); }
.wallet-stats > div:last-child { border-right: 0; }
.wallet-stats span { font-size: 8.5px; color: rgba(255, 255, 255, 0.35); }
.wallet-stats strong { font-family: var(--font-mono); font-size: 12px; font-weight: 550; color: var(--lime); }
.wallet-status { display: flex; align-items: center; gap: 4px; font-family: var(--font-sans) !important; font-size: 10px !important; color: #8ee6b5 !important; }
.wallet-status i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.wallet-art { position: absolute; right: 26%; top: 18%; color: rgba(214, 255, 114, 0.06); z-index: 0; }
.wallet-art span { position: absolute; width: 360px; height: 360px; border: 1px solid rgba(214, 255, 114, 0.07); border-radius: 50%; transform: translate(-50%, -50%); }
.wallet-art span:nth-child(2) { width: 260px; height: 260px; }
.wallet-art span:nth-child(3) { width: 160px; height: 160px; }

.billing-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 17px; margin-bottom: 30px; }
.redeem-panel .panel-pad { padding-top: 4px; }
.redeem-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(214, 255, 114, 0.45); color: var(--forest); }
.redeem-form { display: flex; gap: 8px; }
.redeem-form .input-wrap { flex: 1; }
.redeem-hint { display: flex; align-items: center; gap: 5px; margin-top: 11px; font-size: 9.5px; color: var(--muted-light); flex-wrap: wrap; }
.redeem-hint code { color: var(--forest); background: var(--paper); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; font-size: 9px; }

.plans-section { margin-bottom: 30px; }
.section-mini-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-mini-head h2 { font-size: 18px; letter-spacing: -0.025em; }
.section-mini-head p { color: var(--muted); font-size: 11px; margin-top: 2px; }
.section-mini-head > span { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.plan-card.is-recommended { border-color: var(--forest); background: linear-gradient(160deg, #fffdf8, #f4ffd9); box-shadow: 0 18px 40px -30px rgba(13, 59, 51, 0.5); }
.plan-badge {
  position: absolute;
  top: -9px;
  right: 16px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--lime);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.plan-name { font-size: 11px; font-weight: 650; color: var(--muted); }
.plan-price { margin-top: 6px; font-size: 32px; line-height: 1; letter-spacing: -0.05em; font-weight: 750; }
.plan-price small { font-size: 14px; font-weight: 500; margin-right: 2px; color: var(--muted); }
.plan-card > p { margin-top: 5px; font-size: 10px; color: var(--muted); min-height: 30px; }
.plan-list { display: flex; flex-direction: column; gap: 7px; margin: 14px 0 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.plan-list span { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--muted); }
.plan-list .icon { color: var(--green); }
.plan-card .btn { margin-top: auto; }
.plan-modal-amount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px;
  border-radius: 12px;
  background: var(--paper);
  margin-bottom: 12px;
}
.plan-modal-amount span { font-size: 10px; color: var(--muted); margin-right: auto; }
.plan-modal-amount strong { font-family: var(--font-mono); font-size: 24px; letter-spacing: -0.04em; }
.plan-modal-amount em { font-style: normal; font-size: 9px; color: var(--green); background: #e5f6ec; padding: 2px 6px; border-radius: 4px; }
.plan-modal-rows { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.plan-modal-rows > div { display: flex; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid var(--line); font-size: 11px; }
.plan-modal-rows > div:last-child { border-bottom: 0; }
.plan-modal-rows span { color: var(--muted); }
.plan-modal-rows strong { font-weight: 600; }

.transactions-panel { overflow: hidden; }
.tx-type { display: flex; align-items: center; gap: 9px; }
.tx-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; flex: none; }
.tx-positive { background: #e5f6ec; color: var(--green); }
.tx-negative { background: var(--paper); color: var(--muted); }
.tx-neutral { background: #eaf1ff; color: #2b56b7; }
.tx-type > div { display: flex; flex-direction: column; }
.tx-type strong { font-size: 11px; font-weight: 650; }
.tx-type span { font-size: 9px; color: var(--muted); }
.tx-amount { font-weight: 600; }
.tx-amount.is-positive { color: var(--green); }
.tx-amount.is-negative { color: var(--ink); }
.tx-note { display: flex; flex-direction: column; gap: 1px; }
.tx-note strong { font-size: 11px; font-weight: 500; }
.tx-note code { font-size: 8.5px; color: var(--muted-light); }

/* ================================================================
   Support
   ================================================================ */

.support-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  overflow: hidden;
}
.support-summary > div { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; background: var(--surface); }
.support-num { font-size: 25px; line-height: 1.1; letter-spacing: -0.04em; font-weight: 700; }
.support-summary > div > span:last-child { font-size: 9.5px; color: var(--muted); }
.support-mail { flex-direction: row !important; align-items: center; gap: 10px !important; }
.support-mail .icon { color: var(--forest); }
.support-mail > div { display: flex; flex-direction: column; }
.support-mail span { font-size: 8.5px; color: var(--muted-light); }
.support-mail strong { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; }

.support-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.9fr); gap: 17px; margin-bottom: 35px; }
.tickets-panel { overflow: hidden; }
.ticket-list { display: flex; flex-direction: column; }
.ticket-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 0.14s ease;
}
.ticket-row:hover { background: rgba(214, 255, 114, 0.06); }
.ticket-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--paper); color: var(--forest); flex: none; }
.ticket-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ticket-subject { font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-meta { display: flex; align-items: center; gap: 6px; font-size: 8.5px; color: var(--muted-light); }
.ticket-meta i { width: 2px; height: 2px; border-radius: 50%; background: var(--muted-light); }
.ticket-row > .icon { color: var(--muted-light); }
.support-side { display: flex; flex-direction: column; gap: 17px; }
.support-links { display: flex; flex-direction: column; }
.support-links a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line); }
.support-links a:hover { background: var(--surface-2); }
.support-links a > span:first-child { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--paper); color: var(--forest); flex: none; }
.support-links a > div { display: flex; flex-direction: column; flex: 1; }
.support-links strong { font-size: 10.5px; font-weight: 600; }
.support-links small { font-size: 8.5px; color: var(--muted-light); }
.support-links a > .icon { color: var(--muted-light); }
.contact-card { padding: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 13px; background: rgba(214, 255, 114, 0.4); color: var(--forest); margin-bottom: 10px; }
.contact-card h3 { font-size: 14px; }
.contact-card p { margin: 5px 0 14px; font-size: 10px; color: var(--muted); line-height: 1.65; }
.support-faq .faq-list { border-top: 1px solid var(--line-strong); }
.faq-compact summary { padding: 15px 2px; font-size: 12.5px; }

.ticket-detail { display: flex; flex-direction: column; gap: 15px; }
.ticket-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ticket-detail-head > div { display: flex; align-items: center; gap: 8px; }
.ticket-time { font-size: 9px; color: var(--muted-light); }
.ticket-priority { font-size: 9px; color: var(--muted); }
.ticket-thread { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 2px; }
.ticket-message { display: flex; gap: 9px; }
.ticket-avatar { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--paper); color: var(--forest); font-size: 10px; font-weight: 700; flex: none; }
.ticket-message.is-admin .ticket-avatar { background: var(--forest); color: var(--lime); }
.ticket-message > div { flex: 1; min-width: 0; }
.ticket-message-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.ticket-message-meta strong { font-size: 10.5px; }
.ticket-message-meta time { font-size: 8.5px; color: var(--muted-light); }
.official-tag { font-size: 7px; font-weight: 700; color: var(--forest); background: var(--lime); padding: 1px 4px; border-radius: 3px; }
.ticket-message-body { padding: 10px 12px; border-radius: 3px 10px 10px 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; line-height: 1.7; }
.ticket-message.is-admin .ticket-message-body { background: #f5ffdf; border-color: rgba(13, 59, 51, 0.14); }
.ticket-reply { border-top: 1px solid var(--line); padding-top: 14px; }
.ticket-reply textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 11.5px; resize: vertical; background: var(--surface); min-height: 70px; }
.ticket-reply textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(13, 59, 51, 0.08); }
.ticket-reply-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.ticket-reply-actions .filter-select { height: 32px; min-width: 150px; }
.ticket-closed-note { display: flex; align-items: center; gap: 6px; padding: 11px 12px; border-radius: 8px; background: var(--paper); color: var(--muted); font-size: 10.5px; }
.ticket-closed-note .icon { color: var(--green); }

/* ================================================================
   Account
   ================================================================ */

.account-grid { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 18px; align-items: start; }
.account-profile {
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: center;
}
.account-profile-top { display: flex; flex-direction: column; align-items: center; }
.account-profile-top h2 { margin-top: 13px; font-size: 17px; letter-spacing: -0.02em; }
.account-profile-top p { font-size: 10px; color: var(--muted); margin-top: 2px; }
.role-tag { margin-top: 9px; padding: 3px 8px; border-radius: 999px; background: var(--paper); color: var(--forest); font-size: 8.5px; font-weight: 650; }
.account-profile-rows { margin: 20px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; text-align: left; }
.account-profile-rows > div { display: flex; justify-content: space-between; }
.account-profile-rows span { font-size: 9.5px; color: var(--muted-light); }
.account-profile-rows strong { font-family: var(--font-mono); font-size: 9.5px; font-weight: 550; }
.status-inline { display: inline-flex; align-items: center; gap: 4px; color: var(--green) !important; font-family: var(--font-sans) !important; }
.status-inline i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.account-main { display: flex; flex-direction: column; gap: 17px; }
.account-panel { overflow: hidden; }
.settings-form { display: flex; flex-direction: column; gap: 16px; }
.session-list { display: flex; flex-direction: column; }
.session-row { display: flex; align-items: center; gap: 11px; padding: 13px 22px; border-top: 1px solid var(--line); }
.session-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--paper); color: var(--forest); flex: none; }
.session-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.session-main > div { display: flex; align-items: center; gap: 7px; }
.session-main strong { font-size: 10.5px; font-weight: 600; }
.session-main span { font-size: 8.5px; color: var(--muted-light); }
.session-current { font-size: 8.5px; color: var(--green); padding: 2px 6px; border-radius: 4px; background: #e5f6ec; }

/* ================================================================
   Generic error pages
   ================================================================ */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 20px 110px;
  min-height: 55vh;
}
.error-code {
  font-family: var(--font-mono);
  font-size: 82px;
  line-height: 1;
  letter-spacing: -0.08em;
  color: rgba(13, 59, 51, 0.12);
  font-weight: 700;
}
.error-page h1 { margin-top: 4px; font-size: 27px; letter-spacing: -0.04em; }
.error-page p { margin-top: 7px; color: var(--muted); font-size: 12.5px; max-width: 440px; }
.error-actions { display: flex; gap: 9px; margin-top: 22px; }
.standalone-error { min-height: 100vh; background: var(--paper); }
.standalone-error .site-header { position: relative; }
.standalone-error .error-page { min-height: calc(100vh - 74px - 280px); }
