/* RoleLens — styles. Light and dark, no external fonts or assets. */

:root {
  --bg: #f6f5f1;
  --bg-soft: #efeee8;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #15181d;
  --ink-2: #3d434c;
  --muted: #6d727b;
  --line: rgba(21, 24, 29, 0.12);
  --line-strong: rgba(21, 24, 29, 0.22);
  --accent: #2f3f8f;
  --accent-ink: #1d2a6b;
  --accent-soft: rgba(47, 63, 143, 0.10);
  --amber: #a86a1c;
  --amber-soft: rgba(168, 106, 28, 0.12);
  --ok: #1d6b4f;
  --ok-soft: rgba(29, 107, 79, 0.12);
  --gap: #a3372a;
  --gap-soft: rgba(163, 55, 42, 0.10);
  --shadow: 0 1px 2px rgba(20, 24, 32, 0.05), 0 12px 32px rgba(20, 24, 32, 0.06);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", "Hiragino Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans TC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0d1014;
  --bg-soft: #12161b;
  --surface: #161b21;
  --surface-2: #1b2128;
  --ink: #e9ebef;
  --ink-2: #c2c7d0;
  --muted: #8d95a1;
  --line: rgba(233, 235, 239, 0.13);
  --line-strong: rgba(233, 235, 239, 0.26);
  --accent: #93a8ff;
  --accent-ink: #b9c6ff;
  --accent-soft: rgba(147, 168, 255, 0.14);
  --amber: #e0a95f;
  --amber-soft: rgba(224, 169, 95, 0.14);
  --ok: #74c9a6;
  --ok-soft: rgba(116, 201, 166, 0.14);
  --gap: #e39183;
  --gap-soft: rgba(227, 145, 131, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.015em; margin: 0; }

/* keep Korean and Japanese words intact when wrapping; Chinese needs per-character breaks */
html[lang="ko"] body, html[lang="ja"] body { word-break: keep-all; overflow-wrap: break-word; }
p { margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }

[hidden] { display: none !important; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 50;
  transition: top .15s;
}
.skip:focus { top: 12px; color: var(--bg); }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-block: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; color: var(--accent); }
.brand-name { display: block; font-weight: 700; letter-spacing: -0.02em; font-size: 17px; }
.brand-sub { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
.header-tools { display: flex; align-items: center; gap: 10px; flex: none; }

.langs { display: flex; align-items: center; gap: 2px; }
.langs a {
  font-size: 12.5px;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.langs a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.langs a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .i-moon { display: none; }
[data-theme="dark"] .icon-btn .i-sun { display: none; }
[data-theme="dark"] .icon-btn .i-moon { display: block; }

/* hero */
.hero { padding: clamp(36px, 6vw, 76px) 0 clamp(24px, 4vw, 44px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 650;
  margin-bottom: 14px;
}
h1 { font-size: clamp(1.9rem, 4.2vw, 3.15rem); font-weight: 700; }
.lead { margin-top: 18px; color: var(--ink-2); font-size: clamp(1rem, 1.4vw, 1.1rem); max-width: 58ch; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.badge {
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}
.hero-card-kicker { font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.hero-score { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 2px; }
.hero-score b { font-size: 56px; font-weight: 750; letter-spacing: -0.04em; line-height: 1; }
.hero-score span { color: var(--muted); font-size: 13px; }
.hero-card-label { color: var(--ink-2); font-size: 14px; margin-top: 10px; }
.hero-bars { display: grid; gap: 7px; margin-top: 18px; }
.hero-bar { height: 7px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.hero-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); opacity: .85; }
.hero-bar:nth-child(2) span { width: 62%; background: var(--amber); }
.hero-bar:nth-child(1) span { width: 84%; }
.hero-bar:nth-child(3) span { width: 46%; background: var(--ok); }
.hero-card-foot { margin-top: 16px; font-size: 12px; color: var(--muted); }

/* sections */
.section { padding: clamp(36px, 5vw, 64px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { max-width: 720px; margin-bottom: 28px; }
.sec-kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.sec-kicker b { color: var(--amber); font-weight: 700; margin-right: 8px; }
.sec-head h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 700; }
.sec-lead { margin-top: 12px; color: var(--ink-2); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.4vw, 24px);
  min-width: 0;
}
.panel-title { font-size: 15px; font-weight: 650; letter-spacing: 0.01em; margin-bottom: 14px; }

.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
input[type="text"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { min-height: 230px; resize: vertical; line-height: 1.55; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea::placeholder, input::placeholder { color: var(--muted); }

.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { font-size: 12.5px; color: var(--muted); }
.mt-14 { margin-top: 14px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn--solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--solid:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
[data-theme="dark"] .btn--solid { color: #0d1014; }
[data-theme="dark"] .btn--solid:hover { color: #0d1014; }
.btn--ghost { background: transparent; }
.btn--wide { width: 100%; }

.file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.status {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
}
.status.is-on { color: var(--ink-2); }
.status.is-on::before { content: "• "; color: var(--ok); font-weight: 700; }

/* results */
.results { margin-top: 8px; }
.result-top { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.score-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.score-ring {
  --pct: 0;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--bg-soft) 0);
  display: grid;
  place-items: center;
  position: relative;
  margin-bottom: 14px;
}
.score-ring::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
}
.score-num { position: relative; z-index: 1; font-size: 50px; font-weight: 750; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.score-cap { position: relative; z-index: 1; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.verdict {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 650;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.verdict[data-band="strong"] { background: var(--ok-soft); color: var(--ok); }
.verdict[data-band="fair"] { background: var(--amber-soft); color: var(--amber); }
.verdict[data-band="weak"] { background: var(--gap-soft); color: var(--gap); }
.score-out { font-size: 12px; color: var(--muted); margin-top: 8px; }

.breakdown { display: grid; gap: 12px; }
.bd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.bd-name { font-size: 13.5px; color: var(--ink-2); }
.bd-val { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.bd-bar { display: block; height: 100%; width: var(--w, 0%); border-radius: 99px; background: var(--accent); opacity: .9; transition: width .25s ease; }
.bd-row:nth-child(2) .bd-bar { background: var(--amber); }
.bd-row:nth-child(4) .bd-bar { background: var(--ok); }

.kw-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.kw-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.group-head h3 { font-size: 13.5px; font-weight: 650; letter-spacing: 0.01em; }
.count-badge { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sub-label { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  min-width: 0;
}
.chip-k { overflow-wrap: anywhere; }
.chip-s { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.chip--ok { border-color: color-mix(in srgb, var(--ok) 34%, transparent); background: var(--ok-soft); color: var(--ok); }
.chip--ok .chip-s { color: inherit; opacity: .8; }
.chip--gap { border-color: color-mix(in srgb, var(--gap) 34%, transparent); background: var(--gap-soft); color: var(--gap); }
.chip-empty { font-size: 12.5px; color: var(--muted); }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }

.check { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.check:last-child { border-bottom: 0; }
.check-mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--bg-soft); color: var(--muted); }
.check.is-ok .check-mark { background: var(--ok-soft); color: var(--ok); }
.check.is-gap .check-mark { background: var(--gap-soft); color: var(--gap); }
.check-name { color: var(--ink-2); overflow-wrap: anywhere; }
.check-state { font-size: 12px; color: var(--muted); }
.check.is-gap .check-state { color: var(--gap); }

.metric { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.metric:last-child { border-bottom: 0; }
.metric-k { font-size: 13.5px; color: var(--ink-2); }
.metric-v { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-h { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }
.metric-h.is-ok { color: var(--ok); }
.metric-h.is-warn { color: var(--amber); }
.metric-h.is-gap { color: var(--gap); }

.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.tip { position: relative; padding: 9px 12px 9px 34px; border-radius: 9px; background: var(--surface-2); font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.tip::before { content: "→"; position: absolute; left: 12px; top: 9px; color: var(--accent); font-weight: 700; }
.tip--keyword::before, .tip--wording::before { content: "＋"; color: var(--gap); }
.tip--allgood { background: var(--ok-soft); color: var(--ok); }
.tip--allgood::before { content: "✓"; color: var(--ok); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.ad-slot {
  margin-top: 26px;
  min-height: 92px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--surface-2);
}

/* guide */
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.prose h3 { font-size: 15.5px; font-weight: 650; margin-bottom: 10px; }
.prose p { color: var(--ink-2); font-size: 14.5px; }
.prose--wide { grid-column: 1 / -1; }
.table-wrap { max-width: 100%; overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }

.tips-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.tip-card h4 { margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.tip-card p { font-size: 13.5px; color: var(--ink-2); }

/* faq */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { margin-top: 10px; color: var(--ink-2); font-size: 14px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 38px 0 26px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: 28px; }
.footer-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.footer-brand .brand-mark { width: 24px; height: 24px; }
.footer-about { margin-top: 10px; font-size: 13px; color: var(--muted); max-width: 46ch; }
.footer-h { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.footer-links { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-links .hint { font-size: 12px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 26px; padding-top: 16px; font-size: 12px; color: var(--muted); }
.operated { font-weight: 600; color: var(--ink-2); }

/* policy pages */
.policy { padding: 46px 0 64px; }
.policy-wrap { max-width: 760px; margin-inline: auto; }
.policy h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.policy .updated { color: var(--muted); font-size: 13px; margin-top: 10px; }
.policy .intro { color: var(--ink-2); margin-top: 18px; }
.policy-section { margin-top: 26px; }
.policy-section h2 { font-size: 1.05rem; font-weight: 650; }
.policy-section p { color: var(--ink-2); margin-top: 8px; font-size: 14.5px; }
.back-link { display: inline-block; margin-top: 30px; font-size: 14px; }

/* print */
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .site-header, main > section, .site-footer, .ad-slot, .skip, .btn-row, .actions { display: none !important; }
  .print-only { display: block; padding: 0; }
  #printArea { display: block; }
  #printArea h1 { font-size: 18pt; margin-bottom: 8pt; color: #000; }
  #printArea .print-score { font-size: 12pt; font-weight: 700; margin-bottom: 10pt; }
  #printArea pre { white-space: pre-wrap; font-family: var(--mono); font-size: 9.5pt; line-height: 1.45; color: #000; }
}

/* responsive */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-card { max-width: 460px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .result-top { grid-template-columns: minmax(0, 1fr); }
  .score-panel { flex-direction: row; gap: 20px; text-align: left; justify-content: flex-start; flex-wrap: wrap; }
  .score-ring { margin-bottom: 0; width: 140px; height: 140px; }
  .kw-groups, .two-col, .guide-grid, .tips-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .wrap { width: min(1120px, 100% - 28px); }
  .header-in { min-height: 58px; }
  .brand-sub { display: none; }
  .langs a { padding: 6px 6px; font-size: 12px; }
  .header-tools { gap: 6px; }
  textarea { min-height: 190px; }
  .score-num { font-size: 40px; }
  .score-ring { width: 124px; height: 124px; }
  .btn { padding: 10px 15px; font-size: 14px; }
  .btn--wide { width: 100%; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .hero-score b { font-size: 46px; }
  .panel { padding: 15px; }
  .check, .metric { font-size: 13.5px; }
  .faq details { padding: 12px 13px; }
  th, td { padding: 8px 9px; }
}

@media (max-width: 420px) {
  .langs a { padding: 5px 4px; font-size: 11.5px; }
  .brand-name { font-size: 15.5px; }
  .badges .badge { font-size: 11.5px; }
  .score-panel { flex-direction: column; align-items: flex-start; }
}
