/* The tabs of a server as a cover flow (views/server-capsule.js), in the layout of the prism (cube.css: the head in the middle, the glass bar and the buttons at
   the bottom): the open tab is as big as a side of the prism; the tab before and the tab after lie at an angle at its sides, with a still picture of their
   tab (as the sides of the prism have) and their name over it. The look is the portal's own glass (the same card, radius and shadow as the sides of the
   prism), light and dark. */
.page-fade .page.server-veil.cap-page > * { animation: none; }
.cap-stage { --peek: clamp(40px, 8vw, 220px); --seen: calc(var(--peek) + 40px); container-type: inline-size; position: relative; flex: 1 1 0; width: clamp(280px, calc(100% - 2 * var(--peek)), 2200px); min-height: 320px; margin: 10px auto 0; perspective: 1800px; }
.cube-page .server-area > .cap-stage { flex: 1 1 0; }
.cap { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius-card); background: var(--card-glass); transform-origin: 50% 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 30px 60px -20px rgba(0, 0, 0, 0.5);
  transition: transform var(--move, 0.45s) cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease; }
/* The open tab is nearly solid: the sides lie partly behind it, and they showed through the glass (the console was seen in the settings). No backdrop blur here: a big
   one made the blur of the sidebar flicker. */
.cap[data-o="0"] { transform: none; z-index: 5; background: color-mix(in srgb, var(--surface) 94%, transparent); }
/* Two tabs show on each side, as in the cover flow of iTunes: the first lies at an angle (60 deg) and the second is steeper (72 deg), tucked behind it. The sides
   are set back (translateZ) so that the open tab is the biggest: with the perspective, the near (outer) end of the first side is 0.86 as tall as the open tab and
   that of the second 0.92 (the second is a little bigger than the first, as in iTunes); the rest of a side lies under the open tab. Their bottoms are a little above
   the open tab's (5.5% and 3% of its height: translateY), not on one line with it. --seen is the width of the margin of the page beside the open tab: the first
   side's end shows in its first half, the second's in the other half. (The numbers come from projecting the corners of the sides: cqw is the width of the stage.) */
.cap[data-o="-1"] { transform: translateX(calc(-33.14cqw - var(--seen) * 0.5814)) translateY(1.74%) translateZ(calc(-43.3cqw - 293px)) rotateY(60deg); z-index: 4; --dim: 0.18; }
.cap[data-o="1"] { transform: translateX(calc(33.14cqw + var(--seen) * 0.5814)) translateY(1.74%) translateZ(calc(-43.3cqw - 293px)) rotateY(-60deg); z-index: 4; --dim: 0.18; }
.cap[data-o="-2"] { transform: translateX(calc(-38.9cqw - var(--seen) * 1.087)) translateY(1.1%) translateZ(calc(-47.55cqw - 157px)) rotateY(72deg); z-index: 3; --dim: 0.3; }
.cap[data-o="2"] { transform: translateX(calc(38.9cqw + var(--seen) * 1.087)) translateY(1.1%) translateZ(calc(-47.55cqw - 157px)) rotateY(-72deg); z-index: 3; --dim: 0.3; }
.cap[data-o="-3"] { transform: translateX(calc(-70cqw - var(--seen) * 1.6)) translateY(2%) translateZ(calc(-50cqw - 800px)) rotateY(80deg); opacity: 0; pointer-events: none; z-index: 1; --dim: 0.3; }
.cap[data-o="3"] { transform: translateX(calc(70cqw + var(--seen) * 1.6)) translateY(2%) translateZ(calc(-50cqw - 800px)) rotateY(-80deg); opacity: 0; pointer-events: none; z-index: 1; --dim: 0.3; }
/* a side is dimmed a little (a layer over it: a filter on the picture would break the rounded clip) */
.cap::after { content: ""; position: absolute; inset: 0; z-index: 4; background: #000; opacity: var(--dim, 0); pointer-events: none; transition: opacity 0.4s ease; }
.cap-host { position: absolute; z-index: 1; inset: 0; overflow: auto; padding: 14px 16px; container-type: inline-size; }
.cap:not([data-o="0"]) .cap-host { overflow: hidden; pointer-events: none; }
.cap-host .cube-skel { height: 100%; }
/* pressing a side brings it to the middle. Only a strip of a side shows (its outer end, beyond the open tab), so the name of the first is a small badge, icon
   over name, in that strip; the second has none. */
.cap-tab { touch-action: none; position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 0; border: 0; background: transparent; font: inherit; cursor: pointer; }
.cap[data-o="-1"] .cap-tab { place-items: center start; padding-left: calc(var(--seen) * 0.1); }
.cap[data-o="1"] .cap-tab { place-items: center end; padding-right: calc(var(--seen) * 0.1); }
.cap[data-o="0"] .cap-tab, .cap[data-o="-3"] .cap-tab, .cap[data-o="3"] .cap-tab { display: none; }
.cap[data-o="-2"] .cap-badge, .cap[data-o="2"] .cap-badge { display: none; }
.cap-badge { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 12px; border-radius: 22px; background: var(--glass-strong); border: 1px solid var(--separator); color: var(--text); transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1); }
.cap-badge svg { width: 22px; height: 22px; fill: currentColor; color: var(--accent); }
.cap-badge b { font-size: 14px; font-weight: 700; white-space: nowrap; }
.cap-tab:hover .cap-badge, .cap-tab:focus-visible .cap-badge { transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) { .cap, .cap::after, .cap-badge { transition: none; } }
.cap-host > .server-tab-body { display: block; height: 100%; min-height: 0; }
.cap-host .server-tab-body table { width: 100%; }
.cap-host .mc-settings-form { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cap-host .mc-settings-form > :not(section) { grid-column: 1 / -1; }
@container (max-width: 760px) { .cap-host .mc-settings-form { grid-template-columns: minmax(0, 1fr); } }
.cap-host .mc-console { height: 100%; min-height: 0; }
.cap-host .mc-log { height: 0; flex: 1 1 0; min-height: 120px; overflow: auto; overflow-wrap: anywhere; }
/* The file explorer ends with its capsule: the panes take its height, and each list scrolls in its pane. */
.cap-host > .server-tab-body:has(> .mc-tabs-wrap) { display: flex; flex-direction: column; }
.cap-host .mc-tabs-wrap { flex: 1; min-height: 0; }
.cap-host .mc-dual-area { height: 100%; min-height: 0; }
.cap-host .mc-dual-area.mc-dual { grid-auto-rows: minmax(0, 1fr); align-items: stretch; }
.cap-host .mc-dual-area > .mc-pane { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.cap-host .mc-dual-area:not(.mc-dual) > .mc-pane { overflow: hidden; }
.cap-host .mc-pane-body, .cap-host .mc-files-browser { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.cap-host .mc-files-list { flex: 1; min-height: 0; overflow: auto; }
.cap-host .mc-files-fill { min-height: 24px; }
.cap-host .mc-newtab { min-height: 0; align-self: stretch; }
@media (prefers-reduced-motion: reduce) { .cap, .cap-host, .cap-tab { transition: none; } }
.cap-stage.dragging .cap { transition: none; }
.cap-stage.dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
