/* =====================================================================
   iq-tools.css: the IQ Books landing treatment for the free-tool pages
   (/invoice-template, /quote-template, /receipt-template, /vat-calculator,
   /self-employed-tax-calculator, /mtd-software).

   Part 1 is lifted from index.html (the IQ Books landing): tokens, type,
   masthead, drawer, buttons, section heads, FAQ, final CTA, colophon and
   the reveal system, so these pages read as IQ Books pages. Part 2 adds
   the components the tools need. Load with /iq-landing-polish.css + .js
   for the shared motion layer (it keys off --brand).
   ===================================================================== */

/* ---------- Part 1: lifted from the IQ Books landing ---------- */
:root {--riq: #5b6eae;
        --riq-deep: #3d4d7a;
        --riq-wash: #eef0f8;
        --ciq: #c4576a;
        --ciq-deep: #9a4455;
        --ciq-wash: #f5e8ea;
        --liq: #4a9080;
        --liq-deep: #366558;
        --liq-wash: #e8f0ec;

        
        --prepiq: #7e5a22;
        --prepiq-deep: #5f4218;
        --iqbooks: #2c4566;
        --iqbooks-deep: #1e3450;
        --iqbooks-wash: #e7edf6;
        --brand: var(--iqbooks);
        --brand-ink: var(--iqbooks-deep);
        --brand-wash: var(--iqbooks-wash);

        
        --cream: #faf8f5;
        --ivory: #f5f2ed;
        --paper: #edeae4;
        --ink: #1a1a1a;
        --ink-2: #3d3d3d;
        --ink-3: #6b6b6b;
        --ink-4: #999999;
        --rule: #d4d0c8;
        --rule-strong: #8a8578;

        
        --serif: 'Fraunces', 'Libre Baskerville', Georgia, serif;
        --sans: 'DM Sans', 'Nunito Sans', system-ui, sans-serif;
        --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

        
        --space-1: clamp(4px, 0.5vw, 6px);
        --space-2: clamp(8px, 1vw, 12px);
        --space-3: clamp(12px, 1.5vw, 18px);
        --space-4: clamp(16px, 2vw, 24px);
        --space-5: clamp(24px, 3vw, 36px);
        --space-6: clamp(32px, 4vw, 48px);
        --space-7: clamp(48px, 6vw, 72px);
        --space-8: clamp(64px, 8vw, 96px);
        --space-9: clamp(96px, 12vw, 144px);

        --max: 1440px;
        --gut: clamp(20px, 4vw, 64px);}
*, *::before, *::after {margin: 0; padding: 0; box-sizing: border-box;}
html {scroll-behavior: smooth; -webkit-text-size-adjust: 100%;}
body {font-family: var(--sans);
        background: var(--cream);
        color: var(--ink);
        font-size: 16px;
        line-height: 1.55;
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        font-feature-settings: 'ss01', 'kern';}
a {color: inherit; text-decoration: none;}
::selection {background: var(--brand); color: var(--cream);}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;}
}
.wrap {max-width: var(--max); margin-inline: auto; padding-inline: var(--gut);}
.wrap-wide {max-width: 1600px; margin-inline: auto; padding-inline: var(--gut);}
.eyebrow {font-family: var(--mono);
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: var(--ink-3);}
.kicker {font-family: var(--mono);
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--ink-2);}
.lede {font-family: var(--serif);
        font-weight: 400;
        font-size: clamp(20px, 2.2vw, 26px);
        line-height: 1.45;
        color: var(--ink-2);
        letter-spacing: -0.01em;}
.data {font-family: var(--mono); font-variant-numeric: tabular-nums;}
h2 {font-size: clamp(40px, 6vw, 96px); font-weight: 500; letter-spacing: -0.03em;}
h3 {font-size: clamp(28px, 3.6vw, 52px); font-weight: 500;}
h4 {font-size: clamp(20px, 2.2vw, 28px); font-weight: 600;}
.masthead {position: sticky; top: 0; z-index: 50;
        background: color-mix(in srgb, var(--cream) 88%, transparent);
        backdrop-filter: saturate(140%) blur(14px);
        -webkit-backdrop-filter: saturate(140%) blur(14px);
        border-bottom: 1px solid var(--rule);}
.masthead__inner {display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: var(--space-5);
        height: 64px;}
.mark {display: flex;
        align-items: baseline;
        gap: 8px;
        font-family: var(--serif);
        font-weight: 500;
        font-size: 18px;
        letter-spacing: -0.02em;
        color: var(--ink);
        white-space: nowrap;}
@media (min-width: 480px) {
  .mark {font-size: 20px;}
}
.mark__iq {font-style: italic; color: var(--brand);}
.mark__meta {display: none;
        font-family: var(--mono);
        font-size: 10px;
        letter-spacing: 0.2em;
        text-transform: uppercase;
        color: var(--ink-3);
        margin-left: 8px;}
@media (min-width: 900px) {
  .mark__meta {display: inline;}
}
.masthead__nav {display: none;
        justify-content: center;
        flex-wrap: nowrap; min-width: 0;
        gap: clamp(12px, 1.5vw, 28px);
        font-size: 13.5px;
        font-weight: 500;
        color: var(--ink-2);}
.masthead__nav a {position: relative;
        padding: 4px 0;
        transition: color 180ms ease;}
.masthead__nav a:hover {color: var(--ink);}
.masthead__nav a::after {content: '';
        position: absolute;
        inset: auto 0 -2px 0;
        height: 1px;
        background: var(--ink);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 240ms cubic-bezier(.2,.8,.2,1);}
.masthead__nav a:hover::after {transform: scaleX(1);}
.masthead__cta {display: flex;
        align-items: center;
        gap: 8px;
        justify-self: end;
        min-width: 0;}
@media (max-width: 720px) {
  .masthead__cta .btn--ghost {display: none;}
}
@media (max-width: 520px) {
  .masthead__inner {gap: 10px;}
  .masthead__cta .btn--solid {padding: 9px 12px; font-size: 13px;}
}
@media (max-width: 380px) {
  .masthead__cta .btn--solid {display: none;}
}
.btn {display: inline-flex;
        align-items: center;
        gap: 8px;
        font-family: var(--sans);
        font-size: 14px;
        font-weight: 500;
        letter-spacing: 0.02em;
        padding: 10px 18px;
        border-radius: 2px;
        transition: all 220ms cubic-bezier(.2,.8,.2,1);
        white-space: nowrap;
        cursor: pointer;}
.btn--ghost {color: var(--ink);}
.btn--ghost:hover {color: var(--brand-ink);}
.btn--solid {background: var(--ink);
        color: var(--cream);
        border: 1px solid var(--ink);
        position: relative;
        overflow: hidden;}
.btn--solid:hover {background: var(--brand-ink);
        border-color: var(--brand-ink);
        transform: translateY(-1px);
        box-shadow: 0 8px 24px -12px var(--brand-ink);}
.btn--solid::after {content: '→';
        font-family: var(--mono);
        transition: transform 280ms cubic-bezier(.2,.8,.2,1);}
.btn--solid:hover::after {transform: translateX(4px);}
.btn--outline {color: var(--ink); border: 1px solid var(--ink);}
.btn--outline:hover {background: var(--ink); color: var(--cream);}
.menu-toggle {display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px; height: 40px;
        border: 1px solid var(--rule);
        border-radius: 2px;
        color: var(--ink);}
.menu-toggle svg {width: 20px; height: 20px;}
/* The tool pages list six tools in the masthead, wider than the landing's menu,
   so the full menu needs more room; below 1360px the menu button takes over. */
@media (min-width: 1360px) {
  .masthead__nav {display: flex;}
  .menu-toggle {display: none;}
}
.masthead__nav a {white-space: nowrap;}
@media (min-width: 1180px) and (max-width: 1439px) {
  .mark__meta {display: none;}
  .masthead__nav a[href="/dashboard"] {display: none;}
}
.drawer {position: fixed;
        inset: 64px 0 0 0;
        background: var(--cream);
        z-index: 40;
        transform: translateY(-120%);
        transition: transform 360ms cubic-bezier(.2,.8,.2,1);
        display: flex;
        flex-direction: column;
        padding: var(--space-5) var(--gut);
        border-top: 1px solid var(--rule);
        overflow-y: auto;
        overscroll-behavior: contain;}
.drawer.open {transform: translateY(0);}
.drawer a {font-family: var(--serif);
        font-size: 28px;
        padding: 14px 0;
        border-bottom: 1px solid var(--rule);
        color: var(--ink);}
.section-head {display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-4);
        padding-bottom: var(--space-6);
        border-bottom: 1px solid var(--rule-strong);
        margin-bottom: var(--space-6);}
@media (min-width: 900px) {
  .section-head {grid-template-columns: 4fr 3fr;
            align-items: end;}
}
.section-head h2 {font-size: clamp(44px, 6vw, 96px);
        font-weight: 500;
        line-height: 0.95;
        letter-spacing: -0.035em;}
.section-head h2 em {font-style: italic; font-weight: 400; color: var(--brand-ink);}
.faq {padding: var(--space-8) 0; background: var(--cream);}
.faq__grid {display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-6);}
@media (min-width: 1024px) {
  .faq__grid {grid-template-columns: 1fr 2fr;}
}
.faq__head h2 {font-weight: 400;}
.faq__head h2 em {font-style: italic; color: var(--brand-ink);}
.faq__head p {font-family: var(--serif);
        font-size: 18px;
        line-height: 1.45;
        color: var(--ink-2);
        margin-top: var(--space-3);
        max-width: 360px;}
.faq__list {border-top: 1px solid var(--rule-strong);}
details {border-bottom: 1px solid var(--rule);
        padding: var(--space-4) 0;
        overflow: hidden;}
details summary {list-style: none;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 24px;
        font-family: var(--serif);
        font-size: clamp(18px, 1.8vw, 22px);
        font-weight: 500;
        letter-spacing: -0.01em;
        color: var(--ink);
        padding: 6px 0;}
details summary::-webkit-details-marker {display: none;}
details summary::after {content: '+';
        font-family: var(--mono);
        font-size: 24px;
        line-height: 1;
        color: var(--ink);
        transition: transform 280ms cubic-bezier(.2,.8,.2,1);
        flex-shrink: 0;}
details[open] summary::after {transform: rotate(45deg);}
details .answer {padding-top: var(--space-3);
        font-size: 15px;
        line-height: 1.65;
        color: var(--ink-2);
        max-width: 720px;}
details .answer strong {color: var(--ink); font-weight: 600;}
.final {padding: var(--space-9) 0;
        background: var(--ink);
        color: var(--cream);
        position: relative;
        overflow: hidden;}
.final::before, .final::after {content: '';
        position: absolute;
        width: 600px; height: 600px;
        border-radius: 50%;
        filter: blur(100px);
        opacity: 0.25;
        pointer-events: none;}
.final::before {background: var(--brand);
        top: -150px; left: -100px;
        animation: orbDrift 30s ease-in-out infinite;}
.final::after {background: color-mix(in srgb, var(--brand) 50%, #8ea2d4);
        bottom: -200px; right: -100px;
        animation: orbDrift 34s ease-in-out infinite -4s;}
.final__inner {position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-5);
        align-items: end;}
@media (min-width: 900px) {
  .final__inner {grid-template-columns: 3fr 2fr;}
}
.final h2 {color: var(--cream);
        font-weight: 400;
        font-size: clamp(52px, 8vw, 120px);
        letter-spacing: -0.035em;
        line-height: 0.95;}
.final h2 em {font-style: italic; color: var(--brand);}
.final__aside {font-family: var(--serif);
        font-size: clamp(18px, 1.8vw, 22px);
        line-height: 1.5;
        color: color-mix(in srgb, var(--cream) 75%, transparent);
        padding-left: var(--space-4);
        border-left: 1px solid color-mix(in srgb, var(--cream) 22%, transparent);}
.final__actions {margin-top: var(--space-6);
        padding-top: var(--space-5);
        border-top: 1px solid color-mix(in srgb, var(--cream) 22%, transparent);
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        grid-column: 1 / -1;}
.final .btn--solid {background: var(--cream);
        color: var(--ink);
        border-color: var(--cream);}
.final .btn--solid:hover {background: var(--brand);
        color: var(--cream);
        border-color: var(--brand);}
.final .btn--outline {color: var(--cream);
        border-color: color-mix(in srgb, var(--cream) 50%, transparent);}
.final .btn--outline:hover {background: var(--cream);
        color: var(--ink);
        border-color: var(--cream);}
.colophon {padding: var(--space-7) 0 var(--space-4);
        background: var(--cream);
        border-top: 1px solid var(--rule-strong);
        color: var(--ink-2);}
.colophon__grid {display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-5);}
@media (min-width: 720px) {
  .colophon__grid {grid-template-columns: 2fr 1fr 1fr 1fr;}
}
.colophon__mark {display: flex; flex-direction: column; gap: var(--space-3); max-width: 340px;}
.colophon__mark .wordmark {font-family: var(--serif);
        font-size: 28px;
        font-weight: 500;
        letter-spacing: -0.025em;
        color: var(--ink);}
.colophon__mark .wordmark em {font-style: italic; color: var(--brand);}
.colophon__mark p {font-size: 14px;
        line-height: 1.55;
        color: var(--ink-3);}
.colophon__group h5 {font-family: var(--mono);
        font-size: 10px;
        letter-spacing: 0.22em;
        text-transform: uppercase;
        color: var(--ink-3);
        margin-bottom: var(--space-3);
        padding-bottom: 10px;
        border-bottom: 1px solid var(--rule);}
.colophon__group ul {display: flex;
        flex-direction: column;
        gap: 10px;}
.colophon__group a {font-size: 14px;
        color: var(--ink-2);
        transition: color 180ms ease;}
.colophon__group a:hover {color: var(--brand-ink);}
.colophon__bar {margin-top: var(--space-7);
        padding-top: var(--space-4);
        border-top: 1px solid var(--rule);
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 12px;
        font-family: var(--mono);
        font-size: 11px;
        letter-spacing: 0.08em;
        color: var(--ink-3);}
.colophon__bar .issue em {font-style: italic; color: var(--brand);}
:where(html.js) .reveal {opacity: 0;
        transform: translateY(24px);
        transition: opacity 700ms cubic-bezier(.2,.8,.2,1), transform 700ms cubic-bezier(.2,.8,.2,1);}
.reveal.in {opacity: 1; transform: translateY(0);}
:where(html.js) .reveal--stagger > * {opacity: 0;
        transform: translateY(20px);
        transition: opacity 600ms cubic-bezier(.2,.8,.2,1), transform 600ms cubic-bezier(.2,.8,.2,1);}
.reveal--stagger.in > * {opacity: 1; transform: translateY(0);}
.reveal--stagger.in > *:nth-child(1) {transition-delay: 0ms;}
.reveal--stagger.in > *:nth-child(2) {transition-delay: 80ms;}
.reveal--stagger.in > *:nth-child(3) {transition-delay: 160ms;}
.reveal--stagger.in > *:nth-child(4) {transition-delay: 240ms;}
.reveal--stagger.in > *:nth-child(5) {transition-delay: 320ms;}
.reveal--stagger.in > *:nth-child(6) {transition-delay: 400ms;}
h1, h2 {text-wrap: balance;}

h1, h2, h3, h4, h5 { font-family: var(--serif); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); font-feature-settings: 'ss01', 'lnum'; }
h1 { font-size: clamp(56px, 10vw, 168px); font-weight: 400; letter-spacing: -0.04em; }
em, .italic { font-style: italic; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.masthead .mark { display: inline-flex; align-items: center; gap: 12px; }
.masthead .mark__logo { display: block; height: 24px; width: auto; overflow: visible; }
.masthead .mark__by { display: inline-flex; align-items: center; gap: 6px; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-3); }
.masthead .mark__riq { display: block; height: 15px; width: auto; overflow: visible; }
@media (max-width: 700px) { .masthead .mark__by { display: none; } }
@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-40px, 30px) scale(1.06); }
    50% { transform: translate(20px, -25px) scale(0.95); }
    75% { transform: translate(35px, 15px) scale(1.03); }
}

/* ---------- Part 2: tool-page components ---------- */

/* Page rhythm */
.tp-section { padding: var(--space-8) 0; }
.tp-section--ivory { background: var(--ivory); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.tp-section--paper { background: var(--paper); }
.tp-section--ink { background: var(--ink); color: var(--cream); }
.tp-section--ink h2, .tp-section--ink h3 { color: var(--cream); }

/* Hero */
.th { position: relative; padding: clamp(28px, 4vw, 56px) 0 var(--space-4); overflow: hidden; }
.th::before { content: ''; position: absolute; width: 640px; height: 640px; border-radius: 50%; right: -220px; top: -260px;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 22%, transparent), transparent); pointer-events: none; }
.th__grid { position: relative; display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: end; }
@media (min-width: 1024px) { .th__grid { grid-template-columns: 7fr 5fr; } }
.th__eyebrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.th__eyebrow .eyebrow::before { content: ''; display: inline-block; width: 22px; height: 1px; background: var(--ink-3); vertical-align: middle; margin-right: 10px; }
.th h1 { font-size: clamp(42px, 5.8vw, 92px); line-height: 0.95; letter-spacing: -0.04em; }
.th h1 em { font-style: italic; font-weight: 300; color: var(--brand); }
.th .lede { margin-top: var(--space-4); max-width: 760px; font-size: clamp(18px, 1.7vw, 22px); }
.th__aside { border-left: 1px solid var(--rule-strong); padding-left: var(--space-4); display: grid; gap: var(--space-3); }
.th__stat { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; }
.th__stat b { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.th__stat span { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.th__privacy { display: flex; gap: 10px; align-items: flex-start; margin-top: var(--space-4); font-size: 14px; color: var(--ink-2); max-width: 640px; }
.th__privacy svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--liq); }
.tool-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-5); }
.tool-tabs a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 9px 14px; border: 1px solid var(--rule-strong); border-radius: 999px; color: var(--ink-2); transition: all 200ms ease; }
.tool-tabs a:hover { border-color: var(--ink); color: var(--ink); }
.tool-tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); background: color-mix(in srgb, var(--cream) 70%, transparent); white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip--free { color: var(--liq-deep); border-color: color-mix(in srgb, var(--liq) 45%, transparent); background: var(--liq-wash); }
.chip--paid { color: var(--riq-deep); border-color: color-mix(in srgb, var(--riq) 45%, transparent); background: var(--riq-wash); }
.chip--brand { color: var(--iqbooks-deep); border-color: color-mix(in srgb, var(--iqbooks) 40%, transparent); background: var(--iqbooks-wash); }

/* Tool shell: form + sticky preview */
.tool { padding: var(--space-4) 0 var(--space-8); }
.tool__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: start; }
@media (min-width: 1100px) { .tool__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.tool__panel { background: #fff; border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 1px 0 rgba(26,26,26,.03), 0 24px 48px -32px rgba(30,52,80,.35); }
.tool__stage { position: relative; }
@media (min-width: 1100px) { .tool__stage { position: sticky; top: 84px; } }

/* Form */
.dg-form fieldset { border: 0; border-bottom: 1px solid var(--rule); padding: var(--space-4) var(--space-4) var(--space-4); margin: 0; min-width: 0; }
.dg-form fieldset:last-of-type { border-bottom: 0; }
.dg-form legend { float: left; width: 100%; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.dg-form legend::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.dg-form legend + * { clear: both; }
.dg-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.dg-field label, .dg-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.dg-field input, .dg-field select, .dg-field textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--cream); border: 1px solid var(--rule); border-radius: 4px; padding: 10px 12px; width: 100%; min-width: 0; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.dg-field textarea { resize: vertical; line-height: 1.45; }
.dg-field input:focus, .dg-field select:focus, .dg-field textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.dg-field .hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.dg-row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 560px) { .dg-row { grid-template-columns: 1fr 1fr; } }
.dg-sub { padding: 12px 14px 2px; margin: 4px 0 12px; background: var(--ivory); border: 1px solid var(--rule); border-radius: 4px; }
.dg-sub[hidden] { display: none; }
.dg-toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink); margin: 6px 0 12px; cursor: pointer; }
.dg-toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.dg-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.dg-logo .dg-label { width: 100%; }
.dg-logo input[type=file] { font-size: 13px; max-width: 100%; }
.dg-logo img { max-height: 44px; max-width: 160px; object-fit: contain; border: 1px solid var(--rule); border-radius: 4px; padding: 4px; background: #fff; }
.btn--tiny { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px; border: 1px solid var(--rule-strong); border-radius: 2px; background: transparent; color: var(--ink); cursor: pointer; }
.btn--tiny:hover { border-color: var(--ink); }
.dg-items { display: grid; gap: 10px; }
.dg-item { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 0 10px; padding: 12px 12px 4px; border: 1px solid var(--rule); border-radius: 4px; background: var(--cream); }
.dg-item .f-desc { grid-column: 1 / -1; }
.dg-item.has-vat { grid-template-columns: 1fr 1fr 1fr 34px; }
.dg-item__remove { align-self: center; width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: 50%; background: #fff; color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; }
.dg-item__remove:disabled { opacity: .35; cursor: default; }
.dg-item .line-total { grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: right; padding-bottom: 8px; min-height: 8px; }
.dg-add { margin-top: 10px; }
.dg-status { font-size: 13px; color: var(--ink-3); padding: 0 var(--space-4) var(--space-4); min-height: 20px; }

/* Design controls (template gallery, colours, paper) */
.dg-design { padding: var(--space-4); border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, var(--ivory), #fff); border-radius: 6px 6px 0 0; }
.dg-design__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dg-design__head h2 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; letter-spacing: -0.02em; }
.dg-design__head h2 em { font-style: italic; font-weight: 400; color: var(--brand); }
.dg-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .dg-thumbs { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.dg-thumb { appearance: none; border: 1px solid var(--rule); border-radius: 4px; background: #fff; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 0; overflow: hidden; transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease; text-align: left; }
.dg-thumb:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -16px rgba(30,52,80,.6); }
.dg-thumb[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.dg-thumb__win { position: relative; width: 100%; aspect-ratio: 210 / 297; overflow: hidden; background: #fff; }
.dg-thumb__win iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0; transform-origin: 0 0; pointer-events: none; }
.dg-thumb__name { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 6px 7px; color: var(--ink-2); border-top: 1px solid var(--rule); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.dg-swatches__label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.dg-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rule-strong); cursor: pointer; padding: 0; }
.dg-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.dg-seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 999px; overflow: hidden; }
.dg-seg button { font: inherit; font-size: 12.5px; padding: 6px 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.dg-seg button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }

/* Preview stage */
.dg-stage { background: radial-gradient(120% 80% at 50% 0%, #fff 0%, var(--paper) 70%); border: 1px solid var(--rule); border-radius: 6px; padding: var(--space-4); }
.dg-stage__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dg-stage__bar .eyebrow b { color: var(--ink); font-weight: 500; }
.dg-sheet { position: relative; width: 100%; overflow: hidden; border-radius: 2px; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 30px 60px -30px rgba(30,52,80,.45), 0 12px 24px -18px rgba(0,0,0,.25); background: #fff; }
.dg-sheet iframe { position: absolute; top: 0; left: 0; width: 794px; border: 0; transform-origin: 0 0; background: #fff; }
.dg-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.dg-actions .btn { font-size: 14px; }
.btn--line { color: var(--ink); border: 1px solid var(--ink); background: transparent; }
.btn--line:hover { background: var(--ink); color: var(--cream); }
.dg-clear { font: inherit; font-size: 13px; color: var(--ink-3); background: none; border: 0; text-decoration: underline; cursor: pointer; margin-left: auto; }
.dg-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }

/* Showcase */
.sc-intro { display: grid; gap: var(--space-4); grid-template-columns: 1fr; margin-bottom: var(--space-7); }
@media (min-width: 900px) { .sc-intro { grid-template-columns: 4fr 3fr; align-items: end; } }
.sc-intro h2 { font-size: clamp(42px, 5.6vw, 88px); line-height: 0.95; letter-spacing: -0.035em; font-weight: 500; }
.sc-intro h2 em { font-style: italic; font-weight: 300; color: var(--brand); }
.sc-intro p { font-family: var(--serif); font-size: clamp(18px, 1.8vw, 22px); line-height: 1.5; color: var(--ink-2); }
.feat { display: grid; grid-template-columns: 1fr; gap: var(--space-5); align-items: center; padding: var(--space-7) 0; border-top: 1px solid var(--rule); }
.feat:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 960px) {
    .feat { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-7); }
    .feat--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
    .feat--flip .feat__copy { order: 2; }
}
.feat__num { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--ink-3); display: flex; gap: 10px; align-items: center; margin-bottom: var(--space-3); }
.feat__num::after { content: ''; width: 40px; height: 1px; background: var(--rule-strong); }
.feat h3 { font-size: clamp(30px, 3.4vw, 50px); letter-spacing: -0.03em; line-height: 1.02; font-weight: 500; }
.feat h3 em { font-style: italic; font-weight: 300; color: var(--brand); }
.feat__copy > p { margin-top: var(--space-3); font-size: 16.5px; line-height: 1.65; color: var(--ink-2); max-width: 560px; }
.feat__list { list-style: none; margin-top: var(--space-4); display: grid; gap: 10px; }
.feat__list li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.feat__list li::before { content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--iqbooks-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
.feat__list li::after { content: ''; position: absolute; left: 5px; top: 8px; width: 6px; height: 3.5px; border-left: 1.5px solid var(--brand); border-bottom: 1.5px solid var(--brand); transform: rotate(-45deg); }
.feat__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-4); }
.feat__viz { position: relative; min-width: 0; }

/* Frames */
.shot { position: relative; background: #fff; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; box-shadow: 0 40px 80px -48px rgba(30,52,80,.55), 0 14px 28px -20px rgba(0,0,0,.25); }
.shot__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--rule); background: var(--ivory); }
.shot__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.shot__bar span { margin-left: 10px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot img { width: 100%; height: auto; }
.shot__doc { position: relative; overflow: hidden; background: #fff; }
.shot__doc iframe { position: absolute; top: 0; left: 0; width: 794px; border: 0; transform-origin: 0 0; pointer-events: none; }
.phones { display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 2vw, 24px); }
.phones img { width: 31%; max-width: 230px; min-width: 0; height: auto; filter: drop-shadow(0 30px 40px rgba(30,52,80,.28)); }
.phones img:nth-child(2) { transform: translateY(-28px); }

/* Mock cards (illustrative product UI, drawn in HTML) */
.mock { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: var(--space-4); box-shadow: 0 40px 80px -48px rgba(30,52,80,.5), 0 12px 24px -20px rgba(0,0,0,.2); }
.mock__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--rule); }
.mock__title { font-family: var(--serif); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.mock__meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.mock__rows { display: grid; gap: 0; }
.mock__row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--rule); font-size: 14px; }
.mock__row:last-child { border-bottom: 0; }
.mock__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rule-strong); }
.mock__dot--ok { background: var(--liq); } .mock__dot--brand { background: var(--brand); } .mock__dot--warn { background: #c9902f; } .mock__dot--riq { background: var(--riq); }
.mock__amt { font-family: var(--mono); font-size: 13px; color: var(--ink); white-space: nowrap; }
.mock__sub { font-size: 12.5px; color: var(--ink-3); }
.mock-stack { position: relative; display: grid; gap: var(--space-3); }
.mock-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.mock-pair__arrow { font-family: var(--mono); font-size: 22px; color: var(--ink-3); }
.mock-pair .shot__doc { border-radius: 6px; border: 1px solid var(--rule); box-shadow: 0 24px 48px -32px rgba(30,52,80,.55); }
.pill-status { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.pill-status--ok { background: var(--liq-wash); color: var(--liq-deep); }
.pill-status--brand { background: var(--iqbooks-wash); color: var(--iqbooks-deep); }
.pill-status--muted { background: var(--ivory); color: var(--ink-3); }

/* Logo studio illustration */
.ls { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.ls__tools { display: grid; gap: 8px; align-content: start; }
.ls__tool { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 4px; color: var(--ink-2); background: var(--cream); }
.ls__tool--on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.ls__art { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; background-color: #fff;
    background-image: linear-gradient(var(--ivory) 1px, transparent 1px), linear-gradient(90deg, var(--ivory) 1px, transparent 1px); background-size: 22px 22px; border: 1px solid var(--rule); display: grid; place-items: center; }
.ls__art svg { width: 78%; height: auto; }
.ls__sel { position: absolute; border: 1px dashed var(--brand); }
.ls__sel i { position: absolute; width: 8px; height: 8px; background: #fff; border: 1.5px solid var(--brand); border-radius: 2px; }

/* Plan strip */
.plans { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 900px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { border: 1px solid var(--rule-strong); border-radius: 6px; padding: var(--space-5); background: var(--cream); }
.plan--paid { background: #fff; }
.plan h3 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 500; letter-spacing: -0.025em; margin: 12px 0 6px; }
.plan h3 em { font-style: italic; font-weight: 300; color: var(--brand); }
.plan p { color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* Guide (prose) */
.guide__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 1000px) { .guide__grid { grid-template-columns: 4fr 7fr; } .guide__aside { position: sticky; top: 96px; align-self: start; } }
.guide__aside h2 { font-size: clamp(38px, 4.6vw, 68px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 500; margin-top: 12px; }
.guide__aside h2 em { font-style: italic; font-weight: 300; color: var(--brand); }
.guide__aside p { margin-top: var(--space-3); font-family: var(--serif); font-size: 19px; line-height: 1.5; color: var(--ink-2); }
.prose h3 { font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -0.02em; margin: var(--space-5) 0 10px; padding-top: var(--space-4); border-top: 1px solid var(--rule); }
.prose h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p, .prose li { font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.prose p + p { margin-top: 12px; }
.prose ul { margin: 6px 0 0 20px; display: grid; gap: 6px; }
.prose a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.terms-table { width: 100%; border-collapse: collapse; margin: 14px 0 4px; font-size: 14.5px; }
.terms-table th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); }
.terms-table td { padding: 10px; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.sources { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--rule); font-size: 13px !important; line-height: 1.6; color: var(--ink-3) !important; }
.sources a { color: var(--ink-2); }

/* FAQ answer wrapper (landing uses .answer) */
.faq .answer p + p { margin-top: 10px; }
.faq .answer a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }

/* Final CTA tweaks for tool pages */
.final h2 { font-size: clamp(46px, 6.6vw, 104px); }
.final__aside strong { color: var(--cream); }

/* Free-tools strip */
.tools-strip { padding: var(--space-5) 0; border-top: 1px solid var(--rule); background: var(--ivory); }
.tools-strip__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.tools-strip h2 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-right: 8px; }
.tools-strip ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tools-strip a { display: inline-block; font-size: 14px; padding: 8px 14px; border: 1px solid var(--rule-strong); border-radius: 999px; color: var(--ink-2); background: var(--cream); transition: all 180ms ease; }
.tools-strip a:hover { border-color: var(--ink); color: var(--ink); }
.tools-strip a[aria-current="page"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }

@media (max-width: 560px) {
    .tool__panel { border-radius: 4px; }
    .dg-form fieldset { padding: var(--space-4) 14px; }
    .dg-design { padding: 14px; }
    .ls { grid-template-columns: 1fr; }
    .ls__tools { grid-template-columns: repeat(3, 1fr); }
    .mock-pair { grid-template-columns: 1fr; }
    .mock-pair__arrow { transform: rotate(90deg); justify-self: center; }
}
@media print {
    .masthead, .drawer, .colophon, .final, .tools-strip { display: none !important; }
}

/* Fixes after visual QA */
.colophon__group ul { list-style: none; padding: 0; }
.final h2 em { color: #9fb0e0; }

/* Real IQ Books screenshots (iqbooks-media/tools/, 2x captures), layered in pairs */
.shot--app img { display: block; }
.shot img.is-crop { object-fit: cover; }
.pair { position: relative; }
.pair > .shot, .pair > .mock { width: 92%; }
.pair__second { position: relative; z-index: 2; width: 70%; margin: -14% 0 0 auto; }
.pair__second > .shot, .pair__second > .mock { width: 100%; }
.pair--doc > .shot { width: 74%; }
.pair--doc .pair__second { width: 66%; margin-top: -30%; }
.pill-status--warn { background: #f6ead3; color: #8a5a12; }
@media (max-width: 560px) {
    .pair > .shot, .pair > .mock { width: 100%; }
    .pair__second { width: 90%; margin-top: -8%; }
    .pair--doc > .shot { width: 86%; }
    .pair--doc .pair__second { width: 92%; margin-top: -18%; }
}
.pair--alt > .shot:first-child { margin-left: auto; }
.pair--alt .pair__second { width: 58%; margin-left: 0; margin-right: auto; }
@media (max-width: 560px) { .pair--alt .pair__second { width: 80%; } }
.pill-status { white-space: nowrap; }

/* Mobile: the preview sits below the long form, so a pinned button jumps to it. */
.dg-jump { display: none; }
@media (max-width: 1099px) {
    .dg-jump { display: flex; position: sticky; bottom: 14px; z-index: 5; margin: 16px auto 0; width: max-content;
        align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--cream);
        font: 500 14px/1 var(--sans); text-decoration: none; box-shadow: 0 10px 28px rgba(26,26,26,.22); }
    .tool__stage { scroll-margin-top: 80px; }
}

/* Free-tool pages: the masthead lists the tools; mark the one you are on. */
.masthead__nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.drawer a[aria-current="page"] { font-style: italic; }
