/* My Hanibon: touch-first, with a separate safe area from the village HUD. */
#my-dock{position:fixed;z-index:29;left:50%;transform:translateX(-50%);bottom:calc(12px + env(safe-area-inset-bottom));width:min(440px,calc(100% - 24px));min-height:72px;padding:10px 16px;border:1px solid #dac18a;border-radius:24px;background:#fffbedf5;color:#4a3b10;box-shadow:0 5px 24px #231b1928;display:flex;align-items:center;gap:12px;text-align:left}
#my-dock canvas{width:52px;height:58px;flex:none}#my-dock strong{display:block;font-size:16px}#my-dock small{font-size:11px;display:block;margin-bottom:3px;color:#80683e}#my-dock .dock-arrow{margin-left:auto;font-size:23px}
#hanibon-ec-entry{display:none!important}
.hb-dialog{position:fixed;inset:0;margin:auto;width:min(580px,calc(100% - 24px));max-height:calc(100dvh - 24px);border:1px solid #e0c792;border-radius:26px;background:#fffaf0;color:#45391f;padding:0;box-shadow:0 20px 70px #30261833;font:500 14px/1.6 'Zen Maru Gothic',sans-serif;overflow:auto}
.hb-dialog::backdrop{background:#24203988;backdrop-filter:blur(5px)}
.hb-dialog button,.hb-dialog a.hb-btn{font-family:inherit;font-size:14px;font-weight:700;line-height:1.4;min-height:46px;border-radius:15px;padding:12px 16px;border:1px solid #d9bd82;background:#fff5d8;color:#493c24;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.hb-dialog button:disabled{opacity:.5;cursor:wait}.hb-dialog button:focus-visible,.hb-dialog a:focus-visible,#my-dock:focus-visible{outline:3px solid #9b6b3e;outline-offset:3px}
.hb-dialog .primary{background:#d9774c;color:#fff;border-color:#c3663d;box-shadow:0 3px #af5b34}
.hb-head{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #ebdfc7}.hb-head h2{font-size:19px;line-height:1.3;margin:0}.hb-head small{display:block;font:600 10px/1.4 sans-serif;letter-spacing:.15em;color:#9b8053;margin-bottom:4px}.hb-head button{font-size:22px;padding:4px;width:44px;flex:none;background:transparent;border:0}
.hb-preview{display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at 50% 52%,#f4e4b8 0%,#fffaf0 66%);min-height:190px}
.hb-preview canvas{width:240px;max-width:68vw;height:auto;max-height:30dvh;object-fit:contain}
.hb-tabs{display:flex;gap:6px;padding:8px 16px;overflow:auto;flex-shrink:0}.hb-tabs button{flex:1;white-space:nowrap;font-size:13px;padding:10px 8px;border:0;background:transparent}.hb-tabs button[aria-selected=true]{background:#f1d48d;color:#47361a}
.hb-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:8px 16px 16px;overflow:auto;min-height:120px;max-height:24dvh}.hb-items button{display:flex;flex-direction:column;gap:3px;padding:8px 4px;font-size:11px;background:#fffdf8}.hb-items button[aria-pressed=true]{border:2px solid #b67845;background:#fff0c7}.hb-items img{width:66px;height:64px;object-fit:contain}.hb-items .empty-item{height:64px;display:grid;place-items:center;font-size:24px;color:#b59868}
.hb-maker-bottom{padding:12px 18px max(16px,env(safe-area-inset-bottom));border-top:1px solid #eadac0;background:#fffaf0}.hb-maker-bottom label{display:block;font-size:12px;font-weight:700;margin-bottom:5px}.hb-maker-bottom input{font:700 16px 'Zen Maru Gothic',sans-serif;width:100%;min-height:46px;border:1px solid #cfb57d;border-radius:12px;background:white;padding:10px 12px;color:#493c24}.hb-maker-bottom .primary{width:100%;margin-top:10px}.hb-caption{font-size:11px;color:#887149;margin:7px 0 0}.hb-error{color:#ae452e;font-size:13px;margin:6px 0}.hb-error:empty{display:none}
#hb-maker[open]{display:flex;flex-direction:column;overflow:auto}.hb-maker-main{overflow:auto;min-height:0}.hb-profile{text-align:center;padding:8px 20px 24px}.hb-profile h3{font-size:25px;margin:2px 0}.hb-number{font:600 12px sans-serif;letter-spacing:.14em;color:#957445}.hb-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:20px}.hb-actions .primary{grid-column:1/-1}.hb-secondary{margin-top:18px;font-size:12px;color:#907441}.hb-secondary summary{cursor:pointer;padding:10px}.hb-secondary p{margin:6px 0}.hb-secondary textarea{width:100%;height:80px;font:12px monospace}.hb-secondary select{width:100%;font:inherit;min-height:44px}.hb-card-content{padding:16px;text-align:center}.hb-card-content img{display:block;width:100%;max-height:59dvh;object-fit:contain;border-radius:16px}.hb-card-content .hb-actions{margin-top:12px}.hb-card-content p{font-size:11px;color:#8b7652}
@media(min-width:650px){#hb-maker .hb-preview canvas{max-height:290px;width:270px}.hb-items{max-height:215px}.hb-preview{min-height:230px}}
@media(max-height:650px){.hb-preview{min-height:135px}.hb-preview canvas{max-height:25dvh}.hb-head{padding:10px 16px}.hb-maker-bottom{padding:8px 16px}.hb-items{max-height:20dvh}.hb-card-content img{max-height:46dvh}}
/* Compact dock leaves the village and its facilities visible. */
#my-dock{left:auto;right:12px;transform:none;width:auto;max-width:calc(100% - 24px);min-height:48px;padding:6px 13px;gap:8px;border-radius:999px;box-shadow:0 3px 12px #231b1920}
#my-dock canvas{width:32px;height:36px}#my-dock small{display:none}#my-dock strong{font-size:13px}#my-dock .dock-arrow{font-size:18px}
.hb-collection{padding:16px 18px 22px}.hb-collection-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.hb-collection article{border:1px solid #e7d7b5;border-radius:18px;background:#fffdf5;padding:10px;text-align:center;min-width:0}.hb-collection canvas{width:100%;max-width:155px;height:auto}.hb-collection strong{display:block;font-size:16px;overflow-wrap:anywhere}.hb-collection small{display:block;color:#967d4c;font-size:11px;margin-bottom:10px}.hb-collection article button{width:100%;padding:10px 6px}.hb-collection article .hb-meet{background:transparent;border:0;font-size:12px}.hb-collection-tools{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.hb-collection-tools .primary{flex:1}.hb-collection-note{font-size:11px;line-height:1.6;color:#92794c;margin-top:12px}

.hb-dialog [hidden],#my-dock [hidden]{display:none!important}
/* Find a resident without losing the village context. */
.hb-dialog{overscroll-behavior:contain}
.hb-head{position:sticky;top:0;z-index:2;background:#fffaf0}
.hb-search-label{display:block;font-size:12px;font-weight:700;margin-bottom:6px}
.hb-search{display:block;width:100%;min-height:46px;border:1px solid #d9bd82;border-radius:13px;padding:10px 12px;background:#fffdf8;color:#493c24;font:500 16px 'Zen Maru Gothic',sans-serif}
.hb-collection-count{margin:10px 0;color:#80683e;font-size:12px}
.hb-empty{grid-column:1/-1;padding:24px 8px;text-align:center;color:#80683e}
.hb-collection article button{font-size:13px;padding:10px 4px}
.hb-collection-tools{flex-direction:column}
.hb-pagination{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:18px}
.hb-pagination button{font-size:12px;padding:8px}
.hb-pagination span{font-size:12px;white-space:nowrap;color:#80683e}
.hb-profile .hb-back{background:transparent;border:0;padding:8px;margin-bottom:10px;color:#80683e;font-size:12px}
.hb-name-count{display:block;text-align:right;margin-top:3px;font-size:11px;color:#80683e}
.hb-items{grid-template-columns:repeat(4,minmax(0,1fr));max-height:none;overflow:visible}
.hb-items img,.hb-items .empty-item{width:52px;height:52px}
.hb-items button{justify-content:flex-start;min-height:94px}
.hb-maker-bottom{flex-shrink:0}
.hb-actions .hb-wide{grid-column:1/-1}
#card-v2-link{margin-top:12px}
@media(max-width:360px){.hb-items{gap:5px;padding-inline:12px}.hb-items img,.hb-items .empty-item{width:44px;height:44px}.hb-items button{font-size:10px}.hb-head h2{font-size:17px}.hb-collection{padding-inline:14px}}
@media(prefers-reduced-motion:reduce){.hb-dialog::backdrop{backdrop-filter:none}}
