/* Akram editor — "Tide": deep blue-slate (default) & sea-mist paper; ocean teal accent; 4px corners */
:root {
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --bg0: #0b1216;
  --bg1: #111a1f;
  --bg2: #172228;
  --bg3: #1f2c33;
  --bg4: #29383f;
  --line: #1f2b31;
  --line2: #2c3b42;
  --tx: #e6eef1;
  --tx2: #a2b2b9;
  --tx3: #8a9aa1;
  --ac: #5fd0e4;
  --ac2: #a5e8f3;
  --acbg: rgba(95, 208, 228, 0.13);
  --acln: rgba(95, 208, 228, 0.5);
  --acb: #0e7490;
  --acb2: #155e75;
  --ink: #ffffff;
  --hot: #0891b2;
  --ok: #4fd18b;
  --warn: #f2c14e;
  --err: #ff6b81;
  --sh-pop: 0 16px 40px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --checker: repeating-conic-gradient(#33434b 0 25%, #24323a 0 50%) 50%/10px 10px;
  --r: 4px;
  --r-sm: 4px;
  --top: 52px;
  --rail: 52px;
  --left: 300px;
  --right: 316px;
  color-scheme: dark;
}
[data-theme='light'] {
  --bg0: #e6edf0;
  --bg1: #ffffff;
  --bg2: #f6f9fa;
  --bg3: #ecf2f4;
  --bg4: #dfe8ec;
  --line: #e0e8eb;
  --line2: #d0dbdf;
  --tx: #0f1a1f;
  --tx2: #4a5a61;
  --tx3: #56666d;
  --ac: #0c6a84;
  --ac2: #0b4f63;
  --acbg: rgba(14, 116, 144, 0.09);
  --acln: rgba(14, 116, 144, 0.4);
  --acb: #0e7490;
  --acb2: #155e75;
  --ink: #ffffff;
  --hot: #0891b2;
  --sh-pop: 0 16px 40px -14px rgba(10, 30, 40, 0.26), 0 0 0 1px rgba(10, 30, 40, 0.08);
  --checker: repeating-conic-gradient(#e0e8ec 0 25%, #fff 0 50%) 50%/10px 10px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg0);
  color: var(--tx);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#nx-app {
  height: 100%;
}
button {
  font: inherit;
  color: inherit;
}
input,
select,
textarea {
  font: inherit;
  color: var(--tx);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 4px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--tx3);
}
::-webkit-scrollbar-track {
  background: transparent;
}
.ic {
  flex: 0 0 auto;
  display: block;
}
kbd {
  font: 600 10.5px/1 var(--font);
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--tx2);
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  white-space: nowrap;
}
.ph {
  color: var(--tx3);
}
code {
  font: 12px var(--mono);
}

/* Tooltips (pure CSS) */
[data-tip] {
  position: relative;
}
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  font: 500 11.5px/1.3 var(--font);
  padding: 6px 9px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  animation: tipIn 0.14s ease 0.35s both;
}
[data-tip-pos='right']:hover::after {
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
}
.insp [data-tip]:hover::after,
.pnl [data-tip]:hover::after {
  top: auto;
  bottom: calc(100% + 8px);
}
@keyframes tipIn {
  from {
    opacity: 0;
    translate: 0 -3px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
body.is-dragging [data-tip]::after,
body.is-scrubbing [data-tip]::after {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--tx2);
  cursor: pointer;
  font-weight: 550;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
.btn:hover {
  background: var(--bg3);
  color: var(--tx);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.btn.is-icon {
  width: 32px;
  padding: 0;
}
.btn.s-sm {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}
.btn.s-sm.is-icon {
  width: 28px;
  padding: 0;
}
.btn.is-on {
  background: var(--acbg);
  color: var(--ac2);
}
.b-primary {
  background: var(--acb);
  color: var(--ink);
  border-color: transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 6px 16px -6px var(--acln);
}
.b-primary:hover {
  background: var(--acb2);
  color: var(--ink);
}
.b-outline {
  border-color: var(--line2);
  color: var(--tx);
}
.b-outline:hover {
  border-color: var(--tx3);
  background: var(--bg2);
}
.b-soft {
  background: var(--acbg);
  color: var(--ac2);
}
.b-soft:hover {
  background: var(--acb);
  color: var(--ink);
}
.b-danger {
  background: rgba(255, 92, 122, 0.12);
  color: var(--err);
}
.b-danger:hover {
  background: var(--err);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
}
.spin {
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rot 0.7s linear infinite;
  opacity: 0.8;
}
@keyframes rot {
  to {
    transform: rotate(360deg);
  }
}

/* App frame */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.main {
  flex: 1;
  display: flex;
  min-height: 0;
}
.center-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top bar */
.top {
  height: var(--top);
  flex: 0 0 var(--top);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  background: var(--bg1);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.top-l {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  background: var(--acb);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px -4px rgba(14, 116, 144, 0.7);
  transition: transform 0.2s;
}
.logo:hover {
  transform: rotate(-6deg) scale(1.05);
}
.logo span {
  font: 800 16px/1 var(--font);
  color: #fff;
  letter-spacing: -0.04em;
}
.doc-t {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.doc-title {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: -6px;
  font-weight: 650;
  font-size: 14px;
  width: min(280px, 30vw);
  text-overflow: ellipsis;
}
.doc-title:hover {
  border-color: var(--line2);
}
.doc-title:focus {
  outline: none;
  border-color: var(--ac);
  background: var(--bg2);
}
.doc-st {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--tx3);
  padding-left: 1px;
}
.doc-st i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.doc-st.is-dirty i {
  background: var(--warn);
}
.doc-st.is-saving i {
  background: var(--ac);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
.top-c {
  display: flex;
  align-items: center;
  gap: 8px;
}
.devs {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
  gap: 2px;
}
.devs button {
  width: 38px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.15s;
}
.devs button:hover {
  color: var(--tx);
}
.devs button.is-on {
  background: var(--bg4);
  color: var(--tx);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
[data-theme='light'] .devs button.is-on {
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 24, 40, 0.15);
}
.zoom {
  height: 34px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--tx2);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.zoom:hover {
  color: var(--tx);
}
.top-r {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.top-sep {
  width: 1px;
  height: 20px;
  background: var(--line2);
  margin: 0 4px;
}
.split {
  display: flex;
  margin-left: 4px;
}
.split-main {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  padding: 0 14px;
}
.split-more {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  width: 30px;
  padding: 0;
  margin-left: 1px;
}

/* Rail */
.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  background: var(--bg1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  z-index: 5;
}
.rail button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 0.15s,
    color 0.15s;
}
.rail button:hover {
  background: var(--bg3);
  color: var(--tx);
}
.rail button.is-on {
  background: var(--bg3);
  color: var(--tx);
  box-shadow: inset 2px 0 0 var(--ac);
}
.rail button.is-add {
  background: var(--acb);
  color: var(--ink);
  margin-bottom: 6px;
}
.rail button.is-add:hover {
  background: var(--acb2);
  color: var(--ink);
}
.rail button.is-add .ic {
  transition: transform 0.2s;
}
.rail button.is-add.is-on {
  background: var(--acb2);
  color: var(--ink);
}
.rail button.is-add.is-on .ic {
  transform: rotate(45deg);
}
.rail button.is-ai {
  color: var(--ac);
}
.rail-sp {
  flex: 1;
}

/* Panels */
.left {
  width: var(--left);
  flex: 0 0 var(--left);
  background: var(--bg1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: slideIn 0.18s ease;
}
.left.is-wide {
  width: 360px;
  flex-basis: 360px;
}
@keyframes slideIn {
  from {
    opacity: 0.4;
    transform: translateX(-8px);
  }
}
.pnl {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.pnl.is-compact {
  height: auto;
}
.pnl-h {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 14px 10px;
}
.pnl-h h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  flex: 1;
  letter-spacing: -0.01em;
}
.pnl-sub {
  font-size: 11.5px;
  color: var(--tx3);
}
.pnl-b {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 24px;
  min-height: 0;
}
.pnl-b.is-locked {
  opacity: 0.55;
  pointer-events: none;
}
.pnl-g {
  margin-bottom: 16px;
}
.pnl-gh {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  margin: 14px 2px 8px;
}
.pnl-gh small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.pnl > .seg {
  margin: 0 12px 10px;
  width: auto;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 10px;
  padding: 0 10px;
  height: 36px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx3);
  transition: border-color 0.15s;
}
.search:focus-within {
  border-color: var(--ac);
  color: var(--tx2);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  height: 100%;
}
.search button {
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 0;
  display: flex;
}
.search.sm {
  margin: 0 0 8px;
  height: 32px;
}
.center {
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* Widget tiles */
.wts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.wt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 4px 9px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid transparent;
  cursor: grab;
  user-select: none;
  transition:
    border-color 0.12s,
    background 0.12s;
  min-height: 70px;
  text-align: center;
}
.wt:hover {
  border-color: var(--line2);
  background: var(--bg3);
}
.wt:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 1px;
}
.wt:active {
  cursor: grabbing;
}
.wt-ic {
  color: var(--tx3);
  transition: color 0.12s;
}
.wt:hover .wt-ic,
.wt:focus-visible .wt-ic {
  color: var(--ac);
}
.wt-n {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--tx2);
  line-height: 1.25;
}
.wt-fav {
  position: absolute;
  top: 4px;
  right: 4px;
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  opacity: 0;
  padding: 2px;
  transition: 0.15s;
}
.wt:hover .wt-fav {
  opacity: 1;
}
.wt-fav.is-on {
  opacity: 1;
  color: #f5b83d;
}
.wt-fav.is-on svg {
  fill: currentColor;
}
.structs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.struct {
  padding: 8px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  cursor: grab;
  transition: 0.15s;
}
.struct:hover {
  border-color: var(--acln);
}
.struct-v {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  height: 30px;
}
.struct-v i {
  flex: 1;
  min-height: 12px;
  border-radius: 3px;
  background: var(--bg4);
}
.struct:hover .struct-v i {
  background: var(--acln);
}

/* Layers */
.tree {
  padding: 0 6px 24px;
}
.row {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--tx2);
  user-select: none;
  position: relative;
  padding-right: 6px;
}
.row:hover,
.row.is-hov {
  background: var(--bg2);
  color: var(--tx);
}
.row.is-sel {
  background: var(--acbg);
  color: var(--tx);
}
.row.is-sel .row-ic {
  color: var(--ac2);
}
.row.is-hidden .row-n,
.row.is-hidden .row-ic {
  opacity: 0.45;
}
.row-tg {
  width: 18px;
  height: 18px;
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: transform 0.15s;
  padding: 0;
}
.row-tg.is-open {
  transform: rotate(90deg);
}
.row-tg.is-leaf {
  visibility: hidden;
}
.row-ic {
  color: var(--tx3);
}
.row-n {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.row-in {
  flex: 1;
  min-width: 0;
  height: 24px;
  border: 1px solid var(--ac);
  border-radius: 4px;
  background: var(--bg2);
  padding: 0 6px;
  outline: none;
}
.row-act {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--tx3);
  opacity: 0;
}
.row:hover .row-act,
.row.is-hidden .row-act {
  opacity: 1;
}
.row-act button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 3px;
  display: flex;
  border-radius: 4px;
}
.row-act button:hover {
  color: var(--tx);
  background: var(--bg3);
}
.row.drop-before {
  box-shadow: inset 0 2px 0 var(--ac);
}
.row.drop-after {
  box-shadow: inset 0 -2px 0 var(--ac);
}
.row.drop-in {
  background: var(--acbg);
  outline: 1px dashed var(--ac);
}

/* Library */
.lib-cats {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0 12px 10px;
}
.lib-cats button {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--tx2);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
  font-weight: 550;
}
.lib-cats button.is-on {
  background: var(--tx);
  color: var(--bg1);
  border-color: transparent;
}
.lib-grid {
  display: grid;
  gap: 12px;
}
.lib-c {
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--line);
  cursor: grab;
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.lib-c:hover {
  border-color: var(--acln);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.6);
}
.lib-th {
  height: 150px;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.lib-c.is-tall .lib-th {
  height: 220px;
}
.lib-th iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 1100px;
  border: 0;
  transform: scale(0.232);
  transform-origin: 0 0;
  pointer-events: none;
}
.lib-c.is-tall .lib-th iframe {
  height: 2400px;
}
.lib-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
}
.lib-meta b {
  font-size: 12.5px;
  font-weight: 600;
  flex: 1;
}
.lib-meta small {
  display: block;
  font-size: 11px;
  color: var(--tx3);
  flex-basis: 100%;
}
.is-pages .lib-meta {
  flex-wrap: wrap;
}
.lib-add {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--acbg);
  color: var(--ac2);
  opacity: 0;
  transition: 0.2s;
}
.lib-c:hover .lib-add {
  opacity: 1;
}
.mine {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mine-i {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
}
.mine-i > div {
  flex: 1;
  min-width: 0;
}
.mine-i b {
  display: block;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mine-i small {
  color: var(--tx3);
  font-size: 11px;
}
.mine-ic {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--bg3);
  color: var(--tx2);
}

/* Stage & canvas */
.stage {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--bg0);
}
.stage-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.stage:not(.dev-d) .stage-scroll {
  padding: 10px 0;
}
.frame-wrap {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stage:not(.dev-d) .frame-wrap {
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--line2),
    0 30px 80px -30px rgba(0, 0, 0, 0.7);
}
.frame {
  border: 0;
  display: block;
  transform-origin: 0 0;
  background: #fff;
}
.frame-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg0);
  color: var(--tx3);
  font-weight: 600;
}
.frame-loading .spin {
  width: 22px;
  height: 22px;
}
.dev-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg1);
  border: 1px solid var(--line2);
  color: var(--tx2);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 99px;
  box-shadow: var(--sh-pop);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.dnd-cover {
  position: absolute;
  inset: 0;
  z-index: 30;
  cursor: grabbing;
}
.dnd-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  pointer-events: none;
  background: var(--acb);
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none;
}
body.is-scrubbing,
body.is-scrubbing * {
  cursor: ew-resize !important;
  user-select: none;
}

/* Overlay */
.ovl {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}
.ovl-box {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  border-radius: 2px;
  will-change: transform;
}
.ovl-box.is-hover {
  box-shadow: 0 0 0 1px var(--acln);
}
.ovl-box.is-sel {
  box-shadow:
    0 0 0 2px var(--ac),
    0 0 0 4px rgba(14, 116, 144, 0.18);
}
.ovl-box.is-sel.is-con {
  box-shadow:
    0 0 0 2px var(--ac),
    inset 0 0 0 9999px rgba(14, 116, 144, 0.035);
}
.ovl-box.is-sel.is-editing {
  box-shadow: 0 0 0 2px #22c1a2;
}
.ovl-box.is-parent {
  outline: 1px dashed var(--acln);
  outline-offset: 0;
}
.ovl-tag {
  position: absolute;
  left: -1px;
  top: -19px;
  background: var(--acln);
  color: #fff;
  font: 600 10.5px/1 var(--font);
  padding: 4px 6px;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
}
.ovl-box.is-hover:not([style*='height:0']) .ovl-tag:empty {
  display: none;
}
.ovl-bar {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  align-items: center;
  gap: 1px;
  height: 26px;
  padding: 0 2px;
  background: var(--acb);
  border-radius: 4px;
  pointer-events: auto;
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.45);
  will-change: transform;
  z-index: 3;
}
.ovl-bar button {
  height: 22px;
  min-width: 22px;
  padding: 0 5px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  font: 600 11.5px/1 var(--font);
}
.ovl-bar button:hover {
  background: rgba(0, 0, 0, 0.12);
}
.ovl-bar .ovl-drag {
  cursor: grab;
}
.ovl-name {
  padding-right: 8px !important;
  border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px 0 0 4px !important;
  margin-right: 2px;
}
.ovl-bar [data-tip]:hover::after {
  top: auto;
  bottom: calc(100% + 8px);
}
.ovl-drop {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  background: var(--ac);
  border-radius: 3px;
  z-index: 4;
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.25);
}
.ovl-drop.is-inside {
  background: rgba(14, 116, 144, 0.1);
  box-shadow: inset 0 0 0 2px var(--ac);
  border-radius: 4px;
}
.ovl-drop.is-h::before,
.ovl-drop.is-h::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ac);
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
}
.ovl-drop.is-h::after {
  left: 100%;
}
.itb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px;
  background: var(--bg1);
  border: 1px solid var(--line2);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  will-change: transform;
}
.itb button {
  width: 30px;
  height: 28px;
  border: 0;
  background: none;
  color: var(--tx2);
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.itb button:hover {
  background: var(--bg3);
  color: var(--tx);
}
.itb i {
  width: 1px;
  height: 18px;
  background: var(--line2);
  margin: 0 3px;
}
.itb .itb-done {
  width: auto;
  padding: 0 10px;
  background: #22c1a2;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  margin-left: 4px;
}
.itb .itb-done:hover {
  background: #1eaa8f;
  color: #fff;
}

/* Breadcrumb */
.crumb {
  height: 30px;
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 10px;
  background: var(--bg1);
  border-top: 1px solid var(--line);
  color: var(--tx3);
  font-size: 11.5px;
  overflow: hidden;
  white-space: nowrap;
}
.crumb button {
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.crumb button:hover {
  background: var(--bg3);
  color: var(--tx);
}
.crumb button.is-cur {
  color: var(--ac2);
  font-weight: 600;
}
.crumb-sp {
  flex: 1;
}
.crumb-n {
  font-variant-numeric: tabular-nums;
}

/* Inspector */
.insp {
  width: var(--right);
  flex: 0 0 var(--right);
  background: var(--bg1);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.insp-none {
  flex: 1;
  overflow-y: auto;
}
.insp-hint {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 4px;
  background: var(--acbg);
  color: var(--tx2);
  margin: 0 0 14px;
  font-size: 12px;
}
.insp-hint .ic {
  color: var(--ac2);
}
.insp-h {
  padding: 12px 14px 8px;
}
.insp-crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--tx3);
  font-size: 11px;
  margin-bottom: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.insp-crumbs button {
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 4px;
  font-size: 11px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.insp-crumbs button:hover {
  color: var(--tx);
}
.insp-crumbs button.is-cur {
  color: var(--tx2);
}
.insp-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.insp-ic {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--acbg);
  color: var(--ac2);
  flex: 0 0 auto;
}
.insp-name {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  cursor: text;
  padding: 4px 6px;
  margin-left: -6px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.insp-name:hover {
  background: var(--bg2);
}
.insp-title input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--ac);
  border-radius: 4px;
  background: var(--bg2);
  padding: 0 8px;
  font-weight: 700;
  outline: none;
}
.insp-act {
  display: flex;
  gap: 2px;
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border: 0;
  background: none;
  color: var(--tx3);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.tabs button:hover {
  color: var(--tx);
}
.tabs button.is-on {
  color: var(--tx);
  border-color: var(--ac);
}
.tabs.is-sm {
  padding: 0 8px;
}
.tabs.is-sm button {
  height: 32px;
  font-size: 12px;
}
.insp-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 40px;
  min-height: 0;
}

/* Sections */
.sec {
  border-bottom: 1px solid var(--line);
}
.sec-h {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 650;
  font-size: 12.5px;
  color: var(--tx);
  text-align: left;
}
.sec-h:hover {
  background: var(--bg2);
}
.sec-chev {
  color: var(--tx3);
  transition: transform 0.18s;
}
.sec.is-open .sec-chev {
  transform: rotate(90deg);
}
.sec-h span {
  flex: 1;
}
.sec-r {
  flex: 0 !important;
}
.sec-b {
  padding: 2px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: secIn 0.18s ease;
}
@keyframes secIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}

/* Fields */
.fld {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.fld.is-stack {
  grid-template-columns: 1fr;
  gap: 6px;
}
.fld-l {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.fld-l label {
  font-size: 12px;
  color: var(--tx2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.fld-l label.is-scrub {
  cursor: ew-resize;
}
.fld-l label.is-scrub:hover {
  color: var(--ac2);
}
.fld-dev {
  color: var(--tx3);
  display: flex;
}
.fld-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
  border: 0;
  padding: 0;
}
.fld-dot.is-set {
  background: var(--ac);
  cursor: pointer;
}
.fld-dot.is-set:hover {
  background: var(--err);
}
.fld-dot.is-inh {
  background: var(--warn);
  opacity: 0.75;
}
.fld-x {
  margin-left: auto;
}
.fld-c {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fld-help {
  font-size: 11.5px;
  color: var(--tx3);
  line-height: 1.45;
}
.fld input:not([type='range']):not([type='checkbox']):not([type='color']),
.fld select,
.fld textarea,
.lbl input,
.lbl select,
.grp-f input:not([type='range']):not([type='color']),
.grp-f select,
.grp-f textarea,
.cond input,
.cond select,
.conds-top select,
.ds-tr-g select,
.tplp select,
.dyn-opts input,
.gal-ed input,
.lnk-opts input,
.ai-in,
.cls-add input,
.ds-n,
.ds-cl input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  outline: none;
  transition:
    border-color 0.15s,
    background 0.15s;
  min-width: 0;
}
.fld textarea,
.grp-f textarea,
.ai-in {
  height: auto;
  padding: 8px 9px;
  resize: vertical;
  line-height: 1.5;
}
.fld input:hover,
.fld select:hover,
.fld textarea:hover {
  border-color: var(--line2);
}
.fld input:focus,
.fld select:focus,
.fld textarea:focus,
.grp-f input:focus,
.grp-f textarea:focus,
.grp-f select:focus,
.cond input:focus,
.ai-in:focus {
  border-color: var(--ac);
  background: var(--bg1);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b91a3' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  padding-right: 26px !important;
  cursor: pointer;
}
textarea.code {
  font: 12px/1.55 var(--mono);
  tab-size: 2;
  min-height: 110px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg0);
  color: var(--tx);
  outline: none;
  resize: vertical;
}
textarea.code:focus {
  border-color: var(--ac);
}
.in-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.in-row > input,
.in-row > select {
  flex: 1;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.grid2 .fld {
  grid-template-columns: 1fr;
  gap: 4px;
}
.grid2 .fld-l label {
  font-size: 11px;
  color: var(--tx3);
}
.sub-h {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  margin-top: 6px;
}
.note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 10px;
  border-radius: 4px;
  background: var(--bg2);
  color: var(--tx2);
  font-size: 11.5px;
  line-height: 1.5;
}
.note .ic {
  color: var(--ac2);
  margin-top: 1px;
}
.note.warn .ic {
  color: var(--warn);
}
.note.warn {
  margin: 0 12px 8px;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--tx2);
}
.empty b {
  font-size: 13px;
  color: var(--tx);
}
.empty p {
  margin: 0;
  font-size: 12px;
  color: var(--tx3);
  line-height: 1.5;
  max-width: 240px;
}
.empty-ic {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--bg2);
  color: var(--tx3);
}

/* Segmented, switch, unit, slider */
.seg {
  display: inline-flex;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px;
  gap: 2px;
  max-width: 100%;
  flex-wrap: wrap;
}
.seg.is-full {
  display: flex;
  width: 100%;
}
.seg.is-full button {
  flex: 1;
}
.seg button {
  border: 0;
  background: none;
  color: var(--tx3);
  border-radius: 4px;
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.12s;
  flex: 1 1 auto;
  min-width: 28px;
}
.seg.s-sm button {
  height: 24px;
  padding: 0 7px;
}
.seg button.has-ic {
  padding: 0;
  width: 30px;
  flex: 0 0 30px;
}
.seg button:hover {
  color: var(--tx);
}
.seg button.is-on {
  background: var(--bg4);
  color: var(--tx);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
[data-theme='light'] .seg button.is-on {
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 24, 40, 0.15);
}
.sw {
  width: 34px;
  height: 20px;
  border-radius: 99px;
  border: 0;
  background: var(--bg4);
  position: relative;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: background 0.2s;
}
.sw i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.6, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.sw.is-on {
  background: var(--ac);
}
.sw.is-on i {
  transform: translateX(14px);
}
.unit {
  display: flex;
  align-items: center;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  overflow: hidden;
  transition: border-color 0.15s;
  min-width: 0;
}
.unit:focus-within {
  border-color: var(--ac);
  background: var(--bg1);
}
.unit input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0 !important;
  background: none !important;
  padding: 0 8px !important;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.unit-u {
  flex: 0 0 auto;
  height: 100%;
  border: 0 !important;
  border-left: 1px solid var(--line) !important;
  background: none !important;
  color: var(--tx3);
  font-size: 11px;
  font-weight: 600;
  padding: 0 18px 0 6px !important;
  background-position: right 4px center !important;
  width: auto !important;
  border-radius: 0 !important;
}
.sld {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sld .unit {
  width: 92px;
  flex: 0 0 92px;
}
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 40px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ac) var(--p, 0%), var(--bg4) var(--p, 0%));
  outline: none;
  cursor: pointer;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow:
    0 0 0 3px var(--ac),
    0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: grab;
}
input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 3px var(--ac);
}
.multi {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.multi button {
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--tx2);
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.multi button:hover {
  color: var(--tx);
  border-color: var(--tx3);
}
.multi button.is-on {
  background: var(--tx);
  border-color: var(--tx);
  color: var(--bg1);
}
.multi button.is-on::before {
  content: '✓ ' / '';
  font-weight: 700;
}
.multi.xs button {
  padding: 3px 7px;
}
.sel-btn {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  cursor: pointer;
  color: var(--tx);
  text-align: left;
}
.sel-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sel-btn:hover {
  border-color: var(--line2);
}

/* Color */
.clr {
  display: flex;
  align-items: center;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  overflow: hidden;
  min-width: 0;
}
.clr-sw {
  width: 30px;
  height: 30px;
  border: 0;
  padding: 5px;
  background: none;
  cursor: pointer;
  flex: 0 0 30px;
}
.clr-sw i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  background-image: var(--checker);
}
.clr-sw i {
  background-blend-mode: normal;
}
.clr-sw.is-empty i {
  background: var(--checker) !important;
  opacity: 0.6;
}
.clr-txt {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  padding: 0 6px;
  font: 12px var(--mono);
  color: var(--tx);
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}
.clr-txt .ic {
  color: var(--ac2);
}
.clr-x {
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 0 8px;
  height: 100%;
}
.clr-x:hover {
  color: var(--err);
}
.pop {
  position: fixed;
  z-index: 1500;
  background: var(--bg1);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  padding: 10px;
  animation: popIn 0.14s ease;
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
.cp {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cp-sv {
  position: relative;
  height: 150px;
  border-radius: 4px;
  cursor: crosshair;
  background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent) !important;
  background-blend-mode: normal;
}
.cp-sv {
  background-image: linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.cp-sv i {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 2px 6px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cp-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cp-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cp-eye {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--tx2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cp-hue,
.cp-alpha {
  position: relative;
  height: 10px;
  border-radius: 4px;
  cursor: pointer;
}
.cp-hue {
  background: linear-gradient(90deg, red, #ff0, lime, cyan, blue, #f0f, red);
}
.cp-alpha {
  background: linear-gradient(90deg, transparent, var(--c)), var(--checker);
}
.cp-hue i,
.cp-alpha i {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 1px 4px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cp-in {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cp-in input {
  flex: 1;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  padding: 0 8px;
  font: 12px var(--mono);
  outline: none;
}
.cp-in input:focus {
  border-color: var(--ac);
}
.cp-in span {
  font-size: 11.5px;
  color: var(--tx3);
  width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cp-h {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  margin-top: 2px;
}
.cp-sws {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cp-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.15);
  transition: transform 0.12s;
}
.cp-swatch:hover {
  transform: scale(1.12);
}
.cp-swatch.is-on {
  box-shadow:
    0 0 0 2px var(--bg1),
    0 0 0 4px var(--ac);
}
.cp-swatch.s-sm {
  width: 18px;
  height: 18px;
}
.ge {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ge-bar {
  position: relative;
  height: 24px;
  border-radius: 4px;
  cursor: copy;
  margin: 0 8px;
}
.ge-bar i {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  cursor: grab;
}
.ge-bar i.is-on {
  box-shadow:
    0 0 0 2px var(--ac),
    0 1px 4px rgba(0, 0, 0, 0.4);
}
.ge-row,
.ge-stop {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ge-ang,
.ge-pos {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ge-ang .unit,
.ge-pos .unit {
  width: 64px;
}
.ge-l {
  font-size: 11.5px;
  color: var(--tx3);
  flex: 1;
}
.ge-lite {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ge-lite input[type='color'] {
  width: 34px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px;
  background: var(--bg2);
  cursor: pointer;
}
.ge-hex {
  flex: 1;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  padding: 0 8px;
  font: 12px var(--mono);
  outline: none;
  min-width: 0;
}
.gt {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Media, gallery, icons, link */
.media {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.media-th {
  position: relative;
  height: 130px;
  border-radius: 4px;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  background: var(--checker);
  padding: 0;
  display: grid;
  place-items: center;
}
.media-th img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.media-th.is-empty {
  background: var(--bg2);
  border-style: dashed;
  color: var(--tx3);
}
.media-th.is-empty span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
}
.media-th:hover {
  border-color: var(--acln);
}
.media-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--tx2);
  word-break: break-all;
}
.media-act {
  display: flex;
  gap: 4px;
  align-items: center;
}
.gal-g {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.gal-i {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  cursor: grab;
  outline: 2px solid transparent;
}
.gal-i.is-open {
  outline-color: var(--ac);
}
.gal-i img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gal-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
}
.gal-i:hover .gal-x {
  opacity: 1;
}
.gal-add {
  aspect-ratio: 1;
  border-radius: 4px;
  border: 1px dashed var(--line2);
  background: var(--bg2);
  color: var(--tx3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
}
.gal-add:hover {
  color: var(--ac2);
  border-color: var(--ac);
}
.gal-foot {
  font-size: 11px;
  color: var(--tx3);
}
.gal-ed {
  margin-top: 8px;
  padding: 10px;
  border-radius: 4px;
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gal-ed-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gal-ed label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--tx2);
}
.icn {
  display: flex;
  align-items: center;
  gap: 6px;
}
.icn-th {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--tx);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icn-th svg,
.icn-th img {
  width: 22px;
  height: 22px;
}
.icn-th .ph {
  font-size: 10px;
}
.icon-modal .modal-b {
  padding: 0;
}
.im-top {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.im-top .search {
  flex: 1;
  margin: 0;
}
.im-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 4px;
  padding: 14px 18px;
  max-height: 56vh;
  overflow-y: auto;
}
.im-i {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  cursor: pointer;
  color: var(--tx);
}
.im-i:hover {
  background: var(--bg2);
  border-color: var(--line);
}
.im-i.is-on {
  border-color: var(--ac);
  background: var(--acbg);
}
.im-i svg {
  width: 22px;
  height: 22px;
}
.im-i span {
  font-size: 10px;
  color: var(--tx3);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.im-load,
.im-none {
  padding: 40px;
  text-align: center;
  color: var(--tx3);
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  grid-column: 1/-1;
}
.lnk {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lnk-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.lnk-in {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--tx3);
  min-width: 0;
}
.lnk-in:focus-within {
  border-color: var(--ac);
}
.lnk-in input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  outline: none;
}
.lnk-sugg {
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  z-index: 50;
  background: var(--bg1);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  padding: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.lnk-sugg button,
.pick-res button,
.font-i {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 4px;
  background: none;
  cursor: pointer;
  text-align: left;
  color: var(--tx);
  font-size: 12.5px;
}
.lnk-sugg button:hover,
.pick-res button:hover,
.font-i:hover {
  background: var(--bg3);
}
.lnk-sugg span,
.pick-res span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lnk-sugg small,
.pick-res small {
  color: var(--tx3);
  font-size: 11px;
}
.lnk-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  border-radius: 4px;
  background: var(--bg2);
}
.lnk-opts label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--tx2);
}
.font-list {
  max-height: 320px;
  overflow-y: auto;
  margin: 0 -4px;
}
.font-h {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  padding: 8px 9px 4px;
}
.font-i.is-on {
  background: var(--acbg);
  color: var(--ac2);
}
.dyn-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--tx3);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.dyn-btn:hover {
  color: #f0b429;
  border-color: #f0b42966;
}
.dyn-list {
  max-height: 340px;
  overflow-y: auto;
  margin: 0 -4px;
}
.dyn-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.dyn-chip-b {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #f0b42955;
  background: rgba(240, 180, 41, 0.1);
  color: #f0b429;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}
.dyn-chip-b span {
  flex: 1;
  text-align: left;
}
.dyn-chip-x {
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.dyn-opts {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  background: var(--bg2);
  border-radius: 4px;
}
.dyn-opts label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--tx3);
}
.pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pick-res {
  max-height: 180px;
  overflow-y: auto;
  border-radius: 4px;
  background: var(--bg2);
  padding: 3px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 4px 0 9px;
  border-radius: 99px;
  background: var(--bg3);
  font-size: 11.5px;
  font-weight: 550;
}
.chip small {
  color: var(--tx3);
}
.chip button {
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  padding: 0;
}
.chip button:hover {
  background: var(--bg4);
  color: var(--tx);
}
.tplp {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tplp-act {
  display: flex;
  gap: 4px;
}

/* Repeater & group */
.rep {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rep-i {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  transition: border-color 0.15s;
}
.rep-i.is-open {
  border-color: var(--line2);
  background: var(--bg1);
}
.rep-i.is-over {
  border-color: var(--ac);
}
.rep-h {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 2px;
  height: 34px;
}
.rep-grip {
  color: var(--tx3);
  cursor: grab;
  padding: 4px;
  display: flex;
}
.rep-t {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-weight: 550;
  font-size: 12.5px;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 100%;
}
.rep-b {
  padding: 4px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-top: 1px solid var(--line);
}
.rep-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: 1px dashed var(--line2);
  border-radius: 4px;
  background: none;
  color: var(--tx2);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: 0.15s;
  width: 100%;
}
.rep-add:hover {
  border-color: var(--ac);
  color: var(--ac2);
  background: var(--acbg);
}
.grp {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
}
.grp-f {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 8px;
}
.grp-f.is-stack {
  grid-template-columns: 1fr;
}
.grp-f > label {
  font-size: 11.5px;
  color: var(--tx2);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.rich {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  overflow: hidden;
}
.rich:focus-within {
  border-color: var(--ac);
}
.rich-bar {
  display: flex;
  gap: 1px;
  padding: 3px;
  border-bottom: 1px solid var(--line);
}
.rich-bar button {
  width: 26px;
  height: 24px;
  border: 0;
  background: none;
  color: var(--tx2);
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.rich-bar button:hover {
  background: var(--bg3);
  color: var(--tx);
}
.rich-ed {
  min-height: 110px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 10px;
  outline: none;
  line-height: 1.55;
  font-size: 12.5px;
}
.rich-ed p {
  margin: 0 0 8px;
}
.rich-ed a {
  color: var(--ac2);
}

/* Style tab */
.st-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg1);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.st-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.st-part {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--tx2);
  border-radius: 99px;
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}
.st-part.is-on {
  background: var(--acb);
  border-color: transparent;
  color: var(--ink);
}
.st-part.has-v::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ac2);
}
.st-part.is-on.has-v::after {
  background: #fff;
}
.st-states {
  display: flex;
  align-items: center;
  gap: 2px;
}
.st-states button {
  border: 0;
  background: none;
  color: var(--tx3);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}
.st-states button:hover {
  color: var(--tx);
}
.st-states button.is-on {
  background: var(--bg3);
  color: var(--tx);
}
.st-states button.has-v::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ac2);
}
.st-dev {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--tx3);
  font-weight: 600;
}
.cls {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cls-l {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--tx2);
}
.cls-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip.is-cls {
  background: var(--acbg);
  color: var(--ac);
  font-family: var(--mono);
}
.chip.is-add {
  border: 1px dashed var(--line2);
  background: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 0 9px;
  gap: 4px;
}
.chip.is-add:hover {
  color: var(--ac2);
  border-color: var(--ac);
}
.cls-add {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cls-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 160px;
  overflow-y: auto;
}
.cls-list button {
  border: 0;
  background: none;
  text-align: left;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font: 12px var(--mono);
  color: var(--tx2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cls-list button:hover {
  background: var(--bg3);
}
.cls-list .is-new {
  color: var(--ac2);
  font-family: var(--font);
  font-weight: 600;
}
.cls-hint {
  font-size: 11px;
  color: var(--tx3);
}
.bm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bm-margin,
.bm-padding {
  position: relative;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 62px 1fr 62px;
  grid-template-rows: 34px 1fr 34px;
  align-items: center;
  justify-items: center;
}
.bm-margin {
  background: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(245, 184, 61, 0.06) 5px 10px), var(--bg2);
  border: 1px dashed var(--line2);
  padding: 4px;
}
.bm-padding {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  background: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(61, 214, 140, 0.07) 5px 10px), var(--bg1);
  border: 1px dashed var(--line2);
  min-height: 118px;
}
.bm-core {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  height: 28px;
  border-radius: 4px;
  background: var(--bg3);
}
.bm-lab {
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.bm-in .unit {
  width: 56px;
  height: 26px;
  background: transparent;
  border-color: transparent;
}
.bm-in .unit:hover {
  border-color: var(--line2);
  background: var(--bg2);
}
.bm-in .unit:focus-within {
  background: var(--bg1);
}
.bm-in .unit input {
  text-align: center;
  padding: 0 2px !important;
  font-size: 12px;
}
.bm-in .unit-u {
  display: none;
}
.bm-in.is-set .unit input {
  color: var(--ac2);
  font-weight: 650;
}
.bm-top {
  grid-column: 2;
  grid-row: 1;
}
.bm-bottom {
  grid-column: 2;
  grid-row: 3;
}
.bm-left {
  grid-column: 1;
  grid-row: 2;
}
.bm-right {
  grid-column: 3;
  grid-row: 2;
}
.bm-link {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.bm-link.is-on {
  background: var(--acb);
  color: var(--ink);
}
.bm-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.bm-presets button {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--tx2);
  border-radius: 4px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.bm-presets button:hover {
  border-color: var(--ac);
  color: var(--ac2);
}
.quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.p2 {
  display: flex;
  align-items: center;
  gap: 4px;
}
.p2 small {
  font-size: 10px;
  color: var(--tx3);
  width: 16px;
}
.p2 .unit {
  flex: 1;
}
.shd {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
}
.shd-g {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.shd-g label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shd-g small {
  font-size: 9.5px;
  color: var(--tx3);
  font-weight: 700;
}
.shd-c {
  display: flex;
  gap: 6px;
  align-items: center;
}
.shd-c .clr {
  flex: 1;
}
.shd-in {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 11px;
  color: var(--tx2);
}
.shd-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hide-dev {
  display: flex;
  gap: 4px;
}
.hide-dev button {
  position: relative;
  width: 38px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--tx3);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hide-dev button.is-on {
  background: var(--acbg);
  border-color: var(--acln);
  color: var(--ac2);
}
.hd-x {
  position: absolute;
  bottom: 2px;
  right: 2px;
  opacity: 0;
}
.hide-dev button.is-on .hd-x {
  opacity: 1;
}
.conds {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
}
.conds-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  flex-wrap: wrap;
}
.conds-h span {
  color: var(--tx3);
  font-size: 11px;
  flex-basis: 100%;
}
.conds-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--tx2);
}
.conds-top select {
  width: auto !important;
  flex: 1;
}
.cond {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px;
  border-radius: 4px;
  background: var(--bg1);
  border: 1px solid var(--line);
  position: relative;
  padding-right: 30px;
}
.cond > select,
.cond > input {
  flex: 1 1 120px;
}
.cond .op {
  flex: 0 0 96px;
}
.cond-x {
  position: absolute;
  top: 8px;
  right: 6px;
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.cond-x:hover {
  color: var(--err);
}
.el-id {
  padding: 14px;
  font-size: 11.5px;
  color: var(--tx3);
}
.el-id code {
  cursor: copy;
  color: var(--tx2);
  background: var(--bg2);
  padding: 2px 6px;
  border-radius: 4px;
}
.multi-sel {
  padding: 20px 14px;
}
.multi-act {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.multi-act .btn {
  justify-content: flex-start;
}

/* Design panel */
.ds-colors {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-c {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 6px;
}
.ds-c .clr {
  width: 44px;
}
.ds-c .clr-txt,
.ds-c .clr-x {
  display: none;
}
.ds-c code {
  font-size: 10.5px;
  color: var(--tx3);
}
.ds-n {
  height: 30px !important;
}
.ds-pal {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pal {
  display: flex;
  align-items: center;
  gap: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  cursor: pointer;
  overflow: hidden;
  padding: 0 10px 0 0;
}
.pal i {
  width: 22px;
  height: 100%;
}
.pal span {
  margin-left: 10px;
  font-weight: 600;
  font-size: 12px;
}
.pal:hover {
  border-color: var(--acln);
}
.ds-type {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ds-tr {
  padding: 10px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ds-tr-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ds-tr-h b {
  font-size: 12.5px;
}
.ds-tr-g {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 0.8fr;
  gap: 4px;
}
.ds-tr-g select {
  height: 30px !important;
  font-size: 11.5px;
}
.ds-tr-g .unit {
  height: 30px;
}
.ds-cls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-cl {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 6px;
  align-items: center;
}
.ds-cl code {
  color: #3dd68c;
}
.ds-cl small {
  color: var(--tx3);
  font-size: 11px;
}

/* History */
.hist {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hist-i {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 4px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--tx2);
  cursor: pointer;
  font-size: 12.5px;
  width: 100%;
}
.hist-i span {
  flex: 1;
}
.hist-i small {
  color: var(--tx3);
  font-size: 11px;
}
button.hist-i:hover {
  background: var(--bg2);
  color: var(--tx);
}
.hist-i.is-cur {
  color: var(--ac2);
  font-weight: 650;
  background: var(--acbg);
}
.hist-i.is-future {
  opacity: 0.45;
  cursor: default;
}
.rev {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 4px;
  background: var(--bg2);
  margin-bottom: 6px;
}
.rev img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
.rev > div {
  flex: 1;
}
.rev b {
  display: block;
  font-size: 12px;
}
.rev small {
  color: var(--tx3);
  font-size: 11px;
}

/* AI */
.ai-in {
  margin-bottom: 10px;
}
.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
.ai-quick button {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--tx2);
  border-radius: 99px;
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
}
.ai-quick button:hover:not(:disabled) {
  border-color: var(--ac);
  color: var(--ac2);
}
.ai-res {
  margin-top: 12px;
  padding: 12px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
}
.ai-res p {
  margin: 0 0 10px;
  white-space: pre-wrap;
  line-height: 1.55;
}
.pop-set {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Menus, modals, palette, toasts */
.menu {
  position: fixed;
  z-index: 1600;
  background: var(--bg1);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  padding: 5px;
  animation: popIn 0.12s ease;
}
.menu-h {
  padding: 7px 10px 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-i {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--tx);
  cursor: pointer;
  text-align: left;
  font-size: 12.5px;
}
.menu-i span {
  flex: 1;
}
.menu-i .ic {
  color: var(--tx3);
}
.menu-i kbd {
  font-size: 10px;
  padding: 2px 5px;
}
.menu-i:hover,
.menu-i.is-hi {
  background: var(--bg3);
}
.menu-i.is-danger {
  color: var(--err);
}
.menu-i.is-danger .ic {
  color: var(--err);
}
.menu-i:disabled {
  opacity: 0.4;
}
.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 2px;
}
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(5, 6, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-wrap.is-top {
  align-items: flex-start;
  padding-top: 12vh;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.modal {
  max-width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--bg1);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  animation: modalIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
.modal-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-h h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}
.modal-ic {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--acbg);
  color: var(--ac2);
}
.modal-b {
  padding: 18px;
  overflow-y: auto;
  line-height: 1.6;
  color: var(--tx2);
}
.modal-b p {
  margin: 0 0 12px;
}
.modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.lbl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  margin-bottom: 14px;
}
.hint {
  font-size: 12px;
  color: var(--tx3);
}
.err {
  color: var(--err);
  font-size: 12px;
}
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  border: 1.5px dashed var(--line2);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  color: var(--tx2);
}
.drop:hover {
  border-color: var(--ac);
  background: var(--acbg);
}
.drop .ic {
  color: var(--ac2);
}
.drop span {
  font-size: 12px;
  color: var(--tx3);
}
.lock-u {
  display: flex;
  gap: 14px;
  align-items: center;
}
.lock-u img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
}
.sc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.sc-grid h4 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
}
.sc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--tx);
}
.welcome .modal-b {
  padding: 22px;
}
.wel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.wel-grid button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px 18px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg2);
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
}
.wel-grid button:hover {
  border-color: var(--ac);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -16px var(--acln);
}
.wel-grid .ic {
  color: var(--ac2);
}
.wel-grid b {
  font-size: 14px;
  color: var(--tx);
}
.wel-grid span {
  font-size: 12px;
  color: var(--tx3);
  line-height: 1.45;
}
.wel-tips {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 18px;
  font-size: 12px;
  color: var(--tx3);
}
.pal-box {
  width: 640px;
  max-width: 100%;
  background: var(--bg1);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  overflow: hidden;
  animation: modalIn 0.18s ease;
}
.pal-in {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--line);
  color: var(--tx3);
}
.pal-in input {
  flex: 1;
  border: 0;
  background: none;
  outline: none;
  font-size: 15px;
  height: 100%;
}
.pal-list {
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px;
}
.pal-g {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  padding: 10px 10px 4px;
}
.pal-i {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--tx);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.pal-i span {
  flex: 1;
}
.pal-i small {
  color: var(--tx3);
  font-size: 11px;
}
.pal-i .ic {
  color: var(--tx3);
}
.pal-i.is-hi {
  background: var(--acbg);
}
.pal-i.is-hi .ic {
  color: var(--ac2);
}
.pal-none {
  padding: 28px;
  text-align: center;
  color: var(--tx3);
}
.toasts {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--bg1);
  color: var(--tx);
  box-shadow: var(--sh-pop);
  font-weight: 550;
  font-size: 12.5px;
  max-width: 520px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast .ic {
  flex: 0 0 auto;
}
.t-ok .ic {
  color: var(--ok);
}
.t-err .ic {
  color: var(--err);
}
.t-warn .ic {
  color: var(--warn);
}
.t-info .ic {
  color: var(--ac2);
}
.toast button {
  border: 0;
  background: var(--acbg);
  color: var(--ac2);
  font-weight: 650;
  border-radius: 4px;
  padding: 4px 9px;
  cursor: pointer;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
}
.exit-preview {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  border: 0;
  background: var(--bg1);
  color: var(--tx);
  box-shadow: var(--sh-pop);
  cursor: pointer;
  font-weight: 600;
}
.app.is-preview .top {
  opacity: 0.96;
}

@media (max-width: 1280px) {
  :root {
    --left: 272px;
    --right: 292px;
  }
  .fld {
    grid-template-columns: 88px 1fr;
  }
}
@media (max-width: 1100px) {
  .doc-title {
    width: 160px;
  }
  .top .b-outline {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Accessibility: favorite star has a 24px target; button fill keeps white text ≥ 4.5:1 */
.wt-fav {
  min-width: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
}

/* Presence */
.presence {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
}
.pres-u {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--bg3);
  color: var(--tx);
  font: 700 12px var(--font);
  box-shadow: 0 0 0 2px var(--bg1);
  margin-left: -8px;
}
.pres-u:first-of-type {
  margin-left: 0;
}
.pres-u img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pres-u.is-req {
  box-shadow: 0 0 0 2px var(--acb);
}
.pres-u.is-more {
  font-size: 11px;
}
.pres-ro {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px 0 10px;
  border-radius: 99px;
  background: var(--acbg);
  color: var(--ac);
  font: 600 12px var(--font);
}
.pres-ro button {
  border: 0;
  background: var(--acb);
  color: var(--ink);
  font: 600 12px var(--font);
  border-radius: 99px;
  padding: 4px 10px;
  cursor: pointer;
}

/* Co-editing: collaborators' selections and presence */
.ovl-box.is-peer {
  box-shadow: 0 0 0 2px var(--pc);
}
.ovl-peer {
  position: absolute;
  left: -2px;
  top: -20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px 4px 4px 0;
  background: var(--pc);
  color: #fff;
  font: 600 11px/18px var(--font);
  white-space: nowrap;
}
.pres-co {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--acbg);
  color: var(--ac);
  font-size: 11.5px;
  font-weight: 600;
  margin-right: 4px;
}
.pres-u.is-co {
  box-shadow: 0 0 0 2px var(--pc);
}

/* Loading screen shown until the editor app mounts (kept last so it wins over the rules above). */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0e1211;
}
#nx-boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0e1211;
  z-index: 1;
  transition: opacity 0.3s;
}
#nx-boot i {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #3cc0d8;
  animation: nxb 1s ease-in-out infinite;
}
@keyframes nxb {
  50% {
    transform: scale(0.8) rotate(45deg);
    border-radius: 50%;
  }
}
html[data-theme='light'] #nx-boot,
html[data-theme='light'] body {
  background: #eff4f6;
}
