/* --- Base --- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #f8fafc;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* --- Page layout --- */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

/* --- Title --- */
.app-title {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1rem 0;
}

/* --- Explainer (collapsible) --- */
.explainer {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  color: #475569;
}

.explainer summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
  user-select: none;
  font-size: 0.95rem;
}

.explainer p,
.explainer a {
  font-size: 0.95rem;
  margin-top: 0.75rem;
}

.explainer a {
  color: #6366f1;
}

/* --- Main two-column layout --- */
.main-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.left-panel {
  flex: 1;
  min-width: 0;
}

.right-panel {
  flex: 1.5;
  min-width: 0;
}

/* --- Section labels (h3) --- */
.section-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  margin: 1.25rem 0 0.5rem 0;
}

.left-panel .section-label:first-child,
.right-panel .section-label:first-child {
  margin-top: 0;
}

/* --- Radio buttons --- */
.vocab-radio {
  display: flex;
  gap: 0.75rem;
}

.vocab-radio label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  cursor: pointer;
  color: #334155;
}

.vocab-radio input[type="radio"] {
  accent-color: #6366f1;
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* --- Text input --- */
.text-input {
  width: 100%;
  height: 180px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.6;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}

.text-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* --- Visualized token spans --- */
.token-viz {
  cursor: default;
}

/* --- Token IDs block --- */
.token-ids-block {
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #334155;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* --- Stats --- */
.stats-row {
  display: flex;
  gap: 1rem;
}

.stat-card {
  flex: 1;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  text-align: center;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}
