:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #5a665f;
  --subtle: #dbe4dd;
  --surface: #ffffff;
  --surface-strong: #f5f8f3;
  --accent: #13795b;
  --accent-strong: #0a5f49;
  --amber: #e0a323;
  --rose: #c75146;
  --blue: #3975bf;
  --shadow: 0 18px 50px rgba(32, 45, 37, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(19, 121, 91, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(224, 163, 35, 0.14), transparent 28%),
    #f8faf6;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--subtle);
}

.intro-copy {
  max-width: 720px;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(3rem, 9vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.intro-copy p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.status-panel {
  min-width: 190px;
  padding: 20px;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.status-panel__number {
  display: block;
  color: var(--accent-strong);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
}

.status-panel__label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 28px 0 22px;
}

.search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  width: min(420px, 100%);
  min-height: 48px;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(32, 45, 37, 0.06);
}

.search svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

.search:focus-within {
  border-color: rgba(19, 121, 91, 0.64);
  box-shadow: 0 0 0 4px rgba(19, 121, 91, 0.12);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(32, 45, 37, 0.08);
}

.app-media {
  position: relative;
  display: flex;
  min-height: 88px;
  flex: 0 0 30%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  padding: 12px;
  background:
    linear-gradient(135deg, var(--icon-bg, #e3f4ec), rgba(255, 255, 255, 0.64)),
    #edf4ee;
}

.app-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-preview:not([hidden]) + .app-icon,
.app-preview:not([hidden]) ~ .app-status {
  box-shadow: 0 10px 28px rgba(23, 33, 29, 0.18);
}

.app-preview:not([hidden]) {
  opacity: 0.92;
}

.app-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--icon-bg, #e3f4ec);
  color: var(--icon-fg, var(--accent-strong));
  font-size: 1rem;
  font-weight: 800;
}

.app-favicon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.app-favicon:not([hidden]) + .app-initials {
  display: none;
}

.app-status {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(19, 121, 91, 0.22);
  border-radius: 999px;
  background: #edf8f2;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.app-card__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px 16px 8px;
}

.app-source {
  margin-bottom: 6px;
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-card h2 {
  display: -webkit-box;
  margin-bottom: 6px;
  overflow: hidden;
  font-size: 1.12rem;
  line-height: 1.15;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-card__body p:last-child {
  display: -webkit-box;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.app-tags {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 25px;
  margin: 0 16px 10px;
  overflow: hidden;
}

.app-tags span {
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: #35423b;
  font-size: 0.66rem;
  font-weight: 700;
}

.app-link {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 16px 14px;
  padding: 0 12px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.app-link:hover,
.app-link:focus-visible {
  background: var(--accent-strong);
}

.app-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.empty-state {
  margin: 32px 0 0;
  color: var(--muted);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 34px 0;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
  }

  .status-panel {
    width: 100%;
    min-width: 0;
  }

  .toolbar {
    justify-content: stretch;
  }

  .search {
    width: 100%;
  }

  .app-card {
    aspect-ratio: auto;
    min-height: 276px;
  }

  .app-card__body p:last-child {
    -webkit-line-clamp: 2;
  }
}
