:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #6f6f6f;
  --line: #cfcfcf;
  --line-strong: #111111;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    linear-gradient(90deg, #ececec 1px, transparent 1px),
    linear-gradient(180deg, #ececec 1px, transparent 1px),
    var(--bg);
  background-size: 16px 16px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ink);
  color: var(--panel);
}

button,
input,
select {
  border-radius: 0;
  color: inherit;
  font: inherit;
}

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

.masthead {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}

.eyebrow,
.state,
.field span,
.copy {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: lowercase;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  line-height: 1;
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px 96px;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.field {
  display: grid;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.field span {
  display: block;
  padding: 7px 10px 0;
  color: var(--muted);
}

.search input,
.search select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  padding: 0 10px 7px;
}

.search input::placeholder {
  color: #9a9a9a;
}

.search select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%) right 13px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 50%) right 9px center / 6px 6px no-repeat;
  cursor: pointer;
  padding-right: 26px;
}

.field:focus-within {
  border-color: var(--line-strong);
}

.search button,
.copy {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  cursor: pointer;
}

.search button {
  height: 100%;
  min-height: 58px;
  font-weight: 700;
}

.search button:hover,
.search button:focus-visible,
.copy:hover,
.copy:focus-visible {
  background: var(--ink);
  color: var(--panel);
  outline: none;
}

.results {
  min-height: 220px;
}

.state {
  margin: 0 0 12px;
  color: var(--muted);
}

.state::before {
  content: "> ";
  color: var(--ink);
}

.result-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.app {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 156px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.app:hover {
  border-color: var(--line-strong);
}

.app img {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: #eeeeee;
}

.app-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.meta-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.meta-row::before {
  content: attr(data-label);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.app-name {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.bundle-id {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.bundle-row {
  align-items: start;
}

.copy {
  width: max-content;
  height: 28px;
  padding: 0 8px;
  color: var(--ink);
}

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

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

  .search button {
    min-height: 44px;
  }

  .result-list {
    grid-template-columns: 1fr;
  }
}
