/* SavPresentations — look of the app. Colours come from the SavComponents tokens (Soft style), with its own primary. */
@font-face {
    font-family: "Stack Sans Notch";
    src: url("../fonts/stack-sans-notch.ttf");
    font-display: swap;
}

@font-face {
    font-family: "UI";
    src: url("../fonts/inter-regular.woff") format("woff");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "UI";
    src: url("../fonts/inter-bold.woff") format("woff");
    font-weight: 600 800;
    font-display: swap;
}

:root, .sav-theme-light {
    --sav-color-primary: #6d3bef;
    --sav-color-on-primary: #ffffff;
    --sav-color-bg: #f7f5fc;
    --sav-color-surface-2: #f0ecf9;
    --sav-color-border: #e4ddf2;
    --sav-color-text: #1b1530;
    --sav-color-text-muted: #645c7c;
    --sav-font: "UI", system-ui, sans-serif;
    --sav-radius: 10px;
    --sav-radius-lg: 16px;
    --coral: #e0447c;
    --canvas: #e9e4f3;
}

.sav-theme-dark {
    --sav-color-primary: #a98bff;
    --sav-color-on-primary: #190a3d;
    --sav-color-bg: #110d1c;
    --sav-color-surface: #1a1528;
    --sav-color-surface-2: #241d36;
    --sav-color-border: #342b4b;
    --sav-color-text: #efeaf9;
    --sav-color-text-muted: #a79ec0;
    --sav-color-input-bg: #151021;
    --coral: #ff7fae;
    --canvas: #0b0813;
}

@media (prefers-color-scheme: dark) {
    .sav-theme-auto {
        --sav-color-primary: #a98bff;
        --sav-color-on-primary: #190a3d;
        --sav-color-bg: #110d1c;
        --sav-color-surface: #1a1528;
        --sav-color-surface-2: #241d36;
        --sav-color-border: #342b4b;
        --sav-color-text: #efeaf9;
        --sav-color-text-muted: #a79ec0;
        --sav-color-input-bg: #151021;
        --coral: #ff7fae;
        --canvas: #0b0813;
    }
}

*, ::before, ::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--sav-color-bg);
    color: var(--sav-color-text);
    font: 400 15px/1.5 var(--sav-font);
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

h1, h2, h3, p {
    margin: 0;
}

a {
    color: color-mix(in oklab, var(--sav-color-primary) 85%, var(--sav-color-text));
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--sav-color-focus);
    outline-offset: 2px;
}
/* these SavComponents draw their own focus ring inside: a second outline around them made two loose lines across menus */
sav-menu-item:focus-visible, sav-tree-item:focus-visible, sav-radio:focus-visible { outline: none; }

.muted {
    color: var(--sav-color-text-muted);
}

.hint {
    padding: .2rem 0 .6rem;
    font-size: .85rem;
}

.spacer {
    flex: 1;
}

.row {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}

.stack {
    display: grid;
    gap: .9rem;
}

.grow {
    flex: 1;
    min-width: 0;
}

.two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .8rem;
    align-items: start;
}

.center {
    display: grid;
    place-items: center;
    min-height: 12rem;
    padding: 1rem;
    text-align: center;
}

.lbl {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    margin: .2rem 0;
}

.lk {
    border: 0;
    background: none;
    padding: 0;
    color: color-mix(in oklab, var(--sav-color-primary) 85%, var(--sav-color-text));
    cursor: pointer;
    font-size: .82rem;
}

.lk:hover {
    text-decoration: underline;
}

kbd {
    font: 600 .75rem var(--sav-font);
    padding: .1rem .4rem;
    border: 1px solid var(--sav-color-border);
    border-radius: 6px;
    background: var(--sav-color-surface-2);
    white-space: nowrap;
}

code {
    font: .82rem var(--sav-font-mono);
}

/* ------------------------------------------------------------ slides */
.sl {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    contain: strict;
    font-variant-ligatures: none;
    user-select: none;
    -webkit-user-select: none;
}

.sl .el {
    position: absolute;
    transform-origin: 50% 50%;
}

.sl .tx {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.sl .rt {
    width: 100%;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    outline: 0;
    min-height: 1em;
}

.sl .rt p {
    margin: 0;
    min-height: 1em;
}

.sl .rt ul, .sl .rt ol {
    margin: 0;
    padding-left: 1.25em;
}

.sl .rt li::marker {
    font-variant-numeric: normal;
}

.sl .rt a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: .12em;
}

.sl .rt b {
    font-weight: 700;
}

.sl .rt sup, .sl .rt sub {
    font-size: .62em;
    line-height: 0;
}

.sl .rt.ph {
    opacity: .38;
}

.sl-thumb .rt.ph, .sl-view .rt.ph {
    display: none;
}

.sl .shp {
    position: absolute;
    inset: 0;
    overflow: visible;
    display: block;
}

.sl .shp .hit {
    pointer-events: stroke;
}

.sl .im {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.sl .im img {
    width: 100%;
    height: 100%;
    display: block;
}

.sl .im.empty {
    display: grid;
    place-items: center;
}

.sl .im.empty svg {
    width: min(22%, 64px);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    opacity: .7;
}

.sl-present .im.empty svg, .sl-view .im.empty svg {
    display: none;
}

.sl .playbadge {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 64px;
    height: 64px;
    max-width: 40%;
    max-height: 40%;
    border-radius: 50%;
    background: rgb(0 0 0 / .55);
    display: grid;
    place-items: center;
}

.sl .playbadge svg {
    width: 60%;
    fill: #fff;
}

.sl .bgimg, .sl .bgdim {
    position: absolute;
    inset: 0;
    background-size: cover;
}

.sl .decor {
    pointer-events: none;
}

.sl-edit .el {
    cursor: move;
}

.sl-edit .el.locked {
    cursor: default;
}

.sl-edit .writing {
    cursor: text;
}

.sl .writing .rt {
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.sl-view .linked, .sl-present .linked {
    cursor: pointer;
}

.sl-view .rt {
    user-select: text;
    -webkit-user-select: text;
}

.thumb {
    position: relative;
    overflow: hidden;
}

.thumb .sl, .thumb .sl * {
    pointer-events: none;
}

.thumb.fluid {
    width: 100%;
}

.offscreen {
    position: fixed;
    left: -99999px;
    top: 0;
    width: 4000px;
    height: 4000px;
    overflow: hidden;
}

.offscreen .sl {
    contain: none;
}

/* ------------------------------------------------------------ brand, landing, sign in */
.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.1rem;
    color: var(--sav-color-text);
    text-decoration: none;
    letter-spacing: -.02em;
}

.brand b {
    font-weight: 700;
}

/* the footer, the same of SavDocuments: links on the left, the language on the right */
.credit {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.1rem;
    align-items: center;
    width: 100%;
    max-width: 1680px;
    margin: auto auto 0;
    padding: 1rem clamp(.8rem, 2vw, 1.6rem) calc(1rem + env(safe-area-inset-bottom));
    font-size: .85rem;
    color: var(--sav-color-text-muted);
}

.credit .grow {
    flex: 1;
}

.credit a {
    color: inherit;
}

.credit .sign {
    font-family: "Stack Sans Notch", var(--sav-font);
}

.ltop {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
}

.lmain {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 3rem);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
    padding: clamp(1.5rem, 6vh, 5rem) 0;
}

.hero h1 {
    font-size: clamp(2.3rem, 5vw, 4rem);
    line-height: 1.02;
    letter-spacing: -.045em;
    font-weight: 700;
    text-wrap: balance;
}

.hero-t > p {
    margin: 1.2rem 0 1.6rem;
    font-size: 1.12rem;
    color: var(--sav-color-text-muted);
    max-width: 34rem;
    text-wrap: pretty;
}

.hero-t small {
    display: block;
    margin-top: 1rem;
    color: var(--sav-color-text-muted);
}

.l-stage {
    position: relative;
    aspect-ratio: 1 / .94;
}

.l-card {
    position: absolute;
    width: 64%;
    aspect-ratio: 16 / 9;
    left: calc(1% + var(--i) * 5.6%);
    top: calc(1% + var(--i) * 10%);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgb(44 18 110 / .22);
    will-change: transform, opacity;
    backface-visibility: hidden;
    pointer-events: none;
}

.l-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 34px 80px rgb(44 18 110 / .42);
    opacity: var(--lift, 0);
}

.l-in {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
}

.l-card .sl {
    transform-origin: 0 0;
}

.hero {
    padding-bottom: 5rem;
}

.feats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 2rem 2.5rem;
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--sav-color-border);
}

.feat sav-icon {
    font-size: 1.5rem;
    color: var(--coral);
}

.feat h3 {
    margin: .5rem 0 .2rem;
    font-size: 1.05rem;
}

.feat p {
    color: var(--sav-color-text-muted);
}

.amain {
    display: grid;
    place-items: center;
    min-height: calc(100dvh - 12rem);
    padding: 1rem;
}

.acard {
    width: min(26rem, 100%);
    --sav-card-padding: 1.8rem;
}

.aform {
    display: grid;
    gap: 1rem;
}

.aform h1 {
    font-size: 1.5rem;
    letter-spacing: -.02em;
}

.aerr:empty {
    display: none;
}

.alinks {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.2rem;
    font-size: .9rem;
}

.bigicon {
    font-size: 2.4rem;
    color: var(--sav-color-primary);
    line-height: 1;
}

.or {
    display: flex;
    align-items: center;
    gap: .8rem;
    color: var(--sav-color-text-muted);
    font-size: .85rem;
}

.or::before, .or::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--sav-color-border);
}

.gbox {
    display: grid;
    gap: .8rem;
    justify-items: center;
}

.gbox > sav-button {
    width: 100%;
}

.gbtn {
    min-height: 44px;
    color-scheme: light;
}

.dlg-text {
    max-width: 40rem;
}

/* ------------------------------------------------------------ home */
.htop {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .7rem clamp(.8rem, 2vw, 1.6rem);
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in oklab, var(--sav-color-bg) 88%, transparent);
    backdrop-filter: blur(10px);
}

.hsearch {
    flex: 0 1 30rem;
    margin-left: auto;
}

.htop .hsearch + .spacer {
    flex: 1;
}

.hbody {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 1.6rem;
    padding: .6rem clamp(.8rem, 2vw, 1.6rem) 2rem;
    max-width: 1680px;
    margin: 0 auto;
    align-content: start;
}

/* the pages that scroll (home, settings, first page…): the footer stays at the bottom, as in SavDocuments */
body:not(.ed):not(.spk) > #app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

body:not(.ed):not(.spk) > #app > :is(main, .hbody) {
    width: 100%;
    box-sizing: border-box;
    flex: 1 0 auto;
}

.hside {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    align-self: start;
    position: sticky;
    top: 4.6rem;
}

.newbtn {
    margin-bottom: .8rem;
}

.nofold {
    padding: 0 .8rem;
}

sav-menu-item.over, sav-tree-item.over, .folders sav-button.over {
    outline: 2px dashed var(--sav-color-primary);
    border-radius: 10px;
}

.navh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem .2rem .2rem .8rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--sav-color-text-muted);
}

.quota {
    display: grid;
    gap: .35rem;
    padding: 1.2rem .8rem;
}

.quota small {
    color: var(--sav-color-text-muted);
}

.hhead {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.hhead h1 {
    font-size: 1.5rem;
    letter-spacing: -.025em;
}

.hmain h2 {
    font-size: 1rem;
    margin: 1.4rem 0 .7rem;
}

.quick {
    --sav-card-padding: 1rem 1.2rem 1.2rem;
}

.hmain .qhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .7rem;
}

.hmain .qhead h2 {
    margin: 0;
}

.qrow {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(8.6rem, 1fr);
    gap: .9rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px;
    margin: -4px;
}

.qrow::-webkit-scrollbar {
    display: none;
}

.tile {
    --sav-card-padding: 0;
    min-width: 0;
}

.tile:focus-visible {
    outline: 2px solid var(--sav-color-focus);
    outline-offset: 2px;
    border-radius: var(--sav-radius-lg);
}

.tpl, .lay {
    --sav-radius-lg: 12px;
    font-size: .84rem;
}

.tpl > span, .lay > span {
    display: block;
    padding: .45rem .7rem .5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tthumb {
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--sav-color-surface-2);
}

.tthumb .thumb {
    max-height: 100%;
    width: auto;
    height: 100%;
}

.tthumb .thumb.fluid {
    height: auto;
    width: 100%;
}

.tile.on::part(base) {
    border-color: var(--sav-color-primary);
    box-shadow: 0 0 0 2px var(--sav-color-primary);
}

.blankt {
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: var(--sav-color-primary);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1.2rem;
}

.grid.tpls {
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

.card {
    --sav-radius-lg: 16px;
}

.starb {
    opacity: 0;
    transition: opacity .15s;
}

.card:hover .starb, .card:focus-within .starb, .starb.on, .starb:focus-within {
    opacity: 1;
}

.starb.on {
    --sav-tint: 80%;
}

@media (hover: none) {
    .starb {
        opacity: 1;
    }
}

.cthumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--sav-color-surface-2);
    overflow: hidden;
    display: grid;
    place-items: center;
}

.cthumb .thumb {
    width: 100%;
}

.cthumb .thumb:not([style*="16"]) {
    max-height: 100%;
}

.cglobe {
    position: absolute;
    right: .5rem;
    bottom: .5rem;
    width: 1.7rem;
    height: 1.7rem;
    padding: .38rem;
    border-radius: 50%;
    background: rgb(255 255 255 / .94);
    color: #1b1530;
    box-shadow: var(--sav-shadow-sm);
}

.cglobe.second {
    right: 2.6rem;
}

.cbadge {
    position: absolute;
    left: .5rem;
    top: .5rem;
}

.cinfo {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .7rem .4rem .7rem .9rem;
}

.cinfo > div:first-child {
    flex: 1;
    min-width: 0;
    display: grid;
}

.cinfo b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.cinfo small {
    color: var(--sav-color-text-muted);
    font-size: .8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rows {
    display: grid;
    gap: .4rem;
}

.rows .card {
    contain-intrinsic-size: 15rem 4rem;
}

.rows .card::part(body) {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    align-items: center;
}

.rows .cthumb {
    aspect-ratio: auto;
    height: 3.7rem;
}

.rows .cinfo > div:first-child {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

.folders {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-bottom: 1.2rem;
}

.newdlg {
    display: grid;
    gap: .8rem;
}

.tplpick {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 9.4rem;
    gap: .8rem;
    overflow-x: auto;
    padding: 4px 4px .7rem;
    scroll-snap-type: x proximity;
}

.tplpick .tpl {
    scroll-snap-align: center;
}

.ratio {
    display: inline-block;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.share {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
}

.share section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .6rem;
}

.share h3 {
    font-size: .95rem;
}

.inv {
    flex-wrap: nowrap;
}

.rolesel {
    width: 10.5rem;
    flex: 0 1 10.5rem;
    min-width: 7rem;
}

.person {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .35rem 0;
}

.pinfo {
    flex: 1;
    min-width: 0;
    display: grid;
    line-height: 1.3;
}

.pinfo b, .pinfo small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.pinfo small {
    color: var(--sav-color-text-muted);
    font-weight: 400;
}

.people {
    max-height: 16rem;
    overflow: auto;
}

.acc {
    display: inline-flex;
    gap: .6rem;
    align-items: start;
}

.acc b, .acc small {
    display: block;
    font-weight: 600;
}

.acc small {
    color: var(--sav-color-text-muted);
    font-weight: 400;
}

.linkrow {
    display: flex;
    gap: .6rem;
    align-items: center;
}

.linkrow code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--sav-color-surface-2);
    padding: .5rem .7rem;
    border-radius: 8px;
}

.person.dead {
    opacity: .55;
}

.lic {
    font-size: 1.2rem;
    color: var(--sav-color-primary);
}

.mpanel {
    display: grid;
    gap: .7rem;
    padding-top: .7rem;
}

.mgrid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.mgrid::after {
    content: "";
    flex: 100 1 0;
}

.mcell {
    --ar: 1.4;
    --sav-radius-lg: 10px;
    position: relative;
    flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 92px);
    max-width: 100%;
    aspect-ratio: var(--ar);
    overflow: hidden;
}

.mcell img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mcell .mlic {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    padding: .8rem .5rem .3rem;
    font-size: .7rem;
    color: #fff;
    background: linear-gradient(transparent, rgb(0 0 0 / .65));
    opacity: 0;
}

.mcell:hover .mlic, .mcell:focus-visible .mlic {
    opacity: 1;
}

.mcell.busy {
    opacity: .5;
    pointer-events: none;
}

.vb {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgb(0 0 0 / .55);
    color: #fff;
    display: grid;
    place-items: center;
}

.mcell.own sav-tooltip {
    position: absolute;
    right: .2rem;
    top: .2rem;
    background: var(--sav-color-surface);
    border-radius: 8px;
    opacity: 0;
}

.mcell.own:hover sav-tooltip, .mcell.own:focus-within sav-tooltip {
    opacity: 1;
}

@media (hover: none) {
    .mcell.own sav-tooltip, .mcell .mlic {
        opacity: 1;
    }
}

.vbox {
    aspect-ratio: 16/9;
}

.vbox > * {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 10px;
    background: #000;
}

.dls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .8rem;
}

.dl {
    --sav-card-padding: 1rem;
}

.dl::part(body) {
    display: grid;
    gap: .15rem;
    justify-items: start;
}

.dl sav-icon {
    font-size: 1.6rem;
    color: var(--coral);
}

.dl small {
    color: var(--sav-color-text-muted);
}

.dl.busy {
    opacity: .5;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    to {
        opacity: .9;
    }
}

.keys {
    display: grid;
    gap: .5rem;
}

.kr {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* ------------------------------------------------------------ editor */
body.ed {
    overflow: hidden;
}

body.ed #app {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

.etop {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .7rem;
    background: var(--sav-color-surface);
    border-bottom: 1px solid var(--sav-color-border);
    min-width: 0;
}

.ehome {
    display: grid;
}

.etitle {
    display: grid;
    flex: 0 1 15rem;
    min-width: 8rem;
}

.dtitle {
    width: 100%;
    min-width: 0;
    --sav-color-input-bg: transparent;
}

.dtitle::part(base) {
    border-color: transparent;
    background: none;
    box-shadow: none;
}

.dtitle::part(input) {
    font-weight: 600;
    font-size: 1rem;
    text-overflow: ellipsis;
}

.dtitle:not([readonly]):hover::part(base), .dtitle:focus-within::part(base) {
    border-color: var(--sav-color-border-strong);
}

.status {
    display: inline-flex;
    gap: .35rem;
    align-items: center;
    font-size: .74rem;
    color: var(--sav-color-text-muted);
    padding-left: .45rem;
}

.status.off {
    color: var(--coral);
}

.hist {
    display: flex;
}

.ins {
    display: flex;
    gap: .1rem;
    margin-left: .5rem;
    padding-left: .5rem;
    border-left: 1px solid var(--sav-color-border);
}

#app.viewer .ins {
    display: none;
}

.people-now {
    display: flex;
    gap: .35rem;
    align-items: center;
}

.people-now .more {
    font-size: .8rem;
    color: var(--sav-color-text-muted);
}

.emain {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    min-height: 0;
}

.eleft {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .7rem .5rem .7rem .7rem;
    border-right: 1px solid var(--sav-color-border);
    background: var(--sav-color-surface);
    min-height: 0;
}

.strip {
    flex: 1;
    overflow: hidden auto;
    --gap: .55rem;
    align-content: start;
    padding: 3px 6px 3px 3px;
    scrollbar-width: thin;
    scrollbar-gutter: stable; /* the same width with and without a scroll bar: the small slides do not jump */
    min-height: 0;
}

.st:focus-visible {
    outline: 0;
}

.st:focus-visible .stt {
    box-shadow: 0 0 0 3px var(--sav-color-focus);
}

.st {
    position: relative;
    display: flex;
    gap: .4rem;
    cursor: pointer;
    align-items: flex-start;
    flex: none;
}

.stn {
    width: 1.3rem;
    font-size: .74rem;
    color: var(--sav-color-text-muted);
    text-align: right;
    padding-top: .1rem;
    font-variant-numeric: tabular-nums;
}

.stt {
    border-radius: 7px;
    box-shadow: 0 0 0 1px var(--sav-color-border);
    overflow: hidden;
    background: var(--sav-color-surface-2);
}

.st:hover .stt {
    box-shadow: 0 0 0 2px var(--sav-color-border-strong);
}

.st.on .stt {
    box-shadow: 0 0 0 2.5px var(--sav-color-primary);
}

.st.on .stn {
    color: var(--sav-color-text);
    font-weight: 700;
}

.st.hid .stt {
    opacity: .4;
}

.stb {
    min-width: 0;
}

.stl {
    display: flex;
    gap: .3rem;
    align-items: center;
    min-height: 0;
    padding-top: .15rem;
    font-size: .7rem;
    color: var(--sav-color-text-muted);
    width: 0;
    min-width: 100%; /* as wide as the small slide above it, whatever its width */
}

.stl:empty {
    display: none;
}

.stl span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stl sav-icon {
    flex: none;
    font-size: .8rem;
}

.stp {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: flex;
    gap: 2px;
}

.stp i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid #fff;
}

.banner:empty {
    display: none;
}

.banner {
    padding: .5rem .7rem 0;
}

.banner .prow {
    align-items: center;
}

.ecenter {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-width: 0;
    min-height: 0;
    background: var(--canvas);
}

.ecenter > .scroller {
    grid-row: 2;
}

.ecenter > .banner {
    grid-row: 1;
}

.ecenter > .ebottom {
    grid-row: 4;
}

.scroller {
    overflow: auto;
    display: grid;
    place-items: center;
    place-content: safe center;
    outline: 0;
    touch-action: none;
    padding: 24px;
}

#app.viewer .scroller {
    touch-action: pan-x pan-y pinch-zoom;
}

.scroller.drop {
    box-shadow: inset 0 0 0 3px var(--sav-color-primary);
}

.holder {
    position: relative;
    box-shadow: 0 6px 30px rgb(40 20 90 / .16);
    background: #fff;
}

.ebottom {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .7rem;
    font-size: .8rem;
    color: var(--sav-color-text-muted);
    background: var(--sav-color-surface);
    border-top: 1px solid var(--sav-color-border);
}

.overlay {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.overlay > * {
    position: absolute;
}

.sel {
    outline: 1.5px solid var(--sav-color-primary);
}

.selall {
    outline: 1px dashed var(--sav-color-primary);
}

.hd {
    position: absolute;
    width: 11px;
    height: 11px;
    margin: -5.5px;
    background: #fff;
    border: 1.5px solid #6d3bef;
    border-radius: 3px;
    pointer-events: auto;
    touch-action: none;
}

.hd::after {
    content: "";
    position: absolute;
    inset: -9px;
}

.hd.nw {
    left: 0;
    top: 0;
    cursor: nwse-resize;
}

.hd.n {
    left: 50%;
    top: 0;
    cursor: ns-resize;
}

.hd.ne {
    left: 100%;
    top: 0;
    cursor: nesw-resize;
}

.hd.e {
    left: 100%;
    top: 50%;
    cursor: ew-resize;
}

.hd.se {
    left: 100%;
    top: 100%;
    cursor: nwse-resize;
}

.hd.s {
    left: 50%;
    top: 100%;
    cursor: ns-resize;
}

.hd.sw {
    left: 0;
    top: 100%;
    cursor: nesw-resize;
}

.hd.w {
    left: 0;
    top: 50%;
    cursor: ew-resize;
}

.hd.rot {
    left: 50%;
    top: -26px;
    border-radius: 50%;
    cursor: grab;
}

.hd.rot::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    height: 15px;
    border-left: 1.5px solid #6d3bef;
}

.hd.end {
    left: 0;
    top: 50%;
    border-radius: 50%;
    cursor: move;
}

.hd.end.b {
    left: 100%;
}

.lk .sel, .sel .lk {
    position: absolute;
    right: 2px;
    top: 2px;
    font-size: 12px;
    color: var(--sav-color-primary);
}

.guide {
    background: var(--coral);
}

.marquee {
    background: color-mix(in oklab, var(--sav-color-primary) 14%, transparent);
    outline: 1px solid var(--sav-color-primary);
}

.psel {
    outline: 2px solid var(--pc);
}

.psel span, .pcur span {
    position: absolute;
    left: -2px;
    bottom: 100%;
    padding: 0 .4rem;
    font-size: 11px;
    line-height: 17px;
    color: #fff;
    border-radius: 5px 5px 5px 0;
    white-space: nowrap;
}

.pcur {
    transition: left .2s linear, top .2s linear;
}

.pcur i {
    display: block;
    width: 0;
    height: 0;
    border-left: 11px solid var(--pc);
    border-bottom: 11px solid transparent;
}

.pcur span {
    left: 8px;
    top: 12px;
    bottom: auto;
    background: var(--pc);
    border-radius: 5px;
}

.pin {
    pointer-events: auto;
    margin: -14px;
    --sav-color-primary: var(--coral);
    --sav-color-on-primary: #fff;
}

.pin::part(base) {
    min-height: 26px;
    width: 26px;
    font-size: 11px;
}

.pin.notes {
    --sav-color-primary: #6d3bef;
}

.pin.on {
    transform: scale(1.2);
    z-index: 2;
}

.parea {
    border: 2px dashed var(--coral);
    border-radius: 4px;
    background: rgb(224 68 124 / .08);
    opacity: .5;
}

.parea.notes {
    border-color: #7048e8;
    background: rgb(112 72 232 / .08);
}

.parea.on {
    opacity: 1;
}

.parea.draft {
    animation: draft 1.1s ease-in-out infinite alternate;
}

@keyframes draft {
    to {
        opacity: .55;
    }
}

.pindraft {
    font-size: 26px;
    margin: -26px 0 0 -13px;
    color: var(--coral);
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / .4));
}

.pindraft.notes {
    color: #6d3bef;
}

.picking .scroller, .picking .scroller * {
    cursor: crosshair !important;
}

.epanel {
    width: 0;
    overflow: hidden;
    background: var(--sav-color-surface);
    border-left: 1px solid var(--sav-color-border);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.has-panel .epanel {
    width: 310px;
}

.phead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .4rem .4rem 1rem;
}

.phead h2 {
    font-size: 1rem;
}

.pbody {
    flex: 1;
    overflow: auto;
    padding: 0 1rem 1.4rem;
    scrollbar-width: thin;
}

.rail {
    width: 84px;
    background: var(--sav-color-surface);
    border-left: 1px solid var(--sav-color-border);
    overflow: auto;
    scrollbar-width: none;
}

.rail::part(base) {
    flex-direction: column;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: .4rem .2rem;
    background: none;
    backdrop-filter: none;
}

.rail sav-bottom-nav-item {
    flex: none;
}

.psec {
    display: grid;
    gap: .65rem;
    padding: .7rem 0 .9rem;
    border-bottom: 1px solid var(--sav-color-border);
}

.psec:last-child {
    border: 0;
}

.psec2 {
    margin-top: .5rem;
}

.psec2::part(base) {
    background: none;
}

.flabel {
    font-size: .76rem;
    color: var(--sav-color-text-muted);
}

.prow {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.tools {
    display: flex;
    flex-wrap: wrap;
}

.grid3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.6rem, 1fr));
    gap: .5rem;
}

.prow > sav-number-input {
    flex: 1;
    min-width: 4.5rem;
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.segm {
    max-width: 100%;
}

.dgrid {
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(4.2rem, 1fr));
    gap: 3px;
    overflow-x: auto;
    padding: 2px;
}

.dgrid .th::part(input) {
    font-weight: 700;
}

.cf {
    display: grid;
    gap: .2rem;
    font-size: .76rem;
    color: var(--sav-color-text-muted);
}

.cbtn::part(base) {
    width: 2.9rem;
    padding: 0;
}

.cbtn::part(base)::before {
    background: var(--c, transparent);
    border-color: var(--sav-color-border-strong);
}

.cbtn.none::part(base)::before {
    background: linear-gradient(to top right, transparent 47%, #e03131 47% 53%, transparent 53%);
}

.sw::part(base) {
    min-height: 1.7rem;
    width: 1.7rem;
}

.sw:not([icon])::part(base)::before {
    background: var(--c);
    border-color: rgb(120 120 140 / .4);
}

.cpop {
    display: grid;
    gap: .5rem;
}

.cpop small {
    color: var(--sav-color-text-muted);
}

.sws {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: .35rem;
    justify-items: center;
}

.ptexts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.ins-t {
    --sav-radius-lg: 10px;
    cursor: grab;
}

.ins-t::part(body) {
    display: grid;
    place-items: center;
    padding: .5rem;
    min-height: 2.9rem;
    text-align: center;
}

.ins-t.sq {
    aspect-ratio: 1;
}

.ins-t.sq::part(body) {
    min-height: 0;
    padding: 14%;
}

.ins-t.sq sav-icon {
    font-size: 1.3rem;
}

.ins-t.big::part(body) {
    gap: .25rem;
    padding: .7rem .2rem;
    font-size: .76rem;
}

.ins-t.big sav-icon {
    font-size: 1.4rem;
    color: var(--sav-color-primary);
}

.p-title {
    font-weight: 700;
    font-size: 1.25rem;
    grid-column: span 2;
    letter-spacing: -.02em;
}

.p-heading {
    font-weight: 700;
}

.p-quote {
    font-style: italic;
}

.p-big {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--sav-color-primary);
}

.p-caption {
    font-size: .78rem;
    color: var(--sav-color-text-muted);
}

.pmedia {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
}

.pgrid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .4rem;
}

.draw {
    width: 100%;
    fill: var(--sav-color-text-muted);
}

.draw.line {
    fill: none;
    stroke: var(--sav-color-text);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ins-t:hover .draw:not(.line) {
    fill: var(--sav-color-primary);
}

.ins-t:hover .draw.line {
    stroke: var(--sav-color-primary);
}

.lays {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    padding-top: .8rem;
}

.lay {
    font-size: .76rem;
    color: var(--sav-color-text-muted);
}

.lay .rt.ph {
    opacity: .75;
}

.lay.hid {
    opacity: .5;
}

.ftb {
    position: fixed;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: .1rem;
    padding: .25rem;
    border-radius: 12px;
    background: var(--sav-color-surface);
    border: 1px solid var(--sav-color-border);
    box-shadow: var(--sav-shadow-lg);
    max-width: calc(100vw - 16px);
}

.ftb > i {
    width: 1px;
    height: 1.2rem;
    background: var(--sav-color-border);
    margin: 0 .2rem;
}

.ftpop {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .6rem;
    width: 17rem;
    max-height: 15rem;
    overflow: auto;
    border-radius: 12px;
    background: var(--sav-color-surface);
    border: 1px solid var(--sav-color-border);
    box-shadow: var(--sav-shadow-lg);
}

.ctxm {
    position: fixed;
    z-index: 70;
    width: 0;
    height: 0;
}

.composer {
    display: grid;
    gap: .5rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--sav-color-border);
}

.composer .prow {
    align-items: center;
}

.what {
    font-size: .78rem;
}

.phead2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: .8rem 0 .4rem;
    flex-wrap: wrap;
}

.thread {
    --sav-card-padding: .7rem;
    margin-bottom: .6rem;
    cursor: pointer;
}

.thread.on::part(base) {
    border-color: var(--coral);
}

.thread.note.on::part(base) {
    border-color: #6d3bef;
}

.thread.done {
    opacity: .6;
}

.cm {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
}

sav-avatar {
    flex: none;
}

.cm > div {
    flex: 1;
    min-width: 0;
}

.cmw {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.vnone {
    position: absolute;
    inset: 0;
    margin: auto;
    font-size: 1.6rem;
    color: var(--sav-color-text-muted);
}

.cmh {
    display: flex;
    gap: .5rem;
    align-items: baseline;
}

.cmh small {
    color: var(--sav-color-text-muted);
}

.cm p {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-size: .9rem;
}

.cma {
    display: flex;
    gap: .8rem;
}

.pad {
    padding-top: 1rem;
}

.presentm::part(base) {
    padding: 0;
    width: 2rem;
}

.ttext {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.tprev {
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: .6rem;
    max-height: 60vh;
    overflow: auto;
}

.tprev .thumb, .aview .thumb {
    border-radius: 8px;
    box-shadow: 0 0 0 1px var(--sav-color-border);
}

.ovw {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}

.flist {
    max-height: 40vh;
    overflow: auto;
}

@media (max-width: 900px) {
    .ttext {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------ show */
.show {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #000;
    outline: 0;
}

.show-v {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
}

.show .sl {
    transform: scale(var(--k));
    transform-origin: 0 0;
}

.show .wait {
    visibility: hidden;
}

.show.black .show-v {
    visibility: hidden;
}

.show.lasering {
    cursor: none;
}

.show .im iframe, .show .im video {
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.show-bar {
    position: absolute;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    padding: .2rem .4rem;
    border-radius: 14px;
    background: rgb(27 20 45 / .86);
    color: #fff;
    opacity: 0;
    transition: opacity .25s;
    --sav-color-text: #fff;
    --sav-color-neutral: #fff;
}

.show.awake .show-bar, .show-bar:focus-within {
    opacity: 1;
}

.show:not(.awake) {
    cursor: none;
}

.show-n {
    padding: 0 .6rem;
    font-variant-numeric: tabular-nums;
    font-size: .85rem;
}

.ink {
    position: absolute;
    inset: 0;
    pointer-events: none;
    touch-action: none;
}

.ink.on {
    pointer-events: auto;
    cursor: crosshair;
}

.show-ov {
    position: absolute;
    inset: 0;
    overflow: auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
    align-content: start;
    background: rgb(10 6 22 / .94);
    color: #fff;
    cursor: auto;
}

.show-bar {
    z-index: 3;
}

.laser {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: -9px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 18px 6px rgb(255 59 48 / .6);
    pointer-events: none;
}

/* ------------------------------------------------------------ settings, admin */
.smain {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem clamp(.8rem, 3vw, 2rem) 2rem;
}

.smain.wide {
    max-width: 1320px;
}

.sgrid {
    columns: 2 26rem;
    column-gap: 1.2rem;
    margin-top: 1rem;
}

.scard {
    display: block;
    break-inside: avoid;
    margin-bottom: 1.2rem;
}

.shead {
    display: flex;
    gap: .6rem;
    align-items: center;
}

.shead sav-icon {
    color: var(--coral);
}

.atabs {
    display: block;
    margin-bottom: 1.2rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.afilter {
    display: flex;
    gap: .8rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.afilter sav-input {
    width: 20rem;
    max-width: 100%;
}

.atable {
    display: block;
    overflow-x: auto;
}

.atable small {
    color: var(--sav-color-text-muted);
}

.pager {
    display: flex;
    gap: .8rem;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.replist {
    display: grid;
    gap: .8rem;
}

.rep {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.repi {
    flex: 1;
    min-width: 16rem;
    display: grid;
    gap: .15rem;
    justify-items: start;
}

.repa {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.aview {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.doc {
    max-width: 46rem;
    margin: 0 auto;
    padding: 1rem 1.2rem 3rem;
    line-height: 1.65;
}

.doc h1 {
    font-size: 2rem;
    letter-spacing: -.03em;
    margin: 1rem 0 .4rem;
}

.doc h2 {
    font-size: 1.15rem;
    margin: 1.8rem 0 .4rem;
}

.doc p, .doc ul {
    margin: 0 0 .8rem;
}

.doc .box {
    padding: 1rem 1.2rem;
    border-radius: 14px;
    background: color-mix(in oklab, var(--sav-color-primary) 10%, transparent);
}

/* ------------------------------------------------------------ smaller screens */
@media (max-width: 1640px) {
    .ins .inst { display: none; }

    .ins .insl {
        display: none;
    }

    .ins sav-button {
        --_px: .5rem;
    }
}

@media (max-width: 1120px) {
    .ins {
        display: none;
    }
}

@media (max-width: 1280px) {
    .insl {
        display: none;
    }

    .ins sav-button, .presentb {
        --_px: .6rem;
    }

    .has-panel .epanel {
        width: 290px;
    }
}

@media (max-width: 980px) {
    .emain {
        position: relative;
    }

    .has-panel .epanel {
        position: absolute;
        right: 74px;
        top: 0;
        bottom: 0;
        z-index: 10;
        box-shadow: var(--sav-shadow-lg);
    }

    .ins {
        display: none;
    }

    .hero {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .hbody {
        grid-template-columns: minmax(0, 1fr);
        gap: .8rem;
    }

    .hside {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        align-items: center;
        gap: .3rem;
        scrollbar-width: none;
    }

    .hside .newbtn {
        margin: 0;
        flex: none;
    }

    .hside sav-menu {
        flex: none;
    }

    .hside sav-menu::part(base) {
        display: flex;
        flex-direction: row;
    }

    .hside sav-menu-item {
        white-space: nowrap;
    }

    .navh sav-label, .nofold, .quota {
        display: none;
    }

    .navh {
        padding: 0;
    }

    .hside sav-tree {
        min-width: 12rem;
    }

    /* the places and the folders are in the bar at the bottom (SavOffice.bottomNav): the row keeps "New" */
    .hside > sav-menu, .hside > sav-tree, .hside > .navh {
        display: none;
    }

    .htop {
        flex-wrap: wrap;
    }

    .hsearch {
        order: 3;
        flex: 1 0 100%;
        margin: 0;
    }

    .grid, .grid.tpls {
        grid-template-columns: 1fr 1fr;
        gap: .8rem;
    }

    .rows .card {
        grid-template-columns: 5rem 1fr;
    }

    .inv {
        flex-wrap: wrap;
    }

    .qrow {
        grid-auto-flow: row;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .7rem;
        overflow: visible;
    }

    body.ed #app {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .etop {
        gap: .2rem;
        padding: .3rem .4rem;
    }

    .etitle {
        flex: 1;
        min-width: 0;
    }

    .dtitle {
        width: 100%;
        max-width: none;
    }

    .etop > .spacer {
        display: none;
    }

    .people-now {
        display: none;
    }

    .etop .hist sav-button {
        --_h: 2.2rem;
    }

    .emain {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto auto;
    }

    .ecenter {
        grid-row: 1;
    }

    .eleft {
        grid-row: 2;
        width: auto;
        border: 0;
        border-top: 1px solid var(--sav-color-border);
        padding: .35rem .5rem;
    }

    .eleft > sav-button {
        display: none;
    }

    .strip {
        flex-direction: row;
        scrollbar-gutter: auto;
    }

    .st {
        flex-direction: column;
    }

    .stn {
        display: none;
    }

    .rail {
        grid-row: 3;
        width: auto;
        border: 0;
        border-top: 1px solid var(--sav-color-border);
    }

    .rail::part(base) {
        flex-direction: row;
        padding: .1rem .2rem env(safe-area-inset-bottom);
    }

    .rail sav-bottom-nav-item {
        flex: 1 0 4rem;
    }

    .scroller {
        padding: 10px;
    }

    .has-panel .epanel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: auto;
        height: 56dvh;
        border: 0;
        border-radius: 20px 20px 0 0;
        z-index: 40;
        box-shadow: 0 -10px 50px rgb(0 0 0 / .25);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .hd {
        width: 16px;
        height: 16px;
        margin: -8px;
    }

    .ftb {
        left: 4px !important;
        right: 4px;
        overflow-x: auto;
    }

    .ebottom sav-zoom {
        display: none;
    }

    .pgrid {
        grid-template-columns: repeat(8, 1fr);
    }

    .presentm {
        display: none;
    }
}

@media print {
    body > * {
        display: none;
    }
}

/* ------------------------------------------------------------ simple mode, pages */
.overlay .gcell {
    pointer-events: none;
    border: 1.5px dashed color-mix(in oklab, var(--sav-color-primary) 55%, transparent);
    border-radius: 10px;
}

.gcell.free {
    background: color-mix(in oklab, var(--sav-color-primary) 7%, transparent);
    display: grid;
    place-items: center;
}

.gcell.full {
    border-color: color-mix(in oklab, var(--sav-color-primary) 60%, transparent);
}

.gcell.over {
    background: color-mix(in oklab, var(--sav-color-primary) 22%, transparent);
    border-style: solid;
    border-color: var(--sav-color-primary);
}

.gadd {
    pointer-events: auto;
}

.gcell.full .gadd {
    position: absolute;
    right: 4px;
    bottom: 4px;
    opacity: .9;
    transition: opacity .15s;
}

.scroller:hover .gcell.full .gadd, .gadd[open] {
    opacity: .9;
}

@media (hover: none) {
    .gcell.full .gadd {
        opacity: .7;
    }
}

.overlay .gghost {
    border: 2px solid var(--sav-color-primary);
    border-radius: 10px;
    background: color-mix(in oklab, var(--sav-color-primary) 18%, transparent);
    z-index: 3;
}

.grids {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
    padding: .8rem 0;
}

.gprev {
    position: relative;
    aspect-ratio: 16 / 10;
    margin: 6px;
}

.gprev i {
    position: absolute;
    padding: 1.5px;
}

.gprev i::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: color-mix(in oklab, var(--sav-color-primary) 34%, var(--sav-color-surface));
}

.tile.on .gprev i::before {
    background: var(--sav-color-primary);
}

.gmini {
    width: 4.4rem;
}

.gmini .gprev {
    margin: 0;
}

.prules {
    max-height: 22rem;
}

.rolesel.wide {
    width: 14rem;
    flex: 0 1 14rem;
}

.lockedpage .holder {
    outline: 2px dashed var(--sav-color-border-strong);
    outline-offset: 6px;
}

/* ------------------------------------------------------------ toolbar, speaker notes, speaker view */
.ecenter > .enotes { grid-row: 3; }
.enotes { padding: .45rem .7rem; background: var(--sav-color-surface); border-top: 1px solid var(--sav-color-border); }
.ebottom .has::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); margin-left: -.2rem; }
.inst { align-self: center; padding: 0 .3rem 0 .1rem; font-size: .76rem; color: var(--sav-color-text-muted); }
.toollist { --gap: .3rem; }
.toolrow { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border: 1px solid var(--sav-color-border); border-radius: 10px; background: var(--sav-color-surface); }
.toolrow .grip { cursor: grab; color: var(--sav-color-text-muted); }
.wideicons { grid-template-columns: repeat(auto-fill, minmax(3.2rem, 1fr)); max-height: 50vh; overflow: auto; padding: 2px; }
.show.tooling .show-bar { opacity: 1; }
.show-n { white-space: nowrap; flex: none; }
.show-bar > i { width: 1px; height: 1.4rem; margin: 0 .35rem; background: rgb(255 255 255 / .22); }
.show-bar sav-button[aria-pressed="true"] { --sav-color-primary: #ffd23f; --sav-color-on-primary: #1b1530; }
.pens { display: flex; align-items: center; gap: .15rem; padding: 0 .4rem; }
.penc.on::part(base) { box-shadow: 0 0 0 2px #1b142d, 0 0 0 4px #fff; border-radius: 50%; }
.show-chip, .show-tip { position: absolute; z-index: 4; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 999px; background: rgb(27 20 45 / .92); color: #fff; font-size: .85rem; max-width: calc(100vw - 2rem); }
.show-chip { pointer-events: none; } .show-chip sav-icon { color: #ffd23f; } .show-chip span { opacity: .75; }
.show-tip { border-radius: 14px; top: calc(60px + env(safe-area-inset-top)); cursor: auto; --sav-color-text: #fff; --sav-color-neutral: #fff; --sav-color-primary: #a98bff; --sav-color-on-primary: #190a3d; }
.show.black .show-v, .show.black .ink, .show.black .laser { visibility: hidden; }
body.spk { overflow: hidden; } body.spk #app { height: 100dvh; }
.spk-main { display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 3fr) minmax(0, 2fr); gap: 1rem 1.6rem; height: 100%; padding: 1rem 1.4rem 1.2rem; }
.spk-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; } .spk-time { display: flex; align-items: center; gap: .2rem; } .spk-t { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-right: .4rem; }
.spk-l, .spk-r { display: flex; flex-direction: column; gap: .6rem; min-height: 0; min-width: 0; }
.spk-now { flex: 1; min-height: 0; display: grid; place-items: center; } .spk-now.off .thumb { opacity: .25; } .spk-now.pointing { cursor: crosshair; } .spk .thumb { border-radius: 10px; box-shadow: 0 0 0 1px var(--sav-color-border); }
.spk-next { height: 30%; flex: none; display: grid; place-items: center start; } .spk-c { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; } .spk-n { padding: 0 .4rem; font-variant-numeric: tabular-nums; } .spk-page { width: 11rem; }
.spk-notes { flex: 1; min-height: 0; overflow: auto; white-space: pre-wrap; line-height: 1.5; padding: 1rem 1.1rem; border-radius: 14px; background: var(--sav-color-surface); border: 1px solid var(--sav-color-border); }
@media (max-width: 760px) { .spk-main { grid-template: auto minmax(0, 2fr) minmax(0, 3fr) / minmax(0, 1fr); } .spk-next { display: none; } }

/* ------------------------------------------------------------ colour popover, share, settings, local list */
.cpop { gap: .85rem; } .cpart { display: grid; gap: .4rem; } .sws { grid-template-columns: repeat(8, 1fr); }
.swnone::part(base)::before { background: linear-gradient(to top right, var(--sav-color-surface) 46%, #e03131 46% 54%, var(--sav-color-surface) 54%); border-color: var(--sav-color-border-strong); }
.gbar { height: 1.6rem; border-radius: 8px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
.grow2 { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: .6rem; align-items: center; } .gpick { display: grid; justify-items: center; gap: .1rem; } .gpick small { font-size: .7rem; color: var(--sav-color-text-muted); }
.share { gap: 1rem; } .share sav-divider { margin: .1rem 0; } .share .people { max-height: 15rem; } .acc2 { flex-wrap: nowrap; } .accic { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: color-mix(in oklab, var(--sav-color-primary) 14%, transparent); color: var(--sav-color-primary); font-size: 1.2rem; }
.vsw { display: grid; gap: .55rem; } .share section > .row .grow h3 { margin-bottom: .2rem; }
.stabs { margin-top: 1rem; --sav-tab-vertical-rail: transparent; } .stabs[placement="start"] { min-height: 60vh; }
.ssec { display: grid; gap: .5rem; max-width: 46rem; } .ssec h2 { font-size: 1.25rem; letter-spacing: -.015em; } .ssec > .muted { margin-bottom: .4rem; }
.scard { --sav-card-padding: 0; margin: 0; } .srows { display: grid; }
.srow { display: flex; align-items: center; gap: 1rem 1.6rem; padding: .95rem 1.2rem; border-bottom: 1px solid var(--sav-color-border); } .srow:last-child { border-bottom: 0; }
.srow-t { flex: 1; min-width: 0; display: grid; gap: .15rem; } .srow-t small { color: var(--sav-color-text-muted); font-size: .84rem; } .srow-c { flex: none; max-width: 55%; display: flex; justify-content: flex-end; } .srow-c > sav-select, .srow-c > sav-input { width: 15rem; max-width: 100%; }
.srow.wide { flex-direction: column; align-items: stretch; }
@media (max-width: 700px) { .srow { flex-wrap: wrap; } .srow-c { max-width: 100%; width: 100%; justify-content: flex-start; } .srow-c > sav-select, .srow-c > sav-input { width: 100%; } }
.localmain { max-width: 1240px; margin: 0 auto; padding: .6rem clamp(.8rem, 2vw, 1.6rem) 2rem; display: grid; gap: 1.2rem; } .localmain h2 { font-size: 1rem; margin: 0 0 .7rem; }
.ebottom .modesw { margin-right: .4rem; }

/* ------------------------------------------------------------ fixes: cards, simple mode, pages column, mode dialog, own grids */
.card .cthumb { border-radius: calc(var(--sav-radius-lg) - 1px) calc(var(--sav-radius-lg) - 1px) 0 0; }
.rows .card .cthumb { border-radius: calc(var(--sav-radius-lg) - 1px) 0 0 calc(var(--sav-radius-lg) - 1px); }
/* the cells and their + must be seen on any background: a light and a dark line together, the + solid with a white ring */
.overlay .gcell { box-shadow: 0 0 0 1px rgb(255 255 255 / .6), inset 0 0 0 1px rgb(255 255 255 / .6); }
.gadd > sav-button::part(base) { box-shadow: 0 0 0 2px #fff, 0 2px 10px rgb(0 0 0 / .35); }
.gcell.free .gadd { opacity: 1; }
#app.nostrip .eleft { display: none; }
/* without the strip its column goes too, or the stage, the panel and the rail would each slide one column to the left */
@media (min-width: 901px) { #app.nostrip .emain { grid-template-columns: minmax(0, 1fr) auto auto; } }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; } .modecard { --sav-card-padding: 1rem 1.1rem; } .modec { display: grid; gap: .35rem; justify-items: start; } .modec > sav-icon { font-size: 1.6rem; color: var(--sav-color-primary); } .modec b { font-size: 1.05rem; } .modec ul { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .88rem; display: grid; gap: .2rem; }
@media (max-width: 640px) { .modes { grid-template-columns: 1fr; } }
.gboard { position: relative; display: grid; grid-template-columns: repeat(var(--c), 1fr); grid-template-rows: repeat(var(--r), 1fr); aspect-ratio: 16 / 10; gap: 0; touch-action: none; user-select: none; cursor: crosshair; border-radius: 8px; overflow: hidden; background: var(--sav-color-surface-2); }
.gsq { border: 1px dashed color-mix(in oklab, var(--sav-color-primary) 30%, transparent); } .gsq.on { background: color-mix(in oklab, var(--sav-color-primary) 30%, transparent); }
.gbox { position: absolute; display: grid; place-items: center; padding: 3px; font-size: .75rem; font-weight: 700; color: var(--sav-color-primary); pointer-events: none; }
.gbox::before { content: ""; position: absolute; inset: 3px; border-radius: 5px; border: 2px solid var(--sav-color-primary); background: color-mix(in oklab, var(--sav-color-primary) 12%, transparent); }
.langs { width: max-content; max-width: 100%; }

/* typefaces (the same dialog of SavDocuments) */
.fontdlg .fkind { font-family: var(--sav-font); font-size: .74rem; font-weight: 400; font-style: normal; letter-spacing: 0; text-transform: none; color: var(--sav-color-text-muted); }
.fontdlg sav-tab > .stack { padding-top: .6rem; }
.fontdlg .flist { max-height: 46vh; }
.fontdlg h4 { font-size: .85rem; color: var(--sav-color-text-muted); margin-top: .4rem; }

/* versions: a side panel, as in SavDocuments */
.versions { gap: .5rem; } .tile.version { --sav-card-padding: .6rem .8rem; } .tile.version::part(body) { display: grid; gap: .1rem; } .versions .small { font-size: .84rem; }

/* links of the elements */
.linkrow { display: flex; align-items: center; gap: .4rem; padding: .35rem .3rem .35rem .6rem; border: 1px solid var(--sav-color-border); border-radius: var(--sav-radius); font-size: .86rem; } .linkrow > sav-icon { color: var(--sav-color-primary); flex: none; } .linkrow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkurl { display: block; padding: .5rem .7rem; border-radius: var(--sav-radius); background: var(--sav-color-surface-2); font-size: .84rem; overflow-wrap: anywhere; }
.linktabs sav-tab > .stack { padding-top: .9rem; }

/* videos: the player of SavComponents fills the frame of the element; the frame (.im) keeps the corners or the shape */
.spvideo { position: absolute; inset: 0; height: 100%; --sav-shadow-sm: none; }
.spvideo::part(base) { height: 100%; gap: 0; }
.spvideo::part(frame) { height: 100%; aspect-ratio: auto; border-radius: var(--vr, 0); box-shadow: none; }
.spvideo::part(video) { object-position: var(--vpos, 50% 50%); transform: scaleX(var(--vflip, 1)) scale(var(--vz, 1)); transform-origin: var(--vpos, 50% 50%); }
.im.playing { isolation: isolate; }
.vbox { position: relative; } .vbox > .spvideo { --vr: 10px; background: none; }

/* first page on phones: the top bar fits (the language as an icon), the features close together, nothing moves on touch */
@media (max-width: 600px) {
  .ltop { gap: .3rem; padding-left: 1rem; padding-right: 1rem; }
  .langb .lbl { display: none; }
  .hero { gap: 1.4rem; padding-top: 1.2rem; padding-bottom: 2rem; }
  .hero-t > p { margin: .9rem 0 1.2rem; font-size: 1.02rem; }
  .hero-t .prow sav-button, .hero-t .row sav-button { flex: 1 1 auto; }
  .feats { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; padding: 1.4rem 0 2rem; }
  .feat { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); column-gap: .7rem; align-items: start; }
  .feat sav-icon { grid-row: span 2; font-size: 1.35rem; margin-top: .1rem; }
  .feat h3 { margin: 0 0 .1rem; font-size: 1rem; }
  .feat p { font-size: .92rem; }
  .landing > .credit, .authp > .credit { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 360px) { .ltop .brand span, .ltop .brand b { display: none; } }

.ssub { margin: 0 0 .2rem; }

/* the version in the footer and the page of the changes (the same in every Sav app) */
.credit .vlink { font-variant-numeric: tabular-nums; text-decoration: none; padding: .05rem .5rem; border-radius: 99px; border: 1px solid var(--sav-color-border); }
.credit .vlink:hover { border-color: currentColor; }
.chlog .vlist { display: grid; gap: 1rem; margin-top: 1.2rem; max-width: 46rem; }
.vcard { background: var(--sav-color-surface); border: 1px solid var(--sav-color-border); border-radius: 16px; padding: 1rem 1.2rem 1.1rem; }
.vhead { display: flex; align-items: center; gap: .6rem; } .vhead .grow { flex: 1; } .vhead time { color: var(--sav-color-text-muted); font-size: .85rem; }
.vnow { color: var(--sav-color-primary); font-weight: 600; }
.vcard ul { margin: .75rem 0 0; padding-left: 1.2rem; display: grid; gap: .4rem; } .vcard li { line-height: 1.45; }

/* offline: what is not kept on this device is shown faded */
.card.away .cthumb { opacity: .45; } .offbar { margin-bottom: 1rem; }

/* the menu of the person: the apps of SavOffice, then the avatar */
.umenu { display: inline-flex; align-items: center; gap: .35rem; flex: none; }
/* a separator chosen in the title bar or in the status bar (⋮ → Customise the bars) */
.etop > i.sep, .ebottom > i.sep { width: 1px; align-self: stretch; margin: .45rem .25rem; background: var(--sav-color-border); flex: none; }
/* a fixed space chosen in a bar; an adaptive one is a .spacer */
.etop > i.bgap, .ebottom > i.bgap, .ins > i.bgap { width: .9rem; flex: none; } .ins > .spacer { flex: 1; } .ins > i.sep { width: 1px; align-self: stretch; margin: .45rem .25rem; background: var(--sav-color-border); flex: none; }

/* phones: the title bar as in SavDocuments — the logo, the title, Share, ⋮, the apps and the account; undo, redo, Present and the
   copy in SavDrive are in ⋮ (they do not fit) */
@media (max-width: 640px) {
    .etop > sav-tooltip, .etop > i.sep, .etop > i.bgap, .etop > .spacer, .etop > .pgroup, .etop > .ins, .etop .people-now, .etop savoffice-apps > .so-save {
        display: none;
    }

    .etop .etitle {
        flex: 1 1 auto;
        min-width: 0;
    }
}
