/* ======================================
   GrimoirePrint — the F1 "Guided Wall" landing page
   Loaded by index.html only. The controls laid out here are the converter's
   own (.scheme-thumb, .bg-thumb, .dropcap-style-btn, [data-columns],
   [data-paper]); styles.css still owns how each one looks on its own.
   ====================================== */

/* ---- Frame ---- */
.converter {
    /* The nav is fixed, so the fold starts under it. */
    padding: 64px 0 40px;
}

.f1.converter-app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.f1 button {
    font-family: var(--body-font);
}

/* ---- Fold head ---- */
.fold-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 4px 0 10px;
}

.fold-head h1 {
    font-family: var(--heading-font);
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text);
}

.free-badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    font-size: 12.5px;
    white-space: nowrap;
    background: rgba(200, 166, 78, 0.08);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.free-badge b {
    color: var(--accent);
    font-weight: 600;
}

.free-badge-sep {
    color: rgba(200, 166, 78, 0.4);
}

.fold-alt {
    flex-basis: 100%;
    margin-top: -4px;
    font-size: 12px;
    color: var(--text-muted);
}

.fold-alt a {
    color: var(--accent);
    text-decoration: none;
}

/* ---- The flow: three beats, arrows between, the action inside the last ---- */
.flow {
    display: grid;
    grid-template-columns: 1fr 28px 1fr 28px 1.4fr;
    align-items: stretch;
    margin-bottom: 12px;
}

.flow-beat {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

a.flow-beat:hover {
    border-color: rgba(200, 166, 78, 0.5);
}

.flow-beat-final {
    border-color: rgba(200, 166, 78, 0.45);
    background: linear-gradient(180deg, rgba(200, 166, 78, 0.09), var(--surface));
}

.flow-n {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #0c0a14;
    font-family: var(--body-font);
    font-size: 11.5px;
    font-weight: 700;
}

.flow-t {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}

.flow-sub {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.flow-new {
    color: var(--accent);
    font-weight: 600;
}

.flow-arrow {
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 17px;
    opacity: 0.75;
}

.flow-go {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    min-width: 190px;
    max-width: 300px;
}

.flow-go .btn-convert {
    justify-content: center;
    padding: 9px 18px;
    font-weight: 700;
    box-shadow: 0 4px 16px var(--accent-glow);
    white-space: nowrap;
}

.flow-go .btn-convert:disabled {
    opacity: 0.6;
    cursor: default;
}

.flow-credits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.flow-credits .free-counter {
    padding: 0;
    gap: 4px;
    background: none;
    border: 0;
}

.flow-credits .free-counter-num {
    font-size: 0.95rem;
}

.flow-credits .btn-unlock {
    width: auto;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-family: var(--body-font);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0;
}

.flow-go .signin-nudge {
    align-self: center;
}

/* One line under the button rather than two: the beat sets the band's height. */
.flow-go .watermark-note a {
    display: inline;
    margin: 0 0 0 3px;
}

/* ---- Panel tabs: a phone's three panels. Hidden on a wide screen. ---- */
.f1 .panel-tabs {
    display: none;
}

/* Phone-only, like the tabs: the sample note, the look copy that points at ③,
   and the letters that stand in for the look's step numbers inside tab ②. */
.sample-strip,
.look-sum-phone,
.n-letter {
    display: none;
}

/* ---- The tool: two cards, then the syntax strip and the look, full width ---- */
.f1 .converter-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
}

.card-editor { grid-column: 1; }
.card-preview { grid-column: 2; }
.syntax-strip,
.look-panel { grid-column: 1 / -1; }

.tool-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: clamp(430px, calc(100vh - 360px), 700px);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 9px;
    padding: 7px 12px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.card-step {
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--accent);
    color: #0c0a14;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0;
}

.card-bar .editor-actions {
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
}

.card-hint {
    margin-left: auto;
    font-size: 11.5px;
    letter-spacing: 0;
    text-transform: none;
}

.f1 .panel {
    flex: 1 1 auto;
    min-height: 0;
}

.f1 .panel-editor {
    position: relative;
}

.f1 #editor {
    min-height: 0;
}

/* The image-drop affordance: a real button, and a drop target because it
   sits inside .panel-editor. */
.drop-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 11px 9px;
    padding: 8px 11px;
    text-align: left;
    color: var(--text-muted);
    background: rgba(200, 166, 78, 0.05);
    border: 1px dashed rgba(200, 166, 78, 0.45);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.drop-strip:hover,
.drop-strip:focus-visible {
    background: rgba(200, 166, 78, 0.12);
    border-color: var(--accent);
}

.drop-strip-icon {
    font-size: 16px;
}

.drop-strip-text {
    font-size: 11.5px;
    line-height: 1.45;
}

.drop-strip-text b {
    display: block;
    color: var(--text);
    font-weight: 600;
}

.new-tag {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 2px 6px;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: #0c0a14;
    background: var(--accent);
    border-radius: 3px;
}

.sample-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 11px;
    background: rgba(28, 26, 46, 0.5);
    border-top: 1px solid var(--border);
}

.sample-chips-label {
    font-size: 11.5px;
    color: var(--text-muted);
}

.sample-chip {
    padding: 5px 10px;
    font-size: 11.5px;
    color: var(--text);
    background: rgba(200, 166, 78, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}

.sample-chip:hover,
.sample-chip.is-on {
    background: rgba(200, 166, 78, 0.18);
    border-color: var(--accent);
}

.sample-chip:disabled {
    opacity: 0.6;
    cursor: progress;
}

/* ---- What the editor reads — a strip, and a panel opened on request ---- */
.syntax-strip {
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.syntax-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 13px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.syntax-top b {
    color: var(--text);
    font-weight: 500;
}

.syntax-tok {
    padding: 4px 9px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: #d8d2c2;
    background: rgba(200, 166, 78, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}

.syntax-tok:hover {
    background: rgba(200, 166, 78, 0.18);
    border-color: var(--accent);
}

.syntax-more,
.step-more {
    padding: 5px 13px;
    font-size: 12px;
    color: var(--accent);
    white-space: nowrap;
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}

.syntax-more {
    margin-left: auto;
}

.syntax-more:hover,
.step-more:hover {
    background: rgba(200, 166, 78, 0.12);
}

.caret {
    display: inline-block;
    margin-left: 3px;
    transition: transform 0.2s;
}

[aria-expanded="true"] > .caret {
    transform: rotate(180deg);
}

.syntax-more-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
    padding: 14px 13px;
    background: rgba(12, 10, 20, 0.5);
    border-top: 1px solid var(--border);
}

.syntax-more-panel[hidden] {
    display: none;
}

.syntax-card {
    position: relative;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.syntax-card-new {
    border-color: rgba(200, 166, 78, 0.45);
}

.syntax-card .new-tag {
    position: absolute;
    top: 8px;
    right: 8px;
}

.syntax-card h3 {
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

.syntax-card > code {
    display: block;
    margin-bottom: 5px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 10.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--accent);
}

.syntax-card p {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-muted);
}

.syntax-card p code {
    color: var(--accent);
}

.syntax-guide {
    grid-column: 1 / -1;
    font-size: 12px;
    text-align: right;
}

.syntax-guide a {
    color: var(--accent);
}

/* ---- ② Pick a look: an ordered accordion of the real controls ---- */
.look-panel {
    margin-top: 6px;
}

/* The page-one pin is for a phone. Here the page is above the look. */
.look-pin {
    display: none;
}

.look-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 11px;
    margin-bottom: 10px;
}

.look-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--heading-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.look-sum {
    font-size: 12.5px;
    color: var(--text-muted);
}

.look-legend {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    font-size: 11.5px;
    color: var(--text-muted);
}

.look-legend a {
    color: var(--accent);
}

.pro-badge {
    display: inline-block;
    padding: 2px 5px;
    font-family: var(--body-font);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    color: #0c0a14;
    background: var(--accent);
    border-radius: 3px;
}

.thumb-btn > .pro-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2;
}

.look-rail {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.rail-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}

.rail-n {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 10px;
    border: 1px solid var(--border);
    border-radius: 50%;
}

.rail-count {
    font-size: 10.5px;
    color: var(--accent);
    opacity: 0.85;
}

.rail-step.is-current {
    color: var(--text);
    background: rgba(200, 166, 78, 0.15);
    border-color: var(--accent);
}

.rail-step.is-current .rail-n {
    color: #0c0a14;
    font-weight: 700;
    background: var(--accent);
    border-color: var(--accent);
}

.rail-sep {
    padding: 0 7px;
    font-size: 13px;
    color: var(--accent);
    opacity: 0.6;
}

.look-step {
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.look-step-h {
    margin: 0;
    font: inherit;
}

.look-step-toggle {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 11px 14px;
    color: var(--text);
    text-align: left;
    background: var(--surface-2);
    border: 0;
    cursor: pointer;
}

.step-n {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 21px;
    height: 21px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 50%;
}

.look-step.is-open .step-n {
    color: #0c0a14;
    background: var(--accent);
}

.step-t {
    font-family: var(--heading-font);
    font-size: 14.5px;
    font-weight: 700;
}

.step-count {
    padding: 2px 8px;
    font-size: 11px;
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.step-pick {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.step-pick b {
    font-weight: 500;
    color: var(--text);
}

.look-step-toggle .caret {
    font-size: 12px;
    color: var(--accent);
}

.look-step-body {
    padding: 14px;
}

.look-step-body[hidden] {
    display: none;
}

.step-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 12px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.step-foot .step-more {
    margin-left: auto;
}

/* The shared thumb button, re-proportioned for a wall. */
.f1 .thumb-btn {
    position: relative;
    padding: 0;
    gap: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.f1 .thumb-btn:hover:not(:disabled) {
    border-color: rgba(200, 166, 78, 0.6);
}

.f1 .thumb-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.f1 .thumb-btn .thumb-label {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: none;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
}

.f1 .thumb-btn.active .thumb-label {
    color: var(--text);
}

.scheme-wall {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 11px;
}

.scheme-card .scheme-face {
    display: block;
    aspect-ratio: 360 / 509;
    border: 0;
    border-radius: 0;
    background: #f4edd8;
}

.scheme-card .scheme-face img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.scheme-card .thumb-label i {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 2px;
}

/* A locked render stays readable: the page is the pitch. */
.f1 .scheme-card.scheme-locked .thumb-swatch::after {
    background-color: rgba(0, 0, 0, 0.18);
    background-size: 26px 26px;
}

.bg-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 9px;
}

.bg-wall .thumb-swatch {
    aspect-ratio: auto;
    height: 58px;
    border: 0;
    border-radius: 0;
}

.cap-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.cap-row .thumb-btn {
    width: 86px;
}

.cap-row .dropcap-preview {
    width: 100%;
}

.cap-row .thumb-more-icon {
    aspect-ratio: auto;
    height: 52px;
}

.layout-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 260px));
    gap: 18px;
}

.layout-box h4 {
    margin-bottom: 9px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.layout-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.layout-toggle .option-icon {
    aspect-ratio: auto;
    height: 40px;
    border: 0;
    border-radius: 0;
}

.layout-toggle .thumb-label {
    justify-content: center;
}

.layout-toggle-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* The text size choice, shown as the size it picks. */
.layout-toggle .type-sample {
    font-family: Georgia, serif;
    font-size: 19px;
}

.layout-toggle .type-sample-small {
    font-size: 15px;
}

.layout-toggle .type-sample-large {
    font-size: 24px;
}

/* ---- The summary of choices, and the second Download ---- */
.look-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(200, 166, 78, 0.09), var(--surface));
    border: 1px solid rgba(200, 166, 78, 0.4);
    border-radius: var(--radius);
}

.look-summary-text {
    min-width: 0;
    font-size: 13px;
}

.look-summary-text b {
    color: var(--text);
}

.look-summary-text span {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.look-summary-go {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 10px;
    max-width: 380px;
}

.look-summary-go .btn-download-bottom {
    justify-content: center;
    font-weight: 700;
}

.look-summary-go .btn-download-bottom:disabled {
    opacity: 0.6;
    cursor: default;
}

.look-summary-go .free-counter-bottom {
    border-radius: var(--radius-sm);
    border-left: 1px solid rgba(200, 166, 78, 0.12);
}

.look-summary-go .watermark-note {
    flex: 0 0 100%;
    text-align: right;
}

/* ---- Bands below the tool ---- */
.f1-band {
    padding: 46px 0;
}

.f1-band-h {
    font-family: var(--heading-font);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.f1-band-sub {
    max-width: 680px;
    margin: 7px 0 22px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text-muted);
}

/* ---- The proof: a real page beside its Markdown, then three more documents ---- */
.proof-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.proof-ba {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px 220px;
    align-items: stretch;
    gap: 0 10px;
    margin: 0;
}

.proof-label {
    display: block;
    margin-bottom: 6px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
}

/* Sized by the page beside it, never by the excerpt. */
.proof-md {
    position: relative;
    min-width: 0;
    contain: size;
    overflow: hidden;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* The excerpt is trimmed, so it fades out rather than stopping at an edge. */
.proof-md::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--bg));
}

.proof-md pre {
    margin: 0;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre;
}

.proof-arrow {
    align-self: center;
    font-size: 20px;
    color: var(--accent);
    text-align: center;
}

.proof-page {
    display: block;
    color: inherit;
    text-decoration: none;
}

.proof-page img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 360 / 509;
    padding: 6px;
    background: #e9e1cb;
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    transition: border-color 0.2s, transform 0.2s;
}

.proof-page:hover img {
    border-color: rgba(200, 166, 78, 0.6);
    transform: translateY(-2px);
}

.proof-ba figcaption {
    grid-column: 1 / -1;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.proof-ba figcaption a {
    color: var(--accent);
}

.proof-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding-top: 22px;
}

.page-card {
    display: block;
    overflow: hidden;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, transform 0.2s;
}

.page-card:hover {
    border-color: rgba(200, 166, 78, 0.6);
    transform: translateY(-2px);
}

/* A light mat, so a dark-scheme page still reads as a page on a dark card. */
.page-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 240 / 339;
    object-fit: cover;
    padding: 6px;
    background: #e9e1cb;
}

.page-card span {
    display: block;
    padding: 9px 11px;
    font-family: var(--preview-font);
    font-size: 13.5px;
}

.page-card small {
    display: block;
    margin-top: 2px;
    font-family: var(--body-font);
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.8;
}

.f1-band-more {
    margin-top: 16px;
    font-size: 13px;
}

.f1-band-more a {
    color: var(--accent);
}

/* ---- Between the phone layout and a wide desktop ---- */
@media (max-width: 1180px) {
    .scheme-wall {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .proof-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .proof-cards {
        grid-template-columns: repeat(3, minmax(0, 190px));
        padding-top: 0;
    }

    .syntax-more-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .flow-sub {
        font-size: 11.5px;
    }

    .flow {
        grid-template-columns: 1fr 24px 1fr 24px 1.8fr;
    }

    .flow-go {
        min-width: 170px;
    }

    .flow-beat-final .flow-sub {
        display: none;
    }
}

/* ======================================
   Phone: three numbered tabs for the steps, and a sticky Download bar.
   A media query rather than a script-set class, so the layout is right
   before any script runs and in any harness that can size a viewport.
   ====================================== */
@media (max-width: 860px) {
    .converter {
        padding-top: 58px;
    }

    /* Where the stuck tabs end, under the nav (57px) and the tabs (48px), and
       where a panel or look step scrolled to starts, 10px lower. */
    .f1.converter-app {
        --tabs-bottom: 105px;
        --under-tabs: calc(var(--tabs-bottom) + 10px);
        /* Tab ②'s page-one pin, stuck under the tabs. */
        --look-pin-h: 90px;
        padding: 0 15px;
    }

    .fold-head {
        display: block;
        margin-bottom: 10px;
    }

    /* One line on any phone: the headline is ~16.4em wide, and this leaves
       a few percent of slack for font metrics that differ from Chrome's. */
    .fold-head h1 {
        font-size: min(21px, calc(5.8vw - 1.5px));
    }

    .free-badge {
        display: inline-flex;
        margin: 6px 0 0;
        font-size: 12px;
        white-space: normal;
    }

    /* The menu carries the Standard Edition link on a phone. */
    .fold-alt {
        display: none;
    }

    /* The tabs are the steps on a phone, so the flow band would be a second
       copy of them above the fold. */
    .flow {
        display: none;
    }

    /* Full width and stuck under the nav, so another step is one tap away
       from anywhere in the tool. */
    .f1 .panel-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        position: sticky;
        top: 57px;
        z-index: 40;
        margin: 0 -15px 10px;
        padding: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
    }

    .f1 .panel-tab {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 46px;
        padding: 0 4px;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-muted);
        background: none;
        border: 0;
        border-radius: 0;
    }

    .f1 .panel-tab + .panel-tab {
        border-left: 1px solid var(--border);
    }

    .f1 .panel-tab.active {
        color: var(--text);
        background: rgba(200, 166, 78, 0.07);
    }

    .f1 .panel-tab.active::after {
        content: '';
        position: absolute;
        left: 14px;
        right: 14px;
        bottom: -1px;
        height: 3px;
        border-radius: 3px 3px 0 0;
        background: var(--accent);
    }

    .tab-n {
        width: 20px;
        height: 20px;
        border: 1.5px solid rgba(200, 166, 78, 0.5);
        border-radius: 50%;
        font-size: 11px;
        font-weight: 700;
        line-height: 17px;
        text-align: center;
        color: var(--accent);
    }

    .panel-tab.active .tab-n {
        color: #0c0a14;
        background: var(--accent);
        border-color: var(--accent);
    }

    .f1 .converter-panels.showing-preview > .sample-strip:not([hidden]) {
        display: flex;
    }

    .sample-strip {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 4px 8px;
        margin: 0;
        padding: 8px 12px;
        font-size: 13px;
        color: var(--text-muted);
        background: rgba(200, 166, 78, 0.07);
        border: 1px dashed rgba(200, 166, 78, 0.55);
        border-radius: var(--radius-sm);
    }

    .sample-strip a {
        color: var(--accent);
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
    }

    /* Where a tab switch scrolls to: just under the nav and the stuck tabs. */
    .f1 .converter-panels {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        scroll-margin-top: var(--under-tabs);
    }

    .card-editor,
    .card-preview,
    .syntax-strip,
    .look-panel {
        grid-column: 1;
    }

    /* One panel at a time, chosen by the tab. */
    .f1 .converter-panels > * {
        display: none;
    }

    .f1 .converter-panels.showing-preview > .card-preview,
    .f1 .converter-panels.showing-editor > .card-editor {
        display: flex;
    }

    .f1 .converter-panels.showing-editor > .syntax-strip,
    .f1 .converter-panels.showing-look > .look-panel {
        display: block;
    }

    .tool-card {
        height: clamp(420px, calc(100vh - 230px), 640px);
    }

    .card-bar .editor-actions {
        flex-wrap: wrap;
    }

    .card-hint {
        margin-left: 0;
    }

    .syntax-more {
        width: 100%;
        margin-left: 0;
    }

    .syntax-more-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .look-panel {
        margin-top: 0;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }

    .look-head {
        display: block;
    }

    .look-head h2 {
        font-size: 15.5px;
    }

    .look-sum {
        margin-top: 4px;
    }

    /* The page is on another tab here, not above. */
    .look-sum-wide {
        display: none;
    }

    .look-sum-phone {
        display: inline;
    }

    /* Inside tab ② the look's own steps are a–d, so they do not read as a
       second ①②③. */
    .n-digit {
        display: none;
    }

    .n-letter {
        display: inline;
    }

    .look-legend {
        margin: 7px 0 0;
    }

    .look-rail {
        overflow-x: auto;
        padding-bottom: 3px;
        margin-bottom: 10px;
    }

    .rail-step {
        flex: 0 0 auto;
        padding: 7px 11px;
        font-size: 12px;
    }

    /* Where reveal() scrolls a step to: clear of the nav, the stuck tabs and
       the pin. */
    .look-step {
        scroll-margin-top: calc(var(--under-tabs) + var(--look-pin-h));
    }

    /* Page one, stuck under the tabs while the cards scroll, so a choice shows
       without leaving ②. Full-bleed, like the tabs: the panel's border and
       padding plus the page gutter. */
    .look-pin {
        position: sticky;
        top: var(--tabs-bottom);
        z-index: 30;
        display: flex;
        align-items: center;
        gap: 12px;
        height: var(--look-pin-h);
        margin: -13px -28px 12px;
        padding: 0 15px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
    }

    .look-pin-page {
        position: relative;
        flex: 0 0 auto;
        width: 54px;
        aspect-ratio: 210 / 297;
        overflow: hidden;
        border-radius: 2px;
        background: #fdf6e3;
        box-shadow: 0 0 0 1px rgba(200, 166, 78, 0.5), 0 4px 10px rgba(0, 0, 0, 0.5);
        cursor: pointer;
    }

    /* Both of the pin's panes are laid out 600px wide. The one on show is
       scaled to the 54px page: 54 / 600. */
    .look-pin .preview-content {
        width: 600px;
        overflow: hidden;
        scrollbar-gutter: auto;
    }

    .look-pin-page .preview-content {
        position: absolute;
        top: 0;
        left: 0;
        transform: scale(0.09);
        transform-origin: 0 0;
    }

    /* The background art once down the page, as the PDF lays it under each
       page. The pane's own clamp to 100vh would tile it on a short screen. */
    .look-pin-page .preview-content::before {
        background-size: auto 100%;
    }

    /* Page one ends where its text area does, even where the pager opened no
       gap to mark it: between table rows, or inside a block too tall to move. */
    .look-pin-page .preview-sheet {
        clip-path: inset(0 0 calc(100% - var(--pg-margin-top) - var(--pg-usable)) 0);
    }

    /* Where the pager measures: laid out, never seen. */
    .look-pin-measure {
        position: absolute;
        top: 0;
        left: 0;
        width: 0;
        height: 0;
        overflow: hidden;
        visibility: hidden;
    }

    .look-pin-text {
        min-width: 0;
        margin: 0;
        font-size: 12.5px;
        line-height: 1.4;
        color: var(--text-muted);
    }

    .look-pin-text b {
        display: block;
        color: var(--text);
        font-weight: 600;
    }

    .look-pin-text a {
        display: inline-block;
        margin-top: 4px;
        color: var(--accent);
        font-weight: 600;
        text-decoration: none;
    }

    /* The pin carries the summary on ②, so there the bar is just Download. */
    .f1.converter-app:has(.converter-panels.showing-look) .look-summary-text {
        display: none;
    }

    .look-step-toggle {
        gap: 9px;
        padding: 10px 12px;
    }

    .step-t {
        font-size: 13px;
    }

    .step-pick {
        display: none;
    }

    .look-step-toggle .caret {
        margin-left: auto;
    }

    .look-step-body {
        padding: 11px;
    }

    .scheme-wall {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .bg-wall {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .cap-row .thumb-btn {
        width: calc((100% - 27px) / 4);
    }

    .layout-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    /* The summary becomes the sticky Download bar. It sits above the consent
       banner while that is up (consent.js measures it), rather than under it. */
    .look-summary {
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--gp-consent-height, 0px);
        z-index: 60;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin: 0;
        padding: 9px 13px calc(9px + env(safe-area-inset-bottom));
        border: 0;
        border-top: 1px solid var(--border);
        border-radius: 0;
        background: var(--bg);
    }

    .look-summary-text {
        font-size: 12px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .look-summary-text span {
        display: none;
    }

    .look-summary-go {
        max-width: none;
        margin: 0;
    }

    .look-summary-go .btn-download-bottom {
        flex: 1;
        padding: 13px;
        font-size: 15px;
    }

    /* The bar is the only place a phone shows the credit-line note. Sign-in
       is the chip in the nav. */
    .look-summary-go .watermark-note {
        font-size: 11px;
        text-align: center;
    }

    .look-summary-go .watermark-note a {
        display: inline;
        margin: 0 0 0 3px;
    }

    .look-summary-go .signin-nudge {
        display: none;
    }

    /* Clears the bar at its tallest, where the credit-line note wraps (320px).
       consent.js ends the page with a spacer for its banner. */
    body {
        padding-bottom: calc(136px + env(safe-area-inset-bottom));
    }

    .f1-band {
        padding: 34px 0;
    }

    .f1-band-h {
        font-size: 20px;
    }

    /* Side by side still, so the before/after reads as one picture. */
    .proof-ba {
        grid-template-columns: minmax(0, 1fr) minmax(0, 44%);
        gap: 0 8px;
    }

    .proof-arrow {
        display: none;
    }

    .proof-md {
        padding: 10px;
    }

    /* Long lines clip, as in an editor; wrapping would drop the > markers. */
    .proof-md pre {
        font-size: 9.5px;
        line-height: 1.5;
    }

    .proof-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .page-card img {
        padding: 4px;
    }

    .page-card span {
        padding: 7px 8px;
        font-size: 12px;
        line-height: 1.25;
    }

    .page-card small {
        font-size: 10px;
    }
}
