:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d7dee8;
  --line-strong: #c7d1df;
  --text: #172331;
  --muted: #637083;
  --blue: #195b8f;
  --blue-dark: #13466f;
  --blue-soft: #edf5fb;
  --green: #207348;
  --green-soft: #ecf8f1;
  --amber: #8c6100;
  --amber-soft: #fff7e6;
  --red: #b42318;
  --red-soft: #fff1f0;
  --ink: #172331;
  --shadow: 0 10px 28px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.site-page {
  min-height: 100vh;
  background: #fff;
}
.site-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  height: 88px;
  padding: 0 40px;
  background: #fff;
  border-bottom: 1px solid #eef2f7;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #101828;
  text-decoration: none;
}
.site-brand span {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 4px;
  color: #fff;
  background: #2f63f4;
  font-size: 24px;
  font-weight: 850;
}
.site-brand strong {
  font-size: 24px;
  letter-spacing: 0;
}
.site-top nav {
  justify-content: center;
  gap: 34px;
}
.site-top nav a,
.site-login {
  position: relative;
  border: 0;
  padding: 0;
  color: #111827;
  background: transparent;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}
.site-auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
}
.site-top nav a.active,
.site-top nav a:hover,
.site-login:hover {
  color: #2f63f4;
}
.site-top nav a.active::after {
  position: absolute;
  right: 0;
  bottom: -31px;
  left: 0;
  height: 4px;
  border-radius: 999px;
  background: #2f63f4;
  content: "";
}
.clean-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 56px;
  min-height: 620px;
  padding: 110px clamp(40px, 8vw, 120px) 80px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 245, 223, .78), transparent 21%),
    radial-gradient(circle at 93% 18%, rgba(53, 184, 255, .7), transparent 28%),
    radial-gradient(circle at 10% 55%, rgba(83, 204, 255, .78), transparent 38%),
    linear-gradient(112deg, #dff7ff 0%, #edf5ff 42%, #fff 73%, #b7ecff 100%);
}
.clean-hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(104deg, transparent 0 18%, rgba(255, 255, 255, .55) 18% 19%, transparent 19% 100%),
    linear-gradient(121deg, transparent 0 53%, rgba(255, 255, 255, .45) 53% 54%, transparent 54% 100%);
  content: "";
}
.clean-hero-copy,
.clean-hero-panel {
  position: relative;
  z-index: 1;
}
.eyebrow {
  margin: 0 0 30px;
  color: #31455f;
  font-size: 18px;
  font-weight: 700;
}
.clean-hero h1,
.site-section-page h1 {
  margin: 0;
  color: #233247;
  font-family: "Songti SC", "SimSun", "STSong", serif;
  font-size: clamp(48px, 5.7vw, 72px);
  line-height: 1.12;
  font-weight: 500;
}
.lead {
  max-width: 760px;
  margin-top: 34px;
  color: #334155;
  font-size: 18px;
  line-height: 1.95;
}
.clean-actions {
  display: flex;
  gap: 16px;
  margin-top: 44px;
}
.clean-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid #2f63f4;
  border-radius: 4px;
  color: #fff;
  background: #2f63f4;
  text-decoration: none;
  font-weight: 700;
}
.clean-actions a + a {
  color: #2f63f4;
  background: #fff;
}
.clean-hero-panel {
  align-self: center;
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(199, 209, 223, .82);
  border-top: 4px solid #2f63f4;
  border-radius: 4px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 22px 42px rgba(16, 24, 40, .1);
}
.clean-hero-panel div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  min-height: 54px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fbfdff;
}
.clean-hero-panel span {
  color: #667085;
}
.clean-hero-panel strong {
  min-width: 0;
  overflow: hidden;
  color: #101828;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clean-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1200px;
  margin: 64px auto;
  padding: 0 28px;
}
.clean-strip a,
.site-card-grid section {
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 24px;
  border: 1px solid #e1e7ef;
  border-radius: 4px;
  background: #fff;
  color: #111827;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .06);
}
.clean-strip b,
.site-card-grid h2 {
  margin: 0;
  color: #101828;
  font-size: 18px;
}
.clean-strip span,
.site-card-grid p {
  margin: 0;
  color: #667085;
  line-height: 1.7;
}
.site-section-page {
  min-height: calc(100vh - 158px);
  padding: 82px clamp(28px, 8vw, 120px);
  background:
    linear-gradient(180deg, #f7fbff, #fff 42%),
    #fff;
}
.site-section-page .eyebrow {
  margin-bottom: 18px;
}
.site-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 44px;
}
.site-card-grid.compact {
  max-width: 980px;
}
.site-card-grid a {
  color: #2f63f4;
}
.topbar {
  min-height: 72px;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.25; letter-spacing: 0; }
h2 { font-size: 16px; line-height: 1.35; margin-bottom: 14px; }
h3 { font-size: 14px; line-height: 1.35; margin: 18px 0 8px; }
p { color: var(--muted); margin-top: 4px; line-height: 1.55; }
nav { display: flex; gap: 8px; align-items: center; }
nav a {
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 6px;
  background: #fff;
  font-weight: 650;
}
.public-entry:not(.authenticated) .tabs { display: none; }
.public-entry:not(.authenticated) { background: #fff; }
.public-entry:not(.authenticated) .official-topbar {
  position: sticky;
  top: 0;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 0;
  background: #fff;
  box-shadow: none;
  text-align: left;
}
.official-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: #2d63f0;
  font-size: 24px;
  font-weight: 850;
}
.public-entry:not(.authenticated) .topbar h1 {
  font-size: 23px;
  color: #101828;
  font-weight: 820;
}
.public-entry:not(.authenticated) .topbar p {
  color: #111827;
  font-size: 13px;
}
.public-nav {
  display: flex;
  gap: 26px;
}
.public-nav a {
  position: relative;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  border-color: transparent;
  color: #1f2937;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 16px;
  font-weight: 500;
}
.public-nav a.active,
.public-nav a:hover {
  color: #2d63f0;
}
.public-nav a.active::after {
  position: absolute;
  right: 0;
  bottom: -18px;
  left: 0;
  height: 4px;
  border-radius: 999px;
  background: #2d63f0;
  content: "";
}
.public-entry.authenticated .public-nav,
.public-entry.authenticated .brand-mark {
  display: none;
}
.official-entry {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
  gap: clamp(28px, 4vw, 54px);
  align-items: start;
  place-items: center stretch;
  max-width: none;
  min-height: 690px;
  margin: 0;
  padding: 110px clamp(40px, 8vw, 120px) 70px;
  overflow: hidden;
  background:
    radial-gradient(circle at 62% 18%, rgba(255, 243, 221, .76), transparent 20%),
    radial-gradient(circle at 86% 18%, rgba(51, 179, 255, .62), transparent 28%),
    radial-gradient(circle at 12% 46%, rgba(72, 198, 255, .7), transparent 34%),
    linear-gradient(112deg, #dff7ff 0%, #edf5ff 42%, #fff 72%, #bdefff 100%);
}
.official-entry::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 0 18%, rgba(255, 255, 255, .48) 18% 19%, transparent 19% 100%),
    linear-gradient(120deg, transparent 0 44%, rgba(255, 255, 255, .4) 44% 45%, transparent 45% 100%);
  content: "";
  pointer-events: none;
}
.official-entry > * {
  position: relative;
  z-index: 1;
}
.official-hero {
  display: grid;
  align-content: center;
  gap: 24px;
  min-width: 0;
}
.official-kicker {
  color: #31455f;
  font-size: 18px;
  font-weight: 500;
}
.hero-brand {
  color: #26384d;
  font-size: 28px;
  line-height: 1;
  font-weight: 500;
}
.official-hero h2 {
  max-width: 720px;
  margin: 0;
  color: #233247;
  font-family: "Songti SC", "SimSun", "STSong", serif;
  font-size: clamp(48px, 5.8vw, 72px);
  line-height: 1.12;
  font-weight: 500;
}
.official-hero > p {
  max-width: 760px;
  color: #334155;
  font-size: 17px;
  line-height: 1.95;
}
.hero-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 840px;
  color: #24364d;
  font-family: "Songti SC", "SimSun", "STSong", serif;
  font-size: 29px;
  line-height: 1.65;
}
.hero-line b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 4px;
  color: #fff;
  background: #2d63f0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 24px;
  font-weight: 700;
}
.official-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.official-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  font-weight: 760;
}
.official-actions a + a {
  color: var(--blue);
  background: #fff;
}
.official-capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 760px;
}
.official-capabilities div {
  min-width: 0;
  border: 1px solid rgba(199, 209, 223, .78);
  border-radius: 4px;
  padding: 14px;
  background: rgba(255, 255, 255, .76);
}
.official-capabilities b {
  display: block;
  color: #101828;
  font-size: 15px;
  margin-bottom: 5px;
}
.official-capabilities span {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}
.official-visual {
  display: grid;
  gap: 10px;
  max-width: 560px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid rgba(199, 209, 223, .9);
  border-radius: 4px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 22px 42px rgba(16, 24, 40, .09);
}
.visual-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 4px;
}
.visual-title b {
  color: #101828;
  font-size: 14px;
}
.visual-title span {
  color: #667085;
  font-size: 12px;
}
.visual-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fbfdff;
}
.visual-row.primary {
  border-color: rgba(32, 115, 72, .32);
  background: #f4fbf6;
}
.visual-row span {
  color: #667085;
  font-size: 12px;
}
.visual-row b {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visual-row em {
  color: var(--green);
  font-style: normal;
  font-size: 12px;
  font-weight: 760;
  text-align: right;
}
.official-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 760px;
  margin: 0;
}
.official-facts div {
  min-width: 0;
  border-left: 3px solid var(--green);
  border-radius: 0 4px 4px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .72);
}
.official-facts dt {
  color: #667085;
  font-size: 12px;
}
.official-facts dd {
  margin: 4px 0 0;
  color: #1f2937;
  font-weight: 760;
  word-break: break-all;
}
.site-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 18px 20px 24px;
  color: #667085;
  font-size: 13px;
}
.site-footer a {
  color: var(--blue);
  text-decoration: none;
}
.tabs .tab {
  width: auto;
  min-width: 68px;
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line);
  padding: 8px 12px;
  min-height: 40px;
}
.tabs .tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.auth-panel {
  min-height: calc(100vh - 73px);
  display: grid;
  place-items: center;
  padding: 32px 18px;
}
.auth-card {
  width: min(560px, 100%);
  border-color: rgba(199, 209, 223, .95);
  box-shadow: 0 18px 40px rgba(16, 24, 40, .12);
}
.public-entry:not(.authenticated) .auth-card {
  margin-top: 118px;
  padding: 24px;
  border-top: 4px solid #2d63f0;
  background: rgba(255, 255, 255, .94);
}
.public-entry:not(.authenticated) .auth-card h2 {
  margin-bottom: 16px;
  font-size: 18px;
}
.public-entry:not(.authenticated) .auth-mode {
  gap: 8px;
}
.public-entry:not(.authenticated) .auth-mode button {
  border-radius: 6px;
}
.public-entry:not(.authenticated) #loginBtn {
  min-height: 46px;
}
.app-shell.hidden, .hidden { display: none; }
.app-shell {
  max-width: 1680px;
  margin: 0 auto;
}
.auth-mode {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.auth-mode button {
  background: var(--panel-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}
.auth-mode button.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.register-fields {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
.view { display: none; }
.active-view { display: block; }
.copy-line {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px;
  word-break: break-all;
  background: #f9fafb;
  font-size: 12px;
}
.sense {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}
.sense.matched {
  border-color: rgba(36, 122, 77, .45);
  background: rgba(36, 122, 77, .06);
}
.sense b { display: block; font-size: 13px; margin-bottom: 4px; }
.sense span { color: var(--blue); font-size: 12px; }
.sense p { font-size: 12px; line-height: 1.45; }
.layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(430px, 1fr) minmax(360px, 420px);
  gap: 16px;
  padding: 16px;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  max-width: 1680px;
  margin: 0 auto;
}
.admin-page {
  background: #eef3f8;
  --blue: #138fe6;
  --blue-dark: #0877c9;
  --blue-soft: #eaf6ff;
  --line: #e1e7ef;
  --line-strong: #cfd8e4;
}
.admin-page .admin-topbar {
  min-height: 72px;
  padding: 0 28px;
  color: #fff;
  background: var(--blue);
  border-bottom: 0;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .08);
}
.admin-page .admin-topbar h1 {
  font-size: 23px;
  font-weight: 760;
  color: #fff;
}
.admin-page .admin-topbar p {
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-logo {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 6px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.admin-page .admin-topbar nav {
  gap: 4px;
}
.admin-page .admin-topbar nav a {
  color: #fff;
  background: transparent;
  border-color: transparent;
  border-radius: 4px;
}
.admin-page .admin-topbar nav a:hover {
  background: rgba(255, 255, 255, .16);
}
.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}
.admin-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fff;
}
.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
}
.admin-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 20px;
  color: #303a49;
  text-decoration: none;
  border-left: 4px solid transparent;
  font-size: 15px;
  font-weight: 650;
}
.admin-menu a span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  color: #3f4a5a;
}
.admin-menu a.active,
.admin-menu a:hover {
  color: #fff;
  border-left-color: #0b68b5;
  background: var(--blue);
}
.admin-menu a.active span,
.admin-menu a:hover span {
  color: #fff;
}
.admin-page .admin-content {
  max-width: none;
  margin: 0;
  padding: 16px 28px 40px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}
.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.admin-page-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}
.admin-page-head p {
  margin: 0;
}
.admin-head-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--blue);
  text-decoration: none;
  background: #fff;
  font-weight: 700;
}
.admin-page .admin-content .panel {
  grid-column: span 6;
  border-radius: 6px;
  box-shadow: none;
}
.admin-page .admin-content .wide,
.admin-page .admin-page-head {
  grid-column: 1 / -1;
}
.admin-section {
  display: none;
}
.admin-section.is-active {
  display: block;
}
.admin-page .panel h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: #273142;
  font-size: 16px;
  font-weight: 760;
}
.admin-page .panel h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--blue);
}
.admin-page .actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.admin-page .summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.admin-page .metric {
  min-height: 76px;
  background: #fbfdff;
}
.admin-page .metric.ok { background: #eefbf5; }
.admin-page .metric.warn { background: #fff8ed; }
.admin-page .metric.block { background: #fff3f3; }
#customer-workbench { order: 1; }
#billing-center { order: 2; }
#insforge-ops { order: 3; }
#admin-users-section { order: 4; }
#admin-create-section { order: 5; }
#invite-section { order: 6; }
#profile-section { order: 7; }
#tenant-section { order: 8; }
#query-assets-section { order: 9; }
#query-stats-section { order: 10; }
#admin-session-section { order: 4; }
.login-grid {
  grid-template-columns: minmax(280px, 520px);
  justify-content: center;
  padding-top: 44px;
  width: min(100%, 600px);
}
.wide { grid-column: 1 / -1; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.notice-box {
  border: 1px solid #bfd7ec;
  background: #f2f8fd;
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 14px;
}
.notice-box.compact { padding: 10px; }
.notice-box b {
  display: block;
  color: var(--blue);
  margin-bottom: 6px;
}
.notice-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(25, 91, 143, .18);
  border-color: var(--blue);
}
textarea { min-height: 88px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compact-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.check input { width: auto; margin: 0; }
.check-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.check-row .check { margin-bottom: 0; }
.help-popover { position: relative; }
.help-popover summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.help-popover summary::-webkit-details-marker { display: none; }
.help-popover div {
  position: absolute;
  left: 50%;
  top: 28px;
  z-index: 20;
  width: min(300px, calc(100vw - 48px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(16, 24, 40, .16);
}
.help-popover div b {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}
.help-popover div p {
  font-size: 12px;
  line-height: 1.55;
}
button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 10px 13px;
  font-weight: 650;
  cursor: pointer;
  min-height: 40px;
  letter-spacing: 0;
}
button:disabled { opacity: .72; cursor: progress; }
button:hover:not(:disabled) { background: var(--blue-dark); }
button.secondary {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line);
}
.actions a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
  text-decoration: none;
  font-weight: 650;
  padding: 10px 13px;
}
button.secondary:hover:not(:disabled),
nav a:hover,
.actions a.secondary:hover {
  background: var(--blue-soft);
}
.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.batch-learn-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(280px, .9fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}
.large-input { min-height: 150px; }
.status-line {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  line-height: 1.55;
}
.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr);
  gap: 12px;
  margin-top: 14px;
}
.ops-layout h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.ops-filters { margin-top: 12px; }
.metric {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  min-height: 64px;
  background: #fff;
}
.metric b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.metric span { font-size: 18px; font-weight: 700; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  margin: 2px 4px 2px 0;
  background: var(--panel-soft);
}
.ok { color: var(--green); background: var(--green-soft); border-color: rgba(32, 115, 72, .2); }
.warn { color: var(--amber); background: var(--amber-soft); border-color: rgba(140, 97, 0, .2); }
.block { color: var(--red); background: var(--red-soft); border-color: rgba(180, 35, 24, .2); }
.muted {
  color: var(--muted);
  font-size: 12px;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.inline-number {
  width: 120px;
  min-height: 32px;
  padding: 7px 9px;
}
button.small {
  width: auto;
  padding: 7px 9px;
  font-size: 12px;
  white-space: nowrap;
}
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.empty-state {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--panel-soft); color: var(--muted); font-weight: 700; }
tbody tr:hover { background: #fbfdff; }
pre {
  margin: 0;
  overflow: auto;
  max-height: 520px;
  padding: 12px;
  background: #101828;
  color: #e4e7ec;
  border-radius: 6px;
  font-size: 12px;
}
.trace-block { margin-bottom: 14px; }
.trace-block h3 { color: var(--blue); }
.term-line { margin-top: 8px; }
.analyze-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.flow-step {
  position: relative;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  overflow: hidden;
  background: #fff;
}
.flow-step::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(25, 91, 143, .12), transparent);
  transform: translateX(-100%);
}
.analyze-flow.active .flow-step::after {
  animation: scan 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * .18s);
}
.flow-step span {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  margin-bottom: 8px;
}
.analyze-flow.active .flow-step span {
  animation: pulse 1.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * .16s);
}
.flow-step b { font-size: 13px; }
@keyframes scan {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}
@keyframes pulse {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.18); }
}
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.api-doc-surface {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.api-doc-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.api-doc-title h2 { margin: 0; }
.api-doc-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.api-doc-title > span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #bfd7ec;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  white-space: nowrap;
}
.api-doc-overview {
  display: grid;
  gap: 10px;
}
.api-doc-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.api-doc-overview div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfd;
}
.api-doc-overview b {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.api-doc-overview span {
  display: block;
  color: var(--blue);
  font-weight: 750;
  overflow-wrap: anywhere;
}
.api-doc-overview p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.api-field-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.api-field-list-head,
.api-field-row {
  display: grid;
  gap: 10px;
  align-items: start;
  min-width: 0;
}
.api-field-list-4 .api-field-list-head,
.api-field-list-4 .api-field-row {
  grid-template-columns: 110px minmax(150px, 220px) 86px minmax(0, 1fr);
}
.api-field-list-3 .api-field-list-head,
.api-field-list-3 .api-field-row {
  grid-template-columns: 130px minmax(170px, 260px) minmax(0, 1fr);
}
.api-field-list-head {
  padding: 8px 12px;
  background: #f3f7fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.api-field-row {
  padding: 9px 12px;
  border-bottom: 1px solid #edf2f7;
}
.api-field-row:last-child { border-bottom: 0; }
.api-field-row b {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.api-field-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.api-field-type {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: #5f6f84;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.api-docs code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 5px;
  border: 1px solid #d7e6f3;
  border-radius: 5px;
  background: #eef6ff;
  color: #195b8f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.api-doc-section-block { margin-top: 18px; }
.api-doc-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.api-doc-section-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}
.api-doc-section-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}
.api-console-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}
.api-console-head label { margin-bottom: 0; }
.api-console-head button { align-self: end; }
.api-evidence-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #f9fafb;
}
.api-evidence-box .check { font-size: 12px; }
.api-window-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.api-window {
  min-height: 320px;
  max-height: 520px;
  white-space: pre-wrap;
}
details summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  margin-top: 6px;
}
details pre {
  max-width: 680px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 6px;
  padding: 10px;
  font-size: 11px;
}
@media (max-width: 1100px) {
  .site-top {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
    padding: 14px 20px;
  }
  .site-top nav {
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    overflow-x: auto;
  }
  .site-top nav a {
    flex: 0 0 auto;
  }
  .site-top nav a.active::after {
    bottom: -5px;
  }
  .site-login {
    position: static;
  }
  .site-auth-actions {
    position: absolute;
    top: 26px;
    right: 20px;
    gap: 14px;
  }
  .clean-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 72px 28px 54px;
  }
  .clean-strip,
  .site-card-grid {
    grid-template-columns: 1fr;
  }
  .official-entry {
    grid-template-columns: 1fr;
    max-width: 760px;
    min-height: auto;
    padding: 72px 24px 40px;
  }
  .official-hero h2 {
    font-size: 44px;
  }
  .official-capabilities,
  .official-facts {
    grid-template-columns: 1fr;
  }
  .layout, .admin-grid { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: sticky;
    top: 72px;
    z-index: 20;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .admin-menu {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .admin-menu a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    border-left: 0;
    border-radius: 5px;
  }
  .admin-page .admin-content {
    padding: 14px;
    grid-template-columns: 1fr;
  }
  .admin-page .admin-content .panel {
    grid-column: 1 / -1;
  }
  .batch-learn-layout { grid-template-columns: 1fr; }
  .analyze-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .api-doc-overview,
  .api-console-head,
  .api-window-grid {
    grid-template-columns: 1fr;
  }
  .api-doc-title,
  .api-doc-section-head {
    display: block;
  }
  .api-doc-title > span {
    display: inline-block;
    margin-top: 10px;
    white-space: normal;
  }
  .api-doc-section-head p {
    margin-top: 6px;
    text-align: left;
  }
}

@media (max-width: 720px) {
  body { min-width: 0; }
  .site-brand span {
    width: 48px;
    height: 48px;
  }
  .site-brand strong {
    font-size: 22px;
  }
  .clean-hero {
    padding: 44px 10px 34px;
  }
  .clean-hero h1,
  .site-section-page h1 {
    font-size: 38px;
  }
  .lead {
    margin-top: 24px;
    font-size: 15px;
  }
  .clean-actions {
    flex-wrap: wrap;
    margin-top: 30px;
  }
  .clean-actions a {
    min-width: 138px;
  }
  .clean-hero-panel {
    padding: 10px;
  }
  .clean-hero-panel div {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 10px 12px;
  }
  .clean-strip,
  .site-section-page {
    padding-right: 10px;
    padding-left: 10px;
  }
  .clean-strip {
    margin: 34px auto;
  }
  .topbar {
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    flex-direction: column;
  }
  .public-entry:not(.authenticated) .official-topbar {
    padding: 12px;
  }
  .official-brand {
    width: 100%;
  }
  .public-nav {
    width: 100%;
    overflow-x: auto;
    gap: 18px;
  }
  .public-nav a {
    flex: 0 0 auto;
    min-height: 34px;
    font-size: 14px;
  }
  .public-nav a.active::after {
    bottom: -4px;
  }
  .topbar > div { width: 100%; }
  .topbar nav,
  .tabs {
    width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .admin-page .topbar {
    gap: 10px;
    padding: 12px;
  }
  .admin-page .admin-topbar h1 {
    font-size: 20px;
  }
  .admin-logo {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .admin-sidebar {
    top: 112px;
  }
  .admin-page-head {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }
  .admin-head-action {
    width: 100%;
  }
  nav a,
  .tabs .tab,
  .tabs button,
  #logoutBtn {
    flex: 0 0 auto;
    min-width: 68px;
    white-space: nowrap;
  }
  .auth-panel {
    min-height: calc(100vh - 132px);
    place-items: start stretch;
    padding: 12px;
  }
  .official-entry {
    gap: 18px;
    padding: 34px 12px 24px;
  }
  .official-hero h2 {
    font-size: 38px;
  }
  .official-hero > p {
    font-size: 14px;
  }
  .hero-brand {
    font-size: 24px;
  }
  .hero-line {
    font-size: 23px;
  }
  .hero-line b {
    min-height: 36px;
    font-size: 20px;
  }
  .public-entry:not(.authenticated) .auth-card {
    margin-top: 10px;
  }
  .official-visual {
    padding: 10px;
  }
  .visual-row {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 44px;
  }
  .visual-row em {
    grid-column: 2;
    text-align: left;
  }
  .site-footer {
    align-items: center;
    flex-direction: column;
    gap: 6px;
    padding: 14px 12px 20px;
  }
  .auth-card { width: 100%; }
  .layout,
  .admin-grid,
  .app-shell {
    padding: 12px;
  }
  .panel {
    padding: 12px;
    border-radius: 6px;
  }
  .api-doc-surface { padding: 12px; }
  .api-field-list-head { display: none; }
  .api-field-list-4 .api-field-row {
    grid-template-columns: minmax(92px, .8fr) minmax(0, 1.2fr);
    grid-template-areas:
      "label field"
      "type desc";
  }
  .api-field-list-3 .api-field-row {
    grid-template-columns: minmax(92px, .8fr) minmax(0, 1.2fr);
    grid-template-areas:
      "label field"
      "desc desc";
  }
  .api-field-row b { grid-area: label; }
  .api-field-row code { grid-area: field; }
  .api-field-type { grid-area: type; }
  .api-field-row p { grid-area: desc; }
  .api-field-row {
    gap: 5px 10px;
    padding: 8px 10px;
  }
  .api-field-row code {
    justify-self: start;
  }
  .grid2,
  .summary,
  .ops-layout,
  .admin-page .summary,
  .metrics,
  .actions,
  .auth-mode,
  .api-evidence-box {
    grid-template-columns: 1fr;
  }
  .actions button,
  .actions a,
  button {
    min-height: 42px;
  }
  input,
  select,
  textarea {
    min-height: 42px;
    padding: 10px 11px;
  }
  textarea { min-height: 96px; }
  .table-wrap {
    width: 100%;
    overflow-x: auto;
  }
  table { min-width: 620px; }
  .summary .metric,
  .metric { min-height: auto; }
  .api-window {
    min-height: 220px;
    max-height: 360px;
  }
  .analyze-flow { grid-template-columns: 1fr; }
  .help-popover div {
    left: auto;
    right: 0;
    transform: none;
  }
}

@media (max-width: 420px) {
  .topbar h1 { font-size: 20px; }
  .topbar p,
  label,
  table,
  .status-line {
    font-size: 12px;
  }
  .layout,
  .admin-grid,
  .app-shell,
  .auth-panel {
    padding: 10px;
  }
  .panel { padding: 10px; }
  table { min-width: 560px; }
  th,
  td { padding: 8px; }
  .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  button.small { width: 100%; }
  .api-field-list-4 .api-field-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "field"
      "type"
      "desc";
  }
  .api-field-list-3 .api-field-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "field"
      "desc";
  }
}
