/* Ophthalmer × rajs.cz
   Shared editorial direction. Loaded after the original stylesheet.
   Screen-only overrides preserve the calculator's existing print protocol.
   Sender's embedded form and calculation logic are intentionally independent.
*/
@media screen {
  :root {
    color-scheme: light;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --bg-body: #f5f4f0;
    --bg-section: #eeede8;
    --bg-card: #fff;
    --bg-input: #f5f4f0;
    --text-primary: #191919;
    --text-secondary: #585650;
    --text-muted: #706d66;
    --border: #d9d6ce;
    --accent: #da303d;
    --accent-hover: #b9222e;
    --header-bg: #111;
    --footer-bg: #111;
    --footer-text: #c4c2bb;
    --footer-border: #333;
    --shadow: none;
  }

  html { scroll-padding-top: 100px; }
  body { font-family: var(--sans); font-size: 16px; line-height: 1.75; }
  h1, h2, h3, h4 { font-family: var(--sans); letter-spacing: -.04em; }
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
  [role='button']:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
  #case, .header-container, .hero-inner, .footer-main {
    box-sizing: border-box;
    width: min(1280px, calc(100% - 96px));
    max-width: 1280px;
    margin-inline: auto;
    font-size: 16px;
  }

  /* Header: white wordmark, quiet navigation, the same black as rajs.cz. */
  #top, #top.shrink {
    height: 88px;
    padding: 0;
    background: #111;
    box-shadow: none;
    border-bottom: 1px solid #292929;
  }
  #top .header-container { height: 100%; padding: 0; }
  nav#nav-main { display: flex; align-items: center; justify-content: space-between; height: 100%; padding: 0; }
  nav#nav-main .logo { float: none; margin: 0; padding: 0; }
  nav#nav-main .logo a { padding: 0; }
  .logo_pic, .logo_menu { width: 200px; height: auto; max-height: none; filter: brightness(0) invert(1); }
  nav#nav-main ul { margin: 0; gap: 26px; }
  nav#nav-main a { color: #f5f4f0; font-size: 14px; font-weight: 500; padding: 12px 0; }
  nav#nav-main li a::after { left: 0; right: 0; height: 1px; }
  nav#nav-main li:first-child a { color: #f07880; }
  nav#nav-mobile .logo { display: none; }
  nav#nav-mobile ul { background: #111; margin-block: 0; }
  nav#nav-mobile ul:not(.expanded) { visibility: hidden; }
  nav#nav-mobile ul.expanded { visibility: visible; }
  nav#nav-mobile li { margin-inline: 24px; border-color: #333; font-weight: 500; }
  nav#nav-mobile a { color: #f5f4f0; font-size: 16px; }
  nav#nav-mobile a:hover { background: #202020; color: white; }

  /* Existing photograph, with a soft dark overlay and bold typography. */
  .hero {
    min-height: 660px;
    height: calc(90svh - 88px);
    max-height: 850px;
    background-color: #111;
    background-attachment: scroll;
    background-position: 70% center;
  }
  .hero::before {
    background: linear-gradient(90deg, rgba(17,17,17,.97) 0%, rgba(17,17,17,.83) 34%, rgba(17,17,17,.3) 72%, rgba(17,17,17,.12)), linear-gradient(0deg, #111 0%, transparent 26%);
  }
  .hero-content { max-width: 800px; padding: 72px 0 104px; margin: 0; text-align: left; }
  .hero-content h1 {
    font-size: clamp(56px, 7.6vw, 108px);
    font-weight: 700;
    letter-spacing: -.065em;
    line-height: .98;
    text-transform: uppercase;
    color: #f5f4f0;
    margin-bottom: 34px;
  }
  .hero-content h1 span { color: #da303d; margin-left: .08em; }
  .hero .animate-reveal { animation: none; opacity: 1; transform: none; }
  .hero .hero-description { max-width: 470px; color: #cbc9c4 !important; font-size: 17px !important; line-height: 1.75 !important; margin: 0 !important; }

  /* Credentials and editorial gallery. */
  .about-me-section { padding: 88px 0; max-width: none; }
  .about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px; }
  .about-block { max-width: none; padding: 0; width: auto; }
  .about-block-img { width: 160px; height: 110px; margin-bottom: 30px; filter: brightness(0); }
  .about-block h3 { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: #b9222e; margin-bottom: 16px; }
  .about-block .institution { color: #191919; font-size: 20px; line-height: 1.4; letter-spacing: -.025em; }
  .about-block .details { font-size: 16px; line-height: 1.65; margin-top: 10px; }
  .about-block .date { font-size: 13px; letter-spacing: .06em; margin-top: auto; padding-top: 8px; }
  .section-title { text-align: left; text-transform: uppercase; font-size: clamp(32px, 4.4vw, 60px); line-height: 1.05; letter-spacing: -.05em; margin: 24px 0 40px; }
  .instagram-grid { max-width: none; padding: 0 0 64px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .instagram-grid .refimage { border-radius: 0; }
  .hovereffect { background: #111; }
  .hovereffect img { transform: none; }
  .refimage:focus-visible .overlay span { opacity: 1; transform: none; }
  .refimage:focus-visible img { opacity: .2; }
  .hovereffect .overlay span { font-family: var(--sans); font-size: 16px; }
  .reveal-on-scroll { opacity: 1; transform: none; }

  /* Shared secondary pages, including the newsletter's outer container only. */
  .links-section { max-width: 820px; padding: 72px 0 96px; min-height: 45vh; }
  .links-section h2 { font-size: clamp(32px, 4vw, 52px); font-weight: 650; line-height: 1.15; margin: 0 0 36px; }
  .links-section h3 { font-size: 23px; margin-top: 36px; }
  .links-section p { font-size: 16px !important; line-height: 1.8 !important; }
  .links-list a { font-size: 17px; }

  /* Calculator: retain all state classes, layout mechanics and risk colours. */
  .planner-scope {
    color-scheme: light;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --bg-primary: #f5f4f0;
    --bg-secondary: #fff;
    --bg-card: #fff;
    --bg-input: #f7f6f2;
    --border: #d9d6ce;
    --text-primary: #191919;
    --text-secondary: #585650;
    --text-muted: #706d66;
    --accent: #b9222e;
    --accent-hover: #981a24;
    --accent-dim: rgba(185,34,46,.06);
    --accent-glow: rgba(185,34,46,.12);
    --radius: 4px;
    --shadow: none;
    font-size: 16px;
  }
  .planner-intro, .planner-scope .main-container, .planner-disclaimer {
    box-sizing: border-box; width: min(1280px, calc(100% - 96px)); max-width: 1280px; padding-inline: 0;
  }
  .planner-intro { padding-top: 58px; padding-bottom: 20px; }
  .planner-intro h1 { font-size: clamp(32px, 4vw, 54px) !important; letter-spacing: -.05em; line-height: 1.15; }
  .planner-tag { padding: 0; margin-bottom: 18px; background: none; font-size: 12px; letter-spacing: .12em; }
  .beta-badge { font-size: 10px; border-radius: 2px; vertical-align: middle; }
  .planner-scope .main-container { grid-template-columns: 390px minmax(0, 1fr); gap: 28px; }
  .planner-scope .main-container > * { min-width: 0; }
  .planner-scope .card-header { padding: 18px 20px; }
  .planner-scope .card-header h2 { font-size: 13px !important; letter-spacing: .055em; }
  .planner-scope .card-body { padding: 24px; }
  .planner-scope .form-group label { font-size: 14px; }
  .planner-scope .form-group input, .planner-scope .form-group select { border-radius: 3px; font-size: 16px; }
  .planner-scope .btn { border-radius: 3px; font-size: 14px; }
  .planner-scope .btn-secondary { background: #fff; }
  .planner-scope .btn-calc { min-height: 48px; font-size: 16px; }
  .planner-scope .field-hint, .planner-disclaimer .disclaimer { font-size: 13px; }
  .planner-scope .technique-option { font-size: 12px; }
  .planner-scope .direction-option { font-size: 12px; }
  .planner-scope .iol-power { font-family: var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
  .planner-scope .form-group input:focus, .planner-scope .form-group select:focus { box-shadow: 0 0 0 3px var(--accent-dim); }

  /* Footer echoes the dark Ophthalmer panel on rajs.cz. */
  .footer-main { padding: 64px 0 48px; gap: 64px; }
  .footer-logo { width: 200px; height: auto; }
  .footer-brand p { max-width: 340px; margin-top: 24px !important; font-size: 16px !important; }
  .site-footer h4 { color: #f07880; font-size: 13px; letter-spacing: .1em; }
  .site-footer ul a { font-size: 16px; color: #dedcd5; }
  .footer-bottom { text-align: left; padding: 24px max(48px, calc((100% - 1280px) / 2)); }
  .footer-bottom p, .footer-bottom a { color: #aaa79f !important; font-size: 13px !important; }

  @media (max-width: 1000px) {
    .planner-scope .main-container { grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
    .planner-scope .card-body { padding: 18px; }
  }
  @media (max-width: 900px) {
    #case, .header-container, .hero-inner, .footer-main, .planner-intro, .planner-scope .main-container, .planner-disclaimer { width: calc(100% - 48px); }
    #top, #top.shrink { height: 76px; }
    nav#nav-main { display: none; }
    #nav-trigger { height: 76px; display: flex; align-items: center; justify-content: space-between; }
    #nav-trigger > a { display: block; line-height: 0; }
    #nav-trigger span { padding: 12px 0 12px 20px; }
    .logo_menu { float: none; margin: 0; width: 180px; }
    .hero { min-height: 620px; height: auto; background-position: 65% center; }
    .hero-content { padding: 90px 0; }
    .hero-content h1 { font-size: clamp(52px, 9vw, 80px); }
    .about-grid { gap: 24px; }
    .about-block .institution { font-size: 18px; }
    .planner-scope .main-container { grid-template-columns: 1fr; }
  }
  @media (max-width: 600px) {
    #case, .header-container, .hero-inner, .footer-main, .planner-intro, .planner-scope .main-container, .planner-disclaimer { width: calc(100% - 40px); }
    .hero { min-height: 660px; }
    .hero::before { background: linear-gradient(90deg, rgba(17,17,17,.92), rgba(17,17,17,.64)), linear-gradient(0deg, #111, transparent 40%); }
    .hero-content h1 { font-size: clamp(44px, 12vw, 68px); }
    .hero .hero-description { font-size: 16px !important; }
    .about-me-section { padding: 60px 0; }
    .about-grid { grid-template-columns: 1fr; gap: 48px; }
    .about-block-img { height: 100px; margin-bottom: 22px; }
    .instagram-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 32px; }
    .section-title { margin-top: 0; margin-bottom: 28px; }
    .links-section { padding-block: 48px 64px; }
    .planner-intro { padding-top: 40px; }
    .planner-scope .main-container { padding-top: 12px; }
    .planner-scope .technique-option { padding-inline: 6px; }
    .footer-main { grid-template-columns: 1fr 1fr; gap: 36px 24px; text-align: left; padding-top: 48px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-logo { margin: 0; }
    .footer-bottom { padding-inline: 20px; }
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .animate-reveal, .reveal-on-scroll, .planner-scope .animate-in { animation: none; transition: none; opacity: 1; transform: none; }
  }
}

/* Same masthead proportions and native typography as rajs.cz. */
@media screen {
  body { letter-spacing: -.015em; line-height: 1.8; }
  button, input, select, textarea { font-family: var(--sans); }
  #top, #top.shrink { height: 96px; background: #101010; border-color: #303030; }
  #case, .header-container, .hero-inner, .footer-main { width: min(1280px, calc(100% - 112px)); }
  nav#nav-main ul { gap: 29px; }
  nav#nav-main a { font-weight: 400; letter-spacing: -.015em; }
  nav#nav-main li:first-child a { color: #f5f4f0; }
  nav#nav-main a:hover { color: #ed4351; }
  .logo_pic, .logo_menu { width: 180px; }
  .hero { height: auto; min-height: 660px; max-height: none; background-color: #101010; }
  .hero::before { background: linear-gradient(90deg,#101010 0%,rgba(16,16,16,.9) 25%,rgba(16,16,16,.65) 60%,rgba(16,16,16,.42) 100%),linear-gradient(0deg,#101010,transparent 35%); }
  .hero-content { max-width: none; padding: 58px 0 100px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px 70px; align-items: start; }
  .hero-content h1 { grid-column: 1/-1; margin: 0 0 16px; font-weight: 600; line-height: 1; letter-spacing: -.065em; }
  .hero .hero-description { font-size: 16px !important; line-height: 1.8 !important; padding-top: 6px; }
  .section-title, .links-section h2 { font-weight: 600; font-size: clamp(38px,4.1vw,60px); letter-spacing: -.055em; line-height: 1.06; }
  .about-block h3, .site-footer h4 { font-weight: 500; font-size: 14px; letter-spacing: 0; }
  .planner-intro h1 { font-weight: 600 !important; letter-spacing: -.055em; }
  @media(max-width:1100px) {
    #case, .header-container, .hero-inner, .footer-main { width: calc(100% - 72px); }
  }
  @media(max-width:900px) {
    #top, #top.shrink, #nav-trigger { height: 76px; }
    .hero-content { gap: 30px; }
  }
  @media(max-width:600px) {
    #case, .header-container, .hero-inner, .footer-main { width: calc(100% - 40px); }
    .hero-content { display: block; padding: 42px 0 80px; }
    .hero-content h1 { margin-bottom: 32px; }
    .hero .hero-description { margin-top: 24px !important; }
    .section-title, .links-section h2 { font-size: clamp(33px,10.6vw,51px); }
  }
}

/* Original clinical photo and soft edge, matching the rajs.cz hero. */
@media screen {
  .hero { isolation: isolate; background-image: none; }
  .hero-background { position: absolute; inset: 0 0 0 auto; width: 75%; height: 100%; object-fit: cover; object-position: 50% 43%; z-index: -2; mask-image: linear-gradient(90deg,transparent 0%,rgba(0,0,0,.08) 10%,rgba(0,0,0,.35) 25%,rgba(0,0,0,.75) 42%,#000 60%); -webkit-mask-image: linear-gradient(90deg,transparent 0%,rgba(0,0,0,.08) 10%,rgba(0,0,0,.35) 25%,rgba(0,0,0,.75) 42%,#000 60%); }
  .hero::before { z-index: -1; }
  @media(max-width:600px) {
    .hero-background { width: 100%; object-position: 62% 42%; mask-image: none; -webkit-mask-image: none; }
    .hero::before { background: linear-gradient(90deg,rgba(16,16,16,.84),rgba(16,16,16,.63)),linear-gradient(0deg,#101010,transparent 65%); }
  }
}

/* Navigation mirrors rajs.cz while retaining Ophthalmer destinations. */
@media screen {
  nav#nav-main li a::after { content: none; }
  nav#nav-main li a:hover { box-shadow: 0 1px #da303d; }
  #nav-trigger .menu-toggle { display: none; }
  @media(max-width:900px) {
    #nav-trigger .menu-toggle { display: block; margin-left: auto; border: 0; background: none; color: #f5f4f0; font: 400 14px/1.8 var(--sans); padding: 12px 0; cursor: pointer; }
    #nav-trigger .menu-toggle span { display: inline; padding: 0; margin-left: 8px; font-size: 14px; color: inherit; }
    nav#nav-mobile { position: absolute; top: 76px; left: 0; right: 0; margin: 0; }
    nav#nav-mobile ul { position: static; width: auto; max-height: none; padding: 16px 36px 24px; border-bottom: 1px solid #303030; box-sizing: border-box; }
    nav#nav-mobile ul:not(.expanded) { display: none; }
    nav#nav-mobile ul.expanded { display: flex; flex-direction: column; gap: 4px; }
    nav#nav-mobile li { display: block; margin: 0; padding: 0; border: 0; text-align: left; }
    nav#nav-mobile a { display: block; padding: 10px 0; font-size: 16px; font-weight: 400; line-height: 1.8; }
    nav#nav-mobile a:hover { color: #ed4351; background: none; }
  }
  @media(max-width:600px) { nav#nav-mobile ul { padding-inline: 20px; } }
}

/* Shared heading spacing. */
@media screen {
  .hero-content h1 { margin-bottom: 0; }
  @media(max-width:600px) {
    .hero-content h1 { margin-bottom: 18px; }
  }
}

/* Automatic dark palette. Screen-only so printed reports stay unchanged. */
@media screen and (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg-body: #171716;
    --bg-section: #20201e;
    --bg-card: #242422;
    --bg-input: #292927;
    --text-primary: #f5f4f0;
    --text-secondary: #c4c2bb;
    --text-muted: #aaa79f;
    --border: #41413c;
    --accent: #f07880;
    --accent-hover: #ff9299;
  }
  .about-block-img { filter: brightness(0) invert(1); }
  .about-block .institution { color: var(--text-primary); }
  .about-block h3 { color: var(--accent); }
  .planner-scope {
    color-scheme: dark;
    --bg-primary: #171716;
    --bg-secondary: #20201e;
    --bg-card: #242422;
    --bg-input: #292927;
    --text-primary: #f5f4f0;
    --text-secondary: #c4c2bb;
    --text-muted: #aaa79f;
    --border: #41413c;
    --accent: #f07880;
    --accent-hover: #ff9299;
    --accent-dim: rgba(240,120,128,.10);
    --accent-glow: rgba(240,120,128,.16);
  }
  .planner-scope .btn-secondary { background: var(--bg-card); }
  .planner-scope .btn-calc { background: #b9222e; color: #fff; }
  .planner-scope .btn-calc:hover { background: #ce2937; }
  .planner-scope .technique-option.active,
  .planner-scope .direction-option.active[data-dir="anterior"],
  .planner-scope .direction-option.active[data-vitreous],
  .planner-scope .direction-option.active[data-biometer] { color: #171716; }
}

/* Hero copy alignment. */
@media screen {
  .hero-content { display: block; }
  .hero .hero-description { margin-top: 24px !important; padding-top: 0; }
}

/* Education-first homepage; shared PHP tools keep their existing interfaces. */
@media screen {
  .edu-eyebrow { font: 500 13px/1.6 var(--sans); letter-spacing: .07em; color: var(--accent); margin: 0 0 24px; }
  .edu-hero .hero-content { padding: 76px 0 72px; }
  .edu-hero h1 { font: 600 clamp(52px,7.7vw,110px)/1.02 var(--sans); letter-spacing: -.065em; text-transform: none; margin: 0 0 28px; }
  .edu-hero h1 span { margin: 0; }
  .edu-hero .hero-description { max-width: 540px; margin: 0 !important; font-size: 18px !important; }
  .edu-hero .edu-eyebrow { color: #d0cfcc; }
  .edu-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px 32px; margin-top: 34px; }
  .edu-button { display: inline-flex; align-items: center; gap: 24px; padding: 16px 22px; background: #b9222e; color: #fff; font-size: 16px; font-weight: 500; }
  .edu-button:hover { background: #da303d; color: #fff; }
  .edu-link { display: inline-flex; gap: 18px; align-items: center; padding-bottom: 5px; border-bottom: 1px solid currentColor; font-size: 16px; color: var(--text-primary); }
  .edu-hero .edu-link { color: #f5f4f0; }
  .hero .edu-author { color: #bdbcb8; font-size: 14px; margin: 32px 0 0; }
  .education-section, .edu-tools { padding-block: 88px; }
  .education-section .section-title, .edu-tools .section-title { text-transform: none; margin: 0 0 24px; }
  .edu-intro { max-width: 560px; font-size: 18px !important; line-height: 1.8; margin: 0 0 40px; }
  .education-section .instagram-grid { padding: 0; row-gap: 36px; }
  .education-section .refimage { display: block; color: var(--text-primary); }
  .lesson-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 16px; line-height: 1.45; margin-top: 16px; }
  .lesson-caption > span { color: var(--accent); }
  .resource-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 40px; margin-top: 40px; }
  .resource-card { padding: 32px; background: var(--bg-section); display: flex; flex-direction: column; align-items: flex-start; }
  .resource-card h3 { font-size: 28px; font-weight: 500; line-height: 1.2; margin: 0 0 18px; }
  .resource-card p:not(.edu-eyebrow) { font-size: 16px !important; line-height: 1.8; margin: 0 0 26px; }
  .resource-card .edu-link { margin-top: auto; }
  .author-intro { display: grid; grid-template-columns: 1fr 1.2fr; gap: 70px; margin-bottom: 72px; }
  .author-intro h2 { font-size: clamp(32px,3.4vw,48px); line-height: 1.1; font-weight: 600; }
  .author-intro h2 span { display: block; font-size: 20px; color: var(--text-secondary); margin-top: 18px; }
  .author-intro p:not(.edu-eyebrow) { font-size: 16px !important; line-height: 1.8; }
  nav#nav-main ul { gap: 20px; }
  @media(max-width:1100px) and (min-width:901px) { nav#nav-main a { font-size: 12px; } nav#nav-main ul { gap: 14px; } .logo_pic { width: 150px; } }
  @media(max-width:600px) {
    .edu-hero .hero-content { padding-block: 48px 60px; }
    .edu-hero h1 { font-size: clamp(36px,9.9vw,58px); }
    .edu-hero .hero-description { font-size: 16px !important; }
    .education-section, .edu-tools { padding-block: 56px; }
    .resource-grid, .author-intro { grid-template-columns: 1fr; gap: 28px; }
    .resource-card { padding: 24px; }
    .lesson-caption { font-size: 14px; }
    .edu-button { padding-inline: 16px; gap: 16px; font-size: 15px; }
  }
}

@media screen { .edu-button, .edu-link, .lesson-caption, .education-section a.refimage { text-decoration: none !important; } }

@media screen { .author-intro h2 span { letter-spacing: 0; } }

/* Direct access to the full education library on Instagram. */
@media screen {
  .education-heading { display: flex; justify-content: space-between; align-items: center; gap: 32px; margin-bottom: 24px; }
  .education-heading .section-title { margin-bottom: 0; }
  .instagram-profile-link { display: block; flex-shrink: 0; font: 500 clamp(22px,2.3vw,32px)/1.3 var(--sans); letter-spacing: -.035em; color: var(--accent); text-decoration: none !important; padding-block: 12px; border-bottom: 1px solid currentColor; }
  .instagram-profile-link small { display: block; font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--text-secondary); margin-top: 10px; }
  .instagram-profile-link:hover { color: var(--accent-hover); }
  @media(max-width:900px) { .education-heading { align-items: flex-start; flex-direction: column; } }
}

/* Continue the homepage photograph behind the sticky navigation. */
@media screen {
  .education-home { --masthead-height: 96px; }
  .education-home #top {
    box-sizing: border-box;
    background: transparent;
    border-bottom: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .education-home #top.shrink {
    background: rgba(16, 16, 16, .96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .education-home .edu-hero {
    margin-top: calc(-1 * var(--masthead-height));
    padding-top: var(--masthead-height);
  }
  @media (max-width: 900px) {
    .education-home { --masthead-height: 76px; }
  }
}
