:root { 
	--primary: #222; 
	--accent: #10a37f; 
	--accent-light: #eef9f5;
	--danger: #d32f2f;
	--bg: #f6f7f9;
	--border: #e7e7e7;
	--cloud: #007bff;
}
article.island {
	padding: 0;
	background-color: #000;
	border: unset;
	box-shadow: unset;
}
h1 {
	padding: 0 2.5rem;
}
.island_checklists {
	padding: 1rem
}
.global-acts {
	display: flex;
	width: 100%;
	justify-content: space-around;
	align-items: baseline;
}
.add-cat {
	padding: 5px 16px;
	border-radius: .5rem;
}
.wrap { 
	margin: 0 auto; 
	height: 100%; 
	max-height: 90vh;
	display: flex;
	gap: 1rem;
}

/* --- SIDEBAR LAYOUT --- */
.col-side {
	width: 25rem;
	display: flex;
	flex-direction: column;
	overflow: hidden; 
}
.side-header {
	padding: 12px;
	border-bottom: 1px solid var(--border-color);
	flex-shrink: 0;
}
.side-scroll { flex: 1; overflow-y: auto; padding: 10px; }

/* ОСТРОВ ШАБЛОНОВ */
.template-island {
	background: #fdfdfd;
	border-top: 1px solid var(--border);
	padding: 12px;
	flex-shrink: 0;
}
.island-title {
	font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
	color: #888; font-weight: 700; margin-bottom: 8px;
}
.island-grid {
	display: flex; flex-wrap: wrap; gap: 6px;
}
.island-btn {
	font-size: 12px; padding: 6px 10px; 
	background: #fff; border: 1px solid #ddd; border-radius: 6px;
	cursor: pointer; transition: all 0.2s;
	flex: 1 1 45%; 
	text-align: center;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.island-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.side-footer { 
	padding: 1rem .5rem .5rem;
	border-top: 1px solid var(--border-color);
	font-size: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 4.5rem;
}
.link-btn {
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	padding: 0;
	font-size: inherit;
	text-decoration: underline;
	width: auto;
	margin-bottom: unset;
	transition: color .3s;
}
.link-btn:hover {
	color: var(--primary-color);
	transition: color .3s;
}

/* --- MAIN LAYOUT --- */
.col-main {
	flex: 1; display: flex; flex-direction: column;
	overflow: hidden; position: relative;
}
.main-head {
	padding: 1rem;
	border-bottom: 1px solid var(--border-color);
	display: grid;
	gap: 2rem;
	grid-template-columns: repeat(1,1fr);
}
.main-title-input {
	font-size: 2.2rem;
	border-radius: .5rem;
	background-color: #121214;
	padding: .5rem 1rem;
	height: 3rem;
	border: none;
	outline: none;
	font-weight: 500;
	line-height: 1.2;
}
.main-title-input:focus {
	outline: none;
	background-color: #2a2a2e;
	border: unset;

}

.main-scroll { flex: 1; overflow-y: auto; padding: 0; scroll-behavior: auto !important; }

.main-footer {
	padding: 12px 16px;
	border-top: 1px solid var(--border-color);
	background: #121214;
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	height: 4.5rem;
}

/* Categories & Lists UI */
.cat-block {
	margin-bottom: 1rem;
	transition: background 0.3s;
	border-radius: 8px;

}
.cat-header {
	display: flex; 
	justify-content: space-between;
	align-items: center;
	padding: 6px 4px;
	font-size: 13px;
	font-weight: 700;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	user-select: none;
	transition: color 0.3s;
}
.cat-block.active .cat-header {
	color: #aeaeae;
}
.cat-header:hover .cat-tools {
	opacity: 1;
}
.cat-header:hover, .cat-header.collapsed {
	color: #8a8a8a;
}
.cat-title { display: flex; align-items: center; gap: 6px; cursor: pointer; flex: 1; }
.cat-tools { opacity: 0; transition: opacity 0.2s; display: flex; gap: 4px; }
.icon-btn-small {
	border: none; 
	background: transparent; 
	cursor: pointer; 
	opacity: 0.6; 
	padding: 4px; 
	border-radius: 4px;
	color: white;
}
.icon-btn-small:hover {
	opacity: 1
}

.cat-list-container { min-height: 10px; }
.cat-list-container.drag-over { background: #000; border: 2px dashed var(--accent); border-radius: 8px; }

.list-card {
	padding: .6rem;
	margin-bottom: .5rem;
	border-radius: .5rem;
	cursor: pointer;
	transition: background 0.3s, border-color 0.2s;
	border: 1px solid #1e1e22;
}
.list-card:hover, .list-card.active {
	border-color: var(--border-color);
	background-color: rgba(38, 38, 38, 0.3);
}
.list-card.dragging { border: 1px dashed #ccc; background: #48484b; }

.list-head-row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.progress-track { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.3s ease; }

/* Animation Highlight */
@keyframes highlight-pulse {
	0% { background-color: rgba(16, 163, 127, 0.0); transform: scale(1); }
	20% { background-color: rgba(16, 163, 127, 0.2); transform: scale(1.02); }
	100% { background-color: rgba(16, 163, 127, 0.0); transform: scale(1); }
}
.highlight-new { animation: highlight-pulse 1.5s ease-out forwards; }

/* Items */
.items-list { list-style: none; padding: 0; margin: 0; }

.item-complex {
	border-bottom: 1px solid var(--border-color);
}
.item-complex:hover {
	background: rgba(38, 38, 38, 0.3);
}
.item-complex:hover .drag-handle { opacity: 1; }
.item-complex:hover .item-tools { opacity: 1; }

.item-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 16px; 
}

.drag-handle { opacity: 0; cursor: grab; color: #bbb; padding-top: 3px; transition: opacity 0.2s; user-select: none; touch-action: none; }

.check-wrap {
	position: relative;
} 
.check-wrap:before {
	content: '';
	position: absolute;
	left: 0;
	top: .2rem;
	width: 2rem;
	height: 2rem;
	border: 2px solid #555;
	background-color: #1f1f1f;
	border-radius: 6px;
	transition: all 0.2s ease;
}
.item-content {
	flex: 1;
	min-width: 0;
	cursor: pointer;
	height: 100%;
	padding-left: 3rem;
	z-index: 1;
}
.item-main-line {
	display: flex;
	align-items: flex-start;
	gap: .4rem;
	height: 100%;
}
.item-text {
	position: relative;
	font-size: 1rem;
	line-height: 2.5rem;
	word-break: break-word;
	user-select: none;
	color: var(--subtitle-color);
}
.item-text.done {
	text-decoration: line-through;
	opacity: 0.5;
	color: #888;
}
.item-text.done:before {
	content: '';
	position: absolute;
	left: -3.1rem;
	top: 0.65rem;
	width: 16px;
	height: 12px;
	border: solid white;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
	border-color: #4caf50;
}

.desc-indicator {
	font-size: 1rem;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s;
	user-select: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	border-radius: 4px;
	color: white;
}
.desc-indicator:hover { 
	opacity: 1;
}

.item-desc-block {
	padding: 0 4rem .8rem 5.8rem;
	font-size: .8rem;  
	line-height: 1.5;
	white-space: pre-wrap;
}
.item-desc-block.done {
	color: #666;
}

.item-tools { display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.item-edit-input { width: 100%; padding: 6px; font-size: 15px; font-family: inherit; border: 1px solid #4a90e2; border-radius: 4px; outline: none; }

/* Components */
.btn {
	padding: 8px 12px; border: 1px solid #ddd; background: #fff;
	border-radius: 6px; font-size: 13px; cursor: pointer;
	display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: #f9f9f9; border-color: #ccc; }
.btn-primary {
	background: var(--primary);
	color: #fff;
	border-color: var(--primary);
	border-radius: .5rem;
}
.btn-primary:hover { background: #444; }
.btn-danger { color: #d32f2f; border-color: #ffcdd2; background: #ffebee; }
.btn-danger:hover { background: #ffcdd2; }
.btn-cloud { color: #007bff; border-color: #b8daff; background: #f0f8ff; }
.btn-cloud:hover { background: #e3f2fd; }

/* Toasts & Modals */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #333; color: #fff; padding: 12px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; opacity: 0.95; }
.toast.success { background: var(--accent); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 0.95; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(10px); } }

#modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px); }

.modal-title { font-size: 18px; font-weight: 700; }
.modal-text { font-size: 14px; color: #666; line-height: 1.5; }
.modal-input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; outline: none; display: none; }
.modal-textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; outline: none; display: none; resize: vertical; min-height: 80px; font-family: inherit; }
.modal-input:focus, .modal-textarea:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Share Modal Styles */
.share-link-box { display:flex; gap: 8px; margin-top: 10px; }
.share-link-input { flex: 1; padding: 8px; border: 1px solid #ddd; background: #f9f9f9; border-radius: 6px; font-family: monospace; font-size: 13px; color: #555; }

.empty-state { text-align: center; padding: 40px; color: #888; }

.add-cl {
	padding: 6px 10px;
	font-size: 12px;
	cursor: pointer;
	color: rgb(136, 136, 136);
	transition: color .3s;
}
.add-cl:hover {
	color: var(--primary-color);
	transition: color .3s;
}

.cat-block.dragging {
	opacity: 0.4;
	border: 2px dashed #ccc;
}
.island-pre-cl {
	margin-top: 2rem
}

.add-item-form {
	padding:16px;
	display:flex;
	gap:10px;
}
.global-act {
	padding: 5px 16px;
	border-radius: .5rem;
	max-width: max-content;
	margin: 0;
}
input.add-cl-item {
	flex:1;
	height: 3rem;
}
@media( max-width:991px ){
	.wrap {
		flex-direction: column;
		gap: 3rem;
		max-height: unset;
	}
	.col-side {
		width: 100%;
		height: 50vh;
		order: 2;
	}
	.col-main {
		height: 100vh;
	}
	.main-footer, .side-footer {
		height: auto
	}
}
@media( max-width:845px ){
	.main-footer, .global-acts, .island-grid {
		flex-direction: column;
	}
	.main-footer .btn-primary {
		width: 100%;
	}
	.island-grid {
		gap: 1rem
	}
	.global-acts {
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
		gap: 1rem;
	}
	.global-act {
		max-width: 100%;
		width: 100%
	}
}