:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #5f6778;
  --line: #d9dfeb;
  --paper: #f7f4ef;
  --panel: #ffffff;
  --accent: #fca311;
  --accent-2: #2a9d8f;
  --danger: #c44536;
  --shadow: 0 18px 50px rgba(20, 33, 61, 0.12);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(247, 244, 239, 0.92);
  border-bottom: 1px solid rgba(20, 33, 61, 0.1);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand img {
  width: 34px;
  height: 34px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -10px;
  right: -13px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e63946;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.ghost-button,
.secondary-button,
.primary-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.ghost-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

main {
  padding: 28px clamp(16px, 4vw, 48px) 48px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  min-height: calc(100vh - 120px);
  align-items: start;
}

.tool-console,
.result-panel,
.pricing-grid article,
.api-band {
  background: var(--panel);
  border: 1px solid rgba(20, 33, 61, 0.1);
  box-shadow: var(--shadow);
}

.tool-console {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(18px, 3vw, 34px);
  border-radius: 8px;
}

.console-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 560px;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.08;
}

h2 {
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.05;
}

.usage-pill {
  min-width: 132px;
  padding: 12px;
  border-radius: 8px;
  background: #eef6f4;
  color: var(--ink);
}

.usage-pill span,
.usage-pill strong {
  display: block;
}

.usage-pill span {
  color: var(--muted);
  font-size: 13px;
}

.processor {
  display: grid;
  gap: 16px;
}

.upload-field {
  position: relative;
}

.dropzone {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 170px;
  padding: 20px;
  border: 2px dashed #b8c0cf;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  font: inherit;
}

.file-input-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select {
  min-height: 46px;
  padding: 0 12px;
}

input {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  background: var(--ink);
  color: #fff;
}

.secondary-button {
  background: #eef2f7;
  color: var(--ink);
}

.result-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: calc(100vh - 112px);
  border-radius: 8px;
  overflow: hidden;
  position: sticky;
  top: 84px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.result-actions {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.danger-button {
  color: #8f1d1d;
  background: #fff1f1;
}

.danger-button:hover {
  background: #ffe2e2;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--ink);
}

pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  color: #28344e;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.55;
}

.result-dialog {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr);
  border-radius: 8px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

#resultModalBox {
  max-height: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0 14px;
}

.metrics div {
  padding: 18px;
  border-radius: 8px;
  background: #e9edf5;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  font-size: 24px;
}

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

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 58px;
}

.quick-links a {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.quick-links strong,
.quick-links span {
  display: block;
}

.quick-links strong {
  font-size: 15px;
}

.quick-links span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.section {
  margin-top: 72px;
}

.metrics + #tools {
  margin-top: 34px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.category-tabs button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tool-search {
  margin: 6px 0 14px;
}

.tool-search input {
  width: min(420px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tool-grid-grouped {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.tool-group {
  display: grid;
  gap: 10px;
}

.tool-group-title {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.tool-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tool-card {
  display: grid;
  gap: 7px;
  align-content: start;
  text-align: left;
  min-height: 76px;
  padding: 14px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
  color: #24324d;
  font-weight: 700;
}

.tool-card strong,
.tool-card span {
  display: block;
}

.tool-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.empty-tools {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.history-section[hidden] {
  display: none;
}

.history-list {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.history-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.history-actions input {
  width: min(260px, 42vw);
}

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

.full-history-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.full-history-list {
  max-height: none;
  padding: 16px;
  overflow: auto;
}

.history-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item strong {
  margin-bottom: 6px;
}

.history-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.history-time {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.history-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.empty-history {
  padding: 18px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 22px;
  align-items: start;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pricing-grid article {
  padding: 18px;
  border-radius: 8px;
}

.pricing-grid article span,
.pricing-grid article strong {
  display: block;
}

.pricing-grid article span {
  color: var(--muted);
  font-weight: 800;
}

.pricing-grid article strong {
  margin: 12px 0;
  font-size: 30px;
}

.pricing-grid article p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pricing-grid .featured {
  background: var(--ink);
  color: #fff;
}

.pricing-grid .featured p,
.pricing-grid .featured span {
  color: #dbe3f2;
}

.pricing-section {
  scroll-margin-top: 88px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.plan-grid article {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 14px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.plan-grid span,
.plan-grid strong,
.plan-grid small {
  display: block;
}

.plan-grid span {
  color: var(--muted);
  font-weight: 900;
}

.plan-grid strong {
  font-size: 26px;
  line-height: 1.1;
}

.plan-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.plan-grid small {
  align-self: end;
  color: var(--accent-2);
  font-weight: 900;
}

.plan-grid .featured {
  background: #10182c;
  color: #fff;
}

.plan-grid .featured p,
.plan-grid .featured span {
  color: #dbe3f2;
}

.plan-grid .featured small {
  color: #ffd28a;
}

.chat-section {
  margin-top: 56px;
  margin-bottom: 40px;
}

.chat-model {
  display: grid;
  gap: 6px;
  min-width: min(260px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chat-panel {
  display: grid;
  gap: 14px;
}

.chat-messages {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.chat-message {
  width: fit-content;
  max-width: min(760px, 92%);
  padding: 12px 14px;
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.chat-message.user {
  justify-self: end;
  background: #14213d;
  color: #fff;
}

.chat-message.bot {
  justify-self: start;
  background: #fff;
  border: 1px solid rgba(20, 33, 61, 0.1);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.chat-form textarea {
  min-height: 92px;
}

.chat-status {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.api-band {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  padding: 24px;
  border-radius: 8px;
}

.api-band code {
  padding: 14px 16px;
  border-radius: 8px;
  background: #10182c;
  color: #fff;
  white-space: nowrap;
}

.api-docs {
  display: grid;
  gap: 16px;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.account-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.account-tabs button.active {
  background: #10182c;
  color: #fff;
}

.account-panel {
  display: grid;
  gap: 14px;
}

.membership-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  margin-bottom: 14px;
}

.membership-status,
.bank-panel,
.payment-request-panel {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.membership-status strong,
.bank-panel strong,
.payment-request-panel strong {
  font-size: 15px;
  color: var(--ink);
}

.membership-status span,
.bank-panel span,
.payment-request-panel span {
  color: var(--muted);
  line-height: 1.45;
}

.payment-request-panel {
  grid-column: 1 / -1;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  align-items: end;
}

.payment-request-actions {
  display: grid;
  gap: 8px;
}

.profile-card {
  display: grid;
  gap: 12px;
  max-width: 560px;
  padding: 18px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.profile-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.payment-request-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.payment-request-panel input,
.payment-request-panel textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

.payment-grid article {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.payment-grid strong,
.payment-grid span {
  display: block;
}

.payment-grid span {
  font-size: 28px;
  font-weight: 900;
}

.payment-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.payment-history-list {
  display: grid;
  gap: 10px;
}

.payment-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.payment-history-item strong,
.payment-history-item span {
  display: block;
}

.payment-history-item span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.payment-history-item > div:last-child {
  justify-self: end;
  width: min(260px, 100%);
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 190px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef3f9;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.payment-status-badge.status-paid {
  background: #eaf7ef;
  color: #14733a;
}

.payment-status-badge.status-bank_pending {
  background: #fff5dc;
  color: #7a5100;
}

.payment-status-badge.status-rejected,
.payment-status-badge.status-failed {
  background: #ffecec;
  color: #9e1f1f;
}

.payment-dialog {
  width: min(980px, 100%);
  height: min(760px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 8px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.payment-dialog iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.api-doc-grid,
.api-reference {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.api-doc-grid article,
.api-reference div {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.api-doc-grid strong,
.api-doc-grid span {
  display: block;
}

.api-doc-grid span,
.api-doc-grid p {
  color: var(--muted);
}

.api-doc-grid p {
  margin: 0;
  line-height: 1.45;
}

.api-reference h3 {
  margin: 0;
  font-size: 15px;
}

.api-reference code {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  border-radius: 8px;
  background: #10182c;
  color: #fff;
  white-space: nowrap;
}

.api-key-section[hidden] {
  display: none;
}

.api-key-box {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.api-key-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.api-key-box pre,
.api-key-box code {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  background: #10182c;
  color: #fff;
}

.api-key-box > code:nth-of-type(-n + 2) {
  display: none;
}

.api-snippet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.api-snippet .compact-button {
  align-self: stretch;
}

.api-key-box pre {
  min-height: 54px;
  padding: 14px;
  white-space: pre;
}

.api-key-box code {
  padding: 14px;
  white-space: nowrap;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 33, 61, 0.42);
}

.auth-modal[hidden] {
  display: none;
}

.auth-dialog {
  width: min(440px, 100%);
  border-radius: 8px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.history-dialog {
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
  border-radius: 8px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px 16px 0;
}

.auth-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.4;
}

.admin-section[hidden] {
  display: none;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-metrics div {
  min-height: 92px;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(20, 33, 61, 0.1);
}

.admin-metrics strong,
.admin-metrics span {
  display: block;
}

.admin-metrics strong {
  font-size: 22px;
  line-height: 1.2;
}

.admin-metrics span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.admin-api-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.admin-payment-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.admin-api-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-api-head span,
.api-usage-meta {
  color: var(--muted);
  font-size: 13px;
}

.admin-api-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-api-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.api-usage-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.api-usage-item strong {
  font-size: 14px;
  line-height: 1.35;
}

.admin-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.admin-filter-tabs button {
  min-height: 34px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.admin-filter-tabs button.active {
  border-color: #10182c;
  background: #10182c;
  color: #fff;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.admin-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 13px;
}

.admin-table td strong,
.admin-table td span {
  display: block;
}

.admin-table td span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-table input[type="number"],
.admin-table select {
  min-width: 110px;
}

.admin-table input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
}

.admin-table td .compact-button {
  margin-top: 6px;
}

.admin-table td .secondary-button {
  margin: 3px 6px 3px 0;
  padding: 8px 10px;
  min-height: 34px;
  font-size: 12px;
}

.contact-action-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(320px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.contact-action-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.contact-action-card strong {
  font-size: 16px;
  color: var(--ink);
}

.contact-summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.support-list-card {
  min-height: 100%;
}

.support-list-head,
.support-ticket-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.contact-action-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.contact-action-card input,
.contact-action-card select,
.contact-action-card textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.support-ticket-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.support-ticket-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fbfcff;
}

.support-ticket-unread {
  border-color: rgba(42, 157, 143, 0.42);
  background: #f3fbf8;
}

.support-ticket-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.support-ticket-preview {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.support-status-pill {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.support-status-new {
  background: #dff6ee;
  color: #13715f;
}

.support-status-waiting {
  background: #fff3d6;
  color: #8a5d00;
}

.support-status-closed {
  background: #eef2f7;
  color: #64748b;
}

.support-ticket-item textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.support-thread {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.support-thread-large {
  max-height: min(58vh, 520px);
  padding: 4px;
}

.support-message {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4f7fb;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.support-message-admin {
  background: #eaf7f3;
}

.support-reply-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  align-self: start;
}

.support-reply-panel textarea {
  width: 100%;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  resize: none;
}

.support-reply-actions {
  display: grid;
  gap: 8px;
}

.support-reply-actions .primary-button,
.support-reply-actions .secondary-button {
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 900;
}

.payment-period {
  color: var(--ink);
  font-weight: 800;
}

.feedback-dialog,
.support-dialog {
  max-width: 720px;
}

.support-dialog {
  grid-template-rows: auto auto auto;
  height: auto;
  max-height: min(680px, calc(100vh - 36px));
}

.admin-support-item {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.admin-support-item input,
.admin-support-item textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.admin-support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#adminFeedbackList,
#adminSupportList {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.admin-contact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.legal-grid article {
  padding: 18px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #fff;
}

.legal-grid h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.legal-grid p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 40px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer span {
  color: var(--ink);
  font-weight: 900;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.footer-link-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.cookie-consent {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(20, 33, 61, 0.18);
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent strong,
.cookie-consent p {
  display: block;
}

.cookie-consent p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cookie-actions .compact-button {
  min-width: 92px;
}

@media (max-width: 980px) {
  .workspace,
  .split,
  .quick-links,
  .contact-action-grid,
  .membership-panel,
  .payment-request-panel,
  .payment-history-item {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: auto;
  }

  .payment-history-item > div:last-child {
    justify-self: stretch;
    width: 100%;
  }

  .cookie-consent {
    grid-template-columns: 1fr;
  }

  .cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result-panel {
    max-height: 520px;
    position: static;
  }

  .payment-request-panel {
    align-items: stretch;
  }

  .account-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  main {
    padding-top: 16px;
  }

  .console-head,
  .section-head,
  .api-band {
    display: grid;
  }

  h1 {
    font-size: 32px;
  }

  .field-grid,
  .metrics,
  .admin-metrics,
  .admin-api-grid,
  .api-doc-grid,
  .api-reference,
  .legal-grid,
  .payment-grid,
  .plan-grid,
  .pricing-grid,
  .quick-links,
  .tool-grid,
  .tool-group-grid {
    grid-template-columns: 1fr;
  }

  .history-actions {
    display: grid;
  }

  .history-actions input {
    width: 100%;
  }

  .full-history-toolbar,
  .chat-form,
  .history-pager {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-actions button {
    width: 100%;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .api-snippet {
    grid-template-columns: 1fr;
  }

  .history-time {
    white-space: normal;
  }

  .history-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
