:root {
  --bg-base: #0d0b07;
  --bg-raised: #131008;
  --bg-float: #1a1509;
  --gold-bright: #fcd34d;
  --gold: #f0b429;
  --gold-deep: #d4920f;
  --amber: #f59e0b;
  --amber-deep: #d97706;
  --border: rgba(240, 180, 41, 0.13);
  --border-md: rgba(240, 180, 41, 0.24);
  --border-hi: rgba(240, 180, 41, 0.42);
  --text-hi: #fdf6e3;
  --text: #e8d5a3;
  --text-sub: #a07c38;
  --text-dim: #5c4520;
  --up: #34d399;
  --down: #f87171;
  --mono: "IBM Plex Mono", "SFMono-Regular", monospace;
  --sans: "Sora", "PingFang SC", "Microsoft YaHei", sans-serif;
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 9px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6), 0 6px 20px rgba(0, 0, 0, 0.4);
  --glow-gold: 0 0 40px rgba(240, 180, 41, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.4);
}

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

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
}

.blob-tl {
  width: 900px;
  height: 700px;
  top: -350px;
  left: -300px;
  background: radial-gradient(
    ellipse,
    rgba(240, 180, 41, 0.1) 0%,
    rgba(200, 140, 20, 0.04) 40%,
    transparent 70%
  );
  filter: blur(80px);
}

.blob-tr {
  width: 600px;
  height: 500px;
  top: -200px;
  right: -150px;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.07) 0%, transparent 65%);
  filter: blur(70px);
}

.blob-cl {
  width: 500px;
  height: 600px;
  top: 40%;
  left: -200px;
  background: radial-gradient(ellipse, rgba(212, 146, 15, 0.05) 0%, transparent 65%);
  filter: blur(90px);
  animation: drift-slow 18s ease-in-out infinite alternate;
}

.blob-br {
  width: 700px;
  height: 500px;
  bottom: -200px;
  right: -200px;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.06) 0%, transparent 60%);
  filter: blur(100px);
}

@keyframes drift-slow {
  from {
    transform: translateY(0) translateX(0);
  }

  to {
    transform: translateY(-30px) translateX(20px);
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}

.wrap {
  width: min(1280px, 94vw);
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  background: rgba(13, 11, 7, 0.86);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
  padding: 0 0 0.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(240, 180, 41, 0.36);
  background:
    radial-gradient(circle at 78% 24%, rgba(252, 211, 77, 0.42), transparent 56%),
    linear-gradient(145deg, rgba(240, 180, 41, 0.22), rgba(16, 13, 7, 0.95));
  box-shadow: inset 0 0 0 1px rgba(252, 211, 77, 0.08), 0 10px 20px rgba(0, 0, 0, 0.34);
}

.brand-logo::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 9px;
  border: 1px solid rgba(240, 180, 41, 0.32);
}

.brand-logo::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px dashed rgba(240, 180, 41, 0.3);
  transform: rotate(-14deg);
}

.brand-logo-core {
  position: relative;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(252, 211, 77, 0.36);
}

.brand-logo-sm {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.brand-logo-sm::before {
  inset: 3px;
  border-radius: 6px;
}

.brand-logo-sm::after {
  width: 20px;
  height: 20px;
}

.brand-logo-sm .brand-logo-core {
  font-size: 0.43rem;
  letter-spacing: 0.08em;
}

.brand-logo-xl {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.brand-logo-xl::before {
  inset: 7px;
  border-radius: 10px;
}

.brand-logo-xl::after {
  width: 40px;
  height: 40px;
}

.brand-logo-xl .brand-logo-core {
  font-size: 0.77rem;
}

.brand-name {
  line-height: 1.2;
}

.brand-name .b1 {
  font-size: 1.07rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-hi);
}

.brand-name .b1 em {
  font-style: normal;
  color: var(--gold);
}

.brand-name .b2 {
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  font-weight: 400;
  text-transform: none;
}

.nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav a {
  color: var(--text-sub);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.22s;
  letter-spacing: 0.01em;
}

.nav a:hover,
.nav a.active {
  color: var(--gold);
  border-color: var(--border-md);
  background: rgba(240, 180, 41, 0.07);
}

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

.lang {
  display: flex;
  border: 1px solid var(--border-md);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-floating {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 240;
  background: rgba(13, 11, 7, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.lang button {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--mono);
  font-size: 0.71rem;
  padding: 7px 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.lang button.active {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: #1c1005;
  font-weight: 800;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--border-md);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-md);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(240, 180, 41, 0.07);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.page-main {
  padding: 32px 0 52px;
}

.hero {
  padding: 30px 0 24px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: stretch;
}

.hero-main {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-md);
  padding: 48px;
  background: radial-gradient(
      ellipse 80% 60% at 100% 0%,
      rgba(240, 180, 41, 0.08) 0%,
      transparent 55%
    ),
    radial-gradient(ellipse 60% 80% at 0% 100%, rgba(245, 158, 11, 0.06) 0%, transparent 60%),
    linear-gradient(155deg, rgba(26, 21, 10, 0.95) 0%, rgba(18, 14, 7, 0.98) 100%);
  box-shadow: var(--shadow-lg), var(--glow-gold);
}

.hero-main::before,
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 34px;
  right: 34px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(240, 180, 41, 0.5) 30%,
    rgba(240, 180, 41, 0.5) 70%,
    transparent
  );
}

.hero-title {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
  color: var(--text-hi);
  font-weight: 900;
  margin-bottom: 18px;
}

.hi {
  color: var(--gold);
  background: linear-gradient(100deg, var(--gold-bright), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(240, 180, 41, 0.09);
  border: 1px solid rgba(240, 180, 41, 0.26);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 24px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 180, 41, 0.7);
  }

  75% {
    box-shadow: 0 0 0 9px rgba(240, 180, 41, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(240, 180, 41, 0);
  }
}

.lead {
  max-width: 58ch;
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.8;
}

.hero-cta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.84rem;
  font-family: var(--sans);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: #160f02;
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 12px 34px rgba(245, 158, 11, 0.33);
}

.btn-secondary {
  background: rgba(240, 180, 41, 0.07);
  color: var(--text);
  border-color: var(--border-md);
}

.btn-secondary:hover {
  border-color: var(--border-hi);
}

.kpis {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.kpi {
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(240, 180, 41, 0.04);
  padding: 12px 12px 10px;
}

.kpi .val {
  color: var(--text-hi);
  font-size: 1.26rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}

.kpi .lbl {
  color: var(--text-sub);
  font-size: 0.72rem;
  line-height: 1.3;
}

.hero-side {
  display: grid;
  gap: 12px;
}

.side-card,
.card,
.notice,
.form-card,
.result-card,
.info-card,
.lab-card,
.connector,
.step,
.mcard {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(29, 23, 10, 0.96), rgba(17, 13, 7, 0.98));
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.side-card:hover,
.card:hover,
.notice:hover,
.info-card:hover,
.lab-card:hover,
.connector:hover,
.step:hover,
.mcard:hover {
  border-color: var(--border-md);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.side-card {
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.side-card-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  column-gap: 10px;
  flex: 1;
}

.side-card-text {
  flex: 1;
  min-width: 0;
}

.side-card-eyebrow {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gold-deep);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.side-card-icon {
  flex-shrink: 0;
  width: 76px;
  max-width: 76px;
  max-height: 76px;
  justify-self: end;
  align-self: center;
  overflow: hidden;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.side-card:hover .side-card-icon {
  opacity: 1;
}

.side-card-icon-ekg {
  width: 76px;
  max-width: 76px;
  max-height: 44px;
  margin-top: 4px;
}

.side-card-icon svg {
  width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
}

.ekg-line {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: ekg-draw 2.8s ease-out forwards, ekg-pulse 4s ease-in-out 2.8s infinite;
}

@keyframes ekg-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes ekg-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 0.4; }
}

.side-card-live {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.live-dot-green {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
  animation: live-blink 2s ease-in-out infinite;
}

.live-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: #34d399;
  opacity: 0.75;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 4px rgba(52,211,153,0.6); }
  50% { opacity: 0.4; transform: scale(0.75); box-shadow: none; }
}

.side-visual {
  position: relative;
  width: 100%;
  height: 102px;
  border-radius: var(--r-md);
  border: 1px solid rgba(240, 180, 41, 0.16);
  background: radial-gradient(circle at 22% 24%, rgba(240, 180, 41, 0.12), rgba(13, 9, 5, 0.95));
  overflow: hidden;
}

.side-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(240, 180, 41, 0.06), rgba(240, 180, 41, 0));
  pointer-events: none;
}

.side-visual svg {
  width: 100%;
  height: 100%;
  display: block;
}

.side-card h3,
.card h3,
.notice h4,
.panel h2,
.panel h3,
.panel h4,
.connector h3,
.step h4,
.lab-card h4 {
  color: var(--text-hi);
}

.side-card p,
.card p,
.notice p,
.panel p,
.facts li,
.step p,
.lab-card p,
.tiny,
.f-copy,
.helper {
  color: var(--text-sub);
  line-height: 1.75;
}

.side-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.side-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.page-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card {
  padding: 18px;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.card p {
  font-size: 0.88rem;
}

.card .card-links {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-md);
  color: var(--gold);
  background: rgba(240, 180, 41, 0.06);
  font-size: 0.75rem;
  font-weight: 700;
}

.link-btn:hover {
  border-color: var(--border-hi);
}

.panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: linear-gradient(152deg, rgba(24, 18, 8, 0.95), rgba(13, 10, 6, 0.98));
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-top: 18px;
}

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

.s-eyebrow {
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 2px solid var(--amber);
}

.panel h2 {
  font-size: clamp(1.4rem, 2.2vw, 2.15rem);
  line-height: 1.2;
  margin-bottom: 8px;
}

.panel p {
  font-size: 0.9rem;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.mcard {
  padding: 12px;
  border-radius: var(--r-md);
}

.mcard-sym {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.mcard-price {
  color: var(--text-hi);
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.mcard-chg {
  font-family: var(--mono);
  font-size: 0.78rem;
  margin-bottom: 7px;
}

.sparkline {
  width: 100%;
  height: 26px;
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

.ticker-outer {
  border-radius: 999px;
  border: 1px solid var(--border-md);
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.09), rgba(240, 180, 41, 0.03));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 8px 0 16px;
}

.ticker-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--border-md);
  background: rgba(28, 20, 8, 0.9);
}

.ticker-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: ping 2s infinite;
}

.ticker-badge-label {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
}

.ticker-scroll-area {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  gap: 18px;
  white-space: nowrap;
  padding-right: 18px;
  animation: ticker 46s linear infinite;
}

.ticker-scroll-area:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.tick-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.tick-sym {
  color: var(--gold);
  font-weight: 700;
}

.tick-px {
  color: var(--text-hi);
}

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

.visual-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(152deg, rgba(24, 18, 8, 0.96), rgba(12, 9, 5, 0.98));
  box-shadow: var(--shadow-sm);
  padding: 12px;
}

.visual-media {
  border-radius: var(--r-md);
  border: 1px solid rgba(240, 180, 41, 0.16);
  background: radial-gradient(circle at 30% 30%, rgba(240, 180, 41, 0.11), rgba(14, 10, 5, 0.94));
  padding: 6px;
  min-height: 96px;
  display: flex;
  align-items: center;
}

.visual-media svg {
  width: 100%;
  height: 100%;
  display: block;
}

.visual-card h3 {
  margin-top: 9px;
  color: var(--text-hi);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

.connector-grid,
.pipeline,
.compliance-grid,
.labs-grid,
.forms-grid,
.results-grid,
.info-grid {
  display: grid;
  gap: 12px;
}

.connector-grid,
.pipeline,
.forms-grid,
.results-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.compliance-grid,
.labs-grid,
.info-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.connector,
.step,
.notice,
.lab-card,
.info-card {
  padding: 18px;
}

.conn-head,
.lab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tag,
.lab-tag,
.badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--gold);
  border: 1px solid var(--border-md);
  border-radius: 999px;
  padding: 4px 8px;
}

.facts {
  list-style: none;
  display: grid;
  gap: 6px;
}

.facts li {
  font-size: 0.82rem;
}

.src-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.src-links a {
  border: 1px solid var(--border-md);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: var(--gold);
  background: rgba(240, 180, 41, 0.06);
}

.step-num {
  color: var(--gold);
  font-family: var(--mono);
  font-weight: 700;
  margin-bottom: 8px;
}

.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.82rem;
  vertical-align: top;
}

th {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  background: rgba(240, 180, 41, 0.04);
}

td {
  color: var(--text-sub);
}

.td-label {
  color: var(--text-hi);
  font-weight: 700;
}

.code-wrap {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(8, 6, 3, 0.97);
  overflow: hidden;
}

.code-header {
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.code-dots {
  display: inline-flex;
  gap: 6px;
}

.code-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.d1 {
  background: #ef4444;
}

.d2 {
  background: #f59e0b;
}

.d3 {
  background: #34d399;
}

.code-lang {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 0.7rem;
}

pre {
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
}

code {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.68;
  color: #e7d7aa;
}

.kw {
  color: #f0b429;
}

.fn {
  color: #f59e0b;
}

.str {
  color: #86efac;
}

.num {
  color: #c084fc;
}

.cm {
  color: #746042;
}

.forms-grid {
  margin-top: 8px;
}

.form-card,
.result-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 18px;
  background: linear-gradient(150deg, rgba(29, 23, 10, 0.96), rgba(17, 13, 7, 0.98));
}

.form-card h3,
.result-card h3 {
  margin-bottom: 10px;
  color: var(--text-hi);
}

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

.form label {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.input,
.select,
.textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(10, 8, 5, 0.96);
  color: var(--text-hi);
  padding: 9px 10px;
  font-size: 0.82rem;
  font-family: var(--sans);
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--border-hi);
  outline: none;
}

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

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

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.checkbox input {
  accent-color: var(--amber);
}

.form-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.output {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(9, 7, 4, 0.98);
  padding: 10px;
  min-height: 120px;
  max-height: 300px;
  overflow: auto;
  color: #d6c187;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.output.ok {
  border-color: rgba(52, 211, 153, 0.35);
}

.output.err {
  border-color: rgba(248, 113, 113, 0.35);
}

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

.quick-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.quick-links a {
  border: 1px solid var(--border-md);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--gold);
  font-size: 0.72rem;
}

.status-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-md);
  background: rgba(240, 180, 41, 0.08);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 6px 11px;
}

.status-pill.ok {
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
}

.auth-shell,
.app-shell {
  margin-top: 6px;
}

.auth-hero-panel p {
  max-width: 80ch;
}

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

.auth-main-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
}

.helper-block {
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  padding: 10px;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.is-hidden {
  display: none !important;
}

.anchor-point {
  display: block;
  position: relative;
  top: -86px;
  visibility: hidden;
}

.info-card h4 {
  margin-bottom: 6px;
}

.list {
  list-style: none;
  display: grid;
  gap: 6px;
}

.list li {
  font-size: 0.84rem;
  color: var(--text-sub);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

footer {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding: 18px 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-legalized {
  row-gap: 10px;
}

.f-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.f-brand-title {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text-sub);
}

.f-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.f-links a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.73rem;
  color: var(--text-sub);
}

.f-links a:hover {
  color: var(--gold);
  border-color: var(--border-md);
}

.f-copy {
  font-size: 0.75rem;
}

.f-legal {
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid rgba(240, 180, 41, 0.1);
  font-size: 0.71rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--text-dim);
}

.section-gap {
  margin-top: 18px;
}

@media (max-width: 1120px) {
  .config-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .visual-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .panel,
  .hero-main {
    padding: 22px;
  }

  .row,
  .row3,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    min-height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .top-actions {
    width: 100%;
    order: 3;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .mode-pill {
    padding: 6px 8px;
    font-size: 0.68rem;
  }

  .lang button {
    padding: 7px 10px;
  }

  .nav {
    display: none;
    order: 4;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 4px;
  }

  .nav.mobile-open {
    display: flex;
  }

  .nav a {
    white-space: nowrap;
  }

  .forms-grid,
  .results-grid,
  .connector-grid,
  .pipeline {
    grid-template-columns: 1fr;
  }

  .auth-main-grid,
  .auth-kpi-grid {
    grid-template-columns: 1fr;
  }

  .side-card {
    min-height: 0;
  }

  .side-visual {
    height: 90px;
  }

  .side-card p {
    -webkit-line-clamp: 4;
    min-height: calc(1.7em * 4);
  }
}

@media (max-width: 560px) {
  .hero-title {
    font-size: 1.9rem;
  }

  .lang-floating {
    top: 10px;
    right: 10px;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

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

  .side-card-inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
  }

  .side-card-icon,
  .side-card-icon-ekg {
    width: min(72px, 28vw);
    max-width: 72px;
    justify-self: center;
    margin-top: 2px;
  }

  .f-links {
    width: 100%;
  }

  .f-legal {
    font-size: 0.69rem;
  }
}

/* ============================================================
   Login Page Layout
   ============================================================ */

.login-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
  position: relative;
  z-index: 3;
}

.login-card {
  width: 100%;
  max-width: 480px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-md);
  background: linear-gradient(152deg, rgba(24, 18, 8, 0.97), rgba(13, 10, 6, 0.99));
  box-shadow: var(--shadow-lg), var(--glow-gold);
  padding: 36px 32px 28px;
  position: relative;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 34px;
  right: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 180, 41, 0.55) 30%, rgba(240, 180, 41, 0.55) 70%, transparent);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
}

.login-brand .brand-name {
  text-align: center;
}

.login-brand .b1 {
  font-size: 1.3rem;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-md);
  background: rgba(240, 180, 41, 0.07);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.login-tabs {
  display: flex;
  border-radius: 999px;
  border: 1px solid var(--border-md);
  overflow: hidden;
  margin-bottom: 22px;
  background: rgba(10, 8, 5, 0.6);
}

.login-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.22s;
  letter-spacing: 0.01em;
}

.login-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: #160f02;
  font-weight: 800;
}

.login-panel {
  min-height: 0;
}

.login-section-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--border-hi);
}

.login-password-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.login-password-wrap .input {
  padding-right: 52px;
}

.pwd-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 12px;
  border-radius: 0 9px 9px 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: color 0.2s, background 0.2s;
}

.pwd-toggle:hover {
  color: var(--gold);
  background: rgba(240, 180, 41, 0.07);
}

.login-advanced {
  margin-top: 4px;
}

.login-advanced summary {
  font-size: 0.74rem;
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  user-select: none;
}

.login-advanced summary::before {
  content: "▸";
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.login-advanced[open] summary::before {
  transform: rotate(90deg);
}

.login-advanced summary:hover {
  color: var(--text-sub);
}

.login-advanced-body {
  padding: 8px 0 4px;
}

.login-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: var(--r-sm);
  color: #f87171;
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 8px 11px;
  margin-top: 2px;
}

.login-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  font-size: 0.88rem;
}

.login-hint {
  font-size: 0.77rem;
  color: var(--text-dim);
  margin-top: 14px;
  text-align: center;
  line-height: 1.6;
}

.login-hint-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.login-link {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.77rem;
  font-family: var(--sans);
  text-decoration: underline;
  text-decoration-color: rgba(240, 180, 41, 0.35);
  padding: 0;
  transition: color 0.2s;
}

.login-link:hover {
  color: var(--gold-bright);
}

.login-link-a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(240, 180, 41, 0.35);
  font-size: 0.77rem;
  transition: color 0.2s;
}

.login-link-a:hover {
  color: var(--gold-bright);
}

.login-output {
  margin-top: 12px;
  max-height: 140px;
  font-size: 0.71rem;
}

.login-footer-links {
  margin-top: 20px;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.login-footer-links a {
  font-size: 0.72rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  transition: color 0.2s, border-color 0.2s;
}

.login-footer-links a:hover {
  color: var(--gold);
  border-color: var(--border-md);
}

.verify-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(240, 180, 41, 0.05);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.verify-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.verify-notice strong {
  display: block;
  font-size: 0.84rem;
  color: var(--text-hi);
  margin-bottom: 3px;
}

.verify-notice p {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* Integrated verification step */
.verify-step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(240, 180, 41, 0.05);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 4px;
}

.verify-step-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.verify-step-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 4px;
}

.verify-step-sub {
  font-size: 0.79rem;
  color: var(--text-sub);
  line-height: 1.55;
}

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

.verify-email-tag {
  display: inline-block;
  background: rgba(240, 180, 41, 0.1);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  padding: 1px 7px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--gold);
}

.admin-security-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 9px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.admin-security-notice-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.login-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

@media (max-width: 520px) {
  .login-card {
    padding: 28px 18px 22px;
  }
}

/* ============================================================
   Portal Business UI
   ============================================================ */

/* Welcome bar */
.welcome-bar {
  position: sticky;
  top: 80px;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  background: rgba(13, 11, 7, 0.9);
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
}

.welcome-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.welcome-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
}

.welcome-name {
  color: var(--text-sub);
}

.welcome-name strong {
  color: var(--text-hi);
}

.welcome-meta {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.73rem;
  border-left: 1px solid var(--border-md);
  padding-left: 10px;
}

.welcome-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Portal tabs outer wrapper */
.portal-tabs-outer {
  border-bottom: 1px solid var(--border);
  background: rgba(13, 11, 7, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 124px;
  z-index: 99;
}

.portal-tabs-bar {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.portal-tabs-bar::-webkit-scrollbar {
  display: none;
}

.portal-tab {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.portal-tab:hover {
  color: var(--text);
}

.portal-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.portal-panel {
  padding-top: 14px;
}

/* Portal loading state */
.portal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 45vh;
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(29, 23, 10, 0.96), rgba(17, 13, 7, 0.98));
  padding: 14px 16px;
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
}

.stat-val {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-hi);
  font-family: var(--mono);
  line-height: 1;
}

.stat-val.ok {
  color: var(--up);
}

.stat-val.warn {
  color: var(--amber);
}

.stat-val.err {
  color: #f87171;
}

/* Config panel */
.config-panel {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.config-panel > summary {
  padding: 9px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  background: rgba(240, 180, 41, 0.03);
}

.config-panel > summary::-webkit-details-marker {
  display: none;
}

.config-panel > summary::before {
  content: "▸";
  font-size: 0.68rem;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.config-panel[open] > summary::before {
  transform: rotate(90deg);
}

.config-hint {
  font-size: 0.71rem;
  color: var(--text-dim);
}

.portal-config-grid {
  padding: 10px 14px 14px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.portal-config-grid label {
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* Section head */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.section-head h3 {
  margin-bottom: 0;
}

/* Button variants */
.btn-sm {
  padding: 5px 11px;
  font-size: 0.77rem;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.28);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.18);
}

/* Data tables */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th {
  background: rgba(240, 180, 41, 0.04);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(240, 180, 41, 0.02);
}

.table-empty {
  text-align: center !important;
  color: var(--text-dim) !important;
  font-size: 0.78rem;
  padding: 22px !important;
  font-style: italic;
}

.table-loading {
  text-align: center !important;
  color: var(--text-dim) !important;
  font-size: 0.77rem;
  padding: 16px !important;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-active,
.badge-up,
.badge-approved,
.badge-success {
  background: rgba(52, 211, 153, 0.1);
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.28);
}

.badge-suspended,
.badge-down,
.badge-rejected,
.badge-error {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.27);
}

.badge-pending,
.badge-submitted,
.badge-reviewing {
  background: rgba(240, 180, 41, 0.1);
  color: var(--gold);
  border-color: var(--border-md);
}

.badge-closed,
.badge-deprecated,
.badge-planned {
  background: rgba(92, 69, 32, 0.3);
  color: var(--text-dim);
  border-color: var(--border);
}

.badge-buy {
  background: rgba(52, 211, 153, 0.1);
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.28);
}

.badge-sell {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.27);
}

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 340px;
}

.toast {
  background: rgba(22, 16, 6, 0.97);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  word-break: break-word;
  line-height: 1.5;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

.toast-error {
  border-color: rgba(248, 113, 113, 0.35);
  color: #f87171;
}

.toast-info {
  border-color: var(--border-md);
  color: var(--gold);
}

/* Side toggle (buy/sell) */
.side-toggle {
  display: flex;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  overflow: hidden;
  margin-top: 4px;
}

.side-btn {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-sub);
}

.side-btn.active-buy {
  background: rgba(52, 211, 153, 0.13);
  color: var(--up);
}

.side-btn.active-sell {
  background: rgba(248, 113, 113, 0.13);
  color: #f87171;
}

/* Account snapshot */
.account-snapshot {
  display: grid;
  gap: 5px;
}

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.81rem;
}

.account-row:last-child {
  border-bottom: none;
}

.account-key {
  color: var(--text-sub);
}

.account-val {
  color: var(--text-hi);
  font-family: var(--mono);
  font-weight: 600;
}

/* Quote cards */
.quote-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.quote-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(29, 23, 10, 0.96);
  padding: 12px;
}

.quote-sym {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--gold);
  margin-bottom: 6px;
  font-weight: 700;
}

.quote-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-hi);
  font-family: var(--mono);
}

.quote-detail {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-sub);
  margin-top: 4px;
  line-height: 1.5;
}

/* New key reveal */
.new-key-display {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  background: rgba(9, 7, 4, 0.95);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  padding: 12px;
}

.new-key-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.new-key-label {
  font-size: 0.69rem;
  color: var(--text-dim);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.new-key-val {
  font-family: var(--mono);
  font-size: 0.77rem;
  color: var(--gold);
  word-break: break-all;
  line-height: 1.5;
}

/* Connector cards */
.connector-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.connector-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: linear-gradient(150deg, rgba(29, 23, 10, 0.96), rgba(17, 13, 7, 0.98));
  padding: 14px;
  transition: border-color 0.2s;
}

.connector-card.status-up {
  border-color: rgba(52, 211, 153, 0.22);
}

.connector-card.status-down {
  border-color: rgba(248, 113, 113, 0.22);
}

.connector-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.connector-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-hi);
  font-weight: 700;
}

.connector-provider {
  font-size: 0.73rem;
  color: var(--text-sub);
  margin-top: 3px;
}

.connector-toggle {
  display: flex;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  overflow: hidden;
  flex-shrink: 0;
}

.connector-toggle-btn {
  border: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-dim);
}

.connector-toggle-btn.active-up {
  background: rgba(52, 211, 153, 0.14);
  color: var(--up);
}

.connector-toggle-btn.active-down {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

/* Info notice bar */
.info-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(240, 180, 41, 0.05);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.info-notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* User profile card */
.profile-kv {
  display: grid;
  gap: 5px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.81rem;
  gap: 12px;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-key {
  color: var(--text-dim);
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.03em;
}

.profile-val {
  color: var(--text-hi);
  text-align: right;
  word-break: break-all;
}

/* Inline revoke form row */
.table-action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .welcome-bar {
    top: 60px;
  }

  .portal-tabs-outer {
    top: 100px;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-config-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   2026 UX Upgrade Layer
   ============================================================ */

.auth-entry-page {
  background:
    radial-gradient(1200px 640px at 0% 0%, rgba(240, 180, 41, 0.08), transparent 58%),
    radial-gradient(900px 520px at 100% 100%, rgba(34, 197, 94, 0.06), transparent 62%),
    var(--bg-base);
}

.login-main.login-main-split {
  justify-content: center;
  padding: 38px 18px 46px;
}

.login-shell-2026 {
  width: min(1240px, 96vw);
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.login-side-2026 {
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, rgba(31, 24, 10, 0.96), rgba(14, 11, 6, 0.99)),
    linear-gradient(130deg, rgba(240, 180, 41, 0.1), rgba(34, 197, 94, 0.06));
  box-shadow: var(--shadow-md);
  padding: 34px;
  display: grid;
  gap: 14px;
}

.brand-xl .b1 {
  font-size: 1.52rem;
}

.login-title-2026 {
  color: var(--text-hi);
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.login-desc-2026 {
  color: var(--text-sub);
  font-size: 0.9rem;
  line-height: 1.85;
}

.login-feature-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.login-feature-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(13, 10, 6, 0.74);
  padding: 11px 12px;
}

.login-feature-item h3 {
  font-size: 0.86rem;
  color: var(--text-hi);
  margin-bottom: 4px;
}

.login-feature-item p {
  font-size: 0.76rem;
  color: var(--text-sub);
  line-height: 1.6;
}

.login-card-2026 {
  max-width: none;
  width: 100%;
  display: grid;
  align-content: flex-start;
  gap: 8px;
}

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

.login-badge-admin {
  border-color: rgba(251, 146, 60, 0.42);
  color: #fbbf24;
}

.password-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: -2px;
  margin-bottom: 2px;
}

.password-rules span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--mono);
  line-height: 1.25;
}

.password-rules span.ok {
  border-color: rgba(52, 211, 153, 0.4);
  color: #86efac;
  background: rgba(52, 211, 153, 0.08);
}

.portal-hero-strip {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(130px, 0.52fr));
  gap: 10px;
}

.portal-hero-main,
.portal-hero-metric {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: linear-gradient(152deg, rgba(28, 21, 9, 0.95), rgba(15, 12, 7, 0.98));
  box-shadow: var(--shadow-sm);
}

.portal-hero-main {
  padding: 15px 16px;
}

.portal-hero-main h2 {
  font-size: 1.03rem;
  color: var(--text-hi);
  margin-bottom: 6px;
}

.portal-hero-main p {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.66;
}

.portal-hero-actions {
  margin-top: 10px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.portal-hero-metric {
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.portal-hero-metric span {
  color: var(--text-dim);
  font-size: 0.68rem;
  font-family: var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.portal-hero-metric strong {
  color: var(--text-hi);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.3;
}

@media (max-width: 1120px) {
  .login-shell-2026 {
    grid-template-columns: 1fr;
    gap: 12px;
    width: min(840px, 96vw);
  }

  .login-side-2026 {
    padding: 24px 22px;
  }

  .portal-hero-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .password-rules {
    grid-template-columns: 1fr;
  }

  .portal-hero-strip {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Mobile / iOS / Android optimizations
   ============================================================ */

/* Prevent horizontal overflow on all screens */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* iOS safe-area insets */
.topbar {
  padding-top: env(safe-area-inset-top, 0px);
}

footer {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Minimum 44px touch targets */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Prevent iOS input zoom (font-size < 16px triggers zoom) */
@media (max-width: 768px) {
  .input,
  .select,
  .textarea {
    font-size: 16px;
  }

  /* Login card full-width on small phones */
  .login-card {
    border-radius: var(--r-lg);
  }

  /* Side cards: stack vertically already handled, ensure no overflow */
  .side-cards {
    overflow: hidden;
  }

  /* Hero section: prevent text overflow */
  .hero-title {
    word-break: keep-all;
    overflow-wrap: break-word;
  }
}

@media (max-width: 390px) {
  .topbar-inner {
    gap: 8px;
  }

  .brand-name .b1 {
    font-size: 1rem;
  }

  .brand-name .b2 {
    font-size: 0.6rem;
  }

  .login-main {
    padding: 16px 12px 32px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }
}
