@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root{
  --bg:#f7f8fc;
  --card:#ffffff;
  --txt:#0f172a;
  --muted:#64748b;
  --pri:#2563eb;
  --pri2:#1d4ed8;
  --ok:#047857;
  --warn:#b45309;
  --bad:#b91c1c;
  --line:#e2e8f0;
  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --shadow2: 0 2px 10px rgba(2,6,23,.06);
  --radius:16px;
  --radius2:12px;
  --ring: 0 0 0 4px rgba(37,99,235,.18);
}

/* Global font (Korean rendering) */
html, body{
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic",
    "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*{box-sizing:border-box}
html,body{ height:100% }
body{
  margin:0;
  background: radial-gradient(1200px 400px at 30% -10%, rgba(37,99,235,.12), transparent 60%),
              radial-gradient(900px 350px at 90% 0%, rgba(16,185,129,.10), transparent 55%),
              var(--bg);
  color:var(--txt);
  font-family: inherit;
}

.wrap{max-width:1100px;margin:30px auto;padding:0 16px}

/* Home: market ticker */
.marketbar{margin:0 0 14px;padding:14px 14px 10px;border:1px solid rgba(255,255,255,.08);border-radius:18px;background:rgba(255,255,255,.03)}
.marketbar-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px}
.marketbar-title{font-weight:950;color:var(--txt)}
.marketbar-sub{font-size:12px;color:var(--muted)}
.marketbar-body{border-radius:14px;overflow:hidden}
h1{margin:0 0 14px;font-size:28px;letter-spacing:-.3px}
h3{margin:18px 0 10px}

a{color:inherit}
hr{border:0;border-top:1px solid var(--line);margin:14px 0}

.card{
  background:var(--card);
  border:1px solid rgba(226,232,240,.9);
  border-radius:var(--radius);
  padding:18px;
  box-shadow: var(--shadow2);
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.brand{
  display:flex;align-items:center;gap:10px;
}
.brand .dot{
  width:10px;height:10px;border-radius:50%;
  background: linear-gradient(135deg, var(--pri), #22c55e);
  box-shadow: 0 0 0 6px rgba(37,99,235,.12);
}
.brand .title{
  font-weight:900;
  letter-spacing:-.4px;
}
.brand .sub{
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}

.muted{color:var(--muted)}
.msg{margin-top:10px;font-size:13px}
.msg.ok{color:var(--ok);font-weight:800}
.msg.bad{color:var(--bad);font-weight:800}
.msg.warn{color:var(--warn);font-weight:800}

.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.spacer{flex:1}

.lbl{display:block;margin:10px 0 6px;color:var(--muted);font-size:13px}
.inp{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius2);
  background:#fff;
  font-size:14px;
  outline:none;
  transition: box-shadow .15s, border-color .15s, transform .05s;
}
.inp:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: var(--ring);
}
.inp::placeholder{color:#94a3b8}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid transparent;
  background: linear-gradient(180deg, var(--pri), var(--pri2));
  color:#fff;
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  text-decoration:none;
  font-weight:900;
  box-shadow: 0 8px 18px rgba(37,99,235,.18);
  transition: transform .08s, box-shadow .15s, filter .15s;
}
.btn:hover{filter:brightness(1.02)}
.btn:active{transform: translateY(1px)}
.btn:disabled{opacity:.55;cursor:not-allowed}

.btn.secondary{
  background:#fff;
  color:var(--txt);
  border:1px solid var(--line);
  box-shadow:none;
  font-weight:800;
}
.btn.secondary:hover{box-shadow: var(--shadow2)}
.btn.danger{background: linear-gradient(180deg, #ef4444, #dc2626)}
.btn.ok{background: linear-gradient(180deg, #10b981, #059669)}

.kbd{
  display:inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12px;
  padding:2px 6px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:#334155;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  font-weight:900;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
}
.badge .b{
  width:7px;height:7px;border-radius:50%;
  background:#94a3b8;
}
.badge.ok{border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.08); color:#065f46}
.badge.ok .b{background:#10b981}
.badge.warn{border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.10); color:#92400e}
.badge.warn .b{background:#f59e0b}
.badge.bad{border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); color:#991b1b}
.badge.bad .b{background:#ef4444}
.badge.neutral{background:#f8fafc}

.tabs{display:flex;gap:8px;align-items:center;margin-bottom:10px;flex-wrap:wrap}
.tab{
  border:1px solid var(--line);
  background:#fff;
  padding:9px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:900;
  color:#0f172a;
  transition: box-shadow .15s, transform .08s;
}
.tab:hover{box-shadow: var(--shadow2)}
.tab:active{transform: translateY(1px)}
.tab.active{
  background: rgba(37,99,235,.10);
  border-color: rgba(37,99,235,.25);
}

.hide{display:none}

.grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.grid .k{display:inline-block;width:92px;color:var(--muted)}
.grid .v{font-weight:900}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.grid2 .span2{grid-column:1 / span 2}

.tablewrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:var(--radius);
  margin-top:10px;
}
.tbl{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}
.tbl th,.tbl td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
.tbl th{
  position:sticky;
  top:0;
  z-index:1;
  background: #f8fafc;
  text-align:left;
  font-size:12px;
  color:#334155;
  letter-spacing:.2px;
}
.tbl tr:nth-child(even) td{background:#fcfdff}
.tbl tr:hover td{background: rgba(37,99,235,.06)}
.tbl td b{font-weight:900}

.mini{
  border:1px solid var(--line);
  background:#fff;
  padding:7px 10px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
}
.mini:hover{box-shadow: var(--shadow2)}
.mini.danger{border-color: rgba(239,68,68,.35); color:#991b1b; background: rgba(239,68,68,.06)}

@media (max-width: 860px){
  .grid{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .grid2 .span2{grid-column:auto}
  h1{font-size:22px}
}

/* --- Site layout (homepage-style) --- */
.sitebar{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(247,248,252,.82), rgba(247,248,252,.70));
  border-bottom:1px solid rgba(226,232,240,.9);
}
.sitebar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 16px;
}
.brandlink{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--txt);
}
.brandmark{
  width:46px;height:46px;border-radius:16px;
  background:
    url(/assets/joolab-logo.png) center/cover no-repeat,
    linear-gradient(135deg, var(--pri), #22c55e);
  box-shadow:
    0 0 0 8px rgba(37,99,235,.12),
    0 10px 24px rgba(2,6,23,.18);
}
.brandmeta .name{font-weight:950;letter-spacing:-.6px;font-size:16px;line-height:1.1}
.brandmeta .tag{color:rgba(71,85,105,.88);font-size:12px;margin-top:2px;line-height:1.1}

.sitenav{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.sitenav a{
  text-decoration:none;
  color: #334155;
  font-weight:900;
  font-size:13px;
  padding:9px 10px;
  border-radius:999px;
  border:1px solid transparent;
}
.sitenav a:hover{
  background: rgba(37,99,235,.06);
  border-color: rgba(37,99,235,.12);
}
.sitenav .cta{padding:10px 12px}

.hero{
  border:1px solid rgba(226,232,240,.95);
  background:
    radial-gradient(900px 320px at 20% 0%, rgba(37,99,235,.18), transparent 60%),
    radial-gradient(700px 260px at 90% 20%, rgba(34,197,94,.14), transparent 55%),
    #ffffff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px;
}
.hero h1{
  margin:0 0 10px;
  font-size: 34px;
  letter-spacing:-.8px;
  line-height:1.15;
}
.hero .lead{
  margin:0 0 18px;
  color: var(--muted);
  font-weight:800;
  line-height:1.6;
  max-width: 70ch;
}
.hero-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.jlab-intro{
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(17,24,39,0.55);
}
.hero-meta{
  margin-top:16px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

/* Home: hero + live feed */
.hero-grid{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items: start;
}
.hero-grid .hero-main{min-width:0}
.hero-grid .hero-feed{min-width:0}

/* Home: hero left artwork (no crop, keep original ratio) */
.hero-art{
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(2,6,23,.08);
  overflow:hidden;
  min-height: 240px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 10px;
}
.hero-art-img{
  display:block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.feed-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin: 2px 0 10px;
}
.feed-title{font-weight:950; letter-spacing:-.3px}
.feed-sub{color:var(--muted); font-size:12px; font-weight:900}

.feed-box{
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(2,6,23,.08);
  overflow:hidden;
}
.feed-viewport{
  position:relative;
  height: 220px;
  overflow:hidden;
  padding: 10px 10px 12px;
}
.feed-list{display:flex; flex-direction:column; gap:8px}
.feed-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.85);
}
.feed-item:hover{background: rgba(255,255,255,.95)}
.feed-left{display:flex; gap:8px; align-items:center; min-width:0}
.feed-badge{
  font-size:11px;
  font-weight:950;
  padding: 6px 8px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,.10);
  white-space:nowrap;
}
.feed-badge.ok{background: rgba(34,197,94,.12); color:#166534}
.feed-badge.warn{background: rgba(245,158,11,.14); color:#92400e}
.feed-badge.bad{background: rgba(239,68,68,.12); color:#7f1d1d}
.feed-text{min-width:0}
.feed-ttl{font-weight:950; letter-spacing:-.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.feed-meta{color:var(--muted); font-size:11px; font-weight:900; margin-top:2px}
.feed-empty{color:var(--muted); font-weight:900; padding: 10px}

.feed-anim{--feed-h: 420px; --feed-sec: 28s;}
.feed-anim .feed-list{
  animation: feedScroll var(--feed-sec) linear infinite;
}
.feed-anim .feed-list:nth-child(2){
  animation: feedScroll var(--feed-sec) linear infinite;
  animation-delay: calc(var(--feed-sec) / -2);
}
@keyframes feedScroll{
  0%{ transform: translateY(0); }
  100%{ transform: translateY(calc(-1 * var(--feed-h))); }
}

@media (max-width: 980px){
  .hero-grid{grid-template-columns: 1fr;}
  .feed-viewport{height: 200px;}
}

.section{
  margin-top: 18px;
}
.sectionhead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin: 18px 0 10px;
}
.sectionhead h2{
  margin:0;
  font-size:18px;
  letter-spacing:-.3px;
}
.sectionhead .hint{
  color:var(--muted);
  font-size:12px;
  font-weight:900;
}

.cards3{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 980px){
  .cards3{grid-template-columns: 1fr 1fr;}
}
@media (max-width: 640px){
  .cards3{grid-template-columns: 1fr;}
  .hero{padding:18px}
  .hero h1{font-size:26px}
}

.cards4{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 980px){
  .cards4{grid-template-columns: 1fr 1fr;}
}
@media (max-width: 640px){
  .cards4{grid-template-columns: 1fr;}
}



.feature{
  border:1px solid var(--line);
  background:#fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 16px;
}
.feature .t{
  font-weight:950;
  letter-spacing:-.4px;
  font-size:16px;
  margin: 0 0 6px;
}
.feature .d{
  margin:0 0 12px;
  color: var(--muted);
  font-weight:800;
  line-height:1.55;
  font-size:13px;
}
.feature .meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.footer{
  margin-top: 22px;
  padding: 18px 0 32px;
  color: var(--muted);
  font-weight:800;
  font-size:12px;
}
.footer .line{
  height:1px;
  background: rgba(226,232,240,.9);
  margin: 16px 0 14px;
}
.footer .cols{
  display:grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px){
  .footer .cols{grid-template-columns:1fr}
}
.footer a{color: inherit; text-decoration:none}
.footer a:hover{text-decoration:underline}

.split{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  align-items:start;
}
@media (max-width: 900px){
  .split{grid-template-columns:1fr}
}

.label{display:block;margin:10px 0 6px;color:var(--muted);font-size:13px;font-weight:900}

/* ==========================
   Admin: members grid
   요구사항: 한 줄 3명, 이름/아이디/결제일만
   ========================== */
.membergrid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 10px;
}
@media (max-width: 900px){
  .membergrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .membergrid{ grid-template-columns: 1fr; }
}

.membercard{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15,23,42,0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.membercard:hover{
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 12px 32px rgba(15,23,42,0.08);
}
.membercard:active{ transform: translateY(1px); }

.mc-main{ min-width: 0; }
.mc-name{ font-weight: 900; font-size: 15px; line-height: 1.1; }
.mc-id{ color: var(--muted); font-weight: 800; font-size: 12px; margin-top: 6px; }
.mc-pay{ margin-top: 8px; font-size: 12px; color: var(--text); }

.mc-actions{
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================
   Admin: master-detail split (회원 목록 / 선택 회원 상세)
   ========================== */
.adminsplit{
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px){
  .adminsplit{ grid-template-columns: 1fr; }
}

.memberlist{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memberitem{
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 16px;
  padding: 12px 12px;
  box-shadow: 0 10px 28px rgba(15,23,42,0.06);
  cursor: pointer;
}
.memberitem:hover{
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 12px 32px rgba(15,23,42,0.08);
}
.memberitem.active{
  border-color: rgba(59,130,246,0.65);
  box-shadow: 0 12px 36px rgba(59,130,246,0.10);
}

.mi-name{ font-weight: 900; font-size: 15px; line-height: 1.1; }
.mi-id{ color: var(--muted); font-weight: 800; font-size: 12px; margin-top: 6px; }
.mi-meta{ margin-top: 8px; font-size: 12px; color: var(--text); }

.memberdetail{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 14px 14px;
  box-shadow: 0 10px 28px rgba(15,23,42,0.06);
}

.md-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.md-title{ font-size: 16px; font-weight: 900; }
.md-id{ color: var(--muted); font-weight: 800; font-size: 12px; }
.md-sub{ margin-top: 8px; font-size: 12px; }
.md-actions{ display: flex; gap: 8px; flex-shrink: 0; }

.md-block{ margin-top: 12px; }
.md-block-title{ font-weight: 900; font-size: 13px; }

.memberedit summary{
  font-weight: 900;
  cursor: pointer;
}


/* Home indices cards */
.indices-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width:100%;
}
@media (max-width: 1100px){
  .indices-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px){
  .indices-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.idx-card{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px 12px 10px;
  min-height: 120px;
}
.idx-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 6px;
}
.idx-badge{
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  opacity: 0.9;
  white-space: nowrap;
}
.idx-label{
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
}
.idx-value{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.1;
}
.idx-unit{
  font-size: 12px;
  font-weight: 700;
  opacity: 0.8;
}
.idx-chg{
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
}
.idx-src{
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.65;
}
.idx-card.up .idx-chg{ color: #ff4d4d; }
.idx-card.down .idx-chg{ color: #4da3ff; }
.idx-card.flat .idx-chg{ opacity: 0.9; }
.idx-card.missing{ opacity: 0.55; }

/* TradingView card (USDKRW) */
.idx-card.tv{
  overflow: hidden;
 min-height:120px;}
.idx-card.tv .tv-quote-wrap{
  margin-top: 8px;
}
.idx-card.tv iframe{
  width: 100% !important;
  max-width: 100% !important;
  border: 0 !important;
}
.indices-foot{
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}


/* Home indices ticker tape */
.indices-tape{
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  margin-bottom: 12px;
}
.tape-track{
  display: flex;
  width: max-content;
  gap: 0;
  animation: jlab-marquee 22s linear infinite;
  padding: 10px 12px;
}
.indices-tape:hover .tape-track{ animation-play-state: paused; }

.tape-group{
  display: flex;
  gap: 14px;
  align-items: center;
  padding-right: 14px;
}

.tape-item{
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.06);
  white-space: nowrap;
  font-size: 13px;
}
.tape-label{ opacity: .82; font-weight: 600; }
.tape-val{ font-variant-numeric: tabular-nums; font-weight: 700; }
.tape-chg{ font-variant-numeric: tabular-nums; font-weight: 700; }
.tape-item.up .tape-chg{ color: #ff5252; }
.tape-item.down .tape-chg{ color: #4da3ff; }
.tape-item.miss{ opacity: .65; }

@keyframes jlab-marquee{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}


/* === TradingView-like core indices cards (unified) === */
.marketbar{
  background: linear-gradient(135deg, rgba(37,99,235,0.10), rgba(16,185,129,0.08), rgba(255,255,255,0.70));
  border: 1px solid rgba(16,24,40,0.06);
  box-shadow: 0 10px 30px rgba(16,24,40,0.06);
}
.marketbar-title{
  font-weight: 800;
  letter-spacing: -0.2px;
}
.indices-grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px){
  .indices-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.idx-card{
  border: 1px solid rgba(16,24,40,0.08);
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  padding: 14px 14px 12px;
  min-height: 104px;
  box-shadow: 0 8px 18px rgba(16,24,40,0.06);
}
.idx-card.missing{
  background: rgba(255,255,255,0.78);
  opacity: 0.75;
}
.idx-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.idx-meta{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.idx-icon{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 12px;
  color: #111827;
  background: rgba(17,24,39,0.06);
  border: 1px solid rgba(17,24,39,0.10);
  flex: 0 0 auto;
}
.idx-names{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}
.idx-sym{
  display: none; /* hide English ticker/symbols */
}
.idx-label{
  font-size: 12px;
  font-weight: 700;
  color: rgba(17,24,39,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.idx-src{
  font-size: 11px;
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: linear-gradient(135deg, rgba(37,99,235,0.95), rgba(16,185,129,0.90));
  box-shadow: 0 6px 14px rgba(37,99,235,0.18);
  white-space: nowrap;
}

/* Source badge variants */
.idx-src.src-investing{ background: linear-gradient(135deg, rgba(59,130,246,0.95), rgba(99,102,241,0.90)); }
.idx-src.src-fmp{ background: linear-gradient(135deg, rgba(16,185,129,0.95), rgba(34,197,94,0.90)); }
.idx-src.src-yahoo{ background: linear-gradient(135deg, rgba(245,158,11,0.95), rgba(236,72,153,0.88)); }
.idx-src.src-stooq{ background: linear-gradient(135deg, rgba(17,24,39,0.92), rgba(99,102,241,0.75)); }
.idx-value{
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.4px;
  line-height: 1.05;
  margin-top: 2px;
  color: #111827;
}
.idx-unit{
  font-size: 14px;
  font-weight: 800;
  color: rgba(17,24,39,0.55);
}
.idx-chg{
  margin-top: 8px;
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(17,24,39,0.60);
}
.idx-chg .pill{
  font-size: 12px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,0.10);
  background: rgba(17,24,39,0.04);
}
.idx-card.up .idx-value{ color: #0F766E; }      /* teal */
.idx-card.down .idx-value{ color: #B42318; }    /* red  */
.idx-card.up .idx-chg .pill{ color: #0F766E; border-color: rgba(15,118,110,0.25); background: rgba(15,118,110,0.08); }
.idx-card.down .idx-chg .pill{ color: #B42318; border-color: rgba(180,35,24,0.25); background: rgba(180,35,24,0.08); }
/* hide old badge layout when present */
.idx-badge{ display:none !important; }
.tv-quote-wrap{ display:none !important; }

/* Sample board */
.sample-grid{ display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px; }
@media (max-width: 900px){ .sample-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px){ .sample-grid{ grid-template-columns: 1fr; } }
.sample-card{ text-align:left; border:1px solid rgba(229,231,235,.9); background:#fff; border-radius:18px; overflow:hidden;
  box-shadow: 0 10px 24px rgba(2,6,23,.06); cursor:pointer; padding:0; }
.sample-card:hover{ transform: translateY(-1px); box-shadow: 0 14px 30px rgba(2,6,23,.10); }
.sample-thumb{ width:100%; aspect-ratio: 16/9; background:#f3f4f6; }
.sample-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.sample-meta{ padding:12px 12px 14px; }
.sample-ttl{ font-weight:900; color:#0f172a; font-size:14px; }
.sample-sub{ font-weight:700; color:#64748b; font-size:12px; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Modal (auth-guard) */
.modal{ position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal[aria-hidden="true"]{ display: none; }
.modal-bg{ position: absolute; inset: 0; background: rgba(15,23,42,0.45); backdrop-filter: blur(2px); }
.modal-card{ position: relative; width: min(520px, 100%); background: rgba(255,255,255,0.96); border: 1px solid rgba(226,232,240,0.9);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(2,6,23,0.25); overflow: hidden; }
.modal-head{ display:flex; align-items:center; justify-content:space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(226,232,240,0.8); }
.modal-ttl{ font-weight: 900; color:#0f172a; }
.modal-body{ padding: 16px; }

/* Notice box (me.html) */
.noticebox{ margin: 12px 0 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(226,232,240,0.9);
  background: rgba(248,250,252,0.8); }
.notice-line{ font-weight: 800; color: rgba(15,23,42,0.78); font-size: 13px; }
.notice-line + .notice-line{ margin-top: 6px; }


/* Home: move core indices into hero left (2x2) */
.hero-main .home-indices{
  margin-top: 14px;
}
.hero-main .indices-grid.indices-grid-2x2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.hero-main .indices-foot{
  margin-top: 8px;
}


/* Home: indices left(2x2) + feed right, no hero */
.home-topgrid{
  max-width: 1200px;
  margin: 16px auto 24px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.home-topgrid .topgrid-left,
.home-topgrid .topgrid-right{
  width: 100%;
}
.home-topgrid .indices-grid.indices-grid-2x2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.home-topgrid .indices-foot{
  margin-top: 8px;
}
/* make cards fit better in left column */
.home-topgrid .index-card{
  min-height: 110px;
}
