.appearance-launcher,
.appearance-editor {
  --editor-ink: #26322e;
  --editor-muted: #68736d;
  --editor-line: #dedfd8;
  --editor-paper: #fafaf6;
  --editor-accent: #236650;
  --editor-tint: #e8efe7;
  color-scheme: light;
  color: var(--editor-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.appearance-launcher {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 17px;
  border: 1px solid var(--editor-line);
  border-radius: 100px;
  background: var(--editor-paper);
  box-shadow: 0 4px 20px #0003;
  font-weight: 600;
  cursor: pointer;
}

.appearance-launcher svg,
.appearance-editor svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.appearance-editor {
  position: fixed;
  inset: 12px 12px 12px auto;
  z-index: 200;
  width: 408px;
  height: calc(100dvh - 24px);
  max-width: calc(100vw - 24px);
  max-height: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d2d8d0;
  border-radius: 18px;
  background: var(--editor-paper);
  box-shadow: -8px 12px 60px #0004, 0 1px 4px #0002;
}

.appearance-editor[open] { display: flex; flex-direction: column; }
.appearance-editor--left { left: 12px; right: auto; }
.appearance-editor::backdrop { background: #06120c70; }
.appearance-editor [hidden], .appearance-launcher[hidden] { display: none !important; }
.appearance-editor *, .appearance-editor *::before, .appearance-editor *::after { box-sizing: border-box; }
.appearance-editor :is(button, input, select) { font: inherit; }
.appearance-editor button { cursor: pointer; }
.appearance-editor button:disabled { cursor: default; opacity: .4; }
.appearance-editor :is(button, input, select, summary):focus-visible,
.appearance-launcher:focus-visible { outline: 3px solid #367961; outline-offset: 3px; }
.appearance-editor ::selection { color: #173d2d; background: #d4e7d6; }

.appearance-editor__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
}
.appearance-editor__mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--editor-line); border-radius: 11px; background: #fff; }
.appearance-editor__heading { flex: 1; min-width: 0; }
.appearance-editor h2 { margin: 0; font: 650 18px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.025em; }
.appearance-editor__subtitle { margin: 3px 0 0; color: var(--editor-muted); font-size: 12px; }
.appearance-editor__icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 8px 4px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--editor-muted); }
.appearance-editor__icon-button:hover { background: #e9ece5; color: var(--editor-ink); }

.appearance-editor__tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0 20px 16px; padding: 4px; border: 1px solid var(--editor-line); border-radius: 11px; background: #eeefe9; }
.appearance-editor__tabs button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 4px; border: 0; border-radius: 7px; background: transparent; color: var(--editor-muted); font-size: 13px; font-weight: 550; }
.appearance-editor__tabs svg { display: none; }
.appearance-editor__tabs [aria-selected="true"] { background: #fff; color: var(--editor-ink); box-shadow: 0 1px 4px #26322e1f; }

.appearance-editor__content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #bec7bd transparent; }
.appearance-editor__panel { padding: 4px 20px 24px; }
.appearance-editor__section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.appearance-editor h3 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.5; letter-spacing: 0; }
.appearance-editor__count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 23px; padding: 0 7px; border: 1px solid var(--editor-line); border-radius: 6px; color: var(--editor-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.appearance-editor__help { margin: 0 0 18px; color: var(--editor-muted); font-size: 12px; line-height: 1.6; }
.appearance-editor__theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.appearance-editor__theme { position: relative; display: flex; flex-direction: column; gap: 0; min-width: 0; padding: 5px; border: 1px solid var(--editor-line); border-radius: 11px; background: #fff; color: var(--editor-ink); text-align: left; }
.appearance-editor__theme:hover { border-color: #97aa99; }
.appearance-editor__theme[aria-pressed="true"] { border-color: var(--editor-accent); box-shadow: 0 0 0 1px var(--editor-accent); }
.appearance-editor__theme-sample { position: relative; display: flex; align-items: flex-end; justify-content: space-between; min-height: 73px; padding: 12px; border-radius: 6px; background: var(--sample-background); color: var(--sample-foreground); }
.appearance-editor__theme-letters { font: 500 31px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: -.05em; }
.appearance-editor__swatches { display: flex; padding-bottom: 2px; }
.appearance-editor__swatches i { display: block; width: 14px; height: 14px; margin-left: -3px; border: 1px solid #fff5; border-radius: 50%; background: var(--swatch); }
.appearance-editor__theme-check { position: absolute; right: 7px; top: 7px; display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--editor-accent); }
.appearance-editor__theme-check svg { width: 14px; height: 14px; }
.appearance-editor__theme[aria-pressed="true"] .appearance-editor__theme-check { display: grid; }
.appearance-editor__theme-name { padding: 9px 6px 0; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.appearance-editor__theme-note { padding: 2px 6px 7px; color: var(--editor-muted); font-size: 10px; line-height: 1.4; }
.appearance-editor__default-theme { margin-bottom: 22px; }
.appearance-editor__default-theme .appearance-editor__theme { width: 100%; }
.appearance-editor__default-theme .appearance-editor__theme-sample { min-height: 60px; }
.appearance-editor__theme-tools { margin: 0 20px 20px; padding: 15px 0 18px; border-bottom: 1px solid var(--editor-line); }
.appearance-editor__current-theme { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.appearance-editor__current-theme strong { min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.appearance-editor__current-theme > span { flex: 0 0 auto; color: var(--editor-muted); font-size: 10px; }
.appearance-editor__theme-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 16px; }
.appearance-editor__copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--editor-accent); border-radius: 8px; background: var(--editor-accent); color: #fff; font-size: 12px !important; font-weight: 600 !important; }
.appearance-editor__copy-button:hover { background: #184c3b; }
.appearance-editor__copy-button svg { width: 16px; height: 16px; }
.appearance-editor__theme-help { margin: 10px 0 0; color: var(--editor-muted); font-size: 11px; line-height: 1.6; }
.appearance-editor__name-form { margin-top: 16px; }
.appearance-editor__name-input { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--editor-line); border-radius: 8px; background: #fff; color: var(--editor-ink); font-size: 16px !important; }
.appearance-editor__name-input[aria-invalid="true"] { border-color: #a13e30; }
.appearance-editor__name-actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.appearance-editor__theme-buttons .appearance-editor__text-button, .appearance-editor__name-actions .appearance-editor__text-button { min-height: 44px; }
.appearance-editor__name-error { margin: 7px 0 0; color: #a13e30; font-size: 11px; }
.appearance-editor__empty-themes { margin-top: 20px; }
.appearance-editor__advanced { margin-top: 20px; border-top: 1px solid var(--editor-line); border-bottom: 1px solid var(--editor-line); }
.appearance-editor__advanced > summary { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 12px 0; font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
.appearance-editor__advanced > summary::-webkit-details-marker { display: none; }
.appearance-editor__advanced > summary::before { content: "›"; font-size: 19px; color: var(--editor-muted); transition: transform 150ms; }
.appearance-editor__advanced[open] > summary::before { transform: rotate(90deg); }
.appearance-editor__advanced[open] { padding-bottom: 12px; }
.appearance-editor__color-row input:disabled { cursor: default; }
.appearance-editor__color-row:has(input:disabled) .appearance-editor__color-swatch { opacity: .65; }
.appearance-editor__color-row input:disabled.appearance-editor__hex { color: var(--editor-muted); background: #f0f1eb; }
.appearance-editor__custom-heading { margin: 23px 0 12px !important; }
.appearance-editor__theme-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-top: 18px; padding: 13px 14px; border: 1px solid var(--editor-line); border-radius: 9px; background: #f1f3ec; color: var(--editor-accent); font-size: 12px; font-weight: 600; text-align: left; }
.appearance-editor__theme-action svg { width: 17px; height: 17px; }

.appearance-editor__active-theme { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.appearance-editor__active-theme strong { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.appearance-editor__text-button { border: 0; background: transparent; color: var(--editor-accent); padding: 6px 0; font-size: 11px; font-weight: 550; }
.appearance-editor__search { position: relative; display: block; margin: 0 0 18px; }
.appearance-editor__search svg { position: absolute; left: 11px; top: 12px; width: 17px; height: 17px; color: var(--editor-muted); pointer-events: none; }
.appearance-editor__search input { display: block; width: 100%; min-height: 42px; padding: 10px 12px 10px 36px; border: 1px solid var(--editor-line); border-radius: 8px; background: #fff; color: var(--editor-ink); font-size: 12px; }
.appearance-editor__group-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 3px; color: var(--editor-muted); font-size: 11px; font-weight: 550; letter-spacing: .02em; }
.appearance-editor__color-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 86px 30px; align-items: center; gap: 10px; min-height: 57px; padding-block: 9px; border-bottom: 1px solid #e8e9e2; }
.appearance-editor__color-swatch { position: relative; display: block; width: 32px; height: 32px; overflow: hidden; border: 1px solid #0002; border-radius: 8px; background: var(--swatch); box-shadow: inset 0 0 0 2px #fff4; }
.appearance-editor__color-swatch:focus-within { outline: 3px solid #367961; outline-offset: 3px; }
.appearance-editor__color-swatch input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; }
.appearance-editor__color-label { display: block; min-width: 0; color: var(--editor-ink); font-size: 11px; line-height: 1.4; cursor: text; }
.appearance-editor__color-label small { display: block; margin-top: 3px; color: var(--editor-accent); font-size: 9px; }
.appearance-editor__hex { width: 100%; min-width: 0; height: 34px; padding: 6px 7px; border: 1px solid var(--editor-line); border-radius: 6px; background: #fff; color: #39443e; font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; font-size: 11px !important; letter-spacing: .025em; text-transform: uppercase; }
.appearance-editor__hex[aria-invalid="true"] { border-color: #b34132; background: #fff3ee; }
.appearance-editor__color-row .appearance-editor__icon-button { min-width: 30px; min-height: 34px; padding: 5px; }
.appearance-editor__color-row .appearance-editor__icon-button svg { width: 15px; height: 15px; }
.appearance-editor__details { border-bottom: 1px solid var(--editor-line); }
.appearance-editor__details:first-of-type { margin-top: 17px; border-top: 1px solid var(--editor-line); }
.appearance-editor__details summary { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 14px 0; list-style: none; cursor: pointer; font-size: 12px; font-weight: 600; }
.appearance-editor__details summary::-webkit-details-marker { display: none; }
.appearance-editor__details summary::before { content: "›"; color: var(--editor-muted); font-size: 19px; line-height: 1; transition: transform 150ms; }
.appearance-editor__details[open] summary::before { transform: rotate(90deg); }
.appearance-editor__details summary .appearance-editor__count { margin-left: auto; }
.appearance-editor__details-body { padding-bottom: 12px; }
.appearance-editor__no-results { padding: 25px 0; text-align: center; color: var(--editor-muted); font-size: 12px; }
.appearance-editor__color-note { margin: 17px 0 0; color: var(--editor-muted); font-size: 11px; line-height: 1.6; }
.appearance-editor__range-field { margin-bottom: 22px; }
.appearance-editor__range-label { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 12px; font-weight: 600; }
.appearance-editor__range-label output { min-width: 50px; padding: 4px 8px; border: 1px solid var(--editor-line); border-radius: 6px; background: #fff; font-variant-numeric: tabular-nums; text-align: center; }
.appearance-editor__range-field input[type="range"] { appearance: none; display: block; width: 100%; height: 36px; margin: 8px 0 0; background: transparent; accent-color: var(--editor-accent); cursor: pointer; }
.appearance-editor__range-field input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 10px; background: linear-gradient(to right, var(--editor-accent) var(--range-progress, 50%), #dbe1d7 var(--range-progress, 50%)); }
.appearance-editor__range-field input[type="range"]::-webkit-slider-thumb { appearance: none; width: 19px; height: 19px; margin-top: -7px; border: 3px solid #fff; border-radius: 50%; background: var(--editor-accent); box-shadow: 0 0 0 1px #849a87, 0 1px 3px #0002; }
.appearance-editor__range-field input[type="range"]::-moz-range-track { height: 5px; border-radius: 10px; background: #dbe1d7; }
.appearance-editor__range-field input[type="range"]::-moz-range-progress { height: 5px; border-radius: 10px; background: var(--editor-accent); }
.appearance-editor__range-field input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 3px solid #fff; border-radius: 50%; background: var(--editor-accent); box-shadow: 0 0 0 1px #849a87; }
.appearance-editor__range-scale { display: flex; justify-content: space-between; margin-top: -2px; color: var(--editor-muted); font-size: 10px; }
.appearance-editor__range-help { margin: 9px 0 0; color: var(--editor-muted); font-size: 11px; line-height: 1.6; }
.appearance-editor__water-colors-heading { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--editor-line); }
.appearance-editor__water-colors-heading .appearance-editor__count { max-width: 180px; height: auto; min-height: 23px; overflow-wrap: anywhere; }

.appearance-editor__field-label { display: block; margin: 0 0 7px; font-size: 12px; font-weight: 600; }
.appearance-editor__select { display: block; width: 100%; min-height: 44px; margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--editor-line); border-radius: 8px; background: #fff; color: var(--editor-ink); }
.appearance-editor__switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--editor-line); border-bottom: 1px solid var(--editor-line); cursor: pointer; }
.appearance-editor__switch-row strong { display: block; font-size: 12px; font-weight: 600; }
.appearance-editor__switch-row small { display: block; margin-top: 2px; color: var(--editor-muted); font-size: 11px; }
.appearance-editor__switch { appearance: none; flex: 0 0 38px; width: 38px; height: 23px; margin: 0; border: 1px solid #a2aca0; border-radius: 100px; background: #b4beb1; cursor: pointer; transition: background-color 150ms; }
.appearance-editor__switch::before { content: ""; display: block; width: 17px; height: 17px; margin: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform 150ms; }
.appearance-editor__switch:checked { border-color: var(--editor-accent); background: var(--editor-accent); }
.appearance-editor__switch:checked::before { transform: translateX(15px); }
.appearance-editor__hero-choice { padding-top: 17px; }
.appearance-editor__font-variant { padding-top: 17px; }
.appearance-editor__font-variant .appearance-editor__select { margin-bottom: 0; }
.appearance-editor__font-variant .appearance-editor__switch-row { border-top: 0; }
.appearance-editor__type-preview { padding: 19px 17px; margin: 19px 0; border-radius: 9px; background: var(--preview-background); color: var(--preview-foreground); }
.appearance-editor__type-preview strong { display: block; font-family: var(--preview-font); font-size: 31px; font-weight: var(--preview-font-weight, 500); font-style: var(--preview-font-style, normal); line-height: 1.1; letter-spacing: 0; overflow-wrap: anywhere; }
.appearance-editor__type-preview p { margin: 12px 0 0; font-family: var(--preview-body-font); font-size: 11px; font-weight: var(--preview-body-font-weight, 400); font-style: var(--preview-body-font-style, normal); color: var(--preview-secondary); }
.appearance-editor__font-target { display: flex; gap: 6px; margin: 13px 0; }
.appearance-editor__font-target button { flex: 1; min-height: 36px; padding: 7px 10px; border: 1px solid var(--editor-line); border-radius: 7px; color: var(--editor-muted); background: transparent; font-size: 11px; }
.appearance-editor__font-target [aria-pressed="true"] { border-color: #adbfac; color: var(--editor-accent); background: var(--editor-tint); }
.appearance-editor__font-list { display: grid; gap: 8px; }
.appearance-editor__font { position: relative; display: block; width: 100%; padding: 12px 13px; border: 1px solid var(--editor-line); border-radius: 9px; background: #fff; color: var(--editor-ink); text-align: left; }
.appearance-editor__font[aria-pressed="true"] { border-color: var(--editor-accent); box-shadow: 0 0 0 1px var(--editor-accent); }
.appearance-editor__font-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.appearance-editor__font-name { font-size: 11px; font-weight: 650; }
.appearance-editor__font-note { color: var(--editor-muted); font-size: 9px; }
.appearance-editor__font-sample { display: block; font-family: var(--font-sample); font-size: 22px; font-weight: var(--font-sample-weight, 500); font-style: var(--font-sample-style, normal); line-height: 1.4; letter-spacing: -.02em; overflow-wrap: anywhere; }

.appearance-editor__footer { flex: 0 0 auto; padding: 12px 20px 16px; border-top: 1px solid var(--editor-line); background: #f4f5ee; }
.appearance-editor__footer-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.appearance-editor__history { display: flex; align-items: center; gap: 2px; }
.appearance-editor__history .appearance-editor__icon-button { min-width: 33px; min-height: 32px; padding: 6px; }
.appearance-editor__save-status { display: flex; align-items: center; gap: 6px; color: var(--editor-accent); font-size: 11px; font-weight: 550; }
.appearance-editor__save-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.appearance-editor__save-status[data-state="pending"], .appearance-editor__save-status[data-state="saving"] { color: #94621d; }
.appearance-editor__save-status[data-state="error"], .appearance-editor__save-status[data-state="conflict"] { color: #a13e30; }
.appearance-editor__footer-note { margin: 6px 0 0; color: var(--editor-muted); font-size: 10px; }
.appearance-editor__file-actions { display: flex; align-items: center; gap: 13px; margin-top: 7px; }
.appearance-editor__file-actions button { padding: 4px 0; border: 0; background: transparent; color: var(--editor-muted); font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.appearance-editor__file-actions .appearance-editor__lock { margin-left: auto; }
.appearance-editor__notice { margin: 0 20px 12px; padding: 12px; border: 1px solid #dec099; border-radius: 8px; color: #6d451d; background: #fff4df; font-size: 11px; line-height: 1.6; }
.appearance-editor__notice p { margin: 0 0 9px; }
.appearance-editor__notice button { min-height: 35px; padding: 6px 9px; margin: 3px 5px 0 0; border: 1px solid #b99b74; border-radius: 5px; background: #fffcf5; color: #6d451d; font-size: 10px; }
.appearance-editor__locked { padding: 25px 20px; color: var(--editor-muted); font-size: 13px; }
.appearance-editor__locked p { margin: 0; }
.appearance-editor__toast { margin: 0; padding: 0 20px 12px; color: var(--editor-accent); font-size: 11px; }

@media (max-width: 999px) {
  .appearance-editor { inset: auto 0 0; width: 100%; max-width: 100%; height: min(92dvh, 860px); border-radius: 18px 18px 0 0; border-bottom: 0; }
  .appearance-editor [data-dock] { display: none; }
  .appearance-editor__header { padding-top: 18px; }
  .appearance-editor__footer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .appearance-editor__theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appearance-editor__color-row { grid-template-columns: 36px minmax(0, 1fr) 93px 36px; min-height: 63px; }
  .appearance-editor__color-swatch { width: 36px; height: 36px; }
  .appearance-editor__hex { height: 40px; font-size: 12px !important; }
  .appearance-editor__color-label { font-size: 12px; }
  .appearance-editor__color-row .appearance-editor__icon-button { min-width: 36px; min-height: 40px; }
}
@media (max-width: 359px) {
  .appearance-editor__header, .appearance-editor__panel { padding-inline: 15px; }
  .appearance-editor__tabs { margin-inline: 15px; }
  .appearance-editor__theme-tools { margin-inline: 15px; }
  .appearance-editor__footer { padding-inline: 15px; }
  .appearance-editor__color-row { grid-template-columns: 32px minmax(0, 1fr) 78px 28px; gap: 7px; }
  .appearance-editor__color-row .appearance-editor__icon-button { min-width: 28px; }
  .appearance-editor__color-swatch { width: 32px; height: 36px; }
  .appearance-editor__font-note { max-width: 120px; text-align: right; }
}
@media (max-width: 420px) {
  .appearance-editor__tabs svg { display: none; }
  .appearance-editor__tabs button { padding-inline: 5px; font-size: 12px; }
}
@media (max-height: 500px) and (max-width: 999px) {
  .appearance-editor { height: 100dvh; border-radius: 0; }
  .appearance-editor__header { padding-block: 9px; }
  .appearance-editor__tabs { margin-bottom: 8px; }
  .appearance-editor__footer { padding-top: 7px; }
  .appearance-editor__footer-note, .appearance-editor__file-actions { display: none; }
}
