/* AI 영상 만들기 교안 전용 (aivideo) */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 14px 0 22px; }
.vgrid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vgrid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vgrid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vgrid.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
figure.av { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
figure.av video, figure.av img { display: block; width: 100%; height: auto; background: #111; }
figure.av.v916 video, figure.av.v916 img { aspect-ratio: 9 / 16; object-fit: cover; }
figure.av.v169 video, figure.av.v169 img { aspect-ratio: 16 / 9; object-fit: cover; }
figure.av figcaption { font-size: 12.5px; line-height: 1.5; color: var(--text-soft); padding: 8px 10px 9px; }
figure.av figcaption b { color: var(--text); }
figure.av .tagline { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent-strong); background: var(--accent-bg); border-radius: 5px; padding: 0 6px; margin-bottom: 3px; }
figure.av.wide { grid-column: 1 / -1; }
figure.av.solo { max-width: 340px; margin: 14px 0 20px; }
figure.av.big { margin: 14px 0 20px; }
figure.av.big img { background: #fff; }

.pr { margin: 12px 0 18px; }
.pr-h { font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.pr-h .k { font-size: 11px; color: #fff; background: #2b2d42; border-radius: 5px; padding: 1px 7px; }
.pr .cl-quote { margin: 0; }
.pr .cl-quote p { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.8px; line-height: 1.65; }

.recipe { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; margin: 18px 0 26px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.recipe > figure.av { align-self: start; }
.recipe h4 { margin: 0 0 4px; font-size: 17px; }
.recipe .meta { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.recipe ol, .recipe ul { margin: 6px 0 8px; padding-left: 20px; }
.recipe li { margin: 2px 0; font-size: 14.5px; }
@media (max-width: 760px) { .recipe { grid-template-columns: 1fr; } .recipe > figure.av { max-width: 260px; } }

.cmp3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 20px; }
.cmp3 figure.av figcaption { min-height: 66px; }
@media (max-width: 760px) { .cmp3 { grid-template-columns: 1fr; } .vgrid.g4, .vgrid.g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vgrid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.beatbar { display: flex; height: 54px; border-radius: 10px; overflow: hidden; margin: 12px 0 6px; font-size: 12.5px; font-weight: 700; color: #fff; }
.beatbar div { display: flex; flex-direction: column; justify-content: center; padding: 0 10px; min-width: 0; }
.beatbar small { font-weight: 500; opacity: .85; font-size: 11px; }
.b1 { background: #ea4b71; } .b2 { background: #2b2d42; } .b3 { background: #3b82f6; } .b4 { background: #f59e0b; }

figure.chart { margin: 14px 0 20px; padding: 12px 14px 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
figure.chart svg { width: 100%; height: auto; display: block; }
figure.chart figcaption { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

.src { font-size: 12.5px; color: var(--text-muted); margin-top: -6px; }
.src a { color: inherit; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 1px 7px; vertical-align: 1px; }
.badge.ok { color: #0b6b60; background: #ddf7f2; border: 1px solid #9ee3d6; }
.badge.chk { color: #8a5a00; background: #fff4d6; border: 1px solid #f5d98b; }
.badge.paid { color: #8b1d3a; background: #fde4ea; border: 1px solid #f6b8c8; }
.dday { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent-strong); white-space: nowrap; }
.dday.past { color: #9a9aa4; font-weight: 600; }
tr.is-past td { opacity: .45; }

.linkcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 12px 0 22px; }
.linkcard { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; color: inherit; text-decoration: none; }
.linkcard:hover { border-color: var(--accent); }
.linkcard b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.linkcard span { display: block; font-size: 13px; color: var(--text-soft); line-height: 1.55; }
.linkcard em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-muted); margin-top: 6px; word-break: break-all; }

/* ---------- 실습 도구 (lab.js) ---------- */
.lab { margin: 18px 0 26px; border: 2px solid #2b2d42; border-radius: 14px; background: #fff; overflow: hidden; }
.lab-h { background: #2b2d42; color: #fff; padding: 9px 14px; font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lab-h small { font-weight: 500; opacity: .8; font-size: 12px; }
.lab-b { padding: 14px; }
.lab-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.lab-row label { font-size: 13px; font-weight: 700; color: var(--text-soft); }
.lab input[type=text], .lab textarea, .lab select { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fcfcfa; }
.lab textarea { min-height: 54px; resize: vertical; }
.lab-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.lab button { font: inherit; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: #fff; cursor: pointer; }
.lab button.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.lab button:hover { border-color: var(--accent); }
.lab-out { margin-top: 10px; }
.lab-out .o-h { font-size: 12px; font-weight: 700; color: var(--text-muted); margin: 10px 0 4px; display: flex; justify-content: space-between; align-items: center; }
.lab-out pre { white-space: pre-wrap; word-break: break-word; margin: 0; background: var(--code-bg); color: var(--code-text); padding: 12px 14px; border-radius: 10px; font-size: 12.8px; line-height: 1.65; }
.lab-out .ko { background: #fdf6e9; color: #3d3220; border: 1px solid #f1e0bb; }
.lab table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lab th { text-align: left; font-size: 12px; color: var(--text-muted); padding: 4px 6px; border-bottom: 1px solid var(--border); }
.lab td { padding: 4px 4px; vertical-align: top; border-bottom: 1px solid var(--border); }
.lab td input, .lab td textarea { font-size: 13px; padding: 5px 7px; }
.lab td textarea { min-height: 38px; }
.lab .beat-tag { display: inline-block; color: #fff; font-weight: 700; font-size: 12px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.lab .score { display: inline-flex; gap: 4px; }
.lab .score button { width: 32px; padding: 5px 0; }
.lab .score button.on { background: #2b2d42; color: #fff; border-color: #2b2d42; }
.lab .total { font-size: 22px; font-weight: 800; }
.lab .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.lab .chips button { font-weight: 600; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; }
.lab .chips button.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-strong); }
.lab .chk { display: flex; gap: 8px; align-items: flex-start; padding: 6px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.lab .chk input { margin-top: 4px; }
.lab .saved { font-size: 12px; color: #0b6b60; }
.lab .shot-prev { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: start; }
.lab .shot-prev svg { width: 120px; height: auto; border-radius: 8px; background: #eef0f4; }
@media (max-width: 640px) { .lab-row { grid-template-columns: 1fr; } .lab .shot-prev { grid-template-columns: 1fr; } .lab table, .lab tbody, .lab tr, .lab td { display: block; } .lab thead { display: none; } .lab td { border: 0; } .lab tr { border-bottom: 1px solid var(--border); padding: 6px 0; } }
@media print { .sidebar, .lab-btns, .page-hud, .next-cta { display: none !important; } .lab { border-color: #999; } }

/* ---------- 홈 대시보드 ---------- */
.av-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 318px 250px; gap: 10px; }
.av-grid .pn-hero { grid-column: span 2; }
.hx { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; flex: 1; min-height: 0; }
.hx figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: #111; min-height: 0; }
.hx img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(1.04); transition: opacity .7s ease, transform 1.2s ease; }
.dash.is-on .hx img { opacity: 1; transform: none; }
.hx figure:nth-child(2) img { transition-delay: .25s; } .hx figure:nth-child(3) img { transition-delay: .5s; }
.hx figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.82)); color: #fff; font-size: 11.5px; line-height: 1.45; }
.hx figcaption b { display: block; font-size: 13px; }
.hx .num { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.hx .num small { font-size: 11px; font-weight: 600; opacity: .8; margin-left: 2px; }
.hx .win { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; background: var(--accent); color: #fff; border-radius: 6px; padding: 2px 7px; }
.hx .lose { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.88); color: #2b2d42; border-radius: 6px; padding: 2px 7px; }
.ct-list { display: flex; flex-direction: column; gap: 5px; flex: 1; min-height: 0; overflow: auto; }
.ct { display: grid; grid-template-columns: minmax(0, 1fr) 50px; gap: 3px 8px; align-items: center; text-decoration: none; color: inherit; border: 0; }
.ct-n { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct .dday { font-size: 12px; text-align: right; }
.ct-bar { grid-column: 1 / -1; height: 6px; background: #f4f2ee; border-radius: 3px; overflow: hidden; }
.ct-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.ct-bar i.far { background: #2b2d42; }
.dash.is-on .ct-bar i { width: var(--w); }
.gw { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; flex: 1; min-height: 0; }
.gw a { position: relative; border-radius: 7px; overflow: hidden; border: 0; background: #111; min-height: 0; }
.gw img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gw span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; letter-spacing: -.02em; font-weight: 700; color: #fff; padding: 12px 5px 4px; background: linear-gradient(transparent, rgba(0,0,0,.8)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw a:hover img { transform: scale(1.06); transition: transform .3s; }
.fl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; align-content: space-between; }
.fl a { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 7px; align-items: center; border: 1px solid var(--border); border-radius: 9px; padding: 8px 8px; text-decoration: none; color: inherit; }
.fl a:hover { border-color: var(--accent); }
.fl .n { width: 24px; height: 24px; border-radius: 50%; background: #2b2d42; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.fl b { font-size: 13px; display: block; } .fl small { font-size: 11.5px; color: var(--text-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl em { display: none; }
.bt { display: flex; height: 64px; border-radius: 10px; overflow: hidden; margin: 2px 0 8px; }
.bt div { display: flex; flex-direction: column; justify-content: flex-end; padding: 6px 7px; color: #fff; font-size: 11.5px; font-weight: 700; min-width: 0; transform-origin: left; transform: scaleX(0); transition: transform .6s ease; }
.dash.is-on .bt div { transform: none; }
.bt div:nth-child(2) { transition-delay: .15s; } .bt div:nth-child(3) { transition-delay: .3s; } .bt div:nth-child(4) { transition-delay: .45s; }
.bt small { font-weight: 500; font-size: 10.5px; opacity: .85; }
.wk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.wk a { border: 1px solid var(--border); border-radius: 8px; padding: 6px 7px; text-decoration: none; color: inherit; font-size: 11.5px; line-height: 1.4; }
.wk a:hover { border-color: var(--accent); }
.wk b { display: block; font-size: 12px; color: var(--accent-strong); }
.dash-src { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }
@media (max-width: 1100px) {
  .av-grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .av-grid .pn-hero { grid-column: auto; }
  .av-grid .pn { min-height: 240px; }
  .hx { min-height: 300px; }
  .gw { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 120px; }
}
@media (max-width: 560px) { .hx { grid-template-columns: 1fr 1fr 1fr; min-height: 250px; } .hx figcaption { font-size: 10px; padding: 20px 6px 6px; } .hx figcaption b { font-size: 11px; } .hx .num { font-size: 15px; } }
.md-table td:first-child, .md-table th:first-child { min-width: 4.6em; }
.md-table td small { color: var(--text-muted); }
.badge { white-space: nowrap; }
