:root{
  --base:#00C4CC; --accent:#E01D5A; --yellow:#FFCD00;
  --text:#1A1D1F; --sub:#6B7176; --muted:#4A5056; --line:#EEF0F1; --chip:#F3F4F5; --border:#DADDE0;
  --teal-text:#00737A; --red-text:#C8174F; --yellow-text:#8A6A00;
  --safe-top:env(safe-area-inset-top); --safe-bottom:env(safe-area-inset-bottom);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:#fff;color:var(--text);font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Hiragino Kaku Gothic ProN',system-ui,sans-serif;-webkit-font-smoothing:antialiased}
button,input,textarea{font-family:inherit;font-size:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--teal-text)}
.screen{min-height:100vh;padding-bottom:calc(120px + var(--safe-bottom));max-width:560px;margin:0 auto}
.screen.gray{background:#F5F6F7}

/* header */
.hdr{position:sticky;top:0;z-index:5;background:inherit;padding:calc(12px + var(--safe-top)) 16px 8px;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center}
.screen.gray .hdr{background:#F5F6F7}
.screen:not(.gray) .hdr{background:#fff}
.hdr.top{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
.hdr h1{margin:0;text-align:center;font-size:16px;font-weight:700}
.hdr .right{justify-self:end;display:flex;gap:8px}
.hdr .text-btn{background:none;border:none;height:44px;padding:0 8px;font-size:15px;color:var(--muted);justify-self:start;white-space:nowrap}
.icon-btn{position:relative;width:44px;height:44px;border-radius:22px;border:none;background:var(--chip);display:flex;align-items:center;justify-content:center;padding:0}
.gray .icon-btn{background:#fff}
.logo{width:44px;height:44px;border-radius:12px;display:block;object-fit:cover}
.badge{position:absolute;top:2px;right:2px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:var(--accent);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;border:2px solid #fff}

/* chips */
.chips{padding:12px 20px 4px;display:flex;align-items:center;gap:8px;overflow-x:auto}
.chip{height:34px;padding:0 14px;border-radius:17px;border:1px solid var(--border);background:#fff;color:var(--muted);font-size:13px;font-weight:500;display:flex;align-items:center;gap:6px;white-space:nowrap;flex-shrink:0}
.chip.on{background:var(--base);border-color:var(--base);color:#fff;font-weight:700}
.chip .count{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--accent);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center}
.chips .sep{width:1px;height:20px;background:#E3E5E7;margin:0 4px;flex-shrink:0}

/* list */
.list{padding:0 20px}
.row-wrap{position:relative;overflow:hidden;border-bottom:1px solid var(--line)}
.row-bg{position:absolute;inset:0;background:var(--base);color:#fff;display:flex;align-items:center;padding-left:20px;font-weight:700;gap:8px}
.row{position:relative;background:#fff;display:flex;gap:14px;padding:14px 0;transition:transform .2s ease;touch-action:pan-y}
.thumb{width:76px;height:76px;flex-shrink:0;border-radius:16px;background:var(--chip);display:flex;align-items:center;justify-content:center;overflow:hidden}
.thumb img{width:100%;height:100%;object-fit:contain;background:#fff}
.thumb.lg{width:112px;height:112px;border-radius:20px}
.info{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.name{font-size:16px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.date{font-size:13px;color:var(--sub)}
.left{font-weight:700}
.st-ok .left{color:var(--teal-text)} .st-alert .left{color:var(--yellow-text)} .st-over .left{color:var(--red-text)}
.gauge{height:8px;border-radius:4px;background:var(--line);overflow:hidden}
.gauge>div{height:100%;border-radius:4px;width:0;transition:width .7s cubic-bezier(.2,.8,.2,1)}
.st-ok .gauge>div{background:var(--base)} .st-alert .gauge>div{background:var(--yellow)} .st-over .gauge>div{background:var(--accent)}
.meta{display:flex;align-items:center;justify-content:space-between;min-height:32px}
.owner{font-size:12px;color:var(--muted);background:var(--chip);border-radius:10px;padding:3px 10px}
.buy{height:32px;padding:0 16px;border-radius:16px;border:none;background:var(--accent);color:#fff;font-size:13px;font-weight:700;display:flex;align-items:center;gap:4px;transition:transform .1s}
.buy:active,.btn:active,.fab:active{transform:scale(.96)}
.empty{padding:60px 24px;text-align:center;color:var(--sub);font-size:14px;line-height:1.8}
.fab{position:fixed;right:max(20px,calc(50% - 260px));bottom:calc(28px + var(--safe-bottom));width:60px;height:60px;border-radius:30px;border:none;background:var(--base);box-shadow:0 6px 16px rgba(0,196,204,.35);display:flex;align-items:center;justify-content:center;z-index:6;transition:transform .1s}
.check-pop{position:absolute;right:16px;top:50%;width:40px;height:40px;margin-top:-20px;border-radius:20px;background:var(--base);display:flex;align-items:center;justify-content:center;animation:pop .6s ease forwards}
@keyframes pop{0%{transform:scale(0)}40%{transform:scale(1.15)}70%{transform:scale(1)}100%{transform:scale(1);opacity:0}}

/* detail */
.d-head{padding:8px 20px 0;display:flex;gap:16px;align-items:center}
.d-head h2{margin:0;font-size:24px;font-weight:900;line-height:1.3;word-break:break-all}
.status{margin:20px 20px 0;padding:16px;border-radius:16px;display:flex;flex-direction:column;gap:10px}
.status.st-ok{background:#E3F8F9} .status.st-alert{background:#FFF7D6} .status.st-over{background:#FDE8EF}
.status .top{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.status .left{font-size:22px;font-weight:900}
.status .gauge{height:10px;background:#fff}
.btn-row{padding:16px 20px 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.btn{height:52px;border-radius:26px;border:none;font-size:16px;font-weight:700;display:flex;align-items:center;justify-content:center;gap:6px;transition:transform .1s}
.btn.accent{background:var(--accent);color:#fff}
.btn.base{background:var(--base);color:#fff}
.btn.outline{background:#fff;border:1.5px solid var(--base);color:var(--teal-text)}
.btn.wide{width:100%;height:56px;border-radius:28px;font-size:17px}
.btn.danger{background:#fff;color:var(--red-text);border:1px solid #F3C5D3}
.sec-title{margin:28px 20px 8px;font-size:13px;font-weight:700;color:var(--sub)}
.card{margin:0 20px;border-radius:16px;background:#F7F8F9;padding:0 16px}
.gray .card{background:#fff}
.kv{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid #ECEEF0;font-size:14px}
.kv:last-child{border-bottom:none}
.kv .k{color:var(--muted);flex-shrink:0}
.kv .v{font-weight:700;text-align:right;word-break:break-all}
.kv .v small{display:block;font-size:11px;font-weight:400;color:var(--sub)}
.hist{padding:0 20px}
.hrow{width:100%;background:none;border:none;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:14px 0;text-align:left}
.hrow .d{font-size:15px;font-weight:700}
.hrow .w{font-size:12px;color:var(--sub);margin-top:3px}
.hrow .g{font-size:13px;color:var(--muted);text-align:right}
.tag{margin-left:8px;font-size:11px;font-weight:700;color:#6B5300;background:#FFF5CC;border-radius:8px;padding:2px 8px}

/* form */
.form{padding:8px 20px 0;display:flex;flex-direction:column;gap:20px}
.field{display:flex;flex-direction:column;gap:6px}
.field>label,.field>.lbl{font-size:13px;font-weight:700;color:var(--muted)}
.req{color:var(--red-text)}
.input{height:48px;border-radius:12px;border:1px solid var(--border);padding:0 14px;font-size:16px;background:#fff;width:100%;outline:none;-webkit-appearance:none;appearance:none}
.input:focus{border:1.5px solid var(--base)}
textarea.input{height:84px;padding:12px 14px;resize:none}
.img-pick{width:112px;height:112px;align-self:center;border-radius:20px;border:1.5px dashed #C9CDD1;background:#F7F8F9;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--muted);font-size:12px;overflow:hidden;padding:0;position:relative}
.img-pick img{width:100%;height:100%;object-fit:contain;background:#fff}
.img-pick.has{border-style:solid;border-color:var(--line)}
.wrap{display:flex;gap:8px;flex-wrap:wrap}
.seg{display:grid;gap:4px;padding:4px;border-radius:14px;background:var(--chip)}
.seg button{height:40px;border-radius:10px;border:none;background:transparent;color:var(--muted);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.seg button.on{background:#fff;color:var(--text);font-weight:700;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.shake{animation:shake .4s}
@keyframes shake{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}

/* notifications */
.nrow{display:flex;gap:12px;padding:14px 0;border-bottom:1px solid var(--line);align-items:flex-start}
.avatar{width:44px;height:44px;flex-shrink:0;border-radius:22px;color:#fff;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:700}
.avatar.sm{width:40px;height:40px;border-radius:20px}
.nrow .t{font-size:15px;line-height:1.5}
.nrow .s{font-size:12px;color:var(--sub);margin-top:4px}
.dot{width:10px;height:10px;border-radius:5px;background:var(--accent);margin-top:8px;flex-shrink:0}

/* settings */
.mem{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.mem .f{flex:1;display:flex;flex-direction:column;gap:2px}
.mem label{font-size:11px;color:var(--sub)}
.mem input{border:none;padding:0;font-size:16px;font-weight:700;background:transparent;outline:none;width:100%}
.pill{font-size:11px;font-weight:700;color:var(--teal-text);background:#E3F8F9;border-radius:10px;padding:3px 8px;white-space:nowrap}
.stepper{display:flex;align-items:center;gap:12px}
.stepper button{width:36px;height:36px;border-radius:18px;border:none;background:var(--chip);font-size:20px;line-height:1;color:var(--text)}
.stepper span{min-width:44px;text-align:center;font-weight:700;font-size:15px}
.ver{margin:32px 0 0;font-size:12px;color:#80868B;text-align:center}

/* welcome */
body.teal{background:var(--base)}
.welcome{min-height:100vh;padding:calc(48px + var(--safe-top)) 28px calc(40px + var(--safe-bottom));display:flex;flex-direction:column;justify-content:center;gap:20px;max-width:480px;margin:0 auto}
.welcome .logo{width:160px;height:160px;border-radius:0;align-self:center;margin-bottom:24px}
.welcome .field label{font-size:13px;font-weight:700;color:#fff}
.welcome .input{border-color:#fff}
.welcome .w-go{background:#fff;color:#00737A}
.welcome .w-note{margin:12px 0 0;color:#fff;font-size:13px;line-height:1.7}
.pick{width:100%;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;border:1px solid var(--border);background:#fff;font-size:16px;font-weight:700}

/* toast & sheet */
#toast{position:fixed;left:50%;top:calc(12px + var(--safe-top));transform:translate(-50%,-160%);background:#1A1D1F;color:#fff;border-radius:14px;padding:12px 16px;font-size:14px;display:flex;align-items:center;gap:14px;z-index:50;transition:transform .3s ease;max-width:calc(100% - 32px)}
#toast.show{transform:translate(-50%,0)}
#toast button{background:none;border:none;color:#5FE3E8;font-weight:700;font-size:14px;padding:4px}
#sheet-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:40}
#sheet{position:fixed;left:0;right:0;bottom:0;z-index:41;background:#fff;border-radius:24px 24px 0 0;padding:12px 20px calc(24px + var(--safe-bottom));max-width:560px;margin:0 auto;transform:translateY(100%);transition:transform .25s ease}
#sheet.open{transform:translateY(0)}
#sheet .grab{width:40px;height:5px;border-radius:3px;background:#DADDE0;margin:0 auto 16px}
#sheet h3{margin:0 0 6px;font-size:18px;font-weight:900;text-align:center}
#sheet p{margin:0 0 18px;font-size:14px;color:var(--sub);text-align:center}
#sheet .stack{display:flex;flex-direction:column;gap:10px}
.btn.ghost{background:var(--chip);color:var(--muted)}
.skel{background:linear-gradient(90deg,#EEF0F1 25%,#F7F8F9 50%,#EEF0F1 75%);background-size:200% 100%;animation:sk 1.2s infinite}
@keyframes sk{to{background-position:-200% 0}}
.welcome .w-login{background:transparent;border:1.5px solid rgba(255,255,255,.9);color:#fff;height:48px;font-size:15px}
.w-legal{margin:8px 0 0;text-align:center;font-size:12px}
.w-legal a{color:#fff;text-decoration:underline}
.link-btn{border:none;background:none;padding:0;font-size:15px;font-weight:700;color:var(--teal-text);text-align:left}
.link-btn.danger{color:var(--red-text)}
