/* ================= 디자인 토큰 ================= */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --surface-3: #e8e8ec;
  --line: #e4e4e9;
  --line-strong: #d4d4db;
  --text: #0f0f12;
  --text-2: #3c3c43;
  --muted: #86868f;
  --ink: #0f0f12;
  --ink-text: #ffffff;
  --brand: #2f5bea;
  --brand-soft: #eef2ff;
  --danger: #e5383b;
  --success: #12a150;
  --warn: #c2700a;
  --naver: #03c75a;
  --radius: 16px;
  --radius-sm: 10px;
  --tabbar-h: 60px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color-scheme: light;

  --orange-bg: #fff1e8; --orange-fg: #e0601a;
  --amber-bg: #fdf4e3;  --amber-fg: #b7791f;
  --teal-bg: #e6f6f4;   --teal-fg: #0f8a7e;
  --sky-bg: #e8f3fd;    --sky-fg: #1f7ac9;
  --violet-bg: #f1edfd; --violet-fg: #6c47d9;
  --slate-bg: #eef0f3;  --slate-fg: #4b5563;
  --indigo-bg: #ebeefe; --indigo-fg: #3f51d8;
  --green-bg: #e9f6ec;  --green-fg: #1f8a3e;
  --pink-bg: #fcebf3;   --pink-fg: #c43d82;
  --rose-bg: #fdebec;   --rose-fg: #d0393f;
  --zinc-bg: #efeff2;   --zinc-fg: #55555e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0d; --surface: #161619; --surface-2: #1f1f23; --surface-3: #2a2a2f; --line: #26262b; --line-strong: #34343a;
    --text: #f4f4f6; --text-2: #c7c7cc; --muted: #8b8b94; --ink: #f4f4f6; --ink-text: #0b0b0d;
    --brand: #6e8dff; --brand-soft: #1a2140; color-scheme: dark;
    --orange-bg: #33200f; --orange-fg: #ff9a5c; --amber-bg: #2f2510; --amber-fg: #f2b850; --teal-bg: #0e2a28; --teal-fg: #4fd1c1;
    --sky-bg: #0f2233; --sky-fg: #6cb6f5; --violet-bg: #211a3a; --violet-fg: #a78bfa; --slate-bg: #202329; --slate-fg: #aab2bf;
    --indigo-bg: #1a1f3d; --indigo-fg: #8b9bff; --green-bg: #102a18; --green-fg: #5fd283; --pink-bg: #33152a; --pink-fg: #f383bd;
    --rose-bg: #331618; --rose-fg: #ff7a7f; --zinc-bg: #232327; --zinc-fg: #a5a5ae;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0d; --surface: #161619; --surface-2: #1f1f23; --surface-3: #2a2a2f; --line: #26262b; --line-strong: #34343a;
  --text: #f4f4f6; --text-2: #c7c7cc; --muted: #8b8b94; --ink: #f4f4f6; --ink-text: #0b0b0d;
  --brand: #6e8dff; --brand-soft: #1a2140; color-scheme: dark;
}

/* ================= 기본 ================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
.ic { flex: none; display: block; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ================= 상단바 / 하단 탭 ================= */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px; min-height: 52px;
  padding: calc(env(safe-area-inset-top) + 6px) 12px 6px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font-size: 17px; font-weight: 650; margin: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em; }
.icon-btn { border: 0; background: none; color: var(--text); width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }

main { padding: 4px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 32px); max-width: 720px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr; align-items: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 550; }
.tabbar a.active { color: var(--text); }
.add-btn {
  justify-self: center; width: 48px; height: 48px; border-radius: 16px; border: 0; padding: 0;
  display: grid; place-items: center; background: var(--ink); color: var(--ink-text);
  box-shadow: 0 6px 16px rgba(0,0,0,.18); transition: transform .12s;
}
.add-btn:active { transform: scale(.94); }

/* ================= 타이포 ================= */
.large-title { margin: 8px 2px 16px; }
.large-title h2 { font-size: 30px; font-weight: 750; letter-spacing: -0.035em; margin: 0; line-height: 1.15; }
.large-title p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.section-label { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.section-label h3 { font-size: 13px; font-weight: 650; color: var(--muted); margin: 0; letter-spacing: 0; }
.section-label a, .section-label button { font-size: 13px; color: var(--brand); font-weight: 550; background: none; border: 0; padding: 0; }

/* ================= 버튼 / 입력 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 0;
  background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--ink-text); }
.btn.primary:hover { opacity: .9; }
.btn.block { width: 100%; height: 46px; font-size: 15px; border-radius: 12px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: none; color: var(--brand); padding: 0 6px; }
.btn:disabled { opacity: .4; pointer-events: none; }

.search {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  background: var(--surface-2); border-radius: 12px; color: var(--muted);
}
.search input { flex: 1; border: 0; background: none; outline: none; color: var(--text); font-size: 15px; height: 100%; min-width: 0; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }

.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.55; }

/* ================= 칩 / 배지 ================= */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: 13px; font-weight: 550; color: var(--text-2); white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.chip .ic { width: 15px; height: 15px; }
.chip .x { border: 0; background: none; color: var(--muted); padding: 0; margin-left: 2px; display: grid; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.pill.warn { background: var(--amber-bg); color: var(--amber-fg); }
.pill.busy { background: var(--brand-soft); color: var(--brand); }

.cat-badge { display: inline-grid; place-items: center; border-radius: 10px; flex: none; }
[class*="hue-"] { background: var(--zinc-bg); color: var(--zinc-fg); }
.hue-orange { background: var(--orange-bg); color: var(--orange-fg); } .hue-amber { background: var(--amber-bg); color: var(--amber-fg); }
.hue-teal { background: var(--teal-bg); color: var(--teal-fg); } .hue-sky { background: var(--sky-bg); color: var(--sky-fg); }
.hue-violet { background: var(--violet-bg); color: var(--violet-fg); } .hue-slate { background: var(--slate-bg); color: var(--slate-fg); }
.hue-indigo { background: var(--indigo-bg); color: var(--indigo-fg); } .hue-green { background: var(--green-bg); color: var(--green-fg); }
.hue-pink { background: var(--pink-bg); color: var(--pink-fg); } .hue-rose { background: var(--rose-bg); color: var(--rose-fg); }
.hue-zinc { background: var(--zinc-bg); color: var(--zinc-fg); }

/* ================= 홈: 분류 ================= */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat-tile {
  display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .1s;
}
.cat-tile:hover { border-color: var(--line-strong); }
.cat-tile:active { transform: scale(.985); }
.cat-tile .top { display: flex; align-items: center; justify-content: space-between; }
.cat-tile .name { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-tile .count { font-size: 13px; color: var(--muted); margin-top: 1px; }
.stack { display: flex; }
.stack img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; border: 2px solid var(--surface); margin-left: -8px; background: var(--surface-2); }
.stack img:first-child { margin-left: 0; }

.banner { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 13.5px; font-weight: 600; }

/* ================= 리스트 행 ================= */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item-row { display: flex; gap: 12px; padding: 12px 14px; align-items: center; position: relative; }
.item-row + .item-row::before { content: ""; position: absolute; top: 0; left: 90px; right: 0; border-top: 1px solid var(--line); }
.item-row:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.item-row .thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--muted); }
.item-row .body { min-width: 0; flex: 1; }
.item-row .title { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row .desc { font-size: 13px; color: var(--text-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.item-row .meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.item-row .meta .dot::before { content: "·"; margin-right: 6px; }
mark { background: color-mix(in srgb, #ffcf33 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ================= 이미지 그리드(분류 안) ================= */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; margin-top: 14px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.g-item .img { aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); position: relative; }
.g-item .img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.g-item:hover .img img { transform: scale(1.03); }
.g-item .img .pill { position: absolute; left: 8px; top: 8px; backdrop-filter: blur(8px); }
.g-item .t { font-size: 14px; font-weight: 650; margin-top: 8px; letter-spacing: -0.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.g-item .m { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= 그룹(설정·상세) ================= */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group + .group { margin-top: 12px; }
.g-row { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 14px; position: relative; width: 100%; border: 0; background: none; text-align: left; font-size: 15px; color: var(--text); }
.g-row + .g-row::before, .g-row + .g-block::before, .g-block + .g-row::before, .g-block + .g-block::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--line); }
a.g-row:hover, button.g-row:hover, label.g-row:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.g-row .lead { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.g-row .label { flex: 1; min-width: 0; }
.g-row .label small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.g-row .trail { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 4px; }
.g-row.danger { color: var(--danger); justify-content: center; font-weight: 600; }
.g-block { padding: 14px; position: relative; }
.g-row input[type=checkbox] { width: 44px; height: 26px; appearance: none; -webkit-appearance: none; background: var(--surface-3); border-radius: 999px; position: relative; transition: background .2s; flex: none; margin: 0; }
.g-row input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.g-row input[type=checkbox]:checked { background: var(--success); }
.g-row input[type=checkbox]:checked::after { transform: translateX(18px); }
.g-row .bare { border: 0; background: none; outline: none; flex: 1; min-width: 0; font-size: 15px; padding: 4px 0; color: var(--text); text-align: right; }
.g-row .bare::placeholder { color: var(--muted); }
.naver-n { width: 30px; height: 30px; border-radius: 8px; background: var(--naver); color: #fff; font-weight: 900; font-size: 15px; display: grid; place-items: center; flex: none; font-family: Arial, sans-serif; }

/* ================= 상세 ================= */
.hero-wrap { margin: 0 -16px; position: relative; background: var(--surface-2); }
.hero { width: 100%; max-height: 58vh; object-fit: cover; display: block; cursor: zoom-in; }
.hero.capture { object-fit: contain; max-height: 66vh; background: var(--surface-2); }
@media (min-width: 720px) { .hero-wrap { margin: 0; border-radius: var(--radius); overflow: hidden; } }
.link-hero { padding: 18px; display: flex; gap: 12px; align-items: flex-start; }
.link-hero a { color: var(--brand); word-break: break-all; font-weight: 550; }
.link-hero p { margin: 6px 0 0; white-space: pre-wrap; color: var(--text-2); }

.title-input {
  width: 100%; border: 0; outline: none; background: none; padding: 0; margin: 18px 0 2px;
  font-size: 26px; font-weight: 750; letter-spacing: -0.035em; line-height: 1.25; color: var(--text);
}
.title-input::placeholder { color: var(--line-strong); }
.meta-line { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 11px; }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 0 0 .5px rgba(0,0,0,.04); }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }

.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 3px; color: var(--line-strong); display: grid; }
.stars button.on { color: #f5a623; }
.stars button.on .ic { fill: currentColor; }

.ai-summary { font-size: 15.5px; line-height: 1.65; color: var(--text); margin: 0; }
.points { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.points li { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.points li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); margin-top: 9px; flex: none; }
.kv { display: grid; grid-template-columns: 84px 1fr; margin: 0; }
.kv dt, .kv dd { padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--text); word-break: break-word; }
.kv dt:first-of-type, .kv dd:first-of-type { border-top: 0; }
.sub-title { font-size: 13px; font-weight: 650; color: var(--muted); margin: 16px 0 6px; }
.rating-big { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.rating-big .ic { color: #f5a623; fill: #f5a623; }
.ocr { white-space: pre-wrap; font-size: 13px; line-height: 1.6; color: var(--text-2); max-height: 280px; overflow: auto; background: var(--surface-2); padding: 12px; border-radius: 10px; margin: 8px 0 0; }
details summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 2px; transition: transform .15s; }
details[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.sources a { display: block; font-size: 13px; color: var(--brand); padding: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.confidence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.confidence i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); display: block; }
.confidence.medium i { background: #f5a623; } .confidence.low i { background: var(--danger); }
.ai-empty { text-align: center; padding: 8px 4px 4px; }
.ai-empty .big-ic { width: 44px; height: 44px; border-radius: 14px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.ai-empty p { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.memo-area { width: 100%; border: 0; outline: none; background: none; resize: none; min-height: 88px; font-size: 15px; line-height: 1.6; padding: 0; color: var(--text); }
.memo-area::placeholder { color: var(--muted); }

.minimap { height: 180px; z-index: 0; }
.candidates { display: grid; gap: 0; }
.candidate { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text); }
.candidate:first-child { border-top: 0; }
.candidate .d { margin-left: auto; color: var(--muted); font-size: 12.5px; }

/* ================= 비어있음 ================= */
.empty { text-align: center; padding: 56px 20px 24px; }
.empty .art { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.empty h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; margin: 0 0 8px; }
.empty p { color: var(--muted); margin: 0 auto 6px; max-width: 340px; font-size: 14.5px; line-height: 1.6; }
.how { display: grid; gap: 0; margin: 28px auto 0; max-width: 380px; text-align: left; }

/* ================= 시트 ================= */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0); transition: background .22s; }
.sheet-backdrop.open { background: rgba(0,0,0,.36); }
.sheet { position: absolute; left: 8px; right: 8px; bottom: 8px; max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: 22px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .26s cubic-bezier(.2,.8,.2,1); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 8px; }
.sheet-title { font-size: 13px; font-weight: 650; color: var(--muted); padding: 4px 12px 8px; }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; background: none; padding: 12px; border-radius: 14px; font-size: 15px; color: var(--text); }
.sheet-item:hover { background: var(--surface-2); }
.sheet-item .lead { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none; }
.sheet-item b { font-weight: 650; }
.sheet-item small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.sheet-hint { font-size: 12.5px; color: var(--muted); padding: 8px 12px 6px; line-height: 1.5; }
kbd { font: 600 11.5px var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface-2); }

/* ================= 지도 ================= */
.fullmap { position: fixed; inset: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 1; }
.map-filter { position: fixed; top: calc(env(safe-area-inset-top) + 58px); left: 0; right: 0; z-index: 5; margin: 0; }
.map-filter .chip { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.pin-photo { width: 42px; height: 42px; border-radius: 13px; border: 2.5px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.28); object-fit: cover; background: #fff; display: grid; place-items: center; }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.leaflet-popup-content { margin: 10px 12px; font-family: var(--font); }
.popup { display: flex; gap: 10px; align-items: center; min-width: 200px; color: #0f0f12; }
.popup img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.popup b { font-size: 14px; } .popup small { color: #86868f; }
.pick-card { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); z-index: 5; max-width: 480px; margin: 0 auto; padding: 14px; }

/* ================= 기타 ================= */
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none;
  background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--ink-text); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 550;
  transition: .22s cubic-bezier(.2,.8,.2,1); z-index: 70; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.fade-in { animation: fade .22s ease-out; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 분류 체계 / 꼬리표 ---------- */
.chip.soft { background: var(--surface-2); border-color: transparent; }
.chip.soft.on { background: var(--ink); color: var(--ink-text); }
.chip-n { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.chip.on .chip-n { color: inherit; opacity: .7; }
.count-inline { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.cat-tile .count { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 19px; }
.pill.urgent { background: var(--rose-bg); color: var(--rose-fg); }
input[type=date].bare { font-variant-numeric: tabular-nums; }

/* ---------- 세부 기준(패싯) ---------- */
.facet-label { font-size: 13px; font-weight: 650; color: var(--text-2); margin-bottom: 8px; display: flex; align-items: baseline; gap: 6px; }
.facet-label span { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.facet .chip { height: 30px; padding: 0 11px; font-size: 12.5px; }
.filter-panel { margin-top: 10px; }
.facet-edit summary { padding: 2px 0; }
.facet-edit[open] summary { margin-bottom: 2px; }

/* ---------- 끌어다 놓기 ---------- */
.drop-zone { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.drop-zone.show { opacity: 1; }
.drop-zone > div { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 48px; border-radius: 24px;
  border: 2px dashed var(--line-strong); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.12); }
.drop-zone b { font-size: 17px; font-weight: 700; }
.drop-zone span { font-size: 13px; color: var(--muted); }

/* ---------- 업무 공간 ---------- */
.space-seg { margin: 8px 0 4px; max-width: 260px; }
.w-avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; font-weight: 700; background: var(--surface-2); }
.acc-head { display: flex; align-items: center; gap: 14px; margin: 10px 2px 12px; }
.acc-head h2 { font-size: 24px; font-weight: 750; letter-spacing: -0.03em; margin: 0; word-break: break-all; }
.acc-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.acc-link { text-decoration: none; }
.acc-link .g-row { width: 100%; }
.steps { display: flex; gap: 4px; }
.step { flex: 1; height: 8px; border-radius: 4px; border: 0; padding: 0; background: var(--surface-3); cursor: pointer; }
.step.on { background: var(--ink); }
.qs { max-height: 88vh; overflow-y: auto; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.qs-head { display: flex; gap: 12px; align-items: center; margin: 4px 0 6px; }
.qs-head img, .qs-ph { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; }
.qs-handle { height: 42px; }
.qs-label { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; margin: 16px 0 8px; }
.qs-group { font-size: 12px; font-weight: 650; color: var(--muted); margin: 12px 0 6px; }
.qs .chip { height: 34px; }
.qs-actions { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: 12px -16px calc(-16px - env(safe-area-inset-bottom)); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
details.acc-info > summary { cursor: pointer; }
details.acc-info > summary::after { margin-left: auto; }
details.acc-info[open] > summary { border-bottom: 1px solid var(--line); }

/* ---------- 링크 미리보기 ---------- */
.lp-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--text); }
.lp-card.loading { flex-direction: row; align-items: center; gap: 10px; padding: 14px; color: var(--muted); font-size: 14px; }
.lp-img { width: 100%; max-height: 220px; object-fit: cover; background: var(--surface-2); display: block; }
.lp-body { padding: 12px 14px; }
.lp-site { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.lp-title { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; margin-top: 3px; line-height: 1.4; }
.lp-desc { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
a.lp-link:hover { border-color: var(--line-strong); }
.lp-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--amber-bg); color: var(--amber-fg); font-size: 13px; line-height: 1.5; }
.lp-note .ic { margin-top: 2px; }
