/* HPLC 3D 시뮬레이터 전용 스타일 (sim/index.html). 공통 셸은 assets/css/sim.css */

.hs-top { gap: 14px; flex-wrap: wrap; }
.hs-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hs-toolbar .s-btn { padding: 6px 10px; font-size: 12px; text-decoration: none; }
.hs-toolbar kbd { font-size: 10px; opacity: 0.7; margin-left: 2px; }
.hs-toolbar .s-btn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.hs-toolbar .s-btn.danger-on { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.hs-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.s-btn.small { padding: 4px 9px; font-size: 11.5px; }

.hs-layout { grid-template-columns: minmax(0, 1fr) 380px; }
.hs-main { display: grid; grid-template-rows: minmax(0, 1fr) 240px; min-width: 0; min-height: 0; }
.hs-stage { min-height: 0; }
.hs-bottom { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); border-top: 1px solid var(--border); min-height: 0; background: var(--bg-elev); }
.hs-chrom, .hs-log { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.hs-log { border-left: 1px solid var(--border); }
.hs-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12px; border-bottom: 1px solid var(--border-soft); flex: none; }
.hs-head b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--accent); color: var(--on-accent); font-size: 11px; }
.hs-head .chk { font-size: 11.5px; }
.hs-grow { flex: 1; }
.hs-dim { color: var(--text-faint); font-size: 11.5px; }
#chrom { flex: 1; width: 100%; min-height: 0; display: block; }
#log { list-style: none; margin: 0; padding: 4px 8px; overflow-y: auto; flex: 1; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; }
#log li { white-space: pre-wrap; word-break: break-word; }
#log li time { color: var(--text-faint); margin-right: 6px; }
#log li.warn { color: var(--warn); }
#log li.error { color: var(--danger); }
#log li.ok { color: var(--accent); }

.hs-panel .tabs button { font-size: 12px; padding: 9px 2px; }
.hs-status { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 10px; border-bottom: 1px solid var(--border); flex: none; }
.hs-mod { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 5px 8px; font-size: 11.5px; background: var(--bg); cursor: pointer; }
.hs-mod .nm { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.hs-mod .st { font-size: 10.5px; font-weight: 700; margin-left: auto; }
.hs-mod .vals { font-family: var(--mono); color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.hs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.st-ready .hs-dot { background: #22c55e; } .st-ready .st { color: #16a34a; }
.st-notready .hs-dot { background: #eab308; } .st-notready .st { color: #ca8a04; }
.st-run .hs-dot { background: #3b82f6; } .st-run .st { color: #2563eb; }
.st-error .hs-dot { background: #ef4444; } .st-error .st { color: var(--danger); }
.st-off .st { color: var(--text-faint); }

.hs-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 8px 0; }
.hs-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.hs-form input, .hs-form select, .hs-table select {
  font: inherit; font-size: 12.5px; font-family: var(--mono); padding: 5px 7px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); min-width: 0;
}
.hs-form input.dirty { border-color: var(--warn); }
.hs-form output { font-family: var(--mono); font-size: 13px; color: var(--accent); padding: 5px 0; }
.hs-trace { width: 100%; height: 90px; display: block; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--bg); }
.hs-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.hs-table th, .hs-table td { padding: 4px 5px; border-bottom: 1px solid var(--border-soft); text-align: left; }
.hs-table th { color: var(--text-faint); font-size: 10.5px; }
.hs-table td.num { font-family: var(--mono); text-align: right; }
.hs-table .bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; min-width: 50px; }
.hs-table .bar i { display: block; height: 100%; background: var(--accent); }
.hs-table .air { color: var(--warn); font-weight: 700; }

.hs-tray { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 6px 0; }
.hs-tray button {
  font: inherit; font-size: 10.5px; padding: 6px 0 4px; border-radius: 50%; aspect-ratio: 1;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-faint); cursor: pointer; line-height: 1.1;
}
.hs-tray button.filled { background: var(--accent-soft); color: var(--text); border-color: var(--accent-dim); }
.hs-tray button.wash { background: var(--danger-soft); border-color: var(--danger); }
.hs-tray button.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.hs-tray button.inj { box-shadow: 0 0 0 3px #3b82f6 inset; }
.hs-tray-flip { display: flex; flex-direction: column-reverse; }

.hs-labels { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.hs-labels span {
  position: absolute; transform: translate(-50%, -120%); white-space: nowrap; font-size: 11px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; background: var(--overlay-strong); border: 1px solid var(--border); color: var(--text);
}
.hs-tip {
  position: absolute; z-index: 8; pointer-events: none; font-size: 11.5px; padding: 4px 8px; border-radius: 5px;
  background: var(--overlay-strong); border: 1px solid var(--border); color: var(--text); white-space: nowrap;
}
.hs-toast {
  position: absolute; z-index: 9; left: 50%; bottom: 46px; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  background: var(--overlay-strong); border: 1px solid var(--warn); color: var(--text);
}
.hs-card {
  position: relative; width: 290px; max-width: 70vw; padding: 12px 14px; font-size: 12px; line-height: 1.55;
  background: var(--overlay-strong); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius);
}
.hs-card h4 { margin: 0 0 2px; font-size: 14px; }
.hs-card .model { font-family: var(--mono); color: var(--accent); font-size: 11.5px; }
.hs-card ul { margin: 6px 0 0; padding-left: 16px; }
.hs-card-x { position: absolute; top: 6px; right: 8px; border: none; background: none; color: var(--text-faint); font-size: 18px; cursor: pointer; }
.hs-help { max-width: 560px; max-height: 86vh; overflow: auto; position: relative; }
.hs-help h3 { margin-top: 0; }
.modal[hidden] { display: none; }

@media (max-width: 1100px) {
  .hs-layout { grid-template-columns: 1fr; }
  .hs-page { height: auto; overflow: auto; }
  .hs-main { grid-template-rows: 62vh 260px; }
  .hs-panel { border-left: none; border-top: 1px solid var(--border); }
}
@media (max-width: 720px) {
  .hs-bottom { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .hs-main { grid-template-rows: 55vh auto; }
}
body.hs-embed .sim-back { display: none; }

/* 3D 조작부 · Instant Pilot 도움말 */
.hs-help h3 + .hs-table, .hs-help .hs-table + h3 { margin-top: 12px; }
.hs-help h3 { font-size: 14px; margin: 14px 0 6px; }
.hs-help h3:first-of-type { margin-top: 0; font-size: 16px; }

/* Playground 임베드: 3D 뷰 + 크로마토그램만, 모듈 상태는 3D 위에 겹쳐 표시 */
body.hs-embed .sim-top, body.hs-embed .hs-panel, body.hs-embed .hs-log, body.hs-embed .stage-tr { display: none; }
body.hs-embed.hs-page { height: 100vh; overflow: hidden; }
body.hs-embed .hs-layout { grid-template-columns: 1fr; }
body.hs-embed .hs-main { grid-template-rows: minmax(0, 1fr) 34%; }
body.hs-embed .hs-bottom { grid-template-columns: 1fr; }
body.hs-embed .stage-bl .drop-hint { display: none; }
.hs-status-embed {
  position: absolute; z-index: 5; right: 8px; top: 8px; width: 270px; padding: 6px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--overlay-strong); backdrop-filter: blur(4px);
}
.hs-status-embed .hs-mod { padding: 3px 6px; }
body.hs-embed .stage-tl { display: none; }
