/* 청약 경쟁률 조회 화면 스타일 — RSAT 다크 테마(배경 #0E0C09, 포인트 #FFBC00) */
:root {
  --bg: #0E0C09;
  --surface: #17140F;
  --surface-2: #1F1B14;
  --border: rgba(255, 255, 255, 0.12);
  --text: #D8D4CC;
  --muted: #8A857C;
  --accent: #FFBC00;
  --danger: #FF5A4D;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); }

header.app-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
header.app-header h1 {
  margin: 0;
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
}
header.app-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.error-banner {
  margin: 12px 20px;
  padding: 12px 14px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: rgba(255, 90, 77, 0.1);
  color: var(--danger);
  font-size: 14px;
}
.error-banner[hidden] { display: none; }

main {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  padding: 16px 20px;
  align-items: start;
}
@media (max-width: 820px) {
  main { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* 목록 */
#search {
  width: 100%;
  padding: 9px 11px;
  margin-bottom: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
#search::placeholder { color: var(--muted); }

#region {
  width: 100%;
  padding: 9px 11px;
  margin-bottom: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
#region option { background: var(--surface-2); color: var(--text); }

#complex-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 70vh;
  overflow-y: auto;
}
#complex-list li {
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
#complex-list li:hover { background: var(--surface-2); }
#complex-list li.selected {
  border-color: var(--accent);
  background: var(--surface-2);
}
#complex-list .nm { font-weight: 600; color: var(--text); }
#complex-list .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
#complex-list .meta .area { color: var(--accent); }

/* 상세 */
.detail-header h2 { margin: 0; font-size: 18px; color: var(--text); }
.detail-header .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.detail-header .sub .area { color: var(--accent); }

.section-title {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* 표 (모바일 가로 스크롤) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 13px;
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}
th.col-name, td.col-name { text-align: left; }
th.highlight { color: var(--accent); }

/* "신혼·신생아만 보기" 토글 시 나머지 6개 유형 열 숨김 */
.table-wrap.focus-only .type-other { display: none; }

td.dim { opacity: 0.38; }
td.fail { color: var(--muted); }
.cell-rate { font-weight: 600; color: var(--text); }
.cell-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.cell-prepar { display: block; font-size: 11px; color: var(--accent); margin-top: 2px; }

.toggle-btn {
  margin-top: 18px;
  padding: 9px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}
.toggle-btn:hover { border-color: var(--accent); }
.toggle-btn.btn-inline { margin-top: 0; margin-bottom: 10px; padding: 6px 12px; font-size: 13px; }
.toggle-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.empty-msg { color: var(--muted); padding: 14px 4px; font-size: 14px; }
.placeholder { color: var(--muted); padding: 30px 4px; text-align: center; }
[hidden] { display: none; }
