/* Layout: one phone-width column (max 520px), fixed bottom bar with a pink "sphere" add button, bottom sheet for adding */
:root{
  --bg:#EBEBE9; --surface:#F7F7F5; --sunk:#DEDEDB; --ink:#2A2A2C; --mute:#5E5E62; --line:#D3D3D0;
  --pink:#EDBFC6; --pink-strong:#D98C9C; --on-pink:#2A2A2C; --mark:#F2CCD2; --danger:#A3303F; --ok:#2F6B4A; --scrim:rgba(30,30,32,.38);
  --sans:'IBM Plex Sans KR',system-ui,-apple-system,'Apple SD Gothic Neo','Malgun Gothic',sans-serif;
  --mono:'IBM Plex Mono',ui-monospace,'SFMono-Regular',Menlo,monospace;
  --tabh:calc(70px + env(safe-area-inset-bottom,0px));
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root{
  --bg:#1D1D1F; --surface:#29292C; --sunk:#333336; --ink:#ECECEA; --mute:#A4A4A8; --line:#3B3B3F;
  --pink:#E6B1BA; --pink-strong:#E6B1BA; --on-pink:#1D1D1F; --mark:#6B4148; --danger:#F08A97; --ok:#8FD1AC; --scrim:rgba(0,0,0,.55); color-scheme:dark}}

html,body{background:var(--bg);margin:0;height:100%;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%;touch-action:manipulation}
body{position:fixed;inset:0;width:100%}
#scroller{position:fixed;left:0;right:0;top:0;bottom:var(--tabh);overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding-top:env(safe-area-inset-top,0px)}
body.gate #scroller{bottom:0}
button,a,.tab,.addbtn{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}
body{color:var(--ink);font-family:var(--sans);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}
img{max-width:100%}
[hidden]{display:none!important}
button,input,textarea,select{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.wrap{max-width:520px;margin:0 auto;padding-inline:20px;padding-block:16px 48px;display:flex;flex-direction:column;gap:22px}
body.gate .wrap{padding-block:16px 40px}
body.gate .tabbar{display:none}
.top{display:flex;align-items:center;justify-content:space-between;min-height:48px;gap:8px}
.logo{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:600;letter-spacing:-.02em;line-height:1}
.logo span{display:block;line-height:1;padding-top:2px}
.iconbtn{width:44px;height:44px;flex:0 0 44px;border-radius:22px;border:1px solid var(--line);background:transparent;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--ink);position:relative}
.iconbtn.bare{border-color:transparent}
.iconbtn .ping{position:absolute;top:8px;right:8px;width:8px;height:8px;border-radius:4px;background:var(--pink)}
.eyebrow{font-family:var(--mono);font-size:12px;color:var(--mute);letter-spacing:.04em}
.headline{margin:6px 0 0;font-size:26px;line-height:1.32;font-weight:500;letter-spacing:-.02em;text-wrap:balance}
.headline b{font-weight:600}
.searchbar{display:flex;align-items:center;gap:10px;height:52px;width:100%;border:0;border-radius:26px;background:var(--surface);padding-inline:18px;color:var(--mute);cursor:pointer;text-align:left}
.searchbar svg{color:var(--ink)}
.section{display:flex;flex-direction:column;gap:12px}
.sec-head{display:flex;justify-content:space-between;align-items:center}
.sec-head h2{margin:0;font-size:16px;font-weight:600}
.textbtn{background:none;border:0;color:var(--mute);font-size:13px;min-height:44px;padding:0 4px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}
.textbtn.danger{color:var(--danger)}

.folders{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.fcard{min-height:72px;border-radius:18px;background:var(--surface);padding:12px 16px;display:flex;flex-direction:column;justify-content:space-between;gap:10px;border:1px solid transparent;text-align:left;cursor:pointer}
.fcard.picked{border:1.5px solid var(--ink)}
.fchk{width:22px;height:22px;border-radius:11px;border:1.5px solid var(--mute);display:flex;align-items:center;justify-content:center;color:var(--bg)}
.fchk.on{background:var(--ink);border-color:var(--ink)}
.fchk{flex:none}
.fcard > span:only-child{margin-top:auto}
.row.picked{background:var(--surface)}
.row .fchk{margin-left:4px}
.thumb img{-webkit-touch-callout:none;pointer-events:none}
.row{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.selbar{position:sticky;bottom:12px;box-shadow:0 10px 30px rgba(0,0,0,.12)}
.fcard.add{background:transparent;border:1px solid var(--line);color:var(--mute);justify-content:center;align-items:center;flex-direction:row;gap:8px}
.fcard.form{grid-column:1/-1;cursor:default;background:var(--surface);min-height:0}
.badge{align-self:flex-start;font-family:var(--mono);font-size:10px;font-weight:500;padding:3px 8px;border-radius:10px;background:var(--pink);color:var(--on-pink);white-space:nowrap}
.badge.plain{background:var(--sunk);color:var(--ink)}
.dot{width:10px;height:10px;border-radius:5px;background:var(--ink)}
.dot.pink{background:var(--pink)}
.fname{font-size:15px;font-weight:600;overflow-wrap:anywhere}
.fcount{font-family:var(--mono);font-size:12px;color:var(--mute);font-variant-numeric:tabular-nums}

.list{display:flex;flex-direction:column}
.row{display:flex;gap:14px;align-items:center;padding:11px 0;border:0;border-top:1px solid var(--line);background:none;width:100%;text-align:left;cursor:pointer}
.thumb{flex:0 0 60px;height:60px;border-radius:14px;background:var(--surface);overflow:hidden;display:flex;align-items:center;justify-content:center;color:var(--mute)}
.thumb img{width:100%;height:100%;object-fit:cover;object-position:top;display:block}
.rbody{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.rt{font-size:15px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rs{font-size:13px;color:var(--mute);line-height:1.45;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.rm{font-family:var(--mono);font-size:11px;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
mark{background:var(--mark);color:var(--ink);border-radius:4px;padding:0 2px}

.empty{background:var(--surface);border-radius:24px;padding:24px 22px;display:flex;flex-direction:column;gap:14px;align-items:flex-start}
.empty p{margin:0;color:var(--mute);font-size:14px}
.empty h3{margin:0;font-size:17px;font-weight:600}
.empty.first{padding:18px 20px 16px;gap:6px}
.empty.first p{line-height:1.55}
.empty .erow{display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;margin-top:8px}
#sheet.touring{align-items:flex-start}
#sheet.touring .panel{max-height:calc(100% - var(--tgap,260px))}

.btn{height:52px;border-radius:26px;border:0;background:var(--ink);color:var(--bg);font-weight:500;font-size:15px;padding:0 22px;display:inline-flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;text-decoration:none}
.btn.pink{background:var(--pink);color:var(--on-pink)}
.btn.outline{background:transparent;color:var(--ink);border:1px solid var(--line)}
.btn.danger{background:var(--danger);color:var(--bg)}
.btn.sm{height:44px;border-radius:22px;font-size:14px;padding:0 16px}
.btn:disabled{opacity:.5;cursor:default}
.btn.wide{width:100%}

.hero{display:flex;flex-direction:column;align-items:flex-start;gap:18px;padding-top:8vh}
.hero h1{margin:0;font-size:30px;line-height:1.3;font-weight:500;letter-spacing:-.02em;text-wrap:balance}
.hero p{margin:0;color:var(--mute);font-size:15px}

.tabbar{position:fixed;left:0;right:0;bottom:0;height:var(--tabh);z-index:5;background:var(--surface);border-top:1px solid var(--line);padding:8px 16px env(safe-area-inset-bottom,0px);transform:translateZ(0)}
.tabs{max-width:520px;margin:0 auto;display:flex;justify-content:space-around;align-items:center}
.tab{width:64px;height:52px;border:0;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--mute);cursor:pointer;font-size:11px}
.tab[aria-current="page"]{color:var(--ink);font-weight:600}
.addbtn{width:62px;height:62px;border-radius:31px;border:0;background:var(--pink);color:var(--on-pink);margin-top:-30px;box-shadow:0 0 0 6px var(--bg);display:flex;align-items:center;justify-content:center;cursor:pointer}

.shot{border-radius:24px;background:var(--surface);overflow:hidden;display:flex;justify-content:center;min-height:120px;align-items:center}
.shot img{display:block;width:100%;max-height:70vh;object-fit:contain}
.seg{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;border-radius:24px;background:var(--sunk)}
.seg button{height:40px;border-radius:20px;border:0;background:transparent;cursor:pointer;font-size:14px;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.pill{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 16px;border-radius:22px;background:var(--surface);border:1px solid var(--line);font-size:13px;width:100%;color:var(--ink)}
.seg button[aria-selected="true"]{background:var(--surface);font-weight:600}
.dtitle{margin:0;font-size:22px;font-weight:600;letter-spacing:-.02em;line-height:1.35;text-wrap:balance;overflow-wrap:anywhere}
.bul{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px;font-size:15px;line-height:1.6}
.bul li{display:flex;gap:10px}
.bul li::before{content:"";flex:0 0 6px;height:6px;margin-top:9px;border-radius:3px;background:var(--ink)}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{font-size:12px;padding:6px 11px;border-radius:14px;background:var(--surface);border:0;cursor:pointer;min-height:32px}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.raw{white-space:pre-wrap;background:var(--surface);border-radius:18px;padding:16px;font-size:14px;line-height:1.75;overflow-wrap:anywhere;margin:0;font-family:var(--sans)}
.code{white-space:pre;background:var(--bg);border-radius:14px;padding:14px;font-family:var(--mono);font-size:12px;line-height:1.6;overflow-x:auto;margin:0}
.meta{display:flex;flex-direction:column;border-top:1px solid var(--line)}
.mrow{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:50px;border-bottom:1px solid var(--line);font-size:14px}
.mrow .v{font-family:var(--mono);font-size:12px;color:var(--mute);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.mrow a{color:var(--ink);display:flex;align-items:center;gap:8px;min-width:0;text-decoration:none}
.mrow a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sel{height:40px;border-radius:20px;border:1px solid var(--line);background:var(--surface);padding:0 12px;max-width:60%;font-size:16px}
input,textarea,select{font-size:16px}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.actions .btn{flex:1 1 140px}
.confirm{background:var(--surface);border-radius:20px;padding:16px;display:flex;flex-direction:column;gap:12px}
.confirm p{margin:0;font-size:14px}

.field{display:flex;flex-direction:column;gap:6px}
.field label,.flabel{font-family:var(--mono);font-size:11px;color:var(--mute);letter-spacing:.05em}
.inp{width:100%;border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:12px 14px;font-size:16px;min-height:46px}
.card .inp{background:var(--bg)}
textarea.inp{resize:vertical;line-height:1.6}
.hint{font-size:12px;color:var(--mute);margin:0}
.note{font-size:13px;padding:12px 14px;border-radius:14px;background:var(--sunk);margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.note.err{color:var(--danger)}
.note.ok{color:var(--ok)}
.card{background:var(--surface);border-radius:22px;padding:18px;display:flex;flex-direction:column;gap:14px}
.card h2{margin:0;font-size:16px;font-weight:600}
.card p{margin:0;font-size:13px;color:var(--mute)}
.card a{color:var(--ink)}
.acct{display:flex;align-items:center;gap:12px;min-width:0}
.avatar{flex:0 0 40px;height:40px;border-radius:20px;background:var(--pink);color:var(--on-pink);display:flex;align-items:center;justify-content:center;font-weight:600;overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover}
.acct .rbody span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.steps{margin:0;padding-left:20px;font-size:14px;color:var(--ink);display:flex;flex-direction:column;gap:8px}
.steps b{font-weight:600}

.sheet{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:var(--scrim);padding:calc(16px + env(safe-area-inset-top,0px)) 16px calc(16px + env(safe-area-inset-bottom,0px));overscroll-behavior:contain;touch-action:none}
.sheet .panel{touch-action:pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.panel{width:100%;max-width:520px;max-height:100%;overflow-y:auto;background:var(--bg);border-radius:28px;padding:20px 20px 24px;display:flex;flex-direction:column;gap:18px;box-shadow:0 24px 60px rgba(0,0,0,.18)}
.grab{width:40px;height:4px;border-radius:2px;background:var(--line);align-self:center}
.shead{display:flex;align-items:center;justify-content:space-between}
.shead h2{margin:0;font-size:17px;font-weight:600}
.drop{border:1.5px dashed var(--mute);border-radius:22px;padding:28px 18px;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;color:var(--mute);font-size:14px}
.drop.over{background:var(--surface)}
.pv{display:flex;gap:14px;align-items:center}
.pv .thumb{flex-basis:76px;height:96px;border-radius:16px}
.thumb{position:relative}
.kb{position:absolute;left:4px;bottom:4px;font:600 9px/1 var(--mono);letter-spacing:.04em;padding:3px 5px;border-radius:6px;background:var(--ink);color:var(--bg);pointer-events:none}
.panel > *{flex-shrink:0}
.strip{display:flex;gap:8px;overflow-x:auto;padding:2px;margin:-2px;scrollbar-width:none}
.pv .rbody{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.pv .hint{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pv .actions{gap:8px;flex-wrap:nowrap}
.pv .actions .btn{flex:0 0 auto;height:38px;padding:0 14px;font-size:13px}
.strip::-webkit-scrollbar{display:none}
.tile{position:relative;flex:0 0 54px;height:68px;border-radius:14px;border:1.5px solid var(--line);background:var(--surface);padding:0;overflow:hidden;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--mute)}
.tile.on{border:2px solid var(--ink)}
.tile img{width:100%;height:100%;object-fit:cover;object-position:top;display:block;pointer-events:none}
.tile .tnum{position:absolute;left:4px;top:4px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:var(--ink);color:var(--bg);font:500 11px/18px var(--mono);text-align:center}
.tile .tbusy{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb, var(--surface) 65%, transparent)}
.tile .twarn{position:absolute;right:5px;top:5px;width:9px;height:9px;border-radius:5px;background:var(--danger)}
.tile.add{border-style:dashed;flex-direction:column;gap:2px;font:500 11px/1 var(--mono)}
.fileline{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:18px;background:var(--surface)}
.fileline .ficon{flex:0 0 40px;height:40px;border-radius:12px;background:var(--pink);color:var(--on-pink);display:flex;align-items:center;justify-content:center}
.fileline .fbody{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.fileline .fn{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500}
.fileline .fm{font-size:12px;color:var(--mute);font-family:var(--mono)}
.opts{display:flex;flex-direction:column;gap:8px}
.opt{display:flex;align-items:center;gap:12px;min-height:58px;padding:10px 16px;border-radius:18px;border:1px solid var(--line);background:transparent;text-align:left;cursor:pointer;width:100%}
.opt[aria-checked="true"]{border:1.5px solid var(--ink);background:var(--surface)}
.radio{flex:0 0 20px;height:20px;border-radius:10px;border:1.5px solid var(--ink);display:flex;align-items:center;justify-content:center}
.opt[aria-checked="true"] .radio::after{content:"";width:10px;height:10px;border-radius:5px;background:var(--ink)}
.obody{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.oname{font-size:15px;font-weight:500;overflow-wrap:anywhere}
.odesc{font-size:12px;color:var(--mute)}
.thinking{display:flex;flex-direction:column;align-items:center;gap:12px;padding:26px 0;text-align:center;color:var(--ink)}
.thinking p{margin:0;font-size:14px;color:var(--mute)}
.spin{animation:spin 2.4s linear infinite;transform-origin:50% 50%}
@keyframes spin{to{transform:rotate(360deg)}}
.spinner{flex:none;display:block;animation:spin .9s linear infinite;transform-origin:50% 50%}
@media (prefers-reduced-motion: reduce){.spinner{animation-duration:2.4s}}
.answer{background:var(--surface);border-radius:20px;padding:16px 18px;display:flex;flex-direction:column;gap:10px}
.answer p{margin:0;font-size:14px;line-height:1.7;white-space:pre-wrap}
details summary{cursor:pointer;font-size:13px;color:var(--mute);min-height:36px;display:flex;align-items:center}

.toast{position:fixed;left:50%;bottom:calc(100px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 18px;border-radius:20px;font-size:14px;z-index:30;max-width:calc(100% - 40px)}
.foot{display:flex;justify-content:center;padding-top:12px;opacity:.9}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* opening splash */
#splash{position:fixed;inset:0;z-index:100;background:#FFFFFF;display:flex;align-items:center;justify-content:center;transition:opacity .4s ease}
#splash svg{animation:splashIn .7s ease both}
#splash.out{opacity:0;pointer-events:none}
@keyframes splashIn{from{opacity:0;transform:translateY(6px) scale(.96)}to{opacity:1;transform:none}}
@media (prefers-color-scheme: dark){#splash{background:#1D1D1F}}
@media (prefers-reduced-motion: reduce){#splash svg{animation:none}}

/* usage guide (coach marks) */
#tour{position:fixed;inset:0;z-index:60}
#tour .hole{position:fixed;border-radius:20px;border:2px solid var(--pink-strong);box-shadow:0 0 0 9999px rgba(20,20,22,.42);transition:all .25s ease;pointer-events:none}
#tour .hole.none{border-color:transparent;left:50%;top:50%;width:0;height:0}
#tour .tcard{position:fixed;left:50%;transform:translateX(-50%);max-height:calc(100% - 28px);overflow-y:auto;width:min(360px, calc(100vw - 32px));background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:22px 22px 18px;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;box-shadow:0 18px 50px rgba(0,0,0,.18)}
#tour .tstep{font-family:var(--mono);font-size:12px;color:var(--mute);letter-spacing:.12em}
#tour .ttitle{margin:0;font-size:18px;font-weight:600;letter-spacing:-.01em}
#tour .tdesc{margin:0;font-size:14px;line-height:1.65;color:var(--mute);text-wrap:balance}
#tour .tdots{display:flex;gap:6px;margin:6px 0 4px}
#tour .tdots span{width:14px;height:4px;border-radius:2px;background:var(--line)}
#tour .tdots span.on{width:22px;background:var(--ink)}
#tour .tfoot{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:4px}
#tour .tnext{height:44px;min-width:96px;border-radius:12px;border:0;background:var(--ink);color:var(--bg);font-size:14px;font-weight:500;padding:0 18px;cursor:pointer}
.banner{display:flex;align-items:center;gap:12px;padding:12px 14px 12px 16px;border-radius:18px;background:var(--surface);border:1px solid var(--line)}
.banner{flex-wrap:wrap}
.banner p{margin:0;flex:1 1 180px;font-size:13px;line-height:1.5;color:var(--mute)}
.banner p b{color:var(--ink);font-weight:600}

/* utility classes: no inline style attributes, so the CSP can block them */
.u-svg{display:block;flex:0 0 auto}
.col{flex-direction:column}
.top.home{padding-top:14px;align-items:flex-end}
.m0{margin:0}
.mt-n8{margin-top:-8px}
.mt6{margin-top:6px}
.row4{display:flex;gap:4px}
.row10{display:flex;align-items:center;gap:10px}
.tc{text-align:center}
.as{align-self:flex-start}
.grow{flex:1;min-width:0}
.ctext{cursor:text}
.qinp{flex:1;min-width:0;border:0;background:transparent;outline:none;font-size:16px;color:var(--ink)}
.ink{color:var(--ink)}
.fs15{font-size:15px;font-weight:500}
.bgbg{background:var(--bg)}
.section.g16{gap:16px}.section.g10{gap:10px}.section.g8{gap:8px}
.opt.dim{opacity:.5}
.fchk.bline{border-color:var(--line)}
#tour .tcard.measuring{top:0;visibility:hidden}
.textbtn.privacy{align-self:center;color:var(--mute);font-size:13px;text-decoration:underline;text-underline-offset:3px}
