* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0a0a0a;
  color: #fafafa;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 22px;
  background: rgba(10, 10, 10, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid #1c1c1c;
}

.back {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid #272727;
  border-radius: 11px;
  background: #141414;
  color: #d4d4d6;
  font-size: 17px;
  transition: background 0.2s, border-color 0.2s;
}

.back:hover {
  background: #1c1c1c;
  border-color: #333;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.tab {
  height: 34px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #a1a1aa;
}

.tab.active {
  background: #222226;
  color: #fafafa;
}

.grow {
  flex: 1;
}

.btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: #0974f1;
  color: #fff;
}

.btn.primary:hover {
  background: #0a82ff;
}

.btn.ghost {
  background: #1a1a1a;
  border-color: #272727;
  color: #d4d4d6;
}

.btn.ghost:hover {
  background: #202020;
  border-color: #343434;
}

.btn.sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12.5px;
}

.workspace {
  max-width: 1300px;
  margin: 22px auto 64px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 22px;
  align-items: start;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.card-section {
  background: #111;
  border: 1px solid #1a1a1a;
  border-top-color: #242424;
  border-radius: 20px;
  padding: 20px 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.section-note {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #71717a;
}

/* assets */

.asset {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.asset:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.asset:first-of-type {
  padding-top: 2px;
}

.asset-thumb {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 13px;
  border: 1px solid #2a2a2a;
  background: #1c1c1c;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #71717a;
  font-size: 20px;
  overflow: hidden;
}

.asset-thumb.contain {
  object-fit: contain;
  padding: 4px;
}

.asset-meta {
  flex: 1;
  min-width: 0;
}

.asset-meta strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.asset-meta small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid #272727;
  border-radius: 9px;
  background: transparent;
  color: #8a8a90;
  font-size: 12px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.icon-btn:hover {
  color: #fff;
  background: #1c1c1c;
}

.icon-btn.danger:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

.icon-btn[disabled] {
  opacity: 0.3;
  pointer-events: none;
}

/* form controls */

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field .label,
.field label {
  color: #d4d4d6;
  font-size: 13.5px;
  font-weight: 500;
}

.field .label {
  display: block;
  margin-bottom: 8px;
}

.field.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.input,
.select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #242424;
  border-radius: 15px;
  background: #1c1c1c;
  color: #fafafa;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.input::placeholder {
  color: #5b5b62;
}

.input:focus,
.select:focus {
  border-color: #3d3d3d;
  background: #202020;
}

.textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}

.counter {
  display: block;
  margin-top: 6px;
  text-align: right;
  font-size: 11.5px;
  color: #71717a;
}

.select {
  width: min(200px, 55%);
  height: 42px;
  padding: 0 36px 0 13px;
  background-color: #101010;
  border-color: #1c1c1c;
  font-size: 13.5px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23a1a1aa'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  text-overflow: ellipsis;
}

.seg {
  display: inline-flex;
  gap: 3px;
  width: fit-content;
  padding: 3px;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  background: #171717;
}

.seg button {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #a1a1aa;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.seg button:hover {
  color: #e4e4e7;
}

.seg button.active {
  background: #2a2a2e;
  color: #fff;
}

.seg.small button {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 8px;
}

.layout-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.layout-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  background: #171717;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.layout-option img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  border-radius: 8px;
  background: #0c0c0c;
}

.layout-option:hover {
  color: #e4e4e7;
}

.layout-option.active {
  border-color: #6366f1;
  color: #fff;
  background: #1c1c22;
}

/* switches */

.switches {
  margin-top: 4px;
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.switch-row:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.switch-row span strong {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: #d4d4d6;
}

.switch-row span small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #71717a;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 20px;
  border-radius: 999px;
  background: #2a2a2e;
  transition: background 0.2s, box-shadow 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8a8a90;
  transition: transform 0.2s, background 0.2s;
}

.switch-row input:checked + .switch {
  background: #0974f1;
  box-shadow: 0 0 12px rgba(9, 116, 241, 0.55);
}

.switch-row input:checked + .switch::after {
  transform: translateX(20px);
  background: #fff;
}

.switch-row input:focus-visible + .switch {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

/* links */

.link-list {
  margin-bottom: 10px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  margin-bottom: 8px;
  background: #0d0d0d;
  border: 1px solid #1d1d1d;
  border-radius: 15px;
}

.link-thumb {
  width: 64px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(145deg, #1d2838, #0d1420 55%, #22324a);
  color: #8aa0b8;
  font-size: 16px;
}

.link-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-meta {
  flex: 1;
  min-width: 0;
}

.link-meta strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-meta small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin-bottom: 8px;
  background: #0c0c0c;
  border: 1px solid #222;
  border-radius: 15px;
}

.link-editor .field {
  margin-bottom: 0;
}

.link-editor .field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.link-editor .input {
  height: 38px;
  border-radius: 11px;
  font-size: 13px;
}

.editor-asset {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-asset small {
  flex: 1;
  font-size: 11.5px;
  color: #71717a;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.add-link {
  width: 100%;
  height: 44px;
  border: 1px dashed #2d2d2d;
  border-radius: 15px;
  background: transparent;
  color: #a1a1aa;
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.add-link:hover {
  border-color: #4a4a4a;
  background: #141414;
  color: #fff;
}

/* colors */

.color-list {
  display: flex;
  flex-direction: column;
}

.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.color-row:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.color-row > span:first-child {
  font-size: 13.5px;
  color: #d4d4d6;
}

.color-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="color"] {
  width: 44px;
  height: 30px;
  padding: 3px;
  border: 1px solid #2a2a2a;
  border-radius: 9px;
  background: #1c1c1c;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}

input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 6px;
}

.mini-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid #272727;
  border-radius: 8px;
  background: #151515;
  color: #a1a1aa;
  font-size: 11.5px;
  font-weight: 600;
}

.mini-btn:hover {
  color: #fff;
  border-color: #3a3a3a;
}

/* ranges */

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.range-head output {
  font-size: 12px;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 8px;
  margin: 8px 0 2px;
  border-radius: 999px;
  background: #555;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #a3a3a3;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #fff;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #a3a3a3;
  cursor: pointer;
}

.range-presets {
  display: flex;
  gap: 6px;
  margin-top: 3px;
}

.range-presets button {
  flex: 1;
  min-height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9ca3af;
  font-size: 11.5px;
  font-weight: 600;
  transition: background 0.16s, color 0.16s;
}

.range-presets button:hover {
  background: #1d1d1f;
  color: #e5e7eb;
}

.range-presets button.active {
  background: #1d1d1f;
  color: #fff;
}

/* preview */

.preview {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #111;
  border: 1px solid #1a1a1a;
  border-top-color: #242424;
  border-radius: 20px;
}

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #a1a1aa;
}

.frame {
  height: calc(100vh - 220px);
  min-height: 460px;
  max-height: 820px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #1f1f1f;
  border-radius: 16px;
  background: #05070d;
}

.frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #05070d;
  transition: width 0.25s ease;
}

.frame.mobile iframe {
  width: 390px;
  max-width: 100%;
}

.preview-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #71717a;
}

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 40;
  transform: translate(-50%, 12px);
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(10, 14, 22, 0.9);
  color: #fafafa;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview {
    order: -1;
    position: relative;
    top: 0;
  }

  .frame {
    height: 420px;
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .topbar {
    gap: 8px;
    padding: 0 14px;
  }

  .tab,
  .open-page {
    display: none;
  }

  .workspace {
    margin-bottom: 40px;
    padding: 0 14px;
  }

  .card-section {
    padding: 16px;
  }

  .asset {
    flex-wrap: wrap;
  }

  .field.row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .select {
    width: 100%;
  }

  .frame {
    height: 360px;
  }

  .preview {
    padding: 12px;
  }
}

.empty-links {
  margin: 4px 0 12px;
  font-size: 12.5px;
  color: #71717a;
}

.asset-thumb.has-audio {
  color: #fff;
  background: linear-gradient(145deg, #1c2b40, #0e1622);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #2f6b9e;
  box-shadow: 0 0 0 3px rgba(9, 116, 241, 0.16);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
}

/* ---- decoration page ---- */

.tabs {
  display: flex;
  gap: 4px;
}

.deco-workspace {
  max-width: 1300px;
  margin: 22px auto 64px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.deco-side {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deco-side .card-section {
  padding: 20px 18px 18px;
}

.deco-preview {
  position: relative;
  width: 192px;
  height: 192px;
  margin: 4px auto 0;
}

.deco-preview-avatar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
  background: #222;
}

.deco-frame-img {
  position: absolute;
  inset: 0;
  width: 192px;
  height: 192px;
  pointer-events: none;
  filter: hue-rotate(var(--deco-hue, 0deg));
  transition: opacity 0.25s ease;
}

.deco-preview.is-off .deco-frame-img {
  opacity: 0;
}

.deco-selected {
  margin: 10px 0 18px;
  min-height: 20px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #ededed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input.hue-range[type="range"] {
  background: linear-gradient(to right, #a3a3a3 0 var(--fill, 87%), #555 var(--fill, 87%) 100%);
}

.deco-toggle {
  width: 100%;
  height: 44px;
  margin-top: 16px;
  border: 1px solid #2a2a2e;
  border-radius: 15px;
  background: #1a1a1a;
  color: #d4d4d6;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.deco-toggle:hover {
  background: #202020;
}

.deco-toggle.is-on {
  background: rgba(7, 149, 66, 0.16);
  border-color: rgba(7, 149, 66, 0.3);
  color: #0ad406;
}

.deco-toggle.is-on:hover {
  background: rgba(7, 149, 66, 0.24);
}

.deco-side .preview-hint {
  margin-top: 12px;
}

.inline-link {
  color: #7fb4ff;
}

.inline-link:hover {
  text-decoration: underline;
}

.library {
  padding: 0;
  overflow: hidden;
}

.library-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #1a1a1a;
  scroll-margin-top: 80px;
}

.library-head .section-head {
  margin-bottom: 0;
}

.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: #71717a;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-input {
  padding-left: 38px;
  padding-right: 38px;
}

.search-input::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.45;
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 8px;
  padding: 16px 20px 8px;
}

.frame-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: #d4d4d6;
  text-align: left;
  transition: background 0.18s, box-shadow 0.18s;
}

.frame-card:hover {
  background: #171717;
}

.frame-card.active {
  background: #1a1a1a;
  box-shadow: inset 0 0 0 1px rgba(9, 116, 241, 0.65);
}

.frame-card-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: #141414;
}

.frame-card-avatar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84.75%;
  height: 84.75%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
}

.frame-card-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.frame-card-frame.is-loaded {
  opacity: 1;
}

.frame-card-name {
  display: block;
  padding: 9px 4px 5px;
  font-size: 13px;
  line-height: 1.25;
  color: #d4d4d6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-card.active .frame-card-name {
  color: #fff;
}

.grid-empty {
  margin: 0;
  padding: 26px 20px 10px;
  text-align: center;
  font-size: 12.5px;
  color: #71717a;
}

.library-note {
  margin: 0;
  padding: 4px 20px 14px;
  font-size: 11.5px;
  color: #71717a;
}

.library-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 18px;
  border-top: 1px solid #1a1a1a;
}

.library-foot span {
  font-size: 12px;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
}

.library-foot .btn[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

@media (max-width: 1080px) {
  .deco-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .deco-side {
    position: relative;
    top: 0;
  }
}

@media (max-width: 700px) {
  .deco-workspace {
    margin-bottom: 40px;
    padding: 0 14px;
  }

  .library-head {
    padding: 14px 14px 12px;
  }

  .frame-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 4px;
    padding: 12px 12px 4px;
  }

  .frame-card {
    padding: 6px;
  }

  .frame-card-name {
    font-size: 12px;
  }

  .library-note {
    padding: 2px 14px 12px;
  }

  .library-foot {
    padding: 12px 14px 16px;
  }
}

/* ---- font picker ---- */

.zyo-select {
  position: relative;
  width: min(220px, 55%);
}

.zyo-select-btn {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px 0 14px;
  border: 1px solid #1c1c1c;
  border-radius: 15px;
  background: #101010;
  color: #fafafa;
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}

.zyo-select-btn:hover {
  border-color: #2a2a2a;
  background: #151515;
}

.zyo-select-btn svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: #a1a1aa;
}

.zyo-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: 250px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #262626;
  border-radius: 15px;
  background: #141414;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
}

.zyo-select-menu[hidden] {
  display: none;
}

.font-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  text-align: left;
  transition: background 0.15s;
}

.font-option:hover {
  background: #1f1f22;
}

.font-option.active {
  background: #26262b;
}

.font-option small {
  flex: none;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #71717a;
}

/* ---- choose buttons ---- */

.choose-btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #272727;
  border-radius: 15px;
  background: #171717;
  color: #fafafa;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}

.choose-btn:hover {
  background: #1f1f1f;
  border-color: #343434;
}

.choose-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* ---- effect modals ---- */

.zyo-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.zyo-modal[hidden] {
  display: none;
}

.zyo-modal-panel {
  width: min(880px, 100%);
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid #242424;
  border-top-color: #2f2f2f;
  border-radius: 20px;
  background: #101010;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.zyo-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.fx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 2px;
  min-height: 0;
}

.fx-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: #151515;
  color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fx-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.fx-card.active {
  border-color: rgba(54, 140, 190, 0.72);
  box-shadow: 0 0 0 1px rgba(54, 140, 190, 0.32) inset, 0 0 0 1px rgba(54, 140, 190, 0.16);
}

.fx-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.fx-demo {
  position: relative;
  z-index: 2;
  max-width: 92%;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6em;
  color: #fff;
  text-align: center;
  white-space: nowrap;
}

.fx-card-label {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 7px;
  z-index: 3;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.1em;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.fx-card.bg-card .fx-stage {
  background:
    radial-gradient(circle at 24% 26%, rgba(84, 130, 220, 0.4), transparent 44%),
    radial-gradient(circle at 76% 72%, rgba(186, 92, 168, 0.3), transparent 48%),
    linear-gradient(160deg, #1d2838, #0d1420 55%, #22324a);
}

.fx-card.bg-card .fx-stage.fx-shader-shot {
  background-size: cover;
  background-position: center;
  background-color: #05060a;
}

.fx-card.bg-card .fx-stage .bgfx {
  position: absolute;
  inset: 0;
}

.fx-card.bg-card .bgfx-wave {
  width: 220%;
  height: 22px;
  bottom: -4px;
  opacity: 0.42;
}

.fx-card.bg-card .bgfx-wave:nth-child(2) {
  height: 30px;
  bottom: -12px;
  opacity: 0.34;
}

.fx-card.bg-card .bgfx-wave:nth-child(3) {
  height: 38px;
  bottom: -20px;
  opacity: 0.26;
}

.fx-card.bg-card .bgfx-blur {
  background: rgba(0, 0, 0, 0.2);
}

.zyo-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .zyo-select {
    width: 100%;
  }

  .zyo-modal {
    padding: 10px;
  }

  .zyo-modal-panel {
    padding: 16px;
  }

  .fx-grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }

  .fx-demo {
    font-size: 13px;
  }
}

/* ---- asset / audio / banner modals ---- */

.zyo-modal-panel.narrow {
  width: min(540px, 100%);
}

.modal-hint {
  margin: -6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #78787f;
}

.seg.full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.click-presets {
  display: grid;
  gap: 8px;
}

.click-presets[hidden],
.click-custom[hidden] {
  display: none;
}

.click-preset {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: #141414;
  transition: border-color 0.2s, background 0.2s;
}

.click-preset.active {
  border-color: rgba(54, 140, 190, 0.72);
  background: #151b20;
}

.click-preset .click-choice {
  flex: 1;
  text-align: left;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e8e8ea;
  font-size: 13px;
  font-weight: 500;
}

.click-preset .click-choice.active {
  color: #fff;
}

.click-preview {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #242428;
  color: #d4d4d8;
}

.click-preview:hover {
  background: #2f2f35;
  color: #fff;
}

.click-preview svg {
  width: 15px;
  height: 15px;
}

.click-custom {
  border-bottom: 0;
  padding: 10px 0 0;
}

.audio-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.audio-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: #141414;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.audio-item-row.active {
  border-color: rgba(54, 140, 190, 0.72);
  background: #151b20;
}

.audio-item-row .audio-index {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #222;
  color: #9a9aa2;
  font-size: 11px;
  font-weight: 700;
}

.audio-item-row.active .audio-index {
  background: #0f3b52;
  color: #fff;
}

.audio-item-row .audio-meta {
  flex: 1;
  min-width: 0;
}

.audio-item-row strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-item-row small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #71717a;
}

.audio-item-row .audio-active-tag {
  flex: none;
  padding: 3px 7px;
  border-radius: 6px;
  background: #0f3b52;
  color: #7fd0ff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.audio-empty {
  padding: 16px 0;
  font-size: 12.5px;
  color: #71717a;
}

.audio-options {
  padding: 2px 0;
}

.md-help {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 9px;
  font-size: 13px;
  color: #c4c4ca;
}

.md-help code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #1f1f23;
  color: #8fd0ff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}

.md-help a {
  color: #7fd0ff;
}

.asset .mini-btn {
  flex: none;
}

.link-item.is-hidden {
  opacity: 0.45;
}

.click-thumb svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.click-thumb.off {
  opacity: 0.38;
}

.zyo-modal-panel .field .modal-hint {
  margin: 6px 0 0;
}

/* badges */

.section-desc {
  margin: -4px 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #71717a;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 8px;
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 78px;
  padding: 10px 8px;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  background: #171717;
  color: #a1a1aa;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.badge-card:hover {
  border-color: #2f2f2f;
  background: #1c1c1c;
}

.badge-card.active {
  border-color: rgba(9, 116, 241, 0.65);
  background: rgba(9, 116, 241, 0.12);
  color: #e4e4e7;
}

.badge-card .badge-preview {
  display: flex;
  align-items: center;
  line-height: 0;
}

.badge-card-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* custom code workspace */

.code-workspace {
  overflow: hidden;
  border: 1px solid #303030;
  border-radius: 12px;
  background: #1e1e1e;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.code-tabs {
  display: flex;
  align-items: flex-end;
  height: 38px;
  padding-left: 8px;
  border-bottom: 1px solid #2b2b2b;
  background: #181818;
}

.code-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 170px;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid #2b2b2b;
  background: #181818;
  color: #9d9d9d;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.code-tab:hover {
  color: #c9c9c9;
}

.code-tab.active {
  background: #1e1e1e;
  color: #e7e7e7;
}

.code-tab.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #007acc;
}

.code-tab svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.code-tab svg.css {
  color: #42a5f5;
}

.code-tab svg.html {
  color: #e86a3a;
}

.code-panes {
  position: relative;
}

.code-editor {
  display: block;
  width: 100%;
  height: 320px;
  padding: 14px 16px;
  border: 0;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  resize: none;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  caret-color: #aeafad;
}

.code-editor::placeholder {
  color: #5a5a5a;
}

.code-editor[hidden] {
  display: none;
}

.code-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 24px;
  padding: 0 10px;
  border-top: 1px solid #2b2b2b;
  background: #181818;
  color: #b9b9b9;
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-size: 10.5px;
  line-height: 24px;
  user-select: none;
}

.code-status-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

@media (max-width: 768px) {
  .code-tab {
    min-width: 140px;
  }
}

.badge-card .badge-preview svg {
  font-size: 22px;
}

.badge-card {
  position: relative;
}

.badge-card-index {
  position: absolute;
  top: 7px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #0974f1;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

/* ---------- embed mode: hosted inside the dashboard's Customize pane ---------- */
.embed .back,
.embed .brand,
.embed .tabs {
  display: none;
}

.embed .workspace {
  margin-top: 18px;
}
