/* =========================================================================
   MyDesign — design system. Brand palette from panel.monaqasat.net.
   ========================================================================= */
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-ExtraLight.ttf') format('truetype'); font-weight: 200; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-Light.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../fonts/Tajawal/Tajawal-Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }

:root {
  --primary: #19597a; --primary-2: #23849f; --teal: #6ccad0; --accent: #f05d22; --accent-2: #f68a1f; --gold: #ffcd05;
  --ink: #142b38; --ink-2: #3d5564; --muted: #7b8d98; --line: #e1e8ee; --line-2: #eef3f6;
  --bg: #f3f6f8; --card: #ffffff; --soft: #f7fafb; --tint: #e9f3f7; --tint-accent: #fff1ea;
  --ok: #1f9d6b; --ok-bg: #e5f6ef; --warn: #c9821a; --warn-bg: #fff4e0; --bad: #d64545; --bad-bg: #fde9e9;
  --r-xs: 8px; --r-sm: 10px; --r: 14px; --r-lg: 20px;   /* the one radius scale: small controls, controls, cards, dialogs (pills and circles apart) */
  /* a chosen option, everywhere (2026-11-17): as the adder button under the mouse (.adder-btn:hover), not a solid navy fill */
  --sel-bg: var(--tint); --sel-line: var(--primary-2); --sel-ink: var(--primary); --sel-sh: 0 2px 8px rgba(25,89,122,.1);
  --sh-1: 0 1px 2px rgba(20,43,56,.06), 0 1px 3px rgba(20,43,56,.05);
  --sh-2: 0 6px 18px rgba(20,43,56,.08);
  --sh-3: 0 18px 50px rgba(20,43,56,.18);
  --ease: cubic-bezier(.2,.7,.2,1);
  --top: 60px;
  --rail-w: clamp(288px, 15vw, 360px); --rail-mini: 68px;   /* the workspace's side panel: fixed up to 1920px wide, then grows with the screen; folded to icons */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(35,132,159,.45); outline-offset: 2px; }
::selection { background: rgba(108,202,208,.35); }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 1px solid transparent; border-radius: var(--r-sm); padding: .62rem 1.15rem; font-weight: 700; cursor: pointer; transition: transform .12s var(--ease), background .2s, box-shadow .2s, border-color .2s; white-space: nowrap; background: var(--card); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(25,89,122,.25); }
.btn-primary:hover { background: #154c69; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(240,93,34,.28); }
.btn-accent:hover { background: #dc4f17; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--soft); border-color: #cfdbe3; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-block { width: 100%; }
.btn.loading { pointer-events: none; }
.btn.loading > * { opacity: 0; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--tint); color: var(--primary); }
.icon-btn.on { background: var(--sel-bg); color: var(--sel-ink); box-shadow: inset 0 0 0 1px var(--sel-line); }
.lang-txt { font-weight: 800; font-size: .85rem; }
.chip-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: var(--tint); color: var(--primary); font-weight: 700; font-size: .85rem; border: 0; cursor: pointer; }
.chip-btn:hover { background: #dbecf3; }
.kbd { font-family: ui-monospace, Consolas, monospace; font-size: .72rem; padding: .05rem .4rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-xs); background: #fff; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill.s0 { background: #eef2f5; color: var(--ink-2); }
.pill.s1 { background: var(--tint); color: var(--primary); }
.pill.s2 { background: var(--ok-bg); color: var(--ok); }
.pill.s9 { background: var(--bad-bg); color: var(--bad); }
.pill.sc { background: #e7ecef; color: #44555f; }   /* closed by the admin */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: .78rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); flex: none; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: .66rem; }
.avatar.empty { background: #fff; color: var(--muted); border: 1.5px dashed #c5d3dc; }
.avatar.alt { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.avatar.crm { background: linear-gradient(135deg, #6b4fa0, #9a7fd1); }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field > span:first-child { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.field > span:first-child i { opacity: .6; margin-inline-end: .3rem; }
input[type=text], input[type=password], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: .68rem .9rem; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(35,132,159,.12); }
input.invalid { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(214,69,69,.1); }
textarea { min-height: 96px; resize: vertical; }
.input-wrap { position: relative; display: block; }
.input-wrap .toggle-pw { position: absolute; inset-inline-end: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: .4rem; }
.alert { display: none; padding: .75rem 1rem; border-radius: var(--r-sm); background: var(--bad-bg); color: var(--bad); font-weight: 600; margin-bottom: 1rem; font-size: .9rem; }
.alert.show { display: block; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- login ---------- */
.login-body { background: var(--bg); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: flex-end; gap: 1rem;
  background: radial-gradient(1200px 600px at 20% 0%, #2b7d9f 0%, transparent 60%), linear-gradient(160deg, var(--primary) 0%, #0f3d55 100%); }
.login-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000 30%, transparent 95%); }
.login-art-logo { position: absolute; top: 2.2rem; inset-inline-start: 2.5rem; height: 44px; width: auto; opacity: .95; }
.login-art h2 { font-size: 2rem; max-width: 18ch; position: relative; }
.login-art p { max-width: 46ch; opacity: .8; position: relative; margin: 0; }
.blueprint { position: absolute; top: 14%; inset-inline: 8%; width: 84%; color: rgba(255,255,255,.85); }
.blueprint .draw { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.4s var(--ease) forwards; }
.blueprint .d2 { animation-delay: .3s; } .blueprint .d3 { animation-delay: .6s; } .blueprint .d4 { animation-delay: .9s; }
.blueprint .d5 { animation-delay: 1.2s; } .blueprint .d6 { animation-delay: 1.5s; color: var(--gold); } .blueprint .d7 { animation-delay: 1.8s; stroke-dashoffset: 0; opacity: .5; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.login-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login-card { width: 100%; max-width: 420px; background: var(--card); border-radius: var(--r-lg); padding: 2rem; box-shadow: var(--sh-2); animation: rise .5s var(--ease); }
.login-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.login-logo { height: 38px; width: auto; }
.login-card h1 { font-size: 1.7rem; color: var(--primary); }
.login-card .muted { margin: .25rem 0 1.4rem; }
.captcha-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.captcha-row img { border-radius: var(--r-sm); border: 1px solid var(--line); }
.login-foot { margin-top: 1.5rem; color: var(--muted); font-size: .8rem; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

.center-body { min-height: 100vh; display: grid; place-items: center; }
.empty-state { text-align: center; padding: 3rem 1.5rem; max-width: 460px; margin: auto; }
.empty-state > i { font-size: 3rem; color: var(--primary-2); margin-bottom: 1rem; display: block; }
.empty-state h1, .empty-state h3 { margin-bottom: .5rem; }
.empty-state .btn { margin-top: 1rem; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: 1rem; padding: 0 1rem; background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .6rem; flex: none; }
.brand img { height: 30px; width: auto; }
.brand-name { font-weight: 800; color: var(--primary); font-size: 1.05rem; padding-inline-start: .6rem; border-inline-start: 1px solid var(--line); }
.topbar-center { flex: 1; min-width: 0; display: flex; align-items: center; gap: .75rem; }
.topbar-end { display: flex; align-items: center; gap: .25rem; flex: none; }
.me { display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem; border-radius: var(--r-sm); }
.me-text { display: flex; flex-direction: column; line-height: 1.15; }
.me-text b { font-size: .85rem; } .me-text small { color: var(--muted); font-size: .72rem; }
@media (max-width: 760px) { .me-text, .brand-name { display: none; } }
/* phones: the header fits the screen — smaller icons; on a brief only search stays at the end (the back arrow leads home,
   printing and the glossary are in the search palette) */
@media (max-width: 760px) {
  .topbar { gap: .4rem; padding: 0 .6rem; }
  .topbar .brand img { height: 24px; }
  .topbar-end { gap: 0; }
  .topbar-end .icon-btn { width: 34px; height: 34px; }
  .topbar .me { display: none; }
  .ws-body .topbar .brand, .ws-body .topbar-end > :not([data-act=palette]) { display: none; }
  .ws-body .bar-actions #btnBrief, .ws-body .bar-actions [data-glib], .ws-body .bar-title small, .ws-body #barStatus { display: none; }
  .ws-body .bar-title > div { min-width: 0; }
  .ws-body .bar-actions { gap: .25rem; }
  .ws-body .bar-actions .btn { padding-inline: .55rem; }
}

/* ---------- requests list ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 1.6rem 1.25rem 4rem; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.hero h1 { font-size: 1.75rem; }
.hero p { margin: .3rem 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { background: var(--card); border-radius: var(--r); padding: .9rem 1rem; box-shadow: var(--sh-1); display: flex; align-items: center; gap: .8rem; cursor: pointer; border: 2px solid transparent; transition: border-color .2s, transform .15s; }
.stat:hover { transform: translateY(-2px); }
.stat.on { border-color: var(--primary-2); }
.stat i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--tint); color: var(--primary); font-size: .95rem; flex: none; }
.stat b { display: block; font-size: 1.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat { padding: .65rem .85rem; }
.stat.on i { background: var(--primary); color: #fff; }
.stat small { color: var(--muted); font-weight: 600; }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.search { position: relative; flex: 1; min-width: 220px; }
.search i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: .9rem; color: var(--muted); }
.search input { padding-inline-start: 2.4rem; background: var(--card); }
.search .kbd { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: .7rem; }
.seg { display: inline-flex; background: #e8eef2; border-radius: var(--r-sm); padding: 3px; }
.seg button { border: 0; background: transparent; padding: .45rem .9rem; border-radius: var(--r-sm); cursor: pointer; font-weight: 700; color: var(--ink-2); font-size: .88rem; }
.seg button.on { background: #fff; color: var(--primary); box-shadow: var(--sh-1); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.rq { position: relative; background: var(--card); border-radius: var(--r-lg); padding: 1.1rem 1.15rem 1rem; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: .8rem; transition: transform .2s var(--ease), box-shadow .2s; animation: rise .35s var(--ease) both; border: 1px solid transparent; }
.rq:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: #d7e6ee; }
.rq.closed { background: var(--soft); box-shadow: none; border-color: var(--line); }   /* closed by the admin: still opens, read only */
.rq.closed .ring { opacity: .55; }
.rq-head { display: flex; align-items: flex-start; gap: .8rem; }
.rq-title { flex: 1; min-width: 0; }
.rq-title h3 { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-title small { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .78rem; }
.rq-sub { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .2rem; }
.rq-sub .pill { font-size: .72rem; padding: .1rem .55rem; }
.rq-foot .team { min-width: 0; flex: 1; }
.rq-foot .team-name { margin-inline-start: .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rq-foot .rq-time { white-space: nowrap; flex: none; }
.new-card { grid-column: 1 / -1; min-height: 160px; }
.rq-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--ink-2); font-size: .84rem; }
.rq-meta i { color: var(--primary-2); opacity: .8; margin-inline-end: .25rem; }
.rq-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .7rem; border-top: 1px solid var(--line-2); font-size: .8rem; color: var(--muted); }
.team { display: flex; align-items: center; }
.team .avatar { border: 2px solid #fff; }
.team .avatar + .avatar { margin-inline-start: -8px; }
.ring { --p: 0; --c: var(--primary-2); width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e6edf1 0); position: relative; font-size: .72rem; font-weight: 800; color: var(--ink-2); }
.ring::before { content: ''; position: absolute; inset: 5px; background: #fff; border-radius: 50%; }
.ring span { position: relative; }
.ring.sm { width: 26px; height: 26px; font-size: 0; } .ring.sm::before { inset: 4px; }
.ring.done { --c: var(--ok); }
.new-card { display: grid; place-items: center; text-align: center; gap: .4rem; min-height: 190px; border: 2px dashed #c6d7e1; background: transparent; box-shadow: none; cursor: pointer; color: var(--primary); font-weight: 800; }
.new-card i { font-size: 1.6rem; width: 54px; height: 54px; display: grid; place-items: center; border-radius: var(--r); background: var(--tint); }
.new-card:hover { background: #fff; border-color: var(--primary-2); }
.skeleton { background: linear-gradient(90deg, #eef3f6 25%, #f7fafb 50%, #eef3f6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-lg); min-height: 190px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats .stat:first-child { grid-column: span 2; } }

/* ---------- workspace ---------- */
body.ws-body { overflow: hidden; }
.ws { position: relative; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); transition: grid-template-columns .35s var(--ease); }
.ws.rail-mini { grid-template-columns: var(--rail-mini) minmax(0, 1fr); }
/* each pane keeps its own column, also when the panel becomes a slide-out (fixed, out of the flow) */
.ws > .rail { grid-column: 1; grid-row: 1; min-width: 0; overflow-x: hidden; z-index: 6; } .ws > .stage { grid-column: 2; grid-row: 1; }
.bar-title { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.bar-title .back { flex: none; }
.bar-title h1 { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title small { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .75rem; white-space: nowrap; }
.bar-title .pill, #barStatus { white-space: nowrap; flex: none; }
/* the workspace bar on laptop widths: the user's name goes first, then the button labels (icons keep their tooltips) */
@media (max-width: 1700px) { .ws-body .me-text, .ws-body .brand-name { display: none; } }
@media (max-width: 1600px) { .ws-body .bar-actions .lbl-txt:not(.keep) { display: none; } .ws-body .bar-actions .btn { padding-inline: .7rem; } }
@media (max-width: 1180px) { .ws-body .save-state .ss-txt { display: none; } .ws-body .bar-actions .lbl-txt { display: none; } }
.save-state { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.save-state.saving i { animation: spin 1s linear infinite; }
.save-state.saved i { color: var(--ok); }
.save-state.error { color: var(--bad); }
.bar-actions { display: flex; gap: .4rem; margin-inline-start: auto; align-items: center; }

/* rail */
.rail { border-inline-end: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.rail-head { padding: 1rem 1rem .6rem; display: flex; align-items: center; gap: .8rem; }
.rail-head .ring { width: 54px; height: 54px; font-size: .82rem; }
.rail-head b { display: block; } .rail-head small { color: var(--muted); }
.rail-nav { overflow-y: auto; padding: .3rem .6rem 1rem; flex: 1; }
.rail-item { width: 100%; display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; text-align: start; color: var(--ink-2); font-weight: 600; transition: background .15s, color .15s; position: relative; }
.rail-item:hover { background: var(--soft); }
.rail-item.on { background: var(--tint); color: var(--primary); }
.rail-item.on::before { content: ''; position: absolute; inset-inline-start: -.6rem; top: 20%; bottom: 20%; width: 4px; border-radius: 4px; background: var(--primary); }
.rail-item .ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--soft); color: var(--primary-2); flex: none; font-size: .95rem; }
.rail-item.on .ico { background: #fff; }
.rail-item .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.rail-item .cnt { font-size: .7rem; color: var(--muted); font-weight: 700; }
.rail-item.complete .cnt { color: var(--ok); }
.rail-item.flagged .ico::after { content: ''; position: absolute; top: -3px; inset-inline-end: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.rail-item .ico { position: relative; }
.rail-foot { padding: .7rem 1rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); display: flex; gap: .5rem; flex-wrap: wrap; }

/* stage */
.stage { overflow-y: auto; scroll-behavior: smooth; position: relative; }
/* grows with the stage on wide screens (90% of it), never narrower than 940px nor wider than 1480px so inputs stay a readable length */
.stage-inner { max-width: clamp(940px, 90%, 1480px); margin: 0 auto; padding: 1.8rem 1.6rem 6rem; }
.sec-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.sec-head .big-ico { width: 58px; height: 58px; border-radius: var(--r-lg); display: grid; place-items: center; font-size: 1.45rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 22px rgba(25,89,122,.25); flex: none; }
.sec-head h2 { font-size: 1.55rem; }
.sec-head p { margin: .2rem 0 0; color: var(--muted); }
.sec-head .step { margin-inline-start: auto; color: var(--muted); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.sec-anim { animation: secIn .38s var(--ease); }
@keyframes secIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.qgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.q { background: var(--card); border-radius: var(--r); padding: 1rem 1.1rem 1.1rem; box-shadow: var(--sh-1); border: 1.5px solid transparent; transition: border-color .2s, box-shadow .2s; position: relative; }
.q.span2 { grid-column: 1 / -1; }
/* alone in its row (workspace.js fillRows): the card takes the row, its box keeps a half card's width */
.q.fill { grid-column: 1 / -1; }
.q.fill > input, .q.fill > select, .q.fill > .unit-wrap, .q.fill > .gis-row { max-width: calc(50% - 1.6rem); }
.q:focus-within { border-color: rgba(35,132,159,.45); box-shadow: 0 0 0 4px rgba(35,132,159,.08), var(--sh-1); }
.q-tail { white-space: nowrap; }   /* the name's last word + its marks + the tick wrap together (workspace.js labelHtml) */
.q.answered .q-tail::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .65rem; color: #fff; background: var(--ok); width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; margin-inline-start: .45rem; vertical-align: middle; }
.q.flagged { border-color: rgba(240,93,34,.55); background: linear-gradient(0deg, #fff, #fff), var(--tint-accent); }
.q.staff { background: repeating-linear-gradient(-45deg, #fff, #fff 12px, #fbfcfd 12px, #fbfcfd 24px); }
.q-top { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .7rem; }
.q-label { flex: 1; font-weight: 700; font-size: .95rem; color: var(--ink); }
.q-label .req { color: var(--accent); margin-inline-start: .2rem; }
.q-label .tag { font-size: .68rem; font-weight: 700; padding: .05rem .45rem; border-radius: var(--r-xs); background: #eef2f5; color: var(--muted); margin-inline-start: .4rem; vertical-align: middle; }
.flag-btn { border: 0; background: transparent; color: #b7c4cc; cursor: pointer; padding: .15rem .3rem; border-radius: var(--r-xs); font-size: .9rem; }
.flag-btn:hover { color: var(--accent); background: var(--tint-accent); }
.q.flagged .flag-btn { color: var(--accent); }
.unit-wrap { position: relative; }
.unit-wrap .unit { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: .9rem; color: var(--muted); font-size: .82rem; pointer-events: none; }
.unit-wrap input { padding-inline-end: 3.4rem; }
/* Tajawal's comma is so small that 1,200,000 reads as 1.200.000: in money fields the comma alone comes from a system font */
@font-face { font-family: 'Money Comma'; src: local('Segoe UI Semibold'), local('SegoeUI-Semibold'), local('Arial Bold'), local('Arial'), local('Helvetica'); unicode-range: U+2C; }
.unit-wrap input.money { font-family: 'Money Comma', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif; letter-spacing: .02em; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .95rem; border-radius: 999px; border: 1px solid #d3e0e8; background: #fff; cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--ink-2); transition: all .15s var(--ease); user-select: none; }
.chip:hover { border-color: #b9ccd8; background: var(--soft); }
.chip i { color: var(--primary-2); font-size: .9rem; }
.chip.on { background: var(--sel-bg); border-color: var(--sel-line); color: var(--sel-ink); font-weight: 700; box-shadow: var(--sel-sh); }
.chip.on i { color: var(--primary-2); }
.chip .sw { width: 18px; height: 18px; border-radius: var(--r-xs); border: 1px solid rgba(0,0,0,.12); }
.chip:active { transform: scale(.96); }
.other-input { margin-top: .6rem; animation: rise .25s var(--ease); }

.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.pcard { border: 1.5px solid var(--line); background: #fff; border-radius: var(--r); padding: .95rem .6rem .8rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .55rem; text-align: center; font-weight: 700; font-size: .88rem; transition: all .18s var(--ease); color: var(--ink-2); }
.pcard i { font-size: 1.5rem; width: 54px; height: 54px; display: grid; place-items: center; border-radius: var(--r); background: var(--soft); color: var(--primary-2); transition: all .18s; }
.pcard:hover { transform: translateY(-2px); border-color: #b9ccd8; }
.pcard.on { border-color: var(--primary); background: var(--tint); color: var(--primary); box-shadow: 0 6px 16px rgba(25,89,122,.15); }
.pcard.on i { background: var(--primary); color: #fff; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--soft); cursor: pointer; font-size: 1.05rem; color: var(--primary); transition: background .15s; }
.stepper button:hover { background: var(--tint); }
.stepper input { width: 70px; border: 0; text-align: center; font-weight: 800; font-size: 1.15rem; padding: 0; box-shadow: none !important; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper + .unit-txt { margin-inline-start: .6rem; color: var(--muted); font-size: .85rem; }

.yesno { display: inline-flex; background: #e8eef2; border-radius: var(--r); padding: 4px; gap: 4px; }
.yesno button { border: 0; background: transparent; padding: .5rem 1.3rem; border-radius: var(--r-sm); font-weight: 700; cursor: pointer; color: var(--ink-2); }
.yesno button.on.yes { background: var(--ok); color: #fff; }
.yesno button.on.no { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.tg-more { margin-top: .7rem; }   /* the kinds under the Yes of a yes / no switch */

/* the hint stays on one line: beside the buttons when there is room, under them in a half card (not "5 very / high" squeezed into 66px) */
.scale { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.scale small { white-space: nowrap; }
.scale button { flex: none; width: 44px; height: 44px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; transition: all .15s; }
.scale button.on { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-line); box-shadow: var(--sel-sh); }
.scale button.fill { background: var(--tint); border-color: #bcd9e5; }
.scale small { color: var(--muted); font-size: .78rem; }

.sec-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.next-card { flex: 1; display: flex; align-items: center; gap: .9rem; padding: 1rem 1.2rem; border-radius: var(--r); background: var(--card); box-shadow: var(--sh-1); border: 1.5px solid transparent; cursor: pointer; transition: all .2s var(--ease); text-align: start; }
.next-card:hover { border-color: var(--primary-2); transform: translateY(-2px); }
.next-card small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; }
.next-card b { font-size: 1rem; }
.next-card .arrow { margin-inline-start: auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--primary); color: #fff; }
.next-card.prev .arrow { background: var(--soft); color: var(--primary); margin-inline-start: 0; }
.next-card.prev { flex: 0 0 auto; }
[dir=rtl] .next-card .arrow i, [dir=rtl] .bar-title .back i, [dir=rtl] .rtl-flip { transform: scaleX(-1); }   /* back arrows point right in Arabic (2026-11-25: every back button carries .rtl-flip) */

.meter { height: 8px; border-radius: var(--r-xs); background: #e6edf1; overflow: hidden; margin-top: .45rem; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--teal)); border-radius: var(--r-xs); transition: width .4s var(--ease); }
.meter.over > span { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.eng { display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: var(--r-sm); border: 1px solid var(--line); margin-bottom: .5rem; }
.eng .who { flex: 1; min-width: 0; }
.eng .who small { display: block; color: var(--muted); font-size: .72rem; font-weight: 600; }
.eng .who b { font-size: .88rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eng .who b.none { color: var(--muted); font-weight: 600; font-style: italic; }
.eng .icon-btn { width: 32px; height: 32px; }
.eng.missing { border-style: dashed; border-color: #f3c3ab; background: #fffaf7; }
.flags-list button[disabled] { opacity: .55; cursor: not-allowed; }
.flags-list { display: flex; flex-direction: column; gap: .35rem; }
.flags-list button { text-align: start; border: 0; background: var(--tint-accent); color: #a3401a; border-radius: var(--r-sm); padding: .45rem .7rem; font-size: .84rem; font-weight: 600; cursor: pointer; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .8rem; }
.timeline li { padding: .35rem 0 .35rem 0; padding-inline-start: 1rem; border-inline-start: 2px solid var(--line); position: relative; color: var(--ink-2); }
.timeline li::before { content: ''; position: absolute; inset-inline-start: -5px; top: .75rem; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-2); }
.timeline li small { display: block; color: var(--muted); }
.locked-banner { display: flex; gap: .7rem; align-items: center; background: var(--ok-bg); color: #156b4a; border-radius: var(--r); padding: .8rem 1rem; margin-bottom: 1.2rem; font-weight: 600; }
.locked-banner i { font-size: 1.3rem; }
.locked-banner.closed-banner { background: #e7ecef; color: var(--ink); }
.locked-banner.closed-banner small { display: block; font-weight: 500; color: var(--ink-2); margin-top: .15rem; }
/* the text takes the room it needs (never one word a line); the buttons keep together and drop to their own line when the panel is narrow */
.locked-banner { flex-wrap: wrap; }
.locked-banner > .lb-text { flex: 1 1 16rem; min-width: 0; line-height: 1.6; }
.locked-banner > .lb-acts { display: flex; flex-wrap: wrap; gap: .5rem; flex: 0 1 auto; max-width: 100%; }
.locked-banner > .lb-acts .btn { white-space: nowrap; }

/* programme */
.prog-top { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.floor-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.floor-tab { border: 1px solid #d3e0e8; background: #fff; border-radius: 999px; padding: .42rem .95rem; font-weight: 700; cursor: pointer; display: inline-flex; gap: .45rem; align-items: center; color: var(--ink-2); font-size: .88rem; }
.floor-tab small { background: var(--soft); border-radius: var(--r-xs); padding: 0 .4rem; font-size: .72rem; color: var(--muted); }
.floor-tab.on { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-line); box-shadow: var(--sel-sh); }
.floor-tab.on small { background: #fff; color: var(--primary-2); }
.palette-rooms { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.palette-rooms .chip { padding: .38rem .7rem; font-size: .82rem; }
.palette-rooms .chip i { font-size: .8rem; }
.room-list { display: flex; flex-direction: column; gap: .5rem; }
.room { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 112px 86px 34px 34px; gap: .6rem; align-items: center; background: #fff; border-radius: var(--r); padding: .55rem .7rem; box-shadow: var(--sh-1); animation: rise .25s var(--ease); }
.room .r-ico { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--tint); color: var(--primary); }
.room input[type=text] { border: 0; padding: .35rem .2rem; font-weight: 700; background: transparent; box-shadow: none; }
.room input[type=text]:focus { background: var(--soft); }
.room .stepper button { width: 32px; height: 34px; font-size: .85rem; }
.room .stepper input { width: 38px; font-size: .95rem; }
.room .unit-wrap input { padding: .45rem .6rem; padding-inline-end: 2.2rem; }
.room .unit-wrap .unit { font-size: .74rem; inset-inline-end: .55rem; }
.room .tot { text-align: end; font-weight: 800; color: var(--ink-2); font-size: .9rem; }
.room .sn-btn { width: 34px; height: 34px; }
.room > .sn-strip { grid-column: 2 / -1; }
.room > .sn-ed { grid-column: 1 / -1; }
.room.writing { box-shadow: 0 0 0 2px var(--primary-2), var(--sh-1); }
.room-sum { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: 1rem; padding: 1rem 1.1rem; background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); font-size: .9rem; }
.room-sum b { font-size: 1.05rem; }
@media (max-width: 640px) { .room { grid-template-columns: 34px minmax(0, 1fr) auto; } .room .unit-wrap, .room .tot { grid-column: span 1; } }

/* files */
/* .drop is a <label>: without display:block its dashed border wraps only the inline bits (a box round the icon, a sliver after the chips) */
.drop { position: relative; display: block; border: 2px dashed #c6d7e1; border-radius: var(--r-lg); padding: 1.6rem; text-align: center; background: var(--card); transition: all .2s; cursor: pointer; }
.drop:hover { border-color: #b9ccd8; }
.drop.over { border-color: var(--primary-2); background: var(--tint); transform: scale(1.01); }
.drop:has(.drop-input:focus-visible) { border-color: var(--primary-2); outline: 3px solid rgba(35,132,159,.45); outline-offset: 2px; }
.drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }   /* kept focusable for the keyboard */
.drop > i { display: block; font-size: 2rem; color: var(--primary-2); margin-bottom: .5rem; }   /* the cloud only, not the chips' icons */
.drop p { margin: .4rem 0 0; color: var(--muted); }
.drop .kinds { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; margin-top: .9rem; }
/* min(): two cards a row on a phone instead of one tall card per screen */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: .8rem; margin-top: 1rem; }
.gallery:empty { display: none; }
.att { background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); position: relative; }
.att.new { animation: rise .3s var(--ease); }   /* only the card just added, not the whole gallery on every upload */
.att .thumb { aspect-ratio: 4 / 3; background: var(--soft) center / cover no-repeat; display: grid; place-items: center; color: var(--primary-2); font-size: 2rem; }
.att .meta { padding: .5rem .7rem; font-size: .8rem; }
/* plaintext: a Latin name in the Arabic page keeps its start and loses its end to the ellipsis (not "…de-reference.png") */
.att .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
[dir="rtl"] .att .meta b { text-align: right; }
.att .meta small { color: var(--muted); }
.att .del { position: absolute; top: .4rem; inset-inline-end: .4rem; width: 30px; height: 30px; border-radius: var(--r-sm); border: 0; background: rgba(255,255,255,.92); color: var(--bad); cursor: pointer; opacity: 0; transition: opacity .15s; }
.att:hover .del, .att .del:focus-visible { opacity: 1; }
@media (hover: none) { .att .del { opacity: 1; } }   /* a touch screen has no hover to reveal it */
.att .kind { position: absolute; top: .4rem; inset-inline-start: .4rem; max-width: calc(100% - 3.2rem); }
.att .kind .pill { display: inline-block; background: rgba(20,43,56,.7); color: #fff; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploading { opacity: .6; }

/* ---------- massing model dock ---------- */
.model-dock { position: fixed; z-index: 60; top: calc(var(--top) + 12px); bottom: 12px; inset-inline-end: 12px; width: min(620px, 48vw); background: #0f2a38; border-radius: var(--r-lg); box-shadow: var(--sh-3); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; color: #e6f1f6;
  transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; transition: transform .45s var(--ease), opacity .3s; }
[dir=rtl] .model-dock { transform: translateX(calc(-100% - 24px)); }
.model-dock.open { transform: none; opacity: 1; pointer-events: auto; }
.model-dock.max { width: calc(100vw - 24px); }
.md-top { display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.md-top h3 { font-size: .95rem; flex: 1; display: flex; align-items: center; gap: .5rem; }
.md-top h3 i { color: var(--gold); }
.md-btn { height: 34px; min-width: 34px; padding: 0 .6rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #e6f1f6; cursor: pointer; font-size: .82rem; font-weight: 700; transition: background .15s; }
.md-btn:hover { background: rgba(255,255,255,.14); }
.md-btn.on { background: var(--teal); color: #0f2a38; border-color: var(--teal); }
.md-body { position: relative; min-height: 0; }
.md-body canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.md-body canvas:active { cursor: grabbing; }
.md-side { position: absolute; top: .8rem; inset-inline-start: .8rem; display: flex; flex-direction: column; gap: .35rem; }
.md-side .md-btn { justify-content: flex-start; }
.md-zoom { position: absolute; bottom: .8rem; inset-inline-start: .8rem; display: flex; gap: .35rem; }
.md-views { position: absolute; top: .8rem; inset-inline-end: .8rem; display: flex; flex-direction: column; gap: .35rem; }
.md-legend { position: absolute; bottom: .8rem; inset-inline-end: .8rem; font-size: .74rem; color: #a8c3cf; text-align: end; }
.md-foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: rgba(255,255,255,.08); border-top: 1px solid rgba(255,255,255,.08); }
.md-foot div { background: #0f2a38; padding: .6rem .7rem; }
.md-foot small { display: block; color: #8fb0be; font-size: .7rem; }
.md-foot b { font-size: .95rem; }
.md-foot .warn { color: var(--gold); }
@media (max-width: 900px) { .model-dock { width: calc(100vw - 24px); } }

/* ---------- palette & dialogs ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15,42,56,.42); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 1rem 1rem; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.overlay.center { align-items: center; padding-top: 1rem; }
.cmd { width: 100%; max-width: 620px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3); overflow: hidden; transform: translateY(-10px) scale(.98); transition: transform .25s var(--ease); }
.overlay.open .cmd, .overlay.open .dlg { transform: none; }
.cmd-input { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.cmd-input i { color: var(--muted); }
.cmd-input input { border: 0; padding: .2rem 0; font-size: 1.05rem; box-shadow: none !important; }
.cmd-list { max-height: 52vh; overflow-y: auto; padding: .4rem; }
.cmd-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: var(--r-sm); cursor: pointer; }
.cmd-item i { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--soft); color: var(--primary-2); font-size: .82rem; flex: none; }
.cmd-item .t { flex: 1; min-width: 0; }
.cmd-item .t b { display: block; font-size: .92rem; font-weight: 700; }
.cmd-item .t small { color: var(--muted); font-size: .76rem; }
.cmd-item.on { background: var(--tint); }
.cmd-item mark { background: rgba(255,205,5,.45); border-radius: 3px; color: inherit; }
.cmd-foot { display: flex; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }

.dlg { width: 100%; max-width: 480px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 1.5rem; transform: translateY(-10px) scale(.98); transition: transform .25s var(--ease); max-height: 86vh; overflow-y: auto; }
.dlg h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.dlg .lead { color: var(--muted); margin: 0 0 1.1rem; }
.dlg-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.2rem; }
.pick-list { display: flex; flex-direction: column; gap: .35rem; max-height: 46vh; overflow-y: auto; margin-top: .6rem; }
.pick { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--r-sm); border: 1.5px solid transparent; cursor: pointer; background: var(--soft); }
.pick:hover { border-color: #c3d6e0; }
.pick.on { border-color: var(--primary); background: var(--tint); }
.pick .t { flex: 1; } .pick .t small { display: block; color: var(--muted); font-size: .74rem; }
.client-card { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; border-radius: var(--r); background: var(--ok-bg); color: #155e43; margin-top: .6rem; animation: rise .25s var(--ease); }
.client-card.bad { background: var(--bad-bg); color: var(--bad); }
.client-card i { font-size: 1.4rem; }
/* the new-request confirmation (Scripts/requests.js) */
.dlg.new-dlg { max-width: 460px; text-align: center; }
.dlg.new-dlg .lead { margin-bottom: .9rem; }
.new-hero { margin-bottom: .9rem; }
.new-hero i { font-size: 2rem; color: var(--accent); width: 68px; height: 68px; display: inline-grid; place-items: center; border-radius: var(--r-lg); background: var(--tint-accent); }
.new-facts { list-style: none; margin: 0; padding: .75rem .9rem; background: var(--soft); border-radius: var(--r); display: grid; gap: .55rem; text-align: start; }
.new-facts li { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; color: var(--ink-2); line-height: 1.55; }
.new-facts i { color: var(--primary-2); margin-top: .25rem; width: 1.1rem; text-align: center; flex: none; }
.new-drafts { margin-top: .9rem; padding: .75rem; border: 1px dashed var(--line); border-radius: var(--r); text-align: start; display: grid; gap: .45rem; }
.new-drafts > b { font-size: .82rem; color: var(--ink-2); font-weight: 700; line-height: 1.5; }
.new-draft { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.new-draft:hover, .new-draft:focus-visible { border-color: var(--primary-2); background: var(--tint); }
.new-draft .nd-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.new-draft b { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.new-draft small { color: var(--muted); font-size: .75rem; }
.new-draft > i { color: var(--muted); }
.new-draft .ring { width: 36px; height: 36px; font-size: .62rem; }
.new-draft .ring::before { inset: 4px; }
.dlg.new-dlg .dlg-actions { justify-content: center; }
.dlg.new-dlg .dlg-actions .btn { min-width: 130px; justify-content: center; }
.approve-hero { text-align: center; margin-bottom: 1rem; }
.approve-hero i { font-size: 2.3rem; color: var(--ok); width: 72px; height: 72px; display: inline-grid; place-items: center; border-radius: var(--r-lg); background: var(--ok-bg); }
.burst { animation: burst .6s var(--ease); }
@keyframes burst { 0% { transform: scale(.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* toasts */
.toasts { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: var(--r-sm); box-shadow: var(--sh-3); font-weight: 600; font-size: .9rem; display: flex; gap: .55rem; align-items: center; animation: toastIn .3s var(--ease); pointer-events: auto; }
.toast.bad { background: var(--bad); } .toast.ok i { color: var(--teal); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
/* a toast's action (MD.toast act: "Undo") */
.toast-act { margin-inline-start: .4rem; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; font: inherit; font-weight: 800; font-size: .84rem; padding: .3rem .8rem; border-radius: 999px; cursor: pointer; transition: background .15s; }
.toast-act:hover { background: rgba(255,255,255,.24); }
.toast-act:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(108,202,208,.55); }

/* responsive workspace */
@media (max-width: 820px) {
  .ws, .ws.rail-mini { grid-template-columns: 0 minmax(0, 1fr); }
  .rail { position: fixed; top: var(--top); bottom: 0; inset-inline-start: 0; width: min(320px, 86vw); z-index: 41; transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: var(--sh-3); }
  [dir=rtl] .rail { transform: translateX(105%); }
  .ws.show-rail .rail { transform: none; }
  .qgrid { grid-template-columns: 1fr; }
  .q.fill > input, .q.fill > select, .q.fill > .unit-wrap, .q.fill > .gis-row { max-width: none; }
  .stage-inner { padding: 1.2rem 1rem 5rem; }
  .bar-actions .lbl-txt { display: none; }
}
.only-narrow { display: none; }
@media (max-width: 820px) { .only-narrow { display: inline-grid; } }

/* ---------- printable brief ---------- */
.brief-doc { max-width: 900px; margin: 1.5rem auto 4rem; background: #fff; border-radius: var(--r); box-shadow: var(--sh-2); padding: 2.2rem 2.4rem; }
.brief-doc header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 3px solid var(--primary); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.brief-doc header img { height: 42px; width: auto; }
.brief-doc h1 { font-size: 1.5rem; color: var(--primary); }
.brief-doc .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem 1rem; margin-bottom: 1.2rem; font-size: .9rem; }
.brief-doc .facts small { display: block; color: var(--muted); font-size: .75rem; }
.brief-doc section { break-inside: avoid; margin-bottom: 1.1rem; }
.brief-doc h2 { font-size: 1.05rem; color: var(--primary); display: flex; gap: .5rem; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: .35rem; margin-bottom: .5rem; }
.brief-doc dl { display: grid; grid-template-columns: 38% 1fr; gap: .25rem 1rem; margin: 0; font-size: .9rem; }
.brief-doc dt { color: var(--muted); }
.brief-doc dd { margin: 0; font-weight: 600; white-space: pre-wrap; }
.brief-doc dd .fl { color: var(--accent); font-weight: 700; font-size: .78rem; margin-inline-start: .4rem; }
.brief-doc table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.brief-doc th, .brief-doc td { padding: .35rem .5rem; border-bottom: 1px solid var(--line-2); text-align: start; }
.brief-doc th { color: var(--muted); font-weight: 700; font-size: .78rem; }
/* the client's signature only, at the page's end side (the left in Arabic) */
.sign { display: flex; justify-content: flex-end; margin-top: 2.5rem; font-size: .85rem; color: var(--muted); }
.sign div { width: min(240px, 100%); border-top: 1px solid var(--ink-2); padding-top: .4rem; }
.print-bar { max-width: 900px; margin: 1.2rem auto 0; display: flex; gap: .5rem; justify-content: space-between; align-items: flex-start; padding: 0 1rem; }
/* what the brief prints besides the answers (each off by default), and the model's view under them while it is ticked */
.print-bar .pb-opts { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; min-width: 0; }
.print-bar .pb-acts { display: flex; gap: .5rem; flex: none; }
.print-bar .pb-views { flex-wrap: wrap; }
.print-bar .pb-views[hidden] { display: none; }   /* .seg's inline-flex would keep it on screen */
.print-bar .pb-views button { padding: .4rem .75rem; font-size: .84rem; }
.print-bar .pb-views button[disabled] { opacity: .45; cursor: not-allowed; }
.print-bar .chip-btn:has(input:disabled) { opacity: .55; cursor: not-allowed; }
/* the plan's key under the brief's model (aerial picture or plan) */
.model-print .land-legend { display: flex; flex-wrap: wrap; gap: .25rem .8rem; margin-top: .45rem; font-size: .74rem; color: var(--ink-2); }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .print-bar, .toasts { display: none !important; }
  .brief-doc { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

/* ---------- settings (admin) ---------- */
.settings-page { max-width: 1100px; }
.set-card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1); border: 1px solid var(--line); margin-bottom: 1rem; overflow: hidden; }
.set-head { width: 100%; display: flex; align-items: center; gap: .8rem; padding: 1rem 1.25rem; border: 0; background: transparent; cursor: pointer; text-align: start; }
.set-ico { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--tint); color: var(--primary); font-size: 1.05rem; flex: none; }
.set-title { flex: 1; font-weight: 800; font-size: 1.02rem; }
.set-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .7rem; border-radius: 999px; background: #eef2f5; color: var(--ink-2); font-size: .78rem; font-weight: 700; }
.set-badge i { font-size: .45rem; }
.set-badge.custom { background: var(--tint-accent); color: #a3401a; }
.set-chev { color: var(--muted); transition: transform .25s var(--ease); }
.set-card.open .set-chev { transform: rotate(180deg); }
.set-body, .set-foot { display: none; }
.set-card.open .set-body { display: block; padding: 1.1rem 1.25rem 1.25rem; border-top: 1px solid var(--line); animation: rise .25s var(--ease); }
.set-card.open .set-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .9rem 1.25rem; border-top: 1px solid var(--line); background: var(--soft); }
.set-hint { margin: 0 0 1rem; color: var(--ink-2); }
.set-group { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .85rem; color: var(--primary); margin-bottom: .9rem; }
.set-group::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.set-field { display: flex; flex-direction: column; gap: .4rem; }
.set-field > span { font-weight: 700; font-size: .88rem; }
.set-field > span b { color: var(--accent); margin-inline-start: .2rem; }
.set-field input { text-align: center; font-weight: 700; font-size: 1.05rem; }
.set-field small { color: var(--muted); font-size: .76rem; }
.set-field small.err { color: var(--bad); font-weight: 600; }
.set-info { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.1rem; padding: .8rem 1rem; border-radius: var(--r-sm); background: var(--soft); border: 1px solid var(--line); font-size: .86rem; color: var(--ink-2); }
.set-info i { color: var(--primary-2); margin-top: .2rem; }
.set-error { margin: .8rem 0 0; }
.set-note { margin-inline-start: auto; font-size: .8rem; }
.set-card .timeline { padding: .2rem 0; }
@media (max-width: 760px) { .set-grid { grid-template-columns: 1fr; } .set-note { margin-inline-start: 0; } }
/* the setbacks dialog (library.js editSetbacks): the external blocks' distances from the villa (four kinds) and the majlis' /
   annex's share of their side */
.set-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.set-h { display: flex; align-items: center; gap: .5rem; margin: 1.3rem 0 .2rem; font-size: .95rem; font-weight: 800; color: var(--primary); }
.set-h i { color: var(--primary-2); font-size: .85rem; }
.set-sub { margin: 0 0 .7rem; font-size: .8rem; color: var(--muted); }
@media (max-width: 760px) { .set-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.alert.info { background: var(--tint); color: var(--primary); animation: none; }
.countdown { display: flex; flex-direction: column; align-items: center; margin: .2rem 0 .4rem; }
.countdown b { font-size: 2.6rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.countdown small { color: var(--muted); }

/* ---------- picture & model library popup (Scripts/library.js) ---------- */
.lib-dock { position: fixed; z-index: 60; top: calc(var(--top) + 10px); bottom: 10px; inset-inline-end: 10px; width: min(1180px, calc(100vw - 20px)); background: #0f2a38; border-radius: var(--r-lg); box-shadow: var(--sh-3);
  display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); overflow: hidden; color: #e6f1f6; transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; transition: transform .45s var(--ease), opacity .3s; }
[dir=rtl] .lib-dock { transform: translateX(calc(-100% - 24px)); }
.lib-dock.open { transform: none; opacity: 1; pointer-events: auto; }
.lib-dock.max { top: 10px; width: calc(100vw - 20px); z-index: 70; }
.lib-top { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-bottom: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.lib-top h3 { font-size: .98rem; display: flex; align-items: center; gap: .5rem; margin-inline-end: .4rem; white-space: nowrap; }
.lib-top h3 i { color: var(--gold); }
.lib-favchip { margin-inline-start: auto; }
/* the library & model beside a section, folded to a strip like the side panel (.lib-fold, the strip .lib-mini, the ] key) */
.lib-fold i { font-size: .8rem; }
.ws:not(.ws-studio) .lib-fold, .lib-mini { display: none; }
.lib-mini .md-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
.lib-mini .md-btn.on { background: rgba(255,255,255,.16); color: #fff; }
.lib-mini hr { width: 22px; border: 0; border-top: 1px solid rgba(255,255,255,.14); margin: .15rem 0; }
@media not all and (max-width: 1100px) and (orientation: portrait) {
  .ws-studio.dock-mini.sheet-open > .stage > .lib-dock { flex: 0 0 56px; grid-template-rows: minmax(0, 1fr); }
  .ws-studio.dock-mini.sheet-open > .stage > .lib-dock > :not(.lib-mini) { display: none; }
  .ws-studio.dock-mini.sheet-open .lib-mini { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .7rem 0; }
  .ws-studio.dock-mini.sheet-open .sheet { flex: 1; width: auto; }
  .ws-studio.dock-mini.sheet-open .sheet-scroll { width: 100%; }
  .ws-studio.dock-mini .sheet-size { display: none; }   /* the section already has all the room */
  /* the assistant's button rests in the strip as its round icon, off the section */
  .ws-studio.dock-mini.sheet-open ~ .assist:not(.open) { inset-inline-end: 8px; }
  .ws-studio.dock-mini.sheet-open ~ .assist:not(.open) .as-fab > span:not(.as-av),
  .ws-studio.dock-mini.sheet-open ~ .assist:not(.open) .as-fab > b { display: none; }
  .ws-studio.dock-mini.sheet-open ~ .assist:not(.open) .as-fab, [dir=rtl] .ws-studio.dock-mini.sheet-open ~ .assist:not(.open) .as-fab { padding: .35rem; }
}
@media (max-width: 1100px) and (orientation: portrait) { .lib-fold { display: none; } }   /* stacked: the section is a sheet over the design */
.lib-favchip i { color: #ff6b81; }
.lib-favchip.on { background: #ff6b81; border-color: #ff6b81; color: #fff; }
.lib-favchip.on i { color: #fff; }
.lib-save { font-size: .76rem; color: #8fb0be; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.lib-save.saved i { color: var(--teal); } .lib-save.error { color: #ffb4a8; }
.lib-pane { display: none; min-height: 0; position: relative; }
.lib-pane.on { display: flex; flex-direction: column; }
.lib-pane[data-pane=lib] { background: var(--bg); color: var(--ink); }
.lib-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--line); background: #fff; }
.lib-fams { display: flex; gap: .35rem; flex-wrap: wrap; }
.lib-fams .chip { padding: .36rem .7rem; font-size: .84rem; }
.lib-fams .chip small { opacity: .7; font-weight: 600; }
.lib-search { position: relative; flex: 1; min-width: 170px; }
.lib-search i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: .75rem; color: var(--muted); }
.lib-search input { padding: .48rem .8rem; padding-inline-start: 2.1rem; }
.lib-tools select { width: auto; padding: .48rem .6rem; }
.lib-tools .md-btn { background: var(--soft); color: var(--ink-2); border-color: var(--line); }
.lib-tools .md-btn.on { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-line); box-shadow: var(--sel-sh); }
/* grid-auto-rows: the cards clip their content (overflow: hidden), so without it the rows shrink to fit the visible height:
   91 designs became thin strips and 415 rows of 0 px (the "empty" All). --lib-min is the card size (S / M / L in library.js) */
.lib-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--lib-min, 270px), 100%), 1fr)); grid-auto-rows: max-content; gap: 1rem; align-content: start; }
.lib-sizes { display: inline-flex; gap: 2px; }
.lib-sizes .md-btn:first-child { border-start-end-radius: 0; border-end-end-radius: 0; }
.lib-sizes .md-btn:last-child { border-start-start-radius: 0; border-end-start-radius: 0; }
.lib-sizes .md-btn:not(:first-child):not(:last-child) { border-radius: 0; }
/* loading: cards shaped like the real ones (a picture, a name, a line of facts) */
.lib-skel { background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); padding-bottom: .7rem; }
.lib-skel i, .lib-skel b { display: block; background: linear-gradient(90deg, #eef3f6 25%, #f7fafb 50%, #eef3f6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.lib-skel i { aspect-ratio: 16 / 10; }
.lib-skel b { height: 12px; border-radius: var(--r-xs); margin: .7rem .7rem 0; width: 45%; }
.lib-skel b + b { width: 70%; margin-top: .45rem; }
.lib-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2rem; }
.lib-card { background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s; border: 2px solid transparent; }
.lib-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.lib-card.chosen { border-color: var(--ok); }
.lib-img { position: relative; aspect-ratio: 16 / 10; background: #e9eef1; }
.lib-img img { width: 100%; height: 100%; object-fit: cover; }
.lib-heart { position: absolute; top: .45rem; inset-inline-end: .45rem; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #c2185b; cursor: pointer; display: grid; place-items: center; font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .15s var(--ease); }
.lib-heart:hover { transform: scale(1.12); }
.lib-heart.on { background: #ff4d6d; color: #fff; animation: burst .45s var(--ease); }
.lib-heart[disabled] { cursor: default; opacity: .85; }
.lib-heart.big { position: static; width: 40px; height: 40px; margin-inline-start: auto; }
.lib-3d, .lib-chosen { position: absolute; bottom: .45rem; inset-inline-start: .45rem; background: rgba(15,42,56,.82); color: #fff; font-size: .72rem; font-weight: 800; padding: .15rem .5rem; border-radius: var(--r-xs); display: inline-flex; gap: .3rem; align-items: center; }
.lib-chosen { inset-inline-start: auto; inset-inline-end: .45rem; background: var(--ok); }
.lib-cap { padding: .5rem .7rem .6rem; }
.lib-cap b { font-size: .92rem; } .lib-cap small { color: var(--muted); margin-inline-start: .4rem; font-size: .76rem; }
.lib-meta { display: flex; gap: .8rem; font-size: .78rem; color: var(--ink-2); margin-top: .2rem; flex-wrap: wrap; }
.lib-meta i { color: var(--primary-2); margin-inline-end: .25rem; }
.lib-detail { position: absolute; inset: 0; background: #0f2a38; color: #e6f1f6; display: flex; flex-direction: column; z-index: 3; animation: rise .25s var(--ease); }
.lib-detail[hidden] { display: none; }
.ld-top { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; }
.ld-top .muted { color: #8fb0be; }
.ld-main { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 0 3.5rem; overflow: hidden; }
.ld-main img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); cursor: zoom-in; transition: transform .3s var(--ease); }
.ld-main.zoom img { transform: scale(1.6); cursor: zoom-out; }
.ld-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; z-index: 2; }
.ld-nav:hover { background: rgba(255,255,255,.25); }
.ld-nav.prev { inset-inline-start: .6rem; } .ld-nav.next { inset-inline-end: .6rem; }
.ld-strip { display: flex; gap: .4rem; justify-content: center; padding: .5rem; overflow-x: auto; }
.ld-strip img { height: 54px; border-radius: var(--r-xs); opacity: .55; cursor: pointer; border: 2px solid transparent; }
.ld-strip img.on { opacity: 1; border-color: var(--teal); }
.ld-info { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.ld-info > :not(.lib-meta) { grid-column: 2; }   /* the viewer's one action: in the middle, under the picture */
.ld-info .btn { padding: .78rem 1.7rem; font-size: 1rem; }
.ld-info .lib-meta { color: #cfe2ea; } .ld-info .lib-meta i { color: var(--teal); }
.ld-info .muted { color: #8fb0be; }

.gv-stage { --sky1: #c9b28c; --sky2: #ecd8b8; --sky3: #f3e3cd; position: relative; flex: 1; min-height: 0; overflow: hidden; background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 52%, var(--sky3) 100%); transition: background .6s; touch-action: none; color: var(--ink); }
.gv-stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
.gv-stage.dragging > svg { cursor: grabbing; }
.gv-stage .md-btn { background: rgba(15,42,56,.78); border-color: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(6px); }
.gv-stage .md-btn:hover { background: rgba(15,42,56,.92); }
.gv-stage .md-btn.on { background: var(--teal); color: #0f2a38; border-color: var(--teal); }
.gv-stage .md-btn[disabled] { opacity: .45; cursor: not-allowed; }
.st-msg { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: #0f2a38; z-index: 4; pointer-events: none; }
.st-msg[hidden] { display: none; }
.st-plot { position: absolute; top: .7rem; inset-inline-start: .7rem; max-width: 330px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px); border-radius: var(--r); padding: .6rem .7rem; box-shadow: var(--sh-2); font-size: .8rem; z-index: 2; }
.sp-head { font-weight: 800; color: var(--primary); margin-bottom: .35rem; display: flex; align-items: flex-start; gap: .4rem; }
.sp-head > span { flex: 1; min-width: 0; }
.sp-fold { flex: none; width: 26px; height: 26px; margin: -.15rem 0; border: 0; border-radius: var(--r-xs); background: var(--tint); color: var(--primary); cursor: pointer; display: grid; place-items: center; font-size: .72rem; }
.sp-fold:hover { background: var(--primary); color: #fff; }
.st-plot.folded .sp-more { display: none; }
.st-plot.folded .sp-state { margin-bottom: 0; }
.st-plot.folded .sp-head:last-child { margin-bottom: 0; }
.pip-show { box-shadow: var(--sh-2); }
.sp-state { display: inline-flex; gap: .35rem; align-items: center; font-weight: 700; padding: .12rem .5rem; border-radius: var(--r-xs); margin-bottom: .45rem; }
.sp-state.ok { background: var(--ok-bg); color: var(--ok); } .sp-state.warn { background: var(--warn-bg); color: var(--warn); } .sp-state.bad { background: var(--bad-bg); color: var(--bad); }
.sp-btns { display: flex; flex-wrap: wrap; gap: .3rem; }
.sp-btns .md-btn { height: 30px; font-size: .74rem; padding: 0 .5rem; }
.sp-note { margin-top: .4rem; color: var(--warn); font-weight: 600; }
.sp-hint { margin-top: .45rem; color: var(--muted); }
/* the design tools: one card under the views' row (library.js buildSide); its header folds it to a pill */
.st-side { --ss-top: 3.4rem; position: absolute; top: var(--ss-top); inset-inline-end: .7rem; width: 218px; max-height: calc(100% - var(--ss-top) - 4.6rem); display: flex; flex-direction: column; z-index: 2; color: #fff;
  background: rgba(15,42,56,.86); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r); box-shadow: 0 10px 28px rgba(8,28,38,.28); backdrop-filter: blur(8px); }
.st-side:empty { display: none; }
.st-side.folded { width: auto; border-radius: 999px; }
.ss-head { flex: none; display: flex; align-items: center; gap: .45rem; width: 100%; padding: .5rem .7rem; border: 0; background: transparent; color: inherit; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; border-radius: inherit; text-align: start; }
.ss-head:hover { background: rgba(255,255,255,.06); }
.ss-head > .fa-sliders { color: var(--teal); }
.ss-head > span { flex: 1; white-space: nowrap; }
.ss-chev { font-size: .7rem; opacity: .7; transition: transform .2s var(--ease); }
.st-side.folded .ss-chev { transform: rotate(180deg); }
.st-side:not(.folded) .ss-head { border-bottom: 1px solid rgba(255,255,255,.08); border-radius: var(--r) var(--r) 0 0; }
.ss-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(108,202,208,.25); }   /* folded with an edit panel open */
.ss-body { min-height: 0; overflow-y: auto; padding: .15rem .55rem .55rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.ss-body.opening { animation: ss-open .2s var(--ease); }
@keyframes ss-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ss-sec { display: flex; flex-direction: column; gap: .3rem; padding-top: .5rem; }
.ss-sec + .ss-sec { margin-top: .45rem; border-top: 1px solid rgba(255,255,255,.08); }
.ss-sec h4 { margin: 0; font-size: .64rem; font-weight: 700; color: rgba(255,255,255,.55); letter-spacing: .02em; }
/* buttons inside the card: lighter than the stage's own so they read on its dark glass */
.st-side .md-btn { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); backdrop-filter: none; }
.st-side .md-btn:hover { background: rgba(255,255,255,.15); }
.st-side .md-btn.on { background: var(--teal); color: #0f2a38; border-color: var(--teal); }
.st-erow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; }   /* Blocks, Landscape, Entrances, Windows: two by two */
.st-erow .md-btn { flex-direction: column; justify-content: center; height: auto; min-height: 46px; padding: .35rem .3rem; gap: .2rem; font-size: .7rem; line-height: 1.15; white-space: nowrap; }
.st-erow .md-btn i { font-size: 1rem; }
.st-erow .md-btn span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* a switch row: label, then the switch at the row's end */
.st-side .ss-tog { width: 100%; height: 30px; justify-content: flex-start; gap: .45rem; padding: 0 .55rem; font-size: .74rem; }
.ss-tog > i { width: 1rem; text-align: center; color: rgba(255,255,255,.7); }
.ss-tog > span { flex: 1; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-sw { position: relative; flex: none; width: 26px; height: 15px; border-radius: 999px; background: rgba(255,255,255,.22); transition: background .15s; }
.ss-sw::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s var(--ease); }
.ss-tog[aria-checked=true] .ss-sw { background: var(--teal); }
.ss-tog[aria-checked=true] .ss-sw::after { inset-inline-start: 13px; }
.ss-tog[aria-checked=true] > i { color: var(--teal); }
.ss-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; }   /* Labels, Dimensions: teal when shown */
.st-side .ss-pair .md-btn { min-width: 0; height: 30px; padding: 0 .3rem; gap: .3rem; font-size: .7rem; }
.ss-pair .md-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a choice of a few (storeys, size): a short label, then the options in one track */
.ss-line { display: flex; align-items: center; gap: .45rem; }
.ss-line > span { flex: none; min-width: 3.1rem; font-size: .7rem; font-weight: 700; color: rgba(255,255,255,.75); }
.ss-seg { flex: 1; display: flex; gap: 2px; padding: 2px; border-radius: var(--r-xs); background: rgba(0,0,0,.22); }
.st-side .ss-seg .md-btn { flex: 1 1 auto; min-width: 0; height: 26px; padding: 0 .3rem; border: 0; border-radius: 6px; background: transparent; font-size: .7rem; white-space: nowrap; }
.st-side .ss-seg .md-btn:not(.on):not([disabled]):hover { background: rgba(255,255,255,.12); }
.st-side .ss-seg .md-btn.on { background: var(--teal); color: #0f2a38; }
/* the wall's height under its switch */
.st-wallh { display: flex; flex-direction: column; gap: .2rem; padding: .4rem .55rem .45rem; border-radius: var(--r-xs); background: rgba(0,0,0,.18); border: 1px solid transparent; color: #fff; font-size: .7rem; font-weight: 700; }
.st-wallh b { color: var(--teal); }
.st-wallh input { width: 100%; accent-color: var(--teal); margin: 0; }
.st-wallh small { color: rgba(255,255,255,.7); font-size: .64rem; font-weight: 600; line-height: 1.35; }
.st-wallh.bad { border-color: #f59e0b; }
.st-wallh.bad b, .st-wallh.bad small { color: #fbbf24; }
.st-views { position: absolute; top: .7rem; inset-inline-end: .7rem; display: flex; gap: .3rem; z-index: 2; flex-wrap: wrap; justify-content: flex-end; }
.st-views [hidden] { display: none; }
.st-views .st-mapv { border-color: rgba(255,194,75,.55); }
.st-views [data-view=sat], .st-views [data-view=sat][hidden] + [data-view=plan] { margin-inline-start: .45rem; }
/* the plot from above (Green Villa css/styles.css .land-plan): aerial picture or plan, over the 3D stage */
.st-map { position: absolute; inset: 0; z-index: 1; background: #f4eedf; }
.st-map.sat { background: #3b4a3f; }
.st-map[hidden] { display: none; }
.st-map svg.land-plan { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; font-family: inherit; }
.land-plan .land-villa.can { cursor: grab; }
.st-map.dragging, .st-map.dragging .land-villa { cursor: grabbing; }
.st-map.dragging .land-villa polygon { fill-opacity: .7; }
.land-plan .land-edge { cursor: pointer; }
.land-plan .land-edge:hover { stroke: rgba(255,194,75,.45); }
/* the wall's gates on the plan: the body moves one along the wall, a round end widens it */
.land-plan .land-gate.can [data-gpart=body] { cursor: grab; }
.land-plan .land-gate.can .land-gate-end { cursor: ew-resize; }
.land-plan .land-gate.can:hover line:nth-of-type(2) { filter: brightness(1.25); }
.st-map.dragging .land-gate { cursor: grabbing; }
.st-map .land-legend { position: absolute; bottom: .7rem; left: 50%; transform: translateX(-50%); max-width: calc(100% - 9rem); display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .9rem; padding: .4rem .8rem; background: rgba(255,255,255,.92); border-radius: var(--r-sm); box-shadow: var(--sh-2); font-size: .76rem; color: var(--ink-2); }
.land-legend span { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.land-legend i { width: 1.1rem; height: .75rem; border-radius: 3px; display: inline-block; }
.land-legend .lg-plot { border: 2px solid #F15E25; background: rgba(241,94,37,.14); }
.land-legend .lg-build { border: 2px dashed #2E9E6B; background: rgba(46,158,107,.12); }
.land-legend .lg-villa { background: #1C5A7A; }
.land-legend .lg-street { height: .3rem; background: #FFC24B; }
.land-legend .lg-gate { height: .35rem; border-radius: 2px; } .land-legend .lg-gate.walk { background: #2E9E6B; } .land-legend .lg-gate.car { background: #1C5A7A; }
.gv-stage.mapping .st-bottom, .gv-stage.mapping .st-pip { display: none; }
.sp-export { margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--line); }
.dlg.revit-dlg { max-width: 640px; }
.rv-steps { padding-inline-start: 1.3rem; margin: 0 0 .9rem; line-height: 1.85; }
.rv-steps li { margin-bottom: .35rem; }
.rv-steps b, .rv-layers b { unicode-bidi: isolate; font-family: ui-monospace, Consolas, monospace; font-size: .86em; color: var(--primary); }
.rv-layers { gap: .35rem; }
/* the property line as Revit takes it: each side's distance and bearing from P1 */
.rv-table { width: 100%; border-collapse: collapse; margin: .2rem 0 .6rem; font-size: .84rem; }
.rv-table th { text-align: start; font-weight: 700; color: var(--muted); font-size: .76rem; padding: .3rem .5rem; border-bottom: 1px solid var(--line); }
.rv-table td { padding: .32rem .5rem; border-bottom: 1px solid var(--line-2); font-family: ui-monospace, Consolas, monospace; unicode-bidi: isolate; }
.rv-table tbody tr:nth-child(odd) { background: var(--soft); }
.rv-note { font-size: .78rem; line-height: 1.7; margin: 0 0 .8rem; }
.rv-note b { unicode-bidi: isolate; font-family: ui-monospace, Consolas, monospace; font-size: .86em; color: var(--primary); }
.st-pip { position: absolute; bottom: 4.2rem; inset-inline-end: .7rem; z-index: 2; }
.pip-card { width: 210px; background: rgba(255,255,255,.95); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-2); }
.pip-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; display: block; }
.pip-card > div { display: flex; align-items: center; gap: .4rem; padding: .35rem .5rem; color: var(--ink); font-size: .85rem; }
.pip-card .lib-heart { position: static; width: 30px; height: 30px; font-size: .85rem; margin-inline-start: auto; box-shadow: none; }
.pip-card .md-btn { height: 30px; min-width: 30px; }
.pip-empty { background: rgba(255,255,255,.9); border-radius: var(--r); padding: .6rem .8rem; color: var(--ink-2); font-size: .8rem; display: flex; gap: .6rem; align-items: center; box-shadow: var(--sh-2); max-width: 240px; }
.pip-empty i { font-size: 1.4rem; color: var(--primary-2); }
.pip-empty .md-btn { margin-top: .35rem; }
.st-bottom { position: absolute; bottom: .7rem; inset-inline: .7rem; display: flex; justify-content: space-between; gap: .6rem; align-items: center; z-index: 2; pointer-events: none; flex-wrap: wrap; }
.st-bottom > * { pointer-events: auto; }
.st-zoom { display: flex; gap: .3rem; }
.st-time { display: flex; align-items: center; gap: .45rem; background: rgba(15,42,56,.78); border-radius: var(--r-sm); padding: .3rem .55rem; color: #fff; backdrop-filter: blur(6px); }
.st-time input[type=range] { width: 160px; accent-color: var(--gold); padding: 0; border: 0; background: transparent; box-shadow: none; }
.st-time b { font-size: .82rem; min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; }
.st-time select { width: auto; padding: .2rem .4rem; border-radius: var(--r-xs); font-size: .8rem; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.st-time select option { color: #000; }
.st-time .md-btn { height: 30px; min-width: 30px; }
.st-foot { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* the scene's own SVG classes (Green Villa css/styles.css) */
.gv-stage .dims .dim-line { stroke: #0F2A3A; stroke-width: 1.6; opacity: .75; }
.gv-stage .dims .dim-ext { stroke: #0F2A3A; stroke-width: 1; stroke-dasharray: 3 3; opacity: .45; }
.gv-stage .dims .dim-end { fill: #0F2A3A; opacity: .8; }
.gv-stage .dim-chip rect { fill: #1C5A7A; }
.gv-stage .dim-chip text { fill: #fff; font-size: 12px; font-weight: 600; }
.gv-stage .hour-mark { fill: #7a4a06; font-weight: 600; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; }
.gv-stage .sun-rays { animation: spin 40s linear infinite; transform-box: fill-box; transform-origin: center; }
.gv-stage .facade-chip.hot rect { stroke: #fff; stroke-width: 2; }
.gv-stage .lamp-glow { animation: lamp 3s ease-in-out infinite; }
@keyframes lamp { 50% { opacity: .82; } }
@media (max-width: 900px) { .st-plot { max-width: 210px; } .st-pip { display: none; } .st-time input[type=range] { width: 100px; } .lib-top h3 span { display: none; } }

/* ---------- blocks & landscape: the model edited on its plan (Scripts/gvedit.js) ---------- */
.gv-stage { --ge-w: min(380px, 44%); }
.st-edit { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: var(--ge-w); z-index: 3; background: #fff; color: var(--ink); display: flex; flex-direction: column; box-shadow: var(--sh-2); border-inline-end: 1px solid var(--line); }
.st-edit[hidden] { display: none; }
.gv-stage.editing > svg { inset-inline-start: var(--ge-w); width: calc(100% - var(--ge-w)); }
.gv-stage.editing .st-map { inset-inline-start: var(--ge-w); }   /* the aerial picture or plan, beside the panel */
.gv-stage.editing .st-plot { inset-inline-start: calc(var(--ge-w) + .7rem); max-width: 260px; }
.gv-stage.editing .st-bottom { inset-inline-start: calc(var(--ge-w) + .7rem); }
/* the panel's width dragged at its edge (library.js geSet): kept per browser, never leaving the model less than 260px */
.gv-stage.ge-sized { --ge-w: min(var(--ge-user), calc(100% - 260px)); }
.gv-stage.ge-sized .ge-plan { max-height: max(340px, 58vh); }   /* a wider panel shows its plan larger */
.st-grip { display: none; position: absolute; top: 0; bottom: 0; inset-inline-start: calc(var(--ge-w) - 5px); width: 10px; z-index: 4; cursor: col-resize; touch-action: none; }
.gv-stage.editing > .st-grip { display: block; }
.st-grip::after { content: ''; position: absolute; top: 50%; inset-inline-start: 3px; width: 4px; height: 46px; margin-top: -23px; border-radius: 4px; background: #c9d3da; box-shadow: 0 0 0 2px #fff, var(--sh-1); transition: background .15s, height .15s, margin-top .15s; }
.st-grip:hover::after, .st-grip.on::after, .st-grip:focus-visible::after { background: var(--primary-2); height: 64px; margin-top: -32px; }
.st-grip:focus-visible { outline: none; }
.gv-stage.ge-resizing { cursor: col-resize; user-select: none; }
.gv-stage.ge-resizing > svg, .gv-stage.ge-resizing .st-map, .gv-stage.ge-resizing .st-edit { pointer-events: none; }
.ge-top { display: flex; align-items: center; gap: .4rem; padding: .5rem .6rem; border-bottom: 1px solid var(--line); background: var(--soft); }
.ge-tabs { display: inline-flex; flex: 1; gap: 3px; background: var(--line-2); border-radius: var(--r-sm); padding: 3px; }
.ge-tab { flex: 1; border: 0; background: transparent; color: var(--ink-2); padding: .4rem .6rem; border-radius: var(--r-xs); font-weight: 800; font-size: .84rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.ge-tab.on { background: #fff; color: var(--primary); box-shadow: var(--sh-1); }
.ge-tabs .ge-tab { min-width: 0; padding: .4rem .3rem; font-size: .76rem; gap: .25rem; white-space: nowrap; }   /* four tabs in the panel's width */
.ge-tabs .ge-tab i { font-size: .8rem; }
/* a narrow panel (dragged narrower, or a narrow stage): the tabs keep their icons, their names in the tooltip, so the × stays in view */
.st-edit { container: ge / inline-size; }
.ge-tabs { min-width: 0; }
@container ge (max-width: 369px) {
  .ge-tabs .ge-tab { font-size: 0; gap: 0; padding: .45rem 0; }
  .ge-tabs .ge-tab i { font-size: .95rem; }
}
.ge-x { width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; }
.ge-x:hover { background: var(--tint); color: var(--primary); }
.ge-body { flex: 1; min-height: 0; overflow-y: auto; padding: .6rem .7rem 1rem; font-size: .82rem; }
.st-edit .md-btn { background: var(--soft); color: var(--ink-2); border-color: var(--line); height: 32px; font-size: .78rem; backdrop-filter: none; }
.st-edit .md-btn:hover { background: var(--tint); color: var(--primary); }
.st-edit .md-btn.on { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-line); }
.st-edit .md-btn.ge-del { color: var(--bad); }
.st-edit button[disabled] { opacity: .45; cursor: not-allowed; }
.ge-lbl { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-weight: 800; color: var(--ink-2); margin: .7rem 0 .35rem; font-size: .78rem; }
.ge-lbl:first-child { margin-top: .1rem; }
.ge-lbl b { font-weight: 700; color: var(--primary); }
.ge-note { color: var(--muted); margin: .45rem 0; line-height: 1.6; font-size: .78rem; }
.ge-note i { color: var(--primary-2); }
.ge-link { border: 0; background: none; color: var(--primary-2); font-weight: 700; cursor: pointer; padding: 0; font-size: .78rem; text-decoration: underline; }
.ge-bar { display: flex; flex-wrap: wrap; gap: .35rem; margin: .55rem 0; }
.ge-bar.ge-end { margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.ge-warn { display: flex; gap: .45rem; align-items: flex-start; background: var(--warn-bg); color: #8a5a10; border-radius: var(--r-sm); padding: .45rem .6rem; margin: .5rem 0; line-height: 1.55; }
.ge-warn i { margin-top: .2rem; }
.ge-tpls, .ge-profs, .ge-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .35rem; }
.ge-tp, .ge-pf { position: relative; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: .35rem .25rem .3rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .7rem; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.25; }
.ge-tp svg, .ge-pf svg { width: 40px; height: 30px; }
.ge-tp[aria-pressed=true], .ge-pf[aria-pressed=true] { border-color: var(--primary); background: var(--tint); color: var(--primary); }
.ge-tp.want { border-style: dashed; border-color: var(--accent); }
.ge-tp em { position: absolute; top: -7px; inset-inline-end: 4px; background: var(--accent); color: #fff; font-style: normal; font-size: .6rem; padding: 0 .3rem; border-radius: var(--r-xs); }
.ge-tp-ico { width: 40px; height: 30px; display: grid; place-items: center; font-size: 1.1rem; color: var(--primary-2); }
.ge-tp svg .L0, .ge-pf svg .L0 { fill: #9dc3d3; stroke: #19597a; stroke-width: .5; }
.ge-tp svg .L1 { fill: #19597a; fill-opacity: .55; stroke: #19597a; stroke-width: .5; }
.ge-lvs { display: flex; gap: .3rem; margin: .7rem 0 .45rem; }
.ge-lv { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: .3rem .4rem; cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: .35rem; text-align: start; align-items: center; }
.ge-lv i { grid-row: span 2; width: 10px; height: 10px; border-radius: 3px; background: #9dc3d3; }
.ge-lv.L1 i { background: #e2a75b; } .ge-lv.L2 i { background: #b07fd0; }
.ge-lv.L3 i { background: #5fb3a1; }   /* the mezzanine, between the ground and the first floor */
.ge-lv.want:not(.on) { border-style: dashed; border-color: var(--accent); }   /* the brief asks for it, nothing drawn yet */
.ge-lv b { font-size: .76rem; } .ge-lv small { color: var(--muted); font-size: .68rem; }
.ge-lv.on { border-color: var(--primary); background: var(--tint); }
/* the external block (a majlis or an annex apart from the villa): its tab, its plan and where it may stand */
.ge-lvs { flex-wrap: wrap; }   /* equal tabs while they fit; else the last ones go to a second row — never cut */
.ge-lv { flex: 1 1 0; min-width: max-content; }
.ge-lv b, .ge-lv small { white-space: nowrap; }
.ge-lv.LX { border-style: dashed; } .ge-lv.LX.on { border-style: solid; }
.ge-lv.LX i { background: #b9875a; }
.ge-tp small { color: var(--muted); font-weight: 600; }
.ge-plan .ge-b.LX > polygon { fill: #e8cfae; stroke: #8a5a2b; stroke-width: .12; }
.ge-plan .ge-b.LX.on > polygon { stroke: #F15E25; stroke-width: .22; }
.ge-plan .ge-b.LX.weak > polygon { fill: #f4b4b4; stroke: var(--bad); }
.ge-plan .ge-xzone { fill: rgba(138,90,43,.05); stroke: #8a5a2b; stroke-width: .1; stroke-dasharray: .5 .35; }
.ge-plan .ge-xgate { fill: rgba(46,158,107,.14); stroke: #2E9E6B; stroke-width: .08; stroke-dasharray: .3 .2; pointer-events: none; }   /* a gate's way in, kept clear */
.ge-plan .ge-xgate.car { fill: rgba(28,90,122,.12); stroke: #1C5A7A; }
.ge-plan .ge-xfaint { fill: #8a5a2b; fill-opacity: .12; stroke: #8a5a2b; stroke-opacity: .5; stroke-width: .08; stroke-dasharray: .35 .25; pointer-events: none; }
.ge-plan .ge-draw.x { fill: rgba(138,90,43,.18); stroke: #8a5a2b; }
.ge-kv small { display: block; color: var(--muted); font-size: .66rem; font-weight: 600; }
/* the external block's height against the regulations (annexHeight / majlisHeight) */
.ge-rule { display: flex; gap: .4rem; align-items: flex-start; margin: .45rem 0; padding: .35rem .55rem; border-radius: var(--r-sm); font-size: .76rem; line-height: 1.55; }
.ge-rule i { margin-top: .2rem; }
.ge-rule.ok { background: #e7f5ee; color: #1d7a52; }
.ge-rule.bad { background: #fdecec; color: var(--bad); font-weight: 700; }
.ge-rule.pend { background: var(--soft); color: var(--muted); }
.ge-warn.bad { background: #fdecec; color: #a12d2d; }
.ge-tp-ico { position: relative; }
.ge-tp-x2 { position: absolute; inset-inline-end: 2px; bottom: 0; font-size: .58rem; font-weight: 800; color: #fff; background: #8a5a2b; border-radius: 4px; padding: 0 .2rem; line-height: 1.4; }
.ge-wrap { background: #f6f3ea; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.ge-plan { display: block; width: 100%; height: auto; max-height: 340px; touch-action: none; user-select: none; font-family: inherit; }
.ge-plan .ge-g { stroke: #e6e0d0; stroke-width: .04; } .ge-plan .ge-g.b { stroke: #d6cdb6; stroke-width: .07; }
.ge-plan .ge-plot { fill: #fbf8f0; stroke: #F15E25; stroke-width: .18; }
.ge-plan .ge-build { fill: rgba(46,158,107,.07); stroke: #2E9E6B; stroke-width: .12; stroke-dasharray: .5 .35; }
/* the setbacks' lines as on the plan beside the panel (library.js mapDyn): the street front, the ground floor's limit */
.ge-plan .ge-street { stroke: #FFC24B; stroke-width: .42; stroke-linecap: round; pointer-events: none; }
.ge-plan .ge-ground { fill: rgba(28,90,122,.06); stroke: #1C5A7A; stroke-width: .17; stroke-dasharray: .3 .3; pointer-events: none; }
.ge-key { display: flex; flex-wrap: wrap; gap: .25rem .75rem; padding: .35rem .6rem; border-top: 1px solid var(--line); background: #fff; font-size: .7rem; color: var(--ink-2); }
.ge-key span { display: inline-flex; align-items: center; gap: .3rem; }
.ge-key i { width: 16px; height: 10px; border-radius: 2px; flex: none; }
.ge-key .k-plot { border: 2px solid #F15E25; background: #fbf8f0; }
.ge-key .k-street { height: 4px; background: #FFC24B; }
.ge-key .k-build { border: 2px dashed #2E9E6B; background: rgba(46,158,107,.12); }
.ge-key .k-ground { border: 2px dashed #1C5A7A; background: rgba(28,90,122,.1); }
.ge-plan .ge-front { fill: #b86a3c; font-weight: 800; text-anchor: middle; }
.ge-plan .ge-ghost { fill: rgba(25,89,122,.08); stroke: #19597a; stroke-width: .12; stroke-dasharray: .45 .3; }
.ge-plan .ge-under { fill: #19597a; fill-opacity: .07; stroke: #19597a; stroke-opacity: .3; stroke-width: .08; }
.ge-plan .ge-under.near { fill-opacity: .14; stroke-opacity: .5; }
.ge-plan .ge-over { fill: none; stroke: #b07fd0; stroke-width: .1; stroke-dasharray: .4 .3; }
.ge-plan .ge-b { cursor: grab; }
.ge-plan .ge-b > rect, .ge-plan .ge-b > polygon, .ge-plan .ge-b > path { fill: #9dc3d3; stroke: #19597a; stroke-width: .12; }
.ge-plan .ge-b.L1 > rect, .ge-plan .ge-b.L1 > polygon, .ge-plan .ge-b.L1 > path { fill: #f0c48a; stroke: #a8692a; }
.ge-plan .ge-b.L2 > rect, .ge-plan .ge-b.L2 > polygon, .ge-plan .ge-b.L2 > path { fill: #d6b8ea; stroke: #7d4aa3; }
.ge-plan .ge-b.L3 > rect, .ge-plan .ge-b.L3 > polygon, .ge-plan .ge-b.L3 > path { fill: #b5e0d6; stroke: #2f7d6c; }
.ge-plan .ge-b.on > rect, .ge-plan .ge-b.on > polygon, .ge-plan .ge-b.on > path { stroke: #F15E25; stroke-width: .22; }
.ge-plan .ge-b.weak > rect, .ge-plan .ge-b.weak > polygon, .ge-plan .ge-b.weak > path { fill: #f4b4b4; stroke: var(--bad); }
.ge-plan .ge-t { fill: #0f2a38; font-weight: 800; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.ge-plan .ge-d { fill: #3d5564; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.ge-plan .ge-h { cursor: pointer; }
.ge-plan .ge-h .hit { fill: transparent; stroke: none; }
.ge-plan .ge-h circle:not(.hit), .ge-plan .ge-h rect { fill: #fff; stroke: #F15E25; stroke-width: .14; }
.ge-plan .ge-rot circle:not(.hit) { fill: #F15E25; stroke: #fff; }
.ge-plan .ge-rotl { stroke: #F15E25; stroke-width: .08; stroke-dasharray: .3 .2; }
.ge-plan .ge-frame { fill: none; stroke: #F15E25; stroke-width: .06; stroke-dasharray: .3 .2; }
/* several blocks picked (gvedit.js picks): their frame, turned with the orange handle above it; Shift + drag's frame */
.ge-plan .ge-gframe { fill: rgba(241,94,37,.04); stroke: #F15E25; stroke-width: .1; stroke-dasharray: .45 .3; pointer-events: none; }
.ge-plan .ge-marq { fill: rgba(28,90,122,.08); stroke: #1C5A7A; stroke-width: .1; stroke-dasharray: .35 .25; pointer-events: none; }
/* undo / redo beside the save state (library.js histGo) */
.lib-hist { display: inline-flex; gap: 3px; }
.lib-hist[hidden] { display: none; }
.lib-hist .md-btn { width: 32px; padding: 0; justify-content: center; }
.lib-hist .md-btn[disabled] { opacity: .35; cursor: default; }
.ge-plan .ge-guide { stroke: #2a9fd6; stroke-width: .07; stroke-dasharray: .4 .25; }
.ge-plan .ge-angle { fill: #F15E25; font-weight: 800; text-anchor: middle; }
.ge-plan .ge-draw { fill: rgba(25,89,122,.18); stroke: #19597a; stroke-width: .14; stroke-dasharray: .4 .25; }
.ge-plan .ge-draw.bad { fill: rgba(214,69,69,.15); stroke: var(--bad); }
.ge-plan .ge-draw-t { fill: #0f2a38; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.ge-plan .ge-n circle { fill: rgba(255,255,255,.9); stroke: #c9bfa6; stroke-width: .08; }
.ge-plan .ge-n path { stroke: #F15E25; stroke-width: .22; stroke-linecap: round; }
.ge-plan .ge-n text { fill: #F15E25; font-weight: 800; text-anchor: middle; }
.ge-plan .ge-house { fill: #b9c4cb; stroke: #7b8d98; stroke-width: .1; }
.ge-plan.ge-ls { cursor: crosshair; }
.ge-plan.ge-ls.erasing { cursor: not-allowed; }
.ge-plan .ge-p { cursor: grab; }
.ge-plan .ge-p.on > * { stroke: #F15E25; stroke-width: .2; }
.ge-sel { margin-top: .6rem; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--soft); }
.ge-sel-info { font-weight: 800; color: var(--primary); margin: 0 0 .2rem; }
.ge-nums { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.ge-f { display: flex; flex-direction: column; gap: .15rem; font-size: .72rem; color: var(--ink-2); font-weight: 700; min-width: 0; }
.ge-in { position: relative; display: block; }
.ge-in input { padding: .35rem .5rem; padding-inline-end: 1.6rem; border-radius: var(--r-xs); font-size: .82rem; border-width: 1px; }
.ge-in i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: .5rem; font-style: normal; color: var(--muted); font-size: .72rem; }
.ge-hrow { display: grid; grid-template-columns: 96px 1fr; gap: .4rem; align-items: end; }
.ge-seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.ge-seg button { flex: 1; border: 0; border-inline-end: 1px solid var(--line); background: transparent; padding: .35rem .3rem; font-size: .74rem; font-weight: 700; color: var(--ink-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.ge-seg button:last-child { border-inline-end: 0; }
.ge-seg button small { font-size: .66rem; color: var(--muted); }
.ge-seg button[aria-pressed=true] { background: var(--sel-bg); color: var(--sel-ink); box-shadow: inset 0 0 0 1px var(--sel-line); }
.ge-seg button[aria-pressed=true] small { color: var(--primary-2); }
.ge-seg button:disabled { color: var(--muted); cursor: not-allowed; background: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(0,0,0,.04) 4px, rgba(0,0,0,.04) 8px); }   /* a side next to a neighbour: no gate there */
.ge-slider { display: grid; grid-template-columns: auto 1fr 42px; gap: .5rem; align-items: center; margin: .3rem 0; font-size: .74rem; color: var(--ink-2); font-weight: 700; }
.ge-slider input { padding: 0; border: 0; box-shadow: none; accent-color: var(--primary); }
.ge-slider b { text-align: end; font-variant-numeric: tabular-nums; }
.ge-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; margin: .6rem 0; }
.ge-kv div { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .35rem .45rem; display: flex; flex-direction: column; }
.ge-kv span { font-size: .68rem; color: var(--muted); font-weight: 700; } .ge-kv b { font-size: .86rem; }
.ge-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
.ge-tool { border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: .35rem .3rem; cursor: pointer; display: grid; grid-template-columns: 28px 1fr; column-gap: .3rem; text-align: start; align-items: center; }
.ge-tool svg { grid-row: span 2; width: 28px; height: 28px; }
.ge-tool b { font-size: .74rem; line-height: 1.2; } .ge-tool small { font-size: .64rem; color: var(--muted); line-height: 1.25; }
.ge-tool[aria-pressed=true] { border-color: var(--ok); background: var(--ok-bg); }
.ge-tool[aria-pressed=true] b { color: var(--ok); }
.ge-kinds .ge-pf svg { width: 28px; height: 28px; }
.ge-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.ge-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .2rem .6rem; font-size: .74rem; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.ge-chip[aria-pressed=true] { background: var(--ok); border-color: var(--ok); color: #fff; }
.ge-sps { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
.ge-sp { border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: .3rem .45rem; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: .1rem; position: relative; }
.ge-sp b { font-size: .76rem; } .ge-sp small { font-size: .66rem; color: var(--muted); line-height: 1.3; }
.ge-sp em { font-style: normal; font-size: .6rem; color: var(--warn); font-weight: 700; }
.ge-sp[aria-pressed=true] { border-color: var(--ok); background: var(--ok-bg); }
.ge-cols { display: flex; flex-wrap: wrap; gap: .3rem; }
.ge-col { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.ge-col.usual { background: conic-gradient(var(--c) 0 50%, #fff 0); }
.ge-col[aria-pressed=true] { box-shadow: 0 0 0 2px var(--primary); }
.ge-seg.wide button { padding: .4rem .3rem; }
.ge-sum { display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0 .2rem; }
.ge-sum span { background: var(--ok-bg); color: #17704e; border-radius: var(--r-xs); padding: .15rem .5rem; font-size: .74rem; font-weight: 700; }
/* the wall's gates: dragged on the 3D wall (a target over the opening, round ends, a tag with the width and the suitable size) */
.gt-layer .gt-body { fill: transparent; stroke: transparent; stroke-width: 2; }
.gt-layer .gt-body.can { cursor: grab; }
.gt-layer .gt:hover .gt-body, .gt-layer .gt.on .gt-body, .gt-layer.show .gt-body { fill: var(--gc); fill-opacity: .2; stroke: var(--gc); stroke-dasharray: 6 4; }
.gt-layer .gt-deco { opacity: 0; transition: opacity .15s; }
.gt-layer .gt:hover .gt-deco, .gt-layer .gt.on .gt-deco, .gt-layer.show .gt-deco { opacity: 1; }
.gt-layer .gt-tag { pointer-events: none; }
.gt-layer .gt-hit { fill: transparent; cursor: ew-resize; }
.gt-layer .gt-hit.gt-v, .gt-layer .gt-h.gt-v { cursor: ns-resize; }
.gt-layer .gt-h { fill: #fff; stroke: var(--gc); stroke-width: 3; cursor: ew-resize; }
.gt-layer .gt-ends:hover .gt-h { fill: var(--gc); }
.gt-layer .gt-tag rect { fill: rgba(15,42,56,.9); }
.gt-layer .gt-tag text { fill: #fff; font-size: 12px; font-weight: 700; }
.gt-layer .gt-tag .gt-rec { font-size: 10.5px; font-weight: 600; }
.gt-layer .gt-tag .gt-rec.ok { fill: #8fe3c0; } .gt-layer .gt-tag .gt-rec.warn { fill: #ffd27a; }
.gv-stage.dragging .gt-layer .gt-body.can, .gv-stage.dragging .gt-layer .gt-h { cursor: grabbing; }
/* the windows on the model while the Windows panel is open (gvedit.js winOverlay) */
.wo-layer .wo-win { fill: transparent; stroke: transparent; stroke-width: 1.5; cursor: pointer; transition: fill .12s; }
.wo-layer .wo-fac:hover .wo-win { fill: rgba(62,159,184,.28); stroke: #3e9fb8; stroke-dasharray: 4 3; }
.wo-layer .wo-fac.sel .wo-win { fill: rgba(25,89,122,.22); stroke: #19597a; stroke-dasharray: none; }
.wo-layer .wo-fac.sel.byfloor .wo-win { fill: rgba(25,89,122,.08); stroke: rgba(25,89,122,.35); }
.wo-layer .wo-fac.sel.byfloor .wo-win.fl { fill: rgba(240,93,34,.25); stroke: #f05d22; }
.wo-layer .wo-h line { stroke: #19597a; stroke-width: 2; stroke-dasharray: 3 3; pointer-events: none; }
.wo-layer .gt-hit { fill: transparent; cursor: ns-resize; }
.wo-layer .wo-knob { fill: #fff; stroke: #19597a; stroke-width: 3; cursor: ns-resize; }
.wo-layer .wo-h:hover .wo-knob, .wo-layer.dragging .wo-knob { fill: #19597a; }
.wo-layer .wo-tag rect { fill: rgba(15,42,56,.92); }
.wo-layer .wo-tag text { fill: #fff; }
.wo-layer .wo-t1 { font-size: 12px; font-weight: 800; }
.wo-layer .wo-t2 { font-size: 11px; font-weight: 700; fill: #8fe3c0 !important; }
.wo-layer .wo-chip { cursor: pointer; }
.wo-layer .wo-chip rect { fill: rgba(255,255,255,.12); stroke: rgba(255,255,255,.35); }
.wo-layer .wo-chip text { font-size: 10px; font-weight: 700; }
.wo-layer .wo-chip:hover rect { fill: rgba(255,255,255,.25); }
.wo-layer .wo-chip.on rect { fill: #6ccad0; stroke: #6ccad0; }
.wo-layer .wo-chip.on text { fill: #0f2a38; }
.wo-layer .wo-x { cursor: pointer; }
.wo-layer .wo-x circle { fill: rgba(255,255,255,.14); }
.wo-layer .wo-x path { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.wo-layer .wo-x:hover circle { fill: rgba(255,255,255,.3); }
.gv-stage.dragging .wo-layer .wo-knob { cursor: grabbing; }
.wp-3dhint { display: flex; gap: .45rem; align-items: flex-start; margin: .2rem 0 .5rem; padding: .45rem .6rem; border-radius: var(--r-sm); background: var(--tint); color: var(--primary); font-size: .76rem; font-weight: 600; line-height: 1.55; }
.wp-3dhint i { margin-top: .2rem; }
.wp-fac.sel { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(25,89,122,.12); }
.wp-pick { cursor: pointer; }
.wp-pick:hover { color: var(--primary); text-decoration: underline; }
.ge-plan .ge-wall { fill: none; stroke: #8f9ba3; stroke-width: .3; }
.ge-plan.ge-gt { cursor: default; }
.ge-plan .ge-gate { cursor: grab; }
.ge-plan .ge-gate .hit { stroke: transparent; }
.ge-plan .ge-gh { cursor: ew-resize; }
.ge-plan .ge-gh .hit { fill: transparent; }
.ge-plan .ge-gh circle:not(.hit) { fill: #fff; stroke-width: .2; }
.ge-plan .ge-gate text { font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: .3; pointer-events: none; }
.ge-plan .ge-gate.on .ge-gl { stroke-dasharray: .6 .3; }
.ge-gatebox { border-inline-start: 4px solid var(--gc); }
.ge-gate-head { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.ge-gate-head i { color: var(--gc); }
.ge-gate-head .ge-gw { margin-inline-start: auto; font-weight: 800; font-size: 1.05rem; color: var(--gc); }
.ge-adv { display: flex; gap: .4rem; align-items: flex-start; border-radius: var(--r-sm); padding: .35rem .5rem; margin: .45rem 0; font-size: .76rem; line-height: 1.5; }
.ge-adv.ok { background: var(--ok-bg); color: #17704e; } .ge-adv.warn { background: var(--warn-bg); color: #8a5a10; }
.ge-adv i { margin-top: .2rem; }
/* the Windows panel (Scripts/gvedit.js winBody) */
.ge-adv.bad { background: var(--bad-bg); color: #a12f2f; } .ge-adv.tip { background: var(--tint); color: var(--primary); }
.wp-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; }
.wp-preset { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .45rem .2rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; color: var(--ink-2); }
.wp-preset i { font-size: .95rem; color: var(--primary-2); }
.wp-preset b { font-size: .7rem; white-space: nowrap; }
.wp-preset[aria-pressed=true] { border-color: var(--primary); background: var(--tint); color: var(--primary); box-shadow: 0 0 0 2px rgba(25,89,122,.12); }
.wp-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; }
.wp-size { position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem .2rem .35rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; color: var(--ink-2); }
.wp-size svg { width: 38px; height: 30px; }
.wp-sz-wall { fill: #efe9dc; stroke: #cfc5b0; }
.wp-sz-win { fill: #7fb8d6; stroke: #4f8fb0; }
.wp-size b { font-size: .72rem; }
.wp-size em { position: absolute; top: -.45rem; inset-inline-end: .3rem; font-style: normal; font-size: .58rem; font-weight: 800; padding: 0 .35rem; border-radius: 99px; background: var(--gold); color: #3b3000; }
.wp-size[aria-pressed=true] { border-color: var(--primary); background: var(--tint); color: var(--primary); }
.wp-legend { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; font-size: .66rem; color: var(--muted); }
.wp-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-inline-start: .3rem; }
.wp-wrap { padding: .2rem; }
.wp-plan { display: block; width: 100%; height: auto; max-height: 200px; }
.wp-villa { fill: #e4ddcd; stroke: #b9ad94; stroke-width: 1; }
.wp-side { cursor: pointer; }
.wp-side .wp-hit { stroke: transparent; stroke-width: 20; }
.wp-side .wp-wall { stroke: var(--hc); stroke-width: 10; stroke-linecap: round; opacity: .35; }
.wp-side.on .wp-wall { opacity: .9; }
.wp-side:not(.on) .wp-wall { stroke-dasharray: 2 5; stroke: #9aa7af; stroke-width: 3; opacity: .9; }
.wp-side .wp-glass { stroke: #fff; stroke-linecap: butt; }
.wp-side text { font-size: 9px; font-weight: 700; fill: var(--ink-2); }
.wp-side:hover .wp-wall, .wp-side.hl .wp-wall { opacity: 1; stroke-width: 13; }
.wp-street { font-size: 9px; font-weight: 800; fill: var(--muted); letter-spacing: .05em; }
.wp-north circle { fill: #fff; stroke: var(--line); }
.wp-north line { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.wp-north text { font-size: 8px; font-weight: 800; fill: var(--accent); }
.wp-facs { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.wp-fac { padding: .4rem .55rem .2rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; transition: border-color .15s, background .15s; }
.wp-fac.hl { border-color: var(--primary-2); }
.wp-fac.off { background: var(--soft); padding-bottom: .4rem; }
.wp-fac.off b { color: var(--muted); }
.wp-fac-h { display: flex; align-items: center; gap: .45rem; font-size: .78rem; }
.wp-fac-h b small { font-weight: 600; color: var(--muted); }
.wp-dir { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 700; color: var(--ink-2); padding: .05rem .4rem; border-radius: 99px; background: var(--soft); }
.wp-dir i { width: 7px; height: 7px; border-radius: 50%; background: var(--hc); }
.wp-glass-pct { margin-inline-start: auto; font-size: .68rem; font-weight: 700; color: #3f86ad; white-space: nowrap; }
.wp-fac.off .wp-glass-pct { color: var(--muted); }
.wp-fac .ge-slider { grid-template-columns: auto 1fr 74px; }
.wp-sw { position: relative; display: inline-block; width: 30px; height: 17px; flex: none; }
.wp-sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.wp-sw span { position: absolute; inset: 0; border-radius: 99px; background: #cfd8de; transition: background .2s; }
.wp-sw span::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.wp-sw input:checked + span { background: var(--primary); }
.wp-sw input:checked + span::after { transform: translateX(13px); }
[dir=rtl] .wp-sw input:checked + span::after { transform: translateX(-13px); }
.wp-sw input:focus-visible + span { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.wp-more { margin-top: .6rem; border-top: 1px solid var(--line); padding-top: .45rem; }
.wp-more summary { cursor: pointer; font-size: .76rem; font-weight: 700; color: var(--primary-2); display: flex; gap: .35rem; align-items: center; }
.wp-more .ge-slider { grid-template-columns: 92px 1fr 74px; }
.wp-adv { margin-top: .6rem; }
.ge-guide { margin-top: .7rem; background: var(--tint); border-radius: var(--r-sm); padding: .55rem .7rem; color: var(--ink-2); font-size: .76rem; }
.ge-guide b { color: var(--primary); }
.ge-guide ul { margin: .35rem 0 0; padding-inline-start: 1.1rem; line-height: 1.6; }
@media (max-width: 760px) {
  .gv-stage { --ge-h: 56%; }
  .st-edit { top: auto; width: auto; inset-inline: 0; height: var(--ge-h); border-inline-end: 0; border-top: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
  .gv-stage.editing > svg { inset-inline-start: 0; width: 100%; bottom: auto; height: calc(100% - var(--ge-h)); }
  .gv-stage.editing > .st-grip { display: none; }   /* the panel is a sheet at the bottom here: full width */
  .gv-stage.editing .st-plot, .gv-stage.editing .st-bottom, .gv-stage.editing .st-views, .gv-stage.editing .st-side, .gv-stage.editing .st-pip { display: none; }
}

/* favourites & model in the printed brief */
.fav-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.fav-grid figure { margin: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; break-inside: avoid; }
.fav-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.fav-grid figcaption { padding: .3rem .5rem; font-size: .8rem; font-weight: 700; display: flex; justify-content: space-between; }
.fav-grid figcaption i { color: #e0245e; }
.fav-grid figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.insp-sec h2 i { color: var(--primary-2); }
.model-print { display: grid; grid-template-columns: 1fr 260px; gap: .8rem; align-items: start; }
.model-print .gv-stage { height: 360px; border-radius: var(--r-sm); }
.model-print img { width: 100%; border-radius: var(--r-sm); }
.model-print dl { margin-top: .5rem; }
/* the further views ticked (2026-11-25): under the first, two by two, each named */
.model-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.model-more:empty { display: none; }
.model-more figure { margin: 0; break-inside: avoid; }
.model-more figcaption { font-size: .82rem; font-weight: 800; color: var(--primary); margin-bottom: .3rem; }
.model-more .gv-stage { height: 280px; border-radius: var(--r-sm); }
.model-more .land-legend { display: flex; flex-wrap: wrap; gap: .25rem .8rem; margin-top: .45rem; font-size: .74rem; color: var(--ink-2); }
@media (max-width: 640px) { .model-more { grid-template-columns: minmax(0, 1fr); } }
@media print { .fav-grid { grid-template-columns: repeat(4, 1fr); } .model-print .gv-stage { height: 320px; } .model-more .gv-stage { height: 240px; } }

/* ---------- stair pictures (Green Villa stairPic) ---------- */
.stair-pic { width: 3.6rem; height: 3.6rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--primary); }
.stair-pic rect, .stair-pic circle { fill: rgba(99,195,197,.14); }
.stair-pic .ar { stroke: var(--accent); stroke-width: 2; }
.stair-pic .fl { fill: rgba(99,195,197,.14); }                                       /* the stair details, seen from the side */
.stair-pic .at { stroke: var(--accent); fill: var(--accent); fill-opacity: .22; }
.stair-pic .gl { fill: var(--accent); fill-opacity: .45; stroke: none; }
.stair-pic .dsh { stroke-dasharray: 2.5 2.5; stroke-width: 1.2; }
.pcard.pic { padding-top: .7rem; }
.pcard.pic.on .stair-pic { color: var(--primary); }
.pcards:has(.pcard.pic) { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.pr-pic .stair-pic { width: 2.4rem; height: 2.4rem; vertical-align: middle; margin-inline-end: .4rem; }

/* ---------- glossary strip; the regulation chips (listed in the design assistant only) ---------- */
.gl-strip { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: -.4rem 0 1rem; }
.gl-strip { margin-top: -.5rem; }
.gl-strip-t { font-size: .78rem; font-weight: 800; color: var(--muted); display: inline-flex; gap: .35rem; align-items: center; margin-inline-end: .2rem; }
.reg-chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; font-weight: 700; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: .35rem; }
.reg-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #b8c6cf; }
.reg-chip.ok { border-color: #bfe6d4; } .reg-chip.ok::before { background: var(--ok); }
.reg-chip.bad { border-color: #f3b6b6; background: var(--bad-bg); color: var(--bad); } .reg-chip.bad::before { background: var(--bad); animation: blinkd 1.4s infinite; }
.reg-chip.info::before { background: var(--primary-2); }
.reg-chip:hover { border-color: var(--primary-2); }
@keyframes blinkd { 50% { opacity: .35; } }
.gl-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .2rem .7rem .2rem .25rem; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--ink-2); }
[dir=rtl] .gl-chip { padding: .2rem .25rem .2rem .7rem; }
.gl-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--soft); }
.gl-chip.more { padding: .3rem .7rem; }
.gl-chip:hover { border-color: var(--primary-2); background: var(--tint); }
.gl-q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--tint); color: var(--primary); font-size: .7rem; font-weight: 900; margin-inline-start: .35rem; cursor: help; vertical-align: middle; border: 1px solid #bcd9e5; flex: none; }
.gl-q:hover { background: var(--primary); color: #fff; }
.chip.on .gl-q, .pcard.on .gl-q { background: #fff; color: var(--primary); }
.q-help { display: block; color: var(--muted); font-size: .76rem; margin-top: .35rem; }
.gis-row { display: flex; gap: .5rem; }
.gis-row input { flex: 1; min-width: 0; }
.gis-row .btn { flex: none; width: 48px; padding: 0; font-size: 1.1rem; }

/* glossary term & library */
.dlg.gl-modal, .dlg.gl-lib, .dlg.regs-dlg { max-width: 860px; }
.gl-view { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.2rem; align-items: start; }
.gl-big { margin: 0; background: var(--soft); border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 10; }
.gl-big img { width: 100%; height: 100%; object-fit: cover; }
.gl-big figcaption { font-size: .72rem; color: var(--muted); padding: .3rem .5rem; }
.gl-view h3 { margin: .5rem 0 .1rem; font-size: 1.3rem; }
.gl-other { color: var(--muted); margin: 0 0 .7rem; font-size: .9rem; }
.gl-short { font-weight: 700; color: var(--primary); margin: 0 0 .5rem; }
.gl-text { color: var(--ink-2); margin: 0; line-height: 1.75; white-space: pre-line; }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: max-content; gap: .7rem; margin-top: .8rem; max-height: 56vh; overflow-y: auto; }
.gl-tile { border: 1px solid var(--line); background: #fff; border-radius: var(--r); overflow: hidden; cursor: pointer; text-align: start; padding: 0; display: flex; flex-direction: column; transition: transform .15s var(--ease), box-shadow .15s; }
.gl-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.gl-tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--soft); }
.gl-tile b { padding: .45rem .6rem 0; font-size: .86rem; }
.gl-tile small { padding: .15rem .6rem .55rem; color: var(--muted); font-size: .74rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gl-tile .badges { display: flex; gap: .3rem; padding: 0 .6rem .5rem; }
@media (max-width: 700px) { .gl-view { grid-template-columns: 1fr; } }

/* regulations: side summary, all-regulations dialog */
.rg-cat { margin: 1rem 0 .4rem; font-size: .82rem; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; }
.rg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: .55rem .7rem; border-radius: var(--r-sm); border-inline-start: 4px solid #cfd9df; background: var(--soft); margin-bottom: .35rem; }
.rg-row.ok { border-color: var(--ok); } .rg-row.bad { border-color: var(--bad); background: var(--bad-bg); } .rg-row.info { border-color: var(--primary-2); }
.rg-row small { display: block; color: var(--muted); font-size: .76rem; margin-top: .15rem; white-space: pre-line; }
/* the value: a number stays on one line; a text value (privacy, uses…) wraps within its column */
.rg-v { text-align: end; max-width: min(24rem, 45vw); overflow-wrap: anywhere; }
@media (max-width: 640px) { .rg-row { grid-template-columns: minmax(0, 1fr); gap: .3rem; } .rg-v { text-align: start; max-width: none; } }
.brief-doc tr.rg-bad td { color: var(--bad); font-weight: 700; } .brief-doc tr.rg-ok td:last-child { color: var(--ok); font-weight: 700; }

/* ---------- design assistant ---------- */
.assist { position: fixed; z-index: 55; bottom: 18px; inset-inline-end: 18px; max-width: 380px; transition: inset .3s; }
.assist.open { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3); border: 1px solid var(--line); overflow: hidden; animation: rise .3s var(--ease); width: min(380px, calc(100vw - 36px)); }
.assist.open.warn { border-color: #f3b6b6; } .assist.open.good { border-color: #bfe6d4; }
.as-head { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-size: .88rem; }
.assist.warn .as-head { background: linear-gradient(135deg, #b5452b, var(--accent)); }
.as-head b { flex: 1; }
.as-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); flex: none; }
.as-x { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 26px; height: 26px; border-radius: var(--r-xs); cursor: pointer; }
.as-bubble { padding: .8rem .9rem .9rem; font-size: .88rem; color: var(--ink-2); max-height: 50vh; overflow-y: auto; }
.as-bubble h4 { margin: 0 0 .35rem; color: var(--ink); font-size: .98rem; }
.as-bubble p { margin: 0 0 .5rem; line-height: 1.7; }
.as-sub { color: var(--muted); font-size: .82rem; }
.as-val b { color: var(--primary); }
.as-ok { color: var(--ok); font-weight: 700; } .as-bad { color: var(--bad); font-weight: 700; }
.as-rules { display: flex; flex-wrap: wrap; gap: .35rem; }
.as-acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.as-btn { border: 1.5px solid var(--line); background: var(--soft); border-radius: var(--r-sm); padding: .4rem .7rem; font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--primary); display: inline-flex; gap: .35rem; align-items: center; }
.as-btn:first-child { background: var(--primary); color: #fff; border-color: var(--primary); }
.assist.warn .as-btn:first-child { background: var(--accent); border-color: var(--accent); }
.as-typing { display: flex; gap: .3rem; padding: 1rem; }
.as-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-2); animation: blinkd 1s infinite; }
.as-typing i:nth-child(2) { animation-delay: .2s; } .as-typing i:nth-child(3) { animation-delay: .4s; }
.as-fab { display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 999px; padding: .35rem .9rem .35rem .4rem; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 700; font-size: .85rem; cursor: pointer; box-shadow: var(--sh-2); position: relative; }
[dir=rtl] .as-fab { padding: .35rem .4rem .35rem .9rem; }
.as-fab:hover { transform: translateY(-2px); }
.as-badge { position: absolute; top: -6px; inset-inline-end: -6px; background: var(--bad); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; font-size: .7rem; display: grid; place-items: center; padding: 0 .3rem; border: 2px solid #fff; }
@media print { .assist { display: none !important; } }

/* ---------- settings: regulations & glossary editors ---------- */
.set-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .8rem; }
.rg-zones { width: 100%; border-collapse: collapse; margin-bottom: .5rem; }
.rg-zones th { text-align: start; font-size: .76rem; color: var(--muted); padding: .2rem .3rem; }
.rg-zones td { padding: .2rem .3rem; }
.rg-zones input { padding: .4rem .6rem; }
.rg-cat-own { display: flex; align-items: center; gap: .15rem; }
.rg-cat-own > span { margin-inline-end: .35rem; }
.rg-cat-own .icon-btn { width: 28px; height: 28px; font-size: .74rem; }
.rg-cat-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto; gap: .6rem; align-items: end; margin: 1rem 0 .5rem; padding: .7rem .8rem; border: 1px solid var(--primary-2); border-radius: var(--r-sm); background: var(--soft); }
.rg-cat-edit .set-field input { text-align: start; font-size: .95rem; padding: .4rem .6rem; }
@media (max-width: 640px) { .rg-cat-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rg-cat-edit .set-field { grid-column: 1 / -1; } }
.rg-newcat { margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.rg-ed { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: .45rem; background: #fff; }
.rg-ed > summary { cursor: pointer; padding: .6rem .8rem; display: grid; grid-template-columns: auto 1fr; gap: .1rem 1rem; align-items: baseline; list-style: none; }
.rg-ed > summary::-webkit-details-marker { display: none; }
.rg-ed > summary small { color: var(--muted); font-size: .74rem; }
.rg-ed > summary .rg-vals { grid-column: 1 / -1; font-size: .78rem; color: var(--primary); font-weight: 600; }
.rg-ed[open] { box-shadow: var(--sh-2); border-color: var(--primary-2); }
.rg-ed[open] > :not(summary) { padding: 0 .8rem; }
.rg-ed[open] > .dlg-actions { padding-bottom: .8rem; }
.rg-zvals { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }
.rg-zvals label { display: flex; flex-direction: column; gap: .2rem; }
.rg-zvals small { color: var(--muted); font-weight: 700; font-size: .74rem; }
input[aria-invalid=true] { border-color: var(--bad); }
.gl-tile.off { opacity: .55; }
.gl-ed-pic { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: center; margin: .8rem 0 1rem; }
.gl-ed-pic img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-sm); background: var(--soft); }
.gl-ed-pic > div { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.gl-ed-pic small { flex-basis: 100%; }
.gl-hookadd { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.gl-hookadd select { width: auto; flex: 1; min-width: 160px; }
.gl-x { border: 0; background: rgba(255,255,255,.25); color: inherit; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; margin-inline-start: .3rem; line-height: 1; }
.set-switch { display: inline-flex; gap: .5rem; align-items: center; font-weight: 700; margin-top: .6rem; }
.set-switch input { width: 18px; height: 18px; }
/* /settings → Permissions: the library and the components given to chosen employee codes (Scripts/settings.js) */
.grants { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: .8rem; margin-bottom: .8rem; }
.grant { border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; background: var(--soft); display: flex; flex-direction: column; gap: .6rem; }
.grant-head { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.grant-head i { color: var(--primary-2); }
.grant-list { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 1.9rem; align-items: center; }
.grant-chip { display: inline-flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .15rem .25rem .15rem .7rem; font-size: .82rem; }
[dir=rtl] .grant-chip { padding: .15rem .7rem .15rem .25rem; }
.grant-chip b { font-family: ui-monospace, Consolas, monospace; color: var(--primary); }
.grant-chip em { color: var(--accent); font-style: normal; font-size: .76rem; }
.grant-chip.gone { border-style: dashed; }
.grant-chip button { border: 0; background: transparent; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.grant-chip button:hover { background: var(--danger-bg, #fde8e8); color: #b42318; }
.grant-none { font-size: .82rem; }
.grant-add { display: flex; gap: .4rem; }
.grant-add input { flex: 1; min-width: 0; }
.grant-add .btn { white-space: nowrap; }
@media (max-width: 760px) { .set-grid.two, .gl-ed-pic { grid-template-columns: 1fr; } }

/* ---------- the picture & model library: admin page (/library, Scripts/library-admin.js) ---------- */
.libm-back { display: inline-flex; align-items: center; gap: .4rem; color: var(--primary-2); font-weight: 700; font-size: .85rem; margin-bottom: .35rem; }
.libm-back:hover { text-decoration: underline; }
.libm-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.libm-stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .7rem; align-items: center; text-align: start; padding: .7rem .9rem; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--card); box-shadow: var(--sh-1); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.libm-stat i { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--tint); color: var(--primary); }
.libm-stat b { font-size: 1.25rem; line-height: 1.1; }
.libm-stat span { color: var(--muted); font-size: .78rem; font-weight: 600; }
.libm-stat[disabled] { cursor: default; opacity: 1; }
.libm-stat:not([disabled]):hover { border-color: #b9ccd8; }
.libm-stat.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25,89,122,.12); }
.libm-page .toolbar select { width: auto; min-width: 190px; background: var(--card); }
.libm-fams { margin-bottom: 1rem; }
.libm-fams .chip small { opacity: .7; }
.libm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); grid-auto-rows: max-content; gap: 1rem; }
.libm-empty { grid-column: 1 / -1; text-align: center; padding: 2rem; }
.libm-card { display: flex; flex-direction: column; padding: 0; text-align: start; border: 2px solid transparent; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s; }
.libm-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.libm-card.off .libm-img img { filter: grayscale(.85); opacity: .6; }
.libm-img { position: relative; display: block; flex: none; aspect-ratio: 16 / 10; overflow: hidden; background: #e9eef1; }
.libm-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.libm-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; color: var(--muted); font-size: .8rem; font-weight: 700; }
.libm-ph i { font-size: 1.8rem; }
.libm-badges { position: absolute; top: .45rem; inset-inline-start: .45rem; inset-inline-end: .45rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.libm-badges .pill { box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.libm-cap { display: block; padding: .55rem .75rem .7rem; }
.libm-cap b { font-size: .95rem; } .libm-cap small { color: var(--muted); margin-inline-start: .45rem; font-size: .78rem; }
.libm-cap em { display: block; font-style: normal; font-size: .82rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg.libm-dlg { max-width: 940px; }
.libm-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.libm-head h3 { margin: 0; margin-inline-end: .2rem; }
.libm-head .icon-btn { margin-inline-start: auto; }
.libm-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: max-content; gap: .7rem; }
.libm-pic { position: relative; margin: 0; border-radius: var(--r-sm); overflow: hidden; border: 2px solid var(--line); background: var(--soft); }
.libm-pic.cover { border-color: var(--gold); }
.libm-pic img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.libm-cover { position: absolute; top: .4rem; inset-inline-start: .4rem; display: inline-flex; gap: .3rem; align-items: center; background: var(--gold); color: #3b3000; font-size: .72rem; font-weight: 800; padding: .12rem .5rem; border-radius: var(--r-xs); }
.libm-pic figcaption { display: flex; gap: .25rem; padding: .3rem; background: #fff; }
.libm-pic figcaption button { flex: 1; height: 30px; border: 1px solid var(--line); background: var(--soft); border-radius: var(--r-xs); cursor: pointer; color: var(--ink-2); }
.libm-pic figcaption button:hover:not([disabled]) { background: var(--tint); color: var(--primary); }
.libm-pic figcaption button[disabled] { opacity: .35; cursor: default; }
.libm-pic figcaption button.del:hover { background: var(--bad-bg); color: var(--bad); border-color: #f3c4c4; }
.libm-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-height: 150px; padding: .8rem; text-align: center; border: 2px dashed #c6d7e1; border-radius: var(--r-sm); background: var(--card); cursor: pointer; transition: all .2s; }
.libm-drop i { font-size: 1.6rem; color: var(--primary-2); }
.libm-drop small { color: var(--muted); font-size: .74rem; }
.libm-drop:hover, .libm-drop.over { border-color: var(--primary-2); background: var(--tint); }
.libm-drop.busy { cursor: progress; }
.libm-nopics { display: flex; gap: .7rem; align-items: center; padding: 1rem; border-radius: var(--r-sm); background: var(--soft); color: var(--ink-2); font-weight: 600; }
.libm-nopics i { font-size: 1.5rem; color: var(--primary-2); }
.libm-warn { display: flex; gap: .5rem; align-items: center; margin: .6rem 0 0; padding: .5rem .8rem; border-radius: var(--r-sm); background: var(--warn-bg); color: #8a5a12; font-size: .84rem; font-weight: 600; }
.libm-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.libm-text input[type=text], .libm-code input { text-align: start; font-weight: 500; font-size: 1rem; }
.libm-code { display: flex; align-items: stretch; }
.libm-code > span { display: grid; place-items: center; padding: 0 .7rem; background: var(--soft); border: 1px solid var(--line); border-inline-end: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); color: var(--muted); font-weight: 700; }
.libm-code input { border-radius: 0 var(--r-sm) var(--r-sm) 0; flex: 1; min-width: 0; font-weight: 700; }
.libm-codebox { padding: .62rem .9rem; border-radius: var(--r-sm); background: var(--soft); border: 1px solid var(--line); font-weight: 800; text-align: center; }
.libm-sec { margin-top: .9rem; padding: 1rem 1.1rem; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); }
.libm-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.libm-sec-h b { display: inline-flex; align-items: center; gap: .45rem; font-size: .95rem; }
.libm-sec-h b i { color: var(--primary-2); font-size: .85rem; }
.libm-sec-h span { color: var(--primary); font-weight: 800; font-size: .88rem; }
.libm-sec .libm-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem 1rem; }
.libm-sec .set-field > span small { color: var(--muted); font-weight: 600; }
.libm-sec .set-field input[type=text], .libm-sec textarea { text-align: start; font-weight: 500; font-size: 1rem; }
.libm-sec .set-field input[readonly] { background: var(--soft); color: var(--ink-2); }
.libm-wide { grid-column: span 2; }
.libm-full { grid-column: 1 / -1; }
.libm-totals { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.libm-totals span { padding: .4rem .8rem; border-radius: var(--r-sm); background: var(--soft); font-size: .84rem; color: var(--ink-2); }
.libm-src { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0; font-size: .84rem; }
@media (max-width: 900px) { .libm-sec .libm-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .libm-sec .libm-fields { grid-template-columns: 1fr; } .libm-wide { grid-column: auto; } .libm-sec { padding: .8rem; } }
.libm-switches { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; align-items: center; margin-top: .6rem; }
.libm-nomodel { font-size: .84rem; margin-top: .6rem; }
.libm-meta { font-size: .8rem; margin: .8rem 0 0; }
.libm-del { color: var(--bad); margin-inline-end: auto; }
/* settings → AI (Scripts/settings-ai.js) */
.set-head .set-title small { display: block; font-weight: 600; font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.set-badge.ok { background: var(--ok-bg); color: var(--ok); }
.ai-body { transition: opacity .2s; }
.ai-body.off { opacity: .5; }
.ai-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0 .4rem; }
.ai-mode { display: grid; grid-template-columns: auto 1fr; column-gap: .75rem; row-gap: .2rem; align-items: center; text-align: start; padding: .9rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ai-mode i { grid-row: 1 / 3; width: 42px; height: 42px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--tint); color: var(--primary); font-size: 1.1rem; }
.ai-mode small { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.ai-mode.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25,89,122,.12); }
.ai-mode.on i { background: var(--primary); color: #fff; }
.ai-grid .set-field input, .ai-grid .set-field select { text-align: start; font-weight: 600; font-size: .95rem; }
.ai-grid .set-field input[dir=ltr] { text-align: left; }
.ai-field small a { color: var(--primary-2); font-weight: 700; }
.ai-key { display: flex; gap: .35rem; align-items: stretch; }
.ai-key input { flex: 1; min-width: 0; }
.ai-key .icon-btn { flex: none; height: auto; }
.ai-key-st { display: inline-flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.ai-key-st.ok { color: var(--ok); }
.ai-key-st.off { color: var(--bad); }
.ai-key-st a { color: var(--primary-2); font-weight: 700; }
.ai-adv { margin-top: .7rem; }
.ai-adv summary { cursor: pointer; color: var(--primary-2); font-weight: 700; font-size: .84rem; }
.ai-adv .set-grid { margin-top: .6rem; }
.set-info.ok { background: var(--ok-bg); border-color: #bfe6d4; color: #17694a; }
.set-info.ok i { color: var(--ok); }
.set-info.bad { background: var(--bad-bg); border-color: #f3c4c4; color: #a12f2f; }
.set-info.bad i { color: var(--bad); }
.ai-miss { display: inline-block; margin-top: .3rem; color: #8a5a12; font-weight: 700; }
.ai-models { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.ai-models .chip { padding: .25rem .6rem; font-size: .78rem; direction: ltr; }
.ai-warn { margin-top: .8rem; }
@media (max-width: 760px) { .ai-modes { grid-template-columns: 1fr; } }
.set-head.set-go { color: inherit; }
.set-head.set-go .set-title small { display: block; font-weight: 600; font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.set-head.set-go:hover { background: var(--soft); }
.set-head.set-go .set-go-btn { flex: none; }
/* the design's IFC / Revit files and its 3D model (drawn from a picture or from the IFC file) */
.libm-bim { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.libm-bim-card { display: flex; flex-direction: column; gap: .6rem; padding: .8rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card); transition: border-color .2s, background .2s; }
.libm-bim-card.over { border-color: var(--primary-2); background: var(--tint); }
.libm-bim-h { display: flex; align-items: center; gap: .55rem; }
.libm-bim-h b { flex: 1; min-width: 0; }
.libm-bim-h small { color: var(--muted); font-size: .76rem; font-weight: 700; display: inline-flex; gap: .3rem; align-items: center; }
.libm-bim-h small.ok { color: var(--ok); }
.libm-bim-ico { flex: none; width: 40px; height: 40px; border-radius: var(--r-xs); display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: #fff; background: var(--primary-2); letter-spacing: .03em; }
.libm-bim-ico.rvt { background: #2b6cb0; }
.libm-bim-drop { min-height: 96px; }
.libm-bim-file { display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding: .5rem .7rem; border-radius: var(--r-xs); background: var(--soft); }
.libm-bim-file b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start; }
.libm-bim-file small { color: var(--muted); font-size: .76rem; }
.libm-bim-acts { display: flex; flex-wrap: wrap; gap: .4rem; }
.libm-bim-acts .btn { padding: .45rem .8rem; font-size: .84rem; }
.libm-bim-del:hover { color: var(--bad); border-color: #f3c4c4; background: var(--bad-bg); }
.libm-bim-prog { display: flex; flex-direction: column; gap: .3rem; width: 100%; }
.libm-bim-prog > div { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.libm-bim-prog span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .3s; }
.libm-bim-prog small { color: var(--muted); font-size: .76rem; font-weight: 600; }
.libm-hint { display: flex; gap: .45rem; align-items: baseline; font-size: .78rem; margin: .5rem 0 0; }
.libm-rule { display: flex; gap: .5rem; align-items: baseline; margin: 0 0 .7rem; padding: .55rem .8rem; border-radius: var(--r-sm); background: var(--soft); color: var(--ink-2); font-size: .84rem; font-weight: 600; }
.libm-rule i { color: var(--primary-2); }
.libm-3d { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: center; }
.libm-3d.none { grid-template-columns: 1fr; }
.libm-3d-view { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-sm); background: linear-gradient(180deg, #eef4f8, #f8f5ee); overflow: hidden; display: grid; place-items: center; }
.libm-3d-view svg { width: 100%; height: 100%; display: block; }
.libm-3d-wait { color: var(--muted); font-size: 1.3rem; }
.libm-3d-err { margin: 0; padding: 1rem; color: var(--bad); font-size: .84rem; font-weight: 600; text-align: center; }
.libm-3d-rot { position: absolute; top: .45rem; inset-inline-start: .45rem; display: flex; gap: .25rem; z-index: 1; }
.libm-3d-rot button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: var(--r-xs); background: rgba(255,255,255,.9); color: var(--ink-2); cursor: pointer; }
.libm-3d-rot button:hover { background: var(--tint); color: var(--primary); }
.libm-3d-side { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; }
.libm-3d-off { display: inline-flex; gap: .35rem; align-items: center; color: #8a5a12; font-size: .8rem; font-weight: 600; }
.libm-3d-acts { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .3rem; }
.libm-draw { display: flex; flex-direction: column; gap: .7rem; padding: .9rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--soft); }
.libm-draw.busy { align-items: center; text-align: center; padding: 2rem 1rem; gap: .6rem; }
.libm-draw.busy > i { font-size: 1.8rem; color: var(--primary-2); }
.libm-draw.busy small { color: var(--muted); }
.libm-draw.busy .libm-bim-prog { max-width: 360px; }
.libm-draw .libm-3d-acts { justify-content: flex-end; }
.libm-draw-q { margin: 0; font-weight: 700; font-size: .9rem; }
.libm-draw-srcs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.libm-draw-src { display: grid; grid-template-columns: auto 1fr; column-gap: .65rem; row-gap: .15rem; align-items: center; text-align: start; padding: .75rem .85rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.libm-draw-src i { grid-row: 1 / 4; width: 38px; height: 38px; border-radius: var(--r-xs); display: grid; place-items: center; background: var(--tint); color: var(--primary); }
.libm-draw-src small { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.libm-draw-src em { font-style: normal; color: #8a5a12; font-size: .76rem; font-weight: 700; }
.libm-draw-src.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25,89,122,.12); }
.libm-draw-src[disabled] { opacity: .65; cursor: not-allowed; }
.libm-draw-pics { display: flex; flex-wrap: wrap; gap: .4rem; }
.libm-draw-pics button { padding: 0; width: 96px; border: 2px solid var(--line); border-radius: var(--r-xs); overflow: hidden; cursor: pointer; background: none; }
.libm-draw-pics button.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25,89,122,.15); }
.libm-draw-pics img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.libm-3d-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.libm-3d-pic, .libm-3d-new { position: relative; display: block; border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.libm-3d-pic img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #fff; }
.libm-3d-pic span, .libm-3d-tag { position: absolute; bottom: .4rem; inset-inline-start: .4rem; padding: .1rem .5rem; border-radius: var(--r-xs); background: rgba(20,43,56,.72); color: #fff; font-size: .72rem; font-weight: 700; }
.libm-3d-tag { background: var(--accent); }
.libm-draw-info { margin: 0; display: flex; gap: .45rem; align-items: baseline; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.libm-draw-info small { color: var(--muted); font-weight: 500; }
.libm-map { border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card); padding: .2rem .8rem; }
.libm-map[open] { padding-bottom: .8rem; }
.libm-map summary { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; cursor: pointer; list-style: none; }
.libm-map summary::-webkit-details-marker { display: none; }
.libm-map summary i { color: var(--primary-2); }
.libm-map summary small { color: var(--muted); font-weight: 700; font-size: .76rem; margin-inline-start: auto; }
.libm-map summary::after { content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--muted); transition: transform .2s; }
.libm-map[open] summary::after { transform: rotate(180deg); }
.libm-map .libm-hint { margin: 0 0 .5rem; }
.libm-map-wrap { overflow-x: auto; }
.libm-map-t { width: 100%; border-collapse: collapse; font-size: .84rem; }
.libm-map-t th { text-align: start; color: var(--muted); font-size: .74rem; font-weight: 700; padding: .3rem .45rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.libm-map-t td { padding: .3rem .45rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.libm-map-t tr.off td { color: var(--muted); }
.libm-map-t tr.off b { font-weight: 600; }
.libm-map-t select { min-width: 150px; padding: .35rem .5rem; font-size: .84rem; }
.libm-map-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; font-size: .8rem; }
.libm-map-acts .btn { padding: .4rem .75rem; font-size: .82rem; }
.libm-map-acts [data-mapauto] { margin-inline-start: auto; }
/* the model's definition edited as text (JSON) beside a live preview */
.libm-code { gap: .6rem; }
.libm-code-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.libm-code-bar > b { display: inline-flex; align-items: center; gap: .45rem; font-size: .92rem; }
.libm-code-bar > b i { color: var(--primary-2); }
.libm-code-app { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); font-weight: 700; }
.libm-code-app select { width: auto; padding: .35rem .6rem; font-size: .84rem; }
.libm-code-tools { display: inline-flex; flex-wrap: wrap; gap: .3rem; margin-inline-start: auto; }
.libm-code-tools .btn { padding: .4rem .7rem; font-size: .82rem; gap: .4rem; }
.libm-code-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .7rem; align-items: start; }
.libm-code-box { position: relative; display: flex; direction: ltr; height: 420px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #0f2330; overflow: hidden; }
.libm-code-box:focus-within { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(35,132,159,.15); }
.libm-code-ln { flex: none; margin: 0; padding: .7rem .5rem .7rem .7rem; min-width: 3.2rem; text-align: right; overflow: hidden; user-select: none; color: #5b7686; background: #0b1b25; border-right: 1px solid #1d3443; }
.libm-code-ln, .libm-code-box textarea { font: 12.5px/1.6 ui-monospace, Consolas, 'Courier New', monospace; }
.libm-code-box textarea { flex: 1; min-width: 0; height: 100%; margin: 0; padding: .7rem .8rem; border: 0; border-radius: 0; resize: none; outline: none; background: transparent; color: #d7e7ef; white-space: pre; overflow: auto; tab-size: 2; caret-color: var(--teal); box-shadow: none; text-align: left; }
.libm-code-box textarea::selection { background: rgba(108,202,208,.35); }
.libm-code-side { display: flex; flex-direction: column; gap: .5rem; }
.libm-code-st { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; padding: .55rem .7rem; border-radius: var(--r-sm); font-size: .8rem; line-height: 1.5; background: var(--card); border: 1px solid var(--line); }
.libm-code-st.ok { background: var(--ok-bg); border-color: #bfe6d4; color: #17694a; }
.libm-code-st.bad { background: var(--bad-bg); border-color: #f3c4c4; color: #a12f2f; }
.libm-code-st span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.libm-code-st .btn { padding: .3rem .6rem; font-size: .76rem; background: #fff; }
/* the Revit file's data (read on upload) and the list's filters (as Green Villa's designs page) */
.libm-rvt { margin-top: .8rem; padding: .8rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.libm-rvt-h { display: flex; align-items: center; gap: .5rem; justify-content: space-between; flex-wrap: wrap; }
.libm-rvt-h b { display: inline-flex; gap: .45rem; align-items: center; }
.libm-rvt-h b i { color: #2b6cb0; }
.libm-rvt-h .btn { padding: .4rem .75rem; font-size: .82rem; }
.libm-rvt-body { display: flex; gap: .9rem; align-items: flex-start; margin-top: .6rem; }
.libm-rvt-pv { flex: none; width: 132px; border: 1px solid var(--line); border-radius: var(--r-xs); background: #fff; padding: .25rem; }
.libm-rvt-pv img { display: block; width: 100%; height: auto; image-rendering: auto; }
.libm-kv { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: .45rem .9rem; }
.libm-kv div { display: flex; flex-direction: column; min-width: 0; }
.libm-kv span { color: var(--muted); font-size: .74rem; font-weight: 600; }
.libm-kv b { font-size: .86rem; overflow-wrap: anywhere; text-align: start; }
.libm-rvt-more { margin-top: .6rem; }
.libm-rvt-more summary { cursor: pointer; font-weight: 700; font-size: .84rem; color: var(--primary-2); }
.libm-rvt-more table { width: 100%; border-collapse: collapse; margin-top: .4rem; font-size: .8rem; }
.libm-rvt-more td { padding: .3rem .45rem; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; text-align: start; }
.libm-rvt-more td:first-child { color: var(--muted); white-space: nowrap; }
.libm-lockbtn.on { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-line); box-shadow: var(--sel-sh); }
.libm-lockbar { display: flex; gap: .5rem; align-items: center; margin: -.3rem 0 1rem; padding: .55rem .85rem; border-radius: var(--r-sm); background: var(--warn-bg); color: #8a5a12; font-size: .86rem; font-weight: 600; }
.libm-lockbar[hidden] { display: none; }
/* the file number is typed, never stepped: no up/down arrows */
.libm-dlg input[data-k=FileNo] { -moz-appearance: textfield; appearance: textfield; }
.libm-dlg input[data-k=FileNo]::-webkit-inner-spin-button, .libm-dlg input[data-k=FileNo]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.libm-fno-msg { color: var(--bad); font-weight: 600; }
.libm-fno-msg.ok { color: var(--muted); font-weight: 400; }
.libm-fbtn { position: relative; }
.libm-fbtn.on { border-color: var(--primary); color: var(--primary); }
.libm-fbtn b { min-width: 20px; height: 20px; padding: 0 .3rem; border-radius: 99px; background: var(--primary); color: #fff; font-size: .72rem; display: inline-grid; place-items: center; }
.libm-filters { margin: -.3rem 0 1rem; padding: .9rem; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--sh-1); }
.libm-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: .9rem 1.2rem; }
.libm-fg { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.libm-fg > b { font-size: .84rem; display: inline-flex; align-items: center; gap: .4rem; }
.libm-fg.on > b::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-2); }
.libm-pills { display: flex; flex-wrap: wrap; gap: .3rem; }
.libm-pills button, .libm-seg button { border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: var(--r-xs); padding: .3rem .6rem; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.libm-pills button small { opacity: .6; font-weight: 600; }
.libm-pills button.zero { opacity: .5; }
.libm-pills button[aria-pressed="true"], .libm-seg button[aria-pressed="true"] { background: var(--sel-bg); border-color: var(--sel-line); color: var(--sel-ink); box-shadow: var(--sel-sh); opacity: 1; }
.libm-pills button:hover, .libm-seg button:hover { border-color: #b9ccd8; }
.libm-seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.libm-tri, .libm-range { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .82rem; }
.libm-tri > span:first-child, .libm-range > span:first-child { color: var(--ink-2); font-weight: 600; }
.libm-range > span:last-child { display: inline-flex; align-items: center; gap: .3rem; }
.libm-range input { width: 92px; padding: .35rem .5rem; font-size: .82rem; }
.libm-range i { color: var(--muted); font-style: normal; }
.libm-facts { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .84rem; }
@media (max-width: 760px) { .libm-rvt-body { flex-direction: column; } .libm-rvt-pv { width: 160px; } .libm-page .toolbar select { min-width: 0; flex: 1; } }
@media (max-width: 900px) { .libm-code-main { grid-template-columns: 1fr; } .libm-code-box { height: 320px; } }
@media (max-width: 760px) { .libm-bim, .libm-3d, .libm-draw-srcs, .libm-3d-pair { grid-template-columns: 1fr; } }
@media (max-width: 1179px) { .libm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .libm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .libm-fields { grid-template-columns: 1fr 1fr; } .set-head.set-go .set-go-btn span { display: none; } }

/* ---------- the default template: "default" answers in a brief, and the template page (/template) ---------- */
.q.is-default { border-color: rgba(201,130,26,.5); border-style: dashed; }
.def-tag { display: inline-flex; align-items: center; gap: .3rem; border: 0; background: var(--warn-bg); color: var(--warn); font: inherit; font-size: .72rem; font-weight: 700; padding: .14rem .55rem; border-radius: 999px; cursor: pointer; white-space: nowrap; flex: none; }
.def-tag i { font-size: .62rem; }
.def-tag:hover:not([disabled]) { background: var(--warn); color: #fff; }
.def-tag[disabled] { cursor: default; opacity: 1; }
.def-strip { display: flex; align-items: center; gap: .6rem; background: var(--warn-bg); color: #8a5a12; border-radius: var(--r); padding: .6rem .6rem .6rem .9rem; margin-bottom: 1rem; font-size: .86rem; font-weight: 600; }
.def-strip > i { font-size: 1.1rem; color: var(--warn); }
.def-strip span { flex: 1; }
.def-strip .btn { padding: .35rem .8rem; font-size: .8rem; background: #fff; flex: none; }
/* a narrow panel or a phone: the button goes under the text instead of squeezing it into a five-line column */
.def-strip { flex-wrap: wrap; }
.def-strip span { flex: 1 1 0; min-width: 16rem; }
.def-strip .btn { margin-inline-start: auto; }
.def-acts { display: flex; flex-wrap: wrap; gap: .4rem; }
.def-acts .chip-btn[disabled] { opacity: .5; cursor: default; }
.client-card.warn { background: var(--warn-bg); color: #8a5a12; }
.tpl-banner { background: var(--tint); color: var(--primary); }
.q.changed { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(35,132,159,.12); }
.tpl-skip { display: flex; gap: .5rem; align-items: baseline; color: var(--muted); font-size: .8rem; margin: 1rem .2rem 0; }
.q-hide { border: 0; background: transparent; color: #b7c4cc; cursor: pointer; padding: .15rem .3rem; border-radius: var(--r-xs); font-size: .85rem; }
.q-hide:hover { color: var(--primary); background: var(--tint); }
.q-hide.on { color: var(--primary); }
/* the template's "إظهار المخفي": hidden sections and questions shown for a look only */
.peek-sw { margin-inline-end: .3rem; white-space: nowrap; }
.peek-sw b { font-size: .7rem; background: #eef2f5; color: var(--muted); border-radius: 999px; padding: .05rem .45rem; }
.peek-sw b:empty { display: none; }
.peek-sw input:checked ~ b { background: var(--tint); color: var(--primary); }
.peek-sw input:disabled + i { opacity: .45; }
.peek-sw:has(input:disabled) { cursor: default; color: var(--muted); }
.q.peek { opacity: .6; border-style: dashed; background: #fbfcfd; }
.q.peek:hover { opacity: .85; }
.peek-tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: .05rem .45rem; border-radius: var(--r-xs); background: #eef2f5; color: var(--muted); margin-inline-start: .4rem; vertical-align: middle; }
.peek-banner { background: #eef2f5; color: var(--ink-2); }
.rg-sub.peek, .rg-head.peek { opacity: .55; }
/* a request: what the template hides, shown by the bar's eye (H) — quiet marks the staff see and a client hardly notices */
.peek-btn.on { color: var(--primary); background: var(--tint); }
.q.peek-r { border-style: dashed; border-color: #cfdbe2; }
.q-pin { border: 0; background: transparent; color: #c3ced5; cursor: pointer; padding: .15rem .3rem; border-radius: var(--r-xs); font-size: .78rem; }
.q-pin:hover { color: var(--primary); background: var(--tint); }
.q-pin.on { color: var(--primary-2); }
.pin-bar { display: flex; align-items: center; gap: .55rem; padding: .35rem .4rem .35rem .7rem; margin-bottom: 1rem; border: 1px dashed #cfdbe2; border-radius: var(--r-sm); color: var(--muted); font-size: .78rem; }
.pin-bar > i { color: #b7c4cc; font-size: .75rem; }
.pin-bar.on > i { color: var(--primary-2); }
.pin-bar .chip-btn { margin-inline-start: auto; padding: .2rem .7rem; font-size: .74rem; }
.tpl-hidden { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 1rem .2rem 0; color: var(--muted); font-size: .8rem; }
.tpl-hidden > span { display: inline-flex; gap: .4rem; align-items: center; font-weight: 700; }
.tpl-hidden .chip-btn { padding: .2rem .65rem; font-size: .78rem; background: var(--soft); color: var(--ink-2); border: 1px dashed var(--line); }
.tpl-hidden .chip-btn:hover { background: var(--tint); color: var(--primary); border-color: var(--primary-2); }
.tpl-meta { background: var(--soft); border-radius: var(--r-sm); padding: .7rem .8rem; font-size: .85rem; }
.tpl-meta b, .tpl-meta small { display: block; }
.tpl-meta small { color: var(--muted); margin-top: .15rem; }
.tpl-meta q, .tpl-hist q { display: block; margin-top: .35rem; color: var(--ink-2); font-style: italic; }
.tpl-hist .pill { padding: .05rem .5rem; font-size: .7rem; }
.tpl-hist .chip-btn { margin-top: .35rem; padding: .2rem .65rem; font-size: .75rem; }
.tpl-diff { display: flex; flex-wrap: wrap; gap: .35rem; background: var(--soft); border-radius: var(--r-sm); padding: .7rem; }
.tpl-diff small { flex-basis: 100%; color: var(--muted); font-weight: 700; font-size: .75rem; }
.tpl-diff span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .12rem .6rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.brief-doc dd .fl.df { color: var(--warn); }

/* ---------- prompt notes on the template page (Scripts/workspace.js) ---------- */
.pn-btn { border: 1px dashed #c9d6de; background: transparent; color: #9fb2bd; cursor: pointer; padding: .12rem .4rem; border-radius: var(--r-xs); font-size: .8rem; display: inline-flex; align-items: center; gap: .3rem; }
.pn-btn:hover { color: #8a4fc4; border-color: #b994df; background: #f6f0fc; }
.pn-btn.has { border-style: solid; border-color: #b994df; color: #7b3fb8; background: #f6f0fc; }
.pn-btn b { font-size: .7rem; }
.pn-btn.sec { padding: .3rem .65rem; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.pn-prev { display: flex; align-items: flex-start; gap: .45rem; width: 100%; margin-top: .55rem; padding: .4rem .6rem; border: 0; border-radius: var(--r-sm); background: #f6f0fc; color: #5d3a86; font-size: .78rem; text-align: start; cursor: pointer; line-height: 1.5; }
.pn-prev i { color: #8a4fc4; margin-top: .2rem; }
.pn-prev b { font-weight: 700; color: #7b3fb8; }
.chip.has-pn, .pcard.has-pn { position: relative; }
.chip.has-pn::after, .pcard.has-pn::after { content: ''; position: absolute; top: -4px; inset-inline-end: -4px; width: 11px; height: 11px; border-radius: 50%; background: #8a4fc4; border: 2px solid #fff; }
.pn-n { background: #8a4fc4; color: #fff; border-radius: var(--r-xs); padding: 0 .35rem; font-size: .7rem; margin-inline-start: .3rem; }
.dlg.pn-dlg { max-width: 720px; }
.pn-dlg h3 i { color: #8a4fc4; }
.pn-rows { display: flex; flex-direction: column; gap: .5rem; }
.pn-sub { font-weight: 800; color: var(--ink-2); font-size: .82rem; margin-top: .4rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.pn-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: .6rem; align-items: start; }
.pn-l { display: flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--ink-2); padding-top: .45rem; min-width: 0; }
.pn-l .stair-pic { width: 2.4rem; height: 2.4rem; flex: none; }
.pn-l i { color: var(--primary-2); width: 1.2rem; text-align: center; }
.pn-row textarea { padding: .45rem .6rem; font-size: .86rem; border-radius: var(--r-sm); resize: vertical; min-height: 2.6rem; }
.pn-row.has textarea { border-color: #b994df; background: #fcfaff; }
.pn-l .pn-img { width: 2.4rem; height: 2.4rem; flex: none; border-radius: var(--r-xs); overflow: hidden; background: var(--line-2); }
.pn-l .pn-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pn-l .sw { width: 1.3rem; height: 1.3rem; flex: none; border-radius: var(--r-xs); border: 1px solid rgba(0,0,0,.12); }
/* a catalogue's own prompt (a component's choice, a space type): English and Arabic side by side */
.dlg.pn-dlg.wide { max-width: 980px; }
.pn-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .3rem .6rem; min-width: 0; }
.pn-lang { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pn-lang small { font-size: .68rem; font-weight: 700; color: var(--muted); }
.pn-lh { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-height: 1.45rem; }
.pn-lh .cm-tr { padding: .1rem .45rem; font-size: .7rem; }
.pn-trall { margin-inline-end: auto; }
.pn-trall.busy i { animation: spin 1s linear infinite; }
.pn-pair textarea { width: 100%; }
.pn-row textarea[readonly] { background: var(--line-2); color: var(--ink-2); }
.pn-from { grid-column: 1 / -1; display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: #7b3fb8; }
@media (max-width: 760px) { .pn-pair { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .pn-row { grid-template-columns: 1fr; gap: .2rem; } .pn-l { padding-top: 0; } }

/* ---------- the AI prompt dialog (Scripts/prompt.js) ---------- */
.dlg.prompt-dlg { max-width: 980px; display: flex; flex-direction: column; gap: .8rem; max-height: 92vh; padding: 1.2rem 1.3rem; }
.pr-head { display: flex; align-items: flex-start; gap: .8rem; }
.pr-head > div { flex: 1; min-width: 0; }
.pr-head .lead { margin: 0; font-size: .86rem; }
.pr-ico { width: 46px; height: 46px; border-radius: var(--r); display: grid; place-items: center; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, #7b3fb8, var(--primary-2)); flex: none; }
.pr-scen { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem; }
.pr-card { border: 1.5px solid var(--line); background: #fff; border-radius: var(--r); padding: .6rem .7rem; cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; text-align: start; align-items: center; }
.pr-card i { grid-row: span 2; width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--soft); color: var(--primary-2); }
.pr-card b { font-size: .9rem; } .pr-card small { font-size: .74rem; color: var(--muted); line-height: 1.35; }
.pr-card[aria-checked=true] { border-color: #7b3fb8; background: #f6f0fc; }
.pr-card[aria-checked=true] i { background: #7b3fb8; color: #fff; }
.pr-opts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; font-size: .84rem; color: var(--ink-2); }
.pr-opts label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-weight: 600; }
.pr-opts input[type=checkbox] { width: auto; accent-color: var(--primary); }
.pr-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.pr-seg button { border: 0; background: #fff; padding: .35rem .8rem; font-weight: 700; font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.pr-seg button[aria-pressed=true] { background: var(--sel-bg); color: var(--sel-ink); box-shadow: inset 0 0 0 1px var(--sel-line); }
.pr-out { position: relative; flex: 1 0 auto; display: flex; } /* never shrinks under its textarea: the dialog scrolls instead, so the footer stays below the prompt */
.pr-out textarea { flex: 1; min-height: 46vh; font-family: ui-monospace, Consolas, 'Segoe UI', monospace; font-size: .82rem; line-height: 1.6; background: var(--soft); border-radius: var(--r-sm); resize: vertical; white-space: pre-wrap; }
.pr-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(247,250,251,.85); border-radius: var(--r-sm); font-weight: 700; color: var(--primary); }
.pr-busy[hidden] { display: none; }
.pr-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pr-foot small { flex: 1; color: var(--muted); font-size: .78rem; }
.pr-foot small i { color: #8a4fc4; }
/* «تنفيذ على Revit»: the package's files and how complete its form is (Scripts/revit-export.js) */
.pr-revit .pr-opts { display: none; }
.pr-pack { display: flex; flex-direction: column; gap: .45rem; font-size: .82rem; }
.pr-pack[hidden] { display: none; }
.pr-tool { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .6rem; }
.pr-tool > b { font-size: .82rem; }
.pr-tool small { color: var(--ink-3, #777); flex-basis: 100%; }
.pr-files { display: flex; flex-wrap: wrap; gap: .4rem; }
.pr-file { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border-radius: 999px; background: #f6f0fc; color: #5b2d8c; font-weight: 700; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; direction: ltr; }
.pr-file.off { background: var(--soft); color: var(--muted); text-decoration: line-through; cursor: help; }
.pr-stats { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; color: var(--ink-2); }
.pr-st { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 999px; background: var(--soft); font-weight: 600; }
.pr-st.ok { background: var(--ok-bg); color: var(--ok); } .pr-st.warn { background: var(--warn-bg); color: #8a5a12; } .pr-st.bad { background: var(--bad-bg); color: var(--bad); }
.pr-warn { display: flex; align-items: center; gap: .45rem; color: #8a5a12; background: var(--warn-bg); border-radius: var(--r-sm); padding: .4rem .7rem; font-weight: 600; }
.pr-files .pr-layout { margin-inline-start: auto; padding: .25rem .75rem; font-size: .8rem; }
/* «قبل البدء»: install the mq-villa skills on the Revit machine (prompt.js setupHtml) */
.pr-setup { border: 1px solid #f0c98a; border-inline-start: 4px solid var(--warn); background: var(--warn-bg); color: #6b4510; border-radius: var(--r-sm); padding: .55rem .8rem; }
.pr-setup summary { display: flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.pr-setup summary::-webkit-details-marker { display: none; }
.pr-setup summary > i { color: var(--warn); font-size: 1.05rem; }
.pr-setup summary b { font-size: .9rem; color: #5a3a0c; }
.pr-setup summary small { color: #8a5a12; font-weight: 600; }
.pr-setup summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-inline-start: auto; font-size: .75rem; transition: transform .2s; }
.pr-setup[open] summary::after { transform: rotate(180deg); }
.pr-setup p { margin: .5rem 0 .3rem; line-height: 1.6; }
.pr-setup ol { margin: 0; padding-inline-start: 1.3rem; display: flex; flex-direction: column; gap: .45rem; line-height: 1.6; }
.pr-setup ol small { display: block; color: #8a5a12; margin-top: .2rem; }
.pr-setup ol { max-height: 34vh; overflow: auto; }
.pr-cmd { display: flex; align-items: center; gap: .3rem; margin-top: .25rem; background: #fff; border: 1px solid #f0d9b0; border-radius: var(--r-xs); padding: .15rem .2rem .15rem .55rem; direction: ltr; }
.pr-cmd code { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: #2b2b2b; white-space: pre-wrap; overflow-wrap: anywhere; padding: .2rem 0; }
.pr-cmd .icon-btn { width: 28px; height: 28px; font-size: .78rem; flex: none; }
/* the stage 1 layout review (Scripts/revit-layout.js) */
.dlg.lay-dlg { max-width: 1180px; display: flex; flex-direction: column; gap: .8rem; max-height: 94vh; padding: 1.1rem 1.2rem; }
.lay-status { align-self: center; padding: .2rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--soft); color: var(--ink-2); direction: ltr; }
.lay-status.s-approved { background: var(--ok-bg); color: var(--ok); } .lay-status.s-changes { background: var(--warn-bg); color: #8a5a12; }
.lay-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 1rem; min-height: 0; overflow: auto; }
.lay-plan { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.lay-levels { align-self: flex-start; flex-wrap: wrap; direction: ltr; }
.lay-svg { width: 100%; height: auto; max-height: 64vh; background: #fbfaf7; border: 1px solid var(--line); border-radius: var(--r-sm); }
.lay-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .76rem; color: var(--muted); }
.lay-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.lay-legend i { width: 14px; height: 10px; border: 1px solid #888; border-radius: 2px; display: inline-block; }
.lay-legend i.ln { height: 0; border: 0; border-top: 3px solid #1f6fb2; } .lay-legend i.ln.car { border-top-color: #b5541b; } .lay-legend i.ln.dash { border-top: 2px dashed #3f8f5f; }
.lay-side { display: flex; flex-direction: column; gap: .5rem; min-width: 0; font-size: .84rem; }
.lay-side h4 { margin: .4rem 0 0; font-size: .86rem; }
.lay-sum { font-weight: 700; } .lay-sum .ok { color: var(--ok); } .lay-sum .bad { color: var(--bad); }
.lay-checks, .lay-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.lay-checks li { display: flex; gap: .5rem; align-items: flex-start; padding: .35rem .5rem; border-radius: var(--r-sm); background: var(--soft); }
.lay-checks li > i { margin-top: .2rem; } .lay-checks li.ok > i { color: var(--ok); } .lay-checks li.bad { background: var(--bad-bg); } .lay-checks li.bad > i { color: var(--bad); } .lay-checks li.na > i { color: var(--muted); }
.lay-checks small { display: block; color: var(--muted); font-size: .76rem; margin-top: .1rem; }
.lay-notes li { padding: .3rem .5rem; border-inline-start: 3px solid var(--line); color: var(--ink-2); }
.lay-note span { display: block; font-weight: 700; margin-bottom: .2rem; } .lay-note textarea { width: 100%; }
.lay-keep { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; } .lay-keep input { width: auto; }
@media (max-width: 860px) { .lay-body { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .pr-scen { grid-template-columns: 1fr; } .pr-out textarea { min-height: 40vh; } }

/* ---------- interaction polish (one behaviour for every control) ----------
   a pressed control sinks a pixel; hover changes ease in; nested segments sit inside their track's radius */
.icon-btn, .md-btn, .chip, .chip-btn, .pcard, .rail-item, .stat, .seg button, .ge-tp, .ge-pf, .ge-tool, .ge-chip, .ge-sp, .pr-card, .floor-tab, .libm-stat {
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease); }
.icon-btn:active, .md-btn:active, .chip:active, .chip-btn:active, .pcard:active, .rail-item:active, .stat:active, .seg button:active, .ge-tp:active, .ge-pf:active,
.ge-tool:active, .ge-chip:active, .ge-sp:active, .pr-card:active, .floor-tab:active, .libm-stat:not([disabled]):active { transform: translateY(1px); }
.seg button, .ge-tab, .pr-seg button { border-radius: var(--r-xs); }
.md-btn:focus-visible, .chip:focus-visible, .pcard:focus-visible, .rail-item:focus-visible, .ge-tab:focus-visible { outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: #8a9ba6; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- the rail: the brief's main parts and their items (S.groups, BriefCatalog) ---------- */
.rail-nav { padding: .3rem .7rem 1rem; }
.rg { border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: .55rem; overflow: hidden; transition: background .2s, border-color .2s; }
.rg.here { background: #e8f7f4; border-color: #bfe6df; }
.rg-top { display: flex; align-items: center; }
.rg-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; padding: .6rem .6rem; border: 0; background: transparent; cursor: pointer; text-align: start; color: var(--ink); font-weight: 800; border-radius: var(--r-sm); }
.rg-head .ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--teal, #0f8a7e); font-size: 1rem; flex: none; position: relative; }
.rg-num { font-weight: 800; font-size: .9rem; color: var(--ink); font-variant-numeric: tabular-nums; flex: none; }
.rg-head .lbl { flex: 1; min-width: 0; font-size: .9rem; line-height: 1.3; }
.rg-head:hover { color: var(--primary); }
.rg-head.on .lbl { color: var(--primary); }
.rg .cnt { font-size: .7rem; color: var(--muted); font-weight: 700; flex: none; }
.rg-head.flagged .ico::after, .rg-sub.flagged .dot { background: var(--accent); }
.rg-head.flagged .ico::after { content: ''; position: absolute; top: 0; inset-inline-end: 0; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; }
.rg-fold { width: 30px; height: 34px; border: 0; background: transparent; color: var(--primary-2); cursor: pointer; flex: none; margin-inline-end: .25rem; border-radius: var(--r-xs); }
.rg-fold i { transition: transform .2s; font-size: .8rem; transform: rotate(-90deg); }
[dir=rtl] .rg-fold i { transform: rotate(90deg); }
.rg.open .rg-fold i, [dir=rtl] .rg.open .rg-fold i { transform: none; }
.rg-fold:hover { background: rgba(25,89,122,.08); }
.rg-subs { padding: 0 .55rem .5rem; position: relative; }
.rg-subs::before { content: ''; position: absolute; top: 0; bottom: 1.1rem; inset-inline-start: 1.28rem; width: 1px; background: #c5d3dc; }
.rg-sub { width: 100%; display: flex; align-items: center; gap: .55rem; padding: .34rem .4rem; border: 0; background: transparent; cursor: pointer; text-align: start; color: var(--ink-2); font-weight: 600; border-radius: var(--r-xs); position: relative; }
.rg-sub .dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--primary-2); background: #fff; margin-inline-start: .39rem; flex: none; z-index: 1; }
.rg-sub .lbl { flex: 1; min-width: 0; font-size: .86rem; line-height: 1.3; }
.rg-sub .lbl small { display: block; color: var(--muted); font-size: .72rem; font-weight: 500; margin-top: .05rem; }
.rg-sub:hover { background: rgba(25,89,122,.06); }
.rg-sub.on { background: var(--tint); color: var(--primary); font-weight: 800; }
.rg-sub.on .dot { background: var(--primary); border-color: var(--primary); }
.rg .cnt .fa-check { color: var(--ok); }
.rg .cnt .cnt-int { font-weight: 600; opacity: .85; white-space: nowrap; }
.rg .cnt .cnt-int i { font-size: .65rem; }

/* a section shown inside another one's page (the stairs & lift on the ground floor) */
.sec-part { margin-top: 1.8rem; padding-top: 1.3rem; border-top: 1px dashed #cfdce4; }
.sec-part-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.sec-part-head .ico { width: 42px; height: 42px; border-radius: var(--r); display: grid; place-items: center; font-size: 1.05rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); flex: none; }
.sec-part-head h3 { font-size: 1.15rem; }
.sec-part-head p { margin: .1rem 0 0; color: var(--muted); font-size: .88rem; }

/* questions grouped under a heading (brief.json "sets": the stairs' main / service, each with its inside / outside set nested) */
.qset { grid-column: 1 / -1; padding: 1rem; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--tint), var(--soft) 8rem); border: 1px solid #d3e4ec; min-width: 0; }
.qset-in { padding: .85rem; border-radius: var(--r); background: rgba(255,255,255,.6); border: 1px dashed #c3d8e3; }
.qset-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .85rem; }
.qset-head .ico { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: .98rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); flex: none; }
.qset-in > .qset-head .ico { width: 30px; height: 30px; font-size: .8rem; color: var(--primary); background: var(--tint); border: 1px solid #c9dde7; }
.qset-head h4 { margin: 0; font-size: 1.08rem; color: var(--ink); }
.qset-in > .qset-head h4 { font-size: .98rem; color: var(--primary); }
.qset-head p { margin: .1rem 0 0; color: var(--muted); font-size: .85rem; }
.qset-new { animation: secIn .32s var(--ease); }   /* a part just added (workspace.js set) */
.qset { scroll-margin-top: 84px; }   /* scrolled to under the sheet's head */
/* a part's ×: takes it away with its answers (an undo in the toast) */
.qset-del { margin-inline-start: auto; align-self: flex-start; width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: .85rem; cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.qset-del:hover { color: var(--bad); background: var(--bad-bg); border-color: rgba(214,69,69,.25); }
.qset-del:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(214,69,69,.2); }
/* an adder: what can still be added to the set, as quiet buttons at its end */
.q.q-adder { padding: .7rem .85rem; background: rgba(255,255,255,.55); box-shadow: none; border: 1.5px dashed #c3d8e3; }
.q.q-adder.has-parts { background: transparent; border-color: #d6e4ec; }
.adder { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.adder-txt { color: var(--ink-2); font-size: .88rem; font-weight: 600; margin-inline-end: .2rem; }
.has-parts .adder-txt { color: var(--muted); font-weight: 500; }
.adder-btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #c9dde7; background: var(--card); color: var(--primary); border-radius: 999px; padding: .42rem .95rem; font: inherit; font-weight: 700; font-size: .86rem; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.adder-btn > .fa-plus { font-size: .72rem; color: var(--primary-2); }
.adder-btn .adder-ico { font-size: .8rem; opacity: .75; }
.adder-btn:hover { border-color: var(--primary-2); background: var(--tint); box-shadow: 0 2px 8px rgba(25,89,122,.1); }
.adder-btn:focus-visible, .adder-none:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(35,132,159,.25); }
.adder-none { border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: .84rem; font-weight: 600; padding: .4rem .7rem; border-radius: 999px; cursor: pointer; }
.adder-none:hover { color: var(--ink-2); background: var(--line-2); }
.adder-tools { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .35rem; }
.q-adder.flagged .flag-btn { color: var(--accent); }
.tg-more > .q-help { display: block; margin-top: .45rem; color: var(--muted); font-size: .82rem; }
@container sheet (max-width: 560px) {
  .qset { padding: .75rem; }
  .qset-in { padding: .65rem; }
}
@media (max-width: 560px) {
  .qset { padding: .7rem; }
  .qset-in { padding: .6rem; }
}

/* questions another section holds, answered on this page too (the property on the client's details): one answer, two places */
.sec-also { margin-top: 1.4rem; padding: 1rem; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--tint), var(--soft) 9rem); border: 1px solid #d3e4ec; }
.sec-also-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .95rem; flex-wrap: wrap; }
.sec-also-head .ico { width: 42px; height: 42px; border-radius: var(--r); display: grid; place-items: center; font-size: 1.05rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 14px rgba(25,89,122,.2); flex: none; }
.sec-also-txt { flex: 1; min-width: 12rem; }
.sec-also-txt h3 { font-size: 1.12rem; }
.sec-also-txt p { margin: .1rem 0 0; color: var(--muted); font-size: .86rem; }
.also-home { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid #c9dde7; background: var(--card); color: var(--primary); border-radius: 999px; padding: .34rem .8rem; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.also-home i { font-size: .72rem; color: var(--primary-2); }
.also-home b { font-weight: 800; }
.also-home:hover { border-color: var(--primary-2); background: var(--tint); }
.also-home:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(35,132,159,.25); }

/* the picture & model library inside the stage, in its own section */
.stage > .lib-dock { display: none; position: relative; inset: auto; z-index: auto; width: auto; border-radius: 0; box-shadow: none; transform: none; opacity: 1; pointer-events: auto; transition: none; }

/* ---------- a component's choices in a request: chosen from its pictures ---------- */
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: .65rem; }
.cmp-card { position: relative; border: 1.5px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cmp-card:hover { border-color: #b9ccd8; transform: translateY(-1px); }
.cmp-card.on { border-color: var(--primary); box-shadow: 0 6px 16px rgba(25,89,122,.16); }
.cmp-card.off { opacity: .65; }
.cmp-btn { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); font-weight: 700; font-size: .86rem; text-align: center; }
.cmp-card.on .cmp-btn { color: var(--primary); background: var(--tint); }
.cmp-pic { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--soft); overflow: hidden; color: var(--primary-2); }
.cmp-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-pic > i { font-size: 1.7rem; }
.cmp-pic .stair-pic { width: 62%; height: auto; }
.cmp-pic .sw { width: 60%; height: 60%; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.cmp-name { display: block; padding: .5rem .45rem .55rem; line-height: 1.25; }
.cmp-zoom { position: absolute; top: .35rem; inset-inline-start: .35rem; width: 28px; height: 28px; border: 0; border-radius: var(--r-xs); background: rgba(15,42,56,.62); color: #fff; cursor: zoom-in; display: grid; place-items: center; font-size: .78rem; opacity: 0; transition: opacity .15s; }
.cmp-card:hover .cmp-zoom, .cmp-zoom:focus-visible { opacity: 1; }
@media (hover: none) { .cmp-zoom { opacity: 1; } }
.cmp-tick { position: absolute; top: .35rem; inset-inline-end: .35rem; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .7rem; pointer-events: none; box-shadow: 0 0 0 2px #fff; }
.cmp-card.has-pn .cmp-name::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #7c5cd6; margin-inline-start: .3rem; vertical-align: middle; }
.cmp-notes { margin-top: .6rem; }
.cmp-notes > summary { cursor: pointer; color: var(--primary-2); font-size: .82rem; font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; list-style: none; }
.cmp-notes > summary::-webkit-details-marker { display: none; }
.cmp-notes textarea { margin-top: .4rem; }
.dlg.cmp-view { max-width: min(900px, 94vw); }
.dlg.cmp-view img { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--r-sm); background: var(--soft); margin-top: .5rem; }
.pr-pics { display: inline-flex; gap: .35rem; vertical-align: middle; margin-inline-end: .45rem; flex-wrap: wrap; }
.pr-img { width: 4.6rem; height: 3.4rem; object-fit: cover; border-radius: 6px; border: 1px solid #d8e2e8; }
.pr-note { display: block; color: #4a5e6b; margin-top: .2rem; }

/* ---------- the template's items: order, show, hide (Scripts/layout-editor.js) ---------- */
.dlg.le-dlg { max-width: 760px; }
.le-dlg h3 i { color: var(--primary-2); }
.le-tree { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding-inline-end: .2rem; }
.le-group { flex: none; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.le-ghead { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; background: var(--soft); }
.le-ghead > i { color: var(--primary-2); }
.le-ghead b { flex: 1; min-width: 0; }
.le-row { display: flex; align-items: center; gap: .3rem; padding: .32rem .7rem; border-top: 1px solid var(--line); }
.le-row .ico { width: 26px; text-align: center; color: var(--primary-2); flex: none; }
.le-name { flex: 1; min-width: 0; line-height: 1.25; }
.le-name b { font-weight: 600; font-size: .92rem; }
.le-name small { display: block; color: var(--muted); font-size: .74rem; }
.le-row.own .le-name b { font-weight: 800; }
.le-row.emb { padding-inline-start: 1.7rem; }
.le-row.off { background: #f7f9fa; }
.le-row.off .le-name b, .le-row.off .ico { opacity: .5; }
.le-row .icon-btn { width: 30px; height: 30px; font-size: .78rem; }
.le-row .icon-btn.on, .le-eye.on { background: var(--tint-accent); color: var(--accent); }
.le-fields { padding: .4rem .9rem .6rem 2.4rem; background: #fbfcfd; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: .15rem .8rem; }
[dir=rtl] .le-fields { padding: .4rem 2.4rem .6rem .9rem; }
.le-f { display: flex; align-items: center; gap: .4rem; font-size: .85rem; cursor: pointer; padding: .12rem 0; }
.le-f input { width: auto; flex: none; }
.le-f small { color: var(--muted); font-size: .7rem; }
.le-f.off span { color: var(--muted); text-decoration: line-through; }

/* ---------- إدارة المكونات (/components) ---------- */
.cm-hero-acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.cm-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.cm-side { position: sticky; top: calc(var(--top) + .8rem); background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); padding: .8rem; max-height: calc(100vh - var(--top) - 1.6rem); display: flex; flex-direction: column; gap: .6rem; }
.cm-list { overflow-y: auto; min-height: 0; }
.cm-sec { font-size: .74rem; font-weight: 800; color: var(--muted); padding: .7rem .4rem .25rem; display: flex; justify-content: space-between; gap: .4rem; }
.cm-sec small { font-weight: 600; color: var(--accent); }
.cm-row { width: 100%; display: flex; align-items: center; gap: .5rem; border: 0; background: transparent; padding: .42rem .55rem; border-radius: var(--r-xs); cursor: pointer; text-align: start; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.cm-row .lbl { flex: 1; min-width: 0; }
.cm-row small { color: var(--muted); font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; gap: .2rem; flex: none; }
.cm-row:hover { background: var(--soft); }
.cm-row.on { background: var(--tint); color: var(--primary); font-weight: 800; }
.cm-row.off .lbl { opacity: .5; text-decoration: line-through; }
.cm-pane { min-width: 0; }
.cm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cm-title { min-width: 0; }
.cm-title h2 { font-size: 1.35rem; }
.cm-title p { margin: .2rem 0 0; font-size: .86rem; }
.cm-warn { color: var(--accent); font-weight: 700; }
.cm-acts { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(205px, 100%), 1fr)); gap: .85rem; }
.cm-card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; display: flex; flex-direction: column; border: 1.5px solid transparent; }
.cm-card:hover { border-color: #c7d6df; }
.cm-card.off .cm-pic { filter: grayscale(1); opacity: .55; }
.cm-card.off .cm-name { color: var(--muted); }
.cm-pic { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; background: var(--soft); cursor: pointer; color: var(--primary-2); overflow: hidden; }
.cm-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-pic > i { font-size: 2rem; opacity: .7; }
.cm-pic .stair-pic { width: 58%; height: auto; }
.cm-pic .sw { width: 55%; height: 55%; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.cm-body { padding: .6rem .7rem .2rem; flex: 1; }
.cm-name { border: 0; background: transparent; padding: 0; font-weight: 800; color: var(--ink); cursor: pointer; text-align: start; font-size: .94rem; }
.cm-name:hover { color: var(--primary); }
.cm-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
.cm-tag { font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: var(--r-xs); display: inline-flex; align-items: center; gap: .25rem; }
.cm-tag.ok { background: #e6f5ee; color: #17794f; }
.cm-tag.miss { background: var(--soft); color: var(--muted); }
.cm-foot { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .4rem .7rem .6rem; }
.cm-move { display: inline-flex; gap: .1rem; }
.cm-move .icon-btn { width: 28px; height: 28px; font-size: .72rem; }
.cm-sw { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.cm-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.cm-sw i { width: 34px; height: 20px; border-radius: 999px; background: #c6d2da; position: relative; transition: background .15s; flex: none; }
.cm-sw i::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: inset .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.cm-sw input:checked + i { background: var(--ok); }
.cm-sw input:checked + i::after { inset-inline-start: 16px; }
.cm-sw input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }
.cm-sw input:disabled + i { opacity: .5; }
.dlg.cm-dlg { max-width: 860px; }
.cm-form { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.1rem; margin-top: .8rem; }
.cm-photo { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.cm-drop { display: block; width: 100%; border: 2px dashed #c3d2db; border-radius: var(--r); overflow: hidden; cursor: pointer; background: #fbfcfd; transition: border-color .15s, background .15s; }
.cm-drop.over, .cm-drop:hover { border-color: var(--primary); background: var(--tint); }
.cm-prev { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--soft); color: var(--primary-2); overflow: hidden; }
.cm-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-prev > i { font-size: 2.2rem; opacity: .6; }
.cm-prev .stair-pic { width: 58%; height: auto; }
.cm-prev .sw { width: 55%; height: 55%; border-radius: var(--r-sm); }
.cm-drop-t { display: flex; gap: .4rem; align-items: center; justify-content: center; padding: .5rem; font-size: .78rem; font-weight: 700; color: var(--primary-2); text-align: center; }
.cm-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.cm-fields .field { margin-bottom: .7rem; }
.cm-fields .field > span:first-child { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cm-tr { border: 0; background: var(--tint); color: var(--primary); border-radius: var(--r-xs); padding: .15rem .5rem; font-size: .75rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.cm-tr:disabled { opacity: .45; cursor: default; }
.cm-tr.loading i { animation: spin 1s linear infinite; }
.cm-hint { font-size: .78rem; margin: 0; }
@media (max-width: 900px) {
  .cm-wrap { grid-template-columns: minmax(0, 1fr); }
  .cm-side { position: static; max-height: 44vh; }
  .cm-form { grid-template-columns: minmax(0, 1fr); }
  .cm-photo { max-width: 280px; }
  .cm-pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ---------- الاشتراطات التنظيمية (/regulations, Scripts/regs-admin.js): the side list and pane of /components ---------- */
.rgm-stats .libm-stat.rgm-warn i { background: var(--warn-bg); color: var(--warn); }
.rgm-stats .libm-stat.rgm-warn.on { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(201,130,26,.16); }
.rgm-ico { color: var(--primary-2); width: 1.1rem; text-align: center; }
.cm-row .rgm-empty { font-style: normal; color: var(--warn); display: inline-flex; align-items: center; gap: .2rem; margin-inline-end: .4rem; }
.cm-row .rgm-empty i { font-size: .62rem; }
.rgm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-inline-end: .4rem; }
.cm-row.rgm-dim { opacity: .45; }
.rgm-newcat { padding: .7rem .4rem .2rem; margin-top: .5rem; border-top: 1px solid var(--line); }
.rgm-block { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.rgm-src { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rgm-page .set-field input:not([inputmode=decimal]), .rgm-page .rg-zones input { text-align: start; font-weight: 600; font-size: .95rem; }
.rgm-page .rg-cat-edit { margin-top: 0; }
.rg-ed.rgm-changed, .rg-ed.rgm-new { border-inline-start: 3px solid var(--accent); }
.rgm-tag { font-size: .68rem; font-weight: 800; padding: .05rem .4rem; border-radius: var(--r-xs); vertical-align: middle; margin-inline-start: .3rem; }
.rgm-tag.changed { background: var(--tint-accent); color: #a3401a; }
.rgm-tag.new { background: var(--ok-bg); color: var(--ok); }
.rgm-await { color: var(--warn); font-weight: 700; display: inline-flex; gap: .3rem; align-items: center; }
.rgm-await i { font-size: .7rem; }
.rgm-gcat button { border: 0; background: none; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.rgm-gcat button:hover { text-decoration: underline; }
.rgm-none { text-align: center; padding: 2.4rem 1rem; background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); }
.rgm-none > i { font-size: 1.8rem; color: var(--primary-2); opacity: .6; }
.rgm-none p { margin: .6rem 0 0; }
.rgm-bar { position: sticky; bottom: .8rem; z-index: 20; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; padding: .7rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); }
.rgm-bar.dirty { border-color: rgba(240,93,34,.55); box-shadow: 0 6px 24px rgba(240,93,34,.16); }
.rgm-meta { flex: 1; min-width: 12rem; font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.rgm-meta > i { color: var(--ok); }
.rgm-unsaved { color: #a3401a; display: inline-flex; align-items: center; gap: .4rem; }
.rgm-unsaved i { font-size: .5rem; }
.rgm-page ~ .toasts { bottom: 5.4rem; }   /* above the save bar */
@media (max-width: 760px) {
  .rgm-src { grid-template-columns: minmax(0, 1fr); }
  .rgm-bar { bottom: .4rem; padding: .5rem .6rem; gap: .45rem; }
  .rgm-meta { flex-basis: 100%; min-width: 0; font-size: .78rem; }
  .rgm-bar #regsSave { flex: 1; }
  .rgm-bar #regsUndo span { display: none; }
  .rgm-page ~ .toasts { bottom: 6.6rem; }
}

/* ---------- مكتبة الصور التوضيحية (/glossary, Scripts/glossary-admin.js): the side list and cards of /components ---------- */
.glm-stats .libm-stat.glm-warn i { background: var(--warn-bg); color: var(--warn); }
.glm-stats .libm-stat.glm-warn.on { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(201,130,26,.16); }
.glm-ico { color: var(--primary-2); width: 1.1rem; text-align: center; }
.cm-row.glm-dim { opacity: .45; }
.cm-row .glm-hid { font-style: normal; color: var(--muted); display: inline-flex; align-items: center; gap: .2rem; margin-inline-end: .4rem; }
.cm-row .glm-hid i { font-size: .62rem; }
.glm-grid { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.glm-card .cm-pic { aspect-ratio: 16 / 10; }
.glm-card.off .cm-pic { filter: grayscale(.85); opacity: .55; }
.glm-nopic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; width: 100%; height: 100%; aspect-ratio: 16 / 10; background: var(--soft); color: var(--muted); font-size: .8rem; font-weight: 700; border-radius: inherit; }
.glm-nopic i { font-size: 1.8rem; color: var(--primary-2); opacity: .6; }
.glm-other { display: block; color: var(--muted); font-size: .76rem; margin-top: .1rem; }
.glm-short { margin: .35rem 0 0; font-size: .8rem; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-tag.warn { background: var(--warn-bg); color: var(--warn); }
.dlg.glm-dlg { max-width: 900px; }
.glm-dlg .set-field input { text-align: start; font-weight: 600; font-size: .95rem; }
.glm-dhead { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.glm-dhead h3 { margin: 0 0 .15rem; }
.glm-dhead small { font-size: .78rem; }
.glm-off { color: var(--bad); }
.glm-step { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 700; color: var(--muted); flex: none; }
.glm-newpic { margin: .8rem 0 1rem; }
.glm-acts { align-items: center; flex-wrap: wrap; }
.glm-acts .glm-del { color: var(--bad); }
.glm-unsaved { color: #a3401a; font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; gap: .35rem; margin-inline-end: auto; }
.glm-unsaved[hidden] { display: inline-flex; visibility: hidden; }   /* keeps its place: the buttons stay at the end */
.glm-unsaved i { font-size: .5rem; }
.glm-dlg .btn-ghost.loading::after { border-color: rgba(25,89,122,.25); border-top-color: var(--primary); }
.glm-pv-note { font-size: .8rem; margin: .9rem 0 0; }
@media (max-width: 760px) { .glm-dhead { flex-direction: column; } }

/* =====================================================================
   The side panel (design.aspx, template.aspx): the sections or the overview, folding to icons.
     wide (1280+)       beside the stage, or icons
     tablet landscape   icons; the panel opens over the stage and gets out of the way after a choice
     phone              the panel slides in from the bar's menu button
   The studio (design.aspx, .ws-studio): the library or the model on the stage, each section sliding out beside it.
     landscape          the sheet pushes the design, which stays whole
     portrait           the sheet rises from below, the design above it
   ===================================================================== */
.ws.ws-studio { --sheet-w: clamp(480px, 34vw, 680px); }
.ws.ws-studio.sheet-wide { --sheet-w: clamp(620px, 52vw, 1040px); }
@media (max-width: 1499px) { .ws.ws-studio { --sheet-w: 440px; } .ws.ws-studio.sheet-wide { --sheet-w: min(680px, 56vw); } }
@media (max-width: 1100px) { .ws.ws-studio { --sheet-w: min(400px, 52vw); } .ws.ws-studio.sheet-wide { --sheet-w: 62vw; } }
.ws-studio > .stage { display: flex; overflow: hidden; scroll-behavior: auto; min-width: 0; background: #0f2a38; }
.ws-studio > .stage > .lib-dock { display: grid; flex: 1; min-width: 0; min-height: 0; container: libdock / inline-size; }
.ws-studio .gv-stage { container: gvstage / inline-size; }
.ws-scrim { display: none; }

/* the sheet: it opens from under the panel; its page keeps its width, so it slides instead of reflowing */
.sheet, .sheet-scroll { display: contents; }   /* without the studio the page simply sits on the stage */
.ws-studio .sheet { display: block; position: relative; z-index: 5; flex: none; width: 0; min-height: 0; overflow: hidden; visibility: hidden; background: var(--bg); transition: width .38s var(--ease), visibility 0s .38s; }
.ws-studio.sheet-open .sheet { width: var(--sheet-w); visibility: visible; box-shadow: 0 0 34px rgba(8,28,38,.34); transition: width .38s var(--ease), visibility 0s; }
.ws-studio .sheet-scroll { display: block; position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: var(--sheet-w); overflow-y: auto; overscroll-behavior: contain; container: sheet / inline-size; transition: width .38s var(--ease); }
.ws-studio .stage-inner { max-width: none; margin: 0; padding: 0 1.1rem 2rem; }
.ws-studio .stage-inner > .locked-banner { margin: .8rem 0 0; }
.ws-studio .sec-head { position: sticky; top: 0; z-index: 6; gap: .7rem; margin: 0 -1.1rem .9rem; padding: .65rem .8rem .65rem 1.1rem; background: var(--card); border-bottom: 1px solid var(--line); }
[dir=rtl] .ws-studio .sec-head { padding: .65rem 1.1rem .65rem .8rem; }
.ws-studio .sec-head > div { flex: 1; min-width: 0; }
.ws-studio .sec-head .big-ico { width: 38px; height: 38px; border-radius: var(--r-sm); font-size: .98rem; box-shadow: none; }
.ws-studio .sec-head h2 { font-size: 1.08rem; }
.ws-studio .sec-head p { margin: 0; font-size: .78rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-studio .sec-head .step { margin: 0; font-size: .76rem; }
.sheet-tools { display: flex; gap: .15rem; flex: none; }
.sheet-tools .icon-btn { width: 34px; height: 34px; }
.sheet-x { background: var(--soft); color: var(--ink); }
.sheet-x:hover { background: var(--ink); color: #fff; }
.ws-studio.sheet-wide .sheet-size { background: var(--tint); color: var(--primary); }
.ws-studio .sec-nav { margin-top: 1.3rem; }
.ws-studio .next-card { padding: .7rem .9rem; }
@container sheet (max-width: 560px) {
  .qgrid { grid-template-columns: minmax(0, 1fr); }
  .q.fill > input, .q.fill > select, .q.fill > .unit-wrap, .q.fill > .gis-row { max-width: none; }
  .q { padding: .85rem .9rem .95rem; }
  .sec-head .step { display: none; }
}
@container sheet (max-width: 640px) {
  .room { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .room .unit-wrap, .room .tot { grid-column: span 1; }
}

/* the panel: the sections or the overview */
.rail-views { display: flex; gap: 3px; flex: none; margin: 0 .7rem .45rem; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); }
.rv-btn { flex: 1; min-width: 0; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .38rem .45rem; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--ink-2); font-weight: 700; font-size: .82rem; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.rv-btn i { font-size: .82rem; }
.rv-btn:hover { color: var(--primary); }
.rv-btn.on { background: var(--card); color: var(--primary); box-shadow: var(--sh-1); }
.rv-badge { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .66rem; font-weight: 800; line-height: 17px; text-align: center; }
.rv-badge.hot { background: var(--bad); }
.rv-badge[hidden] { display: none; }
/* the design library: its own entry in the panel, above the brief's parts */
/* the stage's two choices, one above the other: the design library, the design on the plot */
.rail-libs { flex: none; display: flex; flex-direction: column; gap: .3rem; margin: 0 .7rem .55rem; }
.rail-libs .rail-lib { margin: 0; }
.rail-libs .rail-lib + .rail-lib { padding-block: .3rem; }
.rail-libs .rail-lib + .rail-lib .ico { width: 30px; height: 30px; font-size: .92rem; }
.ws:not(.ws-studio) .rail-libs { display: none; }
.rail-lib { flex: none; display: flex; align-items: center; gap: .55rem; margin: 0 .7rem .55rem; padding: .4rem .6rem; border: 0; border-radius: var(--r); background: var(--tint); color: var(--primary); font-weight: 800; font-size: .9rem; text-align: start; cursor: pointer; transition: background .15s, color .15s; }
.rail-lib:hover { background: #dcecf3; }
.rail-lib .ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--card); font-size: 1rem; }
.rail-lib .lbl { flex: 1; min-width: 0; }
.rail-lib small { flex: none; font-size: .72rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail-lib.on { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.rail-lib.on .ico { background: rgba(255,255,255,.18); }
.rail-lib.on small { color: rgba(255,255,255,.8); }
.ws:not(.ws-studio) .rail-lib { display: none; }
.rail-foot { align-items: center; flex-wrap: nowrap; padding: .45rem .7rem; flex: none; }
.rail-keys { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .1rem .6rem; font-size: .72rem; }
.rail-fold { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--card); color: var(--primary-2); cursor: pointer; transition: background .15s, color .15s; }
.rail-fold:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.rail-fold i { font-size: .78rem; transition: transform .3s var(--ease); }
[dir=ltr] .rail-fold i, [dir=rtl] .rail-mini .rail-fold i { transform: scaleX(-1); }
[dir=ltr] .rail-mini .rail-fold i { transform: none; }

/* the overview, inside the panel */
.insight { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: .3rem .8rem 1rem; }
.insight[hidden] { display: none; }
.insight h4 { margin: 1rem 0 .4rem; color: var(--muted); font-size: .78rem; font-weight: 800; }
.ov-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: .5rem 0; background: var(--soft); border-radius: var(--r-sm); }
.ov-stat { min-width: 0; text-align: center; }
.ov-stat + .ov-stat { border-inline-start: 1px solid var(--line); }
.ov-stat b { display: block; font-size: 1rem; line-height: 1.25; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.ov-stat small { color: var(--muted); font-size: .7rem; font-weight: 600; }
.ov-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 .5rem; padding: .5rem .2rem 0; font-size: .78rem; }
.ov-line > span { color: var(--muted); font-weight: 600; }
.ov-line > b { font-size: .83rem; font-variant-numeric: tabular-nums; }
.ov-line .meter { flex-basis: 100%; height: 5px; margin-top: .25rem; }
.ov-item { width: 100%; display: flex; flex-wrap: wrap; align-items: flex-start; gap: .1rem .5rem; margin-bottom: .3rem; padding: .42rem .6rem; border: 0; border-radius: var(--r-sm); background: var(--soft); color: var(--ink-2); text-align: start; font-size: .81rem; font-weight: 600; line-height: 1.35; transition: filter .15s; }
button.ov-item { cursor: pointer; }
button.ov-item:hover { filter: brightness(.96); }
.ov-item > i { flex: none; margin-top: .17rem; font-size: .75rem; }
.ov-item > span:first-of-type { flex: 1; min-width: 0; }
.ov-item.bad { background: var(--bad-bg); color: #a32f2f; }
.ov-item.flag { background: var(--tint-accent); color: #a3401a; }
.ov-item.def { background: var(--warn-bg); color: #7c5310; }
.ov-acts { flex-basis: 100%; display: flex; gap: .3rem; margin-top: .3rem; }
.ov-acts button { border: 0; border-radius: var(--r-xs); background: var(--card); color: var(--primary); padding: .14rem .55rem; font-size: .75rem; font-weight: 700; cursor: pointer; }
.ov-acts button:hover { background: var(--primary); color: #fff; }
.ov-more { border: 0; background: transparent; padding: .1rem .2rem .4rem; color: var(--primary); font-size: .76rem; font-weight: 700; cursor: pointer; }
.ov-clear { display: flex; align-items: center; gap: .45rem; margin: 0; color: var(--ok); font-size: .82rem; font-weight: 600; }
.ov-regs { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .35rem 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ov-regs:hover { border-color: var(--primary-2); box-shadow: var(--sh-1); }
.ov-regs span { color: var(--muted); font-size: .7rem; font-weight: 600; text-align: center; }
.ov-regs b { display: block; color: var(--ink); font-size: 1rem; line-height: 1.25; }
.ov-regs .ok b { color: var(--ok); } .ov-regs .bad b { color: var(--bad); }
.ov-link { width: 100%; display: flex; align-items: center; gap: .5rem; margin-top: .7rem; padding: .6rem .2rem 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: .82rem; font-weight: 700; cursor: pointer; }
.ov-link > span { flex: 1; text-align: start; }
.ov-link > b { color: var(--muted); font-size: .74rem; }
.ov-link:hover { color: var(--primary); }
.ov-team { display: none; }
.ov-tools .chip-btn { padding: .28rem .65rem; font-size: .78rem; }
.ov-tools .chip-btn[disabled] { opacity: .5; cursor: default; }
.ov-hint { margin: .35rem .1rem 0; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.ov-dirty { margin: .55rem 0 0; }
.insight .tpl-meta { padding: .5rem .65rem; font-size: .8rem; margin-bottom: .5rem; }
.dlg .tpl-hist { margin-top: .8rem; }
.dlg .hist-t { margin: 1rem 0 .4rem; color: var(--muted); font-size: .82rem; }

/* the team, on the top bar */
.team-stack { flex: none; display: inline-flex; align-items: center; padding: .2rem .35rem; border: 0; border-radius: 999px; background: transparent; cursor: pointer; transition: background .15s; }
.team-stack:hover, .team-stack[aria-expanded=true] { background: var(--tint); }
.team-stack .avatar { width: 30px; height: 30px; font-size: .68rem; box-shadow: 0 0 0 2px var(--card); }
.team-stack .avatar i { font-size: .66rem; }
.team-stack .avatar.empty { background: var(--card); color: var(--muted); border: 1.5px dashed #b4c4cf; }
.team-stack .avatar + .avatar { margin-inline-start: -9px; }
.ws-pop { position: fixed; z-index: 80; max-height: 80vh; overflow-y: auto; padding: .7rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-3); animation: popIn .16s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.rp-title { display: block; margin-bottom: .45rem; color: var(--muted); font-size: .8rem; }
.team-pop { width: 320px; max-width: calc(100vw - 16px); }
.team-pop .eng:last-of-type { margin-bottom: 0; }
.tp-note { margin: .5rem 0 0; font-size: .75rem; }
.rail-pop { width: 280px; max-width: calc(100vw - 90px); }
.rail-pop .rg-subs { padding: 0; }

/* the stage's own bar and tools follow the room the stage has, not the window */
.lib-top h3 span { overflow: hidden; text-overflow: ellipsis; }
@container libdock (max-width: 1060px) { .lib-top h3 { display: none; } }
@container libdock (max-width: 640px) { .ld-info { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: .5rem; } .ld-info > :not(.lib-meta) { grid-column: 1; } }
@container libdock (max-width: 900px) { .lib-save { font-size: 0; } .lib-save i { font-size: .8rem; } }
@media (min-width: 761px) { @container libdock (max-width: 560px) { .lib-save { display: none; } } }   /* beside a section on a small screen */
@container libdock (max-width: 560px) {
  .st-foot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-foot > div:nth-child(2), .st-foot > div:nth-child(3) { display: none; }
}
@container gvstage (max-width: 900px) {
  .st-pip { display: none; }
  .st-plot { max-width: 230px; }
  .st-time input[type=range] { width: 96px; }
  /* with a section open beside it the plot's card is one line: the room goes to the design */
  .ws-studio.sheet-open .st-plot .sp-more, .ws-studio.sheet-open .st-plot .sp-fold { display: none; }
  .ws-studio.sheet-open .st-plot .sp-state { margin-bottom: 0; }
}
@container gvstage (max-width: 680px) {
  .st-plot { top: 3rem; }   /* under the views' row */
  .st-zoom [data-act=rotL], .st-zoom [data-act=rotR] { display: none; }
  .st-time select { display: none; }
  .st-views .md-btn { height: 30px; padding: 0 .5rem; font-size: .76rem; }
  .st-side:not(.folded) { width: 196px; }
  .st-erow .md-btn { min-height: 40px; }
  .ss-head { padding: .4rem .6rem; font-size: .76rem; }
}
@container gvstage (max-width: 500px) {
  .st-plot { display: none; }
  .st-side { display: none; }
  .st-time { display: none; }
}

/* the folded panel: icons (from the phone upwards the panel has a column of its own) */
@media (min-width: 821px) {
  .rail-mini .rail-head { flex: none; justify-content: center; padding: .7rem 0 .5rem; cursor: pointer; }
  .rail-mini .rail-head > div { display: none; }
  .rail-mini .rail-head .ring { width: 42px; height: 42px; font-size: .66rem; }
  .rail-mini .rail-lib { justify-content: center; margin: 0 .55rem .35rem; padding: .3rem 0; }
  .rail-mini .rail-libs { margin: 0 .55rem .35rem; }
  .rail-mini .rail-libs .rail-lib { margin: 0; padding: .3rem 0; }
  .rail-mini .rail-lib .lbl, .rail-mini .rail-lib small { display: none; }
  .rail-mini .rail-views { flex-direction: column; margin: 0 .55rem .35rem; padding: 0; background: transparent; border: 0; }
  .rail-mini .rv-btn[data-rail-view=nav] { display: none; }
  .rail-mini .rv-btn { padding: .5rem 0; background: var(--soft); color: var(--primary-2); box-shadow: none; }
  .rail-mini .rv-btn:hover { background: var(--tint); }
  .rail-mini .rv-btn i { font-size: .95rem; }
  .rail-mini .rv-btn > span { display: none; }
  .rail-mini .rv-badge { position: absolute; top: -3px; inset-inline-end: -3px; }
  .rail-mini .rail-nav, .rail-mini .rail-nav[hidden] { display: block; padding: .3rem .55rem; }
  .ws.rail-mini .insight { display: none; }
  .rail-mini .rg { margin-bottom: .2rem; border: 0; background: transparent; overflow: visible; }
  .rail-mini .rg-head { justify-content: center; padding: .25rem 0; border-radius: var(--r-sm); position: relative; }
  .rail-mini .rg-head:hover, .rail-mini .rg-head[aria-expanded=true] { background: var(--soft); }
  .rail-mini .rg.here .rg-head { background: var(--tint); }
  .rail-mini .rg-num, .rail-mini .rg-head .lbl, .rail-mini .rg-head .cnt, .rail-mini .rg-fold, .rail-mini .rg > .rg-subs { display: none; }
  .rail-mini .rg-head.flag-any .ico::after { content: ''; position: absolute; top: 0; inset-inline-end: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
  .rail-mini .rail-keys { display: none; }
  .ws.rail-mini .rail-foot { justify-content: center; padding: .45rem 0; }
}

/* tablets in landscape, small laptops: the panel rests as icons and opens over the stage */
@keyframes railOver { from { width: var(--rail-mini); } }
@media (min-width: 821px) and (max-width: 1279px) {
  .ws, .ws.rail-mini { grid-template-columns: var(--rail-mini) minmax(0, 1fr); }
  .ws:not(.rail-mini) > .rail { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: var(--rail-w); z-index: 47; box-shadow: var(--sh-3); animation: railOver .24s var(--ease); }
  .ws:not(.rail-mini) > .ws-scrim { display: block; position: absolute; inset: 0; z-index: 46; background: rgba(15,42,56,.26); }
}

/* phones: the panel slides in from the bar's menu button */
@media (max-width: 820px) {
  .ws > .rail { z-index: 41; }
  .ws.show-rail > .ws-scrim { display: block; position: fixed; top: var(--top); inset-inline: 0; bottom: 0; z-index: 40; background: rgba(15,42,56,.36); }
  .ws-studio.show-rail ~ .assist { display: none; }
  .rail-keys { display: none; }
  .rail-foot { justify-content: flex-end; }
}
@media (max-width: 760px) {
  .ws-studio ~ .assist.folded .as-fab > span:not(.as-av) { display: none; }
  .ws-studio ~ .assist.folded .as-fab, [dir=rtl] .ws-studio ~ .assist.folded .as-fab { padding: .35rem; }
}
/* the bar's room goes to the client's name: the team moves into the overview */
@media (max-width: 900px) {
  .team-stack { display: none; }
  .ov-team { display: flex; }
  .ws-body .bar-title small, .ws-body #barStatus { display: none; }
}
/* the assistant's button keeps its name, and a white edge keeps it plain on the stage's dark bar; the bar leaves it a place, so the figures under the design stay readable */
.ws-studio ~ .assist.folded .as-fab { box-shadow: 0 0 0 2px #fff, var(--sh-2); }
.ws-studio:has(.lib-dock[data-showing=lib] .lib-detail:not([hidden])) ~ .assist { bottom: 84px; }   /* above the bar with the design's action in its middle */
.ws-studio .st-foot { padding-inline-end: 196px; }
@media (max-width: 760px) { .ws-studio .st-foot { padding-inline-end: 66px; } }
/* a laptop with the wide section panel leaves the stage 300–480px: the assistant rests as its round icon (as on a phone) and
   the bar keeps its figures readable instead of 38px cells ("BNY-0139" on two lines, "Covera…") */
@media (min-width: 761px) and (max-width: 1600px) {
  .ws-studio.sheet-open.sheet-wide .st-foot { padding-inline-end: 66px; }
  .ws-studio.sheet-open.sheet-wide ~ .assist.folded .as-fab > span:not(.as-av) { display: none; }
  .ws-studio.sheet-open.sheet-wide ~ .assist.folded .as-fab, [dir=rtl] .ws-studio.sheet-open.sheet-wide ~ .assist.folded .as-fab { padding: .35rem; }
}
@container libdock (max-width: 360px) { .st-foot > div:first-child { display: none; } .st-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* the narrowest: coverage and height (the code is on the picture's button) */

/* portrait: the sheet rises from below, the design stays above it */
@media (max-width: 1100px) and (orientation: portrait) {
  .ws.ws-studio { --sheet-h: calc((100dvh - var(--top)) * .62); }
  .ws.ws-studio.sheet-wide { --sheet-h: calc((100dvh - var(--top)) * .88); }
  .ws-studio > .stage { flex-direction: column-reverse; }
  .ws-studio .sheet, .ws-studio.sheet-open .sheet { width: auto; }
  .ws-studio .sheet { height: 0; flex: none; border-radius: var(--r-lg) var(--r-lg) 0 0; transition: height .38s var(--ease), visibility 0s .38s; }
  .ws-studio.sheet-open .sheet { height: var(--sheet-h); box-shadow: 0 -10px 34px rgba(8,28,38,.34); transition: height .38s var(--ease), visibility 0s; }
  .ws-studio .sheet-scroll { top: 0; bottom: auto; inset-inline: 0; width: auto; height: var(--sheet-h); transition: height .38s var(--ease); }
  .sheet-size i { transform: rotate(90deg); }
  /* above the sheet only the design itself: its bar and tools come back when the sheet closes */
  .ws-studio.sheet-open > .stage > .lib-dock { grid-template-rows: minmax(0, 1fr); }
  .ws-studio.sheet-open .lib-top, .ws-studio.sheet-open .st-foot, .ws-studio.sheet-open .st-plot, .ws-studio.sheet-open .st-side,
  .ws-studio.sheet-open .st-views, .ws-studio.sheet-open .st-bottom, .ws-studio.sheet-open .st-pip, .ws-studio.sheet-open .lib-tools { display: none; }
}

/* ---------- the client file number (رقم ملف العميل): the card in the client details and the picker (workspace.js) ---------- */
.cf-empty { width: 100%; display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border: 1.5px dashed var(--primary-2); border-radius: var(--r); background: var(--tint); color: var(--primary); cursor: pointer; text-align: start; font: inherit; transition: background .15s, border-color .15s; }
.cf-empty:hover { background: #dcecf3; border-style: solid; }
.cf-empty > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.cf-empty small { color: var(--ink-2); font-size: .8rem; }
.cf-empty .cf-go { opacity: .6; }
html[dir="ltr"] .cf-empty .cf-go { transform: scaleX(-1); }
.cf-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--primary); box-shadow: var(--sh-1); }
.cf-card { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.cf-card.ok { border-color: #bfe6d5; background: var(--ok-bg); }
.cf-card.bad { border-color: #f4c4c4; background: var(--bad-bg); }
.cf-card.warn { border-color: #f1d9ad; background: var(--warn-bg); }
.cf-no { flex: none; min-width: 64px; display: flex; flex-direction: column; align-items: center; padding: .35rem .6rem; border-radius: var(--r-sm); background: var(--primary); color: #fff; line-height: 1.15; }
.cf-no small { font-size: .68rem; opacity: .8; }
.cf-no b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.cf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.cf-main small { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .8rem; }
.cf-main small i { opacity: .55; }
.cf-main em { font-style: normal; font-size: .8rem; font-weight: 600; }
.cf-card.ok .cf-main em { color: var(--ok); }
.cf-card.bad .cf-main em, .cf-row .cf-main em { color: var(--bad); }
.cf-card.warn .cf-main em { color: #8a5a12; }
.cf-acts { flex: none; display: flex; align-items: center; gap: .25rem; }
.cf-acts .btn { padding: .4rem .75rem; font-size: .82rem; }
.cf-acts button:disabled { display: none; }
.dlg.cf-dlg { max-width: 560px; display: flex; flex-direction: column; }
.cf-dlg .cf-list { flex: 0 1 auto; min-height: 5rem; }   /* the list gives up its height first: one scrollbar (the list's), not a second on the dialog */
.cf-head { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.cf-head .cf-ic { width: 48px; height: 48px; font-size: 1.2rem; background: var(--tint); box-shadow: none; }
.cf-head h3 { margin: 0; }
.cf-head p { margin: .1rem 0 0; color: var(--muted); font-size: .85rem; }
.cf-seg { display: flex; width: 100%; }
.cf-seg button { flex: 1; }
.cf-search { position: relative; display: flex; align-items: center; margin-top: .7rem; }
.cf-search > i { position: absolute; inset-inline-start: .9rem; color: var(--muted); pointer-events: none; }
.cf-search input { width: 100%; font: inherit; font-size: 1.05rem; padding: .75rem 2.6rem; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--soft); outline: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.cf-search input:focus { border-color: var(--primary-2); background: #fff; box-shadow: 0 0 0 4px rgba(35,132,159,.12); }
.cf-search input::-webkit-search-cancel-button { display: none; }
.cf-search input[dir="ltr"] { text-align: start; }
.cf-x { position: absolute; inset-inline-end: .5rem; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.cf-x:hover { background: var(--line-2); color: var(--ink); }
.cf-from { display: block; min-height: 1.2rem; margin: .35rem .2rem 0; color: var(--primary-2); font-size: .78rem; }
.cf-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; max-height: min(46vh, 380px); overflow-y: auto; padding: 2px; }
.cf-msg { margin: 0; padding: 1.6rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; }
.cf-msg i { display: block; font-size: 1.5rem; margin-bottom: .5rem; opacity: .6; }
.cf-row { position: relative; display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font: inherit; color: inherit; text-align: start; cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.cf-row:hover, .cf-row.act { border-color: var(--primary-2); background: var(--tint); box-shadow: var(--sh-1); }
.cf-row.off { background: var(--soft); cursor: not-allowed; }
.cf-row.off .cf-av, .cf-row.off .cf-no { filter: grayscale(1); opacity: .55; }
.cf-row.mine { border-color: var(--ok); }
.cf-row.mine .cf-no { background: var(--ok); }
.cf-row.loading { pointer-events: none; opacity: .6; }
.cf-av { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--tint); color: var(--primary); font-weight: 800; }
.cf-row mark { background: #fff1a8; color: inherit; border-radius: 3px; padding: 0 1px; }
.cf-more { margin: .3rem 0 0; text-align: center; color: var(--muted); font-size: .8rem; }
.cf-link { border: 0; background: none; padding: 0; margin-top: .3rem; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
/* the card follows its own width, not the window's: a column of the brief's two, a narrow sheet, a phone.
   Narrow: the actions drop to a row of their own under a hairline, so the name and the status keep the width. */
.cf-box { container: cf / inline-size; }
@container cf (max-width: 460px) {
  .cf-card { flex-wrap: wrap; gap: .55rem .65rem; padding: .65rem .7rem; }
  .cf-card .cf-no { min-width: 54px; padding: .3rem .5rem; }
  .cf-acts { flex-basis: 100%; justify-content: flex-end; padding-top: .5rem; border-top: 1px solid rgba(15, 42, 56, .09); }
}
@container cf (max-width: 250px) {   /* the number becomes a strip on top */
  .cf-card .cf-no { flex-direction: row; align-items: baseline; gap: .4rem; }
  .cf-card .cf-main { flex-basis: 100%; }
}
@media (max-width: 560px) { .cf-seg button { padding-inline: .4rem; font-size: .8rem; } }
/* ---------- requested meetings (موعد الاجتماع التالي) against the office calendar: the top bar's bell and /meetings ---------- */
.hero-acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.mt-bell-wrap { position: relative; }
.mt-bell { position: relative; }
.mt-bell.has { color: var(--accent); }
.mt-bell.late i { animation: mt-ring 2.4s ease-in-out 1s 2; }
@keyframes mt-ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } 50% { transform: rotate(0); } }
.mt-count { position: absolute; top: 2px; inset-inline-end: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .64rem; font-weight: 800; display: grid; place-items: center; line-height: 1; border: 2px solid #fff; }
.mt-count[hidden] { display: none; }
.mt-pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: min(360px, calc(100vw - 24px)); background: var(--card); border-radius: var(--r); box-shadow: var(--sh-2, 0 12px 32px rgba(20,43,56,.18)); border: 1px solid var(--line); z-index: 80; overflow: hidden; }
.mt-pop[hidden] { display: none; }
.mt-pop-head { display: flex; align-items: center; gap: .5rem; padding: .75rem .9rem; border-bottom: 1px solid var(--line); font-size: .88rem; }
.mt-pop-head i { color: var(--accent); }
.mt-pop-head b { flex: 1; }
.mt-pop-head span { background: var(--tint-accent); color: var(--accent); border-radius: 999px; padding: .05rem .55rem; font-weight: 800; font-size: .78rem; }
.mt-pop ul { list-style: none; margin: 0; padding: .3rem 0; max-height: 330px; overflow: auto; }
.mt-pop li a { display: grid; grid-template-columns: 1fr auto; gap: 0 .6rem; padding: .5rem .9rem; color: var(--ink); text-decoration: none; }
.mt-pop li a:hover { background: var(--soft); }
.mt-pop li b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-pop li small { grid-column: 1; color: var(--muted); font-size: .74rem; }
.mt-pop li em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: .7rem; font-weight: 700; color: var(--bad); background: var(--bad-bg); border-radius: 999px; padding: .1rem .5rem; }
.mt-pop-empty, .mt-pop-more { padding: .8rem .9rem; margin: 0; font-size: .84rem; }
.mt-pop-empty i { color: var(--ok); }
.mt-pop-all { display: flex; align-items: center; gap: .45rem; justify-content: center; padding: .65rem; border-top: 1px solid var(--line); font-weight: 700; font-size: .84rem; color: var(--primary); text-decoration: none; }
.mt-pop-all:hover { background: var(--tint); }

.mt-stat.warn i { background: var(--tint-accent); color: var(--accent); }
.mt-stat.bad i { background: var(--bad-bg); color: var(--bad); }
.mt-stat.ok i { background: var(--ok-bg); color: var(--ok); }
.mt-wrap { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow-x: auto; }
.mt-table { width: 100%; border-collapse: collapse; min-width: 860px; font-size: .88rem; }
.mt-table th { text-align: start; font-size: .76rem; color: var(--muted); font-weight: 700; padding: .75rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mt-table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.mt-table tr:last-child td { border-bottom: 0; }
.mt-table td > b, .mt-table td > a > b { display: block; }
.mt-table td small { display: block; color: var(--muted); font-size: .76rem; margin-top: .15rem; }
.mt-table td a { color: var(--primary); text-decoration: none; }
.mt-table td a:hover b { text-decoration: underline; }
.mt-table td small .pill { font-size: .68rem; padding: .05rem .45rem; margin-inline-start: .3rem; }
.mt-row.overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
[dir=rtl] .mt-row.overdue td:first-child { box-shadow: inset -3px 0 0 var(--bad); }
.mt-state { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .8rem; border-radius: 999px; padding: .2rem .65rem; white-space: nowrap; }
.mt-state.ok { background: var(--ok-bg); color: var(--ok); }
.mt-state.warn { background: var(--tint-accent); color: #b5461a; }
.mt-state.muted { background: #eef2f5; color: var(--ink-2); }
.mt-table small.mt-late { color: var(--bad); font-weight: 700; }
.mt-table small.mt-on { color: var(--ok); font-weight: 700; }
.mt-clock { font-weight: 700; color: var(--ink-2) !important; }
.mt-team span { display: flex; align-items: center; gap: .4rem; font-size: .8rem; margin-bottom: .25rem; white-space: nowrap; }
.mt-team .avatar { width: 24px; height: 24px; font-size: .62rem; }

/* /settings → Revit execution: paths and text read left-to-right, the outputs as ticks, the skills across the card */
#cardRevit .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#cardRevit .set-field input, #cardRevit .set-field textarea { text-align: start; font-weight: 600; font-size: .9rem; font-family: ui-monospace, Consolas, monospace; }
#cardRevit .set-field > span small { color: var(--muted); font-weight: 600; margin-inline-start: .3rem; }
.rv-wide { grid-column: 1 / -1; }
.rv-outs { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: .5rem 0; }
.rv-outs label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .86rem; cursor: pointer; }
.set-badge.warn { background: var(--warn-bg); color: #8a5a12; }
@media (max-width: 760px) { #cardRevit .set-grid { grid-template-columns: 1fr; } }

/* /settings → meeting dates: days or working days as two segments as tall as the number beside them; the days off as toggles */
.set-grid.mt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt-wide { grid-column: 1 / -1; }
.mt-seg { display: flex; padding: 3px; gap: 3px; background: var(--soft); border-width: 1.5px; border-radius: var(--r-sm); }
.mt-seg button { flex: 1; min-height: 41px; font-size: .92rem; }
.mt-days { display: flex; flex-wrap: wrap; gap: .45rem; }
.mt-days button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 92px; padding: .5rem .8rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); color: var(--ink-2); font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.mt-days button i { font-size: .78rem; opacity: 0; width: 0; transition: opacity .15s; }
.mt-days button:hover { border-color: #b9ccd8; }
.mt-days button[aria-pressed=true] { background: var(--tint-accent); border-color: var(--accent); color: #b23d0c; }
.mt-days button[aria-pressed=true] i { opacity: 1; width: auto; }
/* the public holidays: a row each — name, from, to, remove — with its note (length, problem, or over) underneath */
.mt-hols { display: flex; flex-direction: column; gap: .55rem; }
.mt-hols:empty { display: none; }
.mt-hol { display: grid; grid-template-columns: minmax(0, 1fr) 168px 168px 40px; gap: .3rem .6rem; align-items: end; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--soft); }
.mt-hol label { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.mt-hol label > span { font-size: .76rem; font-weight: 700; color: var(--ink-2); }
.set-field .mt-hol input { text-align: start; font-size: .92rem; font-weight: 600; padding: .55rem .7rem; }
.mt-hol-del { height: 40px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.mt-hol-del:hover { color: var(--bad); border-color: var(--bad); }
.set-field .mt-hol small { grid-column: 1 / -1; }
.mt-hol.over { opacity: .6; }
.mt-hol-foot { display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; }
.mt-hol-foot small { flex: 1 1 260px; }
@media (max-width: 760px) {
  .set-grid.mt-grid { grid-template-columns: 1fr; } .mt-days button { min-width: 0; flex: 1 1 calc(25% - .45rem); }
  .mt-hol { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; gap: .3rem .45rem; padding: .6rem; } .mt-hol-name { grid-column: 1 / -1; }
  .set-field .mt-hol input[type=date] { padding-inline: .4rem; font-size: .85rem; }   /* the whole year stays visible beside the calendar icon */
}
/* phone: a card's badge goes under its title (beside it, a long badge squeezed the title into a narrow column) */
@media (max-width: 560px) {
  .set-head { flex-wrap: wrap; row-gap: .45rem; }
  .set-head .set-title { flex: 1 1 calc(100% - 40px - 2.8rem); min-width: 0; }   /* the row less the icon, the chevron and the gaps: the badge has to wrap */
  .set-head .set-badge { order: 5; margin-inline-start: calc(40px + .8rem); }
  .set-head .set-badge:empty { display: none; }
}

/* =====================================================================
   Screen sizes, across the app: what a laptop, a tablet or a phone used to squeeze
   ===================================================================== */
/* the side panel's sections: a thin scrollbar and a little less padding, so a title keeps its line (the panel is 288px up to 1920px) */
.rail-nav, .ws-studio .sheet-scroll { scrollbar-width: thin; }
.rail-nav { padding-inline: .5rem; }
.rg-head { gap: .42rem; padding-inline: .5rem; }
.rg-head .ico { width: 30px; }
.rg-fold { width: 28px; margin-inline-end: .15rem; }
.rg-head .lbl { font-size: .88rem; }
.rg-head .lbl, .rg-sub .lbl { text-wrap: balance; }

/* the workspace bar on tablets and small laptops: the client's name first. As on a phone, only the bell and the search stay
   at the end (the list, the template, the language and signing out are in the search palette); under 900px the logo goes too,
   the back arrow leads home */
@media (min-width: 761px) and (max-width: 1180px) {
  .ws-body .topbar-end > :not([data-act=palette]):not(.mt-bell-wrap) { display: none; }
  .ws-body .topbar { gap: .6rem; }
}
@media (min-width: 761px) and (max-width: 900px) { .ws-body .topbar .brand { display: none; } }
/* the template on a phone: its tools fill the bar, and the banner under it already says what the page is */
@media (max-width: 560px) { body:has(#ws[data-mode=template]) .bar-title > div { display: none; } }

/* the template's section heading (no sheet there): on a narrow stage the note and the counter go under the title */
.ws:not(.ws-studio) > .stage { container: stage / inline-size; }
.sec-head > div { flex: 1; min-width: 0; }
@container stage (max-width: 600px) {
  .sec-head { flex-wrap: wrap; gap: .5rem .8rem; margin-bottom: 1.1rem; }
  .sec-head .big-ico { width: 46px; height: 46px; border-radius: var(--r); font-size: 1.15rem; }
  .sec-head h2 { font-size: 1.25rem; }
  .sec-head > div { flex-basis: calc(100% - 46px - .8rem); }
}

/* /regulations: the zones table becomes a stack of rows on a phone (code and Arabic name, the English name under it) */
.rg-zones input { width: 100%; min-width: 0; }
@media (max-width: 600px) {
  .rg-zones, .rg-zones tbody { display: block; }
  .rg-zones thead { display: none; }
  .rg-zones tr { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: .35rem; padding: .45rem 0; border-bottom: 1px solid var(--line-2); }
  .rg-zones td { padding: 0; }
  .rg-zones td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .rg-zones td:nth-child(4) { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
}

/* the brief's regulations table: the rule's name keeps a readable width beside a long limit; the figure and the state stay on one line */
.brief-doc tr[class^="rg-"] td:first-child { min-width: 9.5rem; }
.brief-doc tr[class^="rg-"] td:nth-child(3), .brief-doc tr[class^="rg-"] td:nth-child(4) { white-space: nowrap; }
/* the brief's model facts: the labels take what they need (a 38% column of 260px broke them in two) */
.model-print dl { grid-template-columns: auto minmax(0, 1fr); }
/* the printable brief read on a phone (printing keeps the A4 layout) */
@media screen and (max-width: 600px) {
  .brief-doc .model-print { grid-template-columns: minmax(0, 1fr); }   /* the model above its facts, not 36px beside them */
  .brief-doc .model-print .gv-stage { height: 280px; }
  .print-bar { flex-wrap: wrap; margin-top: .8rem; padding: 0 .75rem; }
  .print-bar .pb-opts, .print-bar .pb-acts { flex-basis: 100%; }
  .print-bar .chip-btn { flex-basis: 100%; justify-content: center; padding-block: .55rem; }
  .print-bar .pb-views { flex-basis: 100%; }
  .print-bar .pb-views button { flex: 1 1 30%; padding-inline: .4rem; }
  .print-bar .btn { flex: 1; }
  .brief-doc { margin: .8rem .6rem 3rem; padding: 1.2rem 1rem; }
  .brief-doc header { flex-direction: column-reverse; gap: .7rem; }
  .brief-doc header img { height: 30px; }
  .brief-doc .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brief-doc dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .brief-doc dt { margin-top: .55rem; font-size: .8rem; }
  .brief-doc table { display: block; overflow-x: auto; }
  /* the regulations: each rule a short card — its name and state, then the limit and the brief's figure, named */
  .brief-doc table.rg-tbl, .brief-doc .rg-tbl tbody { display: block; }
  .brief-doc .rg-tbl thead { display: none; }
  .brief-doc .rg-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .8rem; padding: .5rem 0; border-bottom: 1px solid var(--line-2); }
  .brief-doc .rg-tbl td { padding: 0; border: 0; min-width: 0; white-space: normal; }
  .brief-doc .rg-tbl tr td:first-child { min-width: 0; font-weight: 700; }
  .brief-doc .rg-tbl td:nth-child(4) { grid-column: 2; grid-row: 1; white-space: nowrap; font-size: .78rem; }
  .brief-doc .rg-tbl td[data-l] { grid-column: 1 / -1; font-size: .84rem; }
  .brief-doc .rg-tbl td[data-l]::before { content: attr(data-l) ': '; color: var(--muted); font-weight: 600; }
  .sign div { width: min(220px, 70%); }
}

/* the plot's legend: smaller on a narrow stage; in portrait with a section open (the design is a strip above it) it goes with the stage's other overlays */
@container gvstage (max-width: 560px) { .st-map .land-legend { max-width: calc(100% - 5rem); gap: .15rem .6rem; padding: .3rem .55rem; font-size: .68rem; } }
@media (max-width: 1100px) and (orientation: portrait) { .ws-studio.sheet-open .land-legend { display: none; } }

/* dialogs on a phone: the whole height (the 10vh gap above pushed the buttons under the edge), less padding;
   the client-file picker drops its decorative icons so a row's name and message keep the width */
@media (max-width: 560px) {
  .overlay { padding: .75rem .6rem .6rem; }
  .dlg { padding: 1.1rem 1rem; max-height: calc(100dvh - 1.5rem); }
  .cf-head .cf-ic, .cf-row .cf-av { display: none; }
  .cf-row .cf-no { min-width: 54px; padding: .3rem .5rem; }
}

/* touch screens: switches and small links get a finger-sized target */
@media (pointer: coarse) {
  .cm-sw, .set-switch, .libm-back, .peek-sw { min-height: 40px; }
  .cm-name { min-height: 36px; }
}

/* stat tiles (/requests, /meetings, /library, /regulations): a caption that has to wrap breaks evenly;
   where a tile is narrow (phones, the four tiles of /requests and /meetings on a tablet, and the six tiles in a row of
   /library and /regulations on a large screen, from 1180px: below that they go three to a row) the icon sits beside the number and the caption takes the tile's whole
   width under them, instead of the narrow column beside the icon */
.stat small, .libm-stat span { text-wrap: balance; }
@media (max-width: 560px), (min-width: 761px) and (max-width: 940px) {
  .stat { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: start; column-gap: .55rem; row-gap: .35rem; text-align: start; }
  .stat > span { display: contents; }
  .stat i { width: 30px; height: 30px; font-size: .82rem; }
  .stat small { grid-column: 1 / -1; font-size: .8rem; line-height: 1.35; }
}
@media (max-width: 560px), (min-width: 1180px) {
  .libm-stat { align-content: start; column-gap: .6rem; row-gap: .35rem; }
  .libm-stat i { grid-row: auto; width: 32px; height: 32px; font-size: .88rem; }
  .libm-stat span { grid-column: 1 / -1; line-height: 1.35; }
}
@media (max-width: 560px) {
  .page { padding-inline: 1rem; }   /* a phone's usual margin: two tiles side by side need those 8px */
  .stats, .libm-stats { gap: .5rem; }
  .stat, .libm-stat { padding: .6rem; }
  .libm-stat { column-gap: .55rem; }
  .libm-stat i { width: 30px; height: 30px; font-size: .82rem; }
  .stat b, .libm-stat b { font-size: 1.15rem; }
  .stat small, .libm-stat span { font-size: .75rem; }
}
/* under 360px two tiles side by side leave a caption ~118px (the longest needs 135): one compact row per tile, icon · number · caption */
@media (max-width: 359px) {
  .stats, .libm-stats { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
  .stat, .libm-stat { grid-template-columns: auto auto minmax(0, 1fr); padding: .4rem .6rem; column-gap: .6rem; }
  .stat i, .libm-stat i { width: 28px; height: 28px; }
  .stat b, .libm-stat b { min-width: 2.4rem; font-size: 1.05rem; }
  .stat small, .libm-stat span { grid-column: auto; font-size: .8rem; }
}

/* ---------- a floor's spaces (question type "spaces", workspace.js): units from the catalogue of space types (/spaces), each with
   a count, its own area and what one of it holds, three deep at most. The control lays itself out by its own width (container fs). ---------- */
.fs { container: fs / inline-size; display: flex; flex-direction: column; gap: .6rem; --fs-cols: 26px 26px 34px minmax(0, 1fr) 106px 200px 74px 30px 30px; }
.fs-note { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: var(--r-sm); background: var(--warn-bg); color: #8a5a10; font-size: .85rem; font-weight: 600; line-height: 1.55; }
.fs-note > i { flex: none; }
.fs-note > span { flex: 1; min-width: 0; }
.fs-note .btn { flex: none; padding: .35rem .85rem; font-size: .82rem; }
.fs-derived .fs-row { border-style: dashed; }
.fs-head { display: grid; grid-template-columns: var(--fs-cols); gap: .5rem; padding: 0 .6rem; font-size: .72rem; font-weight: 700; color: var(--muted); }
.fs-head span:first-child { text-align: center; cursor: help; white-space: nowrap; font-size: .66rem; justify-self: center; }
.fs-head span:nth-child(2) { grid-column: 2 / 5; }
.fs-head span:nth-child(n+4) { text-align: end; }
.fs-list { display: flex; flex-direction: column; gap: .4rem; }
/* units of one type side by side: two or more under one heading — the type, how many units its rows make, their total area */
.fs-grp { display: flex; flex-direction: column; gap: .35rem; padding: .4rem .45rem .45rem; border: 1px solid var(--line); border-inline-start: 3px solid var(--sel-line); border-radius: var(--r-sm); background: var(--soft); }
.fs-grp-h { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .55rem; padding: .1rem .3rem .05rem; font-size: .84rem; color: var(--ink-2); min-width: 0; }
.fs-grp-ico { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--tint); color: var(--primary); font-size: .72rem; }
.fs-grp-h > b { font-weight: 800; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-grp-n { flex: none; padding: .05rem .55rem; border-radius: 999px; background: var(--sel-bg); border: 1px solid var(--sel-line); color: var(--sel-ink); font-size: .74rem; font-weight: 800; line-height: 1.5; }
.fs-grp-a { margin-inline-start: auto; flex: none; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.fs-grp-a b { font-size: .86rem; font-weight: 800; color: var(--ink-2); }
.fs-row { display: grid; grid-template-columns: var(--fs-cols); gap: .5rem; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .4rem .55rem; transition: border-color .15s; }
.fs-row:hover { border-color: #c7d6df; }
.fs-u.open > .fs-row { border-color: #b9ccd8; border-end-start-radius: 0; border-end-end-radius: 0; }
.fs-tog { width: 26px; height: 26px; border: 0; border-radius: var(--r-xs); background: var(--tint); color: var(--primary); cursor: pointer; display: grid; place-items: center; position: relative; font-size: .7rem; padding: 0; }
.fs-tog i { transition: transform .15s; }
.fs-u:not(.open) > .fs-row .fs-tog i { transform: rotate(-90deg); }
[dir=rtl] .fs-u:not(.open) > .fs-row .fs-tog i { transform: rotate(90deg); }
.fs-tog b { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 15px; height: 15px; border-radius: 999px; background: var(--primary); color: #fff; font-size: .6rem; display: grid; place-items: center; padding: 0 3px; }
.fs-tog:hover { background: var(--primary); color: #fff; }
.fs-tog.fs-tog-x { background: transparent; cursor: default; }
.fs-ico { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--tint); color: var(--primary); display: grid; place-items: center; }
.fs-open .fs-ico { background: var(--ok-bg); color: var(--ok); }
.fs-nm { min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.fs-nm b { font-weight: 800; color: var(--ink); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-nm small { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .4rem; font-size: .72rem; color: var(--muted); min-width: 0; }
.fs-nm small span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fs-nm code { font-size: .66rem; font-weight: 800; padding: .02rem .32rem; border-radius: 4px; background: var(--soft); color: var(--primary-2); border: 1px solid var(--line); direction: ltr; }
.fs-nm em { font-style: normal; color: var(--ok); font-weight: 700; }
.fs-lbl { border: 0; padding: .25rem .4rem; font-weight: 800; background: var(--soft); border-radius: var(--r-xs); box-shadow: none; }
.fs .stepper { border-radius: var(--r-sm); justify-self: end; }
.fs .stepper button { width: 30px; height: 32px; font-size: .78rem; }
.fs .stepper input { width: 38px; font-size: .92rem; height: 32px; }
.fs-a { display: flex; align-items: center; justify-content: flex-end; gap: .25rem; min-width: 0; }   /* width × length (m) = one unit's area */
.fs-a input { width: 54px; flex: none; height: 34px; padding: .3rem .25rem; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.fs-a input::-webkit-inner-spin-button, .fs-a input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.fs-a input::placeholder { font-weight: 600; color: #a3b3bd; }
.fs-x { font-style: normal; font-size: .78rem; color: var(--muted); }
.fs-am { flex: 1 1 auto; min-width: 0; text-align: end; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.fs-am::before { content: '='; margin-inline-end: .25rem; }
.fs-am b { font-size: .86rem; font-weight: 800; color: var(--ink-2); }
.fs-a.warn input { border-color: var(--warn); background: var(--warn-bg); }
.fs-a.warn .fs-am b { color: #8a5a10; }
.fs-a.fs-legacy .fs-am b { text-decoration: underline dotted var(--warn); text-underline-offset: 3px; }
/* the size is mandatory (ticked: the prompt binds it) or indicative (the default) */
/* the size is mandatory or indicative: a padlock at the row's start, open and faint (indicative, the default) or closed and filled */
.fs-fix { position: relative; justify-self: center; flex: none; display: grid; place-items: center; width: 26px; height: 26px; cursor: pointer; }
.fs-fix input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.fs-fix b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; border: 1.5px solid #cfdbe2; background: #fff; color: #a9bbc6; font-size: .64rem; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; }
.fs-fix:hover b { border-color: var(--primary-2); color: var(--primary-2); background: var(--tint); }
.fs-fix input:checked + b { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(25,89,122,.28); }
.fs-fix:hover input:checked + b { background: var(--primary-2); border-color: var(--primary-2); }
.fs-fix input:active + b { transform: scale(.92); }
.fs-fix input:focus-visible + b { box-shadow: 0 0 0 3px rgba(35,132,159,.3); }
.fs-fix:has(input:disabled), .fs-fix input:disabled { cursor: default; }
.fs-fix:has(input:disabled):hover b { border-color: var(--primary); background: var(--primary); color: #fff; }
.fs-fix:has(input:disabled:not(:checked)) { visibility: hidden; }
.fs-nm em.fs-fix-tag { display: inline-flex; align-items: center; gap: .2rem; color: var(--primary); background: var(--tint); border-radius: 999px; padding: 0 .4rem; font-size: .64rem; font-weight: 800; line-height: 1.5; }
.fs-nm em.fs-fix-tag i { font-size: .56rem; }
.fs-fixed > .fs-row { border-color: #a9c8d6; }
.fs-fixed > .fs-row .fs-a input { border-color: #9fc3d3; background: var(--tint); color: var(--primary); }
.fs-t { text-align: end; font-weight: 800; color: var(--ink-2); font-size: .92rem; white-space: nowrap; }
.fs-t small { font-weight: 600; color: var(--muted); font-size: .7rem; margin-inline-start: .2rem; }
.fs-del { width: 30px; height: 30px; color: var(--muted); }
.fs-del:hover { color: var(--bad); background: var(--bad-bg); }
.fs-inner { position: relative; display: flex; flex-direction: column; gap: .35rem; border: 1.5px solid #b9ccd8; border-top: 0; border-radius: 0 0 var(--r-sm) var(--r-sm); padding: .45rem .55rem .55rem; padding-inline-start: 1.6rem; background: var(--soft); }
.fs-inner::before { content: ''; position: absolute; inset-inline-start: .85rem; top: .3rem; bottom: 1rem; border-inline-start: 2px dotted #b9ccd8; }
.fs-in > .fs-row { border-color: var(--line-2); }
.fs-in .fs-ico { width: 28px; height: 28px; font-size: .8rem; justify-self: center; }
.fs-in .fs-nm b { font-size: .86rem; }
.fs-subadd { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; padding-top: .15rem; }
.fs-subadd > span { font-size: .74rem; font-weight: 700; color: var(--muted); margin-inline-end: .15rem; }
.chip.fs-ghost { padding: .26rem .6rem; font-size: .78rem; border-style: dashed; background: transparent; }
.chip.fs-ghost i { font-size: .74rem; }
.chip.fs-ghost:hover { border-style: solid; background: #fff; }
/* the list's one way to add (workspace.js spAddBar): a dashed bar under the units; while the list is empty it carries its empty text */
.fs-addbar { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .5rem .7rem; border: 1.5px dashed #b9ccd8; border-radius: var(--r-sm); background: #fff; color: var(--primary); font: inherit; text-align: start; cursor: pointer; transition: background .15s, border-color .15s; }
.fs-addbar:hover, .fs-addbar[aria-expanded=true] { background: var(--tint); border-color: var(--primary-2); border-style: solid; }
.fs-addbar:focus-visible { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(35,132,159,.3); }
.fs-addbar-i { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--tint); color: var(--primary); font-size: .78rem; transition: background .15s, color .15s; }
.fs-addbar:hover .fs-addbar-i, .fs-addbar[aria-expanded=true] .fs-addbar-i { background: var(--primary-2); color: #fff; }
.fs-addbar-t { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.fs-addbar-t b { font-weight: 800; font-size: .9rem; }
.fs-addbar-t small { color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.55; }
.fs-addbar.is-empty { padding: .75rem .85rem; background: var(--soft); }
.fs-addbar.is-empty .fs-addbar-i { width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: .9rem; }
.fs-addbar.is-empty:hover .fs-addbar-i, .fs-addbar.is-empty[aria-expanded=true] .fs-addbar-i { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.fs-addbar:disabled { cursor: default; opacity: .6; }
.chip.fs-more { border-style: dashed; color: var(--primary); }
.fs-sum { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .82rem; color: var(--ink-2); padding: 0 .2rem; }
.fs-sum b { font-weight: 800; color: var(--ink); }
.fs-sum-g { color: var(--muted); }
.fs-empty { margin: 0; color: var(--muted); font-size: .86rem; display: flex; gap: .45rem; align-items: center; }
.fs-flash > .fs-row { animation: fsFlash 1.2s var(--ease); }
.fs-writing > .fs-row { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(35,132,159,.12); }
.fs-row > .sn-strip { grid-column: 4 / -1; }
.fs-row > .sn-ed { grid-column: 1 / -1; }
@keyframes fsFlash { 0% { box-shadow: 0 0 0 4px rgba(35,132,159,.35); } 100% { box-shadow: 0 0 0 0 rgba(35,132,159,0); } }
/* a block's storey (brief.json "level", workspace.js spLevel): «المجلس الخارجي › الميزانين» and, above the ground level, its
   built area against what it may take (a bar: teal while within, red over). The upper level's card carries a teal edge, so the
   two lists of one block read as a pair. */
.fs-lvl { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .9rem; }
.fs-lvl-tag { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .75rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--ink-2); line-height: 1.4; }
.fs-lvl-tag > i:first-child { color: var(--primary-2); }
.fs-lvl-tag b { color: var(--sel-ink); font-weight: 800; }
.fs-lvl-sep { font-size: .58rem; color: var(--muted); }
.fs-lvl.up .fs-lvl-tag { background: var(--sel-bg); border-color: var(--sel-line); box-shadow: var(--sel-sh); }
.fs-lvl-cap { display: inline-flex; align-items: center; gap: .55rem; flex: 1 1 260px; min-width: 0; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.fs-lvl-cap b { color: var(--ink); font-weight: 800; }
.fs-lvl-cap em { font-style: normal; font-weight: 700; }
.fs-lvl-bar { flex: none; width: 96px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.fs-lvl-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary-2); transition: width .3s var(--ease); }
.fs-lvl-cap.ok .fs-lvl-bar i { background: var(--ok); }
.fs-lvl-cap.over { color: var(--bad); }
.fs-lvl-cap.over .fs-lvl-bar i { background: var(--bad); }
.q:has(.fs-lvl.up) { border-inline-start: 3px solid var(--sel-line); }
.q-opened { animation: secIn .32s var(--ease), fsFlash 1.4s var(--ease) .15s; }
@container fs (max-width: 740px) {
  .fs-head { display: none; }
  .fs-row { display: flex; flex-wrap: wrap; row-gap: .45rem; }
  .fs-row > .fs-nm { flex: 1 1 calc(100% - 26px - 26px - 34px - 60px - 2.5rem); }
  .fs-row > .sn-btn, .fs-row > .fs-del { order: 4; }
  .fs-row > .sn-strip { order: 9; flex: 1 1 100%; margin-inline-start: calc(26px + 26px + 34px + 1.5rem); width: auto; }
  .fs-row > .sn-ed { order: 10; flex: 1 1 100%; }
  .fs-row > .fs-n { order: 5; margin-inline-start: calc(26px + 26px + 34px + 1.5rem); }
  .fs-row > .fs-a { order: 6; flex: 0 1 auto; justify-content: flex-start; }
  .fs-row > .fs-t { order: 7; flex: 1 1 auto; }
  .fs-in > .fs-row > .fs-n { margin-inline-start: 0; }
}
@container fs (max-width: 420px) {
  .fs-row > .fs-n { margin-inline-start: 0; }
  .fs-a input { width: 48px; }
  .fs-inner { padding-inline-start: 1.1rem; }
  .fs-inner::before { inset-inline-start: .55rem; }
  .fs-note { flex-wrap: wrap; }
  .fs-row > .sn-strip { margin-inline-start: 0; }
}
/* the picker over every type: the ones suited here first (the floor's, or what the unit usually holds), the others a click away
   (or found by the search) with the floors they usually stand on; both by category */
.ws-pop.fs-pop { width: min(420px, calc(100vw - 16px)); padding: 0; max-height: min(70vh, 560px); display: flex; flex-direction: column; overflow: hidden; }
.fs-pop-head { padding: .7rem .8rem .6rem; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .5rem; }
.fs-pop-head > b { font-size: .9rem; color: var(--ink); }
.fs-pop-head .search { min-width: 0; flex: none; }
.fs-pick { overflow-y: auto; padding: .3rem .5rem .6rem; min-height: 0; }
.fs-pg h5 { margin: .55rem .3rem .2rem; font-size: .72rem; color: var(--muted); display: flex; gap: .35rem; align-items: center; }
.fs-opt { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: .5rem; align-items: center; border: 0; background: transparent; padding: .42rem .45rem; border-radius: var(--r-xs); cursor: pointer; text-align: start; color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.fs-opt:hover, .fs-opt:focus-visible { background: var(--tint); color: var(--primary); outline: none; }
.fs-opt > i { color: var(--primary-2); text-align: center; }
.fs-opt code { font-size: .68rem; color: var(--muted); direction: ltr; }
.fs-opt small { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.fs-opt[hidden], .fs-pg[hidden], .fs-none[hidden], .fs-tier[hidden], .fs-more-tog[hidden] { display: none; }
.fs-opt-nm { min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.fs-opt-nm > span { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.fs-opt-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-opt .fs-opt-nm small { white-space: normal; font-weight: 600; font-size: .68rem; line-height: 1.45; }
.fs-opt-n { flex: none; font-size: .66rem; font-weight: 800; color: var(--primary); background: var(--tint); border: 1px solid var(--sel-line, #b9d7e2); border-radius: 999px; padding: 0 .38rem; line-height: 1.55; }
.fs-opt-o > i { color: #8ea5b2; }
.fs-tier-h { margin: .5rem .3rem .1rem; display: flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 800; color: var(--primary); }
.fs-tier-h > i { font-size: .74rem; color: var(--primary-2); }
.fs-tier-h span { margin-inline-start: auto; font-size: .7rem; font-weight: 700; color: var(--muted); }
.fs-tier-o .fs-tier-h, .fs-tier-o .fs-tier-h > i { color: var(--ink-2); }
.fs-more-tog:not([hidden]) + .fs-tier > .fs-tier-h { display: none; }   /* the open toggle is the other types' heading (searching hides it: the heading shows) */
.fs-more-tog { display: flex; align-items: center; gap: .5rem; width: 100%; margin: .55rem 0 .15rem; padding: .55rem .65rem; border: 1px dashed #c7d6df; border-radius: var(--r-xs); background: var(--soft); color: var(--ink-2); font: inherit; font-size: .84rem; font-weight: 700; text-align: start; cursor: pointer; }
.fs-more-tog > i:first-child { color: var(--primary-2); }
.fs-more-tog b { margin-inline-start: auto; min-width: 24px; padding: 0 .4rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: .72rem; text-align: center; line-height: 1.6; }
.fs-more-tog > i:last-child { font-size: .68rem; color: var(--muted); transition: transform .15s; }
.fs-more-tog[aria-expanded=true] > i:last-child { transform: rotate(180deg); }
.fs-more-tog:hover, .fs-more-tog:focus-visible { background: var(--tint); color: var(--primary); border-color: var(--primary-2); outline: none; }
.fs-none { padding: .8rem; text-align: center; margin: 0; }
.fs-pop-foot { display: flex; gap: .4rem; align-items: center; padding: .55rem .8rem; border-top: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--primary-2); }
.fs-pop-foot:hover { background: var(--soft); }
/* the programme the floors' spaces make (its section, read only) */
.fs-prog-lead { margin: 0; flex: 1; min-width: 240px; font-size: .86rem; color: var(--ink-2); display: flex; gap: .45rem; align-items: flex-start; line-height: 1.6; }
.fs-prog-lead i { color: var(--primary-2); margin-top: .25rem; }
.fs-prog { display: flex; flex-direction: column; gap: .8rem; }
.fs-pf { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
.fs-pf header { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line-2); }
.fs-pf header b { font-size: 1rem; }
.fs-pf-sum { color: var(--muted); font-weight: 700; font-size: .82rem; margin-inline-end: auto; }
.fs-pf .chip-btn { font-size: .78rem; padding: .3rem .65rem; }
.tag.fs-tag-d { background: var(--warn-bg); color: var(--warn); }
.fs-pt { width: 100%; border-collapse: collapse; font-size: .86rem; }
.fs-pt th { text-align: start; font-size: .72rem; color: var(--muted); font-weight: 700; padding: .45rem .9rem; background: var(--soft); }
.fs-pt td { padding: .42rem .9rem; border-top: 1px solid var(--line-2); }
.fs-pt td:nth-child(n+3), .fs-pt th:nth-child(n+3) { text-align: end; white-space: nowrap; }
.fs-pt code { font-size: .7rem; color: var(--primary-2); direction: ltr; font-weight: 700; }
.fs-pt-dim { display: block; font-size: .7rem; color: var(--muted); }
.fs-pt-fix { display: inline-flex; align-items: center; gap: .2rem; margin-top: .1rem; padding: 0 .35rem; border-radius: 999px; background: var(--tint); color: var(--primary); font-size: .66rem; font-weight: 800; }
.fs-pt-fix i { font-size: .58rem; }
.fs-pt-nm { display: inline-flex; align-items: center; gap: .45rem; padding-inline-start: calc(var(--lv, 0) * 1.3rem); }
.fs-pt-nm > i.fa-solid { color: var(--primary-2); width: 18px; text-align: center; }
.fs-pt-in { font-style: normal; color: var(--muted); }
.fs-pt tr.lv1 td, .fs-pt tr.lv2 td { color: var(--ink-2); font-size: .82rem; }
.fs-pt tr.lv0 td:nth-child(2) { font-weight: 700; }
.fs-pt tr.open td { color: var(--ok); }
.fs-pt em { font-style: normal; font-size: .72rem; color: var(--ok); }
.fs-pt-note { display: flex; gap: .35rem; align-items: baseline; margin-top: .12rem; padding-inline-start: calc(var(--lv, 0) * 1.3rem + 18px + .45rem); font-size: .74rem; font-weight: 500; color: var(--ink-2); line-height: 1.55; white-space: normal; }
.fs-pt-note i { font-size: .58rem; color: var(--primary-2); flex: none; }
.fs-pf-empty { padding: .8rem .9rem; margin: 0; font-size: .85rem; }
@media (max-width: 600px) { .fs-pt th:first-child, .fs-pt td:first-child { display: none; } .fs-pt td, .fs-pt th { padding-inline: .5rem; } }
/* the printed brief: a floor's units with what they hold */
.pr-sp { margin: .15rem 0 0; padding-inline-start: 1.1rem; font-weight: 500; white-space: normal; }
.pr-sp li { margin: .1rem 0; }
.pr-sp code { font-size: .72em; color: #4a5e6b; }
.pr-sp-note { display: block; margin: .1rem 0 .15rem; padding-inline-start: .55rem; border-inline-start: 2px solid #b6d5e0; color: #4a5e6b; font-size: .9em; font-weight: 500; line-height: 1.55; white-space: pre-line; }
.brief-doc tr.pr-in td { color: #4a5e6b; font-size: .92em; }

/* ---------- أنواع الفراغات والوحدات (/spaces, Scripts/spaces-admin.js): the side list and pane of /components ---------- */
.stp-filters { display: flex; flex-direction: column; gap: .35rem; }
.stp-filters small { font-size: .72rem; font-weight: 800; color: var(--muted); }
.stp-seg { display: flex; flex-wrap: wrap; gap: .25rem; }
.stp-seg button { border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-xs); padding: .25rem .55rem; font-size: .78rem; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.stp-seg button:hover { border-color: #b9ccd8; }
.stp-seg button.on { background: var(--sel-bg); border-color: var(--sel-line); color: var(--sel-ink); }
.stp-cats .cm-row > i { width: 18px; text-align: center; color: var(--primary-2); flex: none; }
.stp-cats .cm-row code { font-size: .66rem; color: var(--muted); direction: ltr; }
.stp-cats .cm-row.off { opacity: .5; }
#stpTreeBtn.on { background: var(--tint); color: var(--primary); }
.stp-pane { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.stp-cat { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
.stp-cat > header { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.stp-cat > header h2 { font-size: 1.05rem; margin: 0; }
.stp-cat > header code { font-size: .74rem; color: var(--muted); direction: ltr; }
.stp-cat > header small { background: var(--tint); color: var(--primary); font-weight: 800; border-radius: 999px; padding: .05rem .5rem; font-size: .74rem; }
.stp-cat > header .chip-btn { margin-inline-start: auto; font-size: .78rem; padding: .3rem .7rem; }
.stp-cico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
.stp-row { display: grid; grid-template-columns: 30px 44px minmax(0, 1fr) 150px 92px 44px 38px; gap: .7rem; align-items: center; padding: .65rem 1rem; border-top: 1px solid var(--line-2); }
.stp-row:first-of-type { border-top: 0; }
.stp-row:hover { background: #fbfdfe; }
.stp-row.off { background: #f8fafb; }
.stp-row.off .stp-main, .stp-row.off .stp-ico { opacity: .55; }
.stp-move { display: flex; flex-direction: column; }
.stp-move .icon-btn { width: 28px; height: 22px; font-size: .68rem; }
.stp-ico { width: 44px; height: 44px; border-radius: var(--r-sm); border: 0; background: var(--tint); color: var(--primary); font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; }
.stp-ico:hover { background: var(--primary); color: #fff; }
.stp-main { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.stp-name { border: 0; background: transparent; padding: 0; text-align: start; cursor: pointer; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; font: inherit; }
.stp-name b { font-size: .98rem; color: var(--ink); }
.stp-name small { color: var(--muted); font-size: .78rem; }
.stp-name:hover b { color: var(--primary); }
.stp-tags { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.stp-ref { font-size: .72rem; font-weight: 800; color: var(--primary); background: var(--tint); border-radius: 5px; padding: .08rem .4rem; direction: ltr; }
.stp-use, .stp-flag { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: var(--r-xs); background: var(--soft); color: var(--ink-2); }
.stp-use.u-sub { background: #f2ecfb; color: #6a42b8; }
.stp-use.u-both { background: #e8f4f6; color: #1d7488; }
.stp-flag.add { background: var(--ok-bg); color: var(--ok); }
.stp-flag.chg { background: var(--warn-bg); color: var(--warn); }
.stp-subs { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; font-size: .76rem; }
.stp-subs > span:first-child { color: var(--muted); font-weight: 700; }
.stp-sub { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .45rem; border-radius: 999px; border: 1px dashed #c3d2db; color: var(--muted); font-weight: 600; }
.stp-sub.on { border-style: solid; border-color: #b6d5e0; background: #f1f8fb; color: var(--primary); }
.stp-sub i { font-size: .7rem; }
.stp-inside { font-size: .74rem; color: var(--muted); display: flex; gap: .35rem; align-items: center; }
.stp-floors { display: flex; flex-wrap: wrap; gap: .2rem; }
.stp-floors span { font-size: .7rem; font-weight: 700; padding: .08rem .38rem; border-radius: 5px; background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); }
.stp-floors .muted { border: 0; background: none; font-weight: 600; }
.stp-area { display: flex; flex-direction: column; text-align: end; }
.stp-area b { font-size: .92rem; }
.stp-area small { color: var(--muted); font-size: .72rem; direction: ltr; }
.stp-flash { animation: fsFlash 1.6s var(--ease); }
.stp-tree-lead { margin: 0; font-size: .85rem; display: flex; gap: .45rem; align-items: flex-start; line-height: 1.6; }
.stp-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: .8rem; align-items: start; }
.stp-root { list-style: none; margin: 0; padding: .7rem .8rem; background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); }
.stp-tree ul ul { list-style: none; margin: 0 0 0 0; padding-inline-start: 1.2rem; border-inline-start: 2px dotted #c3d2db; margin-inline-start: .6rem; }
.stp-tree li { margin: .2rem 0; }
.stp-tree li.opt > .stp-node { opacity: .5; }
.stp-node { border: 0; background: transparent; padding: .2rem .35rem; border-radius: var(--r-xs); display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; color: var(--ink-2); font: inherit; font-size: .86rem; text-align: start; flex-wrap: wrap; }
.stp-node:hover { background: var(--tint); color: var(--primary); }
.stp-node i { color: var(--primary-2); width: 18px; text-align: center; }
.stp-node em { font-style: normal; font-weight: 800; color: var(--primary); }
.stp-node code { font-size: .66rem; color: var(--muted); direction: ltr; }
.stp-node small { font-size: .72rem; color: var(--muted); }
.stp-root > li > .stp-node b { font-size: .95rem; color: var(--ink); }
.dlg.stp-dlg { max-width: 1040px; width: calc(100vw - 2rem); }
.stp-dhead { display: flex; gap: .8rem; align-items: center; margin-bottom: .7rem; }
.stp-dhead h3 { margin: 0; }
.stp-dhead small { color: var(--muted); font-size: .8rem; }
.stp-dhead code { color: var(--primary); font-weight: 800; direction: ltr; }
.stp-dico { width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.stp-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; max-height: calc(100vh - 14rem); overflow-y: auto; padding: .1rem; }
.stp-col { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.stp-form fieldset { border: 1.5px solid var(--line); border-radius: var(--r); padding: .7rem .85rem .8rem; margin: 0; min-width: 0; }
.stp-form legend { font-weight: 800; font-size: .86rem; color: var(--primary); padding: 0 .35rem; }
.stp-form .field { margin-bottom: .55rem; }
.stp-form .field > span:first-child { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.stp-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: .25rem; max-height: 118px; overflow-y: auto; padding: .1rem; }
.stp-icons button { height: 34px; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-xs); cursor: pointer; color: var(--ink-2); }
.stp-icons button:hover { border-color: #b9ccd8; color: var(--primary); }
.stp-icons button.on { background: var(--sel-bg); border-color: var(--sel-line); color: var(--sel-ink); }
.stp-uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-bottom: .6rem; }
.stp-usec { cursor: pointer; position: relative; }
.stp-usec input { position: absolute; opacity: 0; width: 0; height: 0; }
.stp-usec > span { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: .55rem .6rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; transition: border-color .15s, background .15s; }
.stp-usec > span i { color: var(--primary-2); }
.stp-usec > span b { font-size: .84rem; }
.stp-usec > span small { font-size: .72rem; color: var(--muted); line-height: 1.45; }
.stp-usec input:checked + span { border-color: var(--primary); background: var(--tint); box-shadow: 0 0 0 3px rgba(25,89,122,.1); }
.stp-usec input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.stp-flwrap.dim { opacity: .45; }
.stp-fls .chip { padding: .35rem .7rem; font-size: .82rem; }
.stp-areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
/* the least standard size: width × length = its area */
.stp-size { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.stp-size .unit-wrap { width: 108px; flex: none; }
.stp-size .unit-wrap input { padding-inline-end: 2rem; text-align: center; font-weight: 700; }
.stp-size .unit-wrap .unit { inset-inline-end: .6rem; }
.stp-size > i { font-style: normal; color: var(--muted); }
.stp-size-a { font-size: .86rem; color: var(--ink-2); }
.stp-size-a b { font-weight: 800; font-size: .98rem; }
.stp-legacy { color: #8a5a10; font-size: .8rem; }
.stp-subsz { display: inline-flex; align-items: center; gap: .2rem; }
.stp-subsz input { width: 50px; height: 30px; padding: .25rem .2rem; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.stp-subsz input::-webkit-inner-spin-button, .stp-subsz input::-webkit-outer-spin-button, .stp-size input::-webkit-inner-spin-button, .stp-size input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stp-size input { -moz-appearance: textfield; }
.stp-subsz input::placeholder { color: #a3b3bd; font-weight: 600; }
.stp-subsz > i { font-style: normal; font-size: .74rem; color: var(--muted); }
.stp-subsz small { min-width: 48px; font-size: .7rem; color: var(--muted); white-space: nowrap; text-align: end; }
.stp-flags { display: flex; flex-direction: column; gap: .45rem; margin-top: .5rem; }
.stp-sublist { display: flex; flex-direction: column; gap: .35rem; margin: .4rem 0 .5rem; }
.stp-subrow { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto 30px 30px; gap: .45rem; align-items: center; padding: .35rem .45rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.stp-subico { width: 30px; height: 30px; border-radius: var(--r-xs); background: var(--tint); color: var(--primary); display: grid; place-items: center; font-size: .8rem; }
.stp-subnm { min-width: 0; display: flex; flex-direction: column; }
.stp-subnm b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stp-subnm code { font-size: .66rem; color: var(--muted); direction: ltr; }
.stp-subrow .stepper { border-radius: var(--r-xs); }
.stp-subrow .stepper button { width: 26px; height: 28px; font-size: .7rem; }
.stp-subrow .stepper input { width: 30px; font-size: .85rem; height: 28px; }
.stp-subrow .unit-wrap input { padding: .3rem .45rem; padding-inline-end: 1.9rem; height: 30px; }
.stp-subrow .unit-wrap .unit { inset-inline-end: .45rem; font-size: .7rem; }
.stp-subrow .cm-sw span { font-size: .74rem; }
.stp-subrow .icon-btn { width: 28px; height: 28px; }
.stp-subrow > .sn-strip { grid-column: 2 / -1; }
.stp-subrow > .sn-ed { grid-column: 1 / -1; }
.stp-subrow.writing { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(35,132,159,.12); }
.stp-subadd { display: flex; gap: .4rem; }
.stp-subadd select { flex: 1; min-width: 0; }
.stp-none { margin: .3rem 0; font-size: .82rem; }
.stp-preview { margin-top: .7rem; background: var(--soft); border-radius: var(--r-sm); padding: .6rem .7rem; font-size: .84rem; }
.stp-preview > b { font-size: .78rem; color: var(--muted); }
.stp-preview ul { list-style: none; margin: .25rem 0 0; padding: 0; }
.stp-preview ul ul { padding-inline-start: 1.1rem; border-inline-start: 2px dotted #c3d2db; margin-inline-start: .45rem; }
.stp-preview li { margin: .15rem 0; }
.stp-preview li > i { color: var(--primary-2); width: 18px; text-align: center; margin-inline-end: .3rem; }
.stp-preview small { color: var(--muted); }
.stp-prev-t { margin-top: .45rem; padding-top: .45rem; border-top: 1px solid var(--line); }
.stp-acts { flex-wrap: wrap; align-items: center; }
.stp-acts .stp-on { margin-inline-end: auto; }
.btn.stp-del { color: var(--bad); }
@media (max-width: 1100px) {
  .stp-row { grid-template-columns: 30px 44px minmax(0, 1fr) 92px 44px 38px; }
  .stp-floors { grid-column: 3; grid-row: 2; }
}
@media (max-width: 900px) {
  .stp-form { grid-template-columns: minmax(0, 1fr); max-height: none; }
  .stp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stp-row { grid-template-columns: 44px minmax(0, 1fr) 38px; padding: .6rem .7rem; column-gap: .6rem; row-gap: .35rem; }
  .stp-move { display: none; }
  .stp-ico { grid-column: 1; grid-row: 1 / span 2; }
  .stp-main { grid-column: 2; grid-row: 1; }
  .stp-row > .icon-btn[data-edit] { grid-column: 3; grid-row: 1; }
  .stp-floors { grid-column: 2; grid-row: 2; }
  .stp-area { grid-column: 2; grid-row: 3; flex-direction: row; gap: .5rem; align-items: baseline; text-align: start; }
  .stp-row .cm-sw { grid-column: 3; grid-row: 2; }
  .stp-uses { grid-template-columns: minmax(0, 1fr); }
  .stp-areas { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stp-subrow { grid-template-columns: 30px minmax(0, 1fr) 30px 30px; }
  .stp-subrow .stepper, .stp-subrow .unit-wrap, .stp-subrow .stp-subsz, .stp-subrow .cm-sw { grid-column: 2 / -1; justify-self: start; }
  .stp-subrow > .icon-btn.sn-btn { grid-column: 3; grid-row: 1; }
  .stp-subrow > .icon-btn[data-sdel] { grid-column: 4; grid-row: 1; }
  .stp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* a unit's note (MD.SpaceNote in Scripts/spaces.js): the row's button, the note under its name, the editor inside the row.
   The same on a floor's spaces, the programme's rows and a type's contents on /spaces. */
.sn-btn { width: 30px; height: 30px; color: var(--muted); }
.sn-btn:hover { color: var(--primary); }
.sn-btn.has { color: var(--primary-2); background: var(--tint); }
.sn-btn.on { color: var(--sel-ink); background: var(--sel-bg); box-shadow: inset 0 0 0 1px var(--sel-line); }
.sn-btn:disabled { cursor: default; background: transparent; }
.sn-strip { display: flex; align-items: flex-start; gap: .45rem; width: 100%; min-width: 0; margin: .05rem 0 0; padding: .36rem .6rem; border: 0; border-inline-start: 3px solid var(--primary-2); border-radius: var(--r-xs); background: var(--soft); color: var(--ink-2); font-size: .8rem; font-weight: 500; line-height: 1.6; text-align: start; cursor: pointer; transition: background .15s; }
.sn-strip > i { flex: none; margin-top: .32rem; font-size: .62rem; color: var(--primary-2); }
.sn-strip > span { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sn-strip:hover { background: var(--tint); }
.sn-strip:disabled { cursor: default; color: var(--ink-2); }
.sn-strip:disabled:hover { background: var(--soft); }
.sn-ed { display: flex; flex-direction: column; gap: .5rem; min-width: 0; margin-top: .3rem; padding: .7rem .75rem .65rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: linear-gradient(180deg, var(--soft), #fff 70%); animation: snIn .18s var(--ease); }
@keyframes snIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sn-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .45rem; min-width: 0; }
.sn-top > i { color: var(--primary-2); font-size: .78rem; }
.sn-top > b { font-size: .84rem; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.sn-top > small { margin-inline-start: auto; font-size: .72rem; color: var(--muted); }
textarea.sn-in { min-height: 64px; max-height: 240px; resize: none; padding: .55rem .7rem; border-radius: var(--r-sm); background: #fff; font-size: .9rem; line-height: 1.7; }
.sn-ph { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.sn-ph > span { margin-inline-end: .15rem; font-size: .72rem; font-weight: 700; color: var(--muted); }
.sn-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border: 1px dashed #c3d2db; border-radius: 999px; background: #fff; color: var(--ink-2); font-size: .76rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.sn-chip > i { font-size: .6rem; color: var(--muted); }
.sn-chip:hover { border-style: solid; border-color: var(--primary-2); color: var(--primary); }
.sn-chip.on { border-style: solid; border-color: #b6d5e0; background: var(--tint); color: var(--primary); }
.sn-chip.on > i { color: var(--primary-2); }
.sn-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.sn-cnt { font-size: .72rem; color: var(--muted); direction: ltr; font-variant-numeric: tabular-nums; }
.sn-cnt.near { color: var(--warn); font-weight: 700; }
.sn-keys { font-size: .7rem; color: var(--muted); opacity: .85; }
.sn-foot > .btn { padding: .36rem .8rem; font-size: .8rem; gap: .4rem; box-shadow: none; }
.sn-foot > .btn:first-of-type { margin-inline-start: auto; }
.sn-clear:hover { color: var(--bad); border-color: #f1c4c4; background: var(--bad-bg); }
@media (hover: none), (max-width: 640px) { .sn-keys { display: none; } }

/* ---------- the external blocks & the ground floor's buildable area («بيانات الأرض», type "extblocks", Scripts/workspace.js) ---------- */
.xb { display: grid; gap: .65rem; }
.xb-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.xb-lbl { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-inline-end: .2rem; }
.xb-lbl i { color: var(--primary-2); }
.xb-seg { display: flex; flex-wrap: wrap; gap: .3rem; }
.xb .chip { padding: .32rem .65rem; font-size: .8rem; }
.xb .chip i { font-size: .75rem; }
.xb .chip:disabled { cursor: default; opacity: .85; }
.xb-add .md-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .7rem; border: 1.5px dashed #c5d3dc; background: #fff; border-radius: var(--r-sm); font-weight: 700; font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.xb-add .md-btn:hover:not(:disabled) { border-color: var(--primary-2); background: var(--soft); }
.xb-add .md-btn span { display: inline-flex; flex-direction: column; line-height: 1.15; text-align: start; }
.xb-add .md-btn small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.xb-add .md-btn .xb-plus { color: var(--muted); font-size: .7rem; }
.xb-add .md-btn:disabled { opacity: .55; cursor: not-allowed; }
.xb-list { display: grid; gap: .5rem; }
.xb-item { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--soft); padding: .55rem .65rem; display: grid; gap: .45rem; }
.xb-item.bad { border-color: #f1c4c4; background: #fff8f8; }
.xb-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.xb-head b { font-size: .9rem; }
.xb-head select { width: auto; padding: .2rem .5rem; font-size: .78rem; border-width: 1px; margin-inline-start: .2rem; }
.xb-acts { display: inline-flex; gap: .25rem; margin-inline-start: auto; }
.xb-acts .md-btn, .xb-size .md-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: var(--r-xs); color: var(--ink-2); cursor: pointer; }
.xb-acts .md-btn:hover, .xb-size .md-btn:hover { border-color: var(--primary-2); color: var(--primary); }
.xb-acts .ge-del:hover { color: var(--bad); border-color: #f1c4c4; }
.xb-body { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; }
.xb-size { display: inline-flex; align-items: flex-end; gap: .35rem; }
.xb-size label { display: grid; gap: .1rem; font-size: .68rem; color: var(--muted); font-weight: 700; }
.xb-size input { width: 66px; padding: .3rem .45rem; font-size: .85rem; border-width: 1px; text-align: center; }
.xb-size > i { font-style: normal; color: var(--muted); padding-bottom: .35rem; }
.xb-size em { font-style: normal; font-size: .8rem; color: var(--ink-2); padding-bottom: .35rem; white-space: nowrap; }
.xb-rule { margin: 0; display: flex; gap: .4rem; align-items: baseline; font-size: .76rem; color: var(--ink-2); line-height: 1.45; }
.xb-rule i { font-size: .72rem; color: var(--muted); }
.xb-rule.ok i { color: var(--ok); } .xb-rule.bad { color: var(--bad); } .xb-rule.bad i { color: var(--bad); } .xb-rule.warn { color: var(--warn); } .xb-rule.warn i { color: var(--warn); }
.xb-want { margin: 0; font-size: .8rem; color: var(--ink-2); background: var(--tint); border-radius: var(--r-sm); padding: .45rem .7rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.xb-want i { color: var(--primary-2); }
.xb-want .ge-link { border: 0; background: none; color: var(--primary); font-weight: 800; text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }
.xb-ground { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: .8rem; align-items: start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .65rem; background: #fff; }
.xb-ground > .q-help { grid-column: 1 / -1; margin: 0; }
.xb-g-plan svg { width: 100%; height: auto; max-height: 260px; display: block; }
.xb-g-fig { display: grid; gap: .5rem; min-width: 0; }
.xb-g-res { display: grid; gap: .1rem; padding: .5rem .7rem; border-radius: var(--r-sm); background: var(--tint); border-inline-start: 4px solid var(--primary); }
.xb-g-res small { font-size: .74rem; color: var(--ink-2); font-weight: 700; }
.xb-g-res b { font-size: 1.45rem; color: var(--primary); line-height: 1.15; }
.xb-g-res em { font-style: normal; font-size: .72rem; color: var(--muted); }
.xb-g-res.warn { background: var(--warn-bg); border-color: var(--warn); }
.xb-g-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .78rem; }
.xb-g-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 .6rem; padding: .2rem 0; border-bottom: 1px dashed var(--line-2); }
.xb-g-list li span { color: var(--ink-2); }
.xb-g-list li b { color: var(--ink); white-space: nowrap; text-align: end; }
.xb-g-list li small { grid-column: 1 / -1; color: var(--muted); font-size: .7rem; }
.xb-g-list li.bad b, .xb-g-list li.bad small { color: var(--bad); } .xb-g-list li.ok small { color: var(--ok); }
@media (max-width: 640px) { .xb-ground { grid-template-columns: 1fr; } .xb-g-plan svg { max-height: 220px; } }

/* the stage's plan: the external blocks and the villa's blocks picked and resized by hand (Scripts/library.js mapDyn) */
.land-plan .land-ext.can { cursor: grab; }
.land-plan .land-ext.can:hover polygon { filter: brightness(1.12); }
.st-map.dragging .land-ext { cursor: grabbing; }
.land-plan .land-h { cursor: pointer; }
.land-plan .land-h[data-xh=x0], .land-plan .land-h[data-xh=x1], .land-plan .land-h[data-bh=x0], .land-plan .land-h[data-bh=x1] { cursor: ew-resize; }
.land-plan .land-h[data-xh=y0], .land-plan .land-h[data-xh=y1], .land-plan .land-h[data-bh=y0], .land-plan .land-h[data-bh=y1] { cursor: ns-resize; }
.land-plan .land-h[data-xh*=x][data-xh*=y], .land-plan .land-h[data-bh*=x][data-bh*=y] { cursor: nwse-resize; }
.land-legend .lg-ground { border: 2px dashed #1C5A7A; background: rgba(28,90,122,.1); }
.land-legend .lg-ext { background: #8a5a2b; }
.st-side .ss-empty { margin: 0; font-size: .72rem; line-height: 1.45; color: rgba(255,255,255,.75); }
.st-side .ss-clear { height: 28px; font-size: .7rem; gap: .35rem; margin-top: .15rem; opacity: .85; }
.ge-seg4 { flex-wrap: wrap; }
.ge-seg4 button { min-width: 25%; }

/* ---------- the requests card's menu (⋮) and Client Access (Scripts/requests.js, Scripts/client-access.js) ---------- */
.rq-cell { position: relative; display: flex; min-width: 0; animation: rise .35s var(--ease) both; }
.rq-cell > .rq { flex: 1; min-width: 0; animation: none; }
.rq-cell > .rq .rq-head { padding-inline-end: 1.9rem; }   /* room for the menu button over the card's corner */
.rq-cell:hover > .rq { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: #d7e6ee; }
.rq-more { position: absolute; top: .8rem; inset-inline-end: .6rem; z-index: 2; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, transform .2s var(--ease); }
.rq-more:hover, .rq-more.on { background: var(--tint); color: var(--primary); }
.rq-cell:hover > .rq-more { transform: translateY(-3px); }
.rq-key { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--tint-accent); color: var(--accent); font-size: .66rem; }
.rq-key.off { background: #eef2f5; color: var(--muted); }
.rq-menu { position: fixed; z-index: 80; width: max-content; min-width: 250px; max-width: min(330px, calc(100vw - 16px)); background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh-3); padding: .35rem; animation: menu-in .14s var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.rq-mi { display: flex; align-items: flex-start; gap: .7rem; width: 100%; border: 0; background: transparent; text-align: start; padding: .55rem .65rem; border-radius: var(--r-xs); cursor: pointer; color: var(--ink); }
.rq-mi > i { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: var(--r-xs); background: var(--tint); color: var(--primary); font-size: .85rem; }
.rq-mi:first-child > i { background: var(--tint-accent); color: var(--accent); }
.rq-mi:first-child { margin-bottom: .3rem; position: relative; }
.rq-mi:first-child::after { content: ''; position: absolute; inset-inline: .65rem; bottom: -.18rem; border-bottom: 1px solid var(--line-2); }
.rq-mi > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; padding-top: .25rem; }
.rq-mi b { font-size: .9rem; }
.rq-mi b em { font-style: normal; font-weight: 600; color: var(--muted); font-size: .74rem; margin-inline-start: .2rem; }
.rq-mi small { color: var(--muted); font-size: .76rem; margin-top: .15rem; }
.rq-mi:hover:not([aria-disabled]), .rq-mi:focus-visible { background: var(--soft); outline: none; }
.rq-mi:focus-visible { box-shadow: inset 0 0 0 2px rgba(35,132,159,.45); }
.rq-mi[aria-disabled] { cursor: not-allowed; opacity: .55; }

.dlg.ca-dlg { max-width: 520px; }
.ca-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .55rem; }
.ca-ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: var(--r); background: var(--tint-accent); color: var(--accent); font-size: 1.15rem; }
.ca-title { flex: 1; min-width: 0; }
.ca-title h3 { margin: 0; }
.ca-title p { margin: .1rem 0 0; color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-title p b { color: var(--ink-2); font-family: ui-monospace, Consolas, monospace; font-weight: 600; }
.ca-state { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.ca-state.on { background: var(--ok-bg); color: var(--ok); }
.ca-state.off { background: var(--warn-bg); color: var(--warn); }
.ca-state.none { background: #eef2f5; color: var(--ink-2); }
.ca-lead { color: var(--muted); font-size: .87rem; margin: 0 0 .9rem; }
.ca-note { display: flex; gap: .55rem; align-items: center; padding: .6rem .8rem; border-radius: var(--r-sm); background: var(--tint); color: var(--primary); font-size: .86rem; font-weight: 600; margin-bottom: .9rem; }
.ca-sec { display: flex; flex-direction: column; gap: .45rem; padding: .9rem 0; border-top: 1px solid var(--line-2); }
.ca-lbl { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.ca-code-row { display: flex; align-items: center; gap: .3rem; }
.ca-code-row input.ca-code { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; font-weight: 700; letter-spacing: .14em; text-align: center; text-transform: uppercase; padding: .5rem .6rem; }
.ca-hint { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.ca-warn { display: flex; gap: .4rem; align-items: baseline; color: var(--warn); font-size: .8rem; font-weight: 600; }
.ca-warn[hidden], .ca-err[hidden], .ca-hint[hidden], .ca-date-row[hidden] { display: none; }
.ca-err { color: var(--bad); font-size: .8rem; font-weight: 600; }
.ca-seg { align-self: flex-start; }
.ca-date-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ca-date-row input[type=date] { width: auto; flex: 0 1 190px; }
.ca-quick { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.ca-quick .chip-btn { font-size: .78rem; padding: .3rem .7rem; }
.ca-share { display: flex; flex-direction: column; gap: .5rem; padding: .85rem; border-radius: var(--r); background: var(--soft); border: 1px solid var(--line-2); margin-top: .2rem; }
.ca-share.stale .ca-link, .ca-share.stale .ca-msg { opacity: .55; }
.ca-link { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .2rem; padding-inline-start: .7rem; min-width: 0; }
.ca-link > i { color: var(--primary-2); }
.ca-link span { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-link .icon-btn { width: 34px; height: 34px; }
.ca-msg { justify-content: center; background: #fff; }
.ca-meta { display: flex; gap: .45rem; align-items: baseline; color: var(--muted); font-size: .78rem; margin: .85rem 0 0; }
.ca-actions { align-items: center; flex-wrap: wrap; }
.ca-gap { flex: 1; }
.ca-stop { color: var(--bad); border-color: #f2c9c9; }
.ca-stop:hover { background: var(--bad-bg); border-color: #ecb3b3; }
@media (max-width: 520px) { .ca-actions .btn { flex: 1; } .ca-gap { display: none; } .ca-stop { order: 3; flex-basis: 100%; } .ca-head { flex-wrap: wrap; } }

/* ---------- the client's own pages: sign-in (client.aspx) and his studio (Client.master, clientdesign.aspx) ---------- */
.cl-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .75rem; border-radius: 999px; background: var(--tint-accent); color: var(--accent); font-weight: 700; font-size: .8rem; margin-bottom: .6rem; }
.cl-req { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: var(--r-sm); background: var(--soft); border: 1px solid var(--line); margin-bottom: 1rem; }
.cl-req-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--tint); color: var(--primary); }
.cl-req-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.cl-req-txt small { color: var(--muted); font-size: .76rem; }
.cl-req-txt b { align-self: flex-start; font-family: ui-monospace, Consolas, monospace; font-size: 1.02rem; color: var(--ink); }
.cl-req-other { font-size: .82rem; font-weight: 700; color: var(--primary-2); white-space: nowrap; }
.cl-req-other:hover { text-decoration: underline; }
input.cl-mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }
input.cl-code { font-size: 1.3rem; font-weight: 700; letter-spacing: .16em; text-align: center; text-transform: uppercase; }
.cl-hint { color: var(--muted); font-size: .78rem; }
.cl-help { display: flex; gap: .45rem; align-items: baseline; color: var(--muted); font-size: .82rem; margin: 1.1rem 0 0; }
.client-mode .me .avatar { background: var(--tint-accent); color: var(--accent); }
.client-mode.ws-body .topbar-end > .cl-out { display: inline-grid; }   /* the client's sign-out stays in view at every width (staff find theirs in the search palette) */

/* ---------- folding (workspace.js "folding"): a page's bigger questions and the stairs' parts as one line each — the question,
   and under it its answer — one open at a time; «فتح كل الأسئلة» (.fold-all in the page's head) shows every page whole. ---------- */
.sec-head .fold-all { flex: none; width: 36px; height: 36px; }
.fold { scroll-margin-top: 84px; }
.fold > .q-top, .fold > .qset-head { flex-wrap: wrap; row-gap: .2rem; align-items: center; }
.fold-sum { order: 9; flex: 1 1 100%; min-width: 0; display: flex; align-items: center; gap: .5rem; font-size: .84rem; font-weight: 600; color: var(--ink-2); line-height: 1.55; }
.fold:not(.shut) .fold-sum { display: none; }
.fold-ans { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-need { flex: none; font-style: normal; font-size: .76rem; font-weight: 700; color: var(--muted); }
.fold-need.req { color: #8a5a10; background: var(--warn-bg); padding: .02rem .55rem; border-radius: 999px; }
.fold-opt { font-style: normal; font-size: .76rem; font-weight: 600; color: #a3b3bd; }
.fold-cnt { flex: none; padding: 0 .5rem; border-radius: 999px; background: var(--sel-bg); border: 1px solid var(--sel-line); color: var(--sel-ink); font-size: .72rem; font-weight: 800; line-height: 1.6; }
.fold-tog { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--tint); color: var(--primary); display: grid; place-items: center; cursor: pointer; font-size: .76rem; transition: background .15s, color .15s; }
.fold-tog:hover { background: var(--primary-2); color: #fff; }
.fold-tog:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(35,132,159,.3); }
.fold-tog i { transition: transform .18s var(--ease); }
.fold.shut > .q-top > .fold-tog i, .fold.shut > .qset-head > .fold-tog i { transform: rotate(-90deg); }
[dir=rtl] .fold.shut > .q-top > .fold-tog i, [dir=rtl] .fold.shut > .qset-head > .fold-tog i { transform: rotate(90deg); }
.q.fold.shut { padding: .75rem 1.1rem; cursor: pointer; }
.q.fold.shut:hover, .qset.fold.shut:hover { border-color: #c7d6df; }
.q.fold.shut > :not(.q-top) { display: none; }
.q.fold.shut > .q-top { margin-bottom: 0; }
.q.fold:not(.shut) { border-color: rgba(35,132,159,.35); }
.q.fold:not(.shut) > .q-top { padding-bottom: .6rem; border-bottom: 1px solid var(--line-2); margin-bottom: .9rem; }
.qset.fold.shut { padding: .75rem 1rem; cursor: pointer; }
.qset.fold.shut > :not(.qset-head) { display: none; }
.qset.fold.shut > .qset-head { margin-bottom: 0; }
.qset.fold.shut > .qset-head p { display: none; }
.qset.fold > .qset-head > .fold-sum { padding-inline-start: calc(38px + .65rem); }
.fold-foot { display: flex; justify-content: flex-end; margin-top: .9rem; }
.fold-foot .fold-next { padding: .4rem .95rem; font-size: .84rem; gap: .45rem; }
.next-card.fold-done { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(35,132,159,.18), var(--sh-1); }
/* a floor's spaces, folding: each unit one line — its count and size, its total — until opened to change it (one open at a time
   in a list); a group of one type is its heading until opened; the column titles go (an open row's fields say what they are) */
.fs-folds .fs-head { display: none; }
.fs-shut > .fs-row { cursor: pointer; }
.fs-shut > .fs-row > .fs-n, .fs-shut > .fs-row > .fs-a, .fs-shut > .fs-row > .sn-btn, .fs-shut > .fs-row > .fs-del, .fs-shut > .fs-row > .sn-ed { display: none; }
.fs-shut > .fs-row > .fs-fix { pointer-events: none; }
.fs-shut > .fs-row > .fs-fix:not(:has(input:checked)) { visibility: hidden; }
.fs-shut > .fs-row > .fs-sm { grid-column: 5 / 7; }
.fs-shut > .fs-row > .fs-t { grid-column: 7; }
.fs-sm { display: flex; align-items: center; justify-content: flex-end; gap: .3rem; min-width: 0; font-size: .86rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.fs-sm b { font-weight: 800; color: var(--primary); }
.fs-sm em { font-style: normal; font-size: .74rem; font-weight: 700; color: #8a5a10; background: var(--warn-bg); padding: .02rem .55rem; border-radius: 999px; }
.fs-sm.warn { color: #8a5a10; }
.fs-sm.warn i { color: var(--warn); font-size: .76rem; }
.fs-folds .fs-u.open > .fs-row { border-color: var(--primary-2); }
.fs-folds .fs-u.open > .fs-inner { border-color: var(--primary-2); }
.fs-folds .fs-u.open:not(:has(> .fs-inner)) > .fs-row { border-radius: var(--r-sm); }
button.fs-grp-h { width: 100%; border: 0; background: transparent; font: inherit; text-align: start; cursor: pointer; border-radius: var(--r-xs); padding: .25rem .3rem; transition: background .15s; }
button.fs-grp-h:hover { background: var(--tint); }
button.fs-grp-h:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(35,132,159,.3); }
.fs-grp-cv { flex: none; width: 18px; text-align: center; font-size: .7rem; color: var(--primary); transition: transform .18s var(--ease); }
.fs-grp.shut .fs-grp-cv { transform: rotate(-90deg); }
[dir=rtl] .fs-grp.shut .fs-grp-cv { transform: rotate(90deg); }
.fs-grp.shut > .fs-u { display: none; }
@container fs (max-width: 740px) {   /* two lines: the name, then its count and size with its total */
  .fs-shut > .fs-row > .fs-nm { flex: 1 1 calc(100% - 26px - 26px - 34px - 1.6rem); }
  .fs-shut > .fs-row > .fs-sm { order: 5; flex: 1 1 auto; margin-inline-start: calc(26px + 26px + 34px + 1.5rem); justify-content: flex-start; }
  .fs-shut > .fs-row > .fs-t { order: 7; flex: 0 0 auto; }
  .fs-in.fs-shut > .fs-row > .fs-sm { margin-inline-start: 0; }
}
@container fs (max-width: 420px) { .fs-shut > .fs-row > .fs-sm { margin-inline-start: 0; } }

/* «الشوارع المحيطة» (type roads, workspace.js roadsControl): the streets' count, the sikkas' count (0 until changed) and the
   corner Yes / No, each its name then its control; side by side while they fit, one under the other on a phone */
.roads { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.6rem; }
.road-row { display: flex; align-items: center; gap: .7rem; }
.road-lbl { display: inline-flex; align-items: center; gap: .45rem; min-width: 4.6rem; font-weight: 700; color: var(--ink-2); }
.road-lbl i { color: var(--muted); font-size: .88em; width: 1.1em; text-align: center; }
.roads .stepper button { width: 40px; height: 40px; }
.roads .stepper button:disabled { color: var(--muted); opacity: .45; cursor: default; background: var(--soft); }
.roads .stepper input { width: 52px; }
@media (max-width: 560px) { .roads { flex-direction: column; align-items: stretch; } .road-row { justify-content: space-between; } }
/* an approved request read against the regulations it was approved under (script v26): the banner's line and, when today's
   differ, a folded table of the differences (workspace.js keptNote); the printed brief's note under its regulations table */
.locked-banner > span > small { display: block; font-weight: 500; opacity: .85; margin-top: .15rem; }
.regs-diff { margin-top: .55rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: 10px; font-weight: 500; }
.regs-diff summary { cursor: pointer; padding: .5rem .75rem; font-size: .84rem; display: flex; gap: .45rem; align-items: center; list-style: none; }
.regs-diff summary::-webkit-details-marker { display: none; }
.locked-banner .regs-diff summary i.chev { margin-inline-start: auto; font-size: .75rem; color: var(--muted); transition: transform .15s; }
.regs-diff[open] summary i.chev { transform: rotate(180deg); }
.locked-banner .regs-diff summary i { font-size: .95rem; color: var(--accent); }
.regs-diff-tbl { width: calc(100% - 1.5rem); margin: 0 .75rem; border-collapse: collapse; font-size: .82rem; }
.regs-diff-tbl th { text-align: start; color: var(--muted); font-weight: 600; font-size: .74rem; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.regs-diff-tbl td { padding: .4rem; border-bottom: 1px solid var(--line-2); }
.regs-diff-tbl td + td { white-space: nowrap; }
.regs-diff p { margin: .5rem .75rem .65rem; font-size: .78rem; color: var(--ink-2); }
.regs-diff-print { margin-top: .8rem; padding: .65rem .85rem; border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: 8px; break-inside: avoid; }
.regs-diff-print > b { display: flex; gap: .45rem; align-items: center; font-size: .9rem; }
.regs-diff-print > b i { color: var(--accent); }
.regs-diff-print p { margin: .3rem 0 .5rem; font-size: .8rem; color: var(--ink-2); }

/* ---------- the approvals' record (/approvals, Scripts/approvals.js) and printing one approval (brief/{id}?approval=N) ---------- */
.ap-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ap-stats div.stat { cursor: default; }
.ap-stats div.stat:hover { transform: none; }
.mt-stat.plain i { background: #eef2f5; color: var(--ink-2); }
.ap-toolbar .search { flex: 1 1 260px; }
.ap-dates { display: flex; gap: .5rem; flex-wrap: wrap; }
.ap-dates label { display: flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--muted); font-weight: 700; }
.ap-dates input { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .45rem .55rem; background: var(--card); color: var(--ink); font: inherit; font-size: .85rem; }
.ap-req { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--tint); color: var(--primary); border-radius: var(--r); padding: .6rem .9rem; margin-bottom: 1rem; font-size: .9rem; }
.ap-req > span { flex: 1; min-width: 0; }
.ap-req a { color: var(--primary); }
.btn.btn-sm { padding: .4rem .8rem; font-size: .82rem; gap: .4rem; }
.btn.is-off { opacity: .55; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ap-day { margin-bottom: 1.2rem; }
.ap-day h2 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; margin: 0 0 .55rem; }
.ap-day h2 i { color: var(--primary); }
.ap-day h2 small { color: var(--muted); font-weight: 700; font-size: .78rem; background: var(--soft); border-radius: 999px; padding: .1rem .6rem; }
.ap-table { min-width: 820px; }
.ap-table td { vertical-align: middle; }
.ap-table td .avatar { width: 24px; height: 24px; font-size: .62rem; margin-inline-end: .4rem; vertical-align: middle; }
.ap-row.force td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
[dir=rtl] .ap-row.force td:first-child { box-shadow: inset -3px 0 0 var(--ok); }
.ap-table small.ap-seq { color: var(--primary); font-weight: 700; }
.ap-table small.ap-reason { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-regs { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.ap-regs.ok { color: var(--ok); }
.ap-regs.muted { color: var(--muted); }
.ap-regs:not(.ok):not(.muted) { color: var(--primary); }
.ap-kind { margin-bottom: .9rem; }
.ap-kind[hidden] { display: none; }
.ap-kind button small { font-weight: 700; color: var(--muted); background: rgba(0,0,0,.05); border-radius: 999px; padding: 0 .45rem; margin-inline-start: .25rem; }
.ap-kind button.on small { color: var(--primary); background: var(--tint); }
.ap-table small.ap-kind-tag { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink-2); font-weight: 700; }
.ap-table small.ap-kind-tag.specs { color: #8a5a00; }
.ap-act { text-align: end; white-space: nowrap; }
.mt-table td.ap-act a.btn-primary { color: #fff; }   /* the table's links are primary-coloured */
@media (max-width: 760px) {
  .ap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-stats .stat:first-child { grid-column: auto; }
  .ap-kind { display: flex; } .ap-kind button { flex: 1 1 auto; white-space: nowrap; padding-inline: .35rem; font-size: .78rem; } .ap-kind button small { padding: 0 .35rem; margin-inline-start: .15rem; }
  .ap-toolbar .seg { flex: 1 1 100%; } .ap-toolbar .seg button { flex: 1; white-space: nowrap; padding-inline: .4rem; }
  .ap-dates { flex: 1 1 100%; } .ap-dates label { flex: 1; } .ap-dates input { flex: 1; min-width: 0; }
  /* a phone: each approval is a card, its cells label themselves (data-l) */
  .ap-table { min-width: 0; }
  .ap-table thead { display: none; }
  .ap-table, .ap-table tbody, .ap-table tr, .ap-table td { display: block; }
  .ap-table tr { padding: .7rem .9rem; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; }
  .ap-table tr:last-child { border-bottom: 0; }
  .ap-table td { border: 0; padding: .2rem 0; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
  .ap-table td[data-l]::before { content: attr(data-l); flex: 0 0 6.5rem; color: var(--muted); font-size: .74rem; font-weight: 700; }
  .ap-table td:nth-child(2) { display: block; order: -1; padding-bottom: .35rem; }
  .ap-act { text-align: start; padding-top: .5rem !important; }
  .ap-act .btn { width: 100%; }
}

/* the print page in an approval's copy: which copy, and the approval's own facts */
.pb-ver { display: flex; align-items: center; gap: .4rem; color: var(--primary); }
.pb-ver[hidden] { display: none; }
.pb-ver select { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .6rem; background: var(--card); color: var(--ink); font: inherit; font-size: .85rem; max-width: 300px; }
.brief-doc .ap-stamp { border: 2px solid var(--ok); border-radius: var(--r); padding: .7rem .9rem; margin: 0 0 1rem; display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; align-items: center; }
.brief-doc .ap-stamp > i { grid-row: span 2; font-size: 1.6rem; color: var(--ok); }
.brief-doc .ap-stamp b { font-size: .98rem; }
.brief-doc .ap-stamp span { font-size: .84rem; color: var(--ink-2); }
.brief-doc .ap-stamp.old { border-color: #c2410c; }
.brief-doc .ap-stamp.old > i { color: #c2410c; }
.brief-doc .ap-stamp .ap-old { grid-column: 1 / -1; color: #c2410c; font-weight: 700; font-size: .84rem; margin-top: .3rem; }
.brief-doc .sign.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media print {
  .brief-doc .ap-stamp { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- design viewing (رؤية التصميم, v28): designview.aspx, clientview.aspx — Scripts/designview.js ---------- */
.dv-page { max-width: 1180px; }
.pt-tracks { display: flex; gap: .6rem; margin: 0 0 1rem; flex-wrap: wrap; }
.pt-step { flex: 1 1 200px; display: flex; align-items: center; gap: .7rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .9rem; color: var(--ink); position: relative; }
a.pt-step:hover { border-color: var(--primary-2); }
.pt-step b { display: block; font-size: .92rem; }
.pt-step small { color: var(--muted); font-size: .78rem; }
.pt-ico { width: 36px; height: 36px; flex: none; border-radius: 999px; display: grid; place-items: center; background: #eef2f5; color: var(--ink-2); }
.pt-step.ok .pt-ico { background: var(--ok-bg); color: var(--ok); }
.pt-step.on .pt-ico { background: var(--tint); color: var(--primary); }
.pt-step.warn .pt-ico { background: var(--tint-accent); color: var(--accent); }
.pt-step.here { border-color: var(--sel-line); background: var(--sel-bg); box-shadow: var(--sel-sh); }
.pt-step.soon { border-style: dashed; background: transparent; }
.pt-step.soon b { color: var(--muted); }
.dv-client { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; border-radius: var(--r); padding: .65rem .9rem; margin-bottom: 1rem; font-size: .88rem; }
.dv-client > span { flex: 1 1 260px; min-width: 0; }
.dv-client.ok { background: var(--ok-bg); color: #13664a; }
.dv-client.warn { background: var(--warn-bg); color: #8a5a10; }
.dv-client.muted { background: #eef2f5; color: var(--ink-2); }
.dv-link { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; word-break: break-all; }
.dv-drop { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; border: 2px dashed #c5d3dc; border-radius: var(--r-lg); padding: 1.4rem 1rem; margin-bottom: 1.2rem; cursor: pointer; background: var(--card); color: var(--ink-2); transition: border-color .15s, background .15s; }
.dv-drop > i { font-size: 1.8rem; color: var(--primary-2); }
.dv-drop small { color: var(--muted); max-width: 560px; }
.dv-drop:hover, .dv-drop:focus-visible, .dv-drop.over { border-color: var(--primary-2); background: var(--tint); outline: none; }
.dv-round { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 1rem 1.1rem 1.1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.dv-round.force { border-color: var(--sel-line); }
.dv-round > header { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.dv-round h2 { font-size: 1.02rem; margin: 0 0 .2rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dv-round h2 > i { color: var(--primary-2); }
.dv-round header small { color: var(--muted); font-size: .8rem; }
.dv-chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
.dv-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; border-radius: 999px; padding: .18rem .6rem; background: #eef2f5; color: var(--ink-2); white-space: nowrap; }
.dv-chip.draft { background: var(--tint); color: var(--primary); }
.dv-chip.sent { background: #eef2f5; }
.dv-chip.seen { background: var(--ok-bg); color: var(--ok); }
.dv-chip.unseen { background: var(--tint-accent); color: #b5461a; }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.dv-file { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.dv-file.is-draft { border-style: dashed; }
.dv-file.uploading { opacity: .6; }
.dv-open { display: block; }
.dv-thumb { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--soft) center / cover no-repeat; color: var(--primary-2); font-size: 2.4rem; }
.dv-meta { padding: .6rem .7rem .2rem; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.dv-meta b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-meta small { color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-st { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; margin-top: .15rem; flex-wrap: wrap; }
.dv-st.draft { color: var(--primary); }
.dv-st.sent { color: #b5461a; }
.dv-st.seen { color: var(--ok); }
.dv-acts { display: flex; gap: .2rem; padding: .2rem .45rem .45rem; margin-top: auto; justify-content: flex-end; }
.dv-acts .icon-btn { width: 32px; height: 32px; }
.dv-del { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: var(--r-sm); cursor: pointer; }
.dv-del:hover { color: var(--bad); background: var(--bad-bg); }
.dv-none { margin: 0; }
.rq-view { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; font-size: .66rem; background: #eef2f5; color: var(--muted); }
.rq-view.sent { background: var(--tint-accent); color: var(--accent); }
.rq-view.seen { background: var(--ok-bg); color: var(--ok); }
/* the client portal's two tabs (Client.master) */
.cl-tabs { display: flex; gap: .25rem; margin-inline-start: .6rem; }
.cl-tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; font-size: .86rem; white-space: nowrap; }
.cl-tabs a:hover { background: var(--soft); }
.cl-tabs a.on { background: var(--sel-bg); color: var(--sel-ink); box-shadow: inset 0 0 0 1px var(--sel-line); }
.grants-one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) {
  .cl-tabs a span { display: none; }
  .pt-step { flex-basis: 100%; }
  .dv-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .dv-round > header .btn { width: 100%; }
}

/* ---------- the specifications (المواصفات, v29): specs.aspx, clientspecs.aspx, speclib.aspx — Scripts/specs.js, speclib.js ---------- */
.sp-page, .sl-page { max-width: 1180px; }
.sp-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); padding: .75rem 1rem; margin-bottom: 1rem; }
.sp-bar > div:first-child { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.sp-bar small { color: var(--muted); font-size: .8rem; }
.sp-acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.sp-level { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); padding: .75rem 1rem; margin-bottom: 1rem; position: sticky; top: calc(var(--top) + .5rem); z-index: 5; }
.sp-level > div:first-child { flex: 1 1 220px; display: flex; flex-direction: column; }
.sp-level small { color: var(--muted); font-size: .8rem; }
.sp-save { font-size: .8rem; color: var(--muted); min-width: 4rem; }
.sp-save.ok { color: var(--ok); } .sp-save.bad { color: var(--bad); }
.sp-cat { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: .9rem 1rem 1rem; margin-bottom: 1rem; }
.sp-cat > h2 { font-size: 1rem; margin: 0 0 .7rem; display: flex; align-items: center; gap: .5rem; }
.sp-cat > h2 small { font-size: .74rem; font-weight: 700; color: var(--muted); background: #eef2f5; border-radius: 999px; padding: .1rem .5rem; }
.sp-item { border-top: 1px solid var(--line-2); padding: .7rem 0; display: flex; flex-direction: column; gap: .4rem; }
.sp-cat > h2 + .sp-item { border-top: 0; padding-top: .2rem; }
.sp-item.out { opacity: .55; }
.sp-item-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sp-item-head > b { font-size: .92rem; }
.sp-item-head select { width: auto; padding: .3rem .5rem; font-size: .8rem; }
.sp-own-name { flex: 1 1 200px; width: auto !important; padding: .4rem .6rem !important; }
.sp-tools { margin-inline-start: auto; display: flex; align-items: center; gap: .3rem; }
.sp-in { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--ink-2); cursor: pointer; }
.sp-tag { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .12rem .55rem; background: var(--tint); color: var(--primary); }
.sp-tag.own { background: var(--tint-accent); color: #b5461a; }
.sp-asked { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; color: #13664a; background: var(--ok-bg); border-radius: 999px; padding: .12rem .55rem; }
.sp-text { margin: 0; color: var(--ink-2); font-size: .88rem; line-height: 1.7; }
.sp-item textarea { min-height: 64px; font-size: .88rem; }
.sp-note-in { font-size: .82rem; padding: .4rem .6rem !important; }
.sp-note { font-size: .8rem; color: var(--ink-2); display: flex; gap: .35rem; align-items: baseline; margin-top: .2rem; }
.sp-note i { color: var(--accent-2); }
.sp-out { color: var(--muted); font-size: .76rem; }
.sp-add { margin-top: .4rem; }
.sp-hist { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: .9rem 1rem; margin-bottom: 1rem; }
.sp-hist > h2 { font-size: 1rem; margin: 0 0 .6rem; display: flex; gap: .5rem; align-items: center; }
.sp-hist > h2 i { color: var(--primary-2); }
.sp-hrow { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; border-top: 1px solid var(--line-2); padding: .65rem 0; }
.sp-hrow small { display: block; color: var(--muted); font-size: .78rem; }
.sp-ack { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; background: var(--warn-bg); color: #8a5a10; border-radius: var(--r); padding: .75rem 1rem; margin-bottom: 1rem; }
.sp-ack > span { flex: 1 1 260px; }
.sp-ack.ok { background: var(--ok-bg); color: #13664a; }
.sp-print-bar { display: flex; gap: .5rem; justify-content: flex-end; margin-bottom: 1rem; }
.sp-doc { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 1.6rem 1.8rem; }
.sp-doc > header { text-align: center; margin-bottom: 1rem; }
.sp-doc > header h2 { margin: 0; font-size: 1.35rem; color: var(--primary); }
.sp-doc > header p { margin: .3rem 0 0; color: var(--ink-2); }
.sp-stamp { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1rem; border: 1.5px solid var(--primary-2); border-radius: var(--r); padding: .7rem 1rem; margin-bottom: 1.2rem; font-size: .86rem; }
.sp-stamp > div { display: flex; flex-direction: column; gap: .15rem; }
.sp-stamp.old { border-color: #c2410c; }
.sp-old { grid-column: 1 / -1; color: #c2410c; font-weight: 700; margin: .2rem 0 0; }
.sp-doc-cat h3 { font-size: .98rem; color: var(--primary); margin: 1rem 0 .4rem; border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.sp-doc-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.sp-doc-table th { text-align: start; font-size: .74rem; color: var(--muted); padding: .35rem .5rem; }
.sp-doc-table td { padding: .5rem; border-top: 1px solid var(--line-2); vertical-align: top; line-height: 1.7; }
.sp-doc-table td:first-child { width: 30%; }
.sp-doc-table td small { display: block; color: var(--muted); }
.sp-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.2rem; }
.sp-sign > div { display: flex; flex-direction: column; gap: .4rem; }
.sp-sign i { display: block; border-bottom: 1px solid var(--ink-2); height: 2.4rem; }
.sp-sign small { color: var(--muted); }
.rq-spec { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; font-size: .64rem; background: #eef2f5; color: var(--muted); }
.rq-spec.submitted { background: var(--warn-bg); color: var(--warn); }
.rq-spec.approved, .rq-spec.sent { background: var(--tint); color: var(--primary); }
.rq-spec.ack { background: var(--ok-bg); color: var(--ok); }
.sl-toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.sl-toolbar .search { flex: 1 1 260px; }
.sl-off { display: inline-flex; gap: .35rem; align-items: center; font-size: .86rem; color: var(--ink-2); }
.sl-item { border-top: 1px solid var(--line-2); padding: .7rem 0; }
.sl-item.off { opacity: .55; }
.sl-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sl-acts { margin-inline-start: auto; display: flex; gap: .2rem; }
.sl-grades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .4rem; }
.sl-grades small { font-weight: 700; color: var(--primary); font-size: .74rem; }
.sl-grades p { margin: .1rem 0 0; font-size: .82rem; color: var(--ink-2); line-height: 1.6; }
.dlg.sl-dlg { width: min(720px, 94vw); max-height: 90vh; overflow: auto; }
.sl-form { display: flex; flex-direction: column; gap: .7rem; }
.sl-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .84rem; font-weight: 700; color: var(--ink-2); }
.sl-form fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .7rem .7rem; display: grid; gap: .4rem; }
.sl-form legend { font-weight: 800; color: var(--primary); font-size: .84rem; padding: 0 .3rem; }
.sl-form textarea { min-height: 56px; }
/* v30: item forms (choices, a tick, a floor type, zones, gypsum levels) and the brief's spaces */
.sp-text.pre, .sp-doc-table td { white-space: pre-line; }
.sp-pick { align-items: center; gap: .35rem; }
.sp-pick .chip { padding: .32rem .8rem; font-size: .82rem; }
.sp-pick .chip i { font-size: .82rem; }
.sp-pick .chip[disabled] { cursor: default; }
.sp-lbl { font-size: .78rem; font-weight: 700; color: var(--muted); margin-inline-end: .2rem; }
.sp-req { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 700; color: var(--bad); }
.sp-item.miss { box-shadow: inset 3px 0 0 var(--bad); padding-inline-start: .6rem; }
[dir="rtl"] .sp-item.miss { box-shadow: inset -3px 0 0 var(--bad); }
.sp-check { font-weight: 700; }
.sp-item select.sp-floor { width: min(360px, 100%); padding: .35rem .55rem; font-size: .84rem; }
.sp-levels { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.sp-levels label { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.sp-levels select { width: auto; padding: .3rem .5rem; font-size: .82rem; }
.sp-units > h2 i { color: var(--primary-2); }
.sp-units-hint { font-size: .8rem; margin: -.3rem 0 .7rem; line-height: 1.7; }
.sp-utabs { margin-bottom: .6rem; gap: .35rem; }
.sp-utabs .chip { padding: .3rem .75rem; font-size: .8rem; }
.sp-utabs .chip b { font-size: .72rem; color: var(--muted); }
.sp-ugrp h3 { font-size: .86rem; color: var(--primary); margin: .7rem 0 .2rem; }
.sp-urow { display: grid; grid-template-columns: minmax(150px, 1.3fr) repeat(3, minmax(0, 1fr)) 34px; gap: .5rem; align-items: center; border-top: 1px solid var(--line-2); padding: .45rem 0; }
.sp-uhead { border-top: 0; padding: 0 0 .15rem; font-size: .72rem; font-weight: 700; color: var(--muted); }
.sp-urow.own { background: linear-gradient(90deg, transparent, var(--tint) 40%, transparent); }
.sp-uname { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-width: 0; }
.sp-uname b { font-size: .86rem; }
.sp-zone { font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .05rem .45rem; background: #eef2f5; color: var(--muted); }
.sp-zone.z-rooms { background: #eaf3ff; color: #2a5d8f; } .sp-zone.z-halls { background: #fff3e6; color: #a25a12; }
.sp-zone.z-service { background: #f1f1f4; color: #5b5b6b; } .sp-zone.z-wet { background: #e6f7f6; color: #1d6f6a; } .sp-zone.z-outdoor { background: #eef7e8; color: #3f6b1f; }
.sp-ucell { display: flex; flex-direction: column; gap: .1rem; min-width: 0; font-size: .82rem; }
.sp-ucell small { display: none; font-size: .7rem; color: var(--muted); font-weight: 700; }
.sp-ucell select { width: 100%; padding: .3rem .45rem; font-size: .8rem; }
.sp-ucell.own select { border-color: var(--sel-line); background: var(--sel-bg); color: var(--sel-ink); font-weight: 700; }
.sp-ufix { color: var(--muted); font-size: .8rem; }
.sp-doc-part td { background: #f4f7f9; font-weight: 800; color: var(--primary); }
.sp-doc-units td:first-child { width: 28%; }
@media (max-width: 760px) {
  .sp-urow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; }
  .sp-uname { grid-column: 1 / 3; }
  .sp-ureset { grid-column: 3; grid-row: 1; }
  .sp-ucell small { display: block; }
  .sp-uhead { display: none; }
  .sp-ucell:nth-of-type(4) { grid-column: 1 / 3; }
}
.sl-form-view { margin-top: .4rem; display: flex; flex-direction: column; gap: .2rem; align-items: flex-start; }
.sl-form-view p { margin: 0; font-size: .82rem; color: var(--ink-2); line-height: 1.6; }
.sl-form-view p.pre { white-space: pre-line; }
.sl-form-view small { font-weight: 700; color: var(--primary); }
/* the floor list (/template «أنواع الأرضيات») */
.dlg.sf-dlg { width: min(640px, 94vw); max-width: none; max-height: 90vh; overflow: auto; }
.sf-list { display: flex; flex-direction: column; gap: .35rem; margin: .6rem 0; }
.sf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: .4rem; align-items: center; }
.sf-row.off input[type=text] { opacity: .5; }
.sf-row input[type=text] { padding: .4rem .55rem; font-size: .86rem; }
@media (max-width: 560px) { .sf-row { grid-template-columns: minmax(0, 1fr) auto auto; } .sf-row input[dir=ltr] { grid-column: 1; } }
/* v31: fields items (choices / numbers / texts in a row), items left out by themselves, floor prices, the tender number, the booklet */
.sp-fields { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; margin: .15rem 0 .35rem; }
.sp-fields .chips { margin: 0; }
.sp-fnum, .sp-ftxt { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.sp-fnum input { width: 9.5rem; padding: .32rem .5rem; font-size: .84rem; }
.sp-ftxt input { width: min(280px, 70vw); padding: .32rem .5rem; font-size: .84rem; }
.sp-item.offx > .sp-item-head b, .sp-item.offx .sp-text { opacity: .55; }
.sp-tag.off { display: inline-flex; align-items: center; gap: .3rem; background: #f1f1f4; color: var(--muted); }
.sp-tender { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); padding: .7rem 1rem; margin-bottom: .8rem; }
.sp-tender > div:first-child { flex: 1 1 240px; display: flex; flex-direction: column; }
.sp-tender > div:first-child b { display: inline-flex; align-items: center; gap: .4rem; }
.sp-tender > div:first-child b i { color: var(--primary-2); }
.sp-tender small { color: var(--muted); font-size: .78rem; }
.sp-tender-in { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; font-weight: 800; color: var(--ink-2); }
.sp-tender-in input { padding: .32rem .4rem; font-size: .88rem; text-align: center; font-weight: 700; }
.sp-tender-in output { font-family: ui-monospace, Consolas, monospace; font-size: .86rem; color: var(--primary); margin-inline-start: .4rem; }
.sp-booklet { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-inline-start: .4rem; padding-inline-start: .6rem; border-inline-start: 1px solid var(--line-2); }
.sp-booklet > span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.sp-print-bar { flex-wrap: wrap; align-items: center; }
.sf-row.has-p { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 6.5rem 6.5rem auto auto; }
.sf-row select.sf-use { padding: .4rem .45rem; font-size: .84rem; }
.sp-stamp.draft { border-color: #d39a2c; background: #fff8ea; }
.sp-stamp.draft b { color: #9a5b00; }
.sp-draft-tag { font-size: .75rem; font-weight: 800; color: #9a5b00; background: #fff1d6; border: 1px solid #e8c27a; border-radius: 999px; padding: .1rem .6rem; vertical-align: middle; }
.sp-ver { display: inline-flex; align-items: center; gap: .35rem; } .sp-ver select { width: auto; padding: .35rem .5rem; font-size: .84rem; }
@media print { .sp-doc-draft .sp-stamp.draft { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.sl-booklet { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); padding: .75rem 1rem; margin-bottom: 1rem; }
.sl-booklet > div:first-child { flex: 1 1 320px; display: flex; flex-direction: column; gap: .15rem; }
.sl-booklet b { display: inline-flex; align-items: center; gap: .45rem; } .sl-booklet b i { color: #2b579a; }
.sl-booklet small { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.sl-booklet-acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.sf-row input.sf-p { padding: .4rem .45rem; font-size: .84rem; }
@media (max-width: 560px) { .sf-row.has-p { grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem auto auto; } .sf-row.has-p input[dir=ltr]:not(.sf-p) { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .sl-grades, .sp-stamp, .sp-sign { grid-template-columns: minmax(0, 1fr); }
  .sp-level { position: static; }
  .sp-doc { padding: 1rem; }
  .sp-doc-table td:first-child { width: 38%; }
}
/* 2026-11-25: the output bar — the version on one side, two output cards on the other (print/PDF · Word booklet) */
.sp-print-bar { justify-content: space-between; gap: .8rem; }
.sp-pb-side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sp-out { display: flex; gap: .6rem; flex-wrap: wrap; }
.sp-out-btn { display: inline-flex; align-items: center; gap: .7rem; text-align: start; text-decoration: none; cursor: pointer; font: inherit;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: var(--r); padding: .55rem .95rem; max-width: 330px;
  box-shadow: var(--sh-1); transition: border-color .15s, transform .15s; }
.sp-out-btn:hover { border-color: var(--primary-2); transform: translateY(-1px); }
.sp-out-btn > i { font-size: 1.35rem; flex: none; }
.sp-out-btn > span { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.sp-out-btn b { font-size: .92rem; }
.sp-out-btn small { font-size: .72rem; color: var(--muted); line-height: 1.45; }
.sp-out-btn.main { background: var(--primary); border-color: var(--primary); color: #fff; }
.sp-out-btn.main small { color: rgba(255, 255, 255, .78); }
.sp-out-btn.word > i { color: #2b579a; }
/* the printed page's letterhead: logo · title · printed on */
.sp-doc > header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; text-align: center; padding-bottom: .9rem; border-bottom: 2px solid var(--primary); }
.sp-logo { height: 46px; width: auto; justify-self: start; }
.sp-printed { justify-self: end; font-size: .74rem; color: var(--muted); }
.sp-doc-table thead th { background: #f4f7f9; }
.sp-wmark { display: none; }
@media (max-width: 640px) {
  .sp-out, .sp-out-btn { width: 100%; max-width: none; }
  .sp-doc > header { grid-template-columns: 1fr; } .sp-logo, .sp-printed { justify-self: center; }
}
@page specs { size: A4; margin: 14mm 13mm 16mm;
  @bottom-center { content: counter(page) " / " counter(pages); direction: ltr; unicode-bidi: isolate; font: 9pt sans-serif; color: #777; } }
@media print {
  .no-print, .sp-print-bar, .sp-ack { display: none !important; }
  .sp-page { max-width: none; padding: 0; page: specs; }
  .sp-doc { box-shadow: none; padding: 0; border-radius: 0; }
  .sp-doc, .sp-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sp-doc-table { font-size: 10pt; }
  .sp-doc-table th, .sp-doc-table td { border: 1px solid #cfd8de; }
  .sp-doc-table thead { display: table-header-group; }
  .sp-doc-table tr, .sp-stamp, .sp-sign { break-inside: avoid; }
  .sp-doc-cat h3 { break-after: avoid; }
  .sp-sign { margin-top: 1.6rem; }
  .sp-wmark { display: block; position: fixed; top: 45%; left: 0; right: 0; text-align: center; transform: rotate(-30deg);
    font-size: 46pt; font-weight: 900; white-space: nowrap; color: rgba(211, 154, 44, .13); pointer-events: none; z-index: 0; }
}
