:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --line: #d8e0e7;
  --text: #17212b;
  --muted: #657382;
  --accent: #0e766e;
  --accent-2: #224e77;
  --danger: #b42318;
  --warning: #9a6700;
  --ok: #0f7a3a;
  --shadow: 0 10px 28px rgba(22, 34, 45, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body.is-busy::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: 4000;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #d7e5ec, var(--accent), #d7e5ec);
  background-size: 220% 100%;
  animation: page-loading-bar 1.1s linear infinite;
}

button, input, select {
  font: inherit;
}

@keyframes page-loading-bar {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 220% 0;
  }
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-screen.hidden + .app-shell {
  display: grid;
}

.login-screen:not(.hidden) + .app-shell {
  display: none;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-panel p {
  color: var(--muted);
}

.login-brand {
  padding: 0 0 8px;
}

.wide-button {
  width: 100%;
}

.site-placeholder {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.site-placeholder-inner {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.site-placeholder-inner h1 {
  font-size: 32px;
}

.site-placeholder-inner p {
  color: var(--muted);
}

.us-home {
  background: #f7f9fc;
  color: #111827;
}

.us-home .public-nav {
  background: rgba(247, 249, 252, 0.94);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.us-home .public-links a {
  color: #334155;
}

.us-home .public-links a:hover {
  background: #e8eef5;
}

.us-home .nav-login,
.us-home .primary-button {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.us-home .nav-login:hover,
.us-home .primary-button:hover {
  background: #115e59;
}

.us-hero {
  position: relative;
  overflow: hidden;
  padding: 78px 0 70px;
  border-bottom: 1px solid #dbe3ea;
  background: #f7f9fc;
}

.us-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 22%, rgba(15, 118, 110, 0.14), transparent 30%),
    radial-gradient(circle at 78% 14%, rgba(37, 99, 235, 0.11), transparent 28%),
    linear-gradient(rgba(37, 99, 235, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.055) 1px, transparent 1px);
  background-size: auto, auto, 58px 58px, 58px 58px;
}

.us-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.88fr);
  gap: clamp(34px, 6vw, 72px);
  align-items: center;
}

.us-hero-copy h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  color: #0f172a;
  font-size: clamp(44px, 5.6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.us-hero-copy .hero-lead {
  max-width: 700px;
  color: #475569;
  font-size: 18px;
  line-height: 1.75;
}

.us-home .hero-secondary {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.26);
  background: rgba(255, 255, 255, 0.8);
}

.us-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}

.us-metrics div {
  padding: 15px;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

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

.us-metrics strong {
  color: #0f172a;
  font-size: 22px;
}

.us-metrics span {
  margin-top: 5px;
  color: #64748b;
  line-height: 1.45;
}

.us-home .risk-console.us-intel-card {
  position: static;
  width: 100%;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
}

.us-home .console-toolbar {
  color: #64748b;
}

.us-home .console-toolbar span {
  background: #bac6d3;
}

.us-risk-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  background: #f8fafc;
}

.us-risk-score span,
.us-risk-score strong {
  display: block;
}

.us-risk-score span {
  color: #64748b;
  font-weight: 800;
}

.us-risk-score strong {
  margin-top: 5px;
  color: #b45309;
  font-size: 22px;
}

.us-risk-score b {
  display: inline-flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: #b45309;
  font-size: 28px;
}

.us-home .console-row {
  border-color: #d7e0e7;
  background: #ffffff;
}

.us-home .console-row em {
  color: #64748b;
}

.us-decision-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.us-decision-list div {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #334155;
}

.us-decision-list span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0f766e;
}

.us-section {
  background: #ffffff;
}

.us-home .section-heading {
  max-width: 820px;
}

.us-card-grid {
  display: grid;
  gap: 16px;
}

.us-card-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.us-card-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.us-card-grid article,
.us-card-grid div {
  min-width: 0;
  padding: 22px;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.055);
}

.us-card-grid h3,
.us-card-grid strong {
  display: block;
  margin: 0 0 9px;
  color: #0f172a;
  font-size: 18px;
}

.us-card-grid p,
.us-card-grid span {
  color: #566579;
  line-height: 1.7;
}

.us-platform {
  background: #eef3f7;
}

.us-split,
.us-dark-grid,
.us-cta-card {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: 40px;
  align-items: center;
}

.us-split p,
.us-dark-grid p,
.us-cta-card p {
  color: #566579;
  line-height: 1.75;
}

.us-stack,
.us-trust-list {
  display: grid;
  gap: 12px;
}

.us-stack div,
.us-trust-list div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  background: #ffffff;
}

.us-stack span {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dff4ef;
  color: #0f766e;
  font-weight: 850;
}

.us-stack strong,
.us-trust-list strong {
  color: #0f172a;
  font-size: 17px;
}

.us-stack p,
.us-trust-list span {
  grid-column: 2;
  margin: 4px 0 0;
  color: #566579;
  line-height: 1.6;
}

.us-dark {
  background: #0f172a;
  color: #ffffff;
}

.us-dark h2,
.us-dark .us-trust-list strong {
  color: #ffffff;
}

.us-dark .eyebrow {
  color: #7dd3c7;
}

.us-dark-grid p,
.us-dark .us-trust-list span {
  color: #c7d2df;
}

.us-dark .us-trust-list div {
  border-color: rgba(203, 213, 225, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.us-final-cta {
  padding: 54px 0;
  background: #f7f9fc;
}

.us-cta-card {
  padding: 30px;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
}

.us-cta-card .primary-button {
  justify-self: end;
}

.us-footer {
  padding: 42px 0;
  background: #0b1220;
  color: #dbe5ef;
}

.us-footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(140px, 1fr));
  gap: 28px;
}

.us-footer .brand-title,
.us-footer .brand-subtitle {
  color: #ffffff;
}

.us-footer p {
  max-width: 420px;
  color: #aab8c7;
  line-height: 1.7;
}

.us-footer strong,
.us-footer a,
.us-footer span {
  display: block;
}

.us-footer strong {
  margin-bottom: 10px;
  color: #ffffff;
}

.us-footer a,
.us-footer span {
  margin-top: 8px;
  color: #aab8c7;
  text-decoration: none;
}

.us-footer a:hover {
  color: #ffffff;
}

@media (max-width: 960px) {
  .us-hero-grid,
  .us-split,
  .us-dark-grid,
  .us-cta-card,
  .us-footer-grid {
    grid-template-columns: 1fr;
  }

  .us-card-grid.four,
  .us-card-grid.three,
  .us-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .us-cta-card .primary-button {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .us-hero {
    padding: 42px 0 34px;
  }

  .us-hero-copy h1 {
    font-size: 39px;
  }

  .us-hero-copy .hero-lead {
    font-size: 15px;
  }

  .us-card-grid.four,
  .us-card-grid.three,
  .us-metrics {
    grid-template-columns: 1fr;
  }

  .us-metrics {
    display: none;
  }

  .us-risk-score b {
    width: 58px;
    height: 58px;
    font-size: 23px;
  }

  .us-stack div,
  .us-trust-list div {
    grid-template-columns: 1fr;
  }

  .us-stack p,
  .us-trust-list span {
    grid-column: auto;
  }
}

.public-site {
  background: #f6f8fb;
  color: #13212b;
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(246, 248, 251, 0.92);
  border-bottom: 1px solid rgba(28, 42, 58, 0.1);
  backdrop-filter: blur(14px);
}

.public-brand {
  color: inherit;
  text-decoration: none;
}

.public-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-links a {
  color: #344655;
  text-decoration: none;
  font-weight: 750;
  padding: 9px 10px;
  border-radius: 6px;
}

.public-links a:hover {
  background: #e8efed;
}

.public-links .nav-login {
  color: #ffffff;
  background: #126b75;
  padding-inline: 14px;
}

.public-links .nav-login:hover {
  background: #0f5962;
}

.public-container {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

.public-hero {
  position: relative;
  min-height: clamp(540px, calc(100vh - 150px), 620px);
  display: grid;
  align-items: center;
  overflow: hidden;
  background: #f6f8fb;
  color: #13212b;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.92;
}

.network-grid {
  position: absolute;
  inset: 0;
  background-color: #f6f8fb;
  background-image:
    linear-gradient(rgba(34, 78, 119, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 78, 119, 0.07) 1px, transparent 1px);
  background-size: 58px 58px;
}

.network-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 28%, rgba(18, 107, 117, 0.14), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(34, 78, 119, 0.12), transparent 30%),
    linear-gradient(90deg, rgba(246, 248, 251, 0.25), rgba(246, 248, 251, 0.92) 72%);
}

.risk-console {
  position: absolute;
  right: clamp(20px, 8vw, 120px);
  bottom: clamp(36px, 9vw, 92px);
  width: min(520px, 48vw);
  padding: 16px;
  border: 1px solid rgba(31, 49, 66, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 64px rgba(19, 33, 43, 0.14);
  backdrop-filter: blur(18px);
}

.console-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6a7a86;
  margin-bottom: 14px;
}

.console-toolbar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a7b3bb;
}

.console-toolbar strong {
  margin-left: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.console-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  padding: 12px;
  margin-top: 9px;
  border: 1px solid rgba(31, 49, 66, 0.1);
  border-radius: 6px;
}

.console-row span {
  font-weight: 800;
}

.console-row b {
  justify-self: end;
}

.console-row em {
  grid-column: 1 / -1;
  color: #667886;
  font-style: normal;
}

.console-row.high b {
  color: #b45309;
}

.console-row.clean b {
  color: #0f7a3a;
}

.console-code {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  background: #071119;
  color: #c6d7de;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.intel-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 12px;
  border: 1px solid rgba(31, 49, 66, 0.1);
  border-radius: 6px;
  background: rgba(244, 248, 250, 0.8);
}

.intel-score span {
  color: #657382;
  font-weight: 800;
}

.intel-score strong {
  color: #126b75;
  font-size: 22px;
}

.intel-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.intel-metrics div {
  padding: 11px;
  border: 1px solid rgba(31, 49, 66, 0.1);
  border-radius: 6px;
  background: rgba(244, 248, 250, 0.72);
}

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

.intel-metrics strong {
  color: #13212b;
  font-size: 18px;
}

.intel-metrics span {
  margin-top: 5px;
  color: #667886;
  font-size: 12px;
  line-height: 1.45;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 72px 0 84px;
}

.hero-content h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 690px;
  color: #52616f;
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions,
.hero-proof {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 26px;
}

.hero-secondary {
  color: #224e77;
  border-color: rgba(34, 78, 119, 0.24);
  background: rgba(255, 255, 255, 0.72);
}

.hero-proof {
  color: #52616f;
  margin-top: 22px;
}

.hero-proof span {
  padding: 7px 10px;
  border: 1px solid rgba(34, 78, 119, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.public-section h2 {
  margin: 8px 0 10px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.15;
}

.section-heading p,
.value-layout p,
.why-layout p,
.cta-box p {
  color: #596a76;
  line-height: 1.75;
}

.public-section {
  padding: 76px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

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

.audience-grid article,
.outcome-grid div,
.decision-panel div,
.why-list div,
.cta-box {
  min-width: 0;
  padding: 20px;
  border: 1px solid #d5e0e2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 39, 48, 0.06);
}

.audience-grid h3,
.decision-panel strong,
.outcome-grid strong,
.why-list strong {
  display: block;
  margin: 0 0 8px;
  font-size: 18px;
}

.audience-grid p,
.decision-panel p,
.outcome-grid span,
.why-list span {
  color: #5b6c78;
  line-height: 1.7;
}

.value-section,
.why-section {
  background: #eef3f7;
}

.value-layout,
.why-layout,
.cta-box {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 34px;
  align-items: center;
}

.decision-panel,
.why-list {
  display: grid;
  gap: 12px;
}

.decision-panel div,
.why-list div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  box-shadow: none;
}

.decision-panel span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e4f3ef;
  color: #0e766e;
  font-weight: 850;
}

.outcome-section {
  background: #ffffff;
}

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

.outcome-grid div {
  border-left: 4px solid #0e766e;
}

.why-list div {
  grid-template-columns: 82px minmax(0, 1fr);
}

.why-list strong {
  color: #0e766e;
}

.cta-section {
  padding-top: 34px;
  background: #10202b;
}

.cta-box {
  background: #ffffff;
  color: #13212b;
}

.cta-box h2 {
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .public-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-links {
    justify-content: flex-start;
  }

  .public-hero {
    min-height: auto;
  }

  .risk-console {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(100%, 540px);
    margin: 0 auto 34px;
  }

  .hero-backdrop {
    position: relative;
    display: grid;
    order: 2;
    padding: 0 18px 34px;
  }

  .hero-content {
    padding: 48px 0 28px;
  }

  .value-layout,
  .why-layout,
  .cta-box,
  .audience-grid,
  .outcome-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .public-nav {
    gap: 12px;
    padding: 12px 18px;
  }

  .public-links a {
    padding-inline: 8px;
  }

  .hero-content h1 {
    font-size: 31px;
  }

  .hero-lead {
    font-size: 15px;
    line-height: 1.65;
  }

  .hero-proof,
  .intel-metrics {
    display: none;
  }

  .risk-console {
    padding: 12px;
    margin-bottom: 14px;
  }

  .console-row {
    padding: 9px;
  }

  .console-row em {
    display: none;
  }

  .intel-score {
    padding: 10px;
  }

  .intel-score strong {
    font-size: 18px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .decision-panel div,
  .why-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.site-brand {
  padding: 0 0 8px;
}

.form-error {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #f2b8ad;
  background: #fff0ed;
  color: var(--danger);
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #14202b;
  color: #dce8f2;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #19a295;
  color: #ffffff;
  font-weight: 800;
}

.brand-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-subtitle {
  color: #92a3b2;
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: #bccbd7;
  background: transparent;
  display: flex;
  align-items: center;
  cursor: pointer;
  text-align: left;
}

.nav-item b {
  font-weight: 650;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  background: #203140;
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 22px 28px 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  margin-bottom: 18px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

#pageSubtitle {
  color: var(--muted);
  margin-top: 5px;
}

.top-actions,
.inline-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--accent-2);
  border: 1px solid var(--line);
  font-weight: 650;
}

.icon-button,
.text-button,
.tool-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: keep-all;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  font-size: 17px;
}

.text-button {
  height: 32px;
  padding: 0 11px;
}

.text-button.danger {
  border-color: #f2b8b5;
  color: var(--danger);
}

.text-button.copied,
.tool-button.copied {
  border-color: #bfe4cc;
  background: #eaf8ef;
  color: var(--ok);
}

.tool-button {
  height: 36px;
  min-width: 64px;
  padding: 0 12px;
  background: var(--surface);
  font-weight: 650;
}

.primary-button {
  height: 36px;
  min-width: 88px;
  padding: 0 12px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.icon-button:hover,
.text-button:hover,
.tool-button:hover {
  background: var(--surface-2);
}

.icon-button:disabled,
.text-button:disabled,
.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.primary-button.is-loading,
.text-button.is-loading,
.tool-button.is-loading {
  cursor: progress;
}

.primary-button.is-loading::after,
.text-button.is-loading::after,
.tool-button.is-loading::after {
  content: "...";
  display: inline-block;
  width: 12px;
  margin-left: 2px;
  text-align: left;
  animation: button-loading-dots 1.1s steps(4, end) infinite;
}

.primary-button.is-loading::before,
.text-button.is-loading::before,
.tool-button.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  vertical-align: -2px;
  animation: button-loading-spin 0.75s linear infinite;
}

@keyframes button-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes button-loading-dots {
  0% {
    width: 0;
  }
  100% {
    width: 12px;
  }
}

.primary-button:hover {
  background: #0b625b;
}

.primary-button:disabled,
.primary-button[disabled] {
  border-color: #cfd9e3;
  background: #e5ebf1;
  color: #718096;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-button:disabled:hover,
.primary-button[disabled]:hover {
  background: #e5ebf1;
}

.primary-button.secondary {
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.primary-button.secondary:hover {
  background: #1a3f60;
}

.alert {
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: #fff7e5;
  color: var(--warning);
}

.alert.error {
  background: #fff0ed;
  color: var(--danger);
  border-color: #f2b8ad;
}

.alert.success {
  background: #eaf8ef;
  color: var(--ok);
  border-color: #b9e5c7;
}

.hidden {
  display: none !important;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metrics-wide {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
  min-height: 92px;
}

.metric span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.metric strong {
  font-size: 28px;
  line-height: 1;
}

.metric small {
  display: block;
  color: var(--muted);
  margin-top: 10px;
}

.split,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

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

.panel {
  min-width: 0;
  padding: 16px;
}

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

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.list-header p {
  color: var(--muted);
  margin-top: 6px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.list-toolbar .inline-tools {
  width: 100%;
  max-width: none;
  flex-wrap: wrap;
}

.list-toolbar .input:not(.compact) {
  flex: 1 1 auto;
  width: auto;
}

.header-actions {
  justify-content: flex-end;
}

.side-panel {
  align-self: start;
}

.table-wrap {
  overflow: auto;
  min-height: 90px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  background: #fbfcfd;
}

td {
  color: #24313d;
}

th.action-col,
td.action-col {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #ffffff;
  box-shadow: -8px 0 14px rgba(22, 34, 45, 0.06);
}

th.action-col {
  z-index: 2;
  background: #fbfcfd;
}

.wrap-cell {
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.muted-small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
  white-space: normal;
}

.entity-ref {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.entity-ref strong {
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.entity-ref span {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  color: var(--muted);
  padding: 18px 4px;
}

.empty-state {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 22px 4px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 15px;
}

.section-note {
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
}

.section-note strong {
  color: var(--text);
}

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

.insight-card,
.account-card,
.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.insight-card,
.account-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  min-width: 0;
}

.insight-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.insight-title h2 {
  font-size: 15px;
}

.insight-title span,
.account-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.insight-main,
.account-card strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.insight-card p,
.account-card p,
.plan-card p {
  color: var(--muted);
  line-height: 1.55;
}

.trend-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.trend-row:first-child {
  border-top: 0;
}

.trend-row span,
.trend-row small {
  color: var(--muted);
}

.setup-steps {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.setup-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.setup-steps li span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.setup-steps li strong {
  font-size: 13px;
}

.setup-steps li small {
  color: var(--muted);
}

.setup-steps li.done span {
  background: #eaf8ef;
  color: var(--ok);
}

.setup-steps li.current {
  border-color: #b7d6e4;
  background: #f4fafc;
}

.setup-steps li.current span {
  background: #dff0f5;
  color: var(--accent-2);
}

.plan-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
}

.plan-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  flex: 0 1 360px;
  width: min(360px, 100%);
  gap: 16px;
  min-height: 430px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  border-color: #cfdbe5;
}

.plan-card:hover {
  border-color: #8fb8c7;
  box-shadow: 0 14px 34px rgba(22, 34, 45, 0.12);
}

.custom-plan-card {
  border-color: #b8c7d8;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
}

.custom-plan-card .plan-credits {
  background: #eef3f8;
  border-color: #d4e0ec;
}

.custom-plan-card .plan-credits span {
  color: #405d78;
}

.custom-plan-credits strong {
  font-size: 28px;
  letter-spacing: 0;
}

.plan-card-head {
  display: grid;
  gap: 8px;
}

.plan-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.plan-price strong {
  font-size: 34px;
  line-height: 1;
}

.plan-price span {
  color: var(--muted);
  font-weight: 750;
}

.plan-credits {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  background: #edf7f5;
  border: 1px solid #c9e8e3;
}

.plan-credits strong {
  font-size: 28px;
  line-height: 1;
}

.plan-credits span {
  color: #32635e;
  font-size: 12px;
  font-weight: 750;
}

.plan-card dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.plan-card dl div,
.payment-highlight div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.plan-card dt,
.payment-highlight span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.plan-card dd {
  margin: 0;
  font-weight: 750;
}

.plan-buy-button {
  width: 100%;
}

.payment-highlight {
  display: grid;
  gap: 0;
}

.payment-highlight strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.purchase-note {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #f0cf78;
  border-radius: 8px;
  background: #fff8df;
}

.purchase-note strong {
  color: var(--text);
}

.purchase-note p {
  color: #654400;
  line-height: 1.55;
}

.account-card.wide {
  grid-column: span 2;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status.ok {
  background: #eaf8ef;
  color: var(--ok);
}

.status.warn {
  background: #fff7e5;
  color: var(--warning);
}

.status.bad {
  background: #fff0ed;
  color: var(--danger);
}

.form {
  display: grid;
  gap: 11px;
}

.confirm-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.confirm-summary div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.confirm-summary div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.confirm-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.confirm-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.input {
  width: 100%;
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 118, 110, 0.12);
}

.input.compact {
  width: 130px;
}

.input.user-filter {
  width: 260px;
}

.input.wide-filter {
  width: 220px;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text) !important;
  font-size: 14px !important;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.secret-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #f0cf78;
  background: #fff8df;
  color: #654400;
  overflow-wrap: anywhere;
}

.security-panel {
  margin-top: 16px;
}

.security-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.security-card.enabled {
  border-color: #bfe4cc;
  background: #f3fbf6;
}

.security-card p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 8px;
}

.security-state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.security-actions {
  flex: 0 0 auto;
}

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

.source-health-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.source-health-card.ok {
  border-color: #bfe4cc;
  background: #f6fcf8;
}

.source-health-card.warn {
  border-color: #f0cf78;
  background: #fffaf0;
}

.source-health-card.bad {
  border-color: #f2b8ad;
  background: #fff7f5;
}

.lookup-loaded-panel {
  display: grid;
  margin: 0 0 14px;
  min-width: 0;
}

.lookup-loaded-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.lookup-loaded-card.ok {
  border-color: #bfe4cc;
  background: #f6fcf8;
}

.lookup-loaded-card.warn {
  border-color: #f0cf78;
  background: #fffaf0;
}

.lookup-loaded-card.bad {
  border-color: #f2b8ad;
  background: #fff7f5;
}

.lookup-loaded-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.lookup-loaded-head h3 {
  margin: 0;
  font-size: 15px;
}

.lookup-loaded-head p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.lookup-loaded-meta,
.lookup-loaded-grid {
  display: grid;
  gap: 10px;
}

.lookup-loaded-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lookup-loaded-meta span,
.lookup-loaded-source {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.lookup-loaded-meta span {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.lookup-loaded-meta strong {
  color: var(--text);
}

.lookup-loaded-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.lookup-loaded-source {
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: hidden;
}

.lookup-loaded-source.ok {
  border-color: #d4eadb;
}

.lookup-loaded-source.bad {
  border-color: #f2c6bd;
}

.lookup-loaded-source p,
.lookup-loaded-error {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lookup-loaded-source p {
  margin: 0;
}

.lookup-loaded-error {
  padding: 10px 12px;
  border: 1px solid #f2b8ad;
  border-radius: 8px;
  background: #fff7f5;
  color: var(--danger);
}

.source-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.source-health-facts {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 7px 10px;
}

.source-health-facts span,
.source-health-card p {
  color: var(--muted);
}

.source-health-facts b,
.source-health-card p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-health-card p {
  margin: 0;
  line-height: 1.45;
}

.source-detail-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.source-detail-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.source-detail-card.ok {
  border-color: #cde9d6;
  background: #fbfffc;
}

.source-detail-card.warn {
  border-color: #f0dfad;
  background: #fffdf6;
}

.source-detail-card.bad {
  border-color: #f0c2ba;
  background: #fffafa;
}

.source-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.source-detail-main p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-detail-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.source-detail-title strong {
  font-size: 14px;
}

.source-detail-title code,
.source-path-grid code {
  min-width: 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f4f7fa;
  color: #526171;
  font-family: inherit;
  overflow-wrap: anywhere;
}

.source-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.source-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.source-detail-facts > div,
.source-path-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.source-detail-facts span,
.source-path-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.source-detail-facts strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.source-path-grid code {
  display: block;
  line-height: 1.55;
}

.source-error-box {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #f0c2ba;
  border-radius: 8px;
  background: #fff7f5;
  color: var(--danger);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.source-log-shell {
  display: grid;
  gap: 14px;
}

.source-log-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(120px, 0.5fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.source-run-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.source-run-list,
.source-log-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.source-run-row,
.source-log-row {
  display: grid;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.source-run-row {
  grid-template-columns: 150px 90px 150px 100px 110px minmax(0, 1fr);
}

.source-log-row {
  grid-template-columns: 150px 82px 110px minmax(180px, 0.9fr) minmax(220px, 1fr);
}

.source-run-row:last-child,
.source-log-row:last-child {
  border-bottom: 0;
}

.source-run-row.failed,
.source-log-row.error {
  background: #fff7f5;
}

.source-log-row.warn {
  background: #fffaf0;
}

.source-log-row p {
  margin: 0;
  line-height: 1.45;
}

.source-log-row code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.security-setup {
  display: grid;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.two-factor-setup {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.qr-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 220px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.qr-card canvas {
  width: 188px;
  height: 188px;
  image-rendering: pixelated;
}

.qr-fallback,
.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.qr-fallback {
  color: var(--danger);
  text-align: center;
}

.mono-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.textarea {
  min-height: 74px;
  padding-top: 9px;
  resize: vertical;
}

.payment-card {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #f0cf78;
  border-radius: 8px;
  background: #fff8df;
}

.payment-card h3 {
  margin: 3px 0 6px;
  font-size: 16px;
}

.payment-card p {
  color: #654400;
  line-height: 1.55;
}

.order-state-card {
  border-color: var(--line);
  background: #fbfcfd;
}

.order-state-card.paid {
  border-color: #bfe4cc;
  background: #f1fbf5;
}

.order-state-card.expired,
.order-state-card.canceled,
.payment-card.payment-expired {
  border-color: #f2b8ad;
  background: #fff5f2;
}

.order-state-card.expired p,
.order-state-card.canceled p,
.payment-card.payment-expired p {
  color: #7a2e23;
}

.payment-card-with-qr {
  gap: 14px;
}

.payment-layout {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.payment-main-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-content: start;
}

.payment-info-tile,
.payment-address-full {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #ead59c;
  border-radius: 8px;
  background: #ffffff;
}

.payment-info-tile {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.payment-info-tile span,
.payment-address-full span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.payment-info-tile strong,
.payment-address-full strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.payment-address-full {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.payment-qr-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 214px;
  padding: 12px;
  border: 1px solid #ead59c;
  border-radius: 8px;
  background: #ffffff;
}

.payment-qr-card canvas {
  width: 188px;
  height: 188px;
  image-rendering: pixelated;
}

.expired-payment-message {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #f2b8ad;
  border-radius: 8px;
  background: #ffffff;
}

.expired-payment-message strong {
  color: var(--danger);
}

.expired-payment-message p {
  color: var(--muted);
}

.eyebrow {
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
}

.copy-line {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #ead59c;
  border-radius: 6px;
  background: #ffffff;
}

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

.copy-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.secret-success {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #bfe4cc;
  border-radius: 8px;
  background: #f1fbf5;
}

.secret-success code {
  display: block;
  padding: 10px;
  border: 1px solid #c9e8e3;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.secret-success p {
  color: var(--muted);
  line-height: 1.55;
}

.payment-mini {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 150px;
}

@media (max-width: 760px) {
  .payment-layout,
  .two-factor-setup {
    grid-template-columns: minmax(0, 1fr);
  }

  .payment-address-full {
    grid-column: auto;
  }
}

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

.doc-block {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.doc-block.wide {
  grid-column: 1 / -1;
}

.doc-block h3 {
  margin: 0;
  font-size: 15px;
}

.doc-block pre {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #101c27;
  color: #edf6ff;
  overflow: auto;
  line-height: 1.5;
}

.doc-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.75;
}

.inline-link {
  display: inline-flex;
  margin-top: 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.setting-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.setting-group h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  font-size: 15px;
}

.setting-list {
  display: grid;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row strong,
.setting-row span,
.setting-row code {
  display: block;
}

.setting-row span {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

.setting-row code {
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

.setting-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #24313d;
  font-weight: 650;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

#usersTable table {
  min-width: 0;
  table-layout: fixed;
}

#usersTable th,
#usersTable td {
  padding-left: 8px;
  padding-right: 8px;
}

#usersTable th:nth-child(1),
#usersTable td:nth-child(1) {
  width: 42px;
}

#usersTable th:nth-child(2),
#usersTable td:nth-child(2) {
  width: 160px;
}

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) {
  width: 220px;
}

#usersTable th:nth-child(4),
#usersTable td:nth-child(4),
#usersTable th:nth-child(6),
#usersTable td:nth-child(6) {
  width: 86px;
}

#usersTable th:nth-child(5),
#usersTable td:nth-child(5),
#usersTable th:nth-child(7),
#usersTable td:nth-child(7) {
  width: 138px;
}

#usersTable th:nth-child(8),
#usersTable td:nth-child(8) {
  width: 252px;
}

#usersTable td:nth-child(2),
#usersTable td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
}

#usersTable .row-actions {
  flex-wrap: wrap;
  gap: 5px;
}

#usersTable .row-actions .text-button {
  height: 30px;
  padding-left: 8px;
  padding-right: 8px;
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(16, 28, 39, 0.42);
}

.modal-backdrop {
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 40;
}

.modal {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 32, 0.26);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal.wide-modal {
  width: min(1100px, calc(100vw - 48px));
}

.modal-header,
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header p,
.drawer-header p {
  color: var(--muted);
  margin-top: 5px;
}

.modal-body,
.drawer-body {
  padding: 18px;
  overflow: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.drawer-backdrop {
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: min(520px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(15, 23, 32, 0.22);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

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

.detail-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0e766e;
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.profile-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.profile-title {
  font-size: 18px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.profile-subtitle {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-meta span:not(.status) {
  color: var(--muted);
  font-size: 12px;
}

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

.detail-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.drawer-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.section-title h3 {
  margin: 0;
  font-size: 15px;
}

.compact-table {
  min-height: 0;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .brand-title,
  .brand-subtitle {
    display: none;
  }

  .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .nav-item {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .metrics,
  .metrics-wide,
  .insight-grid,
  .account-grid,
  .source-health-grid,
  .lookup-loaded-grid,
  .lookup-loaded-meta,
  .split,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .account-card.wide {
    grid-column: auto;
  }

  .source-log-toolbar,
  .source-run-row,
  .source-log-row {
    grid-template-columns: 1fr;
  }

  .source-detail-main,
  .source-path-grid {
    grid-template-columns: 1fr;
  }

  .source-detail-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .panel-header,
  .list-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics {
    gap: 10px;
  }

  .inline-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .list-toolbar {
    padding: 10px;
  }

  .input.compact {
    width: 100%;
  }

  .input.user-filter,
  .input.wide-filter {
    width: 100%;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal {
    max-height: calc(100vh - 24px);
  }

  .drawer {
    width: 100%;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .copy-line,
  .payment-highlight div,
  .doc-grid,
  .setting-row,
  .two-factor-setup {
    display: grid;
    grid-template-columns: 1fr;
  }

  .doc-block.wide {
    grid-column: auto;
  }

  .source-detail-facts {
    grid-template-columns: 1fr;
  }
}

/* Public homepage redesign */
.us-home {
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #fbfcff 0%, #f4f7fb 42%, #ffffff 100%);
  color: #111827;
}

.us-home .public-nav {
  min-height: 72px;
  background: rgba(251, 252, 255, 0.92);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.us-home .brand-mark {
  background: #111827;
}

.us-home .public-brand {
  padding: 0;
}

.us-home .brand-title {
  letter-spacing: 0;
}

.us-home .public-links a {
  color: #344255;
}

.us-home .public-links a:hover {
  background: #eef3f7;
}

.us-home .public-links .nav-login {
  white-space: nowrap;
}

.us-home .public-links .nav-login,
.us-home .primary-button {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.us-home .public-links .nav-login:hover,
.us-home .primary-button:hover {
  background: #115e59;
}

.us-home .text-button.hero-secondary {
  background: #ffffff;
  border-color: #d7e0e7;
  color: #0f172a;
  text-decoration: none;
}

.us-home .text-button.hero-secondary:hover {
  background: #f1f5f9;
}

.us-hero {
  isolation: isolate;
  min-height: auto;
  padding: 92px 0 76px;
  background: #fbfcff;
}

.us-hero-bg {
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(17, 24, 39, 0.06), transparent 42%, rgba(15, 118, 110, 0.08));
  background-size: 72px 72px, 72px 72px, auto;
}

.us-hero-grid {
  width: min(1220px, calc(100% - 48px));
  grid-template-columns: minmax(0, 1fr) minmax(390px, 500px);
  gap: clamp(42px, 6vw, 86px);
}

.us-hero-copy {
  min-width: 0;
}

.us-hero-copy .eyebrow,
.us-home .eyebrow {
  color: #0f766e;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.us-hero-copy h1 {
  max-width: 780px;
  color: #0b1220;
  font-size: clamp(48px, 5.8vw, 82px);
  line-height: 0.98;
}

.us-hero-copy .hero-lead {
  max-width: 690px;
  color: #4b5b6d;
  font-size: 19px;
  line-height: 1.72;
}

.us-metrics {
  max-width: 760px;
  gap: 12px;
}

.us-metrics div {
  border-color: #d8e1ea;
  background: rgba(255, 255, 255, 0.86);
}

.us-metrics strong {
  color: #0b1220;
}

.us-home .risk-console.us-intel-card {
  align-self: center;
  min-width: 0;
  color: #e5edf6;
  border-color: rgba(255, 255, 255, 0.12);
  background: #111827;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.28);
}

.us-home .risk-console.us-intel-card::before {
  content: "";
  display: block;
  height: 3px;
  margin: -18px -18px 16px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #0f766e, #f59e0b, #ef4444);
}

.us-home .console-toolbar {
  color: #a9b6c6;
}

.us-home .console-toolbar strong {
  color: #dce7f3;
}

.us-risk-score {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.us-risk-score span {
  color: #a9b6c6;
}

.us-risk-score strong {
  color: #fbbf24;
}

.us-risk-score b {
  color: #111827;
  background: #fbbf24;
}

.us-home .console-row {
  color: #dce7f3;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.us-home .console-row em {
  overflow-wrap: anywhere;
  color: #a9b6c6;
}

.us-decision-list div {
  background: rgba(255, 255, 255, 0.08);
  color: #e5edf6;
}

.us-section {
  background: #ffffff;
}

.us-home .section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.us-home .section-heading.centered {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.us-card-grid article,
.us-card-grid div {
  min-height: 172px;
  border-color: #d9e2ec;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

.us-card-grid h3,
.us-card-grid strong {
  color: #0b1220;
}

.us-card-grid p,
.us-card-grid span {
  color: #546376;
}

.us-platform {
  background: #f3f6fa;
}

.us-split,
.us-dark-grid,
.us-cta-card {
  width: min(1220px, calc(100% - 48px));
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.us-stack div,
.us-trust-list div {
  min-width: 0;
}

.us-stack div {
  border-color: #d9e2ec;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.045);
}

.us-dark {
  background:
    linear-gradient(135deg, #101827 0%, #151f2e 56%, #0d312f 100%);
}

.us-final-cta {
  background: #f7f9fc;
}

.us-cta-card {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding-right: 0;
  padding-left: 0;
}

.us-footer {
  padding: 50px 0;
  background: #090f1a;
}

.us-footer-grid {
  width: min(1220px, calc(100% - 48px));
  align-items: start;
}

.us-footer .brand-mark {
  background: #0f766e;
}

@media (max-width: 980px) {
  .us-home .public-nav {
    align-items: flex-start;
  }

  .us-hero {
    padding: 62px 0 54px;
  }

  .us-hero-grid,
  .us-split,
  .us-dark-grid,
  .us-cta-card,
  .us-footer-grid {
    width: min(100% - 36px, 760px);
    grid-template-columns: 1fr;
  }

  .us-home .risk-console.us-intel-card {
    max-width: 640px;
  }

  .us-card-grid.four,
  .us-card-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .us-home .public-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .us-home .public-links {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .us-home .public-links a:not(.nav-login) {
    display: none;
  }

  .us-hero {
    padding: 34px 0 28px;
  }

  .us-hero-grid,
  .us-split,
  .us-dark-grid,
  .us-cta-card,
  .us-footer-grid {
    width: min(100% - 28px, 520px);
  }

  .us-hero-copy h1 {
    font-size: clamp(40px, 13vw, 54px);
  }

  .us-hero-copy .hero-lead {
    font-size: 16px;
  }

  .us-card-grid.four,
  .us-card-grid.three,
  .us-metrics {
    grid-template-columns: 1fr;
  }

  .us-metrics {
    display: none;
  }

  .us-decision-list {
    display: none;
  }

  .us-home .console-row.clean {
    display: none;
  }

  .us-card-grid article,
  .us-card-grid div {
    min-height: 0;
  }

  .us-risk-score {
    grid-template-columns: 1fr;
  }

  .us-risk-score b {
    width: 62px;
    height: 62px;
  }

  .us-cta-card .primary-button {
    justify-self: start;
  }
}

/* Keep the public hero crisp on common laptop viewports. */
.us-home .public-nav {
  padding-top: 12px;
  padding-bottom: 12px;
  min-height: 68px;
}

.us-hero {
  padding: 58px 0 48px;
}

.us-hero-copy h1 {
  max-width: 720px;
  font-size: clamp(44px, 5.05vw, 68px);
  line-height: 0.98;
}

.us-hero-copy .hero-lead {
  max-width: 660px;
  font-size: 17px;
  line-height: 1.65;
}

.us-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.us-metrics div {
  padding: 12px;
}

.us-metrics strong {
  font-size: 19px;
}

.us-metrics span {
  font-size: 12px;
}

.us-home .risk-console.us-intel-card {
  padding: 14px;
}

.us-home .risk-console.us-intel-card::before {
  margin: -14px -14px 14px;
}

.us-risk-score {
  padding: 14px;
}

.us-risk-score strong {
  font-size: 20px;
}

.us-risk-score b {
  width: 62px;
  height: 62px;
  font-size: 25px;
}

.us-home .console-row {
  padding: 10px;
  margin-top: 8px;
}

.us-decision-list {
  gap: 8px;
  margin-top: 10px;
}

.us-decision-list div {
  padding: 9px 10px;
}

@media (max-width: 620px) {
  .us-home .public-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 68px;
  }

  .us-home .public-links {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .us-home .public-links a:not(.nav-login) {
    display: none;
  }

  .us-hero {
    padding: 34px 0 28px;
  }

  .us-metrics,
  .us-decision-list,
  .us-home .console-row.clean {
    display: none;
  }
}

/* Public homepage bilingual and brand refinements */
.us-home .public-logo {
  width: 42px;
  height: 42px;
  padding: 7px;
  background: #0b1220;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.us-home .public-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.us-home .public-logo path:first-child {
  fill: #0f766e;
  stroke: none;
}

.us-home .public-logo path:last-child {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid #d7e0e7;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.84);
}

.language-switch button {
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #526173;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.language-switch button.active {
  background: #0b1220;
  color: #ffffff;
}

.language-switch button:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.55);
  outline-offset: 2px;
}

.us-trust-list div {
  grid-template-columns: 1fr;
  gap: 8px;
}

.us-trust-list strong,
.us-trust-list span {
  min-width: 0;
}

.us-trust-list span {
  grid-column: auto;
}

.us-dark .us-trust-list div {
  align-content: start;
}

.us-home[lang="zh"],
html[lang="zh-CN"] .us-home {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

html[lang="zh-CN"] .us-hero-copy h1 {
  max-width: 690px;
  line-height: 1.08;
}

html[lang="zh-CN"] .us-hero-copy .hero-lead,
html[lang="zh-CN"] .us-card-grid p,
html[lang="zh-CN"] .us-card-grid span,
html[lang="zh-CN"] .us-stack p,
html[lang="zh-CN"] .us-trust-list span {
  line-height: 1.82;
}

@media (max-width: 980px) {
  .language-switch {
    order: 10;
  }

  .us-home .public-links .nav-login {
    order: 20;
  }
}

@media (max-width: 620px) {
  .us-home .public-logo {
    width: 40px;
    height: 40px;
  }

  .language-switch {
    display: inline-flex;
    padding: 2px;
  }

  .language-switch button {
    min-width: 32px;
    height: 28px;
    padding: 0 7px;
  }

  html[lang="zh-CN"] .us-hero-copy h1 {
    font-size: clamp(36px, 11vw, 48px);
  }
}

/* Final guard against trust-card text collisions on cached or narrow layouts. */
.us-home .us-dark .us-trust-list div {
  display: block;
  min-height: 0;
  overflow: hidden;
}

.us-home .us-dark .us-trust-list strong,
.us-home .us-dark .us-trust-list span {
  display: block;
  width: 100%;
  max-width: 100%;
}

.us-home .us-dark .us-trust-list strong {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.us-home .us-dark .us-trust-list span {
  margin: 9px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
