@font-face {
  font-family: "LogoHandCN";
  src: url("./assets/fonts/ZCOOLKuaiLe-Regular.ttf") format("truetype");
  font-display: block;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "LogoSkeletonCN";
  src: url("./assets/fonts/ZCOOLQingKeHuangYou-Regular.ttf") format("truetype");
  font-display: block;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "LogoDesignedCN";
  src: url("./assets/fonts/LongCang-Regular.ttf") format("truetype");
  font-display: block;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "LogoScriptEN";
  src: url("./assets/fonts/PrincessSofia-Regular.ttf") format("truetype");
  font-display: block;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "LogoHandEN";
  src: url("./assets/fonts/Kalam-Bold.ttf") format("truetype");
  font-display: block;
  font-style: normal;
  font-weight: 700;
}

:root {
  color-scheme: light;
  --ink: #17232d;
  --muted: #697680;
  --line: #dfe3e2;
  --paper: #f4f1eb;
  --panel: #fffdf9;
  --white: #ffffff;
  --blue: #0962b5;
  --blue-dark: #075792;
  --sky: #44a5db;
  --yellow: #fcc641;
  --shadow: 0 22px 55px rgba(31, 45, 55, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-width: 320px;
  overflow: hidden;
  background: #edf0f1;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  color: var(--ink);
  background: #edf0f1;
  font-family:
    Inter, "SF Pro Display", "Segoe UI", "Microsoft YaHei UI", "PingFang SC",
    sans-serif;
}

body::before {
  content: none;
}

.font-loading-popover {
  position: fixed;
  z-index: 50;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 50%;
  width: min(236px, calc(100vw - 32px));
  padding: 10px 12px 11px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 14px;
  color: #fff;
  background: rgba(23, 35, 45, 0.9);
  box-shadow: 0 14px 34px rgba(10, 27, 33, 0.25);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  pointer-events: none;
  transform: translateX(-50%);
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 220ms ease;
}

.font-loading-copy {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.font-loading-copy strong {
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}

.font-loading-sparkle {
  color: var(--yellow);
  font-size: 14px;
  line-height: 1;
  animation: font-loading-pulse 900ms ease-in-out infinite alternate;
}

.font-loading-track {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.font-loading-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--yellow));
  box-shadow: 0 0 10px rgba(252, 198, 65, 0.45);
  transition: width 180ms ease-out;
}

.font-loading-popover.is-complete .font-loading-sparkle {
  animation: none;
}

.font-loading-popover.is-error {
  border-color: rgba(255, 221, 174, 0.5);
  background: rgba(91, 50, 30, 0.94);
}

.font-loading-popover.is-error .font-loading-copy {
  white-space: normal;
}

.font-loading-popover.is-hidden {
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, -10px) scale(0.98);
}

@keyframes font-loading-pulse {
  from {
    opacity: 0.52;
    transform: rotate(-12deg) scale(0.88);
  }

  to {
    opacity: 1;
    transform: rotate(12deg) scale(1.12);
  }
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="color"],
input[type="range"],
summary {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(58, 184, 233, 0.34);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1760px, 100%);
  height: 100vh;
  min-height: 0;
  margin: 0 auto;
  padding: 22px 28px 14px;
  flex-direction: column;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  flex: 0 1 auto;
  gap: 11px;
  align-items: center;
  min-width: 0;
  padding: 7px 13px 7px 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 17px;
  color: #fff;
  background: rgba(12, 28, 31, 0.32);
  box-shadow: 0 10px 28px rgba(12, 28, 31, 0.16);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  text-decoration: none;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(243, 154, 62, 0.38);
  border-radius: 14px;
  background: rgba(255, 248, 233, 0.96);
  box-shadow: 0 8px 18px rgba(112, 56, 21, 0.22);
  transform: rotate(-5deg);
}

.brand-mark img {
  display: block;
  width: 38px;
  height: 38px;
  transform: rotate(5deg);
}

.brand strong {
  display: block;
  overflow: hidden;
  font-size: 17px;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.38);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.cache-refresh-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 13px;
  color: #fff;
  background: rgba(12, 28, 31, 0.34);
  box-shadow: 0 9px 24px rgba(12, 28, 31, 0.14);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: 160ms ease;
}

.cache-refresh-button:hover {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(12, 28, 31, 0.48);
  transform: translateY(-1px);
}

.cache-refresh-button:disabled {
  cursor: wait;
  opacity: 0.76;
}

.cache-refresh-icon {
  color: var(--yellow);
  font-size: 16px;
  line-height: 1;
}

.cache-refresh-button.loading .cache-refresh-icon,
.mobile-cache-refresh-button.loading .cache-refresh-icon {
  animation: cache-refresh-spin 780ms linear infinite;
}

@keyframes cache-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  min-height: 0;
  overflow: hidden;
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 253, 249, 0.7);
  box-shadow: 0 24px 70px rgba(17, 38, 42, 0.26);
  backdrop-filter: blur(15px) saturate(0.92);
  -webkit-backdrop-filter: blur(15px) saturate(0.92);
}

.control-panel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 30px 30px 26px;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  border-left: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.91);
}

.editor-mode-tabs {
  position: sticky;
  z-index: 7;
  top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: -18px -7px 24px;
  padding: 5px;
  border: 1px solid rgba(214, 222, 221, 0.92);
  border-radius: 15px;
  background: rgba(249, 250, 247, 0.9);
  box-shadow: 0 9px 24px rgba(31, 48, 56, 0.08);
  backdrop-filter: blur(12px) saturate(1.06);
  -webkit-backdrop-filter: blur(12px) saturate(1.06);
}

.editor-mode-tab {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 41px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #697780;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  transition: 150ms ease;
}

.editor-mode-tab > span {
  color: #8aa0aa;
  font-size: 13px;
}

.editor-mode-tab:hover {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.8);
}

.editor-mode-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #167dc0);
  box-shadow: 0 6px 14px rgba(9, 98, 181, 0.2);
}

.editor-mode-tab.active > span {
  color: var(--yellow);
}

.editor-mode-tab i {
  position: absolute;
  top: -4px;
  right: 5px;
  padding: 2px 4px;
  border-radius: 999px;
  color: #554516;
  background: var(--yellow);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.section-title,
.preview-toolbar,
.export-bar,
.toggle-row {
  display: flex;
  align-items: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h2,
p {
  margin-top: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #56636c;
  background: #fff;
  font-size: 21px;
  transition: 160ms ease;
}

.icon-button:hover {
  color: var(--blue);
  border-color: #b7d8ec;
  transform: rotate(-14deg);
}

.control-section {
  margin-top: 26px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.control-section.first-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.section-title {
  gap: 9px;
  margin-bottom: 17px;
}

.section-title h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.section-title .icon-button {
  width: 32px;
  height: 32px;
  margin-left: auto;
  border-radius: 10px;
  font-size: 18px;
}

.layer-lock-button {
  display: grid;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  border: 1px solid #d7dfdf;
  border-radius: 10px;
  color: #66747c;
  background: #fff;
  transition: 150ms ease;
}

.layer-lock-button:not(:disabled):hover {
  color: var(--blue);
  border-color: #add4e8;
}

.layer-lock-button[aria-pressed="true"]:not(:disabled) {
  color: var(--blue);
  border-color: #b9daeb;
  background: #eef8fd;
}

.layer-lock-button:disabled {
  color: #aeb7bb;
  cursor: not-allowed;
  background: #f5f6f5;
}

.layer-lock-glyph {
  position: relative;
  width: 14px;
  height: 14px;
}

.layer-lock-glyph::before {
  position: absolute;
  top: 0;
  left: 3px;
  width: 8px;
  height: 8px;
  border: 1.7px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  content: "";
  transform-origin: 1px 8px;
  transition: 150ms ease;
}

.layer-lock-glyph::after {
  position: absolute;
  right: 1px;
  bottom: 0;
  left: 1px;
  height: 8px;
  border-radius: 3px;
  background: currentColor;
  content: "";
}

.layer-lock-button[aria-pressed="false"] .layer-lock-glyph::before {
  transform: translateX(3px) rotate(25deg);
}

.step-number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: #eaf5fb;
  font-size: 9px;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field > span,
.range-field > span {
  display: flex;
  justify-content: space-between;
  color: #54616a;
  font-size: 11px;
  font-weight: 700;
}

.field output {
  color: #97a0a6;
  font-weight: 600;
}

.field input,
.field select,
.scale-select select {
  width: 100%;
  height: 43px;
  border: 1px solid #d7dcdb;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  transition: 150ms ease;
}

.field input {
  padding: 0 13px;
}

.field select,
.scale-select select {
  padding: 0 34px 0 12px;
}

.field input:hover,
.field select:hover,
.scale-select select:hover {
  border-color: #b8c5ca;
}

.field input:focus,
.field select:focus,
.scale-select select:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(58, 184, 233, 0.1);
}

.canvas-ratio-field {
  gap: 9px;
}

.canvas-ratio-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.canvas-ratio-option {
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  padding: 5px 3px 4px;
  place-items: center;
  border: 1px solid #dde2e1;
  border-radius: 10px;
  color: #758087;
  background: #f0f2f1;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  transition: 140ms ease;
}

.canvas-ratio-option:hover:not(:disabled) {
  color: #4c5d66;
  border-color: #bac9cc;
  background: #e9edec;
}

.canvas-ratio-option.active {
  color: var(--blue);
  border-color: rgba(9, 98, 181, 0.34);
  background: #eaf4fa;
  box-shadow: 0 0 0 2px rgba(9, 98, 181, 0.07);
}

.canvas-ratio-option:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.ratio-icon {
  display: grid;
  width: 30px;
  height: 25px;
  place-items: center;
}

.ratio-shape {
  display: grid;
  border: 1px solid #929b9f;
  border-radius: 2px;
  place-items: center;
  color: #747f84;
  background: #b7bdc0;
  font-style: normal;
  font-size: 8px;
}

.active .ratio-shape {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(9, 98, 181, 0.18);
}

.ratio-banner {
  width: 28px;
  height: 13px;
}

.ratio-landscape {
  width: 27px;
  height: 16px;
}

.ratio-logo {
  width: 27px;
  height: 19px;
}

.ratio-square {
  width: 22px;
  height: 22px;
}

.ratio-ultrawide {
  width: 29px;
  height: 14px;
}

.ratio-auto {
  width: 22px;
  height: 22px;
  border-style: dashed;
  background: transparent;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.example-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
  color: #8b969c;
  font-size: 10px;
}

.text-button {
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  color: #5c6c76;
  background: #f0f2f1;
  font-size: 10px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--blue);
  background: #e9f5fb;
}

.range-field {
  display: grid;
  gap: 8px;
  margin: 8px 0 17px;
}

.range-field output {
  min-width: 48px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--blue);
  background: #eaf5fb;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 6px 0;
  border-radius: 99px;
  appearance: none;
  background: linear-gradient(
    90deg,
    var(--blue) 0 var(--range-progress, 50%),
    #dfe4e4 var(--range-progress, 50%) 100%
  );
}

input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  border: 3px solid #fff;
  border-radius: 50%;
  appearance: none;
  background: var(--blue);
  box-shadow: 0 2px 7px rgba(4, 78, 129, 0.25);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 2px 7px rgba(4, 78, 129, 0.25);
}

.toggle-row {
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
}

.artwork-transform {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dfe5e5;
  border-radius: 14px;
  background: #f8faf9;
}

.precision-summary,
.transform-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.precision-summary {
  min-height: 44px;
  padding: 0 14px;
  color: #53616a;
  list-style: none;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.precision-summary::-webkit-details-marker {
  display: none;
}

.precision-summary:hover {
  color: var(--blue);
}

.precision-chevron {
  color: #869198;
  font-size: 15px;
  transition: transform 160ms ease;
}

details[open] > .precision-summary .precision-chevron {
  transform: rotate(180deg);
}

.precision-controls {
  padding: 13px 14px 2px;
  border-top: 1px solid #e3e8e7;
}

.precision-disclosure {
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid #dfe5e5;
  border-radius: 14px;
  background: #f8faf9;
}

.transform-heading {
  margin-bottom: 7px;
}

.transform-heading strong {
  color: #3f4e57;
  font-size: 11px;
}

.transform-heading button {
  padding: 5px 9px;
  border: 1px solid #d7dfdf;
  border-radius: 999px;
  color: #66747c;
  background: #fff;
  font-size: 9px;
  font-weight: 700;
}

.transform-heading button:hover {
  color: var(--blue);
  border-color: #b7d8ec;
}

.artwork-position-grid {
  gap: 14px;
}

.artwork-position-grid .range-field > span {
  gap: 6px;
}

.drag-target-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #d9dfdf;
  border-radius: 10px;
  background: #eef2f1;
}

.drag-target-switch button {
  min-width: 48px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  color: #77838a;
  background: transparent;
  font-size: 9px;
  font-weight: 800;
}

.drag-target-switch button.active {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 2px 7px rgba(30, 48, 58, 0.09);
}

.drag-target-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.switch-label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #4f5d65;
  font-size: 11px;
  font-weight: 700;
}

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

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 99px;
  background: #ccd3d4;
  transition: 150ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  content: "";
  transition: 150ms ease;
}

.switch-label input:checked + .switch {
  background: var(--blue);
}

.switch-label input:checked + .switch::after {
  transform: translateX(14px);
}

.switch-label input:focus-visible + .switch {
  outline: 3px solid rgba(58, 184, 233, 0.34);
  outline-offset: 2px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.color-control {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.color-control input {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: none;
}

.color-control input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-control input::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

.color-control strong,
.color-control small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.color-control strong {
  font-size: 10px;
}

.color-control small {
  margin-top: 2px;
  color: #8b969c;
  font-size: 8px;
}

.title-shadow-disclosure {
  margin-top: 13px;
}

.shadow-toggle-row {
  margin: 0 0 14px;
}

.shadow-preset-note {
  padding: 4px 8px;
  border-radius: 999px;
  color: #7d695e;
  background: #f3ece6;
  font-size: 8px;
  font-weight: 800;
}

.shadow-controls {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  transition: opacity 150ms ease;
}

.shadow-controls:disabled {
  opacity: 0.46;
}

.shadow-controls:disabled input {
  cursor: not-allowed;
}

.shadow-color-control {
  margin-bottom: 13px;
}

.shadow-controls .range-field:last-child {
  margin-bottom: 8px;
}

.overlay-upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  margin-bottom: 10px;
}

.official-assets-disclosure {
  margin-bottom: 13px;
  overflow: hidden;
  border: 1px solid #dce4e3;
  border-radius: 14px;
  background: #f7faf9;
}

.official-assets-summary {
  min-height: 49px;
  padding: 9px 11px;
  list-style: none;
}

.official-assets-summary::-webkit-details-marker {
  display: none;
}

.official-assets-summary > span:first-child,
.official-assets-summary strong,
.official-assets-summary small {
  display: block;
}

.official-assets-summary strong {
  color: #34434c;
  font-size: 10px;
}

.official-assets-summary small {
  margin-top: 3px;
  color: #8a979d;
  font-size: 8px;
  font-weight: 600;
}

.official-assets-panel {
  padding: 0 9px 10px;
}

.asset-category-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: #e9eeee;
}

.asset-category-tabs button {
  min-height: 29px;
  border: 0;
  border-radius: 8px;
  color: #708087;
  background: transparent;
  font-size: 8px;
  font-weight: 800;
}

.asset-category-tabs button.active {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 2px 8px rgba(37, 54, 61, 0.08);
}

.asset-category-tabs button[hidden] {
  display: none;
}

.asset-category-tabs:has(button[hidden]) {
  grid-template-columns: 1fr;
}

.official-assets-hint {
  margin: 8px 2px;
  color: #7d8b91;
  font-size: 8px;
  line-height: 1.45;
}

.official-asset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-height: 252px;
  padding: 1px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.official-asset-button {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 4px;
  border: 1px solid #dde4e3;
  border-radius: 10px;
  color: #65757d;
  background: #fff;
  font-size: 7px;
  font-weight: 800;
  transition: 140ms ease;
}

.official-asset-button:hover {
  color: var(--blue);
  border-color: #a8d1e7;
  transform: translateY(-1px);
}

.official-asset-button.active {
  color: var(--blue);
  border-color: rgba(9, 98, 181, 0.54);
  box-shadow: 0 0 0 2px rgba(9, 98, 181, 0.09);
}

.official-asset-thumb {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background:
    linear-gradient(45deg, #edf0ef 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(-45deg, #edf0ef 25%, transparent 25%) 0 5px / 10px 10px,
    linear-gradient(45deg, transparent 75%, #edf0ef 75%) 5px -5px / 10px 10px,
    linear-gradient(-45deg, transparent 75%, #edf0ef 75%) -5px 0 / 10px 10px,
    #fff;
}

.official-asset-button[data-asset-kind="decoration"] .official-asset-thumb {
  background: #182126;
}

.official-asset-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.official-asset-button > span:last-child {
  overflow: hidden;
  padding: 4px 1px 1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-asset-gif-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 4px;
  border-radius: 999px;
  color: #2f280f;
  background: var(--yellow);
  box-shadow: 0 2px 5px rgba(52, 42, 13, 0.16);
  font-size: 6px;
  line-height: 1;
}

.official-asset-grid.is-loading {
  pointer-events: none;
  opacity: 0.58;
}

.asset-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 13px 0 10px;
  color: #94a0a5;
  font-size: 8px;
  font-weight: 700;
}

.asset-divider::before,
.asset-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.custom-upload-block[hidden] {
  display: none;
}

.local-gif-experimental-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 8px 9px;
  border: 1px solid rgba(252, 139, 65, 0.25);
  border-radius: 10px;
  color: #687983;
  background: linear-gradient(105deg, #fff7e9, #eef9ff);
  font-size: 9px;
  line-height: 1.45;
}

.local-gif-experimental-note strong {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  background: #ef7c35;
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.local-upload-status {
  margin: 7px 2px 0;
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.45;
}

.custom-upload-block.is-loading .upload-button {
  pointer-events: none;
  opacity: 0.58;
}

.custom-upload-block.is-loading .upload-button::after {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(9, 98, 181, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  content: "";
  animation: local-upload-spin 0.8s linear infinite;
}

@keyframes local-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

.upload-button,
.remove-layer-button,
.layer-reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: 150ms ease;
}

.upload-button {
  position: relative;
  gap: 6px;
  overflow: hidden;
  border: 1px dashed #9fcbe2;
  color: var(--blue);
  background: #f2faff;
}

.upload-button:hover {
  border-color: var(--blue);
  background: #e9f6fd;
}

.upload-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-button:focus-within {
  outline: 3px solid rgba(58, 184, 233, 0.22);
  outline-offset: 2px;
}

.remove-layer-button,
.layer-reset-button {
  border: 1px solid #d7dcdb;
  color: #5a6870;
  background: #fff;
}

.remove-layer-button {
  padding: 0 13px;
}

.remove-layer-button:hover:not(:disabled),
.layer-reset-button:hover:not(:disabled) {
  color: var(--blue);
  border-color: #a9d2e7;
}

.remove-layer-button:disabled,
.layer-reset-button:disabled {
  color: #aeb6ba;
  cursor: not-allowed;
  background: #f5f6f5;
}

.overlay-file-card {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.overlay-thumbnail-wrap {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  color: #91a1aa;
  background:
    linear-gradient(45deg, #edf0ef 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(-45deg, #edf0ef 25%, transparent 25%) 0 6px / 12px 12px,
    linear-gradient(45deg, transparent 75%, #edf0ef 75%) 6px -6px / 12px 12px,
    linear-gradient(-45deg, transparent 75%, #edf0ef 75%) -6px 0 / 12px 12px,
    #fff;
}

.overlay-thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.overlay-file-card > span:last-child {
  min-width: 0;
}

.overlay-file-card strong,
.overlay-file-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-file-card strong {
  color: #34434c;
  font-size: 10px;
}

.overlay-file-card small {
  margin-top: 3px;
  color: #8b969c;
  font-size: 8px;
}

.overlay-controls {
  margin-top: 13px;
  padding: 12px 11px 2px;
  border: 1px solid #e1e6e5;
  border-radius: 12px;
  background: #fbfcfb;
}

.overlay-controls[hidden] {
  display: none;
}

.overlay-controls.is-locked .precision-controls {
  opacity: 0.48;
}

.overlay-top-controls {
  align-items: end;
}

.overlay-top-controls .field {
  margin-bottom: 10px;
}

.layer-reset-button {
  min-height: 43px;
  margin-bottom: 10px;
}

.compact-range {
  margin: 4px 0 13px;
}

.overlay-position-grid {
  gap: 14px;
}

.overlay-position-grid .range-field > span {
  gap: 6px;
}

.overlay-hint {
  margin: 10px 2px 0;
  color: #89959b;
  font-size: 9px;
  line-height: 1.55;
}

.canvas-frame.dragging #logoCanvas {
  cursor: grabbing;
}

.canvas-frame.active-overlay-locked #logoCanvas {
  cursor: default;
}

.canvas-frame.manipulating .canvas-selection {
  border-style: solid;
}

.reference-card {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbf8;
}

.reference-card summary {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  list-style: none;
}

.reference-card summary::-webkit-details-marker {
  display: none;
}

.reference-card summary > span:nth-child(2) {
  flex: 1;
}

.reference-card strong,
.reference-card small {
  display: block;
}

.reference-card strong {
  font-size: 10px;
}

.reference-card small {
  margin-top: 2px;
  color: #8a949a;
  font-size: 8px;
}

.reference-icon {
  color: var(--blue);
  font-size: 19px;
}

.chevron {
  color: #8b959b;
  transition: 160ms ease;
}

.reference-card[open] .chevron {
  transform: rotate(180deg);
}

.reference-preview {
  margin: 0 10px 10px;
  padding: 10px;
  border-radius: 10px;
  background-color: #f1f1ee;
  background-image:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.reference-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.preview-panel {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  padding: 30px 34px 26px;
  overflow: hidden;
  flex-direction: column;
  background:
    linear-gradient(rgba(255, 255, 255, 0.79), rgba(255, 255, 255, 0.79)),
    radial-gradient(circle at 70% 20%, rgba(58, 184, 233, 0.14), transparent 36rem),
    rgba(247, 247, 243, 0.72);
}

.preview-toolbar {
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.preview-toolbar h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.preview-heading {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  min-width: 0;
}

.preview-heading-copy {
  flex: 0 0 auto;
}

.mobile-preview-brand {
  display: none;
}

.mobile-cache-refresh-button {
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(12, 28, 31, 0.78);
  font-size: 14px;
}

.mobile-cache-refresh-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.background-switcher {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.background-button {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  color: #778289;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

.background-button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 42, 49, 0.09);
}

.checker-swatch,
.light-swatch,
.dark-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid #cad0d1;
  border-radius: 3px;
}

.checker-swatch {
  background:
    linear-gradient(45deg, #cfd5d7 25%, transparent 25%) 0 0 / 6px 6px,
    linear-gradient(-45deg, #cfd5d7 25%, transparent 25%) 0 3px / 6px 6px,
    linear-gradient(45deg, transparent 75%, #cfd5d7 75%) 3px -3px / 6px 6px,
    #fff;
}

.light-swatch {
  background: #fff;
}

.dark-swatch {
  border-color: #27323a;
  background: #19232b;
}

.canvas-stage {
  display: grid;
  width: 100%;
  min-height: 0;
  flex: 1 1 0;
  place-items: center;
}

.canvas-frame {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  aspect-ratio: var(--canvas-ratio, 1600 / 743);
  flex: 0 0 auto;
  place-items: stretch;
  overflow: hidden;
  border: 1px solid #d9dddd;
  border-radius: 20px;
  user-select: none;
  transition: background-color 180ms ease;
}

.canvas-frame.checker {
  background-color: #f5f5f3;
  background-image:
    linear-gradient(45deg, #e0e2e0 25%, transparent 25%),
    linear-gradient(-45deg, #e0e2e0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0e2e0 75%),
    linear-gradient(-45deg, transparent 75%, #e0e2e0 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.canvas-frame.light {
  background: #fff;
}

.canvas-frame.dark {
  border-color: #27323a;
  background: #172129;
}

#logoCanvas {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: fill;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 8px 8px rgba(6, 50, 82, 0.05));
}

.canvas-object-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  padding: 3px 4px 3px 8px;
  border: 1px solid rgba(201, 211, 214, 0.88);
  border-radius: 11px;
  color: #617079;
  background: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  font-weight: 800;
}

.canvas-object-tools .drag-target-switch {
  padding: 2px;
  border: 0;
}

.canvas-object-tools .drag-target-switch button {
  min-width: 43px;
  padding: 5px 8px;
}

.canvas-reset-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #d7dfdf;
  border-radius: 8px;
  color: #65747c;
  background: #fff;
  font-size: 15px;
  line-height: 1;
}

.canvas-reset-button:hover {
  color: var(--blue);
  border-color: #acd3e9;
}

.canvas-reset-button:disabled {
  color: #aeb7bb;
  cursor: not-allowed;
  border-color: #e0e4e4;
  background: #f3f5f4;
}

.canvas-selection {
  position: absolute;
  z-index: 4;
  min-width: 36px;
  min-height: 28px;
  border: 1.5px dashed var(--blue);
  border-radius: 5px;
  pointer-events: none;
  transform-origin: center;
}

.canvas-selection[hidden] {
  display: none;
}

.canvas-selection-label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  min-width: max-content;
  padding: 4px 7px;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 3px 9px rgba(8, 89, 148, 0.22);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.rotation-stem {
  display: none;
}

.canvas-handle {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 3px 10px rgba(6, 61, 99, 0.28);
  pointer-events: auto;
  touch-action: none;
  font-size: 12px;
  line-height: 1;
}

.rotation-handle {
  top: 6px;
  right: 6px;
  cursor: grab;
}

.rotation-handle:active {
  cursor: grabbing;
}

.scale-handle {
  right: 6px;
  bottom: 6px;
  cursor: nwse-resize;
}

.dark .canvas-object-tools {
  color: #d0d9dd;
  border-color: rgba(89, 106, 116, 0.82);
  background: rgba(20, 30, 37, 0.84);
}

.dark .canvas-object-tools .drag-target-switch {
  background: rgba(255, 255, 255, 0.09);
}

.dark .canvas-reset-button {
  color: #d3dde1;
  border-color: #53636c;
  background: #26343c;
}

.canvas-corner-label {
  position: absolute;
  right: 13px;
  bottom: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  color: #5d6a72;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(8px);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dark .canvas-corner-label {
  color: #c5ced3;
  background: rgba(16, 23, 28, 0.72);
}

.preview-caption {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  margin: 10px 2px 16px;
  color: #7c878e;
  font-size: 9px;
  font-weight: 600;
}

.preview-caption > span {
  display: flex;
  gap: 6px;
  align-items: center;
}

.canvas-edit-icon {
  color: var(--blue);
  font-style: normal;
  font-size: 11px;
}

.export-bar {
  flex: 0 0 auto;
  gap: 14px;
  min-height: 68px;
  padding: 11px 12px 11px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 22px rgba(37, 49, 56, 0.05);
}

.export-copy {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 155px;
  margin-right: auto;
}

.export-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  color: var(--blue);
  background: #eaf5fb;
  font-size: 18px;
}

.export-copy strong,
.export-copy small {
  display: block;
}

.export-copy strong {
  font-size: 11px;
}

.export-copy small {
  margin-top: 2px;
  color: #849097;
  font-size: 8px;
}

.scale-select {
  display: grid;
  gap: 3px;
  min-width: 120px;
}

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

.scale-select span {
  color: #849097;
  font-size: 8px;
  font-weight: 700;
}

.scale-select select {
  height: 31px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
}

.download-button {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 17px rgba(8, 107, 182, 0.22);
  font-size: 11px;
  font-weight: 800;
  transition: 160ms ease;
}

.download-button #downloadButtonIcon {
  font-size: 17px;
  line-height: 1;
}

.download-button #downloadButtonLabel {
  font-size: 11px;
  line-height: 1;
}

.download-button:hover {
  background: var(--blue-dark);
  box-shadow: 0 10px 23px rgba(8, 107, 182, 0.29);
  transform: translateY(-1px);
}

.download-button:active {
  transform: translateY(1px);
}

.download-button.loading {
  pointer-events: none;
  opacity: 0.7;
}

.gif-exporting .control-panel,
.gif-exporting .canvas-stage,
.gif-exporting .preview-toolbar,
.gif-exporting .scale-select {
  pointer-events: none;
}

.gif-exporting .scale-select {
  opacity: 0.62;
}

.site-footer {
  display: flex;
  gap: 9px;
  min-height: 27px;
  margin-top: 7px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.asset-credit {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 4px rgba(12, 28, 31, 0.2);
}

.analytics-credit {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 7px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.github-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 4px 10px 4px 5px;
  border: 1px solid rgba(255, 255, 255, 0.27);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(12, 28, 31, 0.29);
  box-shadow: 0 7px 20px rgba(12, 28, 31, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: 160ms ease;
}

.github-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(12, 28, 31, 0.46);
  transform: translateY(-1px);
}

.github-badge {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #17232d;
  background: var(--yellow);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.github-arrow {
  color: var(--yellow);
  font-size: 11px;
  transition: transform 160ms ease;
}

.github-link:hover .github-arrow {
  transform: translate(1px, -1px);
}

.save-assist[hidden] {
  display: none;
}

.save-assist {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  padding: 22px;
  place-items: center;
}

.save-assist-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(10, 22, 27, 0.52);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.save-assist-card {
  position: relative;
  z-index: 1;
  width: min(410px, 100%);
  padding: 27px 25px 23px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 10%, rgba(252, 198, 65, 0.2), transparent 31%),
    rgba(255, 253, 249, 0.97);
  box-shadow: 0 26px 70px rgba(8, 25, 31, 0.3);
  text-align: center;
  animation: save-assist-enter 190ms ease-out both;
}

.save-assist-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--sky), var(--yellow));
  content: "";
}

.save-assist-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  border: 1px solid #dce3e4;
  border-radius: 10px;
  color: #65737b;
  background: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.save-assist-emblem {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 1px auto 12px;
  place-items: center;
  border: 1px solid rgba(9, 98, 181, 0.14);
  border-radius: 16px;
  color: var(--blue);
  background: #eaf5fb;
  box-shadow: 0 8px 20px rgba(8, 107, 182, 0.11);
  font-size: 24px;
  font-weight: 800;
}

.save-assist-eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.save-assist-card h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.save-assist-card > p:not(.save-assist-eyebrow) {
  max-width: 320px;
  margin: 9px auto 18px;
  color: #68767e;
  font-size: 11px;
  line-height: 1.65;
}

.save-assist-actions {
  display: grid;
  gap: 9px;
}

.save-assist-actions button {
  display: flex;
  gap: 8px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 800;
}

.save-assist-primary {
  border: 0;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 9px 20px rgba(8, 107, 182, 0.22);
}

.save-assist-primary[hidden] {
  display: none;
}

.save-assist-primary:disabled {
  cursor: wait;
  opacity: 0.66;
}

.save-assist-secondary {
  border: 1px solid #dbe3e4;
  color: #2d3b44;
  background: #fff;
}

.save-assist-card small {
  display: block;
  margin-top: 13px;
  color: #8a969c;
  font-size: 8px;
  line-height: 1.5;
}

.save-image-preview[hidden] {
  display: none;
}

.save-image-preview {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(980px, 100%);
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px);
  gap: 10px;
  place-items: center;
}

.save-image-preview-toolbar {
  display: flex;
  width: min(560px, 100%);
  min-height: 42px;
  padding: 5px 6px 5px 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  color: #fff;
  background: rgba(23, 35, 45, 0.88);
  box-shadow: 0 12px 34px rgba(8, 25, 31, 0.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 10px;
  font-weight: 800;
}

.save-image-preview-toolbar > span {
  min-width: 0;
}

.save-image-preview-toolbar i {
  margin-right: 4px;
  color: var(--yellow);
  font-style: normal;
}

.save-image-preview-toolbar button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: #17232d;
  background: var(--yellow);
  font-size: 9px;
  font-weight: 900;
}

.save-image-preview img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  max-height: calc(100dvh - 190px);
  border: 5px solid rgba(255, 255, 255, 0.94);
  border-radius: 16px;
  background:
    linear-gradient(45deg, #edf1f1 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f1 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f1 75%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  box-shadow: 0 24px 64px rgba(8, 25, 31, 0.34);
  object-fit: contain;
  -webkit-touch-callout: default;
  user-select: auto;
}

.save-image-preview-help {
  display: grid;
  width: min(560px, 100%);
  gap: 7px;
  padding: 9px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  color: #fff;
  background: rgba(23, 35, 45, 0.9);
  box-shadow: 0 12px 34px rgba(8, 25, 31, 0.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.save-image-preview-help p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.save-image-preview-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.save-image-preview-actions button {
  display: flex;
  gap: 7px;
  min-height: 37px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 900;
}

.save-image-preview-actions button[hidden] {
  display: none;
}

#previewSystemSaveButton {
  color: #fff;
  background: var(--blue);
}

#downloadSavedImageButton {
  color: #17232d;
  background: var(--yellow);
}

.save-image-preview-actions button:disabled {
  cursor: wait;
  opacity: 0.66;
}

@keyframes save-assist-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast {
  position: fixed;
  z-index: 20;
  right: 28px;
  bottom: 28px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 17px;
  border-radius: 13px;
  color: #fff;
  background: #17232d;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.2);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast span:first-child {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  color: #17232d;
  background: var(--yellow);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .control-panel {
    padding: 26px 23px;
  }

  .preview-panel {
    padding: 26px 25px 22px;
  }

  .export-copy {
    min-width: auto;
  }

  .export-copy span:last-child {
    display: none;
  }
}

@media (max-width: 820px) {
  html,
  body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body {
    min-height: 0;
  }

  .app-shell {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 14px;
  }

  .workspace {
    display: flex;
    height: auto;
    min-height: 0;
    overflow: hidden;
    flex: 1;
    flex-direction: column-reverse;
    border-radius: 20px;
  }

  .control-panel {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 0;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .preview-panel {
    height: min(52vh, 500px);
    height: min(52dvh, 500px);
    min-height: 0;
    overflow: hidden;
    flex: 0 0 auto;
  }

  .canvas-stage {
    display: grid;
    min-height: 0;
    flex: 1 1 0;
  }

  .canvas-frame {
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .font-loading-popover {
    top: calc(env(safe-area-inset-top, 0px) + 52px);
  }

  .app-shell {
    padding: 8px;
  }

  .topbar {
    display: none;
  }

  .workspace {
    border-radius: 17px;
  }

  .preview-panel {
    height: clamp(300px, 40dvh, 344px);
    padding: 10px;
  }

  .control-panel {
    padding: 16px 14px 22px;
  }

  .editor-mode-tabs {
    margin: -8px -5px 17px;
    padding: 4px;
    border-radius: 13px;
  }

  .editor-mode-tab {
    min-height: 38px;
    padding: 0 8px;
    font-size: 9px;
  }

  .preview-toolbar {
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    flex-direction: row;
  }

  .preview-heading {
    flex: 1 1 auto;
    justify-content: space-between;
    gap: 6px;
    align-items: center;
  }

  .preview-heading-copy {
    display: none;
  }

  .mobile-preview-brand {
    display: flex;
    flex: 0 1 auto;
    gap: 4px;
    align-items: center;
    min-width: 0;
    height: 34px;
    padding: 3px 3px 3px 4px;
    border: 1px solid rgba(221, 225, 223, 0.94);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 3px 10px rgba(31, 48, 56, 0.05);
  }

  .mobile-preview-brand img {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
  }

  .mobile-preview-brand strong {
    overflow: hidden;
    color: #34434b;
    font-size: 9px;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-cache-refresh-button {
    flex: 0 0 auto;
  }

  .background-switcher {
    width: auto;
    flex: 0 0 auto;
    padding: 3px;
  }

  .background-button {
    flex: 1;
    justify-content: center;
  }

  .canvas-frame {
    min-height: 0;
    aspect-ratio: var(--canvas-ratio, 1600 / 743);
    flex: none;
    border-radius: 14px;
  }

  .canvas-object-tools {
    gap: 3px;
    padding: 3px;
  }

  .canvas-object-tools > span {
    display: none;
  }

  .canvas-object-tools .drag-target-switch button {
    min-width: 34px;
    padding: 5px 4px;
  }

  .canvas-reset-button {
    width: 25px;
    height: 25px;
  }

  .background-button {
    padding: 6px;
  }

  .background-label {
    display: none;
  }

  .canvas-selection-label,
  .canvas-corner-label {
    display: none;
  }

  #logoCanvas {
    width: 100%;
    max-width: none;
    max-height: none;
  }

  .field input,
  .field select {
    min-height: 46px;
  }

  input[type="range"] {
    height: 28px;
    margin: 0;
    background-size: 100% 4px;
    background-position: center;
    background-repeat: no-repeat;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 21px;
    height: 21px;
  }

  .control-section {
    margin-top: 17px;
    padding-top: 17px;
  }

  .two-column {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .color-grid {
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }

  .color-control {
    justify-content: center;
    min-height: 58px;
    padding: 5px 4px;
    flex-direction: column;
    gap: 4px;
    border: 0;
    border-radius: 10px;
    background: #f3f7f7;
  }

  .color-control > span {
    display: block;
    width: 100%;
    text-align: center;
  }

  .color-control input {
    width: 100%;
    height: 29px;
    border-radius: 8px;
  }

  .color-control strong {
    font-size: 9px;
  }

  .color-control small {
    display: none;
  }

  .color-section .section-title {
    margin-bottom: 11px;
  }

  .title-shadow-disclosure {
    margin-top: 9px;
  }

  .shadow-color-control {
    min-height: 0;
    padding: 8px;
    justify-content: flex-start;
    flex-direction: row;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fff;
  }

  .shadow-color-control > span {
    display: block;
    text-align: left;
  }

  .shadow-color-control input {
    width: 32px;
    height: 32px;
  }

  .official-asset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 238px;
  }

  .official-assets-panel {
    padding-right: 8px;
    padding-left: 8px;
  }

  .export-bar {
    gap: 7px;
    min-height: 50px;
    padding: 6px;
    flex-wrap: nowrap;
    border-radius: 13px;
  }

  .export-copy {
    display: none;
  }

  .scale-select {
    min-width: 0;
    flex: 1 1 48%;
  }

  .scale-select span {
    display: none;
  }

  .scale-select select {
    height: 40px;
    border-radius: 9px;
  }

  .download-button {
    width: auto;
    min-height: 40px;
    padding: 0 12px;
    flex: 1 1 52%;
    justify-content: center;
  }

  .preview-caption {
    margin: 5px 2px 6px;
  }

  .preview-caption > span:last-child {
    display: none;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    justify-content: center;
  }

  .site-footer {
    gap: 5px;
    min-height: 25px;
    margin-top: 5px;
    flex-direction: column;
  }

  .asset-credit {
    padding: 0 8px;
    font-size: 7px;
  }

  .analytics-credit {
    padding: 0 8px;
    font-size: 6px;
  }

  .github-link {
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 8px;
  }

  .save-assist {
    padding: 0;
    place-items: end center;
  }

  .save-assist-card {
    width: 100%;
    padding: 26px 19px calc(20px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    animation-name: save-assist-mobile-enter;
  }

  .save-assist-card h2 {
    font-size: 18px;
  }

  .save-image-preview {
    width: 100%;
    height: 100%;
    max-height: none;
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      10px
      calc(10px + env(safe-area-inset-bottom, 0px));
    align-content: center;
  }

  .save-image-preview-toolbar {
    width: 100%;
    font-size: 9px;
  }

  .save-image-preview img {
    max-height: calc(100vh - 180px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 180px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-width: 3px;
    border-radius: 12px;
  }

  .save-image-preview-help {
    width: 100%;
    padding: 8px;
  }

  .save-image-preview-help p {
    font-size: 8px;
  }

  .save-image-preview-actions button {
    min-height: 36px;
    font-size: 9px;
  }
}

/* Layer inspector, history controls and compact project information */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.legacy-layer-controls {
  display: none !important;
}

.topbar-actions {
  gap: 6px;
}

.topbar-link-button,
.topbar-icon-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
  transition: 150ms ease;
}

.topbar-link-button {
  gap: 6px;
  padding: 0 10px;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.topbar-icon-link {
  width: 34px;
  padding: 0;
}

.topbar-link-button:hover,
.topbar-icon-link:hover {
  color: var(--yellow);
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.13);
}

.topbar-link-button svg,
.topbar-icon-link svg,
.history-toolbar svg,
.mobile-history-toolbar svg,
.selected-layer-quick-actions svg,
.layer-inline-button svg,
.layer-entry-actions svg,
.layer-inline-properties button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-history-toolbar {
  display: none;
}

.history-toolbar {
  position: sticky;
  z-index: 8;
  top: -16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: -16px -17px 17px;
  padding: 11px 16px;
  border-bottom: 1px solid #d4dbdd;
  background: rgba(250, 251, 250, 0.97);
  backdrop-filter: blur(10px);
}

.history-toolbar button {
  display: flex;
  min-width: 0;
  min-height: 48px;
  padding: 7px 10px;
  align-items: center;
  gap: 8px;
  border: 1px solid #cfd8db;
  border-radius: 10px;
  color: #34464f;
  background: #fff;
  box-shadow: 0 2px 7px rgba(31, 48, 56, 0.06);
  text-align: left;
}

.history-toolbar button:hover:not(:disabled) {
  color: var(--blue);
  border-color: #88bdd8;
  background: #f1f9fd;
}

.history-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.history-toolbar button > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.history-toolbar strong {
  font-size: 11px;
  line-height: 1;
}

.history-toolbar small {
  color: #8a969b;
  font-size: 7px;
  font-weight: 700;
  white-space: nowrap;
}

.selected-layer-heading {
  display: flex;
  min-width: 0;
  margin-bottom: 16px;
  padding-bottom: 14px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #dfe4e5;
}

.selected-layer-preview {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d4dcde;
  border-radius: 12px;
  color: var(--blue);
  background:
    linear-gradient(45deg, #edf0f0 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(-45deg, #edf0f0 25%, transparent 25%) 0 5px / 10px 10px,
    #fff;
  font-size: 20px;
  font-weight: 900;
}

.selected-layer-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.selected-layer-heading > span:last-child {
  min-width: 0;
}

.selected-layer-heading small {
  display: block;
  margin-bottom: 4px;
  color: #89969b;
  font-size: 8px;
  font-weight: 800;
}

.selected-layer-heading h2 {
  overflow: hidden;
  color: #273941;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-layer-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.selected-layer-quick-actions button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d3dcde;
  border-radius: 9px;
  color: #53656d;
  background: #fff;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
}

.selected-layer-quick-actions button:hover {
  color: var(--blue);
  border-color: #9fc9df;
}

.selected-layer-quick-actions button[hidden] {
  display: none;
}

.selected-layer-quick-actions button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(8, 107, 182, 0.18);
}

.decoration-layer-controls,
.group-layer-controls {
  display: grid;
  gap: 13px;
  margin: -2px 0 18px;
  padding: 13px;
  border: 1px solid #cfe2eb;
  border-radius: 12px;
  background: linear-gradient(145deg, #f4fbff, #fffaf0);
}

.decoration-layer-controls[hidden],
.group-layer-controls[hidden] {
  display: none;
}

.decoration-layer-controls-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.decoration-layer-controls-heading > span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #755a08;
  background: var(--yellow);
  font-size: 15px;
}

.group-layer-controls .decoration-layer-controls-heading > span:first-child {
  font-size: 8px;
  font-weight: 900;
}

.decoration-layer-controls-heading strong,
.decoration-layer-controls-heading small {
  display: block;
}

.decoration-layer-controls-heading strong {
  color: #32464f;
  font-size: 10px;
}

.decoration-layer-controls-heading small {
  margin-top: 2px;
  color: #819097;
  font-size: 7px;
  line-height: 1.45;
}

.decoration-layer-content-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.decoration-layer-content-actions .switch-label {
  min-height: 36px;
  font-size: 9px;
}

.randomize-stars-button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #bad7e6;
  border-radius: 9px;
  color: #285c78;
  background: #fff;
  font: inherit;
  font-size: 8px;
  font-weight: 800;
}

.randomize-stars-button span {
  margin-right: 4px;
  color: #d89b00;
}

.randomize-stars-button:hover:not(:disabled) {
  color: var(--blue);
  border-color: #69acd1;
}

.randomize-stars-button:disabled,
.decoration-layer-content-actions input:disabled + .switch {
  cursor: not-allowed;
  opacity: 0.45;
}

.selected-layer-position-grid {
  gap: 10px;
}

.selected-layer-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 19px;
  padding-top: 14px;
  border-top: 1px solid #dfe4e5;
}

.selected-layer-footer-actions button {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #d2dbdd;
  border-radius: 9px;
  color: #53646c;
  background: #fff;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
}

.selected-layer-footer-actions .danger {
  color: #b7473d;
  border-color: #e8c1bc;
  background: #fff8f7;
}

.advanced-layer-mode-card {
  display: flex;
  min-width: 0;
  margin: 0 0 12px;
  padding: 11px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cedee6;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4fbff, #fffaf0);
}

.advanced-layer-mode-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.advanced-layer-mode-copy strong {
  color: #334a55;
  font-size: 10px;
}

.advanced-layer-mode-copy small {
  color: #7b8b92;
  font-size: 7px;
  line-height: 1.45;
}

.advanced-layer-mode-switch {
  min-width: 72px;
  flex: 0 0 auto;
  justify-content: flex-end;
  color: #477084;
  font-size: 8px;
  font-weight: 900;
}

.text-layer-toggle.is-mode-locked {
  cursor: default;
}

.text-layer-toggle.is-mode-locked .text-layer-toggle-index {
  background: linear-gradient(135deg, var(--blue), #56b9d9);
}

.text-layer-field {
  padding: 10px;
  border: 1px solid #dbe2e3;
  border-radius: 12px;
  background: #f8faf9;
  transition: 150ms ease;
}

.text-layer-field-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.text-layer-toggle {
  display: flex;
  min-width: 0;
  padding: 0;
  align-items: center;
  gap: 8px;
  border: 0;
  color: #7d8a90;
  background: transparent;
  text-align: left;
}

.text-layer-toggle-index {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #7a888e;
  background: #e6ebeb;
  font-size: 10px;
  font-weight: 900;
}

.text-layer-toggle-index.wide {
  font-size: 8px;
}

.text-layer-toggle > span:last-child {
  display: grid;
  gap: 2px;
}

.text-layer-toggle strong {
  color: #485960;
  font-size: 10px;
}

.text-layer-toggle b {
  color: #9aa5a9;
  font-size: 7px;
}

.text-layer-toggle.active .text-layer-toggle-index {
  color: #fff;
  background: var(--blue);
}

.text-layer-toggle.active b {
  color: #3a8eb9;
}

.text-layer-field-heading output {
  min-width: 28px;
  color: #8d9a9f;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.text-layer-field.is-disabled {
  border-style: dashed;
  background: #f2f4f4;
}

.text-layer-field.is-disabled > input {
  color: #9aa4a8;
  background: #e9eded;
}

.glyph-fine-tune-card {
  margin: 12px 0 0;
  overflow: hidden;
  border: 1px solid #c9dfe9;
  border-radius: 13px;
  background: linear-gradient(145deg, #f4fbff, #fffaf2);
}

.glyph-fine-tune-card > summary {
  display: grid;
  min-height: 58px;
  padding: 10px 12px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: #405b68;
  list-style: none;
  cursor: pointer;
}

.glyph-fine-tune-card > summary::-webkit-details-marker {
  display: none;
}

.glyph-fine-tune-card > summary:hover {
  color: var(--blue);
}

.glyph-fine-tune-summary-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #ffad4f);
  box-shadow: 0 4px 10px rgba(227, 104, 32, 0.2);
  font-size: 13px;
  font-weight: 900;
}

.glyph-fine-tune-card > summary > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.glyph-fine-tune-card > summary strong {
  font-size: 10px;
}

.glyph-fine-tune-card > summary small {
  color: #819198;
  font-size: 7px;
  line-height: 1.4;
}

.glyph-fine-tune-card[open] > summary .precision-chevron {
  transform: rotate(180deg);
}

.glyph-fine-tune-body {
  padding: 12px;
  border-top: 1px solid #d7e5ea;
  background: rgba(255, 255, 255, 0.68);
}

.glyph-fine-tune-empty {
  padding: 18px 10px;
  color: #849298;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.glyph-target-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.glyph-target-character {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #a9d4e8;
  border-radius: 11px;
  color: var(--blue);
  background: #fff;
  box-shadow: 0 3px 9px rgba(19, 93, 134, 0.1);
  font-size: 21px;
  font-weight: 800;
}

.glyph-target-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.glyph-target-copy strong {
  overflow: hidden;
  color: #3d535e;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glyph-target-copy small {
  overflow: hidden;
  color: #7d8d94;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glyph-reset-button,
.glyph-reset-all-button,
.glyph-navigation button {
  border: 1px solid #cfdbdf;
  color: #526771;
  background: #fff;
  font: inherit;
  font-size: 8px;
  font-weight: 800;
}

.glyph-reset-button {
  min-height: 31px;
  padding: 0 9px;
  border-radius: 999px;
}

.glyph-navigation {
  display: grid;
  margin: 12px 0 13px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.glyph-navigation button {
  display: flex;
  min-height: 36px;
  padding: 0 9px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 9px;
}

.glyph-navigation output {
  min-width: 44px;
  color: #6b7c84;
  font-size: 8px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.glyph-navigation button:hover:not(:disabled),
.glyph-reset-button:hover:not(:disabled),
.glyph-reset-all-button:hover:not(:disabled) {
  color: var(--blue);
  border-color: #8bc5e2;
}

.glyph-navigation button:disabled,
.glyph-reset-button:disabled,
.glyph-reset-all-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.glyph-adjustment-controls {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid #dce5e7;
  border-radius: 11px;
  background: rgba(248, 250, 249, 0.88);
}

.glyph-position-grid {
  gap: 10px;
}

.glyph-reset-all-button {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border-style: dashed;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 560px) {
  .glyph-target-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .glyph-reset-button {
    min-height: 38px;
    grid-column: 1 / -1;
    border-radius: 9px;
  }

  .glyph-navigation button {
    min-height: 44px;
    padding-right: 5px;
    padding-left: 5px;
    font-size: 8px;
  }

  .glyph-reset-all-button {
    min-height: 40px;
  }
}

.layer-item {
  grid-template-columns: 18px 38px minmax(0, 1fr) 32px 32px;
  gap: 7px;
  min-height: 66px;
  padding: 8px 7px;
  border-radius: 11px;
}

.layer-drag-handle {
  font-size: 16px;
}

.layer-thumbnail {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 15px;
}

.layer-copy strong {
  font-size: 11px;
}

.layer-copy small {
  margin-top: 3px;
  font-size: 8px;
}

.layer-inline-button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.layer-inline-button svg,
.layer-entry-actions svg {
  width: 19px;
  height: 19px;
}

.layer-entry-actions {
  grid-column: 2 / -1;
  gap: 6px;
}

.layer-entry-actions button {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 30px;
  padding: 0;
  place-items: center;
  border-radius: 8px;
}

.layer-entry-actions button.danger {
  color: #b74a40;
  border-color: #e8c3be;
  background: #fff9f8;
}

.layer-inline-properties {
  display: none;
}

.official-assets-summary strong {
  font-size: 12px;
}

.official-assets-summary small,
.official-assets-hint {
  font-size: 9px;
}

.asset-category-tabs button {
  min-height: 35px;
  font-size: 9px;
}

.official-asset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 370px;
}

.official-asset-button {
  padding: 6px;
  border-radius: 11px;
  font-size: 9px;
}

.official-asset-button > span:last-child {
  padding-top: 6px;
}

.about-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.about-dialog[hidden] {
  display: none;
}

.about-dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 25, 30, 0.62);
  backdrop-filter: blur(7px);
}

.about-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  color: #384a52;
  background: #fff;
  box-shadow: 0 25px 70px rgba(11, 24, 30, 0.3);
}

.about-card > img {
  display: block;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
}

.about-card > small {
  color: #8d999e;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.about-card h2 {
  margin: 5px 38px 19px 0;
  color: #243840;
  font-size: 20px;
  line-height: 1.3;
}

.about-close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #d8dfe1;
  border-radius: 10px;
  color: #65747a;
  background: #f5f7f7;
  font-size: 20px;
}

.about-card dl {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid #e0e5e6;
}

.about-card dl > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #e6eaeb;
}

.about-card dt {
  color: #8b979c;
  font-size: 9px;
  font-weight: 800;
}

.about-card dd {
  margin: 0;
  color: #43555d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

@media (min-width: 1181px) {
  .workspace {
    grid-template-columns: 276px minmax(360px, 1fr) 360px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .workspace {
    grid-template-columns: 238px minmax(330px, 1fr) 330px;
  }
}

@media (max-width: 900px) {
  .history-toolbar {
    top: -12px;
    margin: -12px -12px 14px;
    padding: 9px 12px;
  }

  .official-asset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .layer-item {
    flex: 0 0 auto;
  }

  .layer-drag-handle {
    color: #c2c9cb;
    cursor: default;
  }

  .layer-inline-properties {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 4px -1px -1px;
    padding: 12px;
    border-top: 1px solid #c9dfe9;
    border-radius: 0 0 9px 9px;
    background: rgba(255, 255, 255, 0.72);
  }

  .layer-inline-properties label {
    display: grid;
    min-width: 0;
    gap: 7px;
  }

  .layer-inline-properties label.wide,
  .layer-inline-properties > button {
    grid-column: 1 / -1;
  }

  .layer-inline-properties label > span {
    display: flex;
    justify-content: space-between;
    color: #5c6d74;
    font-size: 10px;
    font-weight: 800;
  }

  .layer-inline-properties > button.active {
    color: #fff;
    border-color: var(--blue);
    background: var(--blue);
    box-shadow: 0 7px 18px rgba(8, 107, 182, 0.16);
  }

  .inline-decoration-heading {
    grid-column: 1 / -1;
    margin: 0 0 -1px;
    color: #3f6578;
    font-size: 10px;
    font-weight: 900;
  }

  .inline-decoration-heading span,
  .layer-inline-properties [data-layer-action="randomize-stars"] > span:first-child {
    color: #d99b00;
  }

  .inline-decoration-toggle > span {
    min-height: 31px;
    align-items: center;
  }

  .inline-decoration-toggle input {
    width: 20px;
    height: 20px;
    accent-color: var(--blue);
  }

  .layer-inline-properties output {
    color: var(--blue);
    font-variant-numeric: tabular-nums;
  }

  .layer-inline-properties input[type="range"] {
    height: 5px;
    margin: 7px 0;
  }

  .layer-inline-properties > button {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #cfdbde;
    border-radius: 9px;
    color: #53656d;
    background: #fff;
    font: inherit;
    font-size: 9px;
    font-weight: 800;
  }

  .layer-item.is-expanded {
    border-color: #5aa9d7;
    background: #edf8fe;
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    gap: 4px;
  }

  .topbar-link-button,
  .topbar-icon-link,
  .cache-refresh-button {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
  }

  .topbar-link-button > span,
  #cacheRefreshLabel {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand strong {
    max-width: 150px;
  }

  .history-toolbar button {
    min-height: 45px;
  }

  .layer-item {
    grid-template-columns: 16px 40px minmax(0, 1fr) 34px 34px;
    min-height: 69px;
  }

  .layer-thumbnail {
    width: 40px;
    height: 40px;
  }

  .layer-inline-button {
    width: 34px;
    height: 34px;
  }

  .layer-entry-actions button {
    width: 34px;
    min-width: 34px;
    height: 32px;
  }

  .about-card {
    padding: 24px 20px 20px;
  }
}

@media (max-width: 380px) {
  .brand strong {
    max-width: 105px;
    font-size: 10px;
  }

  .history-toolbar small {
    display: none;
  }
}

@keyframes save-assist-mobile-enter {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 380px) {
  .mobile-preview-brand strong {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .font-loading-sparkle,
  .cache-refresh-button.loading .cache-refresh-icon,
  .mobile-cache-refresh-button.loading .cache-refresh-icon {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Full-screen layer editor preview */
html,
body {
  background: #d9dee0;
}

body {
  background-image: none;
}

body::before {
  display: none;
}

.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: #edf0f1;
}

.topbar {
  min-height: 52px;
  margin: 0;
  padding: 0 14px;
  border-bottom: 1px solid #111a1f;
  background: #202a2f;
  box-shadow: 0 1px 8px rgba(17, 27, 32, 0.2);
}

.brand {
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: none;
}

.brand-mark img {
  width: 29px;
  height: 29px;
}

.brand strong {
  font-size: 13px;
  text-shadow: none;
}

.cache-refresh-button {
  min-height: 32px;
  padding: 0 10px;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.workspace {
  display: grid !important;
  grid-template-areas: "layers canvas inspector";
  grid-template-columns: 224px minmax(360px, 1fr) 344px;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  background: #d5dadd;
  box-shadow: none;
  backdrop-filter: none;
}

.layer-panel {
  grid-area: layers;
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 15px 12px 12px;
  overflow: hidden;
  flex-direction: column;
  border-right: 1px solid #c9cfd1;
  background: #f7f8f7;
}

.layer-panel-heading,
.inspector-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.layer-panel-heading > span,
.inspector-heading > span:first-child {
  display: grid;
  gap: 2px;
}

.layer-panel-heading small,
.inspector-heading small {
  color: #8a969b;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.layer-panel-heading strong,
.inspector-heading strong {
  color: #25343b;
  font-size: 14px;
}

.layer-panel-heading output {
  display: grid;
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #26343a;
  font-size: 9px;
  font-weight: 800;
}

.layer-panel-hint {
  margin: 8px 0 11px;
  color: #839096;
  font-size: 8px;
  line-height: 1.5;
}

.layer-list {
  display: flex;
  min-height: 110px;
  padding: 2px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  overscroll-behavior: contain;
}

.layer-item {
  display: grid;
  grid-template-columns: 14px 26px minmax(0, 1fr) 24px 24px;
  gap: 5px;
  align-items: center;
  min-height: 48px;
  padding: 5px;
  border: 1px solid #dbe0e1;
  border-radius: 9px;
  color: #4d5c63;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 42, 48, 0.03);
  cursor: pointer;
  user-select: none;
}

.layer-item:hover {
  border-color: #b9cbd2;
}

.layer-item.active {
  border-color: #5aa9d7;
  background: #edf8fe;
  box-shadow: 0 0 0 1px rgba(54, 154, 211, 0.12);
}

.layer-item.dragging {
  opacity: 0.45;
}

.layer-item.drop-before {
  box-shadow: 0 -2px 0 var(--blue);
}

.layer-item.drop-after {
  box-shadow: 0 2px 0 var(--blue);
}

.layer-drag-handle {
  color: #a2adb1;
  font-size: 12px;
  letter-spacing: -2px;
  cursor: grab;
}

.layer-thumbnail {
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d8dedf;
  border-radius: 6px;
  color: var(--blue);
  background:
    linear-gradient(45deg, #edf0f0 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(-45deg, #edf0f0 25%, transparent 25%) 0 4px / 8px 8px,
    #fff;
  font-size: 12px;
  font-weight: 900;
}

.layer-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.layer-thumbnail i {
  position: absolute;
  right: 1px;
  bottom: 1px;
  padding: 1px 2px;
  border-radius: 3px;
  color: #fff;
  background: #ed8a28;
  font-size: 5px;
  font-style: normal;
  line-height: 1.2;
}

.layer-copy {
  min-width: 0;
}

.layer-copy strong,
.layer-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-copy strong {
  color: #33434a;
  font-size: 9px;
}

.layer-copy small {
  margin-top: 2px;
  color: #8a969b;
  font-size: 7px;
}

.layer-item.is-hidden .layer-copy,
.layer-item.is-hidden .layer-thumbnail {
  opacity: 0.45;
}

.layer-inline-button,
.layer-panel-actions button {
  display: grid;
  place-items: center;
  border: 1px solid #d8dfe0;
  border-radius: 6px;
  color: #64737a;
  background: #fff;
  font-size: 9px;
}

.layer-inline-button {
  width: 24px;
  height: 24px;
  padding: 0;
}

.layer-inline-button:hover,
.layer-panel-actions button:hover:not(:disabled) {
  color: var(--blue);
  border-color: #a8cee2;
}

.layer-panel-actions {
  display: grid;
  grid-template-columns: 32px 32px 1fr 1fr;
  gap: 5px;
  margin-top: 9px;
}

.layer-panel-actions button {
  min-height: 29px;
  padding: 0 7px;
  font-size: 8px;
  font-weight: 800;
}

.layer-panel-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.layer-panel-actions .danger:hover:not(:disabled) {
  color: #be493b;
  border-color: #e6b1aa;
}

.layer-panel-shortcuts {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #dfe3e4;
}

.layer-panel-shortcuts button {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #d8dfe0;
  border-radius: 8px;
  color: #56676e;
  background: #fff;
  font-size: 8px;
  font-weight: 800;
  text-align: left;
}

.layer-panel-shortcuts button:hover {
  color: var(--blue);
  border-color: #a8cee2;
}

.layer-panel-shortcuts span {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: var(--blue);
  font-size: 9px;
}

.control-panel {
  grid-column: auto;
  grid-row: auto;
  grid-area: inspector;
  padding: 16px 17px 24px;
  border-top: 0;
  border-left: 1px solid #c9cfd1;
  background: #fafbfa;
}

.inspector-heading {
  position: sticky;
  z-index: 8;
  top: -16px;
  margin: -16px -17px 18px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #d7ddde;
  background: rgba(250, 251, 250, 0.96);
  backdrop-filter: blur(10px);
}

.inspector-heading > span:last-child {
  max-width: 160px;
  overflow: hidden;
  color: var(--blue);
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-section {
  margin-top: 20px;
  padding-top: 19px;
}

.preview-panel {
  grid-column: auto;
  grid-row: auto;
  grid-area: canvas;
  padding: 13px 15px 12px;
  background: #d5dadd;
}

.preview-toolbar {
  min-height: 38px;
  margin-bottom: 10px;
}

.preview-toolbar h2 {
  font-size: 14px;
}

.canvas-stage {
  padding: clamp(24px, 2.25vw, 38px);
  overflow: hidden;
  border: 1px solid #c3c9cb;
  border-radius: 4px;
  background: #cbd0d2;
  box-shadow: inset 0 1px 6px rgba(31, 43, 49, 0.09);
}

.canvas-frame {
  border-color: #aeb6b9;
  border-radius: 3px;
  box-shadow: 0 7px 24px rgba(31, 43, 49, 0.18);
}

.preview-caption {
  margin: 7px 2px 8px;
}

.export-bar {
  min-height: 57px;
  padding: 7px 8px 7px 11px;
  border-radius: 9px;
  box-shadow: none;
}

.asset-category-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.layer-order-note {
  margin: 0;
  align-self: center;
  color: #7b898f;
  font-size: 8px;
  line-height: 1.4;
}

.site-footer {
  min-height: 24px;
  margin: 0;
  padding: 3px 10px;
  border-top: 1px solid #151e22;
  background: #202a2f;
}

.asset-credit,
.analytics-credit {
  color: rgba(255, 255, 255, 0.64);
  text-shadow: none;
}

.github-link {
  padding-top: 2px;
  padding-bottom: 2px;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 190px minmax(330px, 1fr) 310px;
  }

  .layer-panel {
    padding-right: 9px;
    padding-left: 9px;
  }

  .control-panel {
    padding-right: 13px;
    padding-left: 13px;
  }

  .preview-panel {
    padding-right: 10px;
    padding-left: 10px;
  }

  .canvas-stage {
    padding: 16px;
  }
}

@media (max-width: 900px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .app-shell {
    display: flex;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }

  .topbar {
    display: flex;
  }

  .workspace {
    display: grid !important;
    grid-template-areas:
      "canvas"
      "layers"
      "inspector";
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    flex: 0 0 auto;
  }

  .preview-panel {
    width: 100%;
    height: min(66vh, 590px);
    height: min(66dvh, 590px);
    min-height: 360px;
    padding: 10px;
  }

  .layer-panel {
    min-height: 0;
    max-height: none;
    border-top: 1px solid #c9cfd1;
    border-right: 0;
  }

  .control-panel {
    min-height: 520px;
    overflow: visible;
    border-top: 1px solid #c9cfd1;
    border-left: 0;
  }

  .layer-list {
    min-height: 0;
    max-height: 216px;
    flex: 0 1 auto;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 45px;
    padding: 0 8px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .brand-mark img {
    width: 25px;
    height: 25px;
  }

  .brand strong {
    font-size: 11px;
  }

  .preview-panel {
    height: 400px;
    min-height: 400px;
    padding: 8px;
  }

  .preview-heading-copy,
  .mobile-preview-brand {
    display: none;
  }

  .canvas-stage {
    padding: 6px;
  }

  .canvas-object-tools .drag-target-switch button {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .layer-panel {
    max-height: 360px;
  }

  .control-panel {
    padding: 14px 12px 22px;
  }

  .inspector-heading {
    top: 0;
    margin: -14px -12px 16px;
  }

  .site-footer {
    min-height: 56px;
  }
}

/* Task-focused editor navigation */
.workspace {
  grid-template-areas:
    "layers canvas section-nav"
    "layers canvas inspector";
  grid-template-rows: auto minmax(0, 1fr);
}

.editor-section-nav {
  display: grid;
  grid-area: section-nav;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  padding: 8px 9px;
  border-bottom: 1px solid #d4dadc;
  border-left: 1px solid #c9cfd1;
  background: #f4f6f5;
}

.editor-section-nav button {
  display: flex;
  min-width: 0;
  min-height: 40px;
  padding: 4px 2px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #6d7a80;
  background: transparent;
  font: inherit;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.editor-section-nav button > span {
  display: grid;
  width: 20px;
  height: 17px;
  place-items: center;
  color: #7f9199;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.editor-section-nav button > strong {
  overflow: hidden;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-section-nav button:hover {
  color: var(--blue);
  border-color: #c8dce7;
  background: #fff;
}

.editor-section-nav button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 4px 10px rgba(9, 98, 181, 0.17);
}

.editor-section-nav button.active > span {
  color: var(--yellow);
}

.editor-section-nav .mobile-layer-tab {
  display: none;
}

.control-panel {
  min-height: 0;
}

.control-panel > [data-editor-panel]:not([hidden]) {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

[data-editor-panel][hidden] {
  display: none !important;
}

.export-control-section .export-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 13px;
  padding: 15px;
  border-radius: 12px;
}

.export-control-section .export-copy {
  min-width: 0;
  margin: 0;
}

.export-control-section .scale-select {
  width: 100%;
  min-width: 0;
}

.export-control-section .download-button {
  width: 100%;
  justify-content: center;
}

@media (max-width: 900px) {
  html,
  body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .workspace {
    grid-template-areas:
      "canvas"
      "section-nav"
      "inspector";
    grid-template-columns: minmax(0, 1fr);
    /* Petal and older Chromium builds may reject dynamic viewport units. */
    grid-template-rows: 360px auto minmax(0, 1fr);
    grid-template-rows: clamp(290px, 43vh, 400px) auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
    flex: 1 1 auto;
  }

  @supports (height: 100dvh) {
    .workspace {
      grid-template-rows: clamp(290px, 43dvh, 400px) auto minmax(0, 1fr);
    }
  }

  .preview-panel {
    grid-area: canvas;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .preview-caption {
    display: none;
  }

  .editor-section-nav {
    grid-area: section-nav;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px;
    padding: 6px 8px;
    border-top: 1px solid #bcc5c8;
    border-bottom: 1px solid #cbd2d4;
    border-left: 0;
    background: #eef1f1;
  }

  .editor-section-nav .mobile-layer-tab {
    display: flex;
  }

  .editor-section-nav button {
    min-height: 43px;
  }

  .control-panel,
  .layer-panel {
    grid-area: inspector;
    min-height: 0;
    max-height: none;
    border-top: 0;
    border-right: 0;
    border-left: 0;
  }

  .control-panel {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .layer-panel {
    display: none;
    overflow: hidden;
  }

  .workspace[data-editor-section="layers"] .control-panel {
    display: none;
  }

  .workspace[data-editor-section="layers"] .layer-panel {
    display: flex;
  }

  .layer-list {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
  }

  .site-footer {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .workspace {
    grid-template-rows: 320px auto minmax(0, 1fr);
    grid-template-rows: clamp(270px, 40vh, 340px) auto minmax(0, 1fr);
  }

  @supports (height: 100dvh) {
    .workspace {
      grid-template-rows: clamp(270px, 40dvh, 340px) auto minmax(0, 1fr);
    }
  }

  .preview-panel {
    height: auto;
    min-height: 0;
  }

  .editor-section-nav {
    padding: 5px 6px;
  }

  .editor-section-nav button {
    min-height: 42px;
    border-radius: 7px;
  }

  .editor-section-nav button > strong {
    font-size: 8px;
  }

  .control-panel {
    min-height: 0;
    padding: 12px 12px 18px;
  }

  .inspector-heading {
    top: -12px;
    margin: -12px -12px 13px;
    padding: 9px 12px 8px;
  }

  .layer-panel {
    min-height: 0;
    max-height: none;
    padding: 12px;
  }

  .export-control-section .export-bar {
    padding: 12px;
  }
}

.canvas-compatibility-notice {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  width: min(320px, calc(100% - 32px));
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(174, 83, 67, 0.3);
  border-radius: 12px;
  color: #713d34;
  background: rgba(255, 249, 247, 0.96);
  box-shadow: 0 8px 24px rgba(63, 39, 34, 0.16);
  transform: translate(-50%, -50%);
  text-align: center;
}

.canvas-stage {
  position: relative;
}

.canvas-compatibility-notice strong,
.canvas-compatibility-notice span {
  display: block;
}

.canvas-compatibility-notice strong {
  font-size: 12px;
}

.canvas-compatibility-notice span {
  margin-top: 5px;
  font-size: 9px;
  line-height: 1.5;
}

.canvas-stage.canvas-load-failed .canvas-frame {
  opacity: 0.18;
}

/* Independent text layers and inline color editor */
.layer-item {
  grid-template-columns: 14px 26px minmax(0, 1fr) 24px 24px;
}

.layer-entry-actions {
  display: flex;
  grid-column: 2 / -1;
  gap: 4px;
  min-width: 0;
  justify-content: flex-end;
}

.layer-entry-actions button {
  min-width: 27px;
  height: 23px;
  padding: 0 7px;
  border: 1px solid #d8dfe0;
  border-radius: 6px;
  color: #64737a;
  background: #fff;
  font: inherit;
  font-size: 7px;
  font-weight: 800;
}

.layer-entry-actions button:hover:not(:disabled) {
  color: var(--blue);
  border-color: #a8cee2;
}

.layer-entry-actions button.danger:hover:not(:disabled) {
  color: #be493b;
  border-color: #e6b1aa;
}

.layer-entry-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.color-target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.color-target-button {
  display: flex;
  min-width: 0;
  min-height: 45px;
  padding: 7px 9px;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce2e2;
  border-radius: 10px;
  color: #536169;
  background: #fff;
  text-align: left;
  transition: 140ms ease;
}

.color-target-button:hover {
  border-color: #b9d6e5;
}

.color-target-button.active {
  border-color: #68add3;
  background: #edf8fe;
  box-shadow: 0 0 0 1px rgba(9, 98, 181, 0.08);
}

.color-target-swatch {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(47, 61, 68, 0.17), 0 2px 5px rgba(31, 44, 50, 0.1);
}

.color-target-button > span {
  min-width: 0;
}

.color-target-button strong,
.color-target-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-target-button strong {
  font-size: 9px;
}

.color-target-button small {
  margin-top: 2px;
  color: #88949a;
  font-size: 7px;
  font-variant-numeric: tabular-nums;
}

.inline-color-editor {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dce3e3;
  border-radius: 12px;
  background: #f7f9f8;
}

.shadow-inline-color-editor {
  margin: 0 0 14px;
  padding: 11px;
  border-color: #ded7d1;
  background: #fffaf6;
}

.color-editor-topline {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
}

.color-editor-topline small,
.color-editor-topline strong {
  display: block;
}

.color-editor-topline small {
  color: #8a969b;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.color-editor-topline strong {
  margin-top: 2px;
  color: #33434a;
  font-size: 11px;
}

.color-editor-preview {
  width: 35px;
  height: 35px;
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(44, 59, 66, 0.16), 0 3px 8px rgba(29, 44, 50, 0.11);
}

.color-hex-field {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  margin-bottom: 13px;
  border: 1px solid #d7dede;
  border-radius: 9px;
  background: #fff;
}

.color-hex-field > span {
  color: #7a878d;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
}

.color-hex-field input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid #e0e5e5;
  border-radius: 0 8px 8px 0;
  color: #26343a;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.color-hex-field input:focus {
  outline: 2px solid rgba(9, 98, 181, 0.18);
  outline-offset: -2px;
}

.color-editor-range {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.color-editor-range > span {
  display: flex;
  justify-content: space-between;
  color: #65747b;
  font-size: 8px;
  font-weight: 800;
}

.color-editor-range output {
  min-width: 38px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.color-editor-range input[type="range"] {
  height: 9px;
  margin: 4px 0;
  border: 1px solid rgba(42, 55, 61, 0.12);
}

.color-editor-range input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(35, 48, 54, 0.34), 0 2px 5px rgba(29, 41, 47, 0.18);
}

.color-editor-range input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(35, 48, 54, 0.34), 0 2px 5px rgba(29, 41, 47, 0.18);
}

.hue-range input[type="range"] {
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.quick-color-block,
.palette-preset-block {
  margin-top: 13px;
}

.quick-color-block > span,
.palette-preset-block > span {
  display: block;
  margin-bottom: 7px;
  color: #69777e;
  font-size: 8px;
  font-weight: 800;
}

.quick-color-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
}

.quick-color-row button {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(46, 59, 65, 0.14);
}

.quick-color-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(9, 98, 181, 0.28);
}

.palette-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.palette-preset-grid > button {
  display: flex;
  min-width: 0;
  min-height: 34px;
  padding: 5px 7px;
  align-items: center;
  gap: 7px;
  border: 1px solid #dbe1e1;
  border-radius: 8px;
  color: #5b6970;
  background: #fff;
  font-size: 7px;
  font-weight: 800;
}

.palette-preset-grid > button:hover {
  color: var(--blue);
  border-color: #abd0e3;
}

.palette-preset-grid i {
  display: flex;
  width: 33px;
  height: 19px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(47, 59, 65, 0.13);
  border-radius: 5px;
}

.palette-preset-grid b {
  flex: 1;
}

.canvas-text-layer-switches {
  display: flex;
  min-width: 0;
  margin: -2px 0 9px;
  padding: 4px;
  align-items: center;
  gap: 4px;
  border: 1px solid #c4cbcd;
  border-radius: 9px;
  background: rgba(244, 246, 246, 0.88);
}

.canvas-text-layer-switches > span {
  padding: 0 6px;
  color: #69777d;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.canvas-text-layer-switches button {
  display: flex;
  min-width: 0;
  min-height: 28px;
  padding: 3px 7px;
  align-items: center;
  gap: 5px;
  border: 1px solid #d4dadb;
  border-radius: 7px;
  color: #78858b;
  background: #fff;
  font: inherit;
  font-size: 8px;
  font-weight: 800;
}

.canvas-text-layer-switches button i {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  place-items: center;
  border-radius: 5px;
  color: #728087;
  background: #eef1f1;
  font-size: 7px;
  font-style: normal;
}

.canvas-text-layer-switches button b {
  color: #a0aaae;
  font-size: 6px;
}

.canvas-text-layer-switches button.active {
  color: #174f73;
  border-color: #83bcd9;
  background: #edf8fe;
}

.canvas-text-layer-switches button.active i {
  color: #fff;
  background: var(--blue);
}

.canvas-text-layer-switches button.active b {
  color: #3c8cb8;
}

.canvas-object-tools > strong {
  max-width: 120px;
  overflow: hidden;
  color: #34464f;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-selection-delete {
  position: absolute;
  z-index: 3;
  top: 6px;
  left: 6px;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #d85549;
  box-shadow: 0 3px 10px rgba(100, 35, 29, 0.28);
  pointer-events: auto;
  touch-action: manipulation;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.canvas-selection-delete:hover {
  background: #bd4036;
}

.background-material-control {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 11px;
  border: 1px solid #dce2e2;
  border-radius: 11px;
  background: #f7f9f8;
}

.background-material-control > span {
  color: #59686f;
  font-size: 9px;
  font-weight: 800;
}

.background-material-control .background-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  background: #e9eeee;
}

.background-material-control .background-button {
  justify-content: center;
}

@media (max-width: 900px) {
  .preview-toolbar,
  .canvas-object-tools {
    display: none;
  }

  .canvas-text-layer-switches {
    flex: 0 0 auto;
    margin: 0 0 6px;
  }

  /* Initial size for engines without CSS aspect-ratio; JS refines it later. */
  .canvas-frame {
    height: 46.4375vw;
    max-height: 100%;
  }

  .canvas-text-layer-switches > span {
    display: none;
  }

  .canvas-text-layer-switches button {
    flex: 1 1 0;
    justify-content: center;
  }

  .site-footer {
    display: none;
  }

  body[data-active-editor-section="export"] .site-footer {
    display: flex;
  }
}

@media (max-width: 560px) {
  .canvas-text-layer-switches button {
    padding-right: 4px;
    padding-left: 4px;
    gap: 4px;
  }

  .canvas-text-layer-switches button b {
    display: none;
  }

  .layer-item {
    min-height: 61px;
  }

  .layer-entry-actions button {
    height: 27px;
    font-size: 8px;
  }

  .color-target-button small {
    display: none;
  }

  .quick-color-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .quick-color-row button {
    aspect-ratio: 1.6;
  }
}

/* Final layer sizing overrides: keep controls readable after legacy layout rules. */
.layer-item {
  grid-template-columns: 18px 38px minmax(0, 1fr) 32px 32px;
  gap: 7px;
  min-height: 66px;
  padding: 8px 7px;
  border-radius: 11px;
}

.layer-drag-handle {
  font-size: 16px;
}

.layer-thumbnail {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 15px;
}

.layer-copy strong {
  font-size: 11px;
}

.layer-copy small {
  margin-top: 3px;
  font-size: 8px;
}

.layer-inline-button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.layer-entry-actions {
  grid-column: 2 / -1;
  gap: 6px;
}

.layer-entry-actions button {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 30px;
  padding: 0;
  place-items: center;
  border-radius: 8px;
}

.layer-inline-button svg,
.layer-entry-actions svg {
  width: 19px;
  height: 19px;
}

.layer-entry-actions button.danger {
  color: #b74a40;
  border-color: #e8c3be;
  background: #fff9f8;
}

@media (min-width: 1181px) {
  .workspace {
    grid-template-columns: 276px minmax(360px, 1fr) 360px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .workspace {
    grid-template-columns: 238px minmax(330px, 1fr) 330px;
  }
}

@media (max-width: 560px) {
  .layer-item {
    grid-template-columns: 16px 40px minmax(0, 1fr) 34px 34px;
    min-height: 69px;
  }

  .layer-thumbnail {
    width: 40px;
    height: 40px;
  }

  .layer-inline-button {
    width: 34px;
    height: 34px;
  }

  .layer-entry-actions button {
    width: 34px;
    min-width: 34px;
    height: 32px;
  }
}

/* Mobile history lives on the canvas instead of taking an inspector row. */
@media (max-width: 900px) {
  .history-toolbar {
    display: none;
  }

  .preview-panel {
    position: relative;
  }

  .mobile-history-toolbar {
    position: absolute;
    z-index: 14;
    top: 17px;
    right: 17px;
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(91, 107, 114, 0.28);
    border-radius: 11px;
    background: rgba(250, 252, 252, 0.9);
    box-shadow: 0 4px 14px rgba(31, 43, 49, 0.16);
    backdrop-filter: blur(8px);
    transition: opacity 150ms ease, transform 150ms ease;
  }

  .mobile-history-toolbar.is-empty {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
  }

  .mobile-history-toolbar button {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #34464f;
    background: transparent;
  }

  .mobile-history-toolbar button:active:not(:disabled) {
    color: var(--blue);
    background: #e4f3fb;
  }

  .mobile-history-toolbar button:disabled {
    cursor: not-allowed;
    opacity: 0.34;
  }
}

@media (max-width: 560px) {
  .mobile-history-toolbar {
    top: 13px;
    right: 13px;
  }
}

/* Orange-summer welcome card */
.welcome-dialog {
  position: fixed;
  z-index: 1300;
  inset: 0;
  display: grid;
  min-width: 320px;
  padding: clamp(18px, 4vw, 44px);
  place-items: center;
  overflow: auto;
  isolation: isolate;
  animation: welcome-dialog-enter 360ms ease-out both;
}

.welcome-dialog[hidden] {
  display: none;
}

.welcome-dialog.is-leaving {
  pointer-events: none;
  animation: welcome-dialog-leave 240ms ease-in both;
}

.welcome-dialog-backdrop {
  position: fixed;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(118deg, rgba(205, 69, 24, 0.78), rgba(238, 126, 44, 0.58) 44%, rgba(20, 143, 186, 0.76)),
    url("./assets/arknights-summer-page-bg.webp") center 5% / cover no-repeat;
  filter: saturate(1.08);
  transform: scale(1.025);
}

.welcome-dialog-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 17% 15%, rgba(255, 220, 83, 0.88) 0 4px, transparent 5px),
    radial-gradient(circle at 83% 20%, rgba(255, 255, 255, 0.78) 0 3px, transparent 4px),
    radial-gradient(circle at 9% 78%, rgba(255, 255, 255, 0.68) 0 2px, transparent 3px),
    linear-gradient(rgba(15, 36, 45, 0.08), rgba(15, 36, 45, 0.24));
  background-size: auto, auto, auto, auto;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.welcome-card {
  position: relative;
  width: min(650px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  padding: clamp(27px, 4.4vw, 43px);
  overflow-x: hidden;
  overflow-y: auto;
  isolation: isolate;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 31px 25px 34px 27px;
  color: #263a42;
  background:
    radial-gradient(circle at 88% 15%, rgba(68, 165, 219, 0.13) 0 2px, transparent 2.5px) 0 0 / 14px 14px,
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 237, 0.98));
  box-shadow:
    -12px 11px 0 rgba(49, 169, 207, 0.94),
    13px -10px 0 rgba(242, 145, 55, 0.94),
    0 32px 90px rgba(23, 49, 59, 0.34);
  scrollbar-width: thin;
  scrollbar-color: rgba(32, 146, 185, 0.45) transparent;
  animation: welcome-card-enter 520ms cubic-bezier(0.2, 0.85, 0.25, 1.12) both;
}

.welcome-dialog.is-leaving .welcome-card {
  animation: welcome-card-leave 220ms ease-in both;
}

.welcome-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -76px;
  right: -62px;
  width: 206px;
  height: 206px;
  border: 30px solid rgba(244, 150, 54, 0.1);
  border-radius: 50%;
}

.welcome-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 28px;
  bottom: 27px;
  width: 118px;
  height: 15px;
  border-top: 3px solid rgba(43, 157, 201, 0.2);
  border-bottom: 3px solid rgba(43, 157, 201, 0.2);
  border-radius: 50%;
  transform: rotate(-5deg);
}

.welcome-card-decor {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.welcome-card-decor-star {
  top: 92px;
  right: 23px;
  color: #f4bd31;
  font-size: 29px;
  text-shadow: 17px 14px 0 rgba(49, 169, 207, 0.6);
  transform: rotate(11deg);
}

.welcome-card-decor-flower {
  right: 66px;
  bottom: 143px;
  color: rgba(242, 128, 46, 0.52);
  font-size: 23px;
  transform: rotate(-12deg);
}

.welcome-card-decor-loop {
  left: -22px;
  bottom: 93px;
  width: 54px;
  height: 30px;
  border: 3px solid rgba(46, 157, 201, 0.42);
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(24deg);
}

.welcome-card-topline {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.welcome-edition {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.welcome-edition > img {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  filter: drop-shadow(0 5px 8px rgba(156, 81, 24, 0.14));
  transform: rotate(-8deg);
}

.welcome-edition > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.welcome-edition b {
  color: #287fa3;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.welcome-edition small {
  color: #7a878b;
  font-size: 10px;
  font-weight: 700;
}

.welcome-free-badge {
  display: inline-flex;
  min-height: 34px;
  padding: 7px 12px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 2px solid #1d88b2;
  border-radius: 9px 13px 8px 12px;
  color: #176e91;
  background: #e9f8fd;
  box-shadow: 3px 3px 0 rgba(43, 157, 201, 0.19);
  font-size: 11px;
  transform: rotate(2deg);
}

.welcome-free-badge span {
  padding-right: 7px;
  border-right: 1px dashed rgba(29, 136, 178, 0.46);
  color: #e36f2d;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.welcome-card h1 {
  max-width: 540px;
  margin: 25px 0 12px;
  color: #273a42;
  font-family: "Arial Rounded MT Bold", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: clamp(34px, 5.2vw, 53px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.welcome-card h1 > span {
  display: block;
  color: #e66326;
  letter-spacing: -0.035em;
  text-shadow: 2px 3px 0 rgba(248, 197, 77, 0.36);
}

.welcome-intro {
  max-width: 520px;
  margin: 0 0 23px;
  color: #62747b;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.75;
}

.welcome-author-row {
  display: flex;
  min-width: 0;
  padding: 14px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #c8e1eb;
  border-radius: 17px 14px 18px 13px;
  background: rgba(239, 249, 252, 0.88);
}

.welcome-author {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.welcome-author-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50% 44% 48% 42%;
  color: #fff;
  background: linear-gradient(145deg, #f49a39, #de5926);
  box-shadow: 3px 4px 0 #f6cc50;
  font-size: 17px;
  font-weight: 900;
  transform: rotate(-5deg);
}

.welcome-author > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.welcome-author small {
  color: #72878f;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.welcome-author strong {
  overflow: hidden;
  color: #29414b;
  font-size: 15px;
  text-overflow: ellipsis;
}

.welcome-socials {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.welcome-socials a {
  display: inline-flex;
  min-height: 39px;
  padding: 0 11px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #b7d5e1;
  border-radius: 11px;
  color: #276f8d;
  background: #fff;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
  transition: 150ms ease;
}

.welcome-socials a:hover {
  border-color: #e8843e;
  color: #d86127;
  box-shadow: 0 6px 15px rgba(43, 104, 128, 0.11);
  transform: translateY(-2px) rotate(-1deg);
}

.welcome-socials svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-disclaimer {
  margin: 16px 2px 17px;
  color: #718087;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.65;
}

.welcome-disclaimer strong {
  margin-right: 6px;
  color: #46616c;
  font-weight: 900;
}

.welcome-browser-tip {
  display: flex;
  margin: -5px 2px 16px;
  align-items: flex-start;
  gap: 7px;
  color: #327b98;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.55;
}

.welcome-browser-tip > span {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: -1px;
  place-items: center;
  border: 1px solid rgba(50, 123, 152, 0.48);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 9px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.welcome-start-button {
  display: flex;
  width: 100%;
  min-height: 67px;
  padding: 11px 13px 11px 21px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 18px 15px 20px 14px;
  color: #fff;
  background: linear-gradient(110deg, #e55e27, #f08d35 68%, #f1a03d);
  box-shadow: 0 12px 25px rgba(207, 84, 29, 0.27), 5px 5px 0 #f4c84e;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.welcome-start-button > span {
  display: grid;
  gap: 2px;
}

.welcome-start-button strong {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.welcome-start-button small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.welcome-start-button > b {
  display: grid;
  width: 41px;
  height: 41px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #176f94;
  background: #fff;
  box-shadow: 0 4px 12px rgba(123, 50, 20, 0.18);
  font-size: 21px;
  transition: transform 160ms ease;
}

.welcome-start-button:hover {
  filter: saturate(1.08);
  box-shadow: 0 14px 28px rgba(207, 84, 29, 0.31), 6px 6px 0 #3aa5cc;
  transform: translateY(-2px);
}

.welcome-start-button:hover > b {
  transform: translateX(3px) rotate(-5deg);
}

.welcome-start-button:active {
  transform: translateY(1px) scale(0.995);
}

@keyframes welcome-dialog-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes welcome-card-enter {
  from {
    opacity: 0;
    transform: translateY(26px) rotate(-1.5deg) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes welcome-dialog-leave {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes welcome-card-leave {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(14px) rotate(1deg) scale(0.98);
  }
}

@media (max-width: 640px) {
  .welcome-dialog {
    padding: 14px;
  }

  .welcome-dialog-backdrop {
    background-position: 47% top;
  }

  .welcome-card {
    width: min(100%, 520px);
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    padding: 23px 19px 19px;
    border-radius: 25px 21px 27px 22px;
    box-shadow:
      -6px 7px 0 rgba(49, 169, 207, 0.94),
      7px -6px 0 rgba(242, 145, 55, 0.94),
      0 25px 65px rgba(23, 49, 59, 0.36);
  }

  .welcome-edition > img {
    width: 42px;
    height: 42px;
  }

  .welcome-edition b {
    font-size: 8px;
  }

  .welcome-edition small {
    font-size: 9px;
  }

  .welcome-free-badge {
    min-height: 31px;
    padding: 6px 9px;
    gap: 5px;
    font-size: 10px;
  }

  .welcome-free-badge span {
    padding-right: 5px;
    font-size: 7px;
  }

  .welcome-card h1 {
    margin: 20px 0 9px;
    font-size: clamp(30px, 9.2vw, 42px);
    line-height: 1.13;
  }

  .welcome-intro {
    margin-bottom: 17px;
    font-size: 11px;
    line-height: 1.65;
  }

  .welcome-author-row {
    padding: 11px;
    gap: 10px;
  }

  .welcome-author-mark {
    width: 36px;
    height: 36px;
  }

  .welcome-socials a {
    width: 39px;
    min-width: 39px;
    min-height: 39px;
    padding: 0;
  }

  .welcome-socials a > span {
    display: none;
  }

  .welcome-disclaimer {
    margin: 13px 1px 11px;
    font-size: 9px;
    line-height: 1.6;
  }

  .welcome-browser-tip {
    margin: -2px 1px 13px;
    gap: 6px;
    font-size: 8px;
    line-height: 1.5;
  }

  .welcome-start-button {
    min-height: 61px;
    padding-left: 17px;
  }

  .welcome-start-button strong {
    font-size: 15px;
  }

  .welcome-card-decor-star {
    top: 83px;
    right: 13px;
    font-size: 22px;
  }

  .welcome-card-decor-flower {
    right: 52px;
    bottom: 127px;
  }
}

@media (max-width: 380px) {
  .welcome-card {
    padding-right: 16px;
    padding-left: 16px;
  }

  .welcome-edition small,
  .welcome-start-button small {
    display: none;
  }

  .welcome-free-badge span {
    display: none;
  }

  .welcome-author small {
    font-size: 7px;
    letter-spacing: 0.07em;
  }

  .welcome-author strong {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-dialog,
  .welcome-card,
  .welcome-dialog.is-leaving,
  .welcome-dialog.is-leaving .welcome-card {
    animation-duration: 1ms;
  }

  .welcome-start-button,
  .welcome-start-button > b,
  .welcome-socials a {
    transition: none;
  }
}
