/* Minutechbuilds OS: app icons, desktop folders, folder + app windows, Launchpad, dock faces.
   Built on the Liquid Glass tokens in glass.css. Built-in app styles live in apps-builtin.css. */

.launchpad[hidden], .lp-tile[hidden], .lp-group[hidden], .lp-empty[hidden], .osa-panel[hidden], .desktop-apps > [hidden], .nt-empty[hidden] { display: none !important; }

/* ---------- Squircle app icons (shared by desktop, folders, Launchpad, Spotlight) ---------- */
.osapp-icon {
  --sz: 64px;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--sz);
  height: var(--sz);
  border-radius: calc(var(--sz) * .225);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: linear-gradient(150deg, #6ab4ff, #2f6fe0);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), 0 0 0 .5px rgba(0, 10, 30, .18), 0 6px 14px rgba(0, 12, 40, .22);
}
.osapp-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(165deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 52%);
  pointer-events: none;
}
.osapp-icon img { width: 66%; height: 66%; object-fit: contain; }
.osapp-glyph { display: block; width: 52%; height: 52%; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.osapp-svg { width: 56%; height: 56%; }
.osapp-icon.is-notes { background: linear-gradient(160deg, #fff1a8, #f3b81f); color: #6b4b00; }
.osapp-icon.is-labour { background: linear-gradient(150deg, #7ad7e6, #2a8ea6); }
.osapp-icon.is-diagnostic { background: linear-gradient(150deg, #ff8fa3, #d6455d); }
.osapp-icon.is-brand::after { opacity: .55; }

/* ---------- Desktop: three columns of icons, extra folder tints ---------- */
.folder-green { --folder-top: #86dfae; --folder-bottom: #25965f; }
.folder-orange { --folder-top: #ffc27a; --folder-bottom: #e8662a; }
.desktop-apps .desktop-icon > .osapp-icon { margin-top: 2px; }
.desktop-apps .desktop-icon > .osapp-icon + strong { margin-top: 16px; }
@media (min-width: 761px) {
  .desktop-apps { width: 395px; grid-template-columns: repeat(3, 115px); gap: 20px 25px; }
}

/* ---------- Dock faces ---------- */
.dock-copilot { background: linear-gradient(150deg, #7fd6a2, #2a9066); }
.dock-copilot img { filter: invert(1); }
.dock-notes { background: linear-gradient(160deg, #fff1a8, #f3b81f); }
.dock-notes svg { width: 58%; height: 58%; stroke: #6b4b00; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-folder-games { background: linear-gradient(150deg, #86dfae, #25965f); }
.dock-folder-games img { filter: invert(1); }
.dock-launchpad { background: linear-gradient(160deg, #f1f4fa, #b9c5db); }
.dock-launchpad svg { width: 62%; height: 62%; }

/* ---------- Folder window (Finder style) ---------- */
.app-window[data-window^="folder-"] { width: 840px; height: 560px; }
.app-window[data-window^="app-"], .app-window[data-window="diagnostic"] { width: 1060px; height: 700px; }
.app-window[data-window="about-os"] { width: 660px; height: 470px; }
.osf-main { padding-top: 22px; }
.osf-main h1 { margin: 2px 0 6px; }
.osf-blurb { color: var(--lg-text-2); max-width: 46ch; margin: 0 0 22px; }
.osf-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px 8px; }
.osf-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--lg-text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: background var(--lg-fast) var(--lg-ease), transform var(--lg-medium) var(--lg-spring);
}
.osf-item:hover { background: var(--os-hover); }
.osf-item:active { transform: scale(.96); }
.osf-item:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: -2px; background: var(--lg-accent-soft); }
.osf-item strong { font-size: 13px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.osf-status { font-size: 11px; color: var(--lg-text-3); line-height: 1.2; }
.osf-status.is-live::before, .osa-chip.is-live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #30c15f; vertical-align: 1px; }

/* ---------- App window ---------- */
.osa-main { display: flex; flex-direction: column; gap: 14px; overflow: hidden; padding: 18px 22px 16px; }
.osa-head { display: flex; align-items: flex-start; gap: 16px; flex: none; }
.osa-head > .osapp-icon { margin-top: 2px; }
.osa-titles { flex: 1; min-width: 0; }
.osa-main p { margin: 0; }
.osa-main h1 { margin: 0 0 4px; font-size: 24px; }
.osa-titles .section-kicker { margin: 0 0 2px; color: var(--lg-text-3); }
.osa-tag { margin: 0; color: var(--lg-text); }
.osa-aud { margin: 3px 0 0; color: var(--lg-text-2); font-size: 12px; }
.osa-aud b { font-weight: 600; color: var(--lg-text-3); margin-right: 4px; }
.osa-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.osa-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.osa-chip {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--lg-text-2);
  background: var(--os-card);
  box-shadow: inset 0 0 0 .5px var(--os-card-line);
}
.osa-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-right: 4px; }
.osa-scroll h2 { margin: 4px 0 6px; }
.osa-copy { max-width: 64ch; color: var(--lg-text-2); }
.osa-note { margin-top: 16px; color: var(--lg-text-3); }
.osa-scroll .project-image { margin: 16px 0 6px; max-width: 760px; }
.osa-scroll .project-image img { display: block; width: 100%; height: auto; }
.osa-card { padding: 22px 24px; border-radius: 18px; background: var(--os-card); box-shadow: inset 0 0 0 .5px var(--os-card-line); }
.osa-card h2 { margin: 0 0 6px; }
.osa-private {
  margin: auto;
  max-width: 420px;
  padding: 26px 28px;
  border-radius: 20px;
  text-align: center;
  background: var(--os-card);
  box-shadow: inset 0 0 0 .5px var(--os-card-line);
}
.osa-private strong { font-size: 15px; }
.osa-private p { margin: 8px 0 0; color: var(--lg-text-2); }

.osa-frame {
  position: relative;
  flex: 1;
  min-height: 260px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 .5px var(--os-card-line), var(--lg-shadow-sm);
}
.osa-iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.osa-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--lg-fill-thick);
  color: var(--lg-text);
  pointer-events: none;
}
.osa-frame[data-loading] .osa-loading { display: flex; }
.osa-loading p { margin: 10px 0 0; font-weight: 600; }
.osa-loading small { color: var(--lg-text-3); font-size: 11px; }
.osa-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--lg-accent-soft); border-top-color: var(--lg-accent); animation: osa-spin .8s linear infinite; }
@keyframes osa-spin { to { transform: rotate(360deg); } }

.osa-tabs { display: inline-flex; align-self: flex-start; padding: 3px; gap: 2px; border-radius: 999px; background: var(--os-seg); flex: none; }
.osa-tabs button { min-height: 28px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--lg-text-2); font: 500 12px var(--lg-font); cursor: pointer; }
.osa-tabs button[aria-selected="true"] { background: var(--os-seg-on); color: var(--lg-text); box-shadow: 0 1px 3px rgba(0, 12, 40, .18); }
.osa-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- Launchpad ---------- */
.launchpad {
  position: absolute;
  inset: 0;
  z-index: 2900;
  display: flex;
  justify-content: center;
  padding: 64px 40px 140px;
  overflow-y: auto;
  background: rgba(14, 24, 52, .34);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  backdrop-filter: blur(40px) saturate(150%);
  animation: lp-in .34s var(--lg-spring);
}
body.dark-desktop .launchpad { background: rgba(4, 8, 20, .5); }
@keyframes lp-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.lp-inner { width: min(1000px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.lp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 100%);
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--lg-sheen), rgba(255, 255, 255, .16);
  box-shadow: var(--lg-rim), var(--lg-shadow-sm);
}
.lp-search svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.lp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: 400 14px var(--lg-font); }
.lp-search input::placeholder { color: rgba(255, 255, 255, .72); }
.lp-search:focus-within { box-shadow: var(--lg-rim), 0 0 0 3px rgba(10, 132, 255, .55); }
.lp-groups { width: 100%; display: flex; flex-direction: column; gap: 20px; }
.lp-group h2 { margin: 0 0 6px; text-align: center; color: rgba(255, 255, 255, .78); font: 600 11px var(--lg-font); letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 1px 3px rgba(0, 8, 30, .4); }
.lp-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.lp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 112px;
  gap: 7px;
  padding: 8px 4px 8px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: #fff;
  font: 500 12px/1.25 var(--lg-font);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 8, 30, .5);
  cursor: pointer;
  transition: background var(--lg-fast) var(--lg-ease), transform var(--lg-medium) var(--lg-spring);
}
.lp-tile:hover, .lp-tile:focus-visible { background: rgba(255, 255, 255, .16); transform: scale(1.04); outline: none; }
.lp-tile:focus-visible { box-shadow: 0 0 0 2px #fff; }
.lp-tile:active { transform: scale(.95); }
.lp-empty { margin: 40px 0 0; color: rgba(255, 255, 255, .85); font-size: 15px; text-shadow: 0 1px 4px rgba(0, 8, 30, .4); }

body.ios-mode .launchpad { display: none !important; }
body.motion-reduced .launchpad, body.motion-reduced .osa-spinner { animation: none; }
body.motion-reduced .lp-tile, body.motion-reduced .osf-item { transition: none; }
@media (prefers-reduced-motion: reduce) { .launchpad { animation: none; } .osa-spinner { animation-duration: 2s; } }

/* ---------- Narrow windows (iPad portrait and small laptops) ---------- */
@media (max-width: 900px) {
  .osa-head { flex-wrap: wrap; }
  .osa-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}

/* Long catalogs scroll inside Launchpad instead of running under the Dock. */
.launchpad { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 150px; scrollbar-width: none; }
.launchpad::-webkit-scrollbar { display: none; }
.lp-inner { margin-block: auto; }
