.editor-view .ed-props { background: #111114; border-left-color: #ffffff20; }
.editor-view .ed-props-tabs { padding: 14px 14px 0; }
.editor-view .ed-tabs-track { background: #18181b; border-color: #ffffff1c; box-shadow: none; }
.editor-view .ed-tabs-thumb { background: #26272d; border-color: #ffffff2d; box-shadow: none; }
.editor-view .ed-props-tabs button { min-height: 38px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-shadow: none; }
.editor-view .ed-props-tabs button.on { text-shadow: none; }
.editor-view .ed-tab-ico { filter: none; }
.editor-view .ed-props-tabs button.on .ed-tab-ico { color: var(--tab); filter: none; transform: none; }
.editor-view .ed-props-search { margin: 12px 14px 0; min-height: 42px; border-radius: 14px; background: #19191c; border-color: #ffffff20; box-shadow: none; }
.editor-view .ed-props-body { padding: 14px; gap: 10px; scrollbar-color: #ffffff42 transparent; }
.editor-view .ed-props .panel-fields { gap: 10px; }

/* Full-block tinted shells - soft wash per kind, no left accent strip */
.editor-view .ed-props .ed-card,
.editor-view .ed-props .field.ed-card,
.editor-view .ed-props .ed-card.kind-media,
.editor-view .ed-props .ed-card.kind-color,
.editor-view .ed-props .ed-card.ed-hue-field,
.editor-view .ed-props .ed-card.kind-toggle {
  --kind: #6b8fff;
  --kind-bg: #1a2238;
  --kind-bg-2: #141a2a;
  --kind-ink: #e8eeff;
  --kind-muted: #a8b4d4;
  --kind-input: #0e1422;
  --kind-line: color-mix(in srgb, var(--kind) 35%, #ffffff22);
  padding: 15px 16px;
  gap: 10px;
  border: 1px solid var(--kind-line);
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--kind) 22%, var(--kind-bg)), var(--kind-bg-2) 70%);
  color: var(--kind-ink);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--kind) 18%, transparent);
}
.editor-view .ed-props .ed-card::before,
.editor-view .ed-props .ed-card::after { display: none; }
.editor-view .ed-props .ed-card.kind-text {
  --kind: #6b8fff;
  --kind-bg: #1a2238;
  --kind-bg-2: #141a2a;
  --kind-ink: #e8eeff;
  --kind-muted: #a8b4d4;
  --kind-input: #0e1422;
}
.editor-view .ed-props .ed-card.kind-media {
  --kind: #ff7a35;
  --kind-bg: #2a1c14;
  --kind-bg-2: #1c140f;
  --kind-ink: #ffe8d8;
  --kind-muted: #d4b09a;
  --kind-input: #140e0a;
}
.editor-view .ed-props .ed-card.kind-color {
  --kind: #d35bf2;
  --kind-bg: #26142e;
  --kind-bg-2: #1a0f22;
  --kind-ink: #f6e5ff;
  --kind-muted: #c9a8d8;
  --kind-input: #120a18;
}
.editor-view .ed-props .label-row {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-shadow: none;
  color: var(--kind-ink);
}
.editor-view .ed-props .hint {
  font-size: 12px;
  color: var(--kind-muted);
  font-variant-numeric: tabular-nums;
}
.editor-view .ed-props .field input:not([type="range"]):not([type="file"]):not([type="color"]),
.editor-view .ed-props .field textarea {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--kind) 28%, #ffffff20);
  border-radius: 12px;
  background: var(--kind-input);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--kind-ink);
  font-size: 13px;
  font-weight: 500;
}
.editor-view .ed-props .field input:not([type="range"]):not([type="file"]):not([type="color"]):focus,
.editor-view .ed-props .field textarea:focus {
  border-color: color-mix(in srgb, var(--kind) 70%, #fff);
  background: color-mix(in srgb, var(--kind-input) 90%, #000);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kind) 22%, transparent);
}
.editor-view .ed-props .field input::placeholder,
.editor-view .ed-props .field textarea::placeholder {
  color: var(--kind-muted);
  opacity: 0.75;
}
.editor-view .ed-props .field textarea { min-height: 86px; }
.editor-view .ed-props .input-with-prefix {
  border: 1px solid color-mix(in srgb, var(--kind) 28%, #ffffff20);
  border-radius: 12px;
  background: var(--kind-input);
  box-shadow: none;
  backdrop-filter: none;
}
.editor-view .ed-props .input-with-prefix input { background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--kind-ink) !important; }
.editor-view .ed-props .file-drop,
.editor-view .ed-props .file-drop:hover {
  border-color: color-mix(in srgb, var(--kind) 30%, #ffffff24);
  border-radius: 12px;
  background: var(--kind-input);
  box-shadow: none;
  backdrop-filter: none;
}
.editor-view .ed-props .file-drop-ui { padding: 10px 12px; }
.editor-view .ed-props .file-drop-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--kind) 28%, #111);
  color: color-mix(in srgb, var(--kind) 70%, #fff);
  box-shadow: none;
}
.ed-draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #ffffff1f;
  border-radius: 10px;
  background: #ffffff0a;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
}
.ed-draft-reset {
  flex-shrink: 0;
  padding: 5px 9px;
  border: 1px solid #ffffff24;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ed-draft-reset:hover { background: #ffffff14; }

.editor-view .ed-props .file-drop-preview {
  width: 110px;
  height: 48px;
  border-radius: 10px;
  padding: 6px 8px;
  object-fit: contain;
  object-position: center;
  background: #fff !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1px #00000018;
}
.editor-view .ed-props .file-btn { font-size: 12px; font-weight: 650; letter-spacing: 0; color: var(--kind-ink); }
.editor-view .ed-props .file-name { font-size: 11px; font-weight: 450; color: var(--kind-muted); }

/* Compact on/off row - real switch, not a fat candy card. */
.editor-view .ed-props .ed-card.kind-toggle {
  --kind: #6b8fff;
  --kind-bg: #17181d;
  --kind-bg-2: #121318;
  --kind-ink: #edf0f7;
  --kind-muted: #9aa3b8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 0;
  padding: 12px 14px !important;
  cursor: pointer;
}
.editor-view .kind-toggle .ed-toggle-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--kind-ink);
}
.editor-view .kind-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.editor-view .kind-toggle .ed-toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #3a3d48;
  box-shadow: inset 0 0 0 1px #ffffff14;
  transition: background 140ms ease;
  flex: 0 0 auto;
}
.editor-view .kind-toggle .ed-toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform 140ms ease;
}
.editor-view .kind-toggle:has(input:checked) .ed-toggle-switch {
  background: #3d7bff;
}
.editor-view .kind-toggle:has(input:checked) .ed-toggle-switch::after {
  transform: translateX(18px);
}
.editor-view .kind-toggle:focus-within .ed-toggle-switch {
  box-shadow: inset 0 0 0 1px #ffffff22, 0 0 0 3px rgba(61, 123, 255, 0.28);
}

/* Hue = thin rainbow strip, not a purple color card with a fat slider. */
.editor-view .ed-props .ed-card.ed-hue-field {
  --kind: #8b93a7;
  --kind-bg: #17181d;
  --kind-bg-2: #121318;
  --kind-ink: #edf0f7;
  --kind-muted: #9aa3b8;
  gap: 8px;
  padding: 12px 14px !important;
  background: #17181d !important;
}
.editor-view .ed-hue-control {
  display: block;
  padding: 0;
  margin: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.editor-view .ed-hue-range,
.editor-view .ed-props .ed-hue-field .ed-hue-range,
.editor-view .ed-props .field.ed-hue-field input.ed-hue-range[type="range"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: block;
  width: 100%;
  height: 14px !important;
  min-height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  outline: 0 !important;
  cursor: pointer;
  background: linear-gradient(90deg, #ff2d2d, #ffe600, #23d160, #19d5ff, #3568ff, #d946ef, #ff2d2d) !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18) !important;
}
.editor-view .ed-props .ed-hue-field .ed-hue-range::-webkit-slider-runnable-track {
  height: 14px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ff2d2d, #ffe600, #23d160, #19d5ff, #3568ff, #d946ef, #ff2d2d) !important;
}
.editor-view .ed-props .ed-hue-field .ed-hue-range::-moz-range-track {
  height: 14px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ff2d2d, #ffe600, #23d160, #19d5ff, #3568ff, #d946ef, #ff2d2d) !important;
}
.editor-view .ed-props .ed-hue-field .ed-hue-range::-moz-range-progress {
  background: transparent !important;
}
.editor-view .ed-props .ed-hue-field .ed-hue-range::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 18px !important;
  height: 18px !important;
  margin-top: -2px !important;
  border: 2px solid #fff !important;
  border-radius: 999px !important;
  background: var(--hue-color, #fff) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.45) !important;
}
.editor-view .ed-props .ed-hue-field .ed-hue-range::-moz-range-thumb {
  width: 18px !important;
  height: 18px !important;
  border: 2px solid #fff !important;
  border-radius: 999px !important;
  background: var(--hue-color, #fff) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.45) !important;
}
.editor-view .ed-slider { display: flex; align-items: center; gap: 9px; height: 30px; margin: 2px 0 0; }
.editor-view .ed-slider::before, .editor-view .ed-slider-fill { display: none; }
.editor-view .ed-props .field input[type="range"]:not(.ed-hue-range) {
  --range-progress: 0%;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  flex: 1;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  cursor: pointer;
  touch-action: none;
}
.editor-view .ed-props .field input[type="range"]:not(.ed-hue-range)::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--kind) 80%, #fff) 0 var(--range-progress),
    #ffffff22 var(--range-progress)
  );
}
.editor-view .ed-props .field input[type="range"]:not(.ed-hue-range)::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--kind);
  box-shadow: 0 2px 6px #0008;
}
.editor-view .ed-props .field input[type="range"]:not(.ed-hue-range)::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #ffffff22;
}
.editor-view .ed-props .field input[type="range"]:not(.ed-hue-range)::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--kind) 80%, #fff);
}
.editor-view .ed-props .field input[type="range"]:not(.ed-hue-range)::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--kind);
  box-shadow: 0 2px 6px #0008;
}
.editor-view .ed-btn-export,
.editor-view .ed-btn-export--bar { border-radius: 14px; }

/* Fresher editor controls: no outlines, same roundness as the topbar. */
.editor-view {
  --ed-ui-radius: 20px;
}

.editor-view .ed-props-search,
.editor-view .ed-tabs-track,
.editor-view .ed-tabs-thumb,
.editor-view .ed-props-tabs button,
.editor-view .ed-props .ed-card,
.editor-view .ed-props .field.ed-card,
.editor-view .ed-props .ed-card.kind-media,
.editor-view .ed-props .ed-card.kind-color,
.editor-view .ed-props .field input:not([type="range"]):not([type="file"]),
.editor-view .ed-props .field textarea,
.editor-view .ed-props .input-with-prefix,
.editor-view .ed-props .file-drop,
.editor-view .ed-props .file-drop:hover,
.editor-view .ed-props .file-drop-ico,
.editor-view .ed-props .file-drop-preview,
.editor-view .ed-color-control,
.editor-view .ed-props .color-swatch,
.editor-view .ed-props .preset,
.editor-view .ed-draft-bar,
.editor-view .ed-draft-reset {
  border-radius: var(--ed-ui-radius) !important;
}

.editor-view .ed-props-search,
.editor-view .ed-tabs-track,
.editor-view .ed-tabs-thumb,
.editor-view .ed-props .ed-card,
.editor-view .ed-props .field.ed-card,
.editor-view .ed-props .ed-card.kind-media,
.editor-view .ed-props .ed-card.kind-color,
.editor-view .ed-props .field input:not([type="range"]):not([type="file"]),
.editor-view .ed-props .field textarea,
.editor-view .ed-props .input-with-prefix,
.editor-view .ed-props .file-drop,
.editor-view .ed-props .file-drop:hover,
.editor-view .ed-color-control,
.editor-view .ed-props .color-swatch,
.editor-view .ed-props .preset,
.editor-view .ed-draft-bar,
.editor-view .ed-draft-reset {
  border: 0 !important;
  outline: 0 !important;
}

.editor-view .ed-props .ed-card,
.editor-view .ed-props .field.ed-card,
.editor-view .ed-props .ed-card.kind-media,
.editor-view .ed-props .ed-card.kind-color,
.editor-view .ed-props .ed-card.ed-hue-field,
.editor-view .ed-props .ed-card.kind-toggle {
  padding: 16px;
  background:
    radial-gradient(120% 95% at 0% 0%, color-mix(in srgb, var(--kind) 18%, transparent), transparent 58%),
    linear-gradient(180deg, color-mix(in srgb, var(--kind-bg) 72%, #202026), var(--kind-bg-2));
  box-shadow: none !important;
}

.editor-view .ed-props .field input:not([type="range"]):not([type="file"]),
.editor-view .ed-props .field textarea,
.editor-view .ed-props .input-with-prefix,
.editor-view .ed-props .file-drop,
.editor-view .ed-props .file-drop:hover,
.editor-view .ed-color-control {
  background: color-mix(in srgb, var(--kind-input) 84%, #ffffff0a);
  box-shadow: none !important;
}

.editor-view .ed-props .field input:not([type="range"]):not([type="file"]):focus,
.editor-view .ed-props .field textarea:focus,
.editor-view .ed-props .input-with-prefix:focus-within,
.editor-view .ed-props-search:focus-within {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: color-mix(in srgb, var(--kind-input, #111827) 72%, #ffffff12);
}

.editor-view .ed-slider {
  height: 34px;
}

.editor-view .ed-slider-limits {
  display: none !important;
}

.editor-view .ed-props .hint[data-out] {
  min-width: 2ch;
  text-align: right;
}

.editor-view .ed-range-reset {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #ffffff12;
  color: var(--kind-muted);
  display: grid;
  place-items: center;
  box-shadow: none;
  opacity: 0.75;
}

.editor-view .ed-range-reset:hover:not(:disabled) {
  opacity: 1;
  color: var(--kind-ink);
  background: #ffffff1c;
}

.editor-view .ed-range-reset:disabled {
  opacity: 0.25;
}

.editor-view .ed-color-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.editor-view .ed-color-control .color-presets {
  grid-column: 1 / -1;
  gap: 7px;
}

.editor-view .ed-props .color-swatch {
  width: 54px;
  height: 54px;
  box-shadow: none;
}

.editor-view .ed-props .color-swatch:hover {
  transform: translateY(-1px);
}

.editor-view .ed-color-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--kind-ink);
  font-size: 13px;
  font-weight: 650;
}

.editor-view .ed-props .preset {
  width: 27px;
  height: 27px;
  box-shadow: none !important;
}

.editor-view .ed-props .preset.is-active {
  transform: scale(1.08);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.82) !important;
}

/* Hue strip overrides live near .ed-hue-field above - keep media preview solid white. */
.editor-view .ed-props .kind-media .file-drop-preview {
  width: 110px !important;
  height: 48px !important;
  border-radius: 10px !important;
  background: #fff !important;
  background-image: none !important;
  padding: 6px 8px !important;
  object-fit: contain !important;
}

.ed-control-description{display:block;margin-top:10px;color:var(--muted);font-size:11px;line-height:1.6}

/* A percentage is a numeric target, not another copy field. */
.editor-view .ed-props .ed-card.kind-percent {
  --kind: #23cfa0;
  --kind-bg: #112a27;
  --kind-bg-2: #0d1d1d;
  --kind-ink: #e8fff8;
  --kind-muted: #91cdbd;
  --kind-input: #081817;
  gap: 11px;
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(35, 207, 160, 0.2), transparent 58%),
    linear-gradient(155deg, #16342f, #0d1d1d 72%) !important;
  box-shadow: inset 0 0 0 1px rgba(64, 226, 181, 0.18) !important;
}
.editor-view .ed-percent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  background: rgba(35, 207, 160, 0.13);
  color: #baffec;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.editor-view .ed-percent-badge > span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #23cfa0;
  color: #06241c;
  font-size: 11px;
  font-weight: 900;
}
.editor-view .ed-number-input {
  position: relative;
  display: block;
}
.editor-view .ed-props .kind-percent .ed-number-input input {
  min-height: 50px;
  padding-right: 52px !important;
  background: rgba(4, 18, 16, 0.72) !important;
  color: #f1fffb !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  font-variant-numeric: tabular-nums;
}
.editor-view .ed-number-suffix {
  position: absolute;
  top: 50%;
  right: 11px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(35, 207, 160, 0.16);
  color: #8ff0d4;
  font-size: 13px;
  font-weight: 850;
  pointer-events: none;
}
.editor-view .ed-percent-range {
  display: flex;
  justify-content: space-between;
  padding: 0 3px;
  color: var(--kind-muted);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* The white preview box hides white logos: the frame keeps the box, the image
   inside gets a soft outline-shadow so light artwork stays readable. */
.editor-view .ed-props .kind-media .file-drop-preview-frame {
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.editor-view .ed-props .file-drop-preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.55)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}
.editor-view .ed-props .file-drop-preview-frame[hidden] { display: none !important; }

/* Highlight control (Article Highlight): preview in the panel, marking in .hl-modal.
   The modal reuses the site dialog (.fm-dialog head, .btn-primary) at full screen. */
.editor-view .ed-props .ed-card.kind-highlight {
  --kind: #f5c542;
  --kind-bg: #2a2412;
  --kind-bg-2: #1c180d;
  --kind-ink: #fff4d6;
  --kind-muted: #d8c590;
  --kind-input: #14110a;
}
.ed-props .kind-highlight .label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ed-hl {
  --hl-color: #ffd84d;
  position: relative; width: fit-content; max-width: 100%; margin: 2px auto 0;
  border-radius: 10px; cursor: zoom-in; background: #fff;
  box-shadow: 0 0 0 1px #ffffff1f, 0 10px 28px #0007; transition: box-shadow .18s, transform .18s;
}
.ed-hl:hover, .ed-hl:focus-visible { outline: 0; transform: translateY(-1px); box-shadow: 0 0 0 2px var(--kind, #f5c542), 0 14px 32px #0008; }
.ed-hl-img { display: block; max-width: 100%; max-height: 260px; width: auto; height: auto; border-radius: 10px; pointer-events: none; user-select: none; }
.ed-hl-boxes, .hl-modal-boxes { position: absolute; inset: 0; }
/* A box previews the marker: the chosen colour multiplied over the page. */
.ed-hl-box { position: absolute; box-sizing: border-box; border-radius: 2px; }
.ed-hl-box::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--hl-color, #ffd84d); mix-blend-mode: multiply; opacity: .92;
}
.ed-hl-num {
  position: absolute; left: -7px; top: -7px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; background: #0b0b0e; color: #fff; font-size: 10px; font-weight: 800; line-height: 1;
  box-shadow: 0 0 0 1.5px var(--hl-color, #ffd84d); z-index: 1;
}
.ed-hl-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  padding: 7px 12px; border-radius: 999px; background: #000000b3; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
  opacity: 0; transition: opacity .2s;
}
.ed-hl.is-empty .ed-hl-empty { opacity: 1; }
.ed-hl-row { display: flex; gap: 8px; margin-top: 12px; }
.ed-hl-open, .ed-hl-clear {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; border: 0; border-radius: 12px; padding: 0 14px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700;
}
.ed-hl-open {
  position: relative; overflow: hidden; flex: 1; color: #1c1505;
  background: linear-gradient(135deg, color-mix(in srgb, var(--kind, #f5c542) 70%, #fff), var(--kind, #f5c542) 55%, color-mix(in srgb, var(--kind, #f5c542) 80%, #000));
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--kind, #f5c542) 60%, transparent), inset 0 1px 0 #ffffff59;
  transition: filter .18s, transform .18s;
}
.ed-hl-open::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #ffffff2e, transparent 45%); pointer-events: none; }
.ed-hl-open:hover { filter: brightness(1.06); }
.ed-hl-open:active { transform: scale(.98); }
.ed-hl-open svg { width: 16px; height: 16px; }
.ed-hl-clear { background: color-mix(in srgb, var(--kind, #f5c542) 14%, transparent); color: var(--kind-ink, #fff4d6); }
.ed-hl-clear:hover { background: color-mix(in srgb, var(--kind, #f5c542) 26%, transparent); }

/* Full-screen marking editor */
html.hl-lock, html.hl-lock body { overflow: hidden !important; overscroll-behavior: none; }
.fm-dialog.hl-modal {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; border: 0; border-radius: 0; background: var(--bg, #050505); touch-action: none;
}
.fm-dialog.hl-modal::backdrop { background: #000; }
.hl-modal-head {
  align-items: center; background: #141416;
  padding: max(16px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 16px max(24px, env(safe-area-inset-left));
}
.hl-modal-title { min-width: 0; }
.hl-modal-title .fm-dialog-eyebrow { margin-bottom: 2px; }
.hl-modal-title .fm-dialog-eyebrow:empty { display: none; }
.hl-modal-title h2 { font-size: 20px; line-height: 1.3; }
.hl-modal-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.hl-steps { display: inline-flex; align-items: center; gap: 6px; color: var(--muted, #a3a3a3); font-size: 13px; font-variant-numeric: tabular-nums; }
.hl-steps i { width: 8px; height: 8px; border-radius: 50%; background: #ffffff24; transition: background .2s, box-shadow .2s; }
.hl-steps i.is-on { background: var(--hl-color, #ffd84d); box-shadow: 0 0 10px color-mix(in srgb, var(--hl-color, #ffd84d) 60%, transparent); }
.hl-steps b { margin-left: 4px; font-weight: 600; color: var(--ink-2, #d4d4d4); }
.fm-dialog .hl-done { min-height: 44px; padding: 0 22px; border-radius: 12px; gap: 8px; }
.hl-done svg { width: 18px; height: 18px; }
.hl-modal-viewport {
  position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: crosshair; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(50, 100, 240, 0.16), transparent 70%),
    radial-gradient(circle at 1px 1px, #ffffff12 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--bg, #050505);
}
html.has-custom-cursor .fm-dialog.hl-modal .hl-modal-viewport { cursor: crosshair !important; }
html.has-custom-cursor .fm-dialog.hl-modal .hl-modal-viewport.can-pan { cursor: grab !important; }
.hl-modal-viewport.can-pan { cursor: grab; }
.hl-modal-viewport.is-panning { cursor: grabbing; }
.hl-modal-canvas {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; border-radius: 8px; will-change: transform;
  box-shadow: 0 0 0 1px #ffffff1a, 0 30px 80px #000c, 0 0 120px rgba(50, 100, 240, 0.12);
}
.hl-modal-canvas img { display: block; width: 100%; height: 100%; border-radius: 8px; pointer-events: none; -webkit-user-drag: none; }
/* Inside the zoomable canvas, keep outlines and handles a constant on-screen size. */
.hl-modal .ed-hl-box { box-shadow: 0 0 0 calc(1.5px * var(--inv, 1)) color-mix(in srgb, var(--hl-color, #ffd84d) 70%, #000); }
.hl-modal .ed-hl-box.is-drawing::before { opacity: .5; }
.hl-modal .ed-hl-box.is-drawing { box-shadow: 0 0 0 calc(1.5px * var(--inv, 1)) var(--blue-3, #7ea0ff); }
.hl-modal .ed-hl-num, .hl-modal .ed-hl-del { transform: scale(var(--inv, 1)); }
.hl-modal .ed-hl-num { width: 22px; height: 22px; left: -11px; top: -11px; font-size: 11px; transform-origin: 100% 100%; box-shadow: 0 0 0 2px var(--hl-color, #ffd84d), 0 4px 10px #0008; }
.hl-modal .ed-hl-del {
  position: absolute; right: -14px; top: -14px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2, #ffffff24); padding: 0;
  display: grid; place-items: center; background: #141416; color: #fff; font-size: 17px; line-height: 1; cursor: pointer;
  transform-origin: 0 100%; box-shadow: 0 6px 16px #000a; z-index: 1;
}
.hl-modal .ed-hl-del:hover { background: var(--red, #ef4444); border-color: transparent; }
.hl-modal-tip {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 32px);
  padding: 8px 14px; border-radius: 999px; pointer-events: none; text-align: center;
  background: #141416d9; border: 1px solid var(--line-2, #ffffff24); color: var(--ink-2, #d4d4d4);
  font-size: 12.5px; line-height: 1.45; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: opacity .25s, transform .25s;
}
.hl-modal-viewport:is(.is-drawing, .is-touched) .hl-modal-tip { opacity: 0; transform: translate(-50%, -6px); }
.fm-dialog.hl-modal:focus { outline: 0; }
.hl-toolbar {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 16px;
  background: #141416e6; border: 1px solid var(--line-2, #ffffff24); box-shadow: 0 18px 40px #000a, inset 0 1px 0 #ffffff0d;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); cursor: default;
}
.hl-toolbar button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: 11px; background: transparent; color: var(--ink, #f5f5f5); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.hl-toolbar button:hover { background: #ffffff12; }
.hl-toolbar button:active { background: #ffffff1c; }
.hl-toolbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hl-toolbar .hl-toolbar-text { padding: 0 12px; }
.hl-toolbar [data-hl-modal-clear]:hover { color: #ff8a8a; }
.hl-toolbar [data-hl-modal-clear] svg { width: 16px; height: 16px; }
.hl-zoom-level { min-width: 48px; text-align: center; color: var(--muted, #a3a3a3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hl-toolbar-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--line-2, #ffffff24); }
@media (max-width: 640px) {
  .hl-modal-head { padding: max(12px, env(safe-area-inset-top)) 14px 12px; gap: 10px; }
  .hl-modal-title h2 { font-size: 17px; }
  .hl-modal-actions { gap: 10px; }
  .hl-steps i { width: 7px; height: 7px; }
  .hl-steps b { display: none; }
  .fm-dialog .hl-done { padding: 0 16px; }
  .hl-modal-tip { top: 10px; font-size: 12px; padding: 7px 12px; border-radius: 14px; }
  .hl-toolbar { bottom: max(12px, env(safe-area-inset-bottom)); }
  .hl-toolbar button { min-width: 44px; height: 44px; }
  .hl-toolbar .hl-toolbar-text { padding: 0 10px; }
  .hl-toolbar [data-hl-modal-clear] span { display: none; }
  .hl-zoom-level { min-width: 42px; }
}

/* ── Phones: the editor is one scrolling page - preview on top, controls below in one
   column, Preview / Screenshot pinned to the bottom. Desktop and tablet layouts are untouched. */
@media (max-width: 760px), (max-width: 980px) and (max-height: 520px) {
  .editor-view {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 120px;
    scroll-padding-bottom: 104px;
  }

  .editor-view .ed-toolbar { position: sticky; top: 0; z-index: 20; gap: 8px; padding: 0 10px; }
  .editor-view .ed-toolbar-left { gap: 8px; }
  .editor-view .ed-toolbar-sep,
  .editor-view .ed-toolbar-mark,
  .editor-view .ed-quota-chip { display: none; }
  .editor-view .ed-toolbar-title { flex: 1 1 auto; min-width: 0; max-width: none; font-size: 15px; }
  .editor-view .ed-back-btn { width: 44px; height: 44px; border-radius: 12px; }
  .editor-view .ed-format-chip { height: 44px; margin-left: 0; padding: 0 10px; border-radius: 12px; font-size: 13px; }
  .editor-view .ed-variant-chip .ed-format-label { max-width: 22vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .editor-view .ed-toolbar .ed-btn-export--bar { min-width: 44px; height: 44px; }

  .editor-view .ed-body { display: block; overflow: visible; }
  .editor-view .ed-center { display: block; }
  .editor-view .ed-canvas-wrap { padding: 12px 12px 4px; }
  .editor-view .ed-canvas { width: min(100%, calc(72vh * 16 / 9)); border-radius: 12px; }
  .editor-view .ed-canvas.is-portrait {
    flex: none;
    width: auto;
    height: 52vh;
    height: min(52svh, calc((100vw - 24px) * 16 / 9));
  }
  .editor-view .ed-deck { padding: 2px 0 10px; }
  .editor-view .ed-transport { padding: 6px 12px 2px; }
  .editor-view .ed-transport-play { width: 44px; height: 44px; }
  .editor-view .ed-transport-mute { width: 44px; height: 44px; }
  .editor-view .ed-timeline { padding-left: 12px; padding-right: 12px; }
  .editor-view .ed-waveform-wrap { height: 40px; margin: 8px 12px 0; }

  .editor-view .ed-props {
    max-height: none;
    overflow: visible;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid #ffffff14;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .editor-view .ed-props-tabs { position: sticky; top: 56px; z-index: 15; padding: 10px 12px; background: #111114; }
  .editor-view .ed-props-tabs button { min-height: 44px; font-size: 13px; }
  .editor-view .ed-props-search { margin: 2px 12px 0; min-height: 48px; }
  .editor-view .ed-props-search input { min-height: 44px; }
  .editor-view .ed-props-body { overflow: visible; padding: 12px; }

  .editor-view .ed-props-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    gap: 6px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    background: #111114;
    border-top: 1px solid #ffffff14;
    box-shadow: 0 -14px 30px #0009;
  }
  .editor-view .ed-props-actions .ed-btn-snap,
  .editor-view .ed-props-actions .ed-btn-export { min-height: 50px; }
  .editor-view .ed-props-actions .ed-btn-export--bar span { display: inline; }
  .editor-view .export-note { margin: 0; font-size: 12px; text-align: center; }
  .editor-view .export-note:empty { display: none; }
  /* The on-screen keyboard leaves little room: the pinned bar steps aside while typing. */
  .editor-view:has(.ed-props :is(input:not([type="range"]):not([type="checkbox"]):not([type="file"]), textarea):focus) .ed-props-footer,
  .editor-view:has(.ed-sk-dd.is-open) .ed-props-footer,
  body:has(.ac-color-pop:not([hidden])) .editor-view .ed-props-footer { display: none; }
  .ac-color-pop { width: min(340px, calc(100vw - 24px)); }
  .ac-color-pop input { min-height: 44px; padding: 0 6px; }

  .editor-view .ed-color-control .color-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 8px; }
  .editor-view .ed-props .preset { width: 100%; height: auto; aspect-ratio: 1; max-width: 44px; }
  .editor-view .ed-range-reset { width: 40px; height: 40px; }

  /* 16 px or more, otherwise iOS zooms the page on focus. */
  .editor-view :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select),
  .ac-color-pop input { font-size: 16px !important; }
}
