:root {
  color-scheme: light;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: #192039;
  background: #f6f7fc;
  --ink: #192039;
  --muted: #525c76;
  --line: #dce1ef;
  --accent: #493fc4;
  --teal: #0b6556;
  --card: #fff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
::selection { color: #19134f; background: #e7e0ff; }
:focus-visible { outline: 3px solid #6158e5; outline-offset: 3px; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
p { color: var(--muted); line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, h3 { word-break: keep-all; }
.frame { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }
.site-header { background: #f6f7fce8; border-bottom: 1px solid var(--line); }
.topbar, .site-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar { min-height: 4.2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 800; text-decoration: none; color: var(--ink); }
.mark { background: var(--accent); color: white; border-radius: .65rem; padding: .55rem .5rem; font-size: .875rem; line-height: 1; }
nav { display: flex; flex-wrap: wrap; gap: .75rem 1.35rem; }
nav a { color: var(--muted); font-size: .9rem; font-weight: 650; text-decoration: none; }
nav a:hover { color: var(--accent); text-decoration: underline; }
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(16rem, .85fr); align-items: center; gap: 3rem; padding: 4.5rem 0 4rem; }
.hero h1 { font-size: clamp(2rem, 4.7vw, 3.65rem); line-height: 1.2; letter-spacing: -.055em; }
.hero p { margin: 1.1rem 0 1.4rem; max-width: 34rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.75rem; padding: .55rem .9rem; border: 1px solid transparent; border-radius: .65rem; font-size: .92rem; font-weight: 750; text-decoration: none; text-align: center; overflow-wrap: anywhere; }
.primary { color: #fff; background: var(--accent); }
.primary:hover:not(:disabled) { background: #382fa7; }
.secondary { color: var(--accent); background: #fff; border-color: #cec9ef; }
.secondary:hover:not(:disabled) { background: #f1efff; }
.overview { border-radius: 1.15rem; padding: 1.35rem; background: #17213c; color: #fff; box-shadow: 0 1rem 2rem #222d4d21; }
.overview-title { font-weight: 750; padding: .15rem .1rem 1rem; font-size: 1rem; }
.flow-row { display: flex; align-items: center; gap: .85rem; padding: .75rem .1rem; border-top: 1px solid #ffffff26; }
.flow-row small { display: block; margin-top: .25rem; color: #cdd6f0; font-size: .82rem; }
.flow-mark { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; flex: 0 0 auto; border-radius: .6rem; font-weight: 800; }
.violet { background: #ebe7ff; color: #4335a6; }
.mint { background: #dff5ed; color: var(--teal); }
.peach { background: #fff0dc; color: #7d4416; }
.section-heading { margin-bottom: 1rem; }
.section-heading h2 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.04em; }
.section-heading p { margin-top: .35rem; }
.lab-grid { display: grid; grid-template-columns: minmax(12.5rem, .62fr) minmax(0, 2fr); gap: 1.2rem; align-items: start; }
.lab-tabs { display: grid; gap: .55rem; }
.lab-tabs button {
  text-align: left; border: 1px solid var(--line); color: var(--ink);
  background: var(--card); border-radius: .75rem; padding: .8rem 1rem;
}
.lab-tabs button strong, .lab-tabs button small { display: block; }
.lab-tabs button strong { font-size: .98rem; }
.lab-tabs button small { font-size: .82rem; margin-top: .25rem; color: var(--muted); }
.lab-tabs [aria-selected="true"] { background: #efedff; border-color: #8d82e2; color: #392e98; box-shadow: inset .2rem 0 #6052cf; }
.lab-tabs button:hover { border-color: #8d82e2; }
.lab { border: 1px solid var(--line); border-radius: 1.1rem; padding: clamp(1rem, 3vw, 1.75rem); background: var(--card); min-width: 0; }
.lab header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem; }
.lab header h3 { font-size: clamp(1.22rem, 2.5vw, 1.7rem); letter-spacing: -.04em; }
.lab > p { margin: .7rem 0 1.2rem; }
.type-tag { border-radius: 10rem; padding: .35rem .65rem; font-size: .8rem; font-weight: 750; }
.lab label { display: block; margin: 0 0 .4rem; font-size: .9rem; font-weight: 750; }
.lab textarea, .lab input, .lab select {
  display: block; width: 100%; color: var(--ink); background: #fafbff;
  border: 1px solid #cbd2e5; border-radius: .65rem; padding: .65rem .75rem;
}
.lab textarea { resize: vertical; line-height: 1.5; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
details { margin-top: .75rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: .7rem; }
summary { color: var(--accent); font-weight: 700; }
details p, details label, details .button { margin-top: .65rem; }
.api-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.api-links { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .45rem; font-size: .875rem; }
details p, .feedback { font-size: .9rem; }
.feedback { margin-top: 1rem; color: var(--muted); line-height: 1.55; }
.feedback[data-tone="error"] { color: #982445; }
.feedback[data-tone="success"] { color: var(--teal); }
.exchange, .sentence-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.exchange { margin-top: 1rem; }
.exchange h4, .result h4 { font-size: .9rem; margin-bottom: .45rem; }
.exchange pre {
  margin: 0; min-height: 6rem; max-height: 18rem; overflow: auto; padding: .75rem;
  color: #e7e9ff; background: #18213a; border-radius: .65rem;
  font: .84rem/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}
.result { margin-top: 1rem; padding: .8rem .9rem; border-radius: .7rem; background: #f1f4ff; }
.result p { color: var(--ink); white-space: pre-wrap; }
.result small, .subtle { color: var(--muted); font-size: .85rem; }
#similarity-score { font-size: 1.65rem; font-weight: 800; }
#mcp-form { margin-top: 1rem; }
.inline-input { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .6rem; }
.comparison { margin-top: 3.3rem; }
.comparison dl { background: var(--card); border: 1px solid var(--line); border-radius: .9rem; padding: .3rem 1.1rem; }
.comparison dl div { display: grid; grid-template-columns: minmax(8rem, .65fr) minmax(0, 2fr); padding: .75rem 0; gap: .5rem; }
.comparison dl div + div { border-top: 1px solid var(--line); }
.comparison dt { font-weight: 750; }
.comparison dd { color: var(--muted); line-height: 1.5; }
.site-footer { margin-top: 3rem; padding: 1.15rem 0 1.7rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) {
  .frame { width: calc(100% - 2rem); }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding: 2.5rem 0; }
  .hero h1 br { display: none; }
  .lab-grid { grid-template-columns: 1fr; gap: .75rem; }
  .lab-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .4rem; }
  .lab-tabs button { padding: .7rem; }
}
@media (max-width: 440px) {
  .exchange, .sentence-inputs, .api-options, .comparison dl div { grid-template-columns: 1fr; }
  .inline-input { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
