
  :root { --bg:#0a0a0b; --card:#141416; --line:#26262b; --fg:#ededee; --mut:#8a8a90; --acc:#ff7a1a; --acc-ink:#2a1505; --acc-soft:rgba(255,122,26,0.13); --up:#2bb36b; --mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace; }
  * { box-sizing:border-box; }
  body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,"Apple SD Gothic Neo","Noto Sans KR",sans-serif; }
  .wrap { max-width:1100px; margin:0 auto; padding:18px 16px 64px; }
  .disp { font-family:"Space Grotesk",system-ui,sans-serif; letter-spacing:-0.3px; }
  .mono { font-family:var(--mono); }
  h1 { font-size:23px; font-weight:600; margin:8px 0 4px; letter-spacing:-0.3px; }
  h2 { font-size:16px; margin:24px 0 10px; color:var(--fg); border-bottom:1px solid var(--line); padding-bottom:6px; }
  .sub { color:var(--mut); margin:0 0 18px; font-size:13px; }
  .sub code, .code { font-size:11px; color:var(--mut); font-family:var(--mono); }
  .tile figcaption, .cnt { font-family:var(--mono); }
  .empty,.muted { color:var(--mut); }
  a { color:inherit; text-decoration:none; }
  .back { color:var(--mut); font-size:13px; }
  .back:hover { color:var(--acc); }

  .brandbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:2px 0 14px; margin-bottom:16px; border-bottom:0.5px solid var(--line); }
  .brand { display:flex; align-items:baseline; gap:10px; }
  .brand .wm { font-size:21px; font-weight:700; color:var(--fg); }
  .brand .wm b { color:var(--acc); font-weight:700; }
  .brand .tag { color:var(--mut); font-size:11px; }

  .grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; }
  .card { background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden; transition:.15s; }
  .card:hover { border-color:var(--acc); transform:translateY(-2px); }
  .card .thumb { aspect-ratio:1/1; background:#0a0c10; display:flex; align-items:center; justify-content:center; }
  .card .thumb img { width:100%; height:100%; object-fit:cover; }
  .card .name { padding:8px 10px; font-size:13px; font-weight:600; display:flex; justify-content:space-between; align-items:center; gap:6px; white-space:nowrap; overflow:hidden; }
  .card .name .code { font-weight:400; }
  .noimg { color:var(--mut); font-size:12px; }

  .tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:12px; }
  .tile { margin:0; background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
  .tile img { width:100%; aspect-ratio:1/1; object-fit:cover; display:block; background:#0a0c10; }
  .tile figcaption { padding:6px 8px; font-size:12px; color:var(--mut); text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .tiles[hidden] { display:none; }   /* 접기: display:grid 가 hidden 을 덮어쓰지 않도록 */
  .grp { margin-top:10px; }
  .grp-head { width:100%; text-align:left; display:flex; align-items:center; gap:8px; background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:8px; padding:11px 12px; cursor:pointer; font-size:15px; font-weight:600; }
  .grp-head:hover { border-color:var(--acc); }
  .grp-head .caret { color:var(--acc); width:14px; display:inline-block; }
  .grp-head .cnt { margin-left:auto; font-size:12px; color:var(--mut); font-weight:400; }
  .grp .tiles { margin-top:10px; }

  .login { max-width:320px; margin:60px auto; text-align:center; }
  .login input { width:100%; padding:10px 12px; margin:14px 0; background:var(--card); border:1px solid var(--line); border-radius:8px; color:var(--fg); }
  .login button, .btn { background:var(--acc); color:var(--acc-ink); border:0; padding:9px 16px; border-radius:999px; font-weight:500; cursor:pointer; font-size:13px; }

  .err { color:#ff7a7a; font-size:13px; }
  .admin-top { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  .admin-actions { display:flex; gap:8px; }
  .admin-actions .btn { background:#222732; color:var(--fg); border:1px solid var(--line); }
  .botlist { display:flex; flex-direction:column; gap:10px; }
  .bot { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
  .bot-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .bot-name { font-weight:700; min-width:40px; }
  .nameinput { flex:1; min-width:160px; padding:7px 10px; background:#0e1117; border:1px solid var(--line); border-radius:7px; color:var(--fg); font-size:13px; }
  .savename, .toggle, .uploadbtn { border-radius:7px; padding:7px 10px; cursor:pointer; font-size:12px; }
  .toggle { background:#222732; color:var(--fg); border:1px solid var(--line); }
  .savename { background:var(--acc); color:var(--acc-ink); border:0; font-weight:700; }
  .uploadbtn { background:var(--up); color:#04210f; border:0; font-weight:700; }
  .bot-cur { color:var(--mut); font-size:12px; margin-top:8px; }
  .bot-cur em { color:var(--fg); font-style:normal; }
  .bot-imgs { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:10px; margin-top:12px; }
  .bot-imgs[hidden] { display:none; }   /* 접기 동작: display:grid 가 hidden 을 덮어쓰지 않도록 */

  /* 작품 바로가기 버튼 (갤러리) */
  .linkbar { display:flex; flex-wrap:wrap; gap:8px; margin:2px 0 20px; }
  .golink { background:var(--card); color:var(--fg); border:0.5px solid var(--line); border-radius:999px; padding:8px 16px; font-size:13px; font-weight:500; transition:.12s; }
  .golink:first-child { background:var(--acc); color:var(--acc-ink); border-color:var(--acc); }
  .golink:hover { background:var(--acc); color:var(--acc-ink); border-color:var(--acc); }
  /* 링크 편집(어드민) */
  .linktoggle { background:#222732; color:var(--fg); border:1px solid var(--line); border-radius:7px; padding:7px 10px; cursor:pointer; font-size:12px; }
  .bot-links { margin-top:12px; }
  .bot-links[hidden] { display:none; }
  .linkrows { display:flex; flex-direction:column; gap:8px; }
  .linkrow { display:flex; gap:8px; align-items:center; }
  .l-label { flex:0 0 32%; min-width:110px; padding:7px 10px; background:#0e1117; border:1px solid var(--line); border-radius:7px; color:var(--fg); font-size:13px; }
  .l-url { flex:1; min-width:160px; padding:7px 10px; background:#0e1117; border:1px solid var(--line); border-radius:7px; color:var(--fg); font-size:13px; }
  .l-del { flex:0 0 auto; width:30px; height:30px; border:1px solid var(--line); background:#2a1d22; color:#ff9a9a; border-radius:7px; cursor:pointer; font-size:16px; line-height:1; }
  .linkactions { display:flex; align-items:center; gap:8px; margin-top:10px; }
  .addlink { background:#222732; color:var(--fg); border:1px dashed var(--line); border-radius:7px; padding:7px 12px; cursor:pointer; font-size:12px; }
  .savelinks { background:var(--acc); color:var(--acc-ink); border:0; border-radius:7px; padding:7px 12px; cursor:pointer; font-size:12px; font-weight:700; }
  .linkmsg { font-size:12px; color:var(--mut); }
  .pick { margin:0; border:2px solid transparent; border-radius:8px; overflow:hidden; cursor:pointer; background:#0a0c10; }
  .pick img { width:100%; aspect-ratio:1/1; object-fit:cover; display:block; }
  .pick figcaption { font-size:11px; color:var(--mut); text-align:center; padding:4px; }
  .pick.sel { border-color:var(--acc); }
  .pick:hover { border-color:#3a4150; }

  .guide { color:var(--fg); line-height:1.9; padding-left:20px; }
  .guide code { background:#0e1117; border:1px solid var(--line); border-radius:4px; padding:1px 5px; font-size:12px; }
  .statlist { display:flex; flex-direction:column; gap:8px; }
  .statbot { background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
  .statbot > summary { cursor:pointer; padding:11px 14px; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; font-weight:600; }
  .statbot > summary::-webkit-details-marker { display:none; }
  .statbot > summary .s-meta { font-size:12px; color:var(--mut); font-weight:400; }
  .statbot[open] > summary { border-bottom:1px solid var(--line); }
  table.stat { width:100%; border-collapse:collapse; font-size:13px; }
  table.stat th, table.stat td { text-align:left; padding:7px 14px; border-top:1px solid var(--line); }
  table.stat thead th { color:var(--mut); font-weight:600; border-top:0; }
  table.stat td.num, table.stat th.num { text-align:right; font-variant-numeric:tabular-nums; }
  table.stat tr.zero td { color:#7a8190; }

  /* 로드 통계 대시보드 */
  .cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin:6px 0 14px; }
  .dcard { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px 14px; display:flex; gap:10px; align-items:center; min-height:62px; }
  .dlabel { font-size:11px; color:var(--mut); }
  .dval { font-size:20px; font-weight:700; font-variant-numeric:tabular-nums; }
  .dval2 { font-size:14px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:140px; }
  .dsub { font-size:11px; color:var(--mut); }
  .dthumb { width:42px; height:42px; border-radius:7px; object-fit:cover; background:#0a0c10; flex:0 0 auto; }
  .ctrls { display:flex; gap:12px; align-items:center; flex-wrap:wrap; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:12px; font-size:13px; }
  .ctrls label { display:flex; align-items:center; gap:6px; color:var(--mut); }
  .ctrls label.chk { color:var(--fg); }
  .ctrls select, .ctrls input[type=search] { background:#0e1117; color:var(--fg); border:1px solid var(--line); border-radius:6px; padding:6px 8px; font-size:13px; }
  .ctrls input[type=search] { flex:1; min-width:140px; }
  .card-box { background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
  .srows { display:flex; flex-direction:column; }
  .srow { display:flex; align-items:center; gap:10px; padding:5px 14px; border-top:1px solid var(--line); }
  .srows .srow:first-child { border-top:0; }
  .rthumb { width:34px; height:34px; border-radius:5px; object-fit:cover; background:#0a0c10; flex:0 0 auto; }
  .rkey { flex:0 0 36%; min-width:120px; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .rkey:hover { color:var(--acc); }
  .bar { flex:1; height:8px; background:#0e1117; border-radius:5px; overflow:hidden; min-width:60px; }
  .bar span { display:block; height:100%; background:var(--acc); border-radius:5px; }
  .rn { flex:0 0 auto; width:66px; text-align:right; font-variant-numeric:tabular-nums; font-size:13px; }
  .srow.zero .rn { color:#7a8190; }
  .srow.zero .bar span { background:#39414f; }
  .rkey, .rthumb, .dthumb { cursor:pointer; }

  /* 라이트박스 (갤러리 + 통계 팝업 공용) */
  .lb { position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; }
  .lb[hidden] { display:none; }
  .lb-bg { position:absolute; inset:0; background:rgba(0,0,0,0.84); }
  .lb-fig { position:relative; margin:0; max-width:min(92vw,980px); display:flex; flex-direction:column; gap:10px; align-items:center; }
  .lb-img { max-width:100%; max-height:78vh; object-fit:contain; border-radius:10px; background:#0a0c10; }
  .lb-cap { display:flex; align-items:center; justify-content:center; gap:10px; color:var(--fg); font-size:13px; flex-wrap:wrap; }
  .lb-name { font-weight:600; }
  .lb-cnt { color:var(--mut); font-family:var(--mono); font-size:12px; }
  .lb-open { color:var(--mut); font-size:12px; border:1px solid var(--line); border-radius:999px; padding:4px 12px; }
  .lb-open:hover { color:var(--acc); border-color:var(--acc); }
  .lb-x { position:absolute; top:12px; right:16px; z-index:2; background:none; border:0; color:#fff; font-size:30px; cursor:pointer; line-height:1; padding:4px 8px; }
  .lb-prev, .lb-next { position:absolute; top:50%; transform:translateY(-50%); z-index:2; background:rgba(20,20,22,0.7); border:1px solid var(--line); color:var(--fg); width:42px; height:42px; border-radius:50%; font-size:22px; cursor:pointer; line-height:1; }
  .lb-prev { left:12px; } .lb-next { right:12px; }
  .lb-prev:hover, .lb-next:hover { border-color:var(--acc); color:var(--acc); }
  .lb-img { transition:opacity .15s; }
  .lb.loading .lb-img { opacity:.35; }
  /* 방문 추이 + 인기 갤러리 */
  .tbox { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:14px; }
  .thead { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin-bottom:10px; font-size:14px; }
  .thead .muted { font-size:12px; }
  .tlabel { font-size:12px; color:var(--mut); margin:2px 0 6px; }
  .tchart { display:flex; align-items:flex-end; gap:2px; height:120px; border-bottom:1px solid var(--line); }
  .tchart.small { height:72px; }
  .tchart .b { flex:1; min-width:1px; height:100%; display:flex; align-items:flex-end; }
  .tchart .b span { display:block; width:100%; background:var(--acc); border-radius:4px 4px 0 0; }
  .tchart .b:hover span { background:#ffa35c; }
  .taxis { position:relative; height:16px; margin:4px 0 14px; font-size:11px; color:var(--mut); font-family:var(--mono); }
  .taxis i { position:absolute; font-style:normal; transform:translateX(-50%); white-space:nowrap; }
  .tgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; }
  .hrow { display:flex; align-items:center; gap:8px; font-size:13px; padding:3px 0; }
  .hrow .hk { flex:0 0 74px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .hrow .hb { flex:1; height:8px; background:#0e1117; border-radius:4px; overflow:hidden; }
  .hrow .hb span { display:block; height:100%; background:var(--acc); border-radius:0 4px 4px 0; }
  .hrow .hn { flex:0 0 auto; min-width:86px; text-align:right; font-variant-numeric:tabular-nums; color:var(--mut); font-size:12px; }
  .ttip { position:fixed; z-index:200; pointer-events:none; background:#1d1d21; border:1px solid var(--line); border-radius:6px; padding:4px 8px; font-size:12px; color:var(--fg); white-space:nowrap; }
  .pgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
  .ptile { margin:0; position:relative; background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
  .ptile.zero { opacity:.5; }
  .pimg { width:100%; aspect-ratio:1/1; object-fit:cover; display:block; background:#0a0c10; cursor:pointer; }
  .prank { position:absolute; top:6px; left:6px; background:rgba(10,10,11,.8); color:var(--fg); font:600 11px var(--mono); border-radius:999px; padding:2px 8px; }
  .ptile figcaption { display:flex; justify-content:space-between; align-items:baseline; gap:6px; padding:6px 8px 4px; font-size:12px; }
  .pname { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .pn { flex:0 0 auto; font-weight:700; font-variant-numeric:tabular-nums; }
  .ptile .bar { margin:0 8px 8px; height:4px; min-width:0; }
  .more { display:block; margin:14px auto 0; background:#222732; color:var(--fg); border:1px solid var(--line); }
