/* =====================================================
   twin.css — 단백질 디지털 트윈 추가 스타일 (style.css 보강)
   ===================================================== */

.ko-title { font-size: .55em; color: var(--text-muted); font-weight: 400; }
.app-footer {
    margin: 30px 4px 12px; display: flex; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; color: var(--text-muted); font-size: .78rem;
    border-top: 1px solid var(--border); padding-top: 16px;
}
.btn-ghost {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: .82rem;
    transition: .15s;
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-bright); }
.mini-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------- TAB 1: PROTEIN TWIN ---------------- */
.twin-layout {
    display: grid; grid-template-columns: 320px 1fr 300px; gap: 18px; align-items: start;
}
@media (max-width: 1200px) { .twin-layout { grid-template-columns: 1fr; } }

.twin-controls h2 { font-size: 1.15rem; }
.seg-control { display: flex; flex-direction: column; gap: 6px; }
.seg-btn {
    text-align: left; padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    cursor: pointer; font-size: .85rem; transition: .15s;
}
.seg-btn:hover { background: var(--surface-hover); }
.seg-btn.active {
    border-color: var(--border-bright); background: rgba(102,153,255,.14);
    box-shadow: 0 0 0 1px var(--border-bright) inset;
}
.seg-btn .seg-sub { display: block; font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
    padding: 7px 11px; border-radius: 20px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted); cursor: pointer;
    font-size: .78rem; transition: .15s; user-select: none;
}
.chip:hover { background: var(--surface-hover); color: var(--text); }
.chip.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; border-color: transparent; font-weight: 600;
}
.chip.disabled { opacity: .35; cursor: not-allowed; }

.disease-desc {
    margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: rgba(34,211,238,.06); border: 1px solid rgba(34,211,238,.18);
    font-size: .8rem; color: var(--text); line-height: 1.5;
}
.metrics-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.metric-card {
    padding: 12px; border-radius: var(--radius-sm); background: var(--surface);
    border: 1px solid var(--border); text-align: center;
}
.metric-card .mv { font-size: 1.5rem; font-weight: 800; font-family: 'Outfit'; }
.metric-card .ml { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }
.metric-card.good .mv { color: var(--success); }
.metric-card.warn .mv { color: var(--warn); }
.metric-card.bad .mv { color: var(--danger); }

.tracked-genes { margin-top: 16px; }
.tracked-genes h4 { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; }
.gene-pill {
    padding: 4px 9px; border-radius: 6px; background: rgba(168,85,247,.14);
    border: 1px solid rgba(168,85,247,.3); color: #d8b4fe; font-size: .74rem;
    font-family: 'JetBrains Mono', monospace; cursor: pointer;
}
.gene-pill:hover { background: rgba(168,85,247,.26); }

.twin-viz .viz-head, .twin-side .viz-head {
    display: flex; justify-content: space-between; align-items: center;
    margin: 6px 0 8px;
}
.twin-viz .viz-head h3, .twin-side h3 { font-size: .95rem; }
.chart-box { position: relative; height: 240px; }
.chart-box.small { height: 180px; }
.slider-group { margin: 12px 0; }
.slider-group label {
    display: flex; justify-content: space-between; font-size: .78rem;
    color: var(--text-muted); margin-bottom: 5px;
}
.slider-group label span { color: var(--accent2); font-family: 'JetBrains Mono'; }
.slider-group input[type=range] { width: 100%; accent-color: var(--primary); }

/* ---------------- TAB 2: PROTEIN ATLAS ---------------- */
.atlas-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .atlas-layout { grid-template-columns: 1fr; } }
.atlas-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.atlas-controls .search-input { flex: 1 1 180px; }
.atlas-count { font-size: .78rem; color: var(--text-muted); margin-bottom: 10px; }
.atlas-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px; max-height: 70vh; overflow-y: auto; padding-right: 4px;
}
.prot-card {
    padding: 11px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--surface); cursor: pointer; transition: .15s; position: relative;
}
.prot-card:hover { background: var(--surface-hover); border-color: var(--border-bright); transform: translateY(-2px); }
.prot-card.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.prot-card .pc-gene { font-family: 'JetBrains Mono'; font-weight: 600; font-size: .95rem; }
.prot-card .pc-name { font-size: .68rem; color: var(--text-muted); margin: 3px 0 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prot-card .pc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.axis-tag {
    font-size: .62rem; padding: 2px 6px; border-radius: 5px; font-weight: 600;
}
.role-driver { color: #fca5a5; } .role-protector { color: #86efac; } .role-modulator { color: #93c5fd; }
.pc-ev { position: absolute; top: 8px; right: 9px; font-size: .62rem; color: var(--text-muted); }
.pc-seed { position: absolute; top: 8px; right: 9px; font-size: .6rem; color: var(--accent);}

.atlas-detail-panel { min-height: 500px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head h2 { font-family: 'JetBrains Mono'; font-size: 1.6rem; }
.d-name { color: var(--text-muted); font-size: .85rem; margin-top: 2px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.dbadge { font-size: .68rem; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.ngl-viewer {
    width: 100%; height: 320px; margin: 14px 0 6px; border-radius: var(--radius-sm);
    background: #05070e; border: 1px solid var(--border); position: relative; overflow: hidden;
}
.ngl-viewer .ngl-loading {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: .82rem;
}
.plddt-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .68rem; color: var(--text-muted); }
.plddt-legend .lg { padding: 2px 7px; border-radius: 4px; color: #06121f; font-weight: 600; }
.lg-vh { background: #0053d6; color: #fff; } .lg-c { background: #65cbf3; } .lg-l { background: #ffdb13; } .lg-vl { background: #ff7d45; }
.plddt-val { margin-left: auto; color: var(--text); font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.detail-grid .dg { padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.detail-grid .dg .k { font-size: .66rem; color: var(--text-muted); }
.detail-grid .dg .v { font-size: .86rem; font-weight: 600; margin-top: 2px; }
.detail-section { margin: 12px 0; }
.detail-section h4 { font-size: .82rem; color: var(--text-muted); margin-bottom: 6px; }
.detail-section p { font-size: .85rem; line-height: 1.55; }
.evidence-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.evidence-item { font-size: .76rem; padding: 7px 9px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); }
.evidence-item .ey { color: var(--accent2); font-family: 'JetBrains Mono'; margin-right: 6px; }
.detail-links { display: flex; gap: 8px; margin-top: 12px; }
.detail-links a {
    flex: 1; text-align: center; padding: 9px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-bright); background: rgba(102,153,255,.1);
    color: var(--primary); text-decoration: none; font-size: .8rem; font-weight: 600;
}
.detail-links a:hover { background: rgba(102,153,255,.2); }

/* ---------------- TAB 3: KNOWLEDGE GRAPH ---------------- */
.graph-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.graph-legend, .graph-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: .76rem; }
.graph-filters label { display: flex; align-items: center; gap: 5px; color: var(--text-muted); }
.gl { display: flex; align-items: center; gap: 5px; color: var(--text-muted); }
.gl::before { content: ''; width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.gl-protein::before { background: #6699ff; } .gl-pathway::before { background: #a855f7; }
.gl-disease::before { background: #f87171; } .gl-axis::before { background: #22d3ee; }
.gl-drug::before { background: #34d399; }
#graph-canvas { width: 100%; height: 68vh; display: block; border-radius: var(--radius-sm); background: radial-gradient(circle at 50% 40%, #0a1020, #05070e); cursor: grab; }
.graph-tooltip {
    position: fixed; pointer-events: none; z-index: 100; padding: 8px 11px;
    background: rgba(8,12,22,.95); border: 1px solid var(--border-bright);
    border-radius: 8px; font-size: .76rem; max-width: 260px; box-shadow: var(--shadow);
}
.graph-tooltip .tt-title { font-weight: 700; font-family: 'JetBrains Mono'; margin-bottom: 3px; }
.graph-tooltip .tt-sub { color: var(--text-muted); font-size: .7rem; }

/* ---------------- NEW PAPERS ---------------- */
.newpapers-section { margin-top: 22px; }
.newpapers-section h3 { font-size: 1rem; margin-bottom: 10px; }
.newpapers-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.newpaper-card { padding: 11px 13px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.newpaper-card .np-title { font-size: .82rem; font-weight: 600; line-height: 1.4; }
.newpaper-card .np-meta { font-size: .7rem; color: var(--text-muted); margin-top: 5px; }
.newpaper-card .np-target { color: var(--accent2); font-family: 'JetBrains Mono'; }

.targets-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.targets-cell .tg { font-size: .68rem; font-family: 'JetBrains Mono'; padding: 1px 5px; border-radius: 4px; background: rgba(102,153,255,.12); color: #9db8ff; }

/* ---------------- CALIBRATION TAB ---------------- */
.cal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cal-target-sel { display: flex; flex-direction: column; gap: 5px; min-width: 240px; }
.cal-target-sel label { font-size: .72rem; color: var(--text-muted); }
.cal-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.cal-card { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); min-width: 110px; }
.cal-card.big { background: linear-gradient(135deg, rgba(102,153,255,.16), rgba(168,85,247,.12)); border-color: var(--border-bright); }
.cal-card .mv { font-size: 1.7rem; font-weight: 800; font-family: 'Outfit'; color: var(--accent2); }
.cal-card.big .mv { color: #fff; }
.cal-card .mv-sm { font-size: .72rem; color: var(--text); font-family: 'JetBrains Mono'; }
.cal-card .ml { font-size: .68rem; color: var(--text-muted); margin-top: 3px; }
.cal-card.wide { flex: 1; min-width: 260px; }
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.cal-axis-card { padding: 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.cal-axis-head { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; margin-bottom: 6px; }
.cal-r2 { font-size: .68rem; padding: 2px 7px; border-radius: 5px; font-family: 'JetBrains Mono'; }
.cal-r2.good { background: rgba(52,211,153,.18); color: #86efac; }
.cal-r2.warn { background: rgba(251,191,36,.18); color: #fcd34d; }
.cal-r2.bad { background: rgba(248,113,113,.18); color: #fca5a5; }
.cal-axis-chart { height: 130px; position: relative; }
.cal-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .cal-foot { grid-template-columns: 1fr; } }
.cal-foot h4 { font-size: .85rem; color: var(--text-muted); margin-bottom: 8px; }
.cal-param-table { max-height: 280px; overflow-y: auto; font-family: 'JetBrains Mono'; font-size: .72rem; }
.cal-prow { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.cal-prow:nth-child(odd) { background: rgba(255,255,255,.02); }
.cal-prow .pk { color: var(--text); } .cal-prow .pi { color: var(--text-muted); } .cal-prow .pa { color: var(--accent2); font-weight: 600; }
.cal-param-table::before { content: '파라미터 / 상대표준오차 / COPASI 추정'; display: block; font-size: .66rem; color: var(--text-muted); padding: 4px 8px; }
.cal-provenance { font-size: .76rem; color: var(--text-muted); line-height: 1.5; max-height: 280px; overflow-y: auto; }
.cal-provenance ul { padding-left: 18px; margin-top: 6px; } .cal-provenance li { margin-bottom: 4px; }
.cal-note { font-style: italic; margin-bottom: 8px; color: var(--text); }

.cal-banner { margin: 6px 0 14px; padding: 11px 14px; border-radius: var(--radius-sm); background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25); font-size: .78rem; line-height: 1.55; color: var(--text); }
.cal-banner i { color: var(--text-muted); }
.pflag { font-size: .6rem; color: var(--warn); }

/* ---------------- CYCLE-COUPLED (COMBINE) ---------------- */
.cal-coupled-section { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.cal-coupled-section h4 { font-size: .95rem; margin-bottom: 4px; }
.cal-coupled { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.coupled-row { display: grid; grid-template-columns: 220px 1fr 170px; gap: 10px; align-items: center; font-size: .78rem; }
.coupled-lab { color: var(--text); font-family: 'JetBrains Mono'; font-size: .72rem; }
.coupled-bar-wrap { height: 14px; background: var(--surface); border-radius: 7px; overflow: hidden; border: 1px solid var(--border); }
.coupled-bar { display: block; height: 100%; border-radius: 7px; transition: width .4s; }
.coupled-bar.good { background: linear-gradient(90deg, #34d399, #22d3ee); }
.coupled-bar.warn { background: linear-gradient(90deg, #fbbf24, #fb923c); }
.coupled-bar.bad { background: linear-gradient(90deg, #f87171, #ef4444); }
.coupled-val { color: var(--text-muted); font-size: .72rem; text-align: right; }
@media (max-width: 700px) { .coupled-row { grid-template-columns: 1fr; gap: 3px; } }

/* ---------------- FULL-TEXT GROUNDING ---------------- */
.grounding-list { display: flex; flex-direction: column; gap: 7px; max-height: 240px; overflow-y: auto; }
.grounding-item { padding: 8px 10px; border-radius: 8px; background: rgba(52,211,153,.06); border: 1px solid rgba(52,211,153,.2); }
.gr-paper { font-size: .73rem; color: #86efac; font-weight: 600; margin-bottom: 4px; }
.gr-hits { color: var(--text-muted); font-weight: 400; font-size: .66rem; }
.gr-quote { font-size: .73rem; color: var(--text); line-height: 1.45; font-style: italic; opacity: .9; }

/* ---------------- INDEPENDENT VALIDATION ---------------- */
.cal-validation { margin: 6px 0 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: linear-gradient(135deg, rgba(52,211,153,.1), rgba(34,211,238,.06)); border: 1px solid rgba(52,211,153,.3); }
.val-head { font-size: .95rem; font-weight: 700; margin-bottom: 12px; }
.val-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.val-card { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); min-width: 110px; }
.val-card.big { background: rgba(52,211,153,.16); border-color: rgba(52,211,153,.4); }
.val-card .vv { font-size: 1.5rem; font-weight: 800; font-family: 'Outfit'; color: var(--success); }
.val-card .vl { font-size: .66rem; color: var(--text-muted); margin-top: 3px; }
.val-note { font-size: .74rem; color: var(--text); margin-top: 10px; line-height: 1.5; }
.val-note.dim { color: var(--text-muted); font-size: .7rem; }
.val-pm { font-size: .76rem; color: var(--text); margin-top: 9px; padding: 8px 11px; border-radius: 8px; background: rgba(102,153,255,.08); border: 1px solid rgba(102,153,255,.2); line-height: 1.5; }
.val-pm b { color: var(--accent2); }
