/* FriendWiki — Notion 레이아웃 + velog 타이포/포인트 컬러. 빌드 없는 단일 CSS, 라이트/다크 자동. */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --bg-hover: rgba(55, 53, 47, 0.06);
  --bg-active: rgba(55, 53, 47, 0.1);
  --text: #37352f;
  --text-strong: #212529;
  --muted: #787774;
  --faint: #acaba9;
  --border: rgba(55, 53, 47, 0.12);
  --border-strong: rgba(55, 53, 47, 0.2);
  --accent: #12b886;
  --accent-strong: #0ca678;
  --accent-soft: #e6fcf5;
  --accent-text: #087f5b;
  --danger: #e03131;
  --danger-soft: #fff5f5;
  --ok: #2b8a3e;
  --missing: #e03131;
  --code-text: #eb5757;
  --code-bg: rgba(135, 131, 120, 0.15);
  --add-bg: #e6fcf5;
  --add-sign: #0ca678;
  --del-bg: #fff0f0;
  --del-sign: #e03131;
  --mark: #fff3bf;
  --shadow: 0 1px 2px rgba(15, 15, 15, 0.04), 0 4px 16px rgba(15, 15, 15, 0.06);
  --shadow-lift: 0 4px 12px rgba(15, 15, 15, 0.08), 0 12px 32px rgba(15, 15, 15, 0.08);
  --radius: 6px;
  --radius-lg: 10px;
  --sidebar-w: 248px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "D2Coding", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --bg-soft: #202020;
    --bg-hover: rgba(255, 255, 255, 0.055);
    --bg-active: rgba(255, 255, 255, 0.1);
    --text: rgba(255, 255, 255, 0.82);
    --text-strong: #ffffff;
    --muted: rgba(255, 255, 255, 0.48);
    --faint: rgba(255, 255, 255, 0.28);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #20c997;
    --accent-strong: #38d9a9;
    --accent-soft: rgba(32, 201, 151, 0.12);
    --accent-text: #63e6be;
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.1);
    --ok: #69db7c;
    --missing: #ff8787;
    --code-text: #ff8787;
    --code-bg: rgba(255, 255, 255, 0.08);
    --add-bg: rgba(32, 201, 151, 0.14);
    --add-sign: #38d9a9;
    --del-bg: rgba(255, 107, 107, 0.14);
    --del-sign: #ff8787;
    --mark: rgba(250, 176, 5, 0.32);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 4px 12px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font); letter-spacing: -0.003em;
  word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.35; letter-spacing: -0.02em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
code, pre { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

/* ============================================================ app shell */
.app { display: flex; min-height: 100vh; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; width: var(--sidebar-w); flex: none;
  overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-soft); border-right: 1px solid var(--border);
  padding: 10px 8px; overflow-y: auto; font-size: 14px;
}
.side-top { padding: 4px 6px 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text-strong); letter-spacing: -0.02em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 800;
}
.side-search {
  display: flex; align-items: center; gap: 6px; margin: 0 2px 8px; padding: 0 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted);
}
.side-search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; padding: 6px 0 !important; outline: none !important; box-shadow: none !important; }
.side-nav, .side-section { display: flex; flex-direction: column; gap: 1px; }
.side-section { margin-top: 14px; }
.side-heading { padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.side-link, .side-page {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: var(--radius);
  color: var(--text); min-height: 30px;
}
.side-link:hover, .side-page:hover { background: var(--bg-hover); }
.side-link.active { background: var(--bg-active); color: var(--text-strong); font-weight: 600; }
.side-icon { width: 18px; text-align: center; color: var(--muted); flex: none; font-size: 14px; }
.side-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-page { color: var(--muted); }
.side-page:hover { color: var(--text); }
.side-bottom { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--border); }
.side-user summary {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius);
  cursor: pointer; list-style: none;
}
.side-user summary::-webkit-details-marker { display: none; }
.side-user summary:hover { background: var(--bg-hover); }
.side-user-name { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; min-width: 0; }
.side-user-name small { font-weight: 400; color: var(--muted); font-size: 12px; }
.side-user-menu { display: flex; flex-direction: column; padding: 4px 0 4px 44px; gap: 2px; }
.side-user-menu a, .side-user-menu button { padding: 3px 0; color: var(--muted); text-align: left; font-size: 13.5px; }
.side-user-menu a:hover, .side-user-menu button:hover { color: var(--text); }
.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px;
}
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobilebar { display: none; }
.scrim { display: none; }
.content { width: 100%; max-width: 860px; margin: 0 auto; padding: 56px 48px 120px; }
.content.wide { max-width: 1240px; }

/* ============================================================ typography blocks */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-title { font-size: 2.4rem; font-weight: 800; margin: 0; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.page-desc { margin: 8px 0 0; color: var(--muted); }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
h2.section { font-size: 1.15rem; margin: 40px 0 12px; }
h2.section .count { color: var(--muted); font-weight: 500; }

.empty-state { text-align: center; padding: 72px 16px; color: var(--muted); }
.empty-state h1 { font-size: 1.6rem; margin: 8px 0; }
.empty-emoji { font-size: 44px; color: var(--faint); }
.empty { color: var(--muted); padding: 24px 0; }

/* ============================================================ buttons & forms */
input, select, textarea, button, .button { font: inherit; color: inherit; }
input:not([type=radio]):not([type=checkbox]):not([type=file]), select, textarea {
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg);
  padding: 8px 11px; max-width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: var(--faint); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg);
  padding: 7px 14px; cursor: pointer; line-height: 1.3; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
button:hover, .button:hover { background: var(--bg-hover); }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover, .button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.danger, .button.danger { color: var(--danger); border-color: transparent; background: var(--danger-soft); }
button.danger:hover { background: var(--danger); color: #fff; }
button.ghost, .button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover, .button.ghost:hover { background: var(--bg-hover); color: var(--text); }
button.small, .button.small { padding: 4px 9px; font-size: 13px; }
button.link { border: 0; background: none; padding: 0; color: inherit; font-weight: inherit; }
button.link:hover { background: none; text-decoration: underline; }
button:disabled { opacity: .5; cursor: wait; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); cursor: pointer; font-size: 18px; color: var(--text); }
.icon-btn:hover { background: var(--bg-hover); }

.form { display: flex; flex-direction: column; gap: 18px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.form label > .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.form .actions { display: flex; gap: 8px; margin-top: 4px; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.narrow { max-width: 460px; }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  margin: 0 0 16px; background: var(--bg-soft); border: 1px solid var(--border);
}
.notice-icon {
  flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  font-size: 12px; font-weight: 800; background: var(--bg-active); color: var(--muted); margin-top: 1px;
}
.notice ul { margin: 0; padding-left: 18px; }
.notice-error { background: var(--danger-soft); border-color: transparent; }
.notice-error .notice-icon { background: var(--danger); color: #fff; }
.notice-ok { background: var(--accent-soft); border-color: transparent; }
.notice-ok .notice-icon { background: var(--accent); color: #fff; }
.notice form.inline { margin-left: 8px; }

/* ============================================================ auth (velog modal 느낌) */
body.bare { background: var(--bg-soft); }
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 20px; }
.auth-brand { font-size: 20px; }
.auth-brand .brand-mark { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--bg); border-radius: 14px; box-shadow: var(--shadow-lift);
  padding: 36px 32px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.5rem; }
.auth-card .lead { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.auth-card button.primary { width: 100%; padding: 10px; font-size: 15px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; margin: 20px 0 0; }
.auth-foot a { color: var(--accent-text); font-weight: 600; }

/* ============================================================ document */
.doc-head { margin-bottom: 8px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb .sep { color: var(--faint); }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }
.doc-meta a:hover { color: var(--text); }
.doc-meta .avatar { width: 22px; height: 22px; font-size: 11px; }
.doc-meta .who { display: inline-flex; align-items: center; gap: 6px; }

.tabs { display: flex; gap: 2px; margin: 22px 0 28px; padding-bottom: 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 5px 11px; border-radius: var(--radius); color: var(--muted); font-size: 14px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { background: var(--bg-hover); color: var(--text); }
.tabs a.active { background: var(--bg-active); color: var(--text-strong); }
.tabs a.tab-danger:hover { color: var(--danger); background: var(--danger-soft); }
.tabs .spacer { flex: 1; }

.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
.doc-layout.has-toc { grid-template-columns: minmax(0, 1fr) 220px; }
.doc-toc { position: sticky; top: 32px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; overflow-x: hidden; font-size: 13.5px; border-left: 2px solid var(--border); padding: 2px 0 2px 14px; }
.doc-toc .toc-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; letter-spacing: .02em; }
.doc-toc a { display: block; padding: 3px 0; color: var(--muted); line-height: 1.45; transition: color .15s; overflow-wrap: anywhere; }
.doc-toc a:hover { color: var(--text); }
.doc-toc a.active { color: var(--accent-text); font-weight: 600; }
.doc-toc .toc-l3 { padding-left: 12px; } .doc-toc .toc-l4, .doc-toc .toc-l5, .doc-toc .toc-l6 { padding-left: 24px; }

.categories { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); }
.categories .label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.tag {
  display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-text);
}
.tag:hover { background: var(--accent); color: #fff; }
.tag .n { margin-left: 6px; opacity: .7; font-size: 12px; }

/* ---- 본문 (velog 타이포) */
.wiki-content { font-size: 16.5px; line-height: 1.8; color: var(--text); overflow-wrap: anywhere; }
.wiki-content > :first-child { margin-top: 0; }
.wiki-content p { margin: 0 0 1.1em; }
.wiki-content h1, .wiki-content h2, .wiki-content h3, .wiki-content h4 { margin: 2em 0 .7em; font-weight: 700; }
.wiki-content h1 { font-size: 1.85em; }
.wiki-content h2 { font-size: 1.5em; }
.wiki-content h3 { font-size: 1.25em; }
.wiki-content h4 { font-size: 1.08em; }
.wiki-content a { color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--accent-soft); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.wiki-content a:hover { text-decoration-color: var(--accent); }
.wiki-content a.missing { color: var(--missing); text-decoration-style: dotted; text-decoration-color: currentColor; text-decoration-thickness: 1px; }
.wiki-content a.wiki-img { text-decoration: none; display: inline-block; }
.wiki-content img { border-radius: var(--radius-lg); display: block; margin: 8px 0; }
.wiki-content ul, .wiki-content ol { padding-left: 1.5em; margin: 0 0 1.1em; }
.wiki-content li { margin: .25em 0; }
.wiki-content li::marker { color: var(--muted); }
.wiki-content blockquote {
  margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--accent); background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--text);
}
.wiki-content blockquote > :last-child { margin-bottom: 0; }
.wiki-content :not(pre) > code { color: var(--code-text); background: var(--code-bg); padding: .15em .4em; border-radius: 4px; font-size: .86em; }
.wiki-content pre { background: var(--bg-soft); border-radius: var(--radius-lg); padding: 18px 20px; overflow-x: auto; font-size: 14px; line-height: 1.6; margin: 0 0 1.3em; }
.wiki-content pre code { color: var(--text); }
.wiki-content table { border-collapse: collapse; display: block; overflow-x: auto; margin: 0 0 1.3em; font-size: .95em; }
.wiki-content th, .wiki-content td { border: 1px solid var(--border); padding: 8px 12px; }
.wiki-content th { background: var(--bg-soft); font-weight: 600; text-align: left; }
.wiki-content hr { margin: 2.5em 0; }
.wiki-content input[type=checkbox] { accent-color: var(--accent); }

.doc-foot { margin-top: 56px; color: var(--faint); font-size: 13px; }
a.deleted { text-decoration: line-through; color: var(--muted); }

/* ============================================================ editor (velog 쓰기 화면) */
.editor { display: flex; flex-direction: column; gap: 12px; }
.editor-toolbar {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 2px; flex-wrap: wrap; align-items: center;
  background: var(--bg); padding: 8px 0; border-bottom: 1px solid var(--border);
}
.editor-toolbar button { border: 0; background: transparent; padding: 6px 10px; color: var(--muted); font-size: 14px; min-width: 34px; }
.editor-toolbar button:hover { background: var(--bg-hover); color: var(--text); }
.editor-toolbar button[aria-pressed=true] { color: var(--accent-text); background: var(--accent-soft); }
.editor-toolbar .divider { width: 1px; height: 18px; background: var(--border-strong); margin: 0 6px; }
.editor-toolbar .spacer { flex: 1; }
.editor-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 62vh; }
.editor.split .editor-panes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.editor textarea {
  width: 100%; min-height: 62vh; resize: vertical; border: 0 !important; box-shadow: none !important; border-radius: 0;
  padding: 12px 4px; font: 15px/1.75 var(--mono); background: transparent;
}
.editor.split textarea { padding-right: 24px; border-right: 1px solid var(--border) !important; }
.editor textarea.dragover { background: var(--accent-soft); }
.editor .preview { padding: 12px 4px 12px 32px; min-height: 62vh; overflow-y: auto; }
.editor:not(.split) .preview { padding: 12px 4px; }
.editor-hint { color: var(--faint); font-size: 13px; margin: 0; }
.editor-actions {
  position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 0; background: var(--bg); border-top: 1px solid var(--border);
}
.editor-actions input { flex: 1; min-width: 200px; }
.editor-title { font-size: 2.2rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.035em; color: var(--text-strong); }
.editor-title-bar { width: 64px; height: 6px; background: var(--text-strong); border-radius: 3px; margin: 14px 0 18px; opacity: .85; }

/* ============================================================ lists (velog 카드/피드) */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .avatar { margin-top: 2px; }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-weight: 600; color: var(--text-strong); font-size: 15.5px; }
.feed-title:hover { color: var(--accent-text); }
.feed-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 13px; margin-top: 3px; }
.feed-sub a:hover { color: var(--text); text-decoration: underline; }
.feed-summary { color: var(--text); font-size: 14px; margin-top: 4px; }
.day-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 28px 0 4px; }
.day-label:first-child { margin-top: 0; }

.kind { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg-active); color: var(--muted); }
.kind-create, .kind-restore { background: var(--accent-soft); color: var(--accent-text); }
.kind-delete { background: var(--danger-soft); color: var(--danger); }
.kind-revert { background: var(--mark); color: var(--text); }
.delta { font-family: var(--mono); font-size: 12px; }
.delta.plus { color: var(--add-sign); } .delta.minus { color: var(--del-sign); }

.page-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 16px; }
.page-list a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--radius); }
.page-list a:hover { background: var(--bg-hover); }
.page-list .side-icon { color: var(--faint); }
.page-list .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.letter-head { font-size: 13px; font-weight: 700; color: var(--muted); margin: 24px 0 6px 8px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.search-big { display: flex; gap: 8px; margin-bottom: 28px; }
.search-big input { flex: 1; font-size: 17px; padding: 12px 16px !important; border-radius: var(--radius-lg) !important; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li { padding: 16px 4px; border-bottom: 1px solid var(--border); }
.search-results .feed-title { font-size: 17px; }
.snippet { color: var(--muted); font-size: 14px; margin-top: 4px; line-height: 1.65; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
.goto { display: inline-flex; gap: 8px; align-items: center; padding: 12px 16px; background: var(--accent-soft); border-radius: var(--radius-lg); margin-bottom: 20px; }
.goto a { color: var(--accent-text); font-weight: 700; }

/* ---- tables */
.table-scroll { overflow-x: auto; }
table.history, table.users { border-collapse: collapse; width: 100%; font-size: 14px; }
table.history th, table.users th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.history td, table.users td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.history tr:hover td, table.users tr:hover td { background: var(--bg-hover); }
table.history input[type=radio] { accent-color: var(--accent); }
table.users tr.disabled td { color: var(--faint); }
.table-actions { display: flex; gap: 8px; margin-top: 16px; }

dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 14px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }
.card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); padding: 16px 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.pending-head { display: flex; align-items: center; gap: 10px; }
.pending-msg { margin: 12px 0 14px; padding: 10px 14px; background: var(--bg-soft); border-radius: var(--radius); font-size: 14px; }
code.copyable { cursor: pointer; background: var(--code-bg); padding: 3px 8px; border-radius: 4px; font-size: 13px; }
code.copyable:hover { background: var(--accent-soft); }
code.copyable.copied::after { content: "  ✓ 복사됨"; color: var(--accent-text); font-family: var(--font); }

/* ============================================================ diff */
table.diff { width: 100%; border-collapse: collapse; font: 13px/1.6 var(--mono); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table.diff td { padding: 1px 10px; vertical-align: top; }
table.diff td.ln { width: 1%; color: var(--faint); text-align: right; user-select: none; background: var(--bg-soft); }
table.diff td.code { white-space: pre-wrap; overflow-wrap: anywhere; }
table.diff .sign { display: inline-block; width: 1.4em; user-select: none; font-weight: 700; }
.diff-add td.code { background: var(--add-bg); } .diff-add .sign { color: var(--add-sign); }
.diff-del td.code { background: var(--del-bg); } .diff-del .sign { color: var(--del-sign); }
.diff-skip td { text-align: center; color: var(--muted); background: var(--bg-soft); padding: 4px; font-family: var(--font); font-size: 12.5px; }
.diff-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; font-size: 14px; }
.rev-chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); }
.rev-chip:hover { border-color: var(--accent); }

/* ============================================================ files */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gallery a {
  display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-lg); background: var(--bg-soft);
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.gallery a:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-preview { margin: 0 0 24px; display: flex; justify-content: center; background: var(--bg-soft); border-radius: var(--radius-lg); padding: 16px; }
.file-preview img { max-height: 72vh; border-radius: var(--radius); box-shadow: var(--shadow); }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.file-actions .spacer { flex: 1; }
.dropzone {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 44px 16px; text-align: center;
  cursor: pointer; font-weight: 500 !important; color: var(--muted); transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.dropzone .big { font-size: 32px; line-height: 1; }
.dropzone input[type=file] { max-width: 100%; font-size: 13px; }
.upload-progress { list-style: none; padding: 0; margin: 0; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.upload-progress .err { color: var(--danger); } .upload-progress .done { color: var(--accent-text); }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 32px; color: var(--muted); }

/* ============================================================ responsive */
@media (max-width: 1100px) {
  .doc-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { display: none; }
  .content { padding: 48px 32px 100px; }
}
@media (max-width: 900px) {
  .editor.split .editor-panes { grid-template-columns: minmax(0, 1fr); }
  .editor.split textarea { border-right: 0 !important; padding-right: 4px; }
  .editor.split .preview { display: none; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; height: auto; max-height: 100dvh; transform: translateX(-100%);
    -webkit-overflow-scrolling: touch; padding-bottom: calc(12px + env(safe-area-inset-bottom));
    transition: transform .22s ease, box-shadow .22s ease; width: 280px;
  }
  .nav-toggle:checked ~ .sidebar { transform: none; box-shadow: var(--shadow-lift); }
  body:has(.nav-toggle:checked) { overflow: hidden; }
  .nav-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(15, 15, 15, .4); }
  .mobilebar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 10;
    padding: 6px 8px; background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .content { padding: 28px 18px 80px; }
  .page-title { font-size: 1.9rem; }
  .editor-title { font-size: 1.7rem; }
  .wiki-content { font-size: 16px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .auth-card { padding: 28px 22px; }
  table.history .hide-sm { display: none; }
}

/* ---- profile */
.profile-card { display: flex; align-items: center; gap: 16px; }
.avatar-lg { width: 52px; height: 52px; font-size: 22px; }
.profile-name { font-size: 1.15rem; font-weight: 700; color: var(--text-strong); }
.avatar-xl { width: 72px; height: 72px; font-size: 30px; }
.user-hero { margin-bottom: 8px; }
.user-hero .page-title { font-size: 2rem; }
.who-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.who-cell .avatar { width: 24px; height: 24px; font-size: 11px; }
.status-active { background: var(--accent-soft); color: var(--accent-text); }
.status-disabled { background: var(--danger-soft); color: var(--danger); }
.card .row { margin-top: 4px; }
