/* site-polish.css - shared look of isaev.ca staging pages, linked last in <head> by the <!--polish:css--> marker.
   Source: C:\Blog\polish\site-polish.css, copied to design-assets by `python -m polish.apply --target staging`.
   20.10.2026: the general visual-polish job was stopped by the client; its draft rules are kept UNSHIPPED in
   polish/site-polish.draft.css. This file ships ONLY the paperversions rules (client request of Lyaman, 20.10.2026).
   Every rule is scoped by P = :root:has(link[data-polish-page="paperversions"]) - the attribute is written only into
   the *-paperversions pages by `polish.apply --scope paperversions`, so no other page can match. Text, section order,
   photos (size), menu and footer are not touched; only layout of the delivery-options section and the terms section. */

/* Part B (20.10.2026, round 2, after the client resumed the job) is at the end of this file: the approved general rules,
   scoped by G = :where(:root:has(link[data-polish-set~="general"])) - the attribute is written only into the pages
   listed explicitly on the command line of `polish.apply --scope batch --pages ...`. */

/* ======== PART A: paperversions ======== */
/* ---- 1. One left-aligned column: the content edge equals the text edge of the service pages (ottiaq: wrap 1200px,
   20px padding -> x=380 at 1920). S = the delivery-options section (the one holding the pill row), T = the terms
   section right after it. */
:root:has(link[data-polish-page="paperversions"]) main > section:has(> .wrap > .pvnav) > .wrap,
:root:has(link[data-polish-page="paperversions"]) main > section:has(> .wrap > .pvnav) + section:not(#quote) > .wrap {
  max-width: 1200px;
  padding-left: 20px;
  padding-right: 20px;
}
/* page title (en template) */
:root:has(link[data-polish-page="paperversions"]) main .pvhead {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}
:root:has(link[data-polish-page="paperversions"]) main .pvhead h1 {
  margin-left: 0;
  margin-right: 0;
}
/* the methods list: one column, paragraphs not wider than 760px, equal spacing between methods */
:root:has(link[data-polish-page="paperversions"]) main section:has(> .wrap > .pvnav) .nsvc-list {
  display: block;
  max-width: 760px;
  margin: 0;
}
:root:has(link[data-polish-page="paperversions"]) main section:has(> .wrap > .pvnav) .nscard.mcard {
  align-items: flex-start;
  text-align: left;
  max-width: 760px;
  margin: 0 0 60px;
}
:root:has(link[data-polish-page="paperversions"]) main section:has(> .wrap > .pvnav) .nscard.mcard:last-child {
  margin-bottom: 0;
}
/* photo: same size, now on the left edge; never wider than the phone column (it caused a horizontal scroll) */
:root:has(link[data-polish-page="paperversions"]) main section:has(> .wrap > .pvnav) .nscard.mcard .nsico {
  margin-left: 0;
  margin-right: 0;
  max-width: min(420px, 100%);
}
/* the delivery-service pictures (320x240) sit in a fixed 88x88 box on es/fr/ru/uk and were squashed (F1):
   keep the box, show the whole picture in its own proportions (20.10.2026, coordinator). No-op where the box
   already has the picture's proportions (en). */
:root:has(link[data-polish-page="paperversions"]) main .nsico {
  object-fit: contain;
}
/* terms section: heading and text in the same column */
:root:has(link[data-polish-page="paperversions"]) main section:has(> .wrap > .pvnav) + section:not(#quote) :is(.pvlegalhead, .sh) {
  text-align: left;
  max-width: 760px;
  margin-left: 0;
  margin-right: 0;
}
:root:has(link[data-polish-page="paperversions"]) main section:has(> .wrap > .pvnav) + section:not(#quote) .nssplit {
  display: block;
  max-width: 760px;
  margin: 0;
}

/* ---- 2. The row of delivery options: normal pill buttons, wrapping from the left. ------------------------------
   :not(#p):not(#p) lifts the rule above the page's "linkfix" style block (its rules (they underline every text link in main with
   !important)); anchors (href="#office" ...) are not changed. */
:root:has(link[data-polish-page="paperversions"]) main .pvnav:not(#p) {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  max-width: 960px;
  margin: 0 0 44px;
  padding: 0;
  border: 0;
}
:root:has(link[data-polish-page="paperversions"]) main .pvnav:not(#p):not(#p) > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 20px;
  border: 1px solid #d5dbef;
  border-radius: 999px;
  background: #f4f6fc;
  color: #374aa8;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
:root:has(link[data-polish-page="paperversions"]) main .pvnav:not(#p):not(#p) > a:hover {
  background: #e3e8f7;
  border-color: #b9c3e6;
  color: #2a3a8c;
}
:root:has(link[data-polish-page="paperversions"]) main .pvnav:not(#p):not(#p) > a:focus-visible {
  outline: 2px solid #374aa8;
  outline-offset: 2px;
}

/* ======== PART B: approved general rules (round 2, 20.10.2026) ========
   G = :where(:root:has(link[data-polish-set~="general"])) adds no specificity, so every rule below keeps the strength
   it had in the draft (polish/site-polish.draft.css). Text is never changed. section.hero (hero text and hero photo
   tasks): only the colours of the two buttons on old-template pages (B1, as in the approved draft), nothing else.
   unav header/footer: only the font size of the footer disclaimer/copyright (B4) and the stacking of the «to top» button (B5). */

/* ---- B1. Buttons like the Home on the old service template (client decision 1, variant b) ----------------------
   data-polish-tpl="legacy" = the page's own :root sets --indigo:#3b46c4 (old template). Pages rebuilt to match the
   live site carry the extra set "keepbtn" (polish.apply --scope batch-keepbtn): B1 and B2 skip them. */
:where(:root:has(link[data-polish-set~="general"][data-polish-tpl="legacy"]:not([data-polish-set~="keepbtn"]))) :is(.btn, a.provlink) {
  --indigo: #374aa8;
  --indigo-d: #2a3a8c;
}
:where(:root:has(link[data-polish-set~="general"][data-polish-tpl="legacy"]:not([data-polish-set~="keepbtn"]))) .btn-o {
  color: #000;
  border-color: #374aa8;
}
:where(:root:has(link[data-polish-set~="general"][data-polish-tpl="legacy"]:not([data-polish-set~="keepbtn"]))) .btn-o:hover {
  background: rgba(55, 74, 168, .06);
}
:where(:root:has(link[data-polish-set~="general"][data-polish-tpl="legacy"]:not([data-polish-set~="keepbtn"]))) .btn:where(:not(.hero *)) {
  padding: 17px 34px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .06em;
}

/* ---- B2. Content links like the Home: text links with an inline indigo colour (C4) ---------------------------- */
:where(:root:has(link[data-polish-set~="general"]:not([data-polish-set~="keepbtn"]))) :where(p, li, td, .lede, .dnote, .gtext) > a:is([style*="color:var(--indigo)"], [style*="color:#3b46c4"], [style*="color:#374aa8"]):where(:not(.btn, .cta, .go, .provlink, .hero *)) {
  color: #3a63d8 !important;
}

/* ---- B3. Wrapping (A2/A3): no lone word on the last line of section headings; card text. Outside the hero. ------ */
:where(:root:has(link[data-polish-set~="general"])) :where(h1, h2, h3):where(:not(.hero *, header *, footer *, .mnav *, .ftr *, .t-records *)) {
  text-wrap: balance;
}
:where(:root:has(link[data-polish-set~="general"])) :where(.card, .gcard, .acard, .artcard, .bcard, .step, .nscard, .excase, .ptariff) :where(p, li):where(:not(.hero *)) {
  text-wrap: pretty;
}

/* ---- B4. Phones: text not smaller than 14px (client decision), German hyphenation, one card column ------------- */
@media (max-width: 480px) {
  /* !important: the page rules for these elements are more specific; each selector names one small-text kind */
  :where(:root:has(link[data-polish-set~="general"])) body:not(#u):not(#u):not(#u) :is(.ftr, .subftr) :is(.disc, .copyr) {
    font-size: 14px !important;
  }
  :where(:root:has(link[data-polish-set~="general"])) :is(
      :where(.uw-hint) span,
      :where(.card, .acard) > a.go,
      a.go > span.ar,
      a > span.go,
      :where(.artbody, a.artcard) > span.rm,
      :where(.subform) > label.subchk,
      p.adate,
      :where(figcaption) > span.bsub,
      :where(.wrap) > p.disc,
      :where(.navtiles) > :is(a.big, a.wide),
      :where(.pillwrap) > a.pill,
      a > span.pgn) {
    font-size: 14px !important;
  }
  /* inherited sizes (the disclaimer .prose block is 13px; quote-form labels 13.5px on some pages): raise, never shrink */
  :where(:root:has(link[data-polish-set~="general"])) :is(.prose > p:not([class]):not([style*="font-size"]), :where(.qfield) > label.qlabel) {
    font-size: max(14px, 1em) !important;
  }
  /* one card column on phones (tr-notaryservices: inline 1fr 1fr) */
  :where(:root:has(link[data-polish-set~="general"])) .gallery3[style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* German: a long compound in a section heading is cut mid-word on 360/390 («Übersetzungsdienstleistunge|n»);
     hyphenate it by the German dictionary instead (A5) */
  :where(:root:has(link[data-polish-set~="general"])) :where(:lang(de)) h2:where(:not(.hero *)) {
    hyphens: auto;
    -webkit-hyphens: auto;
  }
}

/* ---- B5. The round «to top» button parks above the footer (page script sets its bottom), so on a phone scrolled to
   the end it rides up into the sticky header and is drawn ON the ISAEV logo (both have z-index 80, the button comes
   later in the page). One step lower: it slides under the white header instead. Position and script unchanged. */
:where(:root:has(link[data-polish-set~="general"])) .totop {
  z-index: 79;
}
/* B5b (client decision 20.10.2026): on phones and tablets the parked button leaves the screen at the end of the page
   (the footer + disclaimer are taller than the screen), so it cannot be pressed exactly where it is needed. Up to
   1100px it stays at its own place in the bottom-left corner (!important outranks the inline bottom the page script
   writes), and the footer gets 80px of empty space under the copyright so the last line can be scrolled above the
   button. Desktop keeps the parking. The page script is not changed. */
@media (max-width: 1100px) {
  :where(:root:has(link[data-polish-set~="general"])) .totop {
    bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  }
  :where(:root:has(link[data-polish-set~="general"])) .subftr::after {
    content: "";
    display: block;
    height: 80px;
  }
}

/* ======== PART C: Home colours and type scale (client decision of Lyaman with Igor, 21.10.2026) ========
   T = :where(:root:has(link[data-polish-set~="type"])) - written by `polish.apply --scope type --pages ...`, which also
   switches "keepbtn" off (B1/B2 then reach the rebuilt pages too). Standard = the staging Home (home-faithful) measured
   on 21.10.2026 (FullLog/reports/typography_2026-10-21/home_measure.md):
     H1 hero clamp(36px,5vw,56px)/1.2 · hero subtitle 24px/1.5 · H2 clamp(28px,2.8vw,40px) · H3 24px
     text and lists clamp(17px,1.4vw,20px) · buttons 16px · section label 14px · caption 16px
   Only size (and the hero line-height) and colour change; weight, family, layout and text stay as they are.
   `body:not(#u):not(#u):not(#u)` = id-level weight: beats the pages' own #rec / #ap-recs rules; !important beats
   Tilda's inline font sizes and the pages' !important link colours. unav header/footer are never matched (they are
   outside .t-records / section.hero / main). */

/* ---- C1. Links: the Home text-link blue #3a63d8 instead of the Tilda orange #ff8562; on light text (a dark shape
   behind, data-pty-on="dark") the link keeps the text colour, underlined - as the Home links in dark sections. ---- */
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) :is(.t-records, .t396, .lsx-r, .rfx-text, .prose, .leg-ol, .leg-cap, .numlist, .dashlist, .dcol, .acard .ab) a:not(.t-btn, .tn-atom, .btn, .artcard, .go, .cta),
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) :is(.t-records, .t396, .lsx-r, .rfx-text, .prose, .leg-ol, .leg-cap, .numlist, .dashlist, .dcol) a:not(.t-btn, .tn-atom, .btn, .artcard, .go, .cta):is(:hover, :focus, :active, :visited) {
  color: #3a63d8 !important;
}
/* 12.11.2026 (бэклог 200): ссылка «PPTC 659E form» в светло-сиреневой плашке #e2e2f3 (блок t611, guides-accepted-translation)
   при #3a63d8 даёт контраст 4,15 (норма 4,5) - здесь чуть темнее, #3558c8 (4,85); решение за владельца 12.11.2026 */
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t611 a[href*="pptc659"]:not(.t-btn, .tn-atom, .btn, .hero *),
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t611 a[href*="pptc659"]:not(.t-btn, .tn-atom, .btn, .hero *):is(:hover, :focus, :active, :visited) {
  color: #3558c8 !important;
}
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 [data-pty-on="dark"] a:not(.tn-atom),
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 [data-pty-on="dark"] a:not(.tn-atom):is(:hover, :focus, :active, :visited) {
  color: inherit !important;
  text-decoration: underline !important;
}

/* ---- C2. Zero-block text (absolute layout): the role written by polish.apply gets the Home size, but never larger
   than the element's own size in that Tilda band (--pty-a >=1200, -b 960-1199, -c 640-959, -d 480-639, -e <480):
   a larger text would run into the element placed below it. ---- */
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h2"] > .tn-atom { font-size: min(clamp(28px, 2.8vw, 40px), var(--pty-a)) !important; }
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h3"] > .tn-atom { font-size: min(24px, var(--pty-a)) !important; }
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="body"] > .tn-atom { font-size: min(clamp(17px, 1.4vw, 20px), var(--pty-a)) !important; }
@media screen and (max-width: 1199px) {
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h2"] > .tn-atom { font-size: min(clamp(28px, 2.8vw, 40px), var(--pty-b)) !important; }
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h3"] > .tn-atom { font-size: min(24px, var(--pty-b)) !important; }
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="body"] > .tn-atom { font-size: min(clamp(17px, 1.4vw, 20px), var(--pty-b)) !important; }
}
@media screen and (max-width: 959px) {
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h2"] > .tn-atom { font-size: min(clamp(28px, 2.8vw, 40px), var(--pty-c)) !important; }
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h3"] > .tn-atom { font-size: min(24px, var(--pty-c)) !important; }
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="body"] > .tn-atom { font-size: min(clamp(17px, 1.4vw, 20px), var(--pty-c)) !important; }
}
@media screen and (max-width: 639px) {
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h2"] > .tn-atom { font-size: min(clamp(28px, 2.8vw, 40px), var(--pty-d)) !important; }
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h3"] > .tn-atom { font-size: min(24px, var(--pty-d)) !important; }
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="body"] > .tn-atom { font-size: min(clamp(17px, 1.4vw, 20px), var(--pty-d)) !important; }
}
@media screen and (max-width: 479px) {
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h2"] > .tn-atom { font-size: min(clamp(28px, 2.8vw, 40px), var(--pty-e)) !important; }
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="h3"] > .tn-atom { font-size: min(24px, var(--pty-e)) !important; }
  :where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t396 .tn-elem[data-pty="body"] > .tn-atom { font-size: min(clamp(17px, 1.4vw, 20px), var(--pty-e)) !important; }
}

/* ---- C3. Tilda standard blocks (flowing layout, so the Home size applies as is). By Tilda's own class meaning:
   section titles and big impact text = H2, item/accordion titles = H3, descriptions and text = body, buttons. Not
   inside a zero-block (C2) and not in the hero. ---- */
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t-records :is(.t-section__title, .t-title_xxl, .t-title_xl, .t-title_lg, .t-text-impact):not(.t396 *, .t794 *, .t611 *, .t431 *, .hero *) {
  font-size: clamp(28px, 2.8vw, 40px) !important;
}
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t-records :is(.t-name, .t-title):not(.t-section__title, .t-title_xxl, .t-title_xl, .t-title_lg, .t396 *, .t794 *, .t611 *, .t431 *, .hero *),
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t-records :is(.t-name, .t-title):not(.t-section__title, .t-title_xxl, .t-title_xl, .t-title_lg, .t396 *, .t794 *, .t611 *, .t431 *, .hero *) [style*="font-size"] {
  font-size: 24px !important;
}
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t-records :is(.t-descr, .t-text, .t-section__descr):not(.t-text-impact, .t396 *, .t794 *, .t611 *, .t431 *, .hero *),
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t-records :is(.t-descr, .t-text, .t-section__descr):not(.t-text-impact, .t396 *, .t794 *, .t611 *, .t431 *, .hero *) [style*="font-size"] {
  font-size: clamp(17px, 1.4vw, 20px) !important;
}
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) .t-records .t-btn:not(.t396 *, .t794 *, .t611 *, .t431 *, .hero *) {
  font-size: 16px !important;
}

/* ---- C4. Hero with a flowing text column (.hcol): H1 and subtitle as on the Home. A zero-block hero is not
   changed here (absolute layout; see the pilot report). ---- */
html:where(:has(link[data-polish-set~="type"])) body section.hero:not(#_ht):not(#_ty) .hcol h1 {
  font-size: clamp(36px, 5vw, 56px) !important;
  line-height: 1.2 !important;
}
html:where(:has(link[data-polish-set~="type"])) body section.hero:not(#_ht):not(#_ty) .hcol .lede {
  font-size: 24px !important;
  line-height: 1.5 !important;
}
/* A very long word (Russian/Ukrainian/German) must never leave the column on a phone: break it as a last resort
   (the font is NOT shrunk; the column width is set per page by herotext where that is allowed). */
html:where(:has(link[data-polish-set~="type"])) body section.hero:not(#_ht):not(#_ty) .hcol .lede {
  text-wrap: pretty; /* no single word alone on the last line of the subtitle (client 21.10.2026) */
}
@media screen and (max-width: 639px) {
  html:where(:has(link[data-polish-set~="type"])) body section.hero:not(#_ht):not(#_ty) .hcol :is(h1, .lede) {
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

/* ---- C5. Thank-you pages: the orange button .tybtn becomes the Home primary button (measured on home-faithful:
   background rgb(55,74,168) = #374aa8, hover rgb(42,58,140) = #2a3a8c, white text). ---- */
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) a.tybtn {
  background: #374aa8 !important;
  color: #fff !important;
}
:where(:root:has(link[data-polish-set~="type"])) body:not(#u):not(#u):not(#u) a.tybtn:hover {
  background: #2a3a8c !important;
  opacity: 1 !important;
}
