/* Бумага и разметка страниц документов (контракт: docs/04_content_format.md) */
.pagewrap { position: relative; display: block; box-shadow: 0 6px 22px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .6); background: #fff; }
.pagewrap canvas.ann { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 20; touch-action: none; }
.ann-text { position: absolute; z-index: 30; min-width: 160px; font-family: "Caveat", "Segoe Print", cursive; background: rgba(255, 246, 168, .95); border: 2px solid #333; padding: 4px 8px; outline: none; resize: both; }

.page { position: relative; box-sizing: border-box; color: #1d1d1d; overflow: hidden; font-family: "PT Serif", Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.5; background: #f3eee2; user-select: none; }
.page .content { position: relative; z-index: 1; padding: 64px 72px; }

/* бумага */
.paper-plain { background: #f3eee2; }
.paper-form { background: #f6f2e8; }
.paper-lined { background-color: #f6f2e6; background-image: linear-gradient(90deg, transparent 78px, rgba(200, 60, 60, .55) 78px, rgba(200, 60, 60, .55) 80px, transparent 80px), repeating-linear-gradient(transparent 0 31px, rgba(70, 110, 190, .38) 31px 32px); background-position: 0 0, 0 24px; }
.paper-grid { background-color: #f6f3e8; background-image: repeating-linear-gradient(0deg, rgba(80, 120, 190, .28) 0 1px, transparent 1px 24px), repeating-linear-gradient(90deg, rgba(80, 120, 190, .28) 0 1px, transparent 1px 24px); }
.paper-thermal { background: linear-gradient(90deg, #ececE6, #f6f6f0 45%, #eaeae3); }
.paper-newsprint { background: #d8d2bd; }
.paper-dotmatrix { background: repeating-linear-gradient(#f4f7ee 0 48px, #d9eed2 48px 96px); }
.paper-diary { background: #efe3c4; }
.paper-photo { background: #f4f2ee; }

/* машинопись */
.typed, .fill, .page .grid, .kind-receipt, .kind-printout { font-family: "Courier Prime", "Courier New", Courier, monospace; }
.typed { margin: 0 0 .55em; font-size: 15px; line-height: 1.55; color: #1b1b1b; text-shadow: 0 0 .5px rgba(0, 0, 0, .65); }
.typed .tw, .fill .tw { display: inline-block; }
.fill { color: #14214f; border-bottom: 1px dotted #777; padding: 0 .3em; text-shadow: 0 0 .5px rgba(0, 0, 20, .6); }
.label { font-size: 10.5px; letter-spacing: .03em; color: #666; text-transform: uppercase; font-family: "PT Serif", Georgia, serif; text-shadow: none; }

/* шапка бланка */
.hdr { text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; line-height: 1.4; margin-bottom: 14px; font-family: "PT Serif", Georgia, serif; font-weight: 700; }
.hdr-left { float: left; max-width: 38%; font-size: 12px; line-height: 1.35; }
.hdr-right { float: right; max-width: 38%; text-align: right; font-size: 12px; line-height: 1.35; }
.page h1.doc-title { clear: both; text-align: center; font: 700 19px/1.3 "PT Serif", Georgia, serif; text-transform: uppercase; letter-spacing: .05em; margin: 22px 0 18px; }

/* рукопись */
.hand-koval { --hf: "Neucha", "Segoe Print", "Comic Sans MS", cursive; --hs: 21px; --hc: #1d2a6b; --hk: -7deg; }
.hand-gnatyuk { --hf: "Marck Script", "Segoe Script", "Brush Script MT", cursive; --hs: 27px; --hc: #232323; --hk: -3deg; }
.hand-lesnyak { --hf: "Bad Script", "Neucha", "Segoe Print", cursive; --hs: 16.5px; --hc: #34363a; --hk: 0deg; }
.hand-rud { --hf: "Marck Script", "Segoe Script", cursive; --hs: 21px; --hc: #2d1f5a; --hk: -1deg; }
.hand-mother { --hf: "Caveat", "Segoe Print", "Comic Sans MS", cursive; --hs: 25px; --hc: #1a2760; --hk: -5deg; }
.hand-generic { --hf: "Caveat", "Segoe Print", "Comic Sans MS", cursive; --hs: 23px; --hc: #1e2f7a; --hk: -4deg; }
p.hand, .hand { font-family: var(--hf); font-size: var(--hs); color: var(--hc); transform: skewX(var(--hk)); transform-origin: left bottom; margin: 0; line-height: 32px; }
p.hand { display: block; }
.hand .hw, .hand-alt .hw, .margin-note .hw, .ins .hw { display: inline-block; }
.hand-alt { font-family: "Caveat", "Segoe Print", "Comic Sans MS", cursive; color: #8c1d1d; font-size: .98em; display: inline-block; transform: rotate(-1.5deg); }
.kind-handwritten .content { padding-top: 52px; padding-left: 100px; }
.s, s.strike { text-decoration: line-through; text-decoration-thickness: 2px; }
.ins { position: relative; top: -.6em; font-size: .85em; margin: 0 .2em; font-family: var(--hf); color: var(--hc); display: inline-block; }
.underline { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.circle { display: inline-block; border: 2px solid var(--hc, #1d2a6b); border-radius: 50% / 46%; padding: 0 .4em; transform: rotate(-2deg); }
.margin-note { float: right; clear: right; width: 26%; margin: 0 -34px 8px 14px; font-family: "Caveat", "Segoe Print", cursive; color: #7a1a1a; transform: rotate(-3deg); font-size: 20px; line-height: 1.15; }
.redact { background: #101010; color: transparent; user-select: none; padding: 0 .2em; border-radius: 1px; }
.clip { position: relative; background: #e9e3cf; padding: 16px 18px; margin: 14px 0; box-shadow: 1px 3px 7px rgba(0, 0, 0, .35); transform: rotate(-.8deg); }
.clip::before { content: ""; position: absolute; top: -12px; left: 24px; width: 14px; height: 44px; border: 3px solid #8e949a; border-radius: 8px; border-bottom-color: transparent; }

/* печати и подписи */
.stamp { display: inline-block; transform: rotate(var(--rot, -6deg)); mix-blend-mode: multiply; opacity: .86; line-height: 0; margin: 4px 10px; }
.stamp-rect { display: inline-block; border: 3px double #22389a; color: #22389a; padding: 5px 12px; font: 700 14px/1.25 "Courier New", monospace; text-align: center; text-transform: uppercase; transform: rotate(var(--rot, -3deg)); mix-blend-mode: multiply; opacity: .85; margin: 4px 8px; }
.sign { display: inline-block; text-align: center; margin: 4px 14px; line-height: 1; vertical-align: bottom; }
.sign svg { display: block; }
.sign-name { font: 11px "PT Serif", Georgia, serif; color: #333; margin-top: -4px; }

/* таблицы */
.page .grid { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 8px 0; }
.page .grid th, .page .grid td { border: 1px solid rgba(0, 0, 0, .45); padding: 2px 7px; text-align: left; vertical-align: top; }
.page .grid th { background: rgba(0, 0, 0, .07); }
.paper-dotmatrix .grid th, .paper-dotmatrix .grid td { border: 1px dotted rgba(0, 0, 0, .45); }

/* матричная распечатка */
.kind-printout { font-size: 13px; color: #232323; }
.kind-printout .content { padding: 0; }
.perf { position: relative; padding: 36px 64px; min-height: 900px; }
.perf::before, .perf::after { content: ""; position: absolute; top: 0; bottom: 0; width: 46px; background: radial-gradient(circle at 23px 16px, #e8e8e0 0 6px, rgba(0, 0, 0, .3) 6px 7px, transparent 8px) 0 0 / 46px 32px repeat-y; border-right: 1px dashed rgba(0, 0, 0, .25); }
.perf::before { left: 0; }
.perf::after { right: 0; border-right: 0; border-left: 1px dashed rgba(0, 0, 0, .25); }
.kind-printout .typed, .kind-printout p { font-family: "IBM Plex Mono", "Courier New", monospace; font-size: 13px; line-height: 1.45; margin: 0 0 .4em; }

/* чек */
.kind-receipt { font-size: 12.5px; color: #4a4a48; }
.kind-receipt .content { padding: 26px 24px 34px; opacity: .84; }
.kind-receipt .hdr { font-family: "Courier Prime", "Courier New", monospace; }
.kind-receipt .typed { font-size: 12.5px; text-shadow: none; color: #4a4a48; margin: 0 0 .3em; }

/* газета */
.kind-newspaper { font-family: "PT Serif", Georgia, "Times New Roman", serif; color: #1c1a16; }
.kind-newspaper .content { padding: 40px 44px; }
.kind-newspaper .hdr { font: 700 36px/1.05 "PT Serif", Georgia, serif; letter-spacing: .04em; border-bottom: 3px double #222; padding-bottom: 8px; margin-bottom: 14px; }
.headline { font: 700 33px/1.08 "PT Serif", Georgia, serif; margin: 8px 0 6px; }
.lead { font-style: italic; font-size: 17px; margin: 0 0 12px; }
.kind-newspaper p { font-size: 14px; line-height: 1.38; text-align: justify; hyphens: auto; margin: 0 0 .55em; }
.cols-2 { column-count: 2; column-gap: 28px; column-rule: 1px solid #8a8472; }
.cols-3 { column-count: 3; column-gap: 24px; column-rule: 1px solid #8a8472; }
.kind-newspaper .pic .imgbox { filter: grayscale(1) contrast(1.3); position: relative; }
.kind-newspaper .pic .imgbox::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(0, 0, 0, .5) 0 .8px, transparent 1.3px) 0 0 / 3px 3px; mix-blend-mode: multiply; pointer-events: none; }

/* фото */
figure.pic { margin: 8px 0; break-inside: avoid; }
figure.pic figcaption { font-size: 11px; font-style: italic; text-align: left; margin-top: 3px; font-family: "PT Serif", Georgia, serif; line-height: 1.25; }
.imgbox img { display: block; width: 100%; height: auto; }
.img-ph { aspect-ratio: 4 / 3; width: 100%; box-sizing: border-box; padding: 14px; background: repeating-linear-gradient(135deg, #8d8f8e 0 14px, #999b99 14px 28px); color: #1f2120; font: 12.5px/1.35 "Courier New", monospace; display: flex; flex-direction: column; justify-content: center; text-align: center; overflow: hidden; border: 1px solid #555; }
.ph-path { font-weight: 700; font-size: 11px; opacity: .7; margin-bottom: 6px; }
.ph-desc { background: rgba(255, 255, 255, .55); padding: 6px 8px; }
.ph-det { margin-top: 6px; font-size: 11px; opacity: .8; }
.kind-photo .content { padding: 50px; }
.photo-print { background: #fff; padding: 22px 22px 66px; box-shadow: 0 3px 12px rgba(0, 0, 0, .4); position: relative; }
.photo-print .img-ph, .photo-print canvas { width: 100%; }
.photo-print canvas.still { display: block; height: auto; background: #000; }
.photo-cap { position: absolute; left: 22px; right: 22px; bottom: 16px; font: 14px/1.2 "Courier Prime", "Courier New", monospace; color: #333; text-align: left; }
.kind-photoTable .content { padding: 40px 36px; }
.kind-photoTable figure.pic { display: inline-block; width: 46%; margin: 1.5% 1.5%; vertical-align: top; background: #fff; padding: 8px 8px 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.kind-photoTable .img-ph { aspect-ratio: 3 / 2; font-size: 11px; padding: 8px; }

/* карта */
.kind-map .content { padding: 0; }
.kind-map { background: #ebe5d0; background-image: repeating-linear-gradient(0deg, rgba(90, 80, 40, .1) 0 1px, transparent 1px 40px), repeating-linear-gradient(90deg, rgba(90, 80, 40, .1) 0 1px, transparent 1px 40px); }
.map-svg { display: block; width: 100%; height: auto; font-family: "PT Serif", Georgia, serif; }
.map-svg [data-label] { cursor: pointer; }
@media (hover: hover) { .map-svg [data-label]:hover { filter: brightness(1.25) drop-shadow(0 0 3px #c00); } }
.map-tip { position: absolute; z-index: 5; transform: translate(-50%, -100%); background: #fff8d0; border: 1px solid #333; padding: 3px 8px; font: 14px "PT Serif", Georgia, serif; box-shadow: 2px 3px 6px rgba(0, 0, 0, .4); pointer-events: none; white-space: nowrap; }

/* ежедневник */
.kind-diary .content { column-count: 2; column-gap: 100px; padding: 56px 80px; }
.kind-diary::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 80px; margin-left: -40px; background: linear-gradient(90deg, transparent, rgba(60, 40, 10, .28) 48%, rgba(255, 255, 255, .25) 50%, rgba(60, 40, 10, .22) 52%, transparent); z-index: 3; pointer-events: none; }

/* состаривание */
.aging-box { position: absolute; inset: 0; z-index: 5; pointer-events: none; mix-blend-mode: multiply; }
.aging { position: absolute; inset: 0; }
.grain { position: absolute; inset: 0; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .15  0 0 0 .55 -.12'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.clip-shadow { position: absolute; top: 0; width: 34px; height: 70px; margin-left: -17px; background: linear-gradient(90deg, rgba(0, 0, 0, .0), rgba(0, 0, 0, .35) 50%, rgba(0, 0, 0, 0)); border-radius: 0 0 14px 14px; filter: blur(2px); opacity: .6; }

/* наложения поверх фото: номера машин, дата в кадре */
.imgbox { --ovbase: 600px; }
@supports (container-type: inline-size) { .imgbox.has-ov { container-type: inline-size; --ovbase: 100cqw; } }
.img-ov { position: absolute; display: flex; align-items: center; justify-content: center; white-space: nowrap; font-family: "PT Mono", "Courier New", monospace; font-weight: bold; color: #151515; pointer-events: none; overflow: hidden; }
.img-ov.plate { background: #e9e9e2; border: 1px solid #333; border-radius: 2px; letter-spacing: .04em; }
.img-ov.stamp-date { color: #ff9a2e; background: none; text-shadow: 0 0 2px rgba(0,0,0,.8); font-family: "Courier New", monospace; }
