@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Mulish:wght@400;500;600;700;800&display=swap");

* { box-sizing: border-box; }

:root {
  --ink: #16273F;
  --body: #5B6675;
  --muted: #8791A0;
  --muted3: #98A2B0;
  --card-border: #EAEDF3;
  --panel-border: #E7EBF1;
  --btn-border: #E4E8EF;
  --row-border: #F1F4F8;
  --red: #E8402A;
  --link: #2F6FE0;
  --green: #1F8A5B;
  --green-run: #1FA97A;
  --danger: #C0392B;
  /* dark code panel */
  --dark: #0E1B2A;
  --dark-border: #0B1622;
  --dark-line: #1C2E42;
  --dark-text: #B7D2EC;
  --dark-dim: #7FA6CC;
  --dark-accent: #CFE0F2;
  --dark-btn: #1B2E42;
  --dark-btn-border: #29405A;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Mulish", system-ui, sans-serif;
  color: var(--body);
  background: linear-gradient(180deg, #F5F3FB 0%, #F1F6F6 100%);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.auth-pending .app-shell { display: none; }

.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

@keyframes dtFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------- Hero ------------------------------- */
.dt-hero-inner { max-width: 90%; margin: 0 auto; padding: 32px 32px 8px; }
.dt-title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin: 0 0 6px;
}
.dt-subtitle { font-size: 15.5px; color: var(--muted); margin: 0; }

/* ------------------------------- Tabs ------------------------------- */
.dt-tabs {
  background: #fff;
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 1px 2px rgba(18, 38, 63, 0.03);
  margin-top: 14px;
}
.dt-tabs-inner { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 8px; }
.dt-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--muted);
  padding: 16px 18px;
  margin: 0 0 -1px;
}
.dt-tab.active { font-weight: 700; color: var(--ink); border-bottom-color: var(--red); }
.dt-tab:focus-visible { outline: 2px solid var(--link); outline-offset: -4px; border-radius: 6px; }

/* ------------------------------- Main ------------------------------- */
.dt-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 28px 32px 56px; }
.dt-view { animation: dtFadeUp 0.3s ease both; }
.dt-intro { font-size: 14.5px; color: var(--body); margin: 0 0 18px; max-width: 760px; line-height: 1.6; }
.mono { font-family: var(--mono); }

/* ------------------------------- Dark code panel ------------------------------- */
.dt-dark {
  background: var(--dark);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(11, 22, 34, 0.28);
  overflow: hidden;
}
.dt-dark-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--dark-line); }
.dt-dark-title { font-family: var(--mono); font-size: 13px; color: var(--dark-accent); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-dark-meta { font-family: var(--mono); font-size: 12px; color: var(--dark-dim); }
.dt-pre {
  margin: 0;
  padding: 22px;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.65;
  color: var(--dark-text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.dt-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--dark-accent);
  background: var(--dark-btn);
  border: 1px solid var(--dark-btn-border);
  border-radius: 8px;
  padding: 7px 12px;
  flex: 0 0 auto;
}
.dt-copy:hover { background: #243B54; }

/* ------------------------------- DevTools console ------------------------------- */
.dt-inspectors {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--btn-border);
  border-radius: 13px;
  padding: 5px;
  box-shadow: 0 1px 2px rgba(18, 38, 63, 0.05);
  margin-bottom: 20px;
}
.dt-insp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--body);
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 9px 15px;
}
.dt-insp.active { color: #fff; background: var(--ink); }
.dt-insp-dot { width: 8px; height: 8px; border-radius: 50%; background: #C2CBD8; }
.dt-insp.active .dt-insp-dot { background: #4ADE80; }
.dt-insp-count { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11px; color: var(--muted3); background: #EEF1F6; border-radius: 6px; padding: 1px 7px; }
.dt-insp.active .dt-insp-count { color: #CBD8EA; background: rgba(255, 255, 255, 0.12); }

.dt-console { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.dt-list-card { background: #fff; border: 1px solid var(--card-border); border-radius: 16px; box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05); overflow: hidden; }
.dt-list-head { padding: 15px 18px; border-bottom: 1px solid #EFF1F6; display: flex; align-items: center; justify-content: space-between; }
.dt-list-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 14px; color: var(--ink); }
.dt-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--green); }
.dt-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #28B36B; }
.dt-list { max-height: 560px; overflow-y: auto; }
.dt-entry { display: block; width: 100%; text-align: left; border: none; border-left: 3px solid transparent; border-bottom: 1px solid var(--row-border); background: #fff; padding: 14px 18px; transition: background .12s; }
.dt-entry.selected { border-left-color: var(--link); background: #F5F9FF; }
.dt-entry:hover:not(.selected) { background: #FAFBFE; }
.dt-entry-top { display: flex; align-items: center; gap: 9px; }
.dt-entry-title { font-family: var(--mono); font-size: 12.5px; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-entry-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.dt-entry-meta { font-size: 11.5px; color: var(--muted3); }

.dt-tag { font-family: var(--mono); font-weight: 700; font-size: 10.5px; border-radius: 5px; padding: 2px 7px; flex: 0 0 auto; }
.dt-tag--green { color: #1F8A5B; background: #E7F7F1; }
.dt-tag--blue { color: #2F6FE0; background: #EAF1FC; }
.dt-tag--violet { color: #7A5AF0; background: #F1EEFC; }
.dt-tag--amber { color: #B5772E; background: #FCF6E4; }
.dt-tag--red { color: #C0392B; background: #FCECEC; }
.dt-status { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11px; border-radius: 6px; padding: 2px 8px; }
.dt-status--ok { color: #1F8A5B; background: #E7F7F1; }
.dt-status--err { color: #C0392B; background: #FCECEC; }
.dt-status--neutral { color: #5B6675; background: #EEF1F6; }

.dt-detail { position: sticky; top: 88px; }
.dt-detail .dt-dark-head { align-items: center; }
.dt-detail-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.dt-detail-tag { font-family: var(--mono); font-weight: 700; font-size: 11px; color: var(--dark); border-radius: 6px; padding: 3px 9px; flex: 0 0 auto; }
.dt-detail-tag--ok { background: #7FD0A6; }
.dt-detail-tag--err { background: #FF8A80; }
.dt-detail-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.dt-detail .dt-pre { max-height: 560px; }

/* ------------------------------- Unit Testing ------------------------------- */
.dt-test-view { display: flex; flex-direction: column; gap: 24px; }
.dt-test-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dt-summary { display: flex; gap: 14px; flex-wrap: wrap; }
.dt-stat { background: #fff; border: 1px solid var(--card-border); border-radius: 14px; box-shadow: 0 2px 10px rgba(18, 38, 63, 0.04); padding: 16px 24px; min-width: 130px; }
.dt-stat-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 28px; line-height: 1; }
.dt-stat-value.green { color: var(--green); }
.dt-stat-value.red { color: var(--danger); }
.dt-stat-value.ink { color: var(--ink); }
.dt-stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.dt-run {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--green-run);
  border: none;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(31, 169, 122, 0.28);
}
.dt-run:hover { background: #188C64; }

.dt-test-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.dt-suites { background: #fff; border: 1px solid var(--card-border); border-radius: 18px; box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05); overflow: hidden; }
.dt-suites-head { padding: 20px 24px 14px; }
.dt-suites-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); margin: 0; }
.dt-suites-sub { font-size: 13px; color: var(--muted3); margin-top: 3px; }
.dt-case { display: flex; align-items: center; gap: 14px; padding: 15px 24px; border-top: 1px solid var(--row-border); }
.dt-case-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dt-case-icon.pass { background: #E7F7F1; }
.dt-case-icon.fail { background: #FCECEC; }
.dt-case-main { flex: 1; min-width: 0; }
.dt-case-name { font-family: var(--mono); font-size: 13.5px; color: var(--ink); font-weight: 600; }
.dt-case-suite { font-size: 12px; color: var(--muted3); margin-top: 2px; }
.dt-case-time { font-family: var(--mono); font-size: 12px; color: var(--muted3); }
.dt-badge { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11px; border-radius: 999px; padding: 3px 11px; border: 1px solid; }
.dt-badge.pass { color: #1F8A5B; background: #E7F7F1; border-color: #C9EBDD; }
.dt-badge.fail { color: #C0392B; background: #FCECEC; border-color: #F3D3D3; }
.dt-jest-tag { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11px; color: #8FD0B4; background: #123528; border: 1px solid #1E4E3A; border-radius: 7px; padding: 4px 10px; }
.dt-test-grid .dt-dark { border-radius: 18px; }
.dt-test-grid .dt-pre { line-height: 1.7; }

/* ------------------------------- SDK ------------------------------- */
.dt-sdk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.dt-sdk-left { display: flex; flex-direction: column; gap: 22px; }
.dt-card { background: #fff; border: 1px solid var(--card-border); border-radius: 18px; box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05); padding: 26px; }
.dt-card.pad24 { padding: 24px; }
.dt-chip { display: inline-flex; align-items: center; gap: 8px; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11.5px; letter-spacing: 0.5px; text-transform: uppercase; color: #7A5AF0; background: #F1EEFC; border-radius: 999px; padding: 5px 12px; }
.dt-sdk-h2 { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); margin: 14px 0 8px; letter-spacing: -0.3px; }
.dt-sdk-p { font-size: 14.5px; line-height: 1.65; color: var(--body); margin: 0; }
.dt-card-h3 { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); margin: 0 0 14px; }
.dt-card-h3.tight { margin-bottom: 5px; }
.dt-card-note { font-size: 13px; color: var(--muted); margin: 0 0 14px; }

.dt-seg { display: inline-flex; gap: 6px; background: #F4F6FA; border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.dt-seg-btn {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 15px;
}
.dt-seg-btn.active { font-weight: 700; color: var(--ink); background: #fff; border-color: var(--btn-border); box-shadow: 0 1px 2px rgba(18, 38, 63, 0.06); }

.dt-cmd { background: var(--dark); border-radius: 11px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dt-cmd-text { font-family: var(--mono); font-size: 13px; color: var(--dark-text); word-break: break-all; }

.dt-key-row { display: flex; align-items: center; gap: 10px; background: #F6F8FC; border: 1.5px solid #E4E9F1; border-radius: 11px; padding: 12px 15px; }
.dt-key { flex: 1; font-family: var(--mono); font-size: 13px; color: var(--ink); letter-spacing: 0.5px; word-break: break-all; }
.dt-key-btn { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 12.5px; border-radius: 8px; padding: 7px 13px; }
.dt-key-btn.reveal { color: var(--link); background: #fff; border: 1px solid #D4E2F8; }
.dt-key-btn.reveal:hover { background: #EAF1FC; }
.dt-key-btn.copy { color: var(--ink); background: #fff; border: 1px solid var(--btn-border); }
.dt-key-btn.copy:hover { border-color: #3C7CE0; color: #3C7CE0; }
.dt-key-warn { display: flex; align-items: center; gap: 9px; margin-top: 13px; background: #FFF8EC; border: 1px solid #F3E2BC; border-radius: 10px; padding: 11px 14px; }
.dt-key-warn span { font-size: 12.5px; color: #8A6D1E; line-height: 1.5; }
.dt-key-warn svg { flex: 0 0 auto; }

.dt-quickstart { position: sticky; top: 88px; }
.dt-quickstart .dt-dark { border-radius: 18px; }
.dt-lang-seg { display: inline-flex; gap: 6px; }
.dt-lang-btn { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 12.5px; color: var(--dark-dim); background: transparent; border: none; border-radius: 8px; padding: 7px 13px; }
.dt-lang-btn.active { font-weight: 700; color: var(--dark); background: var(--dark-accent); }
.dt-quickstart .dt-pre { padding: 24px; font-size: 13px; line-height: 1.75; min-height: 420px; }

/* ------------------------------- Responsive ------------------------------- */
@media (max-width: 1000px) {
  .dt-console { grid-template-columns: 1fr; }
  .dt-detail, .dt-quickstart { position: static; }
  .dt-test-grid, .dt-sdk-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dt-hero-inner, .dt-tabs-inner, .dt-main { padding-left: 20px; padding-right: 20px; }
  .dt-inspectors { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .dt-view { animation: none; }
}
