/* MarkPad — уютная пастельная тема. Токены — из docs/brand/logo/BRAND.md. */

@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('/static/fonts/nunito-vf-cyrillic.woff2') format('woff2');
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('/static/fonts/nunito-vf-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--accent: #EE8B7E;
	--accent-strong: #E27B6E;
	--accent-deep: #B85C50;
	--ribbon: #FFF6F0;
	--bg: #FBF4EE;
	--surface: #FFFFFF;
	--blush: #FBEAE3;
	--ink: #4B3B36;
	--muted: #9A857D;
	--border: #F0DED4;
	--sage: #A8C3A0;
	--butter: #F2D98D;
	--sky: #A9C7DE;
	--lilac: #CBB3DE;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	background: var(--bg);
	color: var(--ink);
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: 18px;
	line-height: 1.6;
	min-height: 100vh;
}

/* Шапка */
.header {
	position: sticky;
	top: 0;
	z-index: 100; /* topbar над сайдбаром; drawer — ещё выше (120) */
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 24px;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

.header .logo {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 800;
	font-size: 19px;
	color: var(--ink);
	text-decoration: none;
}

.header .logo svg {
	width: 30px;
	height: 30px;
	border-radius: 8px;
	display: block;
}

.header .spacer {
	flex: 1;
}

/* Пользователь в шапке */
.userchip {
	display: flex;
	align-items: center;
	gap: 10px;
}

.userchip img {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: block;
}

.userchip .name {
	font-weight: 700;
}

/* Кнопки */
.btn {
	display: inline-block;
	border: none;
	border-radius: 999px;
	padding: 11px 22px;
	font: inherit;
	font-weight: 700;
	color: #FFFFFF;
	background: var(--accent);
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(238, 139, 126, .35);
}

.btn:hover {
	background: var(--accent-strong);
}

.btn-subtle {
	background: var(--surface);
	color: var(--muted);
	border: 1px solid var(--border);
	box-shadow: none;
}

.btn-subtle:hover {
	background: var(--blush);
	color: var(--accent-deep);
}

/* Карточки */
.stack {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 18px;
	padding: 28px;
	box-shadow: 0 6px 18px rgba(75, 59, 54, .06);
}

/* Секции внутри карточки (пространства, настройки) */
.card .card-section:not(:first-child) {
	margin-top: 22px;
}

.card .meta-row {
	margin-top: 12px;
}

.card .muted {
	line-height: 1.6;
}

/* Центрированный экран входа */
main {
	padding: 28px 24px 48px;
}

.login-screen {
	min-height: calc(100vh - 63px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.login-screen .card {
	max-width: 420px;
	width: 100%;
	text-align: center;
}

.login-screen h1 {
	font-size: 22px;
	margin-bottom: 8px;
}

.login-screen p {
	color: var(--muted);
	margin-bottom: 20px;
}

/* Страница ошибки входа */
.error-page {
	color: var(--accent-deep);
	font-weight: 700;
	margin-bottom: 16px;
}

/* Профиль */
.profile-grid {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 10px 18px;
	text-align: left;
	margin-top: 16px;
}

.profile-grid dt {
	color: var(--muted);
	font-weight: 600;
}

.profile-grid dd {
	font-weight: 700;
	overflow-wrap: anywhere;
}

.profile-avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	display: block;
	margin: 0 auto 16px;
}

.muted {
	color: var(--muted);
}

form {
	margin-top: 16px;
}

/* Ядро: списки, сайдбар, запись */
.layout {
	display: block;
	min-height: 0;
}

/* Сайдбар на мобильных — выезжающий drawer */
.sidebar {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	width: min(320px, 86vw);
	background: var(--surface);
	z-index: 120; /* открытый drawer накрывает topbar */
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 14px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	transform: translateX(-105%);
	transition: transform 0.25s ease;
	box-shadow: 0 0 30px rgb(0 0 0 / 18%);
}

.sidebar.drawer-open {
	transform: none;
}

.drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgb(30 20 15 / 40%);
	z-index: 110;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.drawer-backdrop.show {
	opacity: 1;
	pointer-events: auto;
}

.drawer-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--ink);
	cursor: pointer;
	flex: 0 0 auto;
}

.drawer-close {
	align-self: flex-end;
	width: 32px;
	height: 32px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--muted);
	cursor: pointer;
	margin-bottom: 6px;
}

.sidebar-footer {
	margin-top: auto;
	padding-top: 12px;
}

.collection-create input[type="text"] {
	flex: 1;
	min-width: 0;
	padding: 7px 10px;
	font: inherit;
	font-size: 13px;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
}

.collection-create input[type="text"]::placeholder {
	color: var(--muted);
}

.collection-create input[type="text"]:focus {
	outline: none;
	border-color: var(--accent);
}

.collection-create select {
	font: inherit;
	font-size: 12px;
	color: var(--ink);
	text-transform: none;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 7px 4px;
}

.collection-create button {
	width: 34px;
	padding: 0;
	font-size: 16px;
	line-height: 1;
	border-radius: 10px;
	flex: none;
}

.collections-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.filter-group .collections-nav {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.nav-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 10px;
	color: var(--ink);
	text-decoration: none;
}

.nav-item:hover {
	background: var(--blush);
}

.nav-item.active {
	background: var(--blush);
	color: var(--accent-deep);
	font-weight: 700;
}

.nav-item.nested {
	margin-left: 14px;
}

.nav-title {
	margin: 14px 10px 4px;
	font-size: 11px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 800;
}

.count {
	color: var(--muted);
	font-size: 12px;
}

/* Центральная колонка: резина, но не шире 1280px */
.content {
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 28px;
}

.list-toolbar {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.chip {
	border: 1px solid var(--border);
	background: var(--surface);
	border-radius: 999px;
	padding: 7px 16px;
	font-weight: 600;
	font-size: 14px;
	color: var(--muted);
	text-decoration: none;
}

.chip.on {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.entries {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.entry-card {
	display: flex;
	gap: 10px;
	align-items: center;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 12px 14px;
}

.entry-cover {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	object-fit: cover;
}

.entry-space {
	font-weight: 700;
	color: var(--accent);
	text-decoration: none;
	margin-right: 6px;
}

.entry-space:hover {
	text-decoration: underline;
}

.entry-space-sep {
	color: var(--muted);
	margin-right: 6px;
}

.entry-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;
}

.badge {
	font-size: 12px;
	padding: 3px 9px;
	border-radius: 999px;
	font-weight: 700;
}

.badge-private {
	background: var(--blush);
	color: var(--accent-deep);
}

.badge-reg {
	background: var(--sky);
	color: #33546B;
}

.badge-public {
	background: var(--sage);
	color: #3E5638;
}

.tag {
	background: var(--butter);
	color: #6B5416;
	font-size: 11.5px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 999px;
}

.tags {
	display: flex;
	gap: 6px;
	margin-top: 10px;
	flex-wrap: wrap;
}

/* Шапка записи: заголовок слева, бейджи и действия справа */
.entry-top {
	display: flex;
	align-items: center;
	gap: 14px;
	row-gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.page-title {
	font-size: 28px;
	font-weight: 700;
	color: var(--muted);
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.entry-top .entry-head {
	margin-bottom: 0;
}

.entry-full {
	width: 100%;
	margin-bottom: 12px;
}

.entry-cover-full {
	width: 100%;
	border-radius: 12px;
	display: block;
	margin-bottom: 14px;
}

.entry-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 10px;
	margin: 12px 0;
}

.gallery-item img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}

.attachments {
	margin: 8px 0;
	list-style: none;
}

.empty-state {
	text-align: center;
	color: var(--muted);
	padding: 48px;
}

.notice {
	margin-bottom: 16px;
}

.quote {
	border-left: 4px solid var(--accent);
	padding: 8px 14px;
	background: var(--blush);
	border-radius: 10px;
	margin: 12px 0;
}

.muted {
	color: var(--muted);
}

form.inline {
	display: inline;
	margin-left: 6px;
}

form.inline input[type="text"] {
	width: 120px;
}

.entry-editor {
	text-align: left;
}

.entry-editor label {
	display: block;
	margin: 12px 0 4px;
	font-weight: 700;
}

.entry-editor input[type="text"],
.entry-editor input[type="url"],
.entry-editor select,
.entry-editor textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--bg);
	font: inherit;
	color: var(--ink);
	margin-bottom: 8px;
}

.entry-editor .EasyMDEContainer {
	margin-bottom: 8px;
}

/* Массовые операции */
#bulk-bar {
	display: none;
	gap: 8px;
	align-items: center;
	margin-bottom: 12px;
	padding: 10px 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
}

#bulk-bar.active {
	display: flex;
}

.taglist {
	list-style: none;
	padding: 0;
	margin: 12px 0;
	text-align: left;
}

.taglist li {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 0;
	border-bottom: 1px dashed var(--border);
	font-weight: 700;
}

.nested {
	margin-left: 14px;
}

/* Редактор записи: широкий, стилизованные селекты и file-поле */
.entry-screen {
	min-height: calc(100vh - 63px);
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 32px 24px;
}

.entry-editor {
	width: 100%;
	max-width: 960px;
	text-align: left;
}

.entry-editor .btn {
	margin-top: 16px;
}

.entry-editor label,
.entry-editor .file-field+* {
	display: block;
	margin: 14px 0 6px;
	font-weight: 700;
}

.entry-editor input[type="text"],
.entry-editor input[type="url"],
.entry-editor select,
.entry-editor textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	font: inherit;
	color: var(--ink);
	margin-bottom: 4px;
}

.entry-editor input:focus,
.entry-editor select:focus,
.entry-editor textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(238, 139, 126, .18);
}

.entry-editor select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239A857D' d='M6 8 0 2 2 0l4 4 4-4 2 2z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 42px;
	cursor: pointer;
}

.entry-editor .file-field {
	display: flex;
	align-items: center;
	gap: 12px;
}

.entry-editor .file-field .file-btn {
	margin: 0;
	position: relative;
	overflow: hidden;
	cursor: pointer;
}

.entry-editor .file-field input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.file-name {
	color: var(--muted);
	font-weight: 400;
}

.checkline {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 14px 0;
}

.checkline input[type="checkbox"] {
	width: auto;
	margin: 0;
	accent-color: var(--accent);
}

.entry-editor .checkline,
.entry-editor .file-field {
	display: flex;
}

/* Tiptap */
.tiptap-content {
	min-height: 320px;
	padding: 12px 14px;
	outline: none;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	color: var(--ink);
}

.tiptap-content p {
	margin: 0 0 10px;
}

.tiptap-content h1,
.tiptap-content h2,
.tiptap-content h3 {
	margin: 16px 0 8px;
	line-height: 1.25;
}

.tiptap-content ul,
.tiptap-content ol {
	padding-left: 22px;
	margin: 0 0 10px;
}

.tiptap-content blockquote {
	border-left: 4px solid var(--accent);
	background: var(--blush);
	padding: 8px 14px;
	border-radius: 10px;
	margin: 10px 0;
}

.tiptap-content pre {
	background: #F3EAE4;
	border-radius: 10px;
	padding: 10px 14px;
	overflow-x: auto;
}

.tiptap-content code {
	background: #F3EAE4;
	border-radius: 6px;
	padding: 1px 5px;
	font-family: ui-monospace, monospace;
	font-size: .92em;
}

.tiptap-content pre code {
	background: none;
	padding: 0;
}

.tiptap-content a {
	color: var(--accent-deep);
}

.tiptap-content img {
	max-width: 100%;
	border-radius: 10px;
}

.tiptap-content hr {
	border: none;
	border-top: 1px solid var(--border);
	margin: 14px 0;
}

/* Тулбар Tiptap */
.editor-toolbar {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
	margin-bottom: 8px;
	padding: 6px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 10px;
}

.editor-toolbar button,
.editor-toolbar .tb-btn {
	border: none;
	background: none;
	border-radius: 8px;
	padding: 5px 9px;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--ink);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	min-height: 28px;
	position: relative;
}

.editor-toolbar button:hover,
.editor-toolbar .tb-btn:hover {
	background: var(--blush);
}

.editor-toolbar button.on {
	background: var(--accent);
	color: #fff;
}

.editor-toolbar svg {
	display: block;
}

.tb-sep {
	width: 1px;
	height: 20px;
	background: var(--border);
	margin: 0 4px;
}

#body-editor .tiptap-content {
	min-height: 300px;
}

/* Выравнивание кнопок в шапке записи */
.btn {
	vertical-align: middle;
	line-height: 1.2;
}

.entry-head {
	align-items: center;
}

.entry-head form.inline {
	display: inline-flex;
	margin: 0;
}

.entry-head .entry-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

/* Типографика текста статьи — крупнее и воздушнее интерфейса */
.entry-body {
	font-size: 18px;
	line-height: 1.6;
}

.entry-body p {
	margin: 0.7em 0;
}

.entry-body h1,
.entry-body h2,
.entry-body h3,
.entry-body h4 {
	margin: 1.2em 0 0.4em;
	line-height: 1.25;
}

.entry-body h1 { font-size: 1.5em; }
.entry-body h2 { font-size: 1.3em; }
.entry-body h3 { font-size: 1.15em; }
.entry-body h4 { font-size: 1.05em; }

.entry-body ul,
.entry-body ol {
	margin: 0.7em 0;
	padding-left: 1.4em;
}

.entry-body li {
	margin: 0.25em 0;
}

.entry-body blockquote {
	margin: 0.9em 0;
	padding: 6px 16px;
	border-left: 3px solid var(--accent);
	background: #fff;
	border-radius: 0 10px 10px 0;
}

.entry-body pre,
.entry-body code {
	font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
}

.entry-body pre {
	font-size: 14px;
	background: #2f2a28;
	color: #f3ece8;
	padding: 14px 16px;
	border-radius: 10px;
	overflow-x: auto;
}

.entry-body code {
	background: #ee8b7e1f;
	padding: 1px 6px;
	border-radius: 6px;
}

.entry-body pre code {
	background: none;
	padding: 0;
	font-size: inherit;
}

.entry-body table {
	border-collapse: collapse;
	margin: 0.8em 0;
	width: 100%;
	font-size: 0.95em;
}

.entry-body th,
.entry-body td {
	border: 1px solid var(--border);
	padding: 6px 10px;
}

.entry-body hr {
	border: none;
	border-top: 1px solid var(--border);
	margin: 1.4em 0;
}

.entry-body a {
	color: #a05a4c;
}

/* Изображения в тексте записи — не разъезжаются на всю ширину */
.entry-body img,
.quote img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
	margin: 10px 0;
}

/* Пользовательское меню в шапке */
.user-menu {
	position: relative;
}

.user-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	border: none;
	cursor: pointer;
	font: inherit;
	color: var(--ink);
	padding: 5px 10px;
	border-radius: 12px;
}

.user-btn:hover {
	background: var(--blush);
}

.user-btn img {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.user-dropdown {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(75, 59, 54, .12);
	min-width: 160px;
	padding: 6px;
	display: flex;
	flex-direction: column;
	z-index: 30;
}

.user-dropdown a,
.user-dropdown button {
	padding: 8px 12px;
	border-radius: 8px;
	text-align: left;
	color: var(--ink);
	text-decoration: none;
	background: none;
	border: none;
	font: inherit;
	cursor: pointer;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
	background: var(--blush);
}

.user-dropdown form {
	margin: 0;
}

.user-dropdown button {
	width: 100%;
}

[x-cloak] {
	display: none !important;
}

.create-nav {
	display: flex;
	gap: 8px;
}

/* YFM: заметки */
.yfm-note {
	border-left: 4px solid var(--accent);
	background: #fdf0ed;
	border-radius: 0 12px 12px 0;
	padding: 14px 18px;
	margin: 14px 0;
}

.yfm-note p {
	margin: 0 0 8px;
}

.yfm-note> :last-child {
	margin-bottom: 0;
}

.yfm-note-title {
	font-weight: 800;
	color: var(--accent-deep);
}

.yfm-note-info {
	border-color: #6aa5d8;
	background: #eef5fb;
}

.yfm-note-info .yfm-note-title {
	color: #3d78a8;
}

.yfm-note-tip {
	border-color: #8fbf7f;
	background: #f0f7ec;
}

.yfm-note-tip .yfm-note-title {
	color: #5c8f4a;
}

.yfm-note-warning {
	border-color: #e0b45a;
	background: #fbf4e4;
}

.yfm-note-warning .yfm-note-title {
	color: #a87e2a;
}

.yfm-note-alert {
	border-color: #d97a6e;
	background: #fbeeec;
}

.yfm-note-alert .yfm-note-title {
	color: #a84a3d;
}

/* YFM: кат-спойлер */
.yfm-cut {
	border: 1px solid var(--border);
	border-radius: 12px;
	margin: 14px 0;
	background: var(--paper);
}

.yfm-cut summary {
	cursor: pointer;
	padding: 10px 16px;
	font-weight: 700;
	color: var(--accent-deep);
	user-select: none;
}

.yfm-cut summary:hover {
	background: var(--blush);
	border-radius: 12px;
}

.yfm-cut-content {
	padding: 4px 16px 12px;
}

/* YFM: видео */
.yfm-video {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: 12px;
	margin: 14px 0;
}

.yfm-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* YFM/GFM: чек-листы */
.entry-body li input[type="checkbox"],
.yfm-note-content li input[type="checkbox"],
.yfm-cut-content li input[type="checkbox"] {
	margin-right: 6px;
	accent-color: var(--accent);
}

.entry-body li:has(> input[type="checkbox"]) {
	list-style: none;
	margin-left: -18px;
}

/* YFM: картинки с размером */
.entry-body img {
	max-width: 100%;
	height: auto;
}

/* Поиск: строка в тулбаре списка */
.searchbox {
	position: relative;
	flex: 1;
	min-width: 220px;
}

.searchbox input[type="search"] {
	width: 100%;
	padding: 7px 12px;
	border: 1px solid var(--line, #e5d8ce);
	border-radius: 999px;
	background: #fff;
	font: inherit;
	color: inherit;
}

.searchbox input[type="search"]:focus {
	outline: 2px solid #ee8b7e66;
	border-color: #ee8b7e;
}

#search-suggest {
	position: relative;
}

.suggest {
	position: absolute;
	z-index: 30;
	top: 4px;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--line, #e5d8ce);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(75, 59, 54, 0.12);
	padding: 6px;
}

.suggest-group {
	display: flex;
	flex-direction: column;
}

.suggest-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #a08d84;
	padding: 6px 10px 2px;
}

.suggest-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
}

.suggest-item:hover {
	background: #fbf4ee;
}

.suggest-tag {
	color: #ee8b7e;
	font-weight: 600;
}

/* Живые фильтры сайдбара и чипы условий */
.filters {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 8px 4px;
}

.filter-group {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.filter-title {
	width: 100%;
	margin: 14px 0 4px;
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 800;
}

.filter-empty {
	font-size: 0.85rem;
	color: var(--text-muted);
}

.filter-chip {
	padding: 5px 12px;
	border: 1px solid var(--line, #e5d8ce);
	border-radius: 999px;
	font-size: 13px;
	color: inherit;
	text-decoration: none;
	background: #fff;
}

.filter-chip:hover {
	border-color: #ee8b7e;
}

.filter-chip.on {
	background: #ee8b7e;
	border-color: #ee8b7e;
	color: #fff;
}

.filter-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.filter-chips .chip.on {
	background: #ee8b7e;
	border-color: #ee8b7e;
	color: #fff;
}

/* Теги на карточке записи */
.entry-tag {
	padding: 3px 10px;
	border: 1px solid #f0d9d2;
	border-radius: 999px;
	font-size: 13px;
	color: #a05a4c;
	text-decoration: none;
	background: #fff8f5;
}

.entry-tag:hover {
	border-color: #ee8b7e;
	color: #ee8b7e;
}

/* Отступы между бейджем приватности и тегами на карточке */
.entry-badges {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

/* Подборки: кнопка «+ Новая» и модалка создания */
.collection-new {
	padding: 10px 12px 2px;
}

.collection-new-btn {
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	font: inherit;
	color: var(--muted, #a08d84);
	cursor: pointer;
	border-radius: 8px;
	padding: 7px 10px;
}

.collection-new-btn:hover {
	background: #f6ece4;
	color: var(--ink, #4b3b36);
}

.modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(75, 59, 54, 0.35);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 10vh 16px 16px;
}

.modal {
	width: 100%;
	max-width: 380px;
	background: #fff;
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 16px 48px rgba(75, 59, 54, 0.25);
}

.modal-title {
	font-weight: 600;
	font-size: 17px;
	margin-bottom: 14px;
}

.field {
	display: block;
	margin-bottom: 14px;
}

.field span,
.field-label {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #a08d84;
	margin-bottom: 6px;
}

.field input[type="text"] {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #e5d8ce;
	border-radius: 10px;
	font: inherit;
}

.field input[type="text"]:focus {
	outline: none;
	border-color: var(--accent, #ee8b7e);
}

.seg {
	display: inline-flex;
	border: 1px solid #e5d8ce;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 14px;
}

.seg-item {
	padding: 7px 16px;
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
}

.seg-item:has(input:checked) {
	background: #ee8b7e22;
	color: #a05a4c;
	font-weight: 500;
}

.seg-item input {
	accent-color: #ee8b7e;
}

.palette {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
}

.swatch {
	cursor: pointer;
}

.swatch input {
	position: absolute;
	opacity: 0;
}

.swatch-dot {
	display: block;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid transparent;
}

.swatch input:checked+.swatch-dot {
	outline: 2px solid #4b3b36;
	outline-offset: 2px;
}

.swatch input:focus-visible+.swatch-dot {
	outline: 2px dashed #a08d84;
	outline-offset: 2px;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.btn-primary {
	background: var(--accent, #ee8b7e);
	color: #fff;
	border: none;
}

.btn-primary:hover {
	filter: brightness(0.96);
}

/* Цветная точка подборки в сайдбаре */
.col-row {
	display: flex;
	align-items: center;
	gap: 4px;
}

.col-row .nav-item {
	flex: 1;
	min-width: 0;
}

.col-edit {
	font-size: 12px;
	text-decoration: none;
	opacity: 0;
	transition: opacity 0.12s ease;
}

.col-row:hover .col-edit {
	opacity: 0.7;
}

.col-edit:hover {
	opacity: 1 !important;
}

.col-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex: none;
	margin-right: 2px;
	vertical-align: middle;
}

.page-title .col-dot {
	width: 14px;
	height: 14px;
	margin-right: 10px;
}

.public-collection .pager {
	display: flex;
	gap: 8px;
	margin: 24px 0 12px;
}

/* Сетка эмодзи-иконок подборок */
.emoji-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 6px;
	margin-bottom: 14px;
}

.emoji-cell {
	cursor: pointer;
}

.emoji-cell input {
	position: absolute;
	opacity: 0;
}

.emoji-face {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	font-size: 20px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #fff;
}

.emoji-cell input:checked + .emoji-face {
	border-color: var(--accent);
	background: #ee8b7e22;
}

.emoji-cell input:focus-visible + .emoji-face {
	outline: 2px dashed #a08d84;
	outline-offset: 2px;
}

/* Кнопка правки в строке подборки */
button.col-edit {
	border: none;
	background: none;
	padding: 0;
	font-size: 12px;
	line-height: 1;
}

/* Форма правки подборки */
.collection-form {
	max-width: 460px;
	margin-top: 16px;
}

.collection-form .form-actions {
	display: flex;
	gap: 10px;
	margin-top: 8px;
}

.collection-form .danger-zone {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--border);
}

.btn-danger {
	background: #fff;
	color: #c0453a;
	border: 1px solid #e7b3ad;
}

.btn-danger:hover {
	background: #fbeae7;
}

/* Публичная страница подборки и embed */
.list-toolbar .public-search {
	flex: 1;
	margin: 0;
}

.public-search {
	display: flex;
	gap: 8px;
	margin: 10px 0;
	flex-wrap: wrap;
}

.public-search input[type="search"] {
	flex: 1;
	width: 100%;
	min-width: 180px;
	padding: 8px 12px;
	border: 1px solid #e5d8ce;
	border-radius: 999px;
	font: inherit;
	background: #fff;
}

.public-search select {
	border: 1px solid #e5d8ce;
	border-radius: 999px;
	padding: 8px 10px;
	font: inherit;
	background: #fff;
}

.public-collection.embed {
	max-width: 720px;
	margin: 0 auto;
	padding: 10px;
}

.embed-page {
	background: #fff;
}

.add-btn {
	display: inline-block;
	margin-top: 10px;
}

/* Превью контента в карточках лент */
.entry-preview {
	margin-top: 8px;
	font-size: 15px;
	line-height: 1.6;
	color: #5d4c44;
	overflow-wrap: anywhere;
	max-width: 72ch;
}

.entry-preview p {
	margin: 0 0 6px;
}

/* кнопка «Читать далее…»: с границей и отступами от текста и футера карточки */
.read-more {
	display: block;
	width: fit-content;
	margin: 10px 0 8px;
	padding: 4px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
}

.read-more:hover {
	background: var(--blush);
	color: var(--accent-deep);
	border-color: var(--accent);
}

.entry-preview p:last-child {
	margin-bottom: 0;
}

.entry-preview img {
	max-width: 100%;
	border-radius: 8px;
}

/* код в карточке: переносится, не вылезает за границы */
.entry-preview pre {
	white-space: pre-wrap;
	word-break: break-word;
	max-width: 100%;
	overflow-x: auto;
}

/* пагинатор лент: отступы сверху и снизу */
.pager {
	display: flex;
	gap: 8px;
	margin: 20px 0;
}

.entry-preview .gallery {
	margin-top: 4px;
}

/* Файловое поле вида «файл»: перетаскивание */
.file-field {
	border: 1px dashed transparent;
	border-radius: 12px;
	padding: 8px;
	transition: border-color .15s, background .15s;
}

.file-field.drag {
	border-color: var(--accent, #ee8b7e);
	background: #fdf1ed;
}

.file-name.has-files {
	color: var(--ink, #4b3b36);
	font-weight: 500;
}

/* Лайтбокс галерей */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(30, 22, 19, 0.92);
}

.lightbox.open {
	display: flex;
}

.lb-img {
	max-width: 92vw;
	max-height: 86vh;
	border-radius: 8px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
	object-fit: contain;
}

.lb-btn {
	position: fixed;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.lb-btn:hover {
	background: rgba(255, 255, 255, 0.25);
}

.lb-close {
	top: 18px;
	right: 18px;
}

.lb-prev {
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
}

.lb-next {
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
}

.lb-dl {
	right: 18px;
	bottom: 18px;
	color: #fff;
	font-size: 14px;
	text-decoration: none;
	opacity: 0.85;
}

.lb-dl:hover {
	opacity: 1;
	text-decoration: underline;
}

.lb-cap {
	position: fixed;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 14px;
	opacity: 0.85;
	max-width: 80vw;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Карточки лент: основная колонка тянется, галерея — горизонтальный ряд */
.entry-main {
	flex: 1;
	min-width: 0;
}

.entry-preview .gallery {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	gap: 10px;
	padding-bottom: 6px;
	grid-template-columns: none;
}

.entry-preview .gallery-item {
	flex: none;
}

.entry-preview .gallery-item img {
	height: 140px;
	width: auto;
	max-width: none;
}

/* Мета записи (014-entry-meta) */
.meta-mood {
	font-size: 18px;
	line-height: 1;
}

/* Tagify: рамки и чипы в стиле остальных полей (tagify.min.css грузится
   из body позже site.css, поэтому селекторы с повышенной специфичностью) */
.tagify,
tags.tagify {
	border: 1px solid #e5d8ce;
	border-radius: 10px;
}

tags.tagify:focus,
tags.tagify:focus-within {
	border-color: var(--accent, #ee8b7e);
	box-shadow: none;
}

tags.tagify .tagify__tag {
	margin: 3px;
	border-radius: 999px;
	background: #ee8b7e22;
	border: none;
}

.tagify__tag:hover .tagify__tag__removeBtn {
	background: transparent;
	color: #a05a4c;
}

.tagify__dropdown {
	border-radius: 10px;
	border-color: #e5d8ce;
	box-shadow: 0 8px 24px rgba(75, 59, 54, 0.12);
}

.tagify__dropdown__item--active {
	background: #ee8b7e33;
	color: #a05a4c;
}

.author-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	color: var(--ink);
	text-decoration: none;
}

.author-chip img,
.author-avatar {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
}

a.author-chip:hover {
	border-color: var(--accent);
}

.entry-view-date {
	color: var(--muted);
}

.entry-sub {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	width: 100%;
	margin-top: 10px;
	padding-bottom: 4px;
}

.entry-top + .card,
.entry-sub .entry-meta {
	margin: 0;
	font-size: 14px;
}

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.meta-geo {
	text-decoration: none;
}

.geo-chip {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 5px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
}

.geo-chip .geo-pin {
	font-size: 14px;
}

.geo-chip a {
	color: #a05a4c;
	font-weight: 600;
	text-decoration: none;
}

.geo-chip a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.geo-chip .geo-map {
	color: var(--muted);
	font-weight: 500;
}

.geo-chip .geo-map:hover {
	color: var(--accent);
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 8px 0 12px;
	font-size: 14px;
}

.meta-pair {
	color: #5d4c44;
}

.meta-pair b {
	font-weight: 600;
}

/* Форма: мета */

#map-picker {
	margin: 8px 0;
}

.meta-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.meta-row input {
	flex: 1;
	padding: 7px 10px;
	border: 1px solid #e5d8ce;
	border-radius: 8px;
	font: inherit;
}

.meta-row-remove {
	border: none;
	background: none;
	font-size: 18px;
	color: var(--muted, #a08d84);
	cursor: pointer;
}

.meta-row-remove:hover {
	color: #ee8b7e;
}

/* Существующие вложения в форме редактирования */
.file-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 6px 0 10px;
}

.file-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 8px;
	border: 1px solid #f0e4dc;
	border-radius: 10px;
}

.file-main {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.file-thumb {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 8px;
}

/* Плавный зум: ghost-слой старых тайлов + проявление новых */

.map-ghost.fade {
	opacity: 0;
}

/* Настроение: сетка эмодзи */
.mood-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.mood-item {
	cursor: pointer;
}

.mood-item input {
	position: absolute;
	opacity: 0;
}

.mood-item span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	font-size: 22px;
	border-radius: 10px;
	border: 1px solid #f0e4dc;
	background: #fff;
}

.mood-item:hover span {
	border-color: var(--accent, #ee8b7e);
}

.mood-item input:checked+span {
	border-color: var(--accent, #ee8b7e);
	background: #fdf1ed;
	box-shadow: inset 0 0 0 1px var(--accent, #ee8b7e);
}

/* Строка файла: кнопка удаления — справа, по центру вертикали */
.file-row form {
	margin-left: auto;
	display: flex;
	align-items: center;
}

/* Карта-пикер (стабильная версия) */
.map-canvas {
	position: relative;
	height: 320px;
	overflow: hidden;
	border: 1px solid #e5d8ce;
	border-radius: 12px;
	background: #e8e0d8;
	cursor: crosshair;
	touch-action: none;
}

.map-tile {
	position: absolute;
	width: 256px;
	height: 256px;
	user-select: none;
	pointer-events: none;
}

.map-marker {
	position: absolute;
	font-size: 24px;
	line-height: 1;
	display: none;
	transform: translateX(-50%);
	pointer-events: none;
	text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
	z-index: 5;
}

.map-zoom {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	z-index: 6;
}

.map-zoom-btn {
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 8px;
	background: rgba(255, 255, 255, .9);
	font-size: 18px;
	cursor: pointer;
}

.map-tools {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.map-tools input {
	flex: 1;
	min-width: 100px;
	padding: 6px 10px;
	border: 1px solid #e5d8ce;
	border-radius: 8px;
	background: #faf6f2;
	font: inherit;
}

.meta-row {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
}

.meta-row input {
	flex: 1;
	padding: 7px 10px;
	border: 1px solid #e5d8ce;
	border-radius: 8px;
	font: inherit;
}

.meta-row-remove {
	border: none;
	background: none;
	font-size: 18px;
	color: var(--muted, #a08d84);
	cursor: pointer;
}

.meta-row-remove:hover {
	color: #ee8b7e;
}

.map-attrib {
	position: absolute;
	right: 8px;
	bottom: 6px;
	z-index: 6;
	font-size: 11px;
	color: #4b3b36;
	background: rgba(255, 255, 255, 0.85);
	padding: 2px 6px;
	border-radius: 6px;
	text-decoration: none;
}

/* Вечная копия: статус, табы, фрейм копии */
.archive-box {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.archive-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.archive-tabs {
	display: flex;
	gap: 6px;
	margin: 10px 0;
}

.archive-chip {
	cursor: default;
	margin-right: 4px;
}

.archive-frame {
	width: 100%;
	height: 72vh;
	border: 1px solid #e5d8ce;
	border-radius: 12px;
	background: #fff;
}

/* Иконка-ссылка перед заголовком закладки */
.title-link {
	color: var(--muted, #a08d84);
	display: inline-flex;
	margin-right: 10px;
	vertical-align: middle;
}

.title-link svg {
	width: 22px;
	height: 22px;
}

.title-link:hover {
	color: var(--accent, #ee8b7e);
}
/* ============================================================
   Адаптив: планшет и десктоп — сайдбар закреплён слева
   ============================================================ */
@media (min-width: 900px) {
	.layout {
		display: grid;
		grid-template-columns: 250px 1fr;
		min-height: calc(100vh - 63px);
	}

	.sidebar {
		position: static;
		width: auto;
		transform: none;
		transition: none;
		box-shadow: none;
		border-right: 1px solid var(--border);
	}

	.drawer-toggle,
	.drawer-close,
	.drawer-backdrop {
		display: none;
	}
}

@media (max-width: 720px) {
	body {
		overflow-x: clip;
	}

	.header {
		flex-wrap: wrap;
		gap: 8px 10px;
		padding: 10px 12px;
	}

	.header .logo {
		font-size: 17px;
	}

	.header .logo svg {
		width: 26px;
		height: 26px;
	}

	.create-nav {
		display: flex;
		gap: 6px;
		overflow-x: auto;
		max-width: 100%;
		-webkit-overflow-scrolling: touch;
	}

	.create-nav .chip,
	.header .chip {
		flex: 0 0 auto;
		white-space: nowrap;
	}

	.content {
		padding: 0;
	}

	.entry-screen {
		padding: 0;
	}

	.entry-editor {
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.page-title {
		font-size: 22px;
		padding: 0 12px;
	}

	.card {
		padding: 16px 14px;
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.searchbox {
		flex: 1 1 100%;
	}

	.entry-card {
		padding: 10px 12px;
		gap: 8px;
	}

	.profile-grid {
		grid-template-columns: 1fr;
	}

	.meta-row {
		flex-wrap: wrap;
	}

	.meta-row input[type="text"],
	.meta-row input[type="url"] {
		flex: 1 1 100%;
	}

	/* шапка записи вертикально: заголовок → метки → атрибуты → кнопки */
	.entry-top {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
		padding: 0 12px;
	}

	.entry-top .page-title {
		padding: 0;
	}

	.page-title {
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
	}

	.entry-top .entry-head {
		display: contents;
	}

	.entry-top .entry-head .badge,
	.entry-top .entry-head > .muted {
		order: 1;
	}

	/* публичная запись: мета и атрибуты — с тем же отступом, что заголовок */
	.public-meta,
	.entry-meta {
		padding: 0 12px;
	}

	.entry-top .entry-meta {
		order: 2;
	}

	.entry-top .entry-head .spacer {
		display: none;
	}

	/* меню пользователя: кнопка после переноса шапки уезжает влево —
	   dropdown выравниваем по её левому краю, иначе уходит за экран */
	.user-dropdown {
		left: 0;
		right: auto;
	}

	.entry-top .entry-actions {
		order: 3;
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	#bulk-bar {
		flex-wrap: wrap;
	}

	.archive-frame {
		height: 62vh;
	}

	body {
		-webkit-text-size-adjust: 100%;
	}
}

/* ── Комментарии (018-comments-image-rehost) ─────────────────────────── */

.comment-preview {
	border: 1px dashed #e5d8ce;
	border-radius: 10px;
	padding: 8px 12px;
	font-size: 14px;
	line-height: 1.5;
	color: #5d4c44;
	background: #fffdfa;
	overflow-wrap: anywhere;
}

.comment-preview:empty { display: none; }

.comment-preview img { max-width: 100%; border-radius: 8px; }

.comment-edited {
	color: #9b8a80;
	font-size: 12px;
	font-style: italic;
}

.comment-edit-form { margin-top: 8px; }

/* переключатель языка переведённой статьи (018, R13) */
.lang-switch {
	display: flex;
	gap: 6px;
	margin: 0 0 10px;
}

/* переключатель языка переведённой статьи: кроссфейд с блюром 300 мс (R13) */
.langfade-transition { transition: opacity 0.3s ease, filter 0.3s ease; }
.langfade-hidden { opacity: 0; filter: blur(8px); }
.langfade-visible { opacity: 1; filter: blur(0); }



.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.comments {
	margin-top: 24px;
}

.comments h3 {
	margin: 0 0 12px;
	font-size: 18px;
	color: var(--ink);
}

.comment-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.comment-node {
	background: #fff;
	border: 1px solid #eee2d8;
	border-radius: 12px;
	padding: 10px 14px 12px;
}

.comment-node.depth-1 { margin-left: 24px; }
.comment-node.depth-2 { margin-left: 48px; }
.comment-node.depth-3 { margin-left: 72px; }
.comment-node.depth-4 { margin-left: 96px; }
.comment-node.depth-5 { margin-left: 120px; }

.comment-head {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.comment-avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
}

.comment-author {
	font-weight: 600;
	color: var(--ink);
	text-decoration: none;
}

.comment-author:hover { color: var(--accent); }

.comment-to {
	color: var(--accent);
	font-size: 13px;
}

.comment-date {
	color: #9b8a80;
	font-size: 13px;
}

.comment-body {
	margin-top: 6px;
	font-size: 15px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.comment-body img {
	max-width: 100%;
	border-radius: 8px;
}

.comment-body pre, .comment-body code {
	background: #f7efe8;
	border-radius: 6px;
	padding: 1px 5px;
}

.comment-actions {
	display: flex;
	gap: 12px;
	margin-top: 6px;
}

.comment-action {
	background: none;
	border: none;
	padding: 0;
	font-size: 13px;
	color: #9b8a80;
	cursor: pointer;
}

.comment-action:hover { color: var(--accent); }

.comment-delete:hover { color: #c0392b; }

.comment-reply-form { margin-top: 8px; }

.comment-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 10px;
}

.comment-form textarea {
	width: 100%;
	border: 1px solid #e5d8ce;
	border-radius: 10px;
	padding: 8px 10px;
	font: inherit;
	resize: vertical;
	background: #fffdfa;
}

.comment-form-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.comment-image-btn {
	cursor: pointer;
	user-select: none;
}

.comment-error {
	color: #c0392b;
	font-size: 14px;
}

.comment-login {
	margin-top: 10px;
}

.comment-replies {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 8px;
}

.comment-replies:empty { display: none; }

/* ссылка-счётчик комментариев в общей мете записи (прижата вправо, R11) */
.entry-comments {
	margin-left: auto;
	font-size: 13px;
	color: #9b8a80;
	text-decoration: none;
	white-space: nowrap;
}

.entry-comments:hover { color: var(--accent); }

.entry-meta-type {
	color: #9b8a80;
	font-size: 14px;
}

.entry-sub .spacer { margin-left: auto; }

/* — автосохранение черновика — */
.draft-banner {
	margin: 0 0 14px;
	padding: 8px 12px;
	background: #fff3e9;
	border: 1px solid #f3d9c8;
	border-radius: 10px;
	font-size: 13px;
	color: var(--ink);
}

.draft-status {
	font-size: 12px;
	color: #9b8a80;
	margin-right: 10px;
	opacity: 0;
	transition: opacity .25s;
}

.draft-status.on { opacity: 1; }

/* — API-токен в настройках — */
.api-token-row {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin: 8px 0;
}

.api-token-row code {
	background: #f4e9e0;
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 13px;
	word-break: break-all;
}

/* — букмарклет в настройках — */
.bookmarklet-code {
	display: block;
	margin-top: 8px;
	padding: 8px 10px;
	background: #f4e9e0;
	border-radius: 8px;
	font-size: 11px;
	word-break: break-all;
	white-space: pre-wrap;
}
