/* AI 슬라이드: 슬라이드(1280x720) 테마·레이아웃, 결과물 패널, 발표 모드. 테마 색은 app/Modules/Slides/Themes.php 와 같다. */

/* ---------- 테마 ---------- */
.sl-slide {
  --s-bg: #FFFFFF; --s-fg: #1E1B18; --s-muted: #6F665E; --s-surface: #FFF4EE;
  --s-accent: #D3643F; --s-accent2: #F0A35E; --s-cover-fg: #FFFFFF;
  --s-cover-bg: linear-gradient(135deg, #D3643F 0%, #E0824F 100%);
  --s-c1: #D3643F; --s-c2: #F0A35E; --s-c3: #4F7CF5; --s-c4: #1E9E6A; --s-c5: #8B5CF6; --s-c6: #E5484D;
}
.sl-t-midnight {
  --s-bg: #0F172A; --s-fg: #F1F5F9; --s-muted: #94A3B8; --s-surface: #1E293B;
  --s-accent: #38BDF8; --s-accent2: #A78BFA; --s-cover-fg: #F8FAFC;
  --s-cover-bg: radial-gradient(circle at 80% 10%, #1E3A5F 0%, #020617 60%);
  --s-c1: #38BDF8; --s-c2: #A78BFA; --s-c3: #34D399; --s-c4: #FBBF24; --s-c5: #F472B6; --s-c6: #F87171;
}
.sl-t-forest {
  --s-bg: #F5F8F3; --s-fg: #1B2E22; --s-muted: #5B6B60; --s-surface: #FFFFFF;
  --s-accent: #2F7D4F; --s-accent2: #9BBF4F; --s-cover-fg: #F5F8F3;
  --s-cover-bg: linear-gradient(150deg, #1F5C3A 0%, #2F7D4F 100%);
  --s-c1: #2F7D4F; --s-c2: #9BBF4F; --s-c3: #D9A441; --s-c4: #4C8DAE; --s-c5: #B85C38; --s-c6: #7A6FAE;
}
.sl-t-ocean {
  --s-bg: #F3F8FD; --s-fg: #0B2545; --s-muted: #51657D; --s-surface: #FFFFFF;
  --s-accent: #1D6FD8; --s-accent2: #13B5C8; --s-cover-fg: #FFFFFF;
  --s-cover-bg: linear-gradient(135deg, #0B3C7D 0%, #1D6FD8 70%, #13B5C8 100%);
  --s-c1: #1D6FD8; --s-c2: #13B5C8; --s-c3: #F59E0B; --s-c4: #10B981; --s-c5: #8B5CF6; --s-c6: #EF4444;
}
.sl-t-sunset {
  --s-bg: #FFF8F1; --s-fg: #2D1B12; --s-muted: #7A5C4D; --s-surface: #FFFFFF;
  --s-accent: #E4572E; --s-accent2: #F3A712; --s-cover-fg: #FFFFFF;
  --s-cover-bg: linear-gradient(135deg, #E4572E 0%, #F3A712 100%);
  --s-c1: #E4572E; --s-c2: #F3A712; --s-c3: #29335C; --s-c4: #669BBC; --s-c5: #A8C686; --s-c6: #DB2B39;
}
.sl-t-mono {
  --s-bg: #FFFFFF; --s-fg: #111111; --s-muted: #6B6B6B; --s-surface: #F4F4F5;
  --s-accent: #111111; --s-accent2: #9CA3AF; --s-cover-fg: #FFFFFF;
  --s-cover-bg: #111111;
  --s-c1: #111111; --s-c2: #6B7280; --s-c3: #9CA3AF; --s-c4: #374151; --s-c5: #D1D5DB; --s-c6: #4B5563;
}
.sl-t-pastel {
  --s-bg: #FBF8FF; --s-fg: #2E2A3B; --s-muted: #716A85; --s-surface: #FFFFFF;
  --s-accent: #8B5CF6; --s-accent2: #F472B6; --s-cover-fg: #FFFFFF;
  --s-cover-bg: linear-gradient(135deg, #8B5CF6 0%, #C084FC 55%, #F472B6 100%);
  --s-c1: #8B5CF6; --s-c2: #F472B6; --s-c3: #60A5FA; --s-c4: #34D399; --s-c5: #FBBF24; --s-c6: #FB7185;
}
.sl-t-corporate {
  --s-bg: #FFFFFF; --s-fg: #1F2937; --s-muted: #6B7280; --s-surface: #F3F5F8;
  --s-accent: #1E3A8A; --s-accent2: #0EA5E9; --s-cover-fg: #FFFFFF;
  --s-cover-bg: linear-gradient(120deg, #1E3A8A 0%, #1E40AF 65%, #0EA5E9 140%);
  --s-c1: #1E3A8A; --s-c2: #0EA5E9; --s-c3: #64748B; --s-c4: #22C55E; --s-c5: #F59E0B; --s-c6: #EF4444;
}

/* ---------- 슬라이드 공통 ---------- */
.sl-slide {
  position: relative; width: 1280px; height: 720px; overflow: hidden; box-sizing: border-box;
  background: var(--s-bg); color: var(--s-fg);
  font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.35; letter-spacing: -0.015em; text-align: left;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sl-slide * { box-sizing: border-box; }
.sl-slide h1, .sl-slide h2, .sl-slide h3, .sl-slide p, .sl-slide blockquote, .sl-slide ul { margin: 0; }
.sl-slide [data-k] { outline: none; border-radius: 6px; min-width: 1ch; transition: box-shadow .12s; word-break: keep-all; overflow-wrap: anywhere; }
.sl-slide [contenteditable="true"] { cursor: text; }
.sl-slide [contenteditable="true"]:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-accent) 40%, transparent); }
.sl-slide [contenteditable="true"]:focus { box-shadow: 0 0 0 3px var(--s-accent); }
.sl-slide [contenteditable="true"]:empty::before { content: attr(data-ph); opacity: .35; pointer-events: none; }

.sl-icon { flex: none; width: 66px; height: 66px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--s-accent) 14%, var(--s-bg)); color: var(--s-accent); }
.sl-icon svg { width: 36px; height: 36px; }

.sl-head { position: absolute; left: 80px; right: 80px; top: 40px; height: 116px; display: flex; align-items: flex-end; gap: 20px; }
.sl-head::after { content: ""; position: absolute; left: 0; bottom: -16px; width: 64px; height: 6px; border-radius: 3px; background: var(--s-accent); }
.sl-h { font-size: 46px; font-weight: 800; line-height: 1.16; max-height: 116px; overflow: hidden; flex: 1; min-width: 0; }

.sl-foot { position: absolute; left: 80px; right: 80px; bottom: 24px; display: flex; justify-content: space-between; gap: 20px; font-size: 15px; color: var(--s-muted); }
.sl-foot span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 제목과 글머리 */
.sl-content { position: absolute; left: 80px; right: 80px; top: 190px; bottom: 70px; display: flex; flex-direction: column; gap: 24px; overflow: hidden; font-size: 31px; }
.sl-bullets { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .55em; }
.sl-bullets li { position: relative; padding-left: 1.15em; line-height: 1.38; }
.sl-bullets li::after { content: ""; position: absolute; left: .18em; top: .52em; width: .36em; height: .36em; border-radius: 50%; background: var(--s-accent); }
.sl-summary { margin-top: auto; padding: .6em .9em; font-size: .72em; font-weight: 700; background: var(--s-surface); border-left: 6px solid var(--s-accent); border-radius: 14px; white-space: pre-line; }

/* 표지·마무리 */
.sl-l-cover, .sl-l-closing { background: var(--s-cover-bg); color: var(--s-cover-fg); }
.sl-deco { position: absolute; right: -120px; top: -150px; width: 560px; height: 560px; border-radius: 50%; background: var(--s-accent2); opacity: .3; }
.sl-deco::after { content: ""; position: absolute; left: 150px; top: 580px; width: 380px; height: 380px; border-radius: 50%; background: var(--s-cover-fg); opacity: .12; }
.sl-cover { position: absolute; left: 96px; right: 220px; top: 90px; bottom: 96px; display: flex; flex-direction: column; justify-content: flex-end; gap: 20px; }
.sl-cover h1 { font-size: 66px; font-weight: 800; line-height: 1.12; max-height: 300px; overflow: hidden; letter-spacing: -0.025em; }
.sl-cover .sl-sub { font-size: 28px; opacity: .92; font-weight: 500; }
.sl-cover .sl-meta { font-size: 18px; opacity: .78; margin-top: 26px; white-space: pre-line; }
.sl-cover .sl-icon { background: color-mix(in srgb, var(--s-cover-fg) 18%, transparent); color: var(--s-cover-fg); margin-bottom: 8px; }
.sl-bar { width: 84px; height: 8px; border-radius: 4px; background: var(--s-accent2); }
.sl-l-closing .sl-cover { left: 140px; right: 140px; top: 0; bottom: 0; justify-content: center; align-items: center; text-align: center; }
.sl-l-closing .sl-cover h1 { font-size: 76px; }
.sl-t-mono .sl-bar, .sl-t-mono .sl-deco { background: #9CA3AF; }

/* 구역 제목 */
.sl-band { position: absolute; left: 0; top: 0; bottom: 0; width: 420px; background: var(--s-cover-bg); display: flex; align-items: center; justify-content: center; }
.sl-no { font-size: 140px; font-weight: 800; color: var(--s-cover-fg); letter-spacing: -0.04em; }
.sl-sec { position: absolute; left: 490px; right: 80px; top: 120px; bottom: 120px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.sl-sec h1 { font-size: 58px; font-weight: 800; line-height: 1.15; max-height: 300px; overflow: hidden; }
.sl-sec .sl-sub { font-size: 26px; color: var(--s-muted); }

/* 2단 */
.sl-cols { position: absolute; left: 80px; right: 80px; top: 190px; bottom: 70px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.sl-card { background: var(--s-surface); border-radius: 22px; padding: 30px 34px; border-top: 7px solid var(--s-accent); display: flex; flex-direction: column; gap: 18px; overflow: hidden; font-size: 25px; min-height: 0; }
.sl-card-right { border-top-color: var(--s-accent2); }
.sl-card h3 { font-size: 1.25em; font-weight: 800; color: var(--s-accent); line-height: 1.2; }
.sl-card .sl-bullets { gap: .45em; }

/* 큰 숫자 */
.sl-stats { position: absolute; left: 80px; right: 80px; top: 196px; height: 300px; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 32px; }
.sl-stat { background: var(--s-surface); border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45em; padding: 20px; text-align: center; overflow: hidden; font-size: 28px; min-width: 0; }
.sl-stats[style*="--n:1"] .sl-stat, .sl-stats[style*="--n:2"] .sl-stat { font-size: 34px; }
.sl-stats[style*="--n:4"] .sl-stat { font-size: 23px; }
.sl-stat .v { font-size: 2.9em; font-weight: 800; color: var(--s-accent); line-height: 1; letter-spacing: -0.03em; }
.sl-stat .l { font-size: .86em; color: var(--s-muted); font-weight: 600; }
.sl-under { position: absolute; left: 80px; right: 80px; top: 528px; bottom: 66px; font-size: 25px; overflow: hidden; }
.sl-under p { white-space: pre-line; }

/* 인용 */
.sl-quote { position: absolute; left: 130px; right: 130px; top: 64px; bottom: 80px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.sl-kicker { font-size: 21px; font-weight: 800; color: var(--s-accent); }
.sl-mark { font-size: 200px; line-height: .55; height: 84px; color: var(--s-accent2); font-weight: 800; font-family: Georgia, "Times New Roman", serif; }
.sl-qt { font-size: 46px; font-weight: 650; line-height: 1.36; max-height: 340px; overflow: hidden; white-space: pre-line; letter-spacing: -0.02em; }
.sl-author { display: flex; align-items: center; gap: 16px; font-size: 24px; color: var(--s-muted); font-weight: 700; }
.sl-author .ln { width: 48px; height: 4px; border-radius: 2px; background: var(--s-accent); flex: none; }

/* 표 */
.sl-table-wrap { position: absolute; left: 80px; right: 80px; top: 190px; bottom: 70px; overflow: hidden; font-size: 23px; }
.sl-table-wrap.dense { font-size: 19px; }
.sl-table { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: 16px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--s-fg) 12%, transparent); }
.sl-table th { background: var(--s-accent); color: #fff; font-weight: 700; text-align: left; padding: .6em .85em; }
.sl-t-midnight .sl-table th { color: #0F172A; }
.sl-table td { padding: .55em .85em; border-top: 1px solid color-mix(in srgb, var(--s-fg) 10%, transparent); vertical-align: top; }
.sl-table tbody tr:nth-child(even) td { background: var(--s-surface); }

/* 차트 */
.sl-chart-row { position: absolute; left: 80px; right: 80px; top: 184px; bottom: 62px; display: flex; gap: 40px; }
.sl-chart { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; }
.sl-svg { width: 100%; height: 100%; overflow: visible; }
.sl-svg text { font-family: inherit; fill: var(--s-fg); }
.sl-val { font-size: 22px; font-weight: 800; text-anchor: middle; }
.sl-lab { font-size: 20px; text-anchor: middle; fill: var(--s-muted) !important; }
.sl-lab.sm { font-size: 15px; }
.sl-axis { stroke: var(--s-muted); stroke-width: 2; opacity: .6; }
.sl-grid { stroke: var(--s-muted); stroke-width: 1; opacity: .15; stroke-dasharray: 4 6; }
.sl-slice { stroke: var(--s-bg); stroke-width: 3; }
.sl-leg { font-size: 22px; font-weight: 600; }
.sl-leg.sm { font-size: 16px; }
.sl-leg-v { fill: var(--s-muted); font-weight: 500; }
.sl-insight { flex: 0 0 340px; background: var(--s-surface); border-radius: 22px; padding: 28px 28px; font-size: 23px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; min-height: 0; }
.sl-chart-empty { color: var(--s-muted); font-size: 24px; }

/* 만드는 중 */
.sl-slide.is-pending > *:not(.sl-foot) { opacity: .28; }
.sl-slide.is-pending::after {
  content: "만드는 중…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 700; color: var(--s-muted);
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--s-surface) 70%, transparent) 50%, transparent 80%);
  background-size: 200% 100%; animation: sl-shimmer 1.4s linear infinite;
}
@keyframes sl-shimmer { to { background-position: -200% 0; } }

/* ---------- 결과물 패널 ---------- */
.sl-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; flex: 1; }
.sl-headbar { gap: 8px; }
.sl-head-ic { display: inline-flex; color: #E8833A; }
.sl-head-ic svg { width: 18px; height: 18px; }
.sl-deck-title { outline: none; border-radius: 6px; padding: 2px 4px; }
.sl-deck-title[contenteditable="true"]:hover, .sl-deck-title[contenteditable="true"]:focus { background: var(--surface-2); white-space: normal; }
.sl-save { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sl-save.is-error { color: var(--danger, #c0392b); }
.sl-theme, .sl-layout { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.sl-theme svg, .sl-layout svg { width: 16px; height: 16px; }
.sl-theme select, .sl-layout select { height: 34px; width: auto; padding: 0 8px; font-size: 13px; border-radius: 9px; }
.sl-pop-wrap { position: relative; }
.sl-pop { right: 0; top: calc(100% + 6px); min-width: 220px; }
.sl-body { flex: 1; display: flex; min-height: 0; }
.sl-thumbs { flex: 0 0 196px; overflow-y: auto; padding: 14px 10px 20px 8px; border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.sl-thumb { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; border-radius: 10px; position: relative; }
.sl-thumb-no { width: 20px; flex: none; text-align: right; font-size: 12px; color: var(--muted); padding-top: 2px; }
.sl-thumb-box { width: 152px; height: 85.5px; box-sizing: content-box; position: relative; overflow: hidden; border-radius: 8px; border: 2px solid transparent; box-shadow: 0 1px 4px rgba(0, 0, 0, .14); background: #fff; flex: none; }
.sl-thumb:hover .sl-thumb-box { border-color: var(--border-2); }
.sl-thumb.is-active .sl-thumb-box { border-color: var(--brand); }
.sl-thumb.is-active .sl-thumb-no { color: var(--brand); font-weight: 700; }
.sl-thumb-frame { position: absolute; left: 0; top: 0; transform: scale(.11875); transform-origin: 0 0; pointer-events: none; }
.sl-thumb.is-dragging { opacity: .4; }
.sl-thumb.drop-before::before, .sl-thumb.drop-after::after { content: ""; position: absolute; left: 26px; right: 0; height: 3px; border-radius: 2px; background: var(--brand); }
.sl-thumb.drop-before::before { top: -8px; }
.sl-thumb.drop-after::after { bottom: -8px; }
.sl-add { margin-left: 26px; width: 156px; height: 52px; border: 1.5px dashed var(--border-2); border-radius: 10px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: 13px; flex: none; }
.sl-add:hover { border-color: var(--brand); color: var(--brand); }
.sl-add svg { width: 16px; height: 16px; }
.sl-main { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.sl-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 36px; }
.sl-tools .grow { flex: 1; }
.sl-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.sl-count { font-size: 13px; color: var(--text-2); min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.sl-running { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sl-panel .icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.sl-stage { position: relative; width: 100%; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .14), 0 0 0 1px var(--border); background: #fff; flex: none; }
.sl-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.sl-extra[hidden] { display: none; }
.sl-pb { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm, 10px); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sl-pb-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
.sl-pb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sl-pb svg { width: 16px; height: 16px; color: var(--muted); }
.sl-pb .grow { flex: 1; }
.sl-pb select, .sl-pb input { height: 32px; width: auto; font-size: 13px; padding: 0 8px; border-radius: 8px; }
.sl-pb input { width: 130px; }
.sl-pb textarea { width: 100%; font: 13px/1.5 var(--mono, Consolas, monospace); padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }
.sl-pb small { font-size: 12px; }
.sl-notes { display: flex; flex-direction: column; gap: 6px; }
.sl-notes-h { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.sl-notes-h svg { width: 15px; height: 15px; }
.sl-notes textarea { width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--border-2); border-radius: var(--radius-sm, 10px); padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.6; background: var(--surface); color: var(--text); outline: none; }
.sl-notes textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.sl-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sl-pick-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 13px; color: var(--text-2); }
.sl-pick-item:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.sl-pick-item svg { width: 22px; height: 22px; }

/* ---------- 발표 모드 ---------- */
.sl-present { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; flex-direction: column; user-select: none; }
.sl-present-stage { flex: 1; position: relative; overflow: hidden; cursor: pointer; }
.sl-present-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.sl-present-notes { flex: none; max-height: 26vh; overflow: auto; background: #141414; color: #EDEDED; padding: 14px 26px 18px; font-size: 18px; line-height: 1.6; white-space: pre-line; border-top: 1px solid #2a2a2a; }
.sl-present-notes[hidden] { display: none; }
.sl-present-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: rgba(20, 20, 20, .78); color: #fff; font-size: 13px; opacity: 0; transition: opacity .2s; }
.sl-present:hover .sl-present-bar { opacity: 1; }
.sl-present-bar button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sl-present-bar button:hover { background: rgba(255, 255, 255, .16); }
.sl-present-bar span { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 860px) {
  .sl-body { flex-direction: column; }
  .sl-thumbs { flex: none; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  .sl-thumb { flex-direction: column; gap: 2px; }
  .sl-thumb-no { width: auto; text-align: left; }
  .sl-thumb-box { width: 120px; height: 67.5px; }
  .sl-thumb-frame { transform: scale(.09375); }
  .sl-add { margin-left: 0; width: 110px; height: 67px; align-self: flex-end; }
  .sl-main { padding: 12px 12px 24px; }
  .sl-headbar .btn span { display: none; }
  .sl-thumb.drop-before::before, .sl-thumb.drop-after::after { display: none; }
}
