/* WCAG 컬러 대비 검사 전용 스타일 */

nav { max-width: 800px; }
main { max-width: 800px; }

.color-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.55rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.color-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 0;
}

.card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.color-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
}

.color-swatch {
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.color-row input[type="text"] {
  flex: 1;
  padding: 0.55rem 0.7rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-width: 0;
}
.color-row input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.swap-colors {
  align-self: center;
  width: 40px;
  height: 40px;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px dashed var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.swap-colors:hover {
  border-style: solid;
  border-color: var(--primary);
  color: var(--primary);
}

.error {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.95rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: var(--error);
  font-size: 0.85rem;
}
.error[hidden] { display: none; }

/* 비율 카드 */
.ratio-card {
  text-align: center;
  padding: 1.4rem 1.2rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(102, 126, 234, 0.03));
  border: 1px solid var(--primary);
  border-radius: 14px;
  margin-bottom: 1rem;
}

.ratio-main {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
}

.ratio-value {
  font-size: 3.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.04em;
  line-height: 1;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.ratio-suffix {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-sub);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.ratio-grade {
  margin-top: 0.55rem;
  display: inline-block;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
}

.ratio-grade.grade-aaa {
  background: rgba(16, 185, 129, 0.14);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.ratio-grade.grade-aa {
  background: rgba(102, 126, 234, 0.12);
  color: var(--primary);
  border: 1px solid rgba(102, 126, 234, 0.4);
}
.ratio-grade.grade-large {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.ratio-grade.grade-poor {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* 미리보기 */
.preview-card {
  padding: 1.4rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.preview-text {
  word-break: keep-all;
}

.preview-text.small {
  font-size: 14px;
}
.preview-text.large {
  font-size: 24px;
  font-weight: 500;
}
.preview-text.bold-large {
  font-size: 18.66px;
  font-weight: 700;
}

/* 판정 */
.judges {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.6rem;
}

.judge-card {
  padding: 0.85rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.judge-head {
  margin-bottom: 0.65rem;
}

.judge-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.judge-spec {
  font-size: 0.7rem;
  color: var(--text-sub);
}

.judge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.judge-grid.one {
  grid-template-columns: 1fr;
}

.judge-item {
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  text-align: center;
}

.judge-name {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.05em;
}

.judge-th {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  color: var(--text-sub);
  opacity: 0.7;
}

.judge-flag {
  margin-top: 0.2rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
}

.judge-flag.flag-pass {
  background: rgba(16, 185, 129, 0.14);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.judge-flag.flag-fail {
  background: rgba(239, 68, 68, 0.14);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

@media (max-width: 600px) {
  .color-inputs { grid-template-columns: 1fr; }
  .swap-colors { transform: rotate(90deg); margin: 0 auto; }
  .judges { grid-template-columns: 1fr; }
  .ratio-value { font-size: 2.8rem; }
}

@media (max-width: 480px) {
  .preview-text.small { font-size: 13px; }
  .preview-text.large { font-size: 22px; }
}
