/* ==========================================================================
   품꾸미기(pum-embed) 통합 리뷰 허브 — 스타일
   기준: 품스 브랜드(#f34d33·#3ebd91) + 다이닝 라이프 헤더 구조(다크 바·알약 탭)
   ========================================================================== */

@font-face { font-family: 'Pum Sans'; src: url('../assets/fonts/Pretendard-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Pum Sans'; src: url('../assets/fonts/Pretendard-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Pum Sans'; src: url('../assets/fonts/Pretendard-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #221d1a;
  --ink-2: #3b352f;
  --ink-3: #5c544b;
  --muted: #746b60;
  --paper: #faf7f2;
  --paper-2: #f3ede4;
  --card: #ffffff;
  --line: #e6dfd4;
  --line-2: #efe9e0;
  --brand: #f34d33;
  --brand-2: #d8401f;
  --brand-soft: #fdece7;
  --green: #1c8f6b;
  --green-soft: #e4f5ee;
  --gold: #b98a2e;
  --gold-soft: #fdf3dc;
  --violet: #6d28d9;
  --blue: #1d4ed8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(34, 29, 26, .05), 0 8px 22px -12px rgba(34, 29, 26, .18);
  --h: 58px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Pum Sans', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: #ffd9cf; }

/* ---------------------------------------------------------------- 상단 바 */
.topbar {
  height: var(--h);
  background: #1d1a18;
  color: #fff;
  position: relative;
  z-index: 40;
  border-bottom: 1px solid #2c2723;
}
.topbar__in {
  height: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #ff7455, #e23c1e);
  font-weight: 700; font-size: 15px; letter-spacing: -.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 8px rgba(243,77,51,.35);
}
.brand__txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand__txt b { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.brand__txt small { font-size: 10.5px; color: #a9a29a; letter-spacing: .01em; }
.brand__txt i { font-style: normal; color: #ffb4a2; }

.tabs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 7px 13px; border-radius: 99px;
  font-size: 13px; font-weight: 600; color: #cfc8c0; white-space: nowrap;
  transition: background .15s, color .15s;
}
.tabs a em { font-style: normal; font-size: 10.5px; font-weight: 500; color: #8d857c; letter-spacing: -.01em; }
.tabs a:hover { color: #fff; background: rgba(255,255,255,.07); }
.tabs a.is-on { background: #fff; color: #1d1a18; }
.tabs a.is-on em { color: #8d857c; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.tbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px; border-radius: 99px;
  border: 1px solid rgba(255,255,255,.26); background: transparent;
  color: #f0ece7; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.tbtn svg { width: 14px; height: 14px; opacity: .85; }
.tbtn:hover { background: rgba(255,255,255,.1); }
.tbtn[aria-pressed="false"] { color: #a49c93; border-color: rgba(255,255,255,.14); }
.tbtn--cm { border-color: rgba(255,255,255,.28); }
.tbtn--cm.is-on { background: #fff; color: #1d1a18; border-color: #fff; }
.tbtn__cnt {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.tbtn--cm.is-on .tbtn__cnt { background: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- 레이아웃 */
.view { height: calc(100vh - var(--h)); }
.work {
  height: 100%;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 344px;
  align-items: stretch;
}
body.is-panel-off .work { grid-template-columns: 236px minmax(0, 1fr); }
body.is-panel-off .panel { display: none; }

/* ---------------------------------------------------------------- 좌측 목록 */
.rail {
  border-right: 1px solid var(--line);
  background: #fffdfa;
  padding: 14px 10px 18px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.rail__group { display: flex; flex-direction: column; gap: 2px; }
.rail__title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #9b9187; padding: 0 8px 6px;
}
.rail__item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 9px; border-radius: 9px; border: 0; background: transparent;
  text-align: left; color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  transition: background .12s, color .12s;
}
.rail__item:hover { background: var(--paper-2); }
.rail__item.is-on { background: var(--ink); color: #fff; }
.rail__item.is-on .rail__code { color: #ffb9a8; }
.rail__item.is-on .rail__cnt { background: var(--brand); color: #fff; }
.rail__code { font-size: 8.5px; font-weight: 700; color: #a1978c; letter-spacing: .02em; flex: none; width: 54px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail__code--new { color: var(--brand); }
.rail__code--old { color: #a1978c; }
.rail__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__cnt {
  flex: none; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand-2); font-size: 10.5px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.rail__dot { width: 7px; height: 7px; border-radius: 99px; flex: none; margin-left: 4px; }
.rail__dot--guest { background: #2f7bd6; }
.rail__dot--owner { background: var(--brand); }
.rail__dot--ops { background: #6d28d9; }
.rail__dot--data { background: var(--green); }
.rail__foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.rail__link { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.rail__link:hover { color: var(--brand-2); }
.rail__hint { font-size: 11px; color: #9b9187; line-height: 1.5; }

/* ---------------------------------------------------------------- 가운데 */
.stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 18px;
  overflow: hidden;
}
.stage--flow, .stage--erd, .stage--glossary { overflow-y: auto; }

.stage__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.route { display: flex; align-items: center; gap: 7px; min-width: 0; flex-wrap: wrap; }
.route b {
  font-size: 11px; font-weight: 700; color: #8a8076; letter-spacing: .03em;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
}
.route__hash { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.route__do { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.route i { color: #b8ada0; font-style: normal; font-size: 11px; }
.stage__tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg__btn {
  border: 0; background: transparent; border-radius: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 9px;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-on { background: var(--ink); color: #fff; }
.seg--src .seg__btn.is-on { background: var(--green-soft); color: var(--green); }

.mini {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); padding: 5px 9px;
  transition: background .12s, border-color .12s, color .12s;
}
.mini:hover { background: var(--paper-2); }
.mini--ghost { border-color: transparent; background: transparent; color: var(--muted); }
.mini--ghost:hover { background: var(--paper-2); color: var(--ink); }
.mini--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.mini--primary:hover { background: #000; }
.mini--danger { border-color: transparent; background: transparent; color: #a9a096; }
.mini--danger:hover { color: #c0392b; background: #fdeceb; }

/* 브라우저 프레임 */
.browser {
  flex: 1; min-height: 380px;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.browser__bar {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 12px; flex: none;
  background: #f7f2ea; border-bottom: 1px solid var(--line);
}
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: #ded5c8; display: block; }
.dots i:first-child { background: #f0b3a6; }
.browser__url {
  flex: 1; min-width: 0; font-size: 11px; color: var(--muted);
  background: #fff; border: 1px solid var(--line); border-radius: 99px;
  padding: 3px 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.browser__url .ok { color: var(--green); font-weight: 700; font-family: 'Pum Sans', sans-serif; }
.browser__badge {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 5px; flex: none;
}
.browser__badge.is-live { color: var(--green); background: var(--green-soft); display: inline-flex; align-items: center; gap: 4px; }
.browser__badge.is-live i { width: 5px; height: 5px; border-radius: 99px; background: var(--green); display: inline-block; animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.browser__badge.is-local { color: var(--gold); background: var(--gold-soft); }

.browser__body { position: relative; flex: 1; min-height: 0; background: #f4efe6; display: flex; justify-content: center; }
.frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.browser[data-device="mobile"] .frame {
  width: 390px; max-width: 100%; height: 100%; left: auto; right: auto;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  box-shadow: 0 0 0 6px rgba(34,29,26,.06);
}
.frame__load {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: #fbf8f3; color: var(--muted); font-size: 12.5px;
}

.stage__note { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.55; }
.stage__note b { color: var(--ink-2); }

/* ---------------------------------------------------------------- 우측 패널 */
.panel {
  border-left: 1px solid var(--line);
  background: #fff;
  display: flex; flex-direction: column;
  min-height: 0;
}
.panel__tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line-2); flex: none; }
.panel__tab {
  border: 0; background: transparent; padding: 8px 10px 9px;
  font-size: 12.5px; font-weight: 700; color: #9a9086;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.panel__tab b { font-size: 11px; color: var(--brand-2); margin-left: 2px; }
.panel__tab.is-on { color: var(--ink); border-bottom-color: var(--brand); }
.panel__body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 20px; }
.panel__body.is-cm { display: flex; flex-direction: column; overflow: hidden; padding: 0; }

/* 설명 */
.ex__head { padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.ex__code {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em;
  color: #8a8076; background: var(--paper-2); border-radius: 5px; padding: 2px 6px;
}
.ex__head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 4px; }
.ex__route { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.ex__route i { font-style: normal; color: #b8ada0; }
.ex__about { font-size: 12.5px; color: var(--ink-2); line-height: 1.62; margin-top: 9px; }
.ex__why { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 7px; background: var(--paper); border-radius: 8px; padding: 8px 10px; }
.ex__why b { color: var(--ink-2); }

.ex__secs { margin-top: 14px; }
.ex__secs-title { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7px; }
.ex__secs-title h3 { font-size: 12px; font-weight: 700; }
.ex__secs-title span { font-size: 10.5px; color: #a1978c; }
.secrow {
  display: grid; grid-template-columns: 1fr 26px; align-items: start; gap: 2px 8px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent;
}
.secrow:hover { background: var(--paper); }
.secrow.is-on { background: var(--brand-soft); border-color: #f6c9bd; }
.secrow__name { font-size: 12px; font-weight: 700; color: var(--ink); }
.secrow__desc { grid-column: 1 / 2; font-size: 11px; color: var(--muted); line-height: 1.5; }
.secrow__cnt, .secrow__btn {
  grid-row: 1 / 3; grid-column: 2; align-self: center;
  width: 24px; height: 24px; border-radius: 99px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center;
}
.secrow__btn:hover { border-color: var(--brand); color: var(--brand-2); }
.secrow__btn b { color: var(--brand-2); font-size: 11px; }
.secrow--all .secrow__desc { color: #a1978c; }

.ex__checks { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line-2); }
.ex__checks h3 { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.ex__checks ul { display: flex; flex-direction: column; gap: 5px; }
.ex__checks li { position: relative; padding-left: 13px; font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }
.ex__checks li::before { content: ''; position: absolute; left: 3px; top: 7px; width: 5px; height: 5px; border-radius: 99px; background: var(--brand); opacity: .55; }
.ex__muted { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.ex__next { margin-top: 14px; }
.ex__next h3 { font-size: 12px; font-weight: 700; margin-bottom: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px;
}
.chip i { font-style: normal; font-size: 9.5px; color: #a1978c; font-family: ui-monospace, Menlo, monospace; }
.chip--link { background: #fff; cursor: pointer; }
.chip--link:hover { border-color: var(--brand); color: var(--brand-2); }

.ex__table { margin-top: 12px; overflow-x: auto; }
.ex__table table { width: 100%; border-collapse: collapse; font-size: 11px; table-layout: fixed; }
.ex__table th:nth-child(1), .ex__table td:nth-child(1) { width: 42%; }
.ex__table th:nth-child(2), .ex__table td:nth-child(2) { width: 25%; }
.ex__table td { word-break: break-word; }
.ex__table th { text-align: left; font-weight: 700; color: #8a8076; border-bottom: 1px solid var(--line); padding: 5px 6px; white-space: nowrap; }
.ex__table td { border-bottom: 1px solid var(--line-2); padding: 5px 6px; vertical-align: top; color: var(--ink-2); }
.ex__table td b { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--ink); }

.btn {
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: 9px; font-weight: 700; font-size: 12.5px; padding: 9px 14px;
}
.btn:hover { background: #000; }
.btn--sm { padding: 6px 11px; font-size: 11.5px; border-radius: 8px; }

/* ---------------------------------------------------------------- 코멘트 */
.cm-tools { flex: none; padding: 10px 12px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 7px; background: #fffdfb; }
.cm-tools__row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cm-tools__row--end { justify-content: space-between; }
.sel {
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
  font-size: 11px; font-weight: 600; color: var(--ink-2); padding: 4px 6px;
}
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.chk input { width: 13px; height: 13px; accent-color: var(--brand); }
.sync { font-size: 10px; font-weight: 600; color: #9a9086; }
.sync--server { color: var(--green); }
.sync--error { color: var(--brand-2); }
.sync--syncing { color: var(--gold); }

.cm-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 9px; }
.cm {
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
  padding: 9px 10px; box-shadow: 0 1px 2px rgba(34,29,26,.03);
}
.cm--done { background: #fbfaf8; border-color: var(--line-2); }
.cm--done .cm__text { color: #9a9086; }
.cm--flash { animation: flash 1.6s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px #ffd2c6; } 100% { box-shadow: 0 0 0 0 rgba(255,210,198,0); } }
.cm__head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1.5px 5px; }
.tag--sm { font-size: 9.5px; }
.cm__author { font-size: 11.5px; font-weight: 700; }
.cm__time { font-size: 10px; color: #a1978c; margin-left: auto; }
.cm__state { font-size: 9.5px; font-weight: 700; color: var(--green); background: var(--green-soft); border-radius: 5px; padding: 1.5px 5px; }
.cm--done .cm__state { color: #8a8076; background: var(--paper-2); }
.cm__text { font-size: 12px; color: var(--ink-2); line-height: 1.55; margin: 6px 0 0; word-break: break-word; }
.cm__target { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.cm__target span { font-size: 10px; color: #8a8076; background: var(--paper); border-radius: 5px; padding: 2px 6px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm__replies { margin-top: 8px; padding-left: 8px; border-left: 2px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.cmr__head { display: flex; align-items: center; gap: 5px; }
.cmr__head b { font-size: 11px; }
.cmr__head time { font-size: 9.5px; color: #a1978c; margin-left: auto; }
.cmr p { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; margin-top: 2px; word-break: break-word; }
.cmr-form { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.cmr-form .inp { flex: 1 1 80px; }
.cmr-form .ta { flex: 1 1 100%; }
.cmr-form__foot { flex: 1 1 100%; display: flex; justify-content: flex-end; gap: 5px; }
.cm__foot { display: flex; gap: 2px; margin-top: 7px; flex-wrap: wrap; }
.cm__foot .mini { font-size: 10.5px; padding: 3px 7px; }

.cm-empty { padding: 34px 16px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; }
.cm-empty span { font-size: 11px; color: #a1978c; }

.cm-form { flex: none; border-top: 1px solid var(--line-2); background: #fffdfb; padding: 9px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.cm-form__who { display: flex; gap: 6px; }
.inp {
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
  padding: 6px 8px; font-size: 11.5px; min-width: 0; color: var(--ink);
}
.inp:focus, .ta:focus, .sel:focus { outline: 2px solid #f8c9be; outline-offset: 0; border-color: #f0a795; }
.cm-form__who .inp { flex: 1; }
.cm-form__who .sel { width: 78px; font-size: 11px; }
.ta {
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 7px 8px; font-size: 12px; resize: vertical; min-height: 58px; line-height: 1.5;
}
.cm-form__foot { display: flex; align-items: center; gap: 8px; }
.cm-form__target { font-size: 10px; color: #8a8076; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn--primary { background: var(--brand); border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-2); }

/* ---------------------------------------------------------------- 흐름 */
.flow__head { margin-bottom: 16px; }
.flow__head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.flow__head p { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; max-width: 760px; }
.flow__head b { color: var(--ink-2); }
.flow { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.flow__path { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.flow__title { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.flow__title h3 { font-size: 13.5px; font-weight: 700; }
.flow__dot { width: 9px; height: 9px; border-radius: 99px; background: var(--brand); }
.flow__path--guest .flow__dot { background: #2f7bd6; }
.flow__path--owner .flow__dot { background: var(--brand); }
.flow__path--ops .flow__dot { background: #6d28d9; }
.flow__path--data .flow__dot { background: var(--green); }
.flow__row { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: #ded5c8 transparent; }
.flow__row::-webkit-scrollbar { height: 5px; }
.flow__row::-webkit-scrollbar-thumb { background: #ded5c8; border-radius: 99px; }
.flow__note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line-2); }

.node {
  position: relative; display: flex; flex-direction: column; gap: 1px; flex: 0 0 auto;
  min-width: 116px; padding: 8px 11px 9px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; text-align: left;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.node:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(34,29,26,.4); border-color: #d9cfc0; }
.node__code { font-size: 9px; font-weight: 700; letter-spacing: .04em; color: #a1978c; font-family: ui-monospace, Menlo, monospace; }
.node__label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.node__sub { font-size: 10px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.node--screen { background: #f4f8ff; border-color: #cfe0f7; }
.node--screen .node__code { color: #4e7cb5; }
.node--data { background: #f2fbf7; border-color: #cbe9dd; }
.node--data .node__code { color: #2f8a6b; }
.node--entry { background: #f7f4ef; border-color: #e2d8ca; }
.node__cnt {
  position: absolute; top: -7px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 1px 4px rgba(243,77,51,.4);
}
.arrow { display: grid; place-items: center; color: #c3b8a9; font-size: 13px; padding: 0 1px; }
.arrow--branch { color: #9ec3ea; }

/* ---------------------------------------------------------------- ERD */
.erd__hint { display: none; }
.erd__wrap { flex: none; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; max-width: 100%; }
.erd { position: relative; }
.erd__svg { position: absolute; inset: 0; pointer-events: none; }
.erdlink { fill: none; stroke: #c9bdae; stroke-width: 1.6; }
.erdlink--one { stroke: #9ab8a9; stroke-dasharray: 5 3; }
.erdlabel { font-size: 9px; fill: #a1978c; font-family: 'Pum Sans', sans-serif; font-weight: 600; }
.tbl {
  position: absolute; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; padding: 0; overflow: hidden; cursor: pointer;
  box-shadow: 0 4px 14px -10px rgba(34,29,26,.4); transition: border-color .12s, box-shadow .12s;
}
.tbl:hover { border-color: #cdbfa9; }
.tbl.is-on { border-color: var(--brand); box-shadow: 0 0 0 2px #fbd3c8, 0 8px 20px -12px rgba(243,77,51,.5); }
.tbl__head { display: flex; align-items: flex-start; gap: 6px; padding: 8px 10px 6px; border-bottom: 1px solid var(--line-2); background: #fffdfa; }
.tbl__head div { flex: 1; min-width: 0; }
.tbl__head b { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: -.01em; }
.tbl__head span { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.badge { flex: none; font-style: normal; font-size: 9px; font-weight: 700; border-radius: 4px; padding: 1px 5px; }
.badge--new { background: var(--brand-soft); color: var(--brand-2); }
.badge--old { background: var(--paper-2); color: #8a8076; }
.badge--com { background: #eef4ec; color: #5c7a52; }
.tbl__cols { padding: 5px 0 6px; }
.tbl__cols li { display: flex; align-items: center; gap: 5px; padding: 1.5px 10px; }
.col { font-size: 10px; font-family: ui-monospace, Menlo, monospace; color: var(--ink-2); }
.k { font-style: normal; font-size: 8px; font-weight: 700; border-radius: 3px; padding: 0 3px; }
.k--pk { background: #fdf0c9; color: #8a6a1f; }
.k--uk { background: #e7f0fd; color: #2d5ea8; }
.k--fk { background: #eef7f1; color: #2f7a58; }
.tbl__more { padding: 4px 10px 7px; font-size: 9px; color: #a1978c; border-top: 1px dashed var(--line-2); }

.erd__codes, .erd__links { margin-top: 16px; }
.erd__codes h3, .erd__links h3 { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.codegroup { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 7px; }
.codegroup__head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 6px; }
.codegroup__head b { font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
.codegroup__head span { font-size: 10.5px; color: var(--muted); }
.codegroup__head em { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700; color: var(--brand-2); }
.erd__links ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 5px; }
.erd__links li { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 10.5px; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.erd__links li b { font-family: ui-monospace, Menlo, monospace; font-size: 10px; }
.erd__links li span { font-family: ui-monospace, Menlo, monospace; font-size: 9.5px; color: var(--muted); }
.erd__links li em { font-style: normal; font-weight: 700; color: var(--green); font-size: 9.5px; }
.erd__links li i { font-style: normal; color: #a1978c; font-size: 9.5px; margin-left: auto; }

/* ---------------------------------------------------------------- 용어 */
.gl__search { margin-bottom: 12px; max-width: 460px; }
.gl__search .inp { width: 100%; padding: 9px 12px; font-size: 12.5px; border-radius: 10px; }
.gl { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.gl__group h3 { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9b9187; margin-bottom: 7px; }
.gl__item { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; overflow: hidden; }
.gl__q { width: 100%; text-align: left; background: transparent; border: 0; padding: 10px 12px; display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.gl__q b { font-size: 12.5px; }
.gl__q span { font-size: 11.5px; color: var(--muted); }
.gl__q:hover { background: #fffdfa; }
.gl__a { display: none; padding: 0 12px 11px; }
.gl__item.is-open .gl__a { display: block; }
.gl__a p { font-size: 12px; color: var(--ink-2); line-height: 1.65; margin-bottom: 8px; }

/* ---------------------------------------------------------------- 오버레이 */
body.is-ovl { overflow: hidden; }
.ovl { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.ovl__scrim { position: absolute; inset: 0; background: rgba(28, 24, 21, .55); backdrop-filter: blur(2px); }
.ovl__panel {
  position: relative; width: min(1180px, 94vw); height: min(860px, 92vh);
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
  animation: ovlIn .18s ease;
}
@keyframes ovlIn { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.ovl__head { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fffdfa; }
.ovl__id { min-width: 0; }
.ovl__id b { font-size: 14px; margin-left: 6px; }
.ovl__id small { display: block; font-size: 10.5px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; margin-top: 2px; }
.ovl__tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ovl__x { border: 0; background: transparent; font-size: 16px; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; }
.ovl__x:hover { background: var(--paper-2); color: var(--ink); }
.ovl__body { flex: 1; min-height: 0; background: #f2ede4; display: flex; justify-content: center; }
.ovl__body[data-device="mobile"] { padding: 14px 0; }
.ovl__frame { width: 100%; height: 100%; }
.ovl__body[data-device="mobile"] .ovl__frame { width: 390px; height: 100%; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); background: #fff; }
.ovl__frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.ovl__foot { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); background: #fffdfa; }

/* ---------------------------------------------------------------- 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px);
  background: rgba(29, 26, 24, .94); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 99px; z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s; max-width: 90vw;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- 반응형 */
@media (max-width: 1380px) {
  .work { grid-template-columns: 216px minmax(0, 1fr) 320px; }
  body.is-panel-off .work { grid-template-columns: 216px minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .work { grid-template-columns: 196px minmax(0, 1fr) 300px; }
  body.is-panel-off .work { grid-template-columns: 196px minmax(0, 1fr); }
  .tabs a em { display: none; }
  .route__do, .route i { display: none; }
}
@media (max-width: 1024px) {
  body { height: auto; overflow: auto; }
  .view { height: auto; }
  .work { display: flex; flex-direction: column; height: auto; }
  body.is-panel-off .work { display: flex; }
  .rail {
    flex-direction: row; gap: 6px; overflow-x: auto; padding: 8px 12px;
    border-right: 0; border-bottom: 1px solid var(--line); background: #fffdfa;
  }
  .rail__group { flex-direction: row; align-items: center; gap: 4px; }
  .rail__title, .rail__foot { display: none; }
  .rail__item { width: auto; white-space: nowrap; padding: 6px 10px; }
  .rail__code { width: auto; }
  .stage { padding: 12px; min-height: 60vh; overflow: visible; }
  .browser { min-height: 62vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .panel__body { max-height: none; }
  .panel__body.is-cm { height: 60vh; }
}
@media (max-width: 760px) {
  :root { --h: auto; }
  .topbar { height: auto; }
  .topbar__in { flex-wrap: wrap; padding: 8px 12px; gap: 8px 10px; }
  .brand { order: 0; }
  .topbar__right { order: 1; gap: 4px; }
  .tbtn { height: 30px; padding: 0 9px; font-size: 11.5px; }
  .seg--dev { display: none; }
  .tbtn span { display: none; }
  .tbtn--cm span { display: inline; }
  .tabs { order: 2; width: 100%; gap: 0; padding-bottom: 2px; }
  .tabs a { padding: 6px 10px; font-size: 12px; }
  .stage__head { gap: 8px; }
  .stage__tools { margin-left: 0; width: 100%; }
  .browser { min-height: 66vh; }
  .browser[data-device="mobile"] .frame { width: 100%; border: 0; box-shadow: none; }
  .ovl__panel { width: 100vw; height: 100vh; border-radius: 0; }
  .ovl__head { flex-wrap: wrap; }
  .ovl__tools { width: 100%; margin-left: 0; }
  .flow__path { padding: 12px; }
  /* 좁은 화면에서는 가로 스크롤 대신 위에서 아래로 읽는 파이프라인으로 */
  .flow__row { flex-direction: column; align-items: stretch; overflow: visible; gap: 4px; padding-bottom: 0; }
  .node { width: 100%; min-width: 0; }
  .node__label { font-size: 13px; }
  .arrow { transform: rotate(90deg); align-self: flex-start; margin: 1px 0 1px 24px; height: 14px; }
  .erd__wrap { padding: 4px; }
  .erd__hint { display: block; margin: -4px 0 8px; font-size: 11.5px; color: var(--muted); }
  .toast { bottom: 16px; font-size: 12px; }
}
