/* AI 노출 진단 페이지 — 9LA6 디자인 시스템 */

.ai-diagnosis-page .service-main {
  padding-bottom: 64px;
}

.ai-diagnosis-hero {
  padding: 48px 0 24px;
}

.ai-diagnosis-hero-card {
  padding: 40px;
}

.ai-diagnosis-hero-card .section-label {
  background: var(--orange);
  color: var(--white);
  box-shadow: none;
  border: none;
}

.ai-diagnosis-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 12px 0 12px;
}

.ai-diagnosis-hero-desc {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gray-600);
  max-width: 640px;
}

.ai-diagnosis-card {
  padding: 36px 40px;
  margin-top: 8px;
}

.ai-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.ai-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-form-group.full {
  grid-column: 1 / -1;
}

.ai-form-group label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-600);
}

.ai-form-group input,
.ai-form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-form-group input:focus,
.ai-form-group textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.15);
}

.ai-prompt-field:focus-within textarea {
  outline: none;
}

.ai-form-group textarea {
  min-height: 88px;
  resize: vertical;
}

.ai-prompt-field {
  position: relative;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-prompt-field:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.15);
}

.ai-prompt-field textarea {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  box-shadow: none;
}

.ai-prompt-field textarea:focus {
  border: none;
  box-shadow: none;
}

.ai-prompt-field .ai-input-placeholder {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 14px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 1px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(26, 26, 26, 0.42);
  pointer-events: none;
  white-space: normal;
  transition: opacity 0.2s, visibility 0.2s;
}

.ai-prompt-field .ai-placeholder-cursor {
  width: 2px;
  height: 1.1em;
  margin-top: 0.15em;
  background: var(--gray-800);
  border-radius: 1px;
  flex-shrink: 0;
  animation: inputCursorBlink 1.05s step-end infinite;
}

.ai-prompt-field.is-focused .ai-input-placeholder,
.ai-prompt-field.has-value .ai-input-placeholder {
  opacity: 0;
  visibility: hidden;
}

.ai-example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ai-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--orange-light);
  color: var(--orange-dark);
  border: 1px solid var(--orange-100);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.ai-chip:hover {
  background: var(--orange-100);
  transform: translateY(-1px);
}

.ai-diagnose-btn {
  margin-top: 24px;
  width: 100%;
  padding: 16px 28px;
  font-size: 1rem;
}

.ai-diagnose-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

.ai-loading {
  display: none;
  margin-top: 20px;
  padding: 0;
  background: transparent;
}

.ai-loading.active {
  display: block;
}

.ai-aggregate {
  padding: 28px 24px;
  background: linear-gradient(145deg, var(--white) 0%, var(--orange-light) 100%);
  border: 1px solid var(--orange-100);
  border-radius: var(--radius);
  text-align: center;
}

.ai-aggregate-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 6px;
}

.ai-aggregate-sub {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--orange-dark);
  margin-bottom: 20px;
  min-height: 1.25em;
  transition: opacity 0.3s;
}

.ai-platform-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.ai-platform-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-600);
  opacity: 0.55;
  transform: scale(0.98);
  transition: opacity 0.35s, transform 0.35s, border-color 0.35s, box-shadow 0.35s, background 0.35s;
}

.ai-platform-chip.active {
  opacity: 1;
  transform: scale(1);
  border-color: var(--platform-color, var(--orange));
  color: var(--black);
  box-shadow: 0 4px 16px rgba(245, 130, 32, 0.2);
  background: var(--white);
}

.ai-platform-chip.done {
  opacity: 1;
  transform: scale(1);
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.ai-platform-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
  overflow: hidden;
}

.ai-platform-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.ai-platform-chip:not(.active):not(.done) .ai-platform-icon img {
  opacity: 0.45;
  filter: grayscale(0.35);
}

.ai-platform-chip.active .ai-platform-icon,
.ai-platform-chip.done .ai-platform-icon {
  border-color: transparent;
  background: var(--white);
}

.ai-platform-chip.done .ai-platform-icon img {
  opacity: 1;
  filter: none;
}

.ai-platform-status {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  flex-shrink: 0;
  position: relative;
}

.ai-platform-chip.active .ai-platform-status {
  border-color: var(--platform-color, var(--orange));
  border-top-color: transparent;
  animation: aiSpin 0.7s linear infinite;
}

.ai-platform-chip.done .ai-platform-status {
  border: none;
  background: #16a34a;
}

.ai-platform-chip.done .ai-platform-status::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ai-aggregate-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ai-flow-lines {
  display: flex;
  gap: 6px;
  height: 8px;
  align-items: center;
}

.ai-flow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  opacity: 0.3;
  animation: aiFlowPulse 1.2s ease-in-out infinite;
}

.ai-flow-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-flow-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiFlowPulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.ai-aggregate-hub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(26, 26, 26, 0.2);
  animation: aiHubPulse 2s ease-in-out infinite;
}

.ai-aggregate-hub i {
  font-size: 1rem;
  color: var(--orange);
}

@keyframes aiHubPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(26, 26, 26, 0.2); }
  50% { box-shadow: 0 4px 20px rgba(245, 130, 32, 0.35); }
}

.ai-aggregate-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 12px;
}

.ai-aggregate-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

.ai-aggregate-hint {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 600;
}

.ai-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--orange-100);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: aiSpin 0.8s linear infinite;
}

@keyframes aiSpin {
  to { transform: rotate(360deg); }
}

.ai-error {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #b91c1c;
  font-size: 0.875rem;
}

.ai-error.active {
  display: block;
}

.ai-error-message {
  margin: 0;
  white-space: pre-line;
}

.ai-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ai-error-actions .btn {
  font-size: 0.875rem;
  padding: 10px 16px;
}

.ai-results {
  display: none;
  margin-top: 32px;
  animation: aiFadeIn 0.5s ease;
}

.ai-results.active {
  display: block;
}

@keyframes aiFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-results-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.ai-score-ring {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.ai-score-ring svg {
  transform: rotate(-90deg);
}

.ai-score-ring .ring-bg {
  fill: none;
  stroke: var(--gray-100);
  stroke-width: 8;
}

.ai-score-ring .ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.ai-score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ai-score-value .num {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--black);
  line-height: 1;
}

.ai-score-value .unit {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 2px;
}

.ai-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 700;
}

.ai-status-badge.exposed {
  background: #dcfce7;
  color: #15803d;
}

.ai-status-badge.partial {
  background: #fef9c3;
  color: #a16207;
}

.ai-status-badge.not_exposed {
  background: #fee2e2;
  color: #b91c1c;
}

.ai-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.ai-viz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.ai-viz-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.ai-viz-panel.wide {
  grid-column: 1 / -1;
}

.ai-viz-panel h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-viz-panel h4::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.ai-radar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.ai-radar-svg {
  width: 220px;
  height: 220px;
}

.ai-radar-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--gray-600);
}

.ai-radar-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-radar-legend i {
  width: 24px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.ai-share-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.ai-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
}

.ai-donut-hole {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.ai-donut-hole .pct {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--orange-dark);
  line-height: 1;
}

.ai-donut-hole .lbl {
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.ai-share-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--gray-700);
}

.ai-share-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ai-rank-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-rank-row {
  display: grid;
  grid-template-columns: 28px 1fr 52px;
  gap: 12px;
  align-items: center;
}

.ai-rank-row .rank-num {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-400);
  text-align: center;
}

.ai-rank-row.mine .rank-num {
  color: var(--orange);
}

.ai-rank-meta {
  min-width: 0;
}

.ai-rank-meta .name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-rank-row.mine .name {
  color: var(--orange-dark);
}

.ai-rank-meta .sub {
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-top: 2px;
}

.ai-rank-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 6px;
}

.ai-rank-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
  width: 0;
  transition: width 1s ease;
}

.ai-rank-row.mine .ai-rank-bar-fill {
  background: linear-gradient(90deg, #34d399, #059669);
}

.ai-rank-pct {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--orange);
  text-align: right;
}

.ai-type-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-type-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  gap: 10px;
  align-items: center;
  font-size: 0.8125rem;
}

.ai-type-row .bar {
  height: 10px;
  background: var(--gray-100);
  border-radius: 100px;
  overflow: hidden;
}

.ai-type-row .bar i {
  display: block;
  height: 100%;
  border-radius: 100px;
  width: 0;
  transition: width 0.9s ease;
}

.ai-gap-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-gap-item {
  padding: 12px 14px;
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
}

.ai-gap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.ai-gap-head .label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-800);
}

.ai-gap-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.ai-gap-badge.ok {
  background: #dcfce7;
  color: #15803d;
}

.ai-gap-badge.warning {
  background: #fef9c3;
  color: #a16207;
}

.ai-gap-badge.critical {
  background: #fee2e2;
  color: #b91c1c;
}

.ai-gap-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.ai-gap-bar .current {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
  border-radius: 100px;
  width: 0;
  transition: width 1s ease;
}

.ai-gap-bar .benchmark {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: var(--black);
  border-radius: 1px;
}

.ai-gap-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.6875rem;
  color: var(--gray-400);
}

.ai-citation-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.ai-cite-chip {
  flex: 1 1 140px;
  max-width: calc(25% - 8px);
  min-width: 120px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  text-align: center;
  position: relative;
}

.ai-cite-chip.mine {
  border-color: var(--orange);
  background: var(--orange-light);
  box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.15);
}

.ai-cite-chip .r {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gray-400);
}

.ai-cite-chip.mine .r {
  color: var(--orange-dark);
}

.ai-cite-chip .t {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-cite-chip .d {
  font-size: 0.625rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.ai-stat-card {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--gray-200);
}

.ai-stat-card .val {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--orange-dark);
  line-height: 1.2;
}

.ai-stat-card .lbl {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-top: 4px;
}

.ai-result-block {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
}

.ai-result-block h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 12px;
}

.ai-sentence {
  padding: 12px 16px;
  background: var(--white);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  font-size: 0.9375rem;
  color: var(--gray-800);
  margin-bottom: 8px;
  line-height: 1.6;
}

.ai-rec-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-rec-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--gray-600);
}

.ai-rec-list li::before {
  content: '•';
  color: var(--orange);
  font-weight: 700;
  flex-shrink: 0;
}

.ai-cta-box {
  margin-top: 24px;
  padding: 24px;
  background: var(--orange-light);
  border-radius: var(--radius);
  border: 1px solid var(--orange-100);
  text-align: center;
}

.ai-cta-box p {
  font-size: 0.9375rem;
  color: var(--gray-600);
  margin-bottom: 16px;
}

.ai-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 768px) {
  .ai-diagnosis-hero-card,
  .ai-diagnosis-card {
    padding: 24px 20px;
  }

  .ai-form-grid {
    grid-template-columns: 1fr;
  }

  .ai-stat-grid {
    grid-template-columns: 1fr;
  }

  .ai-viz-grid {
    grid-template-columns: 1fr;
  }

  .ai-cite-chip {
    max-width: calc(50% - 8px);
  }

  .ai-results-header {
    flex-direction: column;
    text-align: center;
  }

  .ai-platform-grid {
    gap: 8px;
  }

  .ai-platform-chip {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .ai-platform-icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
}
