:root {
  --ink: #1f2924;
  --ink-2: #56635c;
  --ink-3: #8a948e;
  --paper: #f5f4ef;
  --card: #ffffff;
  --line: #e7e5de;
  --forest: #25332c;
  --forest-2: #34483d;
  --sage: #dce7d9;
  --orange: #ee7857;
  --orange-soft: #ffe5dc;
  --yellow: #f5d36f;
  --blue: #deebf8;
  --red: #c54c40;
  --radius: 22px;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 0; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 24px 15px 18px; color: white; background: var(--forest); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; color: var(--forest); font-size: 19px; font-weight: 950; background: var(--yellow); transform: rotate(-5deg); }
.brand-name { font-size: 16px; font-weight: 850; letter-spacing: -.04em; }
.brand-caption { margin-top: 3px; color: #b8c3bc; font-size: 10px; letter-spacing: .09em; }
.nav { display: grid; gap: 5px; }
.nav-button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 13px; padding: 12px 13px; color: #c9d2cc; text-align: left; background: transparent; }
.nav-button:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-button.active { color: #fff; font-weight: 800; background: var(--forest-2); }
.nav-icon { display: grid; place-items: center; width: 22px; font-size: 16px; }
.sidebar-note { margin-top: auto; padding: 12px 10px 0; color: #b6c1ba; font-size: 11px; line-height: 1.55; }
.online { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; color: #e9f1eb; font-weight: 750; }
.online::before { width: 7px; height: 7px; border-radius: 50%; content: ""; background: #9bd58f; }

.main { min-width: 0; padding: 34px 38px 56px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow { margin-bottom: 6px; color: var(--orange); font-size: 11px; font-weight: 900; letter-spacing: .1em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 29px; letter-spacing: -.065em; }
h2 { margin-bottom: 7px; font-size: 19px; letter-spacing: -.045em; }
h3 { margin-bottom: 5px; font-size: 14px; letter-spacing: -.025em; }
.muted { margin-bottom: 0; color: var(--ink-2); font-size: 12px; line-height: 1.6; }
.episode-picker { min-width: 225px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); font-weight: 750; background: var(--card); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border: 0; border-radius: 11px; padding: 10px 14px; font-size: 12px; font-weight: 850; transition: transform .13s ease, opacity .13s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .4; transform: none; }
.button.primary { color: #fff; background: var(--forest); }
.button.orange { color: #fff; background: var(--orange); }
.button.soft { color: var(--forest); background: var(--sage); }
.button.quiet { color: var(--ink); background: #efeee9; }
.button.danger { color: #fff; background: var(--red); }
.button.small { min-height: 32px; padding: 7px 10px; border-radius: 9px; font-size: 11px; }
.button.wide { width: 100%; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 13px 35px rgba(31,41,36,.065); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; padding: 19px 20px 0; }
.card-body { padding: 19px 20px 20px; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; color: #376b43; font-size: 10px; font-weight: 850; background: #dff0df; white-space: nowrap; }
.status::before { width: 6px; height: 6px; border-radius: 50%; content: ""; background: currentColor; }
.status.wait { color: #99600b; background: #fff0c8; }
.status.ready { color: #34668c; background: var(--blue); }
.tag { display: inline-flex; border-radius: 999px; padding: 5px 8px; color: #56625b; font-size: 10px; font-weight: 750; background: #edf0eb; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 17px; margin-bottom: 18px; }
.hero { position: relative; overflow: hidden; min-height: 238px; padding: 26px; color: #fff; background: var(--forest); }
.hero::after { position: absolute; right: -45px; bottom: -85px; width: 250px; height: 250px; border-radius: 48% 52% 56% 44%; content: ""; background: rgba(245,211,111,.16); transform: rotate(15deg); }
.hero .eyebrow { color: var(--yellow); }
.hero h2 { max-width: 500px; margin-bottom: 12px; font-size: 27px; line-height: 1.22; letter-spacing: -.065em; }
.hero p { max-width: 580px; color: #d6ded8; font-size: 12px; line-height: 1.65; }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 23px; }
.hero .button.quiet { color: var(--forest); background: #fff; }
.hero .button.soft { color: var(--forest); background: var(--yellow); }

.metric-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; height: 100%; }
.metric { display: flex; flex-direction: column; justify-content: space-between; min-height: 110px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); }
.metric-label { color: var(--ink-2); font-size: 10px; }
.metric-value { font-size: 25px; font-weight: 900; letter-spacing: -.07em; }
.metric-note { color: var(--ink-3); font-size: 9px; }

.section-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 17px; }
.episode-list { display: grid; gap: 10px; }
.episode-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: #fcfcfa; }
.episode-cover { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 11px; background: #f0eee8; }
.episode-cover img { width: 100%; height: 100%; object-fit: cover; }
.episode-number { position: absolute; top: 6px; left: 6px; border-radius: 7px; padding: 4px 6px; color: #fff; font-size: 9px; font-weight: 900; background: rgba(37,51,44,.85); }
.episode-title { margin-bottom: 4px; font-size: 14px; font-weight: 850; }
.episode-meta { color: var(--ink-2); font-size: 10px; line-height: 1.5; }

.quick-list { display: grid; gap: 8px; }
.quick { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 9px 0; }
.quick:last-child { border-bottom: 0; }
.quick-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--forest); font-size: 14px; font-weight: 900; background: var(--sage); }
.quick-title { font-size: 12px; font-weight: 800; }
.quick-copy { margin-top: 2px; color: var(--ink-3); font-size: 9px; }

.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.library-card { overflow: hidden; }
.library-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #eeece6; }
.library-cover img { width: 100%; height: 100%; object-fit: cover; }
.library-cover-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--ink-3); font-size: 12px; }
.library-count { position: absolute; right: 10px; bottom: 10px; border-radius: 9px; padding: 6px 8px; color: white; font-size: 10px; font-weight: 850; background: rgba(37,51,44,.88); }
.library-info { padding: 15px; }
.library-title { margin-bottom: 5px; font-size: 14px; font-weight: 850; }
.library-meta { color: var(--ink-2); font-size: 10px; line-height: 1.5; }
.library-actions { display: flex; gap: 7px; margin-top: 13px; }

.render-stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 17px; }
.render-stage { overflow: hidden; }
.stage-preview { display: grid; aspect-ratio: 2 / 1; overflow: hidden; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: #f3f2ed; }
.stage-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.stage-preview .empty { padding: 18px 10px; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 17px; align-items: start; }
.sheet { position: relative; aspect-ratio: 2 / 1; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: repeating-linear-gradient(45deg,#faf9f6,#faf9f6 9px,#f4f2ed 9px,#f4f2ed 18px); }
.sheet img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sheet-label { position: absolute; top: 10px; left: 10px; border-radius: 8px; padding: 5px 8px; color: #fff; font-size: 9px; font-weight: 850; background: rgba(37,51,44,.85); }
.file-path { margin-top: 10px; overflow: hidden; border-radius: 10px; padding: 9px 10px; color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; background: #f3f2ed; }

.mobile-preview { position: relative; width: 286px; max-width: 100%; margin: 0 auto; border: 9px solid #1c211e; border-radius: 35px; padding: 12px 9px 18px; background: #fff; box-shadow: 0 16px 30px rgba(31,41,36,.15); }
.phone-bar { width: 82px; height: 7px; margin: -4px auto 13px; border-radius: 99px; background: #1c211e; }
.ig-head { display: flex; align-items: center; gap: 7px; padding: 0 3px 9px; font-size: 9px; font-weight: 800; }
.avatar { width: 23px; height: 23px; border-radius: 50%; background: var(--yellow); }
.preview-scroller { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border: 1px solid #eee; }
.preview-scroller::-webkit-scrollbar { display: none; }
.preview-slide { flex: 0 0 100%; aspect-ratio: 4 / 5; scroll-snap-align: start; object-fit: cover; }
.ig-icons { display: flex; gap: 10px; padding: 9px 3px 4px; font-size: 14px; }
.ig-dots { display: flex; justify-content: center; gap: 4px; margin-top: -15px; padding-bottom: 10px; pointer-events: none; }
.ig-dot { width: 4px; height: 4px; border-radius: 50%; background: #c7cbc8; }
.ig-dot:first-child { background: #3d80b5; }
.swipe-hint { margin-top: 11px; color: var(--ink-3); font-size: 9px; text-align: center; }

.checklist { display: grid; gap: 8px; }
.check { display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: 12px; padding: 11px; color: var(--ink-2); font-size: 11px; line-height: 1.5; background: #fcfcfa; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--forest); }
.approval-box { margin-top: 14px; border-left: 3px solid var(--orange); border-radius: 0 12px 12px 0; padding: 12px; color: #76594f; font-size: 11px; line-height: 1.55; background: var(--orange-soft); }
.slide-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.slide { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f1efea; }
.slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-no { position: absolute; top: 6px; left: 6px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; color: #fff; font-size: 9px; font-weight: 900; background: rgba(37,51,44,.86); }
.slide-download { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: var(--forest); font-size: 11px; font-weight: 900; background: rgba(255,255,255,.92); }

.caption-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); gap: 17px; align-items: start; }
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field label { color: var(--ink-2); font-size: 10px; font-weight: 850; }
.count { color: var(--ink-3); font-size: 9px; }
input, textarea, select { width: 100%; border: 1px solid #dedcd5; border-radius: 11px; padding: 11px 12px; color: var(--ink); outline: none; background: #fff; }
textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: #7a9886; box-shadow: 0 0 0 3px rgba(122,152,134,.14); }
.hashtag-input { min-height: 55px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.caption-preview { white-space: pre-wrap; color: #2e3632; font-size: 12px; line-height: 1.7; }
.caption-hook { margin-bottom: 11px; font-weight: 850; }
.preview-note { margin-top: 14px; border-radius: 11px; padding: 11px; color: var(--ink-2); font-size: 10px; line-height: 1.55; background: #f2f1ec; }
.candidate-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 17px 20px 0; }
.candidate { display: grid; align-content: start; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 13px; background: #fbfbf9; }
.candidate-label { font-size: 11px; font-weight: 900; }
.candidate-reason { margin-top: 3px; color: var(--ink-3); font-size: 9px; line-height: 1.45; }
.candidate-hook { min-height: 45px; color: var(--forest); font-size: 13px; font-weight: 900; line-height: 1.45; white-space: pre-wrap; }
.candidate-cta { min-height: 34px; color: var(--ink-2); font-size: 10px; line-height: 1.5; white-space: pre-wrap; }

.download-list { display: grid; gap: 10px; }
.download-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 14px; padding: 11px; background: #fcfcfa; }
.download-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--forest); font-size: 14px; font-weight: 900; background: var(--sage); }
.download-title { font-size: 12px; font-weight: 850; }
.download-meta { margin-top: 3px; color: var(--ink-3); font-size: 9px; }
.empty { padding: 34px 18px; color: var(--ink-3); font-size: 12px; text-align: center; }

.toast { position: fixed; z-index: 50; right: 23px; bottom: 23px; max-width: 390px; border-radius: 12px; padding: 13px 15px; color: #fff; font-size: 12px; font-weight: 750; line-height: 1.45; background: var(--forest); box-shadow: 0 15px 35px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a94238; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .main { padding: 28px 24px 50px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .render-stage-grid { grid-template-columns: 1fr; }
  .review-layout, .caption-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { padding-bottom: 71px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; top: auto; right: 0; bottom: 0; left: 0; display: block; width: 100%; height: 68px; padding: 7px 8px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.08); }
  .brand, .sidebar-note { display: none; }
  .nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .nav-button { display: grid; justify-items: center; gap: 2px; min-height: 51px; border-radius: 11px; padding: 6px 2px; font-size: 9px; text-align: center; }
  .nav-icon { width: auto; font-size: 15px; }
  .main { padding: 19px 14px 35px; }
  .topbar { display: grid; gap: 13px; margin-bottom: 18px; }
  h1 { font-size: 24px; }
  .episode-picker { width: 100%; min-width: 0; }
  .hero-grid, .section-grid, .caption-layout, .review-layout, .render-stage-grid { grid-template-columns: 1fr; }
  .hero { min-height: 220px; padding: 21px; }
  .hero h2 { font-size: 24px; }
  .metric-stack { grid-template-columns: repeat(4, 150px); overflow-x: auto; margin: 0 -14px; padding: 0 14px 6px; scroll-snap-type: x proximity; }
  .metric { min-height: 104px; scroll-snap-align: start; }
  .library-grid { grid-template-columns: 1fr; }
  .episode-item { grid-template-columns: 66px minmax(0, 1fr); }
  .episode-item > :last-child { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  .card-head, .card-body { padding-right: 15px; padding-left: 15px; }
  .slide-grid { display: flex; overflow-x: auto; margin: 0 -15px; padding: 0 15px 7px; scroll-snap-type: x mandatory; }
  .slide { flex: 0 0 51%; scroll-snap-align: center; }
  .download-item { grid-template-columns: 38px minmax(0, 1fr); }
  .download-icon { width: 38px; height: 38px; }
  .download-item > :last-child { grid-column: 1 / -1; }
  .download-item .button { width: 100%; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1 1 130px; }
  .candidate-list { grid-template-columns: 1fr; padding: 14px 15px 0; }
  .toast { right: 14px; bottom: 82px; left: 14px; max-width: none; }
}
