/* ══════════════════════════════════════════════════════════════════════
   OWLMARK — LAYOUT PROFILE UI
   Uses the existing OwlMark tokens (--ok-ink, --gel-gold-*, --ok-line …)
   and the existing radius/shadow language. No new colour identity.
   ══════════════════════════════════════════════════════════════════════ */

/* A field a layout family suppresses (e.g. the ministry line on a Cycle 1
   plate). Hidden in the editor and in print — but still in the DOM, still
   editable, and it returns the moment a profile wants it back. */
.om-field-hidden { display: none !important; }

/* ── dialog ─────────────────────────────────────────────────────────── */
.om-dlg-scrim {
  position: fixed; inset: 0; z-index: 9600;
  background: rgba(43, 39, 64, .42);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: omFade .16s ease-out;
}
@keyframes omFade { from { opacity: 0 } to { opacity: 1 } }

.om-dlg {
  width: min(520px, 100%);
  background: var(--ok-panel, #fff);
  border: 1px solid var(--ok-line, #e6e3f2);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(43, 39, 64, .22), 0 2px 6px rgba(43, 39, 64, .08);
  padding: 26px 26px 20px;
  text-align: center;
  animation: omRise .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes omRise { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }

.om-dlg-emblem {
  width: 42px; height: 42px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--gel-gold-a, #fff3d2), var(--gel-gold-b, #ffd98a));
  border: 1px solid var(--gel-gold-rim, #d9a532);
  color: var(--gel-gold-ink, #5c4413);
  font-size: 18px;
}

.om-dlg-title {
  margin: 0 0 8px;
  font-family: 'Cinzel', serif;
  font-size: 18px; line-height: 1.35;
  color: var(--ok-ink, #2b2740);
  letter-spacing: .3px;
}

.om-dlg-body {
  margin: 0 0 16px;
  font-size: 13.5px; line-height: 1.6;
  color: var(--ok-ink-soft, #6f6a85);
}
.om-dlg-body strong { color: var(--ok-ink, #2b2740); }
.om-dlg-body em { font-style: normal; color: var(--gel-gold-ink, #5c4413); font-weight: 600; }

.om-dlg-check {
  display: flex; align-items: center; gap: 8px;
  justify-content: center;
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--ok-ink-soft, #6f6a85);
  cursor: pointer;
}
.om-dlg-check input { accent-color: var(--gel-gold-rim, #d9a532); width: 15px; height: 15px; cursor: pointer; }

.om-dlg-actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  border-top: 1px solid var(--ok-line, #e6e3f2);
  padding-top: 16px;
}

/* ── buttons ────────────────────────────────────────────────────────── */
.om-btn {
  font-family: 'Cinzel', serif;
  font-size: 11.5px; letter-spacing: .6px;
  padding: 0 16px; min-height: 44px;   /* 44px touch target */
  border-radius: 8px;
  border: 1px solid var(--ok-line, #e6e3f2);
  background: var(--ok-soft, #f6f4fd);
  color: var(--ok-ink, #2b2740);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.om-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(43, 39, 64, .12); }
.om-btn:active { transform: none; }
.om-btn:focus-visible {
  outline: 2px solid var(--gel-gold-rim, #d9a532);
  outline-offset: 2px;
}

.om-btn-gold {
  background: linear-gradient(160deg, var(--gel-gold-a, #fff3d2), var(--gel-gold-b, #ffd98a));
  border-color: var(--gel-gold-rim, #d9a532);
  color: var(--gel-gold-ink, #5c4413);
  font-weight: 700;
}
.om-btn-quiet { background: var(--ok-panel, #fff); }
.om-btn-ghost { background: transparent; border-color: transparent; color: var(--ok-ink-faint, #a09aba); }
.om-btn-ghost:hover { background: var(--ok-soft, #f6f4fd); box-shadow: none; }

/* ── restricted-zone warning on canvas (editor only, never printed) ─── */
.text-sticker.om-in-restricted .cs-frame {
  outline: 2px dashed #e0a12f;
  outline-offset: 2px;
  border-radius: 4px;
}
.text-sticker.om-in-restricted::after {
  content: '\26A0';
  position: absolute; top: -9px; right: -9px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-size: 10px;
  border-radius: 999px;
  background: var(--gel-gold-b, #ffd98a);
  border: 1px solid var(--gel-gold-rim, #d9a532);
  color: var(--gel-gold-ink, #5c4413);
  pointer-events: none;
}

/* Editor-only chrome must never reach paper. */
@media print {
  .om-dlg-scrim,
  #omLayoutDlg,
  #omResetLayoutBtn { display: none !important; }
  .text-sticker.om-in-restricted .cs-frame { outline: none !important; }
  .text-sticker.om-in-restricted::after { display: none !important; }
  .om-field-hidden { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .om-dlg-scrim, .om-dlg { animation: none; }
  .om-btn { transition: none; }
  .om-btn:hover { transform: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   POSITIONING STUDIO — editor-only aids. None of this reaches paper.
   ══════════════════════════════════════════════════════════════════════ */

#omArtLayer {
  position: absolute; inset: 0;
  pointer-events: none;          /* never blocks dragging the text */
  z-index: 3;
}

/* The writable paper: everything inside this is safe to place text on. */
.om-paper-edge {
  position: absolute;
  border: 1px dashed rgba(217, 165, 50, .75);
  border-radius: 3px;
  background: rgba(255, 243, 210, .06);
}

/* Where the plate's own artwork lives. */
.om-art-zone {
  position: absolute;
  background: repeating-linear-gradient(
    45deg,
    rgba(224, 161, 47, .13) 0 6px,
    rgba(224, 161, 47, .05) 6px 12px
  );
  border: 1px solid rgba(224, 161, 47, .5);
  border-radius: 3px;
}

/* Text sitting on artwork — amber, with the reason on hover. */
.text-sticker.om-in-restricted::before {
  content: attr(data-om-why);
  position: absolute; bottom: 100%; left: 0;
  transform: translateY(-4px);
  white-space: nowrap;
  font: 600 10px/1.4 'Cinzel', serif;
  letter-spacing: .4px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--gel-gold-b, #ffd98a);
  border: 1px solid var(--gel-gold-rim, #d9a532);
  color: var(--gel-gold-ink, #5c4413);
  opacity: 0; transition: opacity .14s ease;
  pointer-events: none;
}
.text-sticker.om-in-restricted:hover::before { opacity: 1; }

/* Wider dialog for the positioning prompt. */
.om-dlg-wide { width: min(560px, 100%); text-align: left; }
.om-dlg-wide .om-dlg-emblem,
.om-dlg-wide .om-dlg-title { margin-left: auto; margin-right: auto; }
.om-dlg-wide .om-dlg-title { text-align: center; }

.om-dlg-note {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--ok-soft, #f6f4fd);
  border: 1px solid var(--ok-line, #e6e3f2);
  font-size: 12.5px; line-height: 1.55;
  color: var(--ok-ink-soft, #6f6a85);
}

.om-tips { list-style: none; margin: 0 0 16px; padding: 0; }
.om-tips li {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 0;
  font-size: 12.8px; line-height: 1.5;
  color: var(--ok-ink-soft, #6f6a85);
  border-bottom: 1px solid var(--ok-line, #e6e3f2);
}
.om-tips li:last-child { border-bottom: 0; }

.om-swatch { width: 18px; height: 14px; border-radius: 3px; flex: none; }
.om-swatch-art {
  background: repeating-linear-gradient(45deg,
    rgba(224,161,47,.35) 0 4px, rgba(224,161,47,.12) 4px 8px);
  border: 1px solid rgba(224,161,47,.6);
}
.om-key {
  font: 600 11px/1 'Cinzel', serif;
  padding: 4px 7px; border-radius: 5px; flex: none;
  background: var(--ok-soft, #f6f4fd);
  border: 1px solid var(--ok-line, #e6e3f2);
  color: var(--ok-ink, #2b2740);
}

/* Absolutely nothing above may print. */
@media print {
  #omArtLayer, .om-paper-edge, .om-art-zone,
  #omPosDlg, #omPosBtn { display: none !important; }
  .text-sticker.om-in-restricted::before,
  .text-sticker.om-in-restricted::after { display: none !important; }
  .text-sticker.om-in-restricted .cs-frame { outline: none !important; }
}
