/* Components — Security Checker */

*, *::before, *::after { box-sizing: border-box; }

/* display 를 지정한 클래스가 UA 의 [hidden] 을 이기므로 명시적으로 눌러둔다. */
[hidden] { display: none !important; }

html { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* —— Type —— */
.eyebrow {
  display: block;
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  line-height: 1;
}
.display {
  font-size: var(--fs-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: var(--lh-display);
  margin: 0;
}
.title {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin: 0;
}
.heading {
  font-size: var(--fs-heading);
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
}
.lead {
  font-size: var(--fs-body-lg);
  font-weight: 400;
  line-height: var(--lh-lead);
  color: var(--text-secondary);
  margin: 0;
}
.caption {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  margin: 0;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 620;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  background: transparent;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-subtle); }
.btn-ghost {
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-subtle); color: var(--text); }
.btn-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.btn-accent:hover:not(:disabled) { filter: brightness(0.97); }
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { height: 48px; padding: 0 20px; font-size: 14.5px; }

/* —— Form —— */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-secondary);
}
.input, .select {
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder { color: var(--text-tertiary); }
.input-affix {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
}
.input-affix .input {
  border: 0;
  box-shadow: none;
  flex: 1;
  min-width: 0;
}
.input-affix .affix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

/* —— Badge —— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}
.badge-pass { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-fail { background: var(--danger-soft); color: var(--danger); }
.badge-pending { background: var(--pending-soft); color: var(--pending); }
.badge-ink { background: var(--primary-soft); color: var(--text); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* —— Card / Surface —— */
.surface {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.kpi {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-secondary);
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi-meta {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
}
.kpi-fail .kpi-value { color: var(--danger); }

/* —— Progress —— */
.progress {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.4s var(--ease);
}
.progress-ink > span { background: var(--primary); }
.progress-success > span { background: var(--success); }
.progress-fail > span { background: var(--danger); }

/* —— Table —— */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light, var(--border));
  vertical-align: top;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur); }
.table tbody tr:hover { background: #FAFAF8; }
.table tr.is-fail { background: #FFF8F8; }
.table tr.is-fail td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}
.table a.row-link { color: var(--text); font-weight: 600; }
.table a.row-link:hover { color: var(--accent); }

/* —— Check item (app) —— */
.check-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  position: relative;
}
.check-item.is-fail {
  border-color: #F0C9C9;
  background: #FFFCFC;
}
.check-item.is-pass {
  border-color: var(--border);
}
.check-item.is-warn {
  border-color: #F5E0B8;
  background: #FFFEF9;
}
.check-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.check-icon.pass { background: var(--success-soft); color: var(--success); }
.check-icon.fail { background: var(--danger-soft); color: var(--danger); }
.check-icon.warn { background: var(--warn-soft); color: var(--warn); }
.check-icon svg { width: 14px; height: 14px; }
.check-body { min-width: 0; }
.check-title {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0 0 3px;
}
.check-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}
.check-action {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent);
  white-space: nowrap;
  align-self: center;
}
.check-action:hover { text-decoration: underline; }
/* 검사 진행 행의 우측 상태 텍스트 */
.check-state {
  font-size: 12px;
  font-weight: 650;
  color: var(--accent);
  white-space: nowrap;
  align-self: center;
}

/* —— Spec note —— */
.spec-note {
  margin-top: var(--space-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}
.spec-note summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-subtle);
}
.spec-note summary::-webkit-details-marker { display: none; }
.spec-note summary::after {
  content: "+";
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: 18px;
  line-height: 1;
}
.spec-note[open] summary::after { content: "−"; }
.spec-note-body {
  padding: 18px 20px 22px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.spec-note-body h4 {
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.spec-note-body h4:first-child { margin-top: 0; }
.spec-note-body ul { margin: 0; padding-left: 18px; }
.spec-note-body li { margin: 4px 0; }
.spec-note-body pre {
  margin: 8px 0 0;
  padding: 12px 14px;
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  overflow: auto;
}

/* —— Toast / Banner —— */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 13px;
}
.banner-ink { background: var(--bg-ink); color: var(--text-inverse); border-color: transparent; }
.banner-warn { background: var(--warn-soft); border-color: #FDE68A; }
.banner-fail { background: var(--danger-soft); border-color: #FECACA; }
.banner-pass { background: var(--success-soft); border-color: #A7F3D0; }

/* —— Tabs —— */
.tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  gap: 2px;
}
.tab {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 620;
  line-height: 1;
  cursor: pointer;
}
.tab.is-active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* —— Empty —— */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}
.empty svg { margin: 0 auto 14px; color: var(--text-tertiary); }
.empty p { margin: 0 0 16px; font-size: 13.5px; }

/* —— Meta strip (campaign) —— */
.meta-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  font-size: 12px;
  color: var(--text-secondary);
}
.meta-strip .meta-title {
  font-weight: 700;
  color: var(--text);
  margin-right: 2px;
}
.meta-strip .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
  flex: none;
}
.meta-strip .hl-ok {
  color: var(--success);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* —— Scope grid (what we check) —— */
.scope-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}
.scope-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.scope-panel-head .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  line-height: 1;
}
.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.scope-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  background: var(--bg-elevated);
  min-height: 64px;
}
.scope-cell .mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--bg-subtle);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.scope-cell .mark svg { width: 15px; height: 15px; }
.scope-cell .txt { min-width: 0; }
.scope-cell .name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
  line-height: 1.2;
}
.scope-cell .hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.3;
}
.scope-foot {
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  background: #FAFAF8;
}
.scope-foot svg { opacity: 0.55; }

/* Detect pill next to field */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pill-detect {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.pill-detect i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  flex: none;
}

/* —— Result summary —— */
.score-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.score-bar .score-copy { flex: 1; min-width: 0; }
.score-bar .score-copy .kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 4px;
}
.score-bar .score-copy h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.score-bar .score-copy.is-fail h2 { color: var(--text); }
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 2px;
}
.section-label span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.check-detail .hl {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.passed-rail {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.passed-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-full);
  background: var(--success-soft);
  color: var(--success);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}
.passed-chip svg { width: 12px; height: 12px; }

/* —— Step list (fix guide) —— */
.step-list { display: flex; flex-direction: column; gap: 0; }
.step-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.step-row:last-child { border-bottom: 0; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.step-row .step-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
}
.step-row .step-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* —— Receipt (complete) —— */
.receipt {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
  text-align: left;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.receipt-row:last-child { border-bottom: 0; }
.receipt-row .k { color: var(--text-tertiary); font-weight: 600; }
.receipt-row .v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* —— Brand mark (INNORED PASS) —— */
.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
  display: block;
  color: currentColor;
}
.brand-mark-sm { width: 22px; height: 22px; }
.brand-mark-xs { width: 14px; height: 14px; }
.brand-mark-lg { width: 40px; height: 40px; }

.brand-name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  line-height: 1;
}
.brand-innored {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand-innored);
}
.brand-pass {
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.2em;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.brand-name-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.brand-name-stack .brand-innored {
  font-size: 0.72em;
  letter-spacing: 0.2em;
  opacity: 0.72;
}
.brand-name-stack .brand-pass {
  font-size: 1em;
  letter-spacing: -0.01em;
}
.brand-name-sm {
  font-size: 12px;
  gap: 0.28em;
}
.brand-name-sm .brand-pass {
  letter-spacing: -0.01em;
}
.brand-name-on-ink {
  color: #fff;
}

/* —— Icon helper —— */
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

/* —— Tooltip (hover / keyboard) —— */
.has-tip {
  position: relative;
}
.has-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(260px, 70vw);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-ink);
  color: var(--text-inverse);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms var(--ease), transform 140ms var(--ease), visibility 140ms;
  z-index: 60;
}
.has-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-ink);
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms var(--ease), visibility 140ms;
  z-index: 60;
}
.has-tip:hover::after,
.has-tip:hover::before,
.has-tip:focus-visible::after,
.has-tip:focus-visible::before {
  opacity: 1;
  visibility: visible;
}
.has-tip:hover::after,
.has-tip:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}
.has-tip-end::after {
  left: auto;
  right: 0;
  transform: translateY(4px);
}
.has-tip-end:hover::after,
.has-tip-end:focus-visible::after {
  transform: translateY(0);
}
.has-tip-end::before {
  left: auto;
  right: 16px;
  transform: none;
}

/* —— SSO 접근 불가 / 어드민 flash —— */
.sso-denied {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.sso-denied-card {
  width: min(480px, 100%);
  padding: 36px 32px 28px;
  text-align: center;
}
.sso-denied-card h1 {
  margin: 14px 0 10px;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.03em;
}
.sso-denied-card > p {
  margin: 0 0 24px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}
.sso-denied-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sso-denied-help { margin: 22px 0 0; }
.sso-denied-help a { color: var(--accent); font-weight: 650; }
