/* Homepage workspace demo, shared by every language.
   Sizes, colours and fonts follow the SetFN Space client (SpaceShell, AppSwitcher,
   MainHeader, FilesSidebar, FileListing, ChatSidebar, ExportAdvancedModal).
   The app is laid out at a desktop width and scaled to the frame (see hero-demo-ui.js). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
	--demo-scale: 1;
	--font-sans: "Pretendard Variable", Pretendard, "Malgun Gothic", "Segoe UI", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", Roboto, "Helvetica Neue", sans-serif;

	--canvas: #f5f5f5;
	--surface: #ffffff;
	--surface-editor: #ffffff;
	--surface-raised: #ffffff;
	--divider: rgba(75, 85, 99, 0.09);
	--border-subtle: rgba(15, 23, 42, 0.08);
	--border: #e5e7eb;
	--row-line: rgba(0, 0, 0, 0.05);
	--text: #111827;
	--text-2: #374151;
	--text-primary: #6f6f6f;
	--text-secondary: #6b7280;
	--muted: #9ca3af;
	--accent: #3b82f6;
	--accent-400: #60a5fa;
	--selected-bg: rgba(59, 130, 246, 0.08);
	--hover-bg: rgba(0, 0, 0, 0.02);

	--switcher-icon: #656971;
	--switcher-hover: rgb(24 24 27 / 6%);
	--switcher-active-bg: #e7eefb;
	--switcher-active: #2f60cf;
	--switcher-divider: rgb(212 212 216 / 70%);

	--tree-selected-bg: #e8eef7;
	--tree-selected-text: #285c9f;
	--tree-hover: rgba(40, 92, 159, 0.05);
	--menu-badge-bg: rgb(229 231 235 / 70%);

	--dash: #d4d4d4;
	--tool-icon: #737373;
	--tool-label: #525252;

	--search-bg: #ffffff;
	--search-border: #e5e7eb;

	--icon-default: #374151;
	--icon-blue: #2196f3;
	--icon-red: #d94f5d;
	--icon-green: #8eb838;
	--icon-amber: #fbbf24;
	--file-document-icon: #cccccc;
	--file-sfn-document-icon: #71717a;

	--zinc-100: #f4f4f5;
	--zinc-200: #e4e4e7;
	--zinc-400: #a1a1aa;
	--zinc-500: #71717a;
	--zinc-700: #3f3f46;
	--zinc-800: #27272a;
	--zinc-900: #18181b;

	--modal-surface: #ffffff;
	--modal-border: #e5e7eb;
	--modal-scrim: rgba(0, 0, 0, 0.3);
	--seg-track: #f4f4f5;
	--seg-active: #ffffff;
	--chip-on-bg: #eff6ff;
	--chip-on-border: #60a5fa;
	--chip-on-text: #2563eb;
	--input-ring: #e4e4e7;
}

:root[lang="en"],
:root[lang="de"] {
	--font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", "Pretendard Variable", Pretendard, sans-serif;
}

/* Japanese and Chinese follow the client's locale stacks (main.scss), with macOS and Linux fallbacks. */
:root[lang="ja"] {
	--font-sans: "Yu Gothic UI", "Meiryo UI", Meiryo, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", "Pretendard Variable", Pretendard, sans-serif;
}

:root[lang="zh-CN"] {
	--font-sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", "Pretendard Variable", Pretendard, sans-serif;
}

:root[data-setfn-theme="dark"] {
	--canvas: #111419;
	--surface: #181c22;
	--surface-editor: #14171c;
	--surface-raised: #20252d;
	--divider: rgba(226, 232, 240, 0.08);
	--border-subtle: rgba(226, 232, 240, 0.08);
	--border: rgba(226, 232, 240, 0.12);
	--row-line: rgba(255, 255, 255, 0.05);
	--text: #e5e7eb;
	--text-2: #e5e7eb;
	--text-primary: rgba(248, 250, 252, 0.94);
	--text-secondary: rgba(203, 213, 225, 0.72);
	--muted: #6b7280;
	--selected-bg: rgba(59, 130, 246, 0.2);
	--hover-bg: rgba(148, 163, 184, 0.08);

	--switcher-icon: #a1a1aa;
	--switcher-hover: rgb(255 255 255 / 8%);
	--switcher-active-bg: rgb(96 165 250 / 14%);
	--switcher-active: #8ab4ff;
	--switcher-divider: #3f3f46;

	--tree-selected-bg: rgb(30 58 138 / 25%);
	--tree-selected-text: #60a5fa;
	--tree-hover: rgb(31 41 55 / 50%);
	--menu-badge-bg: rgb(0 0 0 / 10%);

	--dash: #525252;
	--tool-icon: #a3a3a3;
	--tool-label: #a3a3a3;

	--search-bg: #20252d;
	--search-border: rgba(226, 232, 240, 0.08);

	--icon-default: #a1a1aa;
	--icon-blue: #64b5f6;
	--icon-red: #ff6b7a;
	--icon-green: #aacc66;
	--icon-amber: #f59e0b;
	--file-document-icon: #8290a3;
	--file-sfn-document-icon: #94a3b8;

	--modal-surface: #181c22;
	--modal-border: rgba(0, 0, 0, 0.4);
	--seg-track: #27272a;
	--seg-active: #3f3f46;
	--chip-on-bg: rgb(30 58 138 / 20%);
	--chip-on-border: rgb(59 130 246 / 60%);
	--chip-on-text: #93c5fd;
	--input-ring: #3f3f46;
	color-scheme: dark;
}

html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
}

body {
	position: relative;
	font-family: var(--font-sans);
	font-size: 14px;
	line-height: 1.5;
	color: var(--text);
	background: var(--canvas);
	-webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

/* Inline Phosphor icons (hero-demo-ui.js fills each <i> with its SVG). */
i[class*="ph-"], i.ph {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 1em;
	height: 1em;
	font-style: normal;
	line-height: 1;
}
i[class*="ph-"] > svg, i.ph > svg { width: 100%; height: 100%; display: block; shape-rendering: geometricPrecision; }

/* ── App shell ─────────────────────────────────────────────── */
.app-container {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	width: calc(100% / var(--demo-scale));
	height: calc(100% / var(--demo-scale));
	overflow: hidden;
	background: var(--canvas);
	transform: scale(var(--demo-scale));
	transform-origin: 0 0;
}

/* AppSwitcher */
.app-switcher {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 56px;
	height: 100%;
	flex-shrink: 0;
	padding-bottom: 10px;
}
.switcher-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 46px;
	margin-bottom: 8px;
}
.switcher-logo img { width: 20px; height: 20px; display: block; }
.switcher-apps {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 0 8px;
}
.ibar-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 40px;
	border-radius: 8px;
	color: var(--switcher-icon);
	font-size: 24px;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}
.ibar-btn:not(.active):hover { background: var(--switcher-hover); }
.ibar-btn.active { background: var(--switcher-active-bg); color: var(--switcher-active); }
.ibar-btn.is-dim { opacity: 0.6; }
.ibar-divider { width: 20px; height: 1px; margin: 8px 0; background: var(--switcher-divider); flex-shrink: 0; }
.ibar-settings { width: calc(100% - 16px); margin-top: auto; }

/* Notification dot: red-400 with a soft ping, as on the product's pinned apps. */
.ibar-btn .iconbar-dot {
	position: absolute;
	border-radius: 0;
	background: none;
	top: 4px;
	right: 4px;
	width: 8px;
	height: 8px;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: none;
}
.ibar-btn .iconbar-dot::before,
.ibar-btn .iconbar-dot::after {
	content: "";
	position: absolute;
	inset: 1px;
	border-radius: 50%;
	background: #f87171;
}
.ibar-btn .iconbar-dot::before { inset: 0; opacity: 0.4; }
.ibar-btn .iconbar-dot.is-live { opacity: 1; transform: scale(1); }
.ibar-btn .iconbar-dot.is-live::before { animation: dotPing 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes dotPing { 75%, 100% { transform: scale(2); opacity: 0; } }

.main-wrapper {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	min-height: 0;
}

/* MainHeader */
.topbar {
	position: relative;
	z-index: 30;
	display: flex;
	align-items: center;
	height: 45px;
	flex-shrink: 0;
}
.topbar-logo {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 208px;
	height: 44px;
	padding-left: 8px;
	white-space: nowrap;
}
.logo-name { font-size: 16px; font-weight: 500; line-height: 1; color: var(--text); }
.logo-subtitle { margin: 0 4px; font-size: 14px; line-height: 1; color: var(--text); opacity: 0.7; }
.topbar-center { flex: 1 1 auto; min-width: 0; }
.search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 600px;
	height: 34px;
	margin: 1px auto 0;
	overflow: hidden;
	border: 1px solid var(--search-border);
	border-radius: 12px;
	background: var(--search-bg);
}
.search-mode {
	display: flex;
	align-items: center;
	align-self: stretch;
	padding: 0 6px;
}
.search-mode-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 28px;
	padding: 0 12px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	color: #475569;
	white-space: nowrap;
}
.search-mode-trigger i { font-size: 12px; color: #64748b; }
.search-divider { width: 1px; height: 20px; flex-shrink: 0; background: #e5e7eb; }
:root[data-setfn-theme="dark"] .search-divider { background: #374151; }
.search-input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0 112px 0 12px;
	border: 0;
	outline: 0;
	background: transparent;
	font-size: 14px;
	color: var(--text);
}
.search-input::placeholder { color: #9ca3af; }
.search-filter {
	position: absolute;
	top: 50%;
	right: 44px;
	display: flex;
	padding: 6px;
	margin: 0 4px;
	border-radius: 8px;
	color: #6b7280;
	font-size: 16px;
	transform: translateY(-50%);
}
.search-submit {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 0 16px;
	border-left: 1px solid #e5e7eb;
	background: #f1f5f9;
	color: #1e40af;
	font-size: 16px;
	opacity: 0.5;
}
:root[data-setfn-theme="dark"] .search-submit { border-left-color: #4b5563; background: #475569; color: #fff; }
.topbar-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	padding-right: 16px;
}
.icon-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 4px;
	color: var(--text);
	font-size: 19px;
	cursor: pointer;
	transition: background-color 0.2s;
}
.icon-btn:hover { background: rgb(191 219 254 / 50%); }
#btn-activity:hover { background: rgb(0 0 0 / 4%); }
.icon-btn.active i { color: var(--accent-400); }
.notif-badge {
	position: absolute;
	top: 9px;
	right: 10px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #f43f5e;
}
.avatar {
	position: relative;
	width: 32px;
	height: 32px;
	margin: 0 8px;
	margin-left: 20px;
	flex-shrink: 0;
	cursor: pointer;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-online {
	position: absolute;
	right: -2px;
	bottom: -2px;
	width: 11px;
	height: 11px;
	border: 2px solid var(--canvas);
	border-radius: 50%;
	background: #10b981;
}

/* SpaceShell body: border on the top and left with a rounded corner. */
.app-body {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
	overflow: hidden;
	border-top: 1px solid var(--divider);
	border-left: 1px solid var(--divider);
	border-top-left-radius: 15px;
}

/* ── File sidebar ──────────────────────────────────────────── */
/* Much narrower than the product's 300px: in the hero frame the tree only needs its labels, and
   the file list and the chat get the room. */
.sidebar {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 220px;
	flex-shrink: 0;
	border-right: 1px solid var(--divider);
}
.sidebar-create {
	position: relative;
	padding: 16px;
	border-bottom: 1px solid var(--divider);
	flex-shrink: 0;
}
.tree-new {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	max-width: 280px;
	height: 38px;
	padding: 0 16px;
	border-radius: 6px;
	background: rgb(59 130 246 / 85%);
	color: #fff;
	font-size: 14.4px;
	font-weight: 500;
	box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
	cursor: pointer;
	transition: background-color 0.15s;
}
.tree-new i { font-size: 20px; }
.tree-new:hover { background: #3b82f6; }
:root[data-setfn-theme="dark"] .tree-new { background: #3b82f6; }

/* The tree scrolls on its own with a thin bar; the frame is short enough that the last items
   (external share, trash) start below the fold. */
.sidebar-scroll {
	flex: 1 1 0;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 5px 5px 20px 0;
}
/* A thin bar that always shows (Chrome ignores ::-webkit-scrollbar once scrollbar-width is set, and
   may then hide the bar until hover), so the standard properties are for other browsers only. */
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { border-radius: 4px; background: rgb(148 163 184 / 55%); }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
@supports not selector(::-webkit-scrollbar) {
	.sidebar-scroll { scrollbar-width: thin; scrollbar-color: rgb(148 163 184 / 55%) transparent; }
}
.side-section { padding: 8px; }
.side-section + .side-section { border-top: 1px solid var(--divider); }
.menu-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 4px -12px 8px;
	padding: 0 12px;
}
.menu-title-left { display: flex; align-items: center; gap: 4px; }
.menu-title-btn { display: flex; padding: 4px; border-radius: 4px; color: var(--muted); font-size: 16px; }
.menu-title-text { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.menu-title-help { margin-left: 8px; font-size: 16px; color: var(--muted); }

.menu-list { font-size: 14px; }
.menu-list > * + * { margin-top: 2px; }

/* DirectoryTreeItem rows */
.tree-item {
	position: relative;
	display: flex;
	align-items: center;
	height: 36px;
	border-radius: 6px;
	color: var(--text);
	cursor: pointer;
}
.tree-item:not(.sel):hover { background: var(--tree-hover); }
.tree-item.sel { background: var(--tree-selected-bg); color: var(--tree-selected-text); }
.tree-children { margin-left: 8px; }
.tree-children > .tree-item { margin-left: 4px; }
.tree-children > * + * { margin-top: 0; }
.tree-caret {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 36px;
	flex-shrink: 0;
	color: var(--text-secondary);
	font-size: 14px;
}
.tree-inner {
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 0;
	gap: 4px;
	padding-right: 8px;
}
.tree-item.root .tree-inner { gap: 8px; }
.tree-inner > i { font-size: 20px; }
.tree-name {
	flex: 1;
	min-width: 0;
	margin-left: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tree-item.root .tree-name { margin-left: 0; }
.tree-item-ico-wrap { position: relative; display: inline-flex; font-size: 20px; }
.tree-red-dot {
	position: absolute;
	top: -1px;
	right: 2px;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: #ef4444;
	box-shadow: 0 0 0 1px rgb(255 255 255 / 70%);
}
:root[data-setfn-theme="dark"] .tree-red-dot { background: #fda4af; box-shadow: 0 0 0 1px rgb(15 23 42 / 80%); }
.tree-badge {
	flex-shrink: 0;
	font-size: 10px;
	font-weight: 500;
	line-height: 16px;
	font-variant-numeric: tabular-nums;
	color: var(--text-secondary);
}

/* CommonMenuItem rows (Team activity, Recent, Approvals …) */
.menu-item {
	display: flex;
	align-items: center;
	height: 36px;
	margin: 0 8px;
	padding-left: 4px;
	border-radius: 6px;
	color: var(--text);
	cursor: pointer;
	transition: background-color 0.2s;
}
.menu-item:hover { background: var(--tree-hover); }
.menu-item-label {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-width: 0;
	padding-left: 12px;
}
.menu-item-label > i { font-size: 20px; }
.menu-item-label > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 16px;
	margin-left: auto;
	margin-right: 5px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--menu-badge-bg);
	color: var(--text-secondary);
	font-size: 10px;
	font-weight: 500;
	line-height: 1;
	flex-shrink: 0;
}
.side-divider { margin: 4px -8px 2px; padding-top: 8px; border-bottom: 1px solid var(--divider); }

.sidebar-footer {
	flex-shrink: 0;
	min-height: 70px;
	padding: 8px 12px;
	border-top: 1px solid var(--divider);
}
.storage-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.storage-label {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
	white-space: nowrap;
}
.storage-label i { font-size: 12px; }
.storage-value { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.storage-bar { display: flex; height: 4px; margin: 4px 0; overflow: hidden; border-radius: 4px; background: rgba(221, 221, 221, 0.7); }
:root[data-setfn-theme="dark"] .storage-bar { background: rgba(85, 85, 85, 0.7); }
.storage-bar span { display: block; height: 100%; }
.storage-legend { display: flex; gap: 4px; margin-top: 3px; font-size: 10px; color: #9ca3af; white-space: nowrap; }
.storage-legend span { display: inline-flex; align-items: center; gap: 3px; }
.storage-legend b { font-weight: 400; color: #6b7280; }
:root[data-setfn-theme="dark"] .storage-legend b { color: #9ca3af; }
.storage-legend i.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }

/* ── Files area ────────────────────────────────────────────── */
.main {
	display: flex;
	flex-direction: column;
	flex: 1 1 0;
	min-width: 0;
	min-height: 0;
	padding: 10px 20px 0 24px;
}
.main-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 40px;
	margin-bottom: 4px;
	padding-top: 12px;
	flex-shrink: 0;
}
.breadcrumb {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
	margin-right: 4px;
	font-size: 20px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--text);
	white-space: nowrap;
}
.bc-item { padding: 0 6px; border-radius: 8px; cursor: pointer; }
.bc-item:hover { background: rgb(107 114 128 / 10%); }
.bc-sep { display: flex; align-items: center; width: 16px; height: 16px; color: #6b7280; flex-shrink: 0; }
.bc-sep svg { display: block; width: 100%; height: 100%; }
.bc-gear {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	color: var(--text);
	font-size: 20px;
	cursor: pointer;
}
.main-top-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.main-top-right span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	color: #737373;
	font-size: 19px;
	cursor: pointer;
}
.main-top-right span:last-child { font-size: 20px; }
:root[data-setfn-theme="dark"] .main-top-right span { color: #a3a3a3; }

.toolbar-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 64px;
	padding-right: 10px;
	flex-shrink: 0;
}
.toolbar-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
	margin: 4px 0;
	padding: 4px 6px;
}
.btn-tool {
	display: flex;
	align-items: center;
	height: 32px;
	padding: 0 14px;
	border: 1px dashed var(--dash);
	border-radius: 8px;
	background: transparent;
	color: var(--tool-label);
	font-size: 14px;
	white-space: nowrap;
	flex-shrink: 0;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn-tool i { font-size: 18px; color: var(--tool-icon); transition: color 0.15s; }
.btn-tool span { margin-left: 6px; }
.btn-tool--create { justify-content: center; gap: 8px; width: 112px; border-radius: 6px; }
.btn-tool--create span { margin-left: 0; }
.btn-tool--organize { padding: 0 16px; }
.btn-tool--organize span { margin-left: 8px; font-weight: 500; }
.btn-tool:hover,
.btn-tool.is-pressed { border-color: #60a5fa; background: #fff; color: #2563eb; box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
.btn-tool:hover i,
.btn-tool.is-pressed i { color: #60a5fa; }
:root[data-setfn-theme="dark"] .btn-tool:hover,
:root[data-setfn-theme="dark"] .btn-tool.is-pressed { background: #262626; color: #60a5fa; }

.filter-box {
	position: relative;
	display: flex;
	align-items: center;
	width: 200px;
	height: 34px;
	margin-right: 6px;
	padding-left: 40px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	color: var(--muted);
	font-size: 14px;
	flex-shrink: 0;
}
.filter-box i { position: absolute; left: 13px; font-size: 16px; color: var(--muted); }
/* Longer toolbar labels: the filter gives up width before it covers the buttons. */
:root[lang="ja"] .filter-box,
:root[lang="zh-CN"] .filter-box,
:root[lang="de"] .filter-box { flex-shrink: 1; min-width: 120px; margin-left: 12px; }

/* File list card */
.file-table {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 0 1 auto;
	min-height: 0;
	margin-bottom: 16px;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface-editor);
	box-shadow: 0 2px 8px -2px rgb(0 0 0 / 5%);
}
.list-hdr,
.frow {
	display: flex;
	align-items: center;
	height: 48px;
	padding-left: 4px;
	flex-shrink: 0;
	border-bottom: 1px solid var(--row-line);
}
.list-hdr { background: var(--surface); color: var(--text-primary); }
.file-list { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.frow {
	background: var(--surface-editor);
	color: var(--text-primary);
	cursor: pointer;
}
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--hover-bg); }
.frow.active-highlight { background: var(--selected-bg); }
.col-chk {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	flex-shrink: 0;
}
.col-chk i { font-size: 18px; color: var(--muted); }
.frow .col-chk i { opacity: 0; transition: opacity 0.15s; }
.frow:hover .col-chk i,
.frow.active-highlight .col-chk i { opacity: 1; }
.frow.active-highlight .col-chk i { color: var(--accent-400); }
.list-hdr .col-chk { width: 68px; }
.frow-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	flex-shrink: 0;
}
.frow-ico svg, .frow-ico i { display: block; }
.col-name {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: 1 1 0;
	min-width: 0;
	margin-left: 14px;
	padding-right: 10px;
}
.list-hdr .col-name { margin-left: 5px; }
.list-hdr .col-name i { font-size: 16px; }
.frow-name-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.col-size,
.col-modified,
.col-author {
	display: flex;
	align-items: center;
	padding-left: 10px;
	white-space: nowrap;
	flex-shrink: 0;
}
.frow .col-size,
.frow .col-modified,
.frow .col-author { font-size: 13px; color: var(--text-secondary); }
.col-size { width: 110px; }
.col-modified { width: 104px; }
.col-author { width: 128px; gap: 8px; overflow: hidden; }
:root[lang="de"] .col-modified { width: 132px; }
.author-name { overflow: hidden; text-overflow: ellipsis; }
.col-history { display: flex; align-items: center; justify-content: flex-end; width: 56px; padding-right: 4px; flex-shrink: 0; }
.frow-actions { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; color: var(--text-secondary); font-size: 18px; }
.frow-actions i { opacity: 0; }
.frow:hover .frow-actions i { opacity: 1; }
/* Narrow file area: the size column goes first, as in the product. */
@container sb-file-table (max-width: 760px) { .col-size { display: none; } }
.file-table { container-type: inline-size; container-name: sb-file-table; }

.author-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	color: #fff;
	font-size: 10px;
	font-weight: 500;
	flex-shrink: 0;
	overflow: hidden;
}
.history-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 22px;
	padding: 0 6px;
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: 6px;
	color: #334155;
	font-size: 11px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.history-pill i { font-size: 15px; }
:root[data-setfn-theme="dark"] .history-pill { color: #cbd5e1; border-color: rgba(71, 85, 105, 0.42); }
.badge-pill-v2 { padding: 1px 5px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }

.file-list.organizing .frow { animation: cleanupRow 0.45s ease both; }
.file-list.organizing .frow:nth-child(2n) { animation-delay: 0.06s; }
@keyframes cleanupRow { to { opacity: 0; transform: translateX(14px); } }

/* ── Team chat (ChatSidebar + realtime ChatMain) ───────────── */
.side-panel {
	position: relative;
	z-index: 20;
	display: flex;
	flex-direction: column;
	width: 380px;
	min-height: 0;
	flex-shrink: 0;
	border-left: 1px solid var(--border-subtle);
}
.panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 54px;
	padding: 8px 8px 8px 16px;
	border-bottom: 1px solid var(--border-subtle);
	flex-shrink: 0;
}
.panel-title { display: flex; align-items: center; gap: 12px; font-size: 18px; color: var(--text); white-space: nowrap; }
.panel-title i { font-size: 20px; }
.panel-head-actions { display: flex; align-items: center; gap: 8px; margin-right: 6px; }
.panel-btn { display: flex; padding: 8px; border-radius: 4px; color: var(--text-secondary); font-size: 21px; cursor: pointer; }
.panel-close { display: flex; color: var(--text-secondary); font-size: 26px; cursor: pointer; }
.chat-subhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 45px;
	padding: 0 12px 0 16px;
	border-bottom: 1px solid var(--border-subtle);
	flex-shrink: 0;
	color: var(--text-secondary);
}
.chat-tools { display: flex; align-items: center; gap: 4px; margin-left: -6px; }
.chat-tools span { display: flex; padding: 6px; border-radius: 6px; font-size: 17px; }
.chat-visitors { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.chat-visitors i { font-size: 16px; }
.panel-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
	min-height: 0;
	padding: 14px 13px;
	overflow-y: auto;
	background: var(--surface);
	scrollbar-width: none;
}
.panel-body::-webkit-scrollbar { display: none; }
.chat-input {
	display: flex;
	align-items: center;
	gap: 9px;
	min-height: 62px;
	padding: 12px 17px 12px 10px;
	border-top: 1px solid var(--border-subtle);
	flex-shrink: 0;
}
.btn-add-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border: 1px solid var(--border);
	border-radius: 50%;
	color: var(--muted);
	font-size: 18px;
}
.chat-input-inner {
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 0;
	min-height: 36px;
	padding: 7px 16px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--surface);
}
.chat-input-inner textarea {
	flex: 1;
	min-width: 0;
	height: 21px;
	max-height: 63px;
	border: 0;
	outline: 0;
	resize: none;
	overflow: hidden;
	background: transparent;
	font-size: 14px;
	line-height: 1.5;
	color: var(--text);
}
.chat-input-inner textarea::placeholder { color: #9ca3af; }
/* An empty box keeps the placeholder on one line, typed messages still wrap. */
.chat-input-inner textarea:placeholder-shown { white-space: nowrap; text-overflow: ellipsis; }
.chat-send { display: flex; margin-left: 7px; color: var(--muted); font-size: 18px; flex-shrink: 0; }

/* ChatContentMessage: avatar, name, level tag and time on one row; the message under the name. */
.msg { display: block; }
.msg-content { display: contents; }
.msg-hdr { display: flex; align-items: center; gap: 4px; min-width: 0; }
.msg-av {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-right: 9px;
	border-radius: 50%;
	color: #fff;
	font-size: 10px;
	font-weight: 500;
	flex-shrink: 0;
	overflow: hidden;
	float: left;
}
.msg > .msg-av { margin-top: 0; }
.msg-name { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.msg-name.is-me { font-weight: 600; }
:root[data-setfn-theme="dark"] .msg-name.is-me { color: #60a5fa; }
.msg-time { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg-bubble {
	clear: both;
	margin: 3px 0 0 29px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--text);
	word-break: keep-all;
	overflow-wrap: anywhere;
}
/* Japanese and Chinese wrap between characters (Japanese by phrase where supported);
   keep-all would break them only at spaces and punctuation. */
:root[lang="ja"] .msg-bubble { word-break: normal; word-break: auto-phrase; line-break: strict; }
:root[lang="zh-CN"] .msg-bubble { word-break: normal; line-break: strict; }
.msg-badge {
	display: inline-flex;
	align-items: center;
	margin-left: 4px;
	padding: 0 5px;
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--text-secondary);
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1.5;
	vertical-align: 1px;
}
.level-tag {
	flex-shrink: 0;
	padding: 1px 6px;
	border-radius: 6px;
	background: #f3f4f6;
	color: #374151;
	font-size: 10.5px;
	line-height: 1.4;
}
:root[data-setfn-theme="dark"] .level-tag { background: #374151; color: #d1d5db; }
.msg-ai-box {
	margin-top: 6px;
	padding: 9px 10px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--canvas);
	font-size: 13px;
	line-height: 1.6;
}
.msg-ai-box-title { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; font-size: 13px; font-weight: 600; }
.msg-ai-box-title i { font-size: 16px; }
.msg-ai-box-text { display: block; margin-left: 22px; color: var(--text-secondary); }
.mention, .mention-ai { padding: 0 4px; border-radius: 4px; background: #fefce8; color: #a16207; }
:root[data-setfn-theme="dark"] :is(.mention, .mention-ai) { background: rgb(133 77 14 / 30%); color: #fef9c3; }

.typing-indicator { display: flex; align-items: center; gap: 6px; }
.typing-av { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 500; flex-shrink: 0; }
.typing-body { display: flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--canvas); color: var(--text-secondary); font-size: 12px; }
.typing-name { margin-right: 2px; font-weight: 600; color: var(--text-2); }
.typing-dots { display: flex; align-items: center; gap: 2px; }
.typing-dots span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #94a3b8; animation: typingBounce 1.2s infinite both; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }
@keyframes slideInDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Inbox panel (docked in the chat slot) ─────────────────── */
.activity-popover { display: none; overflow: hidden; }
.activity-popover.open { display: flex; }
.notif-head { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.notif-head-title { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--text); }
.notif-head-title i { font-size: 20px; color: var(--accent-400); }
.notif-close { font-size: 22px; color: var(--text-secondary); cursor: pointer; }
.notif-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.notif-tab { display: flex; align-items: center; gap: 5px; padding: 6px 4px 10px; border-bottom: 2px solid transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.notif-tab.active { color: var(--text); border-bottom-color: var(--accent-400); }
.notif-tab-count { color: var(--accent-400); font-size: 11px; font-weight: 600; }
.notif-body { flex: 1; min-height: 0; padding: 10px 12px 14px; overflow-y: auto; background: var(--surface); scrollbar-width: thin; }
.notif-cat-list { display: flex; flex-direction: column; }
.notif-cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: 6px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.notif-cat-row:hover { background: var(--hover-bg); }
.notif-cat-row > i:first-child { font-size: 18px; color: var(--text-secondary); }
.notif-cat-row span:nth-child(2) { flex: 1; }
.notif-cat-badge { display: flex; align-items: center; justify-content: center; min-width: 18px; height: 16px; padding: 0 5px; border-radius: 999px; background: #fee2e2; color: #ef4444; font-size: 10px; font-weight: 600; }
.notif-cat-badge.zero { background: var(--menu-badge-bg); color: var(--muted); }
.notif-cat-arrow { font-size: 10px; color: var(--muted); }
.notif-recent-label { margin: 10px 4px 6px; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.notif-recent-list { display: flex; flex-direction: column; gap: 6px; }
.notif-recent-card { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--canvas); }
.notif-recent-from { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; font-size: 11px; color: var(--text-secondary); }
.notif-recent-time-badge { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; padding: 2px 6px; border-radius: 999px; background: var(--selected-bg); color: var(--accent); font-size: 10.5px; }
.notif-recent-title { margin-bottom: 3px; font-size: 13px; font-weight: 600; color: var(--text); }
.notif-recent-snippet { font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.notif-recent-date { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.notif-empty { display: none; flex-direction: column; align-items: center; gap: 8px; padding: 48px 12px; color: var(--muted); font-size: 13px; }
.notif-empty i { font-size: 26px; }

/* ── Create menu (FileCreateBtnMenu) ───────────────────────── */
.main-create-menu {
	position: absolute;
	z-index: 100;
	display: none;
	min-width: 200px;
	padding: 6px 4px;
	border: 1px solid var(--zinc-200);
	border-radius: 0 0 8px 8px;
	background: var(--surface-raised);
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -4px rgb(0 0 0 / 10%);
	text-align: left;
}
:root[data-setfn-theme="dark"] .main-create-menu { border-color: rgb(255 255 255 / 10%); background: #18181b; }
.main-create-menu.open { display: block; animation: slideInDown 0.15s ease; }
.main-create-menu li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	color: var(--zinc-700);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}
:root[data-setfn-theme="dark"] .main-create-menu li { color: #f4f4f5; }
.main-create-menu li:hover { background: var(--zinc-100); }
:root[data-setfn-theme="dark"] .main-create-menu li:hover { background: rgb(255 255 255 / 5%); }
.main-create-menu li > i { font-size: 20px; }
.main-create-menu .menu-divider { height: 1px; margin: 4px 0; background: rgb(9 9 11 / 10%); }
:root[data-setfn-theme="dark"] .main-create-menu .menu-divider { background: rgb(255 255 255 / 10%); }
.nested-submenu {
	position: absolute;
	top: -10px;
	left: calc(100% - 8px);
	z-index: 101;
	display: none;
	flex-direction: column;
	min-width: 480px;
	overflow: hidden;
	border: 1px solid var(--zinc-200);
	border-radius: 8px;
	background: var(--surface-raised);
	box-shadow: 0 25px 50px -12px rgb(0 0 0 / 25%);
	white-space: nowrap;
	animation: subMenuPop 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
:root[data-setfn-theme="dark"] .nested-submenu { border-color: var(--zinc-700); background: #18181b; }
.nested-submenu.open { display: flex; }
@keyframes subMenuPop { from { opacity: 0; transform: translateX(-4px) scale(0.98); } to { opacity: 1; transform: translateX(0) scale(1); } }
.sub-header { padding: 8px 16px; border-bottom: 1px solid rgb(9 9 11 / 5%); background: rgb(250 250 250 / 50%); color: var(--zinc-400); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
:root[data-setfn-theme="dark"] .sub-header { border-color: rgb(255 255 255 / 5%); background: rgb(255 255 255 / 5%); }
.sub-header small { margin-left: 2px; font-size: 8px; font-weight: 400; }
.template-menu-list { display: grid; grid-template-columns: repeat(2, 1fr); }
.tpl-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border-bottom: 1px solid rgb(9 9 11 / 5%); text-align: left; }
.tpl-item:hover, .func-item:hover { background: var(--zinc-100); }
:root[data-setfn-theme="dark"] :is(.tpl-item:hover, .func-item:hover) { background: rgb(255 255 255 / 5%); }
.tpl-icon { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; font-size: 18px; color: var(--text-secondary); }
.tpl-info { display: flex; flex-direction: column; overflow: hidden; text-align: left; }
.tpl-label { font-size: 13px; font-weight: 600; color: var(--text); }
.tpl-desc { font-size: 11px; color: var(--text-secondary); }
.func-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--border); }
.func-item { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 24px; cursor: pointer; }
.func-item > i { font-size: 20px; color: var(--text-secondary); }
.sub-close-btn { position: absolute; top: 8px; right: 12px; z-index: 10; display: flex; padding: 6px; border-radius: 50%; color: var(--zinc-400); font-size: 14px; }
.sub-close-btn:hover { background: var(--zinc-100); color: var(--zinc-700); }

/* Screen recorder strip */
.demo-recorder-container { display: none; align-items: center; justify-content: space-between; margin-top: 12px; padding: 10px 12px; border: 1px solid #f3e8ff; border-radius: 10px; background: #fdfafd; animation: slideInDown 0.2s ease; }
:root[data-setfn-theme="dark"] .demo-recorder-container { border-color: rgb(168 85 247 / 25%); background: rgb(168 85 247 / 8%); }
.demo-recorder-container.open { display: flex; }
.rec-start-btn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; background: #a855f7; color: #fff; font-size: 12px; font-weight: 600; }
.rec-start-btn i { font-size: 16px; }
.rec-start-btn.recording { background: #ef4444; animation: recPulse 1.5s infinite; }
@keyframes recPulse { 50% { opacity: 0.8; } }
.rec-close-btn { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: var(--muted); font-size: 12px; }

/* ── Mail compose window ───────────────────────────────────── */
.demo-mail-modal {
	position: absolute;
	bottom: 0;
	left: 316px;
	z-index: 500;
	display: none;
	flex-direction: column;
	width: 540px;
	height: 400px;
	overflow: hidden;
	border: 1px solid var(--border);
	border-bottom: 0;
	border-radius: 12px 12px 0 0;
	background: var(--surface);
	box-shadow: 0 -4px 30px rgb(15 23 42 / 12%);
	animation: mailModalFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.demo-mail-modal.open { display: flex; }
@keyframes mailModalFade { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.mail-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--canvas); user-select: none; }
.mail-header-left { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.mail-header-left i { font-size: 15px; color: var(--accent); }
.mail-header-actions { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 13px; }
.mail-header-actions i { cursor: pointer; }
.mail-header-actions .is-close { color: #ef4444; }
.mail-modal-body { display: flex; flex-direction: column; flex: 1; padding: 0 16px; overflow-y: auto; }
.mail-field { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--row-line); font-size: 14px; }
.field-label { width: 70px; color: var(--text-secondary); }
.field-value { color: var(--text-2); }
.mail-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--text); }
.mail-input::placeholder, .mail-textarea::placeholder { color: var(--muted); }
.mail-subject { font-weight: 600; }
.mail-field-cc { padding: 2px 6px; border-radius: 4px; color: var(--text-secondary); font-size: 12px; cursor: pointer; }
.mail-textarea { flex: 1; padding: 12px 0; border: 0; outline: 0; resize: none; background: transparent; font-size: 14px; line-height: 1.6; color: var(--text); }
.mail-modal-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--canvas); }
.footer-left, .footer-right { display: flex; align-items: center; gap: 12px; }
.footer-icon { font-size: 18px; color: var(--text-secondary); cursor: pointer; }
.tb-divider { width: 1px; height: 16px; background: var(--border); }
.mail-send-btn { padding: 7px 18px; border-radius: 4px; background: var(--accent-400); color: #fff; font-size: 13px; font-weight: 500; }
.mail-save-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; }
.mail-save-btn i { font-size: 15px; }
.mail-save-btn.saving { border-color: #bfdbfe; background: #eff6ff; color: var(--accent); }
:root[data-setfn-theme="dark"] .mail-save-btn.saving { border-color: rgb(59 130 246 / 40%); background: rgb(59 130 246 / 12%); color: #93c5fd; }

/* ── Modals (AiaModalContainer) ────────────────────────────── */
.batch-folder-overlay {
	position: absolute;
	inset: 0;
	z-index: 1100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	background: var(--modal-scrim);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease-out, visibility 0s linear 0.2s;
}
.batch-folder-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.2s ease-out; }
.aia-modal {
	display: flex;
	flex-direction: column;
	max-height: 100%;
	overflow: hidden;
	border: 1px solid var(--modal-border);
	border-radius: 8px;
	background: var(--modal-surface);
	color: var(--text);
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -4px rgb(0 0 0 / 10%);
	transform: scale(0.9);
	opacity: 0;
	transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.25s ease;
}
.batch-folder-overlay.show .aia-modal {
	transform: none;
	opacity: 1;
	transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}
.aia-modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 12px 20px 8px;
	border-bottom: 1px solid var(--modal-border);
	flex-shrink: 0;
}
:root:not([data-setfn-theme="dark"]) .aia-modal-head { border-bottom-color: #e5e7eb; }
:root[data-setfn-theme="dark"] .aia-modal-head { border-bottom-color: rgb(0 0 0 / 30%); }
.aia-modal-title { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 28px; line-height: 1.25; }
.aia-modal-title > span:first-child { font-size: 16px; font-weight: 700; color: var(--zinc-800); white-space: nowrap; }
:root[data-setfn-theme="dark"] .aia-modal-title > span:first-child { color: #f4f4f5; }
.aia-modal-close { display: flex; margin-top: 4px; color: var(--zinc-800); font-size: 20px; }
:root[data-setfn-theme="dark"] .aia-modal-close { color: #e5e7eb; }
.aia-modal-close:hover { color: var(--text-secondary); }
.aia-modal-body { padding: 24px 24px 4px; overflow: hidden; min-height: 0; }
.aia-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px 8px; flex-shrink: 0; }
.aia-modal-foot > * { margin: 0 4px; }

/* Batch folder and new file prompts */
.batch-folder-modal { width: 400px; }
.create-file-modal { width: 400px; }
.batch-folder-input {
	display: block;
	width: 100%;
	height: 132px;
	padding: 10px 12px;
	border: 0;
	border-radius: 6px;
	outline: 0;
	resize: none;
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--input-ring);
	font-size: 14px;
	line-height: 1.6;
	color: var(--text);
}
.batch-folder-input:focus, .create-file-field:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.create-file-field { display: flex; align-items: center; height: 38px; padding: 0 12px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--input-ring); }
.create-file-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--text); }
.aia-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	padding: 0 20px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.15s, opacity 0.15s;
}
.aia-btn-primary { background: var(--accent-400); color: #fff; }
.aia-btn-primary:hover { background: var(--accent); }
.aia-btn-primary:disabled,
.aia-btn-primary.is-busy { opacity: 0.65; filter: saturate(0.8) brightness(0.95); cursor: default; }
.aia-btn-secondary {
	height: 36px;
	padding: 0 20px;
	border: 1px solid var(--zinc-200);
	border-radius: 8px;
	background: var(--modal-surface);
	color: var(--zinc-500);
	font-weight: 500;
}
:root[data-setfn-theme="dark"] .aia-btn-secondary { border-color: #27272a; background: transparent; color: var(--zinc-400); }
.batch-folder-create:not(.active) { opacity: 0.65; }

/* ── Folder organize (ExportAdvancedModal + AiaModalSettingsLayout) ── */
/* The product modal is as wide as its content (md:w-max): 575px in Korean, 609px in English. */
.organize-modal { width: 575px; }
:root[lang="en"] .organize-modal { width: 609px; }
.om-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 180px;
	padding: 2px 8px;
	border: 1px solid var(--zinc-200);
	border-radius: 6px;
	background: var(--zinc-100);
	color: var(--zinc-500);
	font-size: 11px;
	line-height: 14px;
	white-space: nowrap;
	overflow: hidden;
}
:root[data-setfn-theme="dark"] .om-chip { border-color: var(--zinc-700); background: var(--zinc-800); color: var(--zinc-400); }
.om-chip i { font-size: 11px; }
.om-layout { display: flex; width: 100%; height: 420px; overflow: hidden; }
.om-tabs {
	width: 33.3333%;
	flex-shrink: 0;
	border-right: 1px solid var(--divider);
	border-bottom: 1px solid var(--divider);
	overflow: hidden;
}
:root:not([data-setfn-theme="dark"]) .om-tabs { border-color: #f1f5f9; }
.om-tab {
	margin: 0 20px 6px 0;
	padding: 6px 10px 6px 12px;
	border-radius: 6px;
	color: #6b7280;
	font-size: 13.5px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
}
.om-tab:hover { background: rgb(59 130 246 / 8%); color: var(--accent); }
.om-tab.selected { background: var(--accent-400); color: #fff; }
:root[data-setfn-theme="dark"] .om-tab { color: #8c97a8; }
:root[data-setfn-theme="dark"] .om-tab.selected { background: color-mix(in srgb, #60a5fa 18%, transparent); color: #bfdbfe; }
.om-content {
	flex: 1;
	min-width: 0;
	padding: 16px 16px 16px 24px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #e2e8f0 transparent;
}
:root[data-setfn-theme="dark"] .om-content { scrollbar-color: #3f3f46 transparent; }
.om-content > * + * { margin-top: 20px; }
.om-label { margin-bottom: 8px; font-size: 12px; font-weight: 700; line-height: 1; color: var(--zinc-900); }
:root[data-setfn-theme="dark"] .om-label { color: #f4f4f5; }
.om-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.om-label-row .om-label { margin-bottom: 0; }
.om-link { color: var(--accent); font-size: 11px; font-weight: 500; }
:root[data-setfn-theme="dark"] .om-link { color: #60a5fa; }
.segmented { display: flex; width: 100%; padding: 2px; border-radius: 8px; background: var(--seg-track); }
.seg-btn {
	flex: 1;
	min-width: 0;
	height: 32px;
	padding: 0 8px;
	border-radius: 6px;
	color: var(--zinc-500);
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.15s, background-color 0.15s;
}
:root[data-setfn-theme="dark"] .seg-btn { color: var(--zinc-400); }
.seg-btn.active { background: var(--seg-active); color: var(--zinc-900); font-weight: 500; box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
:root[data-setfn-theme="dark"] .seg-btn.active { color: #fafafa; }
.segmented-sm .seg-btn { height: 28px; font-size: 12px; }
.om-date-box { margin-top: 12px; padding: 12px; border: 1px solid var(--zinc-200); border-radius: 8px; }
:root[data-setfn-theme="dark"] .om-date-box { border-color: rgb(63 63 70 / 60%); }
.om-date-box > * + * { margin-top: 10px; }
.om-row { display: flex; align-items: center; gap: 12px; }
.om-row .segmented { flex: 1; }
.om-row-label { width: 56px; flex-shrink: 0; color: var(--zinc-500); font-size: 12px; }
:root[data-setfn-theme="dark"] .om-row-label { color: var(--zinc-400); }
.om-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.extension-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 28px;
	padding: 0 10px;
	border: 1px solid var(--zinc-200);
	border-radius: 999px;
	color: var(--zinc-400);
	font-size: 12px;
	transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.extension-chip.on { border-color: var(--chip-on-border); background: var(--chip-on-bg); color: var(--chip-on-text); }
.extension-chip-count { font-size: 11px; opacity: 0.7; }
.om-folders > * + * { margin-top: 6px; }
.om-folder { display: flex; align-items: center; gap: 8px; }
.om-folder > i { font-size: 16px; color: var(--zinc-400); }
.folder-name-input {
	flex: 1;
	min-width: 0;
	height: 32px;
	padding: 0 10px;
	border: 0;
	border-radius: 6px;
	outline: 0;
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--zinc-200);
	color: var(--zinc-800);
	font-size: 13px;
}
:root[data-setfn-theme="dark"] .folder-name-input { background: var(--zinc-900); box-shadow: inset 0 0 0 1px var(--zinc-700); color: #f4f4f5; }
.om-folder-count { min-width: 48px; flex-shrink: 0; color: var(--zinc-400); font-size: 12px; text-align: right; }
:root[data-setfn-theme="dark"] .om-folder-count { color: var(--zinc-500); }
.om-foot-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.om-summary { color: var(--zinc-500); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-setfn-theme="dark"] .om-summary { color: var(--zinc-400); }

/* ── Compact frames (tablet and phone) ─────────────────────── */
@media (max-width: 1000px) {
	.sidebar { display: none; }
}

@media (max-width: 900px) {
	.main { padding: 0 12px; }
	.main-top { padding-top: 8px; }
	.breadcrumb { font-size: 17px; }
	.toolbar-row { min-height: 52px; padding-right: 0; }
	.toolbar-actions { padding-left: 0; }
	.filter-box { display: none; }
	.side-panel {
		position: absolute;
		inset: 0;
		width: 100%;
		border-left: 0;
		background: var(--canvas);
	}
	.col-modified, .col-author { display: none; }
	.topbar-logo { display: none; }
	.topbar { padding-left: 10px; }
	.topbar-actions { padding-right: 8px; }
	.demo-mail-modal { left: 0; right: 0; width: 100%; border-radius: 0; }
	.mail-modal-footer { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 767px) {
	.organize-modal { width: 100%; }
	.organize-modal .aia-modal-body { display: flex; flex-direction: column; min-height: 0; padding: 0; }
	.om-layout { flex-direction: column; width: 100%; height: auto; min-height: 0; flex: 1; }
	.om-tabs {
		display: flex;
		width: 100%;
		overflow: hidden;
		border-right: 0;
		-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
		mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
	}
	.om-tab { flex-shrink: 0; margin: 0; padding: 10px 14px; border-radius: 0; border-bottom: 2px solid transparent; }
	.om-tab.selected, :root[data-setfn-theme="dark"] .om-tab.selected { background: transparent; color: var(--accent); border-bottom-color: var(--accent); }
	.om-content { padding: 16px; }
	.om-summary { display: none; }
	.batch-folder-modal, .create-file-modal { width: 100%; }
}

@media (max-width: 480px) {
	.app-switcher { display: none; }
	.app-body { border-left: 0; border-top-left-radius: 0; }
	.search-wrap { margin-left: 0; }
	.search-mode, .search-divider { display: none; }
	.search-input { padding-right: 52px; }
	.search-filter { display: none; }
	.avatar { margin-left: 8px; }
	.btn-tool span { display: none; }
	.btn-tool--create { width: auto; }
	.btn-tool { padding: 0 10px; }
	.main-top-right span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
