/**
 * Shared Choose File picker — brand blue (#1800AC).
 * Used by audio tools (and any future tool that calls sn_file_picker_choose()).
 */

.sn-file-choose-wrap {
	--sn-file-choose-blue: #1800ac;
	--sn-file-choose-blue-hover: #120080;
	--sn-file-choose-blue-soft: rgba(24, 0, 172, 0.22);
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: stretch;
	width: min(100%, 22rem);
}

.sn-file-choose-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
}

.sn-file-choose-row .sn-file-choose {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	max-width: none;
}

.sn-file-choose-info {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 999px;
	background: #fff;
	color: #475569;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sn-file-choose-info:hover,
.sn-file-choose-info:focus-visible,
.sn-file-choose-wrap.is-info-open .sn-file-choose-info {
	color: var(--sn-file-choose-blue);
	border-color: var(--sn-file-choose-blue-soft);
	background: rgba(24, 0, 172, 0.06);
	outline: none;
	box-shadow: 0 0 0 3px rgba(24, 0, 172, 0.12);
}

.sn-file-choose-info__icon {
	font-size: 1.25rem;
	line-height: 1;
}

.sn-file-choose-info__panel {
	margin-top: 0.55rem;
	padding: 0.7rem 0.85rem;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 0.55rem;
	background: #f8fafc;
	color: #475569;
	font-size: 0.8125rem;
	line-height: 1.45;
	text-align: left;
}

.sn-file-choose-info__panel[hidden] {
	display: none !important;
}

.sn-file-choose {
	display: inline-flex;
	align-items: stretch;
	width: 100%;
	min-height: 3.75rem;
	padding: 0;
	border: 0;
	border-radius: 0.65rem;
	background: var(--sn-file-choose-blue);
	color: #fff;
	font-weight: 700;
	font-size: 1.125rem;
	overflow: hidden;
	box-shadow: 0 8px 22px rgba(24, 0, 172, 0.32);
	transition: background 0.15s ease, box-shadow 0.15s ease;
}

.sn-file-choose__main {
	flex: 1 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0.95rem 1.5rem;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.sn-file-choose__caret-btn {
	display: inline-flex;
	align-items: stretch;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.sn-file-choose__main:hover,
.sn-file-choose__main:focus-visible,
.sn-file-choose__caret-btn:hover,
.sn-file-choose__caret-btn:focus-visible {
	background: rgba(0, 0, 0, 0.1);
	outline: none;
}

.sn-file-choose-wrap.is-open .sn-file-choose,
.sn-file-choose:hover,
.sn-file-choose:focus-within {
	background: var(--sn-file-choose-blue-hover);
}

.sn-file-choose__label {
	display: inline-flex;
	align-items: center;
	padding: 0;
	letter-spacing: 0.01em;
}

.sn-file-choose__sep {
	width: 1px;
	align-self: stretch;
	background: rgba(255, 255, 255, 0.35);
}

.sn-file-choose__caret {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 1rem;
	min-width: 3.25rem;
}

.sn-file-choose__caret-icon {
	font-size: 1.35rem;
	color: #fff;
}

.sn-file-choose-menu {
	position: absolute;
	top: calc(100% + 0.45rem);
	left: 0;
	right: auto;
	z-index: 40;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	width: min(100%, 22rem);
	padding: 0.45rem;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 0.65rem;
	background: #fff;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
	text-align: left;
}

.sn-file-choose-menu[hidden] {
	display: none !important;
}

.sn-file-choose-menu__item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	margin: 0;
	padding: 0.7rem 0.85rem;
	border: 0;
	border-radius: 0.45rem;
	background: transparent;
	color: #0f172a;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
}

.sn-file-choose-menu__item:hover,
.sn-file-choose-menu__item:focus-visible {
	background: #f1f5f9;
	outline: none;
}

.sn-file-choose-menu__brand {
	flex: 0 0 auto;
	display: block;
}

.sn-file-choose-menu__brand--mono {
	color: #334155;
}

.sn-file-url-dialog {
	width: min(92vw, 26rem);
	padding: 0;
	border: 0;
	border-radius: 0.75rem;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}

.sn-file-url-dialog::backdrop {
	background: rgba(15, 23, 42, 0.45);
}

.sn-file-url-dialog__form {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	padding: 1.25rem 1.35rem 1.15rem;
}

.sn-file-url-dialog__title {
	margin: 0 0 0.25rem;
	font-size: 1.1rem;
	font-weight: 700;
	color: #0f172a;
}

.sn-file-url-dialog__label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #334155;
	text-align: left;
}

.sn-file-url-dialog__input {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid #cbd5e1;
	border-radius: 0.45rem;
	font-size: 0.95rem;
}

.sn-file-url-dialog__input:focus {
	outline: 2px solid rgba(24, 0, 172, 0.28);
	border-color: var(--sn-file-choose-blue, #1800ac);
}

.sn-file-url-dialog__error {
	margin: 0;
	color: #b91c1c;
	font-size: 0.85rem;
	text-align: left;
}

.sn-file-url-dialog__actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 0.35rem;
}

.sn-file-btn {
	margin: 0;
	padding: 0.55rem 1rem;
	border: 0;
	border-radius: 0.45rem;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}

.sn-file-btn--ghost {
	background: transparent;
	color: var(--sn-file-choose-blue, #1800ac);
}

.sn-file-btn--ghost:hover,
.sn-file-btn--ghost:focus-visible {
	background: #f1f5f9;
	outline: none;
}

.sn-file-btn--primary {
	background: var(--sn-file-choose-blue, #1800ac);
	color: #fff;
}

.sn-file-btn--primary:hover,
.sn-file-btn--primary:focus-visible {
	background: var(--sn-file-choose-blue-hover, #120080);
	outline: none;
}

.sn-file-btn--primary:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Drag-over ring when used inside a drop zone */
.is-dragover .sn-file-choose,
.sn-audio-drop.is-dragover .sn-file-choose {
	box-shadow: 0 0 0 4px var(--sn-file-choose-blue-soft, rgba(24, 0, 172, 0.22));
}

/* Import busy overlay — Drive / Dropbox / URL downloads */
.sn-file-import {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	background: rgba(15, 42, 90, 0.52);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.sn-file-import[hidden] {
	display: none !important;
}

.sn-file-import__card {
	width: min(100%, 22rem);
	padding: 1.45rem 1.5rem 1.3rem;
	border-radius: 1rem;
	background: #fff;
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
	text-align: center;
}

.sn-file-import__spinner {
	width: 2.35rem;
	height: 2.35rem;
	margin: 0 auto 0.9rem;
	border: 3px solid #e2e8f0;
	border-top-color: #1800ac;
	border-radius: 999px;
	animation: sn-file-import-spin 0.75s linear infinite;
}

.sn-file-import__title {
	margin: 0 0 0.4rem;
	font-family: var(--font-heading, Sora, sans-serif);
	font-size: 1.1rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
}

.sn-file-import__detail {
	margin: 0;
	min-height: 1.35rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #64748b;
	line-height: 1.45;
	word-break: break-word;
}

html.sn-file-import-open,
html.sn-file-import-open body {
	overflow: hidden;
}

@keyframes sn-file-import-spin {
	to { transform: rotate(360deg); }
}

.sn-file-sheet-handle,
.sn-file-sheet-title {
	display: none;
}

/* Mobile: Choose File sources as bottom sheet (no overlap with page content) */
@media (max-width: 767px) {
	.sn-file-choose-wrap {
		width: 100%;
		max-width: 22rem;
	}

	.sn-file-choose {
		min-height: 3.35rem;
		border-radius: 0.75rem;
	}

	.sn-file-choose__main {
		padding: 0.85rem 1.15rem;
		font-size: 1.05rem;
	}

	.sn-file-choose__caret {
		min-width: 3rem;
		padding: 0 0.85rem;
	}

	.sn-file-choose-wrap.is-open::before {
		content: '';
		position: fixed;
		inset: 0;
		z-index: 70;
		background: rgba(15, 23, 42, 0.45);
	}

	.sn-file-choose-menu {
		position: fixed;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 80;
		width: 100%;
		max-width: none;
		padding: 0.65rem 0.85rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
		border-radius: 1.1rem 1.1rem 0 0;
		box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.28);
	}

	.sn-file-sheet-handle {
		display: block;
		width: 2.5rem;
		height: 0.28rem;
		margin: 0.1rem auto 0.55rem;
		border-radius: 999px;
		background: rgba(15, 23, 42, 0.18);
	}

	.sn-file-sheet-title {
		display: block;
		margin: 0 0 0.45rem;
		padding: 0 0.25rem;
		color: #64748b;
		font-size: 0.75rem;
		font-weight: 700;
		letter-spacing: 0.04em;
		text-transform: uppercase;
	}

	.sn-file-choose-menu__item {
		min-height: 3.1rem;
		padding: 0.75rem 0.85rem;
		font-size: 1rem;
		border-radius: 0.65rem;
		gap: 0.85rem;
	}

	.sn-file-choose-menu__brand {
		width: 1.5rem;
		height: 1.5rem;
	}
}
