/* One compact, readable story card; the map keeps its real colors and sharpness. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.header-actions .family-entry{display:inline-flex;align-items:center;gap:8px;min-height:46px;padding:8px 15px;font-size:17px;font-weight:800;white-space:nowrap}
.family-entry span:first-child{font-size:25px;line-height:1;color:#b56c39}
.header-actions .family-entry[aria-pressed=true]{background:#28c8c8;color:#1e2b2f;border-color:#23afad}
.header-actions .family-entry:disabled{opacity:.5}
#familyHint{position:absolute;z-index:23;top:82px;right:185px;min-height:44px;padding:8px 14px;border:1px solid #7fbfa9;border-radius:12px;background:#fffdf7;color:#186753;box-shadow:0 6px 20px #315c3240;font-size:16px;font-weight:800;white-space:nowrap}
#familyHomePin{position:absolute;z-index:9;transform:translate(-50%,-50%);width:72px;height:80px;min-width:0;min-height:0;padding:0;border:0;border-radius:12px;background:transparent;box-shadow:none;cursor:pointer}
#familyHomePin:focus-visible{outline:3px solid #087c68;outline-offset:2px;background:#fffdf52e}
.family-open #mapNav,.family-open #sidePanel,.family-open .map-main-actions,.family-open .view-tools,.family-open .map-caption,.family-open .policy-pins,.family-open .policy-nameplates,.family-open .policy-leaders,.family-open .active-route,.family-open .neighbor-pins,.family-open .world-labels,.family-open .nature-labels{display:none!important}
.family-open #menuToggle,.family-open #rollDice,.family-open .header-tools,.family-open #helpOpen{visibility:hidden;pointer-events:none}
.family-open #actorSpeech{display:none!important}
.family-panel{position:absolute;z-index:22;top:100px;right:24px;width:min(380px,calc(100vw - 48px));max-height:calc(100dvh - 135px);display:flex;flex-direction:column;overflow:hidden;background:#fffdf8;border:1px solid #c8dbc6;border-radius:22px;box-shadow:0 15px 38px #234c342d;color:#244c3d}
.family-panel-head{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:16px 19px 13px;border-bottom:1px solid #e0e8d8;flex:none}
.family-panel-head strong{display:block;font-size:22px;line-height:1.4}
.family-panel-head button{width:44px;height:44px;min-width:44px;border-radius:50%;background:#e6efe3;color:#225746;font-size:25px;line-height:1}
.family-content{padding:18px 20px 21px;overflow:auto;overscroll-behavior:contain;font-size:17px;line-height:1.6}
.family-content p{margin:0 0 14px}
.family-content h2{margin:9px 0 14px;font-size:23px;line-height:1.45}
.family-lead{font-size:18px;color:#536b5a}
.family-member-list{display:grid;gap:10px}
.family-note{font-size:14px;color:#647e6d;line-height:1.55;margin:15px 0 0!important}
.family-member{width:100%;display:flex;align-items:center;gap:12px;text-align:left;min-height:72px;background:#f0edfa;border:1px solid #d8d1ed;border-radius:15px;padding:12px;color:#2c3b48}
.family-member[data-family-profile=house]{background:#fff3e9;border-color:#e9c6ad}
.family-member[data-family-profile=jiuma]{background:#fff0e8;border-color:#eec9b8}
.family-member[data-family-profile=agong]{background:#edf5e7;border-color:#bcd6b2}
.family-member[data-family-profile=jiujiu]{background:#e9f1fa;border-color:#b5cee3}
.family-member>span:last-child{margin-left:auto;font-size:28px;color:#7664a8}
.family-member[data-family-profile=house]>span:last-child{color:#ab6548}
.family-avatar{width:48px;height:48px;flex:none;border-radius:50%;background:#8a6bbe;color:white;display:grid;place-items:center;font-size:22px;font-weight:900;border:3px solid #f7cb4f;box-shadow:0 3px 8px #5a4b8330}
.family-avatar.house-avatar{background:#b5563c;border-color:#f2c790;font-size:31px;line-height:1}
.family-avatar.aunt-avatar{background:#e2785e;border-color:#f4d4a2}
.family-avatar.grandpa-avatar{background:#5e8e52;border-color:#e4d499}
.family-avatar.uncle-avatar{background:#4a78a8;border-color:#c9e6b9}
.family-avatar.large{width:58px;height:58px;font-size:27px}
.family-person{display:flex;flex-direction:column;min-width:0}
.family-person strong{font-size:20px;white-space:nowrap}
.family-person strong small{font-size:15px;color:#685b80;font-weight:650}
.family-member[data-family-profile=jiujiu] .family-person strong{white-space:normal;line-height:1.32}
.family-member[data-family-profile=jiujiu] .family-person strong small{display:block;margin-top:2px}
.family-person>span{font-size:15px;color:#535c66;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.family-back,.family-subtle{background:none;color:#137c66;padding:8px 0;min-height:44px;text-align:left;font-weight:750}
.family-profile{display:flex;align-items:center;gap:13px;margin:12px 0 16px}
.family-profile h2{margin:0;font-size:25px}
.family-profile p{margin:3px 0 0;color:#63726a}
.family-voice{font-weight:750;color:#604879;background:#f2edfa;border-radius:11px;padding:12px 14px}
.family-voice.house-voice{color:#804b37;background:#fff0e4}
.family-voice.aunt-voice{color:#874e43;background:#fff0e8}
.family-voice.grandpa-voice{color:#345e3c;background:#edf5e7}
.family-voice.uncle-voice{color:#294d71;background:#e9f1fa}
.family-itinerary{display:flex;flex-direction:column;gap:4px;padding:10px 0 17px;color:#305947}
.family-itinerary i{font-style:normal;color:#729a79}
.family-content button.family-primary{display:block;width:100%;min-height:48px;background:#0d806c;color:white;border-radius:11px;padding:10px 14px;font-weight:800;text-align:center;font-size:18px}
.family-progress{display:flex;gap:7px;margin:2px 0 12px}
.family-progress span{height:7px;flex:1;background:#dce8da;border-radius:20px}
.family-progress span.on{background:#28a895}
.family-stop-phase{color:#597567;font-size:15px;font-weight:800;margin:0 0 8px!important}
.family-content blockquote{margin:0 0 14px;padding:10px 13px;border-left:4px solid #8a6bbe;background:#f2eefa;border-radius:0 11px 11px 0;font-size:18px;font-weight:700}
.family-content blockquote.aunt-difficulty{color:#a52e35;border-left-color:#df7964;background:#fff0ea}
.family-content blockquote.grandpa-difficulty{color:#a52e35;border-left-color:#df7964;background:#fff0ea}
.family-content blockquote.uncle-difficulty{color:#a52e35;border-left-color:#df7964;background:#fff0ea}
.family-options{display:grid;gap:8px}
.family-options button{min-height:48px;text-align:left;padding:10px 13px;background:#e9f4e9;border:1px solid #b9dac5;border-radius:11px;font-size:17px;font-weight:750}
.family-options button:nth-child(2){background:#fff5df;border-color:#e3ca90}
.family-quote{display:flex;align-items:start;gap:11px;background:#eaf7f0;padding:12px;border-radius:13px;margin:0 0 10px}
.family-quote p{margin:0;font-size:17px;line-height:1.65}
.family-policy-copy{background:#eaf5ed;border-left:4px solid #3a9475;padding:11px 13px;border-radius:0 11px 11px 0;margin:0 0 12px}
.family-policy-copy strong{color:#23745c;font-size:15px}
.family-policy-copy p{margin:4px 0 0;font-size:17px;line-height:1.6}
.family-transit-note{padding:11px 13px;border-radius:11px;background:#e9f3ed;color:#396658;font-size:15px;line-height:1.55}
.family-house-dashboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:12px;margin:0 0 13px;background:#edf4ef;border:1px solid #c2d9cb;border-radius:12px}
.family-house-dashboard strong{grid-column:1/-1;color:#255c4c;font-size:15px}
.family-house-dashboard span{padding:7px 9px;border-radius:8px;background:#fffdf8;color:#356451;font-size:14px;font-weight:700}
.family-chiu{display:grid;place-items:center;width:38px;height:38px;flex:none;background:#28c8c8;color:#143c36;border-radius:50%;font-weight:900}
.family-policy{width:100%;min-height:48px;margin-bottom:14px;text-align:left;background:#fff9e7;border:1px solid #e0ca93;color:#316753;padding:10px 13px;border-radius:11px;font-weight:780;line-height:1.5}
.family-comparison{margin:15px 0;border-top:1px solid #e0e8d8;padding:13px 0 0}
.family-comparison strong{display:block;margin-bottom:7px;font-size:16px}
.family-comparison>div{display:flex;gap:6px;background:#edf2e9;padding:4px;border-radius:12px}
.family-comparison button{flex:1;min-height:44px;border-radius:9px;background:transparent;font-size:16px;font-weight:700}
.family-comparison button[aria-pressed=true]{background:#fffdf8;box-shadow:0 2px 6px #335d3421;color:#087967}
.family-comparison p{font-size:16px;margin:9px 0 4px}
.family-comparison p.current{color:#b32330;font-weight:750}
.family-comparison small{display:block;color:#688072;font-size:13px;line-height:1.55}
.family-related{display:flex;gap:8px;margin:-2px 0 14px;flex-wrap:wrap}
.family-related button{flex:1;min-height:44px;min-width:120px;padding:7px 10px;border:1px solid #cbded1;border-radius:10px;background:#edf5ee;color:#246851;font-size:15px;font-weight:750}
.family-summary{list-style:none;margin:14px 0;padding:0;display:grid;gap:8px}
.family-summary li{display:flex;align-items:center;gap:10px;padding:10px;background:#eaf2e8;border-radius:10px;font-weight:700}
.family-summary span{display:grid;place-items:center;min-width:32px;height:32px;background:#2b8a70;color:white;border-radius:50%}
.family-actions{display:grid;gap:7px;margin-top:15px}
.family-actions button:not(.family-primary){background:#f3f6ed;min-height:44px;border-radius:10px;color:#246851;font-weight:700}
#familyThought{position:absolute;z-index:11;transform:translate(-50%,-100%);width:min(218px,calc(100vw - 44px));padding:11px 13px;background:#fffdf9;border:2px solid #9982c1;color:#3b3750;border-radius:15px;font-size:16px;font-weight:750;line-height:1.55;box-shadow:0 6px 20px #2c48502e;pointer-events:none}
#familyThought:after{content:'';position:absolute;bottom:-8px;left:calc(50% - 7px);width:12px;height:12px;background:#fffdf9;border-right:2px solid #9982c1;border-bottom:2px solid #9982c1;transform:rotate(45deg)}
#familyThought[data-kind=house]{border-color:#b57555;color:#603c33}
#familyThought[data-kind=house]:after{border-color:#b57555}
#familyThought[data-kind=jiuma]{border-color:#e2785e;color:#a52e35}
#familyThought[data-kind=jiuma]:after{border-color:#e2785e}
#familyThought[data-kind=agong]{border-color:#6a9d5b;color:#456a43}
#familyThought[data-kind=agong]:after{border-color:#6a9d5b}
#familyThought[data-kind=jiujiu]{border-color:#6996bd;color:#385374}
#familyThought[data-kind=jiujiu]:after{border-color:#6996bd}
#familyChildTag{position:absolute;z-index:12;transform:translate(-50%,0);padding:3px 10px;background:#fffdf8;border:1px solid #9f8ac8;border-radius:9px;color:#5b438c;font-size:15px;font-weight:900;white-space:nowrap;box-shadow:0 2px 7px #455b4540;pointer-events:none}
#familyChildTag[data-kind=jiuma]{border-color:#e5a18b;color:#9b493b}
#familyChildTag[data-kind=agong]{border-color:#a7c399;color:#4b7745}
#familyChildTag[data-kind=jiujiu]{border-color:#a7c7e3;color:#34648b}
@media(max-width:799px){
 .header-actions .family-entry{position:absolute;left:14px;top:96px;min-height:44px;padding:6px 10px;gap:5px;font-size:15px;box-shadow:0 4px 12px #23583b25}
 .family-entry span:first-child{font-size:21px}
 #familyHint{top:146px;left:14px;right:auto;font-size:14px}
 .family-open .map-heading{opacity:.55}
 .family-panel{top:auto;right:10px;bottom:max(10px,env(safe-area-inset-bottom));left:10px;width:auto;max-height:min(48dvh,450px);border-radius:20px}
 .family-panel[data-stage=stop],.family-panel[data-stage=moving],.family-panel[data-stage=house-stop],.family-panel[data-stage=aunt-stop],.family-panel[data-stage=aunt-moving],.family-panel[data-stage=aunt-return],.family-panel[data-stage=grandpa-stop],.family-panel[data-stage=grandpa-moving],.family-panel[data-stage=grandpa-transit],.family-panel[data-stage=grandpa-return],.family-panel[data-stage=uncle-stop],.family-panel[data-stage=uncle-moving]{max-height:min(44dvh,405px)}
 .family-panel-head{padding:10px 14px 8px}
 .family-panel-head strong{font-size:19px}
 .family-content{padding:11px 15px 16px;font-size:16px}
 .family-content h2{font-size:20px}
 .family-content blockquote{font-size:16px}
 .family-quote p{font-size:16px}
 #familyThought{font-size:14px;width:185px}
 #familyHomePin{width:62px;height:68px}
}
@media(min-width:800px) and (max-height:500px){.family-panel{top:68px;right:12px;width:320px;max-height:calc(100dvh - 78px)}.family-content{padding:10px 15px}}
@media(prefers-reduced-motion:reduce){.family-panel,#familyThought{transition:none!important}}
