/* Phone-sized Mac theme: a home screen and one edge-to-edge app at a time. */
.phone-home,.phone-home-indicator{display:none}

@media (max-width: 600px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  html[data-theme=macos]{
    --phone-top:calc(44px + env(safe-area-inset-top,0px));
    --phone-bottom:calc(144px + env(safe-area-inset-bottom,0px));
  }
  html[data-theme=macos] .windows-os{
    background:radial-gradient(ellipse at 100% 95%,#f7c9ad 0,transparent 52%),radial-gradient(ellipse at 0 65%,#c396cd 0,transparent 62%),linear-gradient(155deg,#242449 0%,#705884 51%,#cb91a5 100%);
    -webkit-tap-highlight-color:transparent;
  }
  html[data-theme=macos] .mac-menubar{
    height:var(--phone-top);padding:env(safe-area-inset-top,0px) max(24px,env(safe-area-inset-right,0px)) 0 max(24px,env(safe-area-inset-left,0px));
    background:transparent;color:#fff;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;gap:12px;
  }
  html[data-theme=macos] .mac-menubar :is(button,.mac-active-app){display:none}
  html[data-theme=macos] .mac-wordmark{font-size:16px;letter-spacing:-.04em}
  html[data-theme=macos] .mac-clock{font-size:12px;font-weight:600;letter-spacing:.01em}
  html[data-theme=macos] .os-desktop{top:var(--phone-top);bottom:var(--phone-bottom);left:0;right:0;overflow:hidden}
  html[data-theme=macos] .os-desktop::before{inset:0;filter:none;background:radial-gradient(ellipse at 50% 10%,#fff1 0,transparent 65%)}
  html[data-theme=macos] .wallpaper-brand{
    top:18px;bottom:auto;left:50%;right:auto;transform:translateX(-50%);width:min(260px,calc(100% - 64px));margin:0;filter:none;
  }
  html[data-theme=macos] .wallpaper-brand img{
    display:block;width:100%;height:auto;aspect-ratio:2/1;object-fit:contain;padding:0;border:1px solid #ffffff70;border-radius:26px;background:#fffdf3ed;
    box-shadow:0 10px 30px #34234f20,inset 0 1px #fff;
  }
  html[data-theme=macos] .wallpaper-brand span{margin-top:15px;font-size:11px;font-weight:600;line-height:1.6;letter-spacing:.14em;color:#fff;text-shadow:0 1px 3px #35224755}
  html[data-theme=macos] .desktop-icons{
    left:max(14px,env(safe-area-inset-left,0px));right:max(14px,env(safe-area-inset-right,0px));top:clamp(208px,28dvh,254px);bottom:auto;width:auto;
    grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 4px;align-items:start;
  }
  html[data-theme=macos] .desktop-icon{
    min-width:0;min-height:91px;padding:3px 0;gap:9px;font-size:11px;font-weight:500;line-height:1.35;border-radius:18px;text-shadow:0 1px 4px #35244799;touch-action:manipulation;
  }
  html[data-theme=macos] .desktop-icon>span:last-child{padding:0;max-width:100%;overflow-wrap:normal}
  html[data-theme=macos] .icon-art{
    width:62px;height:62px;border-radius:17px;border-color:#ffffffa6;box-shadow:inset 0 1px #ffffffb3,0 5px 12px #30203f30;
  }
  html[data-theme=macos] .icon-art .os-symbol{width:34px;height:34px}
  html[data-theme=macos] .icon-ueber{background:linear-gradient(145deg,#f6f0ff,#cec6ef);color:#654a9d}
  html[data-theme=macos] .desktop-hint{
    left:20px;right:20px;bottom:3px;margin:0;text-align:center;font:400 11px/1.55 var(--ui-font);letter-spacing:0;color:#fff;opacity:.8;text-shadow:0 1px 3px #30204066;
  }
  html[data-theme=macos] .phone-app-open :is(.wallpaper-brand,.desktop-icons,.desktop-hint){visibility:hidden;pointer-events:none}

  /* Dock stays available in every app; less-frequent destinations live on Home. */
  html[data-theme=macos] footer.taskbar{
    left:50%;right:auto;bottom:calc(44px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);
    width:calc(100% - 28px);max-width:410px;height:88px;padding:10px 9px;gap:7px;border-radius:27px;align-items:center;
    background:#f6ecf8a6;border:1px solid #ffffff80;box-shadow:inset 0 1px #ffffff52,0 8px 24px #3b29472b;
    backdrop-filter:blur(28px) saturate(1.4);-webkit-backdrop-filter:blur(28px) saturate(1.4);
  }
  html[data-theme=macos] footer.taskbar :is(.taskbar-divider,.task-buttons,.show-desktop,.desktop-clock){display:none}
  html[data-theme=macos] .dock-launchers{flex:3;min-width:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  html[data-theme=macos] .dock-launchers :is(.dock-willkommen,.dock-leistungen,.dock-ablauf){display:none}
  html[data-theme=macos] .start-button{
    flex:1;min-width:0;width:auto;height:66px;min-height:44px;padding:0;gap:4px;background:transparent;border:0;border-radius:16px;font-size:10px;font-weight:500;color:#332b46;
  }
  html[data-theme=macos] .start-button>span{
    display:grid;place-items:center;width:48px;height:48px;border:1px solid #ffffffae;border-radius:14px;background:linear-gradient(145deg,#faf8ff,#e0d8ef);font-size:29px;color:#685486;box-shadow:inset 0 1px #fff9,0 3px 7px #3221401f;
  }
  html[data-theme=macos] .start-button .os-symbol{width:29px;height:29px}
  html[data-theme=macos] .start-button[aria-expanded=true]{background:#ffffff6b;box-shadow:none}
  html[data-theme=macos] .dock-app{width:100%;height:66px;min-height:44px;gap:4px;border-radius:16px;transform:none}
  html[data-theme=macos] .dock-app-art{width:48px;height:48px;border-radius:14px}
  html[data-theme=macos] .dock-app .os-symbol{width:28px;height:28px}
  html[data-theme=macos] .dock-dot{display:none}
  html[data-theme=macos] .dock-label{
    display:block;position:static;transform:none;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;padding:0;background:none;border:0;box-shadow:none;font:500 10px/1.3 var(--ui-font);color:#332b46;
  }
  html[data-theme=macos] .dock-app:hover{transform:none}
  html[data-theme=macos] .dock-app[aria-pressed=true]{background:#ffffff73}
  html[data-theme=macos] .phone-home-indicator{
    display:flex;position:fixed;z-index:20000;bottom:env(safe-area-inset-bottom,0px);left:50%;transform:translateX(-50%);width:160px;height:44px;min-height:44px;align-items:center;justify-content:center;
    padding:0;border:0;border-radius:20px;background:transparent;color:transparent;font-size:0;cursor:pointer;touch-action:manipulation;
  }
  html[data-theme=macos] .phone-home-indicator::after{content:'';width:112px;height:5px;background:#fff;border-radius:6px;box-shadow:0 1px 5px #34264720}
  html[data-theme=macos] .phone-home-indicator:focus-visible{outline:2px solid #fff;outline-offset:-6px}

  /* Inline window geometry is intentionally replaced only on these phones. */
  html[data-theme=macos] #workspace .os-window{
    inset:0!important;width:100%!important;height:100%!important;max-width:none;max-height:none;min-width:0;margin:0;padding:0;border:0;border-radius:20px;box-shadow:0 10px 32px #2c1b4133;
  }
  html[data-theme=macos] #workspace .os-window.is-active{box-shadow:0 10px 32px #2c1b4133}
  html[data-theme=macos] .os-window :is(.window-controls,.resize-handle,.os-window-bottom,.window-status){display:none}
  html[data-theme=macos] .os-titlebar,html[data-theme=macos] .os-window.is-active .os-titlebar{
    min-height:56px;padding:4px max(12px,env(safe-area-inset-right,0px)) 4px max(8px,env(safe-area-inset-left,0px));gap:6px;background:#faf9fc;color:#302841;border-bottom:1px solid #e5e0e9;touch-action:manipulation;
  }
  html[data-theme=macos] .phone-home{
    display:flex;order:-2;align-items:center;justify-content:center;gap:3px;flex-shrink:0;min-width:66px;min-height:44px;padding:8px;border:0;border-radius:11px;background:transparent;color:#246ac0;box-shadow:none;font:500 14px/1.2 var(--ui-font);cursor:pointer;touch-action:manipulation;
  }
  html[data-theme=macos] .phone-home:hover{background:#eaf0f9}
  html[data-theme=macos] .phone-home:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
  html[data-theme=macos] .drag-handle{justify-content:flex-start;min-height:44px;padding:6px 2px;gap:7px;font-size:14px;font-weight:600;touch-action:manipulation;cursor:default}
  html[data-theme=macos] .title-icon{display:none}
  html[data-theme=macos] .window-content{overflow-x:hidden;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  html[data-theme=macos] .window-content :is(.hero-grid,.section-content){padding:24px 20px}
  html[data-theme=macos] .window-content :is(.button,.example-tabs button){min-height:44px}
  html[data-theme=macos] .window-content :is(p,li,h1,h2,h3){overflow-wrap:break-word}
  html[data-theme=macos] .window-content .button{white-space:normal}
  html[data-theme=macos] .window-content h1{font-size:clamp(30px,8.8vw,38px)}
  html[data-theme=macos] .window-content h2{font-size:clamp(27px,7.5vw,33px)}
  html[data-theme=macos] .window-content .theme-settings h2{font-size:27px}
  html[data-theme=macos] .theme-settings{padding:24px 18px}
  html[data-theme=macos] .wizard-header{padding:9px 16px}
  html[data-theme=macos] .wizard-sidebar{padding:6px 8px}
  html[data-theme=macos] .wizard-sidebar button{min-height:52px;font-size:10px;gap:3px}
  html[data-theme=macos] .wizard-main{padding:20px 16px;scrollbar-gutter:auto}
  html[data-theme=macos] .window-content .wizard-main h2{font-size:25px}
  html[data-theme=macos] .project-wizard .button{min-height:44px}
  html[data-theme=macos] footer.wizard-footer{position:static;min-height:68px;padding:10px 12px;gap:7px;flex-shrink:0}
  html[data-theme=macos] .wizard-privacy summary{min-height:44px;display:flex;align-items:center}
  html[data-theme=macos] .start-menu,html[data-theme=macos] .start-menu.is-top-menu{
    top:auto;left:14px;right:14px;bottom:var(--phone-bottom);width:auto;max-height:calc(100dvh - var(--phone-top) - var(--phone-bottom) - 10px);padding:12px;border-radius:24px;overflow-x:hidden;overflow-y:auto;
    background:#faf6fcf5;box-shadow:0 12px 40px #241c4447;
  }
  html[data-theme=macos] .start-menu-items>p{font-size:11px;padding:6px 12px 12px}
  html[data-theme=macos] .start-menu-items :is(button,a){min-height:48px;padding:11px 12px;font-size:14px;border-radius:12px}
  html[data-theme=macos] .start-menu-items :is(button,a):focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
  html[data-theme=macos] .start-menu-divider{margin:8px 10px}
}

@media (max-width: 600px) and (max-height:700px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) and (max-height:700px) {
  html[data-theme=macos] .wallpaper-brand{top:8px;width:220px}
  html[data-theme=macos] .wallpaper-brand span{margin-top:10px;font-size:10px}
  html[data-theme=macos] .desktop-icons{top:182px;gap:18px 4px}
  html[data-theme=macos] .desktop-hint{font-size:10px;bottom:4px}
}
@media (max-width: 600px) and (max-height:580px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) and (max-height:580px) {
  html[data-theme=macos] .wallpaper-brand{width:150px;top:0}
  html[data-theme=macos] .wallpaper-brand span{display:none}
  html[data-theme=macos] .desktop-icons{top:88px;gap:8px 4px}
  html[data-theme=macos] .desktop-icon{min-height:80px;gap:5px}
  html[data-theme=macos] .icon-art{width:52px;height:52px;border-radius:15px}
  html[data-theme=macos] .desktop-hint{display:none}
}
@media(max-width:350px){html[data-theme=macos] .dock-label{font-size:9px}}
