:root {
  --bg: #f3f5f8; --surface: #fff; --surface-2: #eaeef3; --text: #162033; --muted: #5a6679; --border: #d8dee8;
  --primary: #0f4c75; --primary-contrast: #fff; --accent: #e8a317; --side-bg: #0f2a43; --side-text: #d6e2ee;
  --st-new: #2563eb; --st-pending: #b45309; --st-approved: #0e7490; --st-published: #15803d; --st-rejected: #dc2626; --st-archived: #64748b; --st-duplicate: #a16207; --st-ad_review: #c026d3; --st-ad: #7e22ce;
  --radius: 10px; --font-he: "Heebo", system-ui, sans-serif; --font-ar: "Cairo", system-ui, sans-serif; --font-en: "Inter", system-ui, sans-serif;
  --pad: 16px; --gap: 16px; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 14px rgb(0 0 0 / .05);
  --font-ui: var(--font-he);
}
:root[data-density="compact"] { --pad: 10px; --gap: 10px; }
html[lang="he"] { --font-ui: var(--font-he); } html[lang="ar"] { --font-ui: var(--font-ar); } html[lang="en"] { --font-ui: var(--font-en); }
[lang="he"] { font-family: var(--font-he); } [lang="ar"] { font-family: var(--font-ar); } [lang="en"] { font-family: var(--font-en); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; } h1 { font-size: 1.5rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
a { color: var(--primary); } button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .grow { flex: 1; } .nowrap { white-space: nowrap; }
.row-flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .spread { justify-content: space-between; }
.mt { margin-top: var(--gap); } .hidden { display: none !important; }

/* shell */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-text); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; color: #fff; text-decoration: none; }
.brand b { font-size: 1.05rem; letter-spacing: .2px; } .brand small { display: block; font-size: .72rem; opacity: .7; font-weight: 400; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: calc(var(--radius) - 2px); color: inherit; text-decoration: none; opacity: .88; }
.nav a:hover { background: rgb(255 255 255 / .08); opacity: 1; }
.nav a[aria-current="page"] { background: var(--primary); color: var(--primary-contrast); opacity: 1; }
.nav .badge-n { margin-inline-start: auto; background: var(--accent); color: #111; border-radius: 99px; padding: 0 7px; font-size: .75rem; font-weight: 700; }
.side-foot { margin-top: auto; padding: 12px 8px 0; font-size: .8rem; opacity: .75; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.top .menu-btn { display: none; }
#view { padding: 24px; max-width: 1400px; width: 100%; margin-inline: auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); line-height: 1.2; }
.btn:hover { background: var(--surface-2); } .btn:focus-visible, .nav a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--primary); color: var(--primary-contrast); border-color: transparent; } .btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--st-rejected); border-color: color-mix(in srgb, var(--st-rejected) 45%, var(--border)); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.sm { padding: 4px 10px; font-size: .85rem; } .btn[disabled] { opacity: .5; pointer-events: none; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--surface); }
textarea { min-height: 84px; resize: vertical; }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); } label.f > :not(span) { color: var(--text); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 99px; transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + i { background: var(--primary); } .switch input:checked + i::after { inset-inline-start: 19px; } .switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow); }
.card > h2, .card > .card-h { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.grid { display: grid; gap: var(--gap); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stat { display: flex; flex-direction: column; gap: 2px; border-inline-start: 4px solid var(--c, var(--primary)); } .stat b { font-size: 1.9rem; line-height: 1.1; } .stat span { color: var(--muted); font-size: .9rem; }
.pill, .badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge { --c: var(--muted); background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 78%, var(--text)); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.st-new { --c: var(--st-new); } .st-pending { --c: var(--st-pending); } .st-approved { --c: var(--st-approved); } .st-published { --c: var(--st-published); } .st-rejected { --c: var(--st-rejected); } .st-archived { --c: var(--st-archived); } .st-duplicate { --c: var(--st-duplicate); } .st-ad_review { --c: var(--st-ad_review); } .st-ad { --c: var(--st-ad); }
.ok { --c: var(--st-published); } .err { --c: var(--st-rejected); } .paused { --c: var(--st-archived); } .ai { --c: #7c3aed; } .warn { --c: var(--st-pending); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); font-size: .8rem; margin: 1px 2px 1px 0; margin-inline: 0 4px; }
.imp { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--border); } .imp-3 { background: var(--st-rejected); } .imp-2 { background: var(--accent); } .imp-1 { background: var(--st-archived); }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; display: flex; } .bar > i { display: block; height: 100%; background: var(--c, var(--primary)); }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.notice { padding: 10px 12px; border-radius: calc(var(--radius) - 2px); background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 35%, transparent); font-size: .9rem; }

/* list rows (inbox etc.) */
.filters { display: grid; grid-template-columns: 2fr repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.list { display: flex; flex-direction: column; } .item { display: grid; grid-template-columns: 14px minmax(0, 1fr) 170px 120px 130px; gap: 12px; align-items: center; padding: 11px 6px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.item:last-child { border-bottom: 0; } a.item:hover { background: var(--surface-2); border-radius: 8px; } .item .t { font-weight: 600; } .item .meta { color: var(--muted); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: start; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; } th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tbl-wrap { overflow-x: auto; }

/* article */
.cmp { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: var(--gap); }
.text-box { white-space: pre-wrap; line-height: 1.8; } .tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.tab { padding: 4px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .85rem; } .tab[aria-selected="true"] { background: var(--primary); color: var(--primary-contrast); border-color: transparent; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.hist { list-style: none; padding: 0; margin: 0; font-size: .85rem; } .hist li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.sticky-actions { position: sticky; top: 56px; z-index: 10; }

/* modal & toast */
.modal-wrap { position: fixed; inset: 0; background: rgb(8 14 24 / .55); display: grid; place-items: center; z-index: 100; padding: 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius); width: min(560px, 100%); max-height: 92vh; overflow-y: auto; padding: 20px; box-shadow: 0 20px 60px rgb(0 0 0 / .35); } .modal.wide { width: min(860px, 100%); }
.modal h2 { margin-bottom: 14px; } .form { display: grid; gap: 12px; } .form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
#toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; display: grid; gap: 8px; z-index: 200; } .toast { background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow); }

/* design studio */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset { border: 2px solid var(--border); border-radius: var(--radius); padding: 8px; cursor: pointer; background: var(--surface); text-align: start; } .preset[aria-pressed="true"] { border-color: var(--primary); }
.preset .sw { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin-bottom: 6px; } .preset .sw i { flex: 1; }
.tok { display: flex; align-items: center; gap: 10px; padding: 4px 0; } .tok span { flex: 1; font-size: .9rem; }
.preview { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; font-family: var(--font-ui); }
.preview .pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.contrast-row { display: flex; justify-content: space-between; font-size: .85rem; padding: 2px 0; }

/* public site */
.pub-head { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.pub-head .in, .pub-wrap { max-width: 1120px; margin-inline: auto; padding: 12px 20px; }
.pub-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); } .pub-brand b { font-size: 1.15rem; } .pub-brand small { display: block; color: var(--muted); font-size: .78rem; }
.hero { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--accent))); color: var(--primary-contrast); padding: 34px 0; }
.hero .pub-wrap { padding-block: 0; } .hero h1 { font-size: 1.8rem; margin-bottom: 14px; }
.hero input, .hero select { color: var(--text); }
.pub-filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.acard { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; } .acard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgb(0 0 0 / .1); }
.acard h3 { font-size: 1.05rem; } .article-full { max-width: 760px; margin-inline: auto; } .article-full .text-box { font-size: 1.05rem; }
.foot { color: var(--muted); text-align: center; padding: 30px 12px; font-size: .85rem; }

/* responsive */
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, 1fr); } .filters { grid-template-columns: repeat(3, 1fr); } .filters > :first-child { grid-column: 1 / -1; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  html[dir="rtl"] .side { transform: translateX(100%); } body.nav-open .side { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / .4); }
  .top .menu-btn { display: inline-flex; } .top { padding: 8px 14px; } #view { padding: 16px 14px; }
  .g2, .g3, .cmp, .form .two { grid-template-columns: 1fr; }
  .item { grid-template-columns: 14px 1fr; } .item > :nth-child(n+3) { grid-column: 2; }
  .filters, .pub-filters { grid-template-columns: 1fr 1fr; } .filters > :first-child, .pub-filters > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } .hero h1 { font-size: 1.4rem; } .page-head h1 { font-size: 1.25rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* journey + message bubbles */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.steps li { display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--surface-2); opacity: .65; }
.steps li.done { opacity: 1; border-color: color-mix(in srgb, var(--st-published) 45%, var(--border)); } .steps li.now { opacity: 1; border-style: dashed; }
.steps .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--border); font-size: .75rem; } .steps li.done .dot { background: var(--st-published); color: #fff; }
.bubble { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid var(--border); font-size: .9rem; line-height: 1.5; max-width: 420px; }
.bubble.whatsapp { background: color-mix(in srgb, var(--st-published) 14%, var(--surface)); }
.chip.rg { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); font-weight: 600; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login { width: min(420px, 100%); display: grid; gap: 12px; padding: 24px; }
.login-brand { text-align: center; } .login-brand h1 { margin: 8px 0 2px; font-size: 1.4rem; } .login-brand p { margin: 0; }

/* base64 media */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; } .shots figure { margin: 0; }
.shots img { width: 100%; height: 110px; object-fit: cover; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--border); cursor: zoom-in; display: block; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--primary) 18%, var(--surface-2)); color: var(--text); font-weight: 700; }

/* user menu in the side bar */
.side-foot { display: grid; gap: 2px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 4px; border-top: 1px solid rgb(255 255 255 / .14); }
.side-user b { display: block; font-size: .88rem; } .side-user small { display: block; opacity: .7; }
.avatar-ini { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-contrast, #fff); font-weight: 700; font-size: .8rem; flex: none; }
.side-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; background: transparent; color: inherit; font: inherit; text-decoration: none; text-align: start; cursor: pointer; border-radius: calc(var(--radius) - 3px); opacity: .9; }
.side-link:hover { background: rgb(255 255 255 / .1); opacity: 1; } .side-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.side-meta { padding: 6px 8px 0; font-size: .72rem; opacity: .65; }

/* picture of a collected item */
.item-thumb { float: inline-end; width: 76px; height: 76px; object-fit: cover; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--border); margin-inline-start: 12px; background: var(--surface-2); }
.item-photo { display: block; max-width: 100%; max-height: 340px; object-fit: contain; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--border); margin-bottom: 10px; background: var(--surface-2); }

/* the bar for working on several selected items stays at the top while scrolling */
#src-bulk, #bulk { position: sticky; top: 56px; z-index: 12; }
#src-bulk > .card, #bulk > .card { box-shadow: 0 6px 16px rgb(0 0 0 / .14); border-color: var(--primary); }

.bulk-progress { display: grid; gap: 6px; } .bulk-progress progress { height: 10px; accent-color: var(--primary); }

/* slim icon rail for the side menu (wide screens); expand with the button at its top */
.side-toggle { display: none; }
@media (min-width: 861px) {
  .side-toggle { display: inline-flex; align-items: center; justify-content: center; align-self: flex-end; width: 34px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; opacity: .8; }
  .side-toggle:hover { background: rgb(255 255 255 / .12); opacity: 1; } .side-toggle:focus-visible { outline: 2px solid var(--accent); }
  .app.rail { grid-template-columns: 64px 1fr; }
  .app.rail .side { padding: 10px 8px; align-items: center; }
  .app.rail .side-toggle { align-self: center; }
  .app.rail .brand { justify-content: center; padding-inline: 0; } .app.rail .brand > span { display: none; }
  .app.rail .nav { width: 100%; } .app.rail .nav a { justify-content: center; padding: 10px 0; position: relative; }
  .app.rail .nav a > span:not(.badge-n) { display: none; }
  .app.rail .nav .badge-n { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; min-width: 18px; padding: 0 5px; font-size: .65rem; line-height: 17px; }
  .app.rail .side-foot { width: 100%; justify-items: center; }
  .app.rail .side-user { padding: 6px 0; border-top: 1px solid rgb(255 255 255 / .14); width: 100%; justify-content: center; } .app.rail .side-user > span:not(.avatar-ini) { display: none; }
  .app.rail .side-link { justify-content: center; padding: 9px 0; } .app.rail .side-link .lbl { display: none; }
  .app.rail .side-meta { display: none; }
}
/* the inbox filters stay on one row on a wide screen */
.filters { grid-template-columns: minmax(150px, 2fr) repeat(6, minmax(0, 1fr)); }
.filters select, .filters input { padding: 7px 8px; font-size: .88rem; min-width: 0; }

/* compact edit forms: several fields per row so the dialog fits without a scrollbar */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.cols5 { display: grid; grid-template-columns: 1.15fr 1fr 1.1fr .8fr .7fr; gap: 10px; align-items: start; }
.cols2 > *, .cols5 > * { min-width: 0; }
.modal .form { gap: 10px; } .modal fieldset { padding: 8px 10px !important; } .modal fieldset .row-flex { gap: 4px 14px; }
.modal h2 { margin-bottom: 10px; }
@media (max-width: 860px) { .cols2 { grid-template-columns: 1fr; } .cols5 { grid-template-columns: 1fr 1fr; } }

.cols4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; } @media (max-width: 860px) { .cols4 { grid-template-columns: 1fr 1fr; } }

.sc-test > summary { cursor: pointer; padding: 4px 0; color: var(--muted); } .sc-test[open] > summary { margin-bottom: 6px; }

/* duplicate comparison */
.dup-grid { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 12px; }
.dup-col { border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); padding: 12px; background: var(--surface); min-width: 0; }
.dup-col.current { border-color: var(--primary); }
.dup-col .text-box { max-height: 260px; overflow: auto; line-height: 1.7; }
mark { background: color-mix(in srgb, var(--st-pending, #e8a317) 38%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 860px) { .dup-grid { grid-template-columns: 1fr; } }

/* hover preview and previous / next */
#hover-card { position: fixed; z-index: 60; max-width: calc(100vw - 16px); padding: 12px 14px; background: var(--surface); color: inherit; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 28px rgb(0 0 0 / .22); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; line-height: 1.6; }
#hover-card.on { opacity: 1; visibility: visible; }
#hover-card img { float: inline-end; margin-inline-start: 10px; border-radius: 8px; object-fit: cover; }
#hover-card p { margin: 6px 0 0; white-space: pre-wrap; font-size: .9rem; max-height: 9.5em; overflow: hidden; }
.btn.disabled { opacity: .4; pointer-events: none; }
@media (hover: none) { #hover-card { display: none; } }

/* public filters: two compact rows (search, then the three selects) on every screen size */
.pub-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pub-filters > :first-child { grid-column: 1 / -1; }
.pub-filters input, .pub-filters select { padding: 6px 10px; font-size: .88rem; min-height: 0; height: 34px; }
.hero { padding: 22px 0; } .hero h1 { margin-bottom: 10px; }
@media (max-width: 860px) { .pub-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pub-filters select { padding-inline: 6px; font-size: .82rem; } }

/* previous / next stays fixed at the top while reading an item */
.art-bar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; margin-bottom: 8px; background: var(--bg, var(--surface)); }
.art-nav a.btn { min-width: 84px; justify-content: center; }
.art-nav > span { min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }

/* public cards: nothing may stick out of its card */
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.acard { min-width: 0; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
.acard h3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.acard p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.acard p:empty { display: none; }

.pub-wrap { overflow-wrap: anywhere; }

/* the save / add buttons of a page stay in view while scrolling */
.page-head:has(.btn.primary) { position: sticky; top: 0; z-index: 9; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); padding: 10px 0 8px; margin-top: -10px; border-bottom: 1px solid transparent; }
.page-head:has(.btn.primary) p { display: none; }
@media (max-width: 860px) { .page-head:has(.btn.primary) { top: 46px; } }
/* in a dialog, the buttons at the bottom stay in view while the form scrolls */
.modal .modal-foot { position: sticky; bottom: -1px; background: var(--surface); padding: 10px 0 4px; margin-top: 8px; z-index: 2; }

/* public header: the brand colour into a deeper shade of itself (no orange / brown mix) */
.hero { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 72%, #03140d)); }

/* public: translation line on cards, article blocks, strip of neighbouring items */
.tr-line { font-size: .88rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 6px; }
.tr-block h1 { font-size: 1.35rem; } .article-full section h1 { font-size: 1.6rem; line-height: 1.35; }
.strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 14px 2px 8px; margin-top: 18px; -webkit-overflow-scrolling: touch; }
.strip-item { flex: 0 0 230px; scroll-snap-align: center; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; font-size: .88rem; line-height: 1.45; }
.strip-item:hover { border-color: var(--primary); } .strip-item[aria-current] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.pub-wrap .art-bar { position: static; background: none; padding: 0; }

/* touch targets on the public header and article bar */
.pub-head .btn.sm, .art-bar .btn.sm { min-height: 38px; padding-inline: 12px; }
.text-box a { color: var(--primary); text-underline-offset: 3px; }

/* public: item pictures */
.card-thumb { width: 100%; height: 150px; object-fit: cover; border-radius: calc(var(--radius) - 2px); background: var(--surface-2); }
.art-img { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin: 12px 0 4px; background: var(--surface-2); }

/* sources table: tighter on a desktop, one card per source on a phone */
.rtable td { padding-block: 7px; vertical-align: middle; } .rtable .small.nowrap { font-size: .78rem; line-height: 1.35; }
.rtable .c-name a { text-decoration: none; } .rtable .c-name a:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .rtable thead { display: none; } .rtable, .rtable tbody { display: block; width: 100%; }
  .rtable tr { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
  .rtable td { display: block; padding: 0; border: 0; width: auto; }
  .rtable td:first-child { flex: 0 0 auto; }
  .rtable td.c-name { flex: 1 1 calc(100% - 40px); min-width: 0; overflow-wrap: anywhere; }
  .rtable td[data-l]::before { content: attr(data-l) ': '; color: var(--muted); font-size: .72rem; }
  .rtable td.c-topics { display: none; }
  .rtable td.c-act { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 5px; }
  .rtable td.c-act .btn { padding: 6px 10px; min-height: 34px; }
}

/* map page */
.map-bar { gap: 8px; margin: 6px 0 10px; align-items: center; } .map-bar select { width: auto; min-width: 150px; }
.map-box { height: 64vh; min-height: 360px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); z-index: 0; }
.map-box .empty { padding: 40px 16px; }
.map-dot-wrap { background: none; border: 0; }
.map-dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .45); }
.map-dot.approx { opacity: .72; border-style: dashed; }
.map-pop { min-width: 190px; max-width: 260px; line-height: 1.5; } .map-pop b { display: block; margin-bottom: 3px; } .map-pop a { display: inline-block; margin-top: 5px; font-weight: 700; }
@media (max-width: 860px) { .map-box { height: 58vh; } }

/* public tabs (list / map) */
.pub-tabs { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 8; }
.pub-tabs .in { display: flex; gap: 4px; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.pub-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 12px 16px 10px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pub-tabs a:hover { color: var(--text); } .pub-tabs a[aria-current] { color: var(--primary); border-bottom-color: var(--primary); }
.pub-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* map: toolbar, frame, markers, clusters, popup, legend */
.map-bar { padding: 10px 0 12px; } .map-bar select { background: var(--surface); border-radius: 99px; padding: 7px 14px; font-weight: 600; }
.map-bar #map-count { margin-inline-start: auto; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); padding: 4px 12px; border-radius: 99px; font-weight: 700; }
.map-box { height: calc(100vh - 290px); min-height: 420px; border: 0; border-radius: 16px; box-shadow: 0 10px 30px rgb(0 0 0 / .14), 0 0 0 1px var(--border); }
.map-box .leaflet-container { font-family: inherit; background: var(--surface-2); }
.map-dot { box-sizing: border-box; border: 3px solid #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .4); transition: transform .12s; } .map-dot:hover { transform: scale(1.25); }
.map-dot.approx { border: 3px dashed #fff; opacity: .8; }
.map-cluster-wrap { background: none; border: 0; }
.map-cluster { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary); color: var(--primary-contrast, #fff); font-weight: 800; font-size: .95rem; border: 4px solid color-mix(in srgb, var(--primary) 35%, #fff); box-shadow: 0 3px 12px rgb(0 0 0 / .35); }
.leaflet-popup-content-wrapper { border-radius: 14px; padding: 0; overflow: hidden; box-shadow: 0 12px 34px rgb(0 0 0 / .3); }
.leaflet-popup-content { margin: 0; width: auto !important; }
.map-pop img { display: block; width: 100%; height: 118px; object-fit: cover; }
.map-pop-body { padding: 11px 14px 13px; } .map-pop-body b { font-size: .98rem; line-height: 1.45; }
.map-pop-body a { display: inline-block; margin-top: 6px; padding: 5px 12px; border-radius: 99px; background: var(--primary); color: var(--primary-contrast, #fff) !important; text-decoration: none; font-weight: 700; font-size: .85rem; }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); padding: 7px 12px; border-radius: 10px; font-size: .78rem; box-shadow: 0 2px 10px rgb(0 0 0 / .18); margin: 0 0 14px 12px; max-width: calc(100% - 90px); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; } .map-legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .25); } .map-legend i.approx { border-style: dashed; }
.map-fit { width: 34px; height: 34px; border: 0; border-radius: 8px; background: #fff; color: #222; font-size: 1.2rem; cursor: pointer; box-shadow: 0 1px 5px rgb(0 0 0 / .4); } .map-fit:hover { background: #f4f4f4; }
@media (max-width: 860px) { .map-box { height: calc(100vh - 330px); min-height: 380px; border-radius: 12px; } .pub-tabs .in { padding: 0 8px; } }

.map-tiles { filter: grayscale(.6) saturate(.75) contrast(.94) brightness(1.04); }
.map-tiles.dark { filter: invert(1) hue-rotate(180deg) grayscale(.55) brightness(.88) contrast(.92); }

/* public: region chips in the header band */
.pub-regions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-btn { cursor: pointer; border-radius: 99px; padding: 4px 12px; font: inherit; font-size: .85rem; border: 1px solid rgb(255 255 255 / .4); background: rgb(255 255 255 / .14); color: var(--primary-contrast, #fff); }
.chip-btn span { opacity: .75; font-size: .78rem; margin-inline-start: 3px; }
.chip-btn:hover { background: rgb(255 255 255 / .26); }
.chip-btn[aria-pressed="true"] { background: #fff; color: var(--primary); font-weight: 700; border-color: #fff; }
.chip-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* background AI job: a small chip in the corner, never blocks the page */
.ai-job { position: fixed; inset-block-end: 16px; inset-inline-start: 16px; z-index: 70; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px); padding: 10px 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-inline-start: 4px solid var(--primary); border-radius: 12px; box-shadow: 0 8px 28px rgb(0 0 0 / .22); font-size: .9rem; }
.ai-job.ready { border-inline-start-color: var(--st-published); } .ai-job.failed { border-inline-start-color: var(--st-rejected); }
.ai-job .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: ai-spin .8s linear infinite; flex: none; }
@keyframes ai-spin { to { transform: rotate(360deg); } } @media (prefers-reduced-motion: reduce) { .ai-job .spin { animation: none; } }

/* entities */
.ent-av { border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); }
.ent-ini { font-weight: 800; color: #fff; background: var(--primary); } .ent-ini.person { background: color-mix(in srgb, var(--accent) 85%, #000); }
.ent-row { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; } .ent-row:hover b { text-decoration: underline; }
.ent-chip { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; } .ent-chip.org { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); } .ent-chip.person { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.badge.org { --c: var(--primary); } .badge.person { --c: var(--accent); }
.ent-fact { padding: 6px 0; border-bottom: 1px solid var(--border); } .ent-fact:last-child { border-bottom: 0; }
.ent-ment { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; } .ent-ment:hover { background: var(--surface-2); }
.ent-fs { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin: 0; }

/* public: list / map switch in the header row, next to the language buttons */
.pub-tabs { display: none; }
.pub-nav { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 99px; }
.pub-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .88rem; }
.pub-nav a:hover { color: var(--text); } .pub-nav a[aria-current] { background: var(--primary); color: var(--primary-contrast, #fff); }
.pub-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* item code: <system code>-<number> */
.code-tag { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .74rem; letter-spacing: .3px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); direction: ltr; unicode-bidi: isolate; }

/* compact public cards: two lines of title, two of summary, two of translation; the whole item opens on click */
.acard { gap: 6px; padding: 12px 14px; } .acard h3 { -webkit-line-clamp: 2 !important; font-size: 1rem; line-height: 1.4; margin: 0; }
.acard p { -webkit-line-clamp: 2 !important; margin: 0; } .acard .card-thumb { height: 112px; }
.acard .tr-line { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-top: 5px; line-height: 1.45; }
.acard .row-flex { gap: 4px; } .acard .chip { font-size: .72rem; padding: 1px 8px; }

/* banner while the AI gathers information about an entity */
.ent-job { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; --c: var(--primary); }
.ent-job .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: ai-spin .8s linear infinite; flex: none; }
.ent-job > span:not(.spin) { flex: 1; } .ent-job.ready { --c: var(--st-published); } .ent-job.failed { --c: var(--st-rejected); }

/* picture candidates for an entity */
.ent-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 6px; }
.ent-photo { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 8px; cursor: pointer; }
.ent-photo:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ent-photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }

/* dashboard: system information */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.sys-card { padding: 14px 16px; } .sys-card h3 { margin: 0 0 8px; font-size: .86rem; color: var(--muted); font-weight: 600; }
.sys-big { font-size: 1.7rem; font-weight: 800; line-height: 1.1; } .sys-sub { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.sys-bars { display: flex; align-items: flex-end; gap: 2px; height: 54px; margin-top: 8px; } .sys-bars i { flex: 1; background: var(--primary); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.sys-ok { color: var(--st-published); } .sys-warn { color: var(--st-pending); } .sys-bad { color: var(--st-rejected); }

/* sources table: fixed columns, one-line cells, aligned header */
.rtable.fixed { table-layout: fixed; width: 100%; }
.rtable.fixed th, .rtable.fixed td { text-align: start; vertical-align: middle; overflow: hidden; }
.rtable.fixed th { white-space: nowrap; font-size: .8rem; padding-block: 9px; }
.rtable.fixed .c-name { white-space: normal; } .rtable .c-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.rtable.fixed .c-name a { display: inline-block; max-width: calc(100% - 44px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.rtable.fixed .c-act { white-space: normal; } .rtable.fixed .c-act .btn { margin: 1px 0; }
.rtable.fixed .c-topics { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rtable.fixed .badge, .rtable.fixed .chip { white-space: nowrap; }
@media (max-width: 860px) { .rtable.fixed { table-layout: auto; } .rtable.fixed colgroup { display: none; } .rtable.fixed .c-name a { max-width: none; white-space: normal; } }

.rtable.fixed td:nth-child(6) .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }

/* public list: every card the same size; the whole item opens on click */
.cards { grid-auto-rows: 1fr; align-items: stretch; }
.acard { height: 100%; min-height: 268px; }
.acard h3 { min-height: 2.8em; }
.acard .row-flex { min-height: 26px; flex-wrap: nowrap; overflow: hidden; }
/* item page: a long text starts short */
.clamp-box { position: relative; } .clamp-in { max-height: 15.5em; overflow: hidden; position: relative; }
.clamp-box:not(.open) .clamp-in::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 5em; background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none; }
.clamp-box.open .clamp-in { max-height: none; } .clamp-btn { margin-top: 8px; }

/* entity toolbar: fixed place, fixed order */
.ent-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ent-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-inline-start: auto; }
.ent-actions .btn { white-space: nowrap; }
.ent-running { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; --c: var(--primary); }
.ent-running .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: ai-spin .8s linear infinite; }
.ent-pulse { animation: ent-pulse 1.6s ease-in-out 3; } @keyframes ent-pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) { .ent-pulse, .ent-running .spin { animation: none; } }

/* entities: fix the type in place */
.ent-inline { width: 100%; max-width: 190px; padding: 4px 8px; font-size: .85rem; background: var(--surface); }

/* item page: compact, everything on one page; a small picture (enlarge on demand); the full text on a button; more items below as cards */
.article-compact { display: grid; grid-template-columns: 260px 1fr; gap: 6px 18px; padding: 14px 18px; align-items: start; }
.article-compact .art-media { position: relative; margin: 0; } .article-compact .art-media img { display: block; width: 100%; height: 172px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.article-compact .art-zoom { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; padding: 3px 8px; background: rgb(0 0 0 / .55); color: #fff; border: 0; }
.article-compact.big { grid-template-columns: 1fr; } .article-compact.big .art-media img { height: 420px; }
.article-compact:not(:has(.art-media)) { grid-template-columns: 1fr; }
.article-compact .art-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.article-compact .art-meta { gap: 6px; } .article-compact h1 { font-size: 1.5rem; line-height: 1.35; margin: 2px 0; }
.article-compact .art-sum { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.55; }
.article-compact .art-tr { border-top: 1px dashed var(--border); padding-top: 6px; } .article-compact .art-tr b { font-size: 1rem; }
.article-compact .art-main > .btn { align-self: flex-start; margin-top: 2px; }
.article-compact .art-full { grid-column: 1 / -1; display: none; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.article-compact.open .art-full { display: block; } .article-compact .art-full section + section { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.art-more-h { font-size: 1rem; margin: 18px 0 8px; color: var(--muted); } .art-more .acard { min-height: 232px; }
@media (max-width: 760px) { .article-compact { grid-template-columns: 1fr; } .article-compact .art-media img { height: 150px; } .article-compact h1 { font-size: 1.3rem; } }

/* quick status bar of the inbox */
.quick-chip { cursor: pointer; border: 1px solid transparent; font: inherit; font-size: .8rem; background: color-mix(in srgb, var(--c, var(--muted)) 14%, var(--surface)); color: var(--c, var(--text)); }
.quick-chip[aria-pressed="true"] { background: var(--c, var(--primary)); color: #fff; font-weight: 700; }
.quick-chip:not([class*="st-"]) { --c: var(--primary); }

/* public: the edit pencil for someone who is signed in and may edit */
.acard { position: relative; }
.card-edit { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--primary); cursor: pointer; box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
.card-edit:hover { background: var(--primary); color: var(--primary-contrast, #fff); }

/* item page = one screen: the item on top, the other items under it in their own scroll area; the buttons are in the header */
body.art-page { overflow: hidden; }
body.art-page #app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
body.art-page .pub-head { flex: none; } body.art-page .pub-head .in { padding-block: 6px; } body.art-page .pub-brand small { display: none; }
body.art-page main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.art-page .pub-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-block: 8px; }
body.art-page .article-compact { flex: 0 1 auto; max-height: 56%; overflow: auto; }
body.art-page .art-more-wrap { flex: 1; min-height: 0; overflow-y: auto; margin-top: 8px; padding-bottom: 12px; }
body.art-page .art-more-h { position: sticky; top: 0; z-index: 3; background: var(--bg); margin: 0; padding: 6px 2px; }
body.art-page .foot { display: none; }
.pub-head .art-nav { margin-inline-end: 8px; }
@media (max-width: 860px) { .pub-head .in { flex-wrap: wrap; gap: 6px; } .pub-head .art-nav { order: 3; width: 100%; justify-content: space-between; margin: 0; } body.art-page .article-compact { max-height: 60%; } }

/* forms: text areas start small and grow as needed */
.form textarea, .modal textarea { field-sizing: content; min-height: 2.5em; max-height: 16em; resize: vertical; }
.modal .form .f > span { font-size: .8rem; }
.modal .form { gap: 8px; }

/* item page: under the item ONE row of small cards (scrolls sideways); the item itself gets the rest of the screen */
body.art-page .article-compact { flex: 1 1 auto; max-height: none; min-height: 0; overflow: auto; }
body.art-page .art-more-wrap { flex: 0 0 auto; overflow-x: auto; overflow-y: hidden; margin-top: 8px; padding-bottom: 6px; }
body.art-page .art-more { display: flex; gap: 10px; width: max-content; min-width: 100%; }
.mini-card { flex: 0 0 290px; display: flex; align-items: center; gap: 10px; height: 88px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; }
.mini-card:hover { border-color: var(--primary); }
.mini-card img, .mini-ph { flex: none; width: 70px; height: 70px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.mini-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mini-t b { font-size: .88rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 860px) { .mini-card { flex-basis: 250px; } }

/* ======================================================================================================
   BUTTON SYSTEM - one scale for the whole app (admin and public), RTL and LTR
   sizes: md 40px, sm 34px (its hit area is 40px); radius 10 / 9; depth from layered shadows, not borders;
   press = scale .97; transitions list their properties; focus ring for the keyboard
   ====================================================================================================== */
:root { --btn-h: 40px; --btn-h-sm: 34px; --btn-r: 10px; --btn-r-sm: 9px;
  --btn-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 13%, transparent), 0 1px 2px rgb(0 0 0 / .06), 0 1px 1px rgb(0 0 0 / .03);
  --btn-shadow-hover: 0 0 0 1px color-mix(in srgb, var(--text) 20%, transparent), 0 3px 8px rgb(0 0 0 / .10), 0 1px 2px rgb(0 0 0 / .05); }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3 { text-wrap: balance; } p, .small { text-wrap: pretty; }
.badge, .badge-n, .sys-big, .seg-n, .stat b, td { font-variant-numeric: tabular-nums; }

.btn, .tab, .chip-btn, .quick-chip, .pub-nav a { -webkit-tap-highlight-color: transparent; }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--btn-h); padding: 0 16px; border: 0; border-radius: var(--btn-r);
  background: var(--surface); color: var(--text); font: inherit; font-size: .92rem; font-weight: 600; line-height: 1; letter-spacing: 0; white-space: nowrap; text-decoration: none; cursor: pointer;
  box-shadow: var(--btn-shadow); transition-property: background-color, box-shadow, color, scale, opacity; transition-duration: .16s; transition-timing-function: cubic-bezier(.2, 0, 0, 1); }
.btn:hover { background: color-mix(in srgb, var(--text) 5%, var(--surface)); box-shadow: var(--btn-shadow-hover); }
.btn:active { scale: .97; box-shadow: var(--btn-shadow); transition-duration: .06s; }
.btn:focus-visible, .tab:focus-visible, .chip-btn:focus-visible, .quick-chip:focus-visible, .pub-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn .ic { flex: none; }
.btn[disabled], .btn.disabled, .btn[aria-disabled="true"] { opacity: .42; pointer-events: none; box-shadow: var(--btn-shadow); }

.btn.primary { background: var(--primary); color: var(--primary-contrast, #fff); border: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 78%, #000), inset 0 1px 0 rgb(255 255 255 / .18), 0 2px 5px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 90%, #fff); filter: none; box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 78%, #000), inset 0 1px 0 rgb(255 255 255 / .22), 0 4px 10px color-mix(in srgb, var(--primary) 40%, transparent); }
.btn.danger { color: var(--st-rejected); border: 0; box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-rejected) 40%, transparent), 0 1px 2px rgb(0 0 0 / .05); }
.btn.danger:hover { background: color-mix(in srgb, var(--st-rejected) 9%, var(--surface)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-rejected) 60%, transparent), 0 3px 8px color-mix(in srgb, var(--st-rejected) 18%, transparent); }
.btn.ghost { background: transparent; border: 0; box-shadow: none; color: inherit; } .btn.ghost:hover { background: color-mix(in srgb, var(--text) 8%, transparent); box-shadow: none; }

.btn.sm { min-height: var(--btn-h-sm); padding: 0 12px; border-radius: var(--btn-r-sm); font-size: .84rem; gap: 6px; }
.btn.sm::after { content: ''; position: absolute; inset: -3px 0; }      /* the hit area reaches 40px */
.btn:has(> .ic:only-child) { width: var(--btn-h); padding: 0; } .btn.sm:has(> .ic:only-child) { width: var(--btn-h-sm); }
.btn .ic + span:empty { display: none; }

/* segmented group: previous | 5 / 391 | next */
.seg { display: inline-flex; align-items: stretch; border-radius: var(--btn-r-sm); background: var(--surface); box-shadow: var(--btn-shadow); }
.seg .btn { border-radius: 0; box-shadow: none; background: transparent; min-height: var(--btn-h-sm); } .seg .btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.seg .btn:first-child { border-start-start-radius: var(--btn-r-sm); border-end-start-radius: var(--btn-r-sm); } .seg .btn:last-child { border-start-end-radius: var(--btn-r-sm); border-end-end-radius: var(--btn-r-sm); }
.seg-n { display: inline-flex; align-items: center; padding: 0 12px; min-width: 76px; justify-content: center; color: var(--muted); font-size: .82rem; font-weight: 600; box-shadow: inset 1px 0 0 var(--border), inset -1px 0 0 var(--border); }
/* the arrows follow the reading direction: previous points to the start edge, next to the end edge */
.art-nav .prev .ic, .art-nav .next .ic { transition: translate .16s ease; }
html[dir="rtl"] .art-nav .prev .ic { transform: scaleX(-1); } html:not([dir="rtl"]) .art-nav .next .ic { transform: scaleX(-1); }
.art-nav .prev:hover .ic { translate: -2px 0; } .art-nav .next:hover .ic { translate: 2px 0; }
html[dir="rtl"] .art-nav .prev:hover .ic { translate: 2px 0; } html[dir="rtl"] .art-nav .next:hover .ic { translate: -2px 0; }
.art-nav .seg .btn { padding: 0 11px; }
@media (max-width: 560px) { .art-nav .seg .lbl { display: none; } .art-nav .seg .btn { padding: 0 12px; } .seg-n { min-width: 64px; } }

/* tabs and chips that act as buttons */
.tab { min-height: 34px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; font-weight: 600;
  box-shadow: var(--btn-shadow); cursor: pointer; transition-property: background-color, box-shadow, color, scale; transition-duration: .16s; }
.tab:hover { background: color-mix(in srgb, var(--text) 6%, var(--surface)); box-shadow: var(--btn-shadow-hover); } .tab:active { scale: .97; }
.tab[aria-selected="true"] { background: var(--primary); color: var(--primary-contrast, #fff); box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 78%, #000), 0 2px 5px color-mix(in srgb, var(--primary) 30%, transparent); }
.chip-btn, .quick-chip { transition-property: background-color, color, box-shadow, scale; transition-duration: .15s; } .chip-btn:active, .quick-chip:active { scale: .97; }
.pub-nav a { transition-property: background-color, color, scale; transition-duration: .16s; } .pub-nav a:active { scale: .97; }
.pub-nav { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent); }

/* pictures get a hairline outline for depth */
.card-thumb, .art-media img, .mini-card img, .ent-av, .item-thumb, .map-pop img { outline: 1px solid rgb(0 0 0 / .08); outline-offset: -1px; }
@media (prefers-reduced-motion: reduce) { .btn, .tab, .chip-btn, .quick-chip, .pub-nav a, .art-nav .ic { transition: none !important; } .btn:active, .tab:active { scale: 1; } }

/* item page: the item is as tall as its content (up to the screen minus the row of small cards), the row sits right under it */
body.art-page .article-compact { flex: 0 1 auto; max-height: calc(100% - 112px); }

/* side menu in categories */
.side { scrollbar-width: none; } .side::-webkit-scrollbar { display: none; }                        /* one scrollbar less: the menu scrolls without its own bar */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { display: flex; flex-direction: column; margin-bottom: 2px; }
.nav-gh { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 12px 4px; border: 0; background: transparent; color: inherit; opacity: .6; font: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .4px; cursor: pointer; text-align: start; }
.nav-gh:hover { opacity: .95; } .nav-gh .ic { transition: rotate .18s ease; rotate: -90deg; } html[dir="rtl"] .nav-gh .ic { rotate: 90deg; } .nav-group.open .nav-gh .ic { rotate: 0deg; }
.nav-items { display: none; flex-direction: column; gap: 1px; } .nav-group.open .nav-items { display: flex; }
@media (min-width: 861px) { .app.rail .nav-gh { display: none; } .app.rail .nav-items { display: flex !important; } .app.rail .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgb(255 255 255 / .12); } }

/* section switch next to a page title (Sources | Found sources | Linked posts) */
.sec-switch { display: inline-flex; gap: 2px; padding: 3px; margin-inline-start: 14px; vertical-align: middle; background: var(--surface-2); border-radius: 99px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent); }
.sec-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .85rem; transition-property: background-color, color, scale; transition-duration: .16s; }
.sec-switch a:hover { color: var(--text); } .sec-switch a:active { scale: .97; }
.sec-switch a[aria-current] { background: var(--primary); color: var(--primary-contrast, #fff); }
.sec-switch .sw-n { background: var(--accent); color: #111; border-radius: 99px; padding: 0 7px; font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sec-switch a[aria-current] .sw-n { background: rgb(255 255 255 / .9); color: var(--primary); }
.page-head h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

/* side menu: one text size (headers and items), consistent chevrons: open = down, closed = toward the reading direction */
.nav a, .nav-gh { font-size: .95rem; line-height: 1.3; letter-spacing: 0; text-transform: none; }
.nav-gh { font-weight: 700; opacity: .72; padding: 9px 12px; }
.nav a span:not(.badge-n) { font-size: inherit; font-weight: 500; }
.nav-gh .ic { rotate: 180deg; } html[dir="rtl"] .nav-gh .ic { rotate: 0deg; } .nav-group.open .nav-gh .ic, html[dir="rtl"] .nav-group.open .nav-gh .ic { rotate: -90deg; }
.nav-group.open .nav-gh { opacity: .9; }

/* admin: the content scrolls by itself, and its scrollbar sits between the menu and the content (not at the far edge of the window) */
@media (min-width: 861px) {
  body:has(.app) { overflow: hidden; }
  .app { height: 100vh; height: 100dvh; min-height: 0; }
  .main { height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
  html[dir="rtl"] .main { direction: ltr; } html[dir="rtl"] .main > * { direction: rtl; }       /* menu on the right: the bar is at the content's right edge */
  html:not([dir="rtl"]) .main { direction: rtl; } html:not([dir="rtl"]) .main > * { direction: ltr; }   /* menu on the left: the bar is at the content's left edge */
}

/* a row of small stat cards: always one line */
.stat-row { display: flex; gap: 10px; flex-wrap: nowrap; overflow-x: auto; margin-bottom: var(--gap); }
.stat-row .stat { flex: 1 1 0; min-width: 118px; padding: 10px 14px; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
.stat-row .stat b { font-size: 1.35rem; } .stat-row .stat span { font-size: .85rem; }
/* icon-only buttons are square; a button with an icon AND a text keeps its width (the aria-label marks the icon-only ones) */
.btn:has(> .ic:only-child) { width: auto; padding: 0 16px; }
.btn[aria-label]:has(> .ic:only-child) { width: var(--btn-h); padding: 0; } .btn.sm[aria-label]:has(> .ic:only-child) { width: var(--btn-h-sm); }
.btn:not(.sm) { gap: 8px; }

/* fix: a button with an icon and a text is as wide as its content (a text is not an element, so ".ic:only-child" also matches it);
   only a button marked with an aria-label and holding just an icon is square */
.btn:has(> .ic:only-child), .btn.sm:has(> .ic:only-child) { width: auto; }
.btn:has(> .ic:only-child) { padding: 0 16px; } .btn.sm:has(> .ic:only-child) { padding: 0 12px; }
.btn[aria-label]:has(> .ic:only-child) { width: var(--btn-h); padding: 0; } .btn.sm[aria-label]:has(> .ic:only-child) { width: var(--btn-h-sm); padding: 0; }

/* item page: ONE row of small cards exactly the width of the page - as many as fit, no scrollbar; phone: two narrow ones */
body.art-page .art-more-wrap { overflow: hidden; padding-bottom: 0; }
body.art-page .art-more { display: grid; width: auto; min-width: 0; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-auto-rows: 88px; height: 88px; overflow: hidden; gap: 10px; }
body.art-page .mini-card { flex: none; width: auto; min-width: 0; }
@media (max-width: 640px) {
  body.art-page .art-more { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: 74px; height: 74px; gap: 8px; }
  body.art-page .mini-card { height: 74px; padding: 6px; gap: 7px; } body.art-page .mini-card img, body.art-page .mini-ph { width: 44px; height: 44px; }
  body.art-page .mini-t b { font-size: .78rem; -webkit-line-clamp: 3; } body.art-page .mini-t .small { display: none; }
  body.art-page .article-compact { max-height: calc(100% - 92px); padding: 12px; } body.art-page .article-compact h1 { font-size: 1.2rem; }
  body.art-page .pub-head .in { padding-inline: 10px; }
}

.chk-grid { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 0; } .chk { display: inline-flex; align-items: center; gap: 5px; font-size: .88rem; }
.modal .field { display: grid; gap: 3px; } .modal .field textarea, .modal .field input:not([type=checkbox]), .modal .field select { width: 100%; }

/* entity edit form: sections, a sticky AI bar, list tools next to the selects */
.ent-form { max-height: 74vh; overflow: auto; padding-inline-end: 6px; gap: 12px; }
.ent-aibar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ent-aibar .small { flex: 1; min-width: 200px; }
.ent-sec { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface-2, var(--surface)) 55%, var(--surface)); }
.ent-sec > h3 { margin: 0; font-size: .82rem; font-weight: 700; color: var(--muted); }
.cols2.c3 { grid-template-columns: repeat(3, 1fr); } @media (max-width: 640px) { .cols2.c3 { grid-template-columns: 1fr; } }
.f-tool { display: flex; align-items: center; gap: 6px; } .f-tool > select, .f-tool > input { flex: 1; min-width: 0; } .f-tool .ent-tool { flex: none; }
.ai-filled { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 1px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-radius: 8px; }
label.check.ai-filled { padding-inline: 6px; }
.btn.busy { opacity: .7; pointer-events: none; }

/* the title + buttons bar of a page: one slim row that stays in view (just under the top bar) while the page scrolls */
.page-head { position: sticky; top: var(--top-h, 0px); z-index: 12; align-items: center; margin: -10px 0 14px; padding: 8px 0; background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(6px); }
.page-head p { display: none; }
.page-head h1 { font-size: 1.3rem; margin: 0; }
.page-head > .row-flex { gap: 8px; flex-wrap: wrap; }
.page-head .btn { height: var(--btn-h-sm, 34px); padding-block: 0; font-size: .85rem; }
@media (max-width: 860px) { .page-head { top: var(--top-h, 46px) !important; } }

/* the AI job indicator lives in the top bar next to the other buttons (not floating over the page) */
.top #ai-job-slot { display: flex; align-items: center; min-width: 0; }
.top .ai-job { position: static; inset: auto; max-width: min(60vw, 520px); padding: 4px 6px 4px 12px; box-shadow: none; border-radius: 10px; font-size: .85rem; }
.top .ai-job .btn { height: var(--btn-h-sm, 32px); }
.top .ai-job span:not(.spin) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the type / role cell in the entity list: a quiet chip that looks like text until it is hovered or focused */
.ent-inline { height: 32px; max-width: 210px; padding: 0 12px; font: inherit; font-size: .86rem; font-weight: 500; color: var(--text); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); border: 1px solid transparent; border-radius: 99px; box-shadow: none; transition-property: background-color, border-color, box-shadow; transition-duration: .15s; text-overflow: ellipsis; }
.ent-inline:hover { background: color-mix(in srgb, var(--primary) 11%, var(--surface)); border-color: var(--border); }
.ent-inline:focus, .ent-inline:focus-visible { outline: none; background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.ent-inline::placeholder { color: var(--muted); font-weight: 400; }
input.ent-inline { cursor: text; }
select.ent-inline { cursor: pointer; padding-inline-end: 26px; }

/* the type / role cells of the entity list win over the generic input style (same chip look, higher specificity) */
.rtable .ent-inline, .rtable input.ent-inline, .rtable select.ent-inline { height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 99px; background-color: color-mix(in srgb, var(--primary) 6%, var(--surface)); box-shadow: none; }
.rtable .ent-inline:hover { background-color: color-mix(in srgb, var(--primary) 11%, var(--surface)); border-color: var(--border); }
.rtable .ent-inline:focus { background-color: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); outline: none; }

/* user guide: a contents list that stays in view + the sections */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.guide-toc { position: sticky; top: calc(var(--top-h, 0px) + 64px); display: grid; gap: 2px; padding: 8px; }
.guide-toc a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .9rem; }
.guide-toc a:hover { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.guide-body { display: grid; gap: 14px; min-width: 0; }
.guide-sec { scroll-margin-top: calc(var(--top-h, 0px) + 64px); line-height: 1.65; }
.guide-sec h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.1rem; }
.guide-sec ul, .guide-sec ol { margin: 6px 0; padding-inline-start: 22px; } .guide-sec li { margin: 5px 0; }
kbd { padding: 1px 7px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); font: inherit; font-size: .82em; }
@media (max-width: 860px) { .guide { grid-template-columns: 1fr; } .guide-toc { position: static; grid-auto-flow: column; overflow-x: auto; } .guide-toc a { white-space: nowrap; } }

/* sources table: the actions of a row are ONE line (compact buttons), never wrapped under each other */
@media (min-width: 861px) {
  .rtable.fixed col:last-child { width: 250px !important; }
  .rtable.fixed td.c-act { white-space: nowrap; text-align: end; }
  .rtable.fixed td.c-act .btn { margin: 0; padding: 0 9px; height: 32px; min-height: 32px; font-size: .82rem; vertical-align: middle; }
  .rtable.fixed td.c-act .btn[aria-label] { width: 32px; padding: 0; }
  .rtable.fixed td.c-act { word-spacing: -2px; } .rtable.fixed td.c-act .btn { word-spacing: normal; }
}

/* item page: the status chips sit in the top bar next to previous / next */
.art-bar { flex-wrap: wrap; row-gap: 6px; } .art-bar .quick-bar { margin: 0 !important; margin-inline-start: auto !important; }

/* system messages: at the top of the page, centered, just under the top bar */
#toasts { top: calc(var(--top-h, 0px) + 12px); bottom: auto; inset-inline: 0; margin-inline: auto; width: max-content; max-width: min(92vw, 560px); justify-items: center; pointer-events: none; z-index: 300; }
#toasts .toast { animation: toast-in .18s ease-out; text-align: center; } @keyframes toast-in { from { opacity: 0; translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { #toasts .toast { animation: none; } }

/* the bar of a page: title, (tabs), buttons - ONE row on a wide screen, so the page keeps its height */
@media (min-width: 861px) {
  .page-head { flex-wrap: nowrap; gap: 14px; }
  .page-head > div:first-child { flex: none; max-width: 36%; }
  .page-head > .row-flex { flex-wrap: nowrap; margin-inline-start: auto; }
  .page-head .btn { white-space: nowrap; }
  .page-head .head-tabs { margin: 0; flex: 1; display: flex; justify-content: center; border: 0; padding: 0; }
}
/* the buttons keep a set distance from the page title (not glued to it, not pushed to the far edge) */
@media (min-width: 861px) {
  .page-head { justify-content: flex-start; }
  .page-head > div:first-child { margin-inline-end: 36px; }
  .page-head > .row-flex { margin-inline-start: 0; }
  .page-head .head-tabs { flex: none; justify-content: flex-start; margin-inline-end: 18px; }
}
/* pages whose title carries a switch (Sources | Found sources | Linked posts): title and switch stay on ONE line, buttons follow on the same row */
@media (min-width: 861px) {
  .page-head h1 { flex-wrap: nowrap; white-space: nowrap; gap: 14px; }
  .page-head > div:first-child:has(.sec-switch) { max-width: none; flex: none; }
  .page-head .sec-switch { margin-inline-start: 0; flex: none; }
  .page-head > div:first-child { margin-inline-end: 24px; }
}
/* the switch is a sibling of the title inside the first block of the bar: make that block a row */
.page-head > div:first-child:has(.sec-switch) { display: flex; align-items: center; flex-wrap: nowrap; gap: 14px; }
.page-head > div:first-child:has(.sec-switch) h1 { flex: none; }

/* public site: topics as a multi-select dropdown */
.multi { position: relative; } .multi > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--btn-h, 40px); padding: 0 14px; border: 1px solid var(--border); border-radius: var(--btn-r, 10px); background: var(--surface); color: var(--text); white-space: nowrap; }
.multi > summary::-webkit-details-marker { display: none; } .multi > summary::after { content: ''; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; rotate: 45deg; translate: 0 -2px; opacity: .6; }
.multi > summary.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); font-weight: 600; }
.multi-pop { position: absolute; inset-inline-start: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; max-height: 340px; overflow: auto; display: grid; gap: 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / .2); }

.mood-sheet { max-height: 70vh; overflow: auto; background: #fff; color: #1c2b33; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }

.chip.tag { text-decoration: none; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); } .chip.tag:hover { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }
.art-tags { gap: 6px; margin: 2px 0 6px; }
/* the open topic / hashtag list sits on the green header: its text must not inherit the header's white */
.multi-pop, .multi-pop .chk, .multi-pop .btn { color: var(--text); }
.multi-pop .muted { color: var(--muted); }
.multi-pop .chk { padding: 3px 4px; border-radius: 6px; cursor: pointer; } .multi-pop .chk:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.multi-pop { min-width: 260px; width: max-content; max-width: min(92vw, 360px); }

/* public topic list: main topics in bold, sub-topics indented under them with a guide line, a count at the end of every row */
.multi-hint { padding: 0 4px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.topic-row { display: flex !important; align-items: center; gap: 8px; }
.topic-row .tn { flex: 1; display: inline-flex; align-items: center; gap: 6px; }
.topic-row.top { font-weight: 700; margin-top: 4px; }
.topic-row.sub { font-weight: 400; color: var(--muted) !important; }
.topic-row.d1 { padding-inline-start: 22px; } .topic-row.d2 { padding-inline-start: 40px; } .topic-row.d3 { padding-inline-start: 58px; }
.topic-row .tl { width: 10px; height: 10px; border-inline-start: 2px solid var(--border); border-bottom: 2px solid var(--border); border-end-start-radius: 4px; margin-top: -6px; flex: none; }
.topic-row .sub-note { font-size: .66rem; font-weight: 500; opacity: .75; } .topic-row .cnt { min-width: 24px; text-align: end; font-variant-numeric: tabular-nums; }
.list-total { margin: 4px 2px 10px; }

/* sortable column titles: click to sort, click again to reverse */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; } th.sortable:hover { color: var(--primary); }
th.sortable::after { content: '\2195'; margin-inline-start: 5px; font-size: .8em; opacity: .3; }
th.sortable.sorted::after { content: '\25B2'; opacity: .9; color: var(--primary); } th.sortable.sorted.desc::after { content: '\25BC'; }
/* public filters: search, topics, hashtags, language, sort and "how many" on ONE row (wide screens); phones wrap in two columns */
@media (min-width: 861px) {
  .pub-filters { display: flex; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
  .pub-filters > input[type="search"] { grid-column: auto; flex: 1 1 220px; min-width: 140px; }
  .pub-filters > select, .pub-filters > .multi { flex: 0 1 auto; min-width: 0; width: auto; }
  .pub-filters > .multi > summary { height: 34px; min-height: 34px; padding-inline: 12px; font-size: .88rem; }
  .pub-filters > select { max-width: 170px; }
}
@media (max-width: 860px) { .pub-filters { grid-template-columns: 1fr 1fr; } .pub-filters > :first-child { grid-column: 1 / -1; } .pub-filters > .multi > summary { height: 34px; min-height: 34px; font-size: .85rem; } }
/* inbox filters: ONE row on a wide screen - the search takes what is left, the lists are compact; on a phone they wrap in two columns */
@media (min-width: 861px) {
  .card > .filters { display: flex; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
  .card > .filters > input[type="search"] { flex: 1 1 200px; min-width: 120px; }
  .card > .filters > select { flex: 0 1 auto; width: auto; min-width: 0; max-width: 150px; text-overflow: ellipsis; padding-inline: 10px; }
}

/* found sources: the table fits its card (fixed columns, texts wrap), the actions of a row stay in ONE line */
@media (min-width: 861px) {
  .disc-table { table-layout: fixed; width: 100%; }
  .disc-table th, .disc-table td { overflow: hidden; vertical-align: middle; }
  .disc-table th:nth-child(1) { width: 34px; } .disc-table th:nth-child(2) { width: 24%; } .disc-table th:nth-child(3) { width: 70px; } .disc-table th:nth-child(4) { width: 74px; }
  .disc-table th:nth-child(5) { width: 112px; } .disc-table th:nth-child(7) { width: 120px; } .disc-table th:nth-child(8) { width: 262px; }
  .disc-table td:nth-child(2) span.small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
  .disc-table td:nth-child(6) a.item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .disc-table td:last-child { white-space: nowrap; text-align: end; }
  .disc-table td:last-child .btn { height: 32px; min-height: 32px; padding: 0 10px; font-size: .82rem; margin: 0; }
}

/* public cards: the classification always sits in the same row at the bottom (above the date and language), a fixed number of chips, "+N" for the rest */
.acard .card-tags { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-height: 24px; margin-top: auto; overflow: hidden; }
.acard .card-tags .chip { flex: 0 1 auto; min-width: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard .card-tags .chip.more { flex: none; max-width: none; background: transparent; border: 1px solid var(--border); color: var(--muted); }
.acard .card-tags .chip.none { background: transparent; border: 1px dashed var(--border); color: var(--muted); font-style: italic; }
.acard .card-foot { margin-top: 0 !important; display: flex; align-items: center; gap: 6px; }

.tpl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; } @media (max-width: 900px) { .tpl-grid { grid-template-columns: 1fr; } }

/* the link to the source: ONE link, at the bottom of the item */
.art-source { display: flex; justify-content: flex-start; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border); } .art-source:empty { display: none; }
.art-source .src-link { text-decoration: none; }

/* public entities: gallery and profile */
.pe-hero .pe-sub { margin: 4px 0 14px; opacity: .9; max-width: 60ch; }
.pe-tools { gap: 10px; flex-wrap: wrap; align-items: center; } .pe-tools input[type=search] { flex: 1 1 220px; max-width: 360px; } .pe-tools select { width: auto; }
.pe-tabs { display: inline-flex; gap: 4px; padding: 3px; background: rgb(255 255 255 / .14); border-radius: 99px; border: 0; margin: 0; } .pe-tabs .tab { color: #fff; border-radius: 99px; padding: 6px 16px; border: 0; background: transparent; }
.pe-tabs .tab[aria-selected="true"] { background: #fff; color: var(--primary); font-weight: 700; } .pe-tabs .tab .badge-n { background: rgb(0 0 0 / .18); color: inherit; }
.pe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 18px; }
.pe-card { display: flex; align-items: center; gap: 14px; padding: 14px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; min-width: 0; } .pe-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgb(0 0 0 / .13); }
.pe-card-t { display: flex; flex-direction: column; min-width: 0; flex: 1; } .pe-card-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; } .pe-card-t .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-card-n { display: flex; flex-direction: column; align-items: center; min-width: 54px; } .pe-card-n b { font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--primary); }
.pe-av { flex: none; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); background: var(--surface-2, #eef2f0); } .pe-av.org { border-radius: 22%; }
.pe-ini { display: inline-grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #000)); } .pe-ini.person { background: linear-gradient(135deg, #b9822b, #7a521a); }
.pe-profile { display: grid; gap: 14px; padding-top: 16px; padding-bottom: 28px; }
.pe-hero-card { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface)); border-inline-start: 5px solid var(--primary); }
.pe-hero-t h1 { margin: 6px 0 2px; font-size: 1.7rem; line-height: 1.25; } .pe-role { font-weight: 600; color: var(--primary); margin-top: 4px; }
.pe-hero-n { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding-inline-start: 20px; border-inline-start: 1px solid var(--border); } .pe-hero-n b { font-size: 2rem; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.pe-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; } .pe-main, .pe-side { display: grid; gap: 14px; min-width: 0; }
.pe-body h2 { font-size: 1rem; margin: 0 0 10px; } .pe-desc { margin: 0; line-height: 1.8; white-space: pre-wrap; font-size: 1.02rem; }
.pe-fact { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); } .pe-fact:last-child { border: 0; } .pe-fact b { text-align: end; }
.pe-links { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.art-ents { gap: 6px; margin: 2px 0 6px; }
@media (max-width: 860px) { .pe-body { grid-template-columns: 1fr; } .pe-hero-card { grid-template-columns: auto 1fr; } .pe-hero-n { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; padding: 10px 0 0; border: 0; border-top: 1px solid var(--border); } .pe-hero-t h1 { font-size: 1.35rem; } }

/* entity filters: compact selects in one row; a lit one is a filter in use */
.ent-filters { flex-wrap: wrap; } .ent-filters select { width: auto; max-width: 160px; } .ent-filters select.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); font-weight: 600; }
.pe-tools select { max-width: 170px; }

.pe-regions { margin-top: 14px; }
/* entity gallery: the country chips sit on the light page (not on the green header), so they need dark text */
.pe-regions { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-regions .chip-btn { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 5px 14px; font-size: .88rem; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.pe-regions .chip-btn:hover { border-color: var(--primary); }
.pe-regions .chip-btn[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* quick change of the labels on an entity profile */
.ent-quick { all: unset; display: inline-flex; align-items: center; gap: 3px; cursor: pointer; border-radius: 99px; padding: 1px 2px; } .ent-quick:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); } .ent-quick:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ent-quick .q-caret { font-size: .7rem; opacity: .45; } .ent-quick:hover .q-caret { opacity: .9; }
.ent-quick .chip.none { border: 1px dashed var(--border); background: transparent; color: var(--muted); font-style: italic; }
.ent-pop { position: fixed; z-index: 400; min-width: 200px; max-width: 280px; max-height: 60vh; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 36px rgb(0 0 0 / .28); padding: 6px; display: grid; gap: 4px; }
.ep-list { display: grid; gap: 1px; } .ep-opt { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: .9rem; } .ep-opt:hover, .ep-opt:focus-visible { background: color-mix(in srgb, var(--primary) 10%, transparent); } .ep-opt.on { font-weight: 700; color: var(--primary); }
.ep-input { width: 100%; margin: 2px 0; } .ent-pop .ep-save { margin: 4px 6px 4px; justify-self: end; }

/* map: layers (items / organizations / people - any combination) and the markers of the entities */
.map-layers { display: inline-flex; gap: 6px; flex-wrap: wrap; } .map-layer { display: inline-flex; align-items: center; gap: 6px; }
.map-layer[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); } .map-layer[aria-pressed="false"] { opacity: .75; }
.ml-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); display: inline-block; box-shadow: 0 0 0 2px rgb(255 255 255 / .8); } .ml-dot.org { border-radius: 2px; background: #0e7490; } .ml-dot.person { border-radius: 2px; rotate: 45deg; background: #b9822b; } .ml-dot.items { background: #d97706; }
.map-ent { display: block; width: 18px; height: 18px; background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 5px rgb(0 0 0 / .45); } .map-ent.org { border-radius: 4px; } .map-ent.person { border-radius: 3px; rotate: 45deg; width: 15px; height: 15px; margin: 2px; }
.map-legend i.sq { border-radius: 3px !important; } .map-legend i.dia { border-radius: 2px !important; rotate: 45deg; }

/* header layer switch: three clear toggles, each with the colour of its marker; off = outlined and dim, on = filled with its colour */
.layer-bar { display: inline-flex; gap: 4px; padding: 3px; border-radius: 99px; background: var(--surface-2, #eef2f0); box-shadow: inset 0 0 0 1px var(--border); }
.layer-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 99px; padding: 5px 12px; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.layer-btn i { width: 11px; height: 11px; flex: none; border: 2px solid var(--lc); background: transparent; border-radius: 50%; }
.layer-btn.items { --lc: #d97706; } .layer-btn.org { --lc: #0e7490; } .layer-btn.org i { border-radius: 3px; } .layer-btn.person { --lc: #b9822b; } .layer-btn.person i { border-radius: 2px; rotate: 45deg; width: 9px; height: 9px; }
.layer-btn:hover { color: var(--text); background: color-mix(in srgb, var(--lc) 10%, transparent); }
.layer-btn[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--lc) 16%, var(--surface)); border-color: var(--lc); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.layer-btn[aria-pressed="true"] i { background: var(--lc); }
.pe-strip { margin: 0 0 22px; } .pe-strip h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 8px; } .pe-strip .pe-grid { margin-top: 12px; }
/* the in-map chips of the admin map use the same colours */
.map-layer[aria-pressed="true"] { background: var(--primary); }

.badge.country { background: #ede9fe; color: #5b21b6; } .ent-ini.country { background: linear-gradient(135deg, #7c3aed, #4c1d95); }

/* countries: a purple ring marker / layer */
.layer-btn.country { --lc: #7c3aed; } .layer-btn.country i { border-radius: 50%; border-width: 3px; background: transparent; } .layer-btn.country[aria-pressed="true"] i { background: #fff; box-shadow: inset 0 0 0 2px var(--lc); }
.ml-dot.country { background: #7c3aed; border-radius: 50%; } .map-ent.country { border-radius: 50%; width: 22px; height: 22px; margin: -2px; border-width: 4px; background: #fff; box-shadow: 0 0 0 2px var(--c), 0 1px 5px rgb(0 0 0 / .45); border-color: var(--c); }
.map-legend i.ring { border-radius: 50% !important; background: #fff !important; box-shadow: 0 0 0 2px var(--c); }
.pe-ini.country { background: linear-gradient(135deg, #7c3aed, #4c1d95); } .pe-av.country { border-radius: 50%; }

/* sharing: channel buttons (item page, the inbox selection) and the bar for items picked on the public site */
.share-btns { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; } .share-btns .sh-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-inline-end: 2px; }
.sh-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: 4px 11px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.sh-btn:hover { color: #fff; border-color: transparent; } .sh-btn.whatsapp:hover { background: #25d366; } .sh-btn.telegram:hover { background: #229ed9; } .sh-btn.sms:hover { background: #475569; } .sh-btn.mail:hover { background: #d97706; } .sh-btn.copy:hover, .sh-btn.html:hover, .sh-btn.native:hover { background: var(--primary); }
.sh-btn.whatsapp { border-color: #25d36666; } .sh-btn.telegram { border-color: #229ed966; }
.art-source { justify-content: space-between; flex-wrap: wrap; gap: 8px; align-items: center; } .art-source:has(.share-btns) { display: flex; }
.card-pick { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 3; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; opacity: .85; }
.card-pick:hover { border-color: var(--primary); opacity: 1; } .card-pick[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; opacity: 1; } .acard { position: relative; } .acard.picked { box-shadow: 0 0 0 2px var(--primary), 0 8px 22px rgb(0 0 0 / .12); }
.psel-bar { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 90; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-top: 2px solid var(--primary); box-shadow: 0 -8px 24px rgb(0 0 0 / .18); }

/* localities: a green pin marker / layer */
.layer-btn.place { --lc: #15803d; } .layer-btn.place i { border-radius: 50% 50% 50% 0; rotate: -45deg; } .ml-dot.place { background: #15803d; border-radius: 50% 50% 50% 0; rotate: -45deg; }
.map-ent.place { width: 17px; height: 17px; margin: 1px; border-radius: 50% 50% 50% 0; rotate: -45deg; } .map-legend i.pin { border-radius: 50% 50% 50% 0 !important; rotate: -45deg; }
.badge.place { background: #dcfce7; color: #166534; } .ent-ini.place, .pe-ini.place { background: linear-gradient(135deg, #15803d, #14532d); } .pe-av.place { border-radius: 38%; }

/* links between entities: chips with a remove button and a search to add */
.chip-x { all: unset; cursor: pointer; margin-inline-start: 4px; font-weight: 700; opacity: .55; } .chip-x:hover { opacity: 1; color: var(--st-rejected); }
.ent-link-add { position: relative; } .ent-link-res { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgb(0 0 0 / .22); padding: 4px; display: grid; }
.ent-chip.country { background: #ede9fe; color: #5b21b6; } .ent-chip.place { background: #dcfce7; color: #166534; }

/* "pick to send" mode: the check box of every card is large and clear, a card shows it is pickable */
.cards.selecting .card-pick { width: 34px; height: 34px; opacity: 1; border-width: 2px; border-color: var(--primary); box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.cards.selecting .acard { cursor: pointer; outline: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: -1px; }
.cards.selecting .acard.picked { outline: 2px solid var(--primary); }

/* map labels in the language of the system (the tiles have none) */
.map-lbl-wrap { pointer-events: none; } .map-lbl { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; color: #334155; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff; font-weight: 600; pointer-events: none; }
.map-lbl.country { font-size: 1rem; letter-spacing: .3px; text-transform: none; font-weight: 700; color: #1e293b; opacity: .8; } .map-lbl.city { font-size: .78rem; }
.map-lbl.dk { color: #e2e8f0; text-shadow: 0 0 3px #0f172a, 0 0 3px #0f172a, 0 0 5px #0f172a; }
.map-tiles-clean { filter: none; }
/* entity gallery tabs: the count is a small round pill, quiet on the green bar, tinted on the chosen tab */
.pe-tabs .tab { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 16px; } html[dir="rtl"] .pe-tabs .tab { padding: 6px 16px 6px 8px; }
.pe-tabs .tab .badge-n { position: static; margin: 0; min-width: 24px; height: 22px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 99px; font-size: .74rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; background: rgb(255 255 255 / .22); color: #fff; box-shadow: none; }
.pe-tabs .tab[aria-selected="true"] .badge-n { background: color-mix(in srgb, var(--primary) 16%, #fff); color: var(--primary); }
.pe-tabs .tab:not([aria-selected="true"]):hover { background: rgb(255 255 255 / .16); }

.map-filters { display: inline-flex; gap: 6px; align-items: center; } .map-filters select { width: auto; max-width: 150px; height: 34px; padding: 0 10px; font-size: .85rem; }

/* the number of items on the map sits in the header, right next to the "Map" tab */
.map-count-pill { display: inline-flex; align-items: center; padding: 0 10px; margin-inline-start: 2px; font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary); white-space: nowrap; } .map-count-pill:empty { display: none; }

/* public header: logo + name, the title in the middle, the menu and the language; under them the filters, fitted to the width */
.pub-head .in { flex-wrap: wrap; gap: 8px 14px; } .pub-title { margin: 0; flex: 1 1 auto; text-align: center; font-size: 1.25rem; font-weight: 700; color: var(--primary); white-space: nowrap; } .pub-title-gap { flex: 1 1 auto; }
.pub-head-filters { padding-top: 0 !important; padding-bottom: 10px !important; }
.pub-head-filters .pub-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; width: 100%; }
.pub-head-filters .pub-filters > input[type="search"] { flex: 1 1 240px; min-width: 150px; }
.pub-head-filters .pub-filters > select, .pub-head-filters .pub-filters > .multi { flex: 0 1 auto; width: auto; max-width: 190px; }
.pub-head-filters input, .pub-head-filters select { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.hero.slim { padding: 12px 0; } .hero.slim .pub-regions { margin: 0; }
@media (max-width: 760px) { .pub-title { order: 3; flex-basis: 100%; font-size: 1.05rem; } }
/* the header is a tall block now (menu + filters): it stays in view only on a wide screen; on a narrower one it scrolls away with the page */
@media (max-width: 1000px) { .pub-head { position: static; } .pub-nav, .layer-bar { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .pub-nav a, .layer-btn { white-space: nowrap; } }

/* public header layout: [logo + name] [title and menu, from the right] [the language buttons, FIXED at the far left on every page] */
@media (min-width: 761px) {
  .pub-head .in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 8px 16px; }
  .pub-head .in > .pub-title, .pub-head .in > .pub-title-gap { display: none; }
  .pub-head .pub-mid { justify-content: flex-start; flex-wrap: wrap; min-width: 0; align-items: center; row-gap: 8px; }
  .pub-head .pub-lang { flex: none; justify-self: end; align-self: start; flex-wrap: nowrap; }
  .pub-head .pub-mid .pub-title-inline { display: inline-block; }
}

.pub-mid .pub-title { flex: 0 0 auto; text-align: start; margin-inline-end: 6px; }

/* public header, final layout (wide): row 1 = [logo + name] [the TITLE, large, in the middle] [language, fixed at the far left]; row 2 = the menu, the layers, the map controls */
@media (min-width: 761px) {
  .pub-head .in { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand title lang" "mid mid mid"; align-items: center; }
  .pub-head .in > .pub-brand { grid-area: brand; } .pub-head .in > .pub-title, .pub-head .in > .pub-title-gap { grid-area: title; display: block; }
  .pub-head .in > .pub-lang { grid-area: lang; align-self: center; } .pub-head .in > .pub-mid { grid-area: mid; }
  .pub-head .pub-title { text-align: center; font-size: 2rem; line-height: 1.2; margin: 0; flex: none; }
}
@media (max-width: 760px) { .pub-head .pub-title { order: 3; flex-basis: 100%; text-align: center; font-size: 1.4rem; } }

/* ONE header on every page: row 1 = [logo + name] [menu and layers, from the right] [language, fixed at the far left]; row 2 = the controls of the page */
@media (min-width: 761px) {
  .pub-head .in.pub-row1 { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand mid lang"; align-items: center; }
  .pub-head .in.pub-head-filters { display: block; padding-top: 0; } .pub-head-filters .pub-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
  .pub-head-filters .pub-filters > input[type="search"] { flex: 1 1 240px; min-width: 150px; }
  .pub-head-filters .pub-filters > select, .pub-head-filters .pub-filters > .multi { flex: 0 1 auto; width: auto; max-width: 190px; }
}
.list-title { font-size: 1.05rem; } .list-title b { color: var(--primary); font-size: 1.15rem; }

/* header rows: row 1 is identical on every page (logo, menu, language - all aligned to the top); the layers join the controls in row 2 */
@media (min-width: 761px) {
  .pub-head .in.pub-row1 { align-items: start; } .pub-head .in.pub-row1 > * { align-self: start; }
  .pub-head .in.pub-head-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
  .pub-head-filters .pub-filters { flex: 1 1 520px; width: auto; }
}
/* the same height on every page: the second row of the header and the green strip take the size of the tallest case, so everything below starts at the same place */
@media (min-width: 761px) {
  .pub-head .in.pub-head-filters { min-height: 90px; align-content: flex-start; }
  .hero.slim { min-height: 94px; display: flex; align-items: center; } .hero.slim > .pub-wrap { width: 100%; }
}

.pub-head-filters .pub-filters > .pe-q { flex: 0 1 210px; min-width: 130px; }
.pub-head-filters .pub-filters > input.pe-q[type="search"] { flex: 0 1 210px; width: 210px; min-width: 130px; }

/* the layer bar sits at the TOP of the second row, level with the first line of controls (not in the middle) */
.pub-head .in.pub-head-filters { align-items: flex-start; } .pub-head-filters .layer-bar { margin-top: 0; align-self: flex-start; }

.ws-list { display: grid; gap: 6px; max-height: 58vh; overflow: auto; } .ws-item { display: grid; gap: 2px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; } .ws-item:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); } .ws-item b { color: var(--primary); }

.src-left { display: grid; gap: 10px; min-width: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; } .seg-o { position: relative; cursor: pointer; } .seg-o input { position: absolute; opacity: 0; inset: 0; cursor: pointer; } .seg-o span { display: block; text-align: center; padding: 8px 10px; font-size: .88rem; } .seg-o + .seg-o span { border-inline-start: 1px solid var(--border); } .seg-o input:checked + span { background: var(--primary); color: #fff; font-weight: 600; } .seg-o input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }

.src-cols { align-items: stretch; } .src-cols > fieldset { height: 100%; box-sizing: border-box; } @media (max-width: 860px) { .src-cols > fieldset { height: auto; } }

.src-info { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--primary) 4%, transparent); } .src-info img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; } .si-body { display: grid; gap: 3px; min-width: 0; } .si-cs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 4px 0; } .si-c { display: grid; } .si-c b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.art-nav { display: inline-flex; flex-wrap: nowrap; } .art-nav .seg { flex-wrap: nowrap; white-space: nowrap; } .art-nav .seg .btn, .art-nav .seg-n { flex: none; white-space: nowrap; } .art-nav .seg .btn { min-width: 0; } .art-nav .seg-n { min-width: 70px; }
.art-nav .seg { display: inline-flex; grid-template-columns: none; flex-wrap: nowrap; align-items: stretch; border: 0; overflow: visible; }

.src-row { display: flex; align-items: center; gap: 10px; min-width: 0; } .src-row-t { min-width: 0; }
.src-logo { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); display: grid; place-items: center; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); }
.src-logo i { font-style: normal; font-weight: 700; font-size: 1rem; } .src-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.rtable.fixed td.c-reg { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; } .rtable.fixed td.c-reg .chip.rg { display: inline-block; max-width: 100%; margin: 1px 0; padding: 1px 8px; font-size: .78rem; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.rtable.fixed th:nth-child(8) { white-space: normal; line-height: 1.3; }

/* found sources + linked posts: one tidy row = logo, name, link on one line; short cells; actions grouped at the end */
.disc-table td { height: 60px; padding-block: 8px; } .disc-table .src-row-t { display: grid; gap: 1px; min-width: 0; } .disc-table .src-row-t b, .disc-table .src-row-t .c-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.disc-table .c-url { font-size: .8rem; direction: ltr; text-align: start; } .disc-table .cnt { position: static; display: inline-flex; min-width: 28px; justify-content: center; }
.disc-table .seen-in { display: flex; align-items: center; gap: 6px; min-width: 0; } .disc-table .seen-in a.item { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; } .disc-table .seen-in .badge { flex: none; }
.disc-table td:last-child { display: table-cell; } .disc-table td:last-child .btn.primary { min-width: 0; }
.post-table th:nth-child(1) { width: 34px; } .post-table th:nth-child(2) { width: auto; } .post-table th:nth-child(3) { width: 84px; } .post-table th:nth-child(4) { width: 26%; } .post-table th:nth-child(5) { width: 230px; }
.post-table .src-logo { width: 34px; height: 34px; } .post-table .src-logo i { font-size: .9rem; }
/* under the item: share + source link in ONE line (scrolls sideways on a narrow screen instead of stacking) */
.art-source:has(.share-btns) { flex-wrap: wrap; gap: 10px; overflow: visible; padding-bottom: 2px; } .art-source:has(.share-btns)::-webkit-scrollbar { display: none; }
.art-source .share-btns { flex-wrap: wrap; flex: 0 1 auto; } .art-source .share-btns .sh-btn, .art-source .btn, .art-source .sh-label { flex: none; white-space: nowrap; }
@media (max-width: 560px) { .art-source .sh-btn { padding: 4px 9px; font-size: .76rem; } .art-source .btn.sm { padding-inline: 10px; } }
.article-compact .art-source { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; justify-content: flex-start; }

/* visit statistics */
.stat-bars{display:flex;align-items:flex-end;gap:2px;height:140px;margin:10px 0 6px}
.stat-col{position:relative;flex:1;height:100%;display:flex;align-items:flex-end;justify-content:center;min-width:2px}
.stat-col i{position:absolute;bottom:0;inset-inline:0;border-radius:2px 2px 0 0}
.stat-col .w{background:color-mix(in srgb,var(--primary) 30%,transparent)}
.stat-col .v{background:var(--primary);inset-inline:25%}
.stat-key{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:middle}
.stat-key.w{background:color-mix(in srgb,var(--primary) 30%,transparent)}.stat-key.v{background:var(--primary)}
td.num{text-align:end;font-variant-numeric:tabular-nums}

/* cards of different heights flow into two columns without gaps (settings, account, entity page, statistics) */
.masonry{display:block;columns:2 380px;column-gap:var(--gap)}
.masonry>*{break-inside:avoid;margin-bottom:var(--gap);display:block}
.masonry>[style*="grid-column:1/-1"]{column-span:all}
@media (max-width:900px){.masonry{columns:1}}

/* one floating save button for a long form */
.save-bar{position:sticky;bottom:12px;z-index:5;column-span:all;display:flex;justify-content:flex-end;align-items:center;gap:12px;margin-top:8px;padding:10px 14px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 6px 24px rgba(0,0,0,.14)}

a.tab{text-decoration:none;display:inline-flex;align-items:center;gap:6px}

/* sign-in overview */
.kpi-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--gap)}
.kpi{display:flex;align-items:center;gap:14px;padding:16px 18px;background:var(--surface);border:1px solid var(--border);border-inline-start:4px solid var(--kc,var(--primary));border-radius:12px}
.kpi.ok{--kc:#2e9e5b}.kpi.warn{--kc:#e08a1e}.kpi.info{--kc:#2f6fd6}.kpi.user{--kc:#7c5cd6}
.kpi-ic{display:grid;place-items:center;width:46px;height:46px;border-radius:12px;background:color-mix(in srgb,var(--kc) 14%,transparent);color:var(--kc)}
.kpi-n{font-size:1.7rem;font-weight:700;line-height:1.1;font-variant-numeric:tabular-nums}
@media (max-width:900px){.kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* text follows the page direction: right in Hebrew and Arabic, left in English */
.form input[type=text],.form input[type=search],.form input[type=url],.form textarea{text-align:start}
.form input::placeholder{text-align:start}

/* internal viewer */
.live-out{max-height:70vh;overflow:auto;text-align:center;background:var(--surface-2);border-radius:12px;padding:10px}
.live-img{max-width:100%;height:auto;border-radius:10px;box-shadow:0 2px 14px rgba(0,0,0,.18);background:#fff}
.live-text{white-space:pre-wrap;text-align:start;font-size:.85rem;max-height:240px;overflow:auto}

/* section tabs and the accounts table */
.sec-tabs{margin:4px 0 14px}.sec-tabs a.tab{text-decoration:none}
.lk-pick{width:150px;display:inline-block}

/* rows: the look of the inbox for lists of sources, posts, accounts */
.rows{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:2px 16px}
.rows-h{margin:18px 2px 8px;font-size:1.05rem}
.rrow{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:14px;align-items:center;padding:13px 2px;border-bottom:1px solid var(--border)}
.rrow.ck{grid-template-columns:22px 48px minmax(0,1fr) auto}
.rrow:last-child{border-bottom:0}
.rrow:hover{background:color-mix(in srgb,var(--primary) 4%,transparent)}
.rav,.rrow .src-logo,.rrow .avatar{width:48px;height:48px;border-radius:12px;object-fit:cover;background:var(--surface-2);display:grid;place-items:center;font-weight:700;color:var(--primary);border:1px solid var(--border);overflow:hidden}
.rmain{min-width:0}
.rt{display:block;font-weight:600;overflow-wrap:anywhere;color:var(--text);text-decoration:none}
a.rt:hover{color:var(--primary);text-decoration:underline}
.rmeta{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;margin-top:5px;color:var(--muted);font-size:.84rem}
.rmeta .bar{display:inline-block;height:6px}
.rlinks{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:7px;font-size:.88rem}
.rl{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}.rl i{font-style:normal;color:var(--muted);font-size:.8rem}
.ract{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.rtool{display:flex;gap:8px;align-items:center;margin:0 0 12px}.rtool input{flex:1;min-width:180px}
.lk-pick{width:150px}
.lk-how{display:grid;grid-template-columns:1fr minmax(240px,320px);gap:20px;align-items:start}
@media (max-width:800px){.rrow,.rrow.ck{grid-template-columns:48px minmax(0,1fr)}.rrow.ck>input[type=checkbox]{display:none}.rrow .ract{grid-column:1/-1;justify-content:flex-start}.lk-how{grid-template-columns:1fr}}

/* video of an item */
.item-media{margin:0 0 var(--gap)}
.item-video{display:block;width:100%;max-height:480px;border-radius:10px;background:#000}
.embed-wrap{margin-top:10px;border-radius:10px;overflow:hidden;background:var(--surface-2)}
.embed-frame{display:block;width:100%;border:0}
.embed-wrap[style*="aspect-ratio"] .embed-frame{height:100%}

/* the round edit / select button sits above the text of a card that has no picture, not on it */
.acard:not(:has(.card-thumb)) h3{padding-inline-start:40px;min-height:2.8em}
.acard:not(:has(.card-thumb)) .tr-line{padding-inline-start:0}

/* the buttons of a page head wrap to the next line instead of running out of the page */
.page-head > .row-flex{flex-wrap:wrap;min-width:0;max-width:100%;row-gap:8px}
.page-head > .tabs{flex-wrap:wrap;min-width:0}
.page-head{row-gap:10px}

/* entities: one-line header, tools under the title, the groups of the list */
.page-head .ent-add{position:relative}.ent-add>summary{list-style:none;cursor:pointer;white-space:nowrap}.ent-add>summary::-webkit-details-marker{display:none}
.ent-add .pop{position:absolute;inset-inline-end:0;top:calc(100% + 6px);z-index:30;display:flex;flex-direction:column;gap:2px;min-width:180px;padding:6px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 10px 30px rgb(0 0 0 / .16)}
.ent-add .pop .btn{justify-content:flex-start;border:0}
.ent-tools{margin:-8px 0 12px;gap:6px}
.ent-grp{border-bottom:1px solid var(--border)}.ent-grp:last-child{border-bottom:0}
.ent-grp-h{display:flex;align-items:center;gap:10px;width:100%;padding:10px 6px;background:transparent;border:0;color:var(--text);font:inherit;cursor:pointer;text-align:start}
.ent-grp-h:hover{background:var(--surface-2);border-radius:8px}
.ent-grp-h svg{transition:rotate .15s;rotate:90deg}.ent-grp.open .ent-grp-h svg{rotate:-90deg}
.ent-grp-h .small{margin-inline-start:auto}
@media (max-width:900px){.page-head .head-tabs{order:3;width:100%}}

/* the division of the entity list: a strip of buttons at the top */
.ent-strip{display:flex;flex-wrap:wrap;gap:8px;padding:12px 16px;margin:0 0 12px;border-radius:var(--radius);background:linear-gradient(135deg,color-mix(in srgb,var(--primary) 78%,#000),var(--primary))}
.ent-strip:empty{display:none}
.ent-strip .chip-btn{white-space:nowrap}

/* entity filters: search and every box in ONE row; the reset is a pill button */
.ent-filters{flex-wrap:nowrap !important;align-items:center}
.ent-filters #ent-q{flex:1 1 180px;min-width:120px}
.ent-filters select{flex:0 1 150px;min-width:0;max-width:160px;width:auto}
.ent-filters label.check{white-space:nowrap;flex:0 0 auto}
.ent-reset{flex:0 0 auto;white-space:nowrap;border-radius:99px;font-weight:600;color:var(--primary);background:color-mix(in srgb,var(--primary) 10%,var(--surface));border:1px solid color-mix(in srgb,var(--primary) 35%,transparent)}
.ent-reset:hover{background:var(--primary);color:var(--primary-contrast,#fff)}
.ent-strip{background:var(--primary);background-image:linear-gradient(135deg,color-mix(in srgb,var(--primary) 78%,#000),var(--primary))}
@media (max-width:1100px){.ent-filters{flex-wrap:wrap !important}}

/* a toggle that filters the list (not a selection of rows) */
.ent-toggle{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:99px;font:inherit;font-size:.85rem;font-weight:600;cursor:pointer;color:var(--muted);background:var(--surface);border:1px solid var(--border)}
.ent-toggle:hover{border-color:var(--primary);color:var(--primary)}
.ent-toggle[aria-pressed="true"]{background:var(--primary);border-color:var(--primary);color:var(--primary-contrast,#fff)}

/* the reset is always there, quiet while there is nothing to reset */
.ent-reset[disabled]{opacity:.45;cursor:default;pointer-events:none}
.ent-tools:empty{display:none}

/* what the public site shows: a clear card with chips, a count and its own save */
.scope-card{text-align:start}
.scope-card .sc-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 14px;margin:6px 0 4px;border-radius:12px;background:var(--surface-2);border:1px solid var(--border)}
.scope-card .sc-summary.on{border-color:color-mix(in srgb,var(--primary) 45%,var(--border))}
.scope-card .sc-state{display:flex;flex-direction:column;gap:2px}
.scope-card .sc-group{padding:14px 0 4px;margin-top:10px;border-top:1px solid var(--border)}
.scope-card .sc-gh{display:flex;align-items:center;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.scope-card .sc-gact{margin-inline-start:auto;display:flex;gap:6px}
.scope-card .sc-chips{display:flex;flex-wrap:wrap;gap:8px}
.scope-card .sc-tag button{border:0;background:transparent;color:inherit;cursor:pointer;font-size:1rem;line-height:1;margin-inline-start:6px;padding:0 2px}
.scope-card input[type=text]{text-align:start}

/* sources: the type strip shows the number of sources in error as a red pill */
.chip-btn .chip-err{opacity:1;background:#d92d20;color:#fff;border-radius:99px;padding:0 7px;font-size:.72rem;font-weight:700;margin-inline-start:6px}
.chip-btn[aria-pressed="true"] .chip-err{background:#d92d20;color:#fff}
.src-strip{margin-bottom:12px}

.masonry>.scope-card{column-span:all;width:100%}
.scope-card .sc-chips{gap:10px}

/* one designed row: the section tabs and the links on the start side, the main buttons on the end side (they stay at the edge, wrap on a small screen) */
.sec-bar{display:flex;align-items:center;justify-content:space-between;gap:10px 16px;flex-wrap:wrap;margin:0 0 14px;padding:8px 12px;background:var(--surface);border:1px solid var(--border);border-radius:14px}
.sec-bar-start{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.sec-bar-end{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-inline-start:auto}
.sec-bar .tabs{margin:0;border:0;padding:0;background:transparent}
.sec-bar .sep{width:1px;height:22px;background:var(--border);margin-inline:4px}

/* ===== the title of every admin page: one design, large and in the middle, with a divider line ===== */
.page-head{position:relative !important;top:auto !important;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px;margin:4px 0 26px;padding:6px 0 24px;background:transparent !important;backdrop-filter:none !important;border-bottom:0 !important}
.page-head > div:first-child{display:flex;flex-direction:column;align-items:center;max-width:min(100%,820px)}
.page-head h1{font-size:clamp(1.7rem,2.6vw,2.35rem);font-weight:800;letter-spacing:.2px;line-height:1.15;color:var(--text)}
.page-head p{display:block !important;max-width:68ch;margin:8px auto 0;font-size:.98rem;color:var(--muted)}
.page-head > .row-flex,.page-head > .tabs{justify-content:center}
.page-head::after{content:"";position:absolute;inset-inline:0;bottom:0;height:2px;border-radius:2px;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--primary) 55%,transparent) 14%,color-mix(in srgb,var(--primary) 55%,transparent) 86%,transparent)}
.page-head::before{content:"";position:absolute;bottom:-4px;inset-inline-start:calc(50% - 5px);width:10px;height:10px;border-radius:2px;transform:rotate(45deg);background:var(--accent);box-shadow:0 0 0 5px var(--bg);z-index:1}
.page-head .art-bar,.page-head .art-nav{justify-content:center}
@media (max-width:860px){.page-head{margin-bottom:20px;padding-bottom:18px}.page-head h1{font-size:1.5rem}}

/* accounts and links: the actions of a row stay on ONE line */
.lk-row{grid-template-columns:48px minmax(0,1fr) auto}
.lk-row .ract{flex-wrap:nowrap;white-space:nowrap}
.lk-row .lk-pick{width:170px;flex:0 0 auto}
@media (max-width:1000px){.lk-row .ract{flex-wrap:wrap}}

/* accounts and connections: ONE line per account, with a small header of the columns */
.lk-rows .lk-row{display:grid;grid-template-columns:44px minmax(110px,1.1fr) minmax(130px,.8fr) minmax(130px,1fr) minmax(190px,1.4fr) auto;gap:12px;align-items:center}
.lk-rows .lk-head{padding:10px 2px 4px;border-bottom:1px solid var(--border);font-weight:600}
.lk-rows .rav{width:40px;height:40px;border-radius:10px}
.lk-rows .lk-handle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lk-rows .lk-net,.lk-rows .lk-src,.lk-rows .lk-ent{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;min-width:0;overflow:hidden;white-space:nowrap}
.lk-rows .lk-ent a{overflow:hidden;text-overflow:ellipsis}
.lk-rows .ract{flex-wrap:nowrap}.lk-rows .lk-pick{width:140px}
@media (max-width:1150px){.lk-rows .lk-row{grid-template-columns:44px 1fr}.lk-rows .lk-head{display:none}.lk-rows .lk-net,.lk-rows .lk-src,.lk-rows .lk-ent,.lk-rows .ract{grid-column:2;flex-wrap:wrap;white-space:normal}}

/* intake policy panel */
.ip-card .ent-strip{margin:0 0 8px}
.ip-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0 6px}
.ip-mode{display:flex;gap:20px;flex-wrap:wrap;margin:8px 0}

/* intake: a value that only some of the chosen countries have */
.ent-toggle[aria-pressed="mixed"]{border-style:dashed;border-color:var(--primary);color:var(--primary);background:color-mix(in srgb,var(--primary) 8%,var(--surface))}
.sc-tag.mixed{border-style:dashed;opacity:.75}

/* the window bar of the inbox */
.win-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0}

/* what is set for every country */
.ip-sum{display:grid;gap:6px;margin:4px 0 14px}
.ip-sum-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

/* the countries as tiles */
.ip-sum{display:grid;gap:12px;margin:6px 0 16px}
.ip-sum-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ip-pill{padding:3px 10px;border-radius:999px;font-size:.82rem;font-weight:600;border:1px solid var(--border);background:var(--surface-2)}
.ip-pill.all{color:var(--ok,#166534)}.ip-pill.sel{color:var(--primary)}.ip-pill.off{color:var(--muted)}
.ip-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px}
.ip-tile{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:start;padding:11px 14px;border-radius:12px;border:1px solid var(--border);background:var(--surface);border-inline-start:4px solid var(--border);cursor:pointer;font:inherit;color:inherit;transition:box-shadow .15s ease,border-color .15s ease}
.ip-tile:hover{box-shadow:0 2px 10px rgba(0,0,0,.08)}
.ip-tile b{font-size:1rem}
.ip-tile .ip-st{font-size:.85rem}.ip-tile .ip-n{font-size:.78rem;color:var(--muted)}
.ip-tile.all{border-inline-start-color:#16a34a}.ip-tile.sel{border-inline-start-color:var(--primary)}.ip-tile.warn{border-inline-start-color:#dc2626}
.ip-tile.off{opacity:.62;border-inline-start-color:var(--muted)}
.ip-tile.picked{box-shadow:0 0 0 2px var(--primary)}
.ip-tile .ip-warn{font-size:.78rem;color:#dc2626}

.ip-card>h2{display:flex;justify-content:flex-start;align-items:center;gap:8px;text-align:start}
.ip-tile.picked{background:var(--primary);color:#fff;border-color:var(--primary);box-shadow:0 2px 10px rgba(0,0,0,.18)}
.ip-tile.picked .ip-n,.ip-tile.picked .ip-st{color:rgba(255,255,255,.86)}
.ip-tile.picked .ip-warn{color:#fecaca}
.ip-tile.picked.off{opacity:1}

/* the settings of the chosen country: its own panel, set apart from the tiles above, with tiles inside */
.ip-card .ip-body{margin-top:18px;padding:16px;border-radius:16px;background:var(--surface-2);border:1px solid var(--border);border-top:3px solid var(--primary);display:grid;gap:14px}
.ip-card .ip-panel-head{display:flex;align-items:center;gap:8px;font-size:1.02rem}
.ip-card .ip-bar,.ip-card .ip-mode{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin:0;align-items:stretch}
.ip-card .ip-bar>.small{grid-column:1/-1}
.ip-card .ip-body .ent-toggle{justify-content:center;padding:13px 16px;border-radius:12px;font-size:.95rem;min-height:48px;text-align:center;background:var(--surface)}
.ip-card .ip-body .ent-toggle[aria-pressed="true"]{background:var(--primary);color:var(--primary-contrast,#fff)}
.ip-card .ip-body .sc-group{padding:14px;border-radius:14px;background:var(--surface);border:1px solid var(--border)}
.ip-card .ip-body .sc-gh{display:flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.ip-card .ip-body .sc-gact{margin-inline-start:auto;display:flex;gap:6px}
.ip-card .ip-body .sc-chips{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px}
.ip-card .ip-body .sc-chips .ent-toggle{min-height:44px;padding:10px 12px;border-radius:12px;justify-content:flex-start;text-align:start}
.ip-card .ip-body .sc-chips .chip.tag{justify-content:space-between}

/* countries and areas: one tile per country with its own switches */
.ip-card .ip-legend{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0 12px}
.ip-card .ip-legend-act{margin-inline-start:auto;display:flex;gap:6px}
.ip-card .ip-h{margin:20px 0 10px;font-size:1rem;display:flex;align-items:center;gap:8px}
.ip-card .ip-bulk{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 14px;margin-bottom:12px;border-radius:12px;background:color-mix(in srgb,var(--primary) 10%,var(--surface));border:1px solid var(--primary)}
.ip-card .ip-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px;align-items:start}
.ip-card .ip-tile{cursor:default;display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:12px 14px;background:var(--surface);color:inherit}
.ip-card .ip-tile.picked{background:var(--surface);color:inherit}
.ip-card .ip-tile.open{box-shadow:0 0 0 2px var(--primary)}
.ip-card .ip-tile.fresh{border-color:var(--primary);background:color-mix(in srgb,var(--primary) 8%,var(--surface))}
.ip-card .ip-tile-top{display:flex;align-items:center;gap:8px}
.ip-card .ip-tile-top b{font-size:1.02rem;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ip-card .ip-chk{display:inline-flex;cursor:pointer}
.ip-card .ip-ctl{display:flex;flex-direction:column;gap:6px}
.ip-card .ip-seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--surface-2)}
.ip-card .ip-seg button{padding:7px 8px;border:0;background:transparent;font:inherit;font-size:.86rem;font-weight:600;color:var(--muted);cursor:pointer;transition:background .15s ease,color .15s ease}
.ip-card .ip-seg button+button{border-inline-start:1px solid var(--border)}
.ip-card .ip-seg button.on{background:var(--primary);color:var(--primary-contrast,#fff)}
.ip-card .ip-seg button:not(.on):hover{background:color-mix(in srgb,var(--primary) 10%,transparent);color:var(--primary)}
.ip-card .ip-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ip-card .ip-edit-btn{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:99px;border:1px solid var(--border);background:var(--surface-2);font:inherit;font-size:.8rem;font-weight:600;cursor:pointer;color:var(--primary)}
.ip-card .ip-edit-btn.on{background:var(--primary);color:var(--primary-contrast,#fff);border-color:var(--primary)}
.ip-card .ip-editor{grid-column:1/-1;display:grid;gap:12px;padding:14px;border-radius:14px;background:var(--surface-2);border:1px solid var(--border);border-top:3px solid var(--primary)}
.ip-card .ip-editor-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.ip-card .ip-group{padding:12px;border-radius:12px;background:var(--surface);border:1px solid var(--border)}
.ip-card .ip-gh{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.ip-card .ip-gact{margin-inline-start:auto;display:flex;gap:6px}
.ip-card .ip-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:8px}
.ip-card .ip-grid .ent-toggle{min-height:40px;border-radius:10px;justify-content:flex-start;text-align:start}

/* countries and areas: one wide row (a card) per country, with the same columns on the head */
.ip-card{margin-top:4px}
.ip-card .ip-list{display:grid;gap:8px;margin-top:8px}
.ip-card .ip-head,.ip-card .ip-row{display:grid;grid-template-columns:34px minmax(170px,1.5fr) minmax(130px,1fr) 150px 80px 150px 150px minmax(130px,auto) auto;gap:12px;align-items:center}
.ip-card .ip-head{padding:6px 16px;font-size:.8rem;font-weight:700;color:var(--muted)}
.ip-card .ip-row{padding:12px 16px;border-radius:14px;background:var(--surface);border:1px solid var(--border);border-inline-start:4px solid var(--border);transition:box-shadow .15s ease,border-color .15s ease}
.ip-card .ip-row:hover{box-shadow:0 2px 10px rgba(0,0,0,.07)}
.ip-card .ip-row.all{border-inline-start-color:#16a34a}.ip-card .ip-row.sel{border-inline-start-color:var(--primary)}.ip-card .ip-row.warn{border-inline-start-color:#dc2626}
.ip-card .ip-row.off{border-inline-start-color:var(--muted);background:color-mix(in srgb,var(--muted) 6%,var(--surface))}
.ip-card .ip-row.off .ip-name,.ip-card .ip-row.off .ip-words{opacity:.65}
.ip-card .ip-row.special{background:color-mix(in srgb,var(--primary) 5%,var(--surface))}
.ip-card .ip-row.open{box-shadow:0 0 0 2px var(--primary)}
.ip-card .ip-row.fresh{border-color:var(--primary);background:color-mix(in srgb,var(--primary) 9%,var(--surface))}
.ip-card .ip-name b{font-size:1.02rem}
.ip-card .ip-words{display:flex;gap:4px;flex-wrap:wrap}
.ip-card .ip-num{font-weight:700}
.ip-card .ip-act{display:flex;gap:6px;justify-content:flex-end}
.ip-card .ip-c-topics{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ip-card .ip-editor{margin:0 0 6px}
@media (max-width:1300px){.ip-card .ip-head{display:none}.ip-card .ip-row{grid-template-columns:34px 1fr auto;grid-template-areas:"chk name act" ". ent ent" ". words num" ". on on" ". mode mode" ". topics topics"}
  .ip-card .ip-row>.ip-chk{grid-area:chk}.ip-card .ip-name{grid-area:name}.ip-card .ip-act{grid-area:act}.ip-card .ip-ent{grid-area:ent}.ip-card .ip-words{grid-area:words}.ip-card .ip-num{grid-area:num}.ip-card .ip-c-on{grid-area:on}.ip-card .ip-c-mode{grid-area:mode}.ip-card .ip-c-topics{grid-area:topics}}

/* countries and areas: the list as a clear grid. Status and what goes up are shown, and changed through the ticks and the bar */
.ip-card .ip-head,.ip-card .ip-row{grid-template-columns:34px minmax(180px,1.6fr) 100px 130px 130px minmax(200px,2fr) auto;gap:14px}
.ip-card .ip-head{padding:10px 16px;border-radius:12px;background:var(--surface-2);border:1px solid var(--border);color:var(--fg)}
.ip-card .ip-th{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;font:inherit;font-size:.82rem;font-weight:700;color:var(--muted);cursor:pointer;padding:2px 0;text-align:start}
.ip-card .ip-th i{font-style:normal;font-size:.7rem;opacity:.6}
.ip-card .ip-th:hover,.ip-card .ip-th.on{color:var(--primary)}.ip-card .ip-th.on i{opacity:1}
.ip-card .ip-row.off{background:var(--surface);opacity:1}
.ip-card .ip-row.on:not(.special){background:color-mix(in srgb,#16a34a 7%,var(--surface))}
.ip-card .ip-row.on.sel:not(.special){background:color-mix(in srgb,var(--primary) 7%,var(--surface))}
.ip-card .ip-row.warn:not(.special){background:color-mix(in srgb,#dc2626 6%,var(--surface))}
.ip-card .ip-name-btn{border:0;background:transparent;padding:0;font:inherit;color:inherit;cursor:pointer;text-align:start}
.ip-card .ip-name-btn:hover b{color:var(--primary);text-decoration:underline}
.ip-card .ip-num{text-align:start;font-variant-numeric:tabular-nums}
.ip-card .ip-badge{display:inline-flex;align-items:center;padding:3px 12px;border-radius:99px;font-size:.82rem;font-weight:700;border:1px solid var(--border);background:var(--surface-2);color:var(--muted)}
.ip-card .ip-badge.on,.ip-card .ip-badge.all{background:color-mix(in srgb,#16a34a 14%,var(--surface));border-color:#16a34a;color:#166534}
.ip-card .ip-badge.sel{background:color-mix(in srgb,var(--primary) 14%,var(--surface));border-color:var(--primary);color:var(--primary)}
.ip-card .ip-c-topics{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.ip-card .ip-bulk{gap:10px}
.ip-card .ip-seg{display:inline-grid;grid-auto-flow:column;grid-auto-columns:1fr;border:1px solid var(--primary);border-radius:10px;overflow:hidden;background:var(--surface)}
.ip-card .ip-seg button{padding:6px 16px;border:0;background:transparent;font:inherit;font-size:.86rem;font-weight:600;color:var(--primary);cursor:pointer}
.ip-card .ip-seg button+button{border-inline-start:1px solid var(--primary)}
.ip-card .ip-seg button.on{background:var(--primary);color:var(--primary-contrast,#fff)}
.ip-card .ip-seg button:not(.on):hover{background:color-mix(in srgb,var(--primary) 12%,transparent)}
.ip-pop{border:1px solid var(--border);border-radius:12px;padding:12px;display:grid;gap:10px}
.ip-pop .ip-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:8px}
.ip-chk-tile{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border);border-radius:10px;cursor:pointer;background:var(--surface)}
.ip-adv{border:1px dashed var(--border);border-radius:12px;padding:8px 12px}
.ip-adv summary{cursor:pointer;font-weight:600}
@media (max-width:1300px){.ip-card .ip-row{grid-template-columns:34px 1fr auto;grid-template-areas:"chk name act" ". num num" ". st st" ". mode mode" ". topics topics"}
  .ip-card .ip-row>.ip-chk{grid-area:chk}.ip-card .ip-name{grid-area:name}.ip-card .ip-act{grid-area:act}.ip-card .ip-num{grid-area:num}.ip-card .ip-c-st{grid-area:st}.ip-card .ip-c-mode{grid-area:mode}.ip-card .ip-c-topics{grid-area:topics}}

/* the edit form that opens below a row */
.ip-card .ip-row.editing{box-shadow:0 0 0 2px var(--primary);border-end-start-radius:0;border-end-end-radius:0;margin-bottom:-8px}
.ip-card .ip-expand{display:grid;gap:12px;padding:16px;margin-top:-8px;border-radius:0 0 14px 14px;background:var(--surface-2);border:2px solid var(--primary);border-top:1px dashed var(--border)}
.ip-card .ip-x-cols{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.ip-card .ip-x-cols.two{grid-template-columns:repeat(2,minmax(0,1fr));max-width:560px}
.ip-card .ip-x-foot{display:flex;align-items:center;gap:8px}
@media (max-width:900px){.ip-card .ip-x-cols{grid-template-columns:1fr}}

/* the head and the rows share the same fixed columns, so the titles sit exactly above the cells */
.ip-card .ip-head,.ip-card .ip-row{grid-template-columns:34px minmax(180px,1.6fr) 100px 150px 120px minmax(200px,2fr) 170px}
.ip-card .ip-act{justify-content:flex-start}
.ip-card .ip-badge{text-align:center}

/* the same list design on topics, hashtags and exceptions: the columns come from --cols of the list */
.ip-card.cols .ip-head,.ip-card.cols .ip-row{grid-template-columns:var(--cols);gap:14px}
.ip-card.cols .ip-row{grid-template-areas:none}
.ip-card.cols .ip-row.off{opacity:.7}
.ip-card.cols .ip-act{justify-content:flex-end}
@media (max-width:1100px){.ip-card.cols .ip-head{display:none}.ip-card.cols .ip-row{display:flex;flex-wrap:wrap;align-items:center}.ip-card.cols .ip-name{flex:1 1 240px}}
.ip-card.cols .ip-row>*{grid-area:auto!important}
.ip-card.cols .ip-row .ip-num,.ip-card.cols .ip-row .ip-c-st,.ip-card.cols .ip-row .ip-c-mode{text-align:start}

/* sources table: the actions wrap into two tidy rows inside their column (no overflow past the edge of the card) */
@media (min-width: 861px) {
  .rtable.fixed col:last-child { width: 188px !important; }
  .rtable.fixed td.c-act { white-space: normal; word-spacing: 0; display: table-cell; }
  .rtable.fixed td.c-act .act-wrap { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-start; }
}
.sec-filters select, [data-src-region], [data-src-sort] { min-width: 170px; max-width: 220px; text-overflow: ellipsis; }

/* the profile title: the name in every language, one size, on one line when it fits */
.ent-names { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .3em; line-height: 1.25; }
.ent-names .ent-sep { opacity: .4; font-weight: 400; }
.ent-akas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ent-akas li { display: flex; align-items: baseline; gap: 8px; }
.ent-akas .chip.lang { font-size: .7rem; min-width: 30px; justify-content: center; }

/* dashboard: sections, AI panel, translations, data tiles */
.dash-sec { margin-block: 22px 8px; } .dash-sh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; } .dash-sh h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.dash-st { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0; } .dash-st b { font-size: 1.35rem; line-height: 1.15; font-variant-numeric: tabular-nums; } .dash-st span { color: var(--muted); font-size: .8rem; }
.dash-st.warn b { color: var(--st-pending); } .dash-st.bad b { color: var(--st-rejected); }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.dash-src h3, .dash-ai h3 { margin: 0 0 8px; font-size: .86rem; color: var(--muted); font-weight: 600; }
.dash-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dash-ai-head > .badge { font-size: .9rem; padding: 6px 14px; }
.dash-ai-q { display: grid; grid-template-columns: repeat(5, minmax(96px, 1fr)); gap: 8px; flex: 1 1 460px; }
.dash-ai-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.dash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; } .dash-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); } .dash-list li:last-child { border-bottom: 0; } .dash-list .grow { min-width: 0; overflow-wrap: anywhere; }
.dash-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex: 0 0 auto; } .dash-dot.ok { background: var(--st-published); } .dash-dot.bad { background: var(--st-rejected); } .dash-dot.off { background: var(--muted); opacity: .5; } .dash-dot.idle { background: var(--st-pending); opacity: .7; }
.dash-trs { padding-block: 6px; }
.dash-tr { display: grid; grid-template-columns: minmax(150px, 1.1fr) repeat(3, minmax(120px, 1fr)); gap: 18px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--border); } .dash-tr:last-child { border-bottom: 0; }
.dash-tr-n { display: flex; flex-direction: column; gap: 2px; }
.dash-tr-c { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .dash-tr-c .bar { height: 8px; } .dash-tr-c .bar i.low { background: var(--st-rejected); } .dash-tr-c .bar i.full { background: var(--st-published); }
@media (max-width: 820px) { .dash-ai-q { grid-template-columns: repeat(2, 1fr); } .dash-tr { grid-template-columns: 1fr 1fr 1fr; } .dash-tr-n { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; } }

.dash-upd { display: inline-flex; align-items: center; gap: 10px; margin-inline-start: auto; } #sys.loading { opacity: .55; transition: opacity .15s; }
.dash-dot.limited { background: var(--st-pending); }
.dash-ai-head > .badge { max-width: 100%; white-space: normal; }
.sys-link { text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; } .sys-link:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgb(0 0 0 / .08); }

/* dashboard tiles: a rounded card with a coloured edge on the side, the figures in the middle */
.dash-st, .sys-card { --c: var(--primary); border-inline-start: 4px solid var(--c); border-radius: 14px; text-align: center; }
.dash-st { align-items: center; justify-content: center; padding: 14px 12px; gap: 4px; }
.dash-st b { font-size: 1.6rem; } .dash-st span { font-size: .82rem; }
.dash-st.warn { --c: var(--st-pending); } .dash-st.bad { --c: var(--st-rejected); } .dash-st.ok { --c: var(--st-published); }
.sys-card { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 14px; }
.sys-card:has(.sys-ok) { --c: var(--st-published); } .sys-card:has(.sys-warn) { --c: var(--st-pending); } .sys-card:has(.sys-bad) { --c: var(--st-rejected); }
.sys-card .sys-sub { text-align: center; overflow-wrap: anywhere; }

.ent-filters [data-src-status], .ent-filters [data-src-type], .ent-filters [data-src-lang], .ent-filters [data-src-region], .ent-filters [data-src-sort] { flex: 1 1 150px; min-width: 130px; max-width: 220px; }
.ent-filters.src-filters { flex-wrap: wrap !important; }

/* sources: the status and the exposure stacked in one column; a long status wraps inside it */
.rtable.fixed td[data-l] .badge { white-space: normal; text-align: center; max-width: 100%; line-height: 1.3; }
.rtable.fixed .src-expo { margin-top: 5px; }
/* the address of a source is English (left-to-right text) but sits on the same side as the name */
html[dir="rtl"] .c-url { text-align: right; } html[dir="ltr"] .c-url { text-align: left; }
html[dir="rtl"] .rtable .src-row-t .c-url { text-align: right !important; unicode-bidi: isolate; } html[dir="rtl"] .rtable .src-row-t { flex: 1 1 auto; }

/* map: the layers that are off stay readable (solid surface, dark text, the colour of their marker); on = filled */
.map-layers .map-layer[aria-pressed="false"] { opacity: 1; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.map-layers .map-layer[aria-pressed="false"]:hover { border-color: var(--primary); }
.map-layers .map-layer[aria-pressed="true"] { opacity: 1; }
.map-layers .map-layer .ml-dot { flex: none; }

/* public profile: figures, main topics and countries inside the hero */
.pe-hero-card { grid-template-columns: auto 1fr; }
.pe-hero-desc { margin: 10px 0 0; color: var(--text); line-height: 1.6; max-width: 68ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pe-hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; } .pe-hero-row > .small { min-width: 7.5em; }
.pe-hero-row .chip b { margin-inline-start: 4px; opacity: .7; font-variant-numeric: tabular-nums; }
.pe-hero-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.pe-stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 6px 4px; } .pe-stat b { font-size: 1.5rem; line-height: 1.15; color: var(--primary); font-variant-numeric: tabular-nums; }

/* items as wide rows: the text across, a small picture at the end (the left side in Hebrew / Arabic) */
.pe-rows { display: flex; flex-direction: column; gap: 10px; }
.item-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px 12px 14px; padding-inline-start: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: inherit; text-decoration: none; transition: box-shadow .15s, border-color .15s; }
.item-row:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgb(0 0 0 / .08); } .item-row.picked { box-shadow: 0 0 0 2px var(--primary); }
.item-row .card-pick, .item-row .card-edit { inset-block-start: 10px; } .item-row .card-edit { inset-block-start: 46px; }
.ir-t { min-width: 0; display: flex; flex-direction: column; gap: 4px; } .ir-t h3 { margin: 0; font-size: 1rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ir-t p { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ir-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 2px; } .ir-foot .card-tags { margin: 0; }
.ir-img { width: 112px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--surface-2, #eef2f0); }
@media (max-width: 560px) { .item-row { grid-template-columns: minmax(0, 1fr); } .ir-img { order: -1; width: 100%; height: 150px; } }
/* public profile on a phone: the hero stacks, the figures wrap, the rows keep their picture on top */
@media (max-width: 860px) { .pe-hero-card { grid-template-columns: auto 1fr; gap: 14px; padding: 16px; } .pe-hero-stats { grid-template-columns: repeat(3, 1fr); } .pe-hero-row > .small { min-width: 0; width: 100%; } }
@media (max-width: 560px) { .pe-hero-card { grid-template-columns: 1fr; text-align: start; } .pe-hero-av { justify-self: center; } .pe-hero-stats { grid-template-columns: repeat(2, 1fr); } .item-row { padding-inline-start: 14px; } .item-row .card-pick { inset-block-start: 8px; z-index: 3; } .item-row .card-edit { inset-block-start: 8px; inset-inline-start: 46px; } }
/* the profile hero: English lines (a role, a description) sit on the same side as the name in an RTL page, not pushed to the other edge */
html[dir="rtl"] .pe-hero-t [dir="auto"], html[dir="rtl"] .pe-hero-t .pe-role { text-align: right; unicode-bidi: isolate; }
html[dir="ltr"] .pe-hero-t [dir="auto"], html[dir="ltr"] .pe-hero-t .pe-role { text-align: left; }

/* pager: previous / numbered pages / next, with "showing 1-100 of N" */
.pager { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 20px 0 8px; }
.pg-btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.pg-btn { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; box-shadow: 0 1px 2px rgb(0 0 0 / .05); transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.pg-btn:hover:not(:disabled):not(.on) { border-color: var(--primary); color: var(--primary); } .pg-btn:active:not(:disabled) { transform: scale(.97); }
.pg-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .18); cursor: default; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; } .pg-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pg-nav { padding-inline: 16px; gap: 6px; } .pg-gap { padding: 0 4px; color: var(--muted); }
@media (max-width: 560px) { .pg-btn { min-width: 36px; height: 36px; padding: 0 9px; } .pg-nav { padding-inline: 12px; } }

/* the profile: previous / next entity on each side of the way back to the gallery (all kinds, in the order of the gallery) */
.pe-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 12px; }
.pe-nav .pe-step { min-width: 0; max-width: 100%; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding-inline: 14px; }
.pe-nav .pe-step.prev { justify-self: start; } .pe-nav .pe-step.next { justify-self: end; }
.pe-step-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pe-arr { font-size: 1.3rem; line-height: 1; flex: none; }
.pe-nav .pe-back { justify-self: center; height: 40px; }
@media (max-width: 640px) { .pe-nav { grid-template-columns: auto 1fr auto; } .pe-step-n { display: none; } .pe-nav .pe-step { width: 44px; padding: 0; justify-content: center; } }

/* admin profile: the same hero as the public one; the name on one line, the quick-edit buttons keep their look */
.ent-hero h1 { margin: 6px 0 2px; } .ent-hero .ent-quick { vertical-align: middle; } .ent-hero .pe-role .ent-quick { font-weight: 600; color: var(--primary); }

/* ================= the editors (wide windows): a header, a body of cards in two columns, a footer that stays ================= */
.modal.wide { width: min(1040px, 100%); max-height: 94vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; position: relative; }
.modal.wide > h2, .modal.wide > .row-flex:first-of-type { margin: 0; padding: 18px 64px 14px 26px; padding-inline: 26px 64px; border-bottom: 1px solid var(--border); background: var(--surface); font-size: 1.2rem; flex: none; }
.modal.wide > h2 { display: block; }
.modal.wide > .row-flex:first-of-type { gap: 12px; align-items: center; }
.modal.wide > form, .modal.wide > .form { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 26px 0; }
.modal.wide > p.small { padding: 10px 26px 0; margin: 0; }
.modal-x { position: absolute; inset-block-start: 12px; inset-inline-end: 14px; z-index: 5; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s, color .15s; }
.modal-x:hover { background: var(--surface-2, #eef2f0); color: var(--text); } .modal-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.modal.wide .ent-form, .modal.wide > form.ent-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-content: start; max-height: none; overflow-y: auto; padding-inline-end: 26px; }
.modal.wide .ent-form > * { min-width: 0; }
.modal.wide .ent-form > .ent-sec.full, .modal.wide .ent-form > .ent-aibar, .modal.wide .ent-form > .ent-full, .modal.wide .ent-form > .modal-foot, .modal.wide .ent-form > #si-wrap, .modal.wide .ent-form > .notice { grid-column: 1 / -1; }
.modal.wide .ent-aibar { position: static; border: 0; padding: 0; background: transparent; }
.modal.wide .ent-sec { position: relative; align-content: start; gap: 12px; padding: 16px 18px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.modal.wide .ent-sec > h3 { margin: 0 0 2px; padding-inline-start: 10px; border-inline-start: 3px solid var(--primary); font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.modal.wide .ent-sec fieldset { border: 0 !important; padding: 0 !important; margin: 0; } .modal.wide .ent-sec legend { display: none; }
/* the fields: label above, a comfortable control */
.modal.wide .f > span, .modal.wide .field > span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.modal.wide input:not([type=checkbox]):not([type=radio]):not([type=range]), .modal.wide select, .modal.wide textarea { min-height: 40px; border-radius: 10px; padding-inline: 12px; width: 100%; }
.modal.wide input:focus-visible, .modal.wide select:focus-visible, .modal.wide textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.modal.wide .cols2, .modal.wide .cols2.c3 { gap: 12px; }
.modal.wide .check { min-height: 32px; }
.modal.wide .modal-foot { position: sticky; bottom: 0; margin: 4px -26px 0; padding: 14px 26px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 14px rgb(0 0 0 / .05); display: flex; gap: 10px; justify-content: flex-end; align-items: center; z-index: 4; grid-column: 1 / -1; }
.modal.wide .modal-foot .btn { height: 42px; padding-inline: 20px; } .modal.wide .modal-foot .btn.danger { margin-inline-end: auto; }
.modal.wide .modal-foot .btn.primary { min-width: 120px; }
@media (max-width: 820px) { .modal-wrap { padding: 0; } .modal.wide { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; } .modal.wide .ent-form, .modal.wide > form.ent-form { grid-template-columns: 1fr; } .modal.wide > form, .modal.wide > .form { padding: 16px 16px 0; } .modal.wide .modal-foot { margin-inline: -16px; padding-inline: 16px; } .modal.wide > h2, .modal.wide > .row-flex:first-of-type { padding-inline: 16px 60px; } }

/* ================= every other form window: the same header / body / footer ================= */
.modal:not(.wide):has(> form) { width: min(680px, 100%); max-height: 92vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; position: relative; }
.modal:not(.wide):has(> form) > h2, .modal:not(.wide):has(> form) > .row-flex:first-of-type { margin: 0; padding: 18px 64px 14px 26px; padding-inline: 26px 64px; border-bottom: 1px solid var(--border); background: var(--surface); font-size: 1.15rem; flex: none; }
.modal:not(.wide):has(> form) > p.small { padding: 10px 26px 0; margin: 0; }
.modal:not(.wide):has(> form) > form { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 26px 0; gap: 14px; }
.modal:not(.wide):has(> form) .f > span, .modal:not(.wide):has(> form) .field > span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.modal:not(.wide):has(> form) input:not([type=checkbox]):not([type=radio]):not([type=range]), .modal:not(.wide):has(> form) select, .modal:not(.wide):has(> form) textarea { min-height: 40px; border-radius: 10px; padding-inline: 12px; width: 100%; }
.modal:not(.wide):has(> form) fieldset { border: 1px solid var(--border) !important; border-radius: 12px !important; padding: 12px 14px !important; }
.modal:not(.wide):has(> form) .modal-foot { position: sticky; bottom: 0; margin: 4px -26px 0; padding: 14px 26px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 14px rgb(0 0 0 / .05); display: flex; gap: 10px; justify-content: flex-end; align-items: center; z-index: 4; }
.modal:not(.wide):has(> form) .modal-foot .btn { height: 42px; padding-inline: 20px; } .modal:not(.wide):has(> form) .modal-foot .btn.danger { margin-inline-end: auto; }
@media (max-width: 640px) { .modal:not(.wide):has(> form) { width: 100%; max-height: 100vh; border-radius: 14px; } .modal:not(.wide):has(> form) > form { padding-inline: 16px; } .modal:not(.wide):has(> form) .modal-foot { margin-inline: -16px; padding-inline: 16px; } }
.ent-link-add { position: relative; } .ent-link-res { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 30; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgb(0 0 0 / .18); padding: 4px; }
.ent-link-res .ep-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; padding: 8px 10px; border-radius: 8px; } .ent-link-res .ep-opt:hover, .ent-link-res .ep-opt:focus-visible { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.ent-link-res .ep-opt .small { margin-inline-start: auto; }

/* the entity editor inside the page (not a window): the cards of the profile are replaced by the same sections as a form */
.ent-editing .masonry { display: none; } .ent-editing .pe-hero-stats { display: none; }
.ent-inline-editor:empty { display: none; }
.ent-inline-editor { margin-block: 14px; }
.ent-inline-editor > h2 { margin: 0 0 14px; font-size: 1.2rem; }
.ent-inline-editor .ent-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-content: start; max-height: none; overflow: visible; padding: 0; }
.ent-inline-editor .ent-form > * { min-width: 0; }
.ent-inline-editor .ent-form > .ent-sec.full, .ent-inline-editor .ent-form > .ent-aibar, .ent-inline-editor .ent-form > .modal-foot { grid-column: 1 / -1; }
.ent-inline-editor .ent-aibar { position: static; border: 0; padding: 0; background: transparent; }
.ent-inline-editor .ent-sec { align-content: start; gap: 12px; padding: 16px 18px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .04); scroll-margin-top: 90px; }
.ent-inline-editor .ent-sec > h3 { margin: 0 0 2px; padding-inline-start: 10px; border-inline-start: 3px solid var(--primary); font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.ent-inline-editor .ent-sec fieldset { border: 0 !important; padding: 0 !important; margin: 0; } .ent-inline-editor .ent-sec legend { display: none; }
.ent-inline-editor .f > span, .ent-inline-editor .field > span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.ent-inline-editor input:not([type=checkbox]):not([type=radio]), .ent-inline-editor select, .ent-inline-editor textarea { min-height: 40px; border-radius: 10px; padding-inline: 12px; width: 100%; }
.ent-inline-editor .modal-foot { position: sticky; bottom: 0; z-index: 6; display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 18px; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 -6px 18px rgb(0 0 0 / .08); }
.ent-inline-editor .modal-foot .btn { height: 42px; padding-inline: 20px; } .ent-inline-editor .modal-foot .btn.primary { min-width: 120px; }
@media (max-width: 820px) { .ent-inline-editor .ent-form { grid-template-columns: 1fr; } }
.card h2:has(.card-ed) { display: flex; align-items: center; gap: 8px; } .card-ed { margin-inline-start: auto; }

/* ================= the editor in the page ================= */
.page-editing #view > *:not(#page-editor):not(.art-bar) { display: none !important; }
.page-editor { margin-block: 8px 24px; }
.page-editor > h2, .page-editor > .row-flex:first-child { margin: 0 0 14px; font-size: 1.3rem; display: flex; align-items: center; gap: 12px; }
.page-editor:not(:has(.ent-form)) > form { max-width: 780px; margin-inline: auto; padding: 22px 24px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 3px rgb(0 0 0 / .05); }
.page-editor:not(:has(.ent-form)) > h2, .page-editor:not(:has(.ent-form)) > .row-flex:first-child, .page-editor:not(:has(.ent-form)) > p.small { max-width: 780px; margin-inline: auto; }
.page-editor:not(:has(.ent-form)) .modal-foot { margin: 8px -24px 0; border-radius: 0 0 16px 16px; border-inline: 0; border-bottom: 0; }
.page-editor .modal-foot { position: sticky; bottom: 0; }
/* the lists of choices: pills, a tick when chosen */
.ent-sec label.check:has(input[type=checkbox]), .page-editor label.check:has(input[type=checkbox]) { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .88rem; line-height: 1.3; min-height: 34px; transition: background-color .15s, border-color .15s, color .15s; }
.ent-sec label.check input[type=checkbox], .page-editor label.check input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ent-sec label.check:has(input[type=checkbox]):hover, .page-editor label.check:has(input[type=checkbox]):hover { border-color: var(--primary); }
.ent-sec label.check:has(input[type=checkbox]:checked), .page-editor label.check:has(input[type=checkbox]:checked) { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.ent-sec label.check:has(input[type=checkbox]:checked)::before, .page-editor label.check:has(input[type=checkbox]:checked)::before { content: "✓"; font-size: .8rem; }
.ent-sec label.check:has(input[type=checkbox]:focus-visible), .page-editor label.check:has(input[type=checkbox]:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.pick-grid { gap: 8px !important; }
/* the three languages of an item, side by side */
.art-lang { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface-2, var(--surface)) 40%, var(--surface)); min-width: 0; } .art-lang.orig { border-color: var(--primary); }
.art-lang-h { display: flex; align-items: center; gap: 8px; }
@media (max-width: 980px) { .art-langs { grid-template-columns: 1fr; } }

/* identity: the kind is a narrow field next to the three names; the aliases are a short box under the names */
.ent-sec[data-sec="identity"] { grid-template-columns: minmax(130px, 190px) minmax(0, 1fr); column-gap: 16px; align-items: start; }
.ent-sec[data-sec="identity"] > h3, .ent-sec[data-sec="identity"] > .small, .ent-sec[data-sec="identity"] > .ent-aibar { grid-column: 1 / -1; }
.ent-sec[data-sec="identity"] > label.f:first-of-type { grid-column: 1; grid-row: 2; }
.ent-sec[data-sec="identity"] > .cols2 { grid-column: 2; grid-row: 2; }
.ent-sec[data-sec="identity"] > label.f:last-of-type:not(:first-of-type) { grid-column: 2; max-width: 520px; }
.ent-sec[data-sec="identity"] textarea[name="aliases"] { min-height: 38px; max-height: 96px; }
@media (max-width: 720px) { .ent-sec[data-sec="identity"] { grid-template-columns: 1fr; } .ent-sec[data-sec="identity"] > label.f:first-of-type, .ent-sec[data-sec="identity"] > .cols2, .ent-sec[data-sec="identity"] > label.f:last-of-type:not(:first-of-type) { grid-column: 1; grid-row: auto; max-width: none; } }
/* the editor in the page: not wider than it needs */
.page-editor .ent-form, .ent-inline-editor .ent-form { max-width: 1120px; margin-inline: auto; }
.ent-inline-editor > h2 { max-width: 1120px; margin-inline: auto; }

/* the entity editor: six columns; tags, classification and links side by side on one row, the rest in halves */
.ent-inline-editor .ent-form, .modal.wide .ent-form { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ent-inline-editor .ent-form > .ent-sec, .modal.wide .ent-form > .ent-sec { grid-column: span 3; }
.ent-inline-editor .ent-form > .ent-sec.full, .modal.wide .ent-form > .ent-sec.full { grid-column: 1 / -1; }
.ent-inline-editor .ent-form > .ent-sec[data-sec="tags"], .ent-inline-editor .ent-form > .ent-sec[data-sec="class"], .ent-inline-editor .ent-form > .ent-sec[data-sec="links"],
.modal.wide .ent-form > .ent-sec[data-sec="tags"], .modal.wide .ent-form > .ent-sec[data-sec="class"], .modal.wide .ent-form > .ent-sec[data-sec="links"] { grid-column: span 2; }
@media (max-width: 1180px) { .ent-inline-editor .ent-form > .ent-sec[data-sec="tags"], .ent-inline-editor .ent-form > .ent-sec[data-sec="class"], .ent-inline-editor .ent-form > .ent-sec[data-sec="links"], .modal.wide .ent-form > .ent-sec[data-sec="tags"], .modal.wide .ent-form > .ent-sec[data-sec="class"], .modal.wide .ent-form > .ent-sec[data-sec="links"] { grid-column: span 3; } }
@media (max-width: 820px) { .ent-inline-editor .ent-form, .modal.wide .ent-form { grid-template-columns: 1fr; } .ent-inline-editor .ent-form > .ent-sec, .modal.wide .ent-form > .ent-sec, .ent-inline-editor .ent-form > .ent-sec[data-sec], .modal.wide .ent-form > .ent-sec[data-sec] { grid-column: 1 / -1; } }

#ps-hdr .chip { margin-inline-end: 4px; }

.ps-lbl { margin-bottom: 6px; } .ps-help { margin: 0 0 14px; max-width: 900px; }
#ps-prev table { width: 100%; } #ps-prev .tbl-wrap, #ps-prev { overflow-x: auto; }

/* a three-state choice (no change / add / remove) in the bulk editor */
.ent-sec label.check:has(input[data-tri]), .page-editor label.check:has(input[data-tri]) { border-style: dashed; color: var(--muted); }
.page-editor label.check:has(input[data-tri][data-state="1"]) { border-style: solid; border-color: var(--st-published); color: var(--st-published); background: color-mix(in srgb, var(--st-published) 12%, var(--surface)); font-weight: 600; }
.page-editor label.check:has(input[data-tri][data-state="1"])::before { content: "✓"; }
.page-editor label.check:has(input[data-tri][data-state="2"]) { border-style: solid; border-color: var(--st-rejected); color: var(--st-rejected); background: color-mix(in srgb, var(--st-rejected) 10%, var(--surface)); font-weight: 600; text-decoration: line-through; }
.page-editor label.check:has(input[data-tri][data-state="2"])::before { content: "✕"; text-decoration: none; display: inline-block; }
.page-editor label.check:has(input[data-tri][data-state="2"]:checked)::before { content: "✕"; }

/* the access section of the bulk editor: the same segmented switch and full-width toggles as the single editor */
.pick-col { display: grid; gap: 8px; } .pick-col > label.check { display: flex !important; width: 100%; justify-content: center; min-height: 40px; border-radius: 12px !important; }
.page-editor label.check:has(input[data-tri][data-state="0"])::after { content: " · " attr(data-none); }

#ps-prev td:last-child, #ps-prev th:last-child { min-width: 150px; } #ps-prev .badge { white-space: normal; }
.chip-btn.zero { opacity: .65; } .chip-btn.zero[aria-pressed="true"] { opacity: 1; }

/* four names (he, ar, en, fa) in a row */
.cols2.names4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } @media (max-width: 980px) { .cols2.names4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ip-x-cols { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* the preview of pasted sources: the type column is wide enough to read, the rows are tidy */
#ps-prev table { table-layout: auto; border-collapse: separate; border-spacing: 0; } #ps-prev th { text-align: start; font-size: .78rem; color: var(--muted); padding: 6px 10px; white-space: nowrap; } #ps-prev td { padding: 8px 10px; vertical-align: middle; border-top: 1px solid var(--border); }
#ps-prev td select[data-k="type"] { min-width: 120px; } #ps-prev td select[data-k="region"] { min-width: 130px; } #ps-prev td input[data-k="entityName"] { min-width: 150px; } #ps-prev td input[data-k="name"] { min-width: 190px; }
#ps-prev .badge { white-space: nowrap; }

.dormant-q { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; border-inline-start: 4px solid var(--st-pending); }

/* the link to the source of an item: always visible, in the list, on the card and on the page */
.src-open { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; align-self: center; font-weight: 600; color: var(--primary); }
.src-open:hover { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-src { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--primary); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; } .card-src:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.src-url { max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item-pics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; margin-top: 10px; }
.item-pics img { width: 100%; height: auto; max-height: 520px; object-fit: contain; border-radius: 10px; background: var(--surface-2, var(--surface)); }
.chip.src-kind { display: inline-flex; align-items: center; gap: 4px; }
.ent-chip.account { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }

.ent-ini { overflow: hidden; line-height: 1; display: inline-flex; align-items: center; justify-content: center; text-overflow: clip; white-space: nowrap; }
.pe-ini, .rav { overflow: hidden; line-height: 1; }
.lk-cube { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; margin-top: 8px; }
.lk-tile { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; transition: border-color .15s, background-color .15s; }
.lk-tile:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.lk-ic { flex: none; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.lk-tile[data-net="instagram"] .lk-ic { background: #fce7f3; color: #be185d; } .lk-tile[data-net="facebook"] .lk-ic { background: #dbeafe; color: #1d4ed8; } .lk-tile[data-net="telegram"] .lk-ic { background: #e0f2fe; color: #0369a1; } .lk-tile[data-net="tiktok"] .lk-ic { background: #e5e7eb; color: #111; } .lk-tile[data-net="youtube"] .lk-ic { background: #fee2e2; color: #b91c1c; } .lk-tile[data-net="x"] .lk-ic { background: #e5e7eb; color: #111; }
.lk-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; } .lk-t b { font-size: .88rem; } .lk-t span { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-info .lk-cube { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }

.role-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.role { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .86rem; text-decoration: none; cursor: default; }
.role.ent { background: #ede9fe; border-color: #c4b5fd; color: #4c1d95; } .role.src { background: #dbeafe; border-color: #93c5fd; color: #1e3a8a; }
a.role, button.role { cursor: pointer; } .role.none { color: var(--muted); border-style: dashed; }
.lk-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lk-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: .74rem; cursor: pointer; color: var(--muted); }
.lk-badge.on { background: #dcfce7; border-color: #86efac; color: #166534; } .lk-badge.off { background: #fef3c7; border-color: #fcd34d; color: #92400e; } .lk-badge.add { color: var(--primary); border-color: var(--primary); } .lk-badge.none { cursor: default; border-style: dashed; }

.badge.src-badge { cursor: pointer; background: #dbeafe; border: 1px solid #93c5fd; color: #1e3a8a; font: inherit; font-size: .75rem; }

.cls-card .cls-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.cls-card .cls-row > .small { min-width: 54px; } .cls-more { margin-top: 8px; } .cls-more summary { cursor: pointer; } .cls-more > div { padding: 2px 0; }

/* the profile of a source */
.sp-hero .pe-hero-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.sp-av { position: relative; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #000)); color: #fff; font-weight: 800; font-size: 2.6rem; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.sp-av i { font-style: normal; } .sp-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sp-telegram { background: linear-gradient(135deg, #2aabee, #1b6ea8); } .sp-x { background: linear-gradient(135deg, #222, #000); } .sp-facebook { background: linear-gradient(135deg, #1877f2, #0d47a1); } .sp-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); } .sp-tiktok { background: linear-gradient(135deg, #25f4ee, #fe2c55); } .sp-youtube { background: linear-gradient(135deg, #ff4e45, #b91c1c); } .sp-web, .sp-rss { background: linear-gradient(135deg, #0f766e, #134e4a); }
.badge.role-src { background: #dbeafe; border: 1px solid #93c5fd; color: #1e3a8a; } .badge.role-ent { background: #ede9fe; border: 1px solid #c4b5fd; color: #4c1d95; text-decoration: none; } .badge.none { border-style: dashed; color: var(--muted); }
.sp-pulse { width: 100%; height: 72px; display: block; } .sp-pulse rect.on { fill: var(--primary); } .sp-pulse rect.off { fill: var(--border); }
.sp-trend { margin-top: 12px; } .sp-line { width: 100%; height: 56px; stroke: var(--accent, var(--primary)); } .sp-trend .up { color: #15803d; } .sp-trend .down { color: #b91c1c; }
.sp-grade { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; padding: 1px 8px; border-radius: 8px; font-weight: 800; color: #fff; background: #64748b; }
.sp-g-a { background: #15803d; } .sp-g-b { background: #65a30d; } .sp-g-c { background: #ca8a04; } .sp-g-d { background: #ea580c; } .sp-g-e, .sp-g-f { background: #b91c1c; }
/* a long item title wraps inside the page instead of running past its edge */
.page-head > div:first-child { min-width: 0; max-width: 100%; }
.page-head h1, .page-head h1[lang] { display: block; white-space: normal; overflow-wrap: anywhere; word-break: normal; text-wrap: balance; font-size: clamp(1.1rem, 1.2vw + .8rem, 1.55rem); line-height: 1.4; max-width: 100%; }

details.fold > summary { cursor: pointer; color: var(--primary); padding: 6px 0; list-style: none; font-weight: 600; } details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸ "; } details.fold[open] > summary::before { content: "▾ "; }
.fold-li { list-style: none; display: block !important; } .fold-li ul { margin: 0; padding: 0; }

img.is-logo { object-fit: contain !important; padding: 10px; background: var(--surface-2); }
.logo-ph { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #000)); border-radius: 10px; }
.logo-ph[data-net="telegram"] { background: linear-gradient(135deg, #2aabee, #1b6ea8); } .logo-ph[data-net="x"] { background: #111; } .logo-ph[data-net="facebook"] { background: #1877f2; } .logo-ph[data-net="instagram"] { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); } .logo-ph[data-net="youtube"] { background: #dc2626; } .logo-ph[data-net="web"], .logo-ph[data-net="rss"] { background: #0f766e; }
.card-thumb.logo-ph, .ir-img.logo-ph { width: 100%; min-height: 84px; }

/* the pictures of the article page: one row of equal tiles under the item, not a giant picture */
.article-compact > .item-media { grid-column: 1 / -1; }
.item-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 8px; margin-top: 8px; }
.item-pics a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); }
.item-pics img { width: 100%; height: 100%; max-height: none; object-fit: cover; border-radius: 0; transition: transform .2s; } .item-pics a:hover img { transform: scale(1.04); }
.art-source:has(.share-btns) { margin-bottom: 6px; } .article-compact .art-full { margin-top: 10px; }
/* the item page scrolls as a page: no scrollbar inside the card */
body.art-page { overflow: auto; }
body.art-page #app { height: auto; min-height: 100dvh; display: block; }
body.art-page main, body.art-page .pub-wrap { display: block; min-height: 0; flex: none; }
body.art-page .article-compact { max-height: none !important; overflow: visible !important; flex: none; }
body.art-page .pub-head { position: sticky; top: 0; z-index: 20; }

/* the item head: details, then the share row, then the title; the source link is a neat rounded box */
.art-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; padding: 6px 10px; border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); border: 1px solid var(--border); }
.art-actions .share-btns { flex-wrap: wrap; }
.src-box { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); font-weight: 600; font-size: .84rem; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.src-box:hover { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); border-color: var(--primary); }
.art-source:not(:has(.share-btns)) { display: none; }

.article-compact .art-media img.is-logo { object-fit: contain; padding: 22px; background: color-mix(in srgb, var(--primary) 7%, var(--surface-2)); }
.article-compact .art-media .logo-ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 172px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 10%, var(--surface-2)); }
.logo-ph svg { max-width: 60%; height: auto; }
.logo-ph[data-net] { background: color-mix(in srgb, var(--primary) 10%, var(--surface-2)); }
/* a picture is never cropped: the whole of it shows, centred in its box, wherever it is shown */
.card-thumb, .ir-img, .mini-card img, .article-compact .art-media img, .item-thumb, .item-photo, .item-pics img, .art-media img, .map-pop img, .ent-ment img, .src-info > img { object-fit: contain !important; object-position: center center; background: var(--surface-2); }
.article-compact .art-media img { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.item-pics a:hover img { transform: none; }

.share-btns.no-native .sh-btn.native { display: none; }
.art-actions .src-box { margin-inline-start: auto; }
/* the picture uses the height of the text beside it: a tall picture grows instead of leaving empty space */
.article-compact { grid-template-columns: minmax(240px, 300px) 1fr; }
.article-compact .art-media { align-self: stretch; display: flex; }
.article-compact .art-media img, .article-compact .art-media .logo-ph { height: auto; min-height: 172px; flex: 1 1 auto; align-self: stretch; }
@media (max-width: 760px) { .article-compact { grid-template-columns: 1fr; } .article-compact .art-media { display: block; } .article-compact .art-media img, .article-compact .art-media .logo-ph { height: 220px; } }

/* the head of an item: one row each for countries, topics, source, code and date; the picture is the same size for every item */
.art-meta-rows { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.art-meta-rows .mrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.art-meta-rows .mrow:empty { display: none; }
.article-compact { grid-template-columns: 340px minmax(0, 1fr); }
.article-compact .art-media { align-self: start; display: block; width: 340px; height: 440px; }
.article-compact .art-media img, .article-compact .art-media .logo-ph { width: 100%; height: 100%; min-height: 0; }
@media (max-width: 860px) { .article-compact { grid-template-columns: 1fr; } .article-compact .art-media { width: 100%; height: 280px; } }

/* the public map: the map fills the page under the header, the feed is beside it (on the far side of the reading direction), the periods under the feed */
body.map-page { overflow: hidden; }
body.map-page #app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
body.map-page .pub-head { flex: none; }
body.map-page main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.map-page .foot { display: none; }
body.map-page .hero.slim { flex: none; }
.map-wrap { flex: 1; min-height: 0; display: flex; padding: 8px 12px 10px; }
.map-shell { flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(300px, 28vw, 400px) minmax(0, 1fr); gap: 10px; width: 100%; }
body.map-page .map-shell .map-box { height: 100%; min-height: 0; border-radius: 14px; }
.map-feed { min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.map-feed-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.map-feed-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }
.map-periods { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.mf-item { position: relative; } .mf-item .acard { margin: 0; }
.mf-loc { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 2; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--primary); cursor: pointer; box-shadow: 0 2px 8px rgb(0 0 0 / .15); }
.mf-loc:hover { background: var(--primary); color: #fff; }
@media (max-width: 860px) and (orientation: portrait) { .map-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr); } .map-shell .map-box { order: -1; } }
@media (max-height: 520px) and (orientation: landscape) { .map-shell { grid-template-columns: 260px minmax(0, 1fr); } .map-wrap { padding: 4px 8px 6px; } }
/* map page: readable period buttons, visible logo placeholder, compact region strip */
.map-periods .chip-btn { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 99px; padding: 5px 14px; font-weight: 600; min-width: 44px; }
.map-periods .chip-btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.map-count-pill { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.logo-ph, .logo-ph[data-net] { color: var(--primary); }
body.map-page .pub-regions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-block: 6px; }
body.map-page .pub-regions > * { flex: none; }
body.map-page .hero.slim .pub-wrap { padding-block: 4px; }
.map-feed .card-thumb, .map-feed .ir-img { height: 110px; }

/* the header never makes the page wider than the screen (phones) */
.pub-head .pub-mid, .pub-head .in { min-width: 0; }
.pub-head .pub-mid { max-width: 100%; }   /* the header container keeps its own width limit (1120px), the same as the list */
.pub-nav { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .pub-nav::-webkit-scrollbar { display: none; }
/* the region strip on the map page: no scroll bar, the chips wrap to the width (smaller, to take less height) */
body.map-page .pub-regions { flex-wrap: wrap; overflow: visible; gap: 5px; padding-block: 4px; }
body.map-page .pub-regions .chip-btn, body.map-page .pub-regions button { padding: 3px 10px; font-size: .8rem; min-height: 0; line-height: 1.5; }
/* the map keeps the width of the list pages (same container), so the cards look the same */
.map-wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding: 8px 20px 12px; box-sizing: border-box; }
@media (max-width: 560px) { .map-wrap { padding: 6px 10px 10px; } }
/* phones: a compact header (logo and language on one row, the menu under it, the filters in two columns), one swipeable row of countries */
@media (max-width: 600px) {
  .pub-head .in { padding: 6px 10px; gap: 6px; }
  .pub-row1.in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; }
  .pub-row1 .pub-brand small { display: none; } .pub-row1 .pub-brand svg { width: 32px; height: 32px; }
  .pub-row1 .pub-lang { justify-self: end; } .pub-row1 .pub-lang .btn { padding: 0 10px; height: 32px; font-size: .8rem; }
  .pub-row1 .pub-mid { grid-column: 1 / -1; width: 100%; min-width: 0; } .pub-row1 .pub-nav { width: 100%; }
  .pub-head-filters .layer-bar { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; } .pub-head-filters .layer-bar::-webkit-scrollbar { display: none; } .pub-head-filters .layer-bar > * { flex: none; }
  .pub-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .pub-filters > input[type="search"] { grid-column: 1 / -1; }
  .pub-filters > select, .pub-filters > details.multi, .pub-filters > details.multi > summary { width: 100%; max-width: none; min-width: 0; box-sizing: border-box; }
  .pub-regions { flex-wrap: nowrap !important; overflow-x: auto !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; } .pub-regions::-webkit-scrollbar { display: none; } .pub-regions > * { flex: none; }
  .hero.slim { min-height: 0; }
}

/* period buttons: in the header, under the layers */
.map-periods-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pub-head-filters .map-periods-row { width: 100%; }
@media (max-width: 600px) { .map-periods-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .map-periods-row::-webkit-scrollbar { display: none; } .map-periods-row > * { flex: none; } }
/* phones, second pass: logo and language on the same row, filters in one swipeable row */
@media (max-width: 600px) {
  .pub-row1.in > .pub-brand { grid-row: 1; grid-column: 1; }
  .pub-row1.in > .pub-lang { grid-row: 1; grid-column: 2; }
  .pub-row1.in > .pub-mid { grid-row: 2; grid-column: 1 / -1; }
  .pub-filters { display: flex !important; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 2px; } .pub-filters::-webkit-scrollbar { display: none; }
  .pub-filters > input[type="search"] { flex: 0 0 150px; min-width: 150px; } .pub-filters > select, .pub-filters > details.multi { flex: none; width: auto; }
  .pub-filters > select { max-width: 140px; }
}
@media (max-width: 600px) { .pub-head-filters .pub-filters { flex-wrap: nowrap !important; overflow-x: auto; flex: none; scrollbar-width: none; } .pub-head-filters .pub-filters::-webkit-scrollbar { display: none; } }

/* the map header has the structure of the list header: layers + filters on one row, the period buttons where the list has sort and amount */
.pub-filters .map-periods-row { margin-top: 0; width: auto; }

/* the map header like the list header: the layers with the period buttons under them on one side, the filters on the other */
.lp-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex: none; }
.lp-col .map-periods-row { margin-top: 0; flex-wrap: nowrap; }
.pub-head-filters:has(.lp-col) .pub-filters > input[type="search"] { flex: 1 1 260px; max-width: 340px; }
@media (max-width: 600px) { .lp-col { width: 100%; align-items: stretch; } .lp-col .layer-bar { align-self: stretch; } .lp-col .map-periods-row { overflow-x: auto; } }

/* the legend sits at the top of the feed beside the map, small and foldable */
.map-legend-d { flex: none; border-bottom: 1px solid var(--border); background: var(--surface-2); padding: 4px 10px; }
.map-legend-d > summary { cursor: pointer; font-size: .74rem; font-weight: 700; color: var(--muted); list-style: none; padding: 2px 0; } .map-legend-d > summary::-webkit-details-marker { display: none; } .map-legend-d > summary::before { content: "▸ "; } .map-legend-d[open] > summary::before { content: "▾ "; }
.map-legend.map-legend-in { position: static; display: flex; flex-wrap: wrap; gap: 4px 10px; background: none; backdrop-filter: none; box-shadow: none; padding: 2px 0 4px; margin: 0; font-size: .7rem; }
.map-legend-in i { width: 10px; height: 10px; }

/* the categories of sources the person defines */
.cats-strip { align-items: center; margin-top: 8px; } .cats-strip .cat-lbl { color: #fff; opacity: .85; font-weight: 700; margin-inline-end: 4px; } .cats-strip .btn { margin-inline-start: auto; }
.cat-chip { background: color-mix(in srgb, var(--accent, var(--primary)) 18%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent, var(--primary)) 40%, var(--border)); font-weight: 600; }
.cat-rows { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding-block: 4px; }
.cat-row { display: grid; grid-template-columns: 24px repeat(3, minmax(0, 1fr)) auto auto; gap: 6px; align-items: center; } .cat-n { color: var(--muted); font-weight: 700; text-align: center; }
@media (max-width: 640px) { .cat-row { grid-template-columns: 24px 1fr 1fr auto auto; } .cat-row input[data-cat-name="en"] { grid-column: 2 / 4; } }

.cat-rows, .cat-row { min-width: 0; max-width: 100%; box-sizing: border-box; }
.cat-row { grid-template-columns: 22px repeat(3, minmax(0, 1fr)) 34px 34px; }
.cat-row input, .cat-row .btn { min-width: 0; width: 100%; box-sizing: border-box; } .cat-row .btn { padding-inline: 0; }
@media (max-width: 640px) { .cat-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 34px 34px; } .cat-row input[data-cat-name="en"] { grid-column: 2 / 4; } }

.cat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; max-width: 100%; box-sizing: border-box; }
.cat-actions .btn { max-width: 100%; }
.modal .cat-rows + .cat-actions, .modal p.muted + .cat-rows { margin-inline: 0; }

.cat-mgr { padding: 6px 26px 14px; box-sizing: border-box; max-width: 100%; min-width: 0; overflow-x: hidden; }
.cat-mgr .cat-rows { padding-inline: 0; margin-inline: 0; padding-inline-end: 6px; }
.cat-mgr .cat-actions { margin: 12px 0 0; padding: 0; }

/* a settings card across the whole width of the page */
.set-wide { grid-column: 1 / -1; column-span: all; width: 100%; box-sizing: border-box; }

/* the categories page: rows across the page, no pop-up */
.cat-page { padding: 14px 18px 18px; }
.cat-page .cat-row { display: grid; grid-template-columns: 30px repeat(3, minmax(0, 1fr)) 120px 84px; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); }
.cat-page .cat-row.cat-th { border-bottom: 2px solid var(--border); color: var(--muted); font-size: .85rem; padding-bottom: 8px; }
.cat-page .cat-row input { width: 100%; min-width: 0; box-sizing: border-box; } .cat-page .cat-cnt { justify-self: start; }
.cat-page .cat-btns { display: inline-flex; gap: 6px; justify-content: flex-end; } .cat-page .cat-btns .btn { width: 36px; padding-inline: 0; }
.cat-page .cat-actions { margin-top: 14px; } .cat-page .cat-foot { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
@media (max-width: 820px) {
  .cat-page .cat-row.cat-th { display: none; }
  .cat-page .cat-row { grid-template-columns: 30px minmax(0, 1fr); padding: 10px 0; } .cat-page .cat-row input { grid-column: 2; } .cat-page .cat-cnt, .cat-page .cat-btns { grid-column: 2; justify-self: start; }
}

/* the settings centre */
.hub-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.hub-bar input[type="search"] { flex: 1 1 260px; max-width: 420px; }
.hub-nav { display: flex; flex-wrap: wrap; gap: 6px; } .hub-nav .chip-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.hub-group { margin-bottom: 22px; scroll-margin-top: 90px; } .hub-group h2 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin: 0 0 10px; }
.hub-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.hub-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; transition: border-color .15s, background-color .15s; }
.hub-item:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); } .hub-item[hidden], .hub-group[hidden] { display: none; }

/* phones, final pass: the filters are a tidy grid (search on its own row, two controls per row) instead of a row that is cut off */
@media (max-width: 600px) {
  .pub-head-filters .pub-filters, .pub-filters { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible !important; flex: none; width: 100%; }
  .pub-head-filters .pub-filters > input[type="search"], .pub-filters > input[type="search"] { grid-column: 1 / -1; flex: none; width: 100%; max-width: none; min-width: 0; min-height: 44px; box-sizing: border-box; }
  .pub-head-filters .pub-filters > select, .pub-head-filters .pub-filters > .multi, .pub-filters > select, .pub-filters > details.multi { width: 100%; max-width: none; min-width: 0; flex: none; min-height: 44px; box-sizing: border-box; }
  .pub-filters > details.multi > summary { min-height: 44px; display: flex; align-items: center; box-sizing: border-box; }
  .pub-head-filters:has(.lp-col) .pub-filters > input[type="search"] { max-width: none; }
  .pub-head .in.pub-head-filters { min-height: 0; display: block; }
  .pub-head-filters .layer-bar { margin-bottom: 8px; }
}

/* extra public pages (admin) and the code gate (public) */
.vw-card { margin-bottom: 12px; } .vw-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; } .vw-head h2 { margin: 0 0 2px; }
.vw-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; min-width: 0; } .vw-link code { overflow-wrap: anywhere; }
.vw-form { margin-top: 12px; display: grid; gap: 12px; } .vw-fs { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.vw-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; max-height: 220px; overflow: auto; } .vw-chk { display: flex; gap: 6px; align-items: center; min-height: 32px; }
.vw-chips, .vw-found { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 6px; }
.view-gate { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; text-align: center; display: grid; gap: 12px; } .view-gate form { display: flex; gap: 8px; } .view-gate input { flex: 1; min-width: 0; min-height: 44px; }

/* the list header has the frame of the map header: layers with a second row under them (sort + how many here, the period buttons on the map); the country strip is the same compact one everywhere */
.lp-col .map-periods-row > select { width: auto; max-width: 200px; min-height: 40px; }
.pub-regions { flex-wrap: wrap; gap: 5px; padding-block: 4px; }
.pub-regions .chip-btn, .pub-regions button { padding: 3px 10px; font-size: .8rem; min-height: 0; line-height: 1.5; }

/* phones: the map is the map (no list of items under it), and the search / filters are folded under one button */
.pf-toggle { display: none; }
@media (max-width: 600px) {
  .map-feed { display: none; }
  .map-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .pf-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-bottom: 6px; }
  .pub-head-filters:not(.pf-open) .pub-filters, .pub-head-filters:not(.pf-open) .sortper { display: none !important; }
  .pub-head .in.pub-head-filters { padding-block: 4px; }
}

/* phones: the map page scrolls (the header above can be long); the map itself is always tall enough to be used */
@media (max-width: 600px) {
  body.map-page { overflow: auto; }
  body.map-page #app { height: auto; min-height: 100dvh; }
  body.map-page main { min-height: 0; }
  body.map-page .map-wrap { flex: none; padding: 6px 8px 10px; }
  body.map-page .map-shell { flex: none; display: block; }
  body.map-page .map-shell .map-box { height: 72dvh; min-height: 420px; }
}

/* the map is the map, the list is the list: no feed of items beside the map on any screen */
.map-feed { display: none !important; }
.map-shell { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 1fr) !important; }

.tg-card { margin-bottom: 12px; } .tg-card .form { display: grid; gap: 10px; max-width: 420px; } .tg-warn { margin-bottom: 12px; } .tg-card input { min-height: 44px; }

.net-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 8px 0 14px; } .net-tile { display: grid; gap: 4px; padding: 12px 14px; min-height: 64px; text-decoration: none; color: inherit; } .net-tile.live { border-color: var(--primary); cursor: pointer; } .net-tile.soon { opacity: .6; }

.tg-dlg { max-height: 360px; overflow: auto; margin: 8px 0; border: 1px solid var(--border); border-radius: 10px; } .tg-dlg-row { display: flex; gap: 8px; align-items: center; padding: 8px 12px; min-height: 44px; border-bottom: 1px solid var(--border); } .tg-dlg-row.added { opacity: .6; } .tg-mine-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }

.cov-bar { display: grid; gap: 8px; margin: 8px 0; } .cov-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .cov-row input[type=search] { flex: 1 1 180px; min-width: 0; } .cov-card { overflow-x: auto; }

.net-tile { font: inherit; text-align: start; cursor: pointer; } .net-tile[aria-pressed=true] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }

.tg-acc { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; } .tg-acc.sel { border-color: var(--primary); } .tg-acc-main { min-width: 0; flex: 1 1 240px; } .chip.warn { background: var(--warn-bg, #fdf2d8); } .tg-paste textarea { width: 100%; box-sizing: border-box; margin-bottom: 8px; }

.tg-acc-wrap { margin-bottom: 8px; } .tg-acc-wrap .tg-acc { margin-bottom: 0; } .tg-acc-wrap.open { border: 1px solid var(--primary); border-radius: 10px; } .tg-acc-wrap.open .tg-acc { border: 0; } .tg-acc-panel { padding: 0 10px 10px; } .tg-acc-panel .tg-card { margin-bottom: 8px; box-shadow: none; } .tg-tools > summary, .cov-card > details > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; } .tg-tools { margin-top: 8px; }

/* the entity of a source: a clear box - the state, then link to an existing one, then make a new one */
.src-ent { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--surface)); }
.src-ent .se-head { font-size: 1rem; } .src-ent .se-linked { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .src-ent .se-sp { flex: 1; }
.src-ent .se-sec { display: grid; gap: 6px; } .src-ent .se-group { display: flex; gap: 8px; } .src-ent .se-group input { flex: 1 1 auto; min-width: 0; min-height: 44px; } .src-ent .se-group .btn { flex: none; min-height: 44px; }
.src-ent .se-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; } .src-ent .se-kinds .btn { min-height: 44px; justify-content: center; }
.src-ent .se-none { padding: 6px 10px; border: 1px dashed var(--border); border-radius: 8px; width: fit-content; }

/* the entity of a source (edit form): closed = one row with the state; open = search with results + make new */
.src-ent .se-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .src-ent .se-sp { flex: 1; } .src-ent .se-t { font-size: .95rem; }
.src-ent .se-edit { display: grid; gap: 8px; padding-top: 6px; border-top: 1px solid var(--border); } .src-ent .se-edit input { width: 100%; min-height: 44px; box-sizing: border-box; }
.src-ent .se-res { display: grid; gap: 4px; max-height: 280px; overflow: auto; } .src-ent .se-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: start; font: inherit; color: inherit; }
.src-ent .se-opt:hover, .src-ent .se-opt:focus-visible { border-color: var(--primary); }

/* the source page: two columns - the pulse, the settings and what it talks about on one side; the connections and the links under them on the other; the latest items across */
.sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; } .sp-col { display: grid; gap: var(--gap); min-width: 0; align-content: start; } .sp-grid > .card { min-width: 0; }
@media (max-width: 900px) { .sp-grid { grid-template-columns: minmax(0, 1fr); } }
.src-conn, .src-conn h2 { text-align: start; } .src-conn .row-flex { justify-content: flex-start; }

/* previous / next source and the way back to the list (like the entity page) */
.src-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; } .src-nav .btn { min-height: 44px; max-width: 34%; min-width: 0; } .src-nav .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.src-nav .src-nav-back { max-width: 40%; } .src-nav .btn.disabled { opacity: .4; pointer-events: none; }
@media (max-width: 600px) { .src-nav .btn { padding-inline: 8px; } .src-nav .src-nav-back { flex: none; } }

/* the view pages list: cards in two columns, each with the same four tiles */
.vw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 12px; align-items: start; } .vw-list > .vw-card { margin: 0; min-width: 0; } .vw-list > .vw-card.open { grid-column: 1 / -1; }
.vw-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .vw-title h2 { margin: 0; }
.vw-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 6px; } .vw-tile { display: grid; gap: 2px; text-align: center; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, var(--surface)); } .vw-tile b { font-size: 1.15rem; font-variant-numeric: tabular-nums; } .vw-tile span { font-size: .75rem; color: var(--muted); }
.vw-scope { min-height: 1.4em; }

.vw-linkrow { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); } .vw-linkrow code { overflow-wrap: anywhere; } @media (max-width: 700px) { .vw-linkrow { grid-template-columns: 1fr; } }

/* the view pages list, wide: a card is a row - the name, link and choice on one side, the four tiles on the other; an open card takes the whole width */
.vw-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 600px), 1fr)); }
@media (min-width: 900px) {
  .vw-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 18px; align-items: center; }
  .vw-card > .vw-head, .vw-card > .vw-link, .vw-card > .vw-scope { grid-column: 1; } .vw-card > .vw-tiles { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .vw-card > :not(.vw-head):not(.vw-link):not(.vw-scope):not(.vw-tiles) { grid-column: 1 / -1; }
}
.vw-list ~ .save-bar { margin-top: 14px; }

/* the view cards are all the same: the head is one row (name + badges wrap inside, the buttons stay), the four tiles have a fixed place and size */
.vw-head { flex-wrap: nowrap; align-items: flex-start; } .vw-head > .row-flex { flex: none; } .vw-title { min-width: 0; flex: 1 1 auto; }
.vw-tile { min-width: 0; min-height: 64px; align-content: center; } .vw-tile span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .vw-card:not(.open) { grid-template-columns: minmax(0, 1fr) 340px; } .vw-list > .vw-card:not(.open) { min-height: 150px; } }

/* the bulk bar of the entities: one row - the head (count, the result of the last action, cancel) and the actions beside it, scrolling sideways when they do not fit */
.ent-bulkbar { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; margin: 8px 0; padding: 8px 12px; } .ent-bulkbar.idle { padding: 6px 12px; }
.ent-bhead { display: flex; align-items: center; gap: 8px; flex: none; max-width: 48%; min-width: 0; } .ent-bhead b { white-space: nowrap; }
.ent-bstat { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--st-published, #1a7f4b); } .ent-bstat.run { color: var(--muted); } .ent-bstat.err { color: var(--st-rejected, #b3261e); }
.ent-bactions { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; } .ent-bactions > * { flex: none; white-space: nowrap; } .ent-bactions select { width: auto; max-width: 150px; }
@media (max-width: 800px) { .ent-bulkbar { flex-wrap: wrap; } .ent-bhead { max-width: 100%; } .ent-bactions { flex: 1 1 100%; } }

/* the bulk bar: no sideways scrolling - the actions wrap to a new row only when they do not fit */
.ent-bulkbar { flex-wrap: wrap; align-items: flex-start; } .ent-bactions { flex-wrap: wrap; overflow: visible; flex: 1 1 360px; } .ent-bhead { max-width: 100%; }
.ent-bactions .btn.sm { padding-inline: 8px; } .ent-bactions select { max-width: 130px; }

.ent-dups { margin: 8px 0; } .dup-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin-top: 8px; } .dup-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; } .dup-names { min-width: 0; }

.dup-ai { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 6px; }

.sd-panel { margin: 8px 0; } .sd-list { display: grid; gap: 6px; max-height: 55vh; overflow: auto; margin-top: 8px; } .sd-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(120px, 220px); gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; } .sd-main { min-width: 0; overflow-wrap: anywhere; } .sd-n { text-align: end; }
@media (max-width: 700px) { .sd-row { grid-template-columns: auto 1fr; } .sd-n { grid-column: 2; text-align: start; } }

/* the status of work that takes time: one line each, at the top of the screen */
#task-bar { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); inset-inline: 0; margin-inline: auto; width: min(620px, calc(100vw - 24px)); z-index: 90; display: grid; gap: 6px; pointer-events: none; }
#task-bar .task { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 28px rgb(0 0 0 / .18); font-size: .9rem; border-inline-start: 5px solid var(--muted); }
#task-bar .task-run { border-inline-start-color: var(--primary); } #task-bar .task-ok { border-inline-start-color: var(--st-published, #1a7f4b); } #task-bar .task-none { border-inline-start-color: #c98a00; } #task-bar .task-err { border-inline-start-color: var(--st-rejected, #b3261e); }
#task-bar .task-t { flex: 1; min-width: 0; overflow-wrap: anywhere; } #task-bar .task-x { all: unset; cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; } #task-bar .task-x:hover { background: var(--surface-2, rgb(0 0 0 / .06)); }

/* paste sources: the dictionary section across the whole window - three clear columns (country / topic + hashtag / entity) */
.ps-dict-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 10px 0; } .ps-dc { display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--surface)); min-width: 0; }
.ps-dc-h { font-weight: 700; display: flex; align-items: center; gap: 6px; } .ps-scroll { max-height: 220px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; }
.ps-kinds { display: flex; gap: 6px; flex-wrap: wrap; } .ps-dc input[type=search], .ps-dc input[type=text] { width: 100%; min-height: 40px; box-sizing: border-box; }
.ps-ent-res { display: grid; gap: 4px; max-height: 220px; overflow: auto; } .ps-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; text-align: start; } .ps-opt:hover, .ps-opt:focus-visible { border-color: var(--primary); }
.ps-ent-sel { min-height: 28px; }
@media (max-width: 900px) { .ps-dict-grid { grid-template-columns: minmax(0, 1fr); } }

/* the columns of a pasted table: a choice for each */
.ps-cols { display: grid; gap: 8px; margin-top: 8px; } .ps-colgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; } .ps-col { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; } .ps-col select { width: 100%; min-height: 38px; }

/* duplicates (entities): every proposal is the same box - names on one side, confidence + merge button in a fixed column on the other (no wrapping of the button under long names) */
.dup-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: center; gap: 12px; box-sizing: border-box; width: 100%; padding: 10px 12px; }
.dup-row .dup-names { overflow-wrap: anywhere; line-height: 1.6; }
.dup-row .dup-names b, .dup-row .dup-names .small { unicode-bidi: plaintext; }
.dup-row > .row-flex, .dup-row > button { justify-self: end; display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; }
.dup-row > .row-flex .btn { white-space: nowrap; min-width: 120px; justify-content: center; }
.dup-row > .row-flex .chip { min-width: 44px; justify-content: center; text-align: center; }
@media (max-width: 640px) { .dup-row { grid-template-columns: minmax(0, 1fr); } .dup-row > .row-flex, .dup-row > button { justify-self: stretch; } .dup-row > .row-flex .btn { flex: 1; } }

/* entity hierarchy: the chain above an entity */
.ent-chain { align-items: center; gap: 4px; }

.ent-photo-row { display: block; margin: 6px 0 10px; } .ent-photo-row .row-flex { align-items: center; gap: 8px; }

/* entity edit form: nothing may spill out of its card (long lists of organizations wrap and scroll inside it; fields never wider than the card) */
.ent-sec, .ent-sec > *, .ent-sec .f, .ent-sec fieldset { min-width: 0; max-width: 100%; box-sizing: border-box; }
.ent-sec select, .ent-sec input:not([type=checkbox]):not([type=radio]), .ent-sec textarea { max-width: 100%; box-sizing: border-box; }
.ent-sec .row-flex { flex-wrap: wrap; min-width: 0; }
.ent-sec fieldset.ent-fs .row-flex { max-height: 190px; overflow: auto; align-content: flex-start; padding: 2px; }
.ent-sec fieldset.ent-fs .check { max-width: 100%; overflow-wrap: anywhere; }

/* the unified list: its filters in one row like the entities lists */
.ent-filters #mx-q{flex:1 1 180px;min-width:120px}

/* the chips of one group (a network and its ways, the types, the states, mine) share a rounded frame; the frames flow and wrap */
.chip-group{display:inline-flex;flex-wrap:wrap;gap:6px;padding:5px;border:1px solid rgba(255,255,255,.38);border-radius:18px;align-items:center}

/* the relationship map */
.gr-main{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px;align-items:start;margin-top:14px}
.gr-cv canvas{width:100%;display:block;border-radius:10px;background:var(--bg-soft,#f6f8fb);touch-action:none}
.gr-side{max-height:640px;overflow:auto;position:sticky;top:12px}
.gr-bar .seg{display:inline-flex;gap:6px;flex-wrap:wrap}
@media(max-width:900px){.gr-main{grid-template-columns:1fr}.gr-side{position:static;max-height:none}}

/* the filters of the map in as few rows as possible */
.gr-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.gr-row select{width:auto;flex:0 1 auto;min-width:0;max-width:150px}
.gr-row input[type=text]{flex:1 1 170px;min-width:130px;max-width:230px}
.gr-row .gr-k{white-space:nowrap;gap:4px;font-size:13px}
.gr-row .seg .btn{white-space:nowrap}

.gr-cv canvas{background:radial-gradient(1200px 600px at 20% 0%,#ffffff 0%,#eef3fb 60%,#e6edf8 100%);box-shadow:inset 0 0 0 1px rgba(100,116,139,.18)}
:root[data-theme="dark"] .gr-cv canvas{background:radial-gradient(1200px 600px at 20% 0%,#16233b 0%,#0d1627 60%,#0a1220 100%);box-shadow:inset 0 0 0 1px rgba(148,163,184,.2)}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .gr-cv canvas{background:radial-gradient(1200px 600px at 20% 0%,#16233b 0%,#0d1627 60%,#0a1220 100%);box-shadow:inset 0 0 0 1px rgba(148,163,184,.2)}}

/* the kinds of entities stay together, side by side in one frame; the row wraps between groups, not inside one */
.gr-kinds{display:inline-flex;flex-wrap:nowrap;gap:10px;align-items:center;padding:5px 12px;border:1px solid var(--line,#d9e2ef);border-radius:999px;white-space:nowrap}
.gr-row .seg{flex-wrap:nowrap}
.gr-row select{max-width:128px}

.gr-cv{overflow:hidden;min-width:0}
.gr-cv canvas{max-width:100%;border-radius:12px}

.si-chips{display:flex;gap:4px;flex-wrap:wrap;margin:3px 0}
.si-chips .chip{font-size:11px}

/* the chosen button of a segmented group keeps its colour */
.seg .btn.primary,.seg .btn[aria-pressed="true"]{background:var(--primary);color:var(--on-primary,#fff);border-color:transparent}
.seg .btn.primary:hover{background:var(--primary)}
.gr-bar .seg{display:inline-flex;grid-template-columns:none;overflow:hidden}

/* the report design dialog: the form scrolls inside itself (never sideways), its buttons stay in view, the preview stays beside it */
#rtf { max-height: 68vh; overflow-y: auto; overflow-x: hidden; padding-inline-end: 8px; display: flex; flex-direction: column; gap: 10px; }
#rtf .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#rtf input[type=text], #rtf input[type=email], #rtf input[type=number], #rtf select, #rtf textarea { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
#rtf .modal-foot { position: sticky; bottom: 0; background: var(--surface, #fff); padding: 10px 0 2px; margin: 0; border-top: 1px solid var(--border); z-index: 2; }
#rtf fieldset { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rt-link-row { display: grid; grid-template-columns: minmax(80px, .9fr) minmax(120px, 1.6fr) auto; gap: 6px; margin-bottom: 6px; align-items: center; }
#rt-prev { position: sticky; top: 0; }

/* the report design dialog, clear sections that are plainly editable */
.rt-hint { display: flex; gap: 8px; align-items: flex-start; background: color-mix(in srgb, var(--primary) 9%, var(--surface, #fff)); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px; line-height: 1.55; }
.tpl-grid > * { min-width: 0; }
#rtf { gap: 12px; }
.rt-sec { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface, #fff); }
.rt-sec h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.rt-sec .f > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rt-sec input[type=text], .rt-sec input[type=email], .rt-sec input[type=number], .rt-sec select { border: 1.5px solid color-mix(in srgb, var(--text) 25%, var(--border)); background: var(--surface, #fff); border-radius: 8px; min-height: 38px; padding: 6px 10px; }
.rt-sec input:focus, .rt-sec select:focus { border-color: var(--primary); outline: 2px solid color-mix(in srgb, var(--primary) 25%, transparent); }
#rtf input[type=color] { width: 100%; height: 40px; padding: 3px; border: 1.5px solid color-mix(in srgb, var(--text) 25%, var(--border)); border-radius: 8px; background: var(--surface, #fff); cursor: pointer; }
.rt-checks { display: flex; gap: 16px; flex-wrap: wrap; }
#rtf .modal-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
#rt-dirty { margin-inline-end: auto; }
.rt-prev-col { position: sticky; top: 0; }
/* the reports page: the three daily editions in one row */
.rep-main { margin-bottom: 16px; }
.rep-row-h { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.rep-main-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .rep-main-grid { grid-template-columns: 1fr; } }
.rep-main-grid .card { height: 100%; }

/* a report: "all" or "only the chosen"; the list is dimmed while "all" is on */
.rep-mode { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; font-weight: 600; }
.rep-pick.dim { opacity: .45; pointer-events: none; }

.rep-filter { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); display: grid; gap: 8px; }

/* the accounts page: air between the blocks of a network tab */
.tg-sec { margin-top: 22px; }
.tg-sec + .tg-sec, .net-tiles-wrap + .card { margin-top: 22px; }

/* the account form (social networks): nothing is wider than the window - long names, a pasted session / cookie text, many source chips */
.modal:has(#af), .modal-box:has(#af), dialog:has(#af) { max-width: min(920px, calc(100vw - 24px)); overflow-x: hidden; }
#af, #af fieldset, #af .two, #af .f, #af label { min-width: 0; max-width: 100%; }
#af input, #af select, #af textarea { width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0; }
#af textarea { overflow-wrap: anywhere; word-break: break-all; resize: vertical; font-size: 12px; line-height: 1.5; max-height: 160px; }
#af .row-flex { flex-wrap: wrap; }
#af .check { max-width: 100%; overflow-wrap: anywhere; }
#af .two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
#mem-box { max-height: 180px; overflow: auto; }

/* cyber teams: red = offence, blue = defence, white = oversight, + mixed teams (chips tinted with the team colour; text keeps contrast on dark and light themes) */
.team-chips { display: inline-flex; gap: 4px; margin-inline-start: 6px; vertical-align: middle; flex-wrap: wrap; }
.team-chip { --tc: #64748b; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; color: var(--text); background: color-mix(in srgb, var(--tc) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tc) 55%, var(--surface)); white-space: nowrap; }
.team-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tc); }
.tm-red { --tc: #ef4444; } .tm-blue { --tc: #3b82f6; } .tm-white { --tc: #e2e8f0; } .tm-purple { --tc: #a855f7; } .tm-yellow { --tc: #eab308; } .tm-green { --tc: #22c55e; } .tm-orange { --tc: #f97316; }
.team-chip.pick { cursor: pointer; height: 30px; padding: 0 12px; } .team-chip.pick input { margin: 0; accent-color: var(--tc); }
.team-chip.pick:has(input:checked) { background: color-mix(in srgb, var(--tc) 38%, var(--surface)); border-color: var(--tc); }
.team-pick { gap: 6px; flex-wrap: wrap; }

/* the feed link on top of the side menu: the main page of the items */
.nav a.nav-feed { display: flex; align-items: center; gap: 10px; margin: 0 8px 8px; padding: 10px 12px; border-radius: var(--radius); font-weight: 700; color: var(--primary-contrast); background: var(--primary); text-decoration: none; }
.nav a.nav-feed:hover { filter: brightness(1.08); }
