.stv1-toolbar--presets {
  flex-wrap: wrap;
}

.skills-head-actions { display:flex;align-items:center;gap:14px;flex:0 0 auto; }
.stp-library-entry {
  min-height:36px;padding:7px 14px;border:1px solid color-mix(in srgb,var(--animated-theme-accent,var(--gold)) 65%,transparent);
  border-radius:var(--r-xs);background:color-mix(in srgb,var(--animated-theme-accent,var(--gold)) 12%,transparent);
  color:var(--animated-theme-light,var(--gold-b));font:700 12px var(--font-ui);white-space:nowrap;cursor:pointer;
}
.stp-library-entry:hover { background:color-mix(in srgb,var(--animated-theme-accent,var(--gold)) 23%,transparent); }
.stp-library-entry:focus-visible { outline:2px solid var(--animated-theme-light,var(--gold-b));outline-offset:3px; }
@media(max-width:959px) {
  .skills-head-actions { gap:9px; }
  .stp-library-entry { min-height:34px;padding:6px 11px;font-size:11px; }
}

.stp-toolbar-actions,
.stp-slot-actions,
.stp-community-actions,
.stp-save-actions,
.stp-preview-bar > div:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stp-toolbar-actions button,
.stp-slot-actions button,
.stp-community-actions > button,
.stp-save-actions button,
.stp-preview-bar button,
.stp-own-toolbar button,
.stp-community-toolbar button,
.stp-close-danger {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(204, 146, 70, 0.28);
  border-radius: var(--r-xs);
  background:
    linear-gradient(180deg, rgba(255, 232, 184, 0.075), rgba(0, 0, 0, 0.16)),
    rgba(17, 15, 13, 0.78);
  color: var(--text-2);
  font: 800 9px var(--font-ui);
  cursor: pointer;
}

.stp-toolbar-actions button:hover,
.stp-slot-actions button:hover:not(:disabled),
.stp-community-actions > button:hover:not(:disabled),
.stp-save-actions button:hover,
.stp-preview-bar button:hover,
.stp-own-toolbar button:hover,
.stp-community-toolbar button:hover,
.stp-close-danger:hover {
  border-color: rgba(232, 181, 100, 0.58);
  color: var(--gold-b);
}

.stp-toolbar-actions {
  flex: 0 0 auto;
}

.stp-toolbar-actions button:last-child {
  border-color: rgba(232, 181, 100, 0.5);
  color: var(--gold-b);
}

.stp-preview-bar {
  flex: 1 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 7px;
  border-top: 1px solid rgba(216, 72, 65, 0.28);
}

.stp-preview-bar[hidden] {
  display: none;
}

.stp-preview-bar > div:first-child {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stp-preview-bar span {
  color: #ff8d82;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stp-preview-bar b {
  overflow: hidden;
  color: var(--text-1);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stp-preview-bar small {
  color: var(--text-3);
  font-size: 9px;
}

.stp-preview-bar [data-stp-apply-preview] {
  border-color: rgba(207, 75, 66, 0.62);
  color: #ff9a90;
}

.stv1-node-wrap.preset-preview .stv1-node {
  border-color: #e34f47;
  box-shadow:
    inset 0 0 0 1px rgba(227, 79, 71, 0.34),
    0 0 17px rgba(227, 79, 71, 0.5);
  animation: stp-preview-pulse 1.2s ease-in-out infinite;
}

.stv1-node-wrap.preset-preview:after {
  content: attr(data-preset-rank);
  position: absolute;
  left: calc(50% - (var(--stv1-node-size) / 2) - 7px);
  top: -7px;
  z-index: 8;
  min-width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 126, 116, 0.78);
  border-radius: 3px;
  background: rgba(34, 8, 8, 0.94);
  color: #ff9a90;
  font: 800 9px/14px "JetBrains Mono", monospace;
  text-align: center;
}

@keyframes stp-preview-pulse {
  0%,
  100% {
    filter: brightness(0.94);
  }
  50% {
    filter: brightness(1.24);
  }
}

.stp-modal {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(1, 2, 4, 0.76);
  backdrop-filter: blur(6px);
}

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

.stp-modal:not([hidden]) ~ .game-confirm-dlg {
  z-index: 4300;
}

body.stp-modal-open {
  overflow: hidden;
}

.stp-dialog {
  width: min(1040px, calc(100vw - 56px));
  height: min(760px, calc(100vh - 56px));
  min-height: 470px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(220, 174, 91, 0.42);
  border-radius: 7px;
  background:
    linear-gradient(155deg, rgba(43, 31, 19, 0.42), transparent 42%),
    rgba(7, 8, 11, 0.97);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 239, 197, 0.08);
  color: var(--text-1);
}

.stp-dialog-head {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px 14px 24px;
  border-bottom: 1px solid rgba(220, 174, 91, 0.22);
  background: linear-gradient(90deg, rgba(220, 174, 91, 0.07), transparent 55%);
}

.stp-dialog-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-d);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stp-dialog-head h2 {
  margin: 0;
  color: var(--gold-b);
  font-family: "Instrument Serif", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
}

.stp-dialog-head button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(230, 196, 122, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  font-size: 25px;
  cursor: pointer;
}

.stp-dialog-head button:hover {
  border-color: rgba(230, 196, 122, 0.52);
  color: var(--gold-b);
}

.stp-dialog-body {
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.stp-dialog-body::-webkit-scrollbar,
.stp-community-list::-webkit-scrollbar,
.stp-effect-list::-webkit-scrollbar {
  width: 6px;
}

.stp-dialog-body::-webkit-scrollbar-thumb,
.stp-community-list::-webkit-scrollbar-thumb,
.stp-effect-list::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(204, 146, 70, 0.34);
}

.stp-dialog-foot {
  display: flex;
  justify-content: flex-end;
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.018);
}

.stp-close-danger {
  border-color: rgba(198, 70, 62, 0.58);
  color: #ff998f;
}

.stp-state {
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.stp-state.error {
  color: #ff998d;
}

.stp-own-toolbar,
.stp-community-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.018);
}

.stp-own-toolbar p {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
}

.stp-own-toolbar p b {
  color: var(--gold-b);
}

.stp-own-toolbar > div {
  display: flex;
  gap: 7px;
}

.stp-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 20px;
}

.stp-slot {
  position: relative;
  min-width: 0;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(230, 196, 122, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.024);
}

.stp-slot.filled {
  justify-content: space-between;
  border-color: rgba(230, 196, 122, 0.32);
}

.stp-slot.locked {
  align-items: center;
  text-align: center;
  opacity: 0.48;
  background: rgba(0, 0, 0, 0.24);
}

.stp-slot-number {
  position: absolute;
  right: 10px;
  top: 9px;
  color: var(--text-3);
  font: 800 9px "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.stp-slot > b {
  color: var(--text-1);
  font-size: 13px;
}

.stp-slot > p {
  margin: 0;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.45;
}

.stp-publication-hint {
  color: #e3bd72 !important;
}

.stp-slot.empty > button {
  width: max-content;
}

.stp-lock {
  position: relative;
  width: 25px;
  height: 20px;
  margin-top: 4px;
  border: 2px solid rgba(230, 196, 122, 0.58);
  border-radius: 3px;
}

.stp-lock:before {
  content: "";
  position: absolute;
  left: 5px;
  top: -13px;
  width: 11px;
  height: 12px;
  border: 2px solid rgba(230, 196, 122, 0.58);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.stp-preset-meta {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-right: 54px;
}

.stp-class-icon,
.stp-class-fallback {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(230, 196, 122, 0.34);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.36);
  color: var(--gold-b);
  font: 500 24px "Instrument Serif", serif;
}

.stp-class-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.stp-preset-meta div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.stp-preset-meta strong {
  overflow: hidden;
  color: var(--text-1);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stp-preset-meta span,
.stp-preset-meta small {
  color: var(--text-3);
  font-size: 9.5px;
}

.stp-slot-actions {
  justify-content: flex-end;
}

.stp-icon-button {
  width: 29px;
  min-width: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.stp-icon-button img {
  width: 18px;
  height: 18px;
  display: block;
}

.stp-icon-button.active {
  border-color: rgba(81, 179, 105, 0.54);
  background: rgba(44, 112, 63, 0.18);
}

.stp-icon-button[aria-busy="true"] {
  opacity: 0.55;
  cursor: wait;
}

.stp-publication-status {
  min-height: 18px;
  padding: 0 16px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.45;
}

.stp-publication-status.success {
  color: #9ce8ae;
}

.stp-publication-status.error {
  color: #ff998d;
}

.stp-save-form {
  width: min(580px, calc(100% - 32px));
  display: grid;
  gap: 14px;
  padding: 26px;
  margin: 22px auto;
  border: 1px solid rgba(230, 196, 122, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.024);
}

.stp-save-form label,
.stp-community-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--text-3);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stp-save-form input,
.stp-save-form select,
.stp-community-toolbar input,
.stp-community-toolbar select {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(230, 196, 122, 0.2);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-1);
  padding: 0 10px;
  font: 500 12px var(--font-ui);
  letter-spacing: 0;
}

.stp-save-form small {
  color: var(--text-3);
  font-size: 9px;
  text-align: right;
}

.stp-save-form > p {
  margin: 0;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.45;
}

.stp-save-actions {
  justify-content: flex-end;
}

.stp-save-primary,
.stp-save-submit {
  border-color: rgba(232, 181, 100, 0.58) !important;
  background:
    linear-gradient(180deg, rgba(232, 181, 100, 0.2), rgba(85, 54, 20, 0.24)),
    rgba(20, 17, 13, 0.92) !important;
  color: var(--gold-b) !important;
  box-shadow:
    inset 0 1px rgba(255, 238, 196, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.2);
}

.stp-save-primary:hover:not(:disabled),
.stp-save-submit:hover:not(:disabled) {
  border-color: rgba(255, 207, 119, 0.82) !important;
  background:
    linear-gradient(180deg, rgba(245, 196, 105, 0.27), rgba(104, 65, 23, 0.3)),
    rgba(24, 20, 15, 0.96) !important;
}

.stp-save-submit {
  min-width: 120px;
  min-height: 34px !important;
  padding-inline: 18px !important;
}

.stp-save-primary:disabled,
.stp-save-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.stp-save-status {
  min-height: 15px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.45;
}

.stp-save-status.error {
  color: #ff998d;
}

.stp-community-toolbar {
  justify-content: flex-start;
}

.stp-community-toolbar label:first-child {
  flex: 1 1 280px;
}

.stp-community-toolbar label:nth-child(2) {
  flex: 0 1 190px;
}

.stp-community-toolbar > [data-stp-own] {
  margin-left: auto;
}

.stp-sort {
  display: flex;
  gap: 5px;
}

.stp-sort button.active {
  border-color: rgba(232, 181, 100, 0.58);
  color: var(--gold-b);
  background: rgba(232, 181, 100, 0.1);
}

.stp-community-list {
  height: calc(100% - 64px);
  min-height: 0;
  display: grid;
  align-content: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 20px;
  overflow: auto;
}

.stp-community-list > .stp-state {
  grid-column: 1 / -1;
}

.stp-community-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(230, 196, 122, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.024);
}

.stp-effects {
  min-width: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.stp-effects summary {
  padding: 8px 2px;
  color: var(--gold-d);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.stp-effect-list {
  max-height: 220px;
  display: grid;
  gap: 6px;
  padding: 0 2px 9px;
  margin: 0;
  overflow: auto;
  list-style: none;
}

.stp-effect-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 7px 8px;
  border-left: 2px solid rgba(230, 196, 122, 0.24);
  background: rgba(255, 255, 255, 0.018);
}

.stp-effect-list li span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stp-effect-list li b {
  overflow: hidden;
  color: var(--text-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stp-effect-list li small {
  color: var(--text-3);
  font-size: 8.5px;
}

.stp-effect-list li em {
  color: var(--gold-b);
  font: 800 9px "JetBrains Mono", monospace;
  font-style: normal;
}

.stp-effect-list li p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--text-3);
  font-size: 9px;
  line-height: 1.35;
}

.stp-empty-copy {
  margin: 0 0 9px;
  color: var(--text-3);
  font-size: 10px;
}

.stp-community-actions {
  justify-content: space-between;
}

.stp-community-actions > button:disabled {
  opacity: 0.38;
  cursor: default;
}

.stp-reactions {
  display: flex;
  gap: 5px;
}

.stp-reactions button {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid rgba(230, 196, 122, 0.18);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-3);
  cursor: pointer;
}

.stp-reactions button.active {
  border-color: rgba(230, 196, 122, 0.54);
  color: var(--gold-b);
}

.stp-reactions img {
  width: 17px;
  height: 17px;
}

.stp-reactions b {
  min-width: 14px;
  font: 800 9px "JetBrains Mono", monospace;
}

@media (prefers-reduced-motion: reduce) {
  .stv1-node-wrap.preset-preview .stv1-node {
    animation: none;
  }
}

@container (max-width: 1040px) {
  .stp-toolbar-actions button:first-child {
    display: none;
  }
}

@media (max-width: 760px) {
  .stp-modal {
    padding: 10px;
  }

  .stp-dialog {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    min-height: 0;
  }

  .stp-dialog-head {
    min-height: 68px;
    padding: 12px 14px;
  }

  .stp-dialog-head h2 {
    font-size: 27px;
  }

  .stp-slot-grid,
  .stp-community-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .stp-community-toolbar,
  .stp-own-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stp-community-toolbar label,
  .stp-community-toolbar label:first-child,
  .stp-community-toolbar label:nth-child(2) {
    flex: 0 0 auto;
  }

  .stp-community-toolbar > [data-stp-own] {
    margin-left: 0;
  }

  .stp-preview-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stp-preview-bar > div:first-child {
    display: grid;
    gap: 3px;
  }
}
.stp-toolbar-actions button,
.stp-slot-actions button,
.stp-community-actions > button,
.stp-save-actions button,
.stp-preview-bar button,
.stp-own-toolbar button,
.stp-community-toolbar button,
.stp-close-danger,
.stp-reactions button {
  min-height: 44px;
  font-size: 12px;
}

.stp-modal { background: color-mix(in srgb, var(--bg-deepest) 82%, transparent); }
.stp-dialog {
  border-color: var(--gold-d);
  background: linear-gradient(155deg, color-mix(in srgb, var(--gold) 8%, transparent), transparent 42%), var(--bg-base);
}
.stp-community-intro {
  padding: 10px 16px;
  margin: 0;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-2);
  font-size: 12px;
}
.stp-results-count {
  grid-column: 1 / -1;
  padding: 2px 2px 5px;
  color: var(--text-2);
  font-size: 12px;
}
.stp-community-toolbar { border-color: var(--glass-border); background: var(--glass-bg); }
.stp-community-toolbar label,
.stp-save-form label { font-size: 12px; }
.stp-community-toolbar input,
.stp-community-toolbar select,
.stp-save-form input,
.stp-save-form select { min-height: 44px; color: var(--text-1); }
.stp-slot,
.stp-community-card { border-color: var(--glass-border-b); background: var(--glass-bg); }
.stp-slot > p,
.stp-publication-hint,
.stp-publication-status,
.stp-preset-meta span,
.stp-preset-meta small,
.stp-effect-list li small,
.stp-effect-list li p,
.stp-save-form > p { font-size: 12px; }
.stp-publication-label {
  width: max-content;
  padding: 3px 8px;
  border: 1px solid var(--glass-border-b);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 12px;
}
.stp-publication-label.published { border-color: var(--c-success); color: var(--c-success); }
.stp-publication-label.stale { border-color: var(--gold-d); color: var(--gold-b); }
.stp-effects-more { border-top: 1px solid var(--glass-border); }
.stp-effects-more summary { padding: 8px 2px; color: var(--gold-b); font-size: 12px; cursor: pointer; }
.stp-reactions button { width: 58px; justify-content: center; }
.stp-reactions button:disabled { opacity: .55; cursor: wait; }
.stp-reactions img { width: 20px; height: 20px; }
.stp-icon-button { width: auto; min-width: 44px; min-height: 44px; gap: 5px; }
.stp-icon-button img { width: 20px; height: 20px; }
.stp-icon-button span { font-size: 12px; white-space: nowrap; }
.stp-state button[data-stp-retry] { min-height: 44px; padding: 8px 14px; }

@container (max-width: 1040px) {
  .stp-toolbar-actions button:first-child { display: inline-flex; }
}
@media (max-width: 420px) {
  .stp-slot-actions { align-items: stretch; flex-wrap: wrap; }
  .stp-slot-actions > button { flex: 1 1 100%; }
  .stp-slot-actions .stp-icon-button { justify-content: center; }
  .stp-community-actions { align-items: stretch; }
  .stp-community-actions > button { min-width: 0; flex: 1 1 auto; }
  .stp-community-toolbar .stp-sort { width: 100%; }
  .stp-community-toolbar .stp-sort button { flex: 1 1 0; }
}

@media (max-width: 760px) {
  .stp-dialog-body { overflow-y: auto; }
  .stp-community-intro {
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.35;
  }
  .stp-community-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 8px;
    padding: 8px 12px;
  }
  .stp-community-toolbar label,
  .stp-community-toolbar label:first-child,
  .stp-community-toolbar label:nth-child(2) {
    min-width: 0;
    flex: initial;
  }
  .stp-community-toolbar .stp-sort {
    min-width: 0;
    display: flex;
    gap: 4px;
  }
  .stp-community-toolbar .stp-sort button {
    min-width: 0;
    flex: 1 1 0;
    padding-inline: 6px;
  }
  .stp-community-toolbar > [data-stp-own] {
    min-width: 0;
    margin-left: 0;
  }
  .stp-community-list {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
}
