:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #5b6472;
  --line: #e3e7ee;
  --accent: #2f6df6;
  --accent-ink: #ffffff;
  --green: #1f8a4c;
  --green-bg: #e5f5ec;
  --red: #c0392b;
  --red-bg: #fbeae7;
  --amber: #9a6b00;
  --amber-bg: #fff4d6;
  --blue-bg: #e8efff;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

/* 상태(오류/안내) 영역 */
#app-status {
  min-height: 1px;
  margin-bottom: 16px;
}
#app-status:empty { display: none; }
#app-status .status {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--red-bg);
  color: var(--red);
  font-weight: 500;
}
#app-status .status.ok {
  background: var(--blue-bg);
  color: #1d3f8f;
}

/* 컨트롤 */
.controls-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.ctl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.ctl select {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 140px;
}

button {
  font: inherit;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
button:hover { border-color: #c9d2e0; }
button.primary, #apply-button {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
button.primary:hover, #apply-button:hover { opacity: 0.92; border-color: var(--accent); }
#example-button { margin-top: 8px; }

/* 요약 + 메타 */
#summary {
  margin-bottom: 8px;
}
#summary .summary-main {
  font-size: 18px;
  font-weight: 700;
}
#summary .summary-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* TOP3 요약 카드 */
#top-card:empty { display: none; }
#top-card { margin: 8px 0; }
#top-card .top-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
#top-card .top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#top-card .top-item {
  flex: 1 1 160px;
  min-width: 0;
  background: #f6f8fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
}
#top-card .top-id {
  display: block;
  font-weight: 700;
  font-size: 14px;
  word-break: break-all;
}
#top-card .top-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 13px;
}
.meta-line:empty { display: none; }

.fit-note {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: #eef2fb;
  border: 1px solid #d9e2f5;
  border-radius: 12px;
  color: #3d4b66;
  font-size: 13.5px;
}

/* 모델 목록 */
.model-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.model-list:empty::after {
  content: "표시할 모델이 없습니다.";
  display: block;
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

li.model {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
li.model.disabled {
  opacity: 0.55;
  cursor: pointer;
}
/* '파라미터 미상' 행은 RAM 부족 행보다 밝게 (CHANGES #1) */
li.model.no-params {
  opacity: 0.75;
}
li.model:not(.disabled) { cursor: default; }

.model .head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.model .mid {
  font-weight: 700;
  font-size: 16px;
  word-break: break-all;
}
a.mid {
  color: var(--accent);
  text-decoration: none;
}
a.mid:hover { text-decoration: underline; }
.model .sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.new { background: var(--blue-bg); color: #1d3f8f; }
.badge.quant { background: #eef0f4; color: var(--ink); }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.no { background: var(--red-bg); color: var(--red); }
.badge.dim { background: var(--amber-bg); color: var(--amber); }
.badge.vram { background: #ece7f8; color: #5b4593; }
.badge.vram.off { background: #f0ece7; color: #6b5b45; }
#top-card a.top-id {
  color: var(--accent);
  text-decoration: none;
}
#top-card a.top-id:hover { text-decoration: underline; }

.detail {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f6f8fc;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
}

/* 모바일 */
@media (max-width: 560px) {
  .page { padding: 16px 12px 48px; }
  .card { padding: 16px; }
  .controls-card { flex-direction: column; align-items: stretch; }
  .ctl select { width: 100%; min-width: 0; }
  button { width: 100%; }
}
