/* A pocket and a pad share the same live apps; only their surrounding UI changes. */
.device-shell,
.device-window-home { display: none; }
.device-shell[hidden],
.device-shell [hidden],
.os-workspace-exit[hidden],
.app-window[hidden] { display: none !important; }

.menu-bar .menu-left > button.os-workspace-exit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid #cfbfdc;
  border-radius: 7px;
  background: #faf4f985;
  color: #80678b;
  font-size: 10px;
}
.os-workspace-exit svg { width: 13px; height: 13px; }
.os-workspace-exit:hover { background: #f6edf9; }

/* Keep the desktop tray close to the screen edge, including maximized apps. */
html[data-device="desktop"] .dock-wrap { bottom: 6px; }

html:is([data-device="phone"], [data-device="tablet"]) {
  --device-status-height: calc(52px + var(--display-safe-top, env(safe-area-inset-top, 0px)));
  --device-dock-bottom: max(8px, var(--display-safe-bottom, env(safe-area-inset-bottom, 0px)));
  --device-dock-height: 80px;
  --device-dock-clearance: calc(var(--device-dock-bottom) + var(--device-dock-height) + 10px);
  --device-home-bottom: calc(var(--device-dock-bottom) + var(--device-dock-height) + 58px);
  --device-ink: #67556f;
  --device-muted: #a28b9f;
  --device-paper: #fffaf4;
}
html:is([data-device="phone"], [data-device="tablet"]) #screen {
  --device-wash-a: #edd7ca;
  --device-wash-b: #dfd5eb;
  --device-wash-c: #e1e5d7;
  height: 100dvh !important;
  min-height: 0 !important;
  background:
    radial-gradient(ellipse at 4% 5%, var(--device-wash-a), transparent 58%),
    radial-gradient(ellipse at 95% 64%, var(--device-wash-b), transparent 65%),
    radial-gradient(ellipse at 30% 100%, var(--device-wash-c), transparent 70%),
    #f5eee8;
  text-shadow: none !important;
}
html:is([data-device="phone"], [data-device="tablet"]) #screen[data-wallpaper="lavender"] {
  --device-wash-a: #e5ddef;
  --device-wash-b: #cbd3e8;
  --device-wash-c: #eedbcc;
}
html:is([data-device="phone"], [data-device="tablet"]) #screen[data-wallpaper="sage"] {
  --device-wash-a: #e6e8d5;
  --device-wash-b: #cdded3;
  --device-wash-c: #e5dce5;
}
html:is([data-device="phone"], [data-device="tablet"]) .screen::before,
html:is([data-device="phone"], [data-device="tablet"]) .screen::after {
  content: none !important;
  display: none !important;
}
html:is([data-device="phone"], [data-device="tablet"]) :is(.menu-bar, .social-panel, #desktop-icons, .desktop-note, .desktop-whisper, .dock-wrap, .wallpaper) {
  display: none !important;
}
html:is([data-device="phone"], [data-device="tablet"]) .device-shell {
  display: block;
  position: absolute;
  inset: 0;
  z-index: auto;
  pointer-events: none;
  color: var(--device-ink);
}

/* The shell is not a stacking context: bars stay above the separate window layer. */
.device-statusbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 450;
  display: grid;
  grid-template-columns: minmax(44px, 1fr) minmax(0, 196px) minmax(44px, 1fr);
  gap: 8px;
  align-items: center;
  height: var(--device-status-height);
  padding: var(--display-safe-top, env(safe-area-inset-top, 0px)) max(12px, var(--display-safe-right, env(safe-area-inset-right, 0px))) 0 max(12px, var(--display-safe-left, env(safe-area-inset-left, 0px)));
  color: #6d5e74;
  pointer-events: none;
}
.device-clock, .device-status-symbols { display: none !important; }
.device-system-name { grid-column: 2; grid-row: 1; justify-self: center; color: #927e9d; font: italic 18px/1.2 Georgia, serif; letter-spacing: -.3px; }
.device-display-toggle,
.device-recents-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #826d8d;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: auto;
}
.device-display-toggle { grid-column: 1; grid-row: 1; justify-self: start; }
.device-recents-toggle { grid-column: 3; grid-row: 1; justify-self: end; }
.device-display-toggle svg, .device-recents-toggle svg { width: 19px; height: 19px; flex: none; }
.device-display-toggle:active, .device-recents-toggle:active { background: #fffaf79c; }
.device-shell button:focus-visible { outline: 3px solid #a68ab8; outline-offset: 3px; }
.device-shell button:disabled { opacity: .45; cursor: default; }

.device-home {
  position: absolute;
  inset: var(--device-status-height) 0 var(--device-home-bottom);
  z-index: 2;
  overflow: hidden;
  padding: 0;
  pointer-events: auto;
  outline: none;
}
.device-home-pager {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  touch-action: pan-x pinch-zoom;
  outline: none;
}
.device-home-page {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 15px max(20px, var(--display-safe-right, env(safe-area-inset-right, 0px))) 16px max(20px, var(--display-safe-left, env(safe-area-inset-left, 0px)));
  scroll-snap-align: start;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  touch-action: pan-x pinch-zoom;
}
.device-home-probe { visibility: hidden !important; z-index: -1; pointer-events: none !important; }
.device-home-probe > .device-home-page { position: absolute; inset: 0; }
.device-home-pager::-webkit-scrollbar, .device-home-page::-webkit-scrollbar { display: none; }
.device-home-inner { max-width: 520px; margin: 0 auto; }
.device-page-heading { padding: 9px 4px 22px; }
.device-page-heading h2 { margin: 0 0 6px; color: #806c8b; font-size: 20px; line-height: 1.4; font-weight: 550; letter-spacing: .3px; }
.device-page-heading :is(p, small) { display: block; margin: 0; color: #a18ca6; font-size: 10px; line-height: 1.7; }
.device-widgets { display: grid; gap: 20px; margin-bottom: 21px; }
.device-welcome-widget,
.device-note-widget {
  display: block;
  position: relative;
  min-width: 0;
  min-height: 216px;
  overflow: hidden;
  padding: 19px 22px;
  border: 1px solid #fffdf2e8;
  border-radius: 27px;
  background: linear-gradient(135deg, #fffaf4f2, #fff7f0b8);
  box-shadow: 0 9px 28px -17px #84688045, inset 0 1px 0 #fffef8;
  color: var(--device-ink);
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
}
.device-widget-date { display: block; position: relative; z-index: 1; color: #a18d96; font-size: 10px; letter-spacing: .6px; }
.device-welcome-copy { display: block; position: relative; z-index: 1; max-width: calc(100% - 78px); margin-top: 12px; }
.device-welcome-copy > small { display: block; color: #ae98ab; font-size: 7px; line-height: 1.7; letter-spacing: 1.1px; }
.device-welcome-copy > strong { display: block; margin: 6px 0 7px; font-size: 18px; line-height: 1.5; font-weight: 550; }
.device-welcome-copy em { display: block; max-width: 100%; overflow: hidden; font: italic 35px/1.08 Georgia, "Times New Roman", serif; color: #a085ad; text-overflow: ellipsis; white-space: nowrap; }
.device-welcome-copy > span { display: block; font-size: 11px; line-height: 1.6; color: #a5949f; }
.device-avatar { position: absolute; top: 67px; right: 20px; z-index: 2; display: block; width: 76px; height: 76px; object-fit: cover; border: 4px solid #fffdf9; border-radius: 23px; background: #f1edf7; box-shadow: 0 4px 14px #9d7fa321; transform: rotate(4deg); }
.device-widget-footnote { position: absolute; bottom: 17px; left: 22px; z-index: 1; display: flex; align-items: center; gap: 6px; font-size: 9px; color: #a3978e; }
.device-widget-footnote i { width: 5px; height: 5px; border-radius: 50%; background: #a9b395; box-shadow: 0 0 0 3px #b9c5a517; }
.device-widget-footnote svg { width: 12px; height: 12px; margin-left: 5px; color: #b6a3b9; }
.device-welcome-widget > .device-widget-bloom { position: absolute; right: 3px; bottom: -6px; width: 74px; height: 83px; opacity: .8; transform: rotate(14deg); }
.device-note-widget { display: none; }
.device-note-label { display: block; font-size: 8px; letter-spacing: 1.8px; color: #a99b7e; }
.device-note-quote { display: block; margin-top: 19px; font-size: 19px; line-height: 1.8; color: #8d7e69; }
.device-note-quote em { display: block; font-style: normal; color: #a88b92; }
.device-note-widget > .device-note-flower { position: absolute; bottom: 16px; right: 17px; width: 90px; height: 100px; transform: rotate(7deg); }
.device-note-count { position: absolute; bottom: 24px; left: 24px; display: flex; align-items: baseline; gap: 8px; color: #ab9782; }
.device-note-count b { font: italic 27px/1 Georgia, serif; color: #aa929b; }
.device-note-count > span { font-size: 9px; }

.device-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; margin-bottom: 10px; padding: 0 3px; }
.device-library-heading h2,
.device-recents > h2 { margin: 0; color: #8b788c; font-size: 12px; line-height: 1.5; font-weight: 550; letter-spacing: .4px; }
.device-library-all { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 5px; min-height: 42px; padding: 5px 0 5px 10px; color: #a38da6; font-size: 10px; }
.device-library-all svg { width: 12px; height: 12px; }
.device-content-status { display: flex; align-items: center; gap: 7px; padding: 8px 4px 16px; font-size: 11px; color: #9b839f; line-height: 1.7; }
.device-content-status button { min-height: 40px; margin-left: auto; padding: 5px 10px; color: #82678f; text-decoration: underline; text-underline-offset: 4px; }
.device-loading-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: #af96b5; }
.device-app-grid { --device-columns: 4; display: grid; grid-template-columns: repeat(var(--device-columns), minmax(0, 1fr)); gap: 18px 10px; margin: 0; padding: 0; list-style: none; }
.device-app-grid > li { min-width: 0; }
.device-app-button { position: relative; display: flex; align-items: center; flex-direction: column; gap: 8px; width: 100%; min-height: 95px; padding: 2px 0 4px; border-radius: 18px; }
.device-app-button .app-icon { width: 60px; height: 60px; border-radius: 19px; box-shadow: inset 0 1.5px 1px #ffffffe6, inset 0 -2px 2px #70528b12, 0 7px 12px -7px #70567e70; }
.device-app-button .app-icon::after,
.device-dock-item .app-icon::after { border-radius: inherit; }
.device-app-button .app-icon > svg { width: 41px; height: 41px; }
.device-app-name { display: -webkit-box; max-width: 100%; overflow: hidden; color: #78647f; font-size: 10px; line-height: 1.45; font-weight: 500; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; text-align: center; }
.device-home-page .device-app-name { height: 2.9em; flex: none; }
.device-app-badge { position: absolute; top: -2px; right: max(0px, calc(50% - 36px)); z-index: 1; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border: 2px solid #f8f2ed; border-radius: 11px; background: #a995b8; color: #fffaf8; font-size: 9px; font-weight: 650; line-height: 1; }
.device-app-button.is-open .device-app-name::after { display: inline-block; width: 3px; height: 3px; margin: 0 0 2px 4px; border-radius: 50%; background: #ac93b2; content: ""; }
.device-app-button:active .app-icon,
.device-dock-item:active .app-icon { transform: scale(.94); }
.device-recents { margin-top: 24px; }
.device-recents > h2 { margin-bottom: 11px; padding-inline: 3px; font-size: 11px; }
.device-recent-list { display: grid; gap: 8px; }
.device-recent-app { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 64px; padding: 10px 13px; border: 1px solid #fffafbd9; border-radius: 17px; background: #fffaf65e; text-align: left; }
.device-recent-app .app-icon { width: 38px; height: 38px; border-radius: 12px; box-shadow: inset 0 1px 1px #fff, 0 3px 7px #80618a12; }
.device-recent-app .app-icon::after { border-radius: 11px; }
.device-recent-app .app-icon > svg { width: 27px; height: 27px; }
.device-recent-app > span:not(.app-icon) { flex: 1; min-width: 0; }
.device-recent-app strong { display: block; overflow: hidden; color: #8b7294; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.device-recent-app small { display: block; margin-top: 3px; color: #b09caf; font-size: 9px; }
.device-recent-app > svg { width: 13px; height: 13px; color: #b59fba; }
.device-home-signature { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 25px 0 5px; color: #b6a1b3; font: italic 11px/1.6 Georgia, serif; }
.device-home-signature svg { width: 12px; height: 12px; }

.device-search-pill,
.device-dock-edit { position: absolute; bottom: calc(var(--device-dock-bottom) + var(--device-dock-height) + 10px); z-index: 440; display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 62px; min-height: 44px; padding: 7px 11px; border: 1px solid #fff8; border-radius: 22px; background: #fffaf65c; color: #957b9f; font-size: 10px; backdrop-filter: blur(12px); pointer-events: auto; }
.device-search-pill { right: max(18px, var(--display-safe-right, env(safe-area-inset-right, 0px))); }
.device-dock-edit { left: max(18px, var(--display-safe-left, env(safe-area-inset-left, 0px))); }
.device-search-pill svg { width: 13px; height: 13px; }
.device-dock-edit svg { width: 13px; height: 13px; }
.device-page-dots { position: absolute; bottom: calc(var(--device-dock-bottom) + var(--device-dock-height) + 10px); left: 50%; z-index: 440; display: flex; align-items: center; justify-content: center; gap: 0; max-width: calc(100% - 186px); min-height: 44px; padding: 0 2px; transform: translateX(-50%); pointer-events: auto; }
.device-page-dots > button { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 44px; border-radius: 14px; }
.device-page-dots > button > span { display: block; width: 5px; height: 5px; border-radius: 6px; background: #b49fba6e; transition: width .18s, background .18s; }
.device-page-dots > button[aria-current="true"] > span { width: 14px; background: #94759f; }
.device-page-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.device-dock { position: absolute; bottom: var(--device-dock-bottom); left: 50%; z-index: 450; display: flex; align-items: center; justify-content: space-around; gap: 8px; width: min(390px, calc(100% - 28px)); min-height: var(--device-dock-height); padding: 10px 14px; border: 1px solid #fffdf2db; border-radius: 29px; background: #fffaf47d; box-shadow: 0 6px 24px -12px #816b8640, inset 0 1px 0 #fff9; transform: translateX(-50%); backdrop-filter: blur(24px) saturate(1.1); pointer-events: auto; }
.device-dock-item { position: relative; display: flex; flex: 1; align-items: center; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; min-height: 58px; padding: 0 2px; border-radius: 18px; }
.device-dock-item .app-icon { width: 56px; height: 56px; border-radius: 18px; box-shadow: inset 0 1.5px 1px #fff, inset 0 -1px 2px #70528b12, 0 4px 8px -5px #70567e70; }
.device-dock-item .app-icon > svg { width: 39px; height: 39px; }
.device-dock-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.device-dock-item.is-open::after { position: absolute; bottom: -5px; left: calc(50% - 1.5px); width: 3px; height: 3px; border-radius: 50%; background: #ab91b4; content: ""; }
.device-dock-item.is-current .app-icon { outline: 3px solid #fffaf8cf; box-shadow: 0 0 0 4px #c1a9cf4d, 0 4px 8px #8f6f9d17; }
.device-dock-item.is-current .device-dock-label { color: #735c82; }
.device-dock-divider { width: 1px; height: 37px; flex: none; margin: 0 3px; background: #bba7c13d; }
.device-dock-item { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.device-dock { transform: translate(calc(-50% + var(--device-dock-drag-x, 0px)), var(--device-dock-drag-y, 0px)) scale(var(--device-dock-drag-scale, 1)); opacity: var(--device-dock-drag-opacity, 1); visibility: visible; transition: none; }
.device-shell[data-dock-view="app"] .device-dock { touch-action: none; }
.device-shell[data-dock-state="hidden"] .device-dock { visibility: hidden; pointer-events: none; }
.device-shell[data-dock-state="preview"] .device-dock { transition: none; }
#screen[data-os-motion="returning"] .device-shell[data-dock-state="home"] .device-dock { transition: none; }
#screen[data-os-motion="returning"] .device-shell[data-dock-state="preview"][data-dock-view="app"] .device-dock { z-index: 1160; }
.device-shell[data-dock-state="opening"] .device-dock { z-index: 1160; }
.device-shell[data-dock-state="dragging"] .device-dock { z-index: 1160; transform: translate(calc(-50% + var(--device-dock-drag-x, 0px)), var(--device-dock-drag-y, 0px)) scale(var(--device-dock-drag-scale, 1)); opacity: var(--device-dock-drag-opacity, 1); visibility: visible; transition: none; }
.device-shell[data-dock-state="settling"] .device-dock { z-index: 1160; }
/* A small invisible target leaves the project's bottom corners fully usable. */
.device-dock-sensor { position: absolute; z-index: 460; bottom: 0; left: 50%; width: min(188px, 52%); height: calc(28px + var(--display-safe-bottom, env(safe-area-inset-bottom, 0px))); margin: 0; padding: 0; border: 0; border-radius: 18px 18px 0 0; background: transparent; box-shadow: none; transform: translateX(-50%); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; pointer-events: auto; }
.device-dock-sensor:focus-visible { outline: 2px solid #b19bc0; outline-offset: -4px; background: #ede3f333; }
.device-shell:not([data-dock-state="hidden"]) .device-dock-sensor { z-index: 449; }
.device-shell[data-dock-state="dragging"] .device-dock-sensor { z-index: 1161; }
body[data-device-view="app"] :is(.device-statusbar, .device-page-dots, .device-dock-edit, .device-search-pill) { display: none; }
/* During an app's flight, the Home page is visible but the shell keeps it inert. */
body[data-device-view="app"] #screen[data-os-backdrop="home"] :is(.device-statusbar, .device-page-dots, .device-dock-edit, .device-search-pill) { display: flex; pointer-events: none; }
body[data-device-view="app"] #screen[data-os-backdrop="home"] .device-statusbar { display: grid; }

/* Small, independent sheets stay below Search (1100) and the owner editor (1200). */
.device-overlay { position: absolute; inset: 0; z-index: 1060; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; pointer-events: auto; }
.device-overlay-scrim { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #6c557950; backdrop-filter: blur(9px); cursor: default; }
.device-sheet,
.device-switcher-sheet { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(100%, 620px); max-height: calc(100% - var(--display-safe-top, env(safe-area-inset-top, 0px)) - 12px); min-height: 0; overflow: hidden; padding: 18px 18px max(16px, var(--display-safe-bottom, env(safe-area-inset-bottom, 0px))); border: 1px solid #fffaf5; border-bottom: 0; border-radius: 29px 29px 0 0; background: #fcf7f2; box-shadow: 0 -12px 50px #59436721; color: #7c6488; outline: none; }
.device-sheet-header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; min-height: 49px; }
.device-sheet-header > div { min-width: 0; }
.device-sheet-header p { margin: 0 0 5px; color: #af97b1; font-size: 8px; line-height: 1.3; letter-spacing: 1.3px; }
.device-sheet-header h2 { margin: 0; color: #7b6087; font-size: 21px; line-height: 1.4; font-weight: 550; }
.device-sheet-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid #e9ddec; border-radius: 15px; background: #f0e6f2; color: #a184aa; }
.device-sheet-close svg { width: 17px; height: 17px; }
.device-sheet-description,
.device-switcher-note { flex: none; margin: 11px 0 14px; color: #a18a9f; font-size: 11px; line-height: 1.7; }
.device-dock-slots { display: grid; flex: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 2px; }
.device-slot { position: relative; display: flex; align-items: center; flex-direction: column; gap: 6px; min-width: 0; min-height: 116px; padding: 15px 4px 10px; border: 1px solid #e8deea; border-radius: 18px; background: #f7eff6; color: #92789d; }
.device-slot:is(.is-selected, [aria-pressed="true"]) { border-color: #ad92bf; background: #eee1f1; box-shadow: 0 0 0 2px #d7c3e575; }
.device-slot-number { position: absolute; top: 4px; left: 7px; color: #b6a2bf; font-size: 8px; line-height: 1.4; }
.device-slot .app-icon { width: 39px; height: 39px; flex: none; border-radius: 13px; }
.device-slot .app-icon > svg { width: 28px; height: 28px; }
.device-slot strong { display: block; width: 100%; overflow: hidden; margin-top: 2px; font-size: 10px; line-height: 1.4; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.device-slot small { font-size: 8px; line-height: 1.4; color: #af98b4; }
.device-slot-move { display: flex; flex: none; align-items: center; gap: 6px; margin: 9px 0 13px; }
.device-slot-move > button { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 8px 12px; border: 1px solid #e9dfeb; border-radius: 13px; background: #f9f2f8; color: #947a9e; font-size: 10px; }
.device-slot-move > button:last-child { margin-left: auto; background: transparent; }
.device-slot-move svg { width: 13px; height: 13px; }
.device-dock-picker { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 88px; overflow: hidden; }
.device-picker-search { display: flex; flex: none; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid #e5d8eb; border-radius: 14px; background: #fffaf7; color: #ac94b4; }
.device-picker-search > svg { flex: none; width: 16px; height: 16px; }
.device-picker-search input { width: 100%; min-width: 0; height: 26px; padding: 0; border: 0; outline: 0; background: transparent; color: #7c6589; font-size: 16px; }
.device-picker-search input::placeholder { color: #b7a0bc; font-size: 11px; }
.device-picker-list { display: grid; align-content: start; gap: 4px; min-height: 0; overflow-y: auto; margin-top: 8px; padding: 3px 1px 6px; overscroll-behavior: contain; }
.device-picker-item { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 57px; padding: 7px 9px; border: 1px solid transparent; border-radius: 14px; text-align: left; }
.device-picker-item:is(.is-selected, [aria-pressed="true"]) { border-color: #e0cfe9; background: #f0e5f4; }
.device-picker-item .app-icon { width: 35px; height: 35px; flex: none; border-radius: 11px; }
.device-picker-item .app-icon > svg { width: 25px; height: 25px; }
.device-picker-item > :not(.app-icon):not(svg) { flex: 1; min-width: 0; }
.device-picker-item strong { display: block; overflow: hidden; color: #8b6c99; font-size: 11px; line-height: 1.5; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.device-picker-item small { display: block; margin-top: 3px; color: #b29ab5; font-size: 9px; }
.device-picker-item > svg { width: 17px; height: 17px; flex: none; margin-left: auto; color: #a187b0; }
.device-editor-feedback { flex: none; min-height: 22px; margin: 10px 2px 0; color: #ab91af; font-size: 10px; line-height: 1.7; }
.device-editor-feedback:empty { min-height: 0; margin: 0; }

.device-switcher-sheet { width: min(100%, 960px); padding-bottom: max(14px, var(--display-safe-bottom, env(safe-area-inset-bottom, 0px))); }
.device-switcher-cards { display: flex; flex: 1 1 auto; align-items: stretch; gap: 16px; min-height: 0; overflow-x: auto; overflow-y: hidden; padding: 5px 4px 12px; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #c7b0d0 transparent; }
.device-app-card { display: flex; flex: 0 0 min(280px, 82%); flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #fffdf9; border-radius: 23px; background: #f8f0f6; box-shadow: 0 6px 18px -12px #76547e5c; scroll-snap-align: center; }
.device-app-card-open { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; padding: 0; overflow: hidden; border-radius: 22px 22px 0 0; text-align: left; }
.device-app-card-art { position: relative; display: grid; place-items: center; flex: 1 1 auto; width: 100%; min-height: 140px; aspect-ratio: 1.2; overflow: hidden; background: radial-gradient(ellipse at 80% 18%, #f4e6d9, transparent 66%), linear-gradient(140deg, #ede0f1, #dfe6dc); }
.device-app-card-art .app-icon { width: 82px; height: 82px; border-radius: 26px; box-shadow: inset 0 2px 0 #fff9, 0 14px 25px -10px #9976aa80; }
.device-app-card-art .app-icon > svg { width: 57px; height: 57px; }
.device-app-card-art > img { width: 100%; height: 100%; max-height: 100%; object-fit: cover; }
.device-app-card-art > span:not(.app-icon) { position: absolute; right: 9px; bottom: 9px; padding: 3px 7px; border: 1px solid #fff7; border-radius: 8px; background: #fffaf4d9; color: #9b809e; font-size: 8px; line-height: 1.5; }
.device-app-card-copy { display: block; flex: none; width: 100%; padding: 14px 16px 12px; }
.device-app-card-copy strong { display: block; overflow: hidden; color: #8b6c97; font-size: 14px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.device-app-card-copy small { display: block; margin-top: 6px; color: #af96b1; font-size: 10px; line-height: 1.5; }
.device-app-card-close { display: flex; flex: none; align-items: center; justify-content: center; align-self: stretch; gap: 5px; min-height: 44px; margin: 0 13px 9px; padding: 8px 12px; border: 1px solid #eadce8; border-radius: 13px; background: #fcf7f7; color: #b48d9e; font-size: 11px; }
.device-app-card-close svg { width: 13px; height: 13px; }
.device-switcher-empty { padding: 40px 18px; color: #ad94b0; font-size: 12px; line-height: 1.8; text-align: center; }
.device-switcher-empty svg { display: block; width: 37px; height: 37px; margin: 0 auto 14px; color: #c0a9c6; }
.device-switcher-footer { display: flex; flex: none; align-items: center; justify-content: center; gap: 12px; padding-top: 9px; }
.device-switcher-footer > p { flex: 1; margin: 0; color: #b39baF; font-size: 9px; line-height: 1.7; }
.device-switcher-footer > button { flex: none; min-height: 44px; padding: 9px 24px; border: 1px solid #dfcde8; border-radius: 15px; background: #eddfF3; color: #987ba5; font-size: 11px; }

/* Apps use the complete viewport; a revealed Dock floats above their content. */
html:is([data-device="phone"], [data-device="tablet"]) #window-layer {
  position: absolute;
  inset: 0 !important;
  z-index: 200;
}
html:is([data-device="phone"], [data-device="tablet"]) #window-layer .app-window.device-background,
html:is([data-device="phone"], [data-device="tablet"]) #window-layer .app-window.minimized { display: none !important; }
html:is([data-device="phone"], [data-device="tablet"]) body[data-device-view="home"] #window-layer { visibility: hidden; pointer-events: none; }
html:is([data-device="phone"], [data-device="tablet"]) #window-layer .app-window,
html:is([data-device="phone"], [data-device="tablet"]) #window-layer .app-window.maximized {
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  background: #fcf9f5;
}
html:is([data-device="phone"], [data-device="tablet"]) .window-titlebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: calc(48px + var(--display-safe-top, env(safe-area-inset-top, 0px)));
  min-height: calc(48px + var(--display-safe-top, env(safe-area-inset-top, 0px)));
  padding: var(--display-safe-top, env(safe-area-inset-top, 0px)) max(10px, var(--display-safe-right, env(safe-area-inset-right, 0px))) 0 max(10px, var(--display-safe-left, env(safe-area-inset-left, 0px)));
  background: #fbf8f3;
  cursor: default;
  touch-action: auto;
}
html:is([data-device="phone"], [data-device="tablet"]) .device-window-home { display: inline-flex; grid-column: 1; grid-row: 1; align-items: center; gap: 2px; min-height: 44px; padding: 7px 6px 7px 0; border-radius: 10px; color: #a184b1; font-size: 12px; }
.device-window-home svg { width: 16px; height: 16px; }
html:is([data-device="phone"], [data-device="tablet"]) .window-caption { position: static; grid-column: 2; grid-row: 1; justify-content: center; min-width: 0; max-width: 100%; overflow: hidden; transform: none; font-size: 12px; letter-spacing: .2px; text-overflow: ellipsis; }
html:is([data-device="phone"], [data-device="tablet"]) .window-caption svg { width: 14px; height: 14px; }
html:is([data-device="phone"], [data-device="tablet"]) .window-more { display: none; }
html:is([data-device="phone"], [data-device="tablet"]) .traffic-lights { grid-column: 3; grid-row: 1; justify-self: end; gap: 4px; }
html:is([data-device="phone"], [data-device="tablet"]) .traffic-lights button { width: 44px; height: 44px; padding: 0; border-radius: 12px; color: #a98491; }
html:is([data-device="phone"], [data-device="tablet"]) .traffic-lights button::before { display: none; }
html:is([data-device="phone"], [data-device="tablet"]) .traffic-lights button svg { width: 15px; height: 15px; opacity: 1 !important; color: inherit; }
html:is([data-device="phone"], [data-device="tablet"]) .traffic-lights [data-window-action="close"] { background: #f5e8e9; }
html:is([data-device="phone"], [data-device="tablet"]) .traffic-lights [data-window-action="maximize"] { background: #edf0e5; color: #92a080; }
html:is([data-device="phone"], [data-device="tablet"]) .traffic-lights [data-window-action="minimize"],
html:is([data-device="phone"], [data-device="tablet"]) .traffic-lights [data-window-action="maximize"] { display: none !important; }
html:is([data-device="phone"], [data-device="tablet"]) [data-settings-tab="computer"],
html:is([data-device="phone"], [data-device="tablet"]) .settings-focus-row { display: none !important; }

/* Comfortable controls inside the existing app DOM, with no iframe reparenting. */
html:is([data-device="phone"], [data-device="tablet"]) .app-window :is(.primary-button, .secondary-button) { min-height: 44px; padding: 10px 14px; font-size: 12px; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-tabs { gap: 4px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-tabs button { flex: none; min-height: 44px; padding: 8px 12px; font-size: 12px; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-content { padding: 20px 20px 30px; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-content h2 { font-size: 21px; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-content p { font-size: 12px; line-height: 1.8; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-row { gap: 12px; min-height: 69px; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-row > span { font-size: 13px; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-row small { font-size: 10px; }
html:is([data-device="phone"], [data-device="tablet"]) .settings-row .toggle-button { flex: none; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-master strong { font-size: 13px; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-master small { font-size: 11px; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-preset-select { min-height: 116px; padding: 13px 12px; gap: 7px; }
html[data-device="phone"] .audio-preset-symbol { display: none; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-preset-copy strong { font-size: 12px; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-preset-copy small { font-size: 11px; line-height: 1.7; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-preset-preview { min-height: 44px; font-size: 12px; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-volume label,
html:is([data-device="phone"], [data-device="tablet"]) .audio-volume output { font-size: 12px; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-volume input { min-height: 44px; }
html:is([data-device="phone"], [data-device="tablet"]) .audio-settings-link { min-height: 44px; font-size: 11px; }
html:is([data-device="phone"], [data-device="tablet"]) .published-social-link { min-height: 65px; }
html:is([data-device="phone"], [data-device="tablet"]) .published-social-link strong { font-size: 13px; }
html:is([data-device="phone"], [data-device="tablet"]) .published-social-link small { font-size: 10px; }
html[data-device="phone"] .welcome-body,
html[data-device="phone"] .immersive .welcome-body { padding: 25px 24px 0; overflow: auto; }
html[data-device="phone"] .welcome-greeting { margin-top: 16px; }
html[data-device="phone"] .welcome-greeting .welcome-avatar { width: 62px; height: 62px; }
html[data-device="phone"] .welcome-greeting .welcome-name { font-size: 38px; }
html[data-device="phone"] .welcome-description { max-width: 76%; font-size: 13px; }
html[data-device="phone"] .welcome-mascot { top: 145px; right: 9px; width: 95px; height: 112px; opacity: .72; }
html[data-device="phone"] .mascot-sparkle,
html[data-device="phone"] .mascot-little { display: none; }
html[data-device="phone"] .welcome-buttons { flex-wrap: wrap; gap: 9px; margin-block: 25px 24px; }
html[data-device="phone"] .welcome-bottom { margin-top: auto; padding-block: 14px; }
html[data-device="phone"] .welcome-tags { font-size: 8px; }
html[data-device="phone"] .about-body { padding: 27px 23px; }
html[data-device="phone"] .about-body p { font-size: 13px; }

html[data-device="phone"] .finder { flex-direction: column; }
html[data-device="phone"] .finder-sidebar { width: auto; flex-direction: row; flex: none; gap: 5px; padding: 9px 10px; border-right: 0; border-bottom: 1px solid #eae2ed; overflow-x: auto; }
html[data-device="phone"] .finder-sidebar :is(.sidebar-label, .sidebar-bottom, .filter-count) { display: none; }
html[data-device="phone"] .finder-sidebar button { flex: none; min-height: 40px; padding-inline: 12px; font-size: 11px; white-space: nowrap; }
html[data-device="phone"] .finder-main { min-height: 0; }
html[data-device="phone"] .finder-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 16px 15px 13px; }
html[data-device="phone"] .finder-heading { font-size: 17px; }
html[data-device="phone"] .finder-view-switch button { min-width: 48px; min-height: 40px; font-size: 10px; }
html[data-device="phone"] .finder-toolbar .finder-search { grid-column: 1 / -1; min-height: 44px; padding: 8px 11px; }
html[data-device="phone"] .finder-search input { font-size: 16px; }
html[data-device="phone"] .finder-search input::placeholder { font-size: 12px; }
html[data-device="phone"] .project-results.project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 4px 12px 17px; }
html[data-device="phone"] .project-icon-card { min-height: 152px; }
html[data-device="phone"] .project-name { font-size: 12px; }
html[data-device="phone"] .project-icon-category,
html[data-device="phone"] .project-access { font-size: 9px; }
html[data-device="phone"] .project-list-header,
html[data-device="phone"] .project-row-category,
html[data-device="phone"] .project-row-tagline { display: none; }
html[data-device="phone"] .project-row { grid-template-columns: minmax(0, 1fr) 65px 12px; gap: 9px; min-height: 72px; }
html[data-device="phone"] .project-row-copy .project-row-mobile-category { display: block; margin-top: 3px; font-size: 10px; color: #9b83a5; }
html[data-device="phone"] .finder-status { padding: 9px 12px; font-size: 9px; }

html:is([data-device="phone"], [data-device="tablet"]) .runner-tool { min-height: 44px; padding: 8px 10px; font-size: 12px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-tool svg { width: 15px; height: 15px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-footer { min-height: 42px; }
html:is([data-device="phone"], [data-device="tablet"]) .project-runner-body {
  padding: 0 var(--display-safe-right, env(safe-area-inset-right, 0px)) var(--display-safe-bottom, env(safe-area-inset-bottom, 0px)) var(--display-safe-left, env(safe-area-inset-left, 0px));
}
html:is([data-device="phone"], [data-device="tablet"]) .runner-footer button { min-height: 34px; font-size: 10px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-status { font-size: 10px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-notice { font-size: 11px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-notice > button { min-height: 38px; font-size: 10px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-notice .runner-notice-close { width: 34px; }
html[data-device="phone"] .runner-toolbar { min-height: 54px; padding: 5px 9px; }
html[data-device="phone"] .runner-address { display: none; }
html[data-device="phone"] .runner-tools { width: 100%; gap: 4px; margin-left: 0; }
html[data-device="phone"] .runner-external { flex: 1; }
html[data-device="phone"] .runner-details { position: absolute; inset: 0; z-index: 3; width: auto; border-left: 0; padding: 18px 22px; }
html[data-device="phone"] .runner-help { inset: 10px; max-height: calc(100% - 20px); padding: 18px; border-radius: 18px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-help-heading { font-size: 14px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-help strong { font-size: 12px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-help li p { font-size: 12px; }
html:is([data-device="phone"], [data-device="tablet"]) .runner-help .runner-help-note { font-size: 11px; }
html[data-device="phone"] .runner-help-actions { flex-direction: column; }
html[data-device="phone"] .runner-placeholder { padding: 25px 21px; }
html[data-device="phone"] .runner-placeholder > p { font-size: 12px; }

/* Search stays below the separately managed content editor at z-index 1200. */
html:is([data-device="phone"], [data-device="tablet"]) .search-overlay { z-index: 1100; padding: calc(var(--device-status-height) + 12px) 16px calc(var(--device-dock-bottom) + 16px); }
html:is([data-device="phone"], [data-device="tablet"]) .search-overlay[hidden] { display: none !important; }
html:is([data-device="phone"], [data-device="tablet"]) .spotlight { display: flex; flex-direction: column; max-height: 100%; border-radius: 22px; }
html:is([data-device="phone"], [data-device="tablet"]) .search-input-wrap { flex: none; min-height: 66px; gap: 8px; padding: 10px 13px; }
html:is([data-device="phone"], [data-device="tablet"]) .search-input-wrap input { font-size: 16px; }
html:is([data-device="phone"], [data-device="tablet"]) .search-input-wrap button { min-width: 44px; min-height: 44px; border: 0; border-radius: 11px; background: #f0e7f4; font-size: 11px; }
html:is([data-device="phone"], [data-device="tablet"]) .search-results { min-height: 0; max-height: min(55dvh, 500px); padding: 8px; overscroll-behavior: contain; }
html:is([data-device="phone"], [data-device="tablet"]) .search-result { min-height: 65px; }
html:is([data-device="phone"], [data-device="tablet"]) .search-result h3 { font-size: 13px; }
html:is([data-device="phone"], [data-device="tablet"]) .search-result p { font-size: 10px; }
html[data-device="phone"] .search-footer { display: none; }
html:is([data-device="phone"], [data-device="tablet"]) .toast { bottom: calc(var(--device-dock-clearance) + 10px); z-index: 1000; font-size: 12px; }

/* The pad gets a second widget, more app columns and a wider Home Dock. */
html[data-device="tablet"] {
  --device-status-height: calc(58px + var(--display-safe-top, env(safe-area-inset-top, 0px)));
  --device-home-bottom: calc(var(--device-dock-bottom) + var(--device-dock-height) + 58px);
}
html[data-device="tablet"] .device-statusbar { grid-template-columns: minmax(44px, 1fr) 224px minmax(44px, 1fr); padding-right: max(28px, var(--display-safe-right, env(safe-area-inset-right, 0px))); padding-left: max(28px, var(--display-safe-left, env(safe-area-inset-left, 0px))); }
html[data-device="tablet"] .device-home-page { padding: 25px max(clamp(28px, 5vw, 72px), var(--display-safe-right, env(safe-area-inset-right, 0px))) 20px max(clamp(28px, 5vw, 72px), var(--display-safe-left, env(safe-area-inset-left, 0px))); }
html[data-device="tablet"] .device-home-inner { max-width: 1080px; }
html[data-device="tablet"] .device-page-heading { padding-block: 14px 32px; }
html[data-device="tablet"] .device-page-heading h2 { font-size: 27px; }
html[data-device="tablet"] .device-page-heading :is(p, small) { font-size: 12px; }
html[data-device="tablet"] .device-widgets { grid-template-columns: 1.15fr 1fr; gap: 24px; margin-bottom: 29px; }
html[data-device="tablet"] .device-welcome-widget,
html[data-device="tablet"] .device-note-widget { min-height: 238px; padding: 23px 25px; border-radius: 30px; }
html[data-device="tablet"] .device-note-widget { display: block; background: linear-gradient(130deg, #faf2dbed, #f4ecdcc9); }
html[data-device="tablet"] .device-welcome-copy { margin-top: 16px; max-width: calc(100% - 91px); }
html[data-device="tablet"] .device-welcome-copy > small { font-size: 8px; }
html[data-device="tablet"] .device-welcome-copy > strong { margin-top: 8px; font-size: 21px; }
html[data-device="tablet"] .device-welcome-copy em { font-size: 41px; }
html[data-device="tablet"] .device-welcome-copy > span { font-size: 12px; }
html[data-device="tablet"] .device-avatar { top: 81px; right: 25px; width: 88px; height: 88px; border-radius: 27px; }
html[data-device="tablet"] .device-widget-footnote { bottom: 21px; left: 25px; font-size: 10px; }
html[data-device="tablet"] .device-welcome-widget > .device-widget-bloom { width: 85px; height: 96px; }
html[data-device="tablet"] .device-library-heading { margin-bottom: 18px; }
html[data-device="tablet"] .device-library-heading h2 { font-size: 14px; }
html[data-device="tablet"] .device-library-all { font-size: 11px; }
html[data-device="tablet"] .device-app-grid { --device-columns: 6; grid-template-columns: repeat(var(--device-columns), minmax(0, 1fr)); gap: 27px 17px; }
html[data-device="tablet"] .device-app-button { min-height: 109px; gap: 11px; }
html[data-device="tablet"] .device-app-button .app-icon { width: 67px; height: 67px; border-radius: 21px; }
html[data-device="tablet"] .device-app-button .app-icon > svg { width: 46px; height: 46px; }
html[data-device="tablet"] .device-app-name { font-size: 12px; }
html[data-device="tablet"] .device-app-badge { right: max(0px, calc(50% - 39px)); }
html[data-device="tablet"] .device-recents { margin-top: 33px; }
html[data-device="tablet"] .device-recent-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
html[data-device="tablet"] .device-recent-app { gap: 9px; padding: 12px; }
html[data-device="tablet"] .device-recent-app > svg { display: none; }
html[data-device="tablet"] .device-dock { justify-content: space-around; width: min(430px, calc(100% - 48px)); gap: 14px; padding-inline: 20px; }
html[data-device="tablet"] .device-dock-item { flex: 1 1 0; }
html[data-device="tablet"] .device-dock-item .app-icon { width: 56px; height: 56px; border-radius: 18px; }
html[data-device="tablet"] .device-dock-label { max-width: 61px; font-size: 9px; }
html[data-device="tablet"] .device-dock-edit { left: max(calc(50% - 215px), var(--display-safe-left, env(safe-area-inset-left, 0px))); }
html[data-device="tablet"] .device-search-pill { right: max(calc(50% - 215px), var(--display-safe-right, env(safe-area-inset-right, 0px))); }
html[data-device="tablet"] .device-overlay { align-items: center; padding: max(24px, var(--display-safe-top, env(safe-area-inset-top, 0px))) max(24px, var(--display-safe-right, env(safe-area-inset-right, 0px))) max(24px, var(--display-safe-bottom, env(safe-area-inset-bottom, 0px))) max(24px, var(--display-safe-left, env(safe-area-inset-left, 0px))); }
html[data-device="tablet"] :is(.device-sheet, .device-switcher-sheet) { max-height: 100%; padding: 25px; border: 1px solid #fffaf5; border-radius: 30px; }
html[data-device="tablet"] .device-sheet { height: min(740px, 100%); }
html[data-device="tablet"] .device-dock-slots { gap: 12px; margin-top: 4px; }
html[data-device="tablet"] .device-slot { min-height: 135px; padding-top: 22px; }
html[data-device="tablet"] .device-slot .app-icon { width: 47px; height: 47px; border-radius: 15px; }
html[data-device="tablet"] .device-slot .app-icon > svg { width: 33px; height: 33px; }
html[data-device="tablet"] .device-slot strong { font-size: 12px; }
html[data-device="tablet"] .device-picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
html[data-device="tablet"] .device-switcher-sheet { max-height: min(650px, 100%); }
html[data-device="tablet"] .device-switcher-cards { gap: 20px; }
html[data-device="tablet"] .device-app-card { flex-basis: 260px; }
html[data-device="tablet"] .window-titlebar { padding-inline: max(15px, var(--display-safe-left, env(safe-area-inset-left, 0px))) max(15px, var(--display-safe-right, env(safe-area-inset-right, 0px))); }
html[data-device="tablet"] .settings-content { max-width: 760px; margin-inline: auto; padding: 26px 30px; }
html[data-device="tablet"] .settings-tabs { padding-left: 25px; }
html[data-device="tablet"] .audio-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-device="tablet"] .welcome-body { padding: 36px 38px 0; }
html[data-device="tablet"] .welcome-description { max-width: 65%; font-size: 14px; }
html[data-device="tablet"] .welcome-mascot { right: 30px; top: 85px; width: 160px; height: 180px; }

@media (orientation: landscape) {
  html[data-device="tablet"] .device-widgets { grid-template-columns: 1.15fr 1fr; }
  html[data-device="tablet"] .device-app-grid { --device-columns: 8; grid-template-columns: repeat(var(--device-columns), minmax(0, 1fr)); gap: 25px 14px; }
  html[data-device="phone"] #window-layer .finder {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }
  html[data-device="phone"] #window-layer .finder-sidebar {
    flex: 0 0 auto !important;
    align-items: center;
    width: 100% !important;
    min-width: 0;
    height: auto !important;
    max-height: 54px;
    padding: 4px 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  html[data-device="phone"] #window-layer .finder-sidebar .filter-button {
    flex: 0 0 auto;
    align-self: center;
    height: 44px;
    min-height: 44px;
    margin: 0;
  }
  html[data-device="phone"] #window-layer .finder-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 0% !important;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }
  html[data-device="phone"] #window-layer .finder-toolbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(160px, 32%);
    gap: 10px;
    padding: 6px 12px;
  }
  html[data-device="phone"] #window-layer .finder-toolbar .finder-search { grid-column: auto; min-height: 40px; }
  html[data-device="phone"] #window-layer .finder-results-scroll { flex: 1 1 0%; width: 100%; min-height: 0; overflow: auto; }
}
@media (max-width: 360px) {
  html[data-device="phone"] .device-statusbar { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; }
  html[data-device="phone"] :is(.device-display-toggle, .device-recents-toggle) > span { display: none; }
  html[data-device="phone"] .device-home-page { padding-right: max(15px, var(--display-safe-right, env(safe-area-inset-right, 0px))); padding-left: max(15px, var(--display-safe-left, env(safe-area-inset-left, 0px))); }
  html[data-device="phone"] .device-welcome-widget { padding-inline: 18px; }
  html[data-device="phone"] .device-welcome-copy { max-width: calc(100% - 72px); }
  html[data-device="phone"] .device-welcome-copy em { font-size: 32px; }
  html[data-device="phone"] .device-avatar { right: 17px; width: 68px; height: 68px; }
  html[data-device="phone"] .device-app-grid { gap: 16px 8px; }
  html[data-device="phone"] .device-app-button .app-icon { width: 55px; height: 55px; border-radius: 17px; }
  html[data-device="phone"] .device-app-button .app-icon > svg { width: 38px; height: 38px; }
  html[data-device="phone"] .device-page-dots { max-width: calc(100% - 176px); }
  html[data-device="phone"] .device-page-dots > button { flex-basis: 23px; width: 23px; }
  html[data-device="phone"] :is(.device-sheet, .device-switcher-sheet) { padding-inline: 13px; }
  html[data-device="phone"] .device-slot { min-height: 110px; padding-inline: 2px; }
  html[data-device="phone"] .device-slot strong { font-size: 9px; }
  html[data-device="phone"] .device-slot-move { gap: 4px; }
  html[data-device="phone"] .device-slot-move > button { padding-inline: 9px; }
}
@media (orientation: portrait) and (max-height: 680px) {
  html[data-device="phone"] { --device-home-bottom: calc(var(--device-dock-bottom) + var(--device-dock-height) + 54px); }
  html[data-device="phone"] .device-home-page { padding-top: 10px; }
  html[data-device="phone"] .device-widgets { margin-bottom: 12px; }
  html[data-device="phone"] .device-welcome-widget { min-height: 168px; padding-block: 14px; }
  html[data-device="phone"] .device-welcome-copy { margin-top: 8px; }
  html[data-device="phone"] .device-welcome-copy > small { display: none; }
  html[data-device="phone"] .device-welcome-copy > strong { margin-block: 3px 4px; font-size: 16px; }
  html[data-device="phone"] .device-welcome-copy em { font-size: 30px; }
  html[data-device="phone"] .device-welcome-copy > span { font-size: 10px; }
  html[data-device="phone"] .device-avatar { top: 44px; width: 62px; height: 62px; border-radius: 19px; }
  html[data-device="phone"] .device-widget-footnote { bottom: 12px; font-size: 8px; }
  html[data-device="phone"] .device-welcome-widget > .device-widget-bloom { width: 61px; height: 68px; }
  html[data-device="phone"] .device-library-heading { min-height: 36px; margin-bottom: 4px; }
  html[data-device="phone"] .device-library-all { min-height: 36px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  html[data-device="phone"] { --device-status-height: calc(48px + var(--display-safe-top, env(safe-area-inset-top, 0px))); --device-dock-height: 72px; --device-home-bottom: calc(var(--device-dock-bottom) + var(--device-dock-height) + 54px); }
  html[data-device="phone"] .device-home-page { padding-top: 6px; padding-bottom: 8px; }
  html[data-device="phone"] .device-home-page[data-home-page="0"] .device-home-inner { display: grid; grid-template-columns: minmax(210px, .9fr) minmax(0, 1.1fr); gap: 0 24px; max-width: 780px; }
  html[data-device="phone"] .device-home-page:not([data-home-page="0"]) .device-home-inner { max-width: 780px; }
  html[data-device="phone"] .device-home-page:not([data-home-page="0"]) .device-app-grid { --device-columns: 6; grid-template-columns: repeat(var(--device-columns), minmax(0, 1fr)); }
  html[data-device="phone"] .device-page-heading { padding-block: 4px 12px; }
  html[data-device="phone"] .device-page-heading h2 { font-size: 17px; }
  html[data-device="phone"] .device-widgets { margin-bottom: 10px; }
  html[data-device="phone"] .device-welcome-widget { min-height: 179px; padding-block: 15px; }
  html[data-device="phone"] .device-welcome-copy { margin-top: 9px; }
  html[data-device="phone"] .device-welcome-copy > small { display: none; }
  html[data-device="phone"] .device-welcome-copy em { font-size: 31px; }
  html[data-device="phone"] .device-avatar { top: 50px; width: 63px; height: 63px; }
  html[data-device="phone"] .device-library-heading { margin-bottom: 2px; min-height: 34px; }
  html[data-device="phone"] .device-library-all { min-height: 34px; }
  html[data-device="phone"] .device-app-grid { gap: 13px 10px; }
  html[data-device="phone"] .device-app-button { min-height: 78px; gap: 5px; }
  html[data-device="phone"] .device-app-button .app-icon { width: 48px; height: 48px; border-radius: 15px; }
  html[data-device="phone"] .device-app-button .app-icon > svg { width: 33px; height: 33px; }
  html[data-device="phone"] .device-app-badge { right: max(0px, calc(50% - 28px)); }
  html[data-device="phone"] .device-recents,
  html[data-device="phone"] .device-home-signature { grid-column: 1 / -1; }
  html[data-device="phone"] .device-dock { width: min(400px, calc(100% - 36px)); padding-block: 6px 9px; }
  html[data-device="phone"] .device-dock-item { min-height: 54px; gap: 4px; }
  html[data-device="phone"] .device-dock-item .app-icon { width: 40px; height: 40px; border-radius: 13px; }
  html[data-device="phone"] .device-dock-item .app-icon > svg { width: 28px; height: 28px; }
  html[data-device="phone"] .device-dock-label { font-size: 8px; }
  html[data-device="phone"] .device-dock-edit { left: max(calc(50% - 200px), var(--display-safe-left, env(safe-area-inset-left, 0px))); }
  html[data-device="phone"] .device-search-pill { right: max(calc(50% - 200px), var(--display-safe-right, env(safe-area-inset-right, 0px))); }
  html[data-device="phone"] .device-overlay { align-items: center; padding: 7px max(12px, var(--display-safe-right, env(safe-area-inset-right, 0px))) max(7px, var(--display-safe-bottom, env(safe-area-inset-bottom, 0px))) max(12px, var(--display-safe-left, env(safe-area-inset-left, 0px))); }
  html[data-device="phone"] .device-sheet { display: grid; grid-template-columns: minmax(245px, .95fr) minmax(0, 1.05fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; gap: 0 18px; width: min(780px, 100%); height: 100%; max-height: 100%; padding: 11px 17px; border: 1px solid #fffaf5; border-radius: 24px; }
  html[data-device="phone"] .device-sheet-header { grid-column: 1 / -1; min-height: 44px; }
  html[data-device="phone"] .device-sheet-header p { font-size: 7px; margin-bottom: 3px; }
  html[data-device="phone"] .device-sheet-header h2 { font-size: 18px; }
  html[data-device="phone"] .device-sheet-description { grid-column: 1; margin: 6px 0 8px; font-size: 10px; }
  html[data-device="phone"] .device-dock-slots { grid-column: 1; align-content: center; }
  html[data-device="phone"] .device-slot { min-height: 103px; padding-block: 13px 7px; }
  html[data-device="phone"] .device-slot .app-icon { width: 34px; height: 34px; border-radius: 11px; }
  html[data-device="phone"] .device-slot .app-icon > svg { width: 24px; height: 24px; }
  html[data-device="phone"] .device-slot-move { grid-column: 1; margin: 6px 0 0; }
  html[data-device="phone"] .device-dock-picker { grid-column: 2; grid-row: 2 / 5; min-height: 0; padding-top: 6px; }
  html[data-device="phone"] .device-editor-feedback { grid-column: 1 / -1; margin-top: 4px; font-size: 9px; }
  html[data-device="phone"] .device-switcher-sheet { width: min(800px, 100%); height: 100%; max-height: 100%; padding: 10px 17px; border: 1px solid #fffaf5; border-radius: 24px; }
  html[data-device="phone"] .device-switcher-note { margin: 3px 0 6px; font-size: 10px; }
  html[data-device="phone"] .device-switcher-cards { gap: 12px; padding-bottom: 5px; }
  html[data-device="phone"] .device-app-card { flex-basis: 210px; border-radius: 19px; }
  html[data-device="phone"] .device-app-card-art { min-height: 45px; aspect-ratio: auto; }
  html[data-device="phone"] .device-app-card-art .app-icon { width: 48px; height: 48px; border-radius: 15px; }
  html[data-device="phone"] .device-app-card-art .app-icon > svg { width: 34px; height: 34px; }
  html[data-device="phone"] .device-app-card-copy { padding: 8px 12px; }
  html[data-device="phone"] .device-app-card-copy strong { font-size: 11px; }
  html[data-device="phone"] .device-app-card-copy small { font-size: 9px; margin-top: 3px; }
  html[data-device="phone"] .device-app-card-close { margin-bottom: 6px; }
  html[data-device="phone"] .device-switcher-footer { padding-top: 2px; }
  html[data-device="phone"] .runner-notice { padding-block: 3px; }
  html[data-device="phone"] .runner-footer { min-height: 32px; padding-block: 2px; }
}
/* Measured Home capacity uses these compact cards before creating extra pages. */
.device-shell[data-home-density="compact"] .device-widgets { gap: 14px; margin-bottom: 14px; }
.device-shell[data-home-density="compact"] :is(.device-welcome-widget, .device-note-widget) { min-height: 120px; padding: 13px 17px; border-radius: 22px; }
.device-shell[data-home-density="compact"] .device-welcome-copy { max-width: calc(100% - 74px); margin-top: 7px; }
.device-shell[data-home-density="compact"] .device-welcome-copy > small,
.device-shell[data-home-density="compact"] .device-widget-footnote { display: none; }
.device-shell[data-home-density="compact"] .device-welcome-copy > strong { margin: 2px 0 5px; font-size: 15px; }
.device-shell[data-home-density="compact"] .device-welcome-copy em { display: inline; margin-left: 3px; font-size: 27px; }
.device-shell[data-home-density="compact"] .device-welcome-copy > span { font-size: 10px; }
.device-shell[data-home-density="compact"] .device-avatar { top: 28px; right: 17px; width: 63px; height: 63px; border-radius: 20px; }
.device-shell[data-home-density="compact"] .device-widget-bloom { width: 44px; height: 49px; opacity: .5; }
.device-shell[data-home-density="compact"] .device-note-label { font-size: 7px; }
.device-shell[data-home-density="compact"] .device-note-quote { margin-top: 8px; font-size: 13px; line-height: 1.6; }
.device-shell[data-home-density="compact"] .device-note-count { bottom: 10px; left: 17px; }
.device-shell[data-home-density="compact"] .device-note-count b { font-size: 19px; }
.device-shell[data-home-density="compact"] .device-note-flower { right: 9px; bottom: 5px; width: 57px; height: 63px; opacity: .55; }
.device-shell[data-home-density="tiny"] .device-widgets { grid-template-columns: minmax(0, 1fr); margin-bottom: 10px; align-self: start; }
.device-shell[data-home-density="tiny"] .device-welcome-widget { min-height: 92px; padding: 12px 14px; border-radius: 20px; }
.device-shell[data-home-density="tiny"] :is(.device-widget-date, .device-welcome-copy > small, .device-welcome-copy > span, .device-widget-footnote, .device-widget-bloom, .device-note-widget) { display: none; }
.device-shell[data-home-density="tiny"] .device-welcome-copy { max-width: calc(100% - 64px); margin: 0; }
.device-shell[data-home-density="tiny"] .device-welcome-copy > strong { margin: 0; font-size: 14px; line-height: 1.5; }
.device-shell[data-home-density="tiny"] .device-welcome-copy em { font-size: 28px; }
.device-shell[data-home-density="tiny"] .device-avatar { top: 17px; right: 14px; width: 56px; height: 56px; border-radius: 18px; }
.device-shell[data-home-density="flat"] { --device-status-height: calc(44px + var(--display-safe-top, env(safe-area-inset-top, 0px))); --device-dock-height: 60px; --device-home-bottom: calc(var(--device-dock-bottom) + 104px); }
.device-shell[data-home-density="flat"] .device-home-page { padding-block: 4px; }
.device-shell[data-home-density="flat"] .device-home-inner { display: block !important; }
.device-shell[data-home-density="flat"] .device-widgets { display: none; }
.device-shell[data-home-density="flat"] .device-app-grid { --device-columns: 2 !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px 12px; }
.device-shell[data-home-density="flat"] .device-app-button { flex-direction: row; min-height: 44px; gap: 8px; padding: 2px 4px; }
.device-shell[data-home-density="flat"] .device-app-button .app-icon { flex: none; width: 36px; height: 36px; border-radius: 12px; }
.device-shell[data-home-density="flat"] .device-app-button .app-icon > svg { width: 25px; height: 25px; }
.device-shell[data-home-density="flat"] .device-app-name { flex: 1; min-width: 0; font-size: 10px; text-align: left; }
.device-shell[data-home-density="flat"] .device-content-status { min-height: 36px; padding: 0; font-size: 10px; line-height: 1.4; }
.device-shell[data-home-density="flat"] .device-content-status button { min-height: 36px; padding-block: 2px; }
.device-shell[data-home-density="flat"] .device-dock { min-height: 60px; padding-block: 6px; border-radius: 23px; }
.device-shell[data-home-density="flat"] .device-dock-item { min-height: 44px; }
.device-shell[data-home-density="flat"] .device-dock-item .app-icon { width: 40px; height: 40px; border-radius: 13px; }
.device-shell[data-home-density="flat"] .device-dock-item .app-icon > svg { width: 28px; height: 28px; }

@media (hover: hover) {
  .device-app-button:hover .app-icon { transform: translateY(-3px); }
  .device-recent-app:hover { background: #fffaf6a8; }
  .device-library-all:hover { color: #7c5e8b; }
  .device-display-toggle:hover, .device-recents-toggle:hover { background: #fffaf777; }
  .device-picker-item:hover { background: #f2e7f4; }
  .device-app-card-open:hover .device-app-card-art { filter: brightness(1.025); }
}
body.reduce-motion .device-shell *,
body.reduce-motion .device-shell *::before,
body.reduce-motion .device-shell *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  .device-shell *, .device-shell *::before, .device-shell *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
