/* =================================================================
   초코랩 미니디자인 — 파스텔, 깔끔하게. 공용 ui.css 위에 덮어쓴다.
   ================================================================= */
:root {
  --bg: #F6F7FB;
  --paper: #FFFFFF;
  --line: #E8E6F0;
  --ink: #2B2730;
  --ink-2: #5D5868;
  --ink-3: #8F8A9C;
  --pink: #FFD9E6;   --pink-ink: #B33C68;
  --mint: #D6F3E8;   --mint-ink: #1F7A5F;
  --lav: #E7E1FF;    --lav-ink: #5B47B8;
  --peach: #FFE6D3;  --peach-ink: #A65A1E;
  --sky: #DDEBFF;    --sky-ink: #2F61B5;
  --site: var(--pink); --site-ink: var(--pink-ink);
  --btn: #FFBDD3; --btn-ink: #4A1830; --btn-hover: #FFA9C6;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(43, 39, 48, .05), 0 10px 30px -14px rgba(91, 71, 184, .22);
  --f-title: 'Pretendard Variable', Pretendard, 'Noto Sans KR', sans-serif;
  --f-body: 'Pretendard Variable', Pretendard, 'Noto Sans KR', system-ui, sans-serif;
}
body {
  background: var(--bg);
  background-image:
    radial-gradient(520px 380px at 8% -4%, rgba(255, 217, 230, .75), transparent 70%),
    radial-gradient(480px 360px at 96% 8%, rgba(214, 243, 232, .8), transparent 70%),
    radial-gradient(620px 420px at 70% 105%, rgba(231, 225, 255, .7), transparent 70%);
  background-attachment: fixed;
  background-size: auto;
}
.top { background: rgba(246, 247, 251, .82); border-bottom: 1px solid var(--line); }
.brand img { border: 0; border-radius: 12px; background: transparent; }
.brand b { font-family: var(--f-title); font-weight: 800; letter-spacing: -.02em; }
h1, h2, h3 { font-family: var(--f-title); letter-spacing: -.02em; }
.pill-site { background: var(--btn); color: var(--btn-ink); }
.pill-site:hover { background: var(--btn-hover); }
.pill-dark { background: var(--ink); }
.pill.big { padding: 15px 30px; font-size: 17px; }
.pill.danger, .danger { color: #B3261E; }
.chip { border-color: var(--line); }
.chip[aria-pressed="true"] { background: var(--lav); border-color: #CFC4FF; color: var(--lav-ink); }
.card { border: 1px solid var(--line); box-shadow: var(--shadow); }
.input, .field input, .field select, .field textarea, select, textarea {
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
}
textarea { width: 100%; padding: 11px 14px; font-size: 15px; resize: vertical; }
select { padding: 9px 12px; font-size: 14px; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: #B9AEF5; box-shadow: 0 0 0 3px var(--lav); }
.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 14px 0 6px; }
.lbl.good { color: var(--mint-ink); } .lbl.bad { color: var(--pink-ink); }
.req { font-size: 11px; color: var(--pink-ink); background: var(--pink); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 6px 0; }
.sub { color: var(--ink-2); margin: 4px 0 0; }
.empty, .loading { color: var(--ink-3); padding: 24px 0; }
.note { background: var(--sky); color: var(--sky-ink); }
.linkish { background: none; border: 0; color: var(--ink-3); text-decoration: underline; cursor: pointer; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn-row.big .pill { flex: 1; padding: 14px 10px; font-size: 15px; }
.btn-col { display: grid; gap: 8px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 10px 0; cursor: pointer; }
.seg { display: inline-flex; flex-wrap: wrap; background: #F1F0F6; border-radius: 14px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(43, 39, 48, .12); }
.tag { background: var(--lav); color: var(--lav-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #F1EFF6 25%, transparent 25%), linear-gradient(-45deg, #F1EFF6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #F1EFF6 75%), linear-gradient(-45deg, transparent 75%, #F1EFF6 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.usage { font-size: 12px; color: var(--ink-3); background: #fff; border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

/* ---------- 탭 ---------- */
.tabs-top { display: flex; gap: 2px; margin-left: 10px; }
.tabs-top a { display: flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 12px; text-decoration: none; font-size: 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tabs-top a:hover { background: #fff; color: var(--ink); }
.tabs-top a[aria-current="page"] { background: var(--pink); color: var(--pink-ink); }
.tabs-top .ti { font-size: 13px; }

.page { padding-top: 26px; padding-bottom: 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 800; }
h2.sec { font-size: 18px; margin: 30px 0 12px; }

/* ---------- 들어오기 ---------- */
#gate { padding: 60px 24px; }
.gate-card { max-width: 520px; margin: 0 auto; padding: 36px 30px; text-align: center; }
.gate-card h1 { margin: 10px 0 8px; font-size: 26px; }
.gate-card .actions { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.gate-pic { display: flex; justify-content: center; gap: 8px; }
.gate-pic span { width: 44px; height: 56px; border-radius: 12px; background: var(--pink); transform: rotate(-8deg); }
.gate-pic span:nth-child(2) { background: var(--mint); transform: translateY(-8px); }
.gate-pic span:nth-child(3) { background: var(--lav); transform: rotate(8deg); }

/* ---------- 그림 넣기 ---------- */
.drop { display: grid; place-items: center; gap: 4px; text-align: center; padding: 26px 16px; border: 2px dashed #D9D4EA; border-radius: 18px; background: rgba(255, 255, 255, .7); color: var(--ink-2); cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop:focus, .drop.over { background: #fff; border-color: #B9AEF5; outline: none; }
.drop b { font-size: 15px; } .drop small { color: var(--ink-3); font-size: 12px; }
.drop.compact { padding: 12px 10px; border-radius: 14px; }
.drop.compact svg { width: 20px; height: 20px; }

/* ---------- 음성 ---------- */
.ta-mic { position: relative; }
.ta-mic textarea { padding-bottom: 40px; }
.mic { position: absolute; right: 8px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 5px 11px; background: var(--mint); color: var(--mint-ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.mic.on { background: var(--pink-ink); color: #fff; animation: pulse 1.2s infinite; }
.mic[disabled] { opacity: .45; cursor: not-allowed; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(179, 60, 104, .2); } }

/* ---------- 창·알림 ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 26px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--paper); box-shadow: 0 30px 80px -20px rgba(43, 39, 48, .45); }
dialog.modal.wide { width: min(980px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(43, 39, 48, .38); backdrop-filter: blur(3px); }
.modal-in { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 6px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-head .x { position: static; }
.modal-body { padding: 8px 22px 16px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 22px 20px; border-top: 1px solid var(--line); }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(520px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 16px; font-size: 14px; box-shadow: var(--shadow); transition: opacity .35s, transform .35s; }
.toast.err { background: #B3261E; } .toast.warn { background: #7A5300; }
.toast.out { opacity: 0; transform: translateY(8px); }
.busy { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: rgba(246, 247, 251, .7); backdrop-filter: blur(2px); }
.busy-in { background: #fff; padding: 22px 28px; border-radius: 22px; box-shadow: var(--shadow); text-align: center; max-width: 320px; }
.busy-in p { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.spin { display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--lav); border-top-color: var(--lav-ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pickcolor input[type=color] { width: 100%; height: 56px; border: 0; background: none; }
.pickcolor .sw { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pickcolor .sw button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }

/* ---------- 내 취향 ---------- */
.prof-pick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.guide { padding: 14px; position: relative; }
.g-num { position: absolute; top: 10px; left: 10px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.g-pic { border-radius: 14px; overflow: hidden; min-height: 150px; display: grid; background: #F4F3F8; }
.g-pic img { width: 100%; height: 190px; object-fit: contain; }
.g-pic .drop { margin: 0; min-height: 150px; }
.g-ai { font-size: 12.5px; color: var(--ink-2); background: #F8F7FC; border-radius: 12px; padding: 8px 10px; }
.ta-mic textarea[rows="1"] { min-height: 74px; }
.summary, .biz { padding: 20px 22px; margin-top: 22px; }
.summary h2, .biz h2 { margin: 0 0 8px; font-size: 18px; }
.biz h2 small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.sum-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sw-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.swatch { width: 34px; height: 34px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch.sm { width: 22px; height: 22px; border-radius: 7px; }
.rules ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }

/* ---------- 영감 ---------- */
.ins-add { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 14px 0 20px; }
.ins-grid { columns: 4 220px; column-gap: 14px; }
.ins-item { break-inside: avoid; margin: 0 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.ins-item img { width: 100%; }
.ins-item figcaption { padding: 10px 12px 12px; }
.ins-item small { color: var(--ink-3); }

/* ---------- 에셋 ---------- */
.extract { padding: 20px 22px; }
.extract h2 { margin: 0; font-size: 18px; }
.extract .drop { margin-top: 12px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.asset { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.asset.cand { border-color: #FFC9DA; background: #FFFBFC; }
.a-pic { border-radius: 12px; overflow: hidden; aspect-ratio: 1; display: grid; place-items: center; }
.a-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.a-pic.big { aspect-ratio: auto; height: 260px; }
.a-title { font-size: 14px; margin-top: 4px; }
.asset small { color: var(--ink-3); font-size: 12px; }
.a-name { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
.asset select { font-size: 13px; padding: 6px 8px; }
.q { position: absolute; top: 14px; left: 14px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--mint); color: var(--mint-ink); }
.q-small, .q-blurry, .q-overlapped { background: var(--peach); color: var(--peach-ink); }
.star { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); color: #D5D1E0; font-size: 16px; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.star[aria-pressed="true"] { color: #F2A93B; }
.btn-row.wrap { flex-wrap: wrap; }

/* ---------- 고르기 ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.pick-item { display: flex; flex-direction: column; gap: 4px; align-items: stretch; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 8px; cursor: pointer; text-align: left; font-size: 12.5px; }
.pick-item img { aspect-ratio: 1; object-fit: contain; width: 100%; background: #F6F5FA; border-radius: 10px; }
.pick-item small { color: var(--ink-3); }
.pick-item[aria-pressed="true"] { border-color: var(--lav-ink); background: var(--lav); }
.kinds-filter { margin-bottom: 4px; }

/* ---------- 엔진 ---------- */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: s; }
.steps li { flex: 1; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink-3); padding: 7px 4px; border-radius: 12px; background: #F4F3F8; counter-increment: s; }
.steps li::before { content: counter(s) '. '; }
.steps li.on { background: var(--pink); color: var(--pink-ink); }
.steps li.done { background: var(--mint); color: var(--mint-ink); }
.srcs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.src { background: #F8F7FC; border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 3px; min-height: 140px; }
.src b { font-size: 13px; } .src small { color: var(--ink-3); font-size: 11.5px; }
.src-btns { display: grid; gap: 6px; margin-top: auto; }
.src-pic { position: relative; margin-top: 4px; }
.src-pic img { width: 100%; height: 96px; object-fit: contain; background: #fff; border-radius: 10px; }
.src-pic .x { top: 4px; right: 4px; width: 26px; height: 26px; font-size: 14px; }
.eng-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.restate .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.restate .col { background: #F8F7FC; border-radius: 16px; padding: 12px; }
.restate .col h3 { margin: 0; font-size: 15px; }
.restate .col small { color: var(--ink-3); font-size: 12px; }
.restate textarea { margin-top: 6px; font-size: 14px; }
.ask { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--peach); color: var(--peach-ink); }
.lead { margin-top: 0; }
.draft { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.draft-pic { border-radius: 18px; overflow: hidden; display: grid; place-items: center; min-height: 280px; border: 1px solid var(--line); }
.draft-pic img { max-width: 100%; max-height: 420px; }
.final { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: center; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare figure { margin: 0; }
.compare figcaption { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.compare .draft-pic { min-height: 220px; }

/* ---------- 새 디자인 ---------- */
.make { padding: 6px 22px 22px; }
.m-sec { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.m-sec h2 { font-size: 18px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.m-sec h2 i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--pink); color: var(--pink-ink); display: grid; place-items: center; font-size: 14px; }
.m-sec h2 small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.fmt-group { margin-top: 10px; }
.custom { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.custom .input { width: 110px; }
.make input[name=purpose] { margin-top: 8px; }
.ref-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ref-list, .asset-list { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mini { position: relative; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.mini.checker img { object-fit: contain; }
.mini button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(43, 39, 48, .7); color: #fff; cursor: pointer; line-height: 1; }
.ref-list .drop.compact { width: 120px; height: 74px; padding: 6px; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 16px; cursor: pointer; font-weight: 700; font-size: 14px; }
.switch small { color: var(--ink-3); font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: #DDDAE6; position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--lav-ink); }
.switch input:checked + span::after { left: 21px; }
.switch input:focus-visible + span { outline: 3px solid var(--lav); }
.m-go { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 22px; }
.m-go small { color: var(--ink-3); }

/* ---------- 내 디자인 ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.proj { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.p-pic { display: grid; place-items: center; width: 100%; height: 220px; border: 0; background: #F4F3F8; cursor: pointer; padding: 10px; }
.p-pic img { max-height: 200px; box-shadow: 0 6px 18px -8px rgba(43, 39, 48, .35); }
.p-pic span { color: var(--ink-3); font-size: 13px; }
.p-info { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.p-info small { color: var(--ink-3); }
.badge { align-self: flex-start; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--peach); color: var(--peach-ink); margin-top: 4px; }
.badge.done { background: var(--mint); color: var(--mint-ink); }
.proj .x { top: 8px; right: 8px; background: rgba(255, 255, 255, .9); }

/* ---------- 표·그래프 데이터 ---------- */
.grid-wrap { overflow: auto; max-height: 50vh; margin-top: 8px; }
table.grid { border-collapse: collapse; }
table.grid td { border: 1px solid var(--line); min-width: 80px; padding: 7px 9px; font-size: 14px; background: #fff; }
table.grid td.head { background: #F6F4FB; font-weight: 700; }
table.grid td:focus { outline: 2px solid var(--lav-ink); }
.row-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.sketch canvas { width: 100%; max-width: 520px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 16px; touch-action: none; display: block; margin: 0 auto; background: #fff; }
.sketch-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.export { display: grid; gap: 10px; }
.exp-opt { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; }
.exp-opt small { grid-column: 1; color: var(--ink-3); }
.exp-opt .pill { grid-row: 1 / span 3; grid-column: 2; }
.exp-opt .check { grid-column: 1; margin: 4px 0 0; }

/* =================================================================
   편집 화면
   ================================================================= */
body.editing { overflow: hidden; }
body.editing .top, body.editing #main { display: none; }
#editor { position: fixed; inset: 0; z-index: 60; background: #EEEDF4; display: flex; flex-direction: column; }
.ed-top { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ed-top .spacer { flex: 1; }
.ed-title { border: 1px solid transparent; border-radius: 10px; padding: 6px 10px; font-size: 15px; font-weight: 700; min-width: 120px; width: 260px; }
.ed-title:hover, .ed-title:focus { border-color: var(--line); outline: none; }
.ed-save { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; flex: none; }
.icon-btn:hover { background: var(--lav); }
.ed-top .pill[aria-pressed="true"] { background: var(--lav); color: var(--lav-ink); border-color: #CFC4FF; }
.ed-body { flex: 1; display: grid; grid-template-columns: 84px 1fr 320px; min-height: 0; }
.ed-rail { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; }
.ed-rail button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; border-radius: 14px; padding: 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.ed-rail button span { width: 36px; height: 36px; border-radius: 12px; background: #F4F3F8; display: grid; place-items: center; font-size: 17px; }
.ed-rail button:hover span { background: var(--pink); color: var(--pink-ink); }
.ed-stage-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden;
  background-image: radial-gradient(rgba(91, 71, 184, .12) 1px, transparent 1px); background-size: 18px 18px; }
.ed-stage { position: absolute; inset: 0; }
.ed-stage.cmyk { filter: saturate(.8) contrast(.95) brightness(.985); }
.ed-reason { position: absolute; left: 14px; right: 14px; bottom: 14px; max-width: 560px; margin: 0 auto; background: rgba(255, 255, 255, .95); border: 1px solid var(--line); border-radius: 16px; padding: 10px 40px 10px 14px; font-size: 13.5px; color: var(--ink-2); box-shadow: var(--shadow); }
.ed-reason b { color: var(--lav-ink); margin-right: 4px; }
.ed-reason .x { top: 6px; right: 6px; width: 28px; height: 28px; }
.ed-panel { background: #fff; border-left: 1px solid var(--line); padding: 12px 16px 24px; overflow: auto; }
.pan-head { display: flex; justify-content: space-between; align-items: center; }
.pan-head .x { position: static; }
.pan-doc small { display: block; color: var(--ink-3); }
.pan-sec { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pan-sec > small, [data-cols] small, [data-ai] small { display: block; font-size: 12px; color: var(--ink-3); margin: 8px 0 4px; }
.legend { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.legend i { display: inline-block; width: 18px; border-top: 2px dashed; margin-right: 6px; vertical-align: middle; }
.l-trim { color: #E0526E; } .l-safe { color: #4F8DE0; }
.color-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.color-row input[type=color] { width: 40px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 2px; }
.color-row .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.range { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; margin: 4px 0; }
.range small { color: var(--ink-3); font-size: 12px; }
.range input { width: 100%; accent-color: var(--lav-ink); }
.range > input:first-child { grid-column: 1 / -1; }
.ed-panel .seg { margin-bottom: 2px; }
.ed-panel .note { margin: 8px 0; }

/* ---------- 휴대폰 ---------- */
@media (max-width: 1100px) {
  .tabs-top a { padding: 8px 9px; }
  .tabs-top .ti { display: none; }
}
@media (max-width: 820px) {
  .tabs-top { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; justify-content: space-around; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
  .tabs-top a { flex-direction: column; gap: 0; font-size: 11px; padding: 6px 4px; flex: 1; }
  .tabs-top .ti { display: block; font-size: 17px; }
  .usage { display: none; }
  .page { padding-bottom: 110px; }
  .page-head h1 { font-size: 24px; }
  .row2, .restate .cols, .draft, .final { grid-template-columns: 1fr; }
  .srcs { grid-template-columns: 1fr 1fr; }
  .ed-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .ed-rail { order: 2; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .ed-rail button { padding: 4px; font-size: 10.5px; }
  .ed-rail button span { width: 30px; height: 30px; font-size: 15px; }
  .ed-stage-wrap { order: 1; }
  .ed-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 58vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px -12px rgba(43, 39, 48, .3); transform: translateY(105%); transition: transform .25s; }
  .ed-panel.open { transform: translateY(0); }
  /* 고정 메뉴가 화면 기준으로 붙도록 (흐림 효과는 기준 상자를 바꾼다) */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(246, 247, 251, .97); }
  .ed-top { gap: 5px; padding: 6px 8px; }
  .ed-top > * { order: 5; }
  .ed-top [data-act=back] { order: 0; }
  .ed-title { order: 1; width: 96px; min-width: 70px; padding: 6px; font-size: 14px; }
  .ed-top [data-act=export] { order: 2; }
  .ed-top [data-act=done] { order: 3; }
  .ed-top .spacer, .ed-save { display: none; }
  .ed-top .pill { padding: 6px 10px; font-size: 12px; }
  .ed-top [data-act=guides], .ed-top [data-act=zoomout], .ed-top [data-act=zoomin], .ed-top [data-act=fit] { display: none; }
}
