/* Matrix Determinant Calculator — content styles.
   Prefix: --md-  /  .md-

   Reference point: the matrix grid itself is the input surface — cells
   arranged in a real 2×2 or 3×3 square, not a linear list of fields,
   so the layout visually matches the mathematical object being
   entered. Sixth `education`-cluster tool this loop, and the second
   (after `geometry-area-and-perimeter-calculator`) where a select
   changes the actual number of input fields.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --md-surface: #ffffff;
  --md-panel:   #f4f5f6;
  --md-line:    #dde0e3;
  --md-text:    #171a1c;
  --md-muted:   #5c6368;
  --md-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.md-wrap {
  width: 100%;
  max-width: 36rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Input panel ─────────────────────────────────────────────────────────── */

.md-panel {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--md-line);
  border-radius: 2px;
  background: var(--md-surface);
}

.md-size-field {
  margin-bottom: 1.25rem;
}

.md-size-field label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--md-muted);
}

.md-size-field select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--md-text);
  background: var(--md-panel);
  border: 1px solid var(--md-line);
  border-radius: 2px;
}

.md-size-field select:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.md-grid {
  display: grid;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
  max-width: 16rem;
  min-height: 7.25rem;
  margin-inline: auto;
}

.md-cell {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.5rem;
  font-family: var(--md-mono);
  font-size: 1.0625rem;
  text-align: center;
  color: var(--md-text);
  background: var(--md-panel);
  border: 1px solid var(--md-line);
  border-radius: 2px;
}

.md-cell:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

/* ── Primary action button ──────────────────────────────────────────────── */

.md-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;
}

.md-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.md-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.md-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Hero + expansion ────────────────────────────────────────────────────── */

.md-hero {
  padding: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  border: 1px solid var(--md-line);
  border-radius: 2px;
  background: var(--md-surface);
}

.md-hero-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--md-muted);
}

.md-hero-value {
  margin: 0;
  font-family: var(--md-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--tf-accent);
}

.md-expansion-wrap {
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--md-line);
  border-radius: 2px;
  background: var(--md-panel);
  overflow-x: auto;
}

.md-expansion-title {
  margin: 0 0 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--md-muted);
}

.md-expansion {
  margin: 0;
  font-family: var(--md-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--md-text);
  white-space: nowrap;
}

.md-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--md-muted);
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.md-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 28rem;
  padding-inline: 1.5rem;
  overflow: hidden;
}

@media (max-width: 26rem) {
  .md-wrap,
  .md-ad { padding-inline: 1rem; }
  .md-panel { padding: 1.25rem; }
  .md-grid { max-width: 100%; }
}

/* 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"] {
  --md-surface: var(--tf-surface);
  --md-panel: var(--tf-surface);
  --md-line: var(--tf-rule);
  --md-text: var(--tf-ink);
  --md-muted: var(--tf-ink-soft);
}
