/* Fraction Simplifier — content styles.
   Prefix: --fd-  /  .fd-

   Reference point: each fraction is laid out as a real num/slash/den
   row rather than two separate labeled fields, so entering 24 / 36
   reads visually like the fraction it represents. Seventh
   `education`-cluster tool this loop.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --fd-surface: #ffffff;
  --fd-panel:   #f4f5f6;
  --fd-line:    #dde0e3;
  --fd-text:    #171a1c;
  --fd-muted:   #5c6368;
  --fd-error:   #b3261e;
  --fd-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.fd-wrap {
  width: 100%;
  max-width: 28rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Input panel ─────────────────────────────────────────────────────────── */

.fd-panel {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--fd-line);
  border-radius: 2px;
  background: var(--fd-surface);
}

.fd-fraction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.fd-fraction-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fd-text);
}

.fd-optional {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--fd-muted);
}

.fd-fraction-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fd-cell {
  width: 5rem;
  box-sizing: border-box;
  padding: 0.625rem 0.5rem;
  font-family: var(--fd-mono);
  font-size: 1.0625rem;
  text-align: center;
  color: var(--fd-text);
  background: var(--fd-panel);
  border: 1px solid var(--fd-line);
  border-radius: 2px;
}

.fd-cell:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.fd-slash {
  font-family: var(--fd-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fd-muted);
}

.fd-status {
  min-height: 1.25rem;
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--fd-error);
}

/* ── Primary action button ──────────────────────────────────────────────── */

.fd-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tf-accent-ink);
  background: var(--tf-accent);
  border: 1px solid var(--tf-accent);
  border-radius: 2px;
  cursor: pointer;
}

.fd-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.fd-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.fd-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Results ─────────────────────────────────────────────────────────────── */

.fd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 26rem) {
  .fd-grid { grid-template-columns: 1fr; }
}

.fd-metric {
  padding: 1rem 0.75rem;
  border: 1px solid var(--fd-line);
  border-radius: 2px;
  background: var(--fd-surface);
  text-align: center;
}

.fd-metric-label {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  color: var(--fd-muted);
}

.fd-metric-value {
  margin: 0;
  font-family: var(--fd-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--tf-accent);
}

.fd-lcd-wrap {
  padding: 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
  border: 1px solid var(--fd-line);
  border-radius: 2px;
  background: var(--fd-panel);
}

.fd-lcd-title {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fd-muted);
}

.fd-lcd-value {
  margin: 0;
  font-family: var(--fd-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--fd-text);
}

.fd-lcd-detail {
  margin: 0.375rem 0 0;
  font-family: var(--fd-mono);
  font-size: 0.8125rem;
  color: var(--fd-muted);
}

.fd-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--fd-muted);
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.fd-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 28rem;
  padding-inline: 1.5rem;
  overflow: hidden;
}

@media (max-width: 26rem) {
  .fd-wrap,
  .fd-ad { padding-inline: 1rem; }
  .fd-panel { padding: 1.25rem; }
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --fd-surface: var(--tf-surface);
  --fd-panel: var(--tf-surface);
  --fd-line: var(--tf-rule);
  --fd-text: var(--tf-ink);
  --fd-muted: var(--tf-ink-soft);
  --fd-error: #da8581;
}
