:root {
  color-scheme: dark;
  --ink: #f1eee8;
  --muted: #bdb7ad;
  --accent: #ffbf00;
  --wash: #382819;
  --line: #363330;
  --page: #111110;
  --surface: #1a1918;
  --surface-raised: #242321;
  --on-accent: #201305;
  --mono: ui-monospace, Consolas, monospace;
  font:
    14px/1.45 Inter,
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a {
  color: var(--accent);
}
i[data-icon],
span[data-icon] {
  display: inline-grid;
  place-items: center;
  font-style: normal;
  flex: none;
}
svg {
  width: 1em;
  height: 1em;
  flex: none;
}
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1160px;
  margin: auto;
  min-height: 51px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 19px;
  font-weight: 850;
  white-space: nowrap;
}
.brand small {
  margin-left: 3px;
  color: var(--muted);
  font: 750 8px var(--mono);
}
.brand .brand-mark {
  flex: none;
  object-fit: contain;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.help-menu {
  position: relative;
  z-index: 5;
}
.help-menu summary {
  list-style: none;
  cursor: pointer;
}
.help-menu summary::-webkit-details-marker {
  display: none;
}
.help-options {
  position: absolute;
  inset: calc(100% + 5px) 0 auto auto;
  min-width: 133px;
  display: grid;
  gap: 2px;
  padding: 4px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px #0008;
}
.help-menu:not([open]) .help-options {
  display: none;
}
.help-options :is(button, a) {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: start;
  background: transparent;
  border: 0;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.help-options [data-icon] { flex: 0 0 16px; font-size: 16px; color: var(--accent); }
.help-options :is(button, a):hover {
  background: var(--wash);
  color: var(--accent);
}
.quiet-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.quiet-button i {
  font-size: 13px;
  color: var(--accent);
}
.icon-button {
  width: 31px;
  height: 31px;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
}
.icon-button[aria-pressed="true"] {
  border-color: #7c562c;
  background: var(--wash);
  color: var(--accent);
}
.quiet-button:hover,
.icon-button:hover {
  color: var(--accent);
  border-color: #9d6530;
}
#toggle-slices[aria-pressed="false"] {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 12px 100px;
  display: grid;
  gap: 10px;
  align-items: start;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 2px 7px #00000026;
}
.preview {
  padding: 10px;
}
.panel-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin-bottom: 7px;
}
.panel-heading h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.heading-icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  font-size: 18px;
}
.preview-meta {
  margin-left: auto;
  color: var(--muted);
  font: 700 10px var(--mono);
  white-space: nowrap;
}
.stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 112px;
  --stage-height: clamp(116px, 35vw, 158px);
  height: var(--stage-height);
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #28292b;
  --slice-guide: #b7b1a587;
}
.stage.is-grid {
  background-image: conic-gradient(
    #363739 25%,
    transparent 0 50%,
    #363739 0 75%,
    transparent 0
  );
  background-size: 19px 19px;
}
.stage[data-background="black"] {
  background-color: #000;
}
.stage[data-background="white"] {
  background-color: #fff;
  --slice-guide: #443c3880;
}
.panel-heading .icon-button,
.top-actions .icon-button {
  display: grid;
  place-items: center;
  line-height: 1;
}
.panel-heading [data-icon] svg,
.settings summary > [data-icon] svg,
.logo-options-toggle > [data-icon] svg,
.field-heading > [data-icon] svg,
.top-actions .icon-button svg { display: block; }

.preview-color::before {
  content: "";
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #ffffff86;
  background: #000;
}
.preview-white::before {
  background: #fff;
}
.art-wrap {
  position: relative;
  width: min(91%, 800px, calc((var(--stage-height) - 12px) * var(--tile-count, 1)));
}
.art-wrap.square {
  width: min(112px, 67%);
}
#art {
  display: block;
  width: 100%;
  height: auto;
}
#slice-lines {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}
#slice-lines i {
  flex: 1;
  border: 1px dashed var(--slice-guide);
  border-right: 0;
}
#slice-lines i:last-child {
  border-right: 1px dashed var(--slice-guide);
}
.preview-loading {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  white-space: nowrap;
}
.settings {
  --settings-row-height: 46px;
  --settings-icon-size: 24px;
  --settings-gap: 8px;
  --settings-label-size: 13px;
  --setting-switch-width: 84px;
  --setting-switch-height: 31px;
  --settings-action-x: calc(var(--settings-icon-size) + 2 * var(--settings-gap) + 2 * var(--settings-label-size));
  padding: 0 10px;
}
.settings > :not([hidden]) ~ :is(details, .settings-field, .palette-field, .settings-with-switch) {
  border-top: 1px dashed var(--line);
}
.settings details {
  min-width: 0;
}
.settings summary {
  display: flex;
  align-items: center;
  gap: var(--settings-gap);
  min-height: var(--settings-row-height);
  list-style: none;
  cursor: pointer;
}
.settings summary::-webkit-details-marker {
  display: none;
}
.settings summary > span[data-icon],
.logo-options-toggle > span[data-icon],
.field-heading > span[data-icon] {
  width: var(--settings-icon-size);
  height: var(--settings-icon-size);
  font-size: 24px;
  color: var(--accent);
}
.settings summary b,
.logo-options-toggle b,
.field-heading b,
.field-heading label {
  font-size: var(--settings-label-size);
  font-weight: 750;
  white-space: nowrap;
}
.field-heading {
  display: flex;
  align-items: center;
  gap: var(--settings-gap);
  min-width: 0;
}
.settings-field {
  padding-block: 7px;
}
.text-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding-block: 8px;
}
.text-field .field-heading {
  min-height: 34px;
}
#types {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}
#types button {
  min-height: 42px;
  padding-inline: 6px;
  gap: 7px;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}
#types button i {
  display: grid;
  place-items: center;
  flex: 0 0 1em;
  width: 1em;
  height: 1em;
  font-size: 24px;
}
#types button svg { display: block; width: 100%; height: 100%; }
#types button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.text-inputs {
  min-width: 0;
  flex: 1;
}
.text-inputs input {
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 16px;
}
.text-inputs .field-hint {
  margin-top: 3px;
}
.setting-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--setting-switch-height);
  padding: 3px 6px 3px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.logo-options-toggle {
  display: flex;
  width: 100%;
  min-height: var(--settings-row-height);
  align-items: center;
  gap: var(--settings-gap);
  text-align: start;
  padding: 0;
  border: 0;
  background: transparent;
}
.setting-switch {
  flex: none;
  white-space: nowrap;
}
.settings-with-switch { position: relative; }
.row-switch-gap { flex: 0 0 var(--setting-switch-width); }
.row-switch {
  width: var(--setting-switch-width);
  justify-content: space-between;
  padding-inline: 7px;
}
.row-switch {
  position: absolute;
  inset-inline-start: var(--settings-action-x);
  top: calc((var(--settings-row-height) - var(--setting-switch-height)) / 2);
}

.setting-switch i {
  position: relative;
  width: 27px;
  height: 16px;
  border-radius: 10px;
  background: #54504b;
}
.setting-switch i::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: var(--surface);
}
.setting-switch[aria-checked="true"] {
  color: var(--accent);
}
.setting-switch[aria-checked="true"] i {
  background: var(--accent);
}
.setting-switch[aria-checked="true"] i::before {
  transform: translateX(11px);
}
#logo-config {
  padding-top: 7px;
}
.settings-field.logo-field { padding-block: 0; }
.logo-heading { position: relative; }
.settings [data-icon="disclosure"] {
  display: inline-grid;
  place-items: center;
  flex: none;
  font-size: 18px;
  color: var(--muted);
}
.settings details[open] > summary > [data-icon="disclosure"],
.settings .logo-options-toggle[aria-expanded="true"] > [data-icon="disclosure"],
#upload-logo[aria-expanded="true"] [data-icon="disclosure"] {
  transform: rotate(180deg);
  color: var(--accent);
}
.summary-value {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  text-align: right;
  min-width: 0;
}
.summary-color {
  --swatch-dot: 8px;
  margin-left: auto;
  width: 16px;
  height: 16px;
  flex: none;
}
.summary-color + .summary-value,
.summary-diagram + .summary-value {
  margin-left: 0;
}
.summary-diagram {
  --diagram-fill: #32271e;
  --diagram-solid: #6c4a2b;
  display: grid;
  place-items: center;
  flex: none;
  margin-left: auto;
  width: 35px;
  height: 19px;
  border: 1px solid #5b4430;
  border-radius: 5px;
  background: #27221d;
  color: #e8b574;
}
.summary-diagram svg {
  width: 31px;
  height: 15px;
}
.options {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  padding: 0 0 9px 0;
}
.options button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  min-height: 34px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}
.options button:hover {
  border-color: #986434;
}
.options button[aria-pressed="true"] {
  background: var(--wash);
  border-color: #805725;
  color: var(--accent);
}
.options button i {
  font-size: 15px;
}
.style-options,
.font-options,
.palette-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.font-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.font-options button {
  flex-direction: column;
  line-height: 1.2;
  min-height: 40px;
}
#fonts button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
#fonts button[aria-pressed="true"] [data-locked-crown] { color: inherit; }
.options button small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
#motions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
#motions button { min-height: 68px; flex-direction: column; gap: 5px; padding: 6px 3px; }
.motion-icon {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #47382a;
  border-radius: 8px;
  background: var(--page);
  background-image: radial-gradient(#5c4934 1px, transparent 1px);
  background-size: 7px 7px;
}
.motion-icon i {
  width: 12px;
  aspect-ratio: 1;
  border-radius: 3px;
  background: linear-gradient(145deg, #ffe193, var(--accent));
  box-shadow: inset 0 0 0 1px #ffeec654;
  animation: var(--demo, none) 1.9s ease-in-out infinite;
}
.motion-icon[data-motion="pulse"] { --demo: motion-demo-scale; }
.motion-icon[data-motion="float"] { --demo: motion-demo-float; }
.motion-icon[data-motion="bounce"] i { grid-area: 1 / 1; }
.motion-icon[data-motion="swing"] { --demo: motion-demo-swing; }
.motion-icon[data-motion="shift"] { --demo: motion-demo-shift; }
.motion-icon[data-motion="flash"] { --demo: motion-demo-flash; }
@keyframes motion-demo-scale { 0%, 100% { transform: scale(.68); } 50% { transform: scale(1.3); } }
@keyframes motion-demo-float { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(-6px); } }
@keyframes motion-demo-swing { 0%, 100% { transform: rotate(-24deg); } 50% { transform: rotate(24deg); } }
@keyframes motion-demo-shift { 0%, 100% { transform: translateX(-7px); } 50% { transform: translateX(7px); } }
@keyframes motion-demo-flash { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .motion-icon i { animation: none; } }
.style-options button {
  flex-direction: column;
  min-height: 60px;
  gap: 2px;
  padding: 4px 2px;
  line-height: 1.2;
  --diagram-fill: #292725;
  --diagram-solid: #62594d;
}
.style-options button[aria-pressed="true"] {
  --diagram-fill: #35291e;
  --diagram-solid: #73532e;
}
.style-options svg {
  width: 76px;
  max-width: 100%;
  height: 34px;
}
.diagram-solid {
  fill: var(--diagram-solid);
}
.diagram-copy {
  fill: none;
  stroke-width: 1.8;
}
.template-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.template-options > button {
  position: relative;
  flex-direction: column;
  text-align: center;
  padding: 6px 3px;
  min-width: 0;
}
.template-sample {
  display: block;
  width: 48px;
  height: 48px;
  background: #272321;
  border-radius: 5px;
}
.template-options b { font-variant-numeric: tabular-nums; }
.template-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
}
.template-tabs { display: flex; flex-wrap: nowrap; gap: 4px; padding: 0; }
.template-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  gap: 4px;
  padding-inline: 6px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.template-bookmark { color: var(--muted); }
.template-bookmark[aria-pressed="true"] { color: var(--accent); border-color: #805725; }
.template-bookmark.single-bookmark:not([aria-pressed="true"]) { background: var(--accent); border-color: var(--accent); color: var(--page); }
.template-bookmark.single-bookmark:not([aria-pressed="true"]):hover { filter: brightness(1.1); }
.template-action-icon { display: grid; place-items: center; width: 15px; height: 15px; flex: none; }
.template-toolbar .template-action-icon { color: inherit; }
.template-action-icon svg { display: block; width: 100%; height: 100%; }
.template-empty { margin: 4px 0 10px; }
.strip-presets { display: grid; gap: 6px; padding-bottom: 8px; }
.strip-preset { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.strip-preset-apply { justify-content: flex-start; gap: 7px; min-width: 0; min-height: 34px; text-align: start; }
.strip-preset-apply span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-preset-apply small { flex: none; margin-inline-start: auto; color: var(--muted); }
.preset-form { display: grid; gap: 10px; margin-top: 12px; }
.preset-form > input { width: 100%; }
.preset-form > button { justify-self: end; }
.template-popular {
  position: absolute;
  inset: 3px 3px auto auto;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.template-popular svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 3px #ff692873); }
.template-popular path { transform-box: fill-box; transform-origin: center bottom; }
.hot-flame-shell { animation: flame-badge .72s ease-in-out infinite; }
.hot-flame-heart { animation: flame-badge .72s -.19s ease-in-out infinite; }
@keyframes flame-badge {
  0%, 100% { transform: scale(.98, .93) rotate(-3deg); }
  40% { transform: scale(.92, 1.12) rotate(4deg); }
  70% { transform: scale(1.06, .99) rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .template-popular path { animation: none; }
}
.settings > .text-field.face-card {
  display: grid;
  gap: 10px;
  margin-block: 6px 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(150deg, var(--surface-raised), var(--surface) 70%);
}
.face-card .text-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.face-card .field-heading label { font-size: 14px; }
.face-content-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: none;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.face-content-mode button {
  min-height: 31px;
  padding: 3px 11px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  white-space: nowrap;
}
.face-content-mode button[aria-pressed="true"] {
  border-color: #8a5b23;
  background: linear-gradient(#4c351b, var(--wash));
  box-shadow: inset 0 0 6px #ffbf001c;
}
.face-card .text-inputs input:not([type="file"]) { min-height: 38px; }
.face-card .field-hint { margin-top: 5px; }
.face-content-panels { display: grid; min-width: 0; }
.face-content-panels > div { grid-area: 1 / 1; min-width: 0; }
.face-content-panels > div[hidden] {
  /* Retain both panels' intrinsic heights while only the current one is interactive. */
  display: block !important;
  visibility: hidden;
}
.face-content-panels > .face-logo-field[hidden] { display: grid !important; }
.face-logo-field {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--settings-gap);
  min-height: 62px;
  padding: 9px;
  border: 1px dashed #514b43;
  border-radius: 9px;
  background: #24232182;
}
.face-logo-field > .single-logo-file { order: 1; max-width: 100%; }
.face-logo-field .single-logo-upload i[data-icon="upload"] { color: var(--accent); }
.single-logo-file { display: flex; align-items: center; min-width: 0; gap: 4px; color: var(--muted); }
.single-logo-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.single-logo-file .icon-button { flex: none; width: 25px; height: 25px; font-size: 13px; }
.single-logo-upload { min-height: 31px; gap: 4px; }
.single-logo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--settings-gap); }
#use-reference-star[aria-pressed="true"] { color: var(--accent); border-color: #805a25; background: var(--wash); }
#logo-row { --logo-switch-width: 42px; }
#logo-row .row-switch-gap { flex-basis: var(--logo-switch-width); }
#logo-switch { width: var(--logo-switch-width); justify-content: center; }
.palette-field {
  position: relative;
}
#palette-action-gap { flex: 0 0 var(--setting-switch-width); }
#palette-action-gap.single-palette-gap { flex-basis: calc((var(--setting-switch-width) - 4px) / 2); }
.palette-actions {
  position: absolute;
  inset-inline-start: var(--settings-action-x);
  top: calc((var(--settings-row-height) - var(--setting-switch-height)) / 2);
  gap: 4px;
  padding: 0;
}
.palette-actions button {
  min-height: var(--setting-switch-height);
  width: calc((var(--setting-switch-width) - 4px) / 2);
  padding: 2px 3px;
  font-size: 11px;
}
.palette-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.palette-options button {
  flex-direction: column;
  min-height: 52px;
  gap: 4px;
  padding: 4px 2px;
  line-height: 1.2;
}
.swatch,
.custom-swatch,
.summary-color {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  border-radius: 50%;
}
.swatch,
.custom-swatch {
  width: 24px;
  height: 24px;
}
.swatch,
.summary-color { background: var(--swatch-bg); }
.swatch::before,
.summary-color::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: var(--swatch-dot, 10px);
  height: var(--swatch-dot, 10px);
  border-radius: 50%;
  background: var(--swatch-fg);
}
.custom-swatch {
  background: var(--wash);
  color: var(--accent);
}
.gradient-editor {
  display: grid;
  gap: 10px;
  margin: 2px 0 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--page);
  font-size: 12px;
}
.gradient-heading, .gradient-stop-tools, .gradient-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gradient-heading:has(#gradient-channels[hidden]) { display: none; }
#gradient-channels, #outline-paint-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
#outline-paint-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gradient-editor :is(button:not([data-index]), input:not([type="range"])) {
  min-height: 36px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  white-space: nowrap;
}
#gradient-channels button, #outline-paint-modes button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
#gradient-channels button[aria-pressed="true"], #outline-paint-modes button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}
#gradient-track {
  position: relative;
  height: 57px;
  touch-action: none;
}
#gradient-preview {
  position: absolute;
  inset: 2px 13px auto;
  height: 24px;
  border: 1px solid #ffffff22;
  border-radius: 6px;
  background: var(--gradient), repeating-conic-gradient(#3a3937 0% 25%, #222120 0% 50%) 0 0 / 12px 12px;
}
#gradient-handles { position: absolute; inset: 23px 13px 0; }
#gradient-handles button {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  width: 26px;
  height: 34px;
  transform: translateX(-50%);
  background: transparent;
  border: 0;
  border-radius: 6px;
}
#gradient-handles button::before {
  content: "";
  width: 13px;
  height: 15px;
  border: 2px solid #938e85;
  border-radius: 5px 5px 3px 3px;
  background: var(--stop-color);
}
#gradient-handles button[aria-pressed="true"] { z-index: 1; }
#gradient-handles button[aria-pressed="true"]::before { border-color: var(--accent); box-shadow: 0 0 0 2px #111; }
.gradient-stop-tools { flex-wrap: wrap; }
.gradient-stop-tools label { margin-inline-start: auto; white-space: nowrap; color: var(--muted); }
#gradient-position { width: 50px; margin-inline: 3px; }
#gradient-plane {
  position: relative;
  height: clamp(94px, 35vw, 154px);
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
  border-radius: 8px;
  background: linear-gradient(0deg, #000, transparent),
    linear-gradient(90deg, #fff, hsl(var(--hue) 100% 50%));
}
#gradient-cursor {
  display: block;
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #111;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.gradient-sliders { display: grid; gap: 1px; }
.gradient-sliders label {
  display: grid;
  grid-template-columns: 4em minmax(0, 1fr) 3em;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  color: var(--muted);
}
.gradient-sliders input {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
}
#gradient-hue {
  grid-column: 2 / -1;
  appearance: none;
  height: 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);
}
#gradient-hue::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #171614;
  border-radius: 50%;
  background: white;
}
#gradient-opacity-value { text-align: right; font-family: var(--mono); }
.gradient-actions { gap: 8px; color: var(--muted); }
#gradient-hex { width: 7em; color: var(--ink); font-family: var(--mono); }

.pack-name,
.duration-edit label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.pack-name input {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  font-size: 16px;
  min-width: 0;
}
.edit-form label + input {
  margin-top: 3px;
}
.edit-form input + label {
  margin-top: 7px;
}
.apply-button {
  justify-self: end;
  border: 0;
  border-radius: 7px;
  background: var(--wash);
  color: var(--accent);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.duration-edit input {
  accent-color: var(--accent);
}
.duration-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 9px;
}
.duration-edit input {
  flex: 1;
  min-width: 40px;
}
.duration-edit output {
  font: 700 10px var(--mono);
  color: var(--accent);
}
.text-action {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
}
.settings .text-action {
  margin-bottom: 9px;
}
.export-dock {
  position: fixed;
  z-index: 4;
  inset: auto 0 0;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  background: #1a1918fa;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 15px #00000039;
}
.export-inner {
  max-width: 1130px;
  margin: 0 auto;
}
.export-bar {
  --add-width: 108px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--add-width) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.balance {
  justify-self: start;
  display: grid;
  gap: 1px;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
  padding-inline: 2px 7px;
}
.balance strong {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
}
.balance strong i { align-self: center; }
.balance small {
  font: 700 11px/1 system-ui, sans-serif;
}
.export-button {
  flex: 1;
  min-height: 39px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border: 0;
  border-radius: 8px;
  padding: 7px 13px;
  color: var(--on-accent);
  background: var(--accent);
  font-weight: 760;
}
.export-button:hover {
  background: #ffd03d;
}
.export-button i {
  font-size: 15px;
}
dialog {
  width: min(92vw, 460px);
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop {
  background: #000000ad;
}
#guide-dialog .guide-steps { margin-block: 13px 2px; }
#guide-dialog .guide-steps li { margin-block: 9px; font-size: 14px; }
.guide-steps strong, .community-panel strong, .community-panel p a { color: var(--accent); }
.community-panel p a { margin-inline: 3px; text-decoration: underline; text-underline-offset: 2px; }
.community-panel { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.community-panel p { margin: 0 0 8px; }
.community-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#guide-dialog .community-actions .export-button { min-height: 34px; text-decoration: none; }
.pack-form, .pack-form > div { display: grid; gap: 8px; }
.pack-form { margin-top: 12px; }
.pack-form p { margin: 0; }
.pack-form p:empty, #my-emoji-status:empty { display: none; }
.pack-form input, .pack-form select { width: 100%; min-width: 0; }
.emoji-pack-list { list-style: none; display: grid; gap: 10px; padding: 0; margin: 12px 0 0; }
.emoji-pack-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.emoji-pack-list strong { flex: 1 0 100%; overflow-wrap: anywhere; }
#about-dialog p { color: var(--muted); line-height: 1.65; }
.about-brand { display: flex; align-items: center; gap: 9px; margin: 14px 0 10px; }
.about-brand img { object-fit: contain; }
.about-brand strong { display: block; font-size: 16px; }
.about-version { color: var(--accent); font-size: 12px; }
.about-website { min-height: 34px; padding-inline: 12px; color: var(--accent); }
#work-added-dialog {
  max-width: 340px;
  padding: 20px 16px 16px;
  border-color: #66502d;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, #3e3121, transparent 61%), var(--surface);
}
.work-added-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  margin: 0 auto 9px;
  border-radius: 15px;
  color: #24170e;
  background: linear-gradient(144deg, #ffedba, #ffc360);
  font-size: 25px;
}
#work-added-title { margin: 0; font-size: 20px; }
#work-added-details { margin: 4px 0 12px; }
#work-added-name {
  width: 100%;
  text-align: center;
  overflow: hidden;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #211f1b;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-added-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dialog-header h2 {
  font-size: 17px;
  margin: 0;
}
dialog ol {
  padding-left: 18px;
  margin: 10px 0;
}
dialog li {
  margin: 5px 0;
}
dialog p {
  color: var(--muted);
  font-size: 12px;
}
#feedback-form {
  margin-top: 10px;
  font-size: 12px;
}
#feedback-text {
  width: 100%;
  display: block;
  margin: 4px 0 8px;
  padding: 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  resize: vertical;
}
.pack-name {
  display: grid;
  gap: 4px;
  margin: 10px 0;
}
.toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  background: #2d271f;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  width: max-content;
  max-width: 88vw;
}
@media (min-width: 760px) {
  .top-inner {
    min-height: 56px;
    padding: 0 20px;
  }
  .page {
    grid-template-columns: minmax(0, 1.28fr) minmax(335px, 1fr);
    padding: 18px 20px 90px;
    gap: 14px;
  }
  .preview {
    padding: 12px;
    position: sticky;
    top: 12px;
  }
  .stage {
    --stage-height: clamp(225px, 28vw, 340px);
  }
  .art-wrap.square {
    width: min(196px, 70%);
  }
  .settings {
    --settings-row-height: 52px;
    padding: 0 13px;
  }
  .export-dock {
    padding: 8px 20px;
  }
  .export-button {
    flex: none;
    min-width: 145px;
  }
}
@media (max-width: 350px) {
  .brand small {
    display: none;
  }
  .top-actions {
    gap: 5px;
  }
  .top-inner {
    padding-inline: 12px;
  }
}

.inline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px 10px;
  padding: 1px 0 9px;
}
.inline-controls > label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.typography-tools {
  display: grid;
  gap: 9px;
  padding: 4px 0 9px;
}
.typography-field {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.control-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding-block-start: 9px;
}
#text-slant {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}
#text-slant button {
  min-height: 34px;
  white-space: nowrap;
}
#text-slant button[data-value="italic"] { font-style: italic; }
#alibaba-weight-fields > label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.inline-controls select {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 7px;
  color: var(--ink);
  background-color: var(--surface-raised);
  font-size: 13px;
}
.inline-controls .toggle-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  min-height: 31px;
}
.toggle-inline input {
  accent-color: var(--accent);
}
.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.effect-hint {
  margin: 0 0 6px;
}
.library-dock-button {
  min-height: 36px;
  white-space: nowrap;
}
.library-dock-button strong {
  color: var(--accent);
  font: 700 10px var(--mono);
}
.library-toolbar {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}
#library-total {
  color: var(--muted);
  font-size: 12px;
}
#library-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  max-height: min(35vh, 300px);
  overflow: auto;
}
#library-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
#library-list .work-select {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
#library-list input {
  accent-color: var(--accent);
}
.work-name {
  min-width: 0;
  max-width: 100%;
  flex: 1;
  width: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 4px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-name:not(:disabled):is(:hover, :focus-visible) { border-color: var(--line); border-radius: 6px; }
.work-card {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}
.work-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.work-preview {
  display: block;
  max-width: 100%;
  max-height: 64px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: conic-gradient(#363739 25%, #28292b 0 50%, #363739 0 75%, #28292b 0);
  background-size: 12px 12px;
}
.work-tiles {
  flex: none;
  color: var(--muted);
  font-size: 11px;
}
.library-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.library-status a {
  display: inline-block;
  margin-inline-end: 8px;
}
@media (max-width: 759px) {
  .top-inner {
    min-height: 44px;
    padding-inline: 11px;
  }
  .page {
    padding: 8px 9px calc(66px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .panel {
    border-radius: 11px;
  }
  .preview {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 7px 8px;
  }
  .panel-heading {
    min-height: 26px;
    margin-bottom: 5px;
  }
  .heading-icon,
  .panel-heading .icon-button {
    width: 26px;
    height: 26px;
  }
  .panel-heading .icon-button { font-size: 14px; }
  .stage {
    min-height: 0;
    --stage-height: clamp(78px, 24vw, 116px);
  }
  .preview.is-single .stage {
    --stage-height: 102px;
  }
  .art-wrap.square {
    width: min(92px, calc(var(--stage-height) - 10px), 67%);
  }
  .settings {
    --settings-row-height: 41px;
    --settings-gap: 6px;
    --settings-label-size: 12px;
    --setting-switch-height: 29px;
    padding-inline: 9px;
  }
  .settings-field {
    padding-block: 5px;
  }
  .text-field {
    padding-block: 7px;
  }
  #types button {
    min-height: 38px;
  }
  .style-options button {
    min-height: 56px;
  }
  .style-options svg {
    height: 30px;
  }
  .export-dock {
    padding: 6px 10px max(6px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 420px) and (max-height: 620px) {
  .stage {
    --stage-height: 78px;
  }
}
@media (max-width: 365px) {
  .export-bar {
    gap: 4px;
  }
  .library-dock-button {
    padding-inline: 5px;
  }
}

[data-crown], [data-locked-crown] {
  width: 12px;
  height: 12px;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--accent);
}
[data-crown] svg, [data-locked-crown] svg { width: 100%; height: 100%; }
.font-option-name { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.font-upload-icon { display: inline-grid; place-items: center; font-style: normal; }
.local-font-icon { display: inline-grid; place-items: center; font-size: 14px; color: var(--accent); }
#fonts [aria-pressed="true"] .local-font-icon { color: inherit; }
.local-font-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-local-font] { min-width: 0; }
[data-local-font] .font-option-name { min-width: 0; max-width: 100%; }
.local-font-list { display: grid; gap: 8px; list-style: none; max-height: 55dvh; overflow-y: auto; margin: 12px 0 0; padding: 0; }
.local-font-list li { min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 8px; }
.local-font-entry { display: flex; gap: 6px; align-items: center; }
.local-font-entry > .font-option-name, .local-font-entry > input { flex: 1; min-width: 0; }
.local-font-entry > .font-option-name { justify-content: start; }
.local-font-entry > button { flex: none; white-space: nowrap; }
@font-face { font-family: "Cube Fangzheng"; src: url("./assets/fz-zheng-gbk.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Cube Alibaba"; src: url("./assets/alibaba-35.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Cube Alibaba"; src: url("./assets/alibaba-55.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cube Alibaba"; src: url("./assets/alibaba-65.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cube Alibaba"; src: url("./assets/alibaba-95.woff") format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Cube Alibaba"; src: url("./assets/alibaba-115.woff") format("woff"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Cube Douyin"; src: url("./assets/douyin.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Cube Sans"; src: url("./assets/sans-common.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Cube Serif"; src: url("./assets/serif-common.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Cube Inter Display"; src: url("./assets/interdisplay-bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Cube Roboto Condensed"; src: url("./assets/roboto_condensed-bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Cube Roboto Slab"; src: url("./assets/robotoslab-bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Cube DIN"; src: url("./assets/dinb.ttf") format("truetype"); font-display: swap; }
.coin-amount { font-family: "Cube DIN", var(--mono); font-variant-numeric: tabular-nums; }
[data-font-face]:not([data-font-face="follow"]) { font-family: var(--sample-face, system-ui), "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 400; }
[data-font-face="fz-zheng"] { --sample-face: "Cube Fangzheng"; }
[data-font-face="alibaba"] { --sample-face: "Cube Alibaba"; }
[data-font-face="douyin"] { --sample-face: "Cube Douyin"; }
[data-font-face="sans"] { --sample-face: "Cube Sans"; }
[data-font-face="serif"] { --sample-face: "Cube Serif"; }
[data-font-face="interdisplay"] { --sample-face: "Cube Inter Display"; }
[data-font-face="robotocondensed"] { --sample-face: "Cube Roboto Condensed"; }
[data-font-face="robotoslab"] { --sample-face: "Cube Roboto Slab"; }
[data-font-face="din"] { --sample-face: "Cube DIN"; }
.latin-picker { border: 1px solid var(--line); background: var(--surface-raised); border-radius: 8px; min-width: 0; }
.settings .latin-picker > summary { min-height: 34px; padding: 0 8px; gap: 6px; justify-content: start; }
#latin-font-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latin-picker > summary [data-icon="disclosure"] { margin-inline-start: auto; }
#latin-font-options { display: grid; padding: 4px; gap: 4px; }
#latin-font-options button { min-height: 34px; justify-content: space-between; padding-inline: 7px; white-space: nowrap; }
.latin-font-sample { color: var(--muted); font-size: 12px; }
.palette-options button:has(> [data-locked-crown]) { position: relative; }
.palette-options button > [data-locked-crown] {
  position: absolute;
  inset: 5px 5px auto auto;
}
.export-bar > button {
  min-height: 40px;
  height: 40px;
  box-sizing: border-box;
}
#save-work {
  width: var(--add-width);
  min-width: 0;
  padding-inline: 6px;
}
.library-dock-button { justify-self: end; }
#save-work i { font-size: 16px; }
.library-dock-button i, .balance strong i { font-size: 14px; }
.library-pricing {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 11px;
}
.library-pricing strong { color: var(--accent); }
.account-page {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 10px 9px 22px;
  display: grid;
  gap: 9px;
}
.account-panel { padding: 13px; }
.account-panel h1, .account-panel h2 { margin: 0; font-size: 16px; }
.account-panel p, #membership-dialog p, #recharge-dialog p {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.wallet-card {
  margin-block: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 12px;
  padding: 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
}
.wallet-card span { font-size: 12px; color: var(--muted); }
.wallet-card strong { grid-column: 1; color: var(--accent); font-size: 24px; font-weight: 750; }
.wallet-card small { grid-column: 1 / -1; color: var(--muted); }
.wallet-card button { grid-area: 1 / 2 / 3 / 3; }
.account-links, .account-form { display: grid; gap: 7px; }
#recharge-stars { margin-block: 12px; }
#stars-checkout { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.account-links > button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 40px;
  text-align: start;
}
.account-links > button > i:first-child,
.wallet-label > i,
#account-recharge > i { flex: none; inline-size: 18px; block-size: 18px; font-size: 18px; line-height: 1; }
:is(.account-links > button > i:first-child, .wallet-label > i, #account-recharge > i) > svg { display: block; width: 100%; height: 100%; }
.account-member-summary i { color: inherit; font-size: 12px; }
.generation-count { min-width: 19px; height: 19px; padding-inline: 5px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 11px; }
#account-logout { margin-top: 9px; }
.account-primary { width: 100%; }
.account-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.account-form input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
}
#payment-orders {
  padding: 0;
  list-style: none;
  font-size: 12px;
}
#payment-orders li {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}
.payment-methods button { min-height: 38px; padding: 4px; font-size: 12px; }
.payment-methods button[aria-pressed="true"] { border-color: #926329; background: var(--wash); color: var(--accent); }
#recharge-dialog { max-height: 90dvh; overflow-y: auto; }
#recharge-form { display: grid; gap: 9px; }
#recharge-offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
#recharge-offers legend { margin-bottom: 6px; padding: 0; color: var(--ink); font-size: 12px; font-weight: 750; }
.recharge-offer {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 76px;
  min-width: 0;
  padding: 6px 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  white-space: nowrap;
}
.recharge-offer b { color: var(--ink); font-size: 11px; }
.recharge-offer strong { color: #ffda90; font-size: 11px; }
.recharge-offer small { color: var(--muted); font-size: 10px; }
.recharge-offer[aria-pressed="true"] { border-color: #dda62d; background: #392b18; }
.recharge-custom label { margin-bottom: 4px; }
.recharge-custom > div { position: relative; }
.recharge-custom input { padding-inline-end: 52px; }
.recharge-custom input::placeholder { color: var(--muted); font-size: 12px; opacity: 1; }
.recharge-custom > div > span { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; }
.recharge-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; color: var(--muted); font-size: 11px; }
.recharge-summary strong { color: var(--accent); font-size: 12px; text-align: end; }
#recharge-dialog #recharge-notice { margin: 0; color: var(--muted); font-size: 11px; }
#payment-proof { margin-top: 9px; }
#payment-status { color: var(--accent) !important; }
@media (max-width: 460px) {
  .top-actions { gap: 5px; }
  .export-bar > button { padding-inline: 8px; }
}


.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 6px;
  color: #d1c9bc;
  background: #33302b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.account-badge i { font-size: 12px; }
.account-badge[data-tier="month"] { background: #453413; color: #ffd084; }
.account-badge[data-tier="quarter"] { background: #333b45; color: #d9e6f4; }
.account-badge[data-tier="year"] { background: #534019; color: #ffe078; }
.top-actions > .icon-button,
.top-actions .help-menu > summary { background: #24211e; color: #dfd8ca; font-size: 19px; }
.top-actions > .icon-button[aria-pressed="true"],
.top-actions .help-menu[open] > summary { color: var(--accent); background: var(--wash); }

.wallet-label, .library-pricing strong, #recharge-dialog h2 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.wallet-label i, .balance strong i, .library-pricing strong i, #recharge-dialog h2 i { color: var(--accent); }
#account-recharge { font-size: 12px; padding-inline: 9px; }
#open-account { position: relative; }
.account-notice { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; background: var(--accent); border: 1px solid var(--page); border-radius: 50%; }
.generation-jobs { list-style: none; display: grid; gap: 8px; margin: 10px 0; padding: 0; }
.generation-jobs li { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.generation-jobs small { color: var(--muted); }
.generation-jobs progress { width: 100%; accent-color: var(--accent); }
#history-heading { display: inline-flex; align-items: center; gap: 6px; }
#history-heading [data-icon="collections-solid"] { color: var(--accent); font-size: 18px; }

.advanced-trigger {
  justify-content: center;
  min-height: var(--setting-switch-height);
  padding: 3px 5px;
  white-space: nowrap;
  gap: 4px;
}
.advanced-trigger .advanced-icon { color: var(--accent); font-size: 13px; }
.advanced-sheet .dialog-header h2 { display: flex; align-items: center; gap: 7px; }
.advanced-sheet h2 [data-icon="advanced-controls"] { color: var(--accent); font-size: 16px; }
body:has(#gradient-dialog[open]) { overflow: hidden; }
.editor-sheet {
  position: fixed;
  inset: auto 0 var(--sheet-keyboard-inset, 0px);
  width: min(100%, 480px);
  max-width: 100%;
  max-height: max(92px, calc(100dvh - var(--sheet-preview-bottom, 150px) - var(--sheet-keyboard-inset, 0px)));
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -13px 28px #000a, 0 -3px 8px #0006;
}
.editor-sheet[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.editor-sheet::backdrop { background: transparent; }
body:has(#gradient-dialog[open]) .advanced-sheet { visibility: hidden; }
.advanced-sheet {
  z-index: 8;
  max-height: min(calc(100dvh - var(--sheet-keyboard-inset, 0px) - 12px), max(min(210px, 55dvh), calc(100dvh - var(--sheet-preview-bottom, 150px) - var(--sheet-keyboard-inset, 0px))));
}
.advanced-trigger[aria-expanded="true"] { border-color: #805725; color: var(--accent); background: var(--wash); }
.animation-adjust-tabs { padding: 0 0 10px; }
#effects-adjust-dialog[open] { grid-template-rows: auto auto minmax(0, 1fr); }
#effects-adjust-body { grid-row: 3; }
.glow-adjust-preview { position: relative; margin: 8px 14px 0; }
.glow-adjust-preview .stage { min-height: 0; height: clamp(45px, 11dvh, 78px); }
.glow-adjust-preview canvas { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.glow-adjust-preview button { display: none; position: absolute; right: 5px; bottom: 5px; }
@media (prefers-reduced-motion: reduce) {
  .glow-adjust-preview button { display: inline-flex; }
}
.animation-adjust-field { grid-template-columns: 72px minmax(0, 1fr) 66px; margin-block: 10px; }
.animation-adjust-field :is(.effect-color-swatch, .animation-choices) { grid-column: span 2; }
.animation-choices { display: grid; grid-template-columns: repeat(var(--choice-columns, 2), minmax(0, 1fr)); padding: 0; }
.animation-choices button { min-width: 0; padding-inline: 3px; }
.animation-choices button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.effect-color-swatch { width: 48px; height: 32px; border: 3px solid var(--surface); outline: 1px solid var(--line); border-radius: 7px; background: var(--swatch); }
.star-appearance { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.star-appearance .animation-adjust-field { margin-block: 0; grid-template-columns: auto minmax(0, 1fr) 36px; }
.star-appearance .animation-adjust-field:last-child { grid-template-columns: auto auto; }
.star-appearance .effect-color-swatch { grid-column: auto; }
.editor-sheet[data-effect-color] { inset: var(--picker-top, 10px) auto auto var(--picker-left, 10px); width: var(--picker-width, min(360px, 92vw)); max-height: var(--picker-height, 90dvh); margin: 0; border-radius: 12px; animation: none; }
#gradient-dialog[data-effect-color] .gradient-sliders label:has(#gradient-opacity) { display: none; }
#gradient-dialog[data-effect-color] .gradient-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#gradient-dialog[data-effect-color] #gradient-hex { min-width: 0; max-width: 100px; }
#effects button:disabled { opacity: .42; }
.star-switches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-block: 10px; }
.star-switches .setting-switch { justify-content: space-between; padding-inline: 6px; gap: 3px; }
#frame-corner-pick button[aria-pressed="false"]:hover { border-color: var(--line); }
.editor-sheet > .dialog-header {
  min-height: 51px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.editor-sheet-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 14px max(12px, env(safe-area-inset-bottom));
}
.editor-sheet-body > .gradient-editor { margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .editor-sheet[open] { animation: editor-sheet-in .18s ease-out; }
  @keyframes editor-sheet-in { from { transform: translateY(100%); } }
}
@media (min-width: 760px) {
  .editor-sheet {
    inset-inline: auto max(20px, calc((100vw - 1120px) / 2));
    width: min(42vw, 470px);
    max-height: calc(100dvh - var(--sheet-keyboard-inset, 0px) - 12px);
    margin: 0;
  }
}
.frame-shape-fields { display: grid; gap: 11px; padding: 2px 0 13px; }
.frame-shape-fields:not([hidden]) ~ .frame-shape-fields:not([hidden]) { border-top: 1px solid var(--line); padding-top: 10px; }
.platform-corner-group {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.platform-corner-group legend { padding: 0 0 6px; font-size: 12px; font-weight: 700; }
.platform-corner-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
.frame-range {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.frame-range input { width: 100%; min-width: 0; margin: 0; accent-color: var(--accent); }
.frame-range input:disabled { opacity: .42; }
.frame-range output { font-family: var(--mono); text-align: end; white-space: nowrap; }
#frame-corner-pick {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0;
}
.frame-shape-fields .options button { min-height: 32px; padding-inline: 3px; }
.advanced-frame-outline, .text-outline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}
.advanced-frame-outline { border-top: 1px dashed var(--line); padding-top: 7px; }
.outline-toggle, #text-outline-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.outline-toggle { gap: 7px; }
#text-outline-paint { min-height: 29px; gap: 5px; padding-inline: 6px; font-size: 11px; white-space: nowrap; }
#text-outline-paint [data-icon="disclosure"] { font-size: 14px; }
.outline-swatch { width: 26px; height: 14px; border: 1px solid #ffffff44; border-radius: 4px; }
.logo-motion-field {
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  margin: 2px 0 6px;
  border-bottom: 1px solid var(--line);
}
.logo-motion-field select { min-width: 7.5em; }
.logo-motion-field > label { flex-direction: row; align-items: center; white-space: nowrap; gap: 6px; margin-inline-start: auto; }

.logo-base-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#logo-modes button { min-height: 39px; gap: 6px; font-size: 12px; }
#logo-modes button i { display: inline-grid; align-items: center; font-size: 19px; }
#logo-modes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#logos {
  display: grid;
  grid-template: repeat(2, 1fr) / repeat(6, minmax(0, 1fr));
  gap: 5px;
}
#upload-logo { min-height: 33px; padding-inline: 9px; }
#upload-logo[aria-expanded="true"], .logo-asset-preview[aria-pressed="true"] { color: var(--accent); border-color: #805a25; background: var(--wash); }
.logo-asset {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--page);
  font-size: 12px;
}
.logo-asset .options { padding-bottom: 0; }
.logo-asset-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; min-width: 0; align-items: center; gap: 6px; }
.logo-asset-preview { display: grid; grid-template-columns: 44px minmax(0, 1fr); width: 100%; min-width: 0; gap: 10px; text-align: start; }
.logo-asset-preview span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-asset-preview canvas { width: 44px; height: 44px; flex: none; border-radius: 6px; background-color: #262526; background-image: conic-gradient(#3a3839 25%, transparent 0 50%, #3a3839 0 75%, transparent 0); background-size: 12px 12px; }
.logo-remove { flex: none; width: 36px; height: 36px; }
.logo-format-hint { margin: 0; }
#choose-logo-file { justify-self: start; }
#uploaded-logo-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.logo-size-control { display: grid; gap: 4px; }
.logo-size-control > div { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.logo-size-control output { color: var(--muted); font-variant-numeric: tabular-nums; }
.logo-size-control input { width: 100%; min-height: 24px; margin: 0; accent-color: var(--accent); }
.logo-size-control input:disabled { opacity: .45; }
.logo-asset > .text-action { justify-self: start; font-size: 11px; padding: 0; }
#logo-quality-dialog { max-width: 370px; }
#logo-quality-dialog a { color: var(--accent); }
#logos button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  padding: 5px;
}
#logos svg { width: min(65%, 28px); height: auto; fill: currentColor; }
.logo-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-block: 4px;
  color: var(--muted);
  font: 11px var(--mono);
}
.logo-pagination .icon-button:disabled { opacity: .35; }
#logo-prev i { transform: rotate(90deg); }
#logo-next i { transform: rotate(-90deg); }

.content-options button { min-height: 34px; }

#membership-dialog {
  padding: 0;
  max-width: 430px;
  max-height: 92dvh;
  border-color: #5f4825;
  background: var(--surface);
  overflow: auto;
}
.history-style-note {
  margin: 0 0 8px;
  padding: 7px 10px;
  border-inline-start: 2px solid #ba8a43;
  border-radius: 6px;
  background: #2a2418;
  color: #ecdaad;
  font-size: 11px;
}
#member-home-dialog { max-width: 410px; max-height: 92dvh; border-color: #604b29; }
#member-home-dialog > .dialog-header { margin-bottom: 12px; }
#member-home-title { font-size: 18px; line-height: 1.3; }
.member-home-card {
  --member-ink: #ffdf9f;
  --member-muted: #ecd1a1;
  --member-line: #957441;
  --member-glow: #a371354f;
  --member-dark: #211b14;
  --member-light: #4b321d;
  position: relative;
  display: grid;
  gap: 21px;
  overflow: hidden;
  padding: 15px 16px 17px;
  color: var(--member-ink);
  border: 1px solid var(--member-line);
  border-radius: 13px;
  background: radial-gradient(ellipse at 94% 111%, var(--member-glow), transparent 59%),
    linear-gradient(135deg, var(--member-dark) 47%, var(--member-light));
}
.member-home-card[data-tier="ordinary"] {
  --member-ink: #e6dfd4;
  --member-muted: #cec6b8;
  --member-line: #5b5248;
  --member-glow: #a0907929;
  --member-dark: #24221f;
  --member-light: #3a342c;
}
.member-home-card[data-tier="quarter"] {
  --member-ink: #e1eefb;
  --member-muted: #d0dbea;
  --member-line: #62788a;
  --member-glow: #8eaaca51;
  --member-dark: #222934;
  --member-light: #3b4c59;
}
.member-home-card[data-tier="year"] {
  --member-ink: #ffe69a;
  --member-muted: #f1deb2;
  --member-line: #ba8e39;
  --member-glow: #ffc04961;
  --member-dark: #352713;
  --member-light: #654416;
}
.member-home-card::after {
  content: "";
  position: absolute;
  inset: 24px -27px auto auto;
  width: 145px;
  height: 145px;
  border: 1px solid currentColor;
  border-radius: 28px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 11px var(--member-line), inset 0 0 0 16px var(--member-line);
  opacity: .17;
  pointer-events: none;
}
.member-card-badge, .member-card-time { position: relative; z-index: 1; }
.member-card-badge, .member-card-time > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.member-card-badge { font-weight: 850; font-size: 14px; }
.member-card-badge i { font-size: 19px; }
.member-card-time { display: grid; gap: 4px; }
.member-card-time > span, .member-card-time > small { color: var(--member-muted); font-size: 11px; }
.member-card-time > small { margin-top: 3px; }
.member-card-time > strong { font-size: clamp(21px, 6vw, 28px); line-height: 1.12; letter-spacing: .02em; }
.member-home-benefits { margin-block: 13px; }
.member-home-benefits h3 { margin: 0 0 8px; font-size: 14px; }
.member-home-benefits .member-features li { min-height: 46px; padding: 7px; border: 1px solid #403626; }
.member-home-benefits .member-features li i { flex: 0 0 24px; }
.member-home-benefits .member-features small { font-size: 11px; line-height: 1.3; }
.member-hero {
  position: relative;
  padding: 47px 14px 0;
  background: radial-gradient(ellipse at 23% 14%, #5d411d60, transparent 72%);
}
.member-cover {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 105px;
  overflow: hidden;
  padding: 13px 15px;
  border: 1px solid #ab792f;
  border-radius: 14px;
  box-shadow: 0 8px 22px #120e0a77, inset 0 1px 2px #fff1b323;
  background: radial-gradient(ellipse at 95% 105%, #a96b254e, transparent 60%),
    linear-gradient(121deg, #3a2c16, #221c15 70%, #4c341c);
}
.member-cover::after {
  content: "";
  position: absolute;
  inset: -9px -28px auto auto;
  width: 149px;
  height: 149px;
  transform: rotate(38deg);
  border: 1px solid #ffcd6d4b;
  border-radius: 27px;
  box-shadow: 0 0 0 13px #f6be5415, inset 0 0 0 18px #f6be5421;
  pointer-events: none;
}
.member-cover-copy, .member-emblem { position: relative; z-index: 1; }
.member-close { position: absolute; top: 12px; right: 12px; background: #241b1180; }
.member-emblem {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #ffdf90;
  border-radius: 15px;
  background: linear-gradient(151deg, #ffedaf, #e9a940 75%);
  color: #523216;
  box-shadow: 0 6px 15px #2e211c65, inset 0 1px 2px #fff9;
  font-size: 26px;
}
#member-title { margin: 0; color: #ffdf96; font-size: clamp(18px, 5.1vw, 23px); letter-spacing: .035em; }
#membership-dialog #member-reason { margin: 4px 0 0; color: #d7c4a6; font-size: 11px; }
.member-body { display: grid; gap: 14px; padding: 14px; }
.member-features { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; }
.member-features li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 7px 5px;
  border-radius: 8px;
  background: #24211d;
}
.member-features li i { width: 24px; height: 24px; border-radius: 7px; background: #3c2d16; color: #ffc867; font-size: 14px; }
.member-features li span { display: grid; gap: 1px; min-width: 0; }
.member-features strong { font-size: 12px; color: #f8e8cc; }
.member-features small { font-size: 9px; color: #c5baaa; }
#membership-dialog .member-features { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
#membership-dialog .member-features li {
  display: grid;
  grid-column: auto;
  justify-items: center;
  gap: 4px;
  padding: 4px 0;
  text-align: center;
  background: transparent;
}
#membership-dialog .member-features li span { display: block; }
#membership-dialog .member-features li i {
  width: 32px;
  height: 32px;
  border: 1px solid #5e482a;
  border-radius: 13px;
  color: #ffd581;
  background: linear-gradient(141deg, #3c2c1b, #29231d);
  font-size: 15px;
}
#membership-dialog .member-features strong { font-size: 10px; white-space: nowrap; }
#membership-dialog .member-features small { display: none; }
#member-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}
#member-plans legend { margin-bottom: 7px; padding: 0; font-size: 13px; font-weight: 750; color: #f5e5dc; }
#member-plans label { position: relative; min-width: 0; cursor: pointer; }
#member-plans input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.member-plan-card {
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
  gap: 5px;
  min-height: 121px;
  padding: 8px 3px;
  border: 1px solid #52452f;
  border-radius: 11px;
  background: linear-gradient(160deg, #2b261e, #211e1a);
  color: #f4e6ce;
}
#member-plans input:checked + .member-plan-card {
  border-color: #e7ad45;
  background: radial-gradient(ellipse at 90% 4%, #8d602848, transparent 65%), linear-gradient(150deg, #4a3520, #2b241c);
  box-shadow: inset 0 0 0 1px #ffd18d26;
}
#member-plans input:focus-visible + .member-plan-card { outline: 2px solid var(--accent); outline-offset: 2px; }
.member-plan-card strong { font-size: 12px; }
.member-plan-card small { font-size: 10px; color: #dfcfb6; }
.member-tier-icon { display: grid; place-items: center; width: 25px; height: 25px; color: #e2aa61; font-size: 21px; }
.member-plan-card[data-tier="quarter"] .member-tier-icon { color: #c2ccd7; }
.member-plan-card[data-tier="year"] .member-tier-icon { color: #ffdd63; }
.member-plan-price { color: #ffe5b4; font: 800 clamp(18px, 5.1vw, 25px)/1.15 var(--mono); }
.member-plan-price small { display: block; margin-top: 2px; font-size: 9px; white-space: nowrap; }
.member-plan-term { padding: 2px 6px; border: 1px solid #69502b; border-radius: 14px; background: #4b35237d; white-space: nowrap; }
#member-plans .member-plan-reward { font-size: 9px; line-height: 1.35; color: #ffe0a0; text-wrap: balance; }
#open-member-rules { justify-self: end; padding: 0; font-size: 11px; }
#member-rules-dialog { max-height: 88dvh; overflow: auto; }
#member-rules-dialog section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
#member-rules-dialog h3 { margin: 0 0 5px; color: #ffdf96; font-size: 13px; }
#member-rules-dialog p, #member-rules-dialog ul { margin: 5px 0; color: var(--muted); font-size: 12px; }
#member-rules-dialog ul { padding-inline-start: 17px; }
.member-checkout { display: grid; gap: 5px; padding-top: 9px; border-top: 1px solid #4a3d29; }
.member-checkout-quote { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; font-size: 12px; }
.member-checkout-quote span { color: #cbbfae; }
.member-checkout-quote strong { color: #ffe0a4; font: 750 14px var(--mono); }
#membership-dialog #member-offer { margin: 0; color: #d8c8b3; font-size: 11px; }
#activate-member, #member-home-action { min-height: 43px; border-radius: 23px; background: linear-gradient(108deg, #ffe4a4, #ffc449 82%); color: #2b1f13; }
#activate-member i { display: inline-grid; place-items: center; transform: rotate(-90deg); }

#insufficient-dialog { max-width: 340px; border-color: #775627; }
#insufficient-title { display: flex; gap: 6px; align-items: center; }
#insufficient-title i { color: var(--accent); }
.insufficient-amount { margin: 12px 0; padding: 10px; border-radius: 9px; text-align: center; background: #342818; color: #ffdd99; }
.insufficient-amount strong { margin: 0 5px; font: 800 25px var(--mono); }
.insufficient-breakdown { margin: 0; display: grid; gap: 5px; }
.insufficient-breakdown div { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.insufficient-breakdown dd { margin: 0; color: var(--ink); font: 750 12px var(--mono); }
.insufficient-breakdown dd::after { content: " 魔币"; font-family: system-ui, sans-serif; }
.generation-fields { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 8px; }
.generation-fields .pack-name { margin: 6px 0 3px; align-content: start; min-width: 0; }
.generation-fields :is(input, select) { display: block; height: 38px; margin-top: 2px; min-width: 0; }
.generation-fields input::placeholder { color: #928b80; }
.generation-fields select {
  width: 100%;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  font-size: 13px;
}
.generation-fields input[aria-invalid="true"] { border-color: #fb7971; }
.generation-fields input[aria-invalid="true"]::placeholder, #library-name-error { color: #ffa09a; }
.generation-submit { width: 100%; min-height: 41px; margin-top: 9px; }
#library-totals { padding-top: 3px; }
#result-status { margin: 8px 0 0; }

#history-list {
  display: grid;
  gap: 6px;
  list-style: none;
  padding: 0;
  max-height: 50dvh;
  overflow: auto;
}
#history-list li {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}
.history-entry { display: grid; gap: 3px; min-width: 0; text-align: left; padding: 4px; border: 0; background: transparent; }
.history-entry strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.history-entry small { color: var(--muted); font-size: 10px; }
#history-list .quiet-button { white-space: nowrap; }
.history-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; max-inline-size: min(12rem, 52vw); }
.result-tools { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.result-tools label { display: inline-flex; align-items: center; gap: 5px; }
.result-tools input { accent-color: var(--accent); }
#result-files {
  display: grid;
  gap: 6px;
  max-height: 44dvh;
  overflow: auto;
  padding: 0;
  list-style: none;
}
#result-files li { margin: 0; }
.result-work {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.result-work-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.result-work-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.result-work-heading button { flex: none; white-space: nowrap; }
.result-tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.result-tiles > li { min-width: 0; }
#result-files label {
  min-width: 0;
  position: relative;
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}
#result-files label:has(input:checked) { border-color: var(--accent); }
#result-files label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
#result-files input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#result-files canvas { width: 100%; height: 100%; border: 0; border-radius: inherit; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.result-actions > * { min-height: 37px; }
.result-bot-icon {
  flex: none;
  width: 15px;
  height: 12px;
  background: var(--accent);
  -webkit-mask: url("./assets/telegram-robot.svg") center / contain no-repeat;
  mask: url("./assets/telegram-robot.svg") center / contain no-repeat;
}
#publish-result, #result-pack { grid-column: 1 / -1; text-decoration: none; }
.member-features li:last-child:nth-child(odd) { grid-column: span 2; }
.member-features li:last-child:nth-child(odd) span { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }

.member-usage {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 6px;
  max-height: 112px;
  overflow: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}
.member-usage li {
  margin: 0;
  padding: 5px 8px;
  border: 1px solid #664c26;
  border-radius: 6px;
  background: #30261a;
  color: #ffe1a1;
  overflow-wrap: anywhere;
  font-size: 12px;
}

#frame-corner-pick button svg { width: 17px; height: 17px; }
.corner-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
#frame-corner-amount-value { font-size: 10px; }
