/* 카드 위: 정렬 탭·검색·태그·신규/TOP 안내 줄 */

/* 정렬 + 검색 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -24px 0 24px;
}

.sort {
  display: flex;
  gap: 6px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 340px;
  min-width: 0;
}

.search svg {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 9px 76px 9px 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.search kbd, .search-count {
  position: absolute;
  right: 12px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.search kbd { padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; }
.search:focus-within kbd, .search-count:not(:empty) ~ kbd, .search:has(.search-count:not(:empty)) kbd { display: none; }

.search-empty {
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}

.search-empty[hidden] { display: none; }
.search-empty p { margin: 0 0 6px; }
.search-empty-title { font-size: 17px; font-weight: 700; color: var(--text); }
.search-empty .submit-open { margin-top: 14px; }

@media (max-width: 640px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { flex-basis: auto; }
  .search kbd { display: none; }
}

.sort a {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

.sort a:hover { color: var(--text); }

.sort a.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.health::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.health-fast { color: #2f9e5b; }
.health-ok   { color: #c99a1c; }
.health-slow { color: #d0662c; }
.health-down { color: #b9473b; }

.search-empty:not([hidden]) ~ .submit-cta { display: none; }

/* ── 태그로 거르기 (랜덤) ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -12px 0 24px;
}
.tags a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.tags a span { font-size: 11px; font-weight: 600; opacity: .7; }
.tags a:hover { color: var(--text); }
.tags a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tags a.on span { opacity: .85; }
@media (max-width: 640px) {
  .tags { margin: -4px 0 16px; gap: 5px; }
  .tags a { padding: 3px 9px; font-size: 12px; }
}

.tags[hidden] { display: none; }

/* 신규 탭 안내 줄 */
.new-note { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.new-note[hidden] { display: none; }
