/* Studio panels: Design, Sections, Details and the photo picker. Built on the tokens and components in
   studio.css sections 1-7. Logical properties throughout so everything mirrors for Arabic. */

/* ---------- frame ---------- */
.pn { position: relative; display: flex; flex-direction: column; min-height: 100%; color: var(--ui-ink); font-size: 14px; }
.pn-body { display: flex; flex-direction: column; gap: 28px; padding: 20px 20px 56px; }
.pn.is-busy .pn-body { pointer-events: none; }
.pn-busy {
  position: sticky; inset-block-start: 0; z-index: 4; display: flex; align-items: center; gap: 10px;
  margin: 12px 16px 0; padding: 10px 14px; border-radius: 999px;
  background: var(--ui-navy); color: var(--ui-cream); font-size: 13.5px; box-shadow: var(--ui-shadow);
}
.pn-busy[hidden] { display: none; }
@media (max-width: 899px) { .pn-h2 { display: none; } } /* the phone sheet's own h2 names the panel there */
.pn-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(241, 238, 230, .3); border-block-start-color: var(--ui-ac); animation: pn-spin .8s linear infinite; flex: none; }
@keyframes pn-spin { to { transform: rotate(360deg); } }

/* ---------- groups and shared bits ---------- */
.pn-g { display: flex; flex-direction: column; gap: 12px; }
.pn-g + .pn-g { padding-block-start: 24px; border-block-start: 1px solid var(--ui-line); }
.pn-gh { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.pn-gt { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.pn-gv { font-size: 13px; color: var(--ui-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-gd { margin: -4px 0 2px; font-size: 13px; color: var(--ui-ink2); line-height: 1.5; }
.pn-sub { font-size: 12.5px; font-weight: 500; color: var(--ui-ink3); margin-block: 4px -2px; }
.pn-ctl { display: flex; flex-direction: column; gap: 8px; }
.pn-ctl-l { font-size: 13px; font-weight: 600; }
.pn-ctl[hidden], .dz-artoff[hidden] { display: none; }
.pn-ctl-h { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ui-ink3); }
.dz-artctl { display: flex; flex-direction: column; }
.dz-artoff { padding: 12px 14px; border-radius: 13px; border: 1px dashed var(--ui-line-2); background: var(--ui-card); }
.dz-artgo { align-self: flex-start; margin-block-start: 2px; }
.pn-linkbtn {
  display: inline; padding: 0; border: 0; background: none; color: var(--ui-ac-strong); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer;
}
.pn-linkbtn:hover { color: var(--ui-navy); }
.pn-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 1px dashed var(--ui-line-2); border-radius: var(--ui-r); color: var(--ui-ink2); text-align: center; }
.pn-empty p { margin: 0; font-size: 13px; }
.pn-empty.sm { padding: 14px; font-size: 13px; }
.pn-empty[hidden] { display: none; }
.pn-tick {
  position: absolute; inset-block-start: 6px; inset-inline-end: 6px; display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--ui-navy); color: var(--ui-cream);
  opacity: 0; transform: scale(.6); transition: opacity .18s var(--ui-ease), transform .18s var(--ui-ease); pointer-events: none;
}
[aria-pressed="true"] > .pn-tick, [aria-pressed="true"] > * > .pn-tick { opacity: 1; transform: none; }
.pn-tip, .pn-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--ui-ink2); }
.pn-tip .ico, .pn-warn .ico { margin-block-start: 1px; }
.pn-warn { padding: 8px 10px; border-radius: var(--ui-r-sm); background: rgba(255, 196, 107, .18); color: #6B4A12; }
.pn-warn .ico { color: #A9741A; }
.pn-fb { font-size: 12.5px; color: var(--ui-ac-strong); }
.pn-fb[hidden] { display: none; }
/* "Arabic not updated" (UX-11): calm, specific, with the fix one tap away. */
.pn-drift {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--ui-r-sm);
  background: var(--ui-ac-soft); color: var(--ui-ink); font-size: 13px; line-height: 1.45;
}
.pn-drift[hidden] { display: none; }
.pn-drift > .ico { margin-block-start: 2px; color: var(--ui-ac-strong); }
.pn-drift .pn-linkbtn { color: var(--ui-ink); }
.pn-sep { color: var(--ui-ink2); }
.sx-stale { color: var(--ui-ac-strong); font-weight: 500; }
.pn-art { display: grid; place-items: center; color: rgba(255, 255, 255, .92); }
.pn-art .ico { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
/* Arabic words inside an English interface (language names) get the Arabic face at a readable size;
   English and code-like fields keep the Latin face inside the Arabic interface. Arabic small print
   needs a little more size than Latin to stay legible. */
.pn input[dir="ltr"], .pn textarea[dir="ltr"] { font-family: var(--ui-font); }
html[lang="ar"] .pn :lang(en):not(input):not(textarea) { font-family: var(--ui-font); }
html[lang="ar"] .pn :is(.sx-sub, .sx-lay-t, .sx-it-name) { font-size: 13.5px; }
html[lang="ar"] .pn :is(.fld-l, .pn-ctl-l, .sx-lbl) { font-size: 14px; }
.pn :lang(ar):not(input):not(textarea) { font-family: var(--ui-font-ar); }
/* Arabic reading text (hints, descriptions, notes) uses the controls' face (F12), at 13.5px: one Arabic
   family across the whole form, never under 13px. */
html[lang="ar"] :is(.pn, .pp) :is(.fld-h, .pn-gd, .pn-sub, .pn-ctl-h, .dz-mood, .dz-note, .dz-font-m, .sx-addk-t span, .pn-fb, .pn-sw-h, .sx-photo-t span, .sx-addnote, .pn-tip, .pn-warn, .pn-drift, .pn-sample-t p, .pn-empty, .pp-own-t p, .pp-art-t span, .pp-count,
  .sg-what, .sg-need, .sg-hint, .on-warn, .on-now, .on-unsure, .id-from, .id-t, .id-later, .id-done, .id-none, .sx-lay-h) {
  font-family: var(--ui-font-ar); font-size: 13.5px; line-height: 1.6;
}
/* Their inline parts (sentences, links) too. */
html[lang="ar"] :is(.pn, .pp) :is(.pn-drift, .pn-tip, .pn-warn, .pn-empty, .dz-note, .pn-sw-h, .pn-ctl-h, .fld-h, .sg-need, .sg-hint, .on-warn, .on-now, .id-done, .id-needs, .sx-lay-h) :is(span, button, p) { font-family: var(--ui-font-ar); font-size: inherit; }
html[lang="ar"] :is(.pn, .pp) :is(.fld-c .fld-l, .sx-sub, .sx-lbl-v, .sx-lay-t, .sx-cta .fld-l, .sx-it-name, .dt-same, .pp-cap, .pp-used, .pp-art-t span, .sg-seen, .id-k, .id-src, .id-count, .sx-count, .on-pill) { font-size: 13px; }
html[lang="ar"] .pn :is(.id-k, .sg-seen, .id-src) { letter-spacing: 0; line-height: 1.55; }
.pn .seg-b span:lang(ar) { font-size: 1.08em; }
.pn-toast { display: inline-flex; align-items: center; gap: 14px; }
.pn-undo {
  padding: 4px 10px; border: 1px solid rgba(241, 238, 230, .35); border-radius: 999px; background: transparent;
  color: var(--ui-cream); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
}
.pn-undo:hover { background: rgba(241, 238, 230, .12); }
.pn-undo:focus-visible { outline-color: var(--ui-ac); }
.pn-ta { min-height: 64px; field-sizing: content; max-height: 360px; }
.fld-c .fld-l { font-size: 12.5px; font-weight: 500; color: var(--ui-ink2); }
.fld-c .input, .fld-c .textarea { min-height: 38px; padding: 7px 11px; font-size: 14px; }
.fld-c .textarea { min-height: 56px; }
.is-flash { animation: pn-flash 1.8s var(--ui-ease); border-radius: var(--ui-r-sm); }
@keyframes pn-flash {
  0%, 60% { box-shadow: 0 0 0 4px var(--ui-ac-soft), 0 0 0 8px rgba(31, 181, 173, .18); background: rgba(31, 181, 173, .07); }
  100% { box-shadow: 0 0 0 0 transparent; background: transparent; }
}

/* Switch */
.pn-swrow { display: flex; align-items: flex-start; gap: 12px; }
.pn-sw-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(37, 211, 102, .14); color: #128C4B; flex: none; }
.pn-sw-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pn-sw-t { font-weight: 600; font-size: 14.5px; }
.pn-sw-h { font-size: 13px; color: var(--ui-ink2); line-height: 1.45; }
.pn-switch {
  position: relative; flex: none; width: 44px; height: 26px; margin-block-start: 4px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(12, 35, 64, .22); cursor: pointer; transition: background-color .2s var(--ui-ease);
}
.pn-switch-k {
  position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(12, 35, 64, .3); transition: transform .22s var(--ui-ease);
}
.pn-switch[aria-checked="true"] { background: var(--ui-ac-strong); }
.pn-switch[aria-checked="true"] .pn-switch-k { transform: translateX(18px); }
[dir="rtl"] .pn-switch[aria-checked="true"] .pn-switch-k { transform: translateX(-18px); }

/* Full-width segmented controls */
.pn-seg .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.pn-seg .seg-b { padding-inline: 8px; min-width: 0; }
.pn-seg .seg-b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-seg-3 .seg { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); border-radius: 16px; }
.pn-seg-3 .seg-b { border-radius: 13px; }
.pn-seg .seg-b .ico { opacity: .7; }
.pn-seg .seg-b[aria-checked="true"] .ico { opacity: 1; }

/* Menu (row ⋯) */
.pn-menu {
  position: fixed; z-index: 900; min-width: 200px; padding: 6px; border-radius: var(--ui-r);
  background: var(--ui-card); border: 1px solid var(--ui-line); box-shadow: var(--ui-shadow-lg);
  animation: m-rise .16s var(--ui-ease); font-family: var(--ui-font);
}
html[lang="ar"] .pn-menu { font-family: var(--ui-font-ar); }
.pn-menu-i {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px;
  background: none; color: var(--ui-ink); font: inherit; font-size: 14px; text-align: start; cursor: pointer;
}
.pn-menu-i:hover:not([disabled]) { background: rgba(12, 35, 64, .06); }
.pn-menu-i:focus-visible { background: rgba(12, 35, 64, .06); outline: none; box-shadow: inset 0 0 0 2px var(--ui-ac-strong); }
.pn-menu-i[disabled] { opacity: .4; cursor: default; }
.pn-menu-i.is-danger { color: var(--ui-danger); }
.pn-menu-sep { height: 1px; margin: 5px 6px; background: var(--ui-line); }

/* ---------- Design panel ---------- */
.dz-surprise { gap: 6px; }
.dz-dirs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dz-card {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 5px 5px 10px; border: 1px solid var(--ui-line); min-width: 0;
  border-radius: 16px; background: var(--ui-card); text-align: start; cursor: pointer; color: inherit;
  transition: border-color .18s var(--ui-ease), box-shadow .18s var(--ui-ease), transform .18s var(--ui-ease);
}
.dz-card:hover { border-color: var(--ui-line-2); box-shadow: var(--ui-shadow); transform: translateY(-1px); }
.dz-card[aria-pressed="true"] { border-color: var(--ui-navy); box-shadow: 0 0 0 1px var(--ui-navy), var(--ui-shadow); }
.dz-artwrap { position: relative; display: block; margin-block-end: 6px; }
.dz-art {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 78px; padding: 10px 12px;
  border-radius: 11px; box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .08); overflow: hidden;
}
/* The owner's own page in that style: the top of a desktop render, scaled into the card. */
.dz-thumb { display: block; height: auto; padding: 0; }
.dz-thumb .thumb { border-radius: inherit; }
.dz-thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .1); pointer-events: none; }
.dz-aa { font-size: 32px; line-height: 1; white-space: nowrap; }
.dz-dots { display: flex; padding-block-end: 3px; }
.dz-dots i { width: 13px; height: 13px; border-radius: 50%; }
.dz-dots i + i { margin-inline-start: -3px; }
.dz-name { padding-inline: 6px; font-weight: 600; font-size: 14px; }
.dz-mood { padding-inline: 6px; font-size: 12.5px; line-height: 1.4; color: var(--ui-ink3); } /* the whole line: it is how the styles differ */

.dz-pals { display: flex; flex-direction: column; gap: 10px; }
.dz-swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.dz-sw {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; cursor: pointer; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .14); transition: transform .16s var(--ui-ease), box-shadow .16s var(--ui-ease);
}
.dz-sw:hover { transform: translateY(-1px); }
.dz-sw i { position: absolute; inset-inline-start: 20%; border-radius: 2px; }
.dz-sw-h { inset-block-start: 24%; width: 52%; height: 4px; }
.dz-sw-t { inset-block-start: 40%; width: 36%; height: 3px; opacity: .8; }
.dz-sw-b { inset-block-end: 20%; width: 42%; height: 9px; border-radius: 5px !important; }
.dz-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ui-panel), 0 0 0 4px var(--ui-navy); }
.dz-sw .pn-tick { inset-block-start: 4px; inset-inline-end: 4px; width: 16px; height: 16px; }
.dz-sw:focus-visible { outline-offset: 3px; }

.dz-brandwrap { margin-block-start: 6px; }
.dz-brand { display: flex; align-items: center; gap: 10px; }
.dz-color {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .18), 0 1px 2px rgba(12, 35, 64, .1);
}
.dz-color:focus-within { outline: 3px solid var(--ui-ac-strong); outline-offset: 2px; }
.dz-color-in { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); padding: 0; border: 0; opacity: 0; cursor: pointer; }
.dz-hex { flex: 0 1 140px; width: 140px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.dz-hex::placeholder { text-transform: uppercase; color: var(--ui-ink3); }
.dz-brand.fld-err .dz-hex { border-color: var(--ui-danger); }
.dz-brand .btn[hidden] { display: none; }
.dz-note { margin: 0; font-size: 12.5px; color: var(--ui-ink2); line-height: 1.5; }
.dz-brand.fld-err + .dz-note { color: var(--ui-danger); }
.dz-fitdot { display: inline-block; width: 11px; height: 11px; margin-inline-end: 6px; border-radius: 50%; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .2); }

.dz-fonts { display: flex; flex-direction: column; gap: 8px; }
.dz-font {
  position: relative; display: flex; flex-direction: column; gap: 3px; width: 100%; padding-block: 11px; padding-inline: 14px 40px;
  border: 1px solid var(--ui-line); border-radius: 13px; background: var(--ui-card); text-align: start; cursor: pointer; color: inherit;
  transition: border-color .18s var(--ui-ease), box-shadow .18s var(--ui-ease);
}
.dz-font:hover { border-color: var(--ui-line-2); }
.dz-font[aria-pressed="true"] { border-color: var(--ui-navy); box-shadow: 0 0 0 1px var(--ui-navy); }
.dz-font .pn-tick { inset-block-start: 50%; inset-inline-end: 12px; margin-block-start: -10px; }
.dz-font-s { font-size: 22px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ui-ink); text-align: match-parent; }
.dz-font-m { font-size: 12.5px; color: var(--ui-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-artdot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .18); flex: none; }
.dz-artdot.is-none { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(12, 35, 64, .25) 3px 4px) !important; }

/* ---------- Design panel: the Forge Atlas (section 12) ---------- */

/* Ideas for your business: the one tinted card in the panel, so it reads as advice, not a control. */
.id-card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 6px; border-radius: 18px;
  background: linear-gradient(165deg, rgba(31, 181, 173, .11), rgba(31, 181, 173, .02) 62%), var(--ui-card);
  border: 1px solid rgba(18, 124, 119, .22);
}
.id-head { display: flex; align-items: flex-start; gap: 12px; padding-block-end: 8px; }
.id-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--ui-navy); color: var(--ui-ac); }
.id-htxt { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-block-start: 1px; }
.id-htxt .pn-gt { min-height: 0; }
.id-from { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ui-ink2); }
.id-list { display: flex; flex-direction: column; }
.id-i { display: flex; flex-direction: column; gap: 4px; padding-block: 13px; border-block-start: 1px solid rgba(12, 35, 64, .1); }
.id-k { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--ui-ac-strong); }
.id-t { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ui-ink); }
.id-src { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--ui-ink3); }
.id-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-block-start: 6px; }
.id-act-row { flex-wrap: nowrap; align-items: flex-end; justify-content: space-between; margin-block-start: 2px; }
.id-act-row .id-src { flex: 1; min-width: 0; padding-block-end: 2px; }
.id-later { flex: 1 1 150px; font-size: 12.5px; line-height: 1.45; color: var(--ui-ink2); }
.id-apply, .id-send { flex: none; gap: 6px; }
.id-apply .ico { color: var(--ui-ac-strong); }
.id-done {
  display: flex; gap: 8px; align-items: flex-start; margin-block-start: 6px; padding: 10px 12px; border-radius: var(--ui-r-sm);
  background: rgba(30, 122, 79, .09); color: var(--ui-ink); font-size: 13px; line-height: 1.45;
  animation: sx-open .22s var(--ui-ease);
}
.id-done > .ico { color: var(--ui-ok); margin-block-start: 1px; }
.id-done:focus-visible { outline: 3px solid var(--ui-ac-strong); outline-offset: 2px; }
.id-done-t { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.id-done-t p { margin: 0; }
.id-warn { margin-block-start: 4px; }
.id-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 4px 6px; border-block-start: 1px solid rgba(12, 35, 64, .1); }
.id-foot:empty { display: none; }
.id-more { gap: 6px; margin-inline-start: -10px; color: var(--ui-ac-strong); font-weight: 600; }
[dir="rtl"] .id-more .ico { transform: scaleX(-1); }
.id-count { font-size: 12.5px; color: var(--ui-ink3); font-variant-numeric: tabular-nums; }
.id-none { margin: 0; padding-block: 12px 10px; border-block-start: 1px solid rgba(12, 35, 64, .1); font-size: 13px; line-height: 1.5; color: var(--ui-ink2); }
/* What the other ideas wait for, with the way to add each one. */
.id-needs p { margin: 0; }
.id-needs-a { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 10px; }
.id-needs-a .btn { gap: 6px; }

/* Signature: one radio per move. The radio covers its card, so the whole card is the target. */
.sg-list { display: flex; flex-direction: column; gap: 8px; }
.sg-opt {
  position: relative; border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-card);
  transition: border-color .18s var(--ui-ease), box-shadow .18s var(--ui-ease);
}
.sg-opt:hover { border-color: var(--ui-line-2); }
.sg-opt.is-on { border-color: var(--ui-navy); box-shadow: 0 0 0 1px var(--ui-navy); }
.sg-opt:has(.sg-in:focus-visible) { outline: 3px solid var(--ui-ac-strong); outline-offset: 2px; }
.sg-in { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sg-in:disabled { cursor: not-allowed; }
/* The tile beside the name and what the move does; where it was seen runs the card's full width below. */
.sg-lab {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "tile name" "tile what" "seen seen";
  column-gap: 12px; padding: 10px; padding-inline-end: 12px;
}
.sg-lab > .sg-tile { grid-area: tile; }
.sg-name { grid-area: name; align-self: end; padding-block-start: 5px; padding-inline-end: 28px; font-size: 14px; font-weight: 600; line-height: 1.3; }
/* The whole sentence, wrapped, on every option (B05, B20): owners compare the moves before choosing one. */
.sg-what { grid-area: what; align-self: start; margin-block-start: 2px; font-size: 12.5px; line-height: 1.45; color: var(--ui-ink2); overflow-wrap: break-word; }
.sg-seen { grid-area: seen; margin-block-start: 8px; font-size: 11.5px; line-height: 1.4; color: var(--ui-ink3); }
.sg-opt .pn-tick { inset-block-start: 13px; inset-inline-end: 12px; }
.sg-opt.is-on .pn-tick { opacity: 1; transform: none; }
.sg-opt.is-off { border-style: dashed; background: transparent; }
.sg-opt.is-off .sg-tile { opacity: .5; filter: saturate(.3); }
.sg-opt.is-off .sg-name { color: var(--ui-ink2); }
.sg-need, .sg-hint {
  position: relative; z-index: 2; display: flex; gap: 8px; align-items: flex-start; margin: -2px 12px 11px 10px; margin-inline: 10px 12px;
  font-size: 12.5px; line-height: 1.45; color: var(--ui-ink);
}
.sg-need > .ico, .sg-hint > .ico { flex: none; margin-block-start: 1px; color: var(--ui-ac-strong); }
.sg-hint[hidden] { display: none; }
/* The tiles: each move drawn small in the site's own colours and type. */
.sg-tile {
  position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 11px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .1);
}
.sg-tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .1); pointer-events: none; }
.sg-aa { font-size: 23px; line-height: 1; white-space: nowrap; }
/* Physical on purpose: the day/night diagonal is drawn top-left to bottom-right in both directions. */
.sg-t-sun i { position: absolute; display: block; }
.sg-day { inset: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.sg-sun { inset-block-start: 9px; left: 9px; width: 13px; height: 13px; border-radius: 50%; }
.sg-moon { inset-block-end: 9px; right: 9px; width: 14px; height: 14px; border-radius: 50%; }
.sg-t-reveal img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .6s var(--ui-ease); }
.sg-opt:hover .sg-t-reveal img, .sg-opt:has(.sg-in:focus-visible) .sg-t-reveal img { filter: none; }
.sg-t-woven i { position: absolute; inset-inline: 0; inset-block-start: 50%; display: block; height: 11px; margin-block-start: -5.5px; }
.sg-t-woven i::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .28) 0 1px, transparent 1px 2.5px), repeating-linear-gradient(-45deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 2.5px);
}
.sg-kw { font-size: 19px; line-height: 1.7; white-space: nowrap; }

/* Open now */
.on-ico { position: relative; background: var(--ui-ac-soft); color: var(--ui-ac-strong); }
.on-dot { position: absolute; inset-block-start: 5px; inset-inline-end: 5px; width: 8px; height: 8px; border-radius: 50%; background: rgba(12, 35, 64, .3); box-shadow: 0 0 0 2px #EAF6F5; transition: background-color .2s var(--ui-ease); }
.on-g.is-on .on-dot { background: #1E9E5A; }
.on-note { display: flex; flex-direction: column; gap: 8px; margin-inline-start: 48px; }
.on-note[hidden] { display: none; }
.on-warn {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--ui-r-sm);
  background: rgba(255, 196, 107, .18); color: #5E4210; font-size: 13px; line-height: 1.45;
}
.on-warn > .ico { flex: none; margin-block-start: 1px; color: #A9741A; }
.on-warn-t { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.on-warn-t p { margin: 0; }
.on-warn .on-sub { color: #6B4A12; }
.on-go { background: #fff; border-color: rgba(185, 127, 28, .45); gap: 6px; margin-block-start: 2px; }
.on-go:hover { border-color: #8A5E14; }
.on-now { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ui-ink2); }
.on-pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 12px; border-radius: 999px;
  background: var(--ui-card); border: 1px solid var(--ui-line-2); color: var(--ui-ink); font-weight: 600; font-size: 13px;
}
.on-pill i { width: 7px; height: 7px; border-radius: 50%; background: rgba(12, 35, 64, .45); }
.on-pill.is-open i { background: #1E9E5A; box-shadow: 0 0 0 3px rgba(30, 158, 90, .18); }
.on-unsure { flex-basis: 100%; font-size: 12.5px; line-height: 1.45; color: var(--ui-ink3); }
.on-typ { margin: 0; }

/* ---------- Sections panel ---------- */
.pn-langbar {
  position: sticky; inset-block-start: 0; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  margin: -8px -8px -12px; padding: 9px 14px; border-radius: 12px; background: rgba(241, 238, 230, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--ui-line); font-size: 13px; color: var(--ui-ink2);
}
.pn-langbar[hidden] { display: none; }
.pn-langbar.is-ar { background: rgba(225, 245, 243, .95); border-color: rgba(18, 124, 119, .25); color: var(--ui-navy); }
.pn-langbar-t { font-weight: 600; margin-inline-end: auto; }

.sx-list { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sx-row {
  position: relative; border: 1px solid var(--ui-line); border-radius: 15px; background: var(--ui-card);
  transition: border-color .18s var(--ui-ease), box-shadow .18s var(--ui-ease);
}
.sx-row:hover { border-color: var(--ui-line-2); }
.sx-row.is-open { border-color: rgba(12, 35, 64, .3); box-shadow: var(--ui-shadow); }
.sx-head { display: flex; align-items: center; gap: 2px; min-height: 60px; padding-inline: 4px 6px; }
.sx-grip, .sx-pin {
  flex: none; display: grid; place-items: center; width: 28px; height: 44px; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--ui-ink3);
}
.sx-grip { cursor: grab; touch-action: none; }
.sx-grip:hover { color: var(--ui-ink); background: rgba(12, 35, 64, .05); }
.sx-grip[hidden], .sx-pin[hidden] { display: none; }
.sx-pin { opacity: .55; }
.sx-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 6px; border: 0; border-radius: 11px;
  background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.sx-main:hover .sx-title { color: var(--ui-navy); }
.sx-kicon {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: rgba(12, 35, 64, .06); color: var(--ui-navy);
}
.sx-row.is-open .sx-kicon { background: var(--ui-navy); color: var(--ui-cream); }
.sx-kwrap { position: relative; flex: none; display: grid; }
.sx-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sx-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: match-parent; } /* own direction, the interface's side */
.sx-sub { font-size: 12.5px; color: var(--ui-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-flag {
  position: absolute; inset-block-start: -3px; inset-inline-end: -3px; width: 12px; height: 12px; border-radius: 50%;
  background: #F2A93B; box-shadow: 0 0 0 2px var(--ui-card);
}
.sx-flag[hidden] { display: none; }
.sx-tools { display: flex; align-items: center; flex: none; }
.sx-tools .btn { color: var(--ui-ink2); }
.sx-tools .btn:hover:not([disabled]) { color: var(--ui-ink); }
.sx-tools .btn[disabled] { opacity: .3; }
.sx-tools .btn[hidden] { display: none; }
/* Up/down live on the open row and on rows holding keyboard focus; drag covers pointers elsewhere. */
.sx-tools .sx-mv { display: none; }
.sx-row.is-open .sx-tools .sx-mv:not([hidden]), .sx-row:has(:focus-visible) .sx-tools .sx-mv:not([hidden]) { display: inline-flex; }
.sx-row.is-hidden { border-style: dashed; background: transparent; }
.sx-row.is-hidden .sx-kicon { opacity: .55; }
.sx-row.is-hidden .sx-title { color: var(--ui-ink2); }
.sx-row.is-hidden .sx-eye { color: var(--ui-danger); }

/* drag */
.sx-list.is-sorting > .sx-row:not(.is-lifted), .dt-hours.is-sorting > .dt-hrow:not(.is-lifted) { transition: transform .2s var(--ui-ease); }
.sx-row.is-lifted, .dt-hrow.is-lifted { z-index: 5; border-color: var(--ui-navy); box-shadow: var(--ui-shadow-lg); cursor: grabbing; }
.sx-row.is-lifted .sx-ed { display: none; }
.sx-row.is-lifted .sx-grip, .dt-hrow.is-lifted .sx-grip { cursor: grabbing; color: var(--ui-navy); }
.pn-slot {
  position: absolute; inset-inline: 0; z-index: 0; border: 1.5px dashed var(--ui-ac-strong); border-radius: 15px;
  background: var(--ui-ac-soft); pointer-events: none; transition: top .2s var(--ui-ease);
}
.dt-hours > .pn-slot { border-radius: 13px; }

/* editor */
.sx-ed { display: flex; flex-direction: column; gap: 22px; padding: 16px 16px 14px; border-block-start: 1px solid var(--ui-line); animation: sx-open .22s var(--ui-ease); }
.sx-ed[hidden] { display: none; }
@keyframes sx-open { from { opacity: 0; transform: translateY(-4px); } }
.sx-blk { display: flex; flex-direction: column; gap: 10px; }
.sx-lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0; font-size: 13px; font-weight: 600; }
.sx-lbl-v { font-size: 12.5px; font-weight: 500; color: var(--ui-ink3); }
.sx-fields { gap: 14px; }

.sx-layouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sx-lay {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 6px 7px; border: 1px solid var(--ui-line);
  border-radius: 12px; background: var(--ui-card); color: var(--ui-ink2); font: inherit; cursor: pointer;
  transition: border-color .16s var(--ui-ease), background-color .16s var(--ui-ease);
}
.sx-lay:hover { border-color: var(--ui-line-2); color: var(--ui-ink); }
.sx-lay[aria-pressed="true"] { border-color: var(--ui-navy); box-shadow: 0 0 0 1px var(--ui-navy); color: var(--ui-ink); background: #FDFCF9; }
.sx-lay-t { font-size: 12px; font-weight: 500; line-height: 1.25; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-lay-h { display: flex; gap: 7px; align-items: flex-start; margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ui-ink2); }
.sx-lay-h[hidden] { display: none; }
.sx-lay-h .ico { flex: none; margin-block-start: 2px; color: var(--ui-ac-strong); }
.fld-l:has(.sx-count) { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sx-count { font-size: 12px; font-weight: 500; color: var(--ui-ac-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sx-count.is-off { color: #8A5E14; }
.wf { width: 100%; height: auto; aspect-ratio: 3 / 2; display: block; }
[dir="rtl"] .wf { transform: scaleX(-1); }
.wf-num { font: 800 11px/1 var(--ui-font); fill: rgba(12, 35, 64, .7); letter-spacing: -.02em; }
[dir="rtl"] .wf-num { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; } /* digits read the right way round */
.sx-lay[aria-pressed="true"] .wf-num { fill: var(--ui-navy); }
.wf-bg { fill: #F6F4EE; stroke: rgba(12, 35, 64, .1); stroke-width: 1; }
.wf-i { fill: rgba(12, 35, 64, .17); }
.wf-h { fill: rgba(12, 35, 64, .62); }
.wf-t { fill: rgba(12, 35, 64, .26); }
.wf-tl { fill: rgba(255, 255, 255, .95); }
.wf-b, .wf-acf { fill: var(--ui-ac); }
.wf-k { fill: #fff; stroke: rgba(12, 35, 64, .16); stroke-width: .8; }
.wf-kk { fill: #fff; stroke: var(--ui-ac-strong); stroke-width: 1.2; }
.wf-o { fill: rgba(12, 35, 64, .7); }
.wf-o2 { fill: rgba(31, 181, 173, .2); }
.wf-art { fill: rgba(31, 181, 173, .35); }
.wf-art2 { fill: rgba(12, 35, 64, .18); }
.wf-r { stroke: rgba(12, 35, 64, .18); stroke-width: .8; }
.wf-r2 { stroke: rgba(12, 35, 64, .5); stroke-width: 1; stroke-linecap: round; }
.wf-d { stroke: rgba(12, 35, 64, .3); stroke-width: .8; stroke-dasharray: .8 1.4; }
.wf-tick { fill: none; stroke: var(--ui-ac-strong); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.wf-arc { fill: none; stroke: rgba(12, 35, 64, .16); stroke-width: .8; }
.wf-notch { fill: #F6F4EE; }
.sx-lay[aria-pressed="true"] .wf-notch { fill: #EEF8F7; }
.wf-map { fill: #E3EEE8; }
.wf-road { stroke: #fff; stroke-width: 1.6; fill: none; }
.sx-lay[aria-pressed="true"] .wf-bg { fill: #EEF8F7; stroke: rgba(18, 124, 119, .35); }
.sx-lay[aria-pressed="true"] .wf-i { fill: rgba(18, 124, 119, .3); }
.sx-lay[aria-pressed="true"] .wf-h { fill: var(--ui-navy); }

.sx-btns { gap: 12px; }
.sx-cta { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 12px; border: 1px solid var(--ui-line); border-radius: 13px; min-width: 0; }
.sx-cta legend { padding-inline: 4px; margin-inline-start: -4px; }
.sx-cta-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sx-cta .fld-l { font-size: 12.5px; font-weight: 500; color: var(--ui-ink2); }
.sx-cta .input, .sx-cta .select { min-height: 40px; }
.sx-add2 { align-self: flex-start; }

.sx-photo {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; padding-inline-end: 14px; border: 1px solid var(--ui-line);
  border-radius: 13px; background: var(--ui-card); color: inherit; font: inherit; text-align: start; cursor: pointer;
  transition: border-color .16s var(--ui-ease), box-shadow .16s var(--ui-ease);
}
.sx-photo:hover { border-color: var(--ui-line-2); box-shadow: var(--ui-shadow); }
.sx-photo img, .sx-photo .pn-art { flex: none; width: 72px; height: 54px; border-radius: 9px; object-fit: cover; }
.sx-photo-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sx-photo-t strong { font-size: 13.5px; font-weight: 600; }
.sx-photo-t span { font-size: 12.5px; color: var(--ui-ink3); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-photo-c { flex: none; font-size: 13px; font-weight: 600; color: var(--ui-ac-strong); }

.sx-items { display: flex; flex-direction: column; gap: 8px; }
.sx-it { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; border: 1px solid var(--ui-line); border-radius: 13px; background: var(--ui-panel); }
.sx-it-top { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.sx-it-n {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(12, 35, 64, .08);
  font-size: 12px; font-weight: 600; color: var(--ui-ink2); flex: none;
}
.sx-it-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ui-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-it-tools { display: flex; flex: none; margin-inline-end: -6px; }
.sx-it-tools .btn { color: var(--ui-ink2); }
.sx-it-tools .btn[disabled] { opacity: .3; }
.sx-it-photo, .sx-it-icon {
  flex: none; display: grid; place-items: center; width: 52px; height: 40px; padding: 0; border: 1px solid var(--ui-line-2);
  border-radius: 9px; background: var(--ui-card); color: var(--ui-ink2); overflow: hidden; cursor: pointer;
}
.sx-it-icon { width: 40px; color: var(--ui-navy); }
.sx-it-icon.is-empty { border-style: dashed; color: var(--ui-ink3); }
.sx-it-icon[aria-expanded="true"] { border-color: var(--ui-navy); box-shadow: 0 0 0 1px var(--ui-navy); }
.sx-it-photo { width: 60px; height: 45px; }
.sx-it-photo img { width: 100%; height: 100%; object-fit: cover; }
.sx-it-photo:hover, .sx-it-icon:hover { border-color: var(--ui-navy); }
.sx-it-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sx-it-fields.m-svc { grid-template-columns: minmax(0, 1fr) 112px; }
.sx-it-fields.m-svc > :nth-child(3) { grid-column: 1 / -1; }
.sx-it-fields.m-num { grid-template-columns: 96px minmax(0, 1fr); }
.sx-it-fields.m-rev { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sx-it-fields.m-rev > :first-child { grid-column: 1 / -1; }
/* Timetable rows: the time beside what happens, details under both. Ticket lines: label beside value. */
.sx-it-fields.m-tt { grid-template-columns: 112px minmax(0, 1fr); }
.sx-it-fields.m-tt > :nth-child(3) { grid-column: 1 / -1; }
.sx-it-fields.m-tt > :first-child .input { font-variant-numeric: tabular-nums; }
.sx-it-fields.m-tk { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sx-untimed[hidden] { display: none; }
.sx-tkstart { gap: 10px; }
.sx-tkstart p { margin: 0; max-width: 34ch; line-height: 1.45; }
.sx-icons {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; padding: 8px; border-radius: 11px;
  background: var(--ui-card); border: 1px solid var(--ui-line); animation: sx-open .18s var(--ui-ease);
}
.sx-ic {
  display: grid; place-items: center; aspect-ratio: 1; min-height: 38px; padding: 0; border: 0; border-radius: 9px; background: none;
  color: var(--ui-ink2); cursor: pointer;
}
.sx-ic:hover { background: rgba(12, 35, 64, .06); color: var(--ui-ink); }
.sx-ic[aria-pressed="true"] { background: var(--ui-navy); color: var(--ui-cream); }
.sx-iadd { align-self: flex-start; }

.pn-sample {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 13px; background: #FFF6E3; border: 1px solid rgba(232, 172, 72, .45); color: #4F3A12;
}
.pn-sample > .ico { color: #B97F1C; margin-block-start: 1px; }
.pn-sample-t { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.pn-sample-t strong { font-size: 13.5px; }
.pn-sample-t p { margin: 0 0 6px; font-size: 13px; line-height: 1.45; }
.pn-sample .btn { background: #fff; border-color: rgba(185, 127, 28, .45); }
.pn-sample .btn:hover { border-color: #8A5E14; }
.sx-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-start: -6px; padding-block-start: 12px; border-block-start: 1px solid var(--ui-line); }
.sx-foot .sx-ask { color: var(--ui-ac-strong); padding-inline: 10px; margin-inline-start: -10px; }

/* add section */
.sx-add { display: flex; flex-direction: column; gap: 10px; }
.sx-addbtn {
  width: 100%; min-height: 48px; border-style: dashed; border-color: rgba(12, 35, 64, .3); border-radius: 15px; background: transparent;
  color: var(--ui-navy); font-weight: 600;
}
.sx-addbtn:hover { background: var(--ui-card); border-style: solid; }
.sx-addbtn[aria-expanded="true"] { background: var(--ui-navy); border-color: var(--ui-navy); border-style: solid; color: var(--ui-cream); }
.sx-addmenu { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 16px; background: var(--ui-card); border: 1px solid var(--ui-line); box-shadow: var(--ui-shadow); animation: sx-open .2s var(--ui-ease); }
.sx-addmenu[hidden] { display: none; }
.sx-addnote { margin: 4px 8px 2px; font-size: 12.5px; color: var(--ui-ink3); }
.sx-addlist { display: flex; flex-direction: column; gap: 2px; }
.sx-addk {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 11px; background: none;
  color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.sx-addk:hover:not([disabled]) { background: rgba(12, 35, 64, .05); }
.sx-addk:hover:not([disabled]) .sx-kicon { background: var(--ui-ac); }
.sx-addk[disabled] { opacity: .45; cursor: not-allowed; }
.sx-addk-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sx-addk-t strong { font-size: 14px; font-weight: 600; }
.sx-addk-t span { font-size: 12.5px; color: var(--ui-ink3); line-height: 1.35; }

/* ---------- Details panel ---------- */
.dt-g { gap: 16px; }
.dt-gi { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: rgba(12, 35, 64, .06); color: var(--ui-navy); }
.dt-pair { display: flex; flex-direction: column; gap: 12px; padding-inline-start: 12px; border-inline-start: 2px solid var(--ui-line); }
.dt-lrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dt-same { font-size: 12.5px; }
.dt-same[hidden] { display: none; }
.dt-qf { margin-block: 2px -2px; }
.dt-stnote { margin-block-end: 4px; }
.dt-stnote[hidden] { display: none; }
.dt-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-chip { min-height: 32px; padding: 0 12px; font-size: 13px; }
.dt-hours { position: relative; display: flex; flex-direction: column; gap: 8px; margin-block: 6px 2px; }
.dt-hrow { position: relative; display: flex; align-items: flex-start; gap: 4px; padding: 6px; padding-inline-end: 4px; border: 1px solid var(--ui-line); border-radius: 13px; background: var(--ui-card); }
.dt-hgrip { height: 40px; }
.dt-hlines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dt-hcells { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.dt-hcells .input { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.dt-hin { display: block; resize: none; overflow: hidden; line-height: 1.4; field-sizing: content; overflow-wrap: anywhere; }
.dt-hnote { margin-block-start: 2px; }
.dt-hrow > .btn { margin-block-start: 4px; color: var(--ui-ink2); }
.dt-langs { display: flex; flex-direction: column; gap: 8px; }
.dt-langs .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.dt-langs .pn-ctl-l + .seg { margin-block-end: 6px; }
.dt-g .fld-h { line-height: 1.45; }

/* ---------- Photo picker ---------- */
.pp-modal { width: min(1040px, 100%); }
.pp-modal .m-body { padding-block-end: 28px; }
.pp { display: flex; flex-direction: column; gap: 26px; contain: inline-size; } /* the dialog takes its width from the screen, not from 83 photos */
.pp-sec { display: flex; flex-direction: column; gap: 12px; }
.pp-own {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 14px 16px; border-radius: 16px;
  background: var(--ui-card); border: 1px solid var(--ui-line);
}
.pp-own-i { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ui-ac-soft); color: var(--ui-ac-strong); }
.pp-own-t { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pp-own-t p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ui-ink2); }
.pp-own-b { flex: none; }
.pp-hrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pp-h { margin: 0; font-size: 15px; font-weight: 600; }
.pp-count { font-size: 13px; color: var(--ui-ink3); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-chip { min-height: 32px; padding: 0 13px; font-size: 13.5px; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pp-tile {
  position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 13px; overflow: hidden; cursor: pointer;
  background: rgba(12, 35, 64, .08); box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .08);
}
.pp-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ui-ease); }
.pp-tile:hover img, .pp-tile:focus-visible img { transform: scale(1.04); }
.pp-cap {
  position: absolute; inset-inline: 0; inset-block-end: 0; padding: 22px 10px 8px; color: #fff; font-size: 12px; line-height: 1.35; text-align: start;
  background: linear-gradient(to top, rgba(8, 18, 32, .82), rgba(8, 18, 32, 0)); opacity: 0; transform: translateY(4px);
  transition: opacity .2s var(--ui-ease), transform .2s var(--ui-ease);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pp-tile:hover .pp-cap, .pp-tile:focus-visible .pp-cap { opacity: 1; transform: none; }
.pp-tile[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ui-panel), 0 0 0 5px var(--ui-ac-strong); }
.pp-tile .pn-tick { inset-block-start: 8px; inset-inline-end: 8px; width: 24px; height: 24px; background: var(--ui-ac-strong); }
.pp-used {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(8, 18, 32, .6); color: #fff; font-size: 11px; font-weight: 500;
}
.pp-art { display: flex; flex-direction: column; align-items: stretch; background: var(--ui-card); text-align: start; }
.pp-art .pn-art { flex: 1; min-height: 0; }
.pp-art-t { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 9px; }
.pp-art-t strong { font-size: 13px; font-weight: 600; color: var(--ui-ink); }
.pp-art-t span { font-size: 11.5px; color: var(--ui-ink3); }

/* ---------- touch: 44px targets (UX-13) ---------- */
/* Finger-sized hit areas where the pointer is coarse. Icon buttons grow for real; inline links and the
   switch keep their look and get an invisible hit area around them. */
@media (pointer: coarse) {
  .pn .btn-sm, .pp .btn-sm { min-height: 44px; }
  .pn .btn-sm.btn-icon { width: 44px; }
  .pn .btn-icon:not(.btn-sm) { width: 44px; min-height: 44px; }
  .sx-head { gap: 0; padding-inline: 2px 4px; }
  .sx-grip, .sx-pin, .dt-hgrip { width: 44px; height: 44px; }
  .sx-main { gap: 10px; padding-inline: 4px; }
  .sx-kicon { width: 34px; height: 34px; }
  .pn-linkbtn { position: relative; }
  .pn-linkbtn::after { content: ''; position: absolute; inset: -13px -6px; }
  .pn-switch::after { content: ''; position: absolute; inset: -9px -2px; }
  .pn-undo { position: relative; min-height: 36px; padding-inline: 14px; }
  .pn-undo::after { content: ''; position: absolute; inset: -6px -4px; }
  .pn .seg-b { min-height: 44px; }
  .dt-chip, .pp-chip { min-height: 44px; padding-inline: 16px; }
  .sx-ic { min-height: 44px; }
  .sx-icons { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .sx-it-icon { width: 44px; height: 44px; }
  .sx-it-photo { height: 46px; }
  .dz-color { width: 44px; height: 44px; }
  .pn .input, .pn .select, .fld-c .input, .sx-cta .input, .sx-cta .select { min-height: 44px; }
  .dt-hcells .input { min-height: 44px; padding-block: 10px; }
  .pn-menu-i { min-height: 44px; }
  .sx-lay { min-height: 44px; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .pn-body { gap: 24px; padding: 16px 16px 48px; }
  .dz-swatches { gap: 7px; }
  .dz-aa { font-size: 28px; }
  .sx-ed { padding: 14px 12px 12px; gap: 20px; }
  .pp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pp-tile { border-radius: 10px; }
  .pp-cap { display: none; }
  .pp-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -24px; padding-inline: 24px; scrollbar-width: none; }
  .pp-chips::-webkit-scrollbar { display: none; }
  .pp-chip { flex: none; }
  .pp-art-t span { display: none; }
  .pp-own { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 12px 14px; }
  .pp-own-i { width: 34px; height: 34px; }
  .pp-own-b { grid-column: 2; justify-self: start; }
}
@media (max-width: 360px) {
  .dz-swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sx-layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
