/* ============================================================
   몰래스탁 — 오피스 위장 모드
   엑셀(M365 정밀 재현) / 파워포인트 / 포토샵 / VS Code
   ============================================================ */

.chrome { display: none; height: 100vh; flex-direction: column; }
body[data-office="excel"]  #chrome-excel,
body[data-office="ppt"]    #chrome-ppt,
body[data-office="ps"]     #chrome-ps,
body[data-office="vscode"] #chrome-vscode { display: flex; }
body:not([data-office="none"]) { overflow: hidden; }

.slot { flex: 1; min-height: 0; overflow: auto; position: relative; }

.win-btns { margin-left: auto; display: flex; flex-shrink: 0; }
.win-btns i {
  font-style: normal; width: 40px; text-align: center; padding: 4px 0; font-size: 12px;
  opacity: .9; cursor: default;
}
.win-btns i.close { cursor: pointer; }
.win-btns i.close:hover { background: #e81123; color: #fff; }

/* ============================================================
   위장 중 사이트 리스킨 (공통)
   ============================================================ */
body:not([data-office="none"]) #site { min-height: 100%; }
body:not([data-office="none"]) .logo,
body:not([data-office="none"]) #office-btn { display: none; }
body:not([data-office="none"]) #topbar { padding: 6px 12px; position: static; }
body:not([data-office="none"]) #gnav { position: static; padding: 0 8px; }
body:not([data-office="none"]) #gnav button { font-size: 12.5px; padding: 8px 11px; }
body:not([data-office="none"]) #view { padding: 12px 12px 20px; }
body:not([data-office="none"]) .card { box-shadow: none; border: 1px solid var(--line); }

/* ============================================================
   EXCEL (Microsoft 365)
   ============================================================ */
body[data-office="excel"] {
  --bg: #ffffff; --surface: #ffffff; --fg: #262626; --sub: #737373;
  --line: #d9d9d9; --brand: #107C41; --sel: #e7f1ec; --head: #f5f5f5;
  --radius: 0px; --shadow: none;
}

#chrome-excel { background: #fff; }

/* 제목 표시줄 */
.xl-title {
  background: #185C37; color: #fff; display: flex; align-items: center;
  padding: 3px 0 3px 10px; font-size: 12px; gap: 10px; user-select: none; height: 34px;
}
.xl-appicon { flex-shrink: 0; }
.xl-autosave { display: flex; align-items: center; gap: 5px; font-size: 11.5px; opacity: .95; white-space: nowrap; }
.xl-autosave b { font-weight: normal; }
.xl-toggle {
  width: 22px; height: 12px; background: #0f3d24; border-radius: 7px; position: relative; display: inline-block;
}
.xl-toggle::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 8px; height: 8px;
  border-radius: 50%; background: #fff;
}
.xl-qat { display: flex; gap: 2px; align-items: center; }
.xl-qat svg { padding: 3px 6px; opacity: .9; }
.xl-searchpill {
  flex: 1; max-width: 460px; margin: 0 auto; background: rgba(255,255,255,.16);
  border-radius: 5px; font-size: 11.5px; padding: 4px 12px; display: flex; align-items: center; gap: 7px;
  white-space: nowrap; overflow: hidden; opacity: .95;
}
.xl-user {
  width: 24px; height: 24px; border-radius: 50%; background: #c43e1c; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0;
}

/* 리본 탭 */
.xl-menubar {
  background: #fff; display: flex; align-items: center; font-size: 12.5px; color: #444;
  padding: 0 6px; user-select: none; border-bottom: 1px solid #e5e5e5;
}
.xl-menubar span { padding: 8px 12px; cursor: default; }
.xl-menubar span:hover { color: #107C41; }
.xl-menubar .file { background: #185C37; color: #fff; padding: 8px 16px; margin-right: 2px; }
.xl-menubar .on { color: #107C41; font-weight: bold; box-shadow: inset 0 -2.5px 0 #107C41; }
.xl-menu-right { margin-left: auto; display: flex; gap: 4px; }
.xl-menu-right span { font-size: 11.5px; color: #555; }
.xl-share { background: #107C41; color: #fff !important; border-radius: 4px; margin: 4px 0; padding: 4px 12px !important; }

/* 리본 본문 */
.xl-ribbon {
  background: #f5f6f7; border-bottom: 1px solid #d9d9d9; display: flex;
  padding: 4px 8px 0; user-select: none; overflow: hidden; height: 92px;
}
.xl-group {
  display: flex; flex-direction: column; border-right: 1px solid #e2e2e2;
  padding: 4px 10px 2px 8px; position: relative; flex-shrink: 0;
}
.xl-gname {
  margin-top: auto; text-align: center; font-size: 10px; color: #888; padding: 3px 0 4px;
}
.xl-paste {
  float: left; display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px 4px; border-radius: 4px; font-size: 10.5px; color: #333; line-height: 1.25;
  text-align: center;
}
.xl-paste:hover { background: #e3e8e5; }
.xl-group:first-child { flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
.xl-group:first-child .xl-gname { position: absolute; bottom: 0; left: 0; right: 0; }
.xl-minis { display: flex; flex-direction: column; gap: 1px; padding: 4px 2px 0 4px; }
.xl-minis i {
  font-style: normal; font-size: 10.5px; color: #444; display: flex; align-items: center; gap: 5px;
  padding: 2px 6px; border-radius: 3px; white-space: nowrap;
}
.xl-minis i:hover { background: #e3e8e5; }

.xl-fontrow { display: flex; gap: 2px; align-items: center; padding: 2px 0; }
.xl-select {
  background: #fff; border: 1px solid #c9c9c9; border-radius: 3px; font-size: 11px; color: #333;
  padding: 2px 6px; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap;
}
.xl-select.wide { min-width: 86px; justify-content: space-between; }
.xl-select b { color: #888; font-weight: normal; font-size: 9px; }
.xl-ib {
  font-style: normal; font-size: 12px; color: #333; padding: 3px 6px; border-radius: 3px;
  display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; line-height: 1.1;
}
.xl-ib:hover { background: #e3e8e5; }
.xl-ib.b { font-weight: 900; }
.xl-ib.i { font-style: italic; }
.xl-ib.u { text-decoration: underline; }
.xl-ib.txt { font-size: 10.5px; color: #444; }
.xl-ib.sm { font-size: 8.5px; text-align: center; }
.xl-ib sup, .xl-ib sub { font-size: 8px; }
.xl-ib.colorA { position: relative; padding-bottom: 6px; }
.xl-ib.colorA .bar { position: absolute; left: 6px; right: 14px; bottom: 3px; height: 3.5px; background: #e11; }
.xl-stylerow { display: flex; gap: 2px; padding: 2px 0; }
.xl-bigbtn {
  font-style: normal; display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 9.5px; color: #333; padding: 5px 8px 3px; border-radius: 4px; line-height: 1.25; text-align: center;
}
.xl-bigbtn:hover { background: #e3e8e5; }

/* 수식 입력줄 */
.xl-formula {
  display: flex; align-items: stretch; background: #fff; border-bottom: 1px solid #d9d9d9;
  font-size: 12px; color: #444; user-select: none; height: 26px;
}
.xl-namebox {
  border-right: 1px solid #d9d9d9; padding: 4px 10px; min-width: 76px;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.xl-namebox b { color: #999; font-weight: normal; font-size: 9px; }
.xl-fx { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-right: 1px solid #d9d9d9; }
.xl-fx i { font-style: normal; color: #bbb; font-size: 11px; }
.xl-fx em { font-style: italic; color: #666; font-family: Georgia, serif; }
.xl-formula-text {
  display: flex; align-items: center; padding: 0 10px; font-family: Consolas, monospace;
  font-size: 12px; color: #333; white-space: nowrap; overflow: hidden; flex: 1;
}

/* 워크북 본문(그리드/차트/뉴스/메모/시트탭)은 excel.css의 xw-* 담당 */
.xl-navarrows { padding: 4px 8px; color: #888; letter-spacing: 4px; }

/* ============================================================
   POWERPOINT (M365 라이트) — 슬라이드가 곧 대시보드 (ppt.js)
   ============================================================ */
body[data-office="ppt"] #site { display: none; }
#chrome-ppt { background: #ededed; font-family: "Malgun Gothic", "맑은 고딕", "Segoe UI", sans-serif; color: #262626; }

.pp-titlebar {
  background: #f9f9f9; color: #333; display: flex; align-items: center;
  padding: 3px 0 3px 10px; font-size: 12px; gap: 10px; user-select: none; height: 36px;
  border-bottom: 1px solid #e8e8e8;
}
.pp-titlebar .xl-toggle { background: #c8cdd2; }
.pp-titlebar .xl-qat svg { color: #555; }
.pp-appicon { flex-shrink: 0; }
.pp-docname {
  font-size: 12px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
.pp-search {
  flex: 1; max-width: 320px; margin: 0 auto; background: #fff; border: 1px solid #d9d9d9;
  border-radius: 5px; font-size: 11.5px; color: #666; padding: 4px 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.pp-user {
  width: 24px; height: 24px; border-radius: 50%; background: #C43E1C; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0;
}
#chrome-ppt .win-btns i { color: #555; }
#chrome-ppt .win-btns i.close:hover { color: #fff; }

.pp-menubar {
  background: #fff; display: flex; align-items: center; font-size: 12.5px; color: #444;
  padding: 0 6px; user-select: none; border-bottom: 1px solid #e5e5e5;
}
.pp-menubar span { padding: 8px 11px; cursor: default; white-space: nowrap; }
.pp-menubar span:hover { color: #C43E1C; }
.pp-menubar .file { color: #444; }
.pp-menubar .on { color: #C43E1C; font-weight: bold; box-shadow: inset 0 -2.5px 0 #C43E1C; }
.pp-menu-right { margin-left: auto; display: flex; }
.pp-share {
  background: #C43E1C; color: #fff; border-radius: 4px; margin: 4px 4px; padding: 4px 12px !important;
  font-size: 11.5px;
}

/* 리본 자체는 엑셀의 xl-* 그룹 컴포넌트 재사용 */
.pp-ribbon {
  background: #f5f6f7; border-bottom: 1px solid #d9d9d9; display: flex;
  padding: 4px 8px 0; user-select: none; overflow: hidden; height: 92px; flex-shrink: 0;
}
.pp-ribbon .xl-paste:hover, .pp-ribbon .xl-ib:hover, .pp-ribbon .xl-minis i:hover, .pp-ribbon .xl-bigbtn:hover { background: #f0e2dd; }

.pp-body { flex: 1; min-height: 0; display: flex; }
.pp-thumbs {
  width: 152px; background: #f6f6f6; border-right: 1px solid #ddd;
  padding: 10px 10px; display: flex; flex-direction: column; gap: 9px; user-select: none;
  overflow-y: auto; flex-shrink: 0;
}
.pp-thumb { display: flex; gap: 7px; align-items: flex-start; cursor: pointer; }
.pp-thumb b { font-size: 11px; color: #666; font-weight: normal; padding-top: 1px; width: 10px; text-align: right; }
.pp-thumb-body { flex: 1; min-width: 0; }
.pp-thumb-label {
  display: block; font-size: 9.5px; color: #888; padding: 3px 1px 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.pp-thumb.on .pp-thumb-label { color: #C43E1C; font-weight: 700; }
.ppm-2col { flex: 1; display: flex; gap: 8%; }
.ppm-2col span { flex: 1; display: flex; flex-direction: column; gap: 12%; }
.ppm-2col i { height: 7%; min-height: 2px; background: #e3e3e3; }
.ppm-bars { flex: 1; display: flex; flex-direction: column; gap: 14%; justify-content: center; }
.ppm-bars i { height: 11%; min-height: 3px; background: #d9a8a0; border-radius: 1px; }
.ppm {
  flex: 1; aspect-ratio: 16/9; background: #fff; border: 1px solid #c9c9c9;
  padding: 7% 8%; display: flex; flex-direction: column; gap: 6%; border-radius: 1px; min-width: 0;
}
.pp-thumb.on .ppm { outline: 2.5px solid #C43E1C; outline-offset: 1px; }
.ppm b { display: block; height: 9%; width: 55%; background: #b9b3ae; border-radius: 1px; }
.ppm-cover { background: linear-gradient(160deg, #23384a 55%, #2c4a63 100%); position: relative; }
.ppm-cover i { position: absolute; left: 0; right: 0; bottom: 18%; height: 22%; background: #a08023; }
.ppm-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6%; }
.ppm-grid i { background: #eee; border: 1px solid #ddd; border-radius: 1px; }
.ppm-rows { flex: 1; display: flex; flex-direction: column; gap: 9%; }
.ppm-rows i { height: 8%; min-height: 2px; background: #e3e3e3; border-radius: 1px; }
.ppm-chart { flex: 1; background: linear-gradient(180deg, #fbe9e4 0%, #f4f4f4 90%); border: 1px solid #eee; }
.ppm-para { flex: 1; display: flex; flex-direction: column; gap: 10%; }
.ppm-para i { height: 6%; min-height: 2px; background: #e3e3e3; }

.pp-stagewrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 22px 30px; overflow: auto;
}
.pp-slide16 {
  aspect-ratio: 16/9; width: min(100%, calc((100vh - 320px) * 16 / 9), 1180px);
  background: #fff; box-shadow: 0 3px 18px rgba(0, 0, 0, .3); position: relative; overflow: hidden;
  container-type: inline-size;
}
.pp-notes {
  background: #fff; border-top: 1px solid #ddd; color: #999; font-size: 12px;
  padding: 9px 26px; user-select: none; flex-shrink: 0;
}
.pp-status {
  background: #f3f2f1; border-top: 1px solid #d4d4d4; display: flex; gap: 16px;
  font-size: 11.5px; color: #555; padding: 4px 14px; user-select: none; white-space: nowrap; overflow: hidden;
}
.pp-status .grow { flex: 1; }

/* ---- 슬라이드 내용 (cqw = 슬라이드 폭 비례) ---- */
.ppd-cover { position: absolute; inset: 0; background: linear-gradient(160deg, #1d2f40 0%, #24405a 70%, #2c4a63 100%); }
.ppd-cover-wave {
  position: absolute; inset: 0; opacity: .5;
  background:
    radial-gradient(120cqw 60cqw at 110% -20%, transparent 59%, rgba(255,255,255,.10) 60%, transparent 61.5%),
    radial-gradient(130cqw 70cqw at 115% -25%, transparent 63%, rgba(255,255,255,.08) 64%, transparent 65.5%),
    radial-gradient(150cqw 80cqw at -15% 125%, transparent 64%, rgba(255,255,255,.10) 65%, transparent 66.5%),
    radial-gradient(160cqw 90cqw at -20% 130%, transparent 68%, rgba(255,255,255,.07) 69%, transparent 70.5%);
}
.ppd-cover-band {
  position: absolute; left: 0; right: 0; bottom: 16cqh; bottom: 16%; background: #a08023;
  display: flex; justify-content: space-between; align-items: center; padding: 2.2cqw 4cqw;
}
.ppd-cover-left small { color: #f4e9c8; font-size: 1.5cqw; letter-spacing: .1em; }
.ppd-cover-left h1 { margin: .6cqw 0 0; color: #fff; font-size: 3.6cqw; line-height: 1.3; letter-spacing: -.02em; }
.ppd-cover-right { text-align: right; color: #fff; }
.ppd-cover-right b { font-size: 1.9cqw; }
.ppd-cover-right hr { border: 0; border-top: 1px solid rgba(255,255,255,.55); margin: .8cqw 0; }
.ppd-cover-right span { font-size: 1.7cqw; color: #f4e9c8; }
.ppd-cover-foot { position: absolute; left: 0; right: 0; bottom: 3.5%; text-align: center; color: rgba(255,255,255,.55); font-size: 1.4cqw; }

.ppd-page { position: absolute; inset: 0; padding: 4.5cqw 5.5cqw; display: flex; flex-direction: column; }
.ppd-title {
  font-size: 3cqw; font-weight: 800; color: #23384a; padding-bottom: 1.2cqw; margin-bottom: 2.4cqw;
  border-bottom: .45cqw solid #C43E1C; letter-spacing: -.02em;
}
.ppd-title small { font-size: 1.5cqw; color: #999; font-weight: normal; margin-left: 1cqw; }
.ppd-pageno { position: absolute; right: 3cqw; bottom: 2cqw; font-size: 1.6cqw; color: #b0b0b0; }

.ppd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2cqw; margin-bottom: 2.6cqw; }
.ppd-stats.col3 { grid-template-columns: repeat(3, 1fr); gap: 1.6cqw; margin-bottom: 2cqw; }
.ppd-stat {
  border: 1px solid #e2e2e2; border-top: .5cqw solid #C43E1C; padding: 1.6cqw 1.8cqw; background: #fbfbfb;
}
.ppd-stat span { display: block; font-size: 1.5cqw; color: #888; font-weight: 700; letter-spacing: .04em; }
.ppd-stat b { display: block; font-size: 3.1cqw; color: #222; margin: .7cqw 0 .4cqw; letter-spacing: -.02em; }
.ppd-stat i { font-style: normal; font-size: 1.55cqw; }
.ppd-stat .up { color: #C0504D; }
.ppd-stat .down { color: #4F81BD; }

.ppd-bullets { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4cqw; font-size: 1.8cqw; }
.ppd-bullets b { color: #23384a; font-size: 1.8cqw; }
.ppd-bullets ul { margin: .8cqw 0 1.6cqw; padding-left: 2.4cqw; }
.ppd-bullets li { margin-bottom: .7cqw; color: #333; }
.ppd-bullets .up { color: #C0504D; font-style: normal; }
.ppd-bullets .down { color: #4F81BD; font-style: normal; }

.ppd-table { width: 100%; border-collapse: collapse; font-size: 1.75cqw; }
.ppd-table th { background: #23384a; color: #fff; padding: 1cqw 1.4cqw; text-align: left; font-weight: 700; }
.ppd-table td { padding: .9cqw 1.4cqw; border-bottom: 1px solid #e4e4e4; color: #333; }
.ppd-table tr:nth-child(even) td { background: #f7f8f9; }
.ppd-table .num { font-variant-numeric: tabular-nums; }
.ppd-table .up { color: #C0504D; }
.ppd-table .down { color: #4F81BD; }
.ppd-note { font-size: 1.4cqw; color: #999; margin-top: auto; }

.ppd-chartwrap { flex: 1; min-height: 0; border: 1px solid #e4e4e4; padding: 1cqw; }
.ppd-chartwrap canvas { display: block; width: 100%; height: 100%; }

.ppd-newslist { list-style: none; margin: 0; padding: 0; }
.ppd-newslist li { border-left: .5cqw solid #C43E1C; padding: .6cqw 0 .6cqw 1.6cqw; margin-bottom: 1.6cqw; }
.ppd-newslist b { display: block; font-size: 1.95cqw; color: #222; line-height: 1.45; }
.ppd-newslist span { font-size: 1.4cqw; color: #999; }

.ppd-quote {
  margin: 0 0 2cqw; padding: 1.6cqw 2.2cqw; background: #f7f4ef; border-left: .6cqw solid #a08023;
  font-size: 2.3cqw; font-weight: 700; color: #23384a; line-height: 1.5;
}
.ppd-para { font-size: 1.85cqw; color: #333; line-height: 1.85; margin: 0 0 1.4cqw; }

/* 급등·급락 / 투자자별 / 글로벌 슬라이드 */
.ppd-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4cqw; }
.ppd-2col.wide { gap: 0 5cqw; }
.ppd-colhead {
  font-size: 2cqw; font-weight: 800; color: #23384a; padding-bottom: 1cqw; margin-bottom: 1.2cqw;
  border-bottom: .25cqw solid #e0e0e0;
}
.ppd-colhead small { font-size: 1.4cqw; color: #999; font-weight: normal; margin-left: .8cqw; }
.ppd-colhead.up { color: #C0504D; border-bottom-color: #C0504D; }
.ppd-colhead.down { color: #4F81BD; border-bottom-color: #4F81BD; }
.ppd-mvlist { list-style: none; margin: 0; padding: 0; }
.ppd-mvlist li {
  display: flex; align-items: center; gap: 1.4cqw; padding: 1cqw .4cqw;
  border-bottom: 1px solid #efefef; font-size: 1.85cqw; color: #333;
}
.ppd-mvlist span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppd-mvlist b { font-variant-numeric: tabular-nums; font-weight: 600; }
.ppd-mvlist i { font-style: normal; min-width: 8cqw; text-align: right; font-variant-numeric: tabular-nums; }
.ppd-mvlist .up { color: #C0504D; }
.ppd-mvlist .down { color: #4F81BD; }

.ppd-ivrow { display: flex; align-items: center; gap: 1.4cqw; padding: 1.1cqw 0; font-size: 1.8cqw; }
.ppd-ivrow > span { width: 7cqw; color: #666; flex-shrink: 0; }
.ppd-ivbar { flex: 1; height: 1.7cqw; background: #f0f0f0; border-radius: .8cqw; overflow: hidden; }
.ppd-ivbar i { display: block; height: 100%; border-radius: .8cqw; }
.ppd-ivbar i.up { background: #C0504D; }
.ppd-ivbar i.down { background: #4F81BD; }
.ppd-ivrow b { min-width: 9cqw; text-align: right; font-variant-numeric: tabular-nums; }
.ppd-ivrow .up { color: #C0504D; }
.ppd-ivrow .down { color: #4F81BD; }

.ppd-minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8cqw; }
.ppd-mini {
  border: 1px solid #e2e2e2; border-left: .5cqw solid #a08023; background: #fbfbfb;
  padding: 1.6cqw 1.8cqw;
}
.ppd-mini span { display: block; font-size: 1.4cqw; color: #888; font-weight: 700; }
.ppd-mini b { display: block; font-size: 2.5cqw; color: #222; margin: .6cqw 0 .3cqw; letter-spacing: -.02em; }
.ppd-mini i { font-style: normal; font-size: 1.45cqw; }
.ppd-mini .up { color: #C0504D; }
.ppd-mini .down { color: #4F81BD; }

.ppd-featlist { list-style: none; margin: 0 0 1.6cqw; padding: 0; }
.ppd-featlist li {
  font-size: 1.75cqw; color: #333; padding: .9cqw 1.6cqw; margin-bottom: .8cqw;
  background: #f7f8f9; border-left: .45cqw solid #999;
}
.ppd-featlist li.up { border-left-color: #C0504D; }
.ppd-featlist li.down { border-left-color: #4F81BD; }

/* ============================================================
   PHOTOSHOP (다크) — 캔버스가 곧 차트 (ps.js)
   ============================================================ */
body[data-office="ps"] #site { display: none; }
#chrome-ps { background: #262626; color: #cfcfcf; font-family: "Malgun Gothic", "Segoe UI", sans-serif; }

.ps-titlebar {
  background: #252525; display: flex; align-items: center; gap: 12px;
  font-size: 12px; padding: 5px 0 5px 10px; border-bottom: 1px solid #171717; user-select: none; height: 32px;
}
.ps-appicon {
  background: #001E36; color: #31A8FF; font-weight: bold; padding: 2px 5px;
  border-radius: 3px; font-size: 11px; flex-shrink: 0;
}
.ps-menu { color: #cfcfcf; white-space: nowrap; overflow: hidden; }
#chrome-ps .win-btns i { color: #999; }

.ps-doctabs {
  background: #1e1e1e; display: flex; font-size: 11.5px; user-select: none; padding-top: 4px;
  border-bottom: 1px solid #171717;
}
.ps-doctabs span {
  background: #2a2a2a; color: #9a9a9a; padding: 6px 14px; border-right: 1px solid #171717;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
.ps-doctabs span.on { background: #3a3a3a; color: #e8e8e8; }
.ps-doctabs i { font-style: normal; color: #777; margin-left: 8px; }

.ps-options {
  background: #323232; color: #b5b5b5; font-size: 11.5px; padding: 6px 12px;
  border-bottom: 1px solid #1a1a1a; white-space: nowrap; overflow: hidden; user-select: none;
  display: flex; align-items: center; gap: 10px;
}
.ps-options b { font-weight: normal; color: #dedede; }
.ps-tool-cur { font-style: normal; background: #464646; border-radius: 3px; padding: 1px 6px; }
.ps-opt-check { color: #b5b5b5; }
.ps-opt-sep { width: 1px; height: 14px; background: #4a4a4a; }
.ps-options svg { color: #9a9a9a; }

.ps-body { flex: 1; min-height: 0; display: flex; }
.ps-tools {
  width: 38px; background: #2b2b2b; border-right: 1px solid #1a1a1a;
  display: flex; flex-direction: column; align-items: center; padding-top: 6px; gap: 1px;
  user-select: none; flex-shrink: 0;
}
.ps-tools i {
  font-style: normal; color: #b5b5b5; font-size: 13px; padding: 5px 0; width: 30px; text-align: center;
  border-radius: 3px; cursor: default;
}
.ps-tools i:hover { background: #3a3a3a; }
.ps-tools i.on { background: #515151; color: #fff; }
.ps-fgbg { position: relative; width: 26px; height: 26px; margin-top: 10px; display: block; }
.ps-fgbg i { position: absolute; width: 16px; height: 16px; border: 1px solid #888; }
.ps-fgbg .fg { top: 0; left: 0; background: #ffffff; z-index: 2; }
.ps-fgbg .bg { bottom: 0; right: 0; background: #000000; }

.ps-canvasarea {
  flex: 1; min-width: 0; background: #1d1d1d; padding: 26px; display: flex;
  align-items: center; justify-content: center; overflow: auto;
}
.ps-doc {
  width: min(100%, 1150px); aspect-ratio: 16/9; background: #10141d;
  border: 1px solid #000; box-shadow: 0 4px 24px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column; padding: 16px 18px; gap: 10px;
  font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", sans-serif;
  user-select: none; overflow: hidden;
}

/* ---- 문서 = 대시보드 포스터 ---- */
.psd-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-shrink: 0; }
.psd-brand { font-size: 15px; font-weight: 900; letter-spacing: .14em; color: #e8ecf5; white-space: nowrap; }
.psd-brand em { font-style: normal; color: #5b667a; font-weight: 600; margin-left: 8px; letter-spacing: .04em; }
.psd-stats { display: flex; gap: 10px; min-width: 0; overflow: hidden; }
.psd-stat {
  display: flex; align-items: baseline; gap: 7px; background: #161c29; border: 1px solid #222b3d;
  border-radius: 7px; padding: 6px 11px; white-space: nowrap;
}
.psd-stat span { font-size: 10px; color: #6b7690; font-weight: 700; letter-spacing: .06em; }
.psd-stat b { font-size: 13px; color: #e8ecf5; }
.psd-stat i { font-style: normal; font-size: 10.5px; }
.psd-stat .up, .psd-qrow .up, .psd-chartlabel .up { color: #26a69a; }
.psd-stat .down, .psd-qrow .down, .psd-chartlabel .down { color: #ef5350; }
.psd-stat .flat, .psd-qrow .flat { color: #6b7690; }

.psd-main { flex: 1; min-height: 0; display: flex; gap: 10px; }
.psd-chartblock {
  flex: 1; min-width: 0; background: #131722; border: 1px solid #1e2636; border-radius: 8px;
  display: flex; flex-direction: column; padding: 8px 10px;
}
.psd-chartlabel { font-size: 12px; color: #aab4c8; padding: 2px 4px 6px; flex-shrink: 0; }
.psd-chartlabel b { color: #e8ecf5; font-size: 12.5px; }
.psd-chartlabel i { font-style: normal; font-size: 11px; }
.psd-chartblock canvas { display: block; width: 100%; flex: 1; min-height: 0; }

.psd-quotes {
  width: 218px; flex-shrink: 0; background: #131722; border: 1px solid #1e2636; border-radius: 8px;
  padding: 9px 10px; display: flex; flex-direction: column; overflow: hidden;
}
.psd-qtitle { font-size: 10px; color: #6b7690; font-weight: 800; letter-spacing: .14em; padding-bottom: 6px; }
.psd-qrow {
  display: flex; align-items: center; gap: 6px; padding: 4.5px 5px; border-radius: 5px;
  font-size: 11.5px; color: #aab4c8; cursor: pointer;
}
.psd-qrow:hover { background: #1a2233; }
.psd-qrow.on { background: #1d2a42; }
.psd-qrow span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psd-qrow b { color: #e8ecf5; font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.psd-qrow i { font-style: normal; font-size: 10.5px; min-width: 48px; text-align: right; white-space: nowrap; }
.psd-qfoot { margin-top: auto; font-size: 8.5px; color: #47506a; letter-spacing: .1em; padding-top: 6px; }

.psd-news {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px; background: #131722;
  border: 1px solid #1e2636; border-radius: 7px; padding: 7px 11px; overflow: hidden; white-space: nowrap;
}
.psd-newstag { font-size: 9px; font-weight: 900; color: #10141d; background: #d8b544; border-radius: 3px; padding: 2px 6px; letter-spacing: .1em; }
.psd-newsitem { font-size: 11px; color: #aab4c8; overflow: hidden; text-overflow: ellipsis; }
.psd-news em { color: #47506a; font-style: normal; }

.ps-panels {
  width: 232px; background: #262626; border-left: 1px solid #1a1a1a;
  display: flex; flex-direction: column; gap: 8px; padding: 8px; user-select: none; flex-shrink: 0;
  overflow-y: auto;
}
.ps-panel { background: #2e2e2e; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.ps-panel.grow { flex: 1; min-height: 160px; }
.ps-panel-tabs { background: #383838; display: flex; font-size: 11px; color: #9a9a9a; }
.ps-panel-tabs span { padding: 6px 12px; }
.ps-panel-tabs span.on { background: #2e2e2e; color: #e0e0e0; }
.ps-colorbox { display: flex; gap: 6px; padding: 10px; height: 96px; }
.ps-spectrum {
  flex: 1; border-radius: 2px;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, #d00);
}
.ps-huebar {
  width: 12px; border-radius: 2px;
  background: linear-gradient(to bottom, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.ps-props { padding: 8px 12px; font-size: 11px; color: #9a9a9a; }
.ps-props div { display: flex; gap: 8px; padding: 3px 0; }
.ps-props b { color: #d5d5d5; font-weight: normal; min-width: 48px; }
.ps-layerops { display: flex; gap: 8px; padding: 7px 10px; font-size: 11px; color: #9a9a9a; align-items: center; }
.ps-layerops select {
  background: #232323; color: #ccc; border: 1px solid #444; border-radius: 3px; font-size: 11px; padding: 2px 4px;
}
.ps-layers { overflow-y: auto; }
.ps-layer {
  font-size: 11.5px; color: #c5c5c5; padding: 7px 10px; border-bottom: 1px solid #272727;
  display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;
}
.ps-layer:hover { background: #333; }
.ps-layer.on { background: #345d8a; color: #fff; }
.ps-layer.locked { color: #8a8a8a; cursor: default; }
.ps-eye { font-style: normal; font-size: 10px; opacity: .85; width: 14px; text-align: center; }
.ps-eye.off { color: #555; }
.ps-thumbico.strip { background: linear-gradient(90deg, #d8b544 20%, #1a2233 20%); }
.ps-lock { font-style: normal; margin-left: auto; font-size: 10px; }
.ps-thumbico {
  width: 24px; height: 17px; border: 1px solid #555; border-radius: 1px; flex-shrink: 0;
  background: linear-gradient(160deg, #16324a 30%, #1f5b46 60%, #7c2c35 100%);
}
.ps-thumbico.bg { background: #0e1116; }
.ps-status {
  background: #1e1e1e; border-top: 1px solid #171717; color: #9a9a9a; font-size: 11px;
  display: flex; gap: 18px; padding: 4px 12px; user-select: none;
}
.ps-status .grow { flex: 1; text-align: right; color: #7c7c7c; }
body[data-office="ps"] .modal-card { background: #2e2e2e; color: #ddd; }

/* ============================================================
   VS CODE (다크 모던) — 탐색기가 곧 메뉴, 에디터에 사이트 임베드
   ============================================================ */
body[data-office="vscode"] {
  --bg: #1f1f1f; --surface: #1f1f1f; --fg: #cccccc; --sub: #8b8b8b;
  --line: #2b2b2b; --brand: #4daafc; --sel: #232936; --head: #252526;
  --radius: 6px; --shadow: none;
  --up: #f14c4c; --down: #4593fc;
}
body[data-office="vscode"][data-color="us"] { --up: #4ec9b0; --down: #f14c4c; }
#chrome-vscode { background: #1f1f1f; color: #ccc; font-family: "Segoe UI", "Malgun Gothic", sans-serif; }

.vs-titlebar {
  background: #181818; display: flex; align-items: center; font-size: 12.5px; gap: 10px;
  color: #cccccc; padding-left: 10px; user-select: none; height: 35px; border-bottom: 1px solid #2b2b2b;
}
.vs-logo { flex-shrink: 0; }
.vs-menu { white-space: nowrap; overflow: hidden; color: #cccccc; }
.vs-center { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.vs-center > i { font-style: normal; color: #7a7a7a; font-size: 13px; }
.vs-searchbox {
  background: #2a2a2a; border: 1px solid #3c3c3c; border-radius: 6px; color: #9d9d9d;
  font-size: 12px; padding: 3px 0; width: min(38vw, 420px); text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.vs-titright { display: flex; gap: 12px; color: #9d9d9d; padding-right: 4px; }
#chrome-vscode .win-btns i { color: #ccc; }

.vs-body { flex: 1; min-height: 0; display: flex; }
.vs-activity {
  width: 48px; background: #181818; border-right: 1px solid #2b2b2b; display: flex; flex-direction: column;
  align-items: center; padding-top: 4px; user-select: none; flex-shrink: 0;
}
.vs-activity > i {
  font-style: normal; color: #868686; width: 100%; text-align: center; padding: 10px 0;
  position: relative; cursor: default;
}
.vs-activity > i:hover { color: #d0d0d0; }
.vs-activity > i.on { color: #ffffff; box-shadow: inset 2px 0 0 #ffffff; }
.vs-badge {
  position: absolute; right: 7px; bottom: 6px; background: #0078d4; color: #fff;
  font-size: 9px; font-style: normal; min-width: 15px; height: 15px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.vs-act-bottom { margin-top: auto; display: flex; flex-direction: column; width: 100%; padding-bottom: 6px; }
.vs-act-bottom i { font-style: normal; color: #868686; width: 100%; text-align: center; padding: 9px 0; cursor: pointer; }
.vs-act-bottom i:hover { color: #d0d0d0; }

.vs-sidebar {
  width: 226px; background: #181818; border-right: 1px solid #2b2b2b;
  font-size: 13px; user-select: none; overflow: hidden; flex-shrink: 0; display: flex; flex-direction: column;
}
.vs-side-head {
  color: #bbbbbb; font-size: 11px; letter-spacing: .08em; padding: 9px 16px 7px;
  display: flex; justify-content: space-between;
}
.vs-side-head i { font-style: normal; color: #8b8b8b; }
.vs-section { color: #cccccc; font-weight: 700; font-size: 11px; padding: 4px 10px; letter-spacing: .02em; }
.vs-section.on { background: transparent; }
.vs-tree { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.vs-file {
  color: #cccccc; padding: 3.5px 10px 3.5px 22px; white-space: nowrap; cursor: pointer;
  display: flex; align-items: center; gap: 7px; font-size: 13px;
}
.vs-file:hover { background: #2a2d2e; }
.vs-file.on { background: #37373d; color: #ffffff; }
.vs-file.dim { color: #9d9d9d; cursor: default; }
.vs-fic { font-style: normal; font-size: 10px; font-weight: 700; width: 16px; text-align: center; flex-shrink: 0; }
.vs-fic.json { color: #cbcb41; }
.vs-fic.md { color: #519aba; }
.vs-fic.gear { color: #85878b; }
.vs-fic.git { color: #e84e31; }

.vs-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #1f1f1f; }
.vs-tabs { background: #181818; display: flex; font-size: 13px; user-select: none; border-bottom: 1px solid #2b2b2b; }
.vs-tabs span {
  padding: 8px 14px; color: #9d9d9d; background: #181818; border-right: 1px solid #2b2b2b;
  display: inline-flex; align-items: center; gap: 7px;
}
.vs-tabs span.on { background: #1f1f1f; color: #ffffff; box-shadow: inset 0 1.5px 0 #0078d4; }
.vs-tabs span.dim { opacity: .8; }
.vs-dot { font-style: normal; font-size: 9px; color: #fff; }
.vs-crumbs {
  background: #1f1f1f; color: #8b8b8b; font-size: 12px; padding: 5px 16px;
  border-bottom: 1px solid #252526; user-select: none;
}
.vs-crumbs b { color: #cccccc; font-weight: normal; }

.vs-statusbar {
  background: #181818; border-top: 1px solid #2b2b2b; color: #9d9d9d; display: flex; font-size: 11.5px;
  padding: 3px 10px; gap: 14px; user-select: none; align-items: center; white-space: nowrap; overflow: hidden;
}
.vs-statusbar .grow { flex: 1; }
.vs-remote { color: #4daafc; }

/* ---- 사이트 임베드 리스킨 (에디터 영역) ---- */
body[data-office="vscode"] #gnav { display: none; }
body[data-office="vscode"] #topbar {
  background: #1f1f1f; border-bottom: 1px solid #2b2b2b; padding: 7px 14px;
}
body[data-office="vscode"] #search-input {
  background: #2a2a2a; border: 1px solid #3c3c3c; color: #ccc; border-radius: 6px;
}
body[data-office="vscode"] #view { max-width: none; padding: 12px 16px 24px; }
body[data-office="vscode"] .card { border: 1px solid #2b2b2b; box-shadow: none; }
body[data-office="vscode"] .modal-card { background: #252526; color: #ddd; }

/* ---------- 다크 계열 위장에서 폼/모달 가독성 ---------- */
body[data-office="ps"] .form input, body[data-office="ps"] .form textarea, body[data-office="ps"] .form select,
body[data-office="ps"] .cmt-form input,
body[data-office="vscode"] .form input, body[data-office="vscode"] .form textarea, body[data-office="vscode"] .form select,
body[data-office="vscode"] .cmt-form input {
  background: var(--head); color: var(--fg); border-color: var(--line);
}

/* ---------- 반응형 ---------- */
@media (max-width: 760px) {
  .xl-ribbon, .xl-menu-right, .xl-searchpill, .xl-autosave { display: none; }
  .xl-menubar, .pp-menubar { overflow-x: auto; }
  .pp-ribbon, .pp-thumbs, .pp-search { display: none; }
  .pp-stage { padding: 8px; }
  .vs-sidebar, .vs-menu, .vs-crumbs, .vs-center { display: none; }
  .ps-panels, .ps-options, .ps-menu { display: none; }
  .ps-canvasarea { padding: 8px; }
}

/* ============================================================
   PPT v5 — 슬라이드 쇼 / Copilot / 새 슬라이드 / 테마 / 인쇄
   ============================================================ */

/* 종목 분석 슬라이드 */
.ppd-stockhead { display: flex; align-items: baseline; gap: 2cqw; margin-bottom: 1.6cqw; }
.ppd-stockhead b { font-size: 4.2cqw; }
.ppd-stockhead i { font-size: 2cqw; font-style: normal; }
.ppd-stockhead span { font-size: 1.6cqw; color: #999; margin-left: auto; }
.ppd-stockgrid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.4cqw; flex: 1; min-height: 0; }
.ppd-chartwrap.sm { height: 100%; min-height: 0; }
.ppd-chartwrap.sm .ppd-canvas { width: 100%; height: 100%; }
.ppd-kvs { display: flex; flex-direction: column; gap: .9cqw; align-content: start; }
.ppd-kv { display: flex; justify-content: space-between; font-size: 1.7cqw; border-bottom: 1px solid #eee; padding: .7cqw .2cqw; }
.ppd-kv span { color: #888; }
.ppd-stocknews { margin-top: 1.6cqw; font-size: 1.5cqw; color: #666; display: flex; flex-direction: column; gap: .5cqw; }

/* 썸네일: 삭제/드래그 */
.pp-thumb { position: relative; }
.pp-thumb-del {
  position: absolute; top: 2px; right: 2px; font-style: normal; width: 15px; height: 15px;
  border-radius: 3px; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; line-height: 15px;
  text-align: center; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.pp-thumb:hover .pp-thumb-del { opacity: 1; }
.pp-thumb-del:hover { background: #C43E1C; }
.pp-thumb.dragover { outline: 2px dashed #C43E1C; outline-offset: 2px; }

/* Copilot 버튼/창 (M365 2026) */
.pp-copilot-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px !important;
  border: 1px solid #e0e0e0; border-radius: 14px; margin: 3px 4px 3px 0; background: #fff;
  cursor: pointer; font-size: 12px; color: #444;
}
.pp-copilot-btn:hover { border-color: #A78BFA; box-shadow: 0 0 0 2px rgba(167,139,250,.15); }
.pp-copilot-pane {
  width: 296px; flex-shrink: 0; background: #fff; border-left: 1px solid #ddd;
  display: flex; flex-direction: column;
}
.ppc-head-bar {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid #eee; font-size: 13px;
}
.ppc-head-bar b { display: inline-flex; align-items: center; gap: 6px; }
.ppc-head-bar button { border: none; background: none; font-size: 17px; color: #888; cursor: pointer; }
.ppc-out { flex: 1; overflow: auto; padding: 12px 14px; }
.ppc-head { font-weight: bold; font-size: 13px; line-height: 1.55; margin: 0 0 8px; min-height: 18px; }
.ppc-p { font-size: 12.5px; line-height: 1.7; color: #444; margin: 0 0 8px; }
.ppc-p.dim { color: #888; }
.ppc-list { padding: 0; margin: 4px 0 8px; list-style: none; }
.ppc-list li {
  font-size: 12px; padding: 6px 9px; border-radius: 7px; background: #f6f4fd;
  margin-bottom: 5px; border-left: 3px solid #A78BFA;
}
.ppc-list li.up { border-left-color: #d64b4b; }
.ppc-list li.down { border-left-color: #4a7de2; }
.ppc-actions { padding: 8px 14px; display: flex; flex-direction: column; gap: 6px; }
.ppc-actions button {
  border: 1px solid #e2ddf5; background: #faf9ff; border-radius: 9px; padding: 8px 10px;
  font-size: 12px; cursor: pointer; text-align: left; font-family: inherit; color: #333;
}
.ppc-actions button:hover { border-color: #A78BFA; background: #f4f0ff; }
.ppc-input {
  margin: 8px 12px 12px; border: 1px solid #d9d3ee; border-radius: 18px; padding: 8px 14px;
  font-size: 12px; color: #999; display: flex; justify-content: space-between; align-items: center;
}
.ppc-input i { font-style: normal; color: #A78BFA; }
.typing::after { content: '▍'; color: #A78BFA; animation: ppc-blink 1s steps(1) infinite; }
@keyframes ppc-blink { 50% { opacity: 0; } }

/* 새 슬라이드 팝오버 */
.pp-addpop {
  position: absolute; inset: 0; z-index: 30; background: rgba(30,30,30,.35);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 120px;
}
#chrome-ppt { position: relative; }
.pp-addcard {
  background: #fff; border-radius: 10px; width: 380px; box-shadow: 0 14px 40px rgba(0,0,0,.3);
  padding: 14px 16px;
}
.pp-addhead { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 10px; }
.pp-addhead button { border: none; background: none; font-size: 17px; color: #888; cursor: pointer; }
.pp-addcard input {
  width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid #ccc; border-radius: 7px;
  font-size: 13px; font-family: inherit; outline: none;
}
.pp-addcard input:focus { border-color: #C43E1C; }
.pp-add-results { max-height: 240px; overflow: auto; margin-top: 8px; }
.pp-add-item { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.pp-add-item span { color: #999; font-size: 11.5px; }
.pp-add-item:hover { background: #fbeae5; }
.pp-add-hint { color: #999; font-size: 12px; padding: 10px 4px; }

/* 슬라이드 쇼 */
.pp-show {
  position: fixed; inset: 0; z-index: 95; background: #000;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pp-show-slidebox { width: min(100vw, calc(100vh * 16 / 9)); box-shadow: none; }
.pp-show-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px;
  display: flex; gap: 6px; align-items: center; background: rgba(28,28,28,.85);
  border-radius: 20px; padding: 6px 14px; opacity: .25; transition: opacity .2s; cursor: default;
}
.pp-show:hover .pp-show-bar { opacity: 1; }
.pp-show-ctl {
  color: #ddd; font-size: 13px; padding: 3px 9px; border-radius: 12px; cursor: pointer; user-select: none;
}
.pp-show-ctl:hover { background: rgba(255,255,255,.15); }
.pp-show-ctl.on { background: #C43E1C; color: #fff; }
.pp-show-no { color: #888; font-size: 12px; padding: 0 6px; }
.pp-showbtn { cursor: pointer; font-weight: normal; }
.pp-showbtn:hover { color: #C43E1C; }

/* 테마 팝오버 + 팔레트 */
.pp-themepop {
  position: absolute; top: 64px; left: 210px; z-index: 40; background: #fff;
  border: 1px solid #ddd; border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding: 6px; min-width: 210px;
}
.pp-theme-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px;
  font-size: 12.5px; cursor: pointer;
}
.pp-theme-item:hover { background: #f5f5f5; }
.pp-theme-item.on { background: #fbeae5; }
.pp-theme-chip { display: inline-flex; width: 34px; height: 20px; border-radius: 4px; overflow: hidden; border: 1px solid #ccc; }
.pp-theme-chip i { flex: 1; }
.pp-theme-chip.t-navy i:first-child { background: #23384a; }
.pp-theme-chip.t-navy i:last-child { background: #b8912c; }
.pp-theme-chip.t-dark i:first-child { background: #16181d; }
.pp-theme-chip.t-dark i:last-child { background: #3d7eff; }
.pp-theme-chip.t-consult i:first-child { background: #fff; }
.pp-theme-chip.t-consult i:last-child { background: #1f3864; }

/* 테마: 다크 */
.pp-slide16[data-t="dark"] { background: #16181d; }
.pp-slide16[data-t="dark"] .ppd-page { color: #d6dae2; }
.pp-slide16[data-t="dark"] .ppd-title { color: #f0f2f6; border-bottom-color: #3d7eff; }
.pp-slide16[data-t="dark"] .ppd-title small { color: #7a8394; }
.pp-slide16[data-t="dark"] .ppd-stat, .pp-slide16[data-t="dark"] .ppd-mini { background: #1e2229; border-color: #2b303a; }
.pp-slide16[data-t="dark"] .ppd-stat span, .pp-slide16[data-t="dark"] .ppd-mini span { color: #8a93a5; }
.pp-slide16[data-t="dark"] .ppd-table th { background: #1e2229; color: #aab3c2; border-color: #2b303a; }
.pp-slide16[data-t="dark"] .ppd-table td { border-color: #262b34; }
.pp-slide16[data-t="dark"] .ppd-kv { border-color: #262b34; }
.pp-slide16[data-t="dark"] .ppd-quote { background: #1e2229; color: #e6e9ef; border-left-color: #3d7eff; }
.pp-slide16[data-t="dark"] .ppd-colhead { color: #cfd5e0; }
.pp-slide16[data-t="dark"] .ppd-note, .pp-slide16[data-t="dark"] .ppd-pageno { color: #6a7386; }
.pp-slide16[data-t="dark"] .ppd-mvlist li { border-color: #262b34; }
.pp-slide16[data-t="dark"] .ppd-newslist li { border-color: #262b34; }
.pp-slide16[data-t="dark"] .ppd-newslist li span { color: #7a8394; }

/* 테마: 컨설팅 화이트 */
.pp-slide16[data-t="consult"] .ppd-title { color: #1f3864; border-bottom: .18cqw solid #1f3864; font-weight: 700; }
.pp-slide16[data-t="consult"] .ppd-stat, .pp-slide16[data-t="consult"] .ppd-mini { background: #fff; border: 1px solid #d8dde6; border-top: .35cqw solid #1f3864; }
.pp-slide16[data-t="consult"] .ppd-quote { background: #f4f6fa; border-left-color: #1f3864; }
.pp-slide16[data-t="consult"] .ppd-cover-band { background: #1f3864; }
.pp-slide16[data-t="consult"] .ppd-table th { background: #1f3864; color: #fff; }

/* 인쇄 (PDF 내보내기) */
#pp-print { position: absolute; left: -10000px; top: 0; width: 1000px; }
#pp-print .pp-print-page { margin-bottom: 12px; }
#pp-print .pp-slide16 { width: 1000px; }
@media print {
  body > *:not(#pp-print) { display: none !important; }
  #pp-print { position: static; left: 0; width: 100%; }
  #pp-print .pp-slide16 { width: 100%; box-shadow: none; page-break-after: always; border: none; }
  #pp-print .pp-print-page { margin: 0; }
  @page { size: A4 landscape; margin: 8mm; }
}

/* ============================================================
   PS v5 — 도구/브러시/문자/줌/히스토리/CTB/내보내기
   ============================================================ */

#ps-canvasarea { position: relative; overflow: hidden; }
#ps-doc { position: relative; transform-origin: 50% 8%; transition: transform .06s linear; }

/* 브러시 오버레이 + 문자 */
.ps-paint {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 6;
}
#ps-texts { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.psd-text {
  position: absolute; z-index: 7; pointer-events: auto; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.5); white-space: nowrap; cursor: default; user-select: none;
}
body[data-pstool="move"] .psd-text { cursor: move; }
.psd-textinput {
  position: absolute; z-index: 9; background: rgba(10,14,22,.85); border: 1px dashed #4d9fff;
  color: #fff; font-size: 14px; padding: 4px 8px; outline: none; min-width: 160px; font-family: inherit;
}

/* AI 코멘트 스티커 (생성형 채우기 결과) */
.psd-ai {
  position: absolute; z-index: 8; max-width: 340px; background: rgba(26,20,46,.92);
  border: 1px solid #7c5cff; border-radius: 10px; padding: 10px 14px 11px;
  color: #e6ddff; font-size: 13.5px; line-height: 1.55; box-shadow: 0 6px 24px rgba(80,40,220,.35);
  cursor: default; user-select: none;
}
body[data-pstool="move"] .psd-ai { cursor: move; }
.psd-ai-tag {
  display: block; font-size: 9.5px; letter-spacing: 1.5px; color: #b9a5ff; margin-bottom: 4px; font-weight: bold;
}

/* 커서 (도구별) */
body[data-pstool="brush"] #ps-doc { cursor: crosshair; }
body[data-pstool="brush"] .ps-paint { pointer-events: auto; }
body[data-pstool="text"] #ps-doc { cursor: text; }
body[data-pstool="hand"] #ps-canvasarea, body[data-pstool="hand-tmp"] #ps-canvasarea { cursor: grab; }
body[data-pstool="zoom"] #ps-doc { cursor: zoom-in; }

/* 컨텍스추얼 태스크 바 (Photoshop 2026) */
.ps-ctb {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  background: #1f2026; border: 1px solid #35363e; border-radius: 20px;
  padding: 5px 8px; box-shadow: 0 4px 18px rgba(0,0,0,.45); user-select: none;
}
.ps-ctb-btn {
  color: #d8d8d8; font-size: 12px; padding: 5px 12px; border-radius: 14px; cursor: pointer; white-space: nowrap;
}
.ps-ctb-btn:hover { background: #2c2d35; }
.ps-ctb-btn.primary { background: #2f2a4a; color: #cabdff; border: 1px solid #4c3f8f; }
.ps-ctb-btn.primary:hover { background: #3a3360; }
.ps-ctb-btn.primary.busy { opacity: .6; cursor: progress; animation: ps-pulse 1.2s infinite; }
@keyframes ps-pulse { 50% { box-shadow: 0 0 0 4px rgba(124,92,255,.18); } }
.ps-ctb-btn.dim { color: #8a8a8a; padding: 5px 9px; }
.ps-ctb-model { color: #9aa0ab; font-size: 11.5px; padding: 4px 8px; cursor: default; }
.ps-ctb-credit { color: #e9c46a; font-size: 11.5px; padding: 4px 6px; cursor: default; }
.ps-ctb-sep { width: 1px; height: 16px; background: #3a3b43; margin: 0 3px; }

/* 히스토리 패널 */
.ps-hist { max-height: 132px; overflow-y: auto; }
.ps-hist-row {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #bbb;
  padding: 5px 10px; border-bottom: 1px solid #2b2b2b;
}
.ps-hist-row i { font-style: normal; font-size: 9px; color: #6a6a6a; }
.ps-hist-row.base { color: #8a8a8a; }
.ps-hist-row:last-child { background: #123a63; color: #fff; }

/* 색상 견본 행 */
.ps-swatch-row { display: flex; gap: 5px; padding: 7px 10px 9px; flex-wrap: wrap; }
.ps-swatch-row i {
  width: 17px; height: 17px; border-radius: 3px; border: 1px solid #111; cursor: pointer;
}
.ps-swatch-row i.on { outline: 2px solid #fff; outline-offset: 1px; }
.ps-fgbg .fg { background: #ff5f56; }

/* 옵션 바 팁 */
.ps-opt-tip { color: #6f7683; font-size: 11px; margin-left: 14px; }
#ps-options input[type="range"] { width: 90px; vertical-align: middle; accent-color: #1473e6; }

/* ============================================================
   PS 문서 탭 = 허브 뷰 (시세/뉴스/토론/공지/브리핑 PSD 문서)
   ============================================================ */

#ps-doctabs { overflow-x: auto; scrollbar-width: none; }
#ps-doctabs span { cursor: pointer; flex-shrink: 0; }

/* 허브 뷰를 담는 "열린 문서" 캔버스 */
.ps-sitewrap {
  position: absolute; inset: 16px 16px 58px; z-index: 5;
  background: var(--bg); border: 1px solid #000;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .5); overflow: auto;
}
body[data-office="ps"] #ps-sitewrap #site { display: flex; min-height: 100%; }
body[data-office="ps"] #gnav { display: none; }   /* 내비게이션 = 문서 탭 */
body[data-office="ps"] #site-foot { display: none; }

/* 포스터 전용 버튼 비활성 상태 (다른 문서 열람 중) */
.ps-ctb-btn.off, #ps-genfill.off { opacity: .35; cursor: default; pointer-events: auto; }
.ps-ctb-btn.off:hover { background: none; }
#ps-genfill.off:hover { background: #2f2a4a; }

/* ── 허브 임베드: 엑셀 [부속 문서] / PPT [데이터 시트] — #site를 위장 앱 안으로 ── */
.xw-sheetwrap { position: relative; }
.pp-stagewrap { position: relative; }
.xw-sitewrap, .pp-sitewrap {
  position: absolute; inset: 0; z-index: 40; overflow: auto;
  background: var(--bg, #f2f4f6);
}
.xw-sitewrap[hidden], .pp-sitewrap[hidden] { display: none !important; }
body[data-office="excel"] #xw-sitewrap #site { display: flex; min-height: 100%; }
body[data-office="ppt"] #pp-sitewrap #site { display: flex; min-height: 100%; }
body[data-office="excel"] #xw-sitewrap #site-foot,
body[data-office="ppt"] #pp-sitewrap #site-foot { display: none; }
#xw-panetab-hub.on, #pp-hubbtn.on { color: #107C41; font-weight: bold; }
#pp-hubbtn.on { color: #C43E1C; }

/* ── 차트 숨김 토글 (msk:nocharts) — 오피스 모드에서 주가 차트류만 감춤. 보스 문서 비즈 차트는 유지 ── */
body.nocharts:not([data-office="none"]) .mkc-spark,
body.nocharts:not([data-office="none"]) .mkc-head svg,
body.nocharts:not([data-office="none"]) .idx-card svg,
body.nocharts:not([data-office="none"]) .d-chart,
body.nocharts:not([data-office="none"]) #xw-chartpane { display: none !important; }
