/* Four Diagrams (the course's fixed-price New Keynesian model). It reuses the New Keynesian workspace
   (experiments.css), the Scenario Lab boards (scenario.css) and the shared components; only its own pieces are here. */
.fd-help { margin: 4px 0 10px; color: #586b83; font-size: .76rem; line-height: 1.45; }
.fd-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 6px 0; padding: 3px; border-radius: 10px; background: #eef1f6; }
.fd-choice.fd-sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fd-choice button { padding: 8px 6px; border: 0; border-radius: 8px; background: transparent; color: #43566f; font-size: .8rem; font-weight: 600; line-height: 1.25; cursor: pointer; }
.fd-choice button[aria-pressed="true"] { background: white; color: var(--model-strong); box-shadow: 0 1px 3px rgba(16, 35, 63, .14); }
.fd-choice button:hover:not([aria-pressed="true"]) { color: var(--model-strong); }

/* The key under the headline: what the line styles and highlights mean. */
.fd-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 0; color: #52647c; font-size: .78rem; }
.fd-key-line { display: inline-block; width: 22px; height: 0; margin-right: -4px; vertical-align: middle; }
.fd-key-before { border-top: 2px dashed #9aa7b8; }
.fd-key-after { border-top: 3px solid #24364f; }
.fd-key-middle { border-top: 2px dotted #326eaf; }

/* Highlighted variables: inside the KaTeX equations and in the key under the headline. */
.fd-shock, .fd-induced { padding: 1px 3px; border-radius: 4px; }
.fd-shock { background: var(--model-accent); color: var(--model-on-accent); }
.fd-induced { background: #fde7c2; color: #6a3f00; }
.fd-swatch { display: inline-block; padding: 0 5px; font-family: "KaTeX_Math", "Times New Roman", serif; font-style: italic; font-weight: 400; }

/* The steps, top to bottom. */
.fd-steps { display: grid; gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.fd-step { padding: 18px 20px; border-top: 4px solid var(--model-border); }
.fd-step.fd-entry { border-top-color: var(--model-accent); }
.fd-step.fd-unchanged { background: #fafbfd; }
.fd-step.fd-unchanged .fd-chart { opacity: .55; }
.fd-step-head h3 { margin: 2px 0 0; font-size: 1.15rem; }
.fd-question { margin: 2px 0 0; color: #586b83; font-size: .86rem; }
.fd-step-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 12px; }
.fd-step-text { min-width: 0; }
.fd-chart { width: 100%; height: 400px; min-width: 0; }
/* The equations: centred and large, like a displayed equation in a paper, each with a small caption. */
.fd-formulas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0 0 14px; padding: 12px 14px 8px; border: 1px solid #e3e8ef; border-radius: 12px; background: #fcfcfe; }
.fd-equation { min-width: 0; margin: 0; text-align: center; }
.fd-equation figcaption { color: #6b7a90; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.fd-math { overflow-x: auto; overflow-y: hidden; color: #121f33; font-size: 1.18rem; }
.fd-math .katex-display { margin: .2em 0 .55em; }
.fd-formula-note { margin: 2px 0 0; color: #586b83; font-size: .8rem; text-align: center; }

/* The explanation: short bullets with the key numbers and directions in bold. */
.fd-points { margin: 0; padding-left: 1.1rem; list-style: disc; color: #2a3b52; font-size: .9rem; line-height: 1.55; }
.fd-points li + li { margin-top: 7px; }
.fd-points li::marker { color: var(--model-accent); }
.fd-points strong { color: #121f33; font-weight: 700; }
.fd-no-change { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: #eef1f6; color: #43566f; font-size: .9rem; font-weight: 600; }
.fd-next { display: block; width: 100%; margin: 14px 0 0; padding: 12px; border: 2px dashed var(--model-border); border-radius: 12px; background: white; color: var(--model-strong); font-weight: 700; cursor: pointer; }
.fd-next:hover { background: var(--model-soft); }

/* The summary table. */
.fd-table-wrap { overflow-x: auto; }
.fd-summary { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.fd-summary th, .fd-summary td { padding: 7px 8px; border-bottom: 1px solid #e3e8ef; text-align: right; }
.fd-summary th[scope="row"], .fd-summary thead th:first-child { text-align: left; }
/* Variable column: the symbol typeset like LaTeX, then its name. */
.fd-summary th[scope="row"] { font-weight: 500; white-space: nowrap; }
.fd-symbol { display: inline-block; min-width: 4.6em; margin-right: .5em; color: #121f33; font-size: 1.08rem; }
.fd-name { color: #43566f; }
/* Direction colours, muted: green for up, amber for no change, red for down. */
.fd-change-cell { text-align: center !important; }
.fd-change { display: inline-block; min-width: 6.5em; padding: 2px 10px; border-radius: 999px; font-weight: 600; text-align: center; white-space: nowrap; }
.fd-change.fd-up { background: #e6f4ec; color: #1d6b45; }
.fd-change.fd-flat { background: #fbf0e1; color: #9a5b13; }
.fd-change.fd-down { background: #fbe9e7; color: #a5332a; }
.fd-after { font-weight: 700; }
.fd-after.fd-up { color: #1d6b45; }
.fd-after.fd-flat { color: #9a5b13; }
.fd-after.fd-down { color: #a5332a; }
.fd-summary thead th:nth-child(3) { text-align: center; }
/* "Assumptions and the math": one centred equation per row, with its name above. */
.fd-equations { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 4px 0 14px; padding: 0; list-style: none; }
.fd-equations li { min-width: 0; padding: 6px 0 2px; border-bottom: 1px solid #edf0f5; text-align: center; }
.fd-equation-name { display: block; color: #6b7a90; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.fd-equations .fd-math { font-size: 1.12rem; }

@media (max-width: 1100px) { .fd-step-body { grid-template-columns: 1fr; } .fd-chart { height: 300px; } }
@media (max-width: 600px) { .fd-math { font-size: 1.05rem; } .fd-formulas { padding: 10px 8px 6px; } }
@media (prefers-reduced-motion: reduce) { .fd-choice button { transition: none; } }

/* The four summary tiles: market, its key variable, the change (coloured by direction) and the status. */
.fd-tiles { margin-top: 14px; grid-template-columns: repeat(var(--tiles, 4), minmax(0, 1fr)); }
.fd-tile-variable { margin-top: 2px; color: #7a889b; font-size: .78rem; }
.metric-tile > strong.fd-tile-value { margin-top: 8px; }
.metric-tile > strong.fd-up { color: #1d6b45; }
.metric-tile > strong.fd-flat { color: #9a5b13; }
.metric-tile > strong.fd-down { color: #a5332a; }
@media (max-width: 900px) { .fd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The policy response: its note under the headline, and disabled choices when there is no gap. */
.fd-response-note { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--model-accent); border-radius: 0 8px 8px 0;
    background: var(--model-page); color: #2a3b52; font-size: .9rem; line-height: 1.5; }
.fd-choice button:disabled { opacity: .45; cursor: default; }
