/* Personal shelves and family tools. Kingdom's river, grove and earned brass
   carry meaning; saved artwork remains the brightest part of each shelf. */
#hubScreen:not(.map-view) {
  --family-paper:#fffaf0;
  --family-ink:#1e2a3a;
  --family-muted:#52616a;
  --family-river:#3f5c6b;
  --family-grove:#556b3e;
  --family-line:#d7c9aa;
  background:linear-gradient(#fffaf057,#f4ead5a8),var(--academy-paper-image) center/cover no-repeat,#f4ead5;
  padding:clamp(18px,3vw,38px) clamp(16px,4vw,52px) 36px;
  color:var(--family-ink);
}
#hubScreen:not(.map-view) :is(.hub-heading,#hubContent) {width:100%;max-width:1220px;margin-inline:auto;min-width:0;}
#hubScreen:not(.map-view) .hub-heading {
  position:static;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;
  height:auto;min-height:0;max-width:1220px;gap:16px 24px;padding:0;margin-bottom:24px;
}
#hubScreen:not(.map-view) .hub-heading>div:first-child {min-width:0;flex:1 1 250px;}
#hubScreen:not(.map-view) .hub-heading h1 {
  max-width:none;margin:0 0 6px;color:var(--family-ink);font:900 clamp(28px,3.1vw,42px)/1.15 var(--kid-font);letter-spacing:-.8px;
}
#hubScreen:not(.map-view) .hub-heading p {display:block;margin:0;max-width:48ch;font:600 17px/1.45 var(--kid-font);color:var(--family-muted);}
#hubScreen:not(.map-view) #hubHeadingActions {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0;}
#hubScreen:not(.map-view) .hub-quicklinks {gap:10px;}
#hubScreen:not(.map-view) .royal-button {
  min-height:52px;padding:11px 20px;border:1px solid var(--family-line);border-image:none;border-radius:16px;
  color:var(--family-river);background:var(--family-paper);box-shadow:0 3px 0 #b7ab902d;
  font:900 17px/1.25 var(--kid-font);text-shadow:none;
}
#hubScreen:not(.map-view) .royal-button.gold {
  background:linear-gradient(#4c6a78,#3f5c6b);border-color:#344e5b;color:#fffaf0;
  box-shadow:0 4px 0 #263d49,0 5px 12px #1e2a3a12;
}
#hubScreen:not(.map-view) .royal-button:is(:hover,:focus-visible) {filter:brightness(1.045);}
#hubScreen:not(.map-view) :is(button,a,input,select,summary):focus-visible {outline:3px solid #b8733a;outline-offset:4px;}
#hubScreen:not(.map-view) :is(.reward-card,.creation-card,.parent-summary,.settings-panel,.family-profile,.illustrated-empty) {
  border:1px solid var(--family-line);border-image:none;border-radius:24px;
  background:var(--family-paper);box-shadow:0 4px 0 #cbbd9b33,0 10px 28px #49392308;color:var(--family-ink);
}

/* The three shelves are picture-and-word choices, with one obvious selection. */
#hubScreen .keepsake-tabs {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;
  margin:0 0 26px;padding:6px;background:#e6ddc8;border:1px solid #d3c4a4;border-radius:22px;
}
#hubScreen .keepsake-tabs button {
  min-width:0;min-height:68px;padding:10px 16px;gap:10px;border:1px solid transparent;border-radius:17px;
  background:transparent;color:var(--family-river);box-shadow:none;font:900 19px/1.2 var(--kid-font);
}
#hubScreen .keepsake-tabs button[aria-pressed=true] {
  border-color:#b6c2bc;background:var(--family-paper);color:#1e2a3a;box-shadow:0 3px 8px #4e493319;
}
#hubScreen .keepsake-tabs button[aria-pressed=true] .toy-icon {color:var(--family-grove);}
#hubScreen .keepsake-tabs .toy-icon {width:31px;height:31px;flex-shrink:0;}
#hubScreen .collection-section {margin:0 0 28px;}
#hubScreen[data-hub-view=collection]:has(.illustrated-empty:not([hidden])):has([data-collection-section=creations]:not([hidden])) #hubHeadingActions,
#hubScreen[data-hub-view=collection]:has([data-collection-section=creations][hidden]) #hubHeadingActions {display:none;}
#hubScreen .collection-section:has(>.illustrated-empty)>h2 {display:none;}
#hubScreen .collection-section>h2 {display:flex;align-items:center;gap:12px;margin:0 0 16px;font:900 23px/1.25 var(--kid-font);}
#hubScreen .collection-section>h2>span {
  margin:0;padding:5px 10px;border:1px solid #d3c7ac;border-radius:10px;background:#fffaf094;
  color:var(--family-muted);font:800 15px/1.25 var(--kid-font);
}
#hubScreen .creation-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;}
#hubScreen .creation-card {padding:8px;overflow:hidden;}
#hubScreen .creation-card-heading {display:flex;align-items:center;gap:12px;padding:9px 8px 16px;}
#hubScreen .creation-card-heading h3 {flex:1;min-width:0;margin:0;font-size:22px;}
#hubScreen .creation-card-heading .royal-button {display:flex;gap:8px;flex:none;min-height:52px;padding:9px 14px;font-size:19px;}
#hubScreen .creation-preview {
  height:auto;aspect-ratio:1.45;border:0;border-radius:17px;background:radial-gradient(ellipse at 50% 35%,#fffaf0,#e7e0c9);
  overflow:hidden;cursor:pointer;
}
#hubScreen .creation-preview img {width:100%;height:100%;object-fit:cover;border:0;transition:transform .2s ease;}
#hubScreen .creation-preview:hover img {transform:scale(1.035);}
#hubScreen .creation-card>div {padding:15px 12px 3px;}
#hubScreen .creation-card h3 {font:900 25px/1.2 var(--kid-font);margin:0 0 6px;overflow-wrap:anywhere;}
#hubScreen .creation-card p {font:600 16px/1.4 var(--kid-font);color:var(--family-muted);margin:0;}
#hubScreen .creation-actions {display:flex;flex-wrap:wrap;gap:10px;margin-top:17px;}
#hubScreen .creation-actions>.royal-button {flex:1 0 100%;font-size:19px;min-height:56px;}
#hubScreen .creation-grownups {width:100%;margin:0;text-align:center;}
#hubScreen .creation-grownups summary {min-height:48px;padding:12px 8px;font:700 15px/1.5 var(--kid-font);color:var(--family-muted);cursor:pointer;}
#hubScreen .creation-grownups .text-link {min-height:48px!important;font-size:16px!important;}
#hubScreen .illustrated-empty {
  display:grid;grid-template-columns:minmax(200px,.9fr) minmax(0,1.1fr);grid-template-rows:1fr auto auto 1fr;
  align-items:center;text-align:left;gap:10px 30px;padding:28px 38px;min-height:305px;
  background:radial-gradient(ellipse at 20% 55%,#e6e9d3 0,transparent 48%),var(--family-paper);
}
#hubScreen .illustrated-empty>img {grid-column:1;grid-row:1/5;width:100%;height:255px;max-width:340px;object-fit:contain;margin:auto;filter:drop-shadow(0 12px 10px #52644318);}
#hubScreen .illustrated-empty h3 {grid-column:2;grid-row:2;margin:0;max-width:20ch;font:900 clamp(25px,2.6vw,34px)/1.2 var(--kid-font);}
#hubScreen .illustrated-empty p {grid-column:2;grid-row:3;margin:0;max-width:34ch;font:600 18px/1.5 var(--kid-font);}
#hubScreen .illustrated-empty>.royal-button {grid-column:2;grid-row:4;justify-self:start;align-self:start;min-height:58px;margin-top:8px;font-size:19px;}
#hubScreen .bookmark-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;}
#hubScreen .bookmark-grid>a {padding:10px;border:1px solid var(--family-line);border-radius:22px;background:var(--family-paper);box-shadow:0 4px 0 #cbbd9b33;color:var(--family-ink);}
#hubScreen .bookmark-grid .scene-art {aspect-ratio:1.3;border-radius:15px;overflow:hidden;}
#hubScreen .bookmark-grid h3 {font:900 24px/1.2 var(--kid-font);margin:14px 7px 8px;}
#hubScreen .bookmark-grid p {font:700 16px/1.4 var(--kid-font);color:var(--family-grove);margin:0 7px 10px;}
#hubScreen .small-empty {
  display:grid;grid-template-columns:100px minmax(0,1fr);gap:8px 22px;align-items:center;padding:26px;
  border:1px solid var(--family-line);border-radius:22px;background:var(--family-paper);
}
#hubScreen .small-empty>img {grid-row:1/3;width:100%;height:112px;object-fit:contain;}
#hubScreen .small-empty p {font:700 21px/1.4 var(--kid-font);margin:0;max-width:29ch;}
#hubScreen .small-empty .text-link {grid-column:2;margin:0;justify-self:start;font-size:18px;color:var(--family-river);font-weight:900;}
#hubScreen .collection-keepsake {
  margin:26px 0 0;padding:22px 28px;min-height:0;display:flex;flex-direction:row;align-items:center;gap:20px;
  background:#e6e9d9;border:1px solid #c4ccb0;border-radius:21px;color:var(--family-grove);
}
#hubScreen .collection-keepsake h2 {font:900 25px/1.25 var(--kid-font);color:#3c5031;margin:0 0 5px;}
#hubScreen .collection-keepsake h2 br {display:none;}
#hubScreen .collection-keepsake p {font:600 16px/1.4 var(--kid-font);color:#526446;margin:0;}
#hubScreen .collection-keepsake>div:last-child {display:flex;gap:20px;}
#hubScreen .collection-keepsake .toy-icon {width:40px;height:40px;}
#hubScreen .collection-import-tools {margin:20px 0 0;padding:8px 2px;color:var(--family-muted);font-size:16px;}
#hubScreen .collection-import-tools summary {min-height:48px;padding:12px 0;cursor:pointer;}
#hubScreen .import-creation {margin:8px 0 12px;font-size:16px;min-height:48px;background:var(--family-paper);}

/* A calm medal cabinet. Earned medals keep their full artwork and warm brass. */
#hubScreen .achievement-banner {
  display:grid;grid-template-columns:110px minmax(0,1fr) auto;gap:22px;align-items:center;
  border:1px solid #8d7853;border-radius:24px;background:linear-gradient(125deg,#3f5c6b,#1e2a3a);
  padding:22px 30px;box-shadow:0 5px 0 #b4a37c33;margin:0 0 24px;
}
#hubScreen .achievement-banner>img {width:110px;height:126px;object-fit:contain;filter:drop-shadow(0 7px 8px #0d17263d);}
#hubScreen .achievement-banner span {font:800 14px/1.35 var(--kid-font);letter-spacing:1px;color:#e7d7b6;}
#hubScreen .achievement-banner h2 {font:900 34px/1.15 var(--kid-font);color:#fffaf0;margin:5px 0 7px;}
#hubScreen .achievement-banner p {color:#ede5d5;font:600 18px/1.4 var(--kid-font);margin:0;}
#hubScreen .achievement-banner>strong {
  display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-width:100px;min-height:100px;margin:0;
  padding:14px;border:1px solid #c8a96a;border-radius:50%;background:#1e2a3a70;color:#e1c48e;font:900 38px/1 var(--kid-font);
}
#hubScreen .achievement-banner strong small {margin:0;max-width:8ch;color:#e1cfa9;letter-spacing:.5px;font:800 11px/1.3 var(--kid-font);text-align:center;}
#hubScreen .reward-grid {grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;}
#hubScreen .reward-card {display:flex;flex-direction:column;align-items:center;padding:18px 16px;min-width:0;}
#hubScreen .reward-card.earned {border:1px solid #bda06a;background:linear-gradient(#fcf6e8,#f5e7c6);}
#hubScreen .reward-card>img {width:100%;height:130px;object-fit:contain;margin:0 0 12px;}
#hubScreen .reward-card:not(.earned)>img {opacity:.65;filter:saturate(.45);}
#hubScreen .reward-card.earned>img {opacity:1;filter:drop-shadow(0 5px 8px #b08a4720);}
#hubScreen .reward-card .reward-status {
  display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:4px 9px;border-radius:9px;
  background:#ece8dd;color:#5b645f!important;letter-spacing:0;text-transform:none;font:800 14px/1.25 var(--kid-font);
}
#hubScreen .reward-card.earned .reward-status {background:#e0e6cf;color:#465b32!important;}
#hubScreen .reward-card h2 {font:900 22px/1.18 var(--kid-font);margin:12px 0 7px;color:#1e2a3a!important;}
#hubScreen .reward-card p {font:600 16px/1.4 var(--kid-font);color:var(--family-muted)!important;margin:0 0 14px;min-height:0;}
#hubScreen .reward-card .royal-progress {width:100%;height:8px;border-radius:6px;margin-top:auto;background:#e5dfd0;overflow:hidden;}
#hubScreen .reward-card .royal-progress i {background:#81915e;}
#hubScreen .reward-card.earned .royal-progress i {background:#b5934f;}
#hubScreen .reward-card>small {font:800 14px/1.2 var(--kid-font);color:var(--family-muted)!important;margin:9px 0 0;}

/* Family space: builder identity first, then progress, then grown-up tools. */
#hubScreen[data-hub-view=parents] .family-profiles {margin:0 0 24px;min-height:0;}
#hubScreen .profile-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:18px;margin:0;}
#hubScreen .family-profile {
  position:relative;width:100%;min-width:0;min-height:220px;padding:24px 16px 20px;
  border:2px solid var(--family-line);outline:none;transition:transform .15s ease,border-color .15s ease;
}
#hubScreen .family-profile.active {border:2px solid #778c66;background:#eff1e5;outline:none;box-shadow:0 4px 0 #acb89840;}
#hubScreen .family-profile.active::after {
  content:'✓';position:absolute;top:12px;right:12px;display:grid;place-items:center;width:29px;height:29px;
  background:#556b3e;color:#fffaf0;border:2px solid #fffaf0;border-radius:50%;font:900 18px/1 var(--kid-font);
}
#hubScreen .family-profile img {width:112px;height:112px;margin:0 auto 14px;border:1px solid #c5ae7f;background:#efe1bc;box-shadow:0 4px 10px #80654114;}
#hubScreen .family-profile b {font:900 25px/1.2 var(--kid-font);overflow-wrap:anywhere;}
#hubScreen .family-profile span {font:700 15px/1.35 var(--kid-font);margin-top:8px;color:var(--family-muted)!important;}
#hubScreen .family-profile.active>span {color:#4d6239!important;}
#hubScreen .family-profile.add-builder {gap:10px;background:#f6efdf;border-style:dashed;}
#hubScreen .family-profile.add-builder>.toy-icon {width:88px;height:88px;min-height:88px;margin:0 0 8px;color:#809078!important;}
#hubScreen .family-profile.add-builder>b {font-size:23px;}
#hubScreen .family-profile:hover {transform:translateY(-2px);border-color:#778c66;}
#hubScreen .parent-summary {display:block;margin:0 0 24px;padding:25px 28px;}
#hubScreen .parent-summary h2 {font:900 28px/1.25 var(--kid-font);margin:0 0 20px;overflow-wrap:anywhere;}
#hubScreen .parent-stats {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0;}
#hubScreen .parent-stats>div {padding:16px 14px;border:0;border-radius:17px;background:#f0ecdF;}
#hubScreen .parent-stats>div:nth-child(2) {background:#e9ece3;}
#hubScreen .parent-stats>div:nth-child(3) {background:#e8edef;}
#hubScreen .parent-stats>div:nth-child(4) {background:#f1e5cd;}
#hubScreen .parent-stats strong {font:900 36px/1.1 var(--kid-font);color:#3f5c6b;}
#hubScreen .parent-stats strong small {font:700 17px/1 var(--kid-font);color:#637177;}
#hubScreen .parent-stats>div>span {font:700 16px/1.35 var(--kid-font);color:#52616a;margin-top:7px;}
#hubScreen .parent-progress-details {margin-top:20px;padding-top:3px;border-top:1px solid #ddd2bb;}
#hubScreen :is(.parent-progress-details,.family-notes,.keyboard-panel)>summary {font:800 17px/1.4 var(--kid-font);min-height:52px;padding:15px 0;cursor:pointer;color:var(--family-river);}
#hubScreen .parent-progress-list {gap:16px;margin:10px 0 14px;}
#hubScreen .parent-progress-list>div {display:grid;grid-template-columns:minmax(180px,1fr) minmax(100px,1fr) auto;gap:14px;align-items:center;}
#hubScreen .parent-progress-list span {min-width:0;font:700 16px/1.4 var(--kid-font);}
#hubScreen .parent-progress-list b {font:800 15px/1.4 var(--kid-font);color:var(--family-grove);}
#hubScreen .parent-progress-list .royal-progress {height:9px;border-radius:5px;background:#e5dfd0;}
#hubScreen .parent-progress-list .royal-progress i {background:#81915e;}
#hubScreen .parent-two-col {grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;margin:0;}
#hubScreen .settings-panel {min-width:0;padding:26px;}
#hubScreen .settings-panel h2 {gap:12px;font:900 27px/1.2 var(--kid-font);margin:0 0 16px;}
#hubScreen .settings-panel h2 .toy-icon {width:30px;height:30px;flex-shrink:0;color:#7e693f;}
#hubScreen .settings-panel>p {font:500 17px/1.6 var(--kid-font);margin:10px 0 18px;color:var(--family-muted)!important;}
#hubScreen .parent-two-col .royal-button {font-size:16px;min-height:52px;}
#hubScreen .parent-two-col .backup-actions>button {background:var(--family-river);border:1px solid #344e5b;color:#fffaf0;}
#hubScreen .backup-actions {gap:10px;margin:18px 0 0;}
#hubScreen .backup-actions .royal-button {padding:12px 16px;}
#hubScreen .settings-panel .quiet-note {font:500 15px/1.5 var(--kid-font)!important;color:#59645c!important;margin-top:15px;}
#hubScreen .family-notes p {font:500 16px/1.6 var(--kid-font);margin:6px 0 14px;}
#hubScreen .text-link {font-size:16px;min-height:48px;color:var(--family-river);}
#hubScreen .text-link.danger {color:#984733;}

/* Comfortable settings. The entire labelled row remains the switch target. */
#hubScreen .settings-layout {grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;align-items:start;}
#hubScreen .settings-layout>.settings-panel:not(.backup-panel):not(.keyboard-panel) {padding:26px;}
#hubScreen .settings-layout .setting-row {gap:18px;min-height:108px;padding:18px 0;border-top:1px solid #e0d6c0;}
#hubScreen .setting-row>span {min-width:0;}
#hubScreen .setting-row b {font:900 20px/1.25 var(--kid-font);color:var(--family-ink);}
#hubScreen .setting-row small {font:500 16px/1.5 var(--kid-font);color:var(--family-muted);max-width:40ch;margin-top:6px;}
#hubScreen .setting-row input[type=checkbox] {
  appearance:none;flex:0 0 64px;width:64px;min-width:64px;height:38px;min-height:38px;margin:0;
  border:2px solid #9aabac;border-radius:24px;background:#dce1d9;box-shadow:none;position:relative;
}
#hubScreen .setting-row input[type=checkbox]::before {
  width:26px;height:26px;left:4px;top:4px;border:0;border-radius:50%;background:#fffaf0;
  box-shadow:0 2px 4px #1e2a3a2b;transition:transform .2s ease;
}
#hubScreen .setting-row input:checked {border-color:#4d6542;background:#637e51;}
#hubScreen .setting-row input:checked::before {transform:translateX(26px);background:#fffaf0;}
#hubScreen .setting-row select {width:118px;min-width:110px;max-width:130px;min-height:52px;padding:10px;border:1px solid #aebdb7;border-radius:13px;background:#f4f5ea;color:var(--family-ink);font:700 16px/1.2 var(--kid-font)!important;}
#hubScreen .settings-layout .keyboard-panel {grid-column:1/-1;padding:4px 26px;}
#hubScreen .shortcut-list {padding:4px 0 18px;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 24px;}
#hubScreen .shortcut-list span {font:600 15px/1.5 var(--kid-font);min-height:40px;color:var(--family-muted);}
#hubScreen .shortcut-list kbd {padding:7px 9px;background:#f1ecdE;color:#3f5c6b;border:1px solid #d1c4a9;font-size:12px;}
#hubScreen .settings-layout .backup-panel {grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:26px;align-items:center;padding:25px 28px;}
#hubScreen .backup-panel h2 {grid-column:1;font-size:25px;margin:0 0 8px;}
#hubScreen .backup-panel>p {grid-column:1;margin:0;max-width:66ch;}
#hubScreen .backup-panel>.royal-button {grid-column:2;grid-row:1/3;min-height:56px;font-size:17px;}
#hubScreen .backup-panel .quiet-note {display:block;grid-column:1/-1;margin:16px 0 0;}
#hubScreen .backup-panel .asset-credits {grid-column:1/-1;font-size:13px;margin-top:12px;}
#hubScreen .backup-panel .asset-credits a {color:var(--family-river);text-underline-offset:3px;}

/* Profile dialog only: build/help dialogs have their own play styling. */
#platformDialog:has(#profileForm) {background:#fffaf0;border:2px solid #c8b58c;border-radius:26px;box-shadow:0 22px 70px #12203366;padding:30px;}
#platformDialog:has(#profileForm) h2 {font:900 29px/1.2 var(--kid-font);color:#1e2a3a;padding-right:32px;}
#platformDialog:has(#profileForm) .dialog-close {width:48px;height:48px;min-height:48px;background:#e8ecdf;border:1px solid #c6d0b9;color:#3f5c6b;border-radius:50%;}
#platformDialog #profileForm .form-label {font:800 17px/1.4 var(--kid-font);color:#3f5c6b;margin:22px 0;}
#platformDialog #profileForm .form-label input {font:700 20px/1.4 var(--kid-font);min-height:58px;border:2px solid #c5cfbf;border-radius:14px;background:#fffdf7;color:#1e2a3a;margin-top:9px;padding:13px 15px;}
#platformDialog #profileForm .avatar-choice {gap:12px;margin:20px 0 26px;}
#platformDialog #profileForm .avatar-choice legend {font:800 17px/1.4 var(--kid-font);color:#3f5c6b;margin-bottom:12px;}
#platformDialog #profileForm .avatar-choice label {padding:20px 9px 12px;border:2px solid #ddd3bc;border-radius:18px;background:#f5efdf;}
#platformDialog #profileForm .avatar-choice label:has(input:checked) {border-color:#718960;background:#e9eddf;box-shadow:0 3px 0 #b5c1a5;}
#platformDialog #profileForm .avatar-choice label:has(input:focus-visible) {outline:3px solid #b8733a;outline-offset:4px;}
#platformDialog #profileForm .avatar-choice input {appearance:auto;min-height:0;width:18px;height:18px;top:9px;right:9px;accent-color:#556b3e;}
#platformDialog #profileForm .avatar-choice img {height:95px;max-width:100%;object-fit:contain;}
#platformDialog #profileForm .avatar-choice span {font:800 16px/1.4 var(--kid-font);color:#1e2a3a;}
#platformDialog #profileForm>.royal-button {min-height:58px;border:1px solid #314a57;border-radius:17px;background:#3f5c6b;color:#fffaf0;font:900 20px/1.3 var(--kid-font);box-shadow:0 4px 0 #263d49;}

@media(max-width:1050px) {
  #hubScreen .creation-grid,#hubScreen .bookmark-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  #hubScreen .reward-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
  #hubScreen .settings-layout {grid-template-columns:1fr;}
  #hubScreen .settings-layout .setting-row {min-height:100px;}
}
@media(max-width:760px) {
  #hubScreen:not(.map-view) {padding:22px 18px 28px;}
  #hubScreen:not(.map-view) .hub-heading {gap:14px;margin-bottom:20px;}
  #hubScreen:not(.map-view) .hub-heading p {font-size:16px;}
  #hubScreen .parent-two-col {grid-template-columns:1fr;}
  #hubScreen .illustrated-empty {grid-template-columns:minmax(160px,.85fr) minmax(0,1.15fr);gap:8px 20px;padding:22px;}
  #hubScreen .illustrated-empty>img {height:215px;}
  #hubScreen .illustrated-empty h3 {font-size:27px;}
  #hubScreen .illustrated-empty p {font-size:17px;}
  #hubScreen .reward-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
  #hubScreen .reward-card {padding:18px 13px;}
  #hubScreen .reward-card h2 {font-size:21px;}
  #hubScreen .reward-card p {font-size:16px;}
  #hubScreen .reward-card>img {height:120px;}
  #hubScreen .collection-keepsake>div:last-child {gap:14px;}
  #hubScreen .collection-keepsake .toy-icon {width:30px;height:30px;}
  #hubScreen .parent-stats {grid-template-columns:repeat(2,minmax(0,1fr));}
  #hubScreen .shortcut-list {grid-template-columns:1fr;}
}
@media(max-width:540px) {
  #hubScreen:not(.map-view) {padding:20px 14px 28px;}
  #hubScreen:not(.map-view) .hub-heading h1 {font-size:29px;letter-spacing:-.6px;}
  #hubScreen:not(.map-view) .hub-heading>div:first-child {flex-basis:100%;}
  #hubScreen:not(.map-view) #hubHeadingActions {width:100%;gap:10px;}
  #hubScreen:not(.map-view) #hubHeadingActions>.royal-button.gold {flex:1;font-size:17px;min-height:54px;}
  #hubScreen .keepsake-tabs {gap:4px;padding:5px;border-radius:20px;margin-bottom:21px;}
  #hubScreen .keepsake-tabs button {flex-direction:column;min-height:80px;padding:9px 3px;gap:7px;font-size:16px;line-height:1.15;border-radius:15px;}
  #hubScreen .keepsake-tabs .toy-icon {width:27px;height:27px;}
  #hubScreen .collection-section>h2 {font-size:22px;margin-bottom:13px;}
  #hubScreen .collection-section>h2>span {font-size:14px;}
  #hubScreen .creation-grid {grid-template-columns:1fr;gap:18px;}
  #hubScreen .creation-preview {aspect-ratio:1.5;}
  #hubScreen .creation-card h3 {font-size:26px;}
  #hubScreen .creation-card-heading h3 {font-size:22px;}
  #hubScreen[data-hub-view=collection] .hub-heading {gap:12px;margin-bottom:16px;}
  #hubScreen[data-hub-view=collection] .hub-heading p {display:none;}
  #hubScreen[data-hub-view=collection] .keepsake-tabs {margin-bottom:16px;}
  #hubScreen[data-hub-view=collection] .keepsake-tabs button {min-height:66px;gap:4px;padding:6px 3px;}
  #hubScreen .illustrated-empty {display:grid;grid-template-columns:96px minmax(0,1fr);grid-template-rows:auto auto auto;gap:16px 12px;text-align:left;padding:20px;min-height:0;background:radial-gradient(ellipse at 18% 20%,#e7e9d8 0,transparent 55%),var(--family-paper);}
  #hubScreen .illustrated-empty>img {grid-column:1;grid-row:1;width:110px;height:110px;max-width:110px;margin:0 0 0 -7px;}
  #hubScreen .illustrated-empty h3 {grid-column:2;grid-row:1;font-size:24px;max-width:19ch;}
  #hubScreen .illustrated-empty p {grid-column:1/-1;grid-row:2;font-size:17px;margin:0;max-width:none;}
  #hubScreen .illustrated-empty>.royal-button {grid-column:1/-1;grid-row:3;align-self:stretch;justify-self:stretch;font-size:18px;margin:0;min-height:56px;}
  #hubScreen .bookmark-grid {gap:12px;}
  #hubScreen .bookmark-grid>a {padding:6px;border-radius:17px;}
  #hubScreen .bookmark-grid .scene-art {aspect-ratio:1;border-radius:12px;}
  #hubScreen .bookmark-grid h3 {font-size:20px;margin:12px 5px 7px;}
  #hubScreen .bookmark-grid p {font-size:15px;margin:0 5px 8px;}
  #hubScreen .small-empty {grid-template-columns:75px minmax(0,1fr);padding:22px 18px;gap:6px 16px;}
  #hubScreen .small-empty>img {height:95px;}
  #hubScreen .small-empty p {font-size:19px;}
  #hubScreen .small-empty .text-link {font-size:17px;}
  #hubScreen .collection-keepsake {padding:19px;gap:14px;}
  #hubScreen .collection-keepsake h2 {font-size:23px;}
  #hubScreen .collection-keepsake>div:last-child {display:none;}
  #hubScreen .achievement-banner {grid-template-columns:76px minmax(0,1fr);gap:15px;padding:21px 19px;border-radius:22px;}
  #hubScreen .achievement-banner>img {width:76px;height:105px;}
  #hubScreen .achievement-banner h2 {font-size:28px;}
  #hubScreen .achievement-banner span {font-size:12px;letter-spacing:.5px;}
  #hubScreen .achievement-banner p {font-size:17px;}
  #hubScreen .achievement-banner>strong {display:none;}
  #hubScreen .reward-card {border-radius:20px;padding:15px 10px;}
  #hubScreen .reward-card>img {height:108px;margin-bottom:10px;}
  #hubScreen .reward-card h2 {font-size:21px;}
  #hubScreen .reward-card .reward-status {font-size:13px;padding:5px 7px;}
  #hubScreen .reward-card p {font-size:16px;line-height:1.4;}
  #hubScreen .profile-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
  #hubScreen .family-profile {min-height:205px;padding:21px 10px 17px;border-radius:21px;}
  #hubScreen .family-profile img {width:88px;height:88px;margin-bottom:13px;}
  #hubScreen .family-profile b {font-size:22px;}
  #hubScreen .family-profile span {font-size:14px;}
  #hubScreen .family-profile.add-builder>.toy-icon {width:68px;height:68px;min-height:68px;}
  #hubScreen .family-profile.add-builder>b {font-size:21px;}
  #hubScreen .family-profile.active::after {top:9px;right:9px;width:25px;height:25px;font-size:16px;}
  #hubScreen .parent-summary {padding:21px 18px;}
  #hubScreen .parent-summary h2 {font-size:25px;margin-bottom:17px;}
  #hubScreen .parent-stats {gap:10px;}
  #hubScreen .parent-stats>div {padding:15px 12px;}
  #hubScreen .parent-stats strong {font-size:32px;}
  #hubScreen .parent-stats>div>span {font-size:15px;}
  #hubScreen .parent-progress-list>div {grid-template-columns:minmax(0,1fr) auto;gap:7px 12px;}
  #hubScreen .parent-progress-list span {grid-column:1/-1;}
  #hubScreen .settings-panel,#hubScreen .settings-layout>.settings-panel:not(.backup-panel):not(.keyboard-panel) {padding:22px 18px;border-radius:22px;}
  #hubScreen .settings-panel h2 {font-size:25px;gap:10px;}
  #hubScreen .settings-panel h2 .toy-icon {width:27px;height:27px;}
  #hubScreen .settings-panel>p {font-size:16px;}
  #hubScreen .settings-layout .setting-row {padding:18px 0;gap:13px;}
  #hubScreen .setting-row b {font-size:19px;}
  #hubScreen .setting-row small {font-size:16px;}
  #hubScreen .setting-row:has(select) {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;}
  #hubScreen .setting-row select {width:100%;max-width:none;min-height:52px;}
  #hubScreen .backup-actions>* {width:100%;justify-content:center;}
  #hubScreen .settings-layout .keyboard-panel {padding:4px 18px;}
  #hubScreen .settings-layout .backup-panel {display:flex;flex-direction:column;align-items:stretch;padding:22px 18px;gap:12px;}
  #hubScreen .backup-panel h2,#hubScreen .backup-panel>p {margin:0;}
  #hubScreen .backup-panel>.royal-button {font-size:17px;min-height:54px;}
  #hubScreen .backup-panel .quiet-note {margin:0;}
  #platformDialog:has(#profileForm) {padding:25px 18px;width:calc(100vw - 28px);}
  #platformDialog:has(#profileForm) h2 {font-size:26px;padding-right:40px;}
  #platformDialog #profileForm .avatar-choice {gap:8px;}
  #platformDialog #profileForm .avatar-choice label {padding:24px 5px 12px;border-radius:15px;}
  #platformDialog #profileForm .avatar-choice img {height:74px;}
  #platformDialog #profileForm .avatar-choice span {font-size:16px;}
}
@media(max-width:380px) and (max-height:640px) {
  /* Keep the complete profile action inside the rounded small-phone dialog. */
  #platformDialog:has(#profileForm) {padding-block:18px;}
  #platformDialog #profileForm .form-label {margin-block:16px;}
  #platformDialog #profileForm .avatar-choice {margin-bottom:18px;}
}
@media(max-height:500px) and (min-width:541px) {
  #hubScreen:not(.map-view) {padding-top:18px;}
  #hubScreen:not(.map-view) .hub-heading {margin-bottom:17px;}
  #hubScreen:not(.map-view) .hub-heading h1 {font-size:28px;}
  #hubScreen .keepsake-tabs button {min-height:58px;font-size:17px;}
  #hubScreen .illustrated-empty {min-height:230px;}
  #hubScreen .illustrated-empty>img {height:190px;}
  #platformDialog #profileForm .avatar-choice img {height:70px;}
}
@media(prefers-reduced-motion:reduce) {
  #hubScreen .creation-preview img,#hubScreen .family-profile,#hubScreen .setting-row input[type=checkbox]::before {transition:none;}
  #hubScreen .creation-preview:hover img,#hubScreen .family-profile:hover {transform:none;}
}
