/* Rail fills have one owner. State changes only the outline and indicator. */
.dock-app { --dock-fill: #fff8ec; background-color: var(--dock-fill); }
.dock-app.os, .dock-app.resources, .dock-app.pharmacists { --dock-fill: #F28C72; }
.dock-app.analytics, .dock-app.about, .dock-app.asc { --dock-fill: #65B7A6; }
.dock-app.consulting, .dock-app.trust { --dock-fill: #B6A4D7; }
.dock-app.book, .dock-app.data { --dock-fill: #F5C773; }

.desktop-app:is(.more, .characters) .desktop-icon { position: relative; }
.desktop-app:is(.more, .characters)[data-open] .desktop-icon::after {
  content: ''; position: absolute; bottom: -5px; left: 50%;
  width: 6px; height: 6px; border: 1px solid #fff8ec; border-radius: 50%;
  background: #65b7a6; transform: translateX(-50%);
}
.desktop-app:is(.more, .characters)[data-minimized] .desktop-icon::after { background: transparent; }

.dock-tooltip {
  pointer-events: none;
}

.desktop-shell .dock[data-overflow] {
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: flex-start;
  scrollbar-width: thin;
}

@media (min-width: 601px) {
  #desktop {
    z-index: auto;
  }

  .dock[data-overflow] [data-dock-app='desktop'] {
    position: sticky;
    left: 0;
    z-index: 2;
  }

  .desktop-wallpaper {
    left: 0;
  }

  .desktop-shell {
    grid-template-columns: minmax(0, 1fr);
    height: 100svh;
    min-height: 0;
    overflow: clip;
  }

  .desktop-work {
    display: grid;
    grid-template-rows: 84px minmax(0, 1fr);
    grid-column: 1;
    height: calc(100svh - var(--privacy-notice-height, 0px));
    min-height: 0;
    isolation: auto;
    padding: 0 16px 12px;
  }

  .desktop-work > .system-bar {
    height: auto;
    align-items: flex-start;
    padding-top: 16px;
    gap: 8px;
  }

  .desktop-shell .workspace-layout {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: none;
    margin: 0 auto;
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .desktop-shell .app-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }

  .desktop-shell .app-window > .window-bar {
    flex: none;
    height: 44px;
    min-height: 44px;
    padding: 0 8px;
  }

  .desktop-shell .window-controls {
    gap: 2px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .desktop-shell .window-control {
    width: 44px;
    height: 44px;
  }

  .desktop-shell .window-identity {
    gap: 8px;
  }

  .desktop-shell .window-app-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .desktop-shell .window-app-icon .product-small {
    width: 28px;
    height: 28px;
  }

  .desktop-shell .window-title {
    font-size: 13px;
    line-height: 1.3;
  }

  .desktop-shell .app-window > .window-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .desktop-shell .window-content {
    padding: 20px 28px;
  }

  .desktop-shell.has-legal-window .workspace-layout {
    min-height: 0;
  }

  .desktop-shell .app-window.legal-window {
    height: 100%;
    max-height: 100%;
  }

  .desktop-shell.is-desktop .workspace-layout {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .desktop-shell .desktop-launcher {
    min-height: 100%;
    height: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr)) 44px;
    gap: 16px;
    padding: 20px 16px;
  }

  .desktop-launcher .desktop-intro {
    grid-column: 2 / 5;
    grid-row: 1 / 3;
    justify-self: center;
    align-self: center;
    max-width: 400px;
    width: 100%;
    margin: 0;
    padding: 20px;
  }

  .desktop-launcher .desktop-intro h1 {
    font-size: clamp(26px, 2vw, 32px);
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 12px;
  }

  .desktop-launcher .desktop-intro p {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
  }

  .desktop-launcher .desktop-talk {
    font-size: 13px;
    margin: 0;
  }

  .desktop-launcher .desktop-apps {
    display: contents;
  }

  .desktop-launcher .desktop-app {
    justify-self: center;
    align-self: center;
    width: 112px;
    min-height: 92px;
    padding: 6px;
  }

  .desktop-launcher .desktop-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 6px;
  }

  .desktop-launcher .desktop-icon > .product-art,
  .desktop-launcher .desktop-icon > .glyph {
    width: 56px;
    height: 56px;
  }

  .desktop-launcher .desktop-app strong {
    font-size: 13px;
  }

  .desktop-launcher .desktop-app.os { grid-area: 1 / 1; }
  .desktop-launcher .desktop-app.analytics { grid-area: 1 / 5; }
  .desktop-launcher .desktop-app.consulting { grid-area: 2 / 6; }
  .desktop-launcher .desktop-app.resources { grid-area: 2 / 1; }
  .desktop-launcher .desktop-app.data { grid-area: 3 / 2; }
  .desktop-launcher .desktop-app.trust { grid-area: 3 / 4; }
  .desktop-launcher .desktop-app.about { grid-area: 3 / 6; }
  .desktop-launcher .desktop-app.characters { grid-area: 2 / 5; }
  .desktop-launcher .desktop-app.more { grid-area: 1 / 6; }

  .desktop-launcher .desktop-audiences {
    display: flex;
    width: auto;
    grid-column: 2 / 6;
    grid-row: 4;
    justify-self: center;
    align-self: center;
    flex-wrap: nowrap;
    gap: 12px;
    margin: 0;
  }

  .desktop-launcher .desktop-audiences > a {
    min-width: 164px;
    min-height: 44px;
    padding: 6px 10px;
    gap: 8px;
    font-size: 12px;
  }

  .desktop-launcher .desktop-audiences .product-small {
    width: 26px;
    height: 26px;
  }

  .desktop-shell .dock {
    position: fixed;
    top: 8px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    margin: 0;
    max-width: calc(100vw - 368px);
    gap: 6px;
    padding: 6px 6px 10px;
    border-radius: 16px;
    overflow: visible;
    scrollbar-width: thin;
    justify-content: flex-start;
  }

  .desktop-shell .dock-app {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .desktop-shell .dock-app > .product-small,
  .desktop-shell .dock-app > .glyph {
    width: 28px;
    height: 28px;
  }

  .dock-tooltip {
    top: calc(100% + 12px);
    bottom: auto;
  }

  .dock-app[data-active] {
    outline: 2px solid #0d7377;
    outline-offset: 2px;
  }

  .dock-app[data-open]::after,
  .dock-app[data-minimized]::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink);
  }

  .dock-app[data-minimized]::after {
    background: transparent;
    border: 1px solid var(--ink);
  }

  .dock-app:hover,
  .dock-app:active {
    transform: none;
  }

  :root[data-theme='dark'] .dock-app[data-active] {
    outline-color: #f5c773;
  }
}

@media (min-width: 901px) and (pointer: fine) {
  .desktop-shell .desktop-work {
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .desktop-shell .dock {
    gap: 4.5px;
    padding: 4.5px 4.5px 7.5px;
    border-radius: 12px;
  }

  .desktop-shell .dock-app {
    width: 33px;
    height: 33px;
    min-width: 33px;
    min-height: 33px;
    border-radius: 7.5px;
  }

  .desktop-shell .dock-app > :is(.product-small, .glyph) {
    width: 21px;
    height: 21px;
  }

  .desktop-shell .dock-app[data-active] {
    outline-width: 1.5px;
    outline-offset: 1.5px;
  }

  .desktop-shell .dock-app[data-open]::after,
  .desktop-shell .dock-app[data-minimized]::after {
    width: 4px;
    height: 4px;
    bottom: -5px;
  }

  .desktop-shell .app-window {
    border-radius: 14px;
  }

  .desktop-shell .app-window > .window-bar {
    height: 33px;
    min-height: 33px;
    padding: 0 6px;
  }

  .desktop-shell .window-control {
    width: 33px;
    height: 33px;
    min-width: 33px;
    min-height: 33px;
  }

  .desktop-shell .window-control > .glyph {
    width: 14px;
    height: 14px;
  }

  .desktop-shell .window-app-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }

  .desktop-shell .window-app-icon .product-small {
    width: 21px;
    height: 21px;
  }

  .desktop-shell .window-identity {
    gap: 6px;
  }

  .desktop-shell .window-title {
    font-size: 12px;
  }

  .desktop-shell .system-actions > :is(a, button),
  .desktop-shell .wallpaper-info > summary {
    width: 33px;
    height: 33px;
    min-width: 33px;
    min-height: 33px;
    padding: 6px;
    border-radius: 10px;
  }

  .desktop-shell .system-actions .product-small,
  .desktop-shell .wallpaper-info > summary .glyph {
    width: 21px;
    height: 21px;
  }

  .desktop-shell .desktop-work > .system-bar {
    padding-top: 12px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .desktop-shell .dock {
    left: 16px;
    transform: none;
    max-width: calc(100vw - 200px);
  }
}

@media (min-width: 601px) and (max-width: 900px), (min-width: 601px) and (max-height: 550px) {
  .desktop-shell .desktop-launcher {
    height: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 12px;
    padding: 12px;
  }

  .desktop-launcher .desktop-intro {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: 400px;
  }

  .desktop-shell .desktop-launcher .desktop-app {
    grid-area: auto;
    width: 100%;
  }

  .desktop-launcher .desktop-audiences {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (min-width: 601px) and (max-height: 500px) {
  .desktop-shell .app-window > .window-content {
    padding: 16px 20px;
  }
}

.desktop-shell .system-actions {
  position: relative;
}

.wallpaper-info {
  position: static;
  flex: none;
}

.wallpaper-info > summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff50;
  border-radius: 14px;
  background: #172e43a6;
  color: #fff8ec;
  cursor: pointer;
  list-style: none;
}

.wallpaper-info > summary::-webkit-details-marker {
  display: none;
}

.wallpaper-info > summary .glyph,
.wallpaper-info > summary svg {
  width: 22px;
  height: 22px;
}

.wallpaper-info > summary:focus-visible {
  outline: 2px dashed #f5c773;
  outline-offset: 3px;
}

.wallpaper-info-panel {
  position: absolute;
  z-index: 95;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100svh - 92px - var(--privacy-notice-height, 0px));
  overflow: auto;
  padding: 16px;
  border: 1px solid #ffffff50;
  border-radius: 12px;
  background: #172e43;
  color: #fff8ec;
  box-shadow: 0 10px 32px #0005;
}

.wallpaper-info-panel .scene-panel {
  width: 100%;
  max-width: none;
}

.wallpaper-info-panel .scene-panel > a {
  padding-right: 0;
}

.wallpaper-info-panel .scene-controls {
  position: static;
  margin-top: 8px;
}

.wallpaper-info-panel .scene-detail {
  position: static;
  max-height: none;
  margin-top: 8px;
}

.mobile-site-header {
  display: none;
}

.more-page { width: 100%; margin: 0 auto; }
.desktop-shell .app-window[data-app='more'] > .window-content h1 { margin: 0; font-size: 24px; }
.more-groups { display: grid; gap: 24px; margin-top: 16px; }
.more-group h2 { margin-bottom: 12px; font-size: 15px; }
.more-links { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.more-links :is(a, button) {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px;
  padding: 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.more-links :is(a, button):hover { background: var(--selection); }
.more-links :is(.product-small, .glyph) { flex: none; width: 24px; height: 24px; }
@media (min-width: 601px) {
  .more-mobile-navigation { display: none; }
  .more-utilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-shell[data-page='more']:not(.window-expanded) .app-window[data-app='more'] {
    width: min(560px, 100%); height: auto; max-height: 100%;
    align-self: start; justify-self: center;
  }
}

@media (max-width: 600px) {
  .wallpaper-info-panel {
    max-height: calc(100svh - 144px - var(--privacy-notice-height, 0px));
  }

  .desktop-shell .dock {
    display: none;
  }

  .desktop-shell .app-window > .window-bar {
    height: 44px;
    min-height: 44px;
    padding: 0 8px;
  }

  .desktop-shell .window-controls {
    gap: 2px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .desktop-shell .window-control {
    width: 44px;
    height: 44px;
  }

  .desktop-shell .window-app-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .desktop-shell .window-app-icon .product-small {
    width: 26px;
    height: 26px;
  }

  .desktop-shell .window-title {
    font-size: 13px;
  }

  .mobile-site-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .mobile-site-header .brand {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0;
  }

  .mobile-site-header .brand img {
    width: 100%;
    max-width: 118px;
  }

  .mobile-site-header :is(.mobile-header-cta, .mobile-more-link) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 12px;
    white-space: nowrap;
  }

  .mobile-more-link :is(.product-small, .glyph) {
    width: 20px;
    height: 20px;
  }

  .more-groups {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}
