/* Publishing, versions and the on-page comparison (versions.js), and the app's confirmation window (dialogs.js). */

/* ---------------------------------------------------------------- the publish window */
.dlg.publish { width: min(1320px, calc(100vw - 32px)); }
.dlg.publish .dlg-head h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 17px; }
.pub-ttl-sub { font-size: 13px; font-weight: 400; color: var(--muted); }
.pub-vers { display: inline-flex; align-items: center; gap: 6px; }
.pub-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid; }
.pub-chip.in-use { color: var(--ok); background: #ecfdf3; border-color: #a6e3bf; }
.pub-chip.new { color: var(--accent-2); background: var(--accent-soft); border-color: #bfd0fb; }
.pub-arrow { color: var(--muted); font-size: 16px; }
html[dir="ltr"] .pub-arrow { transform: scaleX(-1); display: inline-block; }

.pub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: 16px; min-height: 0; }
.pub-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pub-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-inline-start: 16px; border-inline-start: 1px solid var(--line-2); }
.pub.cmp-only { grid-template-columns: minmax(0, 1fr) minmax(320px, 520px); }

.pub-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.pub-card-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.pub-card-head h3 { margin: 0 !important; font-size: 15px; }
.pub-sum { margin-inline-start: auto; font-size: 12px; }
.pub-ic { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.pub-ic.ok { background: var(--ok); }
.pub-ic.warn { background: #f59e0b; }
.pub-ic.bad { background: var(--danger); }
.pub-ic.chg { background: var(--accent); }
.pub-card > .hint { padding: 0 14px; }

.pub-checks, .pub-chg-list { list-style: none; margin: 0; padding: 4px 0; }
.pub-checks li, .pub-chg { display: flex; align-items: center; gap: 10px; padding: 6px 14px; min-height: 36px; }
.pub-checks li + li, .pub-chg + .pub-chg { border-top: 1px solid var(--line-2); }
.pub-ic-s { width: 18px; text-align: center; font-weight: 700; flex: none; }
.pub-checks .ok .pub-ic-s { color: var(--ok); }
.pub-checks .warning .pub-ic-s, .pub-checks .info .pub-ic-s { color: var(--warn); }
.pub-checks .error .pub-ic-s { color: var(--danger); }
.pub-checks .error { background: #fef2f2; }
.pub-issue, .pub-chg-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pub-checks .btn, .pub-chg .btn { flex: none; }
.pub-none { padding: 10px 14px; margin: 0; color: var(--ok); }
.pub-card > p.muted { padding: 10px 14px; }

.pub-chg { cursor: pointer; }
.pub-chg:hover, .pub-chg.on { background: var(--panel-2); }
.pub-num { width: 20px; height: 20px; border-radius: 50%; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.pub-kind { padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; flex: none; }
.pub-kind.added { background: #dcfce7; color: #166534; }
.pub-kind.changed { background: var(--accent-soft); color: var(--accent-2); }
.pub-kind.removed { background: #fee2e2; color: #991b1b; }
.pub-kind.template { background: #f1f5f9; color: #334155; }

.pub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pub-note-in { position: relative; display: flex; }
.pub-note-in input { padding-inline-end: 150px; }
.pub-suggest { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); color: #7c3aed; font-size: 12px; }
.pub-rts .ver-rts { border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; min-height: 40px; }
.pub-nort { border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; margin: 0; }

.pub-pv-head h3 { margin: 0 0 6px !important; font-size: 15px; }
.pub-pv-src { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub-pv-src select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.pub-pv-src #pub-dl { margin-inline-start: auto; }
/* the data of the preview (1.2.1): the template's sample, other samples, a loaded file */
.pub-data { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.pub-data select { max-width: 220px; text-overflow: ellipsis; }
.pub-pv-src select:focus-visible, .pub-pv-src .btn:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 1px; }
.cmp-only .pub-pv-head { margin-bottom: 6px; }

.dlg.publish .dlg-foot { align-items: center; }
.pub-foot { flex: 1; display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; min-width: 0; font-size: 12.5px; color: var(--muted); }
.pub-explain { color: var(--text); }
.pub-hist .link { font-size: 12.5px; text-decoration: underline; }
#pub-go { padding: 9px 18px; font-size: 14px; }
.pub .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- the on-page comparison */
.pub-cmp { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.cmp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmp-modes { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cmp-modes button { border: 0; background: var(--panel); padding: 5px 10px; font-size: 12px; }
.cmp-modes button + button { border-inline-start: 1px solid var(--line); }
.cmp-modes button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.cmp-pager { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.cmp-pager .mini:disabled { opacity: .35; cursor: default; }
.cmp-stage { background: #e9ecf2; border-radius: 8px; padding: 10px; overflow: auto; max-height: calc(100vh - 290px); }
.cmp-paper { position: relative; width: 100%; background: #fff; box-shadow: 0 2px 10px rgba(20, 30, 50, .18); min-height: 120px; }
.cmp-wait { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 10px; margin: 0; color: var(--muted); }
.cmp-wait .wiz-spinner { width: 22px; height: 22px; border-width: 3px; }
.cmp-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cmp-paper > .cmp-layer:first-child { position: relative; height: auto; }
.cmp-pixels { mix-blend-mode: multiply; }
.cmp-onion { opacity: .5; }
.cmp-before-tint { filter: sepia(1) saturate(6) hue-rotate(-50deg); }
.cmp-boxes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.cmp-box rect { fill: none; stroke-width: .6; vector-effect: non-scaling-stroke; }
.cmp-box rect { stroke-width: 2px; }
.cmp-box.added rect { stroke: #16a34a; }
.cmp-box.changed rect { stroke: var(--accent); }
.cmp-box.removed rect { stroke: #dc2626; stroke-dasharray: 5 3; }
.cmp-box circle { fill: #e11d48; }
.cmp-box text { fill: #fff; font: 700 3.4px/1 sans-serif; text-anchor: middle; }
.cmp-box.hot rect { stroke-width: 4px; fill: rgba(250, 204, 21, .18); }
.cmp-status { font-size: 12px; margin: 0; }
.cmp-status .ok-mark { color: var(--ok); font-weight: 700; }

.ver-cmp-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ver-cmp-pick select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }

/* ---------------------------------------------------------------- the confirmation window (dialogs.js) */
.dlg.dlg-confirm { width: min(440px, calc(100vw - 32px)); z-index: 2100; }

@media (max-width: 980px) {
  .pub, .pub.cmp-only { grid-template-columns: 1fr; }
  .pub-preview { padding-inline-start: 0; border-inline-start: 0; border-top: 1px solid var(--line-2); padding-top: 12px; }
  .pub-row { grid-template-columns: 1fr; }
  .cmp-stage { max-height: none; }
}
@media (pointer: coarse) {
  .cmp-modes button, .pub-checks .btn, .pub-chg .btn, .cmp-pager .mini { min-height: 44px; }
  .cmp-pager .mini { min-width: 44px; }
}

/* ---------------------------------------------------------------- all versions */
.ver-root { display: flex; flex-direction: column; gap: 10px; }
.ver-root .ver-status, .ver-root .ver-table { margin: 0; }
