/* Prezentační web (sdílené styly pro cs/, en/, de/).
   Papíry na stole v ordinaci: zpráva vytištěná z nemocničního systému (Courier), hlavičky
   tiskopisů (Barlow Condensed), poznámky propiskou na okrajích (Kalam), zvýrazňovač,
   lepicí papírek, recepty jako tiskopisy, sešitý e-mail a ústřižek přihlášky.
   Papír zůstává světlý i v tmavém režimu, ztmavne jen stůl a papír se trochu ztlumí. */
:root {
  --desk: #26443f; --desk-2: #1d3733; --desk-fg: #cfe0da;
  --paper: #fbf8f1; --ink: #23262b; --muted: #6b6a62; --rule: #2a2d31; --rule-soft: #d8d1c1; --field: #f2eee3;
  --pen: #1f3fae; --red: #c4342b; --stamp: #3b3fb0; --hl: #eef264; --postit: #ffe46b;
  --slip: #eef3ea; --slip-band: #dbe7d6; --slip-line: #b7c7b1;
  --brand: #0c7a56;
  --low-bg: #fbe3df; --rx-bg: #e2e7f7;
  --typed: "Courier Prime", "Courier New", Courier, monospace;
  --form: "Barlow Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --hand: "Kalam", "Segoe Print", "Bradley Hand", cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* maska razítka: nerovnoměrný otisk barvy */
  --grain-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.2 2.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --desk: #121f1d; --desk-2: #0b1413; --desk-fg: #a9bdb6; --paper: #e9e4d7; --field: #ded8c9; --slip: #dfe5da; --slip-band: #cbd8c5; --postit: #e9cf55; } }
:root[data-theme="dark"] {
  --desk: #121f1d; --desk-2: #0b1413; --desk-fg: #a9bdb6; --paper: #e9e4d7; --field: #ded8c9; --slip: #dfe5da; --slip-band: #cbd8c5; --postit: #e9cf55; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; color: var(--ink); font: 400 16px/1.62 var(--typed);
  background: var(--grain), radial-gradient(130% 1100px at 50% 0, var(--desk), var(--desk-2)) no-repeat; background-color: var(--desk-2); }
a { color: var(--brand); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; }
.mono { font-family: var(--typed); }
[hidden] { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.opt { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* list papíru */
.sheet { position: relative; max-width: 920px; margin: 56px auto 28px; padding: 46px 64px 52px;
  background: var(--grain), var(--paper); box-shadow: 0 1px 1px rgba(0,0,0,.12), 0 24px 60px -18px rgba(0,0,0,.55); }
.sheet::before { /* dírky pro šanon */
  content: ""; position: absolute; left: 20px; top: 0; bottom: 0; width: 14px;
  background: radial-gradient(circle at 7px 7px, var(--desk-2) 6px, transparent 6.5px) 0 0 / 14px 50% repeat-y; background-position: 0 25%; opacity: .9; }

/* lepicí papírek */
.postit { position: absolute; right: -26px; top: -30px; z-index: 3; width: 196px; padding: 18px 16px 20px; transform: rotate(4deg);
  background: var(--postit); color: #2b2614; text-decoration: none; font: 400 1.2rem/1.2 var(--hand);
  box-shadow: 0 14px 18px -10px rgba(0,0,0,.45); }
.postit::before { content: ""; position: absolute; left: 50%; top: -10px; width: 70px; height: 22px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(255,255,255,.45); box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
.postit span { display: block; font-weight: 700; font-size: 1.45rem; margin-bottom: 4px; color: var(--red); }
.postit:hover { transform: rotate(2deg) translateY(-2px); }

/* hlavička zprávy */
.letterhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 16px; border-bottom: 3px double var(--rule); }
.brand { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.brand img { width: 46px; height: 46px; flex: none; }
.brand b { display: block; font: 700 1.9rem/1 var(--form); letter-spacing: .01em; text-transform: uppercase; }
.brand span { display: block; font: 400 .8rem/1.35 var(--typed); color: var(--muted); margin-top: 5px; }
.docmeta { margin: 0 110px 0 0; font: 500 .82rem/1.55 var(--form); color: var(--muted); display: grid; grid-template-columns: auto auto; column-gap: 12px; text-transform: uppercase; letter-spacing: .06em; }
.docmeta dt { text-align: right; }
.docmeta dd { margin: 0; color: var(--ink); font: 700 .85rem/1.55 var(--typed); text-transform: none; letter-spacing: 0; }
.langs { display: flex; gap: 2px; margin-left: -4px; }
.langs a { color: var(--muted); text-decoration: none; padding: 0 4px; }
.langs a:hover { color: var(--pen); }
.langs a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.barcode { grid-column: 1 / -1; justify-self: end; width: 138px; height: 24px; margin-top: 8px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 3px, var(--ink) 3px 4px, transparent 4px 7px,
    var(--ink) 7px 10px, transparent 10px 11px, var(--ink) 11px 12px, transparent 12px 15px, var(--ink) 15px 16px, transparent 16px 17px); }

.doctype { margin: 26px 0 0; font: 700 1.05rem/1.3 var(--form); letter-spacing: .3em; text-transform: uppercase; text-align: center; }

/* identifikace „pacienta“: políčka tiskopisu */
.patient { display: grid; grid-template-columns: repeat(4, 1fr); margin: 14px 0 0; border: 1.5px solid var(--rule); }
.patient div { padding: 6px 12px 9px; border-right: 1px solid var(--rule); min-width: 0; }
.patient div:last-child { border-right: 0; }
.patient dt { font: 600 .72rem/1.3 var(--form); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.patient dd { margin: 2px 0 0; font: 700 .92rem/1.35 var(--typed); }

/* úvod */
.hero { padding: 38px 0 34px; display: flex; flex-direction: column; gap: 24px; }
h1 { font: 700 clamp(2.5rem, 7vw, 4.6rem)/.95 var(--form); text-transform: uppercase; letter-spacing: -.005em; margin: 0; text-wrap: balance; }
h1 em { font-style: normal; padding: 0 .06em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(100deg, transparent .1em, var(--hl) .25em, var(--hl) 97%, transparent) 0 88% / 100% 62% no-repeat; }
.lead { font-size: 1.08rem; line-height: 1.6; margin: 18px 0 0; max-width: 40em; }
.hero-side { display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; }
.cta { display: inline-flex; align-items: center; gap: 10px; font: 700 1.2rem/1 var(--form); text-transform: uppercase; letter-spacing: .08em;
  color: var(--stamp); background: transparent; text-decoration: none; border: 3px solid currentColor; outline: 1.5px solid currentColor; outline-offset: -8px;
  border-radius: 4px; padding: 16px 24px; min-height: 52px; cursor: pointer; transform: rotate(-1.5deg); transition: background .15s, color .15s, transform .15s; }
.cta:hover { background: var(--stamp); color: var(--paper); outline-color: var(--paper); transform: rotate(0); }
.cta:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
.cta-note { font: 400 1.15rem/1.3 var(--hand); color: var(--pen); transform: rotate(-2deg); }

/* oddíly zprávy */
.sec { display: grid; grid-template-columns: 170px 1fr; grid-template-rows: auto 1fr; column-gap: 30px; padding: 30px 0; border-top: 1px solid var(--rule); }
.sec > h2 { grid-column: 1; margin: 0; padding-top: 3px; font: 700 1.15rem/1.2 var(--form); text-transform: uppercase; letter-spacing: .06em; }
.sec > h2 b { display: inline-block; min-width: 1.9em; margin-right: 8px; border: 1.5px solid var(--rule); text-align: center; font-size: .9rem; padding: 1px 4px; vertical-align: 2px; }
.sec > div { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.sec p { margin: 0 0 12px; max-width: 42em; }
.sec p:last-child { margin-bottom: 0; }
h3 { font: 700 1.25rem/1.15 var(--form); text-transform: uppercase; letter-spacing: .03em; margin: 0; }
.hand { font: 400 1.12rem/1.45 var(--hand); color: var(--pen); }
.faq { margin: 20px 0 0; }
.faq div { padding: 13px 0; border-top: 1px dashed var(--rule); }
.faq div:last-child { padding-bottom: 0; }
.faq dt { font-weight: 700; }
.faq dd { margin: 5px 0 0; max-width: 42em; }

/* poznámka propiskou na okraji */
.note { grid-column: 1; grid-row: 2; margin: 18px 0 0; font: 400 1.2rem/1.15 var(--hand); color: var(--pen); transform: rotate(-4deg); position: relative; }
.note svg { display: block; width: 86px; height: 40px; margin: 4px 0 0 34px; color: var(--pen); }
.note.red { color: var(--red); } .note.red svg { color: var(--red); }

/* objektivní nález – tabulka vytištěná z laboratoře */
.lab { width: 100%; border-collapse: collapse; font: 400 .9rem/1.4 var(--typed); font-variant-numeric: tabular-nums; }
.lab caption { caption-side: bottom; text-align: left; font: 400 1.05rem/1.4 var(--hand); color: var(--pen); padding-top: 12px; }
.lab th { text-align: left; font: 700 .78rem/1.2 var(--form); text-transform: uppercase; letter-spacing: .08em; padding: 0 10px 6px 0; border-bottom: 2px solid var(--rule); white-space: nowrap; }
.lab td { padding: 10px 10px 10px 0; border-bottom: 1px dashed var(--rule-soft); vertical-align: top; }
.lab td:first-child { font-weight: 700; }
.lab small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.lab .r { text-align: right; padding-right: 6px; }
.flag { display: inline-block; position: relative; min-width: 1.9em; text-align: center; font-weight: 700; padding: 1px 5px; }
.flag.ok { color: var(--brand); }
.flag.low { color: var(--red); }
.flag.low::after { content: ""; position: absolute; inset: -9px -12px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 34' preserveAspectRatio='none'%3E%3Cpath d='M9 22C3 12 17 3 31 3s26 5 25 14-15 14-29 13S5 27 10 12' fill='none' stroke='%23c4342b' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.flag.rx { color: var(--stamp); border: 1.5px solid currentColor; border-radius: 3px; font-size: .8rem; }
.lab tr.low td:nth-child(3) { color: var(--red); font-weight: 700; }
.meter { display: block; height: 5px; border: 1px solid var(--rule); margin-top: 6px; max-width: 110px; }
.meter i { display: block; height: 100%; background: var(--ink); }
.low .meter i { background: var(--red); }

/* diagnóza */
.dg { display: flex; flex-direction: column; gap: 10px; }
.dg div { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: baseline; }
.dg code { font: 700 1rem var(--typed); border: 1.5px solid var(--rule); padding: 2px 8px; text-align: center; }
.dg div:first-child span { font-weight: 700; }

/* terapie – recepty jako tiskopisy */
.rp { list-style: none; margin: 0; padding: 0; counter-reset: rp; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.rp li { counter-increment: rp; position: relative; padding: 46px 18px 16px; background: linear-gradient(var(--slip-band) 0 34px, var(--slip-line) 34px 35px, transparent 35px), var(--slip);
  border: 1px solid var(--slip-line); box-shadow: 0 6px 12px -8px rgba(0,0,0,.35); transform: rotate(-.6deg); }
.rp li:nth-child(even) { transform: rotate(.7deg); }
.rp li:nth-child(3n) { transform: rotate(-.2deg); }
.rp li::before { content: "Rp. " counter(rp); position: absolute; left: 14px; top: 6px; font: 700 1.05rem/22px var(--typed); color: var(--ink); }
.rp li::after { content: var(--slip-label, ""); position: absolute; right: 14px; top: 9px; font: 600 .72rem/16px var(--form); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.rp p { margin: 6px 0 0; font-size: .95rem; line-height: 1.55; }
.sig { font: 400 1.1rem/1.35 var(--hand) !important; color: var(--pen); margin-top: 10px !important; }
.sig b { font: 700 1rem var(--typed); color: var(--ink); margin-right: 6px; }
.who { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font: 400 1.08rem/1.3 var(--hand); color: var(--pen); }
.who span::before { content: "✓ "; color: var(--brand); font-weight: 700; }

/* příloha – sešitý e-mail */
.att-label { font: 700 .85rem/1.4 var(--form); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 14px; }
.mail { position: relative; background: #fffefb; color: #23262b; font: 400 .88rem/1.6 var(--typed); transform: rotate(.6deg);
  box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 10px 20px -10px rgba(0,0,0,.4); border: 1px solid #e4dfd2; }
.staple { position: absolute; left: 30px; top: -7px; width: 50px; height: 9px; border: 2px solid #8d949b; border-bottom: 0; border-radius: 2px 2px 0 0; transform: rotate(-6deg); }
.staple::after { content: ""; position: absolute; left: -2px; right: -2px; top: -2px; height: 2px; background: #b9bfc5; }
.mail-head { display: grid; grid-template-columns: 74px 1fr; margin: 0; padding: 14px 18px 10px; border-bottom: 1px solid #e4dfd2; gap: 2px 10px; }
.mail-head dt { color: var(--muted); }
.mail-head dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.mail-body { padding: 14px 18px 16px; white-space: pre-line; overflow-wrap: anywhere; }
.mail-body mark { background: linear-gradient(100deg, transparent 2px, var(--hl) 4px, var(--hl) calc(100% - 3px), transparent) 0 70% / 100% 75% no-repeat; color: inherit; padding: 0 2px; }
.mail-foot { display: flex; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; border-top: 1px solid #e4dfd2; padding: 10px 18px; font-size: .8rem; color: var(--muted); }
.mail-foot b { color: var(--brand); }

/* doporučení – ústřižek přihlášky */
.form { position: relative; margin-top: 34px; border: 2px dashed var(--rule); background: var(--grain), var(--field); }
.cut { position: absolute; left: 16px; top: -1.35rem; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--paper);
  font: 400 1.1rem/1.6 var(--hand); color: var(--pen); }
.cut::before { content: "✂"; font: 400 1.5rem/1 var(--typed); color: var(--ink); transform: rotate(180deg) translateY(2px); }
.form-head { display: flex; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; padding: 18px 18px 10px; border-bottom: 1.5px solid var(--rule);
  font: 700 1.05rem/1.3 var(--form); text-transform: uppercase; letter-spacing: .08em; }
.form-head span { font-weight: 500; color: var(--muted); letter-spacing: .06em; font-size: .85rem; }
.form form { padding: 20px 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.field > label, .field legend { display: block; font: 600 .8rem/1.4 var(--form); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 2px; padding: 0; }
.field input[type="email"] { width: 100%; font: 400 1.35rem/1.3 var(--hand); color: var(--pen); background: transparent;
  border: 0; border-bottom: 1.5px dotted var(--rule); padding: 8px 2px 4px; border-radius: 0; min-height: 48px; }
.field input[type="email"]::placeholder { color: var(--muted); opacity: .9; }
.field input[type="email"]:focus { outline: none; border-bottom: 2px solid var(--pen); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: center; font-size: .95rem; cursor: pointer; min-height: 40px; }
.check input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 20px; height: 20px; border: 1.5px solid var(--rule);
  background: var(--paper); display: grid; place-items: center; cursor: pointer; }
.check input::after { content: "✗"; font: 700 22px/1 var(--hand); color: var(--pen); transform: scale(0) rotate(-8deg); transition: transform .12s; margin-top: -3px; }
.check input:checked::after { transform: scale(1) rotate(-8deg); }
.check input:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
.submit-row { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.fine { font-size: .8rem; line-height: 1.5; color: var(--muted); margin: 0; max-width: 40em; }
.err { color: var(--red); font: 400 1.1rem/1.3 var(--hand); margin: 0; }
.done { padding: 30px 18px 30px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.done p { margin: 0; }
.done p + p { margin-top: 6px; color: var(--muted); font-size: .92rem; }
.stamp-ok { font: 700 1.6rem/1 var(--form); text-transform: uppercase; letter-spacing: .12em; color: var(--red); text-align: center;
  border: 4px solid var(--red); outline: 1.5px solid var(--red); outline-offset: -9px; border-radius: 6px; padding: 14px 18px 12px; transform: rotate(-8deg);
  -webkit-mask: var(--grain-mask); mask: var(--grain-mask); animation: stamp .35s cubic-bezier(.2,.9,.3,1.3) both; }
.stamp-ok small { display: block; font: 700 .8rem/1 var(--typed); letter-spacing: .04em; margin-top: 6px; }
@keyframes stamp { from { transform: rotate(-8deg) scale(1.7); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .stamp-ok { animation: none; opacity: .9; } }

/* podpis a razítko */
.sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-top: 36px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.sign .when { font-size: .88rem; color: var(--muted); }
.sign .who-signed { position: relative; text-align: center; min-width: 240px; padding-right: 40px; }
.sign svg.sig-line { width: 190px; height: 54px; display: block; margin: 0 auto -4px; color: var(--pen); }
.sign .who-signed b { display: block; border-top: 1px dotted var(--ink); padding-top: 6px; font: 600 .85rem/1.4 var(--form); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.sign svg.round { position: absolute; right: -14px; top: -34px; width: 116px; height: 116px; color: var(--stamp); opacity: .78; transform: rotate(12deg); -webkit-mask: var(--grain-mask); mask: var(--grain-mask); }

.footer { max-width: 920px; margin: 0 auto 44px; padding: 0 24px; font: 400 .8rem/1.6 var(--typed); color: var(--desk-fg); display: flex;
  justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.footer p { margin: 0; max-width: 60em; }

/* tablet: lepicí papírek do řádku, recepty pod sebe */
@media (max-width: 980px) {
  .postit { right: 12px; top: -36px; width: 170px; font-size: 1.05rem; padding: 14px 14px 16px; }
  .postit span { font-size: 1.25rem; }
}
/* telefon */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .sheet { margin: 64px 8px 18px; padding: 24px 16px 32px; }
  .sheet::before { display: none; }
  .postit { right: 10px; top: -52px; width: 156px; padding: 10px 12px 12px; font-size: .98rem; }
  .postit span { font-size: 1.12rem; margin-bottom: 0; }
  .letterhead { flex-direction: column; gap: 14px; }
  .docmeta { margin: 0; grid-template-columns: auto 1fr; }
  .docmeta dt { text-align: left; }
  .barcode { justify-self: start; }
  .langs a { padding: 6px 8px; margin: -6px 0; }
  .langs { margin-left: -8px; }
  .doctype { font-size: .9rem; letter-spacing: .18em; }
  .patient { grid-template-columns: 1fr 1fr; }
  .patient div:nth-child(2) { border-right: 0; }
  .patient div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .hero { gap: 20px; padding: 28px 0 26px; }
  .lead { font-size: 1rem; }
  .sec { grid-template-columns: 1fr; grid-template-rows: none; padding: 24px 0; }
  .sec > h2, .sec > div, .note { grid-column: 1; grid-row: auto; }
  .sec > div { margin-top: 14px; }
  .note { margin: 8px 0 0 auto; text-align: right; font-size: 1.1rem; }
  .note svg { margin: 0 0 0 auto; transform: scaleX(-1); width: 64px; height: 34px; }
  .lab .hide-s { display: none; }
  .lab { font-size: .82rem; }
  .rp { grid-template-columns: 1fr; gap: 16px; }
  .checks { grid-template-columns: 1fr; }
  .done { grid-template-columns: 1fr; justify-items: start; }
  .sign .who-signed { min-width: 0; padding-right: 70px; }
  .sign svg.round { right: -6px; }
  .footer { padding: 16px; margin-bottom: 24px; }
}
@media print { body { background: #fff; } .sheet { box-shadow: none; margin: 0; } .form, .cta, .postit { display: none; } }
