:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1b1f27;
  --muted: #6b7280;
  --primary: #2557d6;
  --primary-ink: #ffffff;
  --primary-soft: #e8eefc;
  --ok: #18794e;
  --ok-soft: #e6f4ec;
  --warn: #9a6200;
  --warn-soft: #fdf3e1;
  --error: #c4302b;
  --error-soft: #fdeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --sidebar-w: 236px;
  --topbar-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #1a1d24;
    --surface-2: #232731;
    --border: #2e333e;
    --text: #e8eaee;
    --muted: #9aa1ad;
    --primary: #6b93ff;
    --primary-ink: #0c1222;
    --primary-soft: #1f2a46;
    --ok: #4cc38a;
    --ok-soft: #173326;
    --warn: #f0b04a;
    --warn-soft: #3a2c12;
    --error: #ff7b72;
    --error-soft: #3d1c1a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
h1 { font-size: 1.45rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h2 { font-size: 1.05rem; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 5px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.center { text-align: center; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic-sm { width: 14px; height: 14px; vertical-align: -2px; }
.ic-lg { width: 32px; height: 32px; }

/* ---------- 상단바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); white-space: nowrap; width: calc(var(--sidebar-w) - 28px); }
.brand .ic { color: var(--primary); width: 22px; height: 22px; }
.brand:hover { text-decoration: none; }
.top-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; height: 38px; }
.top-search .ic { color: var(--muted); }
.top-search input { flex: 1; border: 0; background: transparent; color: inherit; font: inherit; outline: none; min-width: 0; }
.top-info { margin-left: auto; display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.top-disk { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.top-disk meter { width: 64px; height: 8px; }
.top-disk-pct { display: none; }
.top-disk.is-full { color: var(--error); }
.top-clock { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.top-time { color: var(--text); font-weight: 600; }
.top-user { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: .88rem; }
.top-user:hover { text-decoration: none; background: var(--primary-soft); color: var(--primary); }
.top-username { color: var(--muted); font-size: .8rem; }
.top-username::before { content: "("; }
.top-username::after { content: ")"; }
.nav-toggle { display: none; }

/* ---------- 레이아웃 ---------- */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  width: var(--sidebar-w); flex: none; padding: 12px 10px 24px; border-right: 1px solid var(--border);
  background: var(--surface); position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  display: flex; flex-direction: column;
}
.nav-group { margin-top: 2px; }
.nav-tools { display: flex; align-items: center; gap: 8px; margin: 14px 4px 4px 10px; font-size: .75rem; color: var(--muted); }
.nav-tools span { flex: 1; font-weight: 700; letter-spacing: .04em; }
.link-btn { background: none; border: 0; padding: 2px; color: var(--muted); font: inherit; cursor: pointer; }
.link-btn:hover { color: var(--primary); text-decoration: underline; }
.nav-head-row { display: flex; align-items: center; }
.nav-head-row .nav-head { flex: 1; min-width: 0; }
.nav-fold { width: 30px; height: 30px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.nav-fold:hover { background: var(--surface-2); color: var(--text); }
.nav-fold .ic { transition: transform .15s; transform: rotate(-90deg); }
.nav-group.open .nav-fold .ic { transform: none; }
.nav-children { display: none; padding: 2px 0 6px; }
.nav-group.open .nav-children { display: block; }
.nav-sub::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; flex: none; }
.badge-19 { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e5484d; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1; margin-left: 4px; }
.nav-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.nav-head, .nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text);
  width: 100%; font: inherit; background: none; border: 0; cursor: pointer; text-align: left;
}
.nav-head { font-weight: 700; }
.nav-sub { padding: 5px 10px 5px 38px; color: var(--muted); font-size: .92rem; }
.nav-head:hover, .nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-head.active, .nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-backdrop { display: none; }
.content { flex: 1; min-width: 0; padding: 24px 28px 64px; max-width: 1180px; }

/* ---------- 공통 요소 ---------- */
.page-head { margin-bottom: 18px; display: grid; gap: 6px; }
.page-head p { margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.count { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 9px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel-note { border-color: var(--primary); }
.panel-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.link-more { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.home-grid .panel { margin: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card-grid .panel { margin: 0; }
.narrow { max-width: 520px; }
.empty { color: var(--muted); text-align: center; padding: 18px 0; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-danger-ghost { background: transparent; color: var(--error); border-color: transparent; }
.btn-danger-ghost:hover { background: var(--error-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; vertical-align: 1px; }
.badge-draft { background: var(--warn-soft); color: var(--warn); }
.badge-ai { background: var(--primary-soft); color: var(--primary); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-error { background: var(--error-soft); color: var(--error); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chip-link { font-size: .85rem; padding: 4px 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.chip-link:hover, .chip-link.active { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.alert { padding: 11px 14px; border-radius: 8px; margin: 0 0 14px; background: var(--surface-2); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-error { background: var(--error-soft); color: var(--error); }
.temp-pw code { font-size: 1.05rem; user-select: all; }
.temp-pw span { display: block; margin-top: 4px; }

/* ---------- 글 목록 ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-row + .post-row { border-top: 1px solid var(--border); }
.post-link { display: flex; gap: 12px; padding: 11px 4px; color: var(--text); border-radius: 8px; }
.post-link:hover { background: var(--surface-2); text-decoration: none; }
.post-icon { width: 44px; height: 56px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.post-main { min-width: 0; display: grid; gap: 2px; }
.post-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-summary { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); align-items: center; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.toolbar .chips { margin: 0; }
.inline-search { display: flex; gap: 6px; margin-bottom: 12px; }
.toolbar .inline-search { margin: 0; }
.inline-search input { height: 38px; min-width: 220px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.pager-info { color: var(--muted); font-size: .9rem; }

/* ---------- 글 보기 ---------- */
.post-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 6px 0 18px; }
.post-head h1 { font-size: 1.6rem; }
.lead { font-size: 1.05rem; margin: 6px 0; }
.post-actions { display: flex; gap: 6px; flex: none; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.file-list li + li { border-top: 1px solid var(--border); }
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-size { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.meta-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.meta-grid dt { color: var(--muted); }
.meta-grid dd { margin: 0; overflow-wrap: anywhere; }
.prose { overflow-wrap: anywhere; }
.prose h2 { font-size: 1.1rem; margin: 1.2em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1rem; margin: 1em 0 .4em; }
.prose p { margin: .5em 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: 4px 10px; }
.sources ul { margin: 6px 0 0; padding-left: 1.2em; }
.sources li { overflow-wrap: anywhere; }

/* ---------- 폼 ---------- */
.form { display: grid; gap: 14px; }
.form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form fieldset:disabled { opacity: .55; }
.field { display: grid; gap: 5px; }
.field > span { font-weight: 600; font-size: .9rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.edit-form .panel { display: grid; gap: 14px; }
.field-end { align-self: end; }
.req { color: var(--error); font-style: normal; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 11px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus, .dropzone:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { width: auto; flex: none; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.code-input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
.check.remember { align-items: flex-start; line-height: 1.4; }
.check.remember input { margin-top: 3px; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; margin-bottom: 16px; border-top: 1px solid var(--border); }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input { width: 140px; }
.inline-form select { width: auto; }
.danger-zone { text-align: right; }

/* ---------- 자료 사진 (게시판 틀) ---------- */
.post-hero { margin: 6px 0 18px; }
.post-hero.has-photos { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 24px; align-items: start; }
.post-hero.has-photos.is-wide { grid-template-columns: minmax(280px, 520px) 1fr; }
.post-hero.is-wide .gallery-main { aspect-ratio: 16 / 10; }
.post-hero .post-head { margin: 0 0 14px; }
.post-info .meta-grid { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.gallery { display: grid; gap: 8px; min-width: 0; }
.gallery-main { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #0d0f14; cursor: zoom-in; aspect-ratio: 3 / 4; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-count { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.gallery-cap { margin: 0; text-align: center; font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.gallery-thumb { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: pointer; aspect-ratio: 1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active { border-color: var(--primary); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(0,0,0,.88); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 6px; }
.lightbox-cap { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: #eee; margin: 0; }
.lightbox-close, .lightbox-nav { position: fixed; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.prev .ic { transform: rotate(180deg); }
.lightbox-nav.next { right: 14px; }
.post-icon.has-img { padding: 0; overflow: hidden; background: var(--surface-2); }
.post-icon.has-img img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.photo-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); display: grid; }
.photo-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-2); }
.photo-card .photo-meta { padding: 6px 8px; font-size: .78rem; display: grid; gap: 4px; }
.photo-card .photo-actions { display: flex; gap: 4px; }
.photo-card .photo-actions form { flex: 1; }
.photo-card .photo-actions .btn { width: 100%; height: 28px; font-size: .75rem; padding: 0 6px; }
.photo-card.is-main { border-color: var(--primary); }
.photo-tools { display: grid; gap: 10px; margin-top: 12px; }
.photo-tools .inline-search { margin: 0; }
.photo-tools .inline-search input { flex: 1; min-width: 0; }
.opts { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0; display: grid; gap: 8px; }
.opts legend { font-weight: 700; font-size: .9rem; padding: 0 4px; }
.pack-opt { align-items: flex-start; margin-top: 10px; }
.pack-opt input { margin-top: 4px; }
@media (max-width: 860px) {
  .post-hero.has-photos { grid-template-columns: 1fr; }
  .gallery { max-width: 420px; justify-self: center; width: 100%; }
}

/* ---------- 폴더 올리기: 점검 보고서·진행 ---------- */
.drop-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dropzone-sm .btn { margin-left: 4px; }
.plan { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-top: 10px; display: grid; gap: 10px; background: var(--surface); }
.plan-head { font-size: 1rem; }
.plan-sec summary { cursor: pointer; font-weight: 600; }
.plan-sec ul { margin: 6px 0 0; padding-left: 1.2em; max-height: 260px; overflow: auto; font-size: .85rem; display: grid; gap: 4px; }
.plan-sec code { overflow-wrap: anywhere; }
.plan-sec.conflict { display: grid; gap: 8px; }
.progress-box progress { width: 100%; height: 12px; }
.p-live { list-style: none; margin: 0; padding: 0; font-size: .82rem; display: grid; gap: 2px; overflow-wrap: anywhere; }
.resume-box ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.resume-box li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dir-row { display: flex; align-items: center; gap: 8px; padding: 8px 0 4px; font-weight: 600; border-top: 1px solid var(--border); }
.dir-row .dir-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dir-row .pick { width: 18px; height: 18px; }
.file-list.in-dir li { padding-left: 18px; }

/* ---------- 파일 골라 받기 ---------- */
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.files-head .panel-title { margin-bottom: 8px; }
.pick-all { margin: 2px 0 6px; font-size: .9rem; }
.file-list .pick { width: 18px; height: 18px; flex: none; }
.pick-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--primary); box-shadow: 0 6px 20px rgba(0,0,0,.12); }

/* ---------- AI 질문 ---------- */
.questions { border-color: var(--warn); }
.question { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0 0 10px; display: grid; gap: 6px; }
.question legend { font-weight: 700; padding: 0 4px; }
.question p { margin: 0; }
.option { align-items: flex-start; padding: 4px 0; }
.option input { margin-top: 4px; }
.option-text { margin-left: 26px; width: calc(100% - 26px); }
.version-input { width: 120px; flex: none; padding: 4px 8px; font-size: .85rem; }
.version-head { font-size: .9rem; color: var(--muted); margin: 14px 0 4px; }
.version-head:first-of-type { margin-top: 0; }

/* ---------- 시리즈 ---------- */
.series-box .series-list { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.series-list li.current { color: var(--primary); }

/* ---------- 대량 등록 ---------- */
.batch-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.batch-summary .badge { font-size: .8rem; padding: 3px 9px; }
.batch-list { list-style: none; margin: 0; padding: 0; }
.batch-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; }
.batch-item + .batch-item { border-top: 1px solid var(--border); }
.batch-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.batch-main .post-title { color: var(--text); }
.batch-q { margin: 0; font-size: .85rem; color: var(--warn); }
.batch-q.error { color: var(--error); }
.batch-state { flex: none; }
.sticky-actions form { display: inline; }

/* ---------- 개인 자료실 ---------- */
.break { overflow-wrap: anywhere; word-break: break-word; }
.my-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.my-search { margin: 0 0 0 auto; }
.my-upload { margin-bottom: 12px; }
.my-panel { padding: 6px 12px; }
.my-list { list-style: none; margin: 0; padding: 0; }
.my-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; }
.my-row + .my-row { border-top: 1px solid var(--border); }
.my-row:hover { background: var(--surface-2); }
.my-row.is-off { opacity: .6; }
.my-check { width: 18px; height: 18px; flex: none; }
.my-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--text); padding: 4px 0; }
.my-name:hover { text-decoration: none; }
.my-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.my-icon.is-folder { background: #fff4d6; color: #b7791f; }
.my-text { min-width: 0; display: grid; }
.my-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }
.shared-tag { color: var(--primary); }
.row-menu { position: relative; flex: none; }
.row-menu summary { list-style: none; cursor: pointer; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-list { position: absolute; right: 0; top: 36px; z-index: 20; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; display: grid; }
.row-menu-list a, .row-menu-list button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.row-menu-list a:hover, .row-menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.row-menu-list .danger { color: var(--error); }
.row-menu-list form { display: contents; }
.sel-bar { position: sticky; bottom: 12px; z-index: 25; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--primary); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.sel-bar form { display: inline; }
.preview { text-align: center; }
.preview img, .preview video { max-width: 100%; max-height: 75vh; border-radius: 8px; }
.preview audio { width: 100%; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.share-grid .panel { margin: 0; }
.share-people { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.share-people li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.seg { display: grid; gap: 6px; }
.link-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 12px; display: grid; gap: 6px; }
.link-card.is-off { opacity: .6; }
.link-card p { margin: 0; }
.link-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.link-row { display: flex; gap: 6px; }
.link-input { flex: 1; font-size: .85rem; background: var(--surface-2); }
.share-card { width: min(640px, calc(100vw - 32px)); }
.share-card h2 { font-size: 1.1rem; margin: 0; }
.share-preview { max-width: 100%; max-height: 60vh; border-radius: 8px; justify-self: center; }

/* ---------- 업로드 ---------- */
.upload-item.dup { border-color: var(--warn); }
.dup-tag { grid-column: 1 / -1; font-size: .8rem; color: var(--warn); }
.dropzone {
  display: grid; justify-items: center; gap: 6px; padding: 30px 16px; border: 2px dashed var(--border);
  border-radius: var(--radius); text-align: center; cursor: pointer; color: var(--muted); background: var(--surface-2);
}
.dropzone strong { color: var(--text); }
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone-sm { display: flex; justify-content: center; align-items: center; padding: 16px; }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.upload-list:empty { display: none; }
.upload-item { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.upload-item .name { overflow-wrap: anywhere; }
.upload-item .size { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.upload-item progress { grid-column: 1 / -1; width: 100%; height: 6px; }
.upload-item.done .name::after { content: " ✓"; color: var(--ok); }
.upload-item.failed { border-color: var(--error); }
progress { accent-color: var(--primary); }

/* ---------- AI 진행 표시 ---------- */
.ai-banner { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--primary-soft); color: var(--text); margin-bottom: 16px; }
.ai-banner > div { flex: 1; display: grid; gap: 2px; }
.spinner { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 3px solid var(--primary); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.table-compact td { padding: 5px 8px; }
.row-warn td { background: var(--error-soft); }
.plain { margin: 0; padding-left: 1.1em; }
.meter { width: 100%; height: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cat-row .inline-form { flex: 1; }
.cat-sub { padding-left: 28px; }
.cat-icon { color: var(--primary); }
.steps { padding-left: 1.2em; display: grid; gap: 10px; }
.qr { margin: 10px 0; }
.qr img { background: #fff; padding: 8px; border-radius: 8px; }
.secret { user-select: all; overflow-wrap: anywhere; }

/* ---------- 로그인 ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-content: center; padding: 16px; }
.auth-card { width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.auth-card p { margin: 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--primary); }
.auth-brand h1 { color: var(--text); font-size: 1.3rem; }

/* ---------- 모바일 ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .brand { width: auto; }
  .brand span { display: none; }
  .top-upload span { display: none; }
  .top-upload { padding: 0 11px; }
  .top-info { gap: 8px; }
  .top-date, .top-username, .top-disk-text, .top-disk meter { display: none; }
  .top-disk-pct { display: inline; }
  .top-user { padding: 5px 8px; }
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 16px rgba(0,0,0,.15); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 35; background: rgba(0,0,0,.35); }
  .content { padding: 16px 16px 64px; }
  .home-grid { grid-template-columns: 1fr; }
  .post-head { flex-direction: column; }
  .inline-search input { min-width: 0; }
  .meta-grid { grid-template-columns: 1fr; gap: 0; }
  .meta-grid dd { margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .top-search { display: none; }
  .topbar { gap: 8px; }
  .hide-sm { display: none; }
  .my-toolbar .btn span { display: none; }
  .my-toolbar .btn { padding: 0 11px; }
  .my-search { margin: 0; flex: 1; }
  .share-grid { grid-template-columns: 1fr; }
  .post-actions { flex-wrap: wrap; }
  .sticky-actions { flex-wrap: wrap; }
}
@media (prefers-color-scheme: dark) {
  .my-icon.is-folder { background: #3a2f12; color: #f0b04a; }
}