/* 종목탐구 전용 스타일 -- briefing.css/report.css와 같은 독립 페이지
   패턴/색상 토큰을 그대로 따른다. */

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  color: #14181f;
  background: #f2f3f5;
  min-height: 100vh;
}

.ce-toolbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #d5d9e0;
  z-index: 10;
}
.ce-toolbar-title { font-size: 15px; font-weight: 700; }

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #d5d9e0;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  color: #14181f;
}
.btn-primary { background: #14181f; color: #fff; border-color: #14181f; }
.btn-block { display: block; width: 100%; margin-top: 10px; }

.btn-big-primary {
  display: block;
  width: 100%;
  padding: 22px 16px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 16px;
  border: none;
  background: #14181f;
  color: #fff;
  cursor: pointer;
  margin-top: 16px;
}
.btn-big-primary:active { background: #2a3140; }
.btn-big-primary:disabled { background: #838b99; cursor: default; }

#ce-root { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }

section[hidden] { display: none; }

/* ---- 1. 검색 화면 ---- */
.ce-search-row { display: flex; gap: 8px; }
#search-input {
  flex: 1;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #d5d9e0;
}

.ce-hint { text-align: center; color: #4d5561; padding: 16px 0; font-size: 14px; }
.ce-notice {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff8e6;
  border: 1px solid #e3d19a;
  border-radius: 8px;
  font-size: 13px;
  color: #7a5c00;
}

.ce-result-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ce-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: #fff;
  border: 1px solid #d5d9e0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}
.ce-result-item:active { background: #f2f3f5; }
.ce-result-main { display: flex; flex-direction: column; gap: 2px; }
.ce-result-name { font-size: 15px; font-weight: 600; }
.ce-result-sub { font-size: 12px; color: #838b99; }
.ce-result-country {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0f4f0;
  color: #0e8a73;
}

.ce-section-title { font-size: 14px; font-weight: 700; margin: 20px 0 4px; color: #4d5561; }

/* ---- 2. 기업 확인 화면 ---- */
.ce-confirm-card {
  background: #fff;
  border: 1px solid #d5d9e0;
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
}
.ce-confirm-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.ce-confirm-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: #4d5561; }
.ce-confirm-row strong { color: #14181f; }

/* ---- 3. 진행 상태 ---- */
.ce-progress-status { text-align: center; color: #4d5561; padding: 40px 0; font-size: 15px; }

/* ---- 4. 결과 화면 ---- */
.ce-glance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.ce-glance-item {
  background: #fff;
  border: 1px solid #d5d9e0;
  border-radius: 10px;
  padding: 12px;
}
.ce-glance-label { font-size: 12px; color: #838b99; margin-bottom: 4px; }
.ce-glance-value { font-size: 14px; font-weight: 700; }

.ce-verdict-IMPROVING { color: #0e8a73; }
.ce-verdict-STABLE { color: #4d5561; }
.ce-verdict-DETERIORATING { color: #c0392b; }
.ce-verdict-CAUTION { color: #a06a0a; }
.ce-verdict-INSUFFICIENT_DATA { color: #a3a9b3; }

.ce-warnings {
  margin-top: 12px;
  background: #fff4f2;
  border: 1px solid #e8b7ac;
  border-radius: 10px;
  padding: 12px 14px;
}
.ce-warnings-title { font-size: 13px; font-weight: 700; color: #c0392b; margin-bottom: 6px; }
.ce-warning-item { font-size: 13px; color: #5c2b22; margin: 4px 0; line-height: 1.5; }

.ce-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #838b99;
  margin: 16px 0 8px;
}
.ce-provider-badge {
  background: #e0f4f0;
  color: #0e8a73;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.ce-result-text {
  background: #ffffff;
  border: 1px solid #d5d9e0;
  border-radius: 12px;
  padding: 18px;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
}

@media (prefers-color-scheme: dark) {
  body { background: #14181f; color: #e7eaef; }
  .ce-toolbar, .ce-result-text, .ce-confirm-card, .ce-result-item, .ce-glance-item { background: #1c2028; border-color: #2f3542; }
  .btn { background: #1c2028; color: #e7eaef; border-color: #2f3542; }
  #search-input { background: #1c2028; color: #e7eaef; border-color: #2f3542; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #14181f; }
  #ce-root { max-width: none; padding: 0; }
  .ce-result-text, .ce-glance-item { border: none; box-shadow: none; }
  #btn-reanalyze, #btn-back-to-search { display: none; }
}
