* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
:root {
  color-scheme: dark;
  --accent: #d4b86f;
  --surface: #242321;
  --line: #d4b86f29;
  --text: #f2f0ea;
  --muted: #b9b1a1;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
body {
  margin: 0;
  background: #171614;
  color: var(--text);
  font:
    14px/1.45 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
}
.wrap {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.head {
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 205px;
}
.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d4b86f52;
  border-radius: 9px;
  background: #d4b86f1f;
  color: var(--accent);
  font-size: 23px;
}
.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}
.brand p {
  margin: 3px 0 0;
  font-size: 10px;
  color: #999;
}
.head button,
.dialog-actions button {
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #d4b86f6b;
  border-radius: 7px;
  background: #191817;
  color: #e5cf8a;
  font-size: 12px;
  font-weight: 600;
}
.head button:hover,
.dialog-actions button:hover {
  background: #d4b86f20;
  border-color: var(--accent);
}
.top-link {
  position: relative;
  flex: 1;
  min-width: 70px;
}
.top-link input {
  width: 100%;
  height: 42px;
  padding: 9px 10px;
  border: 1px solid #4a4436;
  border-radius: 7px;
  background: #191817;
  color: #e5dfd2;
  font:
    12px/22px Consolas,
    monospace;
  filter: blur(4px);
  cursor: pointer;
}
.top-link:hover input,
.top-link:focus-within input {
  filter: none;
}
.link-caption {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 3px #000;
}
.top-link:hover .link-caption,
.top-link:focus-within .link-caption {
  visibility: hidden;
}
#copy-status {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5;
  font-size: 12px;
  color: #e5cf8a;
  background: #242321;
  border-radius: 5px;
  box-shadow: 0 5px 15px #0006;
}
#copy-status:not(:empty) {
  padding: 8px 12px;
}
.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 60%);
  overflow: hidden;
}
.panel {
  min-width: 0;
  min-height: 0;
  padding: 20px 24px;
  background: var(--surface);
}
h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}
.settings-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-content: start;
  align-items: center;
  gap: 8px 18px;
  border-right: 1px solid var(--line);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #958249 transparent;
}
.settings-panel > h2,
.group-heading,
.wide,
.layout-grid {
  grid-column: 1/-1;
}
.group-heading {
  margin: 19px 0 8px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: #d0b66f;
  font-size: 14px;
  font-weight: 650;
}
.settings-panel > label,
.field-label {
  margin: 9px 0;
  font-size: 13px;
  font-weight: 650;
}
.settings-panel select {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 8px 10px;
  border: 1px solid #4a4436;
  border-radius: 7px;
  background: #191817;
  color: var(--text);
  font-size: 12px;
}
.layout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.layout-grid button {
  min-height: 61px;
  padding: 7px 4px;
  border: 1px solid #4a4436;
  border-radius: 7px;
  background: #191817;
  color: #c2bcae;
  font-size: 11px;
}
.layout-grid b {
  display: block;
  height: 26px;
  line-height: 23px;
  font-size: 18px;
  font-weight: 400;
}
.layout-grid button.selected {
  border-color: var(--accent);
  background: #d4b86f24;
  color: #fff;
}
.range-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 37px;
}
.range-control input {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.range-control output {
  min-width: 55px;
  color: #d7c27f;
  font:
    11px Consolas,
    monospace;
  text-align: right;
}
.toggle-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  cursor: pointer;
}
.toggle-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.switch {
  position: relative;
  width: 39px;
  height: 23px;
  flex: none;
  border-radius: 15px;
  background: #393c49;
}
.switch:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #c7c3d0;
  transition: 0.18s;
}
.toggle-control input:checked + .switch {
  background: #d4b86fa6;
}
.toggle-control input:checked + .switch:after {
  left: 19px;
  background: white;
}
.toggle-control input:focus-visible + .switch {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.toggle-control > span:last-child {
  font-size: 12px;
  font-weight: 400;
}
.hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: #25231f;
  background-image:
    linear-gradient(45deg, #302e29 25%, transparent 25%),
    linear-gradient(-45deg, #302e29 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #302e29 75%),
    linear-gradient(-45deg, transparent 75%, #302e29 75%);
  background-size: 28px 28px;
  background-position:
    0 0,
    0 14px,
    14px -14px,
    -14px 0;
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.preview-header h2 {
  color: #d0b66f;
  font-size: 13px;
}
#dimensions {
  font-size: 10px;
  color: #b9b1a1;
  display: block;
  margin-top: 4px;
}
.segmented {
  display: flex;
  gap: 5px;
  padding: 3px;
  border: 1px solid #ffffff12;
  border-radius: 9px;
  background: #191817;
}
.segmented button {
  padding: 7px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c2bcae;
  font-size: 11px;
  font-weight: 600;
}
.segmented button.selected {
  background: #d4b86f38;
  color: #fff;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage iframe {
  position: absolute;
  border: 0;
  transform-origin: center;
  z-index: 1;
}
.stage-note {
  position: absolute;
  bottom: 0;
  font-size: 9px;
  letter-spacing: 1.3px;
  color: #a69c88;
}
#empty {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 32px;
  width: min(502px, calc(100% - 32px));
  padding: 32px;
  border: 1px solid #ffffff1c;
  border-radius: 25px;
  background: linear-gradient(175deg, #13031f, #101010);
  box-shadow: 0 24px 45px #0005;
  text-align: left;
  color: #fff;
}
#empty h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
}
#empty p {
  margin: 0 0 16px;
  color: #bbb4c2;
  font-size: 14px;
  line-height: 1.4;
}
.bridge-card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a672ff, #5b0ddc);
  color: white;
  font:
    700 46px/1 "Segoe UI",
    sans-serif;
}
.bridge-card-content {
  min-width: 0;
}
.bridge-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 8px 20px;
  border: 1px solid #ffffff2b;
  border-radius: 12px;
  background: #ffffff19;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}
.bridge-download:hover {
  background: #ffffff30;
}
.bridge-download[hidden] {
  display: none;
}
.stage.bridge-missing {
  background: #1f1f1f;
  border-radius: 12px;
}
.preview-panel.bridge-missing {
  background: #1f1f1f;
}
.preview-panel.bridge-missing .palette-panel {
  display: none;
}
.stage.bridge-missing iframe,
.stage.bridge-missing .stage-note {
  visibility: hidden;
}
@media (max-width: 1050px) {
  #empty {
    gap: 18px;
    padding: 24px;
  }
  #empty h3 {
    font-size: 18px;
  }
}
.palette-panel {
  flex: none;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #242321e6;
}
.palette-heading {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #d7c27f;
}
.palette-heading a {
  font-size: 10px;
}
.swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.swatch-color {
  height: 27px;
  border: 1px solid #ffffff20;
  border-radius: 4px;
  transition: background 1s;
}
.swatch-name {
  display: block;
  font-size: 8px;
  color: #c2bcae;
  margin-top: 5px;
}
.palette-panel .hint {
  font-size: 9px;
  margin-top: 9px;
}
.bridge-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
  flex: none;
  min-height: 18px;
}
.bridge-status i {
  width: 6px;
  height: 6px;
  background: #bb7d67;
  border-radius: 50%;
  flex: none;
}
.bridge-status i.ok {
  background: #a7bd88;
}
.bridge-status a {
  margin-left: auto;
  white-space: nowrap;
  color: #d7c27f;
}
footer {
  flex: none;
  padding: 9px 22px;
  font-size: 10px;
  color: #a69c88;
  background: #171614;
  text-align: center;
}
footer a:hover,
footer a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}
dialog {
  width: min(540px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid #d4b86f59;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 60px #000b;
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(9px);
}
dialog h2 {
  font-size: 17px;
  color: #e5cf8a;
}
dialog p {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 16px;
}
dialog label {
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}
dialog input {
  width: 100%;
  min-height: 40px;
  padding: 10px;
  border: 1px solid #4a4436;
  border-radius: 7px;
  background: #191817;
  color: var(--text);
  font:
    12px Consolas,
    monospace;
}
#load-error {
  min-height: 16px;
  color: #ffaaa0;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.dialog-actions .primary {
  background: var(--accent);
  color: #191817;
}
@media (max-width: 1050px) {
  .head {
    gap: 8px;
    padding: 0 14px;
  }
  .brand {
    min-width: 165px;
  }
  .brand h1 {
    font-size: 15px;
  }
  .brand p {
    font-size: 9px;
  }
  .head button {
    font-size: 10px;
    padding: 0 9px;
  }
  .link-caption {
    font-size: 10px;
  }
  .panel {
    padding: 18px;
  }
  .settings-panel {
    gap: 7px 12px;
  }
  .layout-grid button {
    font-size: 10px;
  }
}
@media (max-width: 720px) {
  .wrap {
    position: static;
    min-height: 100vh;
  }
  .head {
    height: auto;
    flex-wrap: wrap;
    padding: 12px;
  }
  .brand {
    flex: 1;
  }
  .top-link {
    order: 5;
    flex-basis: 100%;
  }
  .head button {
    min-height: 35px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .settings-panel {
    overflow: visible;
    border-right: 0;
  }
  .preview-panel {
    min-height: 660px;
    order: -1;
  }
  .stage {
    min-height: 360px;
  }
  footer {
    flex-wrap: wrap;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.settings-panel > label,
.field-label {
  min-width: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.stage iframe {
  color-scheme: only light;
  background: transparent !important;
}
.settings-panel > input[type="text"],
.settings-panel > input[type="number"] {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 8px 10px;
  border: 1px solid #4a4436;
  border-radius: 7px;
  background: #191817;
  color: var(--text);
  font-size: 12px;
}
.settings-panel > input[type="color"] {
  width: 100%;
  height: 37px;
  padding: 3px;
  border: 1px solid #4a4436;
  border-radius: 7px;
  background: #191817;
}
.settings-panel input:disabled {
  opacity: 0.4;
}
.settings-panel > .hint.wide {
  grid-column: 1/-1;
}
.top-link {
  cursor: pointer;
}
.top-link.copied .link-caption {
  visibility: visible;
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 5px 12px;
  border-radius: 6px;
  background: #16864a;
  color: #fff;
  font-weight: 700;
  text-shadow: none;
}
#copy-status {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  padding: 0 !important;
}
.language-control {
  position: absolute;
  top: 50%;
  right: 20px;
  z-index: 20;
  transform: translateY(-50%);
}
.language-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(212, 184, 111, 0.42);
  border-radius: 50%;
  background: #191817;
  cursor: pointer;
}
.language-toggle:hover,
.language-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, #191817);
}
.language-icon {
  display: block;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
}
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 140px;
  padding: 5px;
  border: 1px solid rgba(212, 184, 111, 0.3);
  border-radius: 10px;
  background: #242321;
  box-shadow: 0 10px 28px #0009;
}
.language-menu[hidden] {
  display: none;
}
.language-menu button {
  padding: 9px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #eee;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.language-menu button:hover {
  background: color-mix(in srgb, var(--accent) 15%, #242321);
}
.head {
  position: relative;
  padding-right: 80px;
}
.head .language-toggle {
  padding: 0;
  min-height: 42px;
}
@media (max-width: 720px) {
  .head {
    padding-right: 70px;
  }
  .language-control {
    top: 32px;
    right: 14px;
  }
}
.head .language-toggle {
  border-radius: 50%;
  width: 42px;
  height: 42px;
}
