/* 법카는 거짓말을 안 한다 — style.css
   NOTE: the original stylesheet was lost (2026-11-17) and was not recoverable from memory.
   This is a rewrite that covers every class used by index.html / app.js. */
:root { --c1: #141b2e; --c2: #4b3f7a; --accent: #ffcf70; --card: rgba(255,255,255,.94); --ink: #1b1d26; --muted: #6b7080; --line: rgba(0,0,0,.08); }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: #fff; min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased; background: var(--c1); }
a { color: inherit; }
mark { background: var(--accent); color: #111; border-radius: 3px; padding: 0 1px; }
code { background: rgba(0,0,0,.08); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.muted { color: rgba(255,255,255,.62); }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* background */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-grad { position: absolute; inset: 0; background: linear-gradient(160deg, var(--c1) 0%, var(--c2) 100%); transition: background .6s; }
.bg-img { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .8s; z-index: 1; }
.bg-img.on { opacity: .38; }
.bg-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.65)); }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, calc((100% - 1040px) / 2)); background: rgba(10,12,20,.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo { font-size: 28px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 17px; letter-spacing: -.02em; }
.brand-text small { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { border: 0; background: rgba(255,255,255,.14); color: #fff; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.24); }

/* search */
.search-panel { position: relative; max-width: 1040px; margin: 18px auto 0; padding: 0 16px; z-index: 15; }
.search-box { display: flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); border-radius: 16px; padding: 6px 10px 6px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.search-ico { font-size: 18px; }
.search-box input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 16px; padding: 10px 4px; background: transparent; color: var(--ink); min-width: 0; }
.search-box input::-webkit-search-cancel-button { display: none; }
.clear { display: none; border: 0; background: #eef0f4; color: #555; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.suggest { display: none; list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; left: 16px; right: 16px; background: #fff; color: var(--ink);
  border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.3); max-height: 60vh; overflow: auto; }
.suggest li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.suggest li.active, .suggest li[data-slug]:hover { background: #f1f2f8; }
.suggest li.sub, .suggest .sub { color: var(--muted); font-size: 13px; cursor: default; }
.tag { flex: none; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #e7f6ec; color: #17803d; }
.tag.auto { background: #eef0ff; color: #4a4fc9; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); text-decoration: none; font-size: 14px; border: 1px solid rgba(255,255,255,.12); }
.chip:hover { background: rgba(255,255,255,.26); }

/* layout */
main { max-width: 1040px; margin: 0 auto; padding: 8px 16px 40px; }
.hero { padding: 36px 0 18px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 10px; letter-spacing: -.03em; line-height: 1.2; }
.hero p { margin: 0 0 14px; font-size: 16px; opacity: .92; max-width: 760px; }
.caption { display: inline-block; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.28); }
.section-title { font-size: 18px; margin: 28px 0 12px; }
.note { font-size: 13px; color: rgba(255,255,255,.72); margin: 16px 0; }
.empty { background: var(--card); color: var(--ink); border-radius: 18px; padding: 28px; text-align: center; }
.empty h3 { margin: 0 0 8px; }
.empty .muted { color: var(--muted); }

/* region cards */
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rcard { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 120px; padding: 14px; border-radius: 18px; overflow: hidden; text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: transform .15s; }
.rcard:hover { transform: translateY(-2px); }
.rcard .ri { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.rcard .rg { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 20%, rgba(0,0,0,.7)); z-index: 1; }
.rcard b, .rcard span { position: relative; z-index: 2; }
.rcard b { font-size: 18px; }
.rcard span { font-size: 12.5px; opacity: .9; }

/* region view */
.result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 28px 0 10px; }
.result-head h1 { font-size: clamp(24px, 4.2vw, 36px); margin: 4px 0 8px; letter-spacing: -.03em; line-height: 1.25; }
.crumbs { font-size: 13px; opacity: .8; }
.crumbs a { text-decoration: none; }
.refresh { flex: none; border: 0; background: var(--accent); color: #1b1b1b; font: inherit; font-weight: 700; padding: 10px 16px; border-radius: 12px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.refresh:disabled { opacity: .5; cursor: default; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 10px 0; }
.seg { display: inline-flex; background: rgba(0,0,0,.28); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; color: #fff; font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 700; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px; backdrop-filter: blur(6px); }
.stat b { display: block; font-size: 22px; line-height: 1.2; }
.stat span { font-size: 12.5px; opacity: .8; }

/* list */
.list { display: flex; flex-direction: column; gap: 12px; }
.skel { height: 110px; border-radius: 18px; background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.18), rgba(255,255,255,.08)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.item { display: grid; grid-template-columns: 56px 1fr; gap: 6px 14px; background: var(--card); color: var(--ink); border-radius: 18px; padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: rise .35s both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.item h3 { margin: 2px 0 8px; font-size: 19px; letter-spacing: -.02em; }
.rank { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 20px; background: #f0f1f6; color: #444; }
.rank.r1, .rank.r2, .rank.r3 { font-size: 28px; background: transparent; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: #f0f1f6; color: #444; white-space: nowrap; }
.pill.hl { background: color-mix(in srgb, var(--accent) 35%, #fff); color: #2a2200; font-weight: 700; }
.pill.warn { background: #fff1e6; color: #b45309; }
.purpose { margin-top: 8px; font-size: 14px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 13px; padding: 6px 11px; border-radius: 10px; text-decoration: none; cursor: pointer; }
.btn:hover { background: #f5f6fa; }
.btn.naver { background: #03c75a; border-color: #03c75a; color: #fff; }
.btn.kakao { background: #fee500; border-color: #fee500; color: #191600; }
.visits { display: none; grid-column: 1 / -1; overflow-x: auto; font-size: 13px; }
.visits.on { display: block; }
.visits table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.visits th, .visits td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.visits th { background: #f6f7fb; font-weight: 700; white-space: nowrap; }
.visits .num { text-align: right; white-space: nowrap; }
.visits small { color: var(--muted); margin-left: 2px; }
.ocr-badge { font-size: 10.5px; padding: 1px 5px; border-radius: 5px; background: #eef0ff; color: #4a4fc9; font-weight: 700; }
@media (max-width: 560px) { .item { grid-template-columns: 1fr; } .rank { width: 40px; height: 40px; } }

/* refresh job / discovery boxes */
.job, .disc { display: none; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px 16px; margin: 12px 0; font-size: 14px; }
.job.on, .disc.on { display: block; }
.disc h3 { margin: 0 0 8px; font-size: 17px; }
.disc.ok { background: rgba(22,101,52,.45); }
.disc.fail { background: rgba(127,29,29,.45); }
.dmsg { margin-bottom: 8px; }
.dmsg a { text-decoration: underline; }
.bar { position: relative; height: 6px; border-radius: 6px; background: rgba(255,255,255,.18); overflow: hidden; margin: 8px 0; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 6px; transition: width .4s; }
.bar.indet i { width: 35% !important; animation: indet 1.3s infinite ease-in-out; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }
.job pre, .disc pre { max-height: 180px; overflow: auto; background: rgba(0,0,0,.35); border-radius: 10px; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 8px 0; counter-reset: st; }
.steps li { counter-increment: st; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); opacity: .7; }
.steps li::before { content: counter(st) ". "; }
.steps li.ok { background: rgba(34,197,94,.35); opacity: 1; }
.steps li.ok::before { content: "✓ "; }
.steps li.now { background: var(--accent); color: #222; opacity: 1; font-weight: 700; }
.discform { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.discform input { flex: 1; min-width: 220px; border: 0; border-radius: 10px; padding: 10px 12px; font: inherit; }
.discform button { border: 0; border-radius: 10px; padding: 10px 14px; background: var(--accent); color: #222; font: inherit; font-weight: 700; cursor: pointer; }
details summary { cursor: pointer; font-size: 13px; opacity: .85; }

/* sources & footer */
.sources { font-size: 13px; color: rgba(255,255,255,.8); margin: 10px 0 0; }
.sources a { text-decoration: underline; }
.foot { background: rgba(0,0,0,.45); margin-top: 30px; }
.foot-inner { max-width: 1040px; margin: 0 auto; padding: 22px 16px 30px; font-size: 12.5px; color: rgba(255,255,255,.75); }
.foot-inner p { margin: 0 0 8px; }
.credits a { text-decoration: underline; }
