/* i18n: English default, .lang-ko activates Korean */
.ko-only { display: none !important; }
.lang-ko .ko-only { display: inline !important; }
.lang-ko .en-only { display: none !important; }
.lang-toggle {
  margin-left: auto;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  border: 1px solid var(--line, #d7deea);
  background: var(--panel, #fff);
  cursor: pointer;
  color: var(--muted, #647083);
  flex-shrink: 0;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* 색·서체는 ../_shared/fhe16-theme.css 가 정한다 (2026-09-15) */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

button {
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  color: #8a94a6;
  background: #edf1f7;
  cursor: not-allowed;
}

button:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 44%);
  gap: 28px;
  align-items: center;
  min-height: 330px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: 0;
}

.summary {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.signal {
  width: 100%;
  aspect-ratio: 7 / 4;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
}


.app-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.mode-card {
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.mode-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.mode-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.toolbar,
.panel,
.log-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select {
  min-height: 40px;
  padding: 0 36px 0 12px;
}

.status {
  margin-left: auto;
  min-height: 40px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
  margin-top: 16px;
}

.panel,
.log-panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bit-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 76px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfe;
  cursor: pointer;
}

.bit-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.bit-toggle span {
  width: 100%;
  text-align: center;
  font-weight: 800;
}

.bit-toggle:has(input:checked) {
  border-color: var(--accent);
  background: #e7f4f2;
  color: var(--accent-strong);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.result-grid div {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}

.result-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.result-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.meter {
  overflow: hidden;
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  background: #e8edf5;
}

#benchMeter {
  width: 0;
  height: 100%;
  background: var(--good);
  transition: width 180ms ease;
}

.bench-rows {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
}

.bench-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #edf1f7;
  padding-bottom: 6px;
}

.pass {
  color: var(--good);
  font-weight: 800;
}

.fail {
  color: var(--bad);
  font-weight: 800;
}

.log-panel {
  margin-top: 16px;
}

#clearLogButton {
  min-height: 32px;
  padding: 0 10px;
}

#logOutput {
  overflow: auto;
  min-height: 240px;
  max-height: 380px;
  margin: 0;
  border-radius: 8px;
  background: #101820;
  color: #d7f7ef;
  padding: 14px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 14px;
  }

  .hero,
  .workspace,
  .app-modes {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 34px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .status {
    margin-left: 0;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}

/* block-level language toggle (paragraphs, lists) */
.ko-only-b { display: none !important; }
.lang-ko .ko-only-b { display: revert !important; }
.lang-ko .en-only-b { display: none !important; }
