/* Desktop retroMac: visual layer only; existing window and content behavior is retained. */
#ph-layout.desktop {
  --rm-ink: #111;
  --rm-paper: #fff;
  --rm-gray: #ddd;
  --rm-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Cpath fill='%23fff' d='M0 0h2v2H0z'/%3E%3Cpath fill='%23888' d='M0 0h1v1H0zM1 1h1v1H1z'/%3E%3C/svg%3E");
  background: #aaa var(--rm-pattern) repeat;
  color: var(--rm-ink);
  font: 16px/1.5 Tahoma, Geneva, "Malgun Gothic", sans-serif;
}
#ph-layout .taskbar {
  inset: 0 0 auto;
  height: 36px;
  padding: 0 16px;
  gap: 18px;
  border: 0;
  border-bottom: 2px solid var(--rm-ink);
  border-radius: 0;
  background: var(--rm-paper);
  color: var(--rm-ink);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#ph-layout .taskbar .brand-menu { align-self: stretch; padding: 2px 6px; }
#ph-layout .taskbar .brand-menu img.ph-start-icon { width: 26px; height: 26px; filter: none; image-rendering: pixelated; }
#ph-layout .brand-menu[aria-expanded=true] { background: var(--rm-gray); }
#ph-layout .taskbar .ph-main-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
#ph-layout .taskbar .ph-main-nav > ul { gap: 4px; }
#ph-layout .taskbar .ph-menu-row > a { min-height: 34px; padding: 5px 10px; font-size: 14px; font-weight: 700; border-radius: 0; white-space: nowrap; }
#ph-layout .taskbar .ph-menu-row > a img { max-height: 25px; width: auto; filter: grayscale(1); }
#ph-layout .taskbar .ph-main-nav > ul > li.is-selected > .ph-menu-row > a,
#ph-layout .taskbar .ph-menu-row > a:hover { background: var(--rm-ink); color: var(--rm-paper); border-radius: 0; text-decoration: none; }
#ph-layout .taskbar .ph-main-nav > ul > li.is-selected > .ph-menu-row > a img { filter: grayscale(1) invert(1); }
#ph-layout .ph-header-search { height: 25px; flex-shrink: 0; width: clamp(125px, 15vw, 220px); border: 1px solid var(--rm-ink); border-radius: 0; background: var(--rm-paper); box-shadow: inset 1px 1px 0 #888; }
#ph-layout .ph-header-search input[type=search] { font-size: 13px; padding: 2px 7px; }
#ph-layout .ph-header-search button { width: 28px; height: 23px; border-left: 1px solid var(--rm-ink); font-size: 22px; }
#ph-layout .ph-header-search input::placeholder { color: #555; opacity: 1; }
#ph-layout .ph-taskbar-clock { font-size: 13px; font-weight: 700; }
#ph-layout .rail { top: 58px; width: 112px; gap: 22px; max-height: calc(100dvh - 150px); scrollbar-width: thin; scrollbar-color: #111 #ddd; }
#ph-layout .rail a { color: var(--rm-ink); font-size: 13px; font-weight: 400; text-shadow: none; filter: none; gap: 5px; }
#ph-layout .rail img,
#ph-layout .rail img.ph-home-icon,
#ph-layout .rail a:nth-child(6) img { width: 40px; height: 36px; margin: 0; image-rendering: pixelated; transition: none; }
#ph-layout .rail a:hover img { transform: none; }
#ph-layout .rail a span { padding: 0 4px; background: var(--rm-paper); overflow-wrap: anywhere; }
#ph-layout .rail a.is-selected span,
#ph-layout .rail a:hover span { background: var(--rm-ink); color: var(--rm-paper); border: 0; }
#ph-layout .app-window {
  top: calc(60px + var(--ph-step) * min(20px, 2dvh));
  border: 1px solid var(--rm-ink);
  border-radius: 0;
  background: var(--rm-paper);
  box-shadow: 2px 2px 0 var(--rm-ink);
  transition: none;
}
#ph-layout .app-window.ph-active-window { box-shadow: 3px 3px 0 var(--rm-ink); }
#ph-layout .app-window.maximized { inset: 44px 8px 88px; }
#ph-layout .app-window > .window-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 31px;
  min-height: 31px;
  margin: 0;
  padding: 0 62px 0 32px;
  border-bottom: 1px solid var(--rm-ink);
  background: var(--rm-paper);
  color: var(--rm-ink);
  font: 700 15px/30px Tahoma, Geneva, "Malgun Gothic", sans-serif;
  letter-spacing: 0;
  text-align: center;
  user-select: none;
}
#ph-layout .window-title::before,
#ph-layout .window-title::after { content: ""; flex: 1 1 0; min-width: 8px; height: 17px; background: repeating-linear-gradient(to bottom, #111 0 1px, #fff 1px 3px); }
#ph-layout .app-window:not(.ph-active-window) > .window-title { color: #666; }
#ph-layout .app-window:not(.ph-active-window) > .window-title::before,
#ph-layout .app-window:not(.ph-active-window) > .window-title::after { background: none; }
#ph-layout .window-actions { inset: 0 0 auto; height: 31px; display: block; opacity: 1; pointer-events: none; }
#ph-layout .window-actions button { position: absolute; top: 8px; display: block; width: 15px; height: 15px; min-height: 0; padding: 0; border: 1px solid var(--rm-ink); border-radius: 0; background: var(--rm-paper); color: var(--rm-ink); font-size: 0; line-height: 1; box-shadow: 0 0 0 3px var(--rm-paper); pointer-events: auto; }
#ph-layout .window-actions [data-ph-close] { left: 9px; }
#ph-layout .window-actions [data-ph-maximize] { right: 9px; }
#ph-layout .window-actions [data-ph-minimize] { right: 33px; }
#ph-layout .window-actions [data-ph-maximize]::after { content: ""; position: absolute; inset: 2px 4px 4px 2px; border: 1px solid var(--rm-ink); }
#ph-layout .window-actions [data-ph-minimize]::after { content: ""; position: absolute; inset: auto 2px 3px; height: 2px; background: var(--rm-ink); }
#ph-layout .window-actions [data-ph-close]:hover::after { content: "×"; position: absolute; inset: -1px 0; font: 700 15px/15px monospace; }
#ph-layout .window-actions button:active { background: #aaa; }
#ph-layout .ph-layer-window > iframe { background: var(--rm-paper); }
#ph-layout .app-scroll-viewport { background: var(--rm-paper); mask-image: none; scrollbar-width: auto; scrollbar-color: #fff #ccc; }
@supports selector(::-webkit-scrollbar) {
  #ph-layout .app-scroll-viewport { scrollbar-color: auto; }
}
#ph-layout .app-scroll-viewport::-webkit-scrollbar { width: 17px; height: 17px; }
#ph-layout .app-scroll-viewport::-webkit-scrollbar-track { background: #ddd var(--rm-pattern); border-left: 1px solid #111; }
#ph-layout .app-scroll-viewport::-webkit-scrollbar-thumb { background: #fff; border: 1px solid #111; box-shadow: inset 2px 2px #eee, inset -2px -2px #bbb; }
#ph-layout .app-scroll-viewport::-webkit-scrollbar-corner { background: #fff; border: 1px solid #111; }
#ph-layout .scroll-thumb { display: none; }
#ph-layout .page-content { padding: 26px 30px 32px; }
#ph-layout .rx-module-content { border-radius: 0; }
#ph-layout.ph-embedded { background: var(--rm-paper); }
#ph-layout.ph-embedded > #ph-main-window { inset: 0; border: 0; box-shadow: none; }
#ph-layout.ph-embedded > #ph-main-window > .window-title,
#ph-layout.ph-embedded > #ph-main-window > .window-actions { display: none; }
#ph-layout .ph-window-dock { gap: 10px; bottom: 10px; }
#ph-layout .ph-dock-icon { padding: 3px; border: 0; border-radius: 0; background: transparent; color: var(--rm-ink); box-shadow: none; }
#ph-layout .ph-dock-symbol { width: 36px; height: 34px; background: url('../assets/retro-application.svg') center/contain no-repeat; font-size: 0; }
#ph-layout .ph-dock-icon > span:last-child { background: var(--rm-paper); padding: 0 2px; }
#ph-layout .ph-dock-icon:hover > span:last-child,
#ph-layout .ph-dock-icon:focus-visible > span:last-child { background: var(--rm-ink); color: var(--rm-paper); }
#ph-layout .ph-mobile-menu,
#ph-layout .ph-search,
#ph-layout .ph-submenu,
#ph-layout .dropdown { top: 36px; left: 8px; border: 1px solid var(--rm-ink); border-radius: 0; background: var(--rm-paper); box-shadow: 2px 2px 0 var(--rm-ink); color: var(--rm-ink); }
#ph-layout .ph-popover-title { border-bottom: 1px solid var(--rm-ink); padding-bottom: 12px; }
#ph-layout .ph-mobile-menu .ph-main-nav { display: block; }
#ph-layout .ph-mobile-menu .ph-submenu { background: #eee; border-left: 1px solid var(--rm-ink); }
#ph-layout .ph-mobile-menu .ph-layer-menu-icon { filter: grayscale(1); image-rendering: pixelated; }
#ph-layout .ph-mobile-menu .ph-menu-row a:hover { background: var(--rm-ink); color: var(--rm-paper); text-decoration: none; }
#ph-layout .cookie { border: 3px double var(--rm-ink); outline: 1px solid var(--rm-ink); outline-offset: 3px; border-radius: 0; background: var(--rm-paper); box-shadow: 4px 4px 0 var(--rm-ink); color: var(--rm-ink); width: min(390px, calc(100% - 32px)); }
#ph-layout .cookie > p { color: #444; }
#ph-layout .ph-skip { border: 2px solid #111; border-radius: 0; background: #fff; color: #111; }
#ph-layout button:focus-visible:not(.rx-module-content *),
#ph-layout a:focus-visible:not(.rx-module-content *),
#ph-layout input:focus-visible:not(.rx-module-content *),
#ph-layout .ph-header-search:focus-within { outline: 2px solid #111; outline-offset: 3px; }

/* Restyle the existing landing sections; module and editor internals keep their own skins. */
#ph-layout .ph-landing { gap: 44px; color: #111; }
#ph-layout .ph-landing :is(h1, h2, h3) { letter-spacing: -.025em; font-family: inherit; }
#ph-layout .hero-logo { filter: grayscale(1); margin-bottom: 28px; }
#ph-layout .hero-copy h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.2; }
#ph-layout .hero-copy mark { color: #fff; background: #111; border-radius: 0; padding: 0 4px; }
#ph-layout .highlight { background: #ddd; }
#ph-layout .hero-copy .teams { color: #444; }
#ph-layout .setup,
#ph-layout .showcase-body,
#ph-layout .logo-panel,
#ph-layout .agent-window,
#ph-layout .inbox-window,
#ph-layout .drive-flow,
#ph-layout .cta { border: 1px solid #111; border-radius: 0; background: #fff; box-shadow: 2px 2px 0 #111; }
#ph-layout .setup { padding: 4px; outline: 1px solid #111; outline-offset: 3px; }
#ph-layout .setup-inner { padding: 18px; }
#ph-layout .setup li svg { color: #111; }
#ph-layout .button,
#ph-layout button.button,
#ph-layout .button.gold,
#ph-layout .button.small { min-height: 36px; border: 1px solid #111; border-radius: 5px; background: #fff; color: #111; box-shadow: 1px 1px 0 #111; padding: 7px 14px; font-size: 14px; font-weight: 700; transition: none; }
#ph-layout .button.gold { outline: 1px solid #111; outline-offset: 3px; }
#ph-layout .button:hover,
#ph-layout button.button:hover { background: #111; color: #fff; filter: none; transform: none; }
#ph-layout .button:active { background: #333; color: #fff; transform: translate(1px, 1px); box-shadow: none; }
#ph-layout .setup-buttons { gap: 14px; }
#ph-layout .install-command { background: #eee; border-top: 1px solid #111; }
#ph-layout .install-command small { color: #444; }
#ph-layout .command { border: 1px solid #111; border-radius: 0; background: #fff; }
#ph-layout .showcase { --accent: #111; filter: none; }
#ph-layout .tabs { gap: 4px; }
#ph-layout .tabs button { border: 1px solid #111; border-bottom: 0; border-radius: 0; background: #ddd; color: #111; }
#ph-layout .tabs button[aria-selected=true] { background: #111; color: #fff; }
#ph-layout .showcase-body { padding: 24px; }
#ph-layout .pause { border: 1px solid #111; border-radius: 0; background: #fff; color: #111; }
#ph-layout .demo-visual,
#ph-layout .question,
#ph-layout .report,
#ph-layout .agent-core { border: 1px solid #111; border-radius: 0; background: #f5f5f5; color: #111; box-shadow: none; }
#ph-layout .ph-landing :is(.tool-icon, .hero-logo, .logo-panel img, .cd-art img, .setup h3 img, .ai-demo header img, .agent-response img, .agent-dock img, .inbox-window > header img) { filter: grayscale(1); }
#ph-layout .ph-landing :is(.color-0, .color-1, .color-2, .color-3, .color-4, .color-5, .service, .agent-core span, .orange-highlight, .pr-proof strong, .hurry b, .cta-copy h3 span, .visitor-counter) { color: #111; }
#ph-layout .ph-landing :is(.source-row small, .demo-answer small, .ai-demo header small, .report p, .report small, .step > p, .pr-proof small, .cd-art > small, .cta-copy > small, .cta-copy h3 small, .ph-site-footer) { color: #555; }
#ph-layout .service-2,
#ph-layout .priority,
#ph-layout .report code,
#ph-layout .orange-highlight { border-color: #111; border-radius: 0; background: #ddd; }
#ph-layout .source-row > svg { stroke: #111; }
#ph-layout .source-row,
#ph-layout .mini-bars,
#ph-layout .pr-proof,
#ph-layout .pr-proof li { border-color: #111; }
#ph-layout .mini-bars span { border: 1px solid #111; border-radius: 0; background: #aaa var(--rm-pattern); }
#ph-layout .context-map { background: radial-gradient(#aaa 1px, transparent 1px) 0 0/12px 12px; }
#ph-layout .logo-panel { padding: 20px; }
#ph-layout .shuffle { border: 1px solid #111; border-radius: 0; background: #fff; box-shadow: 1px 1px 0 #111; }
#ph-layout .tools-ticker { padding: 12px 0; border-block: 1px solid #111; }
#ph-layout .tools-ticker > b { color: #111; }
#ph-layout .fetch-app,
#ph-layout .events-table,
#ph-layout .analytics { border: 1px solid #111; border-radius: 0; background: #fff; color: #111; box-shadow: 2px 2px 0 #111; }
#ph-layout .ph-landing :is(.fetch-app header, .events-table header, .analytics header, .agent-window header, .inbox-window > header) { border-bottom: 1px solid #111; background: #ddd; color: #111; }
#ph-layout .fetch-app header > span,
#ph-layout .fetch-app .online,
#ph-layout .fetch-chat > b,
#ph-layout .fetch-chat p span,
#ph-layout .fetch-input,
#ph-layout .reply,
#ph-layout .agent-window > p,
#ph-layout .inbox-window > header span,
#ph-layout .drive-flow span { border: 1px solid #111; border-radius: 0; background: #eee; color: #111; }
#ph-layout .ph-landing :is(.fetch-app header small, .fetch-app footer, .event code, .events-table > a, .analytics header small, .analytics footer, .boxplot b small, .terminal, .terminal pre, .terminal > .command, .agent-window header > span, .inbox-window::before, .inbox-tabs, .inbox-filters, .drive-flow i) { color: #555; }
#ph-layout .street-map { background-color: #eee; filter: grayscale(1); }
#ph-layout .street-map > span { color: #111; text-shadow: none; }
#ph-layout .street-map small { background: #fff; border: 1px solid #111; border-radius: 0; }
#ph-layout .fetch-input svg,
#ph-layout .reply span { background: #111; color: #fff; border-radius: 0; }
#ph-layout .event { border-color: #aaa; }
#ph-layout .boxplot em,
#ph-layout .boxplot .plot-1,
#ph-layout .boxplot .plot-2,
#ph-layout .boxplot .plot-3 { background: #ccc var(--rm-pattern); border: 1px solid #111; border-radius: 0; }
#ph-layout .boxplot em::after { background: #111; }
#ph-layout .terminal { border: 1px solid #111; background: #f5f5f5; }
#ph-layout .terminal > div:first-child { border-color: #111; }
#ph-layout .agent-dock { border: 1px solid #111; border-radius: 0; background: #ddd; box-shadow: 2px 2px 0 #111; }
#ph-layout .agent-dock button,
#ph-layout .agent-dock button:first-child { border: 1px solid #111; border-radius: 0; background: #fff; color: #111; box-shadow: 1px 1px 0 #111; }
#ph-layout .agent-dock button.active { outline: 2px solid #111; outline-offset: 2px; }
#ph-layout .inbox-tabs { border-color: #111; }
#ph-layout .inbox-tabs b { color: #111; border-color: #111; }
#ph-layout .inbox-filters span { border-color: #111; }
#ph-layout .eco { border: 1px solid #111; border-radius: 0; background: #111; color: #fff; }
#ph-layout .starburst { background: #ddd; filter: grayscale(1); }
#ph-layout .clouds button { border: 1px solid #111; background: #fff; color: #111; }
#ph-layout .clouds button[aria-pressed=true] { border-color: #111; background: #111; color: #fff; box-shadow: none; }
#ph-layout .visitor-counter { padding-top: 20px; border-top: 1px solid #111; font-size: 14px; letter-spacing: 0; }
/* Tooltips live outside #ph-layout so they cannot be clipped by the menu bar. */
.ph-primary-tooltip { border: 1px solid #111; border-radius: 0; background: #fff; color: #111; box-shadow: 2px 2px 0 #111; font: 13px/1.4 Tahoma, Geneva, "Malgun Gothic", sans-serif; }
@media (max-width: 1100px) {
  #ph-layout .taskbar { gap: 12px; }
  #ph-layout .app-window { top: calc(52px + var(--ph-step) * min(20px, 2dvh)); border-radius: 0; }
  #ph-layout .app-window > .window-title { margin-left: 0; }
  #ph-layout .app-window.maximized { inset: 44px 4px 88px; }
}
@media (max-width: 650px) {
  #ph-layout .taskbar { height: 40px; padding: 0 8px; gap: 8px; }
  #ph-layout .ph-header-search { flex: 1 1 110px; width: auto; min-width: 80px; }
  #ph-layout .ph-taskbar-clock { max-width: 137px; white-space: normal; text-align: right; font-size: 11px; line-height: 1.2; }
  #ph-layout .taskbar .brand-menu { gap: 3px; padding: 2px; }
  #ph-layout .taskbar .brand-menu img.ph-start-icon { width: 24px; height: 24px; }
  #ph-layout .ph-mobile-menu,
  #ph-layout .ph-search { top: 40px; left: 8px; right: 8px; max-width: none; width: auto; }
  #ph-layout .page-content { padding: 22px 16px 26px; }
  #ph-layout .ph-landing { gap: 36px; }
  #ph-layout .hero-copy h1 { font-size: 28px; line-height: 1.3; }
  #ph-layout .app-window > .window-title { font-size: 13px; gap: 6px; }
  #ph-layout .window-actions button:first-child { display: block; }
  #ph-layout .setup { margin: 4px; }
  #ph-layout .setup-buttons { flex-direction: column; }
  #ph-layout .tabs button { font-size: 12px; padding: 10px 5px 14px; overflow-wrap: anywhere; }
  #ph-layout .showcase-body { padding: 12px; }
  #ph-layout .demo-tools { grid-template-columns: minmax(0, 1fr); font-size: 13px; }
  #ph-layout .demo-tools > a { white-space: normal; }
  #ph-layout .logo-panel { padding: 18px 12px; }
  #ph-layout .cookie { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #ph-layout .app-window, #ph-layout .button { transition: none; }
}
@media print {
  #ph-layout.desktop { height: auto; background: #fff; }
  #ph-layout .app-window,
  #ph-layout .app-window.ph-active-window { position: static; border: 0; box-shadow: none; overflow: visible; }
  #ph-layout .app-window > .window-title,
  #ph-layout .window-actions { display: none; }
  #ph-layout .app-scroll-viewport { overflow: visible; }
  #ph-layout .page-content { padding: 0; }
}
