:root {
  color-scheme: dark;
  --bg: #020713;
  --ink: #f3f8ff;
  --muted: #92a9bb;
  --cyan: #16d8ff;
  --header-height: 66px;
  --footer-height: 56px;
  --card-radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 6%, rgba(18, 102, 225, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(0, 210, 255, 0.13), transparent 31rem),
    linear-gradient(180deg, #061321 0%, #020713 54%, #01040a 100%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  content: "";
  background-image: url("../assets/textures/panel-grain.svg");
  opacity: 0.1;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.portal-bg {
  position: fixed;
  inset: 0;
  z-index: -4;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 19%, transparent 81%, rgba(0, 0, 0, 0.42)),
    linear-gradient(180deg, rgba(13, 31, 49, 0.26), rgba(0, 0, 0, 0.1));
}

.bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background:
    linear-gradient(rgba(108, 203, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 203, 255, 0.1) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(180deg, transparent, black 12%, black 74%, transparent);
}

.bg-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 216, 255, 0.42), transparent);
  opacity: 0.54;
}

.bg-line-one {
  top: 18%;
  left: 5%;
  width: 38%;
}

.bg-line-two {
  right: 5%;
  bottom: 16%;
  width: 44%;
}

.portal-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 clamp(16px, 3vw, 36px);
  background: linear-gradient(180deg, rgba(4, 13, 23, 0.97), rgba(3, 10, 18, 0.88));
  border-bottom: 1px solid rgba(117, 210, 255, 0.2);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--cyan);
  font-size: 1.36rem;
  font-weight: 760;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(0, 216, 255, 0.3);
}

.brand img {
  display: block;
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px rgba(0, 216, 255, 0.34));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(14, 31, 47, 0.92), rgba(5, 13, 23, 0.96));
  border: 1px solid rgba(92, 194, 255, 0.27);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 20px rgba(0, 0, 0, 0.22);
}

.header-button img {
  display: block;
  width: 22px;
  height: 22px;
}

.header-link {
  width: auto;
  min-width: 42px;
  grid-auto-flow: column;
  gap: 8px;
  padding: 0 12px;
  color: rgba(239, 249, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 780;
  text-decoration: none;
}

.header-button:hover {
  border-color: rgba(54, 218, 255, 0.54);
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  color: rgba(226, 246, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 780;
  text-shadow: none;
  background: rgba(22, 216, 255, 0.08);
  border: 1px solid rgba(117, 210, 255, 0.22);
  border-radius: 99px;
}

.portal-stage {
  position: relative;
  z-index: 1;
  min-height: calc(100svh - var(--header-height));
  padding: clamp(14px, 2vh, 18px) clamp(16px, 2.2vw, 30px) 18px;
}

.hub-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(216px, 1fr);
  gap: clamp(14px, 1.3vw, 18px);
}

.portal-admin .service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
  --accent: #16d8ff;
  position: relative;
  display: grid;
  min-height: 216px;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr) var(--footer-height);
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    linear-gradient(145deg, #142335, #081420 56%, #040811);
  border: 1px solid rgba(127, 204, 245, 0.28);
  border-radius: var(--card-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -24px 40px rgba(0, 0, 0, 0.26),
    0 18px 36px rgba(0, 0, 0, 0.34);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.service-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 16% 24%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 10rem),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 11%, transparent), transparent 40%);
  opacity: 0.95;
}

.service-card::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 68%, white 10%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -24px 40px rgba(0, 0, 0, 0.22),
    0 24px 44px rgba(0, 0, 0, 0.38),
    0 0 22px color-mix(in srgb, var(--accent) 18%, transparent);
}

.service-card:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: 90ms;
}

.service-card.is-disabled {
  cursor: default;
}

.service-card.is-disabled:active {
  transform: translateY(-4px);
}

.service-card:focus-visible,
.header-button:focus-visible,
.brand:focus-visible {
  outline: 2px solid #c8f4ff;
  outline-offset: 4px;
}

.service-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 72%, white 10%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -24px 40px rgba(0, 0, 0, 0.22),
    0 0 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.service-card:hover .app-window {
  border-color: color-mix(in srgb, var(--accent) 38%, white 8%);
  background-color: rgba(14, 32, 50, 0.28);
}

.service-card:focus-visible .app-window {
  border-color: color-mix(in srgb, var(--accent) 38%, white 8%);
}

.service-card:hover .card-action b {
  background: color-mix(in srgb, var(--accent) 84%, white 12%);
}

.service-card:focus-visible .card-action b {
  background: color-mix(in srgb, var(--accent) 84%, white 12%);
}

html.has-gsap .service-card {
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

html.has-gsap .service-card:hover,
html.has-gsap .service-card:active {
  transform: none;
}

@media (min-width: 1181px) {
  .service-grid {
    min-height: min(780px, calc(100svh - var(--header-height) - 34px));
    grid-template-rows: repeat(3, minmax(206px, 1fr));
  }

  .portal-public .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(210px, 1fr);
    min-height: 0;
  }
}

.card-visual {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(104px, 27%) minmax(0, 1fr);
}

.card-identity {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.012));
  border-right: 1px solid rgba(143, 224, 255, 0.16);
}

.card-identity::before {
  position: absolute;
  width: 116px;
  height: 116px;
  content: "";
  border: 1px solid color-mix(in srgb, var(--accent) 46%, transparent);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.08));
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.04), 0 0 24px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: rotate(45deg);
}

.card-identity::after {
  position: absolute;
  inset: 14px;
  content: "";
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 10px;
}

.card-identity img {
  position: relative;
  z-index: 1;
  display: block;
  width: 74px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 0 11px color-mix(in srgb, var(--accent) 38%, transparent));
}

.identity-lines {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 42%;
  gap: 6px;
}

.identity-lines i {
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 58%, white 8%));
  border-radius: 99px;
}

.identity-lines i:nth-child(2) {
  width: 72%;
  justify-self: end;
}

.identity-lines i:nth-child(3) {
  width: 50%;
  justify-self: end;
}

.service-preview {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 28%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 10rem),
    linear-gradient(145deg, rgba(14, 30, 47, 0.84), rgba(4, 9, 16, 0.52));
}

.app-window {
  position: absolute;
  inset: 11px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(186, 232, 255, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent 34%),
    linear-gradient(145deg, rgba(10, 25, 41, 0.95), rgba(3, 8, 15, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -22px 36px rgba(0, 0, 0, 0.28);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.app-window::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(128, 220, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 220, 255, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, black, transparent 94%);
}

.app-window::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.72;
}

.app-topbar,
.mock-topbar,
.media-nav,
.file-toolbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 29px;
  gap: 8px;
  padding: 0 10px;
  background: rgba(1, 6, 12, 0.58);
  border-bottom: 1px solid rgba(167, 228, 255, 0.12);
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots i,
.app-topbar > i,
.mock-topbar > i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 62%, white 12%);
}

.search-pill {
  flex: 1;
  height: 17px;
  min-width: 0;
  padding: 1px 9px;
  overflow: hidden;
  color: rgba(239, 249, 255, 0.72);
  font-size: 0.68rem;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(235, 248, 255, 0.08);
  border: 1px solid rgba(235, 248, 255, 0.1);
  border-radius: 99px;
}

.card-footer {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  height: var(--footer-height);
  padding: 0 14px;
  background:
    linear-gradient(90deg, rgba(2, 7, 13, 0.96), rgba(7, 17, 29, 0.94)),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 46%);
  border-top: 1px solid rgba(132, 215, 255, 0.18);
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: max-content;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.state-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #48f46c;
  box-shadow: 0 0 9px rgba(72, 244, 108, 0.58);
}

.is-placeholder .state-dot {
  background: #28d7ff;
  box-shadow: 0 0 9px rgba(40, 215, 255, 0.58);
}

.is-standby .state-dot {
  background: #ffd166;
  box-shadow: 0 0 9px rgba(255, 209, 102, 0.52);
}

.is-offline .state-dot {
  background: #ff5d6c;
  box-shadow: 0 0 9px rgba(255, 93, 108, 0.48);
}

.is-maintenance .state-dot {
  background: #ffb15f;
  box-shadow: 0 0 9px rgba(255, 177, 95, 0.48);
}

.is-pending .state-dot {
  background: #8fa7b7;
  box-shadow: 0 0 9px rgba(143, 167, 183, 0.36);
}

.service-name {
  min-width: 0;
  overflow: hidden;
  color: #f5faff;
  font-size: 1.08rem;
  font-weight: 820;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: max-content;
  color: color-mix(in srgb, var(--accent) 70%, #f2fbff);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.card-action b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #06111d;
  background: color-mix(in srgb, var(--accent) 76%, white 10%);
  border-radius: 50%;
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 24%, transparent);
}

.is-disabled .card-action {
  color: rgba(198, 216, 228, 0.72);
}

.is-disabled .card-action b {
  color: rgba(233, 242, 248, 0.86);
  background: rgba(143, 167, 183, 0.22);
  box-shadow: none;
}

/* Vaultwarden */
.vault-preview {
  background:
    radial-gradient(circle at 84% 16%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 44%),
    linear-gradient(145deg, rgba(8, 19, 31, 0.98), rgba(3, 8, 15, 0.92));
}

.vault-sidebar {
  position: absolute;
  left: 0;
  top: 29px;
  bottom: 0;
  display: grid;
  align-content: start;
  width: 42px;
  gap: 10px;
  padding: 14px 10px;
  background: rgba(1, 6, 12, 0.62);
  border-right: 1px solid rgba(176, 226, 255, 0.1);
}

.vault-sidebar b {
  display: block;
  aspect-ratio: 1;
  border-radius: 7px;
  background: rgba(235, 248, 255, 0.14);
}

.vault-sidebar b:first-child {
  background: color-mix(in srgb, var(--accent) 58%, white 8%);
}

.vault-list {
  position: absolute;
  left: 54px;
  right: 15px;
  top: 42px;
  display: grid;
  gap: 8px;
}

.vault-list span,
.folder-row,
.file-row,
.task-board span {
  display: grid;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(188, 233, 255, 0.11);
  border-radius: 8px;
  background: rgba(3, 11, 20, 0.58);
}

.vault-list span {
  grid-template-columns: 23px minmax(0, 1fr) 34px 14px;
  gap: 8px;
  min-height: 26px;
  padding: 0 8px;
}

.vault-list b,
.folder-row b,
.file-row b {
  display: block;
  aspect-ratio: 1;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 50%, white 10%);
}

.vault-list i,
.folder-row i,
.file-row i,
.task-board i {
  min-width: 0;
  overflow: hidden;
  color: rgba(239, 249, 255, 0.82);
  font-size: 0.68rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-list em,
.folder-row em,
.file-row em,
.task-board em {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: rgba(235, 248, 255, 0.16);
}

.vault-list strong {
  display: block;
  width: 12px;
  height: 12px;
  background: color-mix(in srgb, var(--accent) 72%, white 12%);
  clip-path: polygon(50% 0, 62% 35%, 100% 35%, 69% 56%, 81% 92%, 50% 70%, 19% 92%, 31% 56%, 0 35%, 38% 35%);
}

.vault-shield {
  position: absolute;
  right: 17px;
  bottom: 15px;
  width: 34px;
  height: 40px;
  background: color-mix(in srgb, var(--accent) 34%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 56%, white 8%);
  clip-path: polygon(50% 0, 88% 14%, 82% 66%, 50% 100%, 18% 66%, 12% 14%);
}

/* Jellyfin */
.jelly-preview {
  background:
    radial-gradient(circle at 20% 28%, rgba(170, 93, 255, 0.34), transparent 42%),
    radial-gradient(circle at 86% 72%, rgba(0, 208, 255, 0.22), transparent 46%),
    linear-gradient(145deg, rgba(15, 13, 38, 0.98), rgba(3, 8, 17, 0.9));
}

.media-nav b,
.media-nav i {
  color: rgba(239, 249, 255, 0.8);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 760;
}

.media-nav b {
  color: #fff;
}

.now-playing {
  position: absolute;
  left: 13px;
  top: 43px;
  bottom: 16px;
  display: block;
  width: 33%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.24), transparent 28%),
    linear-gradient(145deg, #ff6fb0, color-mix(in srgb, var(--accent) 68%, #2431a5));
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.24);
}

.now-playing b {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 27px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.82);
}

.now-playing i {
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.68rem;
  font-style: normal;
}

.poster-strip {
  position: absolute;
  left: 42%;
  right: 13px;
  top: 43px;
  bottom: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.poster-strip span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.poster-one { background: linear-gradient(145deg, #9b65ff, #111d55); }
.poster-two { background: linear-gradient(145deg, #0ed2ff, #2839a8); }
.poster-three { background: linear-gradient(145deg, #ffd166, #7f49f2); }
.poster-four { background: linear-gradient(145deg, #21e7bd, #183462); }

.media-progress {
  position: absolute;
  left: 42%;
  right: 13px;
  bottom: 20px;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 30px;
  gap: 10px;
}

.media-progress b,
.song-progress {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(235, 248, 255, 0.16);
}

.media-progress b::before,
.song-progress b,
.xp-bar b {
  display: block;
  width: 62%;
  height: 100%;
  content: "";
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 72%, white 8%);
}

.media-progress i {
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 0 37%, #06111d 37% 45%, transparent 45%),
    color-mix(in srgb, var(--accent) 82%, white 8%);
}

/* Navidrome */
.navidrome-preview {
  background:
    radial-gradient(circle at 32% 48%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 42%),
    linear-gradient(145deg, rgba(8, 20, 34, 0.98), rgba(3, 7, 14, 0.9));
}

.music-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: grid;
  align-content: center;
  width: 35px;
  gap: 11px;
  padding: 0 9px;
  background: rgba(1, 6, 12, 0.58);
  border-right: 1px solid rgba(167, 229, 255, 0.1);
}

.music-sidebar i,
.file-sidebar i {
  display: block;
  aspect-ratio: 1;
  border-radius: 7px;
  background: rgba(235, 248, 255, 0.12);
}

.music-sidebar i:first-child,
.file-sidebar i:first-child {
  background: color-mix(in srgb, var(--accent) 58%, white 8%);
}

.album-stack {
  position: absolute;
  left: 51px;
  top: 31px;
  display: grid;
  width: 86px;
  height: 96px;
}

.album-stack i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background:
    radial-gradient(circle at 63% 38%, #f2fbff 0 8px, transparent 9px),
    conic-gradient(from 210deg, var(--accent), #0f2d55, color-mix(in srgb, var(--accent) 50%, #6e55ff), var(--accent));
  box-shadow: 0 0 17px color-mix(in srgb, var(--accent) 22%, transparent);
}

.album-stack i:nth-child(2) {
  transform: translate(10px, 8px);
  opacity: 0.5;
}

.album-stack i:nth-child(3) {
  transform: translate(20px, 16px);
  opacity: 0.25;
}

.music-meta {
  position: absolute;
  left: 158px;
  right: 15px;
  top: 40px;
  display: grid;
  gap: 9px;
}

.music-meta b {
  color: #f3f8ff;
  font-size: 0.72rem;
}

.music-meta i,
.summary-list i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(238, 249, 255, 0.82), rgba(238, 249, 255, 0.14));
}

.music-meta i:nth-child(3) {
  width: 66%;
}

.player-controls {
  position: absolute;
  left: 158px;
  bottom: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.player-controls i,
.player-controls b {
  display: block;
  border-radius: 50%;
  background: rgba(235, 248, 255, 0.16);
}

.player-controls i {
  width: 18px;
  height: 18px;
}

.player-controls b {
  width: 26px;
  height: 26px;
  background: color-mix(in srgb, var(--accent) 76%, white 8%);
}

.song-progress {
  position: absolute;
  left: 51px;
  right: 74px;
  bottom: 16px;
}

.equalizer {
  position: absolute;
  right: 17px;
  bottom: 17px;
  display: inline-flex;
  align-items: end;
  height: 34px;
  gap: 5px;
}

.equalizer i,
.home-meter b,
.home-meter i,
.signal-panel i,
.reward-row i,
.game-row i {
  display: block;
  width: 5px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 42%, transparent);
}

.equalizer i:nth-child(1) { height: 42%; }
.equalizer i:nth-child(2) { height: 76%; }
.equalizer i:nth-child(3) { height: 54%; }
.equalizer i:nth-child(4) { height: 92%; }
.equalizer i:nth-child(5) { height: 60%; }

/* Home Assistant */
.home-preview {
  padding: 12px;
}

.home-grid {
  position: absolute;
  inset: 12px 12px 34px;
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-tile {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(167, 229, 255, 0.14);
  border-radius: 9px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.08)),
    rgba(6, 18, 30, 0.74);
}

.home-tile b {
  color: color-mix(in srgb, var(--accent) 70%, white 20%);
  font-size: 0.94rem;
  line-height: 1;
}

.home-tile i {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-meter {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: end;
  height: 16px;
  gap: 5px;
}

.home-meter b { height: 16px; }
.home-meter i:nth-child(2) { height: 10px; }
.home-meter i:nth-child(3) { height: 14px; }

/* Le Club des Histoires */
.stories-preview {
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 209, 102, 0.28), transparent 38%),
    radial-gradient(circle at 84% 68%, rgba(125, 255, 178, 0.2), transparent 40%),
    linear-gradient(145deg, rgba(21, 17, 45, 0.98), rgba(5, 8, 20, 0.9));
}

.stories-title {
  position: absolute;
  left: 15px;
  top: 11px;
  z-index: 2;
  max-width: calc(100% - 72px);
  overflow: hidden;
  color: #fff6dd;
  font-size: 0.78rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-stage {
  position: absolute;
  inset: 35px 13px 17px;
  display: grid;
  align-items: end;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.story-card {
  position: relative;
  display: block;
  height: 84%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

.story-card b,
.story-card i,
.story-card em {
  position: absolute;
  left: 9px;
  right: 9px;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.78);
}

.story-card b { bottom: 13px; }
.story-card i { bottom: 27px; width: 52%; right: auto; opacity: 0.68; }
.story-card em {
  left: 12px;
  top: 12px;
  right: auto;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  opacity: 0.72;
}

.story-card.one { background: linear-gradient(145deg, #ffd166, #ff7ba5); }
.story-card.two { height: 100%; background: linear-gradient(145deg, #63f2ff, #7a6cff); }
.story-card.three { height: 76%; background: linear-gradient(145deg, #7dffb2, #ffe66d); }
.story-card.four { height: 91%; background: linear-gradient(145deg, #bd7bff, #2dd4bf); }

.story-stars {
  position: absolute;
  right: 14px;
  top: 13px;
  display: flex;
  gap: 6px;
}

.story-stars i {
  width: 8px;
  height: 8px;
  background: #fff6dd;
  box-shadow: 0 0 9px rgba(255, 209, 102, 0.6);
  clip-path: polygon(50% 0, 61% 36%, 100% 36%, 68% 57%, 80% 100%, 50% 74%, 20% 100%, 32% 57%, 0 36%, 39% 36%);
}

/* FileBrowser */
.file-preview {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
}

.file-toolbar {
  justify-content: space-between;
}

.file-toolbar b {
  min-width: 0;
  overflow: hidden;
  color: rgba(239, 249, 255, 0.8);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-toolbar i {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 5px;
  background: rgba(235, 248, 255, 0.12);
}

.file-sidebar {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 42px 11px 0;
  background: rgba(1, 6, 12, 0.58);
  border-right: 1px solid rgba(167, 229, 255, 0.1);
}

.file-window {
  display: grid;
  align-content: center;
  min-width: 0;
  gap: 8px;
  padding: 39px 11px 12px;
}

.folder-row,
.file-row {
  grid-template-columns: 22px minmax(0, 1fr) 48px;
  gap: 8px;
  min-height: 25px;
  padding: 0 8px;
}

.folder-row b {
  border-radius: 5px 5px 3px 3px;
}

.file-row b {
  border-radius: 5px;
  background: rgba(229, 244, 255, 0.72);
}

.folder-row em,
.file-row em {
  color: rgba(197, 219, 232, 0.68);
  font-size: 0.6rem;
  font-style: normal;
  text-align: right;
  white-space: nowrap;
  background: none;
}

/* Taskoday */
.taskoday-preview {
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 209, 102, 0.2), transparent 36%),
    linear-gradient(145deg, rgba(20, 21, 33, 0.98), rgba(4, 8, 15, 0.92));
}

.task-profile {
  position: absolute;
  left: 13px;
  top: 14px;
  display: grid;
  align-items: center;
  grid-template-columns: 42px 1fr;
  gap: 9px;
}

.task-profile b {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 38%, #fff6dd 0 8px, transparent 9px),
    linear-gradient(145deg, #ffd166, color-mix(in srgb, var(--accent) 50%, #1f375b));
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.18);
}

.task-profile i {
  color: #fff6dd;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 820;
}

.xp-bar {
  position: absolute;
  left: 64px;
  right: 15px;
  top: 50px;
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(235, 248, 255, 0.14);
}

.xp-bar b {
  width: 74%;
  background: linear-gradient(90deg, #ffd166, var(--accent));
}

.task-board {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 72px;
  display: grid;
  gap: 8px;
}

.task-board span {
  grid-template-columns: 20px minmax(0, 1fr) 34px;
  gap: 8px;
  min-height: 25px;
  padding: 0 8px;
}

.task-board b {
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffd166;
}

.task-board em {
  background: color-mix(in srgb, var(--accent) 38%, transparent);
}

.reward-row {
  position: absolute;
  right: 15px;
  bottom: 15px;
  display: inline-flex;
  align-items: end;
  gap: 6px;
}

.reward-row i {
  width: 14px;
  height: 14px;
  background: linear-gradient(145deg, #ffd166, var(--accent));
  clip-path: polygon(50% 0, 100% 36%, 81% 100%, 19% 100%, 0 36%);
}

/* Jarvis */
.jarvis-preview {
  background:
    radial-gradient(circle at 24% 52%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 40%),
    linear-gradient(145deg, rgba(5, 22, 35, 0.98), rgba(3, 8, 14, 0.92));
}

.assistant-title,
.geek-title {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 2;
  color: #f3faff;
  font-size: 0.8rem;
  font-weight: 840;
}

.ai-core {
  position: absolute;
  left: 15px;
  top: 47px;
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--accent) 72%, white 10%);
  border-radius: 15px;
  background:
    linear-gradient(90deg, transparent 0 47%, color-mix(in srgb, var(--accent) 62%, transparent) 47% 53%, transparent 53%),
    linear-gradient(180deg, transparent 0 47%, color-mix(in srgb, var(--accent) 62%, transparent) 47% 53%, transparent 53%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(5, 14, 24, 0.92));
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 28%, transparent);
}

.ai-core::before {
  position: absolute;
  inset: 13px;
  content: "";
  border: 1px solid color-mix(in srgb, var(--accent) 74%, white 8%);
  border-radius: 10px;
}

.ai-core::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  content: "";
  background: #f3fbff;
  border-radius: 3px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent);
  transform: translate(-50%, -50%);
}

.conversation {
  position: absolute;
  left: 88px;
  right: 15px;
  top: 40px;
  display: grid;
  gap: 8px;
}

.bubble {
  display: block;
  width: max-content;
  max-width: 100%;
  padding: 5px 9px;
  overflow: hidden;
  color: rgba(241, 250, 255, 0.88);
  font-size: 0.66rem;
  white-space: nowrap;
  background: rgba(235, 248, 255, 0.1);
  border: 1px solid rgba(186, 232, 255, 0.12);
  border-radius: 9px;
}

.bubble.bot {
  justify-self: end;
  color: #06111d;
  background: color-mix(in srgb, var(--accent) 68%, white 12%);
}

.bubble.small {
  max-width: 72%;
}

.summary-list {
  position: absolute;
  left: 88px;
  right: 54px;
  bottom: 17px;
  display: grid;
  gap: 6px;
}

.summary-list i:nth-child(2) { width: 70%; }
.summary-list i:nth-child(3) { width: 52%; }

.signal-panel {
  position: absolute;
  right: 17px;
  bottom: 15px;
  display: inline-flex;
  align-items: end;
  height: 30px;
  gap: 5px;
}

.signal-panel i:nth-child(1) { height: 14px; }
.signal-panel i:nth-child(2) { height: 24px; }
.signal-panel i:nth-child(3) { height: 18px; }
.signal-panel i:nth-child(4) { height: 28px; }

/* SoireeGeek */
.geek-preview {
  background:
    radial-gradient(circle at 18% 42%, rgba(255, 95, 210, 0.18), transparent 38%),
    radial-gradient(circle at 84% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 38%),
    linear-gradient(145deg, rgba(18, 14, 36, 0.98), rgba(4, 8, 18, 0.9));
}

.event-pill {
  position: absolute;
  right: 14px;
  top: 12px;
  padding: 4px 9px;
  color: #f9f3ff;
  font-size: 0.66rem;
  font-weight: 820;
  background: rgba(235, 248, 255, 0.1);
  border: 1px solid rgba(235, 248, 255, 0.12);
  border-radius: 99px;
}

.trophy {
  position: absolute;
  left: 17px;
  top: 50px;
  width: 54px;
  height: 48px;
  border-radius: 9px 9px 14px 14px;
  background: linear-gradient(145deg, #ffe66d, color-mix(in srgb, var(--accent) 66%, #ffae42 16%));
  box-shadow: 0 0 17px color-mix(in srgb, var(--accent) 22%, transparent);
}

.trophy::before,
.trophy::after {
  position: absolute;
  top: 9px;
  width: 13px;
  height: 18px;
  content: "";
  border: 3px solid color-mix(in srgb, var(--accent) 64%, #ffe66d);
}

.trophy::before {
  left: -12px;
  border-right: 0;
  border-radius: 13px 0 0 13px;
}

.trophy::after {
  right: -12px;
  border-left: 0;
  border-radius: 0 13px 13px 0;
}

.bracket {
  position: absolute;
  left: 88px;
  right: 14px;
  top: 42px;
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.bracket b {
  display: block;
  height: 20px;
  border: 1px solid rgba(233, 247, 255, 0.16);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: rgba(6, 18, 30, 0.66);
}

.game-row {
  position: absolute;
  left: 17px;
  bottom: 16px;
  display: inline-flex;
  gap: 7px;
}

.game-row i {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: linear-gradient(145deg, var(--accent), #ff65c8);
}

.join-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 5px 10px;
  color: #06111d;
  font-size: 0.66rem;
  font-weight: 840;
  background: color-mix(in srgb, var(--accent) 76%, #ff65c8 14%);
  border-radius: 99px;
}

@media (max-width: 1180px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(234px, 1fr);
  }

  .service-card {
    min-height: 234px;
  }
}

@media (hover: none), (pointer: coarse) {
  .service-card:hover,
  .service-card:active {
    transform: none;
  }

  .service-card.is-disabled:active {
    transform: none;
  }

  .service-card:active .card-action b {
    background: color-mix(in srgb, var(--accent) 84%, white 12%);
  }

  .service-card.is-disabled:active .card-action b {
    color: rgba(233, 242, 248, 0.86);
    background: rgba(143, 167, 183, 0.22);
    box-shadow: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 60px;
    --footer-height: 56px;
  }

  .portal-header {
    padding: 0 14px;
  }

  .brand {
    gap: 9px;
    font-size: 1.12rem;
  }

  .portal-badge {
    height: 22px;
    padding-inline: 7px;
    font-size: 0.66rem;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-button {
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }

  .header-button img {
    width: 20px;
    height: 20px;
  }

  .header-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .portal-stage {
    padding: 12px 10px 18px;
  }

  .bg-grid {
    opacity: 0.16;
    background-size: 42px 42px;
  }

  .bg-line {
    opacity: 0.3;
  }

  .service-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(224px, auto);
    gap: 12px;
  }

  .service-card {
    min-height: 224px;
    border-radius: 11px;
  }

  .card-visual {
    grid-template-columns: minmax(86px, 25%) minmax(0, 1fr);
  }

  .card-identity::before {
    width: 92px;
    height: 92px;
    border-radius: 20px;
  }

  .card-identity::after {
    inset: 10px;
  }

  .card-identity img {
    width: 56px;
    height: 56px;
  }

  .identity-lines {
    display: none;
  }

  .app-window {
    inset: 9px;
    border-radius: 9px;
  }

  .state-label,
  .card-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .service-name {
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  .poster-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .poster-four,
  .story-card.four,
  .bracket b:nth-child(n+5) {
    display: none;
  }

  .album-stack {
    left: 43px;
    width: 70px;
    height: 78px;
  }

  .music-meta,
  .player-controls {
    left: 126px;
  }

  .file-toolbar b {
    max-width: 58%;
  }

  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .service-card {
    min-height: 214px;
  }

  .card-visual {
    grid-template-columns: minmax(76px, 24%) minmax(0, 1fr);
  }

  .card-footer {
    gap: 9px;
    padding: 0 11px;
  }

  .portal-badge {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .card-action b {
    width: 28px;
    height: 28px;
  }

  .vault-list span,
  .folder-row,
  .file-row,
  .task-board span {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .vault-list em,
  .vault-list strong,
  .folder-row em,
  .file-row em,
  .task-board em,
  .signal-panel,
  .equalizer {
    display: none;
  }

  .now-playing {
    width: 35%;
  }

  .poster-strip,
  .media-progress {
    left: 45%;
  }

  .home-tile b {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-card,
  .app-window {
    transition: none;
  }

  .service-card:hover,
  .service-card:active {
    transform: none;
  }

  .service-card.is-disabled:active {
    transform: none;
  }

  .service-card:hover .app-window,
  .service-card:focus-visible .app-window {
    background-color: transparent;
  }
}
