/* assets/shell.css — layout for index.html only (not injected into pages/) */
*, *::before, *::after { box-sizing: border-box; margin:0; padding:0; }
html, body { height:100%; overflow:hidden; background: var(--bg); }
body {
  color: var(--text-h);
  font-family: Pretendard, 'Apple SD Gothic Neo', 'Segoe UI', system-ui, sans-serif;
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: 100vh;
}
body.sidebar-collapsed { grid-template-columns: 60px 1fr; }

/* ─── SIDEBAR (DARK) ─── */
.sidebar {
  position: relative;
  background: #0f172a;
  color: #e6edf5;
  border-right: 1px solid #1f2937;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  border-bottom: 1px solid #1f2937;
  min-height: 72px;
  text-align: center;
}
.brand-line1 {
  font-size: 15px; font-weight: 800; color: #ffffff;
  letter-spacing: .5px; line-height: 1.2;
}
.brand-line2 {
  font-size: 11px; font-weight: 600; color: #8a98ad;
  letter-spacing: .3px; line-height: 1.2; margin-top: 3px;
}
body.sidebar-collapsed .brand-line1,
body.sidebar-collapsed .brand-line2 { display: none; }
body.sidebar-collapsed .sidebar-head::after {
  content: "PS";
  font-size: 13px; font-weight: 800; color: #ffffff;
  letter-spacing: 1px;
}

/* Triangle toggle attached to border edge */
.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  width: 28px; height: 44px;
  background: #0f172a;
  color: #e6edf5;
  border: 1px solid #1f2937;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  z-index: 10;
  padding: 0;
}
.sidebar-toggle:hover { background:#1f2937; color:#fff; }
.sidebar-toggle::before { content: "◀"; }
body.sidebar-collapsed .sidebar-toggle::before { content: "▶"; }

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  color: #c5cfdf; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border-left: 3px solid transparent;
  white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: #1f2937; color: #ffffff; }
.nav-item.active {
  background: rgba(79,70,229,.22);
  color: #ffffff;
  border-left-color: var(--accent);
}
.nav-idx {
  font-size: 10px; font-weight: 700;
  color: #8a98ad; min-width: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}
.nav-item.active .nav-idx { color: #ffffff; opacity: .85; }
.nav-label { flex: 1; }
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-idx { display: none; }
body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
}
body.sidebar-collapsed .nav-item::before {
  content: attr(data-short);
  font-size: 10px; font-weight: 800; color: inherit;
  letter-spacing: .3px;
}

.sidebar-foot {
  border-top: 1px solid #1f2937;
  padding: 14px 16px;
}
.rate-box { display: flex; flex-direction: column; gap: 6px; }
.rate-label { font-size: 10px; font-weight: 700; color: #8a98ad; letter-spacing: 1px; text-transform: uppercase; }
.rate-row { display: flex; gap: 6px; align-items: center; }
.rate-input {
  flex: 1; border: 1px solid #1f2937; border-radius: 6px;
  padding: 6px 8px; font-size: 13px; color: #ffffff;
  font-variant-numeric: tabular-nums; text-align: right; outline: none;
  background: #1a2332;
}
.rate-input:focus { border-color: var(--accent); }
.rate-btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 6px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.rate-btn:hover { background: #4338ca; }
body.sidebar-collapsed .sidebar-foot { display: none; }

/* ─── MAIN ─── */
.main { display: flex; flex-direction: column; overflow: hidden; }
.header {
  height: 56px; min-height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.header-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-text { font-size: 14px; font-weight: 800; color: var(--text-h); }
.header-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-sub2); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.45} }

.frame-wrap { flex: 1; background: var(--bg); overflow: hidden; }
#page-frame { width: 100%; height: 100%; border: 0; display: block; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  body { grid-template-columns: 60px 1fr; }
  body .brand-line1,
  body .brand-line2,
  body .nav-label,
  body .rate-box { display: none; }
  body.sidebar-expanded { grid-template-columns: 250px 1fr; }
  body.sidebar-expanded .brand-line1,
  body.sidebar-expanded .brand-line2,
  body.sidebar-expanded .nav-label,
  body.sidebar-expanded .rate-box { display: revert; }
}
