:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f0f4f8;
  --ink: #17202a;
  --muted: #637083;
  --line: #dde5ee;
  --accent: #0f8b8d;
  --accent-strong: #0a6c70;
  --rose: #d14f6f;
  --amber: #c88221;
  --green: #1e8a55;
  --blue: #2d6cdf;
  --shadow: 0 18px 50px rgba(30, 45, 64, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(209, 79, 111, 0.08), transparent 34%),
    var(--bg);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 28px 18px;
  border-right: 1px solid rgba(221, 229, 238, 0.78);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  background: linear-gradient(135deg, #10242f, var(--accent));
  box-shadow: 0 12px 24px rgba(15, 139, 141, 0.2);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(15, 139, 141, 0.08);
}

.nav-item.is-active {
  color: var(--ink);
  border-color: rgba(15, 139, 141, 0.18);
  background: #e9f6f5;
}

.nav-icon {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.12);
}

.nav-count {
  display: grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(23, 32, 42, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(30, 138, 85, 0.12);
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 40px 36px 56px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  color: #fff;
  background: #17202a;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.primary-link:hover {
  background: #0f8b8d;
}

.launch-icon::before {
  width: 10px;
  aspect-ratio: 1;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.external-icon {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.launch-icon::after {
  position: absolute;
  width: 13px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform: rotate(-45deg);
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 16px;
}

.search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(30, 45, 64, 0.06);
}

.search span {
  position: relative;
  width: 16px;
  aspect-ratio: 1;
  border: 2px solid var(--muted);
  border-radius: 999px;
}

.search span::after {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search input::placeholder {
  color: #8490a0;
}

.view-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 4px;
  min-height: 52px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.toggle-button {
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.toggle-button.is-active {
  color: var(--ink);
  background: var(--panel-soft);
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.summary article {
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.summary strong,
.summary span {
  display: block;
}

.summary strong {
  font-size: 23px;
  line-height: 1;
}

.summary span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.app-groups {
  display: grid;
  gap: 28px;
  margin-top: 24px;
}

.app-group {
  display: grid;
  gap: 14px;
}

.group-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.group-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.group-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.app-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 228px;
  padding: 18px;
  border: 1px solid rgba(221, 229, 238, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 36px rgba(30, 45, 64, 0.08);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.app-card:hover,
.app-card:focus-visible {
  border-color: rgba(15, 139, 141, 0.42);
  box-shadow: 0 22px 46px rgba(30, 45, 64, 0.14);
  outline: 0;
  transform: translateY(-3px);
}

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-logo {
  display: grid;
  width: 48px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--app-color, var(--accent));
  font-weight: 800;
  letter-spacing: 0;
}

.launch-icon {
  position: relative;
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.launch-icon::before {
  display: block;
  content: "";
}

.launch-icon::after {
  top: 16px;
  right: 9px;
}

.app-card:hover .launch-icon,
.app-card:focus-visible .launch-icon {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.app-card h3 {
  margin: 18px 0 8px;
  font-size: 19px;
  letter-spacing: 0;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.app-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app-domain {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-type {
  flex: 0 0 auto;
  color: var(--app-color, var(--accent));
}

.app-groups.is-compact .app-group {
  gap: 10px;
}

.app-groups.is-compact .app-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.app-groups.is-compact .app-card {
  grid-template-columns: 42px minmax(220px, 1fr) minmax(170px, auto);
  grid-template-rows: auto;
  align-items: center;
  column-gap: 18px;
  row-gap: 6px;
  min-height: 82px;
  padding: 14px 16px;
}

.app-groups.is-compact .app-card-top {
  display: contents;
}

.app-groups.is-compact .app-logo {
  width: 42px;
}

.app-groups.is-compact .app-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.app-groups.is-compact .app-card p {
  display: block;
  max-width: 660px;
  font-size: 12px;
  line-height: 1.35;
}

.app-groups.is-compact .app-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 180px;
  margin: 0;
  padding: 0;
  border-top: 0;
  font-size: 11px;
}

.app-groups.is-compact .launch-icon {
  display: none;
}

.empty-state {
  margin-top: 34px;
  padding: 34px;
  border: 1px dashed #bac7d5;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 24px;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 28px 16px 40px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .primary-link {
    width: max-content;
  }
}

@media (max-width: 620px) {
  .nav {
    grid-template-columns: 1fr;
  }

  .controls,
  .summary {
    grid-template-columns: 1fr;
  }

  .view-toggle {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-groups.is-compact .app-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .app-groups.is-compact .app-meta {
    grid-column: 2;
    justify-items: start;
    min-width: 0;
    margin-top: 2px;
  }
}
