/* FitMyPic identity layer — "photo studio editorial" look.
   Deliberately a different design language from PNGToolbox: warm ivory paper,
   serif display type, one wide reading column, soft cards and figure captions.
   It only retunes tokens and adds editorial components; the tool widgets keep
   working with their existing class names. */

:root {
  --fm-paper: #fbf8f2;
  --fm-paper-2: #f4efe5;
  --fm-ink: #1a1512;
  --fm-body: #453b33;
  --fm-rule: #e6ddcd;
  --fm-rule-strong: #d3c6ae;
  --fm-accent: #a8482a;
  --fm-accent-ink: #8a3a20;
  --fm-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --fm-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --accent: #a8482a;
  --accent-dark: #8a3a20;
  --accent-soft: rgba(168, 72, 42, 0.08);
  --accent-line: rgba(168, 72, 42, 0.28);
  --bg: var(--fm-paper);
  --ink: var(--fm-ink);
  --line: var(--fm-rule);
  --radius: 18px;
  --radius-lg: 22px;
}
:root.dark {
  --fm-paper: #17130f;
  --fm-paper-2: #1e1913;
  --fm-ink: #f2ece3;
  --fm-body: #cdc3b6;
  --fm-rule: #2e2720;
  --fm-rule-strong: #443a2f;
  --fm-accent: #e08a5f;
  --fm-accent-ink: #f0a884;
  --accent: #e08a5f;
  --accent-dark: #f0a884;
  --accent-soft: rgba(224, 138, 95, 0.13);
  --accent-line: rgba(224, 138, 95, 0.38);
  --bg: var(--fm-paper);
  --ink: var(--fm-ink);
  --line: var(--fm-rule);
}

/* ---------- chrome ---------- */
.topbar { border-bottom: 1px solid var(--fm-rule); background: color-mix(in srgb, var(--fm-paper) 90%, transparent); backdrop-filter: saturate(150%) blur(10px); }
.brand span { font-family: var(--fm-serif); font-size: 1.22rem; font-weight: 600; letter-spacing: -0.01em; }
.topbar nav a { font-size: 0.92rem; }
.site-footer { border-top: 1px solid var(--fm-rule); background: var(--fm-paper-2); font-size: 0.9rem; }
.footer-col strong { font-family: var(--fm-serif); font-size: 1rem; color: var(--fm-ink); }

/* ---------- layout ---------- */
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.wrap-narrow { width: min(72ch, 100% - 2.5rem); margin-inline: auto; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 3.5rem; align-items: start; padding-block: 2.5rem 4.5rem; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; gap: 1.5rem; } }

.crumb { font-size: 0.82rem; color: var(--fm-body); opacity: 0.85; padding-top: 1.75rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.crumb a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--fm-rule-strong); }
.crumb a:hover { color: var(--fm-accent); }

.eyebrow { font-family: var(--fm-sans); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fm-accent); margin: 0 0 0.7rem; }
h1.article-title { font-family: var(--fm-serif); font-weight: 600; font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.06; letter-spacing: -0.015em; margin: 0 0 1.1rem; }
.deck { font-family: var(--fm-serif); font-size: clamp(1.1rem, 1.9vw, 1.32rem); line-height: 1.55; color: var(--fm-body); margin: 0 0 1.5rem; max-width: 62ch; }
.authorline { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; font-size: 0.85rem; color: var(--fm-body); opacity: 0.9; border-top: 1px solid var(--fm-rule); padding-top: 0.8rem; margin-bottom: 2.2rem; }
.authorline strong { color: var(--fm-ink); font-weight: 600; }

.prose { font-size: 1.075rem; line-height: 1.78; color: var(--fm-body); }
.prose > * + * { margin-top: 1.08em; }
.prose h2 { font-family: var(--fm-serif); color: var(--fm-ink); font-size: clamp(1.5rem, 2.6vw, 1.9rem); font-weight: 600; letter-spacing: -0.01em; margin-top: 2.5em; scroll-margin-top: 90px; }
.prose h3 { font-family: var(--fm-serif); color: var(--fm-ink); font-size: 1.24rem; margin-top: 1.9em; scroll-margin-top: 90px; }
.prose strong { color: var(--fm-ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose a { color: var(--fm-accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--fm-paper-2); padding: 0.14em 0.4em; border-radius: 6px; color: var(--fm-ink); }
.prose pre { background: var(--fm-ink); color: #f6f1e9; padding: 1.1rem 1.2rem; border-radius: 14px; overflow-x: auto; font-size: 0.86rem; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose blockquote { margin: 2rem 0; padding: 0 0 0 1.4rem; border-left: 3px solid var(--fm-accent); font-family: var(--fm-serif); font-size: 1.2rem; line-height: 1.55; color: var(--fm-ink); }

.rail { position: sticky; top: 90px; font-size: 0.92rem; }
.rail h2 { font-family: var(--fm-sans); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fm-body); opacity: 0.75; margin: 0 0 0.8rem; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li { margin: 0 0 0.1rem; }
.rail a { display: block; padding: 0.34rem 0; color: var(--fm-body); text-decoration: none; border-bottom: 1px dotted transparent; }
.rail a:hover { color: var(--fm-accent); border-bottom-color: var(--fm-rule-strong); }
@media (max-width: 1000px) { .rail { position: static; } .rail ol { display: flex; gap: 0.5rem; overflow-x: auto; } .rail a { white-space: nowrap; border: 1px solid var(--fm-rule); border-radius: 999px; padding: 0.35rem 0.85rem; } }

.keyfacts { background: var(--fm-paper-2); border-radius: var(--radius); padding: 1.3rem 1.5rem; }
.keyfacts h2 { margin: 0 0 0.7rem; font-family: var(--fm-sans); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fm-accent); }
.keyfacts ul { margin: 0; padding-left: 1.2em; }
.keyfacts li { margin-bottom: 0.35rem; }
.callout { border: 1px solid var(--fm-rule); border-radius: var(--radius); padding: 1.15rem 1.4rem; background: color-mix(in srgb, var(--fm-accent) 5%, var(--fm-paper)); }
.callout strong { display: block; margin-bottom: 0.3rem; color: var(--fm-ink); font-family: var(--fm-serif); font-size: 1.05rem; }
.specbox { border: 1px dashed var(--fm-rule-strong); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1.8rem 0; }
.specbox h3 { margin-top: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1.8rem 0; }
.stat { background: var(--fm-paper-2); border-radius: var(--radius); padding: 1.05rem 1.2rem; }
.stat b { display: block; font-family: var(--fm-serif); font-size: 1.75rem; line-height: 1.05; color: var(--fm-accent); }
.stat span { display: block; margin-top: 0.35rem; font-size: 0.85rem; color: var(--fm-body); }

.table-scroll { overflow-x: auto; margin: 1.8rem 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
table.data caption { text-align: left; font-size: 0.84rem; color: var(--fm-body); opacity: 0.85; padding-bottom: 0.55rem; }
table.data th, table.data td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--fm-rule); vertical-align: top; }
table.data thead th { font-family: var(--fm-sans); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fm-body); border-bottom: 1.5px solid var(--fm-rule-strong); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .best { color: var(--fm-accent-ink); font-weight: 700; }

.figure { margin: 2rem 0; }
.figure svg, .figure img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--fm-rule); background: var(--fm-paper); }
.figure figcaption { margin-top: 0.7rem; font-size: 0.88rem; color: var(--fm-body); opacity: 0.9; }

.pill { display: inline-block; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid var(--fm-rule-strong); border-radius: 999px; padding: 0.22rem 0.7rem; color: var(--fm-body); margin: 0 0.35rem 0.35rem 0; }

.cta-band { background: var(--fm-ink); color: #f7f2ea; border-radius: var(--radius-lg); padding: 1.6rem 1.7rem; margin: 2.6rem 0; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0; font-family: var(--fm-serif); font-size: 1.25rem; color: #fff; }
.cta-band p { margin: 0.4rem 0 0; font-size: 0.94rem; color: #d8cfc3; }
.cta-band a.btn { background: var(--fm-accent); color: #fff; padding: 0.75rem 1.3rem; border-radius: 999px; font-weight: 600; text-decoration: none; white-space: nowrap; }

.related { border-top: 1px solid var(--fm-rule); margin-top: 3.2rem; padding-top: 1.6rem; }
.related h2 { font-family: var(--fm-serif); font-size: 1.15rem; margin: 0 0 1.1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.related-grid a { display: block; background: var(--fm-paper-2); border-radius: var(--radius); padding: 1.1rem 1.2rem; text-decoration: none; color: inherit; }
.related-grid a:hover { background: color-mix(in srgb, var(--fm-accent) 8%, var(--fm-paper-2)); }
.related-grid strong { display: block; font-family: var(--fm-serif); font-size: 1.05rem; margin-bottom: 0.3rem; }
.related-grid span { font-size: 0.88rem; color: var(--fm-body); }

.hub-list { display: grid; gap: 1.1rem; }
.hub-item { background: var(--fm-paper-2); border-radius: var(--radius); padding: 1.2rem 1.4rem; display: block; text-decoration: none; color: inherit; }
.hub-item .tag { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fm-accent); }
.hub-item h3 { margin: 0.35rem 0 0.4rem; font-family: var(--fm-serif); font-size: 1.2rem; }
.hub-item p { margin: 0; font-size: 0.95rem; color: var(--fm-body); }
.hub-item:hover { background: color-mix(in srgb, var(--fm-accent) 8%, var(--fm-paper-2)); }

.source-list { font-size: 0.9rem; color: var(--fm-body); }
.meta-note { font-size: 0.86rem; color: var(--fm-body); opacity: 0.8; }

@media print { .rail, .cta-band, .site-footer, .topbar { display: none; } .layout { grid-template-columns: 1fr; } }
/* Overflow guards: see the PNGToolbox layer for the reasoning. */
main { min-width: 0; }
.layout > main { min-width: 0; }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.figure svg { max-width: 100%; }

/* Long unbroken strings (URLs in source lists) must not stretch the column. */
.prose p, .prose li { overflow-wrap: break-word; }
.prose a { overflow-wrap: anywhere; }
