:root{
  --brand:#f36a2d;
  --brand-dark:#d8581f;
  --brand-soft:#fff4ed;
  --ink:#252525;
  --muted:#727272;
  --line:#e5e5e5;
  --page:#f5f5f5;
  --white:#fff;
  --danger:#c94b42;
  --radius:14px;
  --shadow:0 3px 12px rgba(0,0,0,.055);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;background:var(--page);color:var(--ink);
  font-family:"Yu Gothic UI","Yu Gothic",YuGothic,Meiryo,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-weight:400;line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
button,input,select{font:inherit}
button{cursor:pointer}
.app{width:min(760px,100%);margin:0 auto;min-height:100vh;background:#fff;box-shadow:0 0 18px rgba(0,0,0,.035)}
.header{padding:18px 17px 16px;background:#fff;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:12px}
.mark{width:52px;height:52px;border-radius:13px;overflow:hidden;flex:0 0 auto;border:1px solid #ddd;background:#fff}
.mark img{width:100%;height:100%;display:block;object-fit:cover}
.mochizaru-logo{position:relative;display:inline-flex;align-items:flex-end;width:max-content;margin:0;line-height:.98;letter-spacing:-.055em;
  font-family:"Hiragino Maru Gothic ProN","Hiragino Maru Gothic Pro","BIZ UDPGothic","Yu Gothic UI","Yu Gothic",YuGothic,Meiryo,sans-serif;
  font-size:34px;font-weight:900;font-synthesis:weight;text-rendering:optimizeLegibility}
.logo-mochi{color:#5a341d}
.logo-zaru{color:#ed7a12;margin-left:.02em}
.logo-paw{position:absolute;right:-16px;top:-4px;width:18px;height:17px;display:block}
.logo-paw::after{content:"";position:absolute;left:6px;top:8px;width:8px;height:7px;border-radius:58% 58% 50% 50%;background:#ed7a12;transform:rotate(-9deg)}
.logo-paw i{position:absolute;width:4px;height:5px;border-radius:50%;background:#ed7a12;display:block}
.logo-paw i:nth-child(1){left:0;top:5px;transform:rotate(-28deg)}
.logo-paw i:nth-child(2){left:4px;top:0}
.logo-paw i:nth-child(3){left:9px;top:0}
.logo-paw i:nth-child(4){left:14px;top:5px;transform:rotate(28deg)}
.brand-copy{min-width:0;display:flex;flex-direction:column;gap:2px}
.eyebrow{display:inline-flex;align-items:center;gap:8px;margin:0 0 2px;color:#c86637;font-size:10.5px;font-weight:800;letter-spacing:.055em}
.eyebrow::before{content:"";width:16px;height:2px;border-radius:999px;background:#f2b08a;box-shadow:none;flex:0 0 auto}
.lead{font-size:11.5px;color:#77706c;margin:2px 0 0;font-weight:500}
.pwa-status{display:inline-flex;align-items:center;gap:5px;font-size:10px;color:#8c8784;margin-top:4px}
.pwa-status::before{content:"";width:6px;height:6px;border-radius:50%;background:#69a579}
.main{padding:14px 13px 126px}
.summary{background:#262626;color:#fff;border-radius:16px;padding:17px;margin-bottom:13px;box-shadow:none;position:relative;overflow:hidden}
.summary::before,.summary::after{content:none}
.summary-top{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
.summary-label{font-size:11px;color:#cfcfcf;font-weight:400}
.summary-number{font-weight:700;font-size:29px;line-height:1.05;letter-spacing:-.02em}
.summary-unit{font-size:15px}
.summary-right{text-align:right}
.progress{display:block;width:100%;height:7px;border:0;border-radius:999px;overflow:hidden;margin:13px 0 6px;background:#444;appearance:none;-webkit-appearance:none}
.progress::-webkit-progress-bar{background:#444;border-radius:999px}
.progress::-webkit-progress-value{background:var(--brand);border-radius:999px;transition:width .2s}
.progress::-moz-progress-bar{background:var(--brand);border-radius:999px}
.progress-text{font-size:11px;color:#d0d0d0}
.card{border:1px solid var(--line);border-radius:var(--radius);background:#fff;padding:13px;box-shadow:none;margin-bottom:13px}
.add-row{display:grid;grid-template-columns:1fr 102px;gap:7px}
.input,.select{width:100%;height:44px;border:1px solid #d4d4d4;border-radius:10px;background:#fff;padding:0 11px;outline:none;color:var(--ink)}
.input::placeholder{color:#aaa}
.input:focus,.select:focus{border-color:var(--brand);box-shadow:0 0 0 2px rgba(243,106,45,.10)}
.add-btn{border:0;border-radius:10px;background:var(--brand);color:#fff;font-weight:700;padding:0 12px;box-shadow:none}
.add-meta{display:flex;gap:7px;align-items:center;margin-top:7px}
.add-meta .select{height:37px;font-size:12px;flex:1;background:#fff}
.add-category-btn{height:37px;flex:0 0 auto;border:1px solid #d7d7d7;background:#fff;border-radius:9px;padding:0 10px;color:#555;font-size:12px;font-weight:600}
.add-category-btn:hover{background:#f7f7f7}
.add-meta small{color:#888;font-size:10.5px}
.toolbar{display:flex;gap:7px;align-items:center;overflow:auto;margin:2px 0 11px;scrollbar-width:none}
.toolbar::-webkit-scrollbar{display:none}
.filter{flex:0 0 auto;border:1px solid #ddd;background:#fff;border-radius:999px;padding:7px 10px;font-size:11.5px;font-weight:600;color:#555}
.filter.active{background:#292929;border-color:#292929;color:#fff}
.icon-btn{margin-left:auto;flex:0 0 auto;border:1px solid #ddd;background:#fff;border-radius:9px;padding:7px 9px;color:#555;font-weight:600;font-size:11.5px}
.category{margin-bottom:17px}
.category-head{display:grid;grid-template-columns:23px minmax(0,1fr) auto auto;align-items:center;gap:6px;margin:0 2px 6px;padding:5px 3px;border-bottom:1px solid #e8e8e8;background:transparent;border-radius:0}
.category-title-wrap{min-width:0}
.category-name-btn{width:100%;border:0;background:transparent;padding:4px 2px;text-align:left;border-radius:6px;color:inherit;display:flex;align-items:center;gap:4px;min-width:0}
.category-name-btn:hover{background:#f7f7f7}
.category-name{font-size:15px;font-weight:700;word-break:break-word;min-width:0;color:#2c2c2c}
.category-count{font-size:10.5px;color:#888;white-space:nowrap;background:transparent;border:0;padding:0 4px;font-weight:400}
.category-actions{display:flex;align-items:center;gap:3px}
.category-add{height:28px;border:1px solid #f0c6af;background:#fff7f2;border-radius:999px;color:var(--brand-dark);padding:0 9px;font-size:11px;font-weight:700;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:3px}
.category-add:hover{background:#fff0e6}
.category-inline-add{display:grid;grid-template-columns:minmax(0,1fr) 66px;gap:6px;align-items:center;margin:0 2px 8px;padding:8px;border:1px solid #e7e1dc;border-radius:11px;background:#faf7f4}
.category-inline-add[hidden]{display:none !important}
.category-inline-input{width:100%;height:38px;border:1px solid #d4d4d4;border-radius:9px;background:#fff;padding:0 10px;outline:none;color:var(--ink);font-size:12.5px}
.category-inline-input:focus{border-color:var(--brand);box-shadow:0 0 0 2px rgba(243,106,45,.10)}
.category-inline-submit{height:38px;border:0;border-radius:9px;background:var(--brand);color:#fff;font-size:11.5px;font-weight:700}
.category-move,.category-delete{width:28px;height:28px;border:1px solid #e0e0e0;background:#fff;border-radius:8px;color:#858585;font-size:11px;font-weight:600;padding:0}
.category-move:hover:not(:disabled){background:#f6f6f6;color:#444}
.category-move:disabled{opacity:.25;cursor:default}
.category-delete{border:0;font-size:18px;color:#aaa}
.category-delete:hover{background:#fff0ee;color:var(--danger)}
.category.dragging-category{opacity:.45;background:#fff7f2}
.category.drop-before{box-shadow:0 -3px 0 var(--brand)}
.category.drop-after{box-shadow:0 3px 0 var(--brand)}
.category-empty{border:1px dashed #d7d7d7;border-radius:11px;padding:12px;text-align:center;color:#888;font-size:11.5px;background:#fafafa}
.items{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff}
.item{display:grid;grid-template-columns:23px 29px minmax(0,1fr) 58px 32px;align-items:center;gap:6px;min-height:55px;padding:7px;border-bottom:1px solid #eee;transition:.12s}
.item:last-child{border-bottom:0}
.item.done{background:#fafafa}
.item.dragging{opacity:.42;background:#fff7f2}
.items.drag-over{outline:2px dashed rgba(243,106,45,.4);outline-offset:-4px}
.drag-handle{width:23px;height:32px;border:0;background:transparent;color:#aaa;border-radius:7px;font-size:17px;display:grid;place-items:center;cursor:grab;touch-action:none;user-select:none}
.drag-handle:active{cursor:grabbing}
.check{appearance:none;width:23px;height:23px;border:2px solid #c9c9c9;border-radius:6px;background:#fff;display:grid;place-content:center;margin:0}
.check:checked{border-color:var(--brand);background:var(--brand)}
.check:checked:after{content:"✓";color:#fff;font-weight:700;font-size:14px}
.item-name-wrap{min-width:0}
.item-name-btn{width:100%;border:0;background:transparent;padding:4px 2px;text-align:left;border-radius:6px;color:inherit;display:flex;align-items:center;gap:4px;min-width:0}
.item-name-btn:hover{background:#f7f7f7}
.item-name{font-size:13.5px;font-weight:500;word-break:break-word;min-width:0}
.edit-mark{font-size:11px;color:#b1b1b1;flex:0 0 auto}
.item.done .item-name{text-decoration:line-through;color:#999}
.name-input{width:100%;height:36px;border:1px solid var(--brand);box-shadow:0 0 0 2px rgba(243,106,45,.10);border-radius:8px;padding:0 8px;outline:none;font-size:13px;font-weight:500;background:#fff}
.move-group{display:grid;grid-template-columns:1fr 1fr;gap:3px}
.move{height:28px;border:1px solid #e0e0e0;background:#fff;border-radius:7px;color:#888;font-size:12px;font-weight:600;padding:0}
.move:hover:not(:disabled){background:#f6f6f6;color:#444}
.move:disabled{opacity:.25;cursor:default}
.delete{width:32px;height:32px;border:0;background:transparent;border-radius:8px;color:#aaa;font-size:20px;line-height:1;display:grid;place-items:center}
.delete:hover{background:#fff0ee;color:var(--danger)}
.empty{padding:27px 16px;text-align:center;border:1px dashed #ccc;border-radius:12px;color:#888;font-size:12px;background:#fafafa}
.empty b{display:block;color:#555;margin-bottom:3px;font-weight:600}
.actions{display:flex;justify-content:center;align-items:center;gap:8px}
.sub-btn{border:1px solid #d7d7d7;background:#fff;border-radius:10px;min-height:42px;padding:9px 17px;font-weight:600;color:#555;box-shadow:none;width:min(250px,100%)}
.sub-btn.danger{color:var(--danger);border-color:#efc9c5}
.help{font-size:11px;color:#777;margin-top:11px;line-height:1.65}
.help a{color:var(--brand-dark);font-weight:600;text-decoration:underline;text-underline-offset:2px}
.site-signature{text-align:center;margin:22px 0 4px;color:#555;font-size:12.5px;font-weight:600;letter-spacing:0}
.toast{position:fixed;left:50%;bottom:calc(18px + env(safe-area-inset-bottom));transform:translate(-50%,20px);background:#292929;color:#fff;padding:8px 12px;border-radius:999px;font-size:11.5px;font-weight:600;opacity:0;pointer-events:none;transition:.18s;z-index:50;white-space:nowrap}
.toast.show{opacity:1;transform:translate(-50%,0)}
.has-undo .toast{bottom:calc(72px + env(safe-area-inset-bottom))}
.undo-bar{position:fixed;left:50%;bottom:calc(18px + env(safe-area-inset-bottom));transform:translate(-50%,20px);width:min(430px,calc(100% - 28px));display:flex;align-items:center;gap:10px;justify-content:space-between;background:#292929;color:#fff;padding:9px 10px 9px 13px;border-radius:12px;font-size:11.5px;font-weight:600;opacity:0;pointer-events:none;transition:.18s;z-index:55;box-shadow:0 8px 24px rgba(0,0,0,.2)}
.undo-bar.show{opacity:1;transform:translate(-50%,0);pointer-events:auto}
.undo-bar button{flex:0 0 auto;min-height:34px;border:1px solid rgba(255,255,255,.35);border-radius:9px;background:#fff;color:#292929;padding:0 10px;font-size:11.5px;font-weight:700}
.modal-backdrop,.install-modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.38);display:none;align-items:flex-end;justify-content:center;z-index:60;padding:14px}
.install-modal-backdrop{z-index:80}
.modal-backdrop.show,.install-modal-backdrop.show{display:flex}
.modal,.install-modal{width:min(560px,100%);background:#fff;border-radius:16px;padding:16px;box-shadow:0 20px 50px rgba(0,0,0,.18);border:1px solid #e3e3e3}
.modal h3,.install-modal h3{margin:0 0 5px;font-size:17px;color:#2c2c2c;font-weight:700}
.modal p{margin:0 0 12px;font-size:12.5px;color:#777}
.modal-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.backup-box{margin:12px 0;padding:11px;border:1px solid #e5e5e5;background:#fafafa;border-radius:12px}
.backup-title{font-size:12px;font-weight:700;color:#333;margin:0 0 4px}.backup-desc{font-size:10.5px;line-height:1.55;color:#777;margin:0 0 9px}
.backup-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.backup-btn{min-height:40px;border:1px solid #d7d7d7;border-radius:10px;background:#fff;color:#333;font-size:12px;font-weight:700}.backup-btn.primary{background:#292929;border-color:#292929;color:#fff}
.backup-file{display:none}
.modal button{min-height:42px;border-radius:9px;font-weight:600}
.modal .cancel{background:#fff;border:1px solid #d7d7d7;color:#555}.modal .danger{background:#fff3f1;border:1px solid #efc5c0;color:var(--danger)}
.install-card{display:none;align-items:center;gap:10px;margin:-1px 0 13px;padding:11px 12px;border:1px solid #e3e3e3;border-radius:13px;background:#fafafa;box-shadow:none}
.install-card.show{display:flex}
.install-mini-icon{width:40px;height:40px;border-radius:10px;overflow:hidden;flex:0 0 auto;border:1px solid #ddd;background:#fff}
.install-mini-icon img{width:100%;height:100%;object-fit:cover;display:block}
.install-copy{min-width:0;flex:1}
.install-title{font-size:12.5px;font-weight:700;color:#333;margin:0 0 1px}
.install-desc{font-size:10.5px;color:#777;margin:0;line-height:1.45}
.install-btn{flex:0 0 auto;min-height:36px;border:0;border-radius:9px;padding:0 10px;background:var(--brand);color:#fff;font-size:11px;font-weight:700;white-space:nowrap}
.install-btn:active{transform:translateY(1px)}
.install-modal{width:min(520px,100%)}
.install-modal-head{display:flex;align-items:center;gap:10px;margin-bottom:13px}
.install-modal-head img{width:48px;height:48px;border-radius:12px;border:1px solid #ddd}
.install-modal h3{margin:0;font-size:17px;line-height:1.3}
.install-modal-sub{font-size:11.5px;color:#777;margin:3px 0 0}
.install-steps{display:grid;gap:8px;margin:11px 0 15px}
.install-step{display:grid;grid-template-columns:28px 1fr;gap:8px;align-items:start;padding:9px;border:1px solid #e4e4e4;background:#fafafa;border-radius:11px}
.install-step-num{width:28px;height:28px;border-radius:8px;background:var(--brand-soft);color:var(--brand-dark);display:grid;place-items:center;font-size:12px;font-weight:700}
.install-step b{display:block;font-size:12.5px;color:#333;margin-bottom:1px;font-weight:600}.install-step span{font-size:10.5px;color:#777;line-height:1.5}
.install-close{width:100%;min-height:43px;border:0;border-radius:10px;background:#292929;color:#fff;font-weight:700}
@media(max-width:480px){
  .header{padding:16px 14px 14px}.mark{width:48px;height:48px}h1{font-size:22px;letter-spacing:.018em}.main{padding-left:10px;padding-right:10px}
  .card{padding:11px}.add-row{grid-template-columns:1fr 78px}.summary-number{font-size:27px}
  .item{grid-template-columns:21px 28px minmax(0,1fr) 54px 29px;gap:4px;padding-left:5px;padding-right:4px}.drag-handle{width:21px}.delete{width:29px}.move{height:28px}
  .category-head{grid-template-columns:21px minmax(0,1fr) auto;gap:4px}.category-count{display:none}.category-actions{grid-column:3}.category-add{padding:0 8px;font-size:10.5px}
  .category-inline-add{margin-left:0;margin-right:0;grid-template-columns:minmax(0,1fr) 62px;padding:7px}
  .category-move,.category-delete{width:27px;height:27px}
  .add-meta{display:grid;grid-template-columns:1fr auto;gap:5px}.add-meta .select{margin:0}.add-meta small{grid-column:1/-1}
  .install-card{padding:10px 9px;gap:8px}.install-mini-icon{width:38px;height:38px}.install-btn{padding:0 8px}.install-desc{font-size:10px}
}
