/* SOMAGON — files opened inside the app (media-viewer.js, Haize 2026-10-27): the file over the page, the round cross at the top right. */
html.sv-open,html.sv-open body{overflow:hidden}
.sv-viewer{position:fixed;inset:0;z-index:2147483000;display:grid;grid-template-rows:auto minmax(0,1fr);background:#0c0b10!important;color:#fff;font-family:var(--sg-font,system-ui,-apple-system,sans-serif);-webkit-tap-highlight-color:transparent}
.sv-bar{display:flex;align-items:center;gap:12px;box-sizing:border-box;min-width:0;padding:calc(10px + env(safe-area-inset-top,0px)) calc(14px + env(safe-area-inset-right,0px)) 10px calc(16px + env(safe-area-inset-left,0px))}
.sv-title{flex:1 1 auto;min-width:0;margin:0;color:#fff!important;font-size:15px;font-weight:600;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sv-download{flex:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;padding:0 18px;border-radius:999px;background:rgba(255,255,255,.14);color:#fff;font-size:15px;font-weight:600;text-decoration:none;white-space:nowrap}
.sv-close{flex:none;display:inline-grid;place-items:center;width:44px;height:44px;margin:0;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;cursor:pointer}
.sv-close svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
:is(.sv-download,.sv-close):hover{background:rgba(255,255,255,.22)}
:is(.sv-download,.sv-close):focus-visible{outline:2px solid #b9a6ff;outline-offset:2px}
.sv-stage{display:grid;place-items:center;min-height:0;box-sizing:border-box;padding:8px calc(12px + env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) calc(12px + env(safe-area-inset-left,0px))}
.sv-media{display:block;max-width:100%;max-height:100%;object-fit:contain;border:0;border-radius:6px}
.sv-pdf,.sv-page{width:100%;height:100%;background:#fff}
.sv-page{max-width:720px}
@media(max-width:360px){.sv-download{padding:0 14px}}
/* A picture that opens says so to the pointer. */
img[data-viewer-src]{cursor:zoom-in}
/* Haize 2026-11-09: PDFs made by the app and the legal texts open here too. */
.sv-viewer:has(.sv-foot){grid-template-rows:auto minmax(0,1fr) auto}
.sv-download[hidden]{display:none}
/* Until the text to accept is read, the cross keeps its place but is not shown: the bar does not move when it appears. */
.sv-close[hidden]{display:inline-grid;visibility:hidden}
button.sv-download{border:0;cursor:pointer;font-family:inherit}
.sv-wait{margin:0;padding:24px;color:rgba(255,255,255,.78);font-size:15px;text-align:center}
.sv-viewer[data-viewer=legal] .sv-stage{display:block;padding:0 calc(12px + env(safe-area-inset-right,0px)) 0 calc(12px + env(safe-area-inset-left,0px))}
.sv-viewer[data-viewer=legal]:not(:has(.sv-foot)) .sv-stage{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
.sv-doc{box-sizing:border-box;height:100%;max-width:760px;margin:0 auto;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;border-radius:12px;background:#fff;color:#1d1b24}
.sv-doc:focus-visible{outline:2px solid #b9a6ff;outline-offset:2px}
.sv-doc .sv-wait{color:#5d5a66}
.sv-doc-body{padding:20px 20px 32px;font-size:16px;line-height:1.55;overflow-wrap:break-word}
.sv-doc-body h1{margin:0 0 6px;font-size:22px;line-height:1.25}
.sv-doc-body h2{margin:24px 0 8px;font-size:18px;line-height:1.3}
.sv-doc-body h3{margin:18px 0 6px;font-size:16px}
.sv-doc-body p,.sv-doc-body li{margin:0 0 10px}
/* The document is a white sheet in both themes. Its text never takes the theme's colours, which are made for the app's own
   background: in the dark theme they are pale and could not be read on white. */
.sv-viewer .sv-doc-body :is(h1,h2,h3,h4,p,li,dt,dd,td,th,blockquote,strong,b,em,i,span){color:#1d1b24}
.sv-doc-body ul,.sv-doc-body ol{padding-left:22px}
.sv-doc-body a{color:#5b3fd6}
.sv-viewer .sv-doc-body .legal-meta,.sv-viewer .sv-doc-body .legal-meta :is(strong,b,em,i,span){color:#5d5a66}
.sv-doc-body .legal-meta{font-size:14px}
.sv-doc-body table{width:100%;border-collapse:collapse;font-size:14px}
.sv-doc-body :is(th,td){padding:6px 8px;border-bottom:1px solid #e3e0ea;text-align:left;vertical-align:top}
.sv-foot{display:flex;align-items:center;gap:12px;box-sizing:border-box;padding:12px calc(16px + env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) calc(16px + env(safe-area-inset-left,0px))}
.sv-hint{flex:1 1 auto;min-width:0;margin:0;color:rgba(255,255,255,.82);font-size:14px;line-height:1.35}
.sv-read{flex:none;min-height:var(--sg-cta-height,56px);padding:8px 22px;border:0;border-radius:var(--sg-cta-radius,15px);background:var(--sg-cta-fill,linear-gradient(180deg,#7754FF 0%,#6342F0 100%));color:#fff;font:inherit;font-size:15px;font-weight:700;cursor:pointer;box-shadow:var(--sg-cta-glow,inset 0 1px 0 rgba(255,255,255,.18))}
.sv-read:disabled{background:rgba(255,255,255,.14);color:rgba(255,255,255,.55);box-shadow:none;cursor:default}
.sv-read:focus-visible{outline:2px solid #b9a6ff;outline-offset:2px}
/* The viewer is a modal <dialog> (top layer, above an open sheet): no browser frame, margin or size limit. */
dialog.sv-viewer{width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;box-sizing:border-box;overflow:hidden}
dialog.sv-viewer:not([open]){display:none}
dialog.sv-viewer::backdrop{background:transparent}
/* Haize 2026-11-11: the pages of a PDF are drawn by the app (PDF.js), one under the other, as wide as the screen; an
   iPhone showed a white rectangle for a PDF in a frame. Read by scrolling, enlarged by spreading two fingers. */
.sv-viewer[data-viewer=pdf] .sv-stage{display:block;padding:0 calc(12px + env(safe-area-inset-right,0px)) 0 calc(12px + env(safe-area-inset-left,0px))}
.sv-pages{box-sizing:border-box;width:100%;height:100%;max-width:900px;margin:0 auto;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.sv-pages:focus-visible{outline:2px solid #b9a6ff;outline-offset:2px}
/* Plain blocks, one under the other: in a grid the sheets, whose height comes from their width, overlapped. */
.sv-sheet{width:100%;border-radius:6px;background:#fff;overflow:hidden}
.sv-sheet+.sv-sheet{margin-top:10px}
.sv-sheet canvas{display:block;width:100%;height:100%}
