:root {
	--pet-paper: #f3f3ef;
	--pet-paper-deep: #e8e8e2;
	--pet-ink: #181817;
	--pet-soft: #565650;
	--pet-muted: #77776f;
	--pet-line: #cdcdc5;
	--pet-accent: #c04a32;
	--pet-display: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--pet-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--pw-main-color: var(--pet-accent);
	--pw-text-color: var(--pet-ink);
	--pw-muted-color: var(--pet-muted);
	--pw-border-color: var(--pet-line);
	--pw-main-background: var(--pet-paper);
	--pw-inputs-background: var(--pet-paper);
	--pw-blocks-background: var(--pet-paper);
	--pw-button-background: var(--pet-ink);
	--pw-button-color: var(--pet-paper);
	--pw-button-border: var(--pet-ink);
	--pw-button-hover-background: var(--pet-accent);
	--pw-button-hover-color: #fff;
	--pw-button-hover-border: var(--pet-accent);
	--pw-button-muted-background: transparent;
	--pw-button-muted-color: var(--pet-ink);
	--pw-button-muted-border: var(--pet-line);
	--pw-masthead-background: var(--pet-paper);
	--pw-masthead-active-color: var(--pet-ink);
	--pw-masthead-text-color: var(--pet-soft);
	--pw-masthead-border-color: var(--pet-line);
	--pw-masthead-logo-color: var(--pet-accent);
	--pw-masthead-menu-item-background-hover: var(--pet-paper-deep);
	--pw-button-radius: 0;
	--pw-input-radius: 0;
	color-scheme: light;
	/* !important needed: AdminThemeUikit injects its own inline
	   :root{--pw-main-color:...} style AFTER this stylesheet based on the
	   module's default color setting, which otherwise overrides ours. */
	--pw-main-color: var(--pet-accent) !important;
}

html, body { background: var(--pet-paper) !important; color: var(--pet-ink) !important; font-family: var(--pet-body) !important; }
body { letter-spacing: 0; }
#pw-masthead, #pw-masthead-mobile { border-bottom: 1px solid var(--pet-line) !important; background: var(--pet-paper) !important; box-shadow: none !important; }
#pw-masthead .pw-container { min-height: 76px; }
.pw-logo-link svg, .pw-logo-link img { display: none !important; }
.pw-logo-link::before { content: "Petkevich CMS"; color: var(--pet-ink); font-family: var(--pet-display); font-size: 21px; font-weight: 400; white-space: nowrap; }
.pw-logo-link::after { content: "."; color: var(--pet-accent); font-family: var(--pet-display); font-size: 25px; }
.uk-navbar-nav > li > a, .pw-primary-nav > li > a { color: var(--pet-soft) !important; font-size: 13px !important; text-transform: none !important; }
.uk-navbar-nav > li.uk-active > a, .uk-navbar-nav > li > a:hover { color: var(--pet-accent) !important; }
#pw-content-head, #pw-content-body, #pw-footer { background: var(--pet-paper) !important; }
#pw-content-head { border-bottom: 0 !important; padding-top: 28px !important; }
#pw-content-title, #pw-content-head h1, .pw-headline { color: var(--pet-ink) !important; font-family: var(--pet-display) !important; font-size: clamp(40px, 5vw, 62px) !important; font-weight: 400 !important; letter-spacing: 0 !important; line-height: .98 !important; }
#pw-content-body { min-height: calc(100vh - 230px); }
#pw-content-body > .pw-container { padding-top: 18px; }
.Inputfields > .Inputfield, .uk-card, .pw-panel-container, .ui-widget-content { border-color: var(--pet-line) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.InputfieldHeader, .uk-card-header { border-color: var(--pet-line) !important; background: transparent !important; color: var(--pet-ink) !important; }
.InputfieldContent { background: transparent !important; }
.uk-input, .uk-select, .uk-textarea, input[type="text"], input[type="email"], input[type="password"], textarea, select { border: 1px solid var(--pet-line) !important; border-radius: 0 !important; background: transparent !important; color: var(--pet-ink) !important; box-shadow: none !important; }
.uk-input:focus, .uk-select:focus, .uk-textarea:focus, input:focus, textarea:focus, select:focus { border-color: var(--pet-accent) !important; outline: 1px solid var(--pet-accent) !important; outline-offset: 0 !important; }
.ui-button, .uk-button, button, input[type="submit"] { border-radius: 0 !important; box-shadow: none !important; font-weight: 650 !important; text-transform: none !important; }
.ui-button.ui-priority-primary, .uk-button-primary, button[type="submit"], input[type="submit"] { border-color: var(--pet-ink) !important; background: var(--pet-ink) !important; color: var(--pet-paper) !important; }
.ui-button.ui-priority-primary:hover, .uk-button-primary:hover, button[type="submit"]:hover, input[type="submit"]:hover { border-color: var(--pet-accent) !important; background: var(--pet-accent) !important; color: #fff !important; }
.PageListItem { border-color: var(--pet-line) !important; }
.PageListItem a:hover, .PageListAction a:hover, a:hover { color: var(--pet-accent); }
.PageListAction a, .uk-label, .uk-badge { border-radius: 0 !important; }
.uk-table-divider > tr:not(:first-child), .uk-table-divider > :not(:first-child) > tr, .AdminDataTable tr { border-color: var(--pet-line) !important; }
.uk-table-hover tbody tr:hover, .AdminDataTable tbody tr:hover { background: var(--pet-paper-deep) !important; }
.uk-tab::before { border-color: var(--pet-line) !important; }
.uk-tab > .uk-active > a { border-color: var(--pet-accent) !important; color: var(--pet-accent) !important; }
.NoticeMessage, .uk-alert { border: 1px solid var(--pet-line); border-radius: 0 !important; }
#pw-footer { border-top: 1px solid var(--pet-line); color: var(--pet-muted); }

body.ProcessLogin #pw-content-body { display: grid; min-height: calc(100vh - 170px); place-items: center; }
body.ProcessLogin #ProcessLoginForm { width: min(100%, 440px); padding: 30px; border: 1px solid var(--pet-line); }
body.ProcessLogin #pw-content-title { text-align: center; }

@media (max-width: 760px) {
	.pw-logo-link::before { content: "Petkevich CMS"; font-size: 18px; }
	#pw-content-head { padding-top: 18px !important; }
	#pw-content-title, #pw-content-head h1, .pw-headline { font-size: 40px !important; }
}

/* Empty notices list should never render a marker/box even if the theme
   or a leftover hook pushes a bullet-styled pseudo-element onto it. */
ul.pw-notices:empty { display: none !important; }

/* Page list row actions ("Редактировать / Просмотр / Добавить / Переместить")
   must wrap instead of overflowing/getting clipped on narrower widths —
   our font + spacing made this row wider than the default theme assumed. */
.PageList .PageListItem { flex-wrap: wrap !important; }
.PageListItem .PageListActions.actions { white-space: normal !important; max-width: 100%; }
.PageList .PageListActions a { letter-spacing: 0.2px !important; padding: 1px 6px !important; white-space: nowrap; }
#PageListContainer { overflow-x: visible; }

/* Floating menus (top-nav dropdowns, "Добавить" dropdown, page-list "more"
   menu) are built by jQuery UI's .menu() widget, which tags them
   .ui-widget-content — the same class our card/panel reskin above makes
   transparent with no shadow. That strips their backdrop, so page content
   underneath bleeds through and looks like broken overlapping text. Restore
   an opaque backdrop specifically for the floating-menu case (higher
   specificity than the plain .ui-widget-content rule above, so it always
   wins regardless of source order). */
.ui-menu.ui-widget-content,
.pw-dropdown-menu,
ul.pw-dropdown-menu.prnav {
	background: var(--pet-paper) !important;
	box-shadow: 0 6px 24px rgba(24, 24, 23, .18) !important;
	border: 1px solid var(--pet-line) !important;
}

/* Prominent Tilda-style publish/draft pill, injected by admin.js next to
   the Save button on the page-edit screen. */
.cms-publish-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-right: 10px;
	padding: 7px 14px;
	font-family: var(--pet-body);
	font-size: 13px;
	font-weight: 650;
	border: 1px solid var(--pet-line);
	border-radius: 999px;
	cursor: pointer;
	background: transparent;
	color: var(--pet-ink);
}
.cms-publish-pill.cms-pill-published {
	background: #2f6b3a;
	border-color: #2f6b3a;
	color: #fff;
}
.cms-publish-pill.cms-pill-draft {
	background: var(--pet-accent);
	border-color: var(--pet-accent);
	color: #fff;
}
.cms-publish-pill:disabled { opacity: .6; cursor: default; }

/* Google-style search result preview, injected by admin.js into the SEO tab. */
.cms-serp { margin-bottom: 8px; }
.cms-serp-caption { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--pet-muted); }
.cms-serp-card { max-width: 620px; padding: 16px 18px; border: 1px solid var(--pet-line); background: #fff; }
.cms-serp-url { font-size: 12px; color: #4d5156; }
.cms-serp-title { margin-top: 3px; color: #1a0dab; font-size: 19px; line-height: 1.3; }
.cms-serp-desc { margin-top: 4px; color: #4d5156; font-size: 13px; line-height: 1.55; }
.cms-serp-desc.cms-serp-empty { color: #9aa0a6; font-style: italic; }
.cms-serp-date { color: #70757a; }
.cms-serp-meters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cms-serp-meter { padding: 3px 9px; border: 1px solid var(--pet-line); font-size: 12px; }
.cms-meter-empty { color: var(--pet-muted); }
.cms-meter-short { color: var(--pet-soft); }
.cms-meter-ok { border-color: #2f6b3a; color: #2f6b3a; }
.cms-meter-over { border-color: var(--pet-accent); color: var(--pet-accent); }
