@font-face {
  font-family: "Noto Sans";
  src: url("./fonts/noto-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: url("./fonts/roboto-mono.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

@font-face {
  font-family: "Audiowide";
  src: url("./fonts/audiowide.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* FilamentHound's design system (../filamenthound/STYLE_GUIDE.md), with its values
   raised where they miss WCAG 2.2 AA: text is never under --text-small, grays are dark
   enough to read, and outlines on light grounds use --focus instead of the orange. */
:root {
  color-scheme: light;
  font-family: "Noto Sans", Arial, sans-serif;
  --mono: "Roboto Mono", monospace;
  /* Four text sizes, by role. Reading text never drops below --text-small. */
  --text-display: 1.75rem;
  --text-heading: 1.125rem;
  --text-body: 1rem;
  --text-small: 0.875rem;
  --bg: #eeecea;
  --card: #fff;
  --surface: #f6f4f0;
  --ink: #111;
  --muted: #555;
  --line: #e5e0d8;
  /* Borders of things you operate need 3:1 against the card (WCAG 1.4.11). */
  --control: #8a8580;
  /* The orange is about 2:1 on white, so it is a fill, never an outline, on light grounds. */
  --focus: #a85300;
  --accent: #f90;
  --accent-hover: #e68900;
  --selection: #fff0d9;
  --callout-bg: #fff7eb;
  --callout-line: #f3c27a;
  --warning-bg: #fffbeb;
  --warning-ink: #92400e;
  --warning-line: #fcd34d;
  --danger: #b91c1c;
  /* FilamentHound badge colors. */
  --success-bg: #f0fdf4; --success-ink: #166534; --success-line: #bbf7d0;
  --danger-bg: #fff7ed; --danger-ink: #9a3412; --danger-line: #fed7aa;
  --neutral-bg: #f3f0ea; --neutral-ink: #5c5042; --neutral-line: #e8e0d0;
  --lift: 0 4px 20px rgba(0, 0, 0, 0.1);
  --modal-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  --backdrop: rgba(0, 0, 0, 0.45);
}

:root.dark {
  color-scheme: dark;
  --bg: #111;
  --card: #1e1e1e;
  --surface: #262626;
  --ink: #e8e8e8;
  --muted: #aaa;
  --line: #2e2e2e;
  --control: #777;
  /* On dark grounds the orange itself passes, as on FilamentHound. */
  --focus: #f90;
  --selection: #40301a;
  --callout-bg: #2a2010;
  --callout-line: #5c4413;
  --warning-bg: #2a1f00;
  --warning-ink: #fbbf24;
  --warning-line: #5c4413;
  --danger: #f87171;
  --success-bg: #0f2e1a; --success-ink: #4ade80; --success-line: #1f5130;
  --danger-bg: #2a1000; --danger-ink: #f87171; --danger-line: #5c2410;
  --neutral-bg: #262626; --neutral-ink: #bbb; --neutral-line: #3a3a3a;
  --lift: 0 4px 20px rgba(0, 0, 0, 0.5);
  --modal-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  --backdrop: rgba(0, 0, 0, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-width: 300px; font-size: var(--text-body); line-height: 1.5; }
:root.dark body { letter-spacing: 0.01em; }
::selection { background: var(--accent); color: #111; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.site-header :focus-visible, .promo :focus-visible { outline-color: var(--accent); }
[tabindex="-1"]:focus { outline: none; }
.sr-only, #toast:empty { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin: 0; }
p, li { text-wrap: pretty; }
h1 { font-size: var(--text-display); font-weight: 700; line-height: 1.25; max-width: 30ch; text-wrap: balance; }
h2 { font-size: var(--text-heading); font-weight: 700; line-height: 1.3; text-wrap: balance; }
/* FilamentHound's section titles: small, uppercase, tracked. */
h3 { font-size: var(--text-small); font-weight: 600; line-height: 1.3; letter-spacing: 0.06em; text-transform: uppercase; margin: 22px 0 8px; }

.skip-link { position: fixed; z-index: 5; top: 0; left: 0; padding: 12px 24px; border-radius: 0 0 8px 0; background: var(--accent); color: #111; font-weight: 600; transform: translateY(-110%); }
.skip-link:focus { transform: translateY(0); outline-color: #111; }

/* Header: FilamentHound's black bar, the same in both themes */
.site-header { background: #111; border-bottom: 1px solid #222; color: #fff; }
.header-inner, .shell, .site-footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 var(--text-heading) var(--mono); letter-spacing: -.02em; text-decoration: none; }
.brand img { display: block; border-radius: 4px; }
.brand-block { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 16px; min-width: 0; padding-block: 8px; }
.theme-switch { white-space: nowrap; }
/* The partners' credit, a signature after the wordmark: set off by a hairline, in gray, with each
   name in its own site's logotext. The one place colors outside LayerHound's palette appear. */
.credit { display: flex; align-items: baseline; gap: 0 0.35em; margin: 0; padding-left: 16px; border-left: 1px solid #333;
  color: #999; font-size: var(--text-small); line-height: 1.2; white-space: nowrap; }
.credit a { text-decoration: none; transition: color .12s, filter .12s; }
/* A brightness lift instead of an underline, which fights Audiowide's offset shadow. */
.credit a:hover { filter: brightness(1.25); }
/* FilamentHound's wordmark a step quieter than LayerHound's, so the product name leads. */
.credit-fh { color: #ddd; font-family: var(--mono); font-weight: 700; letter-spacing: -0.02em; }
.credit-fh:hover { color: #fff; }
/* ilovemy3dprinter.com's wordmark: Audiowide, pink with a cyan offset, then white. 15px, the size
   their own wordmark uses; at 14px the offset blurs the thin letters. */
.credit-ilm { color: #f7f2ff; font-family: "Audiowide", var(--mono); font-size: 0.9375rem; }
.ilm-love { color: #ff2d95; text-shadow: 1.5px 1.5px 0 #00e5ff; }
.ilm-heart { width: 0.8em; height: auto; fill: currentColor; filter: drop-shadow(1.5px 1.5px 0 #00e5ff); }
nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px 16px; }
nav .quiet { background: rgba(255, 255, 255, 0.08); color: #eee; border-color: rgba(255, 255, 255, 0.3); }
nav .quiet:not(:disabled):hover { background: rgba(255, 255, 255, 0.14); border-color: var(--accent); color: #fff; }
.theme-switch { display: inline-flex; position: relative; align-items: center; gap: 7px; color: #999; cursor: pointer; font-size: var(--text-small); user-select: none; }
.theme-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { width: 32px; height: 18px; border: 1px solid #888; border-radius: 9px; background: #444; position: relative; flex: none; transition: background .2s, border-color .2s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #999; transition: transform .2s, background .2s; }
.theme-switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.theme-switch input:checked + .switch-track::after { transform: translateX(14px); background: #fff; }
.theme-switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-switch:hover { color: #bbb; }
.theme-switch:hover .switch-track { border-color: #bbb; }

/* Page */
.shell { padding: 20px 0 40px; }
.panel, .intro { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.panel { padding: 20px; }
/* The intro is FilamentHound's explainer card. */
.intro { margin-bottom: 16px; padding: 22px 24px; }
.intro p { max-width: 65ch; margin-top: 8px; color: var(--muted); line-height: 1.6; }
.intro-points { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 14px 0 0; padding: 0; list-style: none; }
.intro-points li { display: flex; align-items: baseline; gap: 8px; }
.intro-points li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; }
.label { color: var(--muted); font-size: var(--text-small); font-variant-numeric: tabular-nums; }

/* Printer choice */
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 10px; font-weight: 700; }
.printers { display: grid; gap: 18px; }
.printer-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* Printer brands read like FilamentHound's brand labels on its cards. */
.printer-vendor { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--text-small); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.printer-vendor::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.printer { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .12s, box-shadow .15s; }
.printer:hover { border-color: var(--control); box-shadow: var(--lift); }
.printer:has(input:checked) { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); background: var(--selection); }
.printer input { flex: none; width: 14px; height: 14px; margin: 3px 0 0; accent-color: var(--accent); }
.printer span { display: grid; gap: 1px; min-width: 0; }
.printer b { font-weight: 600; line-height: 1.3; overflow-wrap: break-word; }
.printer small { color: var(--muted); font-size: var(--text-small); line-height: 1.3; }

/* Upload */
/* The page's task, at the system's full strength: FilamentHound's color band in the one brand
   color across the top of the card, and the heading at the display size. */
.converter { position: relative; overflow: hidden; padding-top: 26px; }
.converter .color-band span { background: var(--accent); }
.converter .section-head { margin-bottom: 18px; }
.converter h2 { font-size: var(--text-display); line-height: 1.2; }
/* A drop target that reads as one: a large dashed well with the main button at body size. */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 9rem; margin-top: 20px; padding: 24px 16px; border: 2px dashed var(--control); border-radius: 12px; background: var(--surface); color: var(--muted); text-align: center; transition: border-color .12s, background .12s; }
.drop:hover, .drop.dragging { border-color: var(--focus); }
.drop.dragging { border-style: solid; background: var(--selection); }
.drop .primary { flex: none; padding: 12px 24px; font-size: var(--text-body); white-space: nowrap; }
.drop:hover .primary, .drop.dragging .primary { background: var(--accent-hover); border-color: var(--accent-hover); }
.helper { margin-top: 8px; min-height: 1.5em; color: var(--muted); font-size: var(--text-small); }
/* Files are waiting on a printer choice: stronger by weight and an edge, not color alone. */
.helper.attention { padding: 8px 12px; border: 1px solid var(--warning-line); border-radius: 8px; background: var(--warning-bg); color: var(--warning-ink); font-weight: 600; }

/* Side guide */
.guide { line-height: 1.55; }
.guide h2 { margin-bottom: 6px; }
.open-project { padding: 16px 18px; border: 1px solid var(--callout-line); border-radius: 8px; background: var(--callout-bg); }
.guide .open-project p { color: var(--ink); }
kbd { padding: 1px 6px; border: 1px solid var(--control); border-radius: 4px; background: var(--card); color: var(--ink); font: 600 0.875em var(--mono); white-space: nowrap; }
.open-hint { margin-top: 4px; }
.guide p { color: var(--muted); }
.guide strong { color: var(--ink); }
.guide .fine { margin-top: 10px; }
.guide .promo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin-top: 18px; padding: 16px 18px; border: 1px solid #333; border-radius: 8px; background: #111; color: #fff; font-weight: 700; line-height: 1.35; }
.promo a { flex: none; padding: 8px 14px; border-radius: 7px; background: var(--accent); color: #111; font-weight: 600; text-decoration: none; transition: background .12s; }
.promo a:hover { background: var(--accent-hover); }
.promo .promo-note { flex-basis: 100%; color: #ccc; font-size: var(--text-small); font-weight: 400; line-height: 1.5; }

/* Buttons: FilamentHound's primary and secondary */
.quiet, .primary, .link-button { display: inline-block; padding: 8px 14px; font-size: var(--text-small); font-weight: 600; line-height: 1.2; }
.quiet { background: var(--card); border: 1px solid var(--control); border-radius: 6px; color: var(--ink); transition: border-color .12s, color .12s; }
.quiet:not(:disabled):hover { border-color: var(--focus); }
.primary { background: var(--accent); border: 1px solid var(--accent); border-radius: 7px; color: #111; transition: background .12s, border-color .12s; }
.primary:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.link-button { background: none; border: 0; padding-inline: 3px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Results */
.results { margin-top: 24px; }
.results-heading { margin-bottom: 10px; }
.result { position: relative; overflow: hidden; padding: 16px 18px; margin-bottom: 10px; }
/* FilamentHound's color band: the file's own filament colors across the top of its card. */
.color-band { position: absolute; inset: 0 0 auto; display: flex; height: 6px; box-shadow: inset 0 -1px 0 var(--line); }
.color-band span { flex: 1; }
.result:has(.color-band) { padding-top: 22px; }
.result-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 3px; }
/* FilamentHound's badge, at a readable size. */
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border: 1px solid; border-radius: 4px; font-size: var(--text-small); font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success-ink); border-color: var(--success-line); }
.badge-warning { background: var(--warning-bg); color: var(--warning-ink); border-color: var(--warning-line); }
.badge-danger { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-line); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-ink); border-color: var(--neutral-line); }
/* FilamentHound's color pills: which filament goes in which slot. */
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.slot-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 6px; border: 1px solid var(--line); border-radius: 20px; font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.result-top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.result .result-name { min-width: 0; font: 600 var(--text-small)/1.5 var(--mono); overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.fine, .result p { font-size: var(--text-small); line-height: 1.5; }
[data-progress] { font-variant-numeric: tabular-nums; }
.result progress { width: 100%; height: 4px; accent-color: var(--accent); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.result details { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-size: var(--text-small); font-weight: 600; }
/* FilamentHound's warning badge, as a block. */
.notice { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--warning-line); border-radius: 8px; background: var(--warning-bg); color: var(--warning-ink); font-size: var(--text-small); line-height: 1.5; }
.notice ul { padding-left: 17px; margin: 0; }
.error { color: var(--danger); }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.table th { color: var(--muted); font-weight: 600; overflow-wrap: normal; white-space: nowrap; }
.table td { max-width: 260px; }
.filament-line { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 9px; font: 400 var(--text-small)/1.5 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.result-tools, .fields { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.result-tools label, .fields label { display: grid; gap: 4px; font-size: var(--text-small); font-weight: 600; }
select, input:not([type="radio"]):not([type="checkbox"]):not([type="color"]):not([type="file"]) { min-width: 0; border: 1px solid var(--control); border-radius: 6px; padding: 7px 10px; background: var(--card); color: var(--ink); }
input[type="color"] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--control); border-radius: 6px; background: var(--card); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 18px; padding: 16px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-small); }
/* The partners' wordmarks in the footer, which follows the theme instead of sitting on the dark
   header: the white parts take the page's ink, and the pink darkens to keep 4.5:1 on light pages. */
.footer-credit { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.35em; }
.footer-credit a { text-decoration: none; }
.footer-credit a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-credit .credit-fh, .footer-credit .credit-ilm { color: var(--ink); }
.footer-credit .credit-ilm { font-size: 0.9375rem; }
.footer-credit .ilm-love { color: #c2006a; }
:root.dark .footer-credit .ilm-love { color: #ff2d95; }

/* Settings review: FilamentHound's modal */
dialog { width: min(640px, calc(100% - 28px)); max-height: 86vh; padding: 24px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--modal-shadow); }
dialog::backdrop { background: var(--backdrop); }
#review-form { display: grid; gap: 14px; }
#review-form > p { margin-top: -6px; }
.choice { display: grid; gap: 8px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.choice legend { padding: 0 4px; font-weight: 600; }
.choice label { display: flex; align-items: center; gap: 8px; min-height: 24px; cursor: pointer; }
.choice input { margin: 0; accent-color: var(--accent); }
#review-form .actions { justify-content: flex-end; }
.choice .option-hint { margin: -4px 0 4px 26px; }
.merge-slots { display: grid; gap: 6px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
/* Off while "Pause and swap" is chosen: dashed and muted, but still readable. */
.merge-slots[disabled] { border-style: dashed; color: var(--muted); }
.merge-slots legend { padding: 0 4px; font-size: var(--text-small); font-weight: 600; }
.choice .slot-row { justify-content: space-between; flex-wrap: wrap; cursor: default; }
.slot-row span { display: inline-flex; align-items: center; gap: 8px; }
.slot-row select { min-width: 7rem; }
.swatch { display: inline-block; width: 1rem; height: 1rem; border: 1px solid var(--control); border-radius: 50%; forced-color-adjust: none; }
.filament-notes { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: var(--text-small); line-height: 1.5; }

/* Toast */
#toast { position: fixed; z-index: 4; right: 16px; bottom: 16px; max-width: min(380px, calc(100% - 32px)); padding: 12px 16px; border: 1px solid #333; border-radius: 8px; background: #1a1a1a; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }

/* Windows high contrast and other forced-color modes drop backgrounds, which is all
   the switch and the selected printer card use to show their state. */
@media (forced-colors: active) {
  .switch-track, .printer { border-color: CanvasText; }
  .switch-track::after { background: CanvasText; }
  .theme-switch input:checked + .switch-track { background: Highlight; border-color: Highlight; }
  .theme-switch input:checked + .switch-track::after { background: HighlightText; }
  .printer:has(input:checked) { border: 2px solid Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  /* On a phone the printer choice has to start within the first screen: a smaller title, and the
     two summary bullets give way since the paragraph already says the same. */
  :root { --text-display: 1.5rem; }
  .intro-points { display: none; }
  .header-inner, .shell, .site-footer { width: calc(100% - 32px); }
  .shell { padding-top: 16px; }
  .panel { padding: 16px; }
  .intro { padding: 16px; margin-bottom: 12px; }
  .intro p { line-height: 1.5; }
  .printer-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand { font-size: var(--text-body); gap: 6px; }
  /* The credit takes its own line under the wordmark and switch instead of squeezing them. */
  .header-inner { flex-wrap: wrap; row-gap: 0; }
  .brand-block { display: contents; }
  .brand { min-height: 48px; }
  .credit { order: 3; flex-basis: 100%; padding: 0 0 10px; border-left: 0; }
  .brand img { width: 24px; height: 24px; }
  nav { gap: 7px 10px; }
  nav .quiet { padding: 6px 10px; }
}

/* Two printer cards per row leave too little room for "Adventurer" at body size. */
@media (max-width: 400px) {
  .printer b { font-size: var(--text-small); }
  /* The credit stays one line down to 300px: it scales with the screen, never below 12px, and
     never wraps the partner logo onto a line of its own. */
  .credit { font-size: clamp(0.75rem, 3.6vw, 0.875rem); }
  .credit-ilm { font-size: 1.07em; }
}

@media (max-width: 355px) {
  .theme-switch > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
