:root {
  --bg: #0a0e1a;
  --fg: #e9edf5;
  --muted: #9bafd7;
  --gold: #d4af37;
  --panel: #0f1428;
  --input: #080c18;
  --text-min: 16px;
  --tap-min: 44px;
  --focus: #7eb6ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--text-min);
  overflow-x: hidden;
}

.wrap { max-width: 720px; margin: 0 auto; }

.scope-tt {
  padding: 20px 16px 40px;
  max-width: 680px;
  margin: 0 auto;
}

.scope-tt h1 {
  font-size: 1.5rem;
  color: var(--gold);
  letter-spacing: 1px;
  margin: 0 0 6px;
  font-weight: 700;
}

.scope-tt .tt-sub {
  color: var(--muted);
  font-size: var(--text-min);
  margin: 0 0 10px;
  line-height: 1.4;
}

.scope-tt .tt-tag {
  display: inline-block;
  font-size: var(--text-min);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}

.lang-toggle {
  display: inline-flex;
  gap: 4px;
  background: #0d1224;
  border-radius: 8px;
  padding: 3px;
  margin-left: 8px;
  vertical-align: middle;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: #888;
  font-weight: 700;
  font-size: var(--text-min);
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.lang-btn.on {
  background: #333;
  color: #fff;
}

.tt-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 0 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tt-tabs button {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: #0d1224;
  color: #bbb;
  min-height: var(--tap-min);
  padding: 10px 14px;
  font-size: var(--text-min);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.tt-tabs button.on {
  background: linear-gradient(135deg, #d4af37, #a87810);
  color: #0a0e1a;
  border-color: #d4af37;
}

.pane {
  display: none;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
}

.pane.on { display: block; }

.scope-tt label {
  display: block;
  color: var(--muted);
  font-size: var(--text-min);
  font-weight: 700;
  letter-spacing: 0.4px;
  margin: 8px 0 6px;
}

.scope-tt input,
.scope-tt select,
.scope-tt textarea {
  width: 100%;
  background: var(--input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--fg);
  padding: 12px;
  font-family: inherit;
  font-size: var(--text-min);
  min-height: var(--tap-min);
}

.scope-tt textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.b {
  appearance: none;
  background: linear-gradient(135deg, #3c4d6e, #2a3650);
  color: #fff;
  border: 0;
  border-radius: 8px;
  min-height: var(--tap-min);
  padding: 10px 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  font-size: var(--text-min);
  letter-spacing: 0.3px;
}

.b.gold {
  background: linear-gradient(135deg, #d4af37, #a87810);
  color: #0a0e1a;
}

.out {
  background: var(--input);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--gold);
  font-family: Consolas, "SFMono-Regular", ui-monospace, monospace;
  font-size: var(--text-min);
  word-break: break-word;
  white-space: pre-wrap;
  min-height: 18px;
  margin-top: 6px;
}

.kbd {
  font-family: Consolas, "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.9em;
  background: var(--input);
  color: var(--gold);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.section-h {
  color: var(--gold);
  font-size: var(--text-min);
  margin: 20px 0 8px;
  padding-top: 12px;
  border-top: 1px solid #333;
  font-weight: 700;
}

.hint {
  font-size: var(--text-min);
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.35;
}

.status-line {
  font-size: var(--text-min);
  color: var(--muted);
  min-height: 1.2em;
}

.yiq-copy-2026 {
  margin: 0 auto 24px;
  padding: 10px 14px;
  max-width: 720px;
  text-align: center;
  font-size: 16px;
  opacity: 0.75;
}

.b:focus-visible,
.lang-btn:focus-visible,
.tt-tabs button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
