/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */

/**
 *  Default styles for xterm.js
 */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility:not(.debug),
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
    pointer-events: none;
}

.xterm .xterm-accessibility-tree:not(.debug) *::selection {
  color: transparent;
}

.xterm .xterm-accessibility-tree {
  font-family: monospace;
  user-select: text;
  white-space: pre;
}

.xterm .xterm-accessibility-tree > div {
  transform-origin: left;
  width: fit-content;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    /* Dim should not apply to background, so the opacity of the foreground color is applied
     * explicitly in the generated class and reset to 1 here */
    opacity: 1 !important;
}

.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }

.xterm-overline {
    text-decoration: overline;
}

.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }

.xterm-strikethrough {
    text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
	z-index: 6;
	position: absolute;
}

.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
	z-index: 7;
}

.xterm-decoration-overview-ruler {
    z-index: 8;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}



/* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */

/* xterm.js customization: Override xterm's cursor style */
.xterm .xterm-scrollable-element > .scrollbar {
    cursor: default;
}

/* Arrows */
.xterm .xterm-scrollable-element > .scrollbar > .scra {
	cursor: pointer;
	font-size: 11px !important;
}

.xterm .xterm-scrollable-element > .visible {
	opacity: 1;

	/* Background rule added for IE9 - to allow clicks on dom node */
	background:rgba(0,0,0,0);

	transition: opacity 100ms linear;
	/* In front of peek view */
	z-index: 11;
}
.xterm .xterm-scrollable-element > .invisible {
	opacity: 0;
	pointer-events: none;
}
.xterm .xterm-scrollable-element > .invisible.fade {
	transition: opacity 800ms linear;
}

/* Scrollable Content Inset Shadow */
.xterm .xterm-scrollable-element > .shadow {
	position: absolute;
	display: none;
}
.xterm .xterm-scrollable-element > .shadow.top {
	display: block;
	top: 0;
	left: 3px;
	height: 3px;
	width: 100%;
	box-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;
}
.xterm .xterm-scrollable-element > .shadow.left {
	display: block;
	top: 3px;
	left: 0;
	height: 100%;
	width: 3px;
	box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
}
.xterm .xterm-scrollable-element > .shadow.top-left-corner {
	display: block;
	top: 0;
	left: 0;
	height: 3px;
	width: 3px;
}
.xterm .xterm-scrollable-element > .shadow.top.left {
	box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
}

/* EnclaveSSH Cloud: the Mac app's look in the browser (docs/DESIGN.md).
   Tokens follow EnclaveBrand (Sources/EnclaveTerminalUI/Support/Brand.swift):
   Night Glass by default, Daylight when the scheme is light. Glass is for
   controls (tab strip, search bar, vault card, lock card); cards, lists and
   the terminal are solid content. */
:root {
  --accent: #5c6eff;
  --on-accent: #fff;
  --accent-text: #8b97ff;
  --backdrop-top: #1f2450;
  --backdrop-bottom: #090c1c;
  --glow: rgba(78, 90, 210, 0.55);
  --ink: #fff;
  --text: #eef0ff;
  --muted: #a6aed0;
  --faint: #8a92b8;
  --fill-1: rgba(255, 255, 255, 0.06);
  --fill-2: rgba(255, 255, 255, 0.1);
  --fill-3: rgba(255, 255, 255, 0.16);
  --hairline: rgba(255, 255, 255, 0.08);
  --edge: rgba(255, 255, 255, 0.14);
  --card: rgba(255, 255, 255, 0.055);
  --card-raised: rgba(255, 255, 255, 0.09);
  --sidebar: rgba(0, 0, 0, 0.16);
  --well: rgba(0, 0, 0, 0.22);
  --glass: rgba(31, 36, 80, 0.62);
  --surface: #161a3a;
  --shadow: rgba(0, 0, 0, 0.35);
  --live: #87f0ab;
  --warn: #ffc46b;
  --danger: #ff8078;
  --terminal-bg: #0f1226;
  --mono: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", monospace;
  --rounded: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, sans-serif;
  --radius: 16px;
  color-scheme: dark;
}
:root[data-scheme="light"] {
  --accent-text: #3f4bd8;
  --backdrop-top: #f4f5fc;
  --backdrop-bottom: #e1e4f4;
  --glow: rgba(92, 110, 255, 0.16);
  --ink: #1c2152;
  --text: #1c2152;
  --muted: #565c8a;
  --faint: #6b7192;
  --fill-1: rgba(28, 33, 82, 0.045);
  --fill-2: rgba(28, 33, 82, 0.07);
  --fill-3: rgba(28, 33, 82, 0.11);
  --hairline: rgba(28, 33, 82, 0.09);
  --edge: rgba(28, 33, 82, 0.14);
  --card: rgba(255, 255, 255, 0.82);
  --card-raised: #fff;
  --sidebar: rgba(255, 255, 255, 0.45);
  --well: rgba(28, 33, 82, 0.06);
  --glass: rgba(255, 255, 255, 0.7);
  --surface: #fff;
  --shadow: rgba(28, 33, 82, 0.12);
  --live: #178548;
  --warn: #9a5b00;
  --danger: #c72630;
  --terminal-bg: #f5f6fc;
  color-scheme: light;
}

/* Geist and Geist Mono, the website's faces (OFL, website/fonts), served
   from this origin. Only the website frame (sign-in, lock) uses them; the
   window keeps the Mac app's system font. */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/geist.3df46843dff36354.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/geist-mono.6315406149c88377.woff2") format("woff2"); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1100px 560px at 22% -12%, var(--glow) 0%, transparent 62%), linear-gradient(var(--backdrop-top), var(--backdrop-bottom)) fixed;
  background-color: var(--backdrop-bottom);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1 { font: 700 28px/1.2 var(--rounded); letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 18px; margin: 0; font-weight: 650; }
h3 { font-size: 15px; margin: 0; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono, code, kbd { font-family: var(--mono); }
.error { color: var(--danger); }
.error:empty { display: none; }
.dev { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.icon { flex: none; }
[hidden] { display: none !important; }

/* Controls */
button { font: inherit; font-weight: 600; border-radius: 999px; min-height: 40px; padding: 8px 16px; cursor: pointer; border: 1px solid transparent; color: inherit; background: none; }
button[disabled] { opacity: 0.55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--on-accent); }
.primary:hover:not([disabled]) { filter: brightness(1.08); }
.secondary { background: var(--fill-2); color: var(--accent-text); border-color: var(--edge); }
.plain { color: var(--accent-text); padding-inline: 10px; }
.plain.small, button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.danger { color: var(--danger); margin-right: auto; padding-inline: 10px; }
.danger-text { color: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--fill-2); border: 1px solid var(--hairline); color: var(--text); white-space: nowrap; }
.chip:hover:not([disabled]) { background: var(--fill-3); }
.chip.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.accent:hover:not([disabled]) { background: var(--accent); filter: brightness(1.08); }
.chip.danger-chip { color: var(--danger); }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 9px; color: var(--muted); }
.icon-button:hover { background: var(--fill-2); color: var(--text); }
.icon-button.done { color: var(--live); }
.pill { font-size: 12px; font-weight: 650; border-radius: 999px; padding: 3px 10px; background: var(--fill-2); white-space: nowrap; }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
label { font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--well); border: 1px solid var(--edge);
  border-radius: 12px; padding: 10px 12px; width: 100%; min-height: 42px;
}
:root[data-scheme="light"] :is(input, select, textarea) { background-color: #fff; }
/* Dropdowns: one look in every browser. The native arrow goes, a chevron
   drawn in the text colour takes its place, and the open list follows the
   scheme (Windows and Linux draw it with these colours). */
select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
select:hover:not([disabled]) { border-color: color-mix(in srgb, var(--accent) 45%, var(--edge)); }
select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
select[disabled] { opacity: 0.55; cursor: default; }
select option { background: var(--surface); color: var(--text); }
textarea { resize: vertical; }
/* iOS Safari zooms the page into any field under 16px when it gets focus,
   and doesn't zoom back. Touch screens get 16px fields (the terminal's
   hidden input too); the code field is bigger already. */
@media (pointer: coarse) { html:root :is(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea) { font-size: 16px; } }
textarea.mono { font: 14px/1.45 var(--mono); }
kbd { font-size: 11px; color: var(--muted); background: var(--fill-2); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.banner { background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 14px; padding: 10px 14px; font-size: 14px; }
.banner.error { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 999px; padding: 2px 8px; }
.code { margin: 0; font: 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); background: var(--well); border-radius: 10px; padding: 9px 11px; }

/* The window (shell.ts) */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.app-bar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 14px 6px 10px; border-bottom: 1px solid var(--hairline); }
.app-brand { display: flex; align-items: center; gap: 9px; width: 238px; flex: none; font-weight: 650; }
.mark, .vault-mark { display: inline-grid; place-items: center; font: 700 12px/1 var(--mono); color: #fff; background: linear-gradient(#6d7cff, #3c46c9); border-radius: 8px; width: 28px; height: 26px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
/* The brand (title bar, sign-in, lock screen) is the app icon, as on
   enclavessh.app. The ">_" text underneath is aria-hidden. */
.mark, .lock-card .vault-mark.large { color: transparent; font-size: 0; background: url("/assets/icon-192.1b190610ff513c55.png") center / cover no-repeat; border-radius: 22.5%;
  width: 28px; height: 28px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 12px -4px rgba(0, 0, 0, 0.5); }
.app-tabs { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ws-tabs { display: contents; }
.ws-tab { display: inline-flex; align-items: center; flex: 0 0 auto; max-width: 260px; min-height: 32px; border-radius: 999px; background: var(--fill-1); border: 1px solid var(--hairline); font-size: 13px; }
.ws-tab.selected { background: var(--fill-3); border-color: var(--edge); }
.ws-tab-main, .ws-home { display: inline-flex; align-items: center; gap: 7px; min-width: 0; min-height: 30px; padding: 0 6px 0 12px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ws-home { padding-right: 14px; }
.ws-tab.selected .ws-tab-main, .ws-home[aria-selected="true"] { color: var(--text); }
.ws-tab.home:has(.ws-home[aria-selected="true"]) { background: var(--fill-3); border-color: var(--edge); }
.ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.ws-tab.live .ws-dot { background: var(--live); }
.ws-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-kind { font: 700 10px/1 var(--mono); color: var(--accent-text); letter-spacing: 0.04em; }
.ws-close { display: inline-grid; place-items: center; width: 22px; height: 22px; min-height: 22px; margin-right: 5px; padding: 0; border-radius: 50%; color: var(--faint); }
.ws-close:hover { background: var(--fill-2); color: var(--text); }
.app-bar-actions { display: flex; gap: 6px; flex: none; }
.app-body { flex: 1; min-height: 0; display: flex; }
.sidebar { width: 252px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 10px; background: var(--sidebar); border-right: 1px solid var(--hairline); overflow-y: auto; }
.side-places, .side-open { display: flex; flex-direction: column; gap: 2px; }
.side-head { margin: 14px 10px 5px; font: 700 11px/1 var(--rounded); letter-spacing: 0.12em; color: var(--faint); }
.side-places .side-head:first-child { margin-top: 4px; }
.side-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text); text-align: left; }
.side-item .icon { color: var(--accent-text); }
.side-item:hover { background: var(--fill-1); }
.side-item[aria-current] { background: var(--fill-2); font-weight: 600; }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 12px; color: var(--faint); font-weight: 500; }
.monogram { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--fill-2); font: 700 11px/1 var(--rounded); }
.side-item.open.live .monogram::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2px var(--backdrop-top); }
.vault-card { margin-top: auto; padding: 14px; border-radius: 22px; background: var(--glass); border: 1px solid var(--edge); display: flex; flex-direction: column; gap: 10px;
  -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
.vault-card-head { display: flex; align-items: center; gap: 10px; }
.vault-mark { width: 34px; height: 34px; border-radius: 10px; }
.vault-text { display: flex; flex-direction: column; min-width: 0; }
.vault-name { font-weight: 650; font-size: 14px; }
.vault-detail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-card-row { display: flex; gap: 6px; align-items: center; }
.vault-card-row.foot { justify-content: space-between; }
.card-button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 4px 10px; font-size: 13px; background: var(--fill-2); border: 1px solid var(--hairline); }
.card-button:hover { background: var(--fill-3); }
.card-button.compact-only { display: none; }
.app.collapsed .card-button.compact-only { display: inline-flex; }
@media (max-width: 1000px) { .app .card-button.compact-only { display: inline-flex; } }
.looks { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--fill-1); }
.look { display: inline-grid; place-items: center; width: 28px; height: 26px; min-height: 26px; padding: 0; color: var(--muted); }
.look[aria-pressed="true"] { background: var(--fill-3); color: var(--text); }
.side-release { margin: 8px 6px 0; font: 11px/1.4 var(--mono); color: var(--faint); }
.side-links { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 6px 6px 0; font-size: 12px; }
.side-links a { color: var(--faint); text-decoration: none; }
.side-links a:hover { color: var(--text); text-decoration: underline; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; overflow-y: auto; padding: 24px clamp(18px, 3vw, 34px) 32px; display: flex; flex-direction: column; gap: 16px; outline: none; }

/* Collapsed sidebar: the icon rail (SidebarRail, 56 pt). */
.app.collapsed .app-brand { width: auto; }
.app.collapsed .brand-name, .app.collapsed .side-label, .app.collapsed .side-count, .app.collapsed .side-head,
.app.collapsed .vault-text, .app.collapsed .vault-card-row.foot, .app.collapsed .side-release, .app.collapsed .side-links, .app.collapsed .card-button span { display: none; }
.app.collapsed .vault-card-row { flex-direction: column; }
.app.collapsed .card-button { width: 40px; height: 36px; padding: 0; flex: none; }
.app.collapsed .sidebar { width: 64px; padding-inline: 10px; align-items: center; }
.app.collapsed .side-item { justify-content: center; width: 42px; padding: 0; min-height: 40px; }
.app.collapsed .side-open { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.app.collapsed .vault-card { padding: 6px; border-radius: 14px; background: none; border: 0; }

/* Pages */
.page-head { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }
.page-title { display: flex; align-items: baseline; gap: 12px; margin-right: auto; }
.page-sub { font-size: 14px; color: var(--muted); }
.page-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-list { display: flex; flex-direction: column; gap: 22px; }
.page-foot { margin-top: auto; padding-top: 10px; }
.page-form { width: min(720px, 100%); padding: 24px; border-radius: 24px; background: var(--card); border: 1px solid var(--hairline); }
.empty { padding: 30px 0; text-align: center; }
.search-bar { display: flex; align-items: center; gap: 10px; width: min(480px, 100%); min-height: 44px; padding: 0 5px 0 15px; border-radius: 999px; color: var(--muted);
  background: var(--glass); border: 1px solid var(--edge); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.search-bar.small { width: min(360px, 100%); min-height: 38px; padding-right: 15px; }
.search-bar input { flex: 1; min-width: 0; min-height: 0; padding: 0; border: 0; background: none !important; color: var(--text); font-size: 14px; outline: none; }
.search-bar:focus-within { border-color: var(--accent); }
.pill-button { min-height: 34px; padding: 4px 16px; font-size: 14px; }
.section-cap { font: 700 11px/1 var(--rounded); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.host-section { display: flex; flex-direction: column; gap: 10px; }
.group-head { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.group-head .chip { min-height: 28px; font-size: 12px; }
.empty-group { padding: 4px 2px; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.recent-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; background: var(--card); border: 1px solid var(--hairline); }
.recent-card.live { border-color: color-mix(in srgb, var(--live) 45%, transparent); }
.recent-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.recent-text { min-width: 0; }
.recent-text h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-state { font-size: 13px; color: var(--muted); }
.recent-state.live { color: var(--live); display: flex; align-items: center; gap: 7px; }
.recent-state.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.recent-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.host-tile { position: relative; display: flex; align-items: center; min-height: 64px; border-radius: 16px; background: var(--card); border: 1px solid var(--hairline); }
.host-tile:hover { background: var(--card-raised); }
.host-tile.live { border-color: color-mix(in srgb, var(--live) 40%, transparent); }
.tile-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 12px; border-radius: 16px; text-align: left; font-weight: 400; }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-title { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { font: 12px/1.4 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; }
.tile-actions { display: flex; gap: 2px; padding-right: 8px; opacity: 0; transition: opacity 0.12s; }
.host-tile:hover .tile-actions, .host-tile:focus-within .tile-actions { opacity: 1; }
@media (hover: none) { .tile-actions { opacity: 1; } }
.host-tile.add { justify-content: center; gap: 8px; color: var(--muted); background: none; border: 1px dashed var(--edge); border-radius: 16px; font-weight: 500; font-size: 14px; }
.host-tile.add:hover { color: var(--text); background: var(--fill-1); }
.badge-tile { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--badge-from), var(--badge-to)); box-shadow: inset 0 0 0 0.75px rgba(255, 255, 255, 0.14); }
.badge-tile.large { width: 42px; height: 42px; border-radius: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.snippet-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--hairline); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head h3 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; gap: 2px; }
.row-card { border-radius: 20px; background: var(--card); border: 1px solid var(--hairline); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 9px 14px; }
.list-row + .list-row { border-top: 1px solid var(--hairline); }
.row-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex: none; color: #fff; background: linear-gradient(135deg, #6d7cff, #3c46c9); }
.row-icon.password { background: linear-gradient(135deg, #f0a040, #d0741a); }
.row-icon.shield { background: linear-gradient(135deg, #38b47a, #1f8a57); }
.row-icon.activity { background: linear-gradient(135deg, #8e96ad, #5d6479); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.row-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.row-sub.mono { font-family: var(--mono); }
.row-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Forms (editor.ts) */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; border: 0; margin: 0; padding: 0; }
fieldset.field legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 6px; }
.row.two > .field { flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--text); font-size: 15px; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.page-form h1 { font-size: 24px; margin-bottom: 4px; }

/* Tabs and panes (workspace.ts, terminal.ts) */
.ws-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--terminal-bg); }
.ws-box { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.ws-box.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ws-box.split > .pane + .pane { border-left: 1px solid var(--edge); }
.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.pane-bar { display: flex; align-items: center; gap: 4px; min-height: 34px; padding: 2px 8px 2px 12px; border-bottom: 1px solid var(--hairline); background: var(--fill-1); font-size: 12px; }
.ws-box.split > .pane:focus-within .pane-bar { background: color-mix(in srgb, var(--accent) 14%, transparent); border-bottom-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pane-bar .term-status { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-bar button { min-height: 26px; padding: 2px 9px; font-size: 12px; }
.pane-bar .pane-close { width: 26px; padding: 0; display: inline-grid; place-items: center; color: var(--muted); }
.term-status { font-size: 12px; color: var(--muted); }
.term-status.error { color: var(--danger); }
.term-screen { flex: 1; min-height: 0; overflow: hidden; padding: 8px 6px 4px 12px; background: var(--terminal-bg); }
.term-screen .xterm { height: 100%; }
.term-screen.bell { animation: bell-flash 0.2s ease-out; }
@keyframes bell-flash { from { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--accent) 22%, transparent); } to { box-shadow: inset 0 0 0 999px transparent; } }
.term-dialog { max-width: min(480px, calc(100vw - 32px)); width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--edge); border-radius: 24px; padding: 24px; box-shadow: 0 30px 80px var(--shadow); }
.term-dialog::backdrop { background: rgba(9, 12, 28, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.fingerprint { font: 600 16px/1.4 var(--mono); letter-spacing: 0.04em; }
.fingerprint.small { font-size: 13px; overflow-wrap: anywhere; letter-spacing: 0; }
.find-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-bottom: 1px solid var(--hairline); }
.find-field { flex: 1; min-width: 0; min-height: 30px; padding: 4px 10px; }
/* The extra-keys bar (shown on touch screens). */
.key-bar { display: none; gap: 6px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none;
  border-top: 1px solid var(--edge); background: var(--glass); }
.key-bar .key { flex: 0 0 auto; min-width: 44px; min-height: 40px; padding: 6px 10px; font-size: 15px; border-radius: 10px;
  background: var(--fill-2); color: var(--text); border: 1px solid var(--edge); }
.key-bar .key[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
@media (pointer: coarse) { .key-bar { display: flex; } }

/* Files (files.ts) */
.files-crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 6px 10px; font: 13px/1.4 var(--mono); border-bottom: 1px solid var(--hairline); }
.crumb { background: transparent; color: var(--accent-text); min-height: 28px; padding: 2px 6px; border: 0; border-radius: 8px; font: inherit; }
.files-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; }
.files-row { display: flex; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--hairline); }
button.files-row, .files-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: transparent; color: var(--text);
                                 border: 0; border-radius: 8px; padding: 6px 8px; text-align: left; font-size: 15px; min-height: 44px; }
button.files-row:hover, .files-open:hover { background: var(--hairline); }
.files-icon { width: 20px; text-align: center; color: var(--accent); flex: 0 0 auto; }
.files-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.files-actions { display: flex; gap: 2px; flex: 0 0 auto; }
.files-empty { padding: 24px 8px; text-align: center; }
.files-viewer { width: min(960px, calc(100vw - 24px)); height: min(820px, calc(100dvh - 24px)); max-width: none; max-height: none; padding: 0;
                background: var(--surface); color: var(--text); border: 1px solid var(--edge); border-radius: var(--radius); }
.files-viewer[open] { display: flex; flex-direction: column; }
.files-viewer::backdrop { background: rgba(9, 12, 28, 0.55); }
.files-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--edge); }
.files-viewer-bar .title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-viewer-body { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; background: var(--terminal-bg); }
.files-media { max-width: 100%; max-height: 100%; }
.files-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.files-text { align-self: stretch; flex: 1; margin: 0; padding: 12px 14px; font: 13px/1.45 var(--mono); white-space: pre; tab-size: 4; }
.files-editor { flex: 1; min-height: 0; width: 100%; resize: none; border: 0; border-radius: 0; padding: 12px 14px; background: var(--terminal-bg); color: var(--text);
                font: 13px/1.45 var(--mono); tab-size: 4; white-space: pre; }
.files-viewer > .small { padding: 6px 12px; }
.pane-bar button { min-height: 32px; padding: 4px 10px; font-size: 14px; }

.files-icon { color: var(--accent-text); }
.files-viewer { border-radius: 24px; }

/* Lock screen (shell() in main.ts): one glass card over a faint, blurred
   window, as the app's vault card. */
.lock-screen { display: grid; place-items: center; padding: 56px 16px 72px; }
.lock-card { position: relative; width: min(420px, 100%); padding: 34px 30px 26px; border-radius: 34px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: var(--glass); border: 1px solid var(--edge); box-shadow: 0 30px 80px var(--shadow);
  -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%); }
.lock-card .vault-mark.large { width: 72px; height: 72px; margin-bottom: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 18px 40px -14px rgba(20, 16, 90, 0.8); }
.lock-card h1 { font-size: 26px; }
.lock-card > .primary, .lock-card form, .lock-card form .primary { width: 100%; }
.lock-card .primary { min-height: 46px; font-size: 16px; }
.lock-card form { text-align: left; }
.lock-card .banner { text-align: left; width: 100%; }
/* Errors on the lock and sign-in screens read as a banner, not loose red text. */
:is(.lock-card, .signin-right) p.error { width: 100%; text-align: left; font-size: 14px; padding: 10px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.signin-right p.error { color: #c42630; background: rgba(196, 38, 48, 0.07); border-color: rgba(196, 38, 48, 0.22); }
.lock-links { display: flex; justify-content: center; width: 100%; padding-top: 10px; border-top: 1px solid var(--hairline); }
.nw { white-space: nowrap; }
/* Master passphrase with its Show/Hide button inside the field. */
.reveal-field { position: relative; }
.reveal-field input { padding-right: 68px; }
.reveal { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); min-height: 30px; padding: 4px 10px; font-size: 13px; color: var(--accent-text); border-radius: 8px; }
.reveal:hover:not([disabled]) { background: var(--fill-2); }

@media (prefers-reduced-transparency: reduce) {
  .vault-card, .lock-card, .search-bar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
}
@media (prefers-contrast: more) {
  :root { --muted: #c9cfea; --faint: #b0b7d8; --edge: rgba(255, 255, 255, 0.4); --hairline: rgba(255, 255, 255, 0.28); }
  :root[data-scheme="light"] { --muted: #33396a; --faint: #3f4570; --edge: rgba(28, 33, 82, 0.45); --hairline: rgba(28, 33, 82, 0.3); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Narrow windows: the sidebar folds to the rail; phones put the places in
   a bar across the top. */
@media (max-width: 1000px) {
  .app:not(.expanded) .brand-name, .app:not(.expanded) .side-label, .app:not(.expanded) .side-count, .app:not(.expanded) .side-head,
  .app:not(.expanded) .vault-text, .app:not(.expanded) .vault-card-row.foot, .app:not(.expanded) .side-release, .app:not(.expanded) .side-links,
  .app:not(.expanded) .card-button span { display: none; }
  .app .vault-card-row:not(.foot) { flex-direction: column; }
  .app .card-button { width: 40px; height: 36px; padding: 0; flex: none; }
  .app .sidebar { width: 64px; padding-inline: 10px; align-items: center; }
  .app .side-item { justify-content: center; width: 42px; padding: 0; min-height: 40px; }
  .app .vault-card { padding: 6px; background: none; border: 0; }
  .app .app-brand { width: auto; }
  .app .app-brand .icon-button { display: none; }
}
@media (max-width: 640px) {
  .app-bar { flex-wrap: wrap; padding-inline: max(10px, env(safe-area-inset-left)); }
  .app-tabs { order: 3; flex-basis: 100%; }
  .app-bar-actions { margin-left: auto; }
  .app-body { flex-direction: column; }
  .app .sidebar { width: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .side-places, .side-open { flex-direction: row; }
  .app .vault-card { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .app .vault-card-row:not(.foot) { flex-direction: row; }
  .search-bar kbd { display: none; }
  .ws-box.split { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .ws-box.split > .pane + .pane { border-left: 0; border-top: 1px solid var(--edge); }
  .page { padding: 16px 14px 24px; }
  .page-head .search-bar { width: 100%; }
  .tile-actions { opacity: 1; }
  .pane-bar { flex-wrap: wrap; }
  .files-row { flex-wrap: wrap; }
  .files-actions { flex-basis: 100%; justify-content: flex-end; }
  .files-meta { display: none; }
  .files-viewer { width: 100vw; height: 100dvh; border-radius: 0; }
}

/* Sign-in screens (concept canvas "Sign-in: first visit", split handoff):
   the steps on Night Glass on the left, the current action on a Daylight
   paper card on the right. Stacks on narrow screens. */
.signin { padding-block: clamp(40px, 7vw, 88px) 72px; }
.signin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(32px, 6vw, 88px); align-items: center; }
.signin-left { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.signin-head { display: flex; flex-direction: column; gap: 14px; }
.signin-head h1 { font: 600 clamp(34px, 4.4vw, 54px)/1.04 var(--site-font); letter-spacing: -0.04em; text-wrap: balance; }
.signin-head .lead { color: #a0a6c6; font-size: 18px; line-height: 1.55; max-width: 32em; }
.signin-head .lead:empty { display: none; }
.signin-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.signin-steps .step { display: flex; gap: 16px; align-items: flex-start; }
.signin-steps .badge { flex: none; width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; font-weight: 650; border: 1px solid rgba(205, 210, 255, 0.18); color: #a0a6c6; }
.signin-steps .now .badge { background: #5c6eff; border-color: #5c6eff; color: #fff; }
.signin-steps .done .badge { background: #87f0ab; border-color: #87f0ab; color: #0b0e1c; }
.step-text { display: flex; flex-direction: column; gap: 4px; }
.step-title { font-size: 17px; font-weight: 650; }
.todo .step-title { color: #a0a6c6; }
.step-detail { font-size: 14px; color: #a0a6c6; }
/* The action side is one paper card, as the website's cards are on ink. */
.signin-right { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 32px 28px 26px; color-scheme: light; color: #1c2152;
  background: #fff; border-radius: 28px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 80px -20px rgba(94, 108, 255, 0.35); }
.signin-right .panel, .handoff-card { width: 100%; }
.handoff-card { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.handoff-text { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.handoff-title { font-weight: 650; font-size: 17px; }
.signin-right h2 { font-size: 24px; }
.signin-right label, .signin-right details summary { color: #565c8a; }
.signin-right input[type="text"] { background: #fff; color: #1c2152; border-color: rgba(28, 33, 82, 0.18); }
.signin-right .check { color: #08091a; font-size: 15px; }
.signin-right .check input { accent-color: #3f4bd8; }
.signin-right .primary { background: #1c2152; color: #fff; }
.signin-right .primary.wide, .signin-right .button { width: 100%; }
.signin-right .secondary { background: rgba(63, 75, 216, 0.08); color: #3f4bd8; border-color: rgba(63, 75, 216, 0.2); }
.signin-right .plain { color: #3f4bd8; }
.signin-right .danger-text, .signin-right .error { color: #c42630; }
.signin-right .code { background: rgba(28, 33, 82, 0.08); color: #08091a; }
.signin-right .fingerprint { color: #08091a; }
.panel-muted { color: #3f4a8a; }
.signin-right .qr { padding: 0; border-radius: 18px; background: #fff; line-height: 0; }
.signin-right .qr canvas { width: 264px; height: 264px; }
.fingerprint-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 16px; background: rgba(28, 33, 82, 0.05); }
.fingerprint-row .cap { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: #565c8a; }
.fingerprint-row .fingerprint { margin-left: auto; font-size: 14px; color: #1c2152; }
a.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; max-width: 400px; }
a.button.dark { background: #1c2152; color: #fff; }
.approved { width: 120px; height: 120px; border-radius: 60px; background: rgba(23, 133, 74, 0.12); color: #17854a; display: grid; place-items: center; font-size: 56px; font-weight: 700; }
/* Confirmation code from the app: big, spaced digits. */
.signin .code-input { font: 600 28px/1.2 var(--mono); letter-spacing: 0.3em; text-align: center; padding: 12px 8px; width: 100%;
  background: #fff; color: #1c2152; border: 1px solid rgba(28, 33, 82, 0.18); border-radius: 12px; }
@media (max-width: 860px) {
  .signin-grid { grid-template-columns: minmax(0, 1fr); }
  .signin-right { order: -1; }
  .signin { padding-top: 28px; }
}
@media (max-width: 480px) { .signin-right { padding: 24px 18px 20px; border-radius: 22px; } }
.row-icon.terminal { background: linear-gradient(135deg, #6d7cff, #3c46c9); }
.row-icon.folder { background: linear-gradient(135deg, #3896e6, #1c68b4); }
.row-icon.lock { background: linear-gradient(135deg, #8e96ad, #5d6479); }
.row-icon.edit { background: linear-gradient(135deg, #e0307a, #a80d50); }

/* Settings (App/Sources/Settings): cards of rows, as the app's Settings window. */
.settings { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.settings-body { display: flex; flex-direction: column; gap: 18px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill-1); border: 1px solid var(--hairline); }
.segmented button { min-height: 30px; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button:hover { color: var(--text); }
.segmented button:is([aria-selected="true"], [aria-pressed="true"]) { background: var(--card-raised); color: var(--text); box-shadow: 0 1px 3px var(--shadow); }
.segmented.small button { min-height: 26px; padding: 3px 11px; font-size: 12px; }
.set-card { border-radius: 20px; background: var(--card); border: 1px solid var(--hairline); padding: 16px 18px; }
.set-title { margin: 0; font-size: 15px; font-weight: 650; }
.set-detail { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.set-rows { display: flex; flex-direction: column; margin-top: 10px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 48px; padding: 8px 0; }
.set-row + .set-row { border-top: 1px solid var(--hairline); }
.set-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.set-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.set-row select { width: auto; min-width: 210px; max-width: 280px; min-height: 36px; padding: 6px 34px 6px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500; background-color: var(--fill-1); }
:root[data-scheme="light"] .set-row select { background-color: #fff; border-color: rgba(28, 33, 82, 0.18); box-shadow: 0 1px 2px rgba(28, 33, 82, 0.06); }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 42px; min-height: 0; height: 25px; padding: 0; border-radius: 999px; border: 0;
  background: var(--fill-3); position: relative; cursor: pointer; transition: background 0.15s; }
:root[data-scheme="light"] .switch { background: var(--fill-3); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch:checked, :root[data-scheme="light"] .switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(17px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border-radius: 10px; background: var(--fill-1); border: 1px solid var(--hairline); }
.stepper button { width: 30px; min-height: 28px; padding: 0; border-radius: 8px; font-size: 16px; color: var(--text); }
.stepper button:hover:not([disabled]) { background: var(--fill-2); }
.stepper button[disabled] { opacity: 0.35; }
.stepper output { min-width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.theme-tools { display: flex; margin: 0 0 12px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 22px 16px; padding: 6px 2px 2px; }
.swatch { display: flex; flex-direction: column; gap: 8px; padding: 0; min-height: 0; border-radius: 14px; text-align: left; background: none; font-weight: 500; }
.swatch-art { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 78px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--hairline); font: 12px/1.3 var(--mono); white-space: nowrap; overflow: hidden; box-shadow: 0 6px 16px -10px var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.swatch-line:last-child { font-size: 15px; letter-spacing: 1px; line-height: 1; }
.swatch:hover .swatch-art { transform: translateY(-1px); box-shadow: 0 10px 22px -12px var(--shadow); }
.swatch[aria-checked="true"] .swatch-art { outline: 2.5px solid var(--accent); outline-offset: 3px; }
.swatch:focus-visible .swatch-art { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.swatch-name { font-size: 13px; color: var(--muted); padding-inline: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch[aria-checked="true"] .swatch-name { color: var(--text); font-weight: 600; }
.term-preview { margin-top: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--hairline); line-height: 1.45; white-space: pre; overflow: hidden; }
.settings-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .theme-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 12px; }
  .set-row select { max-width: none; }
  .set-row { flex-wrap: wrap; }
  .set-row select { width: 100%; }
}

/* The website's frame around the screens before the vault opens: the same
   header, footer, ink ground, Geist type and buttons as enclavessh.app
   (website/css/site.css). Dark only, like the website, whatever the
   window's appearance. */
.site { --site-font: "Geist", -apple-system, BlinkMacSystemFont, system-ui, sans-serif; --site-mono: "Geist Mono", var(--mono);
  --text: #eceef8; --muted: #a0a6c6; --faint: #6e7499; --accent-text: #8b97ff; --edge: rgba(205, 210, 255, 0.18); --hairline: rgba(205, 210, 255, 0.1);
  --well: rgba(0, 0, 0, 0.22); --fill-2: rgba(255, 255, 255, 0.1); --glass: rgba(21, 25, 55, 0.72); --surface: #151937; --danger: #f2787f; --live: #86d6a4; --warn: #ebc57f;
  color-scheme: dark; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; color: var(--text); font-family: var(--site-font);
  background: radial-gradient(760px 520px at 50% 60px, rgba(94, 108, 255, 0.24), rgba(120, 80, 230, 0.08) 55%, transparent 75%) no-repeat, #08091a; }
.site > main { flex: 1; }
.site h1 { font-family: var(--site-font); font-weight: 600; letter-spacing: -0.035em; }
.site-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.site-head { position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top); background: rgba(8, 9, 26, 0.78); border-bottom: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }
.site-head .site-wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.site-brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.site-brand .mark { width: 32px; height: 32px; }
.site-tag { font: 500 11px/1 var(--site-mono); letter-spacing: 0.04em; padding: 4px 7px; border-radius: 6px; color: var(--accent-text); background: rgba(139, 151, 255, 0.14); }
.site-nav { display: flex; gap: 26px; margin-left: auto; font-size: 14px; }
.site-nav a, .site-foot a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.site-nav a:hover, .site-foot a:hover { color: var(--text); }
.site-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 10px; font: 500 14.5px/1 var(--site-font); text-decoration: none;
  background: #eceef8; color: #08091a; white-space: nowrap; transition: background-color 0.15s; }
.site-btn:hover { background: #fff; }
.site :is(a, button):focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }
.site-label { font: 500 12px/1 var(--site-mono); letter-spacing: 0.04em; color: var(--accent-text); }
.site-foot { border-top: 1px solid var(--hairline); padding-block: 40px max(44px, env(safe-area-inset-bottom)); font-size: 13.5px; color: var(--faint); }
.site-foot .site-wrap { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; }
.site-foot h2 { margin: 0 0 12px; font: 500 12px/1 var(--site-mono); color: var(--muted); letter-spacing: 0.04em; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-fine { display: flex; flex-direction: column; gap: 6px; max-width: 30em; line-height: 1.5; }
.site-fine .verified { font-family: var(--site-mono); color: var(--live); }
.site .lock-card { font-family: var(--site-font); }
.site .lock-card h1 { font-size: 28px; }
@media (max-width: 860px) { .site-nav { display: none; } .site-btn { margin-left: auto; } .site-foot .site-wrap { grid-template-columns: 1fr 1fr; } .site-fine { grid-column: 1 / -1; } }
@media (max-width: 400px) { .site-tag { display: none; } }

/* A verified new release is waiting (updates.ts). */
.update-toast { position: fixed; z-index: 50; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 12px; border-radius: 20px; color: var(--text);
  background: var(--glass); border: 1px solid var(--edge); box-shadow: 0 24px 60px var(--shadow); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
.update-text { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.update-text span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.update-actions { display: flex; justify-content: flex-end; gap: 6px; }
@media (prefers-reduced-transparency: reduce) { .update-toast { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); } }
