:root {
  --bg: #0b1020;
  --bg-elev: #121a30;
  --surface: #10172b;
  --text: #e8eefc;
  --text-muted: #a9b5d1;
  --border: #223056;
  --accent: #ff8a2a;
  --accent-strong: #ff9f4f;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: var(--text); max-width: 900px; margin: 0 auto; padding: 20px; background: radial-gradient(1200px 600px at 10% -20%, #1b2a50 0%, transparent 60%), var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
header { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 30px; }
footer { margin-top: 50px; border-top: 1px solid var(--border); padding-top: 20px; font-size: 0.8em; color: var(--text-muted); }
.footer-row { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.footer-links { white-space: nowrap; }
a, a:visited { color: var(--text); }
a:hover { color: #fff; }
h1, h2, h3 { color: #f7faff; }
.hero { text-align: center; padding: 50px 0; }
.cta { margin-top: 30px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 10px; text-decoration: none; font-weight: 700; margin: 0 10px; transition: transform 0.12s ease, opacity 0.12s ease; }
.btn:hover { transform: translateY(-1px); opacity: 0.95; }
.primary { background: linear-gradient(180deg, var(--accent-strong), var(--accent)); color: #1f1204; border: 1px solid #ffb170; }
.primary:hover { filter: brightness(1.04); }
.secondary { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); }

.top-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-left { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-right { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.brand-link { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo-nav { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
.hero-intro { display: inline-flex; align-items: center; justify-content: center; gap: 18px; text-align: left; margin-bottom: 14px; }
.hero-copy h1 { margin: 0 0 8px; }
.hero-copy p { margin: 0; }
.hero-logo { width: 224px; height: 224px; border-radius: 0; object-fit: contain; display: block; box-shadow: none; background: transparent; }
nav a { text-decoration: none; color: var(--text); margin-right: 2px; }
nav a:hover { color: #fff; }
.dash-tabs { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dash-tab { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 999px; padding: 6px 10px; font-size: 13px; text-decoration: none; cursor: pointer; }
.dash-tab.active { background: var(--accent); color: #081021; border-color: var(--accent); }

#owner-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
#owner-badge img, #owner-badge .avatar-fallback { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); }
#owner-badge .avatar-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--bg-elev); color: var(--text); }
.util-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 999px; padding: 4px 10px; text-decoration: none; font-size: 13px; }
.util-pill:hover { background: #1a2441; }
.util-profile-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: relative; display: inline-flex; align-items: center; }
.account-toggle { cursor: pointer; }
.account-options { position: absolute; top: calc(100% + 6px); right: 0; min-width: 150px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); padding: 4px; z-index: 20; }
.account-options a { display: block; padding: 7px 8px; border-radius: 8px; text-decoration: none; color: var(--text); }
.account-options a:hover { background: #1a2441; }
.lang-menu { position: relative; display: inline-flex; align-items: center; }
.lang-toggle { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 999px; padding: 4px 8px; cursor: pointer; line-height: 1; display: inline-flex; align-items: center; gap: 6px; }
.lang-toggle:hover { background: #1a2441; }
.lang-options { position: absolute; top: calc(100% + 6px); right: 0; min-width: 92px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); padding: 4px; z-index: 20; }
.lang-options a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--text); white-space: nowrap; }
.lang-options a:hover { background: #1a2441; }
.lang-flag { width: 16px; height: 12px; border-radius: 2px; border: 1px solid rgba(0,0,0,0.16); display: inline-block; box-sizing: border-box; background-size: cover; background-position: center; background-repeat: no-repeat; }
.flag-us { background-image: url('/icons/flags/us.svg'); }
.flag-tw { background-image: url('/icons/flags/tw.svg'); }
.flag-cn { background-image: url('/icons/flags/cn.svg'); }

@media (max-width: 640px) {
  body { padding: 14px; }
  .btn { margin: 6px 6px 0 0; }
  .hero-intro { display: flex; flex-direction: column; text-align: center; gap: 12px; }
  .hero-logo { width: 160px; height: 160px; }
}

.stack { display: grid; gap: 12px; max-width: 620px; }
.oauth-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.oauth-btn img { width: 20px; height: 20px; flex: 0 0 20px; object-fit: contain; }
.oauth-btn.github { color: var(--text); }
.oauth-btn.google { color: var(--text); }
input, textarea, select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; background: var(--bg-elev); color: var(--text); }
.mc-icon { width: 16px; height: 16px; vertical-align: -2px; }
.invite-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.invite-row input { max-width: 280px; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.share-row input { font-size: 13px; }
.share-row2 { display: grid; grid-template-columns: auto auto auto auto; gap: 10px; align-items: center; justify-content: start; }

/* Brand share icons: no box, larger, colored */
.share-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; text-decoration: none; border-radius: 10px; }
.share-icon svg { width: 28px; height: 28px; }
.share-icon:hover { background: #1a2441; }
.share-icon.x { color: #e8eefc; }
.share-icon.telegram { color: #52b8ff; }
.share-icon.discord { color: #8aa2ff; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); text-decoration: none; cursor: pointer; }
.icon-btn img { width: 18px; height: 18px; filter: brightness(0) invert(1); opacity: 0.95; }
.icon-btn:hover { background: #1a2441; }
.card { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(180deg, #111a30, #0f172a); }
code { background: #1b2849; padding: 2px 6px; border-radius: 4px; color: #dbe8ff; }
.error-msg { color: #ff9aa2; min-height: 1.2em; font-size: 14px; }
.muted { color: var(--text-muted); font-size: 14px; }

.welcome-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.passport-cover { width: 100%; max-width: 360px; height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 10px 24px rgba(0,0,0,0.35); }
@media (min-width: 860px) {
  .welcome-grid { grid-template-columns: 380px 1fr; }
}

.agent-row { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(120px, 1fr) minmax(90px, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.agent-row-head { color: var(--text-muted); font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; }
.agent-col-name { font-weight: 600; }
.agent-col-passport, .agent-col-credit { text-align: left; }


/* News Station cards */
.news-card { display: flex; gap: 14px; margin-top: 12px; padding: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; text-align: left; }
.news-card .news-img { flex-shrink: 0; width: 140px; height: 90px; overflow: hidden; border-radius: 6px; }
.news-card .news-img img { width: 100%; height: 100%; object-fit: cover; }
.news-card .news-body { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .news-card { flex-direction: column; }
  .news-card .news-img { width: 100%; height: 180px; }
}
