/* ==========================================================================
   통합 스튜디오 — 앱 셸 (Phase 0, 디자인 선행)
   토큰만 tokens.css 에서 가져온다. 여기서 색을 새로 만들지 않는다.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--f-sans);
  font-size: var(--f-body);
  line-height: 1.6;
  letter-spacing: var(--track-tight);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

::selection { background: rgba(255, 176, 32, .28); color: var(--bone-hi); }

:focus-visible {
  outline: 2px solid var(--flame-soft);
  outline-offset: 2px;
  border-radius: var(--r-s);
}

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--r-m);
  background: var(--flame); color: var(--ink); font-weight: 700; text-decoration: none;
  transition: top var(--ui) var(--ease);
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 앱 골격 ─────────────────────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100dvh;
}

.shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
}

/* ── 좌측 레일 ───────────────────────────────────────────────────────────── */

.rail {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100dvh;
  padding: 10px 8px;
  background: linear-gradient(180deg, var(--ink-1) 0%, var(--ink) 62%);
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
}

.rail__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  margin: 0 0 10px;
  padding: 0 6px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--bone-hi);
}

.mark {
  flex: 0 0 32px;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--flame-soft), #FF7A00);
  color: #180B00;
  font: 800 13px/32px var(--f-mono);
  letter-spacing: .02em;
  text-align: center;
  box-shadow: 0 6px 18px -6px rgba(255, 176, 32, .6);
}

.rail__brandtext { display: none; font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.rail__brandtext small {
  display: block;
  font: 600 10px/1.4 var(--f-mono);
  letter-spacing: .14em;
  color: var(--t-52);
}

@media (min-width: 1180px) {
  .rail__brandtext { display: block; }
}

.rail__item,
.rail__extra {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--t-62);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background var(--ui) var(--ease), color var(--ui) var(--ease);
}

.rail__item svg,
.rail__extra svg { flex: 0 0 20px; width: 20px; height: 20px; }

.rail__item:hover,
.rail__extra:hover { background: rgba(232, 237, 241, .05); color: var(--bone-2); }

.rail__item[aria-current="page"] {
  color: var(--bone-hi);
  background: rgba(255, 176, 32, .07);
}

.rail__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -8px; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--flame);
}

.rail__label { display: none; font-size: 13px; font-weight: 600; }
.rail__badge {
  display: none;
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  height: 20px;
  border-radius: var(--r-pill);
  background: rgba(143, 230, 255, .14);
  color: var(--cyan);
  font: 700 11px/20px var(--f-mono);
  text-align: center;
}

@media (min-width: 1180px) {
  .rail__label { display: block; }
  .rail__badge { display: block; }
}
.rail__badge[hidden] { display: none; }
@media (max-width: 1179px) {
  .rail__item, .rail__extra { justify-content: center; padding: 0; }
}

/* 모바일: 레일 대신 하단 탭바 */
@media (max-width: 767px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
}

.rail__sep {
  height: 1px;
  margin: 8px 10px;
  background: var(--line-soft);
}

.rail__foot { margin-top: auto; padding: 0 4px; }
.rail__mode {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: var(--r-m);
  border: 1px solid var(--line-soft);
  background: rgba(6, 10, 18, .6);
  font: 600 11px/1.35 var(--f-mono);
  color: var(--t-52);
}
.rail__mode .dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }
.rail__mode b { color: var(--bone-2); font-weight: 700; }
.rail__mode span { display: none; }
@media (min-width: 1180px) { .rail__mode span { display: block; } }
@media (max-width: 1179px) { .rail__mode { justify-content: center; padding: 10px 0; } }

/* ── 상단 커맨드바 ───────────────────────────────────────────────────────── */

.cmdbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--cmdbar-h);
  padding: 0 12px 0 8px;
  background: rgba(8, 16, 26, .86);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--t-62);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: color var(--ui) var(--ease), background var(--ui) var(--ease);
}
.tab:hover { color: var(--bone-2); background: rgba(232, 237, 241, .04); }
.tab[aria-selected="true"] { color: var(--bone-hi); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--flame);
}
.tab__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tab-acc, var(--t-52)); }
.tab__short { display: none; }
@media (max-width: 767px) {
  .tab { padding: 0 10px; font-size: 12px; }
  .tab__full { display: none; }
  .tab__short { display: inline; }
}

.grow { flex: 1 1 auto; min-width: 0; }
.sp { flex: 1 1 auto; min-width: 0; }

.stats { display: flex; align-items: center; gap: 4px; }

.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  background: rgba(232, 237, 241, .03);
  color: var(--t-62);
  font: 600 12px/1 var(--f-mono);
  transition: border-color var(--ui) var(--ease), color var(--ui) var(--ease);
}
.stat:hover { border-color: var(--line); color: var(--bone-2); }
.stat b { color: var(--bone-hi); font-weight: 700; }
.stat .dot { width: 6px; height: 6px; border-radius: 50%; }
.stat--q .dot { background: var(--bone-2); opacity: .5; }
.stat--r .dot { background: var(--cyan); }
.stat--f .dot { background: var(--a3); }
.stat--r[data-on="0"] .dot, .stat--f[data-on="0"] .dot { opacity: .25; }
.stat__label { display: none; }
@media (min-width: 900px) { .stat__label { display: inline; } }
@media (max-width: 619px) { .stat { padding: 0 8px; } }

/* ── 버튼 ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ui) var(--ease), color var(--ui) var(--ease),
              border-color var(--ui) var(--ease), transform var(--ui) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }

.btn--primary {
  background: var(--flame);
  color: var(--ink);
  font-weight: 700;
}
.btn--primary:hover { background: var(--flame-soft); }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--bone);
}
.btn--ghost:hover { border-color: rgba(232, 237, 241, .3); background: rgba(232, 237, 241, .05); }

.btn--quiet {
  background: rgba(232, 237, 241, .05);
  border-color: var(--line-soft);
  color: var(--bone-2);
  font-weight: 600;
}
.btn--quiet:hover { background: rgba(232, 237, 241, .09); }

.btn--sm { padding: 0 14px; font-size: 13px; }

.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
}
.btn[disabled]:hover, .btn[aria-disabled="true"]:hover { background: var(--flame); }

.btn--new { padding: 0 16px; }
.btn__label { display: none; }
@media (min-width: 620px) { .btn__label { display: inline; } }
@media (max-width: 619px) {
  .cmdbar { padding: 0 8px; gap: 4px; }
  .tab { height: 44px; padding: 0 8px; font-size: 11.5px; gap: 5px; }
  .tab__dot { width: 5px; height: 5px; }
  .stat { min-height: 44px; padding: 0 7px; font-size: 11px; gap: 4px; }
  .stat b { font-size: 11px; }
  .btn--new { width: 44px; padding: 0; }
  .stats { gap: 2px; }
}

/* ── 본문 ────────────────────────────────────────────────────────────────── */

.main {
  flex: 1;
  min-width: 0;
  padding: var(--pad);
  padding-bottom: calc(var(--pad) + var(--tabbar-h));
  scroll-behavior: smooth;
}
@media (min-width: 768px) {
  .main { padding-bottom: var(--pad); }
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid rgba(143, 230, 255, .22);
  border-radius: var(--r-l);
  background: linear-gradient(90deg, rgba(143, 230, 255, .07), rgba(143, 230, 255, .02));
  color: var(--bone-2);
  font-size: 13.5px;
  line-height: 1.55;
}
.banner b { color: var(--bone-hi); font-weight: 700; }
.banner .dot {
  flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(143, 230, 255, .16);
}
.banner__sp { flex: 1; min-width: 0; }
@media (max-width: 619px) {
  .banner { padding: 10px 12px; font-size: 12.5px; line-height: 1.5; gap: 8px 10px; margin-bottom: 16px; }
  .banner__sp { display: none; }
  .banner .btn { margin-left: auto; padding: 0 12px; font-size: 12px; }
}

/* ── 홈 ──────────────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 24px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(24px, 2.1vw + 15px, 36px);
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: var(--track-tighter);
  color: var(--bone-hi);
}
.hero h1 em { font-style: normal; color: var(--flame); }
.hero p { max-width: 56ch; color: var(--t-62); font-size: 15px; }
@media (max-width: 619px) {
  .hero { margin-bottom: 14px; gap: 8px; }
  .hero h1 { font-size: 25px; }
  .hero p { font-size: 13px; }
}

.engines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
@media (min-width: 620px) { .engines { gap: 16px; } }
@media (min-width: 980px) { .engines { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 980px) { .thumb { display: block; } }

.engine {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-l);
  background:
    radial-gradient(120% 90% at 12% 0%, color-mix(in srgb, var(--acc) 12%, transparent), transparent 58%),
    linear-gradient(180deg, var(--ink-2), var(--ink-1));
  overflow: hidden;
  transition: border-color var(--ui) var(--ease), transform var(--ui) var(--ease);
}
@media (min-width: 620px) { .engine { padding: 16px; } }
.engine:hover { border-color: var(--line); transform: translateY(-2px); }
.engine--shorts { --acc: var(--a3); --acc-text: var(--a3); }
.engine--web { --acc: var(--a1); --acc-text: var(--a1); }
.engine--deck { --acc: var(--a0); --acc-text: var(--a0-text); }
.engine--blog { --acc: var(--a2); --acc-text: var(--a2); }

.engine__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.engine__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--acc) 16%, transparent);
  color: var(--acc-text, var(--acc));
  font: 700 10.5px/1 var(--f-mono);
  letter-spacing: .1em;
}
.engine__badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.engine__top .chip { margin-left: auto; }

.engine h3 {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: var(--track-tight);
  color: var(--bone-hi);
}
@media (min-width: 620px) { .engine h3 { font-size: var(--f-h3); } }

.engine p {
  margin-bottom: 14px;
  color: var(--t-62);
  font-size: 12.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 620px) { .engine p { font-size: 14px; } }

.engine__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.engine__actions .btn { flex: 1; padding: 0 10px; font-size: 13px; }
.engine__actions .btn--icon { flex: 0 0 auto; width: 44px; padding: 0; }
.engine__actions .btn--icon svg { width: 16px; height: 16px; }

.thumb {
  position: relative;
  margin-bottom: 12px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-m);
  background: var(--ink);
  overflow: hidden;
}
@media (max-width: 979px) { .thumb { display: none; } }

.thumb__tag {
  position: absolute;
  right: 7px; bottom: 7px;
  padding: 2px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(6, 10, 18, .7);
  color: var(--t-62);
  font: 600 9.5px/1.4 var(--f-mono);
  letter-spacing: .08em;
}

/* 썸네일 아트 — 이미지 파일 없이 CSS 로만 (LCP 보호) */
.thumb--shorts .phone-s {
  position: absolute; left: 50%; top: 50%;
  width: 30%; aspect-ratio: 9 / 16;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: 3px;
  padding: 4px;
  border: 1px solid rgba(232, 237, 241, .22);
  border-radius: 6px;
  background: rgba(6, 10, 18, .55);
}
.thumb--shorts .phone-s span {
  flex: 1; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 176, 32, .42), rgba(255, 90, 43, .18));
}
.thumb--shorts .phone-s span:nth-child(2) { background: linear-gradient(90deg, rgba(255, 90, 43, .38), rgba(109, 74, 255, .2)); }
.thumb--shorts .phone-s span:nth-child(3) { background: linear-gradient(90deg, rgba(91, 231, 169, .34), rgba(43, 140, 255, .18)); }

.thumb--web .browser-s {
  position: absolute; inset: 18% 12%;
  border: 1px solid rgba(232, 237, 241, .2);
  border-radius: 6px;
  background: rgba(6, 10, 18, .5);
  overflow: hidden;
}
.thumb--web .browser-s::before {
  content: ""; display: block; height: 18%;
  background: rgba(232, 237, 241, .08);
  border-bottom: 1px solid var(--line-soft);
}
.thumb--web .browser-s i {
  position: absolute; left: 8%; right: 8%; top: 30%; height: 22%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(43, 140, 255, .5), rgba(43, 140, 255, .12));
}
.thumb--web .browser-s i:nth-child(2) { top: 60%; left: 8%; right: 55%; height: 12%; background: rgba(232, 237, 241, .18); }
.thumb--web .browser-s i:nth-child(3) { top: 60%; left: 50%; right: 8%; height: 12%; background: rgba(232, 237, 241, .1); }

.thumb--deck .slide-s {
  position: absolute; inset: 20% 10%;
  border: 1px solid rgba(232, 237, 241, .2);
  border-radius: 4px;
  background: rgba(6, 10, 18, .45);
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.thumb--deck .slide-s b {
  display: block; width: 52%; height: 6px; border-radius: 2px;
  background: rgba(109, 74, 255, .75);
}
.thumb--deck .slide-s i { display: block; height: 3px; border-radius: 2px; background: rgba(232, 237, 241, .22); }
.thumb--deck .slide-s i:nth-of-type(2) { width: 82%; }
.thumb--deck .slide-s i:nth-of-type(3) { width: 64%; }

.thumb--blog .post-s {
  position: absolute; inset: 16% 18%;
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px;
  border: 1px solid rgba(232, 237, 241, .18);
  border-radius: 5px;
  background: rgba(6, 10, 18, .45);
}
.thumb--blog .post-s b { display: block; width: 64%; height: 7px; border-radius: 2px; background: rgba(91, 231, 169, .6); }
.thumb--blog .post-s i { display: block; height: 3px; border-radius: 2px; background: rgba(232, 237, 241, .2); }
.thumb--blog .post-s i:nth-of-type(3) { width: 78%; }
.thumb--blog .post-s i:nth-of-type(4) { width: 88%; }

/* ── 홈 하단 2단 ─────────────────────────────────────────────────────────── */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (min-width: 980px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) var(--queue-w); gap: 24px; }
}

.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-l);
  background: var(--ink-1);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.panel__head h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: var(--track-tight);
  color: var(--bone-hi);
}
.panel__head .sp { flex: 1; }
.panel__note {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(109, 74, 255, .06);
  color: var(--t-62);
  font-size: 12px;
}
.panel__body { padding: 16px; }
.panel__body--flush { padding: 0; }
.panel__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
}

/* 산출물 카드 */
.lib {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 519px) { .lib { grid-template-columns: minmax(0, 1fr); } }

.art {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-m);
  background: var(--ink);
  transition: border-color var(--ui) var(--ease);
}
.art:hover { border-color: var(--line); }
.art__top { display: flex; align-items: center; gap: 6px; }
.art__fmt {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 7px;
  border-radius: 4px;
  background: rgba(232, 237, 241, .07);
  color: var(--bone-2);
  font: 700 10px/1 var(--f-mono);
  letter-spacing: .06em;
}
.art__fmt--mp4 { background: rgba(255, 90, 43, .14); color: #FF8A66; }
.art__fmt--html { background: rgba(43, 140, 255, .14); color: #6FB6FF; }
.art__fmt--pptx { background: rgba(109, 74, 255, .16); color: #A08CFF; }
.art__fmt--md { background: rgba(24, 201, 138, .14); color: var(--mint); }
.art h3 {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--bone);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art__meta { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.art__meta time { font: 600 11px/1 var(--f-mono); color: var(--t-52); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
  color: var(--t-52);
  font-size: 13px;
}
.empty svg { width: 26px; height: 26px; opacity: .5; }
.empty b { color: var(--bone-2); font-weight: 600; }

/* 작업 큐 */
.qlist { display: flex; flex-direction: column; }

.qrow {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  text-align: left;
  transition: background var(--ui) var(--ease);
}
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: rgba(232, 237, 241, .035); }

.qrow__badge {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--acc) 16%, transparent);
  color: var(--acc-text, var(--acc));
  font: 700 11px/1 var(--f-mono);
}
.qrow__main { min-width: 0; }
.qrow__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--bone);
}
.qrow__sub {
  display: flex; align-items: center; gap: 6px;
  font: 600 11px/1.4 var(--f-mono);
  color: var(--t-52);
  margin-top: 3px;
}
.qrow__right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

.bar {
  width: 54px; height: 3px;
  border-radius: 2px;
  background: rgba(232, 237, 241, .12);
  overflow: hidden;
}
.bar i { display: block; height: 100%; background: var(--cyan); width: 0; transition: width 700ms linear; }

/* ── 상태칩 ──────────────────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font: 700 11px/1 var(--f-mono);
  letter-spacing: .02em;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.chip--idle { color: var(--t-62); background: rgba(232, 237, 241, .06); border-color: rgba(232, 237, 241, .1); }
.chip--queued { color: var(--bone-2); background: rgba(232, 237, 241, .08); border-color: rgba(232, 237, 241, .12); }
.chip--running { color: var(--cyan); background: rgba(143, 230, 255, .1); border-color: rgba(143, 230, 255, .26); }
.chip--running::before { animation: pulse 1.4s var(--ease-io) infinite; }
.chip--done { color: var(--mint); background: rgba(91, 231, 169, .1); border-color: rgba(91, 231, 169, .24); }
.chip--failed { color: #FF7A5A; background: rgba(255, 90, 43, .12); border-color: rgba(255, 90, 43, .3); }
.chip--mock { color: #A08CFF; background: rgba(109, 74, 255, .14); border-color: rgba(109, 74, 255, .3); }
.chip--mock::before { background: currentColor; }
.chip--sm { height: 20px; padding: 0 7px; font-size: 10px; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ── 엔진 작업 화면 (입력 40% + 미리보기 60%) ───────────────────────────── */

.view[hidden] { display: none; }

.work__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
}
.work__head h1 {
  font-size: clamp(22px, 1.6vw + 15px, 30px);
  font-weight: 800;
  letter-spacing: var(--track-tighter);
  color: var(--bone-hi);
}
.work__head p { color: var(--t-62); font-size: 13.5px; }
.work__head .sp { flex: 1; }

.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (min-width: 980px) {
  .work {
    grid-template-columns: minmax(300px, 40fr) minmax(0, 60fr);
    gap: 20px;
  }
}

.form-panel { position: relative; }
@media (min-width: 980px) { .form-panel { position: sticky; top: calc(var(--cmdbar-h) + 16px); } }

.form-panel__body { padding: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field:last-of-type { margin-bottom: 0; }
.field__label {
  display: flex; align-items: center; gap: 6px;
  font: 600 11px/1.3 var(--f-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--t-52);
}
.field__hint { color: var(--t-52); font-size: 11.5px; line-height: 1.5; }

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink);
  color: var(--bone);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--ui) var(--ease), box-shadow var(--ui) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--t-52); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--flame);
  box-shadow: 0 0 0 3px rgba(255, 176, 32, .16);
}
.textarea { min-height: 96px; resize: vertical; font-family: var(--f-mono); font-size: 13px; }
.select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--t-62) 50%),
                    linear-gradient(135deg, var(--t-62) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.select option { background: var(--ink-2); color: var(--bone); }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  background: var(--ink);
}
.seg button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--t-62);
  font-size: 13px;
  font-weight: 700;
  transition: background var(--ui) var(--ease), color var(--ui) var(--ease);
}
.seg button[aria-pressed="true"] { background: var(--ink-3); color: var(--bone-hi); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 8px; }

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--ink);
  color: var(--bone-2);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  transition: border-color var(--ui) var(--ease), background var(--ui) var(--ease);
}
.choice:hover { border-color: var(--line); }
.choice[aria-pressed="true"] {
  border-color: rgba(255, 176, 32, .55);
  background: rgba(255, 176, 32, .08);
  color: var(--bone-hi);
}
.choice i {
  flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--acc, var(--t-52));
}
.choice small { display: block; font: 600 10px/1.4 var(--f-mono); color: var(--t-52); font-weight: 600; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--bone-2);
  font-size: 13px;
  font-weight: 600;
}
.check input {
  width: 18px; height: 18px;
  accent-color: var(--flame);
}

.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-actions .btn--primary { flex: 1; }
.form-actions .btn--icon { flex: 0 0 44px; width: 44px; padding: 0; }

/* 미리보기 표면 */
.surface {
  display: flex;
  flex-direction: column;
  min-height: 480px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-l);
  background: var(--ink-1);
  overflow: hidden;
}
@media (min-width: 980px) { .surface { min-height: 560px; } }

.surface__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--ink-2);
}
.surface__title {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--bone-2);
}
.surface__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surface__bar .sp { flex: 1; }
.surface__body {
  flex: 1;
  min-height: 0;
  padding: 16px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 176, 32, .045), transparent 62%),
    var(--ink);
  overflow: auto;
}
.surface__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--t-52);
  font-size: 11.5px;
  line-height: 1.5;
}
.surface__foot .sp { flex: 1; }

.pv-stage { display: flex; justify-content: center; padding: 8px 0 16px; }

/* 쇼츠 미리보기 — 9:16 폰 프레임 */
.phone {
  position: relative;
  width: min(258px, 92%);
  aspect-ratio: 9 / 16;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid rgba(232, 237, 241, .16);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--ink-2), #04070D);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .02);
}
.phone__notch {
  width: 44px; height: 4px;
  margin: 2px auto 8px;
  border-radius: 3px;
  background: rgba(232, 237, 241, .18);
}
.phone__scene {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 10px;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 30% 10%, rgba(255, 176, 32, .35), transparent 60%),
    linear-gradient(160deg, #1A1206, #0A0D16 60%);
}
.phone__scene + .phone__scene { margin-top: 6px; }
.phone__scene b {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--bone-hi);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
}
.phone__scene i {
  display: block;
  height: 3px;
  width: 72%;
  border-radius: 2px;
  background: rgba(232, 237, 241, .22);
}
.phone__scene i:nth-of-type(2) { width: 52%; }
.phone__tc {
  position: absolute;
  right: 8px; top: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(6, 10, 18, .7);
  color: var(--t-62);
  font: 600 9.5px/1.3 var(--f-mono);
}

/* 쇼츠: 폰 + 장면 표 (60% 폭을 쓰는 2단) */
.pv-split {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 699px) {
  .pv-split { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .pv-split .scenes { width: 100%; }
}
.scenes {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--ink-1);
  overflow: hidden;
}
.scenes__head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--ink-2);
  font: 600 10px/1 var(--f-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--t-52);
}
.scene {
  display: grid;
  grid-template-columns: 24px 62px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--bone-2);
}
.scene:last-child { border-bottom: 0; }
.scene .no { font: 700 11px/1 var(--f-mono); color: var(--t-52); }
.scene .tc { font: 600 11px/1 var(--f-mono); color: var(--cyan); }
.scene b { display: block; font-weight: 700; color: var(--bone); font-size: 12.5px; }
.scene span { display: block; color: var(--t-52); font-size: 11px; margin-top: 2px; }

/* 웹 미리보기 — 브라우저 프레임 + 와이어프레임 */
.browser {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
}
.browser__bar {
  display: flex; align-items: center; gap: 5px;
  height: 30px;
  padding: 0 10px;
  background: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
}
.browser__bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(232, 237, 241, .2); }
.browser__url {
  flex: 1;
  margin-left: 6px;
  height: 18px;
  border-radius: 4px;
  background: rgba(6, 10, 18, .7);
  color: var(--t-52);
  font: 600 9.5px/18px var(--f-mono);
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wire { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.wire__hero {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  min-height: 96px;
  padding: 12px;
  border-radius: 8px;
  background:
    radial-gradient(100% 120% at 20% 0%, color-mix(in srgb, var(--theme, var(--a1)) 30%, transparent), transparent 62%),
    var(--ink-2);
  border: 1px solid var(--line-soft);
}
.wire__hero b { font-size: 13px; font-weight: 800; color: var(--bone-hi); line-height: 1.3; }
.wire__hero i { display: block; height: 3px; width: 60%; border-radius: 2px; background: rgba(232, 237, 241, .2); }
.wire__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wire__cell {
  min-height: 52px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(232, 237, 241, .03);
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.wire__cell b { display: block; width: 60%; height: 5px; border-radius: 2px; background: color-mix(in srgb, var(--theme, var(--a1)) 70%, transparent); }
.wire__cell i { display: block; height: 3px; border-radius: 2px; background: rgba(232, 237, 241, .16); }
.wire__cell i + i { width: 70%; }

/* PPT 미리보기 — 슬라이드 그리드 */
.slides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.slide {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: linear-gradient(160deg, var(--ink-3), var(--ink-2));
  display: flex; flex-direction: column; gap: 5px;
  overflow: hidden;
}
.slide::after {
  content: attr(data-no);
  position: absolute; right: 7px; bottom: 5px;
  font: 600 9px/1 var(--f-mono);
  color: var(--t-52);
}
.slide b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px; font-weight: 700; line-height: 1.3;
  color: var(--bone-hi);
}
.slide i { display: block; height: 3px; border-radius: 2px; background: rgba(232, 237, 241, .18); }
.slide i:nth-of-type(2) { width: 78%; }
.slide i:nth-of-type(3) { width: 58%; }
.slide--title { background: radial-gradient(110% 100% at 15% 0%, rgba(109, 74, 255, .4), transparent 65%), var(--ink-2); }

/* 블로그 미리보기 — 글 프레임 */
.post {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-2);
}
.post__kicker { font: 700 10px/1 var(--f-mono); letter-spacing: .12em; color: var(--a2); }
.post h2 {
  margin: 8px 0 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--bone-hi);
  letter-spacing: var(--track-tight);
}
.post__lead { color: var(--t-62); font-size: 12.5px; line-height: 1.6; margin-bottom: 12px; }
.post__img {
  height: 88px;
  margin-bottom: 12px;
  border-radius: 6px;
  background:
    radial-gradient(80% 120% at 20% 0%, rgba(24, 201, 138, .28), transparent 60%),
    repeating-linear-gradient(115deg, rgba(232, 237, 241, .05) 0 8px, transparent 8px 16px),
    var(--ink);
  border: 1px solid var(--line-soft);
}
.post__h3 {
  margin: 12px 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--bone);
}
.post__body { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.post__body i { display: block; height: 4px; border-radius: 2px; background: rgba(232, 237, 241, .13); }
.post__body i:nth-child(3n) { width: 74%; }
.post__body i:nth-child(4n) { width: 88%; }

/* 게이트 목록 (블로그) */
.gates { display: grid; gap: 6px; margin-top: 12px; }
.gate {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(6, 10, 18, .5);
  font-size: 11.5px;
  color: var(--t-62);
}
.gate b { color: var(--bone-2); font-weight: 600; }
.gate .chip { margin-left: auto; }

/* 결과 오버레이 (모의 완료) */
.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 20px;
  border: 1px dashed rgba(109, 74, 255, .45);
  border-radius: var(--r-m);
  background: rgba(109, 74, 255, .07);
  text-align: center;
}
.result b { color: var(--bone-hi); font-size: 13.5px; }
.result p { color: var(--t-62); font-size: 12px; max-width: 46ch; }
.result .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ── 큐 화면 ─────────────────────────────────────────────────────────────── */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-head h1 {
  font-size: clamp(20px, 1.4vw + 14px, 26px);
  font-weight: 800;
  letter-spacing: var(--track-tighter);
  color: var(--bone-hi);
}
.section-head .sp { flex: 1; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filter {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  background: var(--ink-1);
  color: var(--t-62);
  font-size: 12.5px;
  font-weight: 600;
}
.filter[aria-pressed="true"] {
  border-color: rgba(255, 176, 32, .5);
  background: rgba(255, 176, 32, .08);
  color: var(--bone-hi);
}
.filter .n { font: 700 10px/1 var(--f-mono); color: var(--t-52); }

/* 표 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 620px; }
.table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font: 600 10.5px/1 var(--f-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--t-52);
  text-align: left;
  white-space: nowrap;
}
.table td {
  height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--bone-2);
  white-space: nowrap;
}
.table tbody tr:hover td { background: rgba(232, 237, 241, .02); }
.table td.title { color: var(--bone); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.table td.num { font: 600 12px/1 var(--f-mono); color: var(--t-62); }

.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ── 설정 ────────────────────────────────────────────────────────────────── */

.settings { display: grid; gap: 20px; max-width: 900px; }
@media (min-width: 980px) { .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); } .settings > .panel--wide { grid-column: 1 / -1; } }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.kv dt { color: var(--t-62); font-size: 13px; }
.kv dd { margin: 0; font: 600 12px/1.4 var(--f-mono); color: var(--bone); text-align: right; }

.status-line {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-m);
  background: var(--ink);
  font-size: 12.5px;
  color: var(--t-62);
}
.status-line b { color: var(--bone-2); }
.status-line .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }
.status-line[data-mode="live"] .dot { background: var(--mint); }
.status-line[data-mode="checking"] .dot { background: var(--cyan); animation: pulse 1.2s infinite; }

.audit { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font: 600 10px/1 var(--f-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--t-52);
  text-align: left;
}
.audit td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); color: var(--bone-2); }
.audit td.r { font-family: var(--f-mono); color: var(--bone-hi); text-align: right; }
.audit .ok { color: var(--mint); }
.audit .bad { color: #FF7A5A; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); vertical-align: -2px; margin-right: 6px; }

/* ── 새 작업 팝오버 ──────────────────────────────────────────────────────── */

.popover {
  position: absolute;
  top: calc(100% - 4px);
  right: 8px;
  z-index: 40;
  width: min(320px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--ink-2);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9);
}
.popover[hidden] { display: none; }
.popover__title {
  padding: 6px 8px 8px;
  font: 600 10px/1 var(--f-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--t-52);
}
.popover__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--bone-2);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.popover__item:hover { background: rgba(232, 237, 241, .06); }
.popover__item i {
  flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--acc);
}
.popover__item small { display: block; font: 600 10px/1.4 var(--f-mono); color: var(--t-52); font-weight: 600; }

/* ── 모바일 하단 탭바 ────────────────────────────────────────────────────── */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(8, 16, 26, .94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
@media (min-width: 768px) { .tabbar { display: none; } }

.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--t-52);
  font-size: 10px;
  font-weight: 600;
}
.tabbar button svg { width: 20px; height: 20px; }
.tabbar button[aria-current="page"] { color: var(--flame); }

/* ── reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .engine:hover { transform: none; }
}

/* ── 인쇄 (스크린샷/PDF 보조) ────────────────────────────────────────────── */
@media print {
  .rail, .cmdbar, .tabbar, .banner { display: none; }
  .app { grid-template-columns: 1fr; }
}
