.sw-drawer-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.4rem 0.75rem 0.2rem;
}
.sw-drawer-toolbar-inline {
	margin: 0;
	padding-left: 0.35rem;
	align-items: center;
}

.sw-drawer-btn {
	border: 1px solid #c7dafd;
	background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
	color: #1d4da3;
	font-size: 0.79rem;
	font-weight: 700;
	padding: 0.34rem 0.72rem;
	border-radius: 999px;
	line-height: 1.2;
	min-width: 4.4rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.sw-drawer-btn-inline {
	min-width: 0;
	padding: 0.26rem 0.58rem;
	gap: 0.35rem;
	font-size: 0.76rem;
}
.sw-drawer-btn-inline i {
	font-size: 0.82rem;
	line-height: 1;
}

.sw-drawer-btn-badge {
	position: absolute;
	top: -0.28rem;
	right: -0.28rem;
	min-width: 1.05rem;
	height: 1.05rem;
	padding: 0 0.28rem;
	border-radius: 999px;
	background: #ef4444;
	color: #ffffff;
	border: 1px solid #ffffff;
	font-size: 0.61rem;
	font-weight: 800;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
	pointer-events: none;
}

.sw-drawer-btn:hover {
	background: #e6f0ff;
	border-color: #a6c5fa;
}

.sw-drawer-btn.is-active {
	background: #dcecff;
	border-color: #8eb5f7;
	color: #123b83;
}

.sw-drawer-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.sw-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(18, 34, 65, 0.32);
	backdrop-filter: blur(1px);
	z-index: 1035;
}

.sw-drawer-panel {
	position: fixed;
	top: 0;
	right: 0;
	height: 100vh;
	width: min(680px, calc(100vw - 0.9rem));
	background: #ffffff;
	border-left: 1px solid #d8e4fa;
	box-shadow: -16px 0 38px rgba(16, 39, 83, 0.22);
	transform: translateX(103%);
	opacity: 0;
	visibility: hidden;
	transition: transform 180ms ease, opacity 160ms ease;
	z-index: 1040;
	display: grid;
	grid-template-rows: auto 1fr;
}

.sw-drawer-panel.is-open {
	transform: translateX(0);
	opacity: 1;
	visibility: visible;
}

.sw-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	padding: 0.85rem 0.9rem;
	border-bottom: 1px solid #dbe7fd;
	background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
}

.sw-drawer-title {
	font-size: 0.92rem;
	font-weight: 700;
	color: #22395f;
}

.sw-drawer-subtitle {
	font-size: 0.77rem;
	color: #5f7598;
	margin-top: 0.2rem;
}

.sw-drawer-close,
.sw-drawer-fullscreen-btn {
	width: 1.95rem;
	height: 1.95rem;
	border-radius: 8px;
	border: 1px solid #cedefb;
	background: #edf4ff;
	color: #244e97;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.sw-drawer-header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.sw-drawer-close:hover,
.sw-drawer-fullscreen-btn:hover {
	background: #dfebff;
}

.sw-drawer-fullscreen-btn:disabled {
	cursor: not-allowed;
	opacity: 0.42;
}

.sw-drawer-body {
	padding: 0.9rem 0.95rem;
	overflow: auto;
	font-size: 0.9rem;
	color: #2a3f66;
}

.sw-markdown {
	color: #274266;
	font-size: 0.89rem;
	line-height: 1.6;
}

.sw-markdown pre {
	background: #f4f8ff;
	border: 1px solid #d7e4fb;
	padding: 0.74rem 0.78rem;
	border-radius: 10px;
	overflow: auto;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.sw-file-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0.52rem;
}

.sw-files-groups {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.sw-files-section {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.sw-files-section-title {
	font-size: 0.74rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #5f7598;
	padding: 0 0.12rem;
}

.sw-file-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: center;
	gap: 0.5rem;
	padding: 0;
	border-radius: 10px;
	border: 1px solid #d8e5fb;
	background: #f9fbff;
	overflow: hidden;
}

.sw-file-item-has-pin {
	grid-template-columns: minmax(0, 1fr) auto;
}

.sw-file-item-btn {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	min-height: 2.5rem;
	min-width: 0;
	border: 0;
	background: transparent;
	color: inherit;
	padding: 0.62rem 0.64rem;
	margin: 0;
	text-align: left;
	cursor: pointer;
	touch-action: manipulation;
	transition: background-color 120ms ease;
}

.sw-file-item-btn-image {
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.6rem;
}

.sw-file-thumb {
	width: 3.1rem;
	height: 2.3rem;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #cfe0fb;
	background: #eef4ff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.sw-file-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sw-file-item-btn:hover {
	background: rgba(255, 255, 255, 0.45);
}

.sw-file-item-btn:active {
	background: rgba(216, 231, 255, 0.55);
}

.sw-file-item:not(.sw-file-item-has-pin) .sw-file-item-btn {
	border-radius: 9px;
}

.sw-file-item.sw-file-item-has-pin .sw-file-item-btn {
	border-radius: 9px 0 0 9px;
}

.sw-file-item-btn:focus-visible {
	outline: 2px solid #89b3f7;
	outline-offset: -2px;
	border-radius: 9px;
}

.sw-file-item:focus-within {
	box-shadow: 0 0 0 2px rgba(99, 146, 228, 0.24);
}

.sw-file-item-main {
	min-width: 0;
}

.sw-file-item-top {
	display: flex;
	align-items: center;
	gap: 0.45rem;
}

.sw-file-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.08rem 0.34rem;
	border-radius: 999px;
	font-size: 0.64rem;
	font-weight: 800;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	background: #dbeafe;
	color: #1d4ed8;
	border: 1px solid #bfdbfe;
}

.sw-file-item-btn i {
	color: #1e57b3;
	font-size: 0.95rem;
}

.sw-file-shelf-pin-btn {
	align-self: center;
	justify-self: end;
	margin-right: 0.44rem;
	padding: 0.18rem 0.52rem;
	min-width: 2.75rem;
	height: 1.6rem;
	border-radius: 999px;
	border: 1px solid #b6caf0;
	background: linear-gradient(180deg, #ffffff 0%, #ecf3ff 100%);
	color: #2b559e;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	cursor: pointer;
	touch-action: manipulation;
	white-space: nowrap;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.sw-file-shelf-pin-btn:hover {
	background: #deebff;
	border-color: #92b1e7;
}

.sw-file-shelf-pin-btn:focus-visible {
	outline: 2px solid #89b3f7;
	outline-offset: 1px;
}

.sw-files-name {
	display: block;
	font-weight: 700;
	font-size: 0.83rem;
	color: #253f69;
}

.sw-files-meta {
	display: block;
	font-size: 0.75rem;
	color: #5b7092;
}

.sw-files-section.focus-plan .sw-file-item {
	border-color: #9cc2ff;
	background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
}

.sw-files-section.focus-plan .sw-file-item i {
	color: #1d4ed8;
}

.sw-files-section.focus-scratch .sw-file-item {
	border-color: #93d7c6;
	background: linear-gradient(180deg, #f6fffc 0%, #e9f9f3 100%);
}

.sw-files-section.focus-scratch .sw-file-item i {
	color: #0f766e;
}

.sw-files-section.focus-scratch .sw-file-badge {
	background: #ccfbf1;
	color: #115e59;
	border-color: #99f6e4;
}

.sw-files-section.tasks {
	padding: 0.5rem;
	border-radius: 12px;
	border: 1px solid #d9e1ef;
	background: #f8fafc;
}

.sw-files-section.tasks .sw-file-item {
	background: #ffffff;
	border-color: #d4deee;
}

.sw-files-section.images .sw-file-item {
	background: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
	border-color: #cfe0fb;
}

.sw-files-section.other .sw-file-item {
	background: #fbfcff;
}

@media (max-width: 768px) {
	.sw-drawer-toolbar {
		margin: 0.35rem 0.55rem 0.15rem;
	}

	.sw-file-item-btn {
		padding: 0.66rem 0.58rem;
		min-height: 2.65rem;
	}

	.sw-file-thumb {
		width: 2.8rem;
		height: 2.05rem;
	}

	.sw-file-shelf-pin-btn {
		margin-right: 0.36rem;
		padding: 0.18rem 0.48rem;
		min-width: 2.55rem;
		height: 1.52rem;
		font-size: 0.65rem;
	}
}
