:root{
  --gold:#d4af37; --gold-hover:#c19b2a; --gold-light:#f2d478;
  --bg:#f5f6f7; --bg-white:#fff; --bg-gray:#f8f9fa; --bg-highlight:#fffbf0;
  --border:#e5e5e5; --border-light:#f0f0f0;
  --text:#1e1e1e; --text-gray:#666; --text-light:#999;
  --red:#b91c1c;
  --font-sans:'Noto Sans KR',-apple-system,BlinkMacSystemFont,'Segoe UI','Malgun Gothic',sans-serif;
  --font-mono:'JetBrains Mono',Consolas,monospace;
}
body.dark{
  --bg:#161719; --bg-white:#1f2124; --bg-gray:#26282c; --bg-highlight:#2a2410;
  --border:#33363b; --border-light:#2b2e33;
  --text:#e8e8e8; --text-gray:#a0a0a0; --text-light:#777;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:var(--font-sans);background:var(--bg);color:var(--text);line-height:1.6;transition:background .25s,color .25s}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--gold);border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:var(--gold-hover)}
a{color:inherit;text-decoration:none}

/* Header */
header{position:sticky;top:0;z-index:100;background:var(--bg-white);border-bottom:1px solid var(--border);box-shadow:0 1px 3px rgba(0,0,0,.06)}
.hwrap{max-width:1000px;margin:0 auto;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.logo{display:flex;align-items:center;gap:9px;font-weight:700;font-size:1.05rem;color:var(--text)}
.logo svg{width:26px;height:26px;flex:0 0 auto}
.logo b{color:var(--gold)}
.logo span{color:var(--text-gray);font-weight:500;font-size:.92rem}
.hctl{display:flex;align-items:center;gap:6px}
.hbtn{border:1px solid var(--border);background:var(--bg-white);color:var(--text-gray);width:36px;height:36px;border-radius:9px;cursor:pointer;font-size:.85rem;display:flex;align-items:center;justify-content:center;transition:all .18s}
.hbtn:hover{border-color:var(--gold);color:var(--gold)}

/* Main */
main{max-width:820px;margin:0 auto;padding:44px 20px 80px}
.hero{text-align:center;margin-bottom:30px}
.hero h1{font-size:2rem;font-weight:700;letter-spacing:-.02em}
.hero h1 .g{color:var(--gold)}
.hero p{color:var(--text-gray);margin-top:10px;font-size:1rem}

.panel{background:var(--bg-white);border:1px solid var(--border);border-radius:16px;box-shadow:0 2px 8px rgba(0,0,0,.05);padding:22px}
.inrow{display:flex;gap:10px;flex-wrap:wrap}
.inrow input[type=text]{flex:1;min-width:220px;padding:14px 16px;border:1px solid var(--border);border-radius:11px;background:var(--bg-gray);color:var(--text);font-size:.98rem;font-family:var(--font-sans);outline:none;transition:border .18s,box-shadow .18s}
.inrow input[type=text]:focus{border-color:var(--gold);box-shadow:0 0 0 3px rgba(212,175,55,.15)}
.inwrap{position:relative;flex:1;min-width:220px;display:flex}
.inwrap input[type=text]{flex:1;min-width:0;padding-right:42px}
.clrBtn{position:absolute;right:8px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--text-light);font-size:1.4rem;line-height:1;cursor:pointer;padding:0;width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center}
.inwrap input[type=text]:placeholder-shown + .clrBtn{display:none}
.clrBtn:hover{background:var(--bg-gray);color:var(--text)}
.go{padding:14px 26px;border:none;border-radius:11px;background:linear-gradient(135deg,var(--gold),var(--gold-hover));color:#fff;font-weight:700;font-size:.98rem;cursor:pointer;transition:filter .18s,transform .05s;white-space:nowrap}
.go:hover{filter:brightness(1.06)}
.go:active{transform:translateY(1px)}
.go:disabled{opacity:.55;cursor:not-allowed;filter:none}
.go2{padding:14px 20px;border:1px solid var(--border);border-radius:11px;background:var(--bg-white);color:var(--text-gray);font-weight:500;font-size:.95rem;cursor:pointer;white-space:nowrap;transition:all .15s}
.go2:hover{border-color:var(--gold);color:var(--gold)}

.tabs{display:flex;gap:6px;margin:16px 0 0;flex-wrap:wrap}
.tab{padding:8px 16px;border-radius:20px;border:1px solid var(--border);background:var(--bg-white);color:var(--text-gray);font-size:.88rem;cursor:pointer;transition:all .18s}
.tab.on{background:var(--gold);border-color:var(--gold);color:#fff;font-weight:600}
.detail{display:flex;gap:5px;margin-top:10px}
.dbtn{padding:5px 13px;border-radius:8px;border:1px solid var(--border);background:var(--bg-white);color:var(--text-gray);font-size:.82rem;cursor:pointer;transition:all .15s}
.dbtn.on{background:var(--bg-highlight);border-color:var(--gold);color:var(--gold);font-weight:600}
.nojs{max-width:720px;margin:40px auto;padding:0 20px;font-family:sans-serif;line-height:1.7}

.hint{color:var(--text-light);font-size:.82rem;margin-top:12px;text-align:center}

/* history */
.history{margin-top:18px}
.hhead{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.hhead h5{font-size:.8rem;color:var(--text-light);font-weight:500}
.hclear{border:none;background:transparent;color:var(--text-light);font-size:.76rem;cursor:pointer;padding:2px 4px}
.hclear:hover{color:var(--red)}
.hlist{display:flex;flex-direction:column;gap:6px}
.hitem{display:flex;align-items:center;gap:10px;padding:7px 10px;border:1px solid var(--border-light);border-radius:9px;background:var(--bg-white);cursor:pointer;transition:all .15s}
.hitem:hover{border-color:var(--gold);background:var(--bg-highlight)}
.hitem img{width:52px;height:30px;object-fit:cover;border-radius:5px;flex:0 0 auto;background:var(--bg-gray)}
.hitem span{flex:1;font-size:.85rem;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hx{flex:0 0 auto;border:none;background:transparent;color:var(--text-light);font-size:1.15rem;line-height:1;cursor:pointer;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center}
.hx:hover{background:var(--bg-gray);color:var(--red)}
.hextra{display:none}
.hlist.open .hextra{display:flex}
.hleft{display:flex;align-items:center;gap:10px}
.htoggle{border:none;background:transparent;color:var(--gold);font-size:.78rem;font-weight:500;cursor:pointer;padding:0}
.htoggle:hover{text-decoration:underline}

/* Result */
.result{margin-top:22px;display:none}
.result.show{display:block}
.rcard{background:var(--bg-white);border:1px solid var(--border);border-radius:16px;padding:26px 26px 20px;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.rhead{font-family:var(--font-mono);font-size:.78rem;letter-spacing:.04em;color:var(--gold);margin-bottom:14px;min-height:1.1em}
.rhead span{display:inline-block;white-space:pre}
.vcard{display:flex;gap:14px;align-items:center;margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid var(--border-light)}
.vcard img{width:120px;height:68px;object-fit:cover;border-radius:9px;flex:0 0 auto;background:var(--bg-gray)}
.vcard .vtitle{font-weight:600;font-size:.98rem;line-height:1.4}
.vcard .vmeta{font-size:.82rem;color:var(--text-light);margin-top:4px;font-family:var(--font-mono)}
.rbody h3{font-size:1.02rem;margin:18px 0 8px;color:var(--text);border-left:3px solid var(--gold);padding-left:10px}
.rbody h3:first-child{margin-top:0}
.rbody h4{font-size:.94rem;margin:14px 0 6px;color:var(--text-gray);font-family:var(--font-mono)}
.rbody ul{margin:0 0 6px;padding-left:20px}
.rbody li{margin:5px 0}
.rbody p{margin:8px 0}
.rbody strong{color:var(--text);font-weight:600}
.rbody code,.ts{font-family:var(--font-mono);font-size:.86rem}
.rbody.tscript{max-height:440px;overflow-y:auto;padding-right:8px}
.rbody.tscript p{margin:5px 0;font-size:.9rem}
a.jump{color:var(--gold);font-family:var(--font-mono);font-weight:500;border-bottom:1px dashed var(--gold)}
a.jump:hover{background:var(--bg-highlight)}
.ractions{display:flex;gap:8px;margin-top:18px;padding-top:16px;border-top:1px solid var(--border-light);flex-wrap:wrap}
.ractions.top{margin-top:0;padding-top:0;border-top:none;margin-bottom:14px}
.raction{padding:8px 14px;border:1px solid var(--border);background:var(--bg-white);color:var(--text-gray);border-radius:9px;font-size:.84rem;cursor:pointer;transition:all .18s}
.raction:hover{border-color:var(--gold);color:var(--gold)}
.raction.accent{border-color:var(--gold);color:var(--gold);font-weight:600}
.raction.accent:hover{background:var(--gold);color:#fff}

/* loading */
.spin{width:34px;height:34px;border:3px solid var(--border);border-top-color:var(--gold);border-radius:50%;animation:sp .8s linear infinite;margin:8px auto}
@keyframes sp{to{transform:rotate(360deg)}}
.loading{text-align:center;color:var(--text-gray);padding:20px}
.err{color:var(--red);text-align:center;padding:16px;font-size:.92rem}

@keyframes revealChar{0%{color:var(--bg-white)}40%{color:var(--red)}100%{color:var(--gold)}}

/* Footer */
footer{background:var(--bg-white);border-top:1px solid var(--border);color:var(--text-light);font-size:.85rem}
.fwrap{max-width:1000px;margin:0 auto;padding:22px 20px;text-align:center}
.fwrap nav{display:flex;flex-wrap:wrap;gap:10px 16px;justify-content:center;margin-bottom:10px}
.fwrap nav a:hover{color:var(--gold)}

/* embed mode */
body.embed header,body.embed footer{display:none}
body.embed main{padding-top:22px}

@media(max-width:600px){
  .hero h1{font-size:1.6rem}
  .go{width:100%}
  main{padding:30px 16px 60px}
  .vcard img{width:96px;height:54px}
}
