/* ============================================================
   PC530 — Main Stylesheet
   Design: Dark-tech with glass-morphism cards, crisp accents
   Font: Noto Sans SC (body) + JetBrains Mono (code/numbers)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=JetBrains+Mono:wght@400;600&family=Outfit:wght@400;600;700&display=swap');

:root {
  --bg:          #0d1117;
  --bg2:         #161b22;
  --bg3:         #21262d;
  --border:      #30363d;
  --border-light:#3d444d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-faint:  #484f58;
  --accent:      #2f81f7;
  --accent-dim:  #1a4a8a;
  --accent-glow: rgba(47,129,247,.18);
  --green:       #3fb950;
  --red:         #f85149;
  --yellow:      #d29922;
  --purple:      #bc8cff;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 8px 32px rgba(0,0,0,.4);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.3);
  --font:        'Noto Sans SC', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --font-display:'Outfit', sans-serif;
  --transition:  .18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #58a6ff; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.navbar {
  background: rgba(13,17,23,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text) !important;
  margin-right: 8px;
  letter-spacing: -.3px;
}
.navbar-brand svg { color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex: 0 1 auto;
  margin-left: auto;
  min-width: 0;
}
.nav-link {
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--bg3);
}
.nav-link.active { color: var(--accent); }
.nav-link.nav-external { font-size: 12.5px; padding-left: 7px; padding-right: 7px; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  background: none;
  border: none;
}
.nav-dropdown-toggle:hover { color: var(--text); background: var(--bg3); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  padding: 6px;
  box-shadow: var(--shadow);
  display: none;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all var(--transition);
}
.nav-dropdown-item:hover { background: var(--bg3); color: var(--text); }

.navbar-spacer { flex: 1; }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.mobile-menu-btn:hover { background: var(--bg3); color: var(--text); }
.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px 20px 12px;
  border-top: 1px solid var(--border);
  gap: 2px;
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
}
.mobile-nav-link:hover { background: var(--bg3); color: var(--text); }
.mobile-nav-link.active { background: var(--bg3); color: var(--accent); }
.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
}

/* ══════════════════════════════════════════
   BREADCRUMB
══════════════════════════════════════════ */
.breadcrumb-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: var(--text-faint); }
.breadcrumb-current { color: var(--text-muted); }

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  flex: 1;
}
.page-container-sm {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px;
  flex: 1;
}
.page-container-md {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px;
  flex: 1;
}
main { flex: 1; }

/* ══════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════ */
.page-header {
  text-align: center;
  margin-bottom: 36px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.4px;
}
.page-header p { color: var(--text-muted); font-size: 14px; }
.page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 24px;
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-sm { padding: 16px; }
.card-hover {
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.card-hover:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim), var(--shadow);
  transform: translateY(-2px);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #388bfd; color: #fff; box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border-light);
}
.btn-secondary:hover { background: #2d333b; border-color: #545d68; color: var(--text); }
.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(248,81,73,.4);
}
.btn-danger:hover { background: rgba(248,81,73,.12); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 5px; }
.btn-icon {
  padding: 6px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
}
.btn-icon:hover { background: var(--bg3); color: var(--text); border-color: var(--border); }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-faint); }
.form-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.form-select option { background: var(--bg2); color: var(--text); }
.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}
.form-row {
  display: grid;
  gap: 12px;
}
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  pointer-events: none;
  animation: toastIn .22s ease forwards;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.toast.toast-success { border-color: var(--green); color: var(--green); }
.toast.toast-error   { border-color: var(--red);   color: var(--red); }
.toast.toast-out { animation: toastOut .22s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform: translateY(-8px) scale(.94); } to { opacity:1; transform: none; } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform: translateY(-6px) scale(.96); } }

/* ══════════════════════════════════════════
   MODAL / OVERLAY
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  animation: slideUp .22s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  transition: all var(--transition);
  display: flex;
}
.modal-close:hover { background: var(--bg3); color: var(--text); }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: none; } }

/* ══════════════════════════════════════════
   MARKET DATA (Home)
══════════════════════════════════════════ */
.hero-strip {
  background: linear-gradient(135deg, #0d1117 0%, #0d1f3c 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 20px 40px;
  text-align: center;
}
.hero-strip h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.5px;
}
.hero-strip p { color: var(--text-muted); font-size: 15px; }
.hero-accent { color: var(--accent); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-meta { font-size: 12px; color: var(--text-faint); }

.rate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.rate-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.rate-card:hover { border-color: var(--border-light); }
.rate-pair { font-size: 11.5px; color: var(--text-faint); margin-bottom: 4px; font-weight: 600; letter-spacing: .4px; }
.rate-value { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.rate-change { font-size: 12px; font-weight: 600; }
.rate-up   { color: var(--green); }
.rate-down { color: var(--red); }

.crypto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.crypto-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.crypto-card:hover { border-color: var(--border-light); }
.crypto-symbol { font-weight: 700; font-size: 15px; color: var(--text); }
.crypto-name   { font-size: 11px; color: var(--text-faint); margin-bottom: 6px; }
.crypto-price  { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text); }
.crypto-change { font-size: 12px; font-weight: 600; margin-top: 2px; }

.ip-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.ip-flag { font-size: 40px; line-height: 1; }
.ip-address {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ip-location { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.ip-isp { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* Tools grid */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--transition);
  color: var(--text);
}
.tool-card:hover {
  border-color: var(--accent-dim);
  background: #161d2b;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  color: var(--text);
}
.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.tool-info h3 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.tool-info p  { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

.home-section { margin-bottom: 32px; }
.section-subtitle { color: var(--text-faint); font-size: 12px; margin-top: 4px; }
.ip-main { flex: 1; min-width: 220px; }

.market-dashboard { display: block; }
.market-dashboard-header { align-items: flex-start; gap: 16px; }
.market-type-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.market-type-strip span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}
.market-type-strip em {
  color: var(--text-faint);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
}
.market-type-strip-header {
  margin-bottom: 0;
  justify-content: flex-end;
}
.sentiment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.sentiment-card,
.market-panel,
.mini-market-card,
.calendar-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sentiment-card { padding: 14px; min-height: 132px; }
.sentiment-label { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.sentiment-value { font-family: var(--font-mono); color: var(--text); font-size: 24px; font-weight: 700; margin: 6px 0 2px; }
.sentiment-meta { display: flex; gap: 8px; color: var(--text-faint); font-size: 12px; min-height: 19px; }
.sentiment-card p { color: var(--text-muted); font-size: 12px; line-height: 1.45; margin-top: 8px; }
.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, .82fr);
  gap: 14px;
  margin-bottom: 32px;
  align-items: stretch;
}
.market-panel {
  overflow: hidden;
  min-width: 0;
}
.market-panel-large {
  min-width: 0;
  max-height: 760px;
  display: flex;
  flex-direction: column;
}
.market-side-stack {
  min-width: 0;
  max-height: 760px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.market-side-stack .market-panel { min-height: 0; }
.market-side-stack .market-panel:first-child { flex: 1 1 48%; }
.market-side-stack .calendar-panel { flex: 1 1 52%; }
.market-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.market-panel-head h2 {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.market-panel-head span {
  color: var(--text-faint);
  font-size: 12px;
  white-space: nowrap;
}
.opportunity-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-content: start;
  gap: 12px;
  padding: 14px;
}
.opportunity-card {
  min-width: 0;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.opportunity-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.opportunity-top strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opportunity-market {
  flex-shrink: 0;
  background: rgba(139,148,158,.12);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}
.opportunity-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.opportunity-metrics div {
  min-width: 0;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px;
}
.opportunity-metrics span,
.opportunity-metrics b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opportunity-metrics span {
  color: var(--text-faint);
  font-size: 11px;
  margin-bottom: 4px;
}
.opportunity-metrics b {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.opportunity-metrics b.rate-up { color: var(--green); }
.opportunity-metrics b.rate-down { color: var(--red); }
.opportunity-metrics b.text-muted { color: var(--text-muted); }
.opportunity-card p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.symbol-group-list {
  max-height: none;
  height: calc(100% - 49px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
}
.symbol-group + .symbol-group { margin-top: 12px; }
.symbol-group h3,
.overview-block h3,
.heatmap-group h3 {
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.symbol-group h3 span,
.overview-block h3 span,
.heatmap-group h3 span {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}
.symbol-chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.symbol-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
}
.symbol-chip b { color: var(--text); font-family: var(--font-mono); }
.overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
}
.market-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 14px;
  align-items: start;
}
.overview-block { min-width: 0; }
.mini-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.mini-market-card {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
}
.mini-market-card strong,
.mini-market-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-market-card strong { color: var(--text); font-size: 12.5px; }
.mini-market-card span { color: var(--text-faint); font-size: 11px; }
.mini-market-card b { color: var(--text); font-family: var(--font-mono); font-size: 12px; }
.mini-market-card em { grid-column: 2; font-style: normal; font-size: 12px; font-weight: 700; }
.mini-market-card em.rate-up { color: var(--green); }
.mini-market-card em.rate-down { color: var(--red); }
.heatmap-board { padding: 14px; }
.heatmap-group + .heatmap-group { margin-top: 18px; }
.heatmap-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.heatmap-cell {
  min-height: 96px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(139,148,158,.08);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.heatmap-cell.rate-up { background: rgba(63,185,80,.13); border-color: rgba(63,185,80,.26); }
.heatmap-cell.rate-down { background: rgba(248,81,73,.13); border-color: rgba(248,81,73,.26); }
.heatmap-cell strong { color: var(--text); font-family: var(--font-mono); font-size: 13px; }
.heatmap-cell span { color: var(--text-muted); font-size: 11px; line-height: 1.35; flex: 1; overflow: hidden; }
.heatmap-cell b { font-size: 16px; }
.heatmap-cell em { color: var(--text-faint); font-style: normal; font-family: var(--font-mono); font-size: 11px; }
.finance-calendar-list {
  height: calc(100% - 49px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 12px;
}
.finance-calendar-item {
  display: grid;
  grid-template-columns: 44px 48px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
}
.finance-calendar-item:last-child { border-bottom: 0; }
.finance-calendar-date,
.finance-calendar-time,
.finance-calendar-country {
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.finance-calendar-country {
  text-align: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 10px;
}
.finance-calendar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}
.finance-calendar-value {
  justify-self: end;
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
}
.finance-calendar-value.rate-up { color: var(--green); }
.finance-calendar-value.rate-down { color: var(--red); }

.narrow-page {
  max-width: 680px;
}
.auth-card h1 {
  font-size: 22px;
  margin-bottom: 18px;
}
.auth-note {
  margin-top: 14px;
  color: var(--text-muted);
}
.errorlist {
  list-style: none;
  margin-top: 6px;
  color: var(--red);
  font-size: 12px;
}
.link-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.link-site-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.link-site-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.link-site-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  overflow: hidden;
}
.link-site-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.link-site-card h2 {
  font-size: 15px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-site-card p {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.link-site-card span {
  color: var(--text-faint);
  font-size: 12px;
}
.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 22px;
  color: var(--text-muted);
  text-align: center;
}
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  color: var(--text-muted);
  background: var(--bg3);
  font-size: 12px;
}
.data-table td {
  color: var(--text);
  font-size: 13px;
}
.data-table tr:last-child td { border-bottom: 0; }

@media (max-width: 980px) {
  .market-layout,
  .market-bottom-grid { grid-template-columns: 1fr; }
  .market-panel-large,
  .market-side-stack { max-height: none; }
  .market-side-stack { display: grid; grid-template-columns: 1fr; }
  .opportunity-grid,
  .symbol-group-list,
  .finance-calendar-list {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .hero-strip { padding: 34px 18px 28px; text-align: left; }
  .hero-strip h1 { font-size: 30px; }
  .section-header { align-items: flex-start; gap: 8px; flex-direction: column; }
  .market-dashboard-header { flex-direction: column; }
  .sentiment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opportunity-grid { grid-template-columns: 1fr; padding: 10px; }
  .opportunity-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .opportunity-metrics div { padding: 7px 6px; }
  .overview-grid { grid-template-columns: 1fr; }
  .mini-market-grid,
  .heatmap-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-site-grid { grid-template-columns: 1fr; }
  .finance-calendar-item {
    grid-template-columns: 40px 43px 24px minmax(0, 1fr) auto;
    gap: 6px;
    font-size: 11px;
  }
  .ip-card { padding: 16px; gap: 12px; }
  .ip-flag { font-size: 30px; }
  .ip-address { font-size: 18px; word-break: break-all; }
}

/* ══════════════════════════════════════════
   SHARED DOC
══════════════════════════════════════════ */
.doc-line {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  gap: 8px;
  transition: background var(--transition);
}
.doc-line:hover { background: var(--bg3); }
.doc-line-content {
  flex: 1;
  font-size: 13.5px;
  color: var(--text);
  word-break: break-all;
  font-family: var(--font-mono);
  line-height: 1.5;
}
.doc-line-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.doc-line:hover .doc-line-actions { opacity: 1; }
.doc-title-row {
  padding: 16px 10px 8px;
}
.doc-title-row h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   PASSPORT
══════════════════════════════════════════ */
.mrz-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--green);
  word-break: break-all;
  line-height: 2;
}
.result-valid {
  background: rgba(63,185,80,.08);
  border: 1px solid rgba(63,185,80,.3);
  border-radius: var(--radius);
  padding: 16px;
}
.result-invalid {
  background: rgba(248,81,73,.08);
  border: 1px solid rgba(248,81,73,.3);
  border-radius: var(--radius);
  padding: 16px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-item { }
.field-label { font-size: 11px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.field-value { font-size: 13.5px; color: var(--text); font-family: var(--font-mono); }

/* Tab strip */
.tab-strip {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}
.tab-btn {
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ══════════════════════════════════════════
   IDIOM
══════════════════════════════════════════ */
.idiom-search-wrap {
  position: relative;
  margin-bottom: 28px;
}
.idiom-search-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 52px 14px 20px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font);
}
.idiom-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.idiom-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.idiom-search-btn:hover { background: #388bfd; }
.idiom-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.idiom-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: block;
  color: var(--text);
  transition: all var(--transition);
}
.idiom-card:hover {
  border-color: var(--accent-dim);
  background: #161d2b;
  transform: translateY(-1px);
  color: var(--text);
}
.idiom-word { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 3px; letter-spacing: 2px; }
.idiom-pinyin { font-size: 11.5px; color: var(--text-faint); margin-bottom: 6px; }
.idiom-def { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.daily-card {
  background: linear-gradient(135deg, #0d1f3c, #0d1117);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 32px;
}

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg3);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }

/* ══════════════════════════════════════════
   BADGE / TAG
══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-green  { background: rgba(63,185,80,.12);  color: var(--green);  border-color: rgba(63,185,80,.25); }
.badge-red    { background: rgba(248,81,73,.12);  color: var(--red);    border-color: rgba(248,81,73,.25); }
.badge-blue   { background: var(--accent-glow);   color: var(--accent); border-color: var(--accent-dim); }
.badge-yellow { background: rgba(210,153,34,.12); color: var(--yellow); border-color: rgba(210,153,34,.25); }
.badge-purple { background: rgba(188,140,255,.12);color: var(--purple); border-color: rgba(188,140,255,.25); }

code, .mono {
  font-family: var(--font-mono);
  background: var(--bg3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--accent);
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 36px 20px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}
.footer-col h4 { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.footer-col a { display: block; color: var(--text-faint); font-size: 13px; padding: 3px 0; transition: color var(--transition); }
.footer-col a:hover { color: var(--text-muted); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

/* ══════════════════════════════════════════
   ERROR PAGES
══════════════════════════════════════════ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
}
.error-code {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 700;
  color: var(--border-light);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -4px;
}
.error-msg { font-size: 18px; color: var(--text-muted); margin-bottom: 24px; }

/* ══════════════════════════════════════════
   MISC UTILITIES
══════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-mono   { font-family: var(--font-mono); }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.info-box {
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.warn-box {
  background: rgba(210,153,34,.08);
  border: 1px solid rgba(210,153,34,.3);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--yellow);
}
.success-box {
  background: rgba(63,185,80,.08);
  border: 1px solid rgba(63,185,80,.3);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--green);
}
.error-box {
  background: rgba(248,81,73,.08);
  border: 1px solid rgba(248,81,73,.3);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--red);
}
