/* ===== 딸깍해줘 — 깔끔한 흰색 + 파란 포인트 ===== */

/* ---------- 색상·모양 값 (여기만 바꾸면 전체가 바뀝니다) ---------- */
:root {
  --primary: #1f2328;
  --primary-hover: #000000;
  --primary-soft: #f1f0ec;
  --accent: #ffd43b;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --line: #e4e3de;
  --line-strong: #cfcdc6;
  --text: #1f2328;
  --muted: #6e6d68;
  --danger: #e5383b;
  --ok: #12a150;
  --warn-bg: #fff8e6;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);

  /* 예전 이름(도구 화면에서 씀)을 새 색으로 이어 줌 */
  --face: #f3f2ee;
  --hilight: #ffffff;
  --light: #efeee9;
  --shadow: #e8e7e1;
  --dark: #191f28;
  --field: #ffffff;
  --select: var(--primary);
  --select-text: #ffffff;
  --tip: #f6f5f0;
  --bevel-out: 0 0 0 1px var(--line);
  --bevel-in: inset 0 0 0 1px var(--line);
  --bevel-pressed: inset 0 0 0 1.5px var(--primary);
  --bevel-thin-in: inset 0 0 0 1px var(--line);

  --font-body: 'Pretendard', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', 'Noto Sans KR', sans-serif;
  --font-pixel: var(--font-body);
  --font-pixel-big: var(--font-body);

  --topbar-h: 56px;
  --sidebar-w: 236px;
  --btn-h: 42px;
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font-body); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img, svg, canvas { display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.px-icon { display: inline-grid; place-items: center; flex: none; }
.px-icon svg { width: 100%; height: 100%; }

/* ---------- 틀 ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar {
  flex: none; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.03em; }
.brand-tag { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.safe-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: #e9f8ef; color: #0f7a3d; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--light); }
.menu-btn { display: none; margin-left: -6px; }

.body { flex: 1; min-height: 0; display: flex; position: relative; }
.sidebar {
  flex: none; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto; padding: 12px 10px;
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 12px; font-weight: 700; color: var(--muted); padding: 16px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--text); font-size: 14.5px; font-weight: 500; text-decoration: none !important;
}
.nav-link .px-icon { color: var(--muted); }
.nav-link:hover { background: var(--light); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-link.active .px-icon { color: var(--primary); }
.nav-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.scrim { position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(16, 24, 40, .35); z-index: 19; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; outline: none; }
.tabs {
  flex: none; display: flex; gap: 4px; padding: 8px 12px 0; background: var(--bg); overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.tab {
  display: flex; align-items: center; gap: 8px; max-width: 240px; padding: 8px 8px 8px 12px; border-radius: 10px 10px 0 0;
  color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; user-select: none;
  border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px;
}
.tab:hover { background: var(--light); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--line); font-weight: 700; }
.tab-label { overflow: hidden; text-overflow: ellipsis; }
.tab-close { width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); padding: 0; }
.tab-close svg { width: 14px; height: 14px; }
.tab-close:hover { background: var(--line); color: var(--text); }

.views { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; }
.view > .view-head, .view > .window-body { width: 100%; max-width: 1240px; margin: 0 auto; }
.view-head { display: flex; align-items: center; gap: 14px; padding: 24px 28px 4px; }
.view-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.view-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; }
.view-desc { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.window-body { padding: 16px 28px 40px; }
.ic-bg-image { background: #eef1ff; color: #3d5afe; }
.ic-bg-doc { background: #e8f7ef; color: #12a150; }
.ic-bg-etc { background: #fff3e6; color: #f08c00; }

/* 문서 편집처럼 화면 전체를 쓰는 경우 */
.view.full { overflow: hidden; }
.view.full > .view-head { display: none; }
.view.full > .window-body { max-width: none; padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view.full > .window-body > * { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view.full > .window-body > [hidden] { display: none; }

/* ---------- 첫 화면 ---------- */
.win-welcome > .window-body { padding-top: 8px; }
.hero { padding: 36px 4px 12px; }
.hero h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.25; letter-spacing: -0.04em; font-weight: 800; }
.hero .accent { color: var(--primary); }
.hero p { margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-group h2 { margin: 28px 0 12px; font-size: 16px; font-weight: 800; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tool-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); color: var(--text); text-decoration: none !important; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.tool-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: transparent; }
.tool-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tool-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-text b { font-size: 15.5px; }
.tool-text span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.foot-note { margin-top: 28px; }

/* ---------- 글 ---------- */
.lead { margin: 0 0 16px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2.step { display: flex; align-items: center; gap: 10px; margin: 24px 0 10px; font-size: 15px; font-weight: 700; }
h2.step:first-child { margin-top: 0; }
h2.step .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 14px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--btn-h); padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 14.5px; font-weight: 600; line-height: 1.3;
  text-decoration: none !important; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn .px-icon { width: 18px !important; height: 18px !important; }
.btn:hover:not(:disabled) { background: var(--light); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; min-height: 46px; padding: 10px 22px; font-size: 15.5px; font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 13.5px; }
.btn.danger { color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.toggle-group { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 묶음 상자 ---------- */
fieldset.group {
  margin: 0 0 14px; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0;
}
fieldset.group legend { padding: 0 6px; font-size: 14px; font-weight: 700; }

/* ---------- 입력칸 ---------- */
.field, .small-field {
  min-height: var(--btn-h); padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-size: 15px; width: 100%; box-shadow: none; transition: border-color .12s, box-shadow .12s;
}
.small-field { min-height: 36px; padding: 5px 10px; font-size: 14px; }
.field:focus, .small-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(61, 90, 254, .15); }
label.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 파일 넣는 곳 ---------- */
.dropzone {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px;
  min-height: 140px; padding: 24px; text-align: center; border-radius: var(--radius);
  background: var(--surface); border: 2px dashed var(--line-strong); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--primary); }
.dropzone > .px-icon { width: 40px !important; height: 40px !important; color: var(--primary); }
.dropzone .hint { font-size: 14px; color: var(--muted); margin: 0; }
.dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.dragover .hint { color: var(--primary); font-weight: 700; }
.dropzone input[type="file"] { display: none; }
.dropzone.slim { min-height: 0; padding: 10px 14px; justify-content: flex-start; gap: 12px; border-width: 1.5px; }
.dropzone.slim > .px-icon { width: 22px !important; height: 22px !important; }
.dropzone.slim .btn.primary { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.dropzone.slim .hint { font-size: 13px; }

/* ---------- 목록 ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; list-style: none; margin: 0; }
.list:empty { display: none; }
.list-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); border-radius: 8px; }
.list-item:last-child { border-bottom: 0; }
.list-item .thumb { width: 64px; height: 64px; background: var(--light); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.list-item .thumb img { max-width: 64px; max-height: 64px; object-fit: contain; }
.list-item .thumb .px-icon { width: 32px; height: 32px; color: var(--muted); }
.list-item .name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.4; }
.list-item .info { font-size: 13px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.list-item .info.good { color: var(--ok); }
.list-item .info.bad { color: var(--danger); }
.list-item .warn-line { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; font-size: 13px; color: var(--danger); line-height: 1.45; }
.list-item .warn-line .px-icon { width: 16px !important; height: 16px !important; margin-top: 2px; }
.list-item .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.list-head .count { font-size: 14px; font-weight: 600; }

/* ---------- 진행 막대 ---------- */
.progress { margin: 14px 0 6px; }
.progress-text { font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.progress-track { height: 8px; border-radius: 999px; background: var(--light); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .2s; }

/* ---------- 안내 상자 ---------- */
.tip {
  display: flex; gap: 10px; align-items: flex-start; background: var(--tip); padding: 12px 14px; margin: 12px 0;
  border-radius: var(--radius-sm); font-size: 14px; line-height: 1.55; color: #33415c;
}
.tip > .px-icon { width: 18px !important; height: 18px !important; margin-top: 2px; color: var(--primary); }

/* ---------- 알림창 ---------- */
.dialog-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(16, 24, 40, .4); }
.window.dialog { width: min(440px, 100%); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.dialog .titlebar { display: flex; align-items: center; gap: 8px; padding: 16px 16px 0 20px; }
.dialog .titlebar-text { flex: 1; font-weight: 800; font-size: 16px; }
.dialog .title-btns { display: flex; }
.title-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); padding: 0; }
.title-btn svg { width: 18px; height: 18px; }
.title-btn:hover { background: var(--light); }
.dialog .window-body { display: flex; gap: 14px; align-items: flex-start; padding: 12px 20px 8px; max-width: none; }
.dialog .window-body > .px-icon { width: 28px !important; height: 28px !important; color: var(--primary); }
.dialog .window-body > .ic-warn { color: #f08c00; }
.dialog .msg { white-space: pre-line; font-size: 15px; }
.dialog .btn-row { justify-content: flex-end; padding: 8px 20px 20px; }

/* ---------- 도구 막대·작은 판 ---------- */
.editor { display: flex; flex-direction: column; gap: 10px; }
.editor-stage {
  position: relative; display: grid; place-items: center; min-height: 260px; padding: 10px; border-radius: var(--radius);
  background-color: #eceff3; background-image: repeating-conic-gradient(#e2e6eb 0 25%, #eceff3 0 50%); background-size: 16px 16px;
  overflow: hidden; touch-action: none;
}
.editor-stage .canvas-container { touch-action: none; }
.editor-help { font-size: 13.5px; padding: 8px 12px; background: var(--tip); border-radius: var(--radius-sm); color: #33415c; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.toolbar .btn { padding: 6px 12px; min-height: 38px; }
.subpanel { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.subpanel .label { font-size: 14px; font-weight: 600; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 36px; height: 36px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); }
.swatch[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.slider-row { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; }
.slider-row .label { min-width: 110px; }
.slider-row output { min-width: 48px; font-weight: 700; text-align: right; }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); box-shadow: var(--shadow-sm); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

/* ---------- 라디오·체크·선택 상자 (예전 이름 w98-* 유지) ---------- */
.w98-radios { display: flex; flex-direction: column; gap: 4px; }
.w98-radio { display: flex; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; font-size: 14px; }
.w98-radio input[type="radio"], .w98-radio input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.w98-select {
  height: 38px; max-width: 100%; padding: 4px 34px 4px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background-color: var(--surface);
  font-size: 14px; -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-size: 16px; background-position: right 10px center; background-repeat: no-repeat;
}

/* ---------- 탭(설정 화면) ---------- */
.w98-tabs { display: flex; gap: 4px; padding: 4px; background: var(--light); border-radius: 12px; margin-bottom: 10px; }
.w98-tab { flex: 1; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.w98-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.w98-tabbody { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }

/* ---------- 이용 안내 ---------- */
ol.terms { margin: 0; padding-left: 22px; line-height: 1.75; }
ol.terms li { margin: 4px 0; }

/* =========================================================
   도구별 화면 (예전 규칙을 새 색 값으로)
   ========================================================= */
/* ---------- 문서 보기·편집 ---------- */
/* 문서를 열면 창 전체를 편집 화면으로 (여백·상태줄 없이) */
.win.full > .window-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.win.full > .window-body > * { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.win.full > .window-body > [hidden] { display: none; }
.win.full > .statusbar { display: none; }
.doc-area { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.doc-bar { display: flex; align-items: center; gap: 4px; padding: 2px 4px; background: var(--face); border-bottom: 1px solid var(--shadow); flex: none; min-height: 34px; }
.doc-bar .btn { min-height: 28px; padding: 2px 10px; font-size: 14px; }
.doc-bar .btn .px-icon { width: 18px; height: 18px; }
.doc-modes { flex: none; }
.doc-modes .btn { min-height: 28px; padding: 2px 10px; font-size: 14px; }
.doc-name { font: 14px/1.2 var(--font-pixel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30%; padding: 0 4px; }
.doc-help { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-stage { flex: 1; min-height: 0; overflow: auto; background: var(--shadow); padding: 8px; position: relative; }
.doc-stage.office { padding: 0; overflow: hidden; background: #fff; }
.doc-stage.hwp-rich { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.office-host { position: absolute; inset: 0; }
.doc-busy { color: #fff; font: 16px var(--font-pixel); padding: 24px; text-align: center; }
.doc-stage.office .doc-busy { color: var(--text); }
.doc-stage.hwp-rich .rich-editor { flex: 1; min-height: 0; gap: 0; }
.doc-stage.hwp-rich .ribbon { gap: 0; padding: 2px; box-shadow: none; border-bottom: 1px solid var(--shadow); flex: none; }
.doc-stage.hwp-rich .rb-label { display: none; }
.doc-stage.hwp-rich .rb-group { padding: 1px 4px; }
.doc-stage.hwp-rich .rich-desk { flex: 1; height: auto; min-height: 0; padding: 10px; box-shadow: none; }
/* 워드 편집기 기본 글꼴 */
.docx-host { font-family: 'Malgun Gothic', '맑은 고딕', sans-serif; }
.doc-page { background: #fff; margin: 0 auto 12px; max-width: 820px; box-shadow: 2px 2px 0 #404040; }
.doc-page img { width: 100%; height: auto; }
.docx-view .docx-wrapper { background: transparent !important; padding: 0 !important; }
.docx-view .docx-wrapper > section.docx { margin: 0 auto 12px !important; box-shadow: 2px 2px 0 #404040 !important; }
.doc-paper { background: #fff; max-width: 820px; margin: 0 auto; padding: 32px 36px; box-shadow: 2px 2px 0 #404040; color: #000; }
.doc-edit textarea {
  display: block; width: 100%; resize: none; overflow: hidden; border: 1px dashed transparent; background: transparent;
  font: 16px/1.6 var(--font-body); padding: 4px 6px; margin: 0 0 2px; min-height: 36px;
}
.doc-edit textarea:hover { border-color: #b0b0b0; }
.doc-edit textarea:focus { outline: 2px solid var(--select); outline-offset: 0; background: #f5f9ff; }
.doc-edit textarea.changed { background: #fff6b0; }
.doc-edit textarea.h1 { font-size: 24px; font-weight: 700; }
.doc-edit textarea.h2 { font-size: 20px; font-weight: 700; }
.doc-edit textarea.h3 { font-size: 18px; font-weight: 700; }
.doc-ro { color: #777; background: #eee; padding: 4px 6px; margin: 0 0 2px; font-size: 15px; white-space: pre-wrap; }
.doc-table-wrap { overflow-x: auto; margin: 8px 0 12px; }
.doc-table { border-collapse: collapse; width: 100%; }
.doc-table td { border: 1px solid #555; padding: 0; vertical-align: top; min-width: 60px; }
.doc-table td textarea { margin: 0; font-size: 15px; min-height: 34px; }

.sheet-wrap { overflow: auto; background: #fff; max-height: 70vh; }
.sheet { border-collapse: collapse; table-layout: fixed; background: #fff; font: 14px/1.35 var(--font-body); }
.sheet th { position: sticky; top: 0; z-index: 2; background: var(--face); box-shadow: var(--bevel-thin-in); font: 14px/1 var(--font-pixel); font-weight: normal; height: 26px; padding: 0 4px; }
.sheet tbody th { position: sticky; left: 0; z-index: 1; text-align: center; }
.sheet th.corner { left: 0; z-index: 3; }
.sheet td { border: 1px solid #d0d0d0; padding: 3px 5px; height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #000; cursor: cell; }
.sheet td:focus { outline: 2px solid var(--select); outline-offset: -2px; }
.sheet td.editing { outline: 2px solid #e02020; background: #fff !important; overflow: visible; white-space: pre-wrap; cursor: text; }
.sheet td.changed { box-shadow: inset 0 0 0 2px #ffd800; }
.sheet-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.sheet-tab { min-height: 40px; padding: 4px 14px; border: 0; background: var(--face); box-shadow: var(--bevel-out); font: 15px/1 var(--font-pixel); cursor: pointer; }
.sheet-tab.active { background: var(--field); box-shadow: var(--bevel-thin-in); font-weight: 700; }

/* ---------- 리본(서식 도구 막대) ---------- */
.ribbon { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--face); box-shadow: var(--bevel-out); }
.rb-group { display: flex; flex-direction: column; padding: 3px 6px 2px; box-shadow: inset -2px 0 var(--hilight), inset -4px 0 var(--shadow); }
.rb-group:last-child { box-shadow: none; }
.rb-body { display: flex; flex-direction: column; gap: 3px; flex: 1; justify-content: center; }
.rb-row { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.rb-label { text-align: center; font: 12px/1 var(--font-pixel); color: var(--muted); padding-top: 4px; }
.rb-btn {
  position: relative; min-width: 32px; height: 32px; padding: 0 6px; border: 0; background: var(--face);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  font: 15px/1 var(--font-body); color: var(--text); box-shadow: none;
}
.rb-btn:hover { box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilight); }
.rb-btn:active, .rb-btn[aria-pressed="true"] { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hilight); background: var(--light); }
.rb-btn:disabled { opacity: .4; cursor: default; }
.rb-btn.wide { padding: 0 8px; font: 13px/1 var(--font-pixel); }
.rb-btn.fmt { font-weight: 400; font-size: 17px; }
.rb-btn.fmt.b { font-weight: 800; }
.rb-btn.fmt.i { font-style: italic; font-family: serif; }
.rb-btn.fmt.u { text-decoration: underline; }
.rb-btn.fmt.s { text-decoration: line-through; }
.rb-btn.drop { min-width: 18px; padding: 0 2px; font-size: 11px; }
.rb-btn svg { flex: none; }
.rb-split { display: inline-flex; }
.rb-split .rb-btn:first-child { flex-direction: column; gap: 1px; padding: 2px 5px; }
.rb-colorbar { display: block; width: 18px; height: 4px; border: 1px solid #000; }
.rb-select { height: 30px; padding: 2px 6px; border: 0; background: var(--field); box-shadow: var(--bevel-thin-in); font: 14px/1 var(--font-body); }
.rb-combo { display: inline-flex; }
.rb-pop { position: fixed; z-index: 120; padding: 6px; margin: 0; max-width: none; width: auto; }
.rb-palette { display: grid; grid-template-columns: repeat(10, 20px); gap: 3px; }
.rb-swatch { width: 20px; height: 20px; border: 1px solid #000; padding: 0; cursor: pointer; }
.rb-swatch:hover { outline: 2px solid var(--select); }
.rb-menu { display: flex; flex-direction: column; min-width: 190px; }
.rb-menu .rb-btn { justify-content: flex-start; height: 36px; }
.rb-menu .rb-btn:hover { background: var(--select); color: var(--select-text); }

/* 엑셀 */
.sheet-editor { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.fx-bar { display: flex; gap: 4px; align-items: center; }
.name-box { width: 90px; text-align: center; font: 14px/1 var(--font-pixel); }
.fx-label { font: italic 700 15px/1 serif; padding: 0 4px; color: var(--muted); }
.fx-input { min-height: 32px; padding: 4px 8px; font-size: 15px; flex: 1; }
.doc-stage.sheet-stage { padding: 0; background: var(--face); box-shadow: none; }
.sheet-editor .sheet-wrap { max-height: none; height: clamp(260px, calc(100vh - 420px), 2000px); }
.sheet td.sel { background-image: linear-gradient(rgba(0, 0, 128, .14), rgba(0, 0, 128, .14)); }
.sheet td.act { outline: 2px solid var(--select); outline-offset: -2px; }
.sheet th.hl { background: #a8a8d8; }
.sheet thead th { position: sticky; top: 0; }
.sheet thead th { cursor: s-resize; }
.sheet tbody th { cursor: e-resize; }
.sheet th { position: relative; }
.col-resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 4; }
.sheet-tabs { align-items: center; }

/* 워드·한글 서식 편집 */
.rich-editor { display: flex; flex-direction: column; gap: 6px; }
.rich-desk { background: var(--shadow); box-shadow: var(--bevel-in); padding: 14px; overflow: auto; height: clamp(300px, calc(100vh - 380px), 3000px); }
.rich-page {
  background: #fff; color: #000; max-width: 794px; min-height: 1000px; margin: 0 auto; padding: 72px 76px;
  box-shadow: 2px 2px 0 #404040; outline: none; line-height: 1.6; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere;
}
.rich-page p.rp { margin: 0 0 4px; min-height: 1.2em; }
.rich-page p.rp.h1 { font-size: 1.6em; font-weight: 700; }
.rich-page p.rp.h2 { font-size: 1.35em; font-weight: 700; }
.rich-page p.rp.h3 { font-size: 1.15em; font-weight: 700; }
.rich-raw { color: #777; background: #f0f0f0; border: 1px dashed #bbb; padding: 2px 6px; margin: 2px 0 6px; font-size: 13px; user-select: none; }
.rich-tbl { margin: 6px 0 10px; overflow-x: auto; }
.rich-tbl table { border-collapse: collapse; width: 100%; }
.rich-tbl td { border: 1px solid #444; padding: 2px 5px; vertical-align: top; min-width: 40px; outline: none; }
.rich-tbl td:focus-within { box-shadow: inset 0 0 0 2px var(--select); }
.rich-tbl td p.rp { margin: 0; }
.doc-view-box { min-height: 200px; }

@media (max-width: 760px) {
  .ribbon { flex-wrap: nowrap; overflow-x: auto; }
  .rb-group { flex: none; }
  .rich-page { padding: 24px 16px; min-height: 600px; }
  .rich-desk { padding: 6px; height: calc(100vh - 330px); }
  .doc-name { max-width: 40%; }
  .doc-help { display: none; }
  .tt-logo { display: none; }
  .doc-slot .btn { padding: 2px 6px; }
  .doc-slot .btn > span:not(.px-icon) { display: none; }
  .doc-slot .btn:not(:has(.px-icon)) { display: none; }
  .sheet-editor .sheet-wrap { height: calc(100vh - 360px); }
}

/* QR·워터마크 */
.qr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 20px; align-items: start; }
.qr-side { position: sticky; top: 0; }
.qr-frame { background: var(--field); box-shadow: var(--bevel-in); padding: 12px; display: grid; place-items: center; }
.qr-preview { width: 100%; max-width: 320px; height: auto; image-rendering: pixelated; }
.wm-preview { max-width: 100%; height: auto; }
.qr-fields { display: flex; flex-direction: column; gap: 8px; }
.qr-field { display: flex; flex-direction: column; gap: 4px; }
.qr-field .label { font: 15px/1.3 var(--font-pixel); }
.color-input { width: 52px; height: 40px; padding: 2px; border: 0; background: var(--face); box-shadow: var(--bevel-out); cursor: pointer; }
@media (max-width: 900px) { .qr-layout { grid-template-columns: 1fr; } .qr-side { position: static; } }
@media (max-width: 760px) { .icon-col { grid-template-columns: repeat(3, 1fr); } }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.stamp-pick { height: 70px; padding: 6px; border: 0; background: var(--field); box-shadow: var(--bevel-out); cursor: pointer; display: grid; place-items: center; }
.stamp-pick[aria-pressed="true"] { box-shadow: var(--bevel-pressed); outline: 2px dotted var(--dark); outline-offset: -5px; }

/* 넣은 파일 목록 + 크게 보기 */
.fq-with-preview .fq-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 44%); gap: 10px; align-items: start; }
.fq-with-preview .fq-body > .list:empty + .big-preview { grid-column: 1 / -1; }
.fq-list { max-height: 420px; overflow-y: auto; }
.fq-list .list-item { cursor: pointer; }
.fq-list .list-item.picked { background: #dfe4ff; box-shadow: inset 3px 0 var(--select); }
.big-preview { background: var(--face); box-shadow: var(--bevel-in); padding: 6px; position: sticky; top: 0; }
.pv-stage {
  display: grid; place-items: center; min-height: 200px; max-height: 420px;
  background-color: #fff; background-image: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%); background-size: 16px 16px;
}
.pv-stage img { max-width: 100%; max-height: 410px; object-fit: contain; }
.pv-cap { font-size: 14px; color: var(--muted); padding: 6px 4px 2px; overflow-wrap: anywhere; }
.rz-preview .rz-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rz-preview figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rz-preview .rz-cv { min-width: 40px; min-height: 40px; display: grid; place-items: center; padding: 6px; background-color: #fff; background-image: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%); background-size: 16px 16px; box-shadow: var(--bevel-in); }
.rz-preview canvas { display: block; outline: 1px solid #000; }
.rz-preview figcaption { font: 15px/1.3 var(--font-pixel); }
.rz-arrow { font: 700 24px/1 var(--font-pixel-big); }
.rz-info { text-align: center; font-size: 15px; margin-top: 8px; color: var(--muted); }
@media (max-width: 900px) { .fq-with-preview .fq-body { grid-template-columns: 1fr; } .big-preview { position: static; } }

/* ---------- 이미지 간편 변환 (왼쪽 설정 + 오른쪽 미리보기) ---------- */
.cv-top { display: flex; flex-direction: column; gap: 6px; }
.cv-top .fq-list { max-height: 168px; }
.cv-top .list-item { padding: 4px 6px; grid-template-columns: 48px minmax(0, 1fr) auto; }
.cv-top .list-item .thumb { width: 48px; height: 48px; }
.cv-top .list-item .thumb img { max-width: 44px; max-height: 44px; }
.cv-top .list-head { margin: 4px 0 2px; }
.cv-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 10px; margin-top: 8px; align-items: stretch; }
.cv-side { display: flex; flex-direction: column; gap: 2px; }
.cv-group { margin: 0 0 6px; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.cv-group .w98-select { width: 100%; }
.cv-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.cv-row input[type="range"] { flex: 1; min-width: 100px; height: 30px; }
.cv-help { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.cv-field { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.cv-field .small-field { width: 100%; }
.cv-name { background: var(--light); box-shadow: var(--bevel-thin-in); padding: 6px 8px; font-size: 14px; overflow-wrap: anywhere; min-height: 32px; }
.cv-main { display: flex; min-width: 0; }
.cv-pv { flex: 1; display: flex; flex-direction: column; margin: 0; padding: 8px; min-width: 0; }
.cv-pvhead { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 15px; margin-bottom: 6px; }
.cv-dims { font: 15px/1.3 var(--font-pixel); }
.cv-est { color: var(--muted); font-size: 14px; }
.cv-stage {
  flex: 1; position: relative; display: grid; place-items: center; min-height: 360px; height: clamp(360px, calc(100vh - 300px), 1400px);
  background-color: #fff; background-image: repeating-conic-gradient(#e8e8e8 0 25%, #fff 0 50%); background-size: 16px 16px;
  box-shadow: var(--bevel-in); overflow: hidden;
}
.cv-canvas { max-width: calc(100% - 16px); max-height: calc(100% - 16px); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.cv-empty { text-align: center; color: var(--muted); padding: 20px; }
.cv-empty p { margin: 4px 0; }
.cv-bottom { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.cv-bottom .btn.primary { min-width: 160px; }
@media (max-width: 900px) {
  .cv-layout { grid-template-columns: 1fr; }
  .cv-main { order: -1; }
  .cv-stage { height: 300px; min-height: 240px; }
}

/* ---------- 이미지 간편 변환 v2 (왼쪽 미리보기 · 오른쪽 탭) ---------- */
.cv2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; align-items: start; }
.cv2-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cv2-pvbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px; background: var(--face); box-shadow: var(--bevel-out); }
.cv2-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.cv2-tools .sep { width: 4px; height: 28px; box-shadow: inset 2px 0 var(--shadow), inset -2px 0 var(--hilight); margin: 0 3px; }
.cv2-tool { width: 38px; height: 36px; border: 0; background: var(--face); display: grid; place-items: center; cursor: pointer; }
.cv2-tool:hover { box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilight); }
.cv2-tool:active { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hilight); }
.cv2-rotlabel { font: 14px/1.2 var(--font-pixel); color: var(--select); margin-left: 6px; }
.cv2-view { display: flex; }
.cv2-seg { min-height: 32px; padding: 4px 12px; border: 0; background: var(--face); box-shadow: var(--bevel-out); font: 14px/1 var(--font-pixel); cursor: pointer; }
.cv2-seg[aria-pressed="true"] { box-shadow: var(--bevel-pressed); background: var(--light); }
.cv2-stagewrap { position: relative; }
.cv2-stage {
  display: flex; align-items: center; justify-content: center; gap: 24px; height: clamp(300px, calc(100vh - 430px), 1400px);
  background: #3a3a3a; box-shadow: var(--bevel-in); overflow: hidden; padding: 12px;
}
.cv2-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cv2-canvas { display: block; background-color: #fff; background-image: repeating-conic-gradient(#e2e2e2 0 25%, #fff 0 50%); background-size: 14px 14px; box-shadow: 3px 3px 0 #000; }
.cv2-cap { font: 14px/1 var(--font-pixel); color: #fff; }
.cv2-stage .cv-empty { color: #ddd; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cv2-stage .cv-empty .muted { color: #aaa; }
.cv2-badge {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 4px 8px;
  background: var(--tip); border: 1px solid #000; font-size: 13px; line-height: 1.4;
}
.cv2-badge:empty { display: none; }
.cv2-detail { font-size: 14px; min-height: 22px; }
.cv2-detail .cv2-dname { font-weight: 700; }
.cv2-detail .warn-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--danger); margin-top: 4px; }

/* 필름 띠: 넣은 파일을 가로로 */
.cv2-strip .list-head { margin: 2px 0; }
.cv2-strip .fq-list { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; max-height: none; padding: 6px; }
.cv2-strip .fq-list .list-item {
  flex: none; width: 112px; display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  padding: 4px; border: 0; position: relative; background: var(--field);
}
.cv2-strip .list-item .thumb { width: 100%; height: 72px; }
.cv2-strip .list-item .thumb img { max-width: 100%; max-height: 68px; }
.cv2-strip .list-item .name { font-size: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv2-strip .list-item .info { display: none; }
.cv2-strip .list-item .warn-line { font-size: 0; position: absolute; left: 6px; top: 6px; margin: 0; }
.cv2-strip .list-item .warn-line .px-icon { width: 20px; height: 20px; }
.cv2-strip .list-item .actions { position: absolute; right: 2px; top: 2px; }
.cv2-strip .list-item .actions .btn { min-height: 22px; min-width: 22px; padding: 0 5px; font-size: 0; }
.cv2-strip .list-item .actions .btn::after { content: '×'; font-size: 15px; }
.cv2-strip .list-item .actions .btn:not(:last-child) { display: none; }
.cv2-strip .list-item.picked { background: var(--select); box-shadow: none; }
.cv2-strip .list-item.picked .name { color: var(--select-text); }

.cv2-right { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.cv2-page { display: flex; flex-direction: column; gap: 10px; }
.cv2-modes { display: flex; flex-direction: column; gap: 3px; }
.cv2-mode, .cv2-fmt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 6px 10px 6px 34px; position: relative;
  border: 0; background: var(--face); cursor: pointer; font-size: 14px;
}
.cv2-mode b, .cv2-fmt b { font: 15px/1.2 var(--font-pixel); }
.cv2-mode span, .cv2-fmt span { font-size: 12px; color: var(--muted); }
.cv2-mode::before, .cv2-fmt::before {
  content: ''; position: absolute; left: 9px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50% !important; background: var(--field);
  box-shadow: inset -1px -1px var(--hilight), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
}
.cv2-mode[aria-checked="true"], .cv2-fmt[aria-checked="true"] { background: var(--select); }
.cv2-mode[aria-checked="true"] b, .cv2-fmt[aria-checked="true"] b, .cv2-mode[aria-checked="true"] span, .cv2-fmt[aria-checked="true"] span { color: var(--select-text); }
.cv2-mode[aria-checked="true"]::before, .cv2-fmt[aria-checked="true"]::before { background: radial-gradient(circle, #000 0 3px, #fff 3.5px); }
.cv2-mode:hover:not([aria-checked="true"]), .cv2-fmt:hover:not([aria-checked="true"]) { background: var(--light); }
.cv2-fmts { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.cv2-inputs { display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--light); box-shadow: var(--bevel-thin-in); }
.cv2-chip { min-height: 30px; padding: 3px 9px; border: 0; background: var(--face); box-shadow: var(--bevel-out); font-size: 13px; cursor: pointer; }
.cv2-chip:active, .cv2-chip[aria-pressed="true"] { box-shadow: var(--bevel-pressed); background: var(--light); }
.cv2-q input[type="range"] { width: 100%; }
.cv2-q output { font: 700 15px/1 var(--font-pixel); }
.cv2-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.cv2-summary { font-size: 13px; line-height: 1.5; padding: 8px; background: var(--tip); border: 1px solid #000; }
.cv2-summary:empty { display: none; }
.cv2-right .btn.primary { width: calc(100% - 4px); }
.cv2-link { border: 0; background: none; color: var(--select); text-decoration: underline; cursor: pointer; font-size: 13px; align-self: center; }
@media (max-width: 980px) {
  .cv2 { grid-template-columns: 1fr; }
  .cv2-right { position: static; }
  .cv2-stage { height: 300px; }
}
.cv2-fig { max-width: 100%; max-height: 100%; min-width: 0; }
.cv2-canvas { max-width: 100%; height: auto; }
@media (max-width: 760px) { .cv2-stage { height: 260px; padding: 8px; } .cv2-pvbar { justify-content: center; } }
/* 미리보기는 결과만, 밝은 체크무늬 바탕 */
.cv2-stage { background-color: #fff; background-image: repeating-conic-gradient(#e8e8e8 0 25%, #fff 0 50%); background-size: 16px 16px; }
.cv2-canvas { background: none; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.cv2-stage .cv-empty { color: var(--muted); }
.cv2-stage .cv-empty .muted { color: var(--muted); }
.cv2-mode.has-pic { display: grid; grid-template-columns: 50px minmax(0, 1fr); column-gap: 8px; row-gap: 2px; align-items: center; }
.cv2-mode.has-pic .cv2-pic { grid-row: 1 / span 3; background: #fff; box-shadow: var(--bevel-thin-in); padding: 2px; display: grid; place-items: center; }
.cv2-mode.has-pic b, .cv2-mode.has-pic span, .cv2-mode.has-pic em { grid-column: 2; }
.cv2-mode span { font-size: 12.5px; line-height: 1.4; }
.cv2-ex { font-style: normal; font-size: 12.5px; color: #ffd800; font-weight: 700; }
.cv2-ex:empty { display: none; }
.cv2-inhead { font: 14px/1 var(--font-pixel); color: var(--select); }
.cv2-modes { max-height: 470px; overflow-y: auto; }
.rich-pics { margin: 4px 0; user-select: none; }
.rich-pics img { max-width: 100%; height: auto; display: inline-block; vertical-align: top; margin: 2px; }
.doc-slot { display: flex; align-items: center; gap: 4px; }
.doc-slot .doc-help { max-width: 320px; }
.doc-slot .btn { min-height: 28px; padding: 2px 10px; font-size: 14px; }
.doc-slot .btn .px-icon { width: 18px; height: 18px; }
.tt-logo .px-icon { width: 28px; height: 28px; display: block; }
.doc-stage.office > .doc-busy { position: absolute; inset: 0; background: var(--face); display: grid; place-items: center; z-index: 2; }
.office-host > iframe { display: block; border: 0; width: 100%; height: 100%; }
/* 엑셀: 창 전체를 표로 */
.doc-stage.sheet-stage { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.doc-stage.sheet-stage .sheet-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; }
.doc-stage.sheet-stage .sheet-wrap { flex: 1; height: auto; min-height: 0; }
.doc-stage.sheet-stage .ribbon { box-shadow: none; border-bottom: 1px solid var(--shadow); padding: 2px; gap: 0; }
.doc-stage.sheet-stage .rb-group { padding: 1px 4px 0; }
.doc-stage.sheet-stage .rb-label { padding-top: 1px; font-size: 11px; }
/* 워드(SuperDoc) */
.docx-host { display: flex; flex-direction: column; background: #e8e8e8; }
.docx-host .sd-toolbar { flex: none; background: #fff; border-bottom: 1px solid var(--shadow); }
.docx-host .sd-editor { flex: 1; min-height: 0; overflow: auto; padding: 12px 0; }
.docx-host .superdoc { display: flex; justify-content: center; }
.docx-host .superdoc__layers { margin: 0 auto; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* =========================================================
   새 디자인 덧칠 (도구별 화면)
   ========================================================= */

/* 글꼴: Pretendard (SIL OFL 1.1) */

/* 넣은 파일 + 크게 보기 */
.fq-list .list-item.picked { background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary); }
.big-preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 8px; }
.pv-stage { border-radius: 8px; background-color: #fff; background-image: repeating-conic-gradient(#eef0f3 0 25%, #fff 0 50%); }
.pv-cap { font-size: 13px; }
.rz-preview .rz-cv { border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.rz-preview canvas { outline: 1px solid rgba(0,0,0,.25); }
.rz-arrow { color: var(--muted); }

/* 이미지 변환(공통 화면) */
.cv2 { gap: 16px; grid-template-columns: minmax(0, 1fr) 360px; }
.cv2-left { gap: 10px; }
.cv2-pvbar { padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.cv2-tools .sep { width: 1px; height: 22px; background: var(--line); box-shadow: none; margin: 0 4px; }
.cv2-tool { width: 36px; height: 36px; border-radius: 8px; background: transparent; color: var(--text); }
.cv2-tool:hover { background: var(--light); box-shadow: none; }
.cv2-tool:active { background: var(--line); box-shadow: none; }
.cv2-tool svg { width: 20px; height: 20px; }
.cv2-rotlabel { color: var(--primary); font-weight: 700; font-size: 13px; }
.cv2-stage { border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); background-image: repeating-conic-gradient(#f0f2f5 0 25%, #fff 0 50%); }
.cv2-canvas { box-shadow: 0 2px 12px rgba(16,24,40,.15); }
.cv2-badge { left: 12px; bottom: 12px; padding: 6px 10px; background: rgba(25, 31, 40, .85); color: #fff; border: 0; border-radius: 8px; font-size: 12.5px; }
.cv2-detail { font-size: 13.5px; }
.cv2-strip .fq-list { padding: 8px; gap: 8px; border-radius: var(--radius); }
.cv2-strip .fq-list .list-item { border-radius: 10px; background: var(--surface); border: 1px solid var(--line); padding: 6px; }
.cv2-strip .list-item .thumb { border-radius: 6px; }
.cv2-strip .list-item .actions .btn { min-height: 22px; min-width: 22px; padding: 0; border-radius: 50%; background: rgba(25,31,40,.7); border: 0; color: #fff; }
.cv2-strip .list-item .actions .btn::after { font-size: 14px; line-height: 1; }
.cv2-strip .list-item.picked { background: var(--primary-soft); border-color: var(--primary); }
.cv2-strip .list-item.picked .name { color: var(--primary); }
.cv2-right { gap: 10px; top: 8px; }
.cv2-page { gap: 12px; }
.cv2-modes { gap: 6px; max-height: 480px; padding-right: 2px; }
.cv2-mode, .cv2-fmt {
  padding: 10px 12px 10px 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13.5px;
}
.cv2-mode b, .cv2-fmt b { font-size: 14px; font-weight: 700; }
.cv2-mode span, .cv2-fmt span { font-size: 12.5px; color: var(--muted); }
.cv2-mode::before, .cv2-fmt::before { left: 12px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.cv2-mode[aria-checked="true"], .cv2-fmt[aria-checked="true"] { background: var(--primary-soft); border-color: var(--primary); }
.cv2-mode[aria-checked="true"] b, .cv2-fmt[aria-checked="true"] b { color: var(--primary); }
.cv2-mode[aria-checked="true"] span, .cv2-fmt[aria-checked="true"] span { color: #4a5568; }
.cv2-mode[aria-checked="true"]::before, .cv2-fmt[aria-checked="true"]::before { background: radial-gradient(circle, var(--primary) 0 4px, #fff 4.5px); box-shadow: inset 0 0 0 1.5px var(--primary); }
.cv2-mode:hover:not([aria-checked="true"]), .cv2-fmt:hover:not([aria-checked="true"]) { background: var(--bg); border-color: var(--line-strong); }
.cv2-mode.has-pic { padding-left: 38px; }
.cv2-mode.has-pic .cv2-pic { background: var(--bg); border-radius: 6px; box-shadow: none; padding: 3px; }
.cv2-ex { color: var(--primary); }
.cv2-mode[aria-checked="true"] .cv2-ex { color: var(--primary); }
.cv2-fmts { gap: 6px; }
.cv2-inputs { padding: 12px; background: var(--bg); border-radius: 10px; box-shadow: none; gap: 10px; }
.cv2-inhead { font-size: 13px; font-weight: 700; color: var(--text); }
.cv2-chip { min-height: 30px; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); box-shadow: none; font-size: 12.5px; font-weight: 500; }
.cv2-chip:hover { border-color: var(--primary); color: var(--primary); }
.cv2-chip:active, .cv2-chip[aria-pressed="true"] { box-shadow: none; background: var(--primary); border-color: var(--primary); color: #fff; }
.cv2-q output { font-size: 15px; font-weight: 800; color: var(--primary); }
.cv2-summary { padding: 10px 12px; background: var(--bg); border: 0; border-radius: 10px; font-size: 13px; color: #33415c; }
.cv2-right .btn.primary { width: 100%; }
.cv2-link { color: var(--muted); font-size: 12.5px; }
.cv2-seg { border-radius: 8px; border: 1px solid var(--line); background: var(--surface); box-shadow: none; }
.cv2-seg[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); box-shadow: none; }
.cv-name { background: var(--bg); box-shadow: none; border-radius: 8px; }
.cv-stage { border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }

/* QR·워터마크 */
.qr-frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 16px; }
.qr-preview { image-rendering: pixelated; }
.qr-field .label { font-size: 13.5px; font-weight: 600; }
.color-input { width: 48px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: none; }
.stamp-pick { height: 72px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: none; }
.stamp-pick:hover { border-color: var(--line-strong); }
.stamp-pick[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); outline: 0; }

/* 문서 편집 */
.doc-bar { gap: 6px; padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 46px; }
.doc-bar .btn, .doc-modes .btn { min-height: 32px; padding: 4px 12px; font-size: 13.5px; }
.doc-bar .btn.primary { min-height: 32px; padding: 4px 14px; font-size: 13.5px; }
.doc-modes { display: flex; gap: 2px; padding: 3px; background: var(--light); border-radius: 10px; }
.doc-modes .btn { border: 0; background: transparent; color: var(--muted); }
.doc-modes .btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.doc-name { font-size: 14px; font-weight: 700; }
.doc-help { font-size: 12.5px; }
.doc-stage { background: #eceff3; }
.doc-stage.office { background: #fff; }
.doc-busy { color: var(--muted); font-size: 14px; }
.doc-page, .doc-paper, .rich-page { box-shadow: 0 1px 4px rgba(16,24,40,.12); }
.docx-view .docx-wrapper > section.docx { box-shadow: 0 1px 4px rgba(16,24,40,.12) !important; }
.doc-stage.office > .doc-busy { background: var(--surface); }
.rich-desk { background: #eceff3; box-shadow: none; border-radius: var(--radius); }
.doc-stage.hwp-rich .rich-desk { border-radius: 0; }
.rich-raw { border-radius: 4px; }
.docx-host { background: #eceff3; }
.docx-host .sd-toolbar { border-bottom: 1px solid var(--line); }

/* 리본(서식 도구 막대) */
.ribbon { gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.doc-stage .ribbon { border-radius: 0; border-width: 0 0 1px; }
.rb-group { padding: 2px 8px; box-shadow: none; border-right: 1px solid var(--line); }
.rb-group:last-child { border-right: 0; }
.rb-label { font-size: 11px; color: var(--muted); }
.rb-btn { border-radius: 6px; background: transparent; min-width: 30px; height: 30px; }
.rb-btn:hover { background: var(--light); box-shadow: none; }
.rb-btn:active, .rb-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.rb-btn.wide { font-size: 12.5px; }
.rb-select { height: 30px; border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: none; background: var(--surface); font-size: 13px; }
.rb-pop { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); }
.rb-swatch { border-radius: 4px; border-color: rgba(0,0,0,.15); }
.rb-menu .rb-btn:hover { background: var(--primary-soft); color: var(--primary); }

/* 엑셀 */
.sheet th { background: #f3f5f8; box-shadow: inset -1px -1px 0 #dde1e6; color: #4e5968; font-size: 12.5px; }
.sheet td { border-color: #e3e6eb; }
.sheet th.hl { background: #dfe5ff; color: var(--primary); }
.sheet td.sel { background-image: linear-gradient(rgba(61, 90, 254, .12), rgba(61, 90, 254, .12)); }
.fx-bar { padding: 4px 6px; background: var(--surface); border-bottom: 1px solid var(--line); }
.name-box { font-size: 13px; }
.fx-input { min-height: 30px; }
.sheet-tabs { padding: 4px 8px; background: var(--surface); border-top: 1px solid var(--line); gap: 4px; }
.sheet-tab { min-height: 30px; padding: 2px 14px; border: 0; border-radius: 6px; background: transparent; box-shadow: none; font-size: 13px; }
.sheet-tab:hover { background: var(--light); }
.sheet-tab.active { background: var(--primary-soft); color: var(--primary); box-shadow: none; }

/* 글자만 고치기 */
.doc-edit textarea { border-radius: 6px; }
.doc-edit textarea:focus { outline: 2px solid var(--primary); background: #f7f9ff; }

/* ---------- 좁은 화면(휴대폰·태블릿) ---------- */
@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .brand-tag { display: none; }
  .safe-badge { padding: 6px; }
  .sidebar {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 20; width: min(280px, 85vw);
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  .app.drawer-open .sidebar { transform: none; }
  .view-head { padding: 16px 16px 0; }
  .view-title { font-size: 19px; }
  .view-desc { font-size: 13px; }
  .window-body { padding: 12px 16px 32px; }
  .hero { padding-top: 16px; }
  .hero h1 { font-size: 26px; }
  .tool-grid { grid-template-columns: 1fr; }
  .list-item { grid-template-columns: 52px minmax(0, 1fr); }
  .list-item .thumb { width: 52px; height: 52px; }
  .list-item .actions { grid-column: 1 / -1; justify-content: stretch; }
  .list-item .actions .btn { flex: 1; }
  .window-body > .btn-row .btn.primary { width: 100%; }
  .toggle-group .btn { flex: 1 1 0; min-width: 0; }
  .subpanel { padding: 10px; gap: 8px; }
  .editor .toolbar.main {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; border-radius: 0; border-width: 1px 0 0;
    flex-wrap: nowrap; overflow-x: auto; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .editor .toolbar.main .btn { flex: none; }
  .win-photo-edit > .window-body { padding-bottom: 96px; }
  .editor .savebar { order: 10; }
  .editor .savebar .btn.primary { flex: 1 1 100%; }
  .editor-stage { min-height: 200px; padding: 6px; }
  .doc-paper { padding: 14px 10px; }
  .doc-stage { padding: 6px; }
  .doc-name { max-width: 40%; }
  .doc-help { display: none; }
  .ribbon { flex-wrap: nowrap; overflow-x: auto; }
  .rb-group { flex: none; }
  .rich-page { padding: 24px 16px; min-height: 600px; }
}
@media (max-width: 980px) { .cv2 { grid-template-columns: 1fr; } .cv2-right { position: static; } }
.hero-points > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.hero-points > span > .px-icon { padding: 0; border: 0; background: none; color: var(--primary); }
@media (max-width: 860px) { .safe-badge > span:not(.px-icon) { display: none; } .safe-badge > .px-icon { display: inline-grid !important; } }

/* =========================================================
   덜 꾸민 버전: 장식 줄이고 먹색 + 노란 형광펜 하나만
   ========================================================= */
.brand-mark { background: var(--accent); color: #1f2328; border-radius: 6px; width: 30px; height: 30px; }
.brand-name { font-weight: 800; letter-spacing: -0.04em; }
.safe-badge { background: none; color: var(--muted); padding: 0; border-radius: 0; font-weight: 500; font-size: 12.5px; }
.nav-link { border-radius: 4px; padding: 8px 12px; }
.nav-link.active { background: none; color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--text); border-radius: 0; }
.nav-link.active .px-icon { color: var(--text); }
.nav-group { font-weight: 600; letter-spacing: 0; }
.tab { border-radius: 4px 4px 0 0; }
.view-head { padding-top: 28px; }
.view-title { font-size: 21px; }

/* 첫 화면: 카드 대신 목록 */
.hero { padding: 40px 0 8px; max-width: 720px; }
.hero h1 { font-size: 28px; line-height: 1.35; margin: 0 0 12px; }
.hero p { font-size: 15.5px; color: #4a4945; margin: 0; }
.hero mark { background: linear-gradient(transparent 55%, var(--accent) 55%); color: inherit; padding: 0 1px; }
.tool-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin-top: 12px; }
.tool-group h2 { margin: 28px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tool-list { border-top: 1px solid var(--text); }
.tool-row {
  display: grid; grid-template-columns: 20px auto minmax(0, 1fr) 16px; align-items: center; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none !important;
}
.tool-row > .px-icon { color: var(--muted); }
.tool-row b { font-size: 15px; white-space: nowrap; }
.tool-row-desc { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-row-go { width: 16px; height: 16px; color: var(--line-strong); }
.tool-row-go svg { width: 16px; height: 16px; }
.tool-row:hover { background: #fff; }
.tool-row:hover b { text-decoration: underline; text-underline-offset: 3px; }
.tool-row:hover .tool-row-go { color: var(--text); }

/* 버튼·선택 */
.btn { border-radius: 6px; font-weight: 600; }
.btn.primary { border-radius: 6px; }
.btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.dropzone { border-radius: 6px; border-width: 1.5px; }
.dropzone > .px-icon { color: var(--muted); }
.dropzone:hover, .dropzone.dragover { border-color: var(--text); background: #fff; }
.dropzone.dragover .hint { color: var(--text); }
.tip { border-left: 3px solid var(--line-strong); border-radius: 0; color: #4a4945; background: transparent; padding: 6px 12px; }
.tip > .px-icon { color: var(--muted); }
.editor-help { background: transparent; border-left: 3px solid var(--line-strong); border-radius: 0; color: #4a4945; }
h2.step .num { border-radius: 4px; background: var(--text); width: 22px; height: 22px; font-size: 13px; }
.w98-tabs { border-radius: 6px; }
.w98-tab { border-radius: 4px; }
.cv2-mode, .cv2-fmt { border-radius: 6px; }
.cv2-mode[aria-checked="true"], .cv2-fmt[aria-checked="true"] { background: #fff; border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.cv2-mode[aria-checked="true"] b, .cv2-fmt[aria-checked="true"] b { color: var(--text); }
.cv2-mode[aria-checked="true"]::before, .cv2-fmt[aria-checked="true"]::before { background: radial-gradient(circle, var(--text) 0 4px, #fff 4.5px); box-shadow: inset 0 0 0 1.5px var(--text); }
.cv2-ex, .cv2-mode[aria-checked="true"] .cv2-ex { color: #9a6700; }
.cv2-chip { border-radius: 4px; }
.cv2-chip:hover { border-color: var(--text); color: var(--text); }
.cv2-q output, .cv2-rotlabel { color: var(--text); }
.cv2-badge { border-radius: 4px; }
.cv2-strip .list-item.picked { background: #fff; border-color: var(--text); }
.cv2-strip .list-item.picked .name { color: var(--text); }
.fq-list .list-item.picked { background: var(--primary-soft); box-shadow: inset 3px 0 var(--text); }
.swatch, .swatch span { border-radius: 4px; }
.swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--text); }
.stamp-pick[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--text); }
.doc-modes .btn[aria-pressed="true"] { background: #fff; color: var(--text); border: 0; }
.rb-btn:active, .rb-btn[aria-pressed="true"] { background: var(--light); color: var(--text); }
.sheet th.hl { background: #e8e6df; color: var(--text); }
.sheet td.sel { background-image: linear-gradient(rgba(31, 35, 40, .08), rgba(31, 35, 40, .08)); }
.sheet-tab.active { background: var(--light); color: var(--text); }
.progress-fill { background: var(--text); }
input[type="range"]::-webkit-slider-thumb { border-color: var(--text); }
input[type="range"]::-moz-range-thumb { border-color: var(--text); }
.field:focus, .small-field:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(31, 35, 40, .08); }
.w98-radio input[type="radio"], .w98-radio input[type="checkbox"] { accent-color: var(--text); }
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.nav-link, .brand, .tool-row { text-decoration: none; }
.window.dialog { border-radius: 8px; }
.dialog .window-body > .px-icon { color: var(--text); }
@media (max-width: 860px) {
  .tool-cols { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 20px minmax(0, 1fr) 16px; }
  .tool-row-desc { display: none; }
  .hero h1 { font-size: 23px; }
  .safe-badge { color: var(--muted); }
}
body { word-break: keep-all; overflow-wrap: anywhere; }
/* 임시저장 */
.draft-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: #fff8db; border-bottom: 1px solid #f0e2a8; font-size: 13px; flex: none; }
.draft-bar > span { flex: 1; min-width: 240px; }
.draft-list { margin: 0 0 16px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; }
.draft-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.draft-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.draft-name { font-weight: 600; overflow-wrap: anywhere; }
/* 메뉴 접기·펼치기 (넓은 화면) */
.fold-btn { margin-left: -6px; }
.rail-top { display: none; }
.app.folded .topbar { display: none; }
.app.folded .sidebar { width: 56px; padding: 8px 6px; align-items: center; }
.app.folded .rail-top { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); width: 100%; }
.app.folded .rail-brand { text-decoration: none; }
.app.folded .nav, .app.folded .nav-foot { width: 100%; align-items: center; }
.app.folded .nav-group { padding: 0; height: 1px; overflow: hidden; margin: 8px 8px; background: var(--line); font-size: 0; color: transparent; align-self: stretch; }
.app.folded .nav-link { justify-content: center; padding: 10px 0; width: 40px; border-radius: 6px; }
.app.folded .nav-link > span:not(.px-icon) { display: none; }
.app.folded .nav-link.active { box-shadow: none; background: var(--light); }
.app.folded .nav-link:hover { background: var(--light); }
.app.folded .nav-foot { display: flex; flex-direction: column; }
@media (max-width: 860px) {
  .fold-btn, .rail-top { display: none !important; }
  .app.folded .topbar { display: flex; }
  .app.folded .sidebar { width: min(280px, 85vw); padding: 12px 10px; align-items: stretch; }
  .app.folded .nav-link { justify-content: flex-start; width: auto; padding: 8px 12px; }
  .app.folded .nav-link > span:not(.px-icon) { display: inline; }
  .app.folded .nav-group { height: auto; background: none; margin: 0; padding: 16px 12px 6px; }
}
/* 묶음 상자 제목: 테두리에 걸치지 않고 상자 안 맨 위에 */
fieldset.group { padding: 14px 18px 16px; }
fieldset.group > legend { float: left; width: 100%; padding: 0 0 8px; margin: 0 0 10px; border-bottom: 1px solid var(--line); font-size: 14.5px; font-weight: 700; }
fieldset.group > legend + * { clear: both; }
fieldset.group > legend ~ * { clear: both; }
/* 자동 접기 말풍선 */
.fold-tip {
  position: fixed; left: 64px; top: 10px; z-index: 60; display: flex; align-items: flex-start; gap: 8px; max-width: 300px;
  padding: 10px 10px 10px 14px; background: #1f2328; color: #fff; border-radius: 6px; font-size: 13px; line-height: 1.5; box-shadow: var(--shadow-md);
  animation: tipIn .18s ease-out;
}
.fold-tip::before { content: ''; position: absolute; left: -6px; top: 16px; border: 6px solid transparent; border-left: 0; border-right-color: #1f2328; }
.fold-tip-x { flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #c9c9c9; cursor: pointer; display: grid; place-items: center; }
.fold-tip-x svg { width: 14px; height: 14px; }
.fold-tip-x:hover { background: rgba(255,255,255,.12); color: #fff; }
@keyframes tipIn { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .fold-tip { display: none !important; } }

/* 문의하기 */
.contact-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; margin-right: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.contact-btn:hover { background: #f1f1ec; }
.contact-btn svg { width: 15px; height: 15px; }
.nav-foot .nav-link.contact-link { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.contact-dialog { width: min(520px, 100%); }
.contact-form { padding: 12px 20px 4px; display: grid; gap: 14px; }
.contact-row { display: flex; align-items: center; gap: 12px; }
.contact-row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.contact-label { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; }
.contact-count { font-weight: 400; color: var(--muted, #6b7280); font-size: 12px; }
.contact-form textarea.field { width: 100%; resize: vertical; min-height: 120px; font: inherit; line-height: 1.5; }
.contact-form input.field { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.chip.on { background: #1f2328; border-color: #1f2328; color: #fff; }
.contact-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text); }
.contact-check input { margin-top: 3px; }
.contact-note { margin: 0; font-size: 12.5px; color: var(--muted, #6b7280); }
.contact-status { margin: 0; min-height: 0; font-size: 13px; }
.contact-status.err { color: #c92a2a; }
.contact-form .btn-row { justify-content: flex-end; padding: 4px 0 16px; }
.contact-done { padding: 8px 0; }
.contact-done strong { font-size: 16px; }
.contact-done p { margin: 6px 0 0; color: var(--muted, #6b7280); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 860px) { .contact-btn > span:not(.px-icon) { display: none; } .contact-btn { padding: 0 8px; margin-right: 4px; } }
.office-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; font-size: 13.5px; color: var(--muted, #6b7280); }
.office-alt a { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.office-alt a svg { width: 13px; height: 13px; }
/* 오피스(OnlyOffice) 편집 화면 */
.office-stage { position: relative; flex: 1; min-height: 0; padding: 0 !important; overflow: hidden; background: #f3f3f3; }
.office-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.office-loading { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 12px; background: #f7f7f4; color: var(--muted, #6b7280); font-size: 14px; }
.office-loading[hidden] { display: none; }
.spinner { width: 28px; height: 28px; border: 3px solid #ddd; border-top-color: #1f2328; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.office-pct { font-size: 28px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.office-bar { width: min(320px, 70vw); height: 6px; border-radius: 999px; background: #e4e4df; overflow: hidden; }
.office-bar-fill { height: 100%; width: 0; background: #1f2328; border-radius: inherit; transition: width .12s linear; }
.office-stage-text { margin: 0; font-size: 14px; color: var(--text); }
.office-sub { margin: 0; font-size: 12.5px; }
/* 광고 자리 */
.ad-box { position: relative; margin: 20px 0; padding-top: 16px; min-height: 90px; }
.ad-label { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--muted, #6b7280); letter-spacing: .02em; }
.ad-box.ad-preview .ad-ph { display: grid; place-items: center; min-height: 100px; border: 1px dashed #c9c9c2; border-radius: 6px; background: #efefea; color: #8a8a83; font-size: 13px; }
.ad-box ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
/* 왼쪽 메뉴 아래 광고: PC에서 메뉴가 펼쳐져 있고 화면 높이가 넉넉할 때만 */
.side-ad { margin-top: auto; padding: 8px 2px 0; }
.side-ad .ad-box { margin: 0; min-height: 0; }
.side-ad .ad-box.ad-preview .ad-ph { min-height: 200px; }
.app.folded .side-ad { display: none; }
@media (max-width: 860px) { .side-ad { display: none !important; } }
