/* =====================================================================
   TEMPLATE PAGE  (/templates/<slug>)  —  template-page.css

   The highest-traffic page on the site. Built on the system in
   theme.css (tokens, 12-col grid, 8px baseline, Libre Baskerville +
   Inter, navy primary / #457b9d accent, no decorative hover).

   Hierarchy
     notice      the document itself: its title and real text for
                 the reader's state
     understand  it is free to take, or Ezel finishes it for a price
     act         "Finish my document" (primary)  ·  Free Word / PDF

   Grid (desktop, >= 1024)
     container   1200px, margins var(--margin)
     columns     12, gutter 24    main = span 8 (784)   aside = span 4 (392)
     rows        1: title block | offer card    2: document sheet | (card, sticky)
     The document scrolls inside its sheet (max ~78vh) so the page stays
     about two screens tall; the full text is in the DOM for crawlers,
     exactly as the previous layout did it.
     baseline    8px  (B = 24 for body 16/24; document 17/28)
     vertical    head 32 / 24 · body gap 24 · section 96 (64 mobile)

   Type
     h1  --t-h2 40/48 serif   crumbs & meta 14/20   offer 16/24 & 14/20
     document  Times 17/28 in a white sheet, measure ~ 72ch

   Colour roles (from theme.css): paper ground, white sheet & card,
   --line hairlines, navy primary action, accent for links/checks.
   One accent. Nothing green, nothing blue outside the accent.

   Mobile (< 1024)
     one column: head → offer (compact) → sheet. The sticky bottom bar
     from _demo_modal.html shows here only; on desktop the offer card
     is sticky and does that job.
   ===================================================================== */

body.tpl { background: var(--paper); }

.tpl-page { --tpl-nav: 72px; }

/* ---------- Page head ---------- */

.tpl-head { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
.tpl-head-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-2) 0 var(--space-2);
    border-bottom: 1px solid var(--line);
}
.tpl-head-main { min-width: 0; flex: 1 1 480px; }
.tpl-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--t-small);
    line-height: 20px;
    color: var(--muted);
    margin: 0 0 var(--space-3);
}
.tpl-crumbs a { color: var(--accent); text-decoration: none; }
.tpl-crumbs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-crumbs .sep { color: var(--line-strong); }
.tpl-crumbs .current { color: var(--text); }

.tpl-title {
    font-family: var(--font-logo);
    font-size: var(--t-h2);
    line-height: 1.2;
    letter-spacing: -0.015em;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    max-width: 20em;
}
.tpl-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-1) var(--space-2);
    font-size: var(--t-small);
    line-height: 20px;
    color: var(--muted);
    margin: 0;
    padding-bottom: 6px;
    text-align: right;
}
.tpl-meta a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.tpl-meta .dot { color: var(--line-strong); }

/* ---------- Two-column body ---------- */

.tpl-body { padding: var(--space-5) var(--margin) var(--space-8); }
.tpl-body-inner {
    max-width: var(--content);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: var(--space-4);
    align-items: start;
}
.tpl-sheet { grid-column: 1 / span 8; grid-row: 2; min-width: 0; }
.tpl-aside {
    grid-column: 9 / span 4;
    grid-row: 2;
    align-self: start;
    min-width: 0;
    position: sticky;
    top: calc(var(--tpl-nav) + var(--space-4));
}

/* ---------- The sheet: toolbar + document ---------- */

.tpl-sheet {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-card);
    overflow: visible;
}
.tpl-toolbar {
    position: relative;
    z-index: 5;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-m) var(--radius-m) 0 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-2);
    min-height: 48px;
}
.tpl-toolbar .toolbar-scroll-wrap { flex: 1; min-width: 0; position: relative; }
.tpl-toolbar .toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: nowrap;
    overflow: visible;
    padding: var(--space-2) 0;
    background: transparent;
    border: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}
.tpl-toolbar .toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 var(--space-1);
    border-right: 1px solid var(--line);
    margin: 0;
    background: transparent;
}
.tpl-toolbar .toolbar-group:last-child { border-right: 0; }
.tpl-toolbar .toolbar-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-s);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: none;
    box-shadow: none;
}
.tpl-toolbar .toolbar-btn.active { background: var(--paper-2); color: var(--navy); }
.tpl-toolbar .toolbar-btn:disabled { color: var(--line-strong); cursor: default; }
.tpl-toolbar .toolbar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.tpl-toolbar .toolbar-btn .case-label,
.tpl-toolbar .toolbar-btn .insert-label { font-size: 13px; font-weight: 500; }
.tpl-toolbar .toolbar-btn#case-btn,
.tpl-toolbar .toolbar-btn#insert-btn { width: auto; padding: 0 10px; }
.tpl-toolbar .toolbar-select {
    height: 32px;
    padding: 0 var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    background: var(--white);
    color: var(--text);
    font: inherit;
    font-size: 13px;
}
.tpl-toolbar .toolbar-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.tpl-toolbar .case-group, .tpl-toolbar .insert-group { position: relative; }
.tpl-toolbar .case-menu, .tpl-toolbar .insert-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    box-shadow: var(--shadow-card);
    padding: var(--space-1);
    z-index: 20;
}
.tpl-toolbar .insert-menu { display: none; }
.tpl-toolbar .insert-menu.open { display: block; }
.tpl-toolbar .case-option, .tpl-toolbar .insert-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}
.tpl-toolbar .case-option.active { background: var(--paper-2); color: var(--navy); font-weight: 600; }
.tpl-toolbar .insert-option i { width: 16px; color: var(--muted); text-align: center; }
.tpl-toolbar .insert-divider { height: 1px; background: var(--line); margin: var(--space-1) 0; }
.tpl-toolbar .insert-chevron { font-size: 10px; color: var(--muted); }


.tpl-sheet .editor-container { position: relative; }
.tpl-sheet .editor-content {
    max-height: clamp(480px, 78vh, 1100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 0 0 var(--radius-m) var(--radius-m);
    scrollbar-color: var(--line-strong) transparent;
}
.tpl-sheet .editor-content:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* A quiet fade at the foot of the sheet says "there is more below". */
.tpl-sheet .editor-container::after {
    content: "";
    position: absolute;
    left: 1px; right: 1px; bottom: 0;
    height: 48px;
    pointer-events: none;
    border-radius: 0 0 var(--radius-m) var(--radius-m);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
}
.tpl-sheet .rich-editor {
    max-width: none;
    margin: 0;
    padding: var(--space-6) 80px;
    font-size: 18px;
    line-height: 30px;
    color: var(--text);
    background: var(--white);
    border-radius: 0 0 var(--radius-m) var(--radius-m);
    min-height: 480px;
}
.tpl-sheet .rich-editor:focus-visible { outline: none; }
.tpl-sheet .rich-editor a { color: var(--accent); }
.tpl-sheet .rich-editor > :first-child { margin-top: 0; }
.tpl-sheet .rich-editor h1 { font-size: 22px; line-height: 30px; margin: 0 0 var(--space-4); }
.tpl-sheet .rich-editor h2 { font-size: 19px; line-height: 30px; margin: var(--space-5) 0 var(--space-2); }
.tpl-sheet .rich-editor h3 { font-size: 18px; line-height: 30px; margin: var(--space-4) 0 var(--space-2); }
.tpl-sheet .rich-editor p, .tpl-sheet .rich-editor li { margin-bottom: 12px; }
.tpl-sheet .rich-editor ul, .tpl-sheet .rich-editor ol { margin: 12px 0 16px; }

/* ---------- Offer card (the one call to action) ---------- */

.tpl-offer {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-card);
    padding: var(--space-4);
}
.tpl-offer-label {
    font-size: var(--t-label);
    line-height: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 var(--space-2);
}
.tpl-offer-title {
    font-family: var(--font-logo);
    font-size: var(--t-h3);
    line-height: 32px;
    letter-spacing: -0.01em;
    color: var(--navy);
    margin: 0 0 var(--space-2);
}
.tpl-offer-body {
    font-size: var(--t-body);
    line-height: 24px;
    color: var(--text);
    margin: 0 0 var(--space-3);
}
.tpl-offer-price {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
    color: var(--muted);
    font-size: var(--t-small);
    line-height: 20px;
}
.tpl-offer-price strong {
    font-family: var(--font-logo);
    font-size: 32px;
    line-height: 40px;
    color: var(--navy);
    font-weight: 700;
    letter-spacing: -0.01em;
}
.tpl-offer-fine {
    font-size: var(--t-small);
    line-height: 20px;
    color: var(--muted);
    margin: var(--space-2) 0 0;
}
.tpl-offer-free {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}
.tpl-offer-free-label {
    font-size: var(--t-small);
    line-height: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 var(--space-2);
}
.tpl-offer-free-btns { display: flex; gap: var(--space-2); }
.tpl-offer-free-btns .tpl-btn { flex: 1; }
.tpl-offer-free.tpl-attention .tpl-btn--secondary { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons (theme.css spec: pill, 16/600, no hover effects) ---------- */

.tpl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 48px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-pill);
    font: inherit;
    font-size: var(--t-body);
    font-weight: 600;
    line-height: 24px;
    text-decoration: none;
    cursor: pointer;
    transition: none;
    box-shadow: none;
    white-space: nowrap;
}
.tpl-btn--primary { background: var(--navy); color: var(--on-dark); border: 1px solid var(--navy); }
.tpl-btn--secondary { background: var(--white); color: var(--navy); border: 1px solid var(--line-strong); }
.tpl-btn--secondary i { color: var(--muted); }
.tpl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-btn--sm { min-height: 40px; font-size: var(--t-small); padding: 0 var(--space-3); }

/* ---------- Editorial sections: heading column (4) + content column (8) ----------
   Related templates and About this template share one structure: the
   heading, a one-line lead and the facts sit in the left 4 columns; the
   body fills the right 8. Same 12-col grid and gutter as the sheet above. */

.tpl-section { padding: var(--space-8) var(--margin); }
.tpl-section--white { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tpl-section-inner { max-width: var(--content); margin: 0 auto; }
.tpl-cols {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: var(--space-5);
    align-items: start;
}
.tpl-cols-head { grid-column: 1 / span 4; min-width: 0; }
.tpl-cols-body { grid-column: 5 / span 8; min-width: 0; }
.tpl-cols-head h2 {
    font-family: var(--font-logo);
    font-size: var(--t-h2);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--navy);
    margin: 0 0 var(--space-3);
}
.tpl-cols-head > p {
    font-size: var(--t-body);
    line-height: 24px;
    color: var(--muted);
    margin: 0;
    max-width: 22em;
}

/* Facts list (About): label / value pairs on the baseline grid */
.tpl-facts { margin: var(--space-4) 0 0; padding: 0; }
.tpl-facts > div {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    column-gap: var(--space-3);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--line);
    font-size: var(--t-small);
    line-height: 20px;
}
.tpl-facts > div:last-child { border-bottom: 1px solid var(--line); }
.tpl-facts dt { color: var(--muted); margin: 0; }
.tpl-facts dd { color: var(--text); margin: 0; }
.tpl-cites-title {
    font-size: var(--t-label);
    line-height: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent);
    margin: var(--space-5) 0 var(--space-2);
}
.tpl-cites { list-style: none; margin: 0; padding: 0; }
.tpl-cites li {
    font-size: var(--t-small);
    line-height: 20px;
    color: var(--text);
    padding: var(--space-1) 0 var(--space-1) var(--space-3);
    border-left: 2px solid var(--line);
}
.tpl-cites li + li { margin-top: var(--space-1); }

/* Related: chip groups */
.tpl-related-group + .tpl-related-group { margin-top: var(--space-5); }
.tpl-related-group h3 {
    font-size: var(--t-label);
    line-height: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 var(--space-3);
}
.tpl-related-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.tpl-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 40px;
    padding: 0 var(--space-3);
    background: var(--paper-2);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: var(--t-small);
    line-height: 20px;
    font-weight: 500;
    text-decoration: none;
}
.tpl-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-chip .jurisdiction-badge {
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
    background: var(--white);
    border-radius: var(--radius-pill);
    padding: 0 6px;
}
.tpl-related-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 var(--space-2);
    color: var(--accent);
    font-size: var(--t-small);
    font-weight: 600;
    text-decoration: none;
}

/* About: lead paragraph and the two notes */
.tpl-about-lead { font-size: var(--t-lead); line-height: 1.5; color: var(--text); margin: 0 0 var(--space-5); max-width: 36em; }
.tpl-note {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: var(--space-3);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--line);
}
.tpl-note:last-child { border-bottom: 1px solid var(--line); }
.tpl-note i { color: var(--accent); font-size: 16px; line-height: 24px; text-align: center; }
.tpl-note h3 { font-size: var(--t-body); line-height: 24px; font-weight: 600; color: var(--navy); margin: 0 0 var(--space-1); }
.tpl-note p { font-size: var(--t-small); line-height: 20px; color: var(--muted); margin: 0 0 var(--space-2); }
.tpl-note p:last-child { margin-bottom: 0; }

/* ---------- Closing band ---------- */

.tpl-band { background: var(--navy); color: var(--on-dark); padding: var(--space-8) var(--margin); }
.tpl-band-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.tpl-band h2 {
    font-family: var(--font-logo);
    font-size: var(--t-h2);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--on-dark);
    margin: 0 0 var(--space-3);
}
.tpl-band p { font-size: var(--t-lead); line-height: 1.5; color: var(--on-dark-muted); margin: 0 0 var(--space-5); }
.tpl-band .tpl-btn { width: auto; min-width: 260px; background: var(--white); color: var(--navy); border: 1px solid var(--white); box-shadow: none; }

/* ---------- Email modal + post-download offer (markup in template_page.html) ---------- */

.tpl-page .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 58, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    z-index: 1000;
}
.tpl-page .modal-overlay.show { display: flex; }
.tpl-page .modal.email-modal-new {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-frame);
    padding: 0;
    overflow: hidden;
}
.tpl-page .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-4) 0;
    border: 0;
    background: transparent;
}
.tpl-page .modal-header h3 {
    font-family: var(--font-logo);
    font-size: var(--t-h3);
    line-height: 32px;
    color: var(--navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.tpl-page .modal-header h3 i { color: var(--accent); font-size: 18px; }
.tpl-page .modal .modal-close {
    width: 32px; height: 32px;
    border: 0; background: var(--paper-2); border-radius: 50%;
    color: var(--muted); cursor: pointer; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.tpl-page .modal-content { padding: var(--space-3) var(--space-4) var(--space-4); }
.tpl-page .email-modal-description { font-size: var(--t-body); line-height: 24px; color: var(--text); margin: 0 0 var(--space-3); }
.tpl-page .tpl-field-label { display: block; font-size: var(--t-small); line-height: 20px; font-weight: 600; color: var(--text); margin: 0 0 var(--space-1); }
.tpl-page .email-input-label { display: none; }
.tpl-page #email-input {
    width: 100%;
    min-height: 48px;
    padding: 0 var(--space-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    font: inherit;
    font-size: var(--t-body);
    color: var(--text);
    background: var(--white);
}
.tpl-page #email-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.tpl-page .validation-message { font-size: var(--t-small); line-height: 20px; color: #a13d2d; margin: var(--space-1) 0 0; }
.tpl-page .form-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.tpl-page .form-actions .btn-primary,
.tpl-page .form-actions .btn-secondary {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: 48px; padding: 0 var(--space-3);
    border-radius: var(--radius-pill);
    font: inherit; font-size: var(--t-body); font-weight: 600;
    cursor: pointer; transition: none; box-shadow: none;
}
.tpl-page .form-actions .btn-primary { background: var(--navy); color: var(--on-dark); border: 1px solid var(--navy); }
.tpl-page .form-actions .btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--line-strong); }
.tpl-page .form-actions .btn-primary:focus-visible,
.tpl-page .form-actions .btn-secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-page .form-actions .btn-secondary i { display: none; }
.tpl-page .email-disclaimer {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: var(--t-label); line-height: 16px; color: var(--muted);
    margin: var(--space-3) 0 0;
}
.tpl-page .modal-content > p.tpl-offer-line { text-align: left; font-weight: 600; color: var(--navy); font-size: var(--t-body); line-height: 24px; margin: 0 0 var(--space-3); }

/* Image / table dialogs keep their style.css look; only the overlay tint. */
.tpl-page .dialog-overlay { background: rgba(11, 31, 58, 0.55); }

/* ---------- Sticky bottom bar (markup in _demo_modal.html) — mobile only ---------- */

body.tpl .sticky-bottom-bar {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--margin);
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(11, 31, 58, 0.08);
    transform: translateY(100%);
    transition: transform 0.2s ease;
}
body.tpl .sticky-bottom-bar.visible { transform: none; }
body.tpl .sticky-bar-text { display: none; }
body.tpl .sticky-bar-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 var(--space-3);
    border-radius: var(--radius-pill);
    font: inherit; font-size: var(--t-small); font-weight: 600;
    cursor: pointer; transition: none; box-shadow: none; white-space: nowrap;
}
body.tpl .sticky-bar-btn-primary { flex: 1; background: var(--navy); color: var(--on-dark); border: 1px solid var(--navy); }
body.tpl .sticky-bar-btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--line-strong); }
body.tpl .sticky-bar-btn-secondary[data-format="pdf"] { display: none; }
body.tpl .sticky-bar-close {
    width: 36px; height: 36px; flex: 0 0 auto;
    border: 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer;
}
body.tpl:has(.sticky-bottom-bar.visible) .feedback-trigger { bottom: 84px; }

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
    .tpl-body { padding-top: var(--space-4); padding-bottom: var(--space-7); }
    .tpl-body-inner { grid-template-columns: minmax(0, 1fr); }
    .tpl-head, .tpl-aside, .tpl-sheet { grid-column: 1; }
    .tpl-head { grid-row: 1; }
    .tpl-head-inner { display: block; }
    .tpl-title { margin-bottom: var(--space-2); }
    .tpl-meta { justify-content: flex-start; text-align: left; padding-bottom: 0; }
    .tpl-aside { grid-row: 2; }
    .tpl-sheet { grid-row: 3; }
    .tpl-sheet .editor-content { max-height: 70vh; }
    .tpl-main, .tpl-aside { grid-column: auto; }
    .tpl-aside { position: static; }
    .tpl-offer-body { font-size: var(--t-small); line-height: 20px; }
    .tpl-offer-row { display: flex; align-items: center; gap: var(--space-3); }
    .tpl-offer-row .tpl-offer-price { margin: 0; flex: 0 0 auto; }
    .tpl-offer-row .tpl-btn { flex: 1; }
    .tpl-offer-free { margin-top: var(--space-3); padding-top: var(--space-3); }
    .tpl-offer-free-label { display: none; }
    .tpl-offer-free .tpl-offer-fine { display: none; }
    .tpl-sheet .rich-editor { padding: var(--space-5) var(--space-4); font-size: 16px; line-height: 26px; }
    body.tpl .sticky-bottom-bar { display: flex; }
    .tpl-section { padding: var(--space-7) var(--margin); }
    .tpl-cols { display: block; }
    .tpl-cols-head { margin-bottom: var(--space-5); }
    .tpl-band { padding: var(--space-7) var(--margin); }
}

@media (min-width: 1024px) {
    .tpl-offer-row { display: contents; }
}

@media (max-width: 640px) {
    .tpl-head-inner { padding-top: var(--space-4); padding-bottom: var(--space-3); }
    .tpl-title { font-size: 28px; }
    .tpl-offer { padding: var(--space-3); }
    .tpl-offer-row { flex-wrap: wrap; }
    .tpl-offer-row .tpl-btn { flex-basis: 100%; }
    .tpl-sheet .rich-editor { padding: var(--space-4) var(--space-3); }
    .tpl-sheet .rich-editor h1 { font-size: 18px; line-height: 26px; }
    .tpl-toolbar { padding: 0 var(--space-1); }
    .tpl-toolbar .toolbar { flex-wrap: wrap; }
    .tpl-toolbar .toolbar-group { border-right: 0; }
    /* Two rows on a phone: reading is the job here, the rarer controls go. */
    .tpl-toolbar #strikethrough-btn, .tpl-toolbar #blockquote-btn, .tpl-toolbar .case-group { display: none; }
    .tpl-toolbar .insert-label { display: inline; }
    .tpl-band .tpl-btn { width: 100%; min-width: 0; }
    body.tpl .sticky-bar-btn-secondary { display: none; }
}
