:root {
	--bg: #f8fafd;
	--surface: #ffffff;
	--surface-soft: #f1f3f4;
	--ink: #202124;
	--muted: #5f6368;
	--line: #dadce0;
	--line-soft: #e8eaed;
	--blue: #1a73e8;
	--blue-soft: #d2e3fc;
	--green: #188038;
	--yellow: #f9ab00;
	--danger: #d93025;
	--shadow-soft: 0 1px 2px rgba(60, 64, 67, 0.14), 0 1px 3px rgba(60, 64, 67, 0.08);
	--shadow-lift: 0 8px 24px rgba(60, 64, 67, 0.16);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: "Google Sans", "Product Sans", "Segoe UI", sans-serif;
	color: var(--ink);
	background: #f7f9fc;
	overflow-y: auto;
}

body:has(#file-preview-modal:not([hidden])) {
	overflow: hidden;
}

h1,
h2,
h3 {
	margin: 0;
	font-weight: 500;
}

.muted {
	color: var(--muted);
}

.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	height: 64px;
	padding: 0 1rem;
	display: grid;
	grid-template-columns: auto minmax(220px, 680px) auto;
	align-items: center;
	gap: 1rem;
	background: var(--surface);
	border-bottom: 1px solid var(--line-soft);
	box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.brand-wrap {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
}

.brand-mark {
	width: 30px;
	height: 30px;
	color: #fff;
	z-index: 2;
	background: conic-gradient(#1a73e8 0 33%, #34a853 33% 66%, #fbbc04 66% 100%);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.52);
}

.brand {
	font-size: 1.32rem;
	letter-spacing: 0.01em;
}

.top-search {
	width: 100%;
}

.top-search input {
	width: 100%;
	height: 46px;
	border: 1px solid transparent;
	border-radius: 24px;
	padding: 0 1rem;
	background: #eef3fc;
	color: var(--ink);
	transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.top-search input:focus {
	outline: none;
	background: var(--surface);
	border-color: var(--blue-soft);
	box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.top-actions {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.45rem;
}

.container {
	max-width: 1400px;
	margin: 1rem auto 1.8rem;
	padding: 0 0.8rem;
}

.drive-layout {
	display: grid;
	grid-template-columns: 248px minmax(0, 1fr);
	gap: 1.15rem;
}

.drive-sidebar {
	position: sticky;
	top: 80px;
	align-self: start;
	display: grid;
	gap: 0.75rem;
}

.panel {
	background: var(--surface);
	border: 1px solid var(--line-soft);
	border-radius: 18px;
	padding: 0.95rem;
	box-shadow: 0 1px 1px rgba(60, 64, 67, 0.04);
}

.panel.narrow {
	max-width: 460px;
	margin: 2.4rem auto;
}

.drive-create {
	animation: rise-in 280ms ease-out;
}

.drive-create h2 {
	margin-bottom: 0.65rem;
	font-size: 1.08rem;
}

.drive-nav h3,
.storage-card h3 {
	margin-bottom: 0.55rem;
	font-size: 1rem;
}

.drive-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.45rem;
}

.drive-nav li {
	display: block;
}

.drive-nav-filter {
	width: 100%;
	display: inline-flex;
	align-items: center;
	gap: 0.48rem;
	border: none;
	border-radius: 999px;
	padding: 0.5rem 0.6rem;
	background: transparent;
	color: #3c4043;
	font-size: 0.95rem;
	text-align: left;
	cursor: pointer;
}

.drive-nav-filter:hover,
.drive-nav-filter.is-active {
	background: #e8f0fe;
	color: #174ea6;
}

.dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
}

.dot-blue {
	background: var(--blue);
}

.dot-green {
	background: var(--green);
}

.dot-yellow {
	background: var(--yellow);
}

.storage-card p {
	margin: 0 0 0.5rem;
	font-size: 0.9rem;
}

.storage-bar {
	height: 8px;
	border-radius: 999px;
	background: #e9eef6;
	overflow: hidden;
}

.storage-bar span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #4285f4, #1a73e8);
}

.drive-main {
	display: grid;
	gap: 0.9rem;
}

.drive-header-card {
	border-radius: 24px;
	background: #fff;
	animation: rise-in 320ms ease-out;
}

.drive-header-card h1 {
	font-size: 1.65rem;
}

.drive-header-card p {
	margin: 0.4rem 0 0.8rem;
}

.folder-breadcrumbs {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0 0 0.75rem;
	font-size: 0.88rem;
}

.folder-breadcrumbs a {
	color: #1967d2;
	text-decoration: none;
}

.folder-breadcrumbs a:hover {
	text-decoration: underline;
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(140px, 1fr));
	gap: 0.75rem;
}

.stat-card {
	background: #f8fbff;
	border: 1px solid #e5edf8;
	border-radius: 14px;
	padding: 0.75rem;
}

.stat-card h3 {
	color: var(--muted);
	font-size: 0.85rem;
	margin-bottom: 0.3rem;
	font-weight: 500;
}

.stat-card p {
	margin: 0;
	font-size: 1.18rem;
	font-weight: 600;
}

input,
button,
select {
	font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"] {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 0.58rem 0.65rem;
	background: var(--surface);
}

select {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 0.58rem 0.65rem;
	background: var(--surface);
}

input:focus,
select:focus {
	outline: none;
	border-color: #98bcf7;
	box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16);
}

.form-grid,
.settings-form {
	display: grid;
	gap: 0.55rem;
}

.folder-form {
	margin-bottom: 0.7rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--line-soft);
}

.upload-hint {
	font-size: 0.82rem;
	margin: 0;
}

.upload-queue {
	margin-top: 0.7rem;
	padding: 0.65rem;
	border: 1px solid var(--line-soft);
	border-radius: 12px;
	background: #fbfdff;
	display: grid;
	gap: 0.55rem;
}

.upload-queue-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.upload-queue-head h3 {
	margin: 0;
	font-size: 0.92rem;
}

.upload-queue-list {
	display: grid;
	gap: 0.45rem;
	max-height: 220px;
	overflow: auto;
	padding-right: 0.15rem;
}

.upload-queue-item {
	border: 1px solid #e5edf9;
	border-radius: 10px;
	padding: 0.45rem 0.5rem;
	background: #fff;
	display: grid;
	gap: 0.25rem;
}

.upload-queue-item-top {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	align-items: center;
}

.upload-queue-item-top strong {
	font-size: 0.82rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.upload-queue-status {
	font-size: 0.74rem;
	flex-shrink: 0;
}

.upload-queue-item[data-status="done"] .upload-queue-status {
	color: var(--green);
}

.upload-queue-item[data-status="failed"] .upload-queue-status {
	color: var(--danger);
}

.upload-queue-bar {
	height: 7px;
	border-radius: 999px;
	background: #edf1f7;
	overflow: hidden;
}

.upload-queue-bar span {
	display: block;
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, #5da2ff, #1a73e8);
	transition: width 120ms linear;
}

.upload-queue-detail {
	font-size: 0.72rem;
}

.two-factor-panel {
	margin-top: 1rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--line-soft);
	display: grid;
	gap: 0.55rem;
}

.two-factor-panel h3 {
	margin: 0;
	font-size: 1rem;
}

.two-factor-setup-grid {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 0.9rem;
	align-items: start;
}

.two-factor-qr {
	width: 220px;
	height: 220px;
	border-radius: 10px;
	border: 1px solid var(--line-soft);
	background: #fff;
	padding: 0.45rem;
}

.two-factor-secret-wrap {
	display: grid;
	gap: 0.45rem;
}

.folders-panel h2,
.files-panel h2 {
	margin-bottom: 0.75rem;
}

.files-header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.view-toggle {
	display: inline-flex;
	gap: 0.25rem;
	padding: 0.2rem;
	border: 1px solid var(--line-soft);
	border-radius: 999px;
	background: #f8fbff;
}

.view-toggle-btn {
	border: none;
	border-radius: 999px;
	padding: 0.38rem 0.75rem;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font-size: 0.84rem;
}

.view-toggle-btn.is-active {
	background: #dfeaff;
	color: #174ea6;
	font-weight: 600;
}

.quick-filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 0.65rem;
}

.filter-chip {
	border: 1px solid #d6e2f3;
	border-radius: 999px;
	background: #fff;
	color: #3c4043;
	cursor: pointer;
	padding: 0.42rem 0.72rem;
	font-size: 0.85rem;
}

.filter-chip:hover,
.filter-chip.is-active {
	background: #e8f0fe;
	border-color: #bfd3f6;
	color: #174ea6;
}

.files-header-row h2 {
	margin-bottom: 0;
}

.file-filter-toolbar {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) minmax(150px, 190px) auto;
	gap: 0.5rem;
	align-items: center;
	padding: 0.6rem;
	margin-bottom: 0.75rem;
	border: 1px solid #dce5f2;
	border-radius: 14px;
	background: #f8fbff;
}

.file-filter-toolbar input,
.file-filter-toolbar select {
	height: 40px;
}

.file-filter-empty {
	margin: 0.8rem 0 0;
	padding: 0.8rem;
	text-align: center;
	border: 1px dashed #c9d8ee;
	border-radius: 12px;
	background: #f8fbff;
}

.bulk-toolbar {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	flex-wrap: wrap;
	padding: 0.48rem 0.58rem;
	margin-bottom: 0.7rem;
	border: 1px solid #dce5f2;
	border-radius: 999px;
	background: #f8fbff;
}

.bulk-select-all {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	color: #3c4043;
	font-size: 0.85rem;
}

.folder-header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem;
	margin-bottom: 0.6rem;
}

.folder-menu-wrap {
	position: relative;
}

.folder-menu-wrap .kebab-btn {
	position: static;
}

.folder-menu {
	right: 0;
	left: auto;
	min-width: 220px;
}

.folder-inline-form {
	display: grid;
	gap: 0.3rem;
	padding: 0.2rem;
}

.folder-inline-form input {
	border: 1px solid #dfe3ea;
	border-radius: 8px;
	padding: 0.42rem 0.5rem;
	font-size: 0.83rem;
}

.folder-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 0.7rem;
}

.folder-card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.5rem;
	padding: 0.76rem 0.82rem;
	border-radius: 14px;
	background: #fff;
	border: 1px solid #e5e8ef;
	text-decoration: none;
	color: var(--ink);
	box-shadow: var(--shadow-soft);
	transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.folder-card-link {
	display: grid;
	grid-template-columns: 22px minmax(0, 1fr);
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.folder-card-menu-btn {
	position: static;
	flex-shrink: 0;
}

.folder-card.menu-open {
	z-index: 20;
}

.folder-card-menu {
	top: 2.7rem;
	right: 0.5rem;
}

.folder-card:hover {
	background: #f8fbff;
	box-shadow: var(--shadow-lift);
	transform: translateY(-1px);
}

.folder-icon {
	width: 20px;
	height: 15px;
	border-radius: 4px;
	background: linear-gradient(180deg, #f7c84a, #f4b400);
	position: relative;
}

.folder-icon::before {
	content: "";
	position: absolute;
	top: -4px;
	left: 2px;
	width: 10px;
	height: 5px;
	border-radius: 3px 3px 0 0;
	background: #f9d36b;
}

.folder-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.file-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 0.85rem;
}

.file-grid.file-grid-list {
	grid-template-columns: 1fr;
	gap: 0.42rem;
}

.file-grid.file-grid-compact:not(.file-grid-list) {
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.file-grid.file-grid-compact:not(.file-grid-list) .file-preview {
	height: 128px;
}

.file-grid.file-grid-list .file-card {
	grid-template-columns: 86px minmax(0, 1fr);
	align-items: stretch;
	min-height: 76px;
}

.file-grid.file-grid-list .file-preview {
	height: 76px;
	border-radius: 16px 0 0 16px;
}

.file-grid.file-grid-list .image-open {
	border-radius: 16px 0 0 16px;
}

.file-grid.file-grid-list .file-placeholder {
	min-width: 46px;
	padding: 0.42rem 0.5rem;
	font-size: 0.78rem;
}

.file-grid.file-grid-list .file-preview-label,
.file-grid.file-grid-list .image-open::after,
.file-grid.file-grid-list .file-placeholder-wrap::after {
	display: none;
}

.file-grid.file-grid-list .file-meta {
	align-self: center;
	padding-right: 3rem;
}

.file-grid.file-grid-list .file-menu {
	top: 0.6rem;
}

.file-card {
	position: relative;
	border: 1px solid #e2e7ef;
	border-radius: 16px;
	overflow: visible;
	background: #fff;
	display: grid;
	align-content: start;
	box-shadow: var(--shadow-soft);
	transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.file-card.menu-open,
.file-card:has(.file-menu.is-open) {
	z-index: 20;
}

.file-card:hover {
	border-color: #c9d8ee;
	box-shadow: var(--shadow-lift);
	transform: translateY(-2px);
}

.file-preview {
	position: relative;
	background: linear-gradient(180deg, #f8fbff 0%, #eef3fa 100%);
	height: 160px;
	display: grid;
	place-items: center;
	overflow: visible;
	border-radius: 16px 16px 0 0;
}

.select-chip {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 4;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid #d7dee8;
	display: grid;
	place-items: center;
	cursor: pointer;
}

.select-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.select-chip span {
	width: 10px;
	height: 10px;
	border-radius: 999px;
	background: transparent;
	transition: background-color 120ms ease;
}

.select-chip input:checked + span {
	background: #1a73e8;
}

.file-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.file-open {
	cursor: pointer;
}

.image-open,
.file-placeholder-wrap {
	width: 100%;
	height: 100%;
	border: none;
	background: transparent;
	display: grid;
	place-items: center;
	padding: 0;
	color: inherit;
}

.image-open {
	overflow: hidden;
	border-radius: 16px 16px 0 0;
}

.image-open::after,
.file-placeholder-wrap::after {
	content: "Preview";
	position: absolute;
	left: 50%;
	bottom: 0.8rem;
	transform: translateX(-50%) translateY(8px);
	opacity: 0;
	padding: 0.34rem 0.64rem;
	border-radius: 999px;
	background: rgba(32, 33, 36, 0.78);
	color: #fff;
	font-size: 0.78rem;
	transition: opacity 140ms ease, transform 140ms ease;
}

.file-preview:hover .image-open::after,
.file-preview:hover .file-placeholder-wrap::after {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.file-placeholder-wrap {
	gap: 0.45rem;
	align-content: center;
}

.file-placeholder {
	font-weight: 600;
	font-size: 1rem;
	color: #5f6368;
	min-width: 72px;
	text-align: center;
	padding: 0.62rem 0.78rem;
	border-radius: 12px;
	background: #e8eaed;
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}

.file-type-image,
.file-type-pdf {
	background: #fce8e6;
	color: #b3261e;
}

.file-type-video {
	background: #e8f0fe;
	color: #174ea6;
}

.file-type-audio {
	background: #e6f4ea;
	color: #137333;
}

.file-type-text,
.file-type-word {
	background: #fff7d6;
	color: #8a5c00;
}

.file-preview-label {
	color: var(--muted);
	font-size: 0.82rem;
	font-weight: 500;
}

.kebab-btn {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid #dfe4ea;
	background: rgba(255, 255, 255, 0.9);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}

.file-menu {
	position: absolute;
	top: 2.7rem;
	right: 0.5rem;
	width: min(310px, calc(100vw - 2rem));
	max-height: min(620px, 76vh);
	overflow-y: auto;
	padding: 0.42rem;
	border-radius: 14px;
	background: #fff;
	border: 1px solid #e1e6ed;
	box-shadow: 0 16px 34px rgba(60, 64, 67, 0.24);
	display: none;
	z-index: 5;
}

.file-menu.is-open {
	display: grid;
	gap: 0.32rem;
}

.file-menu-section {
	display: grid;
	gap: 0.25rem;
	padding: 0.25rem;
	border-bottom: 1px solid var(--line-soft);
}

.file-menu-section:last-child {
	border-bottom: none;
}

.file-menu-section strong {
	padding: 0.25rem 0.35rem 0.1rem;
	color: var(--muted);
	font-size: 0.76rem;
	font-weight: 600;
	text-transform: uppercase;
}

.file-menu a,
.file-menu button {
	width: 100%;
	text-align: left;
	padding: 0.52rem 0.58rem;
	background: transparent;
	border: none;
	border-radius: 8px;
	font-size: 0.85rem;
	text-decoration: none;
	color: #1f1f1f;
	cursor: pointer;
}

.file-menu label {
	padding: 0 0.35rem;
	color: var(--muted);
	font-size: 0.76rem;
}

.file-menu input[type="text"],
.file-menu input[type="password"],
.file-menu input[type="datetime-local"] {
	border-radius: 9px;
	padding: 0.42rem 0.5rem;
	font-size: 0.82rem;
}

.file-menu .menu-checkbox {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.2rem 0.35rem;
	color: var(--ink);
}

.file-menu .menu-checkbox input[type="checkbox"] {
	width: auto;
}

.file-menu a:hover,
.file-menu button:hover {
	background: #eef3fc;
}

.file-meta {
	padding: 0.65rem;
	display: grid;
	gap: 0.2rem;
}

.file-title-row {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	min-width: 0;
}

.file-title,
.file-sub {
	margin: 0;
}

.file-title {
	font-size: 0.92rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

button.file-title {
	width: 100%;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--ink);
	text-align: left;
	font-weight: 500;
}

button.file-title:hover {
	color: var(--blue);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.star-badge {
	flex-shrink: 0;
	border-radius: 999px;
	padding: 0.12rem 0.38rem;
	background: #fef7e0;
	color: #8a5c00;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
}

.file-sub {
	font-size: 0.79rem;
}

.file-shares {
	border-top: 1px solid var(--line-soft);
	padding: 0.55rem 0.65rem;
	display: grid;
	gap: 0.42rem;
}

.file-preview-modal {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.file-preview-modal[hidden] {
	display: none;
}

.preview-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(32, 33, 36, 0.62);
	backdrop-filter: blur(2px);
}

.preview-dialog {
	position: relative;
	z-index: 1;
	width: min(1120px, 96vw);
	height: min(780px, 92vh);
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	overflow: hidden;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.preview-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	padding: 0.75rem 0.9rem;
	border-bottom: 1px solid var(--line-soft);
	background: #fff;
}

.preview-header h2 {
	max-width: min(620px, 52vw);
	font-size: 1rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.preview-header p {
	margin: 0.18rem 0 0;
	font-size: 0.78rem;
}

.preview-actions {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	flex-shrink: 0;
}

.preview-close {
	width: 36px;
	height: 36px;
	border: 1px solid #dfe4ea;
	border-radius: 999px;
	background: #fff;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
}

.preview-close:hover {
	background: #f1f3f4;
}

.preview-body {
	position: relative;
	min-height: 0;
	display: grid;
	place-items: center;
	background: #f5f7fb;
	overflow: hidden;
	width: 100%;
	height: 100%;
}

.preview-mode-image,
.preview-mode-video,
.preview-mode-frame {
	/* allow scrolling when media is larger than the dialog */
	overflow: auto;
	width: 100%;
	height: 100%;
}

.preview-mode-text {
	overflow: auto;
	width: 100%;
	height: 100%;
}

.preview-mode-fallback,
.preview-mode-audio {
	padding: 1rem;
	overflow: hidden;
	width: 100%;
	height: 100%;
}

.preview-image-stage {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	/* allow the stage to scroll if image is larger than available space */
	overflow: auto;
	position: relative;
	background: radial-gradient(circle at center, #fbfcff, #eef2f9);
}

.preview-image {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	object-fit: contain;
	transform-origin: center center;
	transition: transform 120ms ease;
	cursor: zoom-in;
	user-select: none;
	pointer-events: auto;
}

.preview-image-controls {
	position: absolute;
	right: 0.9rem;
	bottom: 0.9rem;
	display: inline-flex;
	gap: 0.3rem;
	padding: 0.25rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid #dbe5f3;
	box-shadow: 0 8px 22px rgba(38, 53, 77, 0.2);
}

.preview-image-controls button {
	min-width: 36px;
	height: 36px;
	border: 1px solid #dbe1ec;
	border-radius: 999px;
	background: #fff;
	font-size: 0.86rem;
	font-weight: 600;
	cursor: pointer;
}

.preview-image-controls button:hover {
	background: #eef3fc;
}

.preview-video {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	object-fit: contain;
	background: #111;
}

.preview-audio {
	width: min(620px, 88vw);
	margin-top: 0.8rem;
}

.preview-frame {
	width: 100%;
	height: 100%;
	border: none;
	background: #fff;
}

.preview-text {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 1rem;
	overflow: auto;
	background: #fff;
	color: #202124;
	font: 0.9rem/1.45 Consolas, "Courier New", monospace;
	white-space: pre-wrap;
}

.preview-note {
	position: absolute;
	left: 1rem;
	bottom: 1rem;
	margin: 0;
	padding: 0.35rem 0.55rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	font-size: 0.78rem;
	box-shadow: 0 2px 8px rgba(60, 64, 67, 0.18);
}

.preview-fallback {
	max-width: 420px;
	padding: 1rem;
	display: grid;
	place-items: center;
	gap: 0.55rem;
	text-align: center;
}

.preview-fallback h3,
.preview-fallback p {
	margin: 0;
}

.share-mini {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.inline-form {
	display: inline-flex;
	align-items: center;
	gap: 0.42rem;
	flex-wrap: wrap;
}

.btn {
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 0.5rem 0.92rem;
	background: var(--blue);
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	display: inline-block;
	font-weight: 500;
	transition: box-shadow 120ms ease, transform 120ms ease, background-color 120ms ease;
}

.btn:hover {
	background: #1765cc;
	transform: translateY(-1px);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
	opacity: 0.48;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-secondary {
	background: #1967d2;
}

.btn-danger {
	background: var(--danger);
}

.btn-ghost {
	background: #edf3fe;
	color: #1a73e8;
	border: 1px solid #c8daf8;
}

.btn-ghost:hover {
	background: #dce9fc;
	box-shadow: none;
}

.btn-small {
	padding: 0.36rem 0.72rem;
	font-size: 0.82rem;
}

.flash {
	max-width: 1400px;
	margin: 0.72rem auto 0;
	border-radius: 10px;
	padding: 0.72rem 0.94rem;
	border: 1px solid transparent;
}

.flash-success {
	background: #e6f4ea;
	border-color: #9ad0a5;
}

.flash-error {
	background: #fce8e6;
	border-color: #eab2af;
}

.flash-warning {
	background: #fef7e0;
	border-color: #f0d588;
}

.files-panel h2,
.backups-panel h2 {
	margin-bottom: 0.55rem;
}

.data-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin-top: 0.2rem;
	border: 1px solid var(--line-soft);
	border-radius: 12px;
	overflow: hidden;
}

.data-table th,
.data-table td {
	border-bottom: 1px solid var(--line-soft);
	padding: 0.58rem;
	vertical-align: top;
	text-align: left;
}

.data-table th {
	font-size: 0.82rem;
	color: var(--muted);
	font-weight: 500;
	background: #f8f9fa;
}

.data-table tbody tr:hover {
	background: #f8fbff;
}

.data-table tbody tr:last-child td {
	border-bottom: none;
}

.share-form {
	margin-bottom: 0.45rem;
	padding: 0.45rem;
	border-radius: 10px;
	background: #f8fafd;
	border: 1px solid #ebf1f7;
}

.share-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.4rem;
}

.share-list li {
	display: flex;
	gap: 0.45rem;
	align-items: center;
	flex-wrap: wrap;
	padding: 0.42rem 0.48rem;
	background: #f7faff;
	border: 1px dashed #bfd5f7;
	border-radius: 10px;
}

.mono {
	font-family: "Consolas", monospace;
	font-size: 0.82rem;
	padding: 0.16rem 0.32rem;
	background: #edf3ff;
	border-radius: 6px;
	color: #174ea6;
	text-decoration: none;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.mono:hover {
	text-decoration: underline;
}

.error-box {
	background: #1f1f1f;
	color: #f3f3f3;
	padding: 0.72rem;
	border-radius: 10px;
	overflow: auto;
}

.shared-page {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.shared-card {
	width: 100%;
	max-width: 620px;
	background: var(--surface);
	border: 1px solid var(--line-soft);
	border-radius: 18px;
	padding: 1.1rem;
	box-shadow: var(--shadow-lift);
}

.shared-folder-card {
	max-width: 820px;
}

.shared-preview {
	margin: 0.7rem 0;
	border: 1px solid var(--line-soft);
	border-radius: 10px;
	overflow: hidden;
	background: #f4f7fb;
}

.shared-preview img {
	width: 100%;
	max-height: 360px;
	object-fit: contain;
	display: block;
}

@keyframes rise-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 1080px) {
	.topbar {
		grid-template-columns: auto minmax(180px, 1fr) auto;
	}

	.drive-layout {
		grid-template-columns: 220px minmax(0, 1fr);
	}
}

@media (max-width: 860px) {
	.topbar {
		height: auto;
		grid-template-columns: 1fr;
		gap: 0.6rem;
		padding: 0.75rem;
	}

	.top-actions {
		justify-content: flex-start;
		flex-wrap: wrap;
	}

	.container {
		margin-top: 0.7rem;
		padding: 0 0.65rem;
	}

	.drive-layout {
		grid-template-columns: 1fr;
	}

	.drive-sidebar {
		position: static;
	}

	.settings-layout {
		grid-template-columns: 1fr;
	}

	.settings-sidebar {
		position: static;
	}

	.settings-hero,
	.settings-section-head {
		display: grid;
	}

	.settings-usage {
		min-width: 0;
	}

	.settings-grid-form {
		grid-template-columns: 1fr;
	}

	.settings-grid-form .btn,
	.settings-grid-form button {
		grid-column: 1;
		width: 100%;
	}

	.settings-stats-grid,
	.security-chip-grid {
		grid-template-columns: 1fr;
	}

	.session-card {
		display: grid;
	}

	.stats-grid {
		grid-template-columns: 1fr;
	}

	.file-grid {
		grid-template-columns: 1fr;
	}

	.files-header-row,
	.file-filter-toolbar {
		grid-template-columns: 1fr;
	}

	.files-header-row {
		display: grid;
	}

	.inline-form {
		display: grid;
		width: 100%;
	}

	.btn,
	.btn-small {
		width: 100%;
		text-align: center;
	}

	.preview-dialog {
		width: 96vw;
		height: 90vh;
		border-radius: 14px;
	}

	.preview-header {
		align-items: stretch;
		display: grid;
	}

	.preview-header h2 {
		max-width: 100%;
	}

	.preview-actions {
		display: grid;
		grid-template-columns: 1fr 1fr 40px;
	}

	.preview-close {
		width: 40px;
		height: 40px;
	}

	.two-factor-setup-grid {
		grid-template-columns: 1fr;
	}

	.two-factor-qr {
		width: min(220px, 100%);
		height: auto;
	}
}

@media (max-width: 560px) {
	.brand {
		font-size: 1.1rem;
	}

	.panel {
		padding: 0.75rem;
		border-radius: 14px;
	}

	.file-menu {
		width: calc(100vw - 1.1rem);
		right: -0.4rem;
	}

	.preview-dialog {
		width: 100vw;
		height: 100vh;
		border-radius: 0;
	}

	.preview-actions {
		grid-template-columns: 1fr;
	}

	.preview-image-controls {
		right: 0.6rem;
		bottom: 0.6rem;
	}
}

.shared-password-form {
	margin-top: 0.9rem;
}

.shared-error {
	margin: 0;
	border-radius: 10px;
	padding: 0.6rem 0.7rem;
}

.shared-file-list {
	display: grid;
	gap: 0.55rem;
	margin-top: 0.9rem;
}

.shared-file-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	padding: 0.75rem;
	border: 1px solid var(--line-soft);
	border-radius: 12px;
	background: #fff;
}

.shared-file-row p {
	margin: 0.18rem 0 0;
	font-size: 0.82rem;
}

.shared-actions {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	flex-wrap: wrap;
}

.settings-layout {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
}

.settings-sidebar {
	position: sticky;
	top: 80px;
	display: grid;
	gap: 0.8rem;
}

.settings-sidebar h2 {
	font-size: 1.2rem;
}

.settings-nav {
	display: grid;
	gap: 0.2rem;
}

.settings-nav a {
	padding: 0.52rem 0.65rem;
	border-radius: 999px;
	color: #3c4043;
	text-decoration: none;
}

.settings-nav a:hover {
	background: #e8f0fe;
	color: #174ea6;
}

.settings-main {
	display: grid;
	gap: 0.9rem;
}

.settings-hero {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	align-items: center;
	border-radius: 24px;
}

.settings-hero h1 {
	margin: 0.15rem 0 0.35rem;
	font-size: 1.8rem;
}

.settings-hero p {
	margin: 0;
}

.settings-usage {
	min-width: 240px;
	display: grid;
	gap: 0.35rem;
	padding: 0.8rem;
	border: 1px solid #e5edf8;
	border-radius: 16px;
	background: #f8fbff;
}

.settings-section {
	display: grid;
	gap: 0.8rem;
	scroll-margin-top: 90px;
}

.settings-section-head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	align-items: start;
}

.settings-section-head p {
	margin: 0;
	max-width: 540px;
}

.settings-grid-form {
	display: grid;
	grid-template-columns: minmax(150px, 220px) minmax(240px, 1fr);
	gap: 0.65rem 0.8rem;
	align-items: center;
	max-width: 780px;
}

.settings-grid-form .btn,
.settings-grid-form button {
	grid-column: 2;
	justify-self: start;
}

.settings-checkbox {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.settings-checkbox input[type="checkbox"] {
	width: auto;
}

.settings-note {
	margin: 0;
	font-size: 0.84rem;
}

.settings-inline-action {
	margin-top: 0.2rem;
}

.settings-table-wrap {
	overflow-x: auto;
}

.settings-stats-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(140px, 1fr));
	gap: 0.75rem;
}

.security-chip-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(150px, 1fr));
	gap: 0.65rem;
	max-width: 900px;
}

.security-chip {
	padding: 0.72rem;
	border: 1px solid #e2e9f4;
	border-radius: 12px;
	background: #f8fbff;
}

.security-chip strong {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
}

.security-chip p {
	margin: 0;
}

.session-list {
	display: grid;
	gap: 0.6rem;
}

.session-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem;
	border: 1px solid #e1e8f2;
	border-radius: 12px;
	background: #fff;
}

.session-card h3 {
	margin-bottom: 0.22rem;
	font-size: 0.95rem;
}

.session-card p {
	margin: 0.14rem 0;
	font-size: 0.82rem;
}

.session-current-tag {
	display: inline-flex;
	align-items: center;
	height: 32px;
	padding: 0 0.62rem;
	border-radius: 999px;
	background: #e6f4ea;
	color: #137333;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
}
