.lobby-shell {
  width: min(var(--max-width), calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lobby-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.header-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.header-link:hover {
  color: var(--text);
  border-color: var(--accent);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.search-box {
  display: grid;
  gap: 5px;
}

.search-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface-2);
  color: var(--text);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.category-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.category-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-weak);
  color: var(--accent);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 2px 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease;
}

.tool-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.tool-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
}

.tool-card__category,
.tool-card__status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.tool-card__status {
  color: var(--ok);
}

.tool-card__title {
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.tool-card__description {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.empty-state,
.error-state {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--muted);
  text-align: center;
}

.error-state {
  color: var(--danger);
}

@media (max-width: 720px) {
  .lobby-shell {
    width: min(100% - 20px, var(--max-width));
    padding-top: 14px;
  }

  .lobby-header {
    align-items: center;
  }

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

  .category-filter {
    justify-content: flex-start;
  }

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

  .tool-card {
    min-height: 0;
  }
}
