/* 메인(/)·검색(/search) 공고 검색 화면 */
.sx-page {
  --sx-primary: #1d4ed8;
  --sx-primary-2: #2563eb;
  --sx-navy: #0f1f3d;
  --sx-ink: #0f172a;
  --sx-body: #334155;
  --sx-muted: #64748b;
  --sx-line: #e2e8f0;
  --sx-soft: #f1f5f9;
  --sx-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}
.sx-wrap { max-width: 1040px; }

/* ── 검색 히어로 ───────────────────────────────────────── */
.sx-hero { background: var(--sx-navy); padding: 2.6rem 0 1.4rem; }
.sx-hero .container { display: block; }
.sx-h1 { color: #fff; font-size: clamp(1.55rem, 3.4vw, 2.2rem); font-weight: 800; line-height: 1.25; letter-spacing: -.04em; }
.sx-lead { margin-top: .45rem; color: #cbd5e1; font-size: .95rem; letter-spacing: -.01em; }
.sx-lead strong { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }

.sx-form { margin-top: 1.2rem; }
.sx-box {
  position: relative;
  display: flex;
  align-items: center;
  padding: .35rem .35rem .35rem 3rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(2, 8, 23, .28);
}
.sx-box:focus-within { box-shadow: 0 0 0 3px rgba(147, 197, 253, .7), 0 10px 30px rgba(2, 8, 23, .28); }
.sx-ico { position: absolute; left: 1.1rem; width: 20px; height: 20px; fill: none; stroke: var(--sx-muted); stroke-width: 2.2; stroke-linecap: round; }
.sx-box input {
  flex: 1;
  min-width: 0;
  padding: .78rem .25rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--sx-ink);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 500;
}
.sx-box input::placeholder { color: #94a3b8; font-weight: 400; }
.sx-box input::-webkit-search-cancel-button { display: none; }
.sx-clear {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-right: .5rem;
  border: 0;
  border-radius: 50%;
  background: var(--sx-soft);
  color: var(--sx-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.sx-clear:hover { background: var(--sx-line); color: var(--sx-ink); }
.sx-clear[hidden] { display: none; }
.sx-submit {
  flex-shrink: 0;
  padding: .74rem 1.5rem;
  border: 0;
  border-radius: 10px;
  background: var(--sx-primary-2);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.sx-submit:hover { background: var(--sx-primary); }
.sx-progress { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; overflow: hidden; opacity: 0; transition: opacity .15s; }
.sx-progress::after { content: ''; position: absolute; top: 0; bottom: 0; width: 30%; background: #3b82f6; animation: sx-bar 1s ease-in-out infinite; }
.sx-form.is-loading .sx-progress { opacity: 1; }
@keyframes sx-bar { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.sx-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: 1rem; }
.sx-chip { position: relative; }
.sx-chip input { position: absolute; opacity: 0; pointer-events: none; }
.sx-chip span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .36rem .7rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #e2e8f0;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.sx-chip span b { color: #94a3b8; font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sx-chip:hover span { border-color: rgba(255, 255, 255, .45); }
.sx-chip input:checked + span { border-color: #fff; background: #fff; color: var(--sx-navy); }
.sx-chip input:checked + span b { color: var(--sx-primary-2); }
.sx-chip input:focus-visible + span { outline: 2px solid #93c5fd; outline-offset: 2px; }
.sx-chip-news span { color: #cbd5e1; font-weight: 500; }
.sx-chip-sep { width: 1px; height: 1.3rem; margin: 0 .15rem; background: rgba(255, 255, 255, .2); }

/* ── 결과 ─────────────────────────────────────────────── */
.sx-main { padding: 1.3rem 0 2.5rem; background: #f8fafc; }
.sx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  margin-bottom: .8rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--sx-line);
}
.sx-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; min-width: 0; color: var(--sx-ink); font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em; }
#sx-label { overflow-wrap: anywhere; }
.sx-total { color: var(--sx-muted); font-size: .9rem; font-weight: 500; }
.sx-total b { color: var(--sx-primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.sx-controls { display: flex; align-items: center; gap: .5rem; }
.sx-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #e8edf4; }
.sx-seg label { position: relative; }
.sx-seg input { position: absolute; opacity: 0; pointer-events: none; }
.sx-seg span { display: block; padding: .3rem .78rem; border-radius: 8px; color: #475569; font-size: .84rem; font-weight: 600; cursor: pointer; }
.sx-seg input:checked + span { background: #fff; color: var(--sx-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .14); }
.sx-seg input:focus-visible + span { outline: 2px solid #93c5fd; }
.sx-sort {
  padding: .4rem .55rem;
  border: 1px solid var(--sx-line);
  border-radius: 9px;
  background: #fff;
  color: var(--sx-body);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}

.sx-list { display: flex; flex-direction: column; gap: .5rem; transition: opacity .12s; }
.sx-list.is-stale { opacity: .5; }
.sx-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: .95rem 1.15rem;
  border: 1px solid var(--sx-line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.sx-item:hover { border-color: #93b4f6; box-shadow: var(--sx-shadow); }
.sx-item-main { flex: 1; min-width: 0; }
.sx-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin-bottom: .28rem; color: var(--sx-muted); font-size: .76rem; }
.sx-cat { padding: .08rem .45rem; border-radius: 5px; background: var(--sx-soft); color: #475569; font-weight: 700; }
.sx-cat-g2b { background: #e0f2fe; color: #075985; }
.sx-cat-support { background: #dcfce7; color: #166534; }
.sx-cat-kstartup { background: #fce7f3; color: #9d174d; }
.sx-cat-finance { background: #fef3c7; color: #92400e; }
.sx-no { color: #64748b; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; }
.sx-src { max-width: 30em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-region { color: var(--sx-body); white-space: nowrap; }
.sx-region::before { content: '·'; margin-right: .5rem; color: #cbd5e1; }
.sx-title { color: var(--sx-ink); font-size: 1rem; font-weight: 700; line-height: 1.45; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sx-item:hover .sx-title { color: var(--sx-primary); }
.sx-snip {
  display: -webkit-box;
  margin-top: .25rem;
  overflow: hidden;
  color: var(--sx-muted);
  font-size: .84rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sx-page mark { padding: 0 1px; border-radius: 2px; background: #fef08a; color: inherit; }
.sx-item-side { display: flex; flex-direction: column; flex-shrink: 0; align-items: flex-end; gap: .18rem; min-width: 96px; text-align: right; }
.sx-dday { padding: .1rem .5rem; border-radius: 6px; font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sx-dday-today, .sx-dday-soon { background: #fee2e2; color: #b91c1c; }
.sx-dday-week { background: #ffedd5; color: #c2410c; }
.sx-dday-later { background: #eff6ff; color: var(--sx-primary); }
.sx-dday-closed { background: var(--sx-soft); color: var(--sx-muted); }
.sx-meta { color: var(--sx-muted); font-size: .78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sx-budget { color: var(--sx-ink); font-weight: 600; }
.sx-list > .ad-slot { margin: .25rem 0; }

.sx-empty { padding: 2rem 1.5rem; border: 1px dashed #cbd5e1; border-radius: 12px; background: #fff; color: #475569; text-align: center; }
.sx-empty-title { color: var(--sx-ink); font-size: 1.02rem; font-weight: 700; }
.sx-empty-tips { display: grid; gap: .35rem; margin-top: .75rem; font-size: .88rem; list-style: none; }
.sx-link { border: 0; background: none; color: var(--sx-primary); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

.sx-more-wrap { display: flex; justify-content: center; margin-top: 1.1rem; }
.sx-more {
  display: inline-flex;
  padding: .7rem 2.4rem;
  border: 1px solid var(--sx-line);
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  font-size: .92rem;
  font-weight: 700;
}
.sx-more:hover { border-color: var(--sx-primary); color: var(--sx-primary); }
.sx-more[hidden] { display: none; }
.sx-more.is-loading { opacity: .6; pointer-events: none; }

/* ── 조건별 빠른 탐색 ─────────────────────────────────── */
.home-find { padding: 2rem 0 2.5rem; border-top: 1px solid var(--sx-line); background: #fff; }
.home-find-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.home-find-head span { display: block; color: var(--sx-primary); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.home-find-head h2 { margin-top: .25rem; color: var(--sx-ink); font-size: 1.2rem; letter-spacing: -.035em; }
.home-find-head > a { color: var(--sx-primary); font-size: .82rem; font-weight: 700; }
.home-find-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.home-find-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: .7rem;
  padding: .8rem 1rem;
  border: 1px solid var(--sx-line);
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.home-find-card:hover { border-color: #93b4f6; box-shadow: var(--sx-shadow); }
.home-find-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--sx-soft); }
.home-find-card strong { display: block; color: var(--sx-ink); font-size: .84rem; }
.home-find-card small { display: block; margin-top: .12rem; color: var(--sx-muted); font-size: .68rem; }
.home-find-card i { color: var(--sx-primary); font-style: normal; }

@media (max-width: 768px) {
  .home-find-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .sx-hero { padding: 1.5rem 0 1rem; }
  .sx-lead { font-size: .84rem; }
  .sx-form { margin-top: 1rem; }
  .sx-box { padding-left: 2.55rem; border-radius: 12px; }
  .sx-ico { left: .85rem; width: 18px; height: 18px; }
  .sx-box input { padding: .7rem .2rem; }
  .sx-submit { padding: .68rem 1rem; }
  .sx-chips { flex-wrap: nowrap; margin-right: -.85rem; padding-right: .85rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .sx-chips::-webkit-scrollbar { display: none; }
  .sx-main { padding-top: 1rem; }
  .sx-bar { flex-direction: column; align-items: stretch; }
  .sx-controls { justify-content: space-between; }
  .sx-item { flex-direction: column; gap: .45rem; padding: .85rem .9rem; }
  .sx-item-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; min-width: 0; text-align: left; }
  .sx-src { max-width: 100%; }
  .home-find-head { flex-direction: column; align-items: start; }
  .home-find-grid { grid-template-columns: 1fr; }
}
