/**
 * Signed in application shell and the authentication screens.
 */

/* ---------- Authentication screens ---------- */

.sv-auth {
	display: flex;
	align-items: center;
	justify-content: center;
	padding-block: clamp(40px, 8vh, 88px);
}

.sv-auth-inner {
	width: 100%;
	max-width: 440px;
}

.sv-auth-mark {
	display: flex;
	justify-content: center;
	margin-bottom: var(--sv-space-lg);
	color: var(--sv-gold);
	filter: drop-shadow(0 0 14px var(--sv-gold-glow));
}

.sv-auth-card {
	background: var(--sv-surface);
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-lg);
	padding: clamp(24px, 5vw, 36px);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.sv-auth-card h1 {
	font-size: 1.625rem;
	margin-bottom: 6px;
}

.sv-auth-intro {
	color: var(--sv-text-muted);
	font-size: 0.9375rem;
	margin-bottom: var(--sv-space-lg);
}

.sv-auth-foot {
	margin-top: var(--sv-space-lg);
	padding-top: var(--sv-space-md);
	border-top: 1px solid var(--sv-border);
	text-align: center;
	font-size: 0.9375rem;
	color: var(--sv-text-muted);
}

.sv-auth-aside {
	margin-top: var(--sv-space-md);
	text-align: center;
	font-size: 0.8125rem;
	color: var(--sv-text-faint);
}

.sv-password-wrap {
	position: relative;
}

.sv-password-wrap .sv-input {
	padding-right: 46px;
}

.sv-password-peek {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: var(--sv-radius-sm);
	color: var(--sv-text-muted);
	cursor: pointer;
}

.sv-password-peek:hover {
	color: var(--sv-text);
}

.sv-label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.sv-mfa-step {
	margin-top: var(--sv-space-md);
}

/* ---------- Shell ---------- */

.sv-shell {
	display: grid;
	grid-template-columns: var(--sv-sidebar) minmax(0, 1fr);
	min-height: 100vh;
}

.sv-sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
	gap: var(--sv-space-md);
	padding: var(--sv-space-lg) var(--sv-space-md);
	background: rgba(9, 9, 11, 0.55);
	border-right: 1px solid var(--sv-border-soft);
	overflow-y: auto;
}

.sv-sidebar-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-inline: 8px;
	margin-bottom: var(--sv-space-sm);
}

.sv-sidebar-close {
	display: none;
	width: 32px;
	height: 32px;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-sm);
	color: var(--sv-text-secondary);
	cursor: pointer;
}

.sv-sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sv-sidebar-link {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 11px 12px;
	border: 0;
	border-radius: var(--sv-radius);
	background: transparent;
	color: var(--sv-text-secondary);
	font-family: var(--sv-font-body);
	font-size: 0.9375rem;
	text-align: left;
	cursor: pointer;
	transition: background-color 180ms ease, color 180ms ease;
}

.sv-sidebar-link:hover {
	background: var(--sv-accent-wash);
	color: var(--sv-text);
}

.sv-sidebar-link.is-current {
	background: var(--sv-accent-glow);
	color: var(--sv-text);
	font-weight: 600;
}

.sv-sidebar-link.is-current svg {
	color: var(--sv-accent);
}

.sv-sidebar-foot {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sv-sidebar-signout {
	color: var(--sv-text-muted);
}

.sv-plan-card {
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius);
	padding: 14px;
	margin-bottom: var(--sv-space-sm);
	background: rgba(26, 35, 50, 0.4);
}

.sv-plan-label {
	display: block;
	font-size: 0.6875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sv-text-faint);
}

.sv-plan-name {
	display: block;
	font-family: var(--sv-font-display);
	font-size: 1.0625rem;
	font-weight: 600;
	margin-bottom: 10px;
}

.sv-meter {
	height: 5px;
	border-radius: var(--sv-radius-pill);
	background: rgba(30, 58, 95, 0.7);
	overflow: hidden;
}

.sv-meter-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--sv-accent);
	transition: width 400ms ease;
}

.sv-meter-fill.is-full {
	background: var(--sv-warning);
}

.sv-plan-storage {
	display: block;
	font-size: 0.6875rem;
	color: var(--sv-text-muted);
	margin: 7px 0 12px;
}

.sv-sidebar-scrim {
	display: none;
}

.sv-shell-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.sv-topbar {
	position: sticky;
	top: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: var(--sv-space-md);
	height: var(--sv-header);
	padding-inline: clamp(16px, 3vw, 32px);
	background: rgba(13, 17, 23, 0.8);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--sv-border-soft);
}

.sv-topbar-toggle {
	display: none;
}

.sv-topbar-title {
	flex: 1 1 auto;
	min-width: 0;
}

.sv-topbar-title h1 {
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sv-topbar-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sv-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--sv-radius-pill);
	background: var(--sv-accent-glow);
	border: 1px solid var(--sv-border);
	color: var(--sv-accent-hover);
	font-family: var(--sv-font-display);
	font-weight: 600;
	font-size: 0.875rem;
}

.sv-shell-content {
	padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px) 64px;
}

.sv-shell-inner {
	max-width: 1080px;
}

.sv-page-lede {
	margin-bottom: var(--sv-space-lg);
}

.sv-verify-banner {
	align-items: flex-start;
}

.sv-verify-banner p {
	margin: 4px 0 10px;
}

.sv-section-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--sv-space-md);
	margin-bottom: var(--sv-space-md);
}

/* ---------- Stat tiles ---------- */

.sv-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: var(--sv-space-md);
	margin-bottom: var(--sv-space-lg);
}

.sv-stat-tile {
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-lg);
	padding: 18px 20px;
	background: var(--sv-card);
}

.sv-stat-tile-head {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--sv-text-muted);
	font-size: 0.8125rem;
	margin-bottom: 10px;
}

.sv-stat-tile-head svg {
	color: var(--sv-accent);
}

.sv-stat-tile-value {
	display: block;
	font-family: var(--sv-font-display);
	font-size: 1.875rem;
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -0.03em;
}

.sv-stat-tile-sub {
	display: block;
	margin-top: 6px;
	font-size: 0.8125rem;
	color: var(--sv-text-muted);
}

/* ---------- Rows ---------- */

.sv-list {
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-lg);
	overflow: hidden;
	background: var(--sv-card);
}

.sv-list-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: var(--sv-space-md);
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid var(--sv-border);
}

.sv-list-row:last-child {
	border-bottom: 0;
}

.sv-list-row:hover {
	background: rgba(52, 152, 219, 0.04);
}

.sv-list-main {
	min-width: 0;
}

.sv-list-title {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	overflow-wrap: anywhere;
	font-family: var(--sv-font-display);
	font-size: 1.0625rem;
	font-weight: 500;
	margin-bottom: 4px;
}

.sv-list-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 0.8125rem;
	color: var(--sv-text-muted);
	min-width: 0;
	overflow-wrap: anywhere;
}

.sv-list-meta span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.sv-list-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

.sv-icon-btn {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-sm);
	color: var(--sv-text-secondary);
	cursor: pointer;
	transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.sv-icon-btn:hover {
	color: var(--sv-text);
	border-color: var(--sv-accent);
	background: var(--sv-accent-wash);
}

.sv-icon-btn.is-danger:hover {
	color: var(--sv-danger);
	border-color: var(--sv-danger);
	background: rgba(244, 63, 94, 0.08);
}

/* ---------- Vault card ---------- */

.sv-vaults {
	display: grid;
	gap: var(--sv-space-md);
}

.sv-vault {
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-lg);
	padding: var(--sv-space-lg);
	background: var(--sv-surface);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition: border-color 300ms ease;
}

.sv-vault.is-urgent {
	border-color: rgba(245, 158, 11, 0.5);
}

.sv-vault.is-triggered {
	border-color: rgba(244, 63, 94, 0.4);
}

.sv-vault-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--sv-space-md);
	margin-bottom: 12px;
}

.sv-vault-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--sv-font-display);
	font-size: 1.1875rem;
	font-weight: 500;
	letter-spacing: -0.02em;
}

.sv-vault-desc {
	color: var(--sv-text-muted);
	font-size: 0.9375rem;
	margin-bottom: var(--sv-space-md);
}

.sv-vault-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: var(--sv-space-md);
	padding-block: var(--sv-space-md);
	border-top: 1px solid var(--sv-border);
	border-bottom: 1px solid var(--sv-border);
	margin-bottom: var(--sv-space-md);
}

/* A vault with several recipients needs the full width of the card, or the
   addresses wrap into an unreadable column. */
.sv-vault-field-wide {
	grid-column: 1 / -1;
}

/* The native date picker draws its own calendar and icon. Without this the
   browser paints a light popup and a black calendar glyph on a dark field. */
.sv-input[type="datetime-local"] {
	color-scheme: dark;
}

/* ---------- Vault file upload ---------- */

.sv-vault-drop {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px;
	border: 1px dashed var(--sv-border);
	border-radius: var(--sv-radius);
	background: var(--sv-surface);
	color: var(--sv-text-secondary);
	cursor: pointer;
	transition: border-color 140ms ease, background 140ms ease;
}

.sv-vault-drop:hover,
.sv-vault-drop.is-over,
.sv-vault-drop:focus-within {
	border-color: var(--sv-accent);
	background: var(--sv-accent-wash);
}

.sv-vault-drop svg {
	flex: none;
	color: var(--sv-accent);
}

.sv-vault-drop-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	font-size: 0.875rem;
}

.sv-vault-drop-text strong {
	color: var(--sv-text);
	font-weight: 600;
}

.sv-vault-queue {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sv-vault-queue:empty {
	display: none;
}

.sv-vault-queue-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 4px 10px;
	padding: 8px 10px;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-sm);
	background: var(--sv-bg-deep);
	font-size: 0.8125rem;
}

.sv-vault-queue-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--sv-text);
}

.sv-vault-queue-state {
	color: var(--sv-text-muted);
	white-space: nowrap;
}

.sv-vault-queue-item .sv-recipient-remove {
	width: 28px;
	height: 28px;
	font-size: 1rem;
}

.sv-vault-queue-bar {
	grid-column: 1 / -1;
	height: 3px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	overflow: hidden;
}

.sv-vault-queue-bar span {
	display: block;
	height: 100%;
	background: var(--sv-accent);
	transition: width 200ms ease;
}

.sv-vault-queue-item.is-done .sv-vault-queue-state {
	color: var(--sv-success);
}

.sv-vault-queue-item.is-failed,
.sv-vault-queue-item.is-blocked {
	border-color: rgba(244, 63, 94, 0.4);
}

.sv-vault-queue-item.is-failed .sv-vault-queue-state,
.sv-vault-queue-item.is-blocked .sv-vault-queue-state {
	color: var(--sv-danger);
	white-space: normal;
}

.sv-vault-attach-title {
	display: block;
	margin: 12px 0 6px;
}

@media (max-width: 620px) {
	.sv-vault-queue-item {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.sv-vault-queue-state {
		grid-column: 1 / 2;
		white-space: normal;
	}
}

/* ---------- Recipient repeater ---------- */

.sv-recipients {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 10px;
}

.sv-recipient-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
	gap: 8px;
	align-items: center;
}

.sv-recipient-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: none;
	font-size: 1.25rem;
	line-height: 1;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-sm);
	background: transparent;
	color: var(--sv-text-muted);
	cursor: pointer;
	transition: color 140ms ease, border-color 140ms ease;
}

.sv-recipient-remove:hover {
	color: var(--sv-danger);
	border-color: rgba(244, 63, 94, 0.5);
}

.sv-recipient-add[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

@media (max-width: 620px) {
	.sv-recipient-row {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.sv-recipient-row [data-sv-recipient-name] {
		grid-column: 1 / -1;
	}
}

.sv-vault-field span {
	display: block;
	font-size: 0.6875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sv-text-faint);
	margin-bottom: 4px;
}

.sv-vault-field strong {
	font-family: var(--sv-font-mono);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--sv-text-bright);
	word-break: break-word;
}

.sv-countdown {
	font-family: var(--sv-font-mono);
	font-size: 1.0625rem;
	font-weight: 500;
	color: var(--sv-success-bright);
}

.sv-countdown.is-urgent {
	color: var(--sv-warning);
}

.sv-countdown.is-expired {
	color: var(--sv-danger);
}

.sv-vault-progress {
	height: 5px;
	border-radius: var(--sv-radius-pill);
	background: rgba(30, 58, 95, 0.6);
	overflow: hidden;
	margin-bottom: var(--sv-space-md);
}

.sv-vault-progress span {
	display: block;
	height: 100%;
	background: var(--sv-success);
	transition: width 500ms ease;
}

.sv-vault-progress span.is-urgent {
	background: var(--sv-warning);
}

.sv-vault-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* ---------- Files ---------- */

.sv-dropzone {
	border: 1px dashed var(--sv-border);
	border-radius: var(--sv-radius-lg);
	padding: clamp(28px, 5vw, 44px);
	text-align: center;
	background: rgba(26, 35, 50, 0.25);
	transition: border-color 200ms ease, background-color 200ms ease;
	margin-bottom: var(--sv-space-lg);
}

.sv-dropzone.is-over {
	border-color: var(--sv-accent);
	background: var(--sv-accent-wash);
}

.sv-dropzone svg {
	margin: 0 auto 12px;
	color: var(--sv-accent);
}

.sv-dropzone h3 {
	margin-bottom: 6px;
}

.sv-dropzone p {
	color: var(--sv-text-muted);
	font-size: 0.875rem;
	margin-bottom: var(--sv-space-md);
}

.sv-upload-queue {
	display: grid;
	gap: 8px;
	margin-bottom: var(--sv-space-lg);
}

.sv-upload-item {
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius);
	padding: 12px 16px;
	background: var(--sv-card);
}

.sv-upload-item-head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.875rem;
	margin-bottom: 8px;
}

.sv-upload-item-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sv-upload-bar {
	height: 4px;
	border-radius: var(--sv-radius-pill);
	background: rgba(30, 58, 95, 0.6);
	overflow: hidden;
}

.sv-upload-bar span {
	display: block;
	height: 100%;
	background: var(--sv-accent);
	transition: width 200ms linear;
}

.sv-file-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex: none;
	border-radius: var(--sv-radius-sm);
	background: rgba(30, 58, 95, 0.4);
	color: var(--sv-text-secondary);
}

.sv-file-row {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 14px;
	align-items: center;
	padding: 14px 20px;
	border-bottom: 1px solid var(--sv-border);
}

.sv-file-row:last-child {
	border-bottom: 0;
}

.sv-file-name {
	font-size: 0.9375rem;
	word-break: break-word;
}

/* ---------- Activity ---------- */

.sv-timeline {
	border-left: 1px solid var(--sv-border);
	margin-left: 9px;
	padding-left: var(--sv-space-lg);
}

.sv-timeline-item {
	position: relative;
	padding-block: 14px;
}

.sv-timeline-item + .sv-timeline-item {
	border-top: 1px solid rgba(30, 58, 95, 0.5);
}

.sv-timeline-item::before {
	content: "";
	position: absolute;
	left: calc(var(--sv-space-lg) * -1 - 5px);
	top: 22px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--sv-bg);
	border: 1px solid var(--sv-accent);
}

.sv-timeline-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}

.sv-timeline-label {
	font-weight: 600;
	font-size: 0.9375rem;
}

.sv-timeline-time {
	font-family: var(--sv-font-mono);
	font-size: 0.75rem;
	color: var(--sv-text-faint);
}

.sv-timeline-detail {
	font-size: 0.8125rem;
	color: var(--sv-text-muted);
	margin-top: 3px;
	word-break: break-word;
}

/* ---------- Tabs ---------- */

.sv-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	border-bottom: 1px solid var(--sv-border);
	margin-bottom: var(--sv-space-lg);
}

.sv-tab {
	padding: 11px 16px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: transparent;
	color: var(--sv-text-muted);
	font-family: var(--sv-font-display);
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	transition: color 180ms ease, border-color 180ms ease;
}

.sv-tab:hover {
	color: var(--sv-text);
}

.sv-tab.is-active {
	color: var(--sv-text);
	border-bottom-color: var(--sv-accent);
}

.sv-tab-panel[hidden] {
	display: none;
}

/* ---------- Tables ---------- */

.sv-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-lg);
	background: var(--sv-card);
}

.sv-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	min-width: 620px;
}

.sv-table th,
.sv-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--sv-border);
	vertical-align: middle;
}

.sv-table th {
	font-family: var(--sv-font-display);
	font-size: 0.6875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sv-text-faint);
	font-weight: 600;
	white-space: nowrap;
}

.sv-table tbody tr:last-child td {
	border-bottom: 0;
}

.sv-table tbody tr:hover {
	background: rgba(52, 152, 219, 0.04);
}

.sv-table .sv-mono {
	color: var(--sv-text-secondary);
}

/* ---------- Backup codes ---------- */

.sv-codes {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	margin-block: var(--sv-space-md);
}

.sv-codes li {
	font-family: var(--sv-font-mono);
	font-size: 0.9375rem;
	letter-spacing: 0.06em;
	padding: 10px 14px;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-sm);
	background: var(--sv-bg-deep);
	text-align: center;
}

.sv-qr {
	display: flex;
	justify-content: center;
	padding: var(--sv-space-md);
	background: #fff;
	border-radius: var(--sv-radius);
	width: fit-content;
	margin-inline: auto;
}

.sv-secret-box {
	font-family: var(--sv-font-mono);
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	word-break: break-all;
	padding: 12px 14px;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-sm);
	background: var(--sv-bg-deep);
	text-align: center;
}

/* ---------- Pagination ---------- */

.sv-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: var(--sv-space-lg);
	font-size: 0.875rem;
	color: var(--sv-text-muted);
}


/* ---------- Responsive ---------- */

@media (max-width: 980px) {
	.sv-shell {
		grid-template-columns: 1fr;
	}

	.sv-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 272px;
		z-index: 90;
		transform: translateX(-100%);
		transition: transform 240ms ease;
		background: #0f151f;
	}

	.sv-sidebar.is-open {
		transform: translateX(0);
	}

	.sv-sidebar-close {
		display: inline-flex;
	}

	.sv-sidebar-scrim {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 80;
		background: rgba(9, 9, 11, 0.7);
	}

	.sv-sidebar-scrim[hidden] {
		display: none;
	}

	.sv-topbar-toggle {
		display: inline-flex;
	}
}

@media (max-width: 620px) {
	.sv-list-row {
		grid-template-columns: 1fr;
	}

	.sv-list-actions {
		justify-content: flex-start;
	}

	.sv-codes {
		grid-template-columns: 1fr;
	}

	.sv-topbar-actions .sv-btn span {
		display: none;
	}

	.sv-file-row {
		grid-template-columns: auto 1fr;
	}

	.sv-file-row .sv-list-actions {
		grid-column: span 2;
	}
}

/* ---------------------------------------------------------------------------
   Danger zone, used by permanent account deletion.
   --------------------------------------------------------------------------- */

.sv-danger-zone {
	border-color: rgba(244, 63, 94, 0.35);
}

.sv-danger-zone h2 {
	color: var(--sv-danger);
}

.sv-danger-list {
	margin: var(--sv-space-md) 0;
	padding-left: 1.15em;
	color: var(--sv-text-secondary);
	font-size: 0.9rem;
}

.sv-danger-list li + li {
	margin-top: 0.4em;
}

.sv-danger-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sv-space-sm);
	align-items: center;
}

/* ---------------------------------------------------------------------------
   Audit log.
   --------------------------------------------------------------------------- */

.sv-audit-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: var(--sv-space-sm);
	margin-bottom: var(--sv-space-md);
}

.sv-audit-stat {
	padding: 12px 14px;
	border: 1px solid var(--sv-border);
	border-radius: 10px;
	background: var(--sv-card);
}

.sv-audit-stat-value {
	display: block;
	font-family: var(--sv-font-display);
	font-size: 1.35rem;
	font-weight: 600;
	color: var(--sv-text-bright);
	line-height: 1.1;
}

.sv-audit-stat-label {
	display: block;
	margin-top: 2px;
	font-size: 0.75rem;
	color: var(--sv-text-muted);
}

.sv-audit-controls {
	margin-bottom: var(--sv-space-md);
}

.sv-audit-filters {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sv-space-xs);
	margin-bottom: var(--sv-space-md);
}

/* The chip and search field styles below are a copy of the content.css rules.
   The Activity screen uses both, but it is an app route, so content.css is
   never enqueued for it and the chips were falling back to the browser's own
   button styling: a pale box with the theme's white text on top, unreadable.
   Change both files together. */

.sv-chip {
	appearance: none;
	cursor: pointer;
	font: inherit;
	font-size: 0.82rem;
	line-height: 1.2;
	padding: 7px 12px;
	border-radius: 999px;
	color: var(--sv-text-secondary);
	background: var(--sv-surface);
	border: 1px solid var(--sv-border);
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sv-chip:hover,
.sv-chip:focus-visible {
	color: var(--sv-text);
	border-color: var(--sv-accent);
	background: var(--sv-accent-wash);
}

.sv-chip.is-active {
	color: var(--sv-bg);
	background: var(--sv-accent);
	border-color: var(--sv-accent);
	font-weight: 600;
}

.sv-help-search {
	position: relative;
	margin-bottom: var(--sv-space-md);
}

.sv-help-search .sv-input {
	width: 100%;
	padding-left: 42px;
}

.sv-help-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--sv-text-muted);
	pointer-events: none;
	display: flex;
}

.sv-chip-count {
	display: inline-block;
	margin-left: 4px;
	padding: 1px 6px;
	border-radius: 999px;
	font-size: 0.72rem;
	background: rgba(255, 255, 255, 0.08);
}

.sv-chip.is-active .sv-chip-count {
	background: rgba(13, 17, 23, 0.25);
}

.sv-audit-refine {
	display: grid;
	gap: var(--sv-space-sm);
}

.sv-audit-search {
	margin-bottom: 0;
}

.sv-audit-dates,
.sv-audit-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sv-space-sm);
	align-items: center;
}

.sv-audit-dates .sv-input {
	flex: 0 1 180px;
}

.sv-audit-actions .sv-input {
	flex: 1 1 220px;
	min-width: 0;
}

.sv-audit-dash {
	color: var(--sv-text-muted);
}

.sv-audit-count {
	margin: 0 0 var(--sv-space-sm);
}

.sv-timeline-item.is-notable {
	border-left: 2px solid var(--sv-warning);
	padding-left: 12px;
}

.sv-timeline-stamp {
	margin: 4px 0 0;
	font-size: 0.75rem;
	color: var(--sv-text-faint);
}

@media (max-width: 640px) {
	.sv-audit-dates .sv-input,
	.sv-audit-actions .sv-input {
		flex: 1 1 100%;
	}

	.sv-audit-dash {
		display: none;
	}
}

/* ---------------------------------------------------------------------------
   Plan grid.

   The Subscription screen renders the same plan cards as the landing page, but
   it loads app.css rather than landing.css, so the whole grid was arriving
   unstyled. These rules are a copy of the landing ones; change both together.
   --------------------------------------------------------------------------- */

.sv-billing-toggle {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-pill);
	background: rgba(26, 35, 50, 0.45);
}

.sv-billing-toggle button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 20px;
	border: 0;
	border-radius: var(--sv-radius-pill);
	background: transparent;
	color: var(--sv-text-secondary);
	font-family: var(--sv-font-display);
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 200ms ease, color 200ms ease;
}

.sv-billing-toggle button.is-active {
	background: var(--sv-accent);
	color: #fff;
}

.sv-billing-toggle button.is-active .sv-badge {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
}

.sv-plans {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--sv-space-md);
	align-items: stretch;
}

.sv-plan {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--sv-surface);
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-lg);
	padding: var(--sv-space-lg);
}

.sv-plan.is-featured {
	border-color: rgba(139, 92, 246, 0.55);
	background: rgba(26, 35, 50, 0.72);
}

.sv-plan-badge {
	position: absolute;
	top: -11px;
	left: 50%;
	transform: translateX(-50%);
	padding: 4px 12px;
	border-radius: var(--sv-radius-pill);
	font-family: var(--sv-font-display);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	white-space: nowrap;
	background: var(--sv-accent);
	color: #fff;
}

.sv-plan-violet .sv-plan-badge {
	background: var(--sv-violet-deep);
}

.sv-plan-tagline {
	color: var(--sv-text-muted);
	font-size: 0.875rem;
	margin: 6px 0 var(--sv-space-md);
	min-height: 2.6em;
}

.sv-plan-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.sv-plan-amount {
	font-family: var(--sv-font-display);
	font-size: 2.5rem;
	font-weight: 500;
	letter-spacing: -0.03em;
	line-height: 1;
	color: var(--sv-text);
}

.sv-plan-period {
	font-size: 0.8125rem;
	color: var(--sv-text-muted);
}

.sv-plan-annual-note {
	margin-top: 6px;
}

.sv-plan-features {
	margin: var(--sv-space-lg) 0;
	padding: 0;
	display: grid;
	gap: 10px;
	flex: 1 1 auto;
}

.sv-plan-features li {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px;
	align-items: start;
	font-size: 0.875rem;
	color: var(--sv-text-secondary);
}

.sv-plan-features svg {
	margin-top: 3px;
	color: var(--sv-success);
}

.sv-plan-sky .sv-btn-primary {
	background: var(--sv-sky-deep);
}

.sv-plan-sky .sv-btn-primary:hover {
	background: var(--sv-sky);
	box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}

.sv-plan-violet .sv-btn-primary {
	background: var(--sv-violet-deep);
}

.sv-plan-violet .sv-btn-primary:hover {
	background: var(--sv-violet);
	box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.sv-guarantee {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	max-width: 780px;
	margin: var(--sv-space-xl) auto 0;
	padding: 16px 22px;
	border: 1px solid var(--sv-border);
	border-radius: var(--sv-radius-lg);
	background: rgba(16, 185, 129, 0.06);
	color: var(--sv-text-secondary);
	font-size: 0.9375rem;
	text-align: left;
}

.sv-guarantee svg {
	flex: none;
	color: var(--sv-success);
}

@media (max-width: 1080px) {
	.sv-plans {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--sv-space-lg);
	}
}

@media (max-width: 620px) {
	.sv-plans {
		grid-template-columns: 1fr;
	}

	.sv-guarantee {
		flex-direction: column;
		text-align: center;
	}
}

/* The currency has to be unmistakable: the account settles in Australian
   dollars but every plan is presented and charged in US dollars. */
.sv-plan-currency {
	font-family: var(--sv-font-display);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--sv-text-muted);
}

.sv-currency-note {
	max-width: 780px;
	margin: 12px auto 0;
	text-align: center;
}

/* Home screen installs: keep the top bar and the menu clear of the status bar
   and notch. Zero in a normal browser tab. */
.sv-topbar {
	height: calc(var(--sv-header) + env(safe-area-inset-top, 0px));
	padding-top: env(safe-area-inset-top, 0px);
}

.sv-sidebar {
	padding-top: calc(var(--sv-space-lg) + env(safe-area-inset-top, 0px));
	padding-bottom: calc(var(--sv-space-lg) + env(safe-area-inset-bottom, 0px));
}

/* A four column table has nowhere to go on a phone, so below this width each
   row becomes its own small block with the column name beside each value. */
@media (max-width: 600px) {
	.sv-table-stack thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.sv-table-stack,
	.sv-table-stack tbody,
	.sv-table-stack tr,
	.sv-table-stack td {
		display: block;
		width: 100%;
	}

	.sv-table-stack tr {
		padding: 10px 0;
		border-bottom: 1px solid var(--sv-border);
	}

	.sv-table-stack tbody tr:last-child {
		border-bottom: 0;
	}

	.sv-table-stack td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 16px;
		padding: 3px 0;
		border-bottom: 0;
		text-align: right;
	}

	.sv-table-stack td::before {
		content: attr(data-label);
		font-family: var(--sv-font-display);
		font-size: 0.6875rem;
		letter-spacing: 0.1em;
		text-transform: uppercase;
		color: var(--sv-text-faint);
		text-align: left;
	}

	.sv-table-stack td:first-child {
		font-weight: 600;
	}
}
