/* Aumnia Digital Card — platform interface: registration, customer editor, Admin Panel (burgundy / gold, Cairo, RTL-first).
   Platform screens only: published cards and card previews are separate documents with their own styles and fonts.
   Cairo is declared in assets/css/fonts.css (self-hosted WOFF2, SIL OFL 1.1); El Messiri stays declared here for
   font-picker samples. */
@font-face {
  font-family: "El Messiri";
  src: url("../assets/fonts/ElMessiri-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --maroon-900: #3F0A14; --maroon-800: #4A0D17; --maroon-700: #5E111E; --maroon-600: #6E1423; --maroon-500: #8C1C2E;
  --maroon-50: #FBF4F5; --maroon-100: #F6E9EB;
  --gold-700: #8A6A24; --gold-600: #9C7A2E; --gold-500: #C9A14A; --gold-400: #D9B866; --gold-300: #E6CC85; --gold-100: #F7EFD9;
  --gold-grad: linear-gradient(135deg, #F3DFA2 0%, #C9A14A 45%, #9C7A2E 75%, #E6CC85 100%);
  --ink: #2A1A1D; --ink-2: #4B3B3E; --muted: #7D6D70; --line: #EEE4DE; --cream: #FBF8F4; --bg: #F6F1EC;
  --ok: #2E7D4F; --warn: #B7791F; --danger: #B3261E;
  --radius: 16px;
  --shadow: 0 10px 30px -14px rgba(74, 13, 23, .25), 0 2px 6px rgba(74, 13, 23, .05);
  --font: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2.5px solid var(--gold-500); outline-offset: 2px; border-radius: 8px; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; color: #fff;
  background: linear-gradient(165deg, var(--maroon-500), var(--maroon-800));
  border-bottom: 2px solid var(--gold-500);
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
/* official company logo (assets/img/aumnia-logo.png) */
.topbar__logo { width: 44px; height: 44px; flex: none; display: block; border-radius: 11px; box-shadow: 0 0 0 1.5px var(--gold-400), 0 4px 12px rgba(0, 0, 0, .22); }
.topbar__brand > div { min-width: 0; }
.topbar__title { font-size: 18px; font-weight: 700; }
.topbar__sub { font-size: 13px; color: var(--gold-300); }
/* platform title from the Admin brand-name setting (assets/js/brand.js): two lines where the name has a natural break */
.topbar__title--platform { font-size: 17px; font-weight: 700; line-height: 1.3; }
.topbar__title--platform .brandline { display: block; }
.topbar__title--platform .brandline--by { font-size: 13.5px; font-weight: 600; color: var(--gold-300); }
/* the page's own title and the signed-in account under the platform title */
.topbar__context { margin-top: 2px; font-size: 12.5px; color: rgba(255, 255, 255, .82); }
.topbar__context .topbar__page { display: inline; font-size: inherit; font-weight: 700; color: #fff; }
.topbar__context .topbar__sub { display: inline; font-size: inherit; color: inherit; overflow-wrap: anywhere; }
.topbar__context .topbar__sub:not(:empty)::before { content: " · "; }
@media (max-width: 400px) {
  .topbar__logo { width: 38px; height: 38px; border-radius: 10px; }
  .topbar__brand { gap: 10px; }
  .topbar__title--platform { font-size: 15.5px; }
  .topbar__title--platform .brandline--by { font-size: 12.5px; }
}
.topbar__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: var(--maroon-900); background: var(--gold-300); }
html[data-env="production"] .dev-chip { display: none; } /* development-only label */
.tbtn { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; }
.tbtn:hover { border-color: var(--gold-300); background: rgba(255, 255, 255, .18); }

/* status bar */
.statusbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); box-shadow: 0 6px 20px -16px rgba(74, 13, 23, .5);
}
.statusbar__info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.statusbar__pub { color: var(--muted); font-weight: 500; font-size: 13px; }
.statusbar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.is-dirty { background: var(--warn); box-shadow: 0 0 0 4px rgba(183, 121, 31, .18); }
.dot.is-draft { background: var(--gold-500); }
.dot.is-clean { background: var(--ok); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.btn--maroon { color: #fff; background: linear-gradient(150deg, var(--maroon-500), var(--maroon-800)); box-shadow: 0 8px 18px -10px rgba(110, 20, 35, .8); }
.btn--gold { color: var(--maroon-900); background: var(--gold-grad); box-shadow: 0 8px 18px -10px rgba(156, 122, 46, .9); }
.btn--ghost { color: var(--maroon-600); background: #fff; border-color: var(--gold-300); }
.btn--ghost:hover { background: var(--gold-100); }
.btn--danger { color: var(--danger); background: #fff; border-color: #E8B4B0; }
.btn--sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 10px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--maroon-600); }
.icon-btn:hover:not([disabled]) { border-color: var(--gold-400); background: var(--gold-100); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.icon-btn.danger { color: var(--danger); }
.icon-btn .ic { width: 17px; height: 17px; }

/* layout */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; max-width: 1180px; margin: 0 auto; padding: 20px; }
.sidecol { position: sticky; top: 76px; align-self: start; display: grid; gap: 12px; min-width: 0; }
.sidenav { display: grid; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.navbtn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 12px;
  border: 0; background: none; cursor: pointer; text-align: start; font-size: 15px; font-weight: 600; color: var(--ink-2);
}
.navbtn .ic { color: var(--gold-600); }
.navbtn:hover { background: var(--cream); }
.navbtn.is-active { background: linear-gradient(150deg, var(--maroon-500), var(--maroon-800)); color: #fff; }
.navbtn.is-active .ic { color: var(--gold-300); }
.navbtn .badge { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; display: grid; place-items: center; }

.main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; outline: none; }
.card { min-width: 0; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: var(--maroon-700); }
.card__title .ic { width: 22px; height: 22px; color: var(--gold-600); }
.card__desc { color: var(--muted); font-size: 14px; margin: -8px 0 16px; }
.subhead { font-size: 15px; font-weight: 700; color: var(--maroon-600); margin: 20px 0 10px; padding-top: 16px; border-top: 1px dashed var(--line); }
.subhead:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* fields */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field__label { font-size: 14px; font-weight: 700; color: var(--ink-2); display: flex; gap: 6px; align-items: baseline; }
.field__label .req { color: var(--danger); }
.field__hint { font-size: 12.5px; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lang-tag { font-size: 11px; font-weight: 700; color: var(--gold-700); background: var(--gold-100); border-radius: 6px; padding: 0 6px; margin-bottom: 2px; justify-self: start; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 11px; border: 1px solid #E4D8D2; background: #fff;
  font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201, 161, 74, .22); }
.input[dir="ltr"], .textarea[dir="ltr"] { text-align: left; }
.has-error .input, .has-error .textarea, .has-error .select, .input.has-error, .textarea.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.err { color: var(--danger); font-size: 12.5px; font-weight: 600; min-height: 0; }
.err:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--maroon-600); }

/* repeatable rows */
.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rowcard { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--cream); }
.rowcard.is-hidden { background: repeating-linear-gradient(-45deg, #fff, #fff 8px, var(--cream) 8px, var(--cream) 16px); }
.rowcard__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rowcard__num { font-weight: 700; color: var(--maroon-600); display: flex; align-items: center; gap: 8px; }
.rowcard__tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.svc-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--gold-300); background: linear-gradient(150deg, var(--maroon-500), var(--maroon-800)); }
.pill { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.pill--ok { color: var(--ok); background: #E6F4EC; }
.pill--warn { color: var(--gold-700); background: var(--gold-100); }
.pill--off { color: var(--muted); background: #EFEAE7; }

/* social */
.soc-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.soc-tile { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; }
.soc-tile .ic { width: 100%; height: 100%; }
/* official Aumnia logo: shown as is (own rounded shape and colours) */
.soc-tile.soc-tile--aum { border-radius: 0; overflow: visible; }
.soc-tile--aum img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* images */
.imgfield { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.imgprev { width: 96px; height: 96px; border-radius: 18px; border: 1px dashed var(--gold-400); background: var(--cream); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; }
.imgprev img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.imgprev--round { border-radius: 50%; }
.imgprev--round img { object-fit: cover; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* location */
.maplinks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 6px; }
.maplink { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); font-size: 13.5px; }
.maplink > span { min-width: 0; flex: 1; }
.maplink code { display: block; direction: ltr; text-align: left; unicode-bidi: isolate; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mapframe { width: 100%; height: 280px; border: 0; border-radius: 14px; margin-top: 10px; background: var(--cream); }

/* qr */
.qrwrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qrbox { width: 200px; height: 200px; padding: 12px; background: #fff; border-radius: 16px; border: 2px solid var(--gold-400); }
.qrbox svg { width: 100%; height: 100%; }

/* history */
.histlist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.hist { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); flex-wrap: wrap; }
.hist__v { font-weight: 700; color: var(--maroon-600); }
.hist__meta { font-size: 13px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--gold-100); border: 1px dashed var(--gold-400); font-size: 13.5px; color: var(--ink-2); }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(46, 7, 16, .45); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal__box { width: min(460px, 100%); background: #fff; border-radius: 20px; padding: 22px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); border-top: 4px solid var(--gold-500); }
.modal__box h2 { font-size: 19px; color: var(--maroon-700); margin-bottom: 8px; }
.modal__box p { color: var(--ink-2); white-space: pre-line; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; z-index: 60; bottom: 20px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px; background: var(--maroon-900); color: #fff; font-weight: 600; font-size: 14px; border: 1px solid rgba(230, 204, 133, .35); box-shadow: 0 16px 30px -12px rgba(46, 7, 16, .6); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
  .sidecol { display: contents; }
  .exbox { order: 3; }
  .sidenav { position: static; display: flex; overflow-x: auto; gap: 6px; padding: 8px; scrollbar-width: thin; }
  .navbtn { width: auto; white-space: nowrap; padding: 8px 12px; }
  .statusbar { padding: 10px 12px; }
  .statusbar__actions { width: 100%; }
  .statusbar__actions .btn { flex: 1; padding-inline: 8px; }
}
@media (max-width: 560px) {
  .pair, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .soc-tile { width: 44px; height: 44px; }
  .statusbar__info { font-size: 13px; }
  .card { padding: 16px; }
  .topbar { padding: 10px 12px; }
}

/* image positioning editor (same framing CSS as the public card: cover + inline focal point/zoom) */
.posed { margin-top: 14px; padding: 14px; border: 1px solid var(--line, #eadfca); border-radius: 14px; background: #fff; }
.posed__title { font-weight: 700; font-size: 14px; margin: 0 0 10px; }
.posed__body { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.posed__frame {
  position: relative; flex: none; width: 150px; height: 150px; border-radius: 50%; overflow: hidden;
  background: #fff; box-shadow: 0 0 0 2px var(--gold-400), 0 10px 24px -12px rgba(0, 0, 0, .45);
  cursor: grab; touch-action: none; user-select: none; outline-offset: 5px;
}
.posed__frame.is-dragging { cursor: grabbing; }
.posed__frame:focus-visible { outline: 2px solid var(--maroon-600); }
.posed__frame { isolation: isolate; }
.posed__frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.posed__ctls { flex: 1 1 200px; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.posed__ctl { display: grid; gap: 2px; width: 100%; font-size: 13px; font-weight: 600; }
.posed__ctl output { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.posed__ctl input[type="range"] { width: 100%; accent-color: var(--maroon-600); }
.toggle-field { padding: 12px 14px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line, #eadfca); }
.toggle-field .note { margin: 6px 0 0; }

.exbox { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 12.5px; color: var(--muted); box-shadow: var(--shadow); }
.exbox__attr { line-height: 1.7; }
.exbox__promo { margin-top: 10px; padding: 10px; border-radius: 12px; border: 1px dashed var(--gold-400); background: var(--cream); }
.exbox__title { font-weight: 700; color: var(--maroon-700); font-size: 13px; }
.exbox__note { font-size: 11.5px; margin-top: 2px; }
.exbox ul { margin: 6px 0 0; padding-inline-start: 18px; }
.exbox a { color: var(--maroon-600); font-weight: 600; overflow-wrap: anywhere; }

/* =========================================================================
   Platform editor (customer card): one page — form + live preview
   ========================================================================= */
.pl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; max-width: 1320px; margin: 0 auto; padding: 20px; align-items: start; }
.pl-form { display: grid; gap: 12px; min-width: 0; }
.pl-form .main { gap: 12px; }
.pl-preview { position: sticky; top: 72px; display: grid; gap: 8px; min-width: 0; }
.pl-preview__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--maroon-700); }
.pl-preview__head small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.pl-phone { border-radius: 30px; padding: 10px; background: #1b1416; box-shadow: var(--shadow); }
.pl-phone iframe { display: block; width: 100%; height: min(760px, calc(100vh - 170px)); border: 0; border-radius: 22px; background: #fff; }
.editor-banner { max-width: 1320px; margin: 12px auto 0; padding: 10px 16px; border-radius: 12px; background: var(--gold-100); border: 1px dashed var(--gold-500); color: var(--maroon-800); font-weight: 600; font-size: 14px; }
.pl-mobile-only { display: none; }

/* accordion sections */
.acc { padding: 0; }
.acc > summary { list-style: none; cursor: pointer; margin: 0; padding: 16px 20px; border-radius: var(--radius); }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: ""; width: 10px; height: 10px; border: solid var(--gold-600); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; margin-inline-start: auto; }
.acc[open] > summary::after { transform: rotate(-135deg); }
.acc[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.acc__body { padding: 16px 20px 20px; }
.card__title .badge { margin-inline-start: 6px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }

/* notices */
.notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--gold-100); border: 1px solid var(--gold-300); font-size: 14px; font-weight: 600; color: var(--maroon-800); }
.notice--new { background: #E9F5EE; border-color: #9FD3B4; color: #1F5C3A; }
.pill--new { color: #fff; background: var(--ok); }

/* design pickers */
.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl { display: grid; gap: 4px; align-content: start; text-align: start; padding: 8px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.tpl:hover { border-color: var(--gold-400); }
.tpl.is-on { border-color: var(--maroon-600); box-shadow: 0 0 0 3px rgba(110, 20, 35, .14); }
.tpl__name { font-weight: 700; font-size: 13.5px; color: var(--ink); line-height: 1.35; }
.tpl__desc { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.tpl .pill { justify-self: start; font-size: 11px; }
.tpl__mock { position: relative; display: block; height: 92px; border-radius: 10px; overflow: hidden; background: var(--b, #fff); border: 1px solid var(--line); }
.tpl__mock i { position: absolute; display: block; }
.tpl__mock .m-hero { inset: 0 0 auto 0; height: 46px; background: var(--p); }
.tpl__mock .m-logo { width: 24px; height: 24px; border-radius: 50%; left: calc(50% - 12px); top: 10px; background: #fff; box-shadow: 0 0 0 2px var(--s); }
.tpl__mock .m-row { left: 10px; right: 10px; top: 56px; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--p) 18%, transparent); }
.tpl__mock .m-row--2 { top: 73px; right: 40%; background: color-mix(in srgb, var(--s) 55%, transparent); }
.tpl__mock[data-hero="split"] .m-logo { left: 10px; border-radius: 6px; }
.tpl__mock[data-hero="minimal"] .m-hero { height: 44px; background: var(--b); border-bottom: 3px solid var(--s); }
.tpl__mock[data-hero="minimal"] .m-logo { box-shadow: 0 0 0 2px var(--p); }
.tpl__mock[data-hero="band"] .m-hero { height: 52px; clip-path: polygon(0 0, 100% 0, 100% 75%, 0 100%); }
.tpl__mock[data-hero="band"] .m-logo { border-radius: 4px; }
.tpl__mock[data-hero="cover"] .m-hero { height: 50px; background: linear-gradient(135deg, var(--p), var(--s)); }
.tpl__mock[data-hero="cover"] .m-logo { width: 30px; height: 30px; left: calc(50% - 15px); top: 30px; border-radius: 9px; }
.tpl__mock[data-actions="pills"] .m-row { border-radius: 999px; background: var(--p); opacity: .85; }
.tpl__mock[data-actions="list"] .m-row { height: 9px; }

.palgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pal { display: grid; gap: 6px; text-align: start; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; }
.pal.is-on { border-color: var(--maroon-600); box-shadow: 0 0 0 3px rgba(110, 20, 35, .14); }
.pal .pill { justify-self: start; font-size: 11px; }
.swatch { display: flex; height: 20px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.swatch i { flex: 1; }
.colorgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.colorf { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.colorf__in { display: flex; gap: 6px; align-items: center; }
.colorf input[type="color"] { width: 42px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; flex: none; }
.colorf .input { min-width: 0; font-family: Consolas, monospace; text-transform: uppercase; }
.fontlist { display: grid; gap: 8px; }
.fontopt { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.fontopt.is-on { border-color: var(--maroon-600); }
.fontopt input { accent-color: var(--maroon-600); width: 18px; height: 18px; }
.fontopt__name { font-weight: 700; font-size: 14px; }
.fontopt__sample { grid-column: 2 / -1; font-size: 17px; color: var(--ink-2); }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.check--block { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.check--block small { color: var(--muted); font-weight: 500; }
.linkbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); }
.linkbox code { font-size: 14px; font-weight: 700; color: var(--maroon-700); overflow-wrap: anywhere; flex: 1 1 200px; }

@media (max-width: 1100px) {
  .pl-layout { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .pl-preview { display: none; }
  .pl-mobile-only { display: inline-flex; }
  body.show-preview .pl-preview { display: grid; position: fixed; inset: 0; z-index: 70; padding: 12px; background: rgba(20, 10, 12, .72); align-content: start; overflow: auto; }
  body.show-preview .pl-preview__head { color: #fff; }
  body.show-preview .pl-preview__head small { color: rgba(255, 255, 255, .75); }
  body.show-preview .pl-phone { max-width: 440px; width: 100%; margin: 0 auto; }
  body.show-preview .pl-phone iframe { height: calc(100vh - 120px); }
  body.show-preview .pl-close { display: inline-flex; }
}
.pl-close { display: none; }
@media (max-width: 560px) {
  .acc > summary { padding: 14px 16px; }
  .acc__body { padding: 14px 16px 16px; }
  .tplgrid, .palgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .colorgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* sign-in / registration screens */
.auth { max-width: 460px; margin: 40px auto; padding: 0 16px; }
.auth .card { display: grid; gap: 14px; }
.auth h2 { font-size: 21px; color: var(--maroon-700); }
/* registration: Company Card / Individual Card choice (same card, border and colour language as the rest of the page) */
.typechoices { display: grid; gap: 12px; }
.typechoice { display: grid; gap: 6px; text-align: start; padding: 16px 18px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--cream); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.typechoice b { font-size: 17px; color: var(--maroon-700); }
.typechoice span { font-size: 14px; color: var(--muted); line-height: 1.6; }
.typechoice:hover, .typechoice:focus-visible { border-color: var(--gold-500); box-shadow: 0 0 0 3px var(--gold-100); }
/* company dashboard: employee cards (reuses rows, pills, fields and buttons) */
.empform { display: grid; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.emplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.locked-note { margin-bottom: 12px; }
/* company owner: switch between the company card and employee cards (top bar) */
.cardswitch { display: inline-flex; }
.cardswitch .select { width: auto; max-width: 240px; min-height: 36px; padding: 6px 10px; font-size: 13px; color: var(--ink); background-color: #fff; border-radius: 999px; }
.typechosen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.auth__alt { text-align: center; font-size: 14px; color: var(--muted); }
.auth__alt a { color: var(--maroon-600); font-weight: 700; }
.testcode { padding: 12px 14px; border-radius: 12px; border: 2px dashed var(--warn); background: #FFF7E6; color: #6B4A0D; font-size: 14px; }
.testcode b { font-family: Consolas, monospace; font-size: 22px; letter-spacing: .2em; direction: ltr; display: inline-block; }
.formerr { color: var(--danger); font-weight: 600; font-size: 14px; }
.formok { color: var(--ok); font-weight: 600; font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 4px; color: var(--maroon-600); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
/* registration honeypot: removed from layout and from assistive technology */
.hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; } /* no off-screen offset: that scrolls sideways in RTL */

/* image fields: instant preview, upload progress, camera shortcut on touch devices (shared by both editors) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.only-touch { display: none; }
@media (pointer: coarse) { .only-touch { display: inline-flex; } }
.imgfield__btns { flex-wrap: wrap; }
.imgbtn { position: relative; }
.imgprev { position: relative; }
.imgprev.is-busy img { opacity: .7; }
.imgprog { position: absolute; inset: auto 0 0 0; display: grid; gap: 4px; padding: 6px 8px; background: rgba(46, 7, 16, .74); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.imgprev--round .imgprog { inset: 0; place-content: center; border-radius: 50%; }
.imgprog[hidden] { display: none; }
.imgprog__bar { display: block; width: 100%; min-width: 60px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.imgprog__bar i { display: block; height: 100%; width: 0; background: var(--gold-400); transition: width .2s; }
.upstat:empty { display: none; }

/* primary contact buttons (contacts.primary): choose + order with real buttons (works with touch, keyboard, VoiceOver) */
.pb { display: grid; gap: 8px; }
.pb-sub { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--ink-2, #4a3f3b); }
.pb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pb-row--off { background: transparent; border-style: dashed; }
.pb-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--maroon-600); color: #fff; }
.pb-ico .ic { width: 20px; height: 20px; }
.pb-ico--soc { background: none; }
.pb-ico--soc .ic { width: 100%; height: 100%; }
.pb-main { flex: 1 1 140px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pb-name { overflow-wrap: anywhere; }
.pb-tools { display: flex; gap: 6px; margin-inline-start: auto; }
.pb .pb-tools .icon-btn, .pb .pb-tools .btn.pb-toggle { min-width: 44px; min-height: 44px; }
.pb-tools .icon-btn:disabled { opacity: .35; cursor: default; }
.pb-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(64px, calc((100% - 24px) / 4)), 1fr)); gap: 8px; }
.pb-chip { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 14px; font-size: 12px; font-weight: 600; text-align: center; overflow-wrap: anywhere; min-width: 0; }
.pb-legacy { background: var(--gold-100, #FBF3DD); border-radius: 10px; padding: 8px 10px; }

/* phone / WhatsApp number: country selector physically on the LEFT, digits LTR — in Arabic and English alike */
.phonein { direction: ltr; unicode-bidi: isolate; display: flex; align-items: stretch; gap: 0; width: 100%; min-width: 0; }
.phonein__cc { direction: ltr; unicode-bidi: isolate; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 10px;
  border: 1px solid #E4D8D2; border-right: 0; border-radius: 11px 0 0 11px; background: var(--cream); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.phonein__cc:focus-visible { outline: 2px solid var(--maroon-600); outline-offset: 1px; position: relative; z-index: 1; }
.phonein__flag { font-size: 20px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.phonein__code { direction: ltr; unicode-bidi: isolate; font-weight: 700; font-variant-numeric: tabular-nums; }
.phonein__iso { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.phonein__caret { font-size: 10px; color: var(--muted); }
.phonein .phonein__num { direction: ltr; unicode-bidi: isolate; text-align: left; flex: 1 1 auto; min-width: 0; border-radius: 0 11px 11px 0; font-variant-numeric: tabular-nums; }
body.m-mode .phonein__cc { min-height: 48px; font-size: 15px; }

/* country picker sheet (bottom sheet on phones, centred panel on wider screens) */
.ccpick { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.ccpick__backdrop { position: absolute; inset: 0; background: rgba(42, 26, 29, .45); }
.ccpick__panel { position: relative; width: 100%; max-width: 520px; max-height: min(78vh, 640px); display: flex; flex-direction: column; gap: 10px;
  background: #fff; border-radius: 18px 18px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px -12px rgba(0, 0, 0, .35); }
@media (min-width: 821px) { .ccpick { align-items: center; } .ccpick__panel { border-radius: 18px; } }
.ccpick__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ccpick__close { width: 44px; height: 44px; }
.ccpick__search { font-size: 16px; min-height: 46px; }
.ccpick__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; direction: ltr; }
.ccpick__row { direction: ltr; unicode-bidi: isolate; width: 100%; display: grid; grid-template-columns: 28px 64px 34px minmax(0, 1fr); align-items: center; gap: 8px;
  min-height: 46px; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.ccpick__row:hover, .ccpick__row:focus-visible { background: var(--cream); }
.ccpick__row.is-sel { background: var(--gold-100); font-weight: 700; }
.ccpick__code { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; font-weight: 700; }
.ccpick__name { unicode-bidi: isolate; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccpick__none { padding: 16px; color: var(--muted); text-align: center; }
/* registration: campaign offer explained before registering (Phase 3) */
.typechoice .offer { display: grid; gap: 3px; margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--gold-100); border: 1px dashed var(--gold-400); }
.note .offer { display: grid; gap: 3px; }
.offer b { font-size: 14px; color: var(--maroon-700); }
.offer span { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.typechoice .offer--off { display: block; background: #EFEAE7; border-style: solid; color: var(--muted); }
.typechoice:disabled { opacity: .75; cursor: not-allowed; }
.typechoice:disabled:hover { border-color: var(--line); box-shadow: none; }

/* password field with a visibility toggle (assets/js/pwtoggle.js) — logical properties for RTL / LTR */
.pwwrap { position: relative; display: block; }
.pwwrap .input { padding-inline-end: 52px; }
.pwbtn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted, #6E615C); cursor: pointer; }
.pwbtn:hover { color: var(--maroon-600, #6E1423); }
.pwbtn:focus-visible { outline: 3px solid var(--gold-500, #C9A25B); outline-offset: 1px; }
.remember { margin: 2px 0 4px; }
.acct-card + .acct-card { margin-top: 16px; }

/* registration: required acceptance of the Privacy Policy and Terms of Use (works in RTL and LTR) */
.consent { margin: 4px 0 2px; }
.consent__label { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.7; cursor: pointer; }
.consent__label input { flex-shrink: 0; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--maroon-600, #6E1423); cursor: pointer; }
.consent__label a { color: var(--maroon-600, #6E1423); font-weight: 700; text-decoration: underline; }
.consent .err { display: block; margin-top: 4px; }
