/* FruitDoc CRM — dark, colourful, angular, RTL. */

:root {
  --bg: #0d1218;
  --bg-2: #121a23;
  --panel: #16202b;
  --panel-2: #1b2735;
  --line: #26374a;
  --ink: #eaf2f8;
  --muted: #8fa4b8;

  --mango: #ff8a3d;
  --lime: #38d98a;
  --berry: #f0508c;
  --grape: #a06bff;
  --kiwi: #b6e21a;
  --lemon: #ffd23f;
  --sf-blue: #00a1e0;
  --danger: #ff5f56;

  --cut: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Heebo", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(255,138,61,.16), transparent 60%),
    radial-gradient(900px 480px at 6% 4%, rgba(56,217,138,.14), transparent 62%),
    radial-gradient(700px 420px at 50% 110%, rgba(160,107,255,.14), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100%;
}

.hidden { display: none !important; }

/* decorative fruit confetti */
.fruit-confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .07; font-size: 30px; line-height: 2.4;
  overflow: hidden; user-select: none;
}

main, .topbar, .tabbar, footer { position: relative; z-index: 1; }

/* ---------------- angular helper ---------------- */
.cut {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)),
                     calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

/* ---------------- topbar ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 16px 30px; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(22,32,43,.96), rgba(18,26,35,.9));
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  position: relative; width: 58px; height: 58px; flex: none;
  display: grid; place-items: center; font-size: 26px;
  background: linear-gradient(135deg, #f8fbff, #dbeafe);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px),
                     calc(100% - 16px) 100%, 0 100%, 0 16px);
}
.brand-mark .corner {
  position: absolute; width: 10px; height: 10px; background: var(--lemon);
}
.brand-mark .tl { top: 0; inset-inline-start: 0; }
.brand-mark .br { bottom: 0; inset-inline-end: 0; background: var(--lime); }
.brand-text h1 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: -.3px; }
.brand-text h1 .accent {
  background: linear-gradient(90deg, var(--mango), var(--lemon));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text p { margin: 0; font-size: 12.5px; color: var(--muted); }

.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.org-links { display: flex; gap: 7px; flex-wrap: wrap; }
.org-links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; text-decoration: none; font-weight: 500;
  color: #9fdcf6; border: 1px solid #1d4d66; background: #102a38;
  padding: 6px 12px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.org-links a:hover { background: var(--sf-blue); color: #04121a; border-color: var(--sf-blue); }
.org-links a svg { width: 16px; height: 12px; }
.org-links a svg path { fill: currentColor; }

.health {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  padding: 6px 13px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.health .dot { width: 9px; height: 9px; background: var(--muted); flex: none; }
.health.ok .dot { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.health.bad .dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

/* ---------------- main tabs ---------------- */
.tabbar {
  display: flex; gap: 8px; padding: 16px 30px 0;
  max-width: 1000px; margin: 0 auto; flex-wrap: wrap;
}
.maintab {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); border-bottom: none;
  padding: 11px 22px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  font-family: inherit;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
  transition: color .15s, background .15s;
}
.maintab:hover { color: var(--ink); background: var(--panel-2); }
.maintab.active {
  color: #0d1218; background: linear-gradient(135deg, var(--lime), var(--kiwi));
  border-color: transparent;
}
.tab-emoji { font-size: 16px; }

/* ---------------- layout ---------------- */
main {
  max-width: 1000px; margin: 0 auto 60px;
  padding: 0 30px; display: block;
}
.tabpanel { display: flex; flex-direction: column; gap: 20px; padding-top: 20px; }

.card {
  position: relative;
  background: linear-gradient(160deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  padding: 26px 28px;
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px),
                     calc(100% - 22px) 100%, 0 100%, 0 22px);
}
.card::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0;
  width: 100%; height: 4px; background: var(--line);
}
.stripe-mango::before { background: linear-gradient(90deg, var(--mango), var(--lemon)); }
.stripe-lime::before  { background: linear-gradient(90deg, var(--lime), var(--kiwi)); }
.stripe-berry::before { background: linear-gradient(90deg, var(--berry), var(--grape)); }
.stripe-kiwi::before  { background: linear-gradient(90deg, var(--kiwi), var(--lime)); }

.card h2 {
  margin: 0 0 14px; font-size: 17px; font-weight: 900;
  display: flex; align-items: center; gap: 10px;
}
.h-emoji { font-size: 18px; }
.step-num {
  width: 26px; height: 26px; flex: none;
  background: linear-gradient(135deg, var(--mango), var(--berry));
  color: #0d1218; font-size: 13px; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px),
                     calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.card.error { border-color: #6b2a26; }
.card.error::before { background: linear-gradient(90deg, var(--danger), var(--mango)); }
.card.error h2 { color: #ff8f88; }

.lead { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.subhead { margin: 20px 0 10px; font-size: 14px; font-weight: 700; }

/* ---------------- dropzone ---------------- */
.dropzone {
  border: 2px dashed #33506b; background: rgba(13,18,24,.55);
  padding: 30px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px),
                     calc(100% - 16px) 100%, 0 100%, 0 16px);
}
.dropzone:hover, .dropzone:focus, .dropzone.dragover {
  border-color: var(--lime); background: rgba(56,217,138,.08); outline: none;
}
.dz-fruits { font-size: 26px; letter-spacing: 6px; margin-bottom: 8px; }
.dz-title { margin: 4px 0 2px; font-size: 16px; font-weight: 700; }
.dz-sub { margin: 0; font-size: 13.5px; color: var(--muted); }
.dz-hint { margin: 10px 0 0; font-size: 11.5px; color: #63788c; }

.linkbtn {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--lime); text-decoration: underline;
}

.file-chip {
  display: flex; align-items: center; gap: 14px; margin-top: 4px;
  border: 1px solid var(--line); background: var(--panel-2); padding: 12px 15px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px),
                     calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.thumb {
  width: 46px; height: 56px; flex: none; background: #0d1218 center/cover no-repeat;
  border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: var(--muted);
}
.file-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.file-meta strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { font-size: 12px; color: var(--muted); }

/* ---------------- form ---------------- */
.field { display: block; margin: 20px 0 18px; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
select, input[type="text"] {
  width: 100%; padding: 11px 13px; font: inherit;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px),
                     calc(100% - 9px) 100%, 0 100%, 0 9px);
}
select:focus, input[type="text"]:focus { outline: none; border-color: var(--lime); }
.field-hint { display: block; margin-top: 7px; font-size: 12px; color: var(--muted); }

button { font-family: inherit; }

.primary {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--lime), var(--kiwi));
  color: #08130c; border: none; padding: 12px 26px;
  font-weight: 800; font-size: 14.5px; cursor: pointer;
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px),
                     calc(100% - 11px) 100%, 0 100%, 0 11px);
  transition: filter .15s;
}
.primary:hover:not(:disabled) { filter: brightness(1.12); }
.primary:disabled { background: #2c3a49; color: #6d8296; cursor: not-allowed; }
.btn-arrow { font-size: 17px; font-weight: 900; }

.ghostbtn {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  padding: 9px 15px; cursor: pointer; font-size: 13px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.ghostbtn:hover { border-color: var(--lime); color: var(--lime); }

.salesforce {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--sf-blue); color: #051a24; border: none;
  padding: 12px 24px; font-weight: 800; font-size: 14.5px; cursor: pointer;
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px),
                     calc(100% - 11px) 100%, 0 100%, 0 11px);
}
.salesforce:hover:not(:disabled) { filter: brightness(1.12); }
.salesforce:disabled { background: #244a5c; color: #7ea9bd; cursor: not-allowed; }
.sf-logo { width: 27px; height: 20px; }
.sf-logo path { fill: currentColor; }

.sflink {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  border: 1.5px solid var(--sf-blue); color: var(--sf-blue); background: transparent;
  padding: 11px 20px; font-weight: 800; font-size: 14px;
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px),
                     calc(100% - 11px) 100%, 0 100%, 0 11px);
}
.sflink:hover { background: var(--sf-blue); color: #051a24; }
.ext { font-size: 15px; }

/* ---------------- progress ---------------- */
.loader-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.spinner {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  font-size: 19px;
  background: conic-gradient(var(--lime), var(--lemon), var(--mango), var(--berry), var(--lime));
  animation: spin 2.4s linear infinite;
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px),
                     calc(100% - 11px) 100%, 0 100%, 0 11px);
}
.spinner span { animation: spin-rev 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
.loader-msg { margin: 0; font-weight: 700; font-size: 15px; }
.loader-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li {
  font-size: 13.5px; color: var(--muted);
  padding-inline-start: 28px; position: relative;
}
.steps li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 8px;
  width: 10px; height: 10px; background: transparent; border: 2px solid #35506a;
}
.steps li.active { color: var(--ink); font-weight: 700; }
.steps li.active::before { border-color: var(--lemon); background: rgba(255,210,63,.25); }
.steps li.complete::before { background: var(--lime); border-color: var(--lime); }
.steps li.skipped { opacity: .4; text-decoration: line-through; }

/* ---------------- results ---------------- */
.summary { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.pill {
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 6px 14px; font-size: 12.5px; color: var(--muted);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.pill b { color: var(--ink); }
.pill.amber { border-color: var(--lemon); background: rgba(255,210,63,.12); }
.pill.amber b { color: var(--lemon); }
.pill.grape { border-color: var(--grape); background: rgba(160,107,255,.14); }
.pill.grape b { color: #cbb0ff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  background: rgba(56,217,138,.12); border: 1px solid #23694a; color: #9df0c6;
  padding: 5px 11px; direction: ltr;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px),
                     calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.json-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.tabs { display: inline-flex; border: 1px solid var(--line); overflow: hidden; }
.tabs .tab {
  border: none; background: var(--panel-2); color: var(--muted);
  padding: 8px 18px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.tabs .tab.active { background: linear-gradient(135deg, var(--berry), var(--grape)); color: #14060e; font-weight: 700; }
.toolbar-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.json-panel {
  border: 1px solid var(--line); background: rgba(9,13,18,.7);
  margin-bottom: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px),
                     calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.json-panel > summary {
  cursor: pointer; padding: 12px 16px; font-size: 13.5px; font-weight: 700;
  user-select: none; color: var(--ink);
}
.json-view {
  margin: 0; padding: 4px 16px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; max-height: 460px; overflow: auto; text-align: left;
}
pre.json-view { white-space: pre-wrap; word-break: break-word; color: #cfe3f2; }

.node { padding-inline-start: 15px; border-inline-start: 1px dotted #2c435a; }
.node > .row { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; }
.twisty {
  border: none; background: none; cursor: pointer; padding: 0 4px 0 0;
  color: var(--muted); font-size: 11px; width: 16px; text-align: left;
}
.jkey { color: var(--lemon); }
.jstr { color: #7ee2b8; }
.jnum { color: #7fb8ff; }
.jbool { color: var(--mango); }
.jnull { color: #6b8098; font-style: italic; }
.jmeta { color: #7590a8; font-size: 11.5px; }
.collapsed > .children { display: none; }

.actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }

.save-result {
  margin-top: 16px; padding: 15px 17px; font-size: 13.5px;
  background: rgba(56,217,138,.1); border: 1px solid #23694a;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px),
                     calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.save-result.err { background: rgba(255,95,86,.1); border-color: #6b2a26; }
.save-result a { color: #6fd0f5; font-weight: 700; }
.save-result ul { margin: 8px 0 0; padding-inline-start: 20px; }
.save-result code { direction: ltr; display: inline-block; }

/* ---------------- schema library ---------------- */
.schema-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.schema-card {
  background: var(--panel-2); border: 1px solid var(--line); padding: 16px 18px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px),
                     calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.schema-card h4 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.schema-card .tagline { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.schema-card .meta { font-size: 11.5px; color: #6d8296; direction: ltr; text-align: right; }
.badge {
  font-size: 10.5px; font-weight: 800; padding: 2px 8px;
  background: var(--grape); color: #16081f;
}
.badge.builtin { background: var(--mango); color: #1d0c02; }
.schema-card .card-actions { margin-top: 12px; display: flex; gap: 8px; }

footer {
  text-align: center; padding: 0 20px 44px; font-size: 12px; color: var(--muted);
}
footer code {
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 2px 7px; margin: 0 3px; font-size: 11.5px; color: #9fdcf6;
}

@media (max-width: 680px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  main, .tabbar { padding-inline: 16px; }
  .card { padding: 20px 18px; }
}

/* ---------------------------------------------- document preview ---------- */
.preview {
  margin: 18px 0 4px;
  border: 1px solid var(--line);
  background: #0c1622;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px 14px;
  background: linear-gradient(90deg, rgba(56,217,138,.18), rgba(255,138,61,.14));
  border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
}
.preview-body { background: #060c14; min-height: 320px; }
.preview-body iframe,
.preview-body embed { width: 100%; height: 620px; border: 0; display: block; }
.preview-body img { display: block; width: 100%; max-height: 620px; object-fit: contain; }
.preview-body .no-preview {
  padding: 46px 20px; text-align: center; color: #63788c; font-size: 13px;
}

/* ---------------------------------------------- endpoint chips ------------ */
code.ep {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 2px 7px;
  border: 1px solid rgba(56,189,248,.34);
  border-radius: 2px;
  background: rgba(56,189,248,.09);
  color: #7dd3fc;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: .2px;
  white-space: nowrap;
  vertical-align: middle;
}
.steps li.active code.ep {
  border-color: rgba(250,204,21,.55);
  background: rgba(250,204,21,.12);
  color: #fde68a;
}
.steps li.complete code.ep { opacity: .5; }
#save-endpoint { align-self: center; }

/* ---------------------------------------------- API activity log ---------- */
.api-log {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #0a1420;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.api-log > summary {
  cursor: pointer; padding: 9px 14px; font-size: 12.5px; font-weight: 700;
  color: #9fb3c8; list-style: none;
}
.api-log > summary::-webkit-details-marker { display: none; }
.api-log > summary::before { content: "▸ "; color: var(--lime); }
.api-log[open] > summary::before { content: "▾ "; }
.api-log .count {
  display: inline-block; margin-inline-start: 6px; padding: 1px 7px;
  border-radius: 999px; background: rgba(56,217,138,.16); color: var(--lime);
  font-size: 11px;
}
.log-rows { border-top: 1px solid var(--line); max-height: 260px; overflow: auto; }
.log-row {
  display: grid;
  grid-template-columns: 78px 52px 1fr 52px 58px;
  gap: 8px; align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  direction: ltr; text-align: left;
}
.log-row:last-child { border-bottom: 0; }
.log-row .svc { font-weight: 700; font-size: 10px; letter-spacing: .3px; }
.log-row .svc.docupipe { color: #c4b5fd; }
.log-row .svc.salesforce { color: #38bdf8; }
.log-row .verb { color: var(--mango); font-weight: 700; }
.log-row .path { color: #cbd5e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row .code.ok { color: var(--lime); }
.log-row .code.bad { color: #fb7185; }
.log-row .ms { color: #63788c; text-align: right; }

/* --- admin-only warning on the schema lab --- */
.admin-warn {
  margin: 18px 0 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(255, 176, 32, .14), rgba(255, 92, 92, .10));
  border: 1px solid rgba(255, 176, 32, .45);
  border-inline-start: 5px solid #ffb020;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.admin-warn-head {
  font-weight: 800;
  letter-spacing: .5px;
  color: #ffcc66;
  margin-bottom: 6px;
}
.admin-warn p { margin: 0 0 10px; color: #e6dcc8; line-height: 1.65; font-size: .95rem; }
.admin-warn .warn-icon { font-size: 1.1rem; }
.admin-ack { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.admin-ack input { margin-top: 3px; accent-color: #ffb020; width: 18px; height: 18px; }
.admin-ack span { font-weight: 600; color: #fff3dd; }
.pill.sf { background: rgba(0, 161, 224, .18); border-color: rgba(0, 161, 224, .55); }

/* ------------------------------------------------ CRM record browser tab */
.objtabs { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0 14px; }
.objtab {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  padding: 9px 16px; cursor: pointer; font-family: inherit; font-size: 14px;
  font-weight: 600;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px),
                     calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.objtab:hover { border-color: var(--lime); color: var(--ink); }
.objtab.active {
  background: linear-gradient(135deg, var(--lime), var(--kiwi));
  color: #08221a; border-color: transparent;
}
.objtab-tag {
  font-size: 11px; font-style: normal; opacity: .8;
  background: rgba(160,107,255,.22); padding: 1px 7px;
}
.objtab.active .objtab-tag { background: rgba(8,34,26,.18); }

.table-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.record-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.record-table th {
  background: var(--panel-2); color: var(--muted); text-align: right;
  padding: 11px 13px; font-weight: 700; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.record-table td {
  padding: 10px 13px; border-bottom: 1px solid rgba(38,55,74,.55);
  white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
}
.record-table tbody tr:hover { background: rgba(56,217,138,.07); }
.record-table tbody tr:last-child td { border-bottom: none; }
.record-table .row-link a {
  color: var(--sf-blue); text-decoration: none; font-size: 16px;
}
.record-table .row-link a:hover { color: var(--lime); }
.muted-line { color: var(--muted); padding: 18px 4px; }

/* ------------------------------------------------------------- help tab */
.flow {
  display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; margin-top: 18px;
}
.flow-step {
  flex: 1 1 150px; background: var(--panel-2); border: 1px solid var(--line);
  padding: 16px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px),
                     calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.flow-step b { display: block; margin: 6px 0 4px; }
.flow-step p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.flow-emoji { font-size: 24px; }
.flow-arrow { align-self: center; color: var(--lime); font-size: 22px; font-weight: 900; }

.help-grid {
  display: grid; gap: 14px; margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.help-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-inline-start: 4px solid var(--mango); padding: 16px 18px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px),
                     calc(100% - 12px) 100%, 0 100%);
}
.help-card:nth-child(2) { border-inline-start-color: var(--lime); }
.help-card:nth-child(3) { border-inline-start-color: var(--berry); }
.help-card:nth-child(4) { border-inline-start-color: var(--grape); }
.help-card h4 { margin: 0 0 8px; font-size: 16px; }
.help-card p { margin: 0; color: #cfe0ee; font-size: 14px; line-height: 1.7; }
.help-card code, .help-notes code, .help-steps code {
  background: rgba(0,161,224,.14); color: #7fd8ff; padding: 1px 6px; font-size: 12.5px;
}

.help-steps { margin: 16px 0 0; padding-inline-start: 22px; }
.help-steps li { margin-bottom: 12px; color: #cfe0ee; line-height: 1.75; }
.help-steps b { color: var(--ink); }
.help-notes { margin: 14px 0 0; padding-inline-start: 22px; }
.help-notes li { margin-bottom: 8px; color: #cfe0ee; line-height: 1.7; }

/* ---------------------------------------------- code samples tab ---------- */
.code-card { margin-bottom: 18px; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.code-head h3 { margin: 0; font-size: 15.5px; }
.code-blurb { color: var(--muted); font-size: 13.5px; margin: 8px 0 10px; }
.code-eps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.code-eps code.ep { margin-inline-start: 0; }
.copy-btn {
  border: 1px solid rgba(163,230,53,.4); background: rgba(163,230,53,.08);
  color: var(--lime); border-radius: 2px; padding: 4px 12px; cursor: pointer;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.copy-btn:hover { background: rgba(163,230,53,.18); }
pre.code-view {
  margin: 0; padding: 14px 16px; text-align: left; direction: ltr;
  background: #060c14; border: 1px solid var(--line); border-radius: 3px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.3px; line-height: 1.6; color: #cfe3f2;
  max-height: 460px; overflow: auto; white-space: pre;
}
pre.code-view::-webkit-scrollbar { height: 8px; width: 8px; }
pre.code-view::-webkit-scrollbar-thumb { background: #24384c; border-radius: 4px; }

.brand-logo { width: 40px; height: 40px; object-fit: contain; display: block; }

/* ---------------------------------------------- API quotas tab ------------ */
.quota-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ep-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ep-chips code.ep { margin-inline-start: 0; }
.quota-card { margin-bottom: 18px; }
.quota-card h3 { margin: 0; font-size: 16px; }
.quota-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quota-ok { border-color: rgba(163,230,53,.28); }
.quota-low { border-color: rgba(251,113,133,.45); }
.quota-big { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 6px; }
.quota-big b {
  font-size: 44px; font-weight: 900; line-height: 1;
  background: linear-gradient(90deg, var(--lime), var(--kiwi));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.quota-low .quota-big b { background: linear-gradient(90deg, #fb7185, var(--mango)); -webkit-background-clip: text; background-clip: text; }
.quota-big span { color: var(--muted); font-size: 13.5px; }
.quota-warn {
  margin: 10px 0 0; padding: 9px 12px; font-size: 13px; color: #fecdd3;
  border: 1px solid rgba(251,113,133,.4); background: rgba(251,113,133,.09);
  border-radius: 2px;
}
.quota-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 16px 0 0; }
.quota-dl div { border: 1px solid var(--line); border-radius: 2px; padding: 8px 11px; background: rgba(255,255,255,.02); }
.quota-dl dt { font-size: 11.5px; color: var(--muted); margin: 0 0 3px; }
.quota-dl dd { margin: 0; font-size: 14px; font-weight: 700; }
.qlist { display: grid; gap: 14px; margin-top: 14px; }
.qrow-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.qnums { color: var(--muted); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.qbar { display: block; height: 8px; background: #0d1a25; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.qbar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--kiwi), var(--lime)); }
.qbar-fill.hot { background: linear-gradient(90deg, var(--mango), #fb7185); }
.qbar-pct { font-size: 11px; color: var(--muted); }
.quota-stamp { text-align: center; }
