/* 2027 수능 성적표 입력 (실채점 표본 제보) 정식 탭 스타일 (#sample 스코프 격리) */
#sample.sample-view {
  max-width: 780px;
}

#sample .sp-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#sample .sp-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
#sample .sp-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  padding: 3px 10px;
  border-radius: 999px;
}
#sample .sp-privacy-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--pos);
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  padding: 3px 10px;
  border-radius: 999px;
}
#sample .sp-lead {
  margin: 0;
  font-size: 14.5px;
  color: var(--grey);
  line-height: 1.6;
}

/* 표본 급구 과목 강조 + 공유 배너 */
#sample .sp-urgent-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.09) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 1px solid var(--pos-border);
}
#sample .sp-urgent-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#sample .sp-urgent-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
#sample .sp-urgent-pill {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: #e11d48;
  padding: 2px 7px;
  border-radius: 999px;
}
#sample .sp-urgent-desc {
  margin: 0;
  font-size: 13px;
  color: var(--grey);
  line-height: 1.45;
}
#sample .sp-urgent-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#sample .sp-share-btn {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
#sample .sp-share-btn.is-primary {
  background: var(--pos);
  border-color: transparent;
  color: #ffffff;
}
#sample .sp-share-btn:hover { filter: brightness(0.95); }

/* 공통 카드 */
#sample .sp-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#sample .sp-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
#sample .sp-card-head h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
#sample .sp-sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--faint);
}
#sample .sp-ghost-btn {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
}
#sample .sp-ghost-btn:hover { filter: brightness(0.96); }

/* 누적 KPI & 진행률 */
#sample .sp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#sample .sp-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#sample .sp-kpi.is-accent { background: var(--blue-bg); border-color: var(--blue-border); }
#sample .sp-kpi.is-purple { background: var(--ai-bg); border-color: var(--ai-border); }
#sample .sp-kpi-label { font-size: 12px; font-weight: 600; color: var(--grey); }
#sample .sp-kpi-val { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
#sample .sp-kpi-note { font-size: 11.5px; color: var(--faint); }

#sample .sp-progress-title { font-size: 13px; font-weight: 700; color: var(--grey); margin-bottom: 8px; }
#sample .sp-bars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 8px;
}
#sample .sp-bars-compact {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
}
#sample .sp-bar-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#sample .sp-bar-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
#sample .sp-need-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  padding: 1px 5px;
  border-radius: 4px;
}
#sample .sp-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
#sample .sp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.35s ease;
}
#sample .sp-bar-fill.is-done { background: var(--pos); }
#sample .sp-bar-nums { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

#sample .sp-inq-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey);
  user-select: none;
}

#sample .sp-inline-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 8px 11px;
}

/* 폼 */
#sample .sp-form { display: flex; flex-direction: column; gap: 16px; }
#sample .sp-seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#sample .sp-seg-opt { position: relative; cursor: pointer; }
#sample .sp-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
#sample .sp-seg-opt span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  transition: border-color 0.15s ease, background 0.15s ease;
}
#sample .sp-seg-opt strong { font-size: 14px; color: var(--ink); }
#sample .sp-seg-opt small { font-size: 12px; color: var(--faint); }
#sample .sp-seg-opt input:checked + span {
  border-color: var(--blue);
  background: var(--blue-bg);
}

#sample .sp-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
#sample .sp-chip { position: relative; cursor: pointer; }
#sample .sp-chip input { position: absolute; opacity: 0; pointer-events: none; }
#sample .sp-chip span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--grey);
}
#sample .sp-chip input:checked + span {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}
#sample .sp-chip.is-clear input:checked + span {
  border-color: var(--line-strong);
  background: var(--line-strong);
  color: var(--ink);
}

#sample .sp-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--grey);
  cursor: pointer;
  white-space: nowrap;
}

#sample .sp-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#sample .sp-field-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#sample .sp-field-grid-5 { grid-template-columns: 1.8fr repeat(4, minmax(0, 1fr)); }

#sample .sp-field { display: flex; flex-direction: column; gap: 5px; }
#sample .sp-field span { font-size: 12.5px; font-weight: 600; color: var(--grey); }
#sample .sp-field small { font-weight: 400; color: var(--faint); }
#sample .sp-field input,
#sample .sp-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
#sample .sp-field input[readonly] { background: var(--panel); color: var(--grey); }
#sample .sp-field.is-official input { border-color: var(--blue-border); background: var(--blue-bg); }
#sample .sp-field input:focus,
#sample .sp-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

#sample .sp-inq-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#sample .sp-inq-title { font-size: 13px; font-weight: 700; color: var(--grey); }

#sample .sp-sanity {
  margin: 0;
  font-size: 12.5px;
  padding: 8px 11px;
  border-radius: 8px;
}
#sample .sp-sanity.is-warn { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-border); }
#sample .sp-sanity.is-ok { color: var(--pos); background: var(--pos-bg); border: 1px solid var(--pos-border); }

#sample .sp-submit-wrap { display: flex; flex-direction: column; gap: 10px; }
#sample .sp-submit-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--blue-solid);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
#sample .sp-submit-btn:hover { background: var(--blue-solid-hover); }
#sample .sp-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
#sample .sp-status {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
#sample .sp-status.is-ok { color: var(--pos); background: var(--pos-bg); border: 1px solid var(--pos-border); }
#sample .sp-status.is-err { color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger-border); }
#sample .sp-footnote { margin: 0; font-size: 12.5px; color: var(--faint); line-height: 1.55; }

/* 제출 직후 결과 비교 & AI 라인 연동 카드 */
#sample .sp-result-card {
  border-color: var(--pos-border);
  background: linear-gradient(180deg, var(--pos-bg) 0%, var(--paper) 88px);
}
#sample .sp-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
#sample .sp-compare-table th,
#sample .sp-compare-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
#sample .sp-compare-table th:first-child,
#sample .sp-compare-table td:first-child { text-align: left; font-weight: 700; }
#sample .sp-compare-table th { font-size: 12px; color: var(--faint); font-weight: 600; }
#sample .sp-diff-pos { color: var(--pos); font-weight: 700; }
#sample .sp-diff-neg { color: var(--danger); font-weight: 700; }
#sample .sp-diff-zero { color: var(--blue); font-weight: 700; }

#sample .sp-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#sample .sp-line-btn {
  flex: 1 1 220px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--blue-solid);
  color: #ffffff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}
#sample .sp-line-btn:hover { background: var(--blue-solid-hover); }
#sample .sp-result-share-btn {
  height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#sample.is-hidden-phase [data-official-block] { display: none !important; }

@media (max-width: 680px) {
  #sample .sp-urgent-card { flex-direction: column; align-items: stretch; }
  #sample .sp-urgent-actions { justify-content: flex-end; }
  #sample .sp-kpi-grid { grid-template-columns: 1fr; }
  #sample .sp-seg { grid-template-columns: 1fr; }
  #sample .sp-field-grid,
  #sample .sp-field-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #sample .sp-field-wide { grid-column: 1 / -1; }
}
