/* EXPLORE CMS editor. Warm neutral chrome, a dotted canvas, blue selection. */
:root {
  --bg: #f4f3ee; --dot: #d9d6cc; --panel: #ffffff; --field: #faf9f6; --field-2: #f0eee7; --hover: #f3f1ea;
  --line: #e7e4db; --line-2: #efede6; --line-strong: #d8d4c9;
  --ink: #201f1c; --ink-2: #4a4843; --muted: #6e6b63; --faint: #9a968c;
  --accent: #c6613f; --accent-hover: #b0522f; --accent-soft: #f7e7e0; --accent-ink: #9a4526;
  --sel: #2f6feb; --sel-soft: rgba(47, 111, 235, .12); --sel-ink: #1d4fbf;
  /* the CMS colour (as Webflow's purple): collections, their lists and items, wherever they show */
  --cms: #7c3aed; --cms-soft: rgba(124, 58, 237, .11); --cms-ink: #6427c9; --cms-line: rgba(124, 58, 237, .55); --cms-badge: #efe8fd;
  --ok: #2e7d4f; --danger: #b93a2b;
  --raised: #fff; --glass: rgba(255, 255, 255, .95); --check: #e6e3da; --thumb: #dcd9cf; --thumb-2: #e8e5dc; --inv: #201f1c; --inv-ink: #faf9f5;
  --font: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", "IBM Plex Sans Arabic", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(32, 31, 28, .06), 0 8px 24px -12px rgba(32, 31, 28, .2);
  --shadow-lg: 0 2px 6px rgba(32, 31, 28, .06), 0 24px 60px -18px rgba(32, 31, 28, .32);
  --left-w: 276px; --right-w: 304px; --top-h: 52px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
body.booting #app, body.booting #login { visibility: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 12px; } .grow { flex: 1; }
.ic { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
kbd { font: 500 11px/1 var(--mono); padding: 3px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--field); color: var(--ink-2); }
html[lang="ar"] body { font-size: 13.5px; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--danger); }
.btn.primary.danger, .modal-foot .btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.block { width: 100%; } .btn.lg { height: 40px; font-size: 14px; } .btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); text-decoration: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
a.icon-btn[aria-disabled="true"] { opacity: .3; cursor: default; background: none; }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn[hidden] { display: none; }   /* a button a site doesn't have (.cms-only on a site with no CMS) */
.linkbtn { background: none; border: 0; padding: 0; color: var(--sel); font-weight: 500; font-size: 12px; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--danger); }
.badge { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 600 10.5px/17px var(--font); text-align: center; }
.badge.soft { background: var(--accent-soft); color: var(--accent-ink); }
.pill { font: 600 10.5px/1 var(--font); padding: 3px 7px; border-radius: 999px; background: var(--sel-soft); color: var(--sel-ink); }
.count { background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; }
.inp, .ta, .code, .fld input { width: 100%; border: 1px solid var(--line-strong); background: var(--panel); border-radius: 8px; padding: 7px 9px; font-size: 13px; }
.inp:focus, .ta:focus, .code:focus, .fld input:focus, .knob-num:focus, .bm-in:focus { outline: none; border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.ta { resize: vertical; line-height: 1.55; min-height: 70px; }
.code { font: 12px/1.65 var(--mono); min-height: 150px; resize: vertical; tab-size: 2; }
.code::placeholder, .ta::placeholder, .inp::placeholder { color: var(--faint); opacity: .75; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.fld > label, .fld > span { font-size: 12px; color: var(--ink-2); }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.5; margin-top: 6px; }
.hint.pad { padding: 4px 14px 16px; margin: 0; }
.hint.kbd { margin: 0; font-family: var(--mono); }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
.spin.lg { width: 22px; height: 22px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }

/* ---------- sign in ---------- */
#login { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 18px 18px; }
.login-card { width: min(380px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 10px; animation: pop .25s; }
.login-card h1 { font: 600 24px/1.25 var(--serif); margin: 12px 0 0; letter-spacing: -.01em; }
html[lang="ar"] .login-card h1 { font-family: var(--font); font-size: 21px; letter-spacing: 0; }
.login-card > .muted { margin: 0 0 8px; }
.login-card .fld input { height: 40px; font-size: 14px; }
.login-card .linkbtn { align-self: center; margin-top: 6px; color: var(--muted); }
.err { color: var(--danger); font-size: 12.5px; min-height: 18px; }
.brandmark { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff; font: 800 14px/1 var(--font); background: linear-gradient(135deg, #e0492a, #f7941d); }
.brandmark.lg { width: 42px; height: 42px; font-size: 21px; border-radius: 12px; }

/* ---------- frame ---------- */
#app { display: grid; grid-template-rows: var(--top-h) minmax(0, 1fr); height: 100vh; }
#top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr); align-items: center; gap: 12px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.top-start, .top-end { display: flex; align-items: center; gap: 4px; min-width: 0; }
.top-end { justify-content: flex-end; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.brand-name { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.brand-name b { font-weight: 600; color: var(--ink); }
/* on the panel's own addresses the brand is the site menu (js/main.js siteButton, js/panel.js) */
.brand.site-switch { height: 34px; border: 0; background: none; border-radius: 8px; padding: 0 6px 0 4px; color: inherit; }
.brand.site-switch:hover { background: var(--hover); }
.brand.site-switch .chev { color: var(--muted); margin-inline-start: -4px; }
.brandmark.xs { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }
.top-sep, .bar-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.page-btn { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 10px; border-radius: 8px; border: 0; background: none; font-weight: 600; min-width: 0; }
.page-btn:hover { background: var(--hover); }
.page-btn span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#modes { display: flex; gap: 2px; padding: 3px; background: var(--field-2); border-radius: 10px; }
#modes button { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 8px; border: 0; background: none; font-weight: 500; font-size: 12.5px; color: var(--muted); transition: background .12s, color .12s; }
#modes button[hidden] { display: none; }
#modes button:hover { color: var(--ink); }
#modes button.on { background: var(--raised); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04); }
#modes button.on svg { color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 8px; white-space: nowrap; }
.status.saved svg { color: var(--ok); }
.status.error, .status.retrying { color: var(--danger); }
#publish { margin: 0 4px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2f2e2a; color: #fff; font: 600 12px/1 var(--font); border: 0; display: grid; place-items: center; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10.5px; background: var(--accent); }

#work { display: grid; grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w); min-height: 0; transition: grid-template-columns .2s ease; }
body.hide-left #work { grid-template-columns: 0 minmax(0, 1fr) var(--right-w); }
body.hide-right #work { grid-template-columns: var(--left-w) minmax(0, 1fr) 0; }
body.hide-left.hide-right #work, body[data-mode="preview"] #work { grid-template-columns: 0 minmax(0, 1fr) 0; }
#left, #right { background: var(--panel); min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
#left { border-inline-end: 1px solid var(--line); }
#right { border-inline-start: 1px solid var(--line); }
.panel-body { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.panel-head { flex: none; border-bottom: 1px solid var(--line); padding: 12px 14px 0; }

/* ---------- canvas ---------- */
#canvas-wrap { position: relative; min-width: 0; min-height: 0; }
#canvas { position: absolute; inset: 0; overflow: auto; direction: ltr; background-color: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 18px 18px; }
#stage { position: relative; }
#device { position: absolute; transform-origin: 0 0; background: #fff; overflow: hidden; border-radius: 6px; box-shadow: 0 0 0 1px rgba(32, 31, 28, .07), 0 20px 50px -22px rgba(32, 31, 28, .4); transition: opacity .2s; }
#device[data-device="tablet"] { border-radius: 22px; }
#device[data-device="mobile"] { border-radius: 34px; }
#frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
#canvas-wrap.loading #device { opacity: .35; pointer-events: none; }
.canvas-loading { position: absolute; inset: 0; display: none; place-items: center; pointer-events: none; }
#canvas-wrap.loading .canvas-loading { display: grid; }
#ov-clip { position: absolute; overflow: hidden; pointer-events: none; }
#ov-free { position: absolute; inset: 0; pointer-events: none; }
html[dir="rtl"] #ov-free > * { direction: rtl; }
.box { position: absolute; left: 0; top: 0; display: none; pointer-events: none; will-change: transform; border-radius: 1px; }
.box.hover { box-shadow: inset 0 0 0 1.5px var(--sel); }
.box.sel { box-shadow: inset 0 0 0 2px var(--sel), 0 0 0 1px rgba(255, 255, 255, .8); }
.box.sel.editing { box-shadow: inset 0 0 0 2px var(--sel), 0 0 0 4px rgba(47, 111, 235, .22); }
.box.sel.comment { --sel: var(--accent); }
.box.block { outline: 1.5px dashed var(--sel); outline-offset: -1.5px; }
.hover-tag { position: absolute; left: 0; top: 0; display: none; align-items: center; gap: 4px; height: 18px; padding: 0 6px; font: 600 10.5px/1 var(--font); color: #fff; background: var(--sel); border-radius: 4px; white-space: nowrap; pointer-events: none; }
/* CMS: a collection's list, items and what they hold, in the CMS colour (js/canvas.js) */
.box.hover.cms { box-shadow: inset 0 0 0 1.5px var(--cms); }
.box.sel.cms { box-shadow: inset 0 0 0 2px var(--cms), 0 0 0 1px rgba(255, 255, 255, .8); }
.box.sel.cms.editing { box-shadow: inset 0 0 0 2px var(--cms), 0 0 0 4px var(--cms-soft); }
.box.cms-item { outline: 1px dashed var(--cms); outline-offset: -1px; }
.cms-lists, .cms-badges { position: absolute; inset: 0; pointer-events: none; }
.box.cms-list { outline: 1px dashed var(--cms-line); outline-offset: 3px; }
.box.cms-list.on { outline: 1.5px solid var(--cms); }
.hover-tag.cms { background: var(--cms); }
.hover-tag .tag-cms { display: inline-flex; align-items: center; gap: 3px; height: 14px; margin-inline-start: 3px; padding: 0 5px; border-radius: 3px; background: #fff; color: var(--cms); }
.cms-badge { position: absolute; left: 0; top: 0; display: none; align-items: center; gap: 4px; height: 18px; max-width: 240px; padding: 0 7px; border: 0; border-radius: 4px; font: 600 10.5px/1 var(--font); color: var(--cms-ink); background: var(--cms-badge); box-shadow: 0 0 0 1px var(--cms-line); pointer-events: auto; cursor: pointer; white-space: nowrap; overflow: hidden; }
.cms-badge span { overflow: hidden; text-overflow: ellipsis; }
.cms-badge:hover, .cms-badge.on { background: var(--cms); color: #fff; box-shadow: none; }
.cms-badge:focus-visible { outline: 2px solid var(--cms); outline-offset: 1px; }
.ftb-cms { display: inline-flex; align-items: center; gap: 4px; height: 20px; margin-inline-end: 2px; padding: 0 7px; border-radius: 6px; background: rgba(163, 126, 245, .24); color: #ddd0ff; font-size: 11.5px; font-weight: 600; }
.cms-toggle.on { background: var(--cms-soft); color: var(--cms); }
.cms-toggle.on:hover { background: var(--cms-soft); color: var(--cms-ink); }
.ftb { position: absolute; left: 0; top: 0; display: none; align-items: center; gap: 2px; padding: 4px; background: #1f1e1c; color: #f5f4ef; border-radius: 10px; box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .55); pointer-events: auto; white-space: nowrap; z-index: 2; animation: fade .12s; }
.ftb-label { display: flex; align-items: center; gap: 6px; padding: 0 6px; font-weight: 600; font-size: 12px; }
.ftb-sep { width: 1px; height: 18px; background: rgba(255, 255, 255, .18); margin: 0 3px; }
.ftb-btn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: inherit; background: transparent; border: 0; }
.ftb-btn:hover { background: rgba(255, 255, 255, .14); }
.ftb-btn.on { background: rgba(255, 255, 255, .2); }
.ftb-btn.primary { width: auto; display: flex; gap: 5px; padding: 0 10px; background: var(--sel); font-weight: 600; font-size: 12px; }
.ftb-hint { font-size: 11.5px; color: rgba(245, 244, 239, .6); padding: 0 6px; }
.canvas-bar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 5; }
.seg { display: flex; background: var(--field-2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 0 8px; min-height: 26px; font-weight: 500; font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--raised); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04); }
.seg button:disabled { opacity: .4; cursor: default; }
.vis-seg { margin-bottom: 6px; }
.seg.icons button { width: 32px; padding: 0; }
.rtl-el .seg svg { transform: scaleX(-1); }
.seg.small button { min-height: 24px; font-size: 11.5px; }
.seg.full { margin: 8px; }
.zoom { display: flex; align-items: center; }
.zoom-val { min-width: 48px; height: 26px; border: 0; background: none; border-radius: 6px; font: 500 12px var(--mono); color: var(--ink-2); }
.zoom-val:hover { background: var(--hover); }
.exit-preview { position: absolute; top: 12px; inset-inline-end: 14px; display: none; z-index: 6; box-shadow: var(--shadow); }
body[data-mode="preview"] .exit-preview { display: inline-flex; }

/* ---------- left panel ---------- */
.left-tabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); flex: none; }
.ltab { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; border-radius: 8px; border: 0; background: none; font-weight: 500; font-size: 11px; color: var(--muted); min-width: 0; }
.ltab span:not(.badge) { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.ltab:hover { color: var(--ink); background: var(--hover); }
.ltab.on { background: var(--field-2); color: var(--ink); }
.ltab .badge { position: absolute; top: 3px; inset-inline-end: 6px; }
.list { padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; text-align: start; color: var(--ink-2); }
.row:hover { background: var(--hover); }
.row[hidden] { display: none; }
.pages-search { margin: 0; flex: 1; min-width: 0; }
/* Pages list: the search box and Add page (pageops.js addPage) */
.pages-top { display: flex; align-items: center; gap: 6px; padding: 6px 6px 0; }
.pages-top + .list { padding-top: 4px; }
.pg-add-btn { margin-inline-start: auto; flex: none; }
/* Add page pop-up: its name and address, and on the Sitemap its SEO settings */
.pg-add .pg-url .inp { direction: ltr; }
.pg-add .muted.small { display: flex; align-items: center; gap: 6px; }
.pg-add-seo { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pg-add-h { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; }
.pg-add-seo > .hint { margin: 2px 0 12px; }
.row.on { background: var(--sel-soft); color: var(--ink); }
.row.on > svg { color: var(--sel); }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-title { font-weight: 500; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 11px; color: var(--faint); text-align: start; }
.layers { padding: 6px 0 20px; font-size: 12px; }
/* deep levels step in less, so a page 15 levels deep still leaves room for the names (the tooltip has the whole one) */
.layer { display: flex; align-items: center; gap: 5px; height: 28px; padding-inline-start: calc(6px + min(var(--d), 6) * 12px + max(var(--d) - 6, 0) * 5px); padding-inline-end: 10px; color: var(--ink-2); white-space: nowrap; cursor: default; }
.layer:hover { background: var(--hover); }
.layer.on { background: var(--sel-soft); color: var(--sel-ink); }
.layer.dim { opacity: .5; }
.layer.deleted .ly-name, .layer.deleted .ly-kind { text-decoration: line-through; }
.twisty { width: 16px; height: 16px; display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--faint); flex: none; border-radius: 4px; }
.twisty:hover { background: var(--field-2); color: var(--ink); }
.twisty svg { transition: transform .12s; }
html[dir="rtl"] .twisty svg { transform: scaleX(-1); }
.twisty.open svg, html[dir="rtl"] .twisty.open svg { transform: rotate(90deg); }
.ly-kind { font-weight: 500; flex: none; }
.ly-name { color: var(--faint); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.layer.sec .ly-kind { font-weight: 650; color: var(--ink); }
.layer.on.sec .ly-kind { color: var(--sel-ink); }
.ly-kind { overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 70%; }
.ly-tucked { display: flex; align-items: center; gap: 6px; margin: 8px 10px 0; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--faint); font: inherit; font-size: 11.5px; cursor: pointer; }
.ly-tucked:hover { background: var(--hover); color: var(--ink-2); }
.layer .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sel); margin-inline-start: auto; flex: none; }
.layer .ly-eye { margin-inline-start: auto; flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--muted); visibility: hidden; }
.layer .dot + .ly-eye { margin-inline-start: 6px; }
.layer:hover .ly-eye, .layer .ly-eye.off, .layer .ly-eye:focus-visible { visibility: visible; }
.layer .ly-eye:hover { background: var(--hover); color: var(--ink); }
.layer.dim .ly-eye.off { opacity: 1; }
/* a collection's list and items (and what is in them), as Webflow's Navigator shows them */
.layer.cms > .ic, .layer.cms-in > .ic { color: var(--cms); }
.layer.cms .ly-kind { color: var(--cms-ink); }
.layer.on.cms, .layer.on.cms-in { background: var(--cms-soft); color: var(--cms-ink); }
.ly-cms { display: inline-flex; align-items: center; gap: 3px; flex: none; max-width: 42%; height: 16px; padding: 0 5px; border-radius: 4px; background: var(--cms-soft); color: var(--cms-ink); font: 600 10px/1 var(--font); overflow: hidden; }
.ly-cms span { overflow: hidden; text-overflow: ellipsis; }
.ly-cms.holds { background: none; padding: 0; font-weight: 500; }
.layer .ly-cms + .dot { margin-inline-start: 6px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 22px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.empty b { color: var(--ink); font-weight: 600; font-size: 13px; }
.empty-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--field-2); display: grid; place-items: center; color: var(--muted); margin-bottom: 4px; }
.ch-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px; font-weight: 600; font-size: 12.5px; }
.grp { padding: 6px; }
.grp-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.grp-head .muted { margin-inline-start: auto; font-weight: 500; }
.change { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; cursor: pointer; }
.change:hover { background: var(--hover); }
.change-main { flex: 1; min-width: 0; }
.change-title { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 10.5px; padding: 2px 6px; border-radius: 5px; background: var(--field-2); color: var(--ink-2); }
.change .icon-btn { opacity: 0; }
.change:hover .icon-btn, .change .icon-btn:focus-visible { opacity: 1; }
.ch-foot { position: sticky; bottom: 0; padding: 12px; background: linear-gradient(transparent, var(--panel) 30%); }
.ch-foot .hint { margin-top: 6px; text-align: center; }
.ch-pick, .pub-pick input[type="checkbox"], .pick-all input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--sel); cursor: pointer; }
.ch-foot-row { display: flex; justify-content: space-between; margin-top: 6px; }
.pub-pick { max-height: min(46vh, 420px); overflow: auto; }
.pub-pick li.pick-grp { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--line-2); border-bottom: 0; }
.pub-pick li:has(.pick-row) { padding: 0; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; width: 100%; cursor: pointer; }
.pick-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row:hover { background: var(--hover); }
.pick-all { display: flex; align-items: center; gap: 10px; padding: 0 12px; margin-top: 10px; font-weight: 600; cursor: pointer; }
.pick-all .muted { margin-inline-start: auto; font-weight: 400; font-size: 12px; }
.cmt { padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.cmt:hover { background: var(--hover); }
.cmt.other { opacity: .8; }
.cmt-head { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.cmt-head .muted { margin-inline-start: auto; font-size: 11px; }
.cmt-del { width: 22px; height: 22px; margin: -3px -4px -3px 0; color: var(--faint); opacity: 0; }
.cmt:hover .cmt-del, .cmt:focus-within .cmt-del, .cmt.on .cmt-del { opacity: 1; }
.cmt-del:hover, .cmt-del:focus-visible { color: var(--danger); opacity: 1; }
@media (hover: none) { .cmt-del { opacity: 1; } }
.cmt-where { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--faint); margin: 4px 0 2px; }
.cmt-text { font-size: 12.5px; color: var(--ink); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- inspector ---------- */
.insp-title { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 10px; }
.kind-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--sel-soft); color: var(--sel); display: grid; place-items: center; flex: none; }
.kind-ic.accent { background: var(--accent-soft); color: var(--accent); }
.it-main { min-width: 0; flex: 1; }
.it-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.it-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 1px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.crumb { background: none; border: 0; padding: 1px 4px; border-radius: 4px; color: inherit; font-size: inherit; unicode-bidi: isolate; }
button.crumb:hover { background: var(--hover); color: var(--ink); }
.crumb.cur { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
html[dir="rtl"] .crumb-sep { transform: scaleX(-1); }
.tabs { display: flex; margin: 0 -14px; padding: 0 8px; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 6px 8px; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.sec { padding: 14px; border-bottom: 1px solid var(--line-2); }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sec-head h4 { margin: 0; font: 600 11px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
html[lang="ar"] .sec-head h4 { font-size: 12px; letter-spacing: 0; text-transform: none; }
.ctl { margin-bottom: 12px; }
.ctl > label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.lang-note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.lang-note .linkbtn { margin-inline-start: auto; }
.img-prev { border-radius: 8px; overflow: hidden; background: repeating-conic-gradient(var(--line-2) 0 25%, var(--panel) 0 50%) 50% / 16px 16px; aspect-ratio: 16 / 10; display: grid; place-items: center; border: 1px solid var(--line); }
.img-prev img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.inp-group { display: flex; gap: 6px; align-items: center; }
.insp-foot { padding: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.page-info { padding: 18px 14px; }
.pi-stat { font-size: 12.5px; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); }
.pi-stat.has { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.tips { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 12px; }
.tips li { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.tips li svg { color: var(--faint); margin-top: 1px; }
.knob { margin-bottom: 14px; }
.knob-top { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.knob-top label { font-size: 12px; color: var(--ink-2); flex: 1; }
.knob.is-set .knob-top label { color: var(--sel-ink); font-weight: 600; }
.knob-val { display: flex; align-items: center; height: 26px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; direction: ltr; }
.knob-num { width: 46px; border: 0; background: transparent; font: 500 12px var(--mono); text-align: right; padding: 0; -moz-appearance: textfield; }
.knob-num::-webkit-inner-spin-button, .knob-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.knob-unit { font: 11px var(--mono); color: var(--faint); margin-left: 3px; min-width: 8px; }
.mini-reset { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--faint); padding: 0; }
.mini-reset:hover { background: var(--hover); color: var(--ink); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--sel-soft); border-color: var(--sel); }
.knob.is-set input[type="range"]::-webkit-slider-thumb { border-color: var(--sel); }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.sw { width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 1px solid rgba(0, 0, 0, .14); padding: 0; flex: none; }
.sw:hover { transform: scale(1.1); }
.sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--sel); }
.sw.custom { position: relative; overflow: hidden; display: grid; place-items: center; color: #fff; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e); cursor: pointer; }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: inset-inline-start .15s; }
.switch input:checked + i { background: var(--sel); }
.switch input:checked + i::after { inset-inline-start: 16px; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--sel-soft); }
.boxmodel { position: relative; direction: ltr; border: 1px dashed var(--line-strong); border-radius: 9px; padding: 28px 44px; background: var(--field); }
.bm-inner { position: relative; border: 1px solid var(--line-strong); border-radius: 6px; padding: 28px 44px; background: var(--panel); }
.bm-core { text-align: center; font: 500 11px var(--mono); color: var(--sel-ink); padding: 7px 0; background: var(--sel-soft); border-radius: 4px; white-space: nowrap; }
.bm-tag { position: absolute; top: 5px; left: 7px; font-size: 10px; color: var(--faint); }
.bm-in { position: absolute; width: 40px; height: 22px; text-align: center; border: 1px solid transparent; background: transparent; border-radius: 4px; font: 500 11px var(--mono); padding: 0; }
.bm-in:hover { border-color: var(--line); background: var(--panel); }
.bm-in.t { top: 3px; left: 50%; transform: translateX(-50%); }
.bm-in.b { bottom: 3px; left: 50%; transform: translateX(-50%); }
.bm-in.l { left: 2px; top: 50%; transform: translateY(-50%); }
.bm-in.r { right: 2px; top: 50%; transform: translateY(-50%); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; font-size: 12px; align-items: center; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; display: flex; align-items: center; gap: 4px; min-width: 0; }
.kv code { font: 11.5px var(--mono); background: var(--field-2); padding: 2px 5px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kv code.sel { white-space: normal; overflow-wrap: anywhere; }
.font-list { display: flex; flex-direction: column; gap: 4px; }
.font-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); text-align: start; }
.font-opt:hover { border-color: var(--line-strong); }
.font-opt.on { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.font-opt svg { color: var(--sel); }
.fo-name { flex: 1; font-size: 13px; }
.fo-sample { color: var(--muted); font-size: 13px; }

/* ---------- gradient (js/gradient.js) ---------- */
.g-check { background-image: var(--g, none), repeating-conic-gradient(var(--check) 0 25%, var(--panel) 0 50%); background-size: 100% 100%, 10px 10px; }
.grad { display: flex; flex-direction: column; gap: 12px; }
.g-add { align-self: flex-start; }
.g-note { margin: -4px 0 0; }
.g-layers { display: flex; align-items: center; gap: 6px; }
.g-chip { width: 30px; height: 22px; border-radius: 6px; border: 0; padding: 0; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.g-chip span { font: 600 10px/1 var(--font); color: #fff; text-shadow: 0 0 2px rgba(0, 0, 0, .75), 0 0 1px rgba(0, 0, 0, .75); }
.g-chip.on { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px var(--panel), 0 0 0 4px var(--sel); }
.g-chip.add { background: var(--field-2); color: var(--muted); box-shadow: none; }
.g-chip.add:hover { background: var(--line); color: var(--ink); }
.g-bar { position: relative; height: 32px; margin: 0 7px; touch-action: none; }
.g-track { position: absolute; left: 0; right: 0; top: 4px; height: 24px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); cursor: copy; }
.g-stop { position: absolute; top: 0; width: 14px; height: 32px; margin-left: -7px; padding: 0; border: 2px solid #fff; border-radius: 5px; background: linear-gradient(var(--c), var(--c)), repeating-conic-gradient(var(--check) 0 25%, var(--panel) 0 50%) 0 0 / 8px 8px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 2px 5px rgba(0, 0, 0, .25); cursor: grab; touch-action: none; }
.g-stop:active { cursor: grabbing; }
.g-stop.on { z-index: 1; box-shadow: 0 0 0 2px var(--sel), 0 3px 8px rgba(0, 0, 0, .3); }
.g-stop:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--sel), 0 0 0 5px var(--sel-soft); }
.g-stoprow { display: grid; grid-template-columns: minmax(0, 1fr) 56px 62px 26px; gap: 6px; align-items: end; }
.g-pick { display: flex; gap: 6px; min-width: 0; }
.g-cap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.g-cap > span:first-child { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-well { position: relative; display: block; flex: none; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; cursor: pointer; background: linear-gradient(var(--c), var(--c)), repeating-conic-gradient(var(--check) 0 25%, var(--panel) 0 50%) 0 0 / 8px 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.g-well input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.g-hex { height: 30px; padding: 0 8px; font: 500 12px var(--mono); }
.g-num { display: flex; align-items: center; height: 30px; padding: 0 7px 0 4px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; direction: ltr; }
.g-num:focus-within { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.g-num input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; font: 500 12px var(--mono); text-align: right; -moz-appearance: textfield; }
.g-num input::-webkit-inner-spin-button, .g-num input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.g-num i { margin-left: 2px; font: normal 11px var(--mono); color: var(--faint); }
.g-del { height: 30px; }
/* the pop-up hangs from the row, not the well, so it stays inside the panel whichever well opened it */
.g-wellwrap { position: static; display: block; flex: none; }
.g-tones, .g-pick { position: relative; }
button.g-well { padding: 0; border: 0; }
button.g-well.open { box-shadow: 0 0 0 2px var(--sel), inset 0 0 0 1px rgba(0, 0, 0, .15); }
.g-well.sm { width: 22px; height: 22px; border-radius: 6px; }
.g-cpop { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 20; width: 228px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .12s; }
.g-cpop-h { margin: 0 0 8px; font-size: 11px; font-weight: 600; color: var(--muted); }
.g-cpop-sws { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.g-cpop-sw { aspect-ratio: 1; padding: 0; border: 0; border-radius: 7px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); cursor: pointer; }
.g-cpop-sw:hover { transform: scale(1.08); }
.g-cpop-sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--sel); }
.g-cpop-manual { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.g-cpop-manual:hover { background: var(--hover); color: var(--ink); }
.g-cpop-manual input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.g-sws { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sw.sm { width: 18px; height: 18px; }
.g-pad { position: relative; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.g-paint { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 10px; background-image: var(--g); background-size: cover; background-position: center; pointer-events: none; }
.g-paint.text { -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; font: 800 30px/1.2 var(--font); }
.g-paint.text span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.g-dir { position: absolute; left: 50%; top: 50%; width: 2px; height: clamp(20px, 34%, 48px); background: var(--panel); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); transform-origin: 50% 100%; transform: translate(-50%, -100%) rotate(var(--a)); pointer-events: none; }
.g-dir::after { content: ""; position: absolute; left: 50%; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--sel); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.g-dir.sm { height: 26px; z-index: 1; }
.g-dir.sm::after { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-width: 1.5px; }
.g-hub { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.g-dot { position: absolute; z-index: 2; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--sel); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .3); pointer-events: none; }
.g-row { display: flex; align-items: flex-end; gap: 8px; }
.g-row .g-cap { flex: 1; }
.g-rot { height: 30px; }
.g-field > label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink-2); }
.g-field select.inp { height: 30px; padding: 0 8px; }
.g-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.g-preset { height: 26px; padding: 0; border: 0; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .12s, box-shadow .12s; }
.g-preset:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 4px 10px -3px rgba(0, 0, 0, .3); }
.g-tones { display: flex; flex-wrap: wrap; gap: 6px; }
.g-tone { width: 30px; height: 30px; }
.g-brand { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.g-bsw { position: relative; display: block; }
.g-bdel { position: absolute; top: -5px; inset-inline-end: -5px; display: none; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: var(--ink, #222); color: var(--panel, #fff); place-items: center; cursor: pointer; box-shadow: 0 0 0 2px var(--panel, #fff); }
.g-bsw:hover .g-bdel, .g-bdel:focus-visible { display: grid; }
@media (hover: none) { .g-bdel { display: grid; } }
.g-badd { display: grid; place-items: center; background: var(--panel); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.g-badd:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-2); }
.g-brand-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.g-brand .hint { margin-top: 6px; }
.g-brand .hint .linkbtn { display: inline; }
.g-templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 6px; }
.g-tpl { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; color: var(--ink-2); font: 500 11px/1.2 var(--font); text-align: center; cursor: pointer; }
.g-tpl span { display: block; height: 40px; border-radius: 6px; background: repeating-conic-gradient(var(--check) 0 25%, var(--panel) 0 50%) 0 0 / 10px 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .12s, box-shadow .12s; }
.g-tpl span::after { content: ""; display: block; height: 100%; border-radius: inherit; background-image: var(--g); }   /* its own box: a template's layers don't share the checker's sizes */
.g-tpl-note { margin-top: 8px; }
.g-tpl-group { margin: 10px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3, var(--ink-2)); }
.g-tpl-group:first-of-type { margin-top: 0; }
.g-tpl b { font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.g-tpl:hover span { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 4px 10px -3px rgba(0, 0, 0, .3); }
.g-tpl:hover b { color: var(--ink); }
.g-foot { display: flex; align-items: center; gap: 14px; }

/* ---------- comments on the canvas ---------- */
.pin { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 12px 12px 12px 3px; background: var(--accent); color: #fff; font: 700 11px/1 var(--font); display: none; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .45); pointer-events: auto; padding: 0; }
.pin:hover, .pin.on { background: var(--inv); }
.pop { position: absolute; left: 0; top: 0; width: 290px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; pointer-events: auto; display: flex; flex-direction: column; gap: 8px; z-index: 3; animation: pop .15s; }
.pop-head { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.pop-head > svg { color: var(--accent); }
.pop-head .muted { font-size: 11px; }
.pop textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px; resize: vertical; min-height: 64px; font-size: 13px; line-height: 1.5; }
.pop textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pop-text { font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); max-height: min(50vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.pop textarea { max-height: min(50vh, 420px); }
.pin.gone { opacity: .6; border-style: dashed; }
.pop-foot { display: flex; align-items: center; gap: 6px; }
.cm-edit { display: flex; flex-direction: column; gap: 6px; }
.pop .btn { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- menus, dialogs, toasts ---------- */
.menu { position: fixed; z-index: 60; min-width: 230px; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .12s; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; font-size: 13px; text-align: start; }
.menu-item:hover { background: var(--hover); }
.menu-item.on { font-weight: 600; }
.menu-item .muted { margin-inline-start: auto; font-size: 11.5px; font-weight: 400; }
.menu-item .ic.end { margin-inline-start: auto; color: var(--sel); }
.menu-item .muted + .ic.end { margin-inline-start: 0; }
.menu-head { padding: 6px 10px 4px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.modal-back { position: fixed; inset: 0; background: rgba(32, 31, 28, .36); display: grid; place-items: center; z-index: 80; padding: 20px; animation: fade .15s; }
.modal { width: min(440px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .4); animation: pop .18s; }
.modal.wide { width: min(560px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.modal-head h3 { margin: 0; font: 600 19px/1.3 var(--serif); }
html[lang="ar"] .modal-head h3 { font-family: var(--font); font-size: 17px; }
.modal-body { padding: 6px 18px 14px; overflow: auto; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.modal-body p { margin: 0 0 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line-2); }
.pub-list, .hist-list { list-style: none; margin: 10px 0 12px; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.pub-list li, .hist-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.pub-list li:last-child, .hist-list li:last-child { border-bottom: 0; }
.pub-list li .muted { margin-inline-start: auto; font-size: 12px; }
.pub-to { margin-bottom: 14px; }
.pub-to button { min-height: 30px; font-size: 12.5px; }
.pub-link { margin: -4px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--field-2); font-size: 12.5px; word-break: break-all; text-align: start; }
.pub-link a { color: var(--ink); }
.hist-ic { color: var(--faint); display: grid; }
.hist-main { flex: 1; font-size: 13px; }
.hist-main b { font-weight: 500; }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 4px 0; align-items: center; }
.shortcuts dd { margin: 0; }
#toasts { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--inv); color: var(--inv-ink); border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: auto; max-width: min(520px, 90vw); }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #8e2b1e; }
.toast.warn { background: #6b4b12; }
.toast.ok svg { color: #7fd6a2; }
.toast .linkbtn { color: #a9c6ff; margin-inline-start: 6px; }

/* ---------- smaller screens ---------- */
/* the page name, the save status and Publish always fit beside the modes (main.js fitTop):
   the brand name goes first, then the mode names */
body[data-top-fit~="brand"] .brand-name { display: none; }
body[data-top-fit~="modes"] #modes button span:not(.badge) { display: none; }
body[data-top-fit~="modes"] #modes button { padding: 0 10px; }
/* saved and saving keep their tick and spinner, with the words on hover; a failed save keeps its words */
body[data-top-fit~="status"] .status.saved, body[data-top-fit~="status"] .status.saving { font-size: 0; gap: 0; }
@media (max-width: 860px) {
  .status span, .status { font-size: 0; gap: 0; }
  #history, #view-site { display: none; }
  #left, #right { position: fixed; top: var(--top-h); bottom: 0; width: 290px; z-index: 30; box-shadow: var(--shadow-lg); }
  #left { inset-inline-start: 0; } #right { inset-inline-end: 0; }
  body.hide-left #left, body.hide-right #right, body[data-mode="preview"] #left, body[data-mode="preview"] #right { display: none; }
  #work { grid-template-columns: 0 minmax(0, 1fr) 0 !important; }
}

/* deleting elements */
.ftb-btn.danger:hover { background: var(--danger); }
.pi-deleted { margin: 14px -6px 0; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.pi-deleted .grp-head { padding-inline: 8px; }
.pi-deleted .change > svg { color: var(--faint); }
.pi-deleted .change-title { color: var(--ink-2); }
.pi-show { padding: 8px 8px 0; }
.pi-show .hint { margin-top: 4px; }

/* right-click on the page (js/pickmenu.js) */
.pick-menu { min-width: 240px; max-width: 340px; }
.pick-row { gap: 8px; padding: 7px 10px; font-size: 12.5px; }
.pick-row > .ic:first-child { color: var(--faint); }
.pick-row.top > .ic:first-child, .pick-row.on > .ic:first-child { color: var(--sel); }
.pick-kind { flex: none; font-weight: 500; }
.pick-name { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; unicode-bidi: isolate; }
.pick-row.gone .pick-kind, .pick-row.gone .pick-name { text-decoration: line-through; }
.pick-row.veiled { opacity: .7; }
.pick-row .pick-off { margin-inline-start: 4px; color: var(--muted); flex: none; }
.pick-row:focus-visible { outline: none; background: var(--hover); }
.pick-row.on { font-weight: 400; background: var(--sel-soft); }
.del-note { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; margin: 14px; padding: 12px; border-radius: 10px; background: var(--hover); color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.del-note > svg { color: var(--danger); margin-top: 2px; }
.del-note b { display: block; color: var(--ink); font-size: 12.5px; }
.del-note .btn { grid-column: 1 / -1; justify-self: start; }

/* ---------- board (js/board.js) ---------- */
#board { position: absolute; inset: 0; z-index: 1; overflow: hidden; direction: ltr; visibility: hidden; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none;
  background-color: var(--bg); background-image: radial-gradient(var(--dot) 1.1px, transparent 1.3px); background-size: 24px 24px; }
body[data-mode="board"] #board { visibility: visible; pointer-events: auto; }
body[data-mode="board"] #canvas, body[data-mode="board"] .canvas-loading { display: none; }
body[data-mode="board"] #work { grid-template-columns: var(--left-w) minmax(0, 1fr) 0; }
body[data-mode="board"].hide-left #work { grid-template-columns: 0 minmax(0, 1fr) 0; }
body[data-mode="board"] #toggle-right { visibility: hidden; }
#board[data-tool="comment"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cpath d='M2 24V12a10 10 0 1 1 10 10H2z' fill='%23c6613f' stroke='white' stroke-width='2'/%3E%3Cpath d='M12 7.5v9M7.5 12h9' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 2 24, crosshair; }
#board[data-tool="pen"], #board[data-tool="marker"], #board[data-tool="arrow"], #board[data-tool="rect"], #board[data-tool="ellipse"] { cursor: crosshair; }
#board.space { cursor: grab; }
#board.grabbing, #board.grabbing * { cursor: grabbing !important; }
#board-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#board-world.moving { will-change: transform; }
.bframe { position: absolute; top: 0; }
.bpage { position: absolute; inset: 0; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(32, 31, 28, .08), 0 24px 70px -28px rgba(32, 31, 28, .38); }
.bpage iframe { display: block; border: 0; background: #fff; pointer-events: none; transition: opacity .3s; }
.bframe.loading .bpage { background: linear-gradient(100deg, #fff 30%, #f6f4ee 50%, #fff 70%) 0 0 / 300% 100%; animation: bshine 1.4s linear infinite; }
.bframe.loading .bpage iframe { opacity: 0; }
@keyframes bshine { to { background-position: -150% 0; } }
.bink { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.bink .hl, .cink .hl { mix-blend-mode: multiply; }
.bink g[data-cid], .cink g[data-cid] { transition: opacity .2s; }
.bink g.dim, .cink g.dim { opacity: .25; }
.bink g.lit { filter: drop-shadow(0 0 6px rgba(198, 97, 63, .55)); }
.bink .draft-box { fill: none; stroke: var(--sel); stroke-width: 1.25; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
#board-ui { position: absolute; inset: 0; pointer-events: none; }
html[dir="rtl"] #board-ui > .bcard { direction: rtl; }
.bf-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 6px 0 2px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; pointer-events: auto; }
.bf-label:hover { background: var(--glass); color: var(--ink); }
.bf-label svg { color: var(--muted); }
.bf-label b { font-weight: 600; }
.bf-label .muted { font: 11px var(--mono); color: var(--faint); }
.bf-label.tight b, .bf-label.tight .muted { display: none; }
.bf-label .spin { display: none; width: 10px; height: 10px; border-width: 1.5px; color: var(--faint); }
.bf-label.loading .spin { display: inline-block; }
.bpin { position: absolute; left: 0; top: 0; z-index: 1; width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 15px 15px 15px 3px; border: 2px solid #fff; background: var(--accent); color: #fff; font: 700 12px/1 var(--font); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 0, 0, .05); pointer-events: auto; transform-origin: 0 100%; transition: background .15s, scale .15s; }
.bpin:hover, .bpin.hover { scale: 1.1; }
.bpin.on { background: var(--inv); z-index: 2; scale: 1.1; }
.bpin.resolved { background: var(--ok); }
.bpin.gone { opacity: .6; border-style: dashed; }
.bpin.draft { background: var(--panel); color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(198, 97, 63, .18), 0 6px 16px -6px rgba(0, 0, 0, .4); }
.bpin.fresh { animation: bpop .6s ease; }
@keyframes bpop { 0% { scale: .4; } 60% { scale: 1.2; } 100% { scale: 1; } }
.bcard { width: 312px; z-index: 4; cursor: auto; }
.bcard textarea, .bcard .pop-text { user-select: text; -webkit-user-select: text; }
.bcard.nudge, .pop.composer.nudge { animation: bnudge .4s; }
@keyframes bnudge { 20%, 60% { margin-left: -6px; } 40%, 80% { margin-left: 6px; } }
.bc-dev { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); background: var(--field-2); border-radius: 999px; padding: 2px 8px 2px 6px; }
.bc-where { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--faint); margin-top: -2px; }
.bc-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-draw { display: flex; align-items: center; gap: 2px; padding: 4px; margin: -2px 0; background: var(--field); border: 1px solid var(--line-2); border-radius: 9px; }
.bc-draw-label { font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 0 6px 0 4px; }
.bc-tool { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--ink-2); }
.bc-tool:hover { background: var(--hover); color: var(--ink); }
.bc-tool.on { background: var(--raised); color: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 1px rgba(0, 0, 0, .05); }
.bc-marks { font-size: 11px; color: var(--muted); padding: 0 2px; white-space: nowrap; }
.pop .btn:disabled { opacity: .45; }
.brail { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px; background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.brail-sep { width: 22px; height: 1px; background: var(--line); margin: 4px 0; }
.btool { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--ink-2); padding: 0; }
.btool:hover { background: var(--hover); color: var(--ink); }
.btool.on { background: var(--accent); color: #fff; }
.btool[data-tip]:hover::after { content: attr(data-tip) "  " attr(data-kbd); position: absolute; top: 50%; inset-inline-start: calc(100% + 10px); transform: translateY(-50%); padding: 5px 9px; border-radius: 7px; background: var(--inv); color: var(--inv-ink); font: 500 12px/1.2 var(--font); white-space: pre; pointer-events: none; box-shadow: var(--shadow); animation: fade .12s; }
.brail.palette-open .bcolor::after { display: none; }
.bdot { width: var(--s); height: var(--s); min-width: 8px; min-height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px rgba(0, 0, 0, .14); transition: width .15s, height .15s; }
.bpalette { position: absolute; bottom: 0; inset-inline-start: calc(100% + 10px); display: none; flex-direction: column; gap: 10px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .12s; }
.brail.palette-open .bpalette { display: flex; }
.bp-row { display: flex; gap: 8px; align-items: center; }
.bp-row.sizes { padding-top: 10px; border-top: 1px solid var(--line-2); }
.bsize { width: 34px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: var(--field-2); padding: 0; }
.bsize:hover { background: var(--line); }
.bsize.on { background: var(--raised); box-shadow: 0 0 0 2px var(--sel); }
.bsize span { width: 18px; height: var(--s); border-radius: 99px; background: var(--c); }
.bhint { position: absolute; top: 14px; left: 50%; z-index: 5; transform: translate(-50%, -6px); max-width: calc(100% - 140px); overflow: hidden; text-overflow: ellipsis; padding: 7px 14px; border-radius: 999px; background: rgba(31, 30, 28, .9); color: #f5f4ef; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.bhint.show { opacity: 1; transform: translate(-50%, 0); }
html[dir="rtl"] .bhint { direction: rtl; }
@media (prefers-reduced-motion: reduce) { .bpin, .bhint, .bframe.loading .bpage { transition: none; animation: none; } }

/* comment drawings on the canvas, and the Comments list */
.cink { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cmt.on { background: var(--accent-soft); border-color: rgba(198, 97, 63, .25); }
.cmt-num { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px 10px 10px 3px; background: var(--accent); color: #fff; font: 700 10.5px/20px var(--font); text-align: center; flex: none; }
.cmt-num.done { display: grid; place-items: center; background: var(--ok); }
.cmt-body { display: flex; gap: 10px; align-items: flex-start; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt-ink { flex: none; margin-top: 4px; padding: 3px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); display: grid; }
.cmt:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; }
/* the board itself is laid out left to right; in Arabic its tool rail sits on the right */
html[dir="rtl"] .brail { inset-inline-start: auto; right: 14px; }
html[dir="rtl"] .btool[data-tip]:hover::after { inset-inline-start: auto; right: calc(100% + 10px); direction: rtl; }
html[dir="rtl"] .bpalette { inset-inline-start: auto; right: calc(100% + 10px); }

/* ---------- SEO mode (js/seo.js): the page's settings, laid out like Webflow's ---------- */
body[data-mode="seo"] { --right-w: 384px; }
.seo-lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.seo-lang .seg { width: 150px; }
.seo-loading { display: grid; place-items: center; padding: 40px; }
.seo-sec { padding: 16px 16px 18px; }
.seo-sec h3 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; }
/* a link's page and section (linkpick.js), a page's link in the menu (navbar.js) */
.lp select.inp, .nav-sec select.inp { height: 32px; padding: 0 8px; }
.nav-sec .seo-switch { margin: 8px 0 12px; padding-top: 0; border-top: 0; }
.seo-intro { margin: 0 0 14px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.seo-fld { margin-bottom: 14px; }
.seo-fld .ta { width: 100%; resize: vertical; min-height: 84px; line-height: 1.5; font-size: 13px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; background: var(--panel); }
.seo-fld .hint { margin-top: 5px; }
.seo-lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.seo-count { font-size: 11px; font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }
.seo-count.over { color: var(--accent-ink); }
.seo-group { margin-bottom: 14px; }
.seo-group .seo-fld { margin-bottom: 0; }
.seo-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.seo-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--sel); cursor: pointer; }
.seo-same { padding: 7px 9px; border-radius: 8px; background: var(--field-2); color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.seo-img-row { display: flex; gap: 6px; }
.seo-img-row .inp { min-width: 0; }
.seo-switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); cursor: pointer; }
.seo-switch-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.seo-switch-text b { font-weight: 500; color: var(--ink-2); }
/* Google result */
.serp { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-family: Arial, "IBM Plex Sans Arabic", sans-serif; }
.serp-site { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.serp-site > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.serp-site b { font-weight: 400; font-size: 14px; color: #202124; line-height: 1.3; }
.serp-ic { width: 26px; height: 26px; flex: none; border-radius: 50%; background: #f1f3f4; border: 1px solid #e3e5e8; display: grid; place-items: center; overflow: hidden; color: #5f6368; }
.serp-ic img { width: 18px; height: 18px; object-fit: contain; }
.serp-url { font-size: 12px; color: #4d5156; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.serp-title { font-size: 19px; line-height: 1.3; color: #1a0dab; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.serp-desc { font-size: 13.5px; line-height: 1.55; color: #4d5156; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.serp-desc i { color: #9aa0a6; }
/* shared link card */
.ogcard { border: 1px solid #dadde1; border-radius: 10px; overflow: hidden; background: #f2f3f5; font-family: Helvetica, Arial, "IBM Plex Sans Arabic", sans-serif; }
.og-img { aspect-ratio: 1.91 / 1; background: #e4e6eb; display: grid; place-items: center; border-bottom: 1px solid #dadde1; }
.og-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.og-img span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: #8a8d91; }
.og-text { padding: 10px 12px 12px; }
.og-host { font-size: 11.5px; color: #606770; letter-spacing: .02em; margin-bottom: 3px; }
.og-title { font-size: 15px; font-weight: 600; line-height: 1.3; color: #1d2129; margin-bottom: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.og-desc { font-size: 13px; line-height: 1.4; color: #606770; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- CMS mode (js/cms.js): collections and their items, laid out like Webflow's CMS ---------- */
:root { --cms-w: clamp(640px, 56vw, 940px); --cms-item-w: 440px; }
#work { position: relative; }
#cms, #cms-item { display: none; }
body[data-mode="cms"] #work { grid-template-columns: 0 minmax(0, 1fr) 0; }
body[data-mode="cms"] #left, body[data-mode="cms"] #right { visibility: hidden; }
body[data-mode="cms"] #toggle-left, body[data-mode="cms"] #toggle-right { visibility: hidden; }
body[data-mode="cms"] #canvas-wrap { margin-inline-start: var(--cms-w); }
body[data-mode="cms"] #cms { display: flex; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--cms-w); z-index: 6; background: var(--panel); border-inline-end: 1px solid var(--line); box-shadow: 8px 0 30px -24px rgba(32, 31, 28, .35); }
body[data-mode="cms"] #cms-item.open { display: flex; flex-direction: column; position: absolute; inset-block: 0; inset-inline-start: var(--cms-w); width: min(var(--cms-item-w), calc(100% - var(--cms-w))); z-index: 7; background: var(--panel); border-inline-end: 1px solid var(--line); box-shadow: 16px 0 40px -22px rgba(32, 31, 28, .4); animation: cms-in .18s ease; }
@keyframes cms-in { from { opacity: 0; transform: translateX(-12px); } }
html[dir="rtl"] #cms-item.open { animation-name: cms-in-rtl; }
@keyframes cms-in-rtl { from { opacity: 0; transform: translateX(12px); } }
.cms-loading { display: grid; place-items: center; padding: 48px; color: var(--muted); }

/* collections */
.cms-cols { width: 236px; flex: none; border-inline-end: 1px solid var(--line); overflow: auto; padding: 14px 10px 20px; background: var(--field); }
.cms-cols-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.cms-cols-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.cms-cols-title .ic { color: var(--cms); }
.cms-lead { margin: 6px 6px 14px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.cms-grp { margin: 14px 6px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
html[lang="ar"] .cms-grp { letter-spacing: 0; font-size: 11.5px; }
.cms-col { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 9px; background: none; text-align: start; }
.cms-col:hover { background: var(--hover); }
.cms-col.on { background: var(--raised); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 0 0 1px var(--line); }
.cms-col-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--field-2); color: var(--ink-2); }
.cms-col.on .cms-col-ic { background: var(--cms-soft); color: var(--cms); }
.cms-col-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cms-col-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-col-sub { font-size: 11.5px; color: var(--muted); }
.cms-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* the open collection */
.cms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; container-type: inline-size; }
.cms-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px 12px; }
.cms-head-main { flex: 1; min-width: 0; }
.cms-head h2 { margin: 0; font: 600 20px/1.25 var(--serif); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[lang="ar"] .cms-head h2 { font-family: var(--font); font-size: 18px; letter-spacing: 0; }
.cms-head-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.pill.soft { background: var(--field-2); color: var(--ink-2); }
.cms-unpub { color: var(--accent-ink); font-weight: 500; }
.cms-unpub::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-inline-end: 6px; vertical-align: middle; }
.cms-tools { display: flex; align-items: center; gap: 10px; padding: 0 18px 12px; }
.cms-search { flex: 1; position: relative; display: flex; align-items: center; }
.cms-search .ic { position: absolute; inset-inline-start: 10px; color: var(--faint); pointer-events: none; }
.cms-search .inp { padding-inline-start: 32px; height: 32px; }
.cms-view { width: auto; }
.cms-view button { padding: 0 10px; }

.cms-table { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--line); }
.cms-tr { display: grid; grid-template-columns: var(--cms-cols); align-items: center; gap: 8px; padding: 0 12px; min-height: 52px; border-bottom: 1px solid var(--line-2); }
.cms-th { position: sticky; top: 0; z-index: 1; min-height: 34px; background: var(--field); font-size: 11.5px; font-weight: 500; color: var(--muted); border-bottom-color: var(--line); }
.cms-th > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container (max-width: 600px) { .cms-tr { grid-template-columns: var(--cms-cols-sm); } .cms-xcol { display: none; } }
.cms-tr input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--sel); cursor: pointer; display: block; }
.cms-row { cursor: pointer; background: var(--panel); transition: background .1s; position: relative; }
.cms-row:hover { background: var(--hover); }
.cms-row.picked { background: var(--sel-soft); }
.cms-row.open { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] .cms-row.open { box-shadow: inset -3px 0 0 var(--accent); }
.cms-row:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; }
.cms-row.archived .cms-thumb, .cms-row.archived .cms-name, .cms-row.archived .cms-cell { opacity: .5; }
.cms-row.dragging { opacity: .35; }
.cms-row.drop-before::before, .cms-row.drop-after::after { content: ""; position: absolute; inset-inline: 8px; height: 2px; background: var(--sel); border-radius: 2px; z-index: 2; }
.cms-row.drop-before::before { top: -1px; }
.cms-row.drop-after::after { bottom: -1px; }
.cms-grip { color: var(--faint); cursor: grab; display: grid; place-items: center; height: 32px; border-radius: 6px; }
.cms-grip:hover { color: var(--ink-2); background: var(--field-2); }
.cms-grip.off { visibility: hidden; }
.cms-row:active .cms-grip { cursor: grabbing; }
.cms-thumb { width: 44px; height: 36px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; color: var(--faint);
  background: var(--thumb) linear-gradient(45deg, var(--thumb-2) 25%, transparent 25%, transparent 75%, var(--thumb-2) 75%) 0 0 / 10px 10px; border: 1px solid var(--line); }
.cms-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cms-name { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.cms-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-name small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "IBM Plex Sans Arabic", var(--font); }
.cms-cell { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-st { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.cms-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cms-st.live { background: var(--tint-ok); color: var(--ok); }
.cms-st.new { background: var(--sel-soft); color: var(--sel-ink); }
.cms-st.edited { background: var(--accent-soft); color: var(--accent-ink); }
.cms-st.archived { background: var(--field-2); color: var(--muted); }
.cms-slot { position: sticky; top: 34px; z-index: 1; padding: 8px 14px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--field); border-bottom: 1px solid var(--line-2); }
.cms-tbody:empty { min-height: 44px; border-bottom: 1px dashed var(--line-strong); }
.cms-hint { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 18px 10px; border-top: 1px solid var(--line-2); }
.cms-bulk { position: absolute; inset-inline: 18px; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; background: #1f1e1c; color: #f5f4ef; border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .15s; z-index: 3; }
.cms-bulk > span { flex: 1; font-weight: 600; font-size: 12.5px; }
.cms-bulk .btn { background: rgba(255, 255, 255, .1); border-color: transparent; color: inherit; }
.cms-bulk .btn:hover { background: rgba(255, 255, 255, .18); }
.cms-bulk .btn.danger { color: #ffb4a8; }
.cms-bulk .linkbtn { color: rgba(245, 244, 239, .7); }
.menu-item.danger { color: var(--danger); }
.menu-item:disabled { opacity: .4; cursor: default; background: none; }

/* the item panel */
.cms-ip-head { flex: none; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.cms-ip-crumb { font-size: 11.5px; color: var(--muted); }
.cms-ip-title { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; min-width: 0; }
.cms-ip-title h3 { margin: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-ip-acts { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.cms-ip-acts .icon-btn { margin-inline-end: auto; }
.cms-ip-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 16px 24px; }
.cms-f { margin-bottom: 18px; }
.cms-f-lbl { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.cms-req { color: var(--accent); }
.cms-f .hint { margin-top: 5px; }
.cms-lang { position: relative; margin-bottom: 6px; }
.cms-lang-tag { position: absolute; top: 7px; inset-inline-end: 8px; z-index: 1; font: 600 10px/16px var(--font); padding: 0 5px; border-radius: 4px; background: var(--field-2); color: var(--muted); pointer-events: none; }
.cms-lang .inp { padding-inline-end: 38px; }
.cms-lang .inp[dir="rtl"] { padding-inline-end: 9px; padding-inline-start: 38px; font-family: "IBM Plex Sans Arabic", var(--font); }
.cms-lang .inp[dir="rtl"] ~ .cms-lang-tag, .cms-lang:has(.inp[dir="rtl"]) .cms-lang-tag { inset-inline-end: auto; inset-inline-start: 8px; }
html[dir="rtl"] .cms-lang:has(.inp[dir="rtl"]) .cms-lang-tag { inset-inline-start: auto; inset-inline-end: 8px; }
.cms-lang.rich .cms-lang-tag { top: 6px; }
.cms-rich { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); overflow: hidden; }
.cms-rich:focus-within { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.cms-rich-bar { display: flex; gap: 2px; padding: 3px 4px; border-bottom: 1px solid var(--line-2); background: var(--field); }
.cms-rich-bar button { width: 26px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--ink-2); }
.cms-rich-bar button:hover { background: var(--field-2); color: var(--ink); }
.cms-rich-ed { min-height: 84px; max-height: 260px; overflow: auto; padding: 8px 10px; line-height: 1.6; font-size: 13px; outline: none; overflow-wrap: anywhere; }
.cms-rich-ed[dir="rtl"] { font-family: "IBM Plex Sans Arabic", var(--font); }
.cms-rich-ed:empty::before { content: attr(data-ph); color: var(--faint); opacity: .8; pointer-events: none; }
.cms-img { position: relative; height: 150px; border-radius: 10px; border: 1px dashed var(--line-strong); overflow: hidden; display: grid; place-items: center;
  background: var(--thumb) linear-gradient(45deg, var(--thumb-2) 25%, transparent 25%, transparent 75%, var(--thumb-2) 75%) 0 0 / 14px 14px; }
.cms-img.over { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.cms-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.cms-img-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 20px; text-align: center; }
.cms-img-empty.bad { color: var(--danger); }
.cms-img-up { position: absolute; bottom: 8px; inset-inline-end: 8px; box-shadow: var(--shadow); }
.cms-url { margin-top: 6px; font-size: 12px; }
.cms-err { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 8px 10px; border-radius: 8px; background: var(--tint-danger); color: var(--danger); font-size: 12.5px; }
.cms-note { display: flex; gap: 8px; margin: 6px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--field); color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.cms-note .ic { margin-top: 2px; }
.cms-pages-bar { display: flex; align-items: center; gap: 8px; margin: 0 18px 12px; padding: 7px 10px; border-radius: 9px; background: var(--field); font-size: 12px; color: var(--muted); }
.cms-pages-bar > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-pages-bar code { font: 11.5px var(--mono); color: var(--ink-2); }
.cms-switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.cms-switch input { appearance: none; width: 28px; height: 16px; margin: 0; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; }
.cms-switch input::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); transition: transform .15s; }
.cms-switch input:checked { background: var(--ok); }
.cms-switch input:checked::after { transform: translateX(12px); }
[dir="rtl"] .cms-switch input:checked::after { transform: translateX(-12px); }
.cms-chip { display: inline-flex; align-items: center; gap: 3px; margin-inline-end: 4px; padding: 1px 6px; border-radius: 4px; background: var(--field-2); color: var(--muted); font: 600 10px/16px var(--font); vertical-align: 1px; }
.cms-chip .ic { flex: none; }
/* how an item shows: a card, a page, or both (cms.js showControl) */
.cms-show .seg button { min-height: 30px; padding: 3px 6px; white-space: normal; line-height: 1.2; text-align: center; }
.cms-show .seg button .ic { flex: none; }
.cms-show .seg button.on { color: var(--cms-ink); }
.cms-show .seg button.on .ic { color: var(--cms); }
.cms-show-warn { display: flex; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--cms-soft); color: var(--cms-ink); font-size: 11.5px; line-height: 1.45; }
.cms-show-warn .ic { flex: none; margin-top: 2px; }
.cms-url-sm { font: 11px var(--mono); color: var(--faint); }
.cms-sec { margin: 22px 0 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cms-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
.cms-sec-head > span { flex: 1; }
.cms-sec-head .ic { color: var(--cms); }
.cms-sec-status { margin: -6px 0 12px; color: var(--accent-ink); }
.cms-slug { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); overflow: hidden; }
.cms-slug > span { flex: none; padding: 0 4px 0 9px; font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.cms-slug .inp { border: 0; border-radius: 0; padding-inline-start: 2px; font-family: var(--mono); font-size: 12px; }
.cms-slug:focus-within { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.cms-slug .inp:focus { box-shadow: none; }
.cms-rich-bar button.on { background: var(--sel-soft); color: var(--sel-ink); }
.cms-code-btn { margin-inline-start: auto; width: auto !important; padding: 0 6px; font: 600 11px var(--mono); }
.cms-html-ed { max-height: 420px; }
.cms-html-ed h2 { font-size: 16px; margin: .6em 0 .3em; } .cms-html-ed h3 { font-size: 14px; margin: .6em 0 .3em; }
.cms-html-ed p { margin: 0 0 .6em; } .cms-html-ed ul, .cms-html-ed ol { margin: 0 0 .6em; padding-inline-start: 20px; }
.cms-html-ed img { max-width: 100%; height: auto; }
.cms-html-code { border: 0; border-radius: 0; min-height: 200px; font: 11.5px/1.6 var(--mono); resize: vertical; }

/* in Edit mode: an element that is part of a collection */
.cms-insp { display: flex; gap: 10px; margin: 12px 14px 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; line-height: 1.5; }
.cms-insp .ic { margin-top: 2px; flex: none; }
.cms-insp p { margin: 0 0 8px; }
.cms-insp.cms { background: var(--cms-soft); color: var(--cms-ink); }
.cms-insp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 4px; }
.cms-insp-head b { font-weight: 650; }
.cms-insp-head span { font-size: 11px; opacity: .8; }
.cms-insp-field { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; font-weight: 600; }
.dev-note p { margin: 0; }

@media (max-width: 1180px) { :root { --cms-w: min(640px, 70vw); --cms-item-w: 400px; } .cms-cols { width: 200px; } }

/* ---------- Inbox mode (js/inbox.js): messages from the site's forms ---------- */
#inbox { display: none; }
#modes .badge { margin-inline-start: 2px; }
body[data-mode="inbox"] #inbox { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); position: absolute; inset: 0; z-index: 8; background: var(--panel); }
body[data-mode="inbox"] #toggle-left, body[data-mode="inbox"] #toggle-right { visibility: hidden; }
.ib-side { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--line); background: var(--field); }
.ib-head { display: flex; align-items: flex-start; gap: 8px; padding: 16px 16px 4px 18px; }
.ib-head-main { flex: 1; min-width: 0; }
.ib-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 20px/1.25 var(--serif); letter-spacing: -.01em; }
.ib-head h2 .ic { color: var(--accent); }
html[lang="ar"] .ib-head h2 { font-family: var(--font); font-size: 18px; letter-spacing: 0; }
.ib-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.ib-sub b { color: var(--accent-ink); font-weight: 600; }
.ib-lead { margin: 4px 18px 12px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.ib-tools { display: flex; align-items: center; gap: 8px; padding: 0 14px 12px; }
.ib-tools .seg { flex: none; }
.ib-list { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--line); }
.ib-row { width: 100%; display: flex; gap: 10px; padding: 12px 16px 12px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: var(--panel); text-align: start; position: relative; }
.ib-row:hover { background: var(--hover); }
.ib-row.open { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] .ib-row.open { box-shadow: inset -3px 0 0 var(--accent); }
.ib-row:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; }
.ib-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; background: transparent; }
.ib-row.unread .ib-dot { background: var(--accent); }
.ib-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ib-row-top { display: flex; align-items: baseline; gap: 8px; }
.ib-row-top b { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-row.unread .ib-row-top b { font-weight: 700; }
.ib-row-top time { flex: none; font-size: 11.5px; color: var(--faint); }
.ib-row.unread .ib-row-top time { color: var(--accent-ink); font-weight: 600; }
.ib-row-mail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
html[dir="rtl"] .ib-row-mail { text-align: right; }
.ib-row-msg { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--font); }
.ib-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 24px; text-align: center; color: var(--muted); }
.ib-empty .ic { color: var(--faint); margin-bottom: 4px; }
.ib-empty b { color: var(--ink-2); font-weight: 600; }
.ib-empty span { font-size: 12px; max-width: 260px; }
.ib-pick { height: 100%; justify-content: center; }
.ib-read { min-width: 0; min-height: 0; overflow: auto; padding: 24px clamp(20px, 4vw, 56px) 40px; }
.ib-read-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); max-width: 760px; }
.ib-read-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ib-read-who h3 { margin: 0 0 2px; font: 600 18px/1.3 var(--font); overflow-wrap: anywhere; }
.ib-read-who a { color: var(--sel-ink); text-decoration: none; font-size: 13px; overflow-wrap: anywhere; }
.ib-read-who a:hover { text-decoration: underline; }
.ib-avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.ib-read-acts { display: flex; align-items: center; gap: 4px; }
.ib-read-acts .btn.primary { text-decoration: none; margin-inline-end: 6px; }
.ib-read-acts .icon-btn.danger:hover { color: var(--danger); }
.ib-msg { max-width: 760px; margin: 20px 0 24px; font-size: 15px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-msg.none { color: var(--muted); font-style: italic; font-size: 13px; }
.ib-meta { max-width: 760px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-size: 12.5px; }
.ib-meta dt { color: var(--muted); }
.ib-meta dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.ib-meta a { color: var(--sel-ink); text-decoration: none; }
.ib-meta a:hover { text-decoration: underline; }
@media (max-width: 860px) { body[data-mode="inbox"] #inbox { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 45%) minmax(0, 1fr); } .ib-side { border-inline-end: 0; border-bottom: 1px solid var(--line); } }
#modes button .badge:not(.hide) { display: inline-block; }
.cms-head-sub > * { white-space: nowrap; }
.pick-act { gap: 8px; padding: 7px 10px; font-size: 12.5px; }
.pick-act > .ic:first-child { color: var(--faint); }

/* Pages list: Duplicate page and Page settings on each row (panels.js, pageops.js) */
.page-item { position: relative; }
.page-item[hidden] { display: none; }
.page-acts { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; background: var(--hover); border-radius: 6px; }
.page-item:hover .page-acts, .page-item:focus-within .page-acts { display: flex; }
.page-item .badge.new { background: var(--sel-soft); color: var(--sel); }
/* Page settings: the page's address, the part that can change in a field */
.pg-url { display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--faint); }
.pg-url .inp { flex: 1; min-width: 60px; }
.pg-pre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
/* Pages list: a page under another one step in, as in the Sitemap */
.page-row { padding-inline-start: calc(10px + var(--d, 0) * 14px); }

/* ---------- Sitemap mode (js/sitemap.js): every page and its sections as a map to rearrange, the left panel beside it ---------- */
:root { --pend: #e0a526; --pend-soft: #fff5dc; --pend-line: #efd38e; --pend-ink: #855600;
  --sm-bg: #f2f1ec; --sm-dot: #d6d2c6; --sm-wire: #bfbaad; --sm-line: #e3e0d7; --sm-line-2: #d3cfc4; --sm-tpl: #eef3fd; --sm-row: #f6f5f1; --sm-grip: #c2beb2;
  --sm-hit: #fff7da; --sm-hit-line: #e9d38b; --sm-chip: #ebe9e2; --sm-chip-pend: #fbe7b5; --sm-list: #ddd0fb; --sm-far: #ecebe5; --sm-far-pend: #f5d98f; --sm-far-sel: #bcd0f7;
  --tint-ok: #e5f0e9; --tint-danger: #f6e4e0; }
#sitemap { display: none; }
/* in the canvas's column: the left panel stays beside it */
body[data-mode="sitemap"] #sitemap { display: block; position: absolute; inset: 0; grid-column: 2; grid-row: 1; z-index: 8; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  background-color: var(--sm-bg); background-image: radial-gradient(var(--sm-dot) 1.1px, transparent 1.3px); background-size: 24px 24px; }
body[data-mode="sitemap"] #work { grid-template-columns: var(--left-w) minmax(0, 1fr) 0; }
body[data-mode="sitemap"].hide-left #work { grid-template-columns: 0 minmax(0, 1fr) 0; }
body[data-mode="sitemap"] #toggle-right { visibility: hidden; }
#sitemap.grabbing, #sitemap.grabbing *, #sitemap.dragging, #sitemap.dragging * { cursor: grabbing !important; }
#sitemap.space .sm-card, #sitemap.space .sm-row, #sitemap.space .sm-head { cursor: grab; }
#sitemap.busy .sm-cards { cursor: progress; }
.sm-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; direction: ltr; }
.sm-wires { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.sm-wires path { fill: none; stroke: var(--sm-wire); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.sm-wires path.sm-cmslink { stroke: var(--cms); stroke-width: 1.8; opacity: .85; }
.sm-wires path.sm-cmslink.frozen { stroke: var(--sm-wire); stroke-dasharray: 4 4; opacity: 1; }
.sm-cmsdot { fill: var(--cms); }
.sm-cmsdot.frozen { fill: var(--sm-wire); }
.sm-trays rect { fill: rgba(47, 111, 235, .035); stroke: rgba(47, 111, 235, .3); stroke-width: 1.2; stroke-dasharray: 5 4; }
.sm-cards { position: relative; }
/* a page */
.sm-card { position: absolute; background: var(--panel); border: 1px solid var(--sm-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(32, 31, 28, .05), 0 10px 28px -18px rgba(32, 31, 28, .26); transition: box-shadow .15s, opacity .15s; cursor: grab; }
html[dir="rtl"] .sm-card { direction: rtl; }
.sm-card:hover { border-color: var(--sm-line-2); }
.sm-card.sel { border-color: transparent; box-shadow: 0 0 0 2px var(--sel), 0 12px 32px -20px rgba(32, 31, 28, .3); }
.sm-card.pend { border-color: transparent; box-shadow: 0 0 0 2px var(--pend), 0 10px 28px -18px rgba(32, 31, 28, .26); }
.sm-card.pend.sel { box-shadow: 0 0 0 2px var(--sel), 0 0 0 6px rgba(224, 165, 38, .4); }
.sm-card.dim { opacity: .25; }
.sm-card.lifted { opacity: .4; }
.sm-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 10px 12px; border-radius: 13px 13px 0 0; }
html[dir="rtl"] .sm-head { padding: 12px 12px 10px 8px; }
.sm-card.root .sm-head { background: var(--inv); color: var(--inv-ink); }
.sm-card.tpl .sm-head { background: var(--sm-tpl); }
.sm-ic { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 9px; background: var(--field-2); color: var(--ink-2); }
.sm-card.root .sm-ic { background: rgba(255, 255, 255, .12); color: #fff; }
.sm-card.tpl .sm-ic { background: var(--panel); color: var(--sel-ink); }
.sm-titles { flex: 1; min-width: 0; }
.sm-title { font-weight: 650; font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.005em; }
.sm-url { font: 11px/1.45 var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[dir="rtl"] .sm-url { text-align: right; }
.sm-card.root .sm-url { color: rgba(250, 249, 245, .55); }
.sm-badges { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 8px; }
.sm-card.root .sm-badges, .sm-card.tpl .sm-badges { padding-top: 8px; }
.sm-badge { display: inline-flex; align-items: center; justify-content: center; gap: 3px; height: 19px; min-width: 19px; padding: 0 7px; border-radius: 999px; font: 600 10.5px/1 var(--font); background: var(--field-2); color: var(--ink-2); white-space: nowrap; }
.sm-badge.ch { background: var(--accent); color: #fff; padding: 0 6px; }
.sm-badge.new { background: var(--sel-soft); color: var(--sel-ink); }
.sm-badge.cms { background: var(--cms-soft); color: var(--cms-ink); }
.sm-badge.pend { background: var(--pend-soft); color: var(--pend-ink); box-shadow: inset 0 0 0 1px var(--pend-line); }
.sm-more { width: 26px; height: 26px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--faint); opacity: 0; transition: opacity .12s; }
.sm-card:hover .sm-head .sm-more, .sm-row:hover .sm-more, .sm-more:focus-visible, .sm-card.sel .sm-head .sm-more, .sm-row.sel .sm-more { opacity: 1; }
.sm-more:hover { background: var(--hover); color: var(--ink); }
.sm-card.root .sm-head .sm-more { color: rgba(250, 249, 245, .7); }
.sm-card.root .sm-head .sm-more:hover { background: rgba(255, 255, 255, .12); color: #fff; }
@media (hover: none) { .sm-more { opacity: 1; } }
/* its sections, in order */
.sm-rows { display: flex; flex-direction: column; gap: 5px; padding: 2px 10px 10px; }
.sm-card.root .sm-rows, .sm-card.tpl .sm-rows { padding-top: 10px; }
.sm-row { position: relative; display: flex; align-items: flex-start; gap: 7px; padding: 8px 4px 9px 8px; border-radius: 9px; background: var(--sm-row); border: 1px solid transparent; transition: background .12s, border-color .12s, opacity .12s, box-shadow .12s; }
html[dir="rtl"] .sm-row { padding: 8px 8px 9px 4px; }
.sm-row:hover { border-color: var(--line-strong); background: var(--panel); }
.sm-row.sel { border-color: var(--sel); background: var(--panel); box-shadow: 0 0 0 3px var(--sel-soft); }
.sm-row.pend { background: var(--pend-soft); border-color: var(--pend-line); }
.sm-row.pend.sel { border-color: var(--sel); }
.sm-row.hit { background: var(--sm-hit); border-color: var(--sm-hit-line); }
.sm-row.lifted { opacity: .3; }
.sm-row.edited::before { content: ""; position: absolute; inset-inline-start: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.sm-row.lock { align-items: center; padding-block: 5px; background: transparent; border: 1px dashed var(--line-strong); cursor: default; }
.sm-row.lock .sm-name { color: var(--muted); font-weight: 500; }
.sm-row.gone, .sm-row.tucked { opacity: .6; }
.sm-row.veiled { opacity: .6; }
.sm-row.gone .sm-name > span:first-child { text-decoration: line-through; }
.sm-grip { flex: none; width: 14px; height: 18px; display: grid; place-items: center; color: var(--sm-grip); }
.sm-row:hover .sm-grip { color: var(--muted); }
.sm-row.lock .sm-grip { height: 22px; }
.sm-row-main { flex: 1; min-width: 0; }
.sm-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; line-height: 18px; color: var(--ink); }
.sm-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-own { width: 5px; height: 5px; flex: none; border-radius: 50%; background: var(--sel); }
.sm-desc { margin-top: 1px; font-size: 11.5px; line-height: 1.45; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sm-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 19px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 500; background: var(--sm-chip); color: var(--ink-2); }
.sm-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-chip.moved { background: var(--accent-soft); color: var(--accent-ink); }
.sm-chip.copy { background: var(--sel-soft); color: var(--sel-ink); }
.sm-chip.off { background: var(--tint-danger); color: var(--danger); }
.sm-chip.cms { background: var(--cms-soft); color: var(--cms-ink); }
.sm-chip.pend { background: var(--sm-chip-pend); color: var(--pend-ink); font-weight: 600; }
.sm-row .sm-more { width: 22px; height: 22px; margin-top: -2px; }
/* the items a section lists, by their titles */
.sm-list { display: flex; flex-direction: column; margin-top: 5px; padding-inline-start: 7px; border-inline-start: 2px solid var(--sm-list); }
.sm-li { display: block; width: 100%; min-width: 0; padding: 1px 6px; border: 0; border-radius: 5px; background: none; color: var(--ink-2); font: 400 11.5px/1.4 var(--font); text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-li:hover { background: var(--tint-ok); color: var(--ok); }
.sm-li.more { color: var(--muted); font-weight: 500; }
.sm-none { padding: 14px 8px; text-align: center; font-size: 12px; color: var(--faint); }
.sm-sum { padding: 2px 14px 12px; font-size: 12px; color: var(--muted); }
.sm-more-rows { display: flex; align-items: center; gap: 6px; margin: -4px 10px 10px; padding: 5px 8px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 11.5px; }
.sm-more-rows:hover { background: var(--hover); color: var(--ink); }
.sm-kids { position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%); z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-2); font-size: 11px; font-weight: 500; white-space: nowrap; }
.sm-kids:hover { color: var(--ink); border-color: var(--muted); }
.sm-kids.shut { background: var(--inv); border-color: var(--inv); color: var(--inv-ink); }
/* a CMS item's page, on its template's tray */
.sm-card.item { border-radius: 10px; box-shadow: 0 1px 2px rgba(32, 31, 28, .05); cursor: default; }
.sm-card.item.draft { background: var(--field); border-style: dashed; }
.sm-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px 10px; }
.sm-card.item .sm-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.7em; overflow-wrap: anywhere; }
.sm-card.item .sm-url { font-size: 10.5px; margin-top: 3px; }
.sm-card.item .sm-badge { flex: none; }
.sm-card.item.more { background: var(--sm-row); border-style: dashed; box-shadow: none; }
.sm-item-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 58px; padding: 9px 10px; border: 0; border-radius: inherit; background: none; color: var(--ink-2); font: 600 12.5px/1.3 var(--font); }
.sm-item-more:hover { background: var(--hover); color: var(--ink); }
/* zoomed far out: the names over the cards, the cards' words out of the way */
.sm-labels { position: absolute; inset: 0; z-index: 2; display: none; direction: ltr; overflow: hidden; pointer-events: none; }
#sitemap.far .sm-labels { display: block; }
.sm-label { position: absolute; left: 0; top: 0; box-sizing: border-box; padding: 5px 8px; border-radius: 8px; background: var(--glass); color: var(--ink); font: 650 13px/1.25 var(--font); text-align: start; overflow-wrap: anywhere; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; box-shadow: 0 1px 2px rgba(32, 31, 28, .1); }
.sm-label.narrow { padding: 3px 5px; font-size: 11px; border-radius: 6px; }
.sm-label.root { background: var(--inv); color: var(--inv-ink); font-size: 14px; }
.sm-label.root.narrow { font-size: 12px; }
.sm-label.tpl { background: var(--sm-tpl); color: var(--sel-ink); }
.sm-label.item { font-size: 11px; font-weight: 550; padding: 3px 6px; border-radius: 6px; -webkit-line-clamp: 2; background: var(--glass); }
.sm-label.more { background: var(--sm-row); color: var(--ink-2); }
.sm-label.dim { opacity: .25; }
#sitemap.far .sm-head > *, #sitemap.far .sm-row > *, #sitemap.far .sm-badges, #sitemap.far .sm-item, #sitemap.far .sm-item-more > *, #sitemap.far .sm-more-rows, #sitemap.far .sm-sum, #sitemap.far .sm-none, #sitemap.far .sm-kids { visibility: hidden; }
#sitemap.far .sm-row { background: var(--sm-far); border-color: transparent; box-shadow: none; }
#sitemap.far .sm-row.pend { background: var(--sm-far-pend); }
#sitemap.far .sm-row.sel { background: var(--sm-far-sel); }
/* where a dragged section or page goes */
.sm-drop { position: absolute; left: 12px; right: 12px; z-index: 2; height: 3px; margin-top: -1.5px; border-radius: 3px; background: var(--sel); box-shadow: 0 0 0 3px rgba(47, 111, 235, .15); pointer-events: none; }
.sm-drop::before { content: ""; position: absolute; left: -5px; top: -3.5px; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--sel); background: var(--panel); }
html[dir="rtl"] .sm-drop::before { left: auto; right: -5px; }
.sm-drop.copy { background: var(--ok); box-shadow: 0 0 0 3px rgba(46, 125, 79, .15); }
.sm-drop.copy::before { border-color: var(--ok); }
.sm-slot { position: absolute; z-index: 5; width: 4px; margin-left: -2px; border-radius: 4px; background: var(--sel); box-shadow: 0 0 0 4px rgba(47, 111, 235, .18); pointer-events: none; }
.sm-card.drop-into { box-shadow: 0 0 0 2px var(--sel), 0 0 0 7px rgba(47, 111, 235, .16), 0 18px 44px -20px rgba(47, 111, 235, .5); }
.sm-card.drop-no { box-shadow: 0 0 0 2px var(--danger); }
.sm-ghost { position: fixed; left: 0; top: 0; z-index: 95; display: flex; align-items: center; gap: 7px; max-width: 340px; padding: 7px 12px; border-radius: 999px; background: var(--inv); color: var(--inv-ink); font-size: 12.5px; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow-lg); pointer-events: none; }
.sm-ghost span { overflow: hidden; text-overflow: ellipsis; }
.sm-ghost-plus { display: none; width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--ok); color: #fff; font-size: 12px; line-height: 16px; text-align: center; }
.sm-ghost.copy .sm-ghost-plus { display: block; }
.sm-ghost-to { display: none; padding-inline-start: 8px; border-inline-start: 1px solid rgba(255, 255, 255, .2); color: #f2c4b3; }
.sm-ghost-to.show { display: inline; }
.sm-ghost.no { opacity: .6; }
.sm-ghost.no .sm-ghost-to { color: #f3a99d; }
/* the toolbar, zoom, the first-time hint and what waits for approval */
.sm-bar { position: absolute; top: 12px; inset-inline: 12px; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; }
.sm-bar > * { pointer-events: auto; }
.sm-bar-l, .sm-bar-r, .sm-zoom { background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.sm-bar-l { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; min-width: 0; }
.sm-bar-l svg { color: var(--accent); flex: none; }
.sm-bar-l b { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.sm-bar-l .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-bar-r { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 6px; min-width: 0; }
.sm-search { position: relative; display: flex; align-items: center; width: 200px; }
.sm-search .ic { position: absolute; inset-inline-start: 9px; color: var(--faint); pointer-events: none; }
.sm-search .inp { height: 30px; padding-inline-start: 30px; font-size: 12.5px; }
.sm-bar .icon-btn.on { background: var(--sel-soft); color: var(--sel-ink); }
.sm-zoom { position: absolute; bottom: 14px; inset-inline-end: 14px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 4px; }
.sm-hint { position: absolute; top: 66px; inset-inline-start: 12px; z-index: 3; display: flex; align-items: flex-start; gap: 10px; max-width: min(520px, calc(100% - 24px)); padding: 10px 8px 10px 14px; border-radius: 12px; background: var(--inv); color: var(--inv-ink); font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow-lg); animation: pop .2s; }
html[dir="rtl"] .sm-hint { padding: 10px 14px 10px 8px; }
.sm-hint > svg { margin-top: 2px; color: #f2b8a2; flex: none; }
.sm-hint .icon-btn { flex: none; color: rgba(245, 244, 239, .7); }
.sm-hint .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sm-approve { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 220px); padding: 7px 7px 7px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--pend-line); box-shadow: 0 0 0 4px rgba(224, 165, 38, .14), var(--shadow-lg); animation: pop .2s; }
html[dir="rtl"] .sm-approve { padding: 7px 14px 7px 7px; }
.sm-approve.hide { display: none; }
.sm-ap-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--pend); box-shadow: 0 0 0 4px rgba(224, 165, 38, .2); }
.sm-ap-text { display: flex; flex-direction: column; min-width: 0; margin-inline-end: 6px; }
.sm-ap-text b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.sm-ap-text .muted { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-approve .btn { flex: none; }
.sm-state { position: absolute; inset: 0; z-index: 2; display: none; place-items: center; pointer-events: none; }
.sm-state.show { display: grid; }
.sm-state-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 30px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--muted); font-size: 13px; pointer-events: auto; }
.sm-state-box b { color: var(--ink); }
/* renaming in place, the menus and the page list to move a section to */
.sm-menu { min-width: 240px; }
.sm-menu .menu-head { font-weight: 600; color: var(--ink-2); }
.sm-menu .menu-item.good { color: var(--ok); }
.sm-rename { position: fixed; z-index: 96; height: 32px; font-weight: 600; border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft), var(--shadow-lg); }
.sm-rename-hint { position: fixed; z-index: 96; max-width: 320px; padding: 5px 9px; border-radius: 7px; background: var(--inv); color: var(--inv-ink); font-size: 11.5px; line-height: 1.4; pointer-events: none; }
.sm-pick-where { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 12.5px; color: var(--ink-2); }
.sm-pick-q { margin-bottom: 8px; }
.sm-pick-q .inp { padding-inline-start: 30px; }
.sm-pick-list { max-height: 46vh; overflow: auto; margin: 0 -8px; }
.sm-pick { padding-inline-start: calc(10px + var(--d, 0) * 16px); }
.sm-pick > svg { color: var(--faint); }
.sm-pick[hidden] { display: none; }
.sm-help { margin: 0; padding-inline-start: 18px; }
.sm-help li { margin-bottom: 8px; }
/* the Changes list: what waits for approval on the Sitemap, first (panels.js) */
.badge.plan { background: var(--pend); color: #fff; }
.ltab .badge + .badge.plan { inset-inline-end: 26px; }
.plan-grp { margin: 6px; padding: 4px 4px 8px; border-radius: 12px; background: var(--pend-soft); border: 1px solid var(--pend-line); }
.plan-grp .grp-head { color: var(--pend-ink); }
.plan-note { padding: 0 8px 6px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.plan-op { gap: 6px; padding: 7px 6px; }
.plan-op:hover { background: var(--glass); }
.plan-op .change-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.plan-op .icon-btn { width: 28px; height: 28px; opacity: 1; }
.plan-op .icon-btn.good { color: var(--ok); }
.plan-op .icon-btn.good:hover { background: var(--tint-ok); }
.plan-op .icon-btn:disabled { opacity: .3; }
.plan-ic { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--panel); color: var(--pend-ink); align-self: flex-start; }
.plan-op.stuck .change-title { color: var(--muted); }
.chip.warn { background: var(--tint-danger); color: var(--danger); }
.plan-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 0; }
.empty.after-plan { padding-top: 22px; }
.pub-plan { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 9px 11px; border-radius: 9px; background: var(--pend-soft); border: 1px solid var(--pend-line); color: var(--pend-ink); font-size: 12.5px; line-height: 1.45; }
.pub-plan svg { flex: none; margin-top: 2px; }
@media (max-width: 1100px) { .sm-bar-l .muted { display: none; } .sm-search { width: 150px; } .sm-ap-text .muted { display: none; } }
@media (max-width: 860px) { .sm-approve { max-width: calc(100% - 28px); bottom: 64px; } }
@media (max-width: 760px) { .sm-bar { flex-direction: column; align-items: stretch; } .sm-bar-r { justify-content: flex-start; } .sm-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .sm-card, .sm-row, .sm-hint, .sm-approve { transition: none; animation: none; } }

/* ---------- dark theme (html[data-theme="dark"], switched in the top bar and the account menu; js/main.js) ----------
   Only tokens change, so every state rule keeps working. The page being edited (canvas, board frames)
   and the Google and social previews keep the site's own light colours. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161513; --dot: #2e2c28; --panel: #1f1e1b; --field: #262521; --field-2: #2c2b27; --hover: #2e2d29;
  --line: #34322d; --line-2: #2b2a26; --line-strong: #46433c;
  --ink: #ecebe6; --ink-2: #c8c5bc; --muted: #9b978d; --faint: #757168;
  --accent: #d46a45; --accent-hover: #e07a56; --accent-soft: #3b2820; --accent-ink: #f0a487;
  --sel: #5b8ff2; --sel-soft: rgba(91, 143, 242, .2); --sel-ink: #a3c0fa;
  --cms: #a37ef5; --cms-soft: rgba(163, 126, 245, .2); --cms-ink: #cbb6fd; --cms-line: rgba(163, 126, 245, .6); --cms-badge: #2f2647;
  --ok: #5cb784; --danger: #ec7462;
  --raised: #3a3833; --glass: rgba(31, 30, 27, .94); --check: #2f2d29; --thumb: #2a2925; --thumb-2: #32302b; --inv: #3a3833; --inv-ink: #f5f4ef;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 60px -18px rgba(0, 0, 0, .75);
  --pend-soft: #3a3020; --pend-line: #6b5524; --pend-ink: #f1c867;
  --sm-bg: #151412; --sm-dot: #34322d; --sm-wire: #57534b; --sm-line: #3a3833; --sm-line-2: #4d4a42; --sm-tpl: #1f2a40; --sm-row: #262521; --sm-grip: #5f5b52;
  --sm-hit: #3a3020; --sm-hit-line: #6b5524; --sm-chip: #34322d; --sm-chip-pend: #4a3a18; --sm-list: #3f3266; --sm-far: #2e2c28; --sm-far-pend: #5a4719; --sm-far-sel: #2a3d63;
  --tint-ok: rgba(92, 183, 132, .16); --tint-danger: rgba(236, 116, 98, .16);
}
:root[data-theme="dark"] .avatar { background: #46433c; }
:root[data-theme="dark"] .sw { border-color: rgba(255, 255, 255, .2); }
:root[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .modal { box-shadow: 0 0 0 1px var(--line), 0 30px 80px -20px rgba(0, 0, 0, .8); }

/* CMS: duplicated collections, items moved between collections (js/cms.js) */
.cms-copy-bar { justify-content: space-between; }
.cms-picks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cms-pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; font-size: 13px; }
.cms-pick:has(input:checked) { border-color: var(--sel); background: var(--sel-soft); }

/* ---------- an item page's content as blocks (js/blocks.js) ---------- */
.cms-blk-lang { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); margin-bottom: 8px; }
.cms-blk-bar { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--line-2); }
.cms-blk-bar .cms-lang-tag { position: static; }
.cms-blk-bar .hint { margin: 0; flex: 1; }
.cms-blk-bar .cms-code-btn { border: 0; background: none; border-radius: 5px; height: 22px; padding: 0 6px; font: 600 11px/22px var(--mono); color: var(--ink-2); }
.cms-blk-bar .cms-code-btn:hover, .cms-blk-bar .cms-code-btn.on { background: var(--sel-soft); color: var(--sel-ink); }
.cms-blk-lang .cms-html-code { min-height: 260px; }
.cms-blocks { padding: 8px; display: flex; flex-direction: column; }
.cms-blk-none { padding: 6px 2px 10px; }
.cms-blk { border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); transition: box-shadow .15s, border-color .15s; position: relative; }
.cms-blk:focus-within { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-soft); }
.cms-blk.flash { border-color: var(--sel); }
.cms-blk.dragging { opacity: .45; }
.cms-blk.drop-before::before, .cms-blk.drop-after::after { content: ''; position: absolute; inset-inline: -2px; height: 3px; border-radius: 2px; background: var(--sel); }
.cms-blk.drop-before::before { top: -6px; } .cms-blk.drop-after::after { bottom: -6px; }
.cms-blk-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-bottom: 1px solid var(--line-2); background: var(--field); border-radius: 8px 8px 0 0; min-height: 32px; }
.cms-blk-grip { cursor: grab; color: var(--faint); display: grid; place-items: center; width: 18px; height: 22px; border-radius: 4px; }
.cms-blk-grip:hover { color: var(--ink); background: var(--field-2); }
.cms-blk-type { display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px/1 var(--font); color: var(--ink-2); white-space: nowrap; }
.cms-blk-head select.inp.xs { width: auto; height: 24px; padding: 0 22px 0 6px; font-size: 11.5px; border-radius: 6px; }
html[dir="rtl"] .cms-blk-head select.inp.xs, .cms-blocks[dir="rtl"] select.inp.xs { padding: 0 6px 0 22px; }
.cms-blk-fmt { display: inline-flex; gap: 1px; }
.cms-blk-fmt button { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--ink-2); }
.cms-blk-fmt button:hover { background: var(--field-2); color: var(--ink); }
.cms-blk-tools { margin-inline-start: auto; display: inline-flex; gap: 1px; opacity: .55; transition: opacity .15s; }
.cms-blk:hover .cms-blk-tools, .cms-blk:focus-within .cms-blk-tools, .cms-blk-card:hover .cms-blk-tools { opacity: 1; }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 5px; }
.icon-btn.xs:disabled { opacity: .3; pointer-events: none; }
.cms-blk-what { font: 11px/1 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cms-blk-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cms-blk-body > .inp { font-size: 13px; }
.cms-blocks[dir="rtl"] .inp, .cms-blocks[dir="rtl"] .cms-blk-ed { font-family: "IBM Plex Sans Arabic", var(--font); }
.cms-blk-ed { outline: none; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; min-height: 22px; padding: 2px 3px; border-radius: 4px; }
.cms-blk-ed:empty::before { content: attr(data-ph); color: var(--faint); pointer-events: none; }
.cms-blk-ed.multi { min-height: 44px; border: 1px dashed var(--line-2); padding: 5px 7px; }
.cms-blk-ed.multi:focus { border-color: var(--line-strong); }
.cms-blk-ed p { margin: 0 0 .5em; } .cms-blk-ed p:last-child { margin-bottom: 0; }
.cms-blk-ed ul, .cms-blk-ed ol { margin: 0 0 .5em; padding-inline-start: 20px; }
.cms-blk-ed.h-h1 { font-size: 19px; font-weight: 700; line-height: 1.35; }
.cms-blk-ed.h-h2 { font-size: 16px; font-weight: 700; line-height: 1.4; }
.cms-blk-ed.h-h3, .cms-blk-ed.h-h4 { font-size: 14px; font-weight: 650; line-height: 1.4; }
.cms-blk-list { margin: 0; padding-inline-start: 22px; }
.cms-blk-list li { margin: 1px 0; }
.cms-blk-pic { position: relative; border-radius: 6px; overflow: hidden; background: var(--field); min-height: 70px; display: grid; place-items: center; border: 1px dashed transparent; }
.cms-blk-pic.over { border-color: var(--sel); }
.cms-blk-pic img { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.cms-blk-pic .cms-img-up { position: absolute; bottom: 6px; inset-inline-end: 6px; }
.cms-blk-pic .cms-img-empty { padding: 18px; }
.cms-blk.k-box .cms-blk-body { border-inline-start: 3px solid var(--sel); border-radius: 0 0 0 8px; }
.cms-blk-card { border: 1px solid var(--line-2); border-radius: 7px; padding: 6px; display: flex; flex-direction: column; gap: 5px; background: var(--field); }
.cms-blk-card-head { display: flex; align-items: center; gap: 6px; }
.cms-blk-card-head .inp { flex: 1; height: 26px; padding: 2px 7px; font-size: 12px; font-weight: 600; }
.cms-blk-num { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 600 10.5px/1 var(--font); background: var(--sel-soft); color: var(--sel-ink); }
.cms-blk-card .cms-blk-tools { opacity: .55; }
.cms-blk-card .cms-blk-ed.multi { background: var(--panel); }
.cms-blk-cadd { align-self: flex-start; }
.cms-blk-code { min-height: 90px; font: 11px/1.55 var(--mono); resize: vertical; }
.cms-blk-gap { position: relative; height: 10px; }
.cms-blk-ins { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-2); display: grid; place-items: center; opacity: 0; transition: opacity .15s; z-index: 2; }
.cms-blk-gap:hover .cms-blk-ins, .cms-blk-ins:focus-visible, .cms-blk-gap:has(.cms-blk-menu) .cms-blk-ins { opacity: 1; }
.cms-blk-ins:hover { background: var(--sel); color: #fff; border-color: var(--sel); }
.cms-blk-add { position: relative; margin-top: 8px; }
.cms-blk-menu { position: absolute; z-index: 20; top: calc(100% + 4px); inset-inline-start: 0; min-width: 200px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 4px; display: flex; flex-direction: column; }
.cms-blk-gap .cms-blk-menu { inset-inline-start: 50%; transform: translateX(-50%); top: 16px; }
html[dir="rtl"] .cms-blk-gap .cms-blk-menu, .cms-blocks[dir="rtl"] .cms-blk-gap .cms-blk-menu { transform: translateX(50%); }
.cms-blk-menu button { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: start; padding: 7px 9px; border-radius: 6px; font-size: 12.5px; color: var(--ink); }
.cms-blk-menu button:hover, .cms-blk-menu button:focus { background: var(--field-2); outline: none; }
.cms-blk-ed.title { font-weight: 650; border: 1px solid var(--line-2); padding: 4px 7px; border-radius: 6px; background: var(--panel); }
.cms-blk-ed.title:focus { border-color: var(--line-strong); }
.cms-blocks[hidden], .cms-blk-lang .cms-html-code[hidden] { display: none; }
/* which language a content box is: its own colour, name and edge */
.cms-blk-lang.lang-en { --lang: #2f6fdf; --lang-soft: rgba(47,111,223,.09); }
.cms-blk-lang.lang-ar { --lang: #0d8a5f; --lang-soft: rgba(13,138,95,.10); }
.cms-blk-lang.lang-en, .cms-blk-lang.lang-ar { border-color: var(--lang); border-inline-start-width: 4px; margin-bottom: 14px; }
.cms-blk-lang .cms-blk-bar { background: var(--lang-soft); border-bottom-color: var(--lang); border-radius: 6px 6px 0 0; padding: 7px 10px; }
.cms-blk-lname { display: inline-flex; align-items: center; gap: 7px; font: 650 13px/1 var(--font); color: var(--lang); }
.cms-blk-lname b { display: grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--lang); color: #fff; font: 700 11px/1 var(--font); }
.cms-blk-lang.lang-ar .cms-blk-lname { font-family: "IBM Plex Sans Arabic", var(--font); }
.cms-blk-lother { font-weight: 500; font-size: 11.5px; opacity: .75; }
.cms-blk-lang .cms-blk-bar .hint { text-align: end; }
.cms-blk-lang .cms-blk { border-inline-start: 2px solid var(--lang-soft); }
