/* PDF to Excel: one stylesheet for every page of the tool.
   Loaded after /assets/brand.css, whose --mib-* tokens it maps onto its own variables.
   Shared parts (header, footer, buttons, articles, FAQ) are the same as the QR tool's so
   the three tools look alike; this tool's accent is spreadsheet green (--mib-xls).
   Light and dark follow prefers-color-scheme. */

:root {
  --bg: var(--mib-bg);
  --surface: var(--mib-surface);
  --surface-2: var(--mib-surface-2);
  --text: var(--mib-ink);
  --text-soft: var(--mib-ink-soft);
  --muted: var(--mib-muted);
  --border: var(--mib-line);
  --border-strong: #c3c8dd;
  --accent: var(--mib-xls-strong);   /* #15803d: 5:1 on white, text-safe */
  --accent-bright: var(--mib-xls);   /* #16a34a: dots, icons, fills */
  --accent-hover: #166534;
  --accent-ink: var(--mib-xls-ink);  /* #166534: text on --accent-soft (6.4:1) */
  --accent-soft: var(--mib-xls-soft);
  --accent-grad: linear-gradient(135deg, #15803d 0%, #166534 52%, #3f37c9 100%);
  --on-accent: #ffffff;
  --ok: #1d7340;
  --ok-soft: #e5f4ea;
  --warn: #8a5300;
  --warn-soft: #fff3d9;
  --error: #b3261e;
  --error-soft: #fdeceb;
  --date-ink: #3f37c9;               /* dates in the preview grid (7.6:1 on white) */
  --grid-line: #d9dde9;
  --grid-head: #f1f3f9;
  --grid-select: #15803d;
  --pdf-red: #dc2626;
  --focus: var(--mib-focus);
  --paper: #ffffff;
  --text-gradient: linear-gradient(100deg, #15803d 0%, #3f37c9 62%, #7c3aed 100%); /* 3:1+ for large text */
  --radius: var(--mib-radius);
  --radius-sm: var(--mib-radius-sm);
  --radius-lg: var(--mib-radius-lg);
  --shadow: var(--mib-shadow-sm);
  --font: var(--mib-font-body);
  --font-head: var(--mib-font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 66px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --border-strong: #3d4672;
    --accent: var(--mib-xls);
    --accent-bright: var(--mib-xls);
    --accent-hover: var(--mib-xls-strong);
    --accent-ink: var(--mib-xls-ink);
    --accent-grad: linear-gradient(135deg, #4ade80 0%, #86efac 50%, #a5b4fc 100%);
    --on-accent: #052e16;
    --ok: #74d593;
    --ok-soft: #122e1c;
    --warn: #f2bd57;
    --warn-soft: #33270e;
    --error: #ff8f86;
    --error-soft: #3b1714;
    --date-ink: #b4bbff;
    --grid-line: #2f365c;
    --grid-head: #1b2140;
    --grid-select: #4ade80;
    --paper: #e9ebf7;
    --text-gradient: linear-gradient(100deg, #4ade80 0%, #a5b4fc 60%, #c4b5fd 100%);
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; } /* 6.3:1 or more on every surface */
a:hover { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; overflow-wrap: anywhere; border: 1px solid var(--border); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.015em; font-weight: 800; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--mib-ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus); }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px 18px; border-radius: 12px;
  background: var(--mib-ink); color: var(--mib-bg); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--mib-bg); }
.mib-gradient-text { background-image: var(--text-gradient); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.block { display: block; margin-top: 4px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------------ header (matches the hub) */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--mib-glass);
  -webkit-backdrop-filter: saturate(1.8) blur(14px);
  backdrop-filter: saturate(1.8) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--mib-line) 80%, transparent);
}
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-family: var(--mib-font); font-weight: 800; font-size: 1.14rem; letter-spacing: -0.02em;
  color: var(--mib-ink); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--mib-ink); }
.brand-mark {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #0ea5a4 100%);
  box-shadow: 0 8px 18px -8px rgba(79, 70, 229, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.4s var(--mib-ease-spring);
}
.brand-mark svg { display: block; overflow: visible; }
.brand-mark .mark-back { transform-box: fill-box; transform-origin: center; transition: transform 0.4s var(--mib-ease-spring); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand:hover .mark-back { transform: translate(2px, -2px) rotate(8deg); }
.site-nav, .nav-more { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; color: var(--mib-ink-soft); text-decoration: none;
  font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.site-nav a:hover { background: var(--mib-surface-2); color: var(--mib-ink); }
.site-nav a[aria-current="page"] { color: var(--mib-ink); background: var(--mib-surface-2); }
.nav-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--mib-pdf); box-shadow: 0 0 0 3px var(--mib-pdf-soft); }
.nav-dot-qr { background: var(--mib-qr); box-shadow: 0 0 0 3px var(--mib-qr-soft); }
.nav-dot-xls { background: var(--mib-xls); box-shadow: 0 0 0 3px var(--mib-xls-soft); }
@media (min-width: 980px) and (max-width: 1100px) { .site-nav a { padding: 0 10px; font-size: 0.92rem; } }
.nav-toggle {
  display: none; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 14px; justify-content: center;
  border-radius: 999px; font: inherit; font-weight: 700; font-size: 0.95rem; color: var(--mib-ink);
  background: var(--mib-surface-2); border: 0; cursor: pointer;
}
.nav-toggle[aria-expanded="true"] { background: var(--mib-line); }

/* Below 980px this tool's own pages sit behind "Menu"; the other tools stay one tap away, with
   their full names wherever they fit (all but small phones). */
@media (max-width: 979px) {
  .has-nav-toggle .nav-toggle { display: inline-flex; }
  .has-nav-toggle .nav-more {
    position: absolute; right: 0; top: calc(100% + 6px); width: min(280px, calc(100vw - 2 * var(--gutter)));
    display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px;
    background: var(--mib-surface); border: 1px solid var(--mib-line); border-radius: var(--mib-radius); box-shadow: var(--mib-shadow-lg);
  }
  .has-nav-toggle .nav-more.is-open { display: flex; animation: nav-drop 0.3s var(--mib-ease) both; }
  .has-nav-toggle .nav-more a { border-radius: 12px; min-height: 48px; font-size: 1rem; }
  html:not(.has-nav-toggle) .header-inner { flex-wrap: wrap; padding-block: 8px; }
  html:not(.has-nav-toggle) .site-nav, html:not(.has-nav-toggle) .nav-more { flex-wrap: wrap; }
}
@media (max-width: 540px) {
  .nav-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-nav > a { padding: 0 12px; }
}
@media (max-width: 420px) {
  .nav-toggle { padding: 0; width: 44px; }
  .nav-toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 360px) { .brand { font-size: 1.02rem; gap: 8px; } .site-nav > a { padding: 0 10px; } }
/* Three tools in the header: on small phones the other tools' links drop their colour dot
   and some padding so everything fits beside the logo; the targets stay at least 44px wide. */
@media (max-width: 440px) {
  .site-nav > a .nav-dot { display: none; }
  .site-nav > a { padding: 0 10px; min-width: 44px; justify-content: center; }
}
@media (max-width: 360px) { .header-inner { gap: 8px; } .site-nav > a { padding: 0 6px; min-width: 44px; font-size: 0.9rem; } }
@keyframes nav-drop { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700;
  min-height: 44px; padding: 8px 18px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; position: relative;
  transition: transform 0.25s var(--mib-ease), box-shadow 0.25s var(--mib-ease), border-color 0.2s, background-color 0.2s;
}
.btn:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--mib-shadow-sm); color: var(--text); }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(0); }
.btn-small { min-height: 44px; padding: 6px 14px; font-size: 0.9rem; border-radius: 10px; }
.btn-primary {
  background: var(--accent-grad); border: 0; color: var(--on-accent); padding: 12px 26px; font-size: 1.05rem;
  min-height: 52px; border-radius: 14px; overflow: hidden; isolation: isolate;
  box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.32) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.8s var(--mib-ease);
}
.btn-primary:hover:not(:disabled):not([aria-disabled="true"]) { color: var(--on-accent); box-shadow: 0 16px 32px -12px color-mix(in srgb, var(--accent) 90%, transparent); border: 0; }
.btn-primary:hover:not(:disabled):not([aria-disabled="true"])::after { transform: translateX(120%); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
/* Busy (aria-disabled keeps the button focusable while a file is written). */
.btn[aria-disabled="true"] { opacity: 0.45; cursor: progress; box-shadow: none; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); padding-left: 4px; }
.btn-ghost:hover:not(:disabled) { box-shadow: none; border-color: transparent; color: var(--accent-hover); }
.btn-link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-link:hover { color: var(--accent-hover); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.icon-btn { font-size: 1.6rem; line-height: 1; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text); cursor: pointer; border-radius: 12px; }
.icon-btn:hover { background: var(--surface-2); }

/* Call-to-action links used on the pages (not inside the tool). */
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 24px;
  border-radius: 14px; font-weight: 700; font-size: 1.02rem; text-decoration: none; position: relative; overflow: hidden; isolation: isolate;
  transition: transform 0.25s var(--mib-ease), box-shadow 0.25s var(--mib-ease), border-color 0.2s;
}
.cta-primary { background: var(--accent-grad); color: var(--on-accent); box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--accent) 85%, transparent); }
.cta-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.32) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.8s var(--mib-ease);
}
.cta-primary:hover { color: var(--on-accent); transform: translateY(-2px); box-shadow: 0 18px 36px -14px color-mix(in srgb, var(--accent) 95%, transparent); }
.cta-primary:hover::after { transform: translateX(120%); }
.cta-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--mib-shadow-sm); }
.cta-secondary:hover { color: var(--text); transform: translateY(-2px); border-color: var(--accent); }
.cta svg { flex: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.cta:hover .nudge { animation: nudge 0.7s var(--mib-ease) infinite alternate; }
@keyframes nudge { to { transform: translateY(3px); } }

/* ------------------------------------------------------------------ hero */
.hero { display: grid; gap: 28px; align-items: center; padding: 32px 0 8px; }
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 44px; padding: 52px 0 24px; }
}
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.3rem); letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 0.4em; }
.hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.18rem); color: var(--text-soft); max-width: 58ch; }
.hero-copy { min-width: 0; }
.hero-copy > * { animation: mib-rise 0.8s var(--mib-ease) both; }
.hero-copy > :nth-child(2) { animation-delay: 0.06s; }
.hero-copy > :nth-child(3) { animation-delay: 0.12s; }
.hero-copy > :nth-child(4) { animation-delay: 0.18s; }
.hero-copy > :nth-child(5) { animation-delay: 0.24s; }
.hero-copy > :nth-child(6) { animation-delay: 0.3s; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; }
.pills li {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px 6px 8px; border-radius: 999px; font-size: 0.875rem; font-weight: 700;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--mib-shadow-sm);
}
.pills li::before {
  content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 13px no-repeat;
}
@media (prefers-color-scheme: dark) {
  .pills li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386efac' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E"); }
}
.crumbs { font-size: 0.9rem; color: var(--text-soft); margin: 0 0 14px; }
.crumbs a { color: var(--text-soft); font-weight: 700; }
.crumbs a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ tool: shell */
.tool { margin: 20px auto 0; scroll-margin-top: calc(var(--header-h) + 12px); }
.tool-loading {
  padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--border); color: var(--text-soft); min-height: 240px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 200% 100%;
  animation: mib-shimmer 1.6s linear infinite;
}
.tool-inner { display: grid; gap: 22px; }

/* stepper */
.stepper {
  position: relative; z-index: 20; padding: 12px 8px 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); box-shadow: var(--mib-shadow-sm);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  --fill: 0;
}
@media (min-width: 1080px) {
  .stepper { position: sticky; top: calc(var(--header-h) + 10px); }
  /* keep focused controls clear of the sticky header and stepper */
  html { scroll-padding-top: calc(var(--header-h) + 112px); }
}
.stepper-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; z-index: 1; }
.stepper-link {
  display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 58px; padding: 2px 2px 4px; border-radius: 14px;
  text-decoration: none; color: var(--muted); font-size: 0.76rem; font-weight: 700; text-align: center; line-height: 1.2;
}
@media (min-width: 560px) { .stepper-link { font-size: 0.86rem; } }
.stepper-link:hover { color: var(--text); }
.stepper-num {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-soft); font-weight: 800; font-size: 0.92rem;
  transition: background 0.35s var(--mib-ease), border-color 0.35s, color 0.35s, transform 0.35s var(--mib-ease-spring), box-shadow 0.35s;
}
.stepper-n { transition: opacity 0.2s; }
.stepper-num svg { position: absolute; opacity: 0; transform: scale(0.4); transition: opacity 0.3s, transform 0.45s var(--mib-ease-spring); }
.stepper-link:hover .stepper-num { transform: translateY(-2px); }
.stepper-item.is-current .stepper-link { color: var(--text); }
.stepper-item.is-current .stepper-num { border-color: var(--accent-bright); color: var(--accent-ink); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-bright) 18%, transparent); }
.stepper-item.is-done .stepper-num { background: var(--accent-grad); border-color: transparent; color: var(--on-accent); }
.stepper-item.is-done .stepper-n { opacity: 0; }
.stepper-item.is-done .stepper-num svg { opacity: 1; transform: none; }
.stepper-track { position: absolute; left: 10%; right: 10%; top: 28px; height: 3px; border-radius: 3px; background: var(--border); }
.stepper-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--fill)); background: var(--accent-grad); border-radius: inherit; transition: transform 0.6s var(--mib-ease); }

/* layout: the four steps, one under another */
.tool-layout { display: grid; gap: 28px; align-items: start; }

/* steps */
.step {
  --pad: 16px;
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px var(--pad) 22px; box-shadow: var(--mib-shadow); min-width: 0;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
@media (min-width: 700px) { .step { --pad: 28px; padding: 26px var(--pad) 28px; } }
@media (min-width: 1080px) { .step { scroll-margin-top: calc(var(--header-h) + 100px); } }
.tool-layout > .step:not(:last-of-type)::after {
  content: ""; position: absolute; left: calc(var(--pad) + 19px); top: calc(100% + 1px); width: 2px; height: 26px;
  background: linear-gradient(var(--accent-bright), var(--mib-brand)); opacity: 0.35; border-radius: 2px;
}
.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.step-head h2 { margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.4rem); }
.step-sub { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
.step-num {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-grad); color: var(--on-accent);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 90%, transparent);
}
.step.is-done .step-num { color: transparent; }
.step.is-done .step-num::after {
  content: ""; position: absolute; inset: 0; background: var(--on-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 20px no-repeat;
  animation: mib-pop 0.5s var(--mib-ease-spring) both;
}

/* ------------------------------------------------------------------ tool: fields */
.field { margin: 0 0 16px; min-width: 0; }
.field > label, .label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.unit { font-weight: 500; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.875rem; margin: 6px 0 0; }
.inline-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-field > label { margin: 0; }
.inline-field select { width: auto; min-width: 12rem; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 13px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
select { cursor: pointer; }
textarea { min-height: 100px; resize: vertical; line-height: 1.45; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 0.9rem; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--mib-ink); outline-offset: 0; border-color: var(--mib-ink);
  box-shadow: 0 0 0 5px var(--focus);
}
[aria-invalid="true"] { border-color: var(--error) !important; box-shadow: 0 0 0 1px var(--error); }
select:disabled, input:disabled { opacity: 0.6; }

.tpl-row { display: flex; gap: 6px; }
.tpl-row .tpl { flex: 1 1 auto; min-width: 0; }
.tpl-row .insert-col {
  flex: 0 0 auto; width: auto; max-width: 9.5rem; font-size: 0.875rem; font-weight: 700; color: var(--accent-ink);
  background: var(--accent-soft); border-color: transparent;
}
.tpl-row .insert-col:disabled { color: var(--muted); background: var(--surface-2); }

.check, .radio { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; cursor: pointer; min-height: 28px; }
.check input, .radio input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
fieldset { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; font-size: 0.95rem; }
.radios-inline .radio, .checks-inline .check { margin: 6px 0; }

.grid-2, .grid-3 { display: grid; gap: 0 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* tabs */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 16px; max-width: 100%; }
.tabs [role="tab"] {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 0.95rem; font-weight: 700; border: 0; background: transparent;
  color: var(--muted); padding: 8px 16px; border-radius: 12px; cursor: pointer; min-height: 44px; transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.tabs [role="tab"] svg { flex: none; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: var(--mib-shadow-sm), 0 0 0 1px var(--border); }
@media (max-width: 460px) { .tabs { display: flex; } .tabs [role="tab"] { flex: 1 1 auto; justify-content: center; padding: 8px 10px; font-size: 0.9rem; } }

/* dropzone */
.dropzone { position: relative; margin-bottom: 12px; }
.dropzone-label {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 200px; padding: 28px 20px; border-radius: 20px; cursor: pointer; color: var(--text);
  background: radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 70%), var(--surface-2);
  transition: background-color 0.3s, transform 0.3s var(--mib-ease), box-shadow 0.3s;
}
.drop-border { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; border-radius: 20px; pointer-events: none; }
.drop-border rect { fill: none; stroke: var(--border-strong); stroke-width: 4; stroke-dasharray: 10 9; animation: a-march 3s linear infinite; transition: stroke 0.3s; }
.drop-icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 20px; color: var(--on-accent);
  background: var(--accent-grad); box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--accent) 90%, transparent);
  animation: drop-bob 2.6s var(--mib-ease) infinite;
}
@keyframes drop-bob { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-9px); } 60% { transform: translateY(-7px); } }
.dropzone-label:hover, .dropzone.is-dragover .dropzone-label { box-shadow: 0 16px 36px -18px color-mix(in srgb, var(--accent) 70%, transparent); }
.dropzone-label:hover .drop-border rect, .dropzone.is-dragover .drop-border rect { stroke: var(--accent-bright); animation-duration: 0.8s; }
.dropzone.is-dragover .dropzone-label { transform: scale(1.015); background: radial-gradient(120% 100% at 50% 0%, var(--accent-soft), transparent 80%), var(--accent-soft); }
.dropzone.is-dragover .drop-icon { animation-duration: 0.9s; }
.dropzone input:focus-visible + .dropzone-label { outline: 2px solid var(--mib-ink); outline-offset: 3px; box-shadow: 0 0 0 7px var(--focus); }
.dropzone-label strong { font-size: 1.05rem; }
.linkish { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.data-status .btn-link { color: var(--accent-ink); }

.data-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); animation: mib-fade 0.4s both;
}
.data-status > span { min-width: 0; }
.data-status .btn { margin-left: 4px; border-radius: 999px; border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent-ink); background: var(--surface); }
.data-status .btn::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.2 6.3L20.5 10l-6.3 2.2L12 18.5l-2.2-6.3L3.5 10l6.3-1.7zM19 15l.9 2.4 2.1.6-2.1.8L19 21l-.9-2.2-2.1-.8 2.1-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.2 6.3L20.5 10l-6.3 2.2L12 18.5l-2.2-6.3L3.5 10l6.3-1.7zM19 15l.9 2.4 2.1.6-2.1.8L19 21l-.9-2.2-2.1-.8 2.1-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.data-status.is-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); flex-wrap: nowrap; align-items: flex-start; }
.data-status.is-ok::before {
  content: ""; width: 24px; height: 24px; flex: none; border-radius: 50%; margin-right: 4px;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 15px no-repeat;
  animation: mib-pop 0.5s var(--mib-ease-spring) both;
}
@media (prefers-color-scheme: dark) {
  .data-status.is-ok::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23122e1c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E"); }
}
.data-status.is-warn { background: var(--warn-soft); }
.data-status.is-error { background: var(--error-soft); color: var(--error); }
.data-status.is-busy::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--muted); font-size: 0.875rem; }
.privacy-note svg { color: var(--accent); flex: none; }


/* notices & badges */
.notice { padding: 11px 14px; border-radius: 14px; border: 1px solid var(--border); border-left: 4px solid var(--border-strong); background: var(--surface-2); margin: 10px 0; font-size: 0.925rem; animation: mib-fade 0.35s both; }
.notice p { margin: 0 0 4px; }
.notice p:last-child { margin: 0; }
.notice-ok { border-left-color: var(--ok); background: var(--ok-soft); }
.notice-info { border-left-color: var(--accent); }
.notice-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice-error { border-left-color: var(--error); background: var(--error-soft); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-error { background: var(--error-soft); color: var(--error); }
.badge-muted { background: var(--surface-2); color: var(--muted); }


/* download step */
.custom-grid { border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px 0; background: var(--surface-2); margin-bottom: 16px; }
.custom-grid legend { padding: 0 6px; background: var(--surface); border-radius: 8px; }
.download-row { margin-top: 14px; }
.progress { position: relative; margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; animation: mib-fade 0.3s both; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress progress {
  flex: 1; height: 12px; -webkit-appearance: none; appearance: none; border: 0; border-radius: 999px; overflow: hidden;
  background: var(--border); accent-color: var(--accent);
}
.progress progress::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
.progress progress::-webkit-progress-value { background: var(--accent-grad); border-radius: 999px; transition: width 0.3s var(--mib-ease); }
.progress progress::-moz-progress-bar { background: var(--accent-grad); border-radius: 999px; }
.tool.is-busy .progress progress::-webkit-progress-value {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%) 0 0 / 200% 100%, var(--accent-grad);
  animation: mib-shimmer 1.2s linear infinite;
}
.tool.is-busy .progress::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, color-mix(in srgb, var(--accent-bright) 14%, transparent) 50%, transparent 65%) 0 0 / 200% 100%;
  animation: mib-shimmer 1.6s linear infinite;
}
#progress-text { margin: 8px 0 0; font-weight: 600; }
#progress-text.is-error { color: var(--error); }
.progress.is-done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); padding-left: 68px; min-height: 70px; display: flex; flex-direction: column; justify-content: center; animation: done-pop 0.6s var(--mib-ease-spring) both; }
.progress.is-done #progress-text { margin: 0; }
.progress.is-done::before {
  content: ""; position: absolute; left: 16px; top: 50%; width: 38px; height: 38px; margin-top: -19px; border-radius: 50%;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 20%, transparent);
  animation: mib-pop 0.6s var(--mib-ease-spring) 0.1s both;
}
@media (prefers-color-scheme: dark) {
  .progress.is-done::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23122e1c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E"); }
}
.progress.is-done::after {
  content: ""; position: absolute; left: 35px; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 -30px 0 #f59e0b, 26px -16px 0 #4f46e5, 30px 12px 0 #0d9488, 0 30px 0 #ec4899, -26px 16px 0 #22c55e, -28px -14px 0 #7c3aed;
  animation: confetti 0.9s var(--mib-ease) 0.15s both;
}
@keyframes confetti { 0% { opacity: 1; transform: scale(0.2); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes done-pop { 0% { transform: scale(0.98); } 50% { transform: scale(1.01); } 100% { transform: none; } }
.progress.is-done .progress-row { display: none; }
.reset-line { margin-top: 16px; }
.reset-line .btn-link, .data-status .btn-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }


/* ------------------------------------------------------------------ content (articles below the tool, landing pages) */
.content { max-width: 1100px; margin: 0 auto; }
.content > section { margin-top: 80px; }
.content h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); margin-top: 0; }
.content section > h2::before, .content .split h2::before {
  content: ""; display: block; width: 44px; height: 5px; margin-bottom: 14px; border-radius: 5px; background: var(--mib-gradient);
}
.content h3 { font-size: 1.12rem; margin-top: 1.4em; }
.content section > p, .content section > h2, .content section > h3, .content section > ul:not([class]), .content section > ol:not([class]),
.content section > details, .content section > .callout { max-width: 760px; }
/* Wide screens: text sections get a sticky heading on the left and the copy on the right.
   Sections built around a full-width grid, table or picture keep the stacked layout. */
@media (min-width: 1000px) {
  .content > section:not(.cta-band):not(:has(> .cards-4, > .steps-list, > table, > .split)) {
    display: grid; grid-template-columns: minmax(0, 290px) minmax(0, 1fr); column-gap: 56px; align-items: start;
  }
  .content > section:not(.cta-band):not(:has(> .cards-4, > .steps-list, > table, > .split)) > * { grid-column: 2; }
  .content > section:not(.cta-band):not(:has(> .cards-4, > .steps-list, > table, > .split)) > h2 {
    grid-column: 1; grid-row: 1 / span 30; position: sticky; top: calc(var(--header-h) + 28px); font-size: clamp(1.5rem, 2.3vw, 1.9rem);
  }
  .content > section:not(.cta-band):not(:has(> .cards-4, > .steps-list, > table, > .split)) > .feature-list { margin-top: 4px; }
  .content > section.faq:not(:has(> .cards-4)) > details { max-width: none; }
}
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: 0.45em; }
.content ul:not([class]) li::marker { color: var(--accent-bright); }
.content ol:not([class]) li::marker { color: var(--accent); font-weight: 800; }
.content table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 14px 0 22px; font-size: 0.93rem; display: block; overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--mib-shadow-sm); }
.content th, .content td { border-bottom: 1px solid var(--border); padding: 11px 14px; text-align: left; vertical-align: top; }
.content th { background: var(--surface-2); font-family: var(--font-head); font-weight: 800; white-space: nowrap; }
.content tbody tr:last-child td { border-bottom: 0; }
.content tbody tr:hover td { background: var(--accent-soft); }

/* numbered step tiles */
.steps-list { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: 16px; margin: 22px 0 0; position: relative; }
@media (min-width: 900px) {
  .steps-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .steps-list.steps-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-list:not(.steps-4)::before { content: ""; position: absolute; top: 42px; left: 14%; right: 14%; height: 2px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 8px, transparent 8px 14px); }
}
@media (min-width: 1100px) { .steps-list.steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps-list li {
  counter-increment: s; position: relative; padding: 76px 20px 22px; margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--mib-shadow); transition: transform 0.35s var(--mib-ease), box-shadow 0.35s var(--mib-ease);
}
.steps-list li:hover { transform: translateY(-4px); box-shadow: var(--mib-shadow-lg); }
.steps-list li::before {
  content: counter(s); position: absolute; left: 20px; top: 20px; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-grad);
  color: var(--on-accent); display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--accent) 90%, transparent);
}
.steps-list li strong { display: block; font-family: var(--font-head); font-size: 1.08rem; margin-bottom: 4px; }

/* benefit / use-case cards with icons */
.cards { display: grid; gap: 16px; grid-template-columns: 1fr; padding: 0 !important; list-style: none; margin: 22px 0 0; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cards.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cards li {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin: 0;
  box-shadow: var(--mib-shadow-sm); transition: transform 0.35s var(--mib-ease), box-shadow 0.35s var(--mib-ease), border-color 0.3s;
}
.cards li:hover { transform: translateY(-4px); box-shadow: var(--mib-shadow); border-color: color-mix(in srgb, var(--accent-bright) 40%, var(--border)); }
.cards li strong { display: block; font-family: var(--font-head); font-size: 1.05rem; margin-bottom: 4px; }
.card-icon {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 14px; color: var(--accent-ink); background: var(--accent-soft);
  transition: transform 0.4s var(--mib-ease-spring), background 0.3s, color 0.3s;
}
.cards li:hover .card-icon, .feature-list li:hover .card-icon { transform: rotate(-6deg) scale(1.08); background: var(--accent-grad); color: var(--on-accent); }

/* lists of "<strong>Label.</strong> text" shown as a grid of cards */
.feature-list { list-style: none; padding: 0 !important; margin: 22px 0 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .feature-list { grid-template-columns: 1fr 1fr; } }
.feature-list li {
  position: relative; margin: 0; padding: 18px 18px 18px 78px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--mib-shadow-sm); transition: transform 0.35s var(--mib-ease), box-shadow 0.35s var(--mib-ease);
}
.feature-list li:hover { transform: translateY(-3px); box-shadow: var(--mib-shadow); }
.feature-list li .card-icon { position: absolute; left: 16px; top: 18px; margin: 0; }
.feature-list li strong { font-family: var(--font-head); }
.feature-list.is-checks li { padding-left: 60px; }
.feature-list.is-checks li::before {
  content: ""; position: absolute; left: 18px; top: 20px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.feature-list.is-warn li::before {
  background-color: var(--warn-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a5300' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  .feature-list.is-checks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386efac' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E"); }
  .feature-list.is-warn li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2bd57' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E"); }
}
ol.feature-list { counter-reset: f; }
ol.feature-list li { counter-increment: f; padding-left: 70px; }
ol.feature-list li::before {
  content: counter(f); position: absolute; left: 18px; top: 18px; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-grad); color: var(--on-accent); font-family: var(--font-head); font-weight: 800;
}

/* a split section: text on one side, a picture on the other */
.split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; }
  .split:has(> .visual-card:first-child) { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}
@media (max-width: 899px) { .split > .visual-card:first-child { order: 2; } }
.split > div { min-width: 0; }
.visual-card { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--mib-shadow); }
.code-sample {
  display: block; max-width: 760px; padding: 14px 16px; border-radius: 16px; font-size: 0.92rem; overflow-x: auto;
  background: #13162b; color: #d6fff7; border: 1px solid #2a3154; box-shadow: var(--mib-shadow-sm);
}
.code-sample code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }

/* FAQ */
.faq details {
  max-width: 820px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 0; margin-bottom: 12px;
  box-shadow: var(--mib-shadow-sm); transition: border-color 0.3s, box-shadow 0.3s;
}
.faq details[open] { border-color: color-mix(in srgb, var(--accent-bright) 45%, var(--border)); box-shadow: var(--mib-shadow); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; font-weight: 800; font-family: var(--font-head);
  padding: 16px 18px; min-height: 56px; border-radius: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 30px; height: 30px; border-radius: 50%; transition: transform 0.35s var(--mib-ease);
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 16px no-repeat;
}
@media (prefers-color-scheme: dark) {
  .faq summary::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386efac' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E"); }
}
.faq details[open] summary::after { transform: rotate(135deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { margin: 0; padding: 0 18px 18px; color: var(--text-soft); }
.faq details[open] p { animation: mib-rise 0.4s var(--mib-ease) both; }

.callout { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-bright) 25%, transparent); border-radius: 18px; padding: 16px 18px; margin: 18px 0; }
.callout p:last-child { margin-bottom: 0; }

/* closing call to action */
.cta-band {
  position: relative; overflow: hidden; margin-top: 80px; padding: 40px 24px; border-radius: 28px; text-align: center;
  background: linear-gradient(135deg, #14532d 0%, #15803d 42%, #3f37c9 100%); color: #fff; box-shadow: var(--mib-shadow-lg);
}
.cta-band::before, .cta-band::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.12); pointer-events: none; }
.cta-band::before { width: 260px; height: 260px; top: -120px; right: -60px; animation: mib-float 8s ease-in-out infinite; }
.cta-band::after { width: 180px; height: 180px; bottom: -90px; left: -40px; animation: mib-float 9s ease-in-out 1s infinite; }
.cta-band h2 { color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin: 0 auto 0.35em; max-width: 26ch; }
.cta-band h2::before { display: none !important; }
.cta-band p { max-width: 52ch; margin: 0 auto 22px; color: #fff; }
.cta-band .cta { background: #fff; color: #14532d; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45); }
.cta-band .cta:hover { color: #14532d; transform: translateY(-2px); }
.cta-band > * { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ article pages (about, privacy, terms, 404) */
.page-head { padding: 48px 0 4px; animation: mib-rise 0.7s var(--mib-ease) both; }
.page-head h1 { font-size: clamp(2rem, 5vw, 2.9rem); letter-spacing: -0.03em; margin-bottom: 0.25em; }
.page-head .lede { font-size: 1.1rem; color: var(--text-soft); max-width: 60ch; }
.updated { color: var(--muted); font-size: 0.9rem; }
.content.article { max-width: 880px; }
.article-card {
  margin-top: 20px; padding: 26px 20px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--mib-shadow);
  animation: mib-rise 0.8s var(--mib-ease) 0.1s both;
}
@media (min-width: 700px) { .article-card { padding: 40px 52px 44px; } }
.article-card > section { margin-top: 38px; }
.article-card > section:first-child { margin-top: 0; }
.article-card h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
.article-card section > h2::before { width: 32px; height: 4px; margin-bottom: 10px; }
.article-card ul:not([class]) li::marker { color: var(--accent-bright); }
.link-cards { list-style: none; padding: 0 !important; display: grid; gap: 12px; margin: 18px 0 0; }
@media (min-width: 640px) { .link-cards { grid-template-columns: 1fr 1fr; } }
.link-cards li {
  position: relative; margin: 0; padding: 16px 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-soft); transition: transform 0.3s var(--mib-ease), box-shadow 0.3s, border-color 0.3s;
}
.link-cards li:hover { transform: translateY(-3px); box-shadow: var(--mib-shadow); border-color: var(--accent); }
.link-cards a { display: flex; align-items: center; min-height: 44px; font-weight: 800; font-family: var(--font-head); font-size: 1.05rem; text-decoration: none; }
.link-cards a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.link-cards a:hover { text-decoration: underline; }
.not-found .page-head { text-align: center; }
.art-404 { display: block; width: min(300px, 72vw); height: auto; margin: 6px auto 0; }
.a-x { stroke: var(--error); stroke-width: 7; stroke-linecap: round; fill: none; }
.a-x-group { transform-box: fill-box; transform-origin: center; animation: mib-pulse 2.4s ease-in-out infinite; }

/* ------------------------------------------------------------------ footer (matches the hub) */
.site-footer {
  position: relative; margin-top: 96px;
  background: var(--mib-surface); border-top: 1px solid var(--mib-line);
  color: var(--mib-ink-soft); font-size: 0.95rem;
}
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--mib-gradient); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 32px 56px; padding-block: 52px 32px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { margin: 0 0 8px; max-width: 40ch; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-title { margin: 0 0 8px; font: 800 0.78rem/1.4 var(--mib-font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mib-ink); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { display: inline-flex; align-items: center; min-height: 36px; min-width: 44px; color: var(--mib-ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--mib-ink); text-decoration: underline; }
.footer-base { padding-bottom: 28px; }
.footer-base p { margin: 0; padding-top: 18px; border-top: 1px solid var(--mib-line); font-size: 0.85rem; color: var(--mib-muted); }
.footer-base p + p { border-top: 0; padding-top: 8px; }
.footer-base a { color: var(--accent-ink); }
@media (max-width: 860px) { .footer-inner { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (pointer: coarse) { .footer-col a { min-height: 44px; } }

/* ------------------------------------------------------------------ ad slots
   Empty slots are hidden. Once AdSense code is pasted inside, the slot reserves
   height before the ad loads, so the page doesn't jump (no layout shift). */
.ad-slot { position: relative; display: block; margin: 48px auto; padding-top: 20px; min-height: 300px; max-width: 100%; text-align: center; overflow: hidden; }
@media (min-width: 768px) { .ad-slot { min-height: 270px; } }
.ad-slot:empty { display: none; }
.ad-slot:not(:empty)::before { content: "Advertisements"; position: absolute; top: 0; left: 0; right: 0; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ads-preview .ad-slot { display: block !important; border: 2px dashed var(--warn); background: var(--warn-soft); }
.ads-preview .ad-slot::after { content: "Ad slot: " attr(data-slot); display: block; padding: 110px 12px 0; color: var(--warn); font-weight: 700; }

/* Focus: components with their own shadows keep the site-wide amber halo. */
.type-tile:focus-visible, .tile:focus-visible, .btn:focus-visible, .cta:focus-visible, .stepper-link:focus-visible,
.tabs [role="tab"]:focus-visible, .site-nav a:focus-visible, .nav-toggle:focus-visible, .faq summary:focus-visible, .link-cards a:focus-visible {
  outline: 2px solid var(--mib-ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus);
}


/* ================================================================== PDF to Excel */

/* ------------------------------------------------------------------ hero illustration
   A PDF page whose table lifts off and lands in a spreadsheet, cells filling in.
   One 9 s loop; with reduced motion everything rests in its finished state. */
.x-art { position: relative; width: 100%; max-width: 580px; margin: 0 auto; animation: mib-fade 0.9s var(--mib-ease) 0.15s both; }
.x-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.x-art text { font-family: var(--font-head); }
.x-glow-1 { stop-color: var(--accent-soft); }
.x-glow-2 { stop-color: var(--mib-pdf-soft); }
.x-flood { flood-color: #1d2c55; flood-opacity: 0.16; }
@media (prefers-color-scheme: dark) { .x-flood { flood-color: #000; flood-opacity: 0.55; } }
.x-paper { fill: #ffffff; stroke: #d7dbea; stroke-width: 1.2; }
.x-fold { fill: #eef0f7; stroke: #d7dbea; stroke-width: 1.2; }
.x-pdf-tag { fill: #dc2626; }
.x-tag-text { fill: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; }
.x-ink { fill: #1b1f3b; }
.x-bar { fill: #c9cee0; }
.x-bar-dark { fill: #8b92b3; }
.x-row { fill: #eef8f2; }
.x-rule { stroke: #b8bfd6; stroke-width: 1; }
.x-lift { transform-box: fill-box; transform-origin: center; }
.x-card { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; }
.x-head { fill: var(--surface-2); }
.x-grid { stroke: var(--border); stroke-width: 1; fill: none; }
.x-letter, .x-num { fill: var(--muted); font-size: 10px; font-weight: 800; }
.x-hdr { fill: var(--accent-soft); }
.x-hdr-text { fill: var(--accent-ink); font-size: 10.5px; font-weight: 800; }
.x-cell { fill: var(--text); font-size: 10.5px; font-weight: 600; font-family: var(--font) !important; }
.x-cell-num { text-anchor: end; font-variant-numeric: tabular-nums; }
.x-sel { fill: none; stroke: var(--grid-select); stroke-width: 2; }
.x-dot { fill: var(--grid-select); }
.x-xls { fill: #107c41; }
.x-flow { fill: none; stroke: var(--accent-bright); stroke-width: 2; stroke-dasharray: 5 6; stroke-linecap: round; opacity: 0.8; }
.x-chip { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.x-chip-text { fill: var(--text); font-size: 12.5px; font-weight: 800; }
.x-accent { fill: var(--accent-bright); }
.x-indigo { fill: var(--mib-brand); }
.x-check { fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.x-fill { transform-box: fill-box; transform-origin: left center; }

@media (prefers-reduced-motion: no-preference) {
  .x-lift { animation: x-lift 9s var(--mib-ease) infinite both; }
  .x-fill { animation: x-fill 9s var(--mib-ease) infinite both; animation-delay: calc(3s + var(--i, 0) * 0.16s); }
  .x-sel { animation: x-sel 9s var(--mib-ease) infinite both; }
  .x-flow { animation: a-march 1s linear infinite; }
  .x-float { animation: mib-float 6s ease-in-out infinite; }
  .x-float-2 { animation: mib-float 7s ease-in-out 1.2s infinite; }
  .x-pulse { transform-box: fill-box; transform-origin: center; animation: mib-pulse 2.4s ease-in-out infinite; }
}
@keyframes x-lift {
  0%, 8% { transform: none; opacity: 1; filter: none; }
  16% { transform: translate(8px, -14px) scale(1.04); opacity: 1; }
  30% { transform: translate(196px, -6px) scale(0.92); opacity: 0.9; }
  36%, 100% { transform: translate(210px, 0) scale(0.9); opacity: 0; }
}
@keyframes x-fill {
  0% { opacity: 0; transform: scaleX(0.3); }
  4% { opacity: 1; transform: scaleX(1.06); }
  6%, 84% { opacity: 1; transform: none; }
  92%, 100% { opacity: 0; transform: none; }
}
@keyframes x-sel {
  0%, 40% { transform: translate(0, 0); opacity: 0; }
  44%, 54% { transform: translate(0, 0); opacity: 1; }
  58%, 68% { transform: translate(0, 24px); opacity: 1; }
  72%, 82% { transform: translate(0, 48px); opacity: 1; }
  88%, 100% { transform: translate(0, 48px); opacity: 0; }
}
@keyframes a-march { to { stroke-dashoffset: -22; } }

/* ------------------------------------------------------------------ drop zone */
.dropzone-label { min-height: 230px; background: radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 70%), var(--surface-2); }
.drop-art { display: block; width: 132px; height: 88px; margin-bottom: 4px; }
.drop-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.d-page { fill: var(--paper); stroke: var(--border-strong); stroke-width: 1.4; }
.d-tag { fill: var(--pdf-red); }
.d-tag-t { fill: #fff; font: 800 7px var(--font-head); letter-spacing: 0.05em; }
.d-line { fill: #c9cee0; }
.d-arrow { fill: none; stroke: var(--accent-bright); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.d-sheet { fill: var(--surface); stroke: var(--accent-bright); stroke-width: 1.6; }
.d-grid { stroke: color-mix(in srgb, var(--accent-bright) 55%, transparent); stroke-width: 1; }
.d-p1, .d-p2, .d-p3, .d-arrow-g { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .d-p1 { animation: d-bob 3.2s var(--mib-ease) infinite; }
  .d-p2 { animation: d-bob 3.2s var(--mib-ease) 0.25s infinite; }
  .d-p3 { animation: d-bob 3.2s var(--mib-ease) 0.5s infinite; }
  .d-arrow-g { animation: d-arrow 1.6s var(--mib-ease) infinite; }
  .dropzone.is-dragover .d-p1, .dropzone.is-dragover .d-p2, .dropzone.is-dragover .d-p3 { animation-duration: 1s; }
}
@keyframes d-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-2deg); } }
@keyframes d-arrow { 0%, 100% { transform: translateY(-2px); opacity: 0.6; } 50% { transform: translateY(3px); opacity: 1; } }
.drop-hint { color: var(--muted); font-size: 0.875rem; }

/* samples */
.samples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 4px; }
.samples-label { font-weight: 700; font-size: 0.92rem; color: var(--text-soft); margin-right: 2px; }
.sample-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 8px; border-radius: 999px;
  font: inherit; font-size: 0.9rem; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; box-shadow: var(--mib-shadow-sm); transition: transform 0.25s var(--mib-ease), border-color 0.2s, box-shadow 0.25s;
}
.sample-btn:hover { transform: translateY(-2px); border-color: var(--accent-bright); box-shadow: var(--mib-shadow); }
.sample-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.sample-btn:disabled, .sample-btn[aria-disabled="true"] { opacity: 0.55; cursor: progress; transform: none; }

/* ------------------------------------------------------------------ file list */
.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.file-list:empty { display: none; }
.file {
  position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start;
  padding: 14px 12px 14px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--mib-shadow-sm);
  animation: file-in 0.45s var(--mib-ease) both;
}
@keyframes file-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.file.is-done { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.file.is-error { border-color: color-mix(in srgb, var(--error) 45%, var(--border)); }
.file.is-scan, .file.is-password { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.file-icon {
  position: relative; display: grid; place-items: end center; width: 40px; height: 48px; padding-bottom: 6px; border-radius: 6px 12px 6px 6px;
  background: var(--paper); border: 1.5px solid var(--border-strong); font: 800 0.62rem/1 var(--font-head); letter-spacing: 0.05em; color: #fff;
}
.file-icon::before { content: ""; position: absolute; left: 7px; right: 7px; top: 9px; height: 2px; border-radius: 2px; background: #c9cee0; box-shadow: 0 5px 0 #c9cee0, 0 10px 0 #c9cee0; }
.file-icon span { position: relative; padding: 2px 4px; border-radius: 4px; background: var(--pdf-red); }
.file.is-done .file-icon span { background: #107c41; }
.file-main { min-width: 0; }
.file-name { font-weight: 800; font-family: var(--font-head); overflow-wrap: anywhere; line-height: 1.3; }
.file-meta { color: var(--muted); font-size: 0.85rem; }
.file-status { width: fit-content; max-width: 100%; margin: 6px 0 0; border-radius: 6px; font-size: 0.9rem; color: var(--text-soft); } /* takes focus when its control goes away */
.file-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.file-progress progress { flex: 1; height: 8px; -webkit-appearance: none; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: var(--border); accent-color: var(--accent); }
.file-progress progress::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
.file-progress progress::-webkit-progress-value { background: var(--accent-grad); border-radius: 999px; transition: width 0.25s var(--mib-ease); }
.file-progress progress::-moz-progress-bar { background: var(--accent-grad); border-radius: 999px; }
.file.is-reading .file-progress progress::-webkit-progress-value {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%) 0 0 / 200% 100%, var(--accent-grad);
  animation: mib-shimmer 1.2s linear infinite;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; background: var(--surface-2); color: var(--text-soft); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-error { background: var(--error-soft); color: var(--error); }
.chip-info { background: var(--surface-2); color: var(--text-soft); } /* neutral: "No tables found" is not a success */
.chip-sample { background: var(--mib-pdf-soft, var(--surface-2)); color: var(--date-ink); }
.file-notes { margin-top: 8px; font-size: 0.88rem; color: var(--text-soft); }
.file-notes summary { cursor: pointer; font-weight: 700; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; color: var(--text); }
.file-notes ul { margin: 4px 0 0; padding-left: 1.2em; }
.file-notes li { margin: 2px 0; }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-remove {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.file-remove:hover { background: var(--error-soft); color: var(--error); }
.pw-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.pw-form .field { margin: 0; flex: 1 1 14rem; }
.pw-form label { font-size: 0.9rem; }
.pw-form input { min-height: 44px; }
.pw-error { flex-basis: 100%; margin: 0; color: var(--error); font-weight: 700; font-size: 0.88rem; }
.pw-error:empty { display: none; }
@media (max-width: 480px) {
  .file { grid-template-columns: 40px minmax(0, 1fr) 44px; padding: 12px 8px 12px 10px; column-gap: 10px; }
  .file-icon { width: 36px; height: 44px; }
}

.batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.batch-bar[hidden] { display: none; }
.batch-text { flex: 1 1 14rem; margin: 0; font-weight: 700; }
.spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2.5px solid var(--accent-bright); border-right-color: transparent; animation: mib-spin 0.8s linear infinite; }

/* ------------------------------------------------------------------ preview: a small spreadsheet */
.preview-empty {
  display: grid; place-items: center; gap: 6px; min-height: 200px; padding: 24px; text-align: center; border-radius: 18px;
  color: var(--muted); background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 26px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 96px 100%,
    var(--surface);
  border: 1px dashed var(--border-strong);
}
.preview-empty p { margin: 0; padding: 8px 14px; border-radius: 12px; background: var(--surface); font-weight: 600; }
.preview-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.preview-top .field { margin: 0; }
.preview-top select { min-width: min(18rem, 100%); }
.preview-stats { margin: 0; color: var(--text-soft); font-size: 0.92rem; }
.preview-stats strong { color: var(--text); }
/* The sheet tabs scroll sideways; a fade and an arrow at either end show there are more. */
.sheet-tabs-wrap { position: relative; }
.sheet-tabs-wrap::before, .sheet-tabs-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 2px; width: 56px; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.sheet-tabs-wrap::before { left: 0; background: linear-gradient(90deg, var(--surface) 30%, transparent); }
.sheet-tabs-wrap::after { right: 0; background: linear-gradient(270deg, var(--surface) 30%, transparent); }
.sheet-tabs-wrap.more-left::before, .sheet-tabs-wrap.more-right::after { opacity: 1; }
.tabs-scroll {
  position: absolute; top: 4px; bottom: 4px; z-index: 2; display: none; place-items: center; width: 40px; padding: 0; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--mib-shadow-sm); cursor: pointer;
}
.tabs-prev { left: 0; }
.tabs-next { right: 0; }
.sheet-tabs-wrap.more-left .tabs-prev, .sheet-tabs-wrap.more-right .tabs-next { display: grid; }
.tabs-scroll:hover { border-color: var(--accent-bright); color: var(--accent-ink); }
.sheet-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px 4px 0; margin: 0; list-style: none; border-bottom: 2px solid var(--grid-line); scrollbar-width: thin; }
.sheet-tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-bottom: 0;
  border-radius: 12px 12px 0 0; font: inherit; font-size: 0.9rem; font-weight: 700; color: var(--muted); background: transparent; cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.sheet-tab:hover { color: var(--text); background: var(--surface-2); }
.sheet-tab[aria-selected="true"] { color: var(--accent-ink); background: var(--surface); border-color: var(--grid-line); box-shadow: 0 2px 0 var(--surface), inset 0 3px 0 var(--accent-bright); position: relative; top: 2px; }
.sheet-tab .tab-count { padding: 1px 7px; border-radius: 999px; font-size: 0.72rem; background: var(--surface-2); color: var(--text-soft); }
.sheet-tab .tab-name { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; }
/* Phones: a long sheet name can't take the whole strip, so the next tab always shows. */
@media (max-width: 640px) { .sheet-tab .tab-name { max-width: min(10rem, 42vw); } }
.formula-bar {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--grid-line); border-top: 0;
  background: var(--surface); font-size: 0.9rem; overflow: hidden;
}
.fx-ref { flex: none; min-width: 3.4em; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); font: 700 0.85rem var(--mono); text-align: center; }
.fx-type { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; background: var(--surface-2); color: var(--text-soft); }
.fx-type[data-type="number"] { background: var(--accent-soft); color: var(--accent-ink); }
.fx-type[data-type="date"] { background: var(--mib-pdf-soft); color: var(--date-ink); }
.fx-type[data-type="header"] { background: var(--warn-soft); color: var(--warn); }
.fx-value { flex: 1 1 8rem; min-width: 0; font-family: var(--mono); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-source { flex: 0 1 auto; min-width: 0; color: var(--muted); font-size: 0.82rem; white-space: normal; overflow-wrap: anywhere; }
.fx-source:empty { display: none; }
/* Phones: the value and where it came from wrap under the cell reference instead of being cut off. */
@media (max-width: 640px) {
  .formula-bar { flex-wrap: wrap; row-gap: 4px; }
  .fx-value { white-space: normal; overflow-wrap: anywhere; }
  .fx-source { flex-basis: 100%; white-space: normal; }
}
.grid-scroll {
  position: relative; max-height: 460px; overflow: auto; border: 1px solid var(--grid-line); border-top: 0; border-radius: 0 0 14px 14px;
  background: var(--surface); overscroll-behavior: contain;
}
.grid { border-collapse: separate; border-spacing: 0; font-size: 0.86rem; min-width: 100%; }
.grid th, .grid td { border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); padding: 5px 9px; white-space: nowrap; max-width: 26rem; overflow: hidden; text-overflow: ellipsis; height: 30px; }
.grid thead th {
  position: sticky; top: 0; z-index: 2; background: var(--grid-head); color: var(--muted); font: 800 0.74rem var(--font-head); text-align: center; padding: 4px 9px; height: 26px;
}
.grid .rn { position: sticky; left: 0; z-index: 1; min-width: 42px; background: var(--grid-head); color: var(--muted); font: 700 0.74rem var(--font-head); text-align: center; }
.grid thead .rn { z-index: 3; }
.grid td { color: var(--text); cursor: cell; outline: none; }
.grid td.c-number { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.c-date { text-align: right; font-variant-numeric: tabular-nums; color: var(--date-ink); }
.grid td.c-bold { font-weight: 700; }
.grid td.c-filled { font-style: italic; }
.grid tr.is-header td { background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.grid tr.is-header td.c-right { text-align: right; }
.grid tbody tr:hover td:not(.is-active) { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.grid tbody tr.is-header:hover td:not(.is-active) { background: var(--accent-soft); }
.grid td.is-active { box-shadow: inset 0 0 0 2px var(--grid-select); position: relative; }
.grid td.is-active::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 6px; height: 6px; background: var(--grid-select); border: 1px solid var(--surface); }
.grid td:focus-visible { box-shadow: inset 0 0 0 2px var(--mib-ink), inset 0 0 0 4px var(--focus); }
.grid tr.is-blank td { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.grid .col-letter.is-active, .grid .rn.is-active { background: color-mix(in srgb, var(--accent-soft) 70%, var(--grid-head)); color: var(--accent-ink); }
/* A "Like the PDF" sheet: laid out as the workbook is (fixed column widths, merged cells, the
   PDF's own fonts, borders and shading, set inline), on white like a spreadsheet, with faint
   gridlines between cells and a line where each PDF page starts. */
.grid.is-layout { table-layout: fixed; border-collapse: collapse; min-width: 0; width: max-content; font-size: 1rem; }
.grid.is-layout col.rn-col { width: 42px; }
.grid.is-layout thead th { padding: 4px 0; overflow: hidden; text-overflow: clip; max-width: none; }
.grid.is-layout td {
  height: auto; max-width: none; padding: 1px 3px; overflow: hidden; text-overflow: clip; line-height: 1.2; vertical-align: top;
  white-space: pre-wrap; background: #fff; color: #000; border: 0; box-shadow: inset -1px -1px 0 #e6e8ee;
}
.grid.is-layout tbody tr:hover td:not(.is-active) { background: #fff; }
.grid.is-layout td.is-active { box-shadow: inset 0 0 0 2px var(--grid-select); }
.grid.is-layout tr.page-start td, .grid.is-layout tr.page-start th { border-top: 2px dashed #9aa6bd; }
.grid.is-layout .r-bold { font-weight: 700; }
.grid.is-layout .r-plain { font-weight: 400; }
.grid.is-layout .r-italic { font-style: italic; }
.preview-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; font-size: 0.85rem; color: var(--text-soft); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--grid-line); font: 700 0.72rem var(--mono); background: var(--surface); }
.swatch-number { justify-content: end; color: var(--text); }
.swatch-date { color: var(--date-ink); }
.swatch-header { background: var(--accent-soft); color: var(--accent-ink); }
.swatch-filled { font-style: italic; }
.legend li[hidden] { display: none; }
.grid-note { margin: 0; color: var(--muted); font-size: 0.85rem; }
.preview-issues { margin-top: 12px; }

/* ------------------------------------------------------------------ options */
.opt-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .opt-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.opt-cards.two { grid-template-columns: 1fr; }
@media (min-width: 640px) { .opt-cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .opt-cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) { .opt-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.opt { position: relative; cursor: pointer; display: block; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt-card {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; align-items: center; height: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 16px; background: var(--surface); transition: transform 0.3s var(--mib-ease), border-color 0.2s, background-color 0.2s, box-shadow 0.3s;
}
.opt-art { grid-row: 1 / span 2; width: 56px; height: 44px; }
.opt-art svg { display: block; width: 100%; height: 100%; }
.o-sheet { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.2; }
.o-line { stroke: var(--border-strong); stroke-width: 1; }
.o-tab { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.o-tab-on { fill: var(--accent-bright); }
.o-head { fill: color-mix(in srgb, var(--accent-bright) 35%, var(--surface)); }
.opt-card.no-art { grid-template-columns: minmax(0, 1fr); align-content: center; }
.opt-card strong { font-family: var(--font-head); font-size: 0.98rem; line-height: 1.25; }
.opt-sub { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.opt:hover .opt-card { transform: translateY(-2px); box-shadow: var(--mib-shadow-sm); border-color: color-mix(in srgb, var(--accent-bright) 60%, var(--border)); }
.opt input:checked + .opt-card { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.opt input:checked + .opt-card strong { color: var(--accent-ink); }
.opt input:focus-visible + .opt-card { outline: 2px solid var(--mib-ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus); }
.opt-group + .opt-group, .check-card + .opt-group { margin-top: 18px; }
.opt-note { margin: -2px 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text-soft); font-size: 0.88rem; }
.opt-note[hidden] { display: none; }
/* The layout doesn't apply to merged CSV files: the cards stay usable but look set aside.
   Only the pictures fade: the radios still work, so their text keeps its full contrast. */
.opt-group.is-moot .opt-card { border-style: dashed; background: var(--surface-2); box-shadow: none; }
.opt-group.is-moot .opt-art { opacity: 0.45; }
.opt-hint { margin: -4px 0 10px; }
.opt-group legend { margin-bottom: 10px; }
.check-card { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; }
.check-card input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-card strong { display: block; font-family: var(--font-head); }
.check-card span span { color: var(--muted); font-size: 0.85rem; }

/* ------------------------------------------------------------------ download */
.dl-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 16px; padding: 14px 16px; border-radius: 16px; background: var(--gradient-soft, var(--mib-gradient-soft)); border: 1px solid var(--border); }
.dl-file { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; font-family: var(--font-head); overflow-wrap: anywhere; }
.dl-file-icon { display: grid; place-items: center; width: 34px; height: 40px; border-radius: 6px 10px 6px 6px; background: #107c41; color: #fff; font: 800 0.6rem var(--font-head); flex: none; }
.dl-file-icon.is-csv { background: #475569; }
.dl-sub { color: var(--text-soft); font-size: 0.9rem; }
/* What isn't in the download (warn) and what is worth knowing about it (neutral). */
.dl-list { margin: 0 0 16px; }
.dl-list[hidden] { display: none; }
.dl-list ul { margin: 0; padding-left: 1.2em; }
.dl-list li { margin: 4px 0; overflow-wrap: anywhere; }
.dl-list li .btn { margin: 4px 0 0; vertical-align: middle; }
.dl-list-title { margin: 0 0 6px; }
/* Step 2's note on how dates were read, and step 1's notes. */
.date-notice { margin: 0 0 12px; }
.date-notice[hidden], .files-note[hidden], .reader-notice[hidden] { display: none; }
.date-notice ul { margin: 4px 0 0; padding-left: 1.2em; }
.date-notice .btn-row { margin: 8px 0 0; }
.date-notice li { margin: 6px 0 0; overflow-wrap: anywhere; }
.date-notice li .btn-row { margin: 4px 0 0; }
/* A PDF's name in the notice shows it in the preview; how its example date was read stands out. */
.date-notice .notice-file { font-weight: 700; color: var(--text); text-align: start; overflow-wrap: anywhere; }
.date-notice li > .notice-file { display: block; margin: 0 0 2px; }
.date-notice .notice-file:hover { color: var(--accent-ink); }
.date-notice .date-reading { font-weight: 700; }
.files-note { margin: 12px 0 0; }
.reader-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 0; }
.reader-notice p { flex: 1 1 16rem; margin: 0; }
/* A download that left PDFs out: amber, and no confetti. */
.progress.is-done.is-partial { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.progress.is-done.is-partial::before {
  background: var(--warn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18.5v.5'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 20%, transparent);
}
.progress.is-done.is-partial::after { display: none; }
.progress.is-partial .done-actions .btn-link { color: var(--text); }
/* Phones and tablets: a bar at the bottom of the window leads to step 4 (the stepper is sticky from 1080px). */
.dl-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto; padding: 8px 8px 8px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--border); box-shadow: var(--mib-shadow);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); animation: mib-fade 0.25s both;
}
.dl-bar[hidden] { display: none; }
.dl-bar-text { flex: 1 1 auto; min-width: 0; margin: 0; font-weight: 700; font-size: 0.9rem; line-height: 1.3; }
.dl-bar-link { flex: none; gap: 6px; background: var(--accent-grad); border: 0; color: var(--on-accent); }
.dl-bar-link:hover:not([aria-disabled="true"]) { color: var(--on-accent); }
@media (min-width: 1080px) { .dl-bar { display: none; } }
/* While the bar is shown (js/app.js barSpace()), a focused control scrolls clear of it, the way
   scroll-padding-top keeps it clear of the sticky header: the bar, its 12px from the bottom and a gap. */
html.has-dl-bar { scroll-padding-bottom: calc(var(--dl-bar-h, 64px) + 24px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1080px) { html.has-dl-bar { scroll-padding-bottom: 0; } }
.download-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.download-row .btn-primary svg { flex: none; }
@media (max-width: 480px) { .download-row .btn { width: 100%; } }
.done-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 0 -4px; }
/* Links on the green done box: 44px tall targets, and the darker ink for 4.5:1 or more on --ok-soft. */
.done-actions .btn-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--accent-ink); }
.done-actions .btn-link:hover { color: var(--text); }

/* ------------------------------------------------------------------ page extras */
.type-show { list-style: none; padding: 0 !important; margin: 22px 0 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .type-show { grid-template-columns: 1fr 1fr; } }
.type-show li { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--mib-shadow-sm); }
.ts-from { font-family: var(--mono); font-size: 0.88rem; color: var(--text-soft); overflow-wrap: anywhere; }
.ts-arrow { color: var(--accent-bright); font-weight: 800; }
.ts-to { display: grid; gap: 2px; font-size: 0.85rem; }
.ts-to b { font-family: var(--mono); font-size: 0.9rem; color: var(--text); }
.ts-to span { color: var(--muted); }
.honest { border-left: 4px solid var(--warn); }

/* ------------------------------------------------------------------ reduced motion and print
   brand.css shortens every animation; the decorative loops are switched off entirely here
   so illustrations rest in their finished, fully visible state. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *, .x-art, .x-art *, .hero-art, .hero-art *, .drop-border rect, .drop-art *, .file, .cta-band::before, .cta-band::after,
  .art-404 *, .visual-card *, .page-head, .article-card, .spinner, .file-progress progress::-webkit-progress-value {
    animation: none !important;
  }
  .x-lift { opacity: 0; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .tool, .hero-art, .x-art, .cta-band { display: none !important; }
}
.a-err-soft { fill: var(--error-soft); }
