:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --surface: #fffdfa;
  --surface-strong: #ffffff;
  --ink: #252422;
  --muted: #6f6a60;
  --line: #ded8cc;
  --accent: #2e7d6b;
  --accent-soft: #dff1ec;
  --rose: #b94d67;
  --yellow: #c78319;
  --blue: #3f6da8;
  --violet: #7659a8;
  --shadow: 0 10px 24px rgba(48, 42, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(220px, 430px);
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(245, 243, 238, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 1px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.1;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 38px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 107, 0.16);
}

.search button {
  position: absolute;
  right: 6px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.search button:hover {
  background: #f0ebe1;
  color: var(--ink);
}

.workspace {
  padding: 10px 14px 18px;
}

.summary {
  display: flex;
  min-height: 24px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

#resultCount {
  font-weight: 700;
}

.board {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  align-items: start;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #bfb6a8 transparent;
}

.board::-webkit-scrollbar {
  height: 10px;
}

.board::-webkit-scrollbar-track {
  background: transparent;
}

.board::-webkit-scrollbar-thumb {
  background: #bfb6a8;
  border: 3px solid var(--bg);
  border-radius: 999px;
}

.column {
  flex: 0 0 235px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.8);
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.column-header {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 9px 7px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.column-header h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  line-height: 1.15;
}

.badge {
  flex: 0 0 auto;
  min-width: 28px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

.cards {
  display: grid;
  gap: 6px;
  padding: 7px;
}

.tool-card {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 8px;
  border: 1px solid #ebe5da;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: var(--surface-strong);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(46, 125, 107, 0.55);
  box-shadow: 0 8px 16px rgba(48, 42, 35, 0.11);
  outline: none;
}

.tool-card__top {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  justify-content: space-between;
}

.tool-card strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  line-height: 1.1;
}

.tag {
  flex: 0 0 auto;
  max-width: 44%;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 999px;
  background: #f1eee7;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-card__description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.column:nth-child(2n) .tool-card {
  border-left-color: var(--blue);
}

.column:nth-child(2n) .badge {
  background: #e4ecf8;
  color: var(--blue);
}

.column:nth-child(3n) .tool-card {
  border-left-color: var(--rose);
}

.column:nth-child(3n) .badge {
  background: #f7e4e9;
  color: var(--rose);
}

.column:nth-child(4n) .tool-card {
  border-left-color: var(--yellow);
}

.column:nth-child(4n) .badge {
  background: #f8ebd3;
  color: var(--yellow);
}

.empty-state {
  width: 100%;
  padding: 28px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.66);
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

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

@media (max-width: 1050px) {
  .column {
    flex-basis: 220px;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: 1fr;
    padding: 9px 10px;
  }

  .workspace {
    padding: 8px 10px 14px;
  }

  .column {
    flex: 0 0 min(82vw, 300px);
  }
}
