:root {
  --z-app: 105;

  --tw-z-settings: 220;
  --tw-z-island: 300;
  --tw-z-p2-sheet: 350;
  --tw-z-theme: 400;
  --tw-z-i18n: 500;
  --tw-app-bg:
    radial-gradient(120% 55% at 50% -8%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 70%),
    var(--theme-bg);
}

.tw-island { z-index: var(--tw-z-island, 300); }

.tw-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 22px 6px;
  justify-items: center;
  padding: 10px 0 0;
}
.tw-appcell { display: flex; justify-content: center; width: 100%; }

.tw-appicon {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  width: 76px; padding: 0;
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.tw-appicon-tile {
  position: relative; display: block;
  width: 60px; height: 60px;
  border-radius: 22.37%;
  overflow: hidden;
  background: var(--tw-icon-bg, #101a17);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14), 0 6px 14px rgb(0 0 0 / .34);
}
.tw-appicon-tile > svg { display: block; width: 100%; height: 100%; }
.tw-appicon-label {
  max-width: 100%;
  font-size: 11px; line-height: 1.2; font-weight: 500;
  color: var(--theme-text);
  text-shadow: 0 1px 3px rgb(0 0 0 / .5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: var(--tw-lab, 1);
}

.tw-appicon[data-live="true"] .tw-appicon-tile { opacity: 0; }
.tw-appicon:focus-visible .tw-appicon-tile { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.tw-appicon[data-badge="1"] .tw-appicon-tile::after {
  content: ""; position: absolute; top: 5px; right: 5px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--color-danger); box-shadow: 0 0 0 2px rgb(0 0 0 / .55);
}

.tw-apps-layer {
  position: absolute; inset: 0;
  z-index: var(--z-app);
  pointer-events: none;
  isolation: isolate;
  overflow: hidden;
}
.tw-apps-scrim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }

.tw-app-win {
  position: absolute; left: 0; top: 0;
  width: 0; height: 0;
  overflow: hidden;
  contain: layout paint style;
  transform-origin: 0 0;
  background: var(--tw-app-bg);
  color: var(--theme-text);
  border-radius: 14px;
  box-shadow: 0 16px 44px rgb(0 0 0 / .42), 0 3px 10px rgb(0 0 0 / .24);
  visibility: hidden;
  pointer-events: none;
  outline: none;
  will-change: transform, width, height;
}
.tw-app-win[data-state="opening"],
.tw-app-win[data-state="open"],
.tw-app-win[data-state="dragging"] { visibility: visible; pointer-events: auto; }
.tw-app-win[data-state="closing"] { visibility: visible; pointer-events: none; }

.tw-app-win[data-docked="true"] {
  width: 100%; height: 100%;
  border-radius: 0; box-shadow: none; transform: none;
  will-change: auto;
}

.tw-app-face { position: absolute; inset: 0; background: var(--tw-icon-bg, #101a17); pointer-events: none; overflow: hidden; }
.tw-app-face::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); }
.tw-app-glyph { position: absolute; left: 50%; top: 50%; width: 100px; height: 100px; transform-origin: 50% 50%; }
.tw-app-glyph > svg { display: block; width: 100%; height: 100%; }
.tw-app-win[data-docked="true"] .tw-app-face { display: none; }

.tw-app-content {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  transform-origin: 0 0;
  pointer-events: none;
}
.tw-app-win[data-interactive="true"] .tw-app-content { pointer-events: auto; }
.tw-app-body { position: absolute; inset: 0; overflow: hidden; }

.tw-app-x {

  display: none !important;
  position: absolute; z-index: 5;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: max(14px, env(safe-area-inset-left, 0px));
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgb(255 255 255 / .12);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 0 0 1px rgb(255 255 255 / .07);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tw-app-x svg { width: 16px; height: 16px; }

.tw-app-edge-close {
  position: absolute;
  z-index: 8;
  bottom: 0;
  width: 64px;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  cursor: pointer;
}
.tw-app-edge-close--left { left: 0; }
.tw-app-edge-close--right { right: 0; }
.tw-app-edge-close:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) { .tw-app-win { will-change: auto; } }
