#widget-settings {
  --editor-ink: #182422;
  --editor-muted: #64706d;
  --editor-accent: #087f64;
  --editor-line: #e0e5e3;
  --editor-canvas: #f7f8fa;
  color: var(--editor-ink);
}
#widget-settings .lp-widget-editor-jump { display:none; }
#sample-widget-result, #sample-widget-controls { scroll-margin-top:16px; }
@media (max-width:600px) {
  #widget-settings .lp-widget-editor-jump { display:flex; align-items:center; justify-content:center; gap:10px; min-height:44px; margin-top:22px; border:1px solid #c9ded2; border-radius:8px; color:#087f64; background:#eff7f2; font-size:13px; }
  #widget-settings .lp-widget-editor-jump .app-icon { width:17px; height:17px; transform:rotate(90deg); }
  #widget-settings .lp-widget-editor-back .app-icon { transform:rotate(-90deg); }
}
#widget-settings .lp-widget-settings-intro { margin-bottom: 28px; }
#widget-settings .lp-widget-settings-intro h2 {
  max-width: 680px; margin: 0; color: var(--editor-ink);
  font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; font-weight: 600; letter-spacing: -.045em;
}
#widget-settings .lp-widget-settings-intro p {
  max-width: 580px; margin: 16px 0 0; color: var(--editor-muted); font-size: 16px; line-height: 1.6;
}
#widget-settings .lp-widget-editor-sample {
  display: block; overflow: visible; border: 1px solid var(--editor-line); border-radius: 20px;
  background: #fff; box-shadow: 0 4px 6px -4px #1824220a, 0 18px 48px -24px #18242220;
}
#widget-settings .lp-widget-editor-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 66px; padding: 12px 24px; border-bottom: 1px solid var(--editor-line);
}
#widget-settings .lp-widget-editor-title { display: flex; align-items: center; gap: 10px; font-size: 15px; }
#widget-settings .lp-widget-editor-title strong { font-weight: 600; }
#widget-settings .lp-widget-editor-title .app-icon { width: 19px; height: 19px; color: var(--editor-muted); }
#widget-settings .lp-widget-editor-reset {
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--editor-line); border-radius: 8px;
  background: #fff; color: var(--editor-muted); font: inherit; font-size: 13px; cursor: pointer;
}
#widget-settings .lp-widget-editor-reset:hover { background: var(--editor-canvas); color: var(--editor-ink); }
/* Settings take 38% of the workbench; the real widget keeps the remaining canvas. */
#widget-settings .lp-widget-editor-body { display: grid; grid-template-columns: minmax(280px, .76fr) minmax(0, 1.24fr); }
#widget-settings .lp-widget-editor-fields { min-width: 0; padding: 28px; }
#widget-settings .lp-widget-editor-group { display: grid; min-width: 0; gap: 18px; margin: 0; padding: 0; border: 0; }
#widget-settings .lp-widget-editor-group + .lp-widget-editor-group { margin-top: 26px; }
#widget-settings .lp-widget-editor-group legend {
  margin-bottom: 16px; padding: 0; color: var(--editor-ink); font-size: 14px; font-weight: 650; line-height: 1.4;
}
#widget-settings .lp-widget-editor-field { display: grid; min-width: 0; gap: 8px; }
#widget-settings .lp-widget-editor-field > label,
#widget-settings .lp-widget-editor-label { color: var(--editor-muted); font-size: 13px; font-weight: 500; line-height: 1.4; }
#widget-settings .lp-widget-editor-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#widget-settings [data-sample-color-value] { font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
#widget-settings .lp-widget-editor-field :is(input:not([type="color"]), textarea, select) {
  box-sizing: border-box; display: block; width: 100%; min-width: 0; min-height: 44px;
  margin: 0; padding: 10px 12px; border: 1px solid #cdd5d1; border-radius: 8px;
  background-color: #fff; box-shadow: 0 1px 2px #18242205; color: var(--editor-ink);
  font: inherit; font-size: 14px; line-height: 1.5; caret-color: var(--editor-accent);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
#widget-settings .lp-widget-editor-field textarea { min-height: 88px; resize: vertical; }
#widget-settings .lp-widget-editor-field :is(input, textarea, select):hover { border-color: #a7b4ae; }
#widget-settings :is(button, a, input, textarea, select):focus-visible { outline: 3px solid #087f6440; outline-offset: 3px; }
#widget-settings .lp-widget-editor-field :is(input:not([type="color"]), textarea, select):focus-visible {
  border-color: var(--editor-accent); outline: 0; box-shadow: 0 0 0 3px #087f6426;
}
/* Cnippet Select's trigger, popup and selected check, with native select semantics. */
#widget-settings select {
  appearance: none; padding-right: 38px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364706d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; cursor: pointer;
}
@supports (appearance: base-select) {
  #widget-settings select, #widget-settings select::picker(select) { appearance: base-select; }
  #widget-settings .lp-widget-editor-field select { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  #widget-settings select::picker-icon { display: none; }
  #widget-settings select::picker(select) {
    min-width: anchor-size(width); max-width: calc(100vw - 24px); margin-block: 5px; padding: 5px;
    border: 1px solid var(--editor-line); border-radius: 10px; background: #fff; color: var(--editor-ink);
    box-shadow: 0 8px 24px #1824221a, 0 2px 6px #1824220a; font: inherit; font-size: 14px;
  }
  #widget-settings select option { min-height: 44px; gap: 12px; padding: 10px 12px; border-radius: 6px; cursor: pointer; }
  #widget-settings select option:is(:hover, :focus) { background: #f0f4f2; color: var(--editor-ink); outline: none; }
  #widget-settings select option:checked { background: #edf5f1; font-weight: 500; }
  #widget-settings select option::checkmark { order: 2; margin-left: auto; color: var(--editor-accent); }
}
#widget-settings .lp-widget-editor-palette { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#widget-settings .lp-widget-editor-swatch {
  position: relative; display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px;
  padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
}
#widget-settings .lp-widget-editor-swatch::before { content: ""; position: absolute; inset: 5px; border-radius: inherit; background: var(--sample-swatch); }
#widget-settings .lp-widget-editor-swatch[aria-pressed="true"] { border-color: var(--sample-swatch); }
#widget-settings .lp-widget-editor-swatch:hover { background: #edf1ef; }
#widget-settings .lp-widget-editor-swatch svg { position: relative; width: 18px; height: 18px; opacity: 0; }
#widget-settings .lp-widget-editor-swatch[aria-pressed="true"] svg { opacity: 1; }
#widget-settings .lp-widget-editor-custom {
  position: relative; display: block; flex: 0 0 44px; width: 44px; height: 44px; overflow: hidden;
  border: 1px dashed #b3bfb9; border-radius: 50%; background: #fff; color: var(--editor-muted);
}
#widget-settings .lp-widget-editor-custom:focus-within { outline: 3px solid #087f6440; outline-offset: 3px; }
#widget-settings .lp-widget-editor-custom svg { position: absolute; width: 20px; height: 20px; inset: 11px; pointer-events: none; }
#widget-settings .lp-widget-editor-custom input[type="color"] {
  position: absolute; inset: 0; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer;
}
#widget-settings .lp-widget-editor-note { margin: 22px 0 0; color: var(--editor-muted); font-size: 12px; line-height: 1.6; }
#widget-settings .lp-widget-editor-preview {
  display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 20px 24px 24px;
  border: 0; border-left: 1px solid var(--editor-line); border-radius: 0 0 20px 0; background: var(--editor-canvas);
}
#widget-settings .lp-widget-editor-preview figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 0 18px; border: 0;
}
#widget-settings .lp-widget-editor-preview figcaption > strong { font-size: 13px; font-weight: 500; color: var(--editor-muted); }
#widget-settings .lp-widget-editor-view { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--editor-line); border-radius: 9px; background: #edf0f2; }
#widget-settings .lp-widget-editor-view button {
  min-height: 34px; padding: 5px 13px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--editor-muted); font: inherit; font-size: 12px; line-height: 1.4; cursor: pointer;
}
#widget-settings .lp-widget-editor-view button:hover { color: var(--editor-ink); }
#widget-settings .lp-widget-editor-view button[aria-pressed="true"] {
  border-color: #e0e5e3; background: #fff; box-shadow: 0 1px 3px #1824220a; color: var(--editor-ink); font-weight: 600;
}
#widget-settings .lp-widget-editor-canvas { flex: 1; min-width: 0; overflow: hidden; border: 1px solid #dce2df; border-radius: 12px; background: #fff; }
#widget-settings .lp-widget-editor-site-label { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 14px; border-bottom: 1px solid var(--editor-line); color: #738079; font-size: 11px; }
#widget-settings .lp-widget-editor-site-label .app-icon { width: 14px; height: 14px; }
#widget-settings .lp-widget-editor-preview iframe { display: block; width: 100%; height: 440px; border: 0; border-radius: 0; pointer-events: none; }
#widget-settings .lp-widget-editor-cta { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 16px; color: var(--editor-accent); font-size: 14px; font-weight: 600; }
#widget-settings .lp-widget-editor-cta .app-icon { width: 18px; height: 18px; }
@media (max-width: 800px) {
  #widget-settings .lp-widget-editor-body { grid-template-columns: minmax(0, 1fr); }
  #widget-settings .lp-widget-editor-fields { padding: 24px; }
  #widget-settings .lp-widget-editor-preview { padding: 20px; border-left: 0; border-top: 1px solid var(--editor-line); border-radius: 0 0 20px 20px; }
  #widget-settings .lp-widget-editor-preview iframe { height: 400px; }
  #widget-settings .lp-widget-editor-view button { min-height: 38px; }
}
@media (max-width: 420px) {
  #widget-settings .lp-widget-settings-intro p { font-size: 15px; }
  #widget-settings .lp-widget-editor-toolbar { padding: 12px 16px; }
  #widget-settings .lp-widget-editor-title { gap: 7px; font-size: 13px; }
  #widget-settings .lp-widget-editor-title .app-icon { width: 16px; height: 16px; }
  #widget-settings .lp-widget-editor-reset { min-height: 44px; padding-inline: 10px; font-size: 12px; }
  #widget-settings .lp-widget-editor-fields { padding: 22px 16px; }
  #widget-settings .lp-widget-editor-palette { gap: 2px; }
  #widget-settings .lp-widget-editor-field :is(input:not([type="color"]), textarea, select) { font-size: 16px; }
  #widget-settings .lp-widget-editor-preview { padding: 16px 0 0; }
  #widget-settings .lp-widget-editor-preview figcaption { gap: 8px; padding: 0 12px 14px; }
  #widget-settings .lp-widget-editor-canvas { border-inline: 0; border-bottom: 0; border-radius: 0 0 20px 20px; }
  #widget-settings .lp-widget-editor-view button { min-height: 40px; padding-inline: 10px; }
  #widget-settings .lp-widget-editor-preview iframe { height: 400px; }
}
@media (prefers-reduced-motion: reduce) {
  #widget-settings .lp-widget-editor-field :is(input, textarea, select) { transition: none; }
}
