/* Makeweb 5.0 admin shell. Plain CSS, no framework. Colours follow the v4.1 admin
   (docs/v41/reference.md "Colours and controls"), modernised. */

:root {
	--mw-header-bg: #58595b;
	--mw-header-fg: #fff;
	--mw-dark: #646262;
	--mw-darker: #444;
	--mw-content-bg: #e9e7e7;
	--mw-panel-bg: #fff;
	--mw-border: #c9c6c6;
	--mw-border-strong: #646262;
	--mw-text: #1f1f1f;
	--mw-muted: #666;
	--mw-accent: #4e95d3;
	--mw-accent-dark: #2f6fa8;
	--mw-success: #2e7d32;
	--mw-success-bg: #e6f4e7;
	--mw-warning: #8a5a00;
	--mw-warning-bg: #fff4d6;
	--mw-danger: #b3261e;
	--mw-danger-bg: #fdeceb;
	--mw-info-bg: #e8f1fa;
	--mw-zebra: rgba(0, 0, 0, .035);
	--mw-radius: 6px;
	--mw-radius-small: 4px;
	--mw-shadow: 0 6px 24px rgba(0, 0, 0, .18);
	--mw-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mw-font-size: 14px;
	--mw-header-h: 64px;
	--mw-nav-w: 210px;
	--mw-focus: 0 0 0 3px rgba(78, 149, 211, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.mw-admin {
	font: var(--mw-font-size)/1.45 var(--mw-font);
	color: var(--mw-text);
	background: var(--mw-content-bg);
	min-height: 100vh;
}
a { color: var(--mw-accent-dark); }
code { font-size: .92em; background: rgba(0, 0, 0, .06); padding: 1px 4px; border-radius: 3px; }
h1 { font-size: 1.45rem; margin: 0; font-weight: 600; }
:focus-visible { outline: none; box-shadow: var(--mw-focus); }
[hidden] { display: none !important; }

.mw-visually-hidden {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.mw-skip { position: absolute; left: -999px; top: 4px; z-index: 100; background: #fff; padding: 6px 10px; }
.mw-skip:focus { left: 8px; }
.mw-muted { color: var(--mw-muted); }

/* ---- icons: white PNGs from shared/icons on a grey square (v4.1 style) */
.mw-icon {
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 22px; height: 22px; border-radius: var(--mw-radius-small); background: var(--mw-dark);
}
.mw-icon img { width: 16px; height: 16px; display: block; }

/* ---- header */
.mw-header {
	position: sticky; top: 0; z-index: 20;
	display: flex; align-items: center; gap: 16px;
	height: var(--mw-header-h); padding: 0 20px;
	background: var(--mw-header-bg); color: var(--mw-header-fg);
}
.mw-brand { display: flex; align-items: baseline; gap: 6px; color: #fff; text-decoration: none; }
.mw-brand-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -.5px; }
.mw-brand-version { font-size: .85rem; font-weight: 600; opacity: .8; }
.mw-header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mw-switcher { display: flex; align-items: center; gap: 6px; margin: 0; }
.mw-pill {
	display: inline-flex; align-items: center; gap: 6px;
	height: 32px; padding: 0 12px 0 5px; border-radius: 16px;
	background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; white-space: nowrap;
}
a.mw-pill:hover, label.mw-pill:hover { background: rgba(255, 255, 255, .22); }
.mw-pill .mw-icon { background: transparent; }
.mw-pill select {
	background: transparent; color: #fff; border: 0; font: inherit; cursor: pointer; max-width: 220px;
}
.mw-pill select option { color: var(--mw-text); }
.mw-logout { margin: 0; }
.mw-pill-button { border: 0; font: inherit; cursor: pointer; padding: 0 12px; }
.mw-pill-button:hover { background: rgba(255, 255, 255, .22); }
.mw-nav-toggle {
	display: none; background: transparent; border: 1px solid rgba(255, 255, 255, .4); color: #fff;
	border-radius: var(--mw-radius-small); padding: 6px 10px; font: inherit; cursor: pointer;
}

/* ---- body: nav + content */
.mw-body { display: flex; align-items: stretch; min-height: calc(100vh - var(--mw-header-h)); }
.mw-nav {
	flex: none; width: var(--mw-nav-w); padding: 18px 0 24px 12px;
	background: #f7f6f6; border-right: 1px solid var(--mw-border);
}
.mw-nav-cat { margin-bottom: 10px; }
.mw-nav-cat h2 { margin: 0; font-size: inherit; }
.mw-nav-cat-title {
	display: block; width: calc(100% - 12px); text-align: left; cursor: pointer;
	background: var(--mw-dark); color: #fff; border: 0; border-radius: var(--mw-radius-small);
	padding: 7px 10px; font: 700 .78rem/1.2 var(--mw-font); text-transform: uppercase; letter-spacing: .04em;
}
.mw-nav-cat-title::after { content: "▸"; float: right; opacity: .7; }
.mw-nav-cat.is-open .mw-nav-cat-title::after { content: "▾"; }
.mw-nav-cat ul { list-style: none; margin: 6px 0 0; padding: 0; display: none; }
.mw-nav-cat.is-open ul { display: block; }
.mw-nav-item {
	display: flex; align-items: center; gap: 8px; margin: 0 12px 4px 0; padding: 4px 8px 4px 4px;
	background: #fff; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small);
	color: var(--mw-text); text-decoration: none;
}
.mw-nav-item:hover { border-color: var(--mw-dark); }
.mw-nav-item.is-active {
	margin-right: -1px; border-radius: var(--mw-radius-small) 0 0 var(--mw-radius-small);
	background: var(--mw-content-bg); border-color: var(--mw-border); border-right-color: var(--mw-content-bg);
	font-weight: 600;
}

.mw-main { flex: 1; min-width: 0; padding: 20px 28px 48px; }
.mw-main:focus { outline: none; }
.mw-page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.mw-page-actions { margin-left: auto; display: flex; gap: 8px; }
.mw-page-actions form { margin: 0; }

/* ---- flash messages (server) */
.flash {
	position: relative; padding: 10px 40px 10px 14px; margin-bottom: 14px;
	border-radius: var(--mw-radius); border-left: 4px solid var(--mw-accent); background: var(--mw-info-bg);
}
.flash-success { border-color: var(--mw-success); background: var(--mw-success-bg); }
.flash-error { border-color: var(--mw-danger); background: var(--mw-danger-bg); }
.flash-warning { border-color: var(--mw-warning); background: var(--mw-warning-bg); }
/* local draft offer at the top of a TabForm (tabform.js, MAKEWEB5-74) */
.mw-draft-bar { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding-right: 14px; }
.mw-draft-bar-text { margin: 0; flex: 1 1 320px; }
.mw-draft-bar-actions { display: flex; gap: 8px; }
.mw-flash-close, .mw-toast-close {
	position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
	border: 0; background: transparent; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 4px 8px;
}
.mw-flash-close:hover, .mw-toast-close:hover { opacity: 1; }

/* ---- buttons */
.mw-btn {
	display: inline-flex; align-items: center; gap: 6px; justify-content: center;
	min-height: 32px; padding: 0 14px; border-radius: var(--mw-radius-small);
	border: 1px solid #a9a6a6; background: linear-gradient(#fafafa, #e3e1e1); color: var(--mw-text);
	font: 600 .8rem/1 var(--mw-font); text-transform: uppercase; letter-spacing: .03em;
	text-decoration: none; cursor: pointer; white-space: nowrap;
}
.mw-btn:hover { background: linear-gradient(#fff, #d9d6d6); border-color: var(--mw-dark); }
.mw-btn:disabled { opacity: .5; cursor: default; }
.mw-btn-primary { background: var(--mw-dark); border-color: var(--mw-dark); color: #fff; }
.mw-btn-primary:hover { background: var(--mw-darker); border-color: var(--mw-darker); }
.mw-btn-danger { background: var(--mw-danger); border-color: var(--mw-danger); color: #fff; }
.mw-btn-danger:hover { background: #8f1d17; border-color: #8f1d17; }
.mw-btn-ghost { background: transparent; border-color: transparent; text-transform: none; font-weight: 500; }
.mw-btn-ghost:hover { background: rgba(0, 0, 0, .05); border-color: transparent; }
.mw-btn-small { min-height: 26px; padding: 0 10px; font-size: .72rem; }

/* ---- dashboard tiles */
.mw-tiles { list-style: none; display: flex; flex-wrap: wrap; gap: 24px; padding: 8px 0 16px; margin: 0; }
.mw-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 148px; color: var(--mw-muted); text-decoration: none; }
.mw-tile-icon {
	display: flex; align-items: center; justify-content: center; width: 148px; height: 148px;
	border-radius: 10px; background: #969494; transition: background .15s, transform .15s;
}
.mw-tile-icon img { width: 96px; height: 96px; }
a.mw-tile:hover .mw-tile-icon { background: var(--mw-dark); transform: translateY(-2px); }
.mw-tile.is-disabled { opacity: .55; cursor: not-allowed; }
.mw-dashboard-widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin: 0 0 20px; }
.mw-dashboard-widgets > .mw-panel { margin: 0; }

/* ---- forms */
.mw-field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.mw-field > label, .mw-field > legend, .mw-field > .mw-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; color: #333; padding: 0; }
.mw-field input[type="text"], .mw-field input[type="email"], .mw-field input[type="date"], .mw-field input[type="password"],
.mw-field input[type="search"], .mw-field input[type="tel"], .mw-field input[type="url"], .mw-field input[type="number"], .mw-field select, .mw-field textarea {
	display: block; width: 100%; max-width: 640px; font: inherit; color: inherit;
	padding: 7px 9px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #fff;
}
.mw-field input[type="date"] { max-width: 220px; }
.mw-field textarea { resize: vertical; }
.mw-field .mw-input-large { font-size: 1.35rem; padding: 8px 10px; }
.mw-field input:focus, .mw-field select:focus, .mw-field textarea:focus { border-color: var(--mw-accent); box-shadow: var(--mw-focus); outline: none; }
.mw-field [aria-invalid="true"] { border-color: var(--mw-danger) !important; background: #fffafa; }
.mw-field-error { color: var(--mw-danger); font-size: .82rem; margin: 4px 0 0; }
.mw-field-row { display: flex; flex-wrap: wrap; gap: 0 24px; }
.mw-check { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-weight: normal; cursor: pointer; }

/* ---- tabbed edit form */
.mw-tabbar { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--mw-border-strong); }
.mw-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: -1px; }
.mw-tab {
	position: relative; display: inline-flex; align-items: center; gap: 7px;
	padding: 6px 14px 6px 6px; font: inherit; color: var(--mw-muted); cursor: pointer;
	background: #f6f5f5; border: 1px solid var(--mw-border); border-bottom-color: var(--mw-border-strong);
	border-radius: var(--mw-radius) var(--mw-radius) 0 0;
}
.mw-tab .mw-icon { background: #9a9898; }
.mw-tab:hover { color: var(--mw-text); }
.mw-tab[aria-selected="true"] {
	color: var(--mw-text); font-weight: 600; background: var(--mw-panel-bg);
	border-color: var(--mw-border-strong); border-bottom-color: var(--mw-panel-bg);
}
.mw-tab[aria-selected="true"] .mw-icon { background: var(--mw-dark); }
.mw-tab-mark { display: none; width: 8px; height: 8px; border-radius: 50%; }
.mw-tab.is-dirty .mw-tab-mark { display: inline-block; background: var(--mw-accent); }
.mw-tab.has-error { color: var(--mw-danger); }
.mw-tab.has-error .mw-tab-mark { display: inline-block; background: var(--mw-danger); }
.mw-tab.has-error::after {
	content: attr(data-errors); position: absolute; top: -8px; right: -6px;
	min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
	background: var(--mw-danger); color: #fff; font: 700 .7rem/18px var(--mw-font); text-align: center;
}
.mw-dirty-indicator {
	margin: 0 0 6px auto; padding: 3px 10px; border-radius: 12px;
	background: var(--mw-warning-bg); color: var(--mw-warning); font-size: .8rem; font-weight: 600;
}
.mw-dirty-indicator::before { content: "● "; }
.mw-tabpanel {
	background: var(--mw-panel-bg); padding: 20px; border: 1px solid var(--mw-border-strong); border-top: 0;
	border-radius: 0 0 var(--mw-radius) var(--mw-radius);
}
.mw-form-summary {
	margin: 0 0 14px; padding: 8px 14px; border-radius: var(--mw-radius);
	background: var(--mw-danger-bg); color: var(--mw-danger); border-left: 4px solid var(--mw-danger);
}
.mw-form-summary p { margin: 2px 0; }
.mw-form-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.mw-tabform[aria-busy="true"] .mw-tabpanel { opacity: .75; }

/* ---- list view */
.mw-list-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.mw-list-search { display: flex; gap: 6px; margin: 0; }
.mw-list-q { width: 260px; font: inherit; padding: 5px 9px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); }
.mw-list-count { color: var(--mw-muted); font-size: .85rem; margin-left: auto; }
.mw-table-wrap { overflow-x: auto; background: var(--mw-panel-bg); border-radius: var(--mw-radius); border: 1px solid var(--mw-border); }
.mw-table { width: 100%; border-collapse: collapse; }
.mw-table th {
	background: var(--mw-darker); color: #fff; text-align: left; font-size: .8rem; font-weight: 700;
	padding: 8px 10px; white-space: nowrap;
}
.mw-table td { padding: 7px 10px; border-top: 1px solid #eee; vertical-align: middle; }
.mw-table tbody tr:nth-child(even) { background: var(--mw-zebra); }
.mw-table tbody tr:hover { background: var(--mw-info-bg); }
.mw-sort { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.mw-sort:focus-visible { box-shadow: var(--mw-focus); }
.mw-sort-arrow { opacity: .55; font-size: .75em; }
.mw-sort.is-active .mw-sort-arrow { opacity: 1; }
.mw-col-num { width: 60px; text-align: right; }
th.mw-col-num { text-align: right; }
.mw-actions-col { width: 1%; white-space: nowrap; text-align: right; }
.mw-row-action {
	display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; padding: 2px 8px 2px 2px;
	border: 1px solid transparent; border-radius: var(--mw-radius-small); background: transparent;
	font: inherit; font-size: .8rem; color: var(--mw-text); text-decoration: none; cursor: pointer;
}
.mw-row-action:hover { border-color: var(--mw-border); background: #fff; }
.mw-row-action.is-danger:hover { border-color: var(--mw-danger); color: var(--mw-danger); }
.mw-row-action.is-danger:hover .mw-icon { background: var(--mw-danger); }
.mw-empty td, .mw-list-error td { text-align: center; padding: 24px; color: var(--mw-muted); }
.mw-list-error td { color: var(--mw-danger); }
.mw-list.is-loading .mw-table tbody { opacity: .5; transition: opacity .2s .1s; }
.mw-status { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; }
.mw-status::before { font-weight: 700; }
.mw-status.is-on::before { content: "✓"; color: var(--mw-success); }
.mw-status.is-off::before { content: "✕"; color: var(--mw-danger); }
.mw-pager { display: flex; gap: 4px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.mw-page {
	min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--mw-border); background: #fff;
	border-radius: var(--mw-radius-small); font: inherit; cursor: pointer;
}
.mw-page:hover:not(:disabled) { border-color: var(--mw-dark); }
.mw-page:disabled { opacity: .45; cursor: default; }
.mw-page.is-current { background: var(--mw-dark); color: #fff; border-color: var(--mw-dark); opacity: 1; }
.mw-page-gap { padding: 0 4px; color: var(--mw-muted); }

/* ---- dialogs */
.mw-dialog {
	padding: 0; border: 0; border-radius: var(--mw-radius); box-shadow: var(--mw-shadow);
	width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 64px); color: var(--mw-text);
}
.mw-dialog::backdrop { background: rgba(30, 30, 30, .45); }
.mw-dialog-head { display: flex; align-items: center; background: var(--mw-darker); color: #fff; padding: 10px 8px 10px 16px; }
.mw-dialog-head h2 { margin: 0; font-size: 1rem; flex: 1; }
.mw-dialog-close { border: 0; background: transparent; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 8px; }
.mw-dialog-body { padding: 16px; overflow: auto; }
.mw-dialog-body > p:first-child { margin-top: 0; }
.mw-dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: #f5f4f4; border-top: 1px solid #e3e1e1; }

/* ---- toasts */
.mw-toasts {
	position: fixed; right: 20px; bottom: 20px; z-index: 1000;
	display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none;
}
.mw-toast {
	position: relative; pointer-events: auto; min-width: 240px; max-width: 420px;
	padding: 10px 40px 10px 14px; border-radius: var(--mw-radius); box-shadow: var(--mw-shadow);
	background: #333; color: #fff; border-left: 4px solid var(--mw-accent);
	animation: mw-toast-in .2s ease-out;
}
.mw-toast-success { border-left-color: #66bb6a; }
.mw-toast-error { border-left-color: #ef5350; }
.mw-toast-warning { border-left-color: #ffb300; }
.mw-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes mw-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mw-toast-action {
	margin-left: 12px; padding: 2px 10px; border: 1px solid rgba(255, 255, 255, .6); border-radius: var(--mw-radius);
	background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.mw-toast-action:hover, .mw-toast-action:focus-visible { background: rgba(255, 255, 255, .15); }

/* ---- Papirkurv (MAKEWEB5-78) */
.mw-trash-tabs { margin-bottom: 12px; }
.mw-trash-tabs .mw-tab { text-decoration: none; }
.mw-trash-tabs .mw-tab[aria-current="page"] {
	color: var(--mw-text); font-weight: 600; background: var(--mw-panel-bg);
	border-color: var(--mw-border-strong); border-bottom-color: var(--mw-panel-bg);
}
.mw-trash-tabs .mw-tab[aria-current="page"] .mw-icon { background: var(--mw-dark); }
.mw-trash-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #e3e1e1; color: var(--mw-text); font-size: 12px; text-align: center; }
.mw-trash-contains { display: block; }

/* ---- small screens: navigation becomes a drawer */
@media (max-width: 800px) {
	:root { --mw-header-h: 56px; }
	.mw-nav-toggle { display: inline-block; }
	.mw-header { padding: 0 12px; gap: 10px; }
	.mw-header-tools .mw-pill:not(.mw-switcher .mw-pill):not(.mw-pill-button) { display: none; }
	.mw-nav {
		position: fixed; top: var(--mw-header-h); bottom: 0; left: 0; z-index: 15; overflow-y: auto;
		transform: translateX(-100%); transition: transform .2s; box-shadow: var(--mw-shadow);
	}
	.mw-nav-open .mw-nav { transform: none; }
	.mw-main { padding: 16px; }
	.mw-list-q { width: 100%; }
	.mw-action-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}

/* ---- rich-text editor (shared/js/mw/richtext.js) */
.mw-rte {
	max-width: 900px; background: #fff; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small);
}
.mw-rte:focus-within { border-color: var(--mw-accent); box-shadow: var(--mw-focus); }
.mw-rte.is-invalid, .mw-field.has-error .mw-rte { border-color: var(--mw-danger); }
.mw-rte-toolbar {
	position: sticky; top: var(--mw-header-h); z-index: 2;
	display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 5px 6px;
	background: #f4f3f3; border-bottom: 1px solid var(--mw-border); border-radius: var(--mw-radius-small) var(--mw-radius-small) 0 0;
}
.mw-rte-group { display: flex; gap: 2px; align-items: center; }
.mw-rte-group + .mw-rte-group { padding-left: 10px; border-left: 1px solid #dcdada; }
.mw-rte-btn {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: var(--mw-radius-small);
	background: transparent; color: var(--mw-darker); font: 600 15px/1 var(--mw-font); cursor: pointer;
}
.mw-rte-btn img { width: 16px; height: 16px; filter: invert(.75); }
.mw-rte-btn:hover:not(:disabled) { background: #fff; border-color: var(--mw-border); }
.mw-rte-btn[aria-pressed="true"] { background: #dfe9f3; border-color: #a8c4df; }
.mw-rte-btn:disabled { opacity: .35; cursor: default; }
.mw-rte-btn:focus-visible { box-shadow: var(--mw-focus); }
.mw-rte-unlink::after {
	content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px;
	background: var(--mw-danger); transform: rotate(-45deg);
}
.mw-rte-table-tool img { filter: invert(.55) sepia(1) hue-rotate(170deg) saturate(3); }
/* .mw-rte-toolbar prefix: the editor sits in a .mw-field, whose `select` rule (padding 7px, width 100%)
   must not reach these 30px dropdowns or it clips their text (MAKEWEB5-58). */
.mw-rte-toolbar .mw-rte-select {
	display: inline-block; width: auto; max-width: 16rem; height: 30px; margin: 0;
	font: inherit; font-size: .85rem; line-height: normal; color: inherit; padding: 0 4px; border: 1px solid var(--mw-border);
	border-radius: var(--mw-radius-small); background: #fff;
}
.mw-rte-toolbar .mw-rte-select:focus { border-color: var(--mw-accent); box-shadow: var(--mw-focus); outline: none; }
.mw-rte-area {
	min-height: 10em; padding: 10px 14px; outline: none; overflow-wrap: break-word; line-height: 1.55;
}
.mw-rte-area > :first-child { margin-top: 0; }
.mw-rte-area > :last-child { margin-bottom: 0; }
.mw-rte-area img { max-width: 100%; height: auto; }
/* Neutral content look, used when the field has no design CSS (.has-design: see below). */
.mw-rte:not(.has-design) .mw-rte-area p { margin: 0 0 .7em; }
.mw-rte:not(.has-design) .mw-rte-area :is(h2, h3, h4) { margin: 1em 0 .4em; line-height: 1.25; }
.mw-rte:not(.has-design) .mw-rte-area blockquote { margin: 0 0 .7em; padding: 4px 14px; border-left: 4px solid var(--mw-border); color: #444; font-style: italic; }
.mw-rte:not(.has-design) .mw-rte-area a { color: var(--mw-accent-dark); }
.mw-rte:not(.has-design) .mw-rte-area hr { border: 0; border-top: 1px solid var(--mw-border-strong); margin: 1em 0; }
.mw-rte:not(.has-design) .mw-rte-area table, .mw-rte-preview table { border-collapse: collapse; margin: 0 0 .7em; min-width: 50%; }
.mw-rte:not(.has-design) .mw-rte-area :is(th, td), .mw-rte-preview th, .mw-rte-preview td { border: 1px solid var(--mw-border); padding: 4px 8px; min-width: 3em; vertical-align: top; }
.mw-rte:not(.has-design) .mw-rte-area th, .mw-rte-preview th { background: #f4f3f3; text-align: left; }
/* With a design (data-mw-design-css): .mw-rte-frame.mw-rte-design gets the site's body styles from
   GET /admin/designs/{id}/editor.css (DesignContent::editorCss); only editing aids are added here. */
.mw-rte-frame { border-radius: 0 0 var(--mw-radius-small) var(--mw-radius-small); }
.mw-rte.has-design .mw-rte-area :where(td, th) { outline: 1px dashed rgba(127, 127, 127, .45); outline-offset: -1px; min-width: 2em; }
.mw-rte.has-design .mw-rte-area { line-height: inherit; }
.mw-rte-source {
	display: block; width: 100%; min-height: 10em; margin: 0; padding: 10px 14px; border: 0; resize: vertical;
	font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fbfbfb; color: #222; outline: none;
}
.mw-rte.is-source .mw-rte-toolbar { background: #ecebeb; }
.mw-rte-inline { display: flex; gap: 6px; }
.mw-rte-inline input { flex: 1; }
.mw-rte-dialog .mw-field input[type="text"], .mw-rte-dialog .mw-field input[type="number"] {
	display: block; width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small);
}
.mw-rte-dialog .mw-field input[type="number"] { width: 100px; }
.mw-rte-preview { background: #fff; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); padding: 10px 14px; max-width: 900px; }
.mw-rte-preview blockquote { margin: 0 0 .7em; padding: 4px 14px; border-left: 4px solid var(--mw-border); font-style: italic; }
.mw-code { white-space: pre-wrap; word-break: break-all; background: #f7f7f7; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); padding: 10px; font-size: 12px; max-width: 900px; max-height: 320px; overflow: auto; }
.mw-picker-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mw-picker-list button {
	display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 8px; cursor: pointer;
	font: inherit; background: #fff; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small);
}
.mw-picker-list button:hover { border-color: var(--mw-accent); background: var(--mw-info-bg); }
.mw-picker-list img { width: 48px; height: 32px; object-fit: cover; border-radius: 3px; }

/* ---- login page (cms/layouts/auth.phtml) and account page */
body.mw-auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
.mw-auth-box {
	width: 100%; max-width: 380px; background: var(--mw-panel-bg); border-radius: var(--mw-radius);
	box-shadow: var(--mw-shadow); overflow: hidden;
}
.mw-auth-head { background: var(--mw-header-bg); color: var(--mw-header-fg); padding: 18px 24px; }
.mw-auth-body { padding: 24px; }
.mw-auth-body h1 { font-size: 1.2rem; margin: 0 0 16px; }
.mw-check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.mw-hint { font-size: .78rem; color: var(--mw-muted); margin: 4px 0 0; }
.mw-token-new { background: var(--mw-success-bg); border: 1px solid var(--mw-success); border-radius: var(--mw-radius); padding: 12px 16px; margin: 0 0 16px; }
.mw-token-new code { display: block; word-break: break-all; font-size: .9rem; padding: 8px; background: #fff; border-radius: var(--mw-radius-small); margin-top: 6px; user-select: all; }
.mw-panel { background: var(--mw-panel-bg); border: 1px solid var(--mw-border); border-radius: var(--mw-radius); padding: 20px; margin: 0 0 20px; }
.mw-panel h2 { font-size: 1.05rem; margin: 0 0 12px; }
.mw-inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.mw-inline-form .mw-field { margin: 0; flex: 1 1 240px; }

/* ---- tree view (shared/js/mw/tree.js) and menu editor (cms/views/menus) */
.mw-tree-root { background: var(--mw-panel-bg); border: 1px solid var(--mw-border); border-radius: var(--mw-radius); margin: 0 0 20px; padding: 0 0 8px; }
.mw-tree-root.is-drop-target { outline: 2px dashed var(--mw-accent); outline-offset: -2px; }
.mw-tree-root-head {
	display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px;
	background: var(--mw-darker); color: #fff; border-radius: var(--mw-radius) var(--mw-radius) 0 0;
}
.mw-tree-root-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; margin: 0; flex: 1 1 auto; }
.mw-tree-root-actions { display: flex; gap: 6px; }
.mw-tree-root-head .mw-btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.mw-tree-empty { margin: 0; padding: 18px 16px; color: var(--mw-muted); font-style: italic; }
.mw-tree { list-style: none; margin: 0; padding: 0; }
.mw-tree-node.is-collapsed > .mw-tree { display: none; }
.mw-tree-row {
	position: relative; display: flex; align-items: center; gap: 6px; min-height: 38px;
	padding: 3px 10px 3px calc(8px + var(--mw-tree-level, 0) * 26px); border-bottom: 1px solid #eee;
}
.mw-tree-row:hover { background: var(--mw-info-bg); }
.mw-tree-toggle {
	flex: 0 0 22px; width: 22px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer;
	color: var(--mw-muted); font-size: .9rem; border-radius: var(--mw-radius-small);
}
.mw-tree-toggle:hover:not(.is-leaf) { background: #fff; color: var(--mw-text); }
.mw-tree-toggle.is-leaf { cursor: default; }
.mw-tree-handle {
	flex: 0 0 24px; width: 24px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: var(--mw-radius-small);
	background: transparent; color: var(--mw-muted); cursor: grab; touch-action: none; font-size: 1rem; line-height: 1;
}
.mw-tree-handle:hover, .mw-tree-handle:focus-visible { border-color: var(--mw-border); background: #fff; color: var(--mw-text); }
.mw-tree-handle:focus-visible { outline: none; box-shadow: var(--mw-focus); }
.mw-tree-content { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.mw-tree-main { display: flex; align-items: baseline; gap: 10px; flex: 1 1 260px; min-width: 0; }
.mw-tree-title { font-weight: 600; color: var(--mw-text); text-decoration: none; }
.mw-tree-title:hover { color: var(--mw-accent-dark); text-decoration: underline; }
.mw-tree-path { font-size: .75rem; color: var(--mw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-tree-meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.mw-tree-actions { display: flex; flex: 0 0 auto; }
.mw-tree-actions .mw-row-action { padding: 2px; }
.mw-badge { display: inline-block; padding: 1px 7px; border-radius: 10px; background: #eee; color: var(--mw-darker); font-size: .72rem; }
.mw-status.is-partial::before { content: "◐"; color: var(--mw-warning); }
.mw-tree-view.is-dragging, .mw-tree-view.is-dragging * { cursor: grabbing !important; user-select: none; }
.mw-tree-node.is-dragging > .mw-tree-row { opacity: .4; }
.mw-tree-node.is-dragging > .mw-tree { opacity: .4; }
.mw-tree-row.is-drop-inside { background: var(--mw-info-bg); box-shadow: inset 0 0 0 2px var(--mw-accent); }
.mw-tree-row.is-drop-before::before, .mw-tree-row.is-drop-after::after {
	content: ""; position: absolute; left: calc(40px + var(--mw-tree-level, 0) * 26px); right: 8px; height: 3px;
	background: var(--mw-accent); border-radius: 2px; pointer-events: none;
}
.mw-tree-row.is-drop-before::before { top: -2px; }
.mw-tree-row.is-drop-after::after { bottom: -2px; }
.mw-tree-ghost {
	position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; padding: 6px 12px; border-radius: var(--mw-radius);
	background: var(--mw-darker); color: #fff; font-weight: 600; box-shadow: var(--mw-shadow); white-space: nowrap;
}
.mw-tree-view[aria-busy="true"] { opacity: .7; pointer-events: none; }
.mw-dialog-choices { border: 0; padding: 0; margin: 0; }
.mw-dialog-choices legend { padding: 0; margin: 0 0 6px; }
kbd { font: .8em var(--mw-font); padding: 1px 5px; border: 1px solid var(--mw-border); border-bottom-width: 2px; border-radius: 3px; background: #fff; }
/* menu edit form: what the page content is and where its articles are listed too (MAKEWEB5-64) */
.mw-menu-content-hint { max-width: 760px; margin: 0 0 16px; }
.mw-menu-listed-on { max-width: 760px; margin: 0 0 18px; padding: 10px 14px; border-radius: var(--mw-radius); border-left: 4px solid var(--mw-accent); background: var(--mw-info-bg); }
.mw-menu-listed-on p { margin: 0; }
.mw-menu-listed-on ul { margin: 6px 0; padding-left: 20px; }
.mw-slug-input { display: flex; align-items: stretch; max-width: 640px; }
.mw-slug-prefix {
	display: flex; align-items: center; padding: 0 8px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	border: 1px solid var(--mw-border); border-right: 0; border-radius: var(--mw-radius-small) 0 0 var(--mw-radius-small);
	background: #f3f2f2; color: var(--mw-muted); font-family: ui-monospace, monospace; font-size: .85rem;
}
.mw-field .mw-slug-input input[type="text"] { flex: 1 1 auto; border-radius: 0 var(--mw-radius-small) var(--mw-radius-small) 0; font-family: ui-monospace, monospace; }
.mw-field input[type="number"]#f-order { width: 100px; }
[data-counter-for].is-over { color: var(--mw-warning); font-weight: 600; }
.mw-serp { max-width: 600px; padding: 12px 16px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius); background: #fff; font-family: Arial, sans-serif; }
.mw-serp p { margin: 0; }
.mw-serp-url { font-size: .8rem; color: #202124; }
.mw-serp-title { font-size: 1.15rem; color: #1a0dab; margin: 2px 0 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-serp-desc { font-size: .85rem; color: #4d5156; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mw-infolist { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0 0; font-size: .85rem; }
.mw-infolist dt { color: var(--mw-muted); }
.mw-infolist dd { margin: 0; }
.mw-plain-list { list-style: none; margin: 0; padding: 0; }

/* ---- Form builder (cms/views/forms, shared/js/mw/pages/form-edit.js) */
.mw-subhead { font-size: 1rem; margin: 20px 0 8px; }
.mw-inline-create { display: flex; gap: 6px; align-items: center; }
.mw-inline-create input { font: inherit; padding: 5px 9px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); width: 220px; }
.mw-detail-table { max-width: 900px; background: var(--mw-panel-bg); }
.mw-detail-table th { width: 220px; text-align: left; vertical-align: top; }
.mwf-builder { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .mwf-builder { grid-template-columns: 1fr; } }
.mwf-fields { list-style: none; margin: 0 0 12px; padding: 0; }
.mwf-empty { padding: 16px; border: 1px dashed var(--mw-border-strong); border-radius: var(--mw-radius); background: var(--mw-panel-bg); }
.mwf-field { background: var(--mw-panel-bg); border: 1px solid var(--mw-border); border-radius: var(--mw-radius); margin-bottom: 6px; }
.mwf-field.is-open { border-color: var(--mw-border-strong); }
.mwf-field.has-error { border-color: var(--mw-danger); }
.mwf-field.is-dragging { opacity: .45; }
.mwf-field.is-drop-before { box-shadow: 0 -3px 0 var(--mw-accent); }
.mwf-field.is-drop-after { box-shadow: 0 3px 0 var(--mw-accent); }
.mwf-field-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px; }
.mwf-handle { cursor: grab; padding: 4px 6px; color: var(--mw-muted); user-select: none; font-size: 1.1rem; }
.mwf-toggle { all: unset; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 4px; border-radius: var(--mw-radius-small); }
.mwf-toggle:focus-visible { box-shadow: var(--mw-focus); }
.mwf-toggle::after { content: "▸"; margin-left: auto; opacity: .6; }
.mwf-field.is-open .mwf-toggle::after { content: "▾"; }
.mwf-type-badge { font-size: .72rem; text-transform: uppercase; letter-spacing: .3px; background: #eceaea; border-radius: 3px; padding: 2px 6px; white-space: nowrap; color: #444; }
.mwf-field-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mwf-req { color: var(--mw-danger); font-weight: 700; }
.mwf-field-tools { display: flex; gap: 2px; }
.mwf-field-tools .mw-row-action { min-width: 28px; justify-content: center; margin-left: 0; padding: 2px 6px; }
.mwf-field-tools .mw-row-action:disabled { opacity: .35; cursor: default; }
.mw-form-actions[hidden] { display: none; }
.mwf-field-body { padding: 10px 14px 4px 38px; border-top: 1px solid #eee; }
.mwf-field-body .mw-field-row > .mw-field { flex: 1 1 200px; }
.mwf-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mwf-add label { font-size: .8rem; font-weight: 600; }
.mwf-add select { font: inherit; padding: 4px 6px; }
.mwf-preview { position: sticky; top: 12px; }
.mwf-preview .mw-subhead { margin-top: 0; }
.mwf-preview-body { background: #fff; border: 1px solid var(--mw-border); border-radius: var(--mw-radius); padding: 16px; }
.mwf-embed { margin-top: 20px; padding: 10px 12px; background: var(--mw-panel-bg); border-radius: var(--mw-radius); }
.mwf-summary { display: inline-block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---- file library (shared/js/mw/filelibrary.js): page and picker dialog */
.mw-lib { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.mw-lib-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mw-lib-search {
	flex: 1 1 200px; max-width: 320px; margin-left: auto; padding: 6px 10px; font: inherit;
	border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #fff;
}
.mw-lib-search:focus { border-color: var(--mw-accent); box-shadow: var(--mw-focus); outline: none; }
.mw-lib-viewtoggle { display: inline-flex; }
.mw-lib-viewtoggle .mw-btn { border-radius: 0; }
.mw-lib-viewtoggle .mw-btn:first-child { border-radius: var(--mw-radius-small) 0 0 var(--mw-radius-small); }
.mw-lib-viewtoggle .mw-btn:last-child { border-radius: 0 var(--mw-radius-small) var(--mw-radius-small) 0; margin-left: -1px; }
.mw-lib-viewtoggle .mw-btn[aria-pressed="true"] { background: var(--mw-dark); border-color: var(--mw-dark); color: #fff; }
.mw-lib-panes {
	display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 10px;
	height: calc(100vh - var(--mw-header-h) - 150px); min-height: 420px;
}
.mw-lib-tree-pane, .mw-lib-main, .mw-lib-details {
	background: var(--mw-panel-bg); border: 1px solid var(--mw-border); border-radius: var(--mw-radius); min-height: 0; overflow: auto;
}
.mw-lib-pane-title { background: var(--mw-darker); color: #fff; padding: 6px 10px; font-size: .8rem; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.mw-lib-tree, .mw-lib-tree ul { list-style: none; margin: 0; padding: 0; }
.mw-lib-tree { padding: 4px 0; }
.mw-lib-folder { display: flex; align-items: center; gap: 2px; padding: 1px 4px; border-radius: var(--mw-radius-small); margin: 0 4px; }
.mw-lib-folder:hover { background: rgba(0, 0, 0, .04); }
.mw-lib-folder.is-current { background: var(--mw-info-bg); }
.mw-lib-folder.is-drop-target { background: #d4e6f7; outline: 2px dashed var(--mw-accent); }
.mw-lib-folder-toggle { flex: none; width: 18px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--mw-muted); font-size: .8rem; }
.mw-lib-folder-name {
	flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit;
	text-align: left; padding: 4px 2px; cursor: pointer; color: inherit;
}
.mw-lib-folder-name span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-lib-folder.is-current .mw-lib-folder-name { font-weight: 600; }
.mw-lib-folder-icon { width: 18px; height: 18px; background: var(--mw-dark); border-radius: 3px; padding: 2px; flex: none; }
.mw-lib-count { margin-left: auto; font-size: .72rem; color: var(--mw-muted); padding-left: 4px; }
.mw-lib-folder-actions { display: none; gap: 2px; }
.mw-lib-folder:hover .mw-lib-folder-actions, .mw-lib-folder:focus-within .mw-lib-folder-actions { display: inline-flex; }
.mw-lib-folder-actions button { border: 0; padding: 0; background: var(--mw-dark); border-radius: 3px; width: 20px; height: 20px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mw-lib-folder-actions button:hover { background: var(--mw-darker); }
.mw-lib-folder-actions img { width: 14px; height: 14px; }

.mw-lib-main { display: flex; flex-direction: column; overflow: hidden; }
.mw-lib-heading { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--mw-darker); color: #fff; font-size: .85rem; min-height: 31px; }
.mw-lib-heading .mw-btn-ghost { color: #fff; }
.mw-lib-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mw-lib-crumb { border: 0; background: none; color: #fff; font: inherit; padding: 0; cursor: pointer; }
.mw-lib-crumb:hover { text-decoration: underline; }
.mw-lib-crumb:last-child { font-weight: 600; }
.mw-lib-crumb-sep { opacity: .6; }
.mw-lib-queue { list-style: none; margin: 0; padding: 6px 10px; border-bottom: 1px solid var(--mw-border); display: grid; gap: 4px; max-height: 140px; overflow: auto; background: #fafafa; }
.mw-lib-queue-item { display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .8rem; }
.mw-lib-queue-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-lib-queue-item progress { width: 100%; height: 10px; }
.mw-lib-queue-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mw-muted); }
.mw-lib-queue-item.is-done .mw-lib-queue-status { color: var(--mw-success); }
.mw-lib-queue-item.is-error .mw-lib-queue-status { color: var(--mw-danger); white-space: normal; }
.mw-lib-queue-close { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; }
.mw-lib-files-wrap { position: relative; flex: 1; min-height: 0; overflow: auto; }
.mw-lib-files { min-height: 100%; outline: none; }
.mw-lib-files:focus-visible { box-shadow: inset var(--mw-focus); }
.mw-lib-files.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; padding: 10px; align-content: start; }
.mw-lib-files.is-grid .mw-lib-file {
	display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid transparent;
	border-radius: var(--mw-radius-small); cursor: pointer; user-select: none; min-width: 0;
}
.mw-lib-files.is-grid .mw-lib-file:hover { background: rgba(0, 0, 0, .04); }
.mw-lib-file.is-selected, .mw-lib-files.is-grid .mw-lib-file.is-selected { background: var(--mw-info-bg); border-color: var(--mw-accent); }
.mw-lib-thumb {
	width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; position: relative;
	background: #f3f2f2 repeating-conic-gradient(#e6e4e4 0 25%, transparent 0 50%) 0 0 / 16px 16px; border: 1px solid #e0dede; border-radius: 3px; overflow: hidden;
}
.mw-lib-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mw-lib-thumb.is-icon, .mw-lib-thumb-small.is-icon, .mw-lib-thumb-large.is-icon { background: var(--mw-dark); flex-direction: column; gap: 4px; color: #fff; }
.mw-lib-thumb.is-icon img { width: 40px; height: 40px; }
.mw-lib-ext { font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.mw-lib-file-name { font-size: .78rem; text-align: center; word-break: break-all; line-height: 1.25; max-height: 3.75em; overflow: hidden; }
.mw-lib-files.is-list { padding: 0; }
.mw-lib-table { width: 100%; border: 0; border-radius: 0; }
.mw-lib-table th { position: sticky; top: 0; z-index: 1; }
.mw-lib-table .mw-lib-file { cursor: pointer; user-select: none; }
.mw-lib-table .mw-lib-file-name { text-align: left; max-height: none; word-break: normal; overflow-wrap: anywhere; font-size: inherit; }
.mw-lib-table td { white-space: nowrap; }
.mw-lib-table td.mw-lib-file-name { white-space: normal; }
.mw-lib-sort { border: 0; background: none; font: inherit; font-weight: 600; color: inherit; cursor: pointer; padding: 0; }
.mw-lib-cell-thumb { width: 44px; }
.mw-lib-thumb-small { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 3px; overflow: hidden; background: #f3f2f2; }
.mw-lib-thumb-small img { max-width: 100%; max-height: 100%; }
.mw-lib-thumb-small.is-icon img { width: 22px; height: 22px; }
.mw-lib-thumb-small.is-icon .mw-lib-ext { display: none; }
.mw-lib-empty { color: var(--mw-muted); padding: 30px 16px; text-align: center; grid-column: 1 / -1; }
.mw-lib-dropzone {
	position: absolute; inset: 6px; display: none; align-items: center; justify-content: center; pointer-events: none;
	border: 3px dashed var(--mw-accent); border-radius: var(--mw-radius); background: rgba(232, 241, 250, .9);
	font-weight: 600; color: var(--mw-accent-dark);
}
.mw-lib-files-wrap.is-dropping .mw-lib-dropzone { display: flex; }
.mw-lib-status { display: flex; gap: 12px; justify-content: space-between; background: var(--mw-accent); color: #fff; font-size: .78rem; padding: 4px 10px; }
.mw-lib-status-right { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-lib.is-loading .mw-lib-files { opacity: .6; }

.mw-lib-details { padding: 12px; }
.mw-lib-details-title { font-size: .95rem; margin: 0 0 10px; word-break: break-all; }
.mw-lib-details-empty { color: var(--mw-text); font-size: .88rem; }
.mw-lib-preview {
	display: flex; align-items: center; justify-content: center; width: 100%; min-height: 120px; max-height: 220px; padding: 0; margin: 0 0 10px;
	border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); overflow: hidden; cursor: zoom-in;
	background: #f3f2f2 repeating-conic-gradient(#e6e4e4 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}
.mw-lib-preview img { max-width: 100%; max-height: 218px; object-fit: contain; }
.mw-lib-preview.is-icon { cursor: default; background: none; border: 0; }
.mw-lib-thumb-large { width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; border-radius: var(--mw-radius-small); }
.mw-lib-thumb-large.is-icon img { width: 56px; height: 56px; }
.mw-lib-info { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .8rem; margin: 0 0 12px; }
.mw-lib-info dt { color: var(--mw-muted); }
.mw-lib-info dd { margin: 0; word-break: break-word; }
.mw-lib-url-row { display: flex; gap: 4px; }
.mw-lib-url-row input { flex: 1; min-width: 0; font-size: .78rem; padding: 4px 6px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #f7f7f7; }
.mw-lib-variants { font-size: .78rem; margin: -8px 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.mw-lib-details .mw-field { margin-bottom: 10px; }
.mw-lib-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mw-lib-actions a.mw-btn { text-decoration: none; display: inline-flex; align-items: center; }
.mw-lib-multi { font-size: .8rem; padding-left: 18px; margin: 0 0 12px; max-height: 200px; overflow: auto; word-break: break-all; }
.mw-lib-limits { font-size: .78rem; }

/* picker dialog: the library without the page chrome */
.mw-dialog-library { width: min(1180px, calc(100vw - 32px)); height: min(760px, calc(100vh - 48px)); max-height: none; }
.mw-dialog-library[open] { display: flex; flex-direction: column; }
.mw-dialog-library .mw-dialog-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px; background: var(--mw-content-bg); }
.mw-dialog-library .mw-lib-picker, .mw-dialog-library .mw-lib { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mw-dialog-library .mw-lib-panes { height: auto; flex: 1; min-height: 0; grid-template-columns: 200px minmax(0, 1fr) 260px; }
.mw-dialog-preview { width: min(1100px, calc(100vw - 32px)); }
.mw-lib-preview-full { display: block; max-width: 100%; max-height: calc(100vh - 220px); margin: 0 auto; object-fit: contain; }
.mw-lib-preview-file { display: flex; flex-direction: column; align-items: center; }
.mw-dialog-prompt .mw-field input[type="text"], .mw-dialog-prompt .mw-field select { width: 100%; }
.mw-picker-demo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mw-picker-demo-result { margin-bottom: 12px; }
.mw-picker-demo-result img { max-width: 100%; height: auto; border: 1px solid var(--mw-border); }
.mw-picker-demo-json { white-space: pre-wrap; word-break: break-all; background: #f7f7f7; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); padding: 10px; font-size: 12px; max-height: 360px; overflow: auto; }

@media (max-width: 1100px) {
	.mw-lib-panes { grid-template-columns: 200px minmax(0, 1fr); height: auto; }
	.mw-lib-main { min-height: 420px; }
	.mw-lib-details { grid-column: 1 / -1; }
	.mw-dialog-library .mw-lib-panes { grid-template-columns: 170px minmax(0, 1fr); }
}
@media (max-width: 700px) {
	.mw-lib-panes, .mw-dialog-library .mw-lib-panes { grid-template-columns: 1fr; }
	.mw-lib-tree-pane { max-height: 180px; }
}

/* ---- template (design) editor: code editor, file switcher, live preview */
.mw-mono, .mw-code-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.mw-subhead { font-size: 1rem; margin: 24px 0 12px; }
.mw-small { font-size: .82rem; }
.mw-link { background: none; border: 0; padding: 0; font: inherit; color: var(--mw-accent-dark); text-decoration: underline; cursor: pointer; text-align: left; }
.mw-codeedit { border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #fff; overflow: hidden; }
.mw-codeedit:focus-within { border-color: var(--mw-accent); box-shadow: var(--mw-focus); }
.mw-codeedit-toolbar { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: #f6f5f5; border-bottom: 1px solid var(--mw-border); flex-wrap: wrap; }
.mw-codeedit input.mw-codeedit-search { display: inline-block; width: 220px; max-width: 100%; font: inherit; font-size: .85rem; padding: 3px 7px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); }
.mw-codeedit input.mw-codeedit-search.is-miss { border-color: var(--mw-danger); background: #fffafa; }
.mw-codeedit-count { font-size: .8rem; color: var(--mw-muted); min-width: 60px; }
.mw-codeedit-status { margin-left: auto; font-size: .8rem; color: var(--mw-muted); }
.mw-codeedit-body { display: flex; position: relative; }
.mw-codeedit-gutter {
	flex: none; overflow: hidden; background: #f3f3f3; border-right: 1px solid var(--mw-border); color: #999;
	text-align: right; user-select: none; padding: 8px 6px 8px 4px;
}
.mw-codeedit-lines { white-space: pre; font: 13px/19px ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; will-change: transform; }
.mw-field textarea.mw-code-text, textarea.mw-code-text {
	flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none !important;
	padding: 8px 10px; font-size: 13px; line-height: 19px; tab-size: 4; -moz-tab-size: 4; white-space: pre; overflow: auto;
	resize: vertical; min-height: 380px; height: 62vh; background: #fff; color: #1f1f1f;
}
.mw-field textarea.mw-code-text[aria-invalid="true"] { background: #fffafa; }
.mw-tpl-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 42%); gap: 16px; align-items: start; }
.mw-tpl-workspace[data-preview-open="false"] { grid-template-columns: minmax(0, 1fr); }
.mw-tpl-workspace[data-preview-open="false"] .mw-tpl-preview { display: none; }
.mw-tpl-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.mw-tpl-file-btn { text-transform: none; font-weight: 500; }
.mw-tpl-file-btn.is-current { background: var(--mw-dark); border-color: var(--mw-dark); color: #fff; }
.mw-tpl-file-btn.has-error { border-color: var(--mw-danger); color: var(--mw-danger); }
.mw-tpl-file-btn.is-current.has-error { background: var(--mw-danger); color: #fff; }
.mw-tpl-file-btn.is-new::after { content: " ●"; color: var(--mw-accent); }
.mw-tpl-add { text-transform: none; }
.mw-tpl-asset { display: flex; gap: 8px; align-items: center; max-width: 640px; }
.mw-tpl-asset input { flex: 1 1 auto; }
.mw-tpl-asset .mw-btn { flex: none; text-transform: none; }
/* Stil tab (design tokens and presets) */
.mw-tpl-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; max-width: 900px; }
.mw-tpl-color-input { display: flex; gap: 6px; align-items: center; }
.mw-tpl-color-input input[type="color"] { flex: none; width: 40px; height: 34px; padding: 2px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #fff; cursor: pointer; }
.mw-tpl-color-input input[type="text"] { flex: 1 1 auto; min-width: 0; }
.mw-tpl-presets td { vertical-align: middle; }
.mw-tpl-presets input[type="text"] { width: 100%; min-width: 100px; }
.mw-tpl-sections { display: grid; gap: 10px; max-width: 900px; }
.mw-tpl-section { border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); padding: 10px 12px; background: var(--mw-panel-bg); }
.mw-tpl-section-head { display: flex; align-items: center; gap: 10px; }
.mw-tpl-section-head code { flex: 0 0 auto; min-width: 6em; }
.mw-tpl-section-head input { flex: 1 1 auto; min-width: 0; }
.mw-tpl-section-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.mw-tpl-section-field { display: flex; flex-direction: column; gap: 2px; font-size: .82rem; color: var(--mw-muted); }
.mw-tpl-section-field select { width: 100%; }
.mw-tpl-file-head { display: flex; align-items: flex-end; gap: 10px; }
.mw-tpl-file-head .mw-field { flex: 0 1 320px; margin-bottom: 10px; }
.mw-tpl-file-head .mw-btn { margin-bottom: 12px; }
.mw-tpl-help { margin-top: 16px; font-size: .88rem; }
.mw-tpl-help summary { cursor: pointer; font-weight: 600; }
.mw-tpl-help h3 { font-size: .95rem; margin: 14px 0 6px; }
.mw-tpl-help code { font-size: .82rem; background: #f3f3f3; padding: 0 3px; border-radius: 3px; }
.mw-table-compact td { padding: 5px 8px; vertical-align: top; }
.mw-tpl-preview { position: sticky; top: 12px; background: var(--mw-panel-bg); border: 1px solid var(--mw-border-strong); border-radius: var(--mw-radius); padding: 10px; }
.mw-tpl-preview-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 8px; }
.mw-tpl-preview-sizes { display: inline-flex; gap: 4px; }
.mw-tpl-preview-sizes [aria-pressed="true"] { background: var(--mw-dark); border-color: var(--mw-dark); color: #fff; }
.mw-tpl-preview-status { font-size: .8rem; margin-left: auto; }
.mw-tpl-preview-errors { margin: 0 0 8px; padding: 8px 12px 8px 28px; background: var(--mw-danger-bg); color: var(--mw-danger); border-radius: var(--mw-radius-small); font-size: .85rem; }
.mw-tpl-preview-errors .mw-link { color: var(--mw-danger); }
.mw-tpl-preview-frame { overflow: auto; background: #d8d6d6; border-radius: var(--mw-radius-small); height: 72vh; }
.mw-tpl-preview-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; margin: 0 auto; }
.mw-tpl-preview-note { font-size: .78rem; margin: 6px 0 0; }
@media (max-width: 1100px) {
	.mw-tpl-workspace { grid-template-columns: minmax(0, 1fr); }
	.mw-tpl-preview { position: static; }
}

/* Visual templates (MAKEWEB5-44): shell picker ("Ny mal", Oppsett tab), the embedded block editor */
.mw-tpl-shells { border: 0; padding: 0; margin: 0 0 12px; }
.mw-tpl-shell-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 6px; }
.mw-tpl-shell-picker.is-compact { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.mw-tpl-shell-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius); background: var(--mw-panel-bg); cursor: pointer; }
.mw-tpl-shell-card:hover { border-color: var(--mw-accent); }
.mw-tpl-shell-card:has(input:checked) { border-color: var(--mw-accent); box-shadow: inset 0 0 0 2px var(--mw-accent); background: var(--mw-info-bg); }
.mw-tpl-shell-card:focus-within { box-shadow: var(--mw-focus); }
.mw-tpl-shell-card input { position: absolute; top: 8px; right: 8px; margin: 0; }
.mw-tpl-shell-wire { display: block; width: 100%; max-width: 160px; height: auto; border: 1px solid #dcdada; border-radius: 3px; background: #fff; }
.mw-tpl-shell-picker.is-compact .mw-tpl-shell-wire { max-width: 108px; }
.mw-tpl-shell-wire .w-head { fill: #e3e1e1; }
.mw-tpl-shell-wire .w-logo { fill: #8f8c8c; }
.mw-tpl-shell-wire .w-menu, .mw-tpl-shell-wire .w-crumbs { fill: #a9a6a6; }
.mw-tpl-shell-wire .w-banner { fill: var(--mw-accent); }
.mw-tpl-shell-wire .w-band { fill: var(--mw-accent-dark); }
.mw-tpl-shell-wire .w-band-light { fill: var(--mw-info-bg); }
.mw-tpl-shell-wire .w-card { fill: #fff; stroke: #c9c6c6; stroke-width: .5; }
.mw-tpl-shell-wire .w-text { fill: #cfcccc; }
.mw-tpl-shell-wire .w-text-inv { fill: rgba(255, 255, 255, .85); }
.mw-tpl-shell-wire .w-button { fill: #f0a830; }
.mw-tpl-shell-wire .w-side { fill: #eeecec; }
.mw-tpl-shell-wire .w-foot { fill: #58595b; }
.mw-tpl-areas.is-embedded .mw-be-toolbar { margin-bottom: 6px; min-height: 1em; }
.mw-tpl-readonly { background: #f6f5f5; color: #444; }

/* Article editor (MAKEWEB5-14) */
.mw-article-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 16px; margin-bottom: 8px; }
.mw-article-filters .mw-field { margin-bottom: 8px; }
.mw-article-filters .mw-hint { margin: 0 0 14px; }
.mw-article-status { font-size: .82rem; color: var(--mw-muted); margin: 0 0 8px auto; }
.mw-article-status + .mw-dirty-indicator { margin-left: 0; }
.mw-article-image { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.mw-article-image-preview { width: 240px; height: 180px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px dashed var(--mw-border-strong); border-radius: var(--mw-radius-small); overflow: hidden; }
.mw-article-image-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mw-article-image-info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.mw-article-image-name { margin: 0; font-size: .85rem; word-break: break-all; }
.mw-article-menus legend { font-weight: 600; }
.mw-article-menu-group .mw-subhead { margin: 14px 0 4px; }
.mw-checktree { list-style: none; margin: 0; padding: 0; }
.mw-checktree li { padding-left: calc(var(--depth, 0) * 22px); }
.mw-checktree .is-disabled { color: var(--mw-muted); cursor: default; }
.mw-page-picker { max-height: 50vh; overflow: auto; margin-top: 10px; }
.mw-page-picker li { padding-left: calc(var(--depth, 0) * 16px); }
#panel-preview .mw-tpl-preview-frame { height: 70vh; }

/* ---- site settings (MAKEWEB5-40, cms/views/settings/edit.phtml) */
.mw-settings-form .mw-field-row > .mw-field { flex: 1 1 240px; }
.mw-settings-form .mw-field-row > .mw-settings-zip { flex: 0 0 9rem; }
.mw-settings-image .mw-article-image-preview.is-small { width: 96px; height: 96px; }
.mw-social-rows { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.mw-social-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px; background: #fff; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); }
.mw-social-row.has-error { border-color: var(--mw-danger, #b3261e); }
.mw-field .mw-social-row select { flex: 0 0 9rem; width: auto; }
.mw-field .mw-social-row input { width: auto; }
.mw-social-row .mw-social-url { flex: 1 1 260px; min-width: 0; }
.mw-social-row .mw-social-label { flex: 0 1 11rem; min-width: 0; }
.mw-social-row .mw-social-actions { display: flex; gap: 4px; margin-left: auto; }
.mw-social-row .mw-social-error { flex: 1 0 100%; margin: 0; color: var(--mw-danger, #b3261e); font-size: .85rem; }

/* ---- page content editor (MAKEWEB5-42, shared/js/mw/blockeditor.js): mw-be-* */
.mw-be-head { margin-bottom: 10px; }
.mw-be-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mw-be-toolbar .mw-btn-primary.is-dirty { box-shadow: 0 0 0 3px rgba(224, 123, 0, .35); }
.mw-be-toolbar-right { margin-left: auto; display: flex; gap: 8px; }
.mw-be-status { font-size: .85rem; }
.mw-be-alert { padding: 10px 14px; margin-bottom: 10px; border-radius: var(--mw-radius-small); background: var(--mw-danger-bg); color: var(--mw-danger); border: 1px solid #f0c4c0; }
.mw-be-alert.is-conflict { background: var(--mw-warning-bg); color: var(--mw-warning); border-color: #ecd28f; }
.mw-be-note { margin: 0 0 10px; padding: 8px 12px; background: var(--mw-info-bg); border-radius: var(--mw-radius-small); font-size: .9rem; }
.mw-be-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 16px; align-items: start; }
.mw-be-preview { position: sticky; top: 8px; min-width: 0; }
.mw-be-preview-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mw-be-preview-sizes { display: flex; gap: 4px; }
.mw-be-preview-sizes [aria-pressed="true"] { background: var(--mw-dark); border-color: var(--mw-dark); color: #fff; }
.mw-be-preview-frame { background: #d8d6d6; border-radius: var(--mw-radius-small); height: calc(100vh - 150px); min-height: 420px; overflow: auto; }
.mw-be-preview-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; margin: 0 auto; }
.mw-be-side { min-width: 0; background: var(--mw-panel-bg); border: 1px solid var(--mw-border); border-radius: var(--mw-radius); padding: 12px; }
.mw-be-area + .mw-be-area { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--mw-border); }
.mw-be-area-title { font-size: .95rem; margin: 0 0 8px; }
.mw-be-area.is-drop-target { outline: 2px dashed var(--mw-accent); outline-offset: 4px; }
.mw-be-sections, .mw-be-blocks { list-style: none; margin: 0; padding: 0; }
.mw-be-section { margin: 0 0 10px; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #faf9f9; }
.mw-be-section.is-hidden { opacity: .6; }
.mw-be-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--mw-radius-small); position: relative; }
.mw-be-section-row { background: #eeecec; border-radius: var(--mw-radius-small) var(--mw-radius-small) 0 0; }
.mw-be-row.is-selected { background: var(--mw-info-bg); box-shadow: inset 0 0 0 2px var(--mw-accent); }
.mw-be-row.has-error { box-shadow: inset 0 0 0 2px var(--mw-danger); background: var(--mw-danger-bg); }
.mw-be-row.is-drop-before::before, .mw-be-row.is-drop-after::after,
.mw-be-section.is-drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--mw-accent); border-radius: 2px; pointer-events: none; }
.mw-be-row.is-drop-before::before { top: -3px; }
.mw-be-row.is-drop-after::after { bottom: -3px; }
.mw-be-section.is-drop-after { position: relative; }
.mw-be-section.is-drop-after::after { bottom: -7px; }
.mw-be-handle {
	flex: none; width: 24px; height: 28px; border: 0; background: none; cursor: grab; color: var(--mw-muted);
	font-size: 16px; line-height: 1; border-radius: var(--mw-radius-small); touch-action: none; padding: 0;
}
.mw-be-handle:hover { background: rgba(0, 0, 0, .07); color: var(--mw-text); }
.mw-be-outline.is-dragging, .mw-be-outline.is-dragging * { cursor: grabbing !important; user-select: none; }
.is-dragging > .mw-be-row { opacity: .45; }
.mw-be-label {
	flex: 1; min-width: 0; text-align: left; border: 0; background: none; font: inherit; color: inherit; padding: 4px 2px; cursor: pointer;
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px;
}
.mw-be-label:hover strong { text-decoration: underline; }
.mw-be-meta { color: var(--mw-muted); font-size: .8rem; }
.mw-be-summary { flex-basis: 100%; color: var(--mw-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-be-actions { display: flex; gap: 1px; flex: none; }
.mw-be-action {
	width: 24px; height: 26px; border: 1px solid transparent; background: none; border-radius: var(--mw-radius-small);
	cursor: pointer; color: #444; font-size: 13px; padding: 0; line-height: 1;
}
.mw-be-action:hover:not(:disabled) { border-color: var(--mw-border); background: #fff; }
.mw-be-action.is-danger:hover:not(:disabled) { color: var(--mw-danger); border-color: var(--mw-danger); }
.mw-be-action:disabled { opacity: .3; cursor: default; }
.mw-be-columns { padding: 6px 8px 8px 12px; display: grid; gap: 8px; }
.mw-be-col { min-width: 0; border-left: 3px solid #dcdada; padding: 2px 0 2px 8px; border-radius: 2px; }
.mw-be-col.is-drop-target { border-left-color: var(--mw-accent); background: var(--mw-info-bg); }
.mw-be-col-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mw-muted); margin-bottom: 2px; }
.mw-be-col-empty, .mw-be-empty { color: var(--mw-muted); font-size: .85rem; margin: 2px 0 4px; }
.mw-be-block { margin: 0 0 3px; }
.mw-be-block-row { background: #fff; border: 1px solid #e2e0e0; }
.mw-be-block.is-locked .mw-be-block-row { background: #f6f3ea; }
.mw-be-lock { font-size: .72rem; }
.mw-be-add-block {
	border: 1px dashed #bdbaba; background: none; color: var(--mw-accent-dark); font: inherit; font-size: .82rem;
	padding: 3px 10px; border-radius: var(--mw-radius-small); cursor: pointer; margin-top: 2px;
}
.mw-be-add-block:hover { border-color: var(--mw-accent); background: var(--mw-info-bg); }
.mw-be-add-section { margin-top: 2px; }
.mw-be-ghost {
	position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; padding: 4px 10px; background: var(--mw-dark); color: #fff;
	border-radius: var(--mw-radius-small); font-size: .85rem; box-shadow: var(--mw-shadow);
}
.mw-be-wire { display: inline-flex; gap: 2px; width: 34px; height: 18px; flex: none; }
.mw-be-wire > span { display: block; background: #b9b6b6; border-radius: 2px; flex-basis: 0; }
.mw-be-layouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mw-be-layouts.is-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.mw-be-layout-choice {
	display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border: 1px solid var(--mw-border);
	border-radius: var(--mw-radius-small); background: #fff; font: inherit; font-size: .82rem; cursor: pointer;
}
.mw-be-layouts.is-inline .mw-be-layout-choice { padding: 6px; }
.mw-be-layout-choice .mw-be-wire { width: 72px; height: 34px; }
.mw-be-layouts.is-inline .mw-be-wire { width: 44px; height: 22px; }
.mw-be-layout-choice:hover { border-color: var(--mw-accent); background: var(--mw-info-bg); }
.mw-be-layout-choice.is-current { border-color: var(--mw-accent); box-shadow: inset 0 0 0 1px var(--mw-accent); }
.mw-be-layout-choice.is-current .mw-be-wire > span { background: var(--mw-accent); }
.mw-be-palette-group h3 { font-size: .85rem; margin: 12px 0 6px; color: #333; }
.mw-be-palette-group:first-child h3 { margin-top: 0; }
.mw-be-palette-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mw-be-palette-item {
	display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; font: inherit;
	border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #fff; cursor: pointer;
}
.mw-be-palette-item:hover:not(:disabled) { border-color: var(--mw-accent); background: var(--mw-info-bg); }
.mw-be-palette-item:disabled { opacity: .5; cursor: default; }
.mw-dialog.mw-be-palette-dialog { width: min(640px, 94vw); }
.mw-be-inspector-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--mw-border); }
.mw-be-inspector-head h2 { font-size: 1.05rem; margin: 0; flex: 1; outline: none; }
.mw-be-locked-note { padding: 10px 12px; background: var(--mw-warning-bg); color: var(--mw-warning); border-radius: var(--mw-radius-small); }
@media (max-width: 1000px) {
	.mw-be-work { grid-template-columns: minmax(0, 1fr); }
	.mw-be-preview { position: static; }
	.mw-be-preview-frame { height: 60vh; }
}

/* ---- schema forms (shared/js/mw/schemaform.js): mw-sf-* */
.mw-sf-summary { margin-bottom: 10px; }
.mw-sf-field.has-error > .mw-label, .mw-sf-field.has-error > label { color: var(--mw-danger); }
.mw-sf-field.has-error input, .mw-sf-field.has-error select, .mw-sf-field.has-error textarea { border-color: var(--mw-danger); }
.mw-sf-required { color: var(--mw-danger); }
.mw-sf-number { max-width: 140px; }
.mw-sf-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mw-sf-file-preview { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mw-sf-file-actions { display: flex; gap: 6px; }
.mw-sf-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: var(--mw-radius-small); background: #eee; flex: none; }
span.mw-sf-thumb { display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--mw-muted); text-align: center; padding: 2px; overflow: hidden; }
span.mw-sf-thumb.is-file { width: auto; min-width: 72px; max-width: 220px; padding: 2px 8px; color: var(--mw-text); }
.mw-sf-file-name { font-size: .82rem; word-break: break-all; }
.mw-sf-sub { display: flex; flex-direction: column; gap: 2px; flex-basis: 100%; font-size: .8rem; }
.mw-sf-image-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mw-sf-image-item { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.mw-sf-image-actions { display: flex; gap: 1px; }
.mw-sf-mini {
	width: 24px; height: 24px; border: 1px solid var(--mw-border); background: #fff; border-radius: var(--mw-radius-small);
	cursor: pointer; font-size: 11px; padding: 0; line-height: 1;
}
.mw-sf-mini:disabled { opacity: .35; cursor: default; }
.mw-sf-mini.is-danger:hover:not(:disabled) { color: var(--mw-danger); border-color: var(--mw-danger); }
.mw-sf-link { display: grid; gap: 6px; }
.mw-sf-link-file { display: flex; align-items: center; gap: 8px; }
.mw-sf-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.mw-sf-swatch { position: relative; cursor: pointer; }
.mw-sf-swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mw-sf-swatch-color { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--mw-border); }
.mw-sf-swatch-color.is-none { background: repeating-linear-gradient(45deg, #fff 0 4px, #ddd 4px 8px); }
.mw-sf-swatch input:checked + .mw-sf-swatch-color { box-shadow: 0 0 0 2px var(--mw-accent); }
.mw-sf-swatch input:focus-visible + .mw-sf-swatch-color { box-shadow: var(--mw-focus); }
.mw-sf-icon { display: flex; gap: 6px; align-items: center; }
.mw-sf-icon-current { display: inline-flex; align-items: center; gap: 4px; text-transform: none; }
.mw-sf-icon-img { width: 20px; height: 20px; }
.mw-sf-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 10px; max-height: 60vh; overflow: auto; }
.mw-sf-icon-choice {
	display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; font: inherit; font-size: .7rem;
	border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #fff; cursor: pointer; word-break: break-all;
}
.mw-sf-icon-choice img { width: 24px; height: 24px; }
.mw-sf-icon-choice:hover, .mw-sf-icon-choice.is-current { border-color: var(--mw-accent); background: var(--mw-info-bg); }
.mw-dialog.mw-sf-icon-dialog { width: min(620px, 94vw); }
.mw-sf-rows { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.mw-sf-row { display: flex; align-items: center; gap: 4px; padding: 3px 6px; background: #f6f5f5; border-radius: var(--mw-radius-small); }
.mw-sf-row-title { flex: 1; min-width: 0; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-sf-list { display: grid; gap: 8px; }
.mw-sf-item { margin: 0; padding: 8px 10px 0; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); background: #fbfbfb; min-width: 0; }
.mw-sf-item-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.mw-sf-item-title { flex: 1; min-width: 0; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-sf-item-actions { display: flex; gap: 2px; }
.mw-sf-item .mw-sf-field { margin-bottom: 10px; }
.mw-sf-list > .mw-btn { justify-self: start; }
.mw-be-action .mw-icon { width: 18px; height: 18px; }
.mw-be-action .mw-icon img { width: 12px; height: 12px; }
.mw-be-action.is-danger .mw-icon { background: #8d3a35; }

/* ---- Staff admin account page (cms/views/staff/account.phtml) */
.mw-staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 20px; }
.mw-staff-grid .mw-infolist { margin-top: 0; }
.mw-actions-col .mw-staff-login { display: inline; margin: 0 0 0 8px; }
/* Staff account edit form (cms/views/staff/account-form.phtml, MAKEWEB5-52) */
.mw-staff-account-form .mw-field-row > .mw-field { flex: 1 1 220px; }
.mw-staff-account-form textarea { width: 100%; max-width: 40rem; }
.mw-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }

/* ---- staff admin CRM card and log (MAKEWEB5-53) */
.mw-crm-tabs { margin: 0 0 16px; }
.mw-crm-tabs .mw-tab { padding: 6px 14px; text-decoration: none; }
.mw-crm-form { max-width: 980px; }
.mw-crm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.mw-crm-grid .mw-crm-wide { grid-column: 1 / -1; }
.mw-crm-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.mw-crm-filter label { font-size: .85rem; }
.mw-crm-entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 980px; }
.mw-crm-entry { background: var(--mw-panel-bg); border: 1px solid var(--mw-border); border-radius: var(--mw-radius); padding: 10px 14px; }
.mw-crm-entry.is-system { background: #f8f8f8; }
.mw-crm-entry-head { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: baseline; font-size: .85rem; }
.mw-crm-entry-head .mw-crm-entry-date { font-weight: 600; }
.mw-crm-entry-actions { margin-left: auto; display: flex; gap: 6px; }
.mw-crm-meta { color: var(--mw-muted); }
.mw-crm-comment { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mw-crm-comment + .mw-crm-comment { border-top: 1px solid #eee; padding-top: 8px; }
.mw-crm-comment-by { display: block; font-size: .78rem; color: var(--mw-muted); white-space: normal; }
.mw-crm-files { margin: 8px 0 0; padding: 0 0 0 18px; }
.mw-crm-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 980px; }
.mw-crm-comments textarea { min-height: 80px; }
.mw-crm-filelist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.mw-crm-filelist li { display: flex; gap: 8px; align-items: center; }
.mw-crm-filter-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.mw-crm-pager a.mw-page { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }

/* Edit conflict dialog (conflict.js, MAKEWEB5-73) */
.mw-dialog.mw-dialog-conflict { width: min(900px, calc(100vw - 32px)); }
.mw-conflict-wrap { max-height: 55vh; overflow: auto; }
.mw-conflict-table { width: 100%; table-layout: fixed; }
.mw-conflict-table tbody th { background: transparent; color: inherit; white-space: normal; border-top: 1px solid #eee; padding: 7px 10px; }
.mw-conflict-table th[scope="row"] { width: 28%; text-align: left; vertical-align: top; font-weight: normal; }
.mw-conflict-table td { vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; }
.mw-conflict-table .mw-conflict-tab th { background: #f5f4f4; color: var(--mw-darker); text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.mw-conflict-label { display: block; font-weight: 600; }
.mw-conflict-status { margin-top: 4px; }
.mw-conflict-status.is-both .mw-conflict-badge { background: #fbe3c8; color: #7a3e00; }
.mw-conflict-pick { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.mw-conflict-ins { background: #d9f2d9; text-decoration: none; }
.mw-conflict-del { background: #fde0e0; text-decoration: none; }

/* Article modules (Moduler tab) and the gallery editor (Bildegalleri tab, galleryedit.js, MAKEWEB5-80) */
.mw-article-modules { max-width: 760px; }
.mw-article-modules td { vertical-align: top; }
.mw-article-modules .mw-hint { margin: 2px 0 0; }
.mw-article-module-on { width: 48px; text-align: center; }
.mw-article-module-on input { width: 18px; height: 18px; margin-top: 2px; }
.mw-gallery-editor-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.mw-gallery-drop { padding: 14px; border: 2px dashed var(--mw-border-strong); border-radius: var(--mw-radius-small); text-align: center; color: var(--mw-muted, #666); margin-bottom: 10px; }
.mw-gallery-drop.is-over { background: #eef6ff; border-color: #3a7bd5; color: #1d4f91; }
.mw-gallery-uploads { list-style: none; margin: 0 0 10px; padding: 0; }
.mw-gallery-uploads li { display: grid; grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr); gap: 8px; align-items: center; padding: 2px 0; }
.mw-gallery-uploads li.is-error { color: #a40000; }
.mw-gallery-edit-list { list-style: none; margin: 0 0 8px; padding: 0; }
.mw-gallery-edit-row { display: grid; grid-template-columns: 20px 120px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px; margin-bottom: 6px; background: #fff; border: 1px solid var(--mw-border); border-radius: var(--mw-radius-small); }
.mw-gallery-edit-row.is-dragging { opacity: .5; }
.mw-gallery-edit-row.is-drop-target { outline: 2px solid #3a7bd5; }
.mw-gallery-edit-handle { cursor: grab; color: #888; user-select: none; padding-top: 4px; }
.mw-gallery-edit-thumb { width: 120px; height: 90px; display: flex; align-items: center; justify-content: center; background: #f3f3f3; overflow: hidden; }
.mw-gallery-edit-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mw-gallery-edit-fields { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mw-gallery-edit-fields input, .mw-gallery-edit-fields textarea { width: 100%; }
.mw-gallery-edit-actions { display: flex; gap: 4px; }
.mw-gallery-edit-empty { padding: 12px 0; }
@media (max-width: 700px) {
	.mw-gallery-edit-row { grid-template-columns: 80px minmax(0, 1fr); }
	.mw-gallery-edit-handle { display: none; }
	.mw-gallery-edit-thumb { width: 80px; height: 60px; }
	.mw-gallery-edit-actions { grid-column: 1 / -1; }
}
