/* SIDE BY SIDE (nav/split.js): two apps at once, each in a frame of the site, and the bar between them that's dragged.
   The button in every app's top bar shows only when the screen can hold two (html.sv-can) */
.sv-btn { display: none; }
html.sv-can .sv-btn:not(.stage-off) { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--bg-raised); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sv-btn svg { width: 18px; height: 18px; }
html.sv-can .sv-hbtn:not(.stage-off) { width: 36px; height: 36px; } /* (the header's, beside Search: its size) */
@media (hover: hover) { html.sv-can .sv-btn:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--rule)); } }
html.in-pane .sv-btn { display: none !important; }

/* (the two sides and the bar: the left side's share is --sv-f) */
.sv { --sv-f: 0.5; position: fixed; inset: 0; z-index: 2147483300; display: grid; grid-template-columns: minmax(0, calc((100% - 12px) * var(--sv-f))) 12px minmax(0, 1fr); background: var(--bg); }
.sv[hidden] { display: none; }
/* (which is on the left: their order; Swap sides turns it, the frames staying where they are, as a frame moved is loaded again) */
.sv-side[data-sv-side="0"] { order: 1; } .sv-bar { order: 2; } .sv-side[data-sv-side="1"] { order: 3; }
.sv.is-flip .sv-side[data-sv-side="0"] { order: 3; } .sv.is-flip .sv-side[data-sv-side="1"] { order: 1; }
.sv-side { position: relative; min-width: 0; height: 100%; overflow: hidden; background: var(--bg); }
.sv-side:not(.is-in)::after { content: ''; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2.5px solid color-mix(in srgb, var(--gold) 30%, transparent); border-top-color: var(--gold); border-radius: 50%; animation: sv-spin 0.8s linear infinite; }
@keyframes sv-spin { to { transform: rotate(360deg); } }
.sv-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
/* (being dragged: the frames hold still under the finger, and the side about to close says so) */
.sv.is-drag .sv-frame { pointer-events: none; }
.sv.is-drag { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.sv-side::before { content: ''; position: absolute; inset: 0; z-index: 2; background: color-mix(in srgb, var(--ink) 55%, transparent); opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
.sv.is-closing-0 .sv-side[data-sv-side="0"]::before, .sv.is-closing-1 .sv-side[data-sv-side="1"]::before { opacity: 1; }

.sv-bar { position: relative; z-index: 3; display: grid; place-items: center; height: 100%; background: var(--bg); cursor: col-resize; touch-action: none; -webkit-tap-highlight-color: transparent; outline: none; }
.sv-bar::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-50%); background: var(--rule); }
.sv-grip { position: relative; width: 6px; height: 52px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 38%, var(--bg)); box-shadow: 0 0 0 4px var(--bg); transition: background 0.15s ease, height 0.15s ease; }
.sv-bar:hover .sv-grip, .sv-bar:focus-visible .sv-grip, .sv.is-drag .sv-grip { background: var(--gold); height: 64px; }
/* (Swap sides, on the bar itself, above its grip: always there to see) */
.sv-swap { position: absolute; left: 50%; top: calc(50% - 74px); display: grid; place-items: center; width: 34px; height: 34px; padding: 0; transform: translateX(-50%); border: 1px solid var(--rule); border-radius: 50%; background: var(--bg-raised); color: var(--ink); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.35); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sv-swap svg { width: 17px; height: 17px; }
@media (hover: hover) { .sv-swap:hover { border-color: var(--gold); color: var(--gold); } }
.sv.is-drag .sv-swap, .sv.is-drag .sv-end { opacity: 0; }
/* (Close side by side, on the bar below its grip, as Swap is above it) */
.sv-end { position: absolute; left: 50%; top: calc(50% + 40px); display: grid; place-items: center; width: 34px; height: 34px; padding: 0; transform: translateX(-50%); border: 1px solid var(--rule); border-radius: 50%; background: var(--bg-raised); color: var(--ink); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.35); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sv-end svg { width: 15px; height: 15px; }
@media (hover: hover) { .sv-end:hover { border-color: var(--gold); color: var(--gold); } }
/* (which side to close: the bar's × asks on the sides themselves, each a little dimmed, a card in its middle) */
.sv-end.is-on { border-color: var(--gold); background: var(--gold); color: var(--on-gold, #fff); }
.sv-veil { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 52%, transparent); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: sv-veil 0.18s ease both; cursor: default; }
@keyframes sv-veil { from { opacity: 0; } to { opacity: 1; } }
.sv-veil-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 280px; padding: 22px 26px 18px; border: 1px solid var(--rule); border-radius: 22px; background: var(--bg-raised); color: var(--ink); text-align: center; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5); cursor: pointer; animation: sv-card 0.22s cubic-bezier(0.22, 1, 0.36, 1) both; -webkit-tap-highlight-color: transparent; }
@keyframes sv-card { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
.sv-veil-btn b { font: 700 17px/1.3 var(--sans); }
.sv-veil-btn small { font: 500 13px/1.4 var(--sans); color: var(--muted); }
.sv-veil-x { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border: 1.5px solid var(--gold); border-radius: 50%; color: var(--gold); }
.sv-veil-x svg { width: 18px; height: 18px; }
@media (hover: hover) { .sv-veil-btn:hover { border-color: var(--gold); transform: translateY(-1px); } .sv-veil:hover { background: color-mix(in srgb, var(--bg) 40%, transparent); } }
@media (prefers-reduced-motion: reduce) { .sv-veil, .sv-veil-btn { animation: none; } }
/* (a side come back to Home: its own Close, at its foot, so the other has the screen) */
.sv-sidex { position: absolute; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); /* (above a side's own tab bar, a narrow side's: the phone's) */ z-index: 2; display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px 10px 13px; transform: translateX(-50%); border: 1px solid var(--rule); border-radius: 999px; background: var(--bg-raised); color: var(--ink); font: 700 14px var(--sans); white-space: nowrap; box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.5); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sv-sidex[hidden] { display: none; }
.sv-sidex svg { width: 14px; height: 14px; }
@media (hover: hover) { .sv-sidex:hover { border-color: var(--gold); } }
/* (in a side, every window is its whole side: the Size button is for the page, index.html's applyAppSize) */
html.in-pane .app-size-btn { display: none !important; }

/* (the bar's menu) */
.sv-menu { position: fixed; z-index: 4; display: flex; flex-direction: column; min-width: 210px; padding: 6px; border: 1px solid var(--rule); border-radius: 14px; background: var(--bg-raised); box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.45); }
.sv-menu[hidden] { display: none; }
.sv-mrow { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 12px; border: none; border-radius: 10px; background: none; color: var(--ink); font: 600 14.5px var(--sans); text-align: left; cursor: pointer; }
.sv-mrow small { font: 500 12px var(--sans); color: var(--muted); }
.sv-mrow:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }

/* (a side with nothing in it yet: which app to open there) */
.sv-pick { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sv-pick-in { max-width: 560px; margin: 0 auto; padding: calc(22px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom)); }
.sv-pick-h { margin: 4px 0 16px; font: italic 600 24px/1.25 var(--serif); }
.sv-door { margin: 0 0 14px; }
.sv-home { width: 100%; margin-top: 4px; }
/* What goes with an app, beside it (Split.btn): its chip, with the two panes, only where side by side can be, or is (in a
   side, it opens in the other one) */
.ui-chip.sv-beside { display: none; } /* (as strong as ui.css's .ui-chip, loaded after) */
html.sv-can .sv-beside:not(.stage-off), html.in-pane .sv-beside:not(.stage-off) { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.sv-beside svg { width: 16px; height: 16px; flex: none; }
/* (not in the window over the apps (nav/sheet.js): what's under it isn't what the passage would be beside) */
.nv .sv-beside { display: none !important; }
