*{box-sizing:border-box}
:root{
  --bg:#f5f5f2;
  --card:#ffffff;
  --text:#171918;
  --muted:#777c78;
  --line:#e5e7e3;
  --accent:#72d54a;
  --accent-dark:#4ca72d;
  --dark:#171918;
  --danger:#c84d4d;
}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}
body{overscroll-behavior-y:none}
button,input{font:inherit}
button{touch-action:manipulation}
main{min-height:100svh}
.screen{min-height:100svh;padding:calc(22px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom))}
.pin-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;max-width:430px;margin:auto}
.brand{text-align:center}
.brand img{width:84px;height:84px;border-radius:23px;display:block;margin:0 auto 14px}
.brand h1{margin:0;font-size:30px;letter-spacing:-.7px}
.brand p{margin:6px 0 0;color:var(--muted)}
.language{margin:18px 0 26px;display:flex;gap:9px;align-items:center;font-size:14px;color:var(--muted)}
.lang{border:0;background:none;padding:3px;color:var(--muted);font-weight:700;cursor:pointer}
.lang.active{color:var(--text)}
.pin-screen h2{font-size:22px;margin:0;text-align:center}
.hint{color:var(--muted);font-size:14px;text-align:center;margin:8px 0 16px}
.pin-dots{display:flex;gap:13px;margin:18px 0 10px}
.pin-dot{width:13px;height:13px;border-radius:50%;border:1.5px solid #aeb2ae;background:transparent}
.pin-dot.filled{background:var(--dark);border-color:var(--dark)}
.error{height:20px;color:var(--danger);font-size:13px;text-align:center;margin-bottom:8px}
.keypad{display:grid;grid-template-columns:repeat(3,78px);gap:10px;margin:4px 0 18px}
.keypad button{height:58px;border:0;border-radius:17px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.08);font-size:22px;font-weight:600;color:var(--text)}
.keypad button:active{transform:scale(.97)}
.empty-key{visibility:hidden}
.delete-key{font-size:20px!important}
.primary{width:100%;max-width:252px;border:0;border-radius:15px;padding:14px 20px;background:var(--dark);color:white;font-weight:700;cursor:pointer}
.primary:disabled{opacity:.35;cursor:default}
.app-screen{max-width:720px;margin:auto}
.app-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
.header-brand{display:flex;align-items:center;gap:10px}
.header-brand img{width:42px;height:42px;border-radius:12px}
.header-brand strong{display:block;font-size:20px}
.header-brand small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.header-actions{display:flex;gap:6px}
.header-actions button{width:40px;height:40px;border:0;border-radius:12px;background:#fff;color:var(--text);font-size:22px}
.list-tabs{display:flex;gap:8px;overflow-x:auto;padding-bottom:5px;margin-bottom:12px}
.list-tab{flex:0 0 auto;border:1px solid var(--line);background:#fff;border-radius:14px;padding:10px 16px;color:var(--muted);font-weight:700}
.list-tab.active{background:var(--dark);color:#fff;border-color:var(--dark)}
.add-card,.list-card{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:15px;margin-bottom:12px}
#itemName{width:100%;border:0;outline:0;font-size:18px;padding:8px 2px 13px;background:transparent}
.add-row{display:flex;gap:8px;border-top:1px solid var(--line);padding-top:12px}
.add-row input{width:85px;border:1px solid var(--line);border-radius:12px;padding:10px 11px;outline:none}
.add-row .primary{max-width:none;flex:1;padding:10px 14px}
.list-toolbar{display:flex;justify-content:space-between;align-items:center;font-weight:800;margin-bottom:8px}
.text-button{border:0;background:none;color:var(--muted);font-size:12px;padding:4px}
.item{display:flex;align-items:center;gap:11px;padding:13px 2px;border-top:1px solid var(--line)}
.check{width:27px;height:27px;border-radius:50%;border:1.5px solid #b7bbb7;background:white;flex:0 0 auto;color:white;font-weight:900}
.item.done .check{background:var(--accent-dark);border-color:var(--accent-dark)}
.item-body{min-width:0;flex:1}
.item-name{font-size:16px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item.done .item-name{text-decoration:line-through;color:var(--muted)}
.item-meta{font-size:12px;color:var(--muted);margin-top:3px}
.delete{border:0;background:none;color:#a4a8a4;font-size:25px;padding:4px 6px}
.empty{padding:30px 10px;text-align:center;color:var(--muted)}
.total-row{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:13px;margin-top:4px;font-size:14px}
.total-row strong{font-size:17px}
@media(max-width:380px){
  .keypad{grid-template-columns:repeat(3,70px)}
  .keypad button{height:55px}
}
