.cf-editor {
  --ed-ink: #282141;
  --ed-mute: #625a76;
  --ed-accent: #6148b9;
  --ed-border: #dcd6ea;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(620px, calc(100% - 24px));
  max-width: none;
  max-height: min(88vh, 780px);
  max-height: min(88dvh, 780px);
  padding: 0;
  margin: auto;
  overflow: hidden;
  color: var(--ed-ink);
  background: #fffeff;
  border: 1px solid #d9d2e9;
  border-radius: 24px;
  box-shadow: 0 24px 90px #23144145;
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  line-height: 1.45;
  word-break: keep-all;
  color-scheme: light;
}
.cf-editor::backdrop {
  background: #12141199;
}
.cf-editor *,
.cf-editor *::before,
.cf-editor *::after {
  box-sizing: border-box;
}
.cf-editor [hidden] {
  display: none !important;
}
.cf-editor form {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: inherit;
  margin: 0;
}
.cf-editor button,
.cf-editor input {
  font: inherit;
  color: inherit;
}
.cf-editor button {
  cursor: pointer;
}
.cf-editor :focus-visible {
  outline: 3px solid #8371cc;
  outline-offset: 3px;
}
.cf-editor :disabled {
  opacity: 0.5;
  cursor: wait;
}
.cf-ed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px 12px;
}
.cf-ed-header h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -0.06em;
  line-height: 1.35;
}
.cf-ed-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ed-mute);
  background: #f2eff8;
  border: 0;
  border-radius: 50%;
  font-size: 25px !important;
  line-height: 1;
}
.cf-ed-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 24px;
  background: #f0edf6;
  border-radius: 12px;
}
.cf-ed-tabs button {
  flex: 1;
  min-height: 40px;
  padding: 6px;
  color: var(--ed-mute);
  background: none;
  border: 0;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 720;
}
.cf-ed-tabs [aria-selected="true"] {
  color: #553caa;
  background: white;
  box-shadow: 0 1px 4px #3024431a;
}
.cf-ed-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 24px;
}
.cf-ed-overview .face-list {
  margin: 0 0 14px;
  grid-template-columns: minmax(0, 1fr);
}
.cf-ed-overview .face-card {
  --face: #70489a;
  --tint: #eee3ff;
  grid-template-columns: clamp(58px, 14vw, 80px) minmax(0, 1fr) 28px;
  gap: 13px;
  padding: 12px 14px;
}
.cf-ed-overview .face-card[data-side="1"] {
  --face: #346e63;
  --tint: #dff4eb;
}
.cf-ed-overview .edit-icon {
  position: static;
  width: 28px;
  height: 28px;
}
.cf-ed-overview .edit-icon svg {
  width: 14px;
  height: 14px;
}
.cf-ed-overview .match-options {
  flex-direction: column;
  gap: 0;
}
.cf-ed-overview .match-options button {
  min-height: 42px;
  padding: 5px;
  border-left: 0;
  font-size: 14px;
}
.cf-ed-face {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}
.cf-ed-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 10px;
  background: #f5f1fc;
  border-radius: 16px;
}
.cf-ed-face[data-side="1"] .cf-ed-preview {
  background: #ecf6f2;
}
.cf-ed-preview canvas {
  width: min(100%, 164px);
  aspect-ratio: 1;
  height: auto;
  display: block;
}
.cf-ed-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px 8px;
  flex-wrap: wrap;
}
.cf-ed-upload-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-height: 35px;
  padding: 6px 13px;
  color: #4c386f;
  border: 1px solid #d9d2e6;
  border-radius: 9px;
  background: #ffffffeb;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.cf-ed-upload-btn input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.cf-ed-upload-btn:focus-within {
  outline: 3px solid #8371cc;
  outline-offset: 2px;
}
.cf-ed-remove {
  padding: 5px 2px;
  border: 0;
  background: none;
  color: var(--ed-mute) !important;
  font-size: 12px !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cf-ed-face-fields,
.cf-ed-game-copy {
  display: grid;
  align-content: center;
  gap: 12px;
}
.cf-ed-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 740;
}
.cf-ed-field input,
.cf-ed-count input {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0 11px;
  background: #fff;
  border: 1px solid var(--ed-border);
  border-radius: 9px;
  font-size: 15px;
  font-weight: 500;
}
.cf-ed-field input::placeholder {
  color: #817990;
  font-size: 13px;
}
.cf-ed-color,
.cf-ed-count,
.cf-ed-motion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 740;
  font-size: 14px;
}
.cf-ed-color input {
  width: 48px;
  height: 34px;
  padding: 2px 4px;
  background: #fff;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  cursor: pointer;
}
.cf-ed-color input::-webkit-color-swatch-wrapper {
  padding: 3px;
}
.cf-ed-color input::-webkit-color-swatch {
  border-radius: 4px;
  border: 0;
}
.cf-editor fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.cf-editor legend {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 760;
  color: var(--ed-ink);
}
.cf-ed-crop {
  grid-column: 1 / -1;
}
.cf-ed-crop label {
  display: grid;
  grid-template-columns: 66px minmax(40px, 1fr) 52px;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  padding: 2px 0;
  font-size: 13px;
  color: var(--ed-mute);
}
.cf-ed-crop input {
  width: 100%;
  height: 28px;
  accent-color: var(--ed-accent);
}
.cf-ed-crop output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cf-ed-game {
  display: grid;
  gap: 16px;
}
.cf-ed-game-copy {
  grid-template-columns: 1fr 1fr;
}
.cf-ed-game-copy label:first-child {
  grid-column: 1 / -1;
}
.cf-ed-count {
  border-top: 1px solid #e8e3f0;
  padding-top: 15px;
}
.cf-ed-count input {
  max-width: 90px;
  font-variant-numeric: tabular-nums;
}
.cf-ed-count small,
.cf-ed-motion small {
  color: var(--ed-mute);
  font-size: 12px;
  font-weight: 500;
}
.cf-ed-count small {
  margin-left: 5px;
}
.cf-ed-speed > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.cf-ed-speed label {
  position: relative;
  cursor: pointer;
}
.cf-ed-speed input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.cf-ed-speed label > span {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 6px;
  min-height: 42px;
  padding: 6px;
  border: 1px solid var(--ed-border);
  border-radius: 10px;
  background: white;
  color: var(--ed-mute);
  font-size: 14px;
  font-weight: 730;
}
.cf-ed-speed small {
  font-size: 11px;
  font-weight: 550;
}
.cf-ed-speed input:checked + span {
  color: #53389a;
  border-color: #8d78c5;
  background: #f1ecfb;
}
.cf-ed-speed input:focus-visible + span {
  outline: 3px solid #8371cc;
  outline-offset: 2px;
}
.cf-ed-motion {
  background: #f7f5fa;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.cf-ed-motion small {
  display: block;
  margin-top: 2px;
}
.cf-ed-motion input {
  width: 22px;
  height: 22px;
  accent-color: var(--ed-accent);
}
.cf-ed-status {
  margin: 0;
  padding: 0 24px 10px;
  color: #9b3350;
  font-size: 13px;
}
.cf-ed-status:empty {
  display: none;
}
.cf-ed-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 24px;
  border-top: 1px solid #e8e4ef;
  background: #fcfbfe;
}
.cf-ed-footer > span {
  flex: 1;
  color: var(--ed-mute);
  font-size: 12px;
}
.cf-ed-footer button {
  min-height: 42px;
  min-width: 68px;
  padding: 8px 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 750;
}
.cf-ed-cancel {
  border: 1px solid var(--ed-border);
  background: white;
}
.cf-ed-save {
  color: white !important;
  border: 1px solid transparent;
  background: var(--ed-accent);
}
@media (max-width: 470px) {
  .cf-editor {
    width: calc(100% - 16px);
    max-height: 93vh;
    max-height: 93dvh;
    border-radius: 19px;
  }
  .cf-ed-header {
    padding: 14px 16px 8px;
  }
  .cf-ed-tabs {
    margin: 0 14px;
  }
  .cf-ed-body {
    padding: 15px 14px;
  }
  .cf-ed-face {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .cf-ed-preview {
    flex-direction: row;
    justify-content: start;
    padding: 9px 14px;
  }
  .cf-ed-preview canvas {
    width: 89px;
  }
  .cf-ed-upload {
    gap: 5px 12px;
  }
  .cf-ed-game-copy {
    grid-template-columns: 1fr;
  }
  .cf-ed-footer {
    padding: 11px 14px;
  }
  .cf-ed-footer button {
    min-width: 55px;
    padding: 8px 13px;
  }
  .cf-ed-status {
    padding: 0 14px 8px;
  }
}
