/* safety.4infinity.si — 4INFINITY brand, Apple-style interaction details */
:root {
  --navy: #0a121e;
  --surf: #142338;
  --teal: #3d8d96;
  --teal-light: #5bb3ba;
  --teal-ink: #2b6e76;     /* small teal text on white/light: 5.4:1 */
  --teal-strong: #2e747c;  /* buttons/banner with white text: 5.4:1 */
  --faint-ink: #5f7184;    /* small grey text on white/light: 4.6:1 */
  --muted: #a3b4c2;
  --faint: #76899a;
  --ink: #14202e;
  --body: #4a5a6e;
  --light: #f3f6f8;
  --line: #dce3e9;
  --white: #fff;
  --radius: 16px;
  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 40px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--body); background: var(--white); }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Typography: tight tracking on large type, none on body */
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.07; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); line-height: 1.18; letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-ink); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); font-weight: 300; line-height: 1.6; color: var(--muted); max-width: 42rem; }

/* Pressable: feedback on pointer-down, instantly */
.press { transition: transform 100ms ease-out, background-color 150ms ease, border-color 150ms ease; }
.press:active { transform: scale(.97); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.3rem; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer; background: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--teal-strong); color: var(--white); }
.btn-primary:hover { background: #285f66; }
.btn-light { background: var(--white); color: var(--navy); }
.btn-ghost-dark { border-color: rgba(255,255,255,.25); color: var(--white); }
.btn-ghost-dark:hover { border-color: rgba(255,255,255,.5); }
.btn-text { padding: .4rem 0; color: var(--teal-ink); }
.btn-text:hover { color: #1f565c; }
.icon { width: 18px; height: 18px; flex: none; }

/* Event banner */
.event-banner { background: var(--teal-strong); color: var(--white); font-size: .82rem; font-weight: 600; }
.event-banner .wrap { display: flex; align-items: center; gap: .75rem; min-height: 42px; }
.event-banner a { color: inherit; display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; flex: 1; }
.event-banner a span.more { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.event-banner .close { margin-left: auto; background: none; border: 0; padding: 6px; cursor: pointer; color: inherit; opacity: .85; display: grid; place-items: center; border-radius: 8px; }
.event-banner .close:hover { opacity: 1; background: rgba(255,255,255,.12); }
.event-banner[hidden] { display: none; }
.event-banner .short, .event-banner .go { display: none; }
@media (max-width: 760px) {
  .event-banner .wrap { min-height: 44px; gap: .25rem; padding-right: calc(var(--gutter) - 8px); }
  .event-banner a { gap: .6rem; min-width: 0; }
  .event-banner .long, .event-banner .more { display: none; }
  .event-banner .short { display: block; min-width: 0; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .event-banner .go { display: inline-flex; margin-left: auto; }
  .event-banner .go .icon { width: 16px; height: 16px; }
  .event-banner .close { padding: 8px; }
}

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--navy); color: var(--white); padding: 28px 0 88px; }
.hero h1 { color: var(--white); }
.hero::before { content: ""; position: absolute; width: 760px; height: 760px; right: -200px; top: -320px; border-radius: 50%; background: rgba(61,141,150,.22); filter: blur(140px); pointer-events: none; }
.hero .watermark { position: absolute; right: 4%; top: 120px; width: min(520px, 45vw); opacity: .04; pointer-events: none; }
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--white); }
.brand img { width: 40px; height: auto; }
.brand b { font-size: 1rem; letter-spacing: .12em; }
.brand small { font-size: .82rem; color: var(--muted); padding-left: .65rem; border-left: 1px solid rgba(255,255,255,.25); }
.nav-links { display: flex; align-items: center; gap: 1.75rem; font-size: .88rem; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--white); }
.nav-links .btn { padding: .55rem 1rem; font-size: .82rem; }
.menu-btn { display: none; background: none; border: 0; color: var(--white); padding: 6px; cursor: pointer; }
.hero-body { position: relative; margin-top: 72px; display: grid; gap: 24px; max-width: 780px; }
.hero-body.compact { margin-top: 56px; }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: grid; }
  .nav-links.open { display: flex; position: absolute; top: calc(100% + 12px); right: 0; left: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px; background: var(--surf); border-radius: 14px; z-index: 20; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
  .nav-links.open a { padding: .85rem 1rem; border-radius: 10px; }
  .nav-links.open .btn { margin-top: 6px; }
  .brand small { display: none; }
  .hero { padding-bottom: 40px; }
  .hero-body { margin-top: 40px; }
}

/* Segmented control — navy indicator slides with a spring, slightly larger than the track */
.selector { background: var(--white); border-bottom: 1px solid var(--line); padding: 28px 0; display: flex; justify-content: center; }
.segmented { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center; isolation: isolate; }
.segmented::before { content: ""; position: absolute; inset: 0; border-radius: 12px; background: rgba(10,18,30,.06); z-index: -2; }
.segmented .indicator { position: absolute; top: -5px; bottom: -5px; left: 0; width: 0; border-radius: 12px; background: var(--navy); box-shadow: 0 4px 12px rgba(10,18,30,.22); z-index: -1; will-change: transform, width; }
.segmented button { border: 0; background: none; cursor: pointer; padding: .62rem 1.5rem; font-size: .9rem; font-weight: 600; color: var(--body); white-space: nowrap; border-radius: 12px; transition: color 180ms ease, font-size 180ms ease; }
.segmented button[aria-selected="true"] { color: var(--white); font-size: .95rem; }
.segmented button:not([aria-selected="true"]):hover { color: var(--ink); }
@media (max-width: 600px) {
  .selector { padding: 16px var(--gutter); }
  .segmented { width: 100%; }
  .segmented button { padding: .62rem .5rem; font-size: .82rem; }
  .segmented button[aria-selected="true"] { font-size: .86rem; }
}

/* Sticky translucent bar */
.sticky { position: fixed; inset: 0 0 auto 0; z-index: 40; background: rgba(255,255,255,.72); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); box-shadow: 0 8px 24px rgba(10,18,30,.06); transform: translateY(-110%); transition: transform 380ms var(--ease-out); }
.sticky.show { transform: none; }
.sticky .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.sticky .brand { color: var(--ink); }
.sticky .brand img { width: 36px; }
.sticky .brand b { font-size: .9rem; }
.sticky .links { display: flex; gap: 1.25rem; font-size: .85rem; }
.sticky .links a { text-decoration: none; color: var(--body); }
.sticky .links a:hover { color: var(--teal); }
.sticky .segmented button { padding: .45rem 1.1rem; font-size: .82rem; }
.sticky .segmented button[aria-selected="true"] { font-size: .86rem; }
.sticky .segmented .indicator { top: -3px; bottom: -3px; }
@media (max-width: 900px) { .sticky .links, .sticky .brand b { display: none; } .sticky .segmented { flex: 1; } }
@media (prefers-reduced-transparency: reduce) { .sticky { background: var(--white); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* Story */
.story { padding: 96px 0; }
.story[hidden] { display: none; }
.story > .wrap > * + * { margin-top: 88px; }
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.intro-text { display: grid; gap: 20px; }
.intro-text p { font-size: 1.06rem; line-height: 1.65; }
.intro-text .logo { height: 44px; width: auto; }
.intro-text .logo.badge { height: 60px; border-radius: 10px; }
.intro-text .logo.square { height: 84px; }
/* The photo takes the height of the text beside it */
.intro:has(.intro-media) { align-items: stretch; }
.intro-media { position: relative; min-height: 300px; }
.intro-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.facts.row { grid-template-columns: repeat(4, 1fr); margin-top: 56px !important; }
.fact { background: var(--light); border-radius: 14px; padding: 22px; }
.fact b { display: block; color: var(--teal-strong); font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.02em; }
.fact span { display: block; margin-top: 6px; font-size: .82rem; line-height: 1.45; }
.head { display: grid; gap: 12px; max-width: 45rem; }
.head p { font-size: 1rem; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; }
.step { border-top: 2px solid var(--teal); padding-top: 20px; }
.step .n { color: var(--teal-ink); font-weight: 600; font-size: .82rem; }
.step h3 { margin: 10px 0 8px; }
.step p { font-size: .9rem; line-height: 1.55; }
.uses { display: grid; grid-template-columns: 1fr 400px; gap: 48px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chip { border: 1px solid var(--line); border-radius: 100px; padding: .6rem 1rem; font-size: .88rem; color: var(--ink); }
.video-card { display: grid; gap: 14px; background: var(--navy); color: var(--muted); border-radius: var(--radius); padding: 28px; text-decoration: none; }
.video-card h3 { color: var(--white); }
.video-card .play { width: 48px; height: 48px; border-radius: 50%; background: var(--teal-strong); display: grid; place-items: center; color: var(--white); }
.video-card .go { color: var(--teal-light); font-weight: 600; font-size: .9rem; display: inline-flex; gap: .4rem; align-items: center; }
.note { background: rgba(61,141,150,.08); border: 1px solid rgba(61,141,150,.4); border-radius: var(--radius); padding: 28px 32px; display: grid; gap: 8px; }
.note h3 { font-size: 1.15rem; }
@media (max-width: 960px) {
  .story { padding: 40px 0 56px; }
  .story > .wrap > * + * { margin-top: 48px; }
  .intro, .uses { grid-template-columns: 1fr; gap: 28px; }
  /* Phone order: text → key facts → photo → how it works / solutions → documents */
  .story > .wrap { display: flex; flex-direction: column; gap: 40px; }
  .story > .wrap > * + * { margin-top: 0; }
  .story > .wrap > * { order: 4; }
  .intro { display: contents; }
  .intro-text { order: 1; }
  .facts, .facts.row { order: 2; margin-top: 0 !important; }
  .intro-media { order: 3; min-height: 0; }
  .intro-media img { position: static; height: auto; aspect-ratio: 16 / 10; }
  .facts.row { grid-template-columns: repeat(2, 1fr); margin-top: 28px !important; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { border-top-width: 1.5px; padding: 14px 0 12px; }
  .step h3 { display: inline; margin-left: 8px; font-size: 1rem; }
  .step p { margin-top: 4px; }
}
@media (max-width: 600px) { .facts { gap: 10px; } .fact { padding: 14px; } .fact b { font-size: 1.1rem; } }

/* Documents */
.doc-group + .doc-group { margin-top: 40px; }
.doc-group h3 { font-size: 1rem; margin-bottom: 16px; display: flex; gap: .6rem; align-items: baseline; }
.doc-group h3 small { color: var(--faint-ink); font-size: .82rem; }
.doc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.doc { display: flex; gap: 20px; align-items: center; text-align: left; width: 100%; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px 24px 16px 16px; cursor: pointer; }
.doc:hover { border-color: #c4d0da; box-shadow: 0 10px 28px rgba(10,18,30,.06); }
.doc .thumb { width: 80px; flex: none; aspect-ratio: 1 / 1.414; object-fit: cover; object-position: top; border-radius: 5px; border: 1px solid var(--line); background: var(--light); }
.doc .meta { display: flex; gap: .5rem; align-items: center; font-size: .75rem; color: var(--faint-ink); flex-wrap: wrap; }
.tag { background: rgba(61,141,150,.12); color: var(--teal-ink); font-weight: 600; border-radius: 6px; padding: .3rem .6rem; }
.doc h4 { margin: 6px 0 4px; color: var(--ink); font-size: 1.05rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.doc p { font-size: .82rem; line-height: 1.5; }
.doc .open { margin-top: 8px; display: inline-flex; gap: .4rem; align-items: center; font-weight: 600; font-size: .88rem; color: var(--teal-ink); }
@media (max-width: 900px) {
  .doc-grid { grid-template-columns: 1fr; gap: 12px; }
  .doc { padding: 12px 14px 12px 12px; gap: 14px; }
  .doc .thumb { width: 52px; }
  .doc p { display: none; }
  .doc h4 { font-size: .95rem; }
}

/* Docs page layout */
.doc-tabs { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); }
.doc-tabs .wrap { display: flex; gap: 10px; padding-block: 16px; overflow-x: auto; scrollbar-width: none; }
.doc-tabs a { flex: none; text-decoration: none; border: 1px solid var(--line); border-radius: 100px; padding: .5rem .95rem; font-size: .82rem; font-weight: 600; color: var(--ink); }
.doc-tabs a b { color: var(--teal-ink); margin-right: .35rem; }
.doc-tabs a.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.doc-tabs a.active b { color: var(--teal-light); }
.doc-section { padding: 88px 0; }
.doc-section:nth-of-type(even) { background: var(--light); }
.doc-section .wrap { display: grid; grid-template-columns: 320px 1fr; gap: 80px; }
.doc-section .side { display: grid; gap: 14px; align-content: start; }
.doc-section .side .n { color: var(--teal-ink); font-weight: 600; letter-spacing: .1em; }
.doc-section .doc-grid { grid-template-columns: 1fr; }
@media (max-width: 900px) { .doc-section { padding: 36px 0; } .doc-section .wrap { grid-template-columns: 1fr; gap: 16px; } .doc-section .side p { display: none; } }

/* Video band */
.band { background: var(--navy); color: var(--muted); padding: 64px 0; }
.band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.band .l { display: flex; align-items: center; gap: 24px; }
.band h2 { color: var(--white); font-size: 1.8rem; }
.band .play { width: 64px; height: 64px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; color: var(--white); flex: none; }

/* Contact + footer */
.contact { background: var(--navy); color: var(--muted); padding: 72px 0; }
.contact .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.contact h2 { color: var(--white); max-width: 40rem; margin: 10px 0; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.contact .eyebrow { color: var(--teal-light); }
.footer { background: var(--light); padding: 28px 0; font-size: .82rem; color: var(--faint-ink); }
.footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer .logos { display: flex; align-items: center; gap: 20px; color: var(--ink); font-weight: 700; letter-spacing: .04em; font-size: .88rem; }
.footer .logos img.inf { width: 44px; }
.footer .logos img.fb { height: 30px; width: auto; }
.footer .logos i { width: 1px; height: 28px; background: var(--line); }
@media (max-width: 700px) { .contact { padding: 40px 0; } .contact .btn { width: 100%; } }

/* Event page */
.event-hero { display: grid; grid-template-columns: 1fr 400px; gap: 80px; align-items: start; margin-top: 40px; position: relative; }
.back { display: inline-flex; gap: .5rem; align-items: center; color: var(--muted); text-decoration: none; font-size: .88rem; margin-top: 40px; position: relative; }
.back:hover { color: var(--white); }
.pill { display: inline-flex; gap: .6rem; align-items: center; background: rgba(61,141,150,.18); color: var(--teal-light); font-weight: 600; font-size: .82rem; padding: .45rem .9rem; border-radius: 100px; width: fit-content; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal-light); }
.event-card { background: var(--surf); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 26px 30px; }
.event-card dl { margin: 0; }
.event-card .row { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.event-card .row:first-child { padding-top: 0; }
.event-card .row:last-of-type { border-bottom: 0; }
.event-card .ic { width: 38px; height: 38px; border-radius: 10px; background: rgba(61,141,150,.18); display: grid; place-items: center; color: var(--teal-light); flex: none; }
.event-card dt { font-size: .75rem; color: #8d9fb0; }
.event-card dd { margin: 2px 0 0; color: var(--white); font-weight: 600; line-height: 1.45; }
.event-card .map { color: var(--teal-light); font-weight: 600; font-size: .88rem; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.program { padding: 96px 0; }
.program .wrap { display: grid; grid-template-columns: 1fr 380px; gap: 80px; }
.program ol { list-style: none; margin: 28px 0 0; padding: 0; }
.program li { display: grid; grid-template-columns: 40px 1fr; padding: 18px 0; border-top: 1px solid var(--line); }
.program li .n { color: var(--teal-ink); font-weight: 600; }
.program li h3 { font-size: 1.1rem; }
.program li p { font-size: .95rem; margin-top: 4px; }
.info { display: grid; gap: 16px; align-content: start; }
.info .box { background: var(--light); border-radius: var(--radius); padding: 24px; }
.info .box h3 { font-size: 1.05rem; margin-bottom: 8px; }
.info .row { display: flex; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.info .row .ic { width: 38px; height: 38px; border-radius: 10px; background: rgba(61,141,150,.12); display: grid; place-items: center; color: var(--teal); flex: none; }
.info .row h3 { font-size: .98rem; }
.info .row p { font-size: .9rem; }
.register { background: var(--light); padding: 96px 0; }
.register .wrap { display: grid; grid-template-columns: 380px 1fr; gap: 80px; }
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink); }
.field label i { color: var(--teal-ink); font-style: normal; }
.field input, .field select, .field textarea { font: inherit; font-size: 1rem; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: .85rem 1rem; background: var(--white); width: 100%; transition: border-color 150ms ease, box-shadow 150ms ease; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(61,141,150,.18); }
.field input:user-invalid { border-color: #c0544f; }
.field .err { font-size: .78rem; color: #b0443f; min-height: 0; }
.checks { display: grid; gap: 12px; margin-top: 20px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--teal); flex: none; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; font-size: .8rem; color: var(--faint-ink); }
.form-msg { margin-top: 16px; font-size: .9rem; color: #b0443f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thanks { text-align: center; display: grid; justify-items: center; gap: 14px; padding: 48px 24px; }
.thanks .ok { width: 60px; height: 60px; border-radius: 50%; background: rgba(61,141,150,.12); color: var(--teal); display: grid; place-items: center; }
.thanks p { max-width: 32rem; }
@media (max-width: 960px) {
  .event-hero, .program .wrap, .register .wrap { grid-template-columns: 1fr; gap: 28px; }
  .program, .register { padding: 40px 0; }
  .form-card { padding: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .program li p { display: none; }
  .form-foot { flex-direction: column-reverse; align-items: stretch; }
  .form-foot .btn { width: 100%; }
}

/* Document viewer: a sheet over a dimmed, pushed-back page */
body.viewer-open { overflow: hidden; }
.page-shell { transition: transform 420ms var(--ease-out), filter 420ms ease; transform-origin: 50% 0; }
body.viewer-open .page-shell { transform: scale(.97); filter: brightness(.9); }
.viewer { position: fixed; inset: 0; z-index: 100; display: none; }
.viewer.open { display: block; }
.viewer .scrim { position: absolute; inset: 0; background: rgba(10,18,30,.6); opacity: 0; transition: opacity 280ms ease; }
.viewer.shown .scrim { opacity: 1; }
.sheet { position: absolute; left: 50%; top: 32px; bottom: 32px; width: min(1160px, calc(100% - 64px)); transform: translateX(-50%); background: var(--white); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 90px rgba(0,0,0,.3); will-change: transform, opacity; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px 12px 24px; background: rgba(255,255,255,.86); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.sheet-title { display: flex; gap: 14px; align-items: center; min-width: 0; }
.sheet-title h2 { font-size: 1rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-title p { font-size: .75rem; color: var(--faint-ink); }
.tools { display: flex; gap: 8px; align-items: center; }
.seg { display: flex; align-items: center; gap: 2px; background: var(--light); border-radius: 11px; padding: 3px; font-size: .82rem; font-weight: 600; color: var(--ink); }
.seg span { min-width: 54px; text-align: center; }
.ibtn { border: 0; background: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.ibtn:hover { background: rgba(10,18,30,.06); }
.ibtn.round { border-radius: 50%; background: var(--light); }
.sheet-body { flex: 1; display: flex; min-height: 0; background: #e9eef2; }
.rail { width: 132px; flex: none; overflow-y: auto; padding: 20px 0; display: grid; justify-items: center; align-content: start; gap: 14px; background: rgba(255,255,255,.55); }
.rail button { border: 0; background: none; padding: 0; cursor: pointer; display: grid; gap: 6px; justify-items: center; font-size: .72rem; color: var(--faint-ink); }
.rail img { width: 76px; border-radius: 4px; outline: 1px solid var(--line); }
.rail button.current { color: var(--teal-ink); font-weight: 600; }
.rail button.current img { outline: 2px solid var(--teal); }
.stage { flex: 1; overflow: auto; padding: 28px; overscroll-behavior: contain; }
.pages { margin: 0 auto; display: grid; gap: 20px; width: min(var(--pw, 760px), 100%); transition: width 200ms ease; }
.pages.zoomed { width: var(--pw); }
.pages img { width: 100%; height: auto; background: var(--white); box-shadow: 0 8px 28px rgba(10,18,30,.12); }
.no-save, .no-save * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-save img { pointer-events: none; }
.grabber { display: none; }
.pill-pager { display: none; }
@media (max-width: 760px) {
  body.viewer-open .page-shell { transform: scale(.94); border-radius: 14px; }
  .sheet { left: 0; right: 0; top: 56px; bottom: 0; width: 100%; transform: none; border-radius: 20px 20px 0 0; }
  .grabber { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
  .sheet-top { touch-action: none; background: var(--white); }
  .sheet-bar { padding: 8px 14px 12px 20px; backdrop-filter: none; background: var(--white); }
  .tools .seg, .rail { display: none; }
  .stage { padding: 16px; }
  .pill-pager { display: flex; position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); align-items: center; gap: 12px; padding: 8px 12px; border-radius: 100px; background: rgba(10,18,30,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: var(--white); font-weight: 600; font-size: .85rem; z-index: 3; }
  .pill-pager .ibtn { color: var(--white); width: 28px; height: 28px; }
}

/* Story switch: gentle rise + fade */
.story.enter { animation: rise 420ms var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  body.viewer-open .page-shell { transform: none; }
}
