﻿:root {
  --bg: #f5f7fb;
  --text: #0f172a;
  --muted: #64748b;
  --surface: rgba(255, 255, 255, 0.86);
  --stroke: #d9e2ef;
  --primary: #0b8f7a;
  --primary-rgb: 11, 143, 122;
  --primary-strong: #087f6d;
  --primary-soft: #0aa386;
  --primary-surface: #eaf7f4;
  --danger: #d7364f;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  --bg-layer-1: radial-gradient(1200px 600px at -10% -10%, #c9ece9, transparent);
  --bg-layer-2: radial-gradient(900px 600px at 120% 10%, #f8e1cf, transparent);
  --bg-layer-3: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(245, 247, 251, .08));
  background: var(--bg-layer-1), var(--bg-layer-2), var(--bg-layer-3), var(--bg);
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text);
  min-height: 100vh;
}

body.bg-variant-a {
  --bg-layer-1: radial-gradient(1100px 580px at -12% -8%, #c8e7ff, transparent);
  --bg-layer-2: radial-gradient(980px 620px at 118% 8%, #ffe7c8, transparent);
  --bg-layer-3: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(236, 244, 255, .12));
}

body.bg-variant-b {
  --bg-layer-1: radial-gradient(1200px 680px at -8% -14%, #d6f4e3, transparent);
  --bg-layer-2: radial-gradient(920px 560px at 112% 14%, #fbd9e5, transparent);
  --bg-layer-3: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(240, 248, 245, .10));
}

body.bg-variant-c {
  --bg-layer-1: radial-gradient(1250px 620px at -18% -6%, #d9dcff, transparent);
  --bg-layer-2: radial-gradient(980px 640px at 124% 12%, #ffe6d4, transparent);
  --bg-layer-3: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(242, 244, 255, .10));
}

body.bg-variant-d {
  --bg-layer-1: radial-gradient(1120px 620px at -10% -10%, #d8f0f1, transparent);
  --bg-layer-2: radial-gradient(960px 620px at 116% 10%, #ffe7d9, transparent);
  --bg-layer-3: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(238, 245, 251, .12));
}

body.bg-variant-e {
  --bg-layer-1: radial-gradient(1180px 620px at -12% -8%, #e2f0ff, transparent);
  --bg-layer-2: radial-gradient(930px 590px at 120% 8%, #ffeccf, transparent);
  --bg-layer-3: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(245, 247, 255, .10));
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(80px);
  opacity: .4;
}

.orb-a {
  width: 220px;
  height: 220px;
  background: #62d0c0;
  top: -40px;
  left: -60px;
}

.orb-b {
  width: 280px;
  height: 280px;
  background: #f1b07d;
  right: -110px;
  top: 18vh;
}

.app {
  padding: 14px 14px 112px;
  max-width: 680px;
  margin: 0 auto;
}

.workspace {
  display: grid;
  gap: 12px;
}

.editor-col {
  min-width: 0;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #d7e5f2;
  border-radius: 20px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.92), rgba(248, 252, 255, 0.8)),
    linear-gradient(90deg, rgba(11, 143, 122, 0.1), rgba(241, 176, 125, 0.12));
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
  overflow: visible;
}

.topbar::after {
  content: "";
  position: absolute;
  top: -32px;
  right: -42px;
  width: 170px;
  height: 110px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(11, 143, 122, 0.2), rgba(11, 143, 122, 0));
  pointer-events: none;
}

.brand-shell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark-wrap {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid #cfe3f1;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffffff, #ecf5fe);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 7px 14px rgba(15, 23, 42, .08);
  flex: 0 0 auto;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.brand-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.brand-kicker {
  margin: 0 0 2px;
  font-family: Outfit, sans-serif;
  font-size: .68rem;
  letter-spacing: .16em;
  color: #2563eb;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 188px;
  padding: 8px;
  border: 1px solid #c9dbeb;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f2f7fe);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .14);
  display: grid;
  gap: 6px;
}

.settings-menu[hidden] {
  display: none;
}

.settings-menu-user {
  margin: 0;
  padding: 6px 8px;
  color: #334155;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.35;
}

.settings-menu-item {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #d4dfeb;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: .86rem;
  text-align: left;
}

.settings-menu-item:hover {
  background: #edf4fd;
}

.brand-copy h1 {
  margin: 0;
  font-family: Outfit, sans-serif;
  font-size: 1.36rem;
  letter-spacing: .3px;
  line-height: 1.12;
}

h2 {
  margin: 0;
  font-family: Outfit, sans-serif;
  font-size: 1.04rem;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.brand-meta {
  margin-top: 3px;
  color: #516780;
  font-size: .82rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, .06);
  animation: rise .35s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.template-manager-head {
  margin-bottom: 4px;
}

.template-manager-card {
  position: relative;
  z-index: 120;
}

.template-toggle-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.template-manager-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .76rem;
  color: #46586d;
  border-color: rgba(148, 163, 184, .45);
}

.template-manager-body {
  overflow: visible;
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  align-items: end;
}

#templateManagerBody.template-manager-body {
  position: relative;
  z-index: 40;
  margin-bottom: 0;
}

.template-manager-body label {
  margin-bottom: 0;
  display: grid;
  gap: 6px;
  position: relative;
}

.template-manager-body .tm-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  inset: auto;
}

.template-manager-body .tm-select {
  position: relative;
  z-index: 10;
}

.template-manager-body .tm-select-trigger {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 52px;
  padding: 12px 46px 12px 14px;
  border-radius: 18px;
  border: 1px solid transparent;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23566f8c' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m3.25 5.75 4.75 4.5 4.75-4.5'/%3E%3C/svg%3E") no-repeat right 16px center / 14px 14px,
    linear-gradient(180deg, #ffffff, #f7fbff) padding-box,
    linear-gradient(132deg, rgba(11, 143, 122, .36), rgba(59, 130, 246, .2)) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .96), 0 8px 18px rgba(15, 23, 42, .08);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
  font-weight: 500;
  color: #10233a;
  text-align: left;
  cursor: pointer;
}

.template-manager-body .tm-select-trigger:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 10px 22px rgba(15, 23, 42, .11);
}

.template-manager-body .tm-select.is-open .tm-select-trigger,
.template-manager-body .tm-select-trigger:focus,
.template-manager-body .tm-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(11, 143, 122, .62);
  box-shadow: 0 0 0 3px rgba(11, 143, 122, .14), 0 12px 24px rgba(15, 23, 42, .13);
}

.template-manager-body .tm-select-panel {
  position: absolute;
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 400;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #cfdeee;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(245, 250, 255, .96));
  box-shadow: 0 16px 32px rgba(15, 23, 42, .16);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(6px) scale(.985);
  transform-origin: bottom center;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

.template-manager-body .tm-select.is-open .tm-select-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear 0s;
}

.template-manager-body .tm-select-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.template-manager-body .tm-select-option {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 8px 10px;
  background: transparent;
  color: #10233a;
  text-align: left;
  font-size: .96rem;
  font-weight: 500;
  cursor: pointer;
}

.template-manager-body .tm-select-option:hover {
  background: rgba(var(--primary-rgb), .10);
  border-color: rgba(var(--primary-rgb), .22);
}

.template-manager-body .tm-select-option.is-selected {
  background: linear-gradient(90deg, rgba(var(--primary-rgb), .95), rgba(var(--primary-rgb), .78));
  color: #fff;
  border-color: rgba(var(--primary-rgb), .55);
}

.template-manager-body .tm-select-option:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.template-manager-card.is-ready .template-manager-body {
  transition: max-height .28s ease, opacity .2s ease, transform .2s ease, margin .2s ease, padding .2s ease, visibility 0s linear 0s;
}

.template-manager-card .row.template-manager-body {
  margin-top: 12px;
  position: relative;
  z-index: 5;
}

.template-manager-card.is-collapsed .template-manager-body {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  transition: max-height .26s ease, opacity .16s ease, transform .16s ease, margin .16s ease, padding .16s ease, visibility 0s linear .26s;
}

html[data-tm-collapsed="1"] .template-manager-card:not(.is-ready) .template-manager-body {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.template-manager-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: min(240px, calc(100vw - 44px));
  margin: 0;
  z-index: 24;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease;
}

.template-manager-tip.is-fading {
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
}

.template-manager-tip::before {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 18px;
  width: 11px;
  height: 11px;
  border-right: 1px solid rgba(148, 163, 184, .38);
  border-bottom: 1px solid rgba(148, 163, 184, .38);
  background: rgba(255, 255, 255, .78);
  transform: rotate(45deg);
}

.template-manager-tip p {
  margin: 0;
  color: inherit;
  font-size: .8rem;
  line-height: 1.45;
}

#statusText {
  font-size: .8rem;
  color: var(--muted);
}

.preview-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.preview-focus-btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .76rem;
  color: #46586d;
  background: rgba(255, 255, 255, .72);
  border-color: rgba(148, 163, 184, .4);
}

.preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #f1f5f9;
  overflow: hidden;
  touch-action: manipulation;
}

.preview-focus-toast {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}

.preview-focus-toast.is-visible {
  opacity: 1;
  animation: preview-focus-toast-fade .82s ease both;
}

@keyframes preview-focus-toast-fade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }

  14% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  72% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-2px);
  }
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  overflow: hidden;
}

.skeleton-poster {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 85%;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: blur(10px);
  animation: skeleton-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}

.skeleton-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.15);
  margin-bottom: 30px;
}

.skeleton-title {
  width: 60%;
  height: 28px;
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 6px;
  margin-bottom: 20px;
}

.skeleton-date {
  width: 35%;
  height: 14px;
  background: #f1f5f9;
  border-radius: 4px;
  margin-bottom: 30px;
}

.skeleton-line {
  width: 90%;
  height: 2px;
  background: #f1f5f9;
  margin-bottom: 40px;
}

.skeleton-row {
  width: 85%;
  height: 40px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 12px;
}

.skeleton-footer {
  margin-top: auto;
  width: 80%;
  height: 60px;
  background: #f1f5f9;
  border-radius: 8px;
  opacity: 0.6;
}

.preview-loading-text {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px #fff;
}

@keyframes skeleton-pulse {

  0%,
  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.98);
  }

  50% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1.0);
  }
}

#previewImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .2s ease;
}

.preview-stage.is-loaded #previewImage {
  opacity: 1;
}

.preview-stage.is-loaded .preview-placeholder {
  display: none;
}

label {
  display: block;
  font-size: .87rem;
  margin-bottom: 8px;
  color: #1e293b;
}

input,
textarea,
select,
button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
}

input,
textarea,
select {
  transition: border-color .18s ease, box-shadow .22s ease, background-color .18s ease;
}

input:not([type="range"]):not([type="checkbox"]):not([type="file"]):not([type="color"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), .32);
  box-shadow: inset 0 0 10px rgba(var(--primary-rgb), .09);
}

input:not([type="range"]):not([type="checkbox"]):not([type="file"]):not([type="color"]):focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: rgba(var(--primary-rgb), .38);
  box-shadow: inset 0 0 12px rgba(var(--primary-rgb), .11);
}

textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.6;
}

#priceEditorExtra {
  min-height: 98px;
}

input[type="range"] {
  padding: 0;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  padding: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.date-input-wrap {
  position: relative;
  display: block;
}

.date-input-wrap #dateInput {
  padding-right: 42px;
}

#dateInputPicker {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  border: none;
  padding: 0;
  min-height: 0;
}

.date-input-icon {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7d92;
  background: transparent;
  border: none;
  border-radius: 0 12px 12px 0;
  min-height: 0;
  padding: 0;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}

.date-input-icon:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), .06);
}

.date-input-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  pointer-events: none;
}

#dateInput.is-invalid {
  border-color: #f87171;
  outline: none;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, .22);
}

.theme-color-field {
  margin-bottom: 0;
}

.theme-color-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
}

#themeColor {
  width: 56px;
  height: 42px;
  border-radius: 10px;
  padding: 4px;
}

.theme-color-hex {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  color: #334155;
  font-family: Outfit, "Noto Sans SC", sans-serif;
  font-size: .86rem;
  letter-spacing: .02em;
}

.theme-palette {
  display: grid;
  grid-template-columns: repeat(7, 34px);
  gap: 8px;
  margin-top: 8px;
  justify-content: start;
}

.theme-swatch {
  width: 34px;
  min-height: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid #d6dee8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

.theme-swatch.is-active {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .14);
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.range-value {
  color: #475569;
  font-family: Outfit, "Noto Sans SC", sans-serif;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.stats {
  color: var(--muted);
  font-size: .82rem;
  text-align: right;
}

.switch-line {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  cursor: pointer;
  min-height: 44px;
  transition: transform .16s ease, background-color .16s ease;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: .65;
  transform: none;
}

.mini-btn {
  background: #eef6ff;
}

.mini-btn.danger {
  background: #ffecee;
  color: #8d1126;
}

.ghost-btn {
  width: auto;
  min-height: 40px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .85);
}

.icon-btn {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9dbeb;
  background: linear-gradient(180deg, #ffffff, #edf5fe);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .08);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: #334155;
}

.topbar .icon-btn {
  border: none;
  background: transparent;
  box-shadow: none;
}

.topbar .icon-btn svg {
  animation: settings-icon-pulse 1.9s cubic-bezier(.4, 0, .2, 1) infinite;
  fill: #6f8095;
  filter: drop-shadow(0 0 0 rgba(var(--primary-rgb), 0));
}

.icon-btn:hover {
  background: linear-gradient(180deg, #ffffff, #e6f1ff);
}

.topbar .icon-btn:hover {
  background: transparent;
}

.topbar .icon-btn:hover svg {
  fill: #5f738a;
}

@keyframes settings-icon-pulse {
  0% {
    opacity: .86;
    transform: translateY(0) scale(1);
    fill: #7c8da1;
    filter: drop-shadow(0 0 0 rgba(var(--primary-rgb), 0));
  }

  45% {
    opacity: 1;
    transform: translateY(-.25px) scale(1.03);
    fill: #5f738a;
    filter: drop-shadow(0 0 7px rgba(var(--primary-rgb), .42));
  }

  100% {
    opacity: .86;
    transform: translateY(0) scale(1);
    fill: #7c8da1;
    filter: drop-shadow(0 0 0 rgba(var(--primary-rgb), 0));
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar .icon-btn svg {
    animation: none;
    opacity: .95;
    transform: none;
    filter: none;
  }

  .card,
  .modal-panel,
  .toast,
  .toast.is-fading,
  .preview-focus-toast.is-visible,
  .fullscreen-exit-hint.is-visible,
  .skeleton-poster,
  .settings-pane,
  .template-manager-tip,
  .loading-runway-wrap *,
  .forklift-group {
    animation: none !important;
    transition: none !important;
  }

  .preview-focus-toast,
  .fullscreen-exit-hint {
    opacity: 1;
  }

  .settings-tabs {
    transition: none;
  }
}

.icon-btn:focus-visible,
.ghost-btn:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), .78);
  outline-offset: 2px;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  background: linear-gradient(180deg, #f9fbff 0%, #f3f7fe 100%);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--stroke);
  box-shadow: 0 -14px 40px rgba(15, 23, 42, .18);
  animation: sheet-up .22s ease-out both;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes sheet-up {
  from {
    transform: translateY(18px);
    opacity: .86;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-head {
  position: sticky;
  top: 0;
  background: rgba(249, 251, 255, .92);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--stroke);
}

.modal-body {
  overflow: auto;
  padding: 12px 12px 28px;
  scroll-padding-bottom: 28px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.settings-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 2px;
  background: rgba(249, 251, 255, .88);
  backdrop-filter: blur(6px);
  scrollbar-width: none;
  opacity: 1;
  transform: translateY(0);
  transition: transform .22s ease, opacity .18s ease;
}

.settings-tabs.is-auto-hidden {
  transform: translateY(calc(-100% - 8px));
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tab {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb), .26);
  background: rgba(var(--primary-rgb), .08);
  color: var(--primary-strong);
  font-size: .9rem;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.settings-tab.is-active {
  background: linear-gradient(90deg, var(--primary-strong), var(--primary-soft));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(var(--primary-rgb), .28);
}

.settings-pane {
  margin-bottom: 18px;
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .28s ease, transform .28s ease;
}

.settings-pane.is-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.settings-subhead {
  margin: 2px 0 8px;
  color: #5f7288;
  font-size: .84rem;
  font-weight: 600;
}

.settings-inline-hint {
  margin: 6px 0 0;
  color: #73879d;
  font-size: .76rem;
}

.card-style-gallery {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.card-style-option {
  border: 1px solid rgba(148, 163, 184, .42);
  background: #fff;
  border-radius: 12px;
  padding: 8px 8px 9px;
  min-height: 44px;
  display: grid;
  gap: 6px;
  justify-items: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}

.card-style-option:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--primary-rgb), .38);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .1);
}

.card-style-option:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), .38);
  outline-offset: 2px;
}

.card-style-option.is-active {
  border-color: rgba(var(--primary-rgb), .64);
  box-shadow: 0 10px 20px rgba(var(--primary-rgb), .22);
  background: linear-gradient(180deg, rgba(var(--primary-rgb), .08), rgba(var(--primary-rgb), .02));
}

.card-style-thumb {
  width: 62px;
  aspect-ratio: 9/16;
  border-radius: 8px;
  background: linear-gradient(180deg, #eef4fb, #e2eaf5);
  border: 1px solid #d6deea;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-style-poster {
  position: absolute;
  inset: 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(var(--primary-rgb), .18), rgba(255, 255, 255, .94) 36%);
  border: 1px solid rgba(var(--primary-rgb), .28);
  box-shadow: 0 3px 8px rgba(15, 23, 42, .16);
}

.card-mini-logo,
.card-mini-title,
.card-mini-date,
.card-mini-divider,
.card-mini-row,
.card-mini-footer,
.card-mini-stamp {
  position: absolute;
}

.card-mini-logo {
  top: 5px;
  left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), .34);
}

.card-mini-title {
  top: 6px;
  left: 20px;
  right: 6px;
  height: 5px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), .42);
}

.card-mini-date {
  top: 14px;
  left: 20px;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: rgba(100, 116, 139, .38);
}

.card-mini-divider {
  top: 20px;
  left: 6px;
  right: 6px;
  height: 1px;
  background: rgba(100, 116, 139, .24);
}

.card-mini-row {
  left: 8px;
  right: 10px;
  height: 3px;
  border-radius: 999px;
  background: rgba(71, 85, 105, .35);
}

.card-mini-row-a {
  top: 25px;
}

.card-mini-row-b {
  top: 31px;
}

.card-mini-row-c {
  top: 37px;
  right: 16px;
}

.card-mini-footer {
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 7px;
  border-radius: 3px;
  background: rgba(203, 213, 225, .55);
}

.card-mini-stamp {
  right: 5px;
  bottom: 16px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(220, 38, 38, .45);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .14);
}

.card-style-option--stack .card-style-poster {
  box-shadow: 0 3px 8px rgba(15, 23, 42, .16), 4px 4px 0 rgba(148, 163, 184, .34), 8px 8px 0 rgba(203, 213, 225, .5);
}

.card-style-option--block .card-style-poster {
  box-shadow: 0 5px 0 rgba(71, 85, 105, .35), 0 10px 18px rgba(15, 23, 42, .2);
}

.card-style-option--flip .card-style-poster::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 12px solid rgba(var(--primary-rgb), .2);
  border-left: 12px solid transparent;
}

.card-style-option--ticket .card-style-poster {
  border-style: dashed;
  border-width: 2px;
}

.card-style-option--double .card-style-poster {
  inset: 9px;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .26), 0 0 0 5px rgba(var(--primary-rgb), .12), 0 6px 12px rgba(15, 23, 42, .15);
}

.card-style-option--aurora .card-style-poster {
  background: linear-gradient(145deg, rgba(34, 197, 94, .24), rgba(59, 130, 246, .2), rgba(236, 72, 153, .18));
  backdrop-filter: blur(2px);
}

.card-style-option--aurora .card-mini-row {
  background: rgba(255, 255, 255, .55);
}

.card-style-option--paper_relief .card-style-poster {
  background: linear-gradient(180deg, #fffef8, #f4efe1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92), inset 0 -2px 0 rgba(180, 169, 146, .28), 0 5px 10px rgba(15, 23, 42, .12);
}

.card-style-option--paper_relief .card-mini-stamp {
  border-color: rgba(180, 83, 9, .42);
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, .14);
}

.card-style-name {
  font-size: .74rem;
  line-height: 1.15;
  color: #4b5d72;
  font-weight: 600;
}

@media (max-width: 680px) {
  .card-style-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .card-style-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.media-grid {
  align-items: start;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.preset-item {
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
  background: #fff;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
}

.preset-item:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--primary-rgb), .3);
}

.preset-item.is-active {
  border-color: var(--primary);
  background: var(--primary-surface);
}

.preset-item.is-active::after {
  content: "鉁?;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

.preset-thumb,
.preset-thumb-none {
  aspect-ratio: 9/16;
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.preset-thumb-none {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: .8rem;
  border: 1px dashed #cbd5e1;
}

.preset-name {
  display: block;
  text-align: center;
  font-size: .72rem;
  margin-top: 4px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast.is-fading {
  animation: toast-out 0.25s ease both;
}

@keyframes toast-in {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .preset-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 400px) {
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.upload-field {
  margin-bottom: 0;
  border: 1px solid #d9e4f1;
  border-radius: 14px;
  padding: 10px 10px 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .84);
}

.upload-field input[type="file"] {
  border-radius: 12px;
  border: 1px solid #ccd7e4;
  background: rgba(255, 255, 255, .72);
  color: #7b8ca3;
  min-height: 42px;
  padding: 5px 8px;
  box-shadow: none;
  transition: border-color .16s ease, background-color .16s ease;
}

.upload-field input[type="file"]:hover {
  border-color: #b8c7d8;
  background: rgba(255, 255, 255, .8);
}

.upload-field input[type="file"]:focus,
.upload-field input[type="file"]:focus-visible {
  outline: none;
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.upload-field input[type="file"]::file-selector-button {
  border: 1px solid #a8b7c8;
  background: #f4f7fb;
  color: #1f2f44;
  border-radius: 8px;
  padding: 7px 12px;
  margin-right: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}

.upload-field input[type="file"]::file-selector-button:hover {
  border-color: #95a8bd;
  background: #edf3fa;
}

.upload-field input[type="file"]::-webkit-file-upload-button {
  border: 1px solid #a8b7c8;
  background: #f4f7fb;
  color: #1f2f44;
  border-radius: 8px;
  padding: 7px 12px;
  margin-right: 8px;
  font-weight: 500;
  cursor: pointer;
}

.upload-field-bg {
  background: linear-gradient(180deg, #f3f8ff, #eef5ff);
  border-color: #d5e4f7;
}

.upload-field-logo {
  background: linear-gradient(180deg, #f2fbf6, #ecf8f1);
  border-color: #cfe8db;
}

.upload-field-stamp {
  background: linear-gradient(180deg, #fff7f4, #fff1ec);
  border-color: #f0ddd3;
}

.upload-field-qr {
  background: linear-gradient(180deg, #f5f6ff, #eff1ff);
  border-color: #d8dcf7;
}

.upload-hint {
  margin: 4px 0 2px;
  font-size: .74rem;
  color: #94a3b8;
  line-height: 1.4;
  letter-spacing: .01em;
}

.upload-thumb {
  margin-top: 8px;
  width: min(100%, 180px);
  min-height: 96px;
  max-height: 180px;
  position: relative;
  border: 1px solid #d7e3ef;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f8fd, #eef3fb);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.upload-thumb.is-placeholder {
  border-style: dashed;
  border-color: #b8cadf;
}

.upload-thumb.is-placeholder img {
  opacity: .95;
}

.upload-thumb.is-placeholder .upload-thumb-remove {
  display: none !important;
}


.upload-thumb-remove {
  position: absolute;
  right: 5px;
  top: 5px;
  min-width: 0;
  min-height: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  line-height: 0;
  font-size: 0;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, .78);
  color: rgba(51, 65, 85, .78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
  opacity: 0;
  transform: translateY(-2px) scale(.96);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.upload-thumb-remove svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-thumb:hover .upload-thumb-remove,
.upload-thumb:focus-within .upload-thumb-remove {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.upload-thumb-remove:hover,
.upload-thumb-remove:focus-visible {
  background: rgba(255, 255, 255, .96);
  color: #dc2626;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .2);
}

.upload-thumb-random {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: auto;
  min-width: 0;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(163, 177, 194, .85);
  background: rgba(255, 255, 255, .9);
  color: #5f6f82;
  font-size: .72rem;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .1);
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.upload-thumb-random:hover,
.upload-thumb-random:focus-visible {
  background: rgba(255, 255, 255, .98);
  border-color: rgba(138, 157, 179, .9);
  color: #425366;
}

@media (hover: none),
(pointer: coarse) {
  .upload-thumb-remove {
    min-width: 0;
    min-height: 0;
    width: 26px;
    height: 26px;
    padding: 0;
    opacity: .72;
    transform: none;
    pointer-events: auto;
    background: rgba(255, 255, 255, .72);
    color: rgba(220, 38, 38, .72);
  }

  .upload-thumb-random {
    min-height: 28px;
    padding: 0 11px;
  }
}

.modal-card {
  margin-bottom: 16px;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  background: rgba(249, 251, 255, .95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--stroke);
  box-shadow: 0 -10px 18px rgba(15, 23, 42, .06);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

#settingsModal .modal-body {
  flex: 1;
  min-height: 0;
  padding-bottom: 12px;
}

#settingsModal .modal-panel {
  height: min(90vh, 860px);
}

#settingsModal .modal-actions {
  position: static;
  bottom: auto;
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg,
      rgba(249, 251, 255, .62) 0%,
      rgba(246, 249, 255, .88) 28%,
      rgba(244, 247, 254, .96) 100%);
  border-top: 1px solid rgba(210, 221, 236, .9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78), 0 -8px 18px rgba(15, 23, 42, .04);
}

#settingsModal .modal-actions>button {
  width: clamp(136px, 24vw, 210px);
  flex: 0 1 auto;
}

.modal-panel-sm {
  max-height: 72vh;
}

#loginModal .modal-panel {
  left: 12px;
  right: 12px;
  top: 8vh;
  bottom: auto;
  transform: none;
  animation: none;
  width: auto;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  max-height: min(62vh, 520px);
  border-radius: 16px;
  border: 1px solid var(--stroke);
  box-shadow: 0 16px 44px rgba(15, 23, 42, .2);
}

.modal-actions.modal-actions-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.modal-actions.modal-actions-2 {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

#priceRowDrawerModal #deletePriceDrawerBtn {
  border: 1px solid #f8c7cf;
  background: #fff1f3;
  color: #b4233d;
}

#priceRowDrawerModal #deletePriceDrawerBtn:hover,
#priceRowDrawerModal #deletePriceDrawerBtn:focus-visible {
  border-color: #f3aab7;
  background: #ffe5ea;
  color: #9f1239;
}

#priceRowDrawerModal #savePriceDrawerBtn {
  border: 1px solid #b7e6c7;
  background: linear-gradient(90deg, #74d39a, #8ee3ae);
  color: #0f5130;
}

#priceRowDrawerModal #savePriceDrawerBtn:hover,
#priceRowDrawerModal #savePriceDrawerBtn:focus-visible {
  border-color: #9adbb4;
  background: linear-gradient(90deg, #67c88d, #82dba5);
  color: #0b4227;
}

.price-drawer-panel .modal-body {
  display: grid;
  gap: 8px;
}

.price-drawer-panel {
  bottom: 0;
  transition: none;
}

.drawer-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.drawer-row-2 {
  grid-template-columns: 1fr 1fr;
}

.drawer-type-value-row {
  align-items: start;
}

.drawer-value-slot {
  min-width: 0;
}

.drawer-value-slot>div {
  width: 100%;
}

.drawer-value-slot .drawer-inline-field {
  grid-template-columns: 40px minmax(0, 1fr);
}

.drawer-range-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.drawer-range-input {
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  font-size: .92rem;
}

.drawer-range-sep {
  color: #64748b;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

#priceDrawerValueNumberWrap[hidden],
#priceDrawerValueRangeWrap[hidden],
#priceDrawerValueTextWrap[hidden] {
  display: none !important;
}

.drawer-inline-field {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.drawer-field-label {
  font-size: .82rem;
  color: #64748b;
  text-align: right;
  white-space: nowrap;
}

.drawer-inline-field input,
.drawer-inline-field select {
  min-height: 38px;
  padding: 8px 10px;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.password-row .ghost-btn {
  min-width: 68px;
}

.form-error {
  min-height: 20px;
  color: #b42318;
  font-size: .84rem;
  margin-top: 2px;
}

.dialog-message {
  margin: 0;
  color: #334155;
  font-size: .9rem;
  line-height: 1.5;
}

.copy-dialog-tip {
  display: block;
  margin-bottom: 8px;
}

.copy-dialog-text {
  width: 100%;
  min-height: 170px;
  margin: 0;
  resize: vertical;
  font-size: .84rem;
  line-height: 1.45;
}

.copy-dialog-row {
  display: block;
  margin-top: 10px;
}

.copy-dialog-row .mini-btn {
  width: 100%;
}

.copy-dialog-row .mini-btn.is-success {
  background: #dcfce7;
  color: #166534;
}

.copy-dialog-row .mini-btn.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.copy-dialog-reg-tip {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(var(--primary-rgb), .07);
  border: 1px solid rgba(var(--primary-rgb), .18);
  color: #0b5f52;
  font-size: .82rem;
  line-height: 1.5;
}

.dialog-danger-text {
  color: #b42318;
  font-weight: 700;
}

#dialogInputWrap[hidden] {
  display: none !important;
}

.dialog-panel {
  bottom: auto !important;
  top: 15vh;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  animation: sheet-down 0.25s ease-out both;
}

@keyframes sheet-down {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.dialog-panel .modal-actions {
  grid-template-columns: 1fr 1fr;
}

#dialogModal.is-copy-dialog #closeDialogBtn {
  display: none;
}

#dialogModal.is-copy-dialog .modal-actions {
  grid-template-columns: 1fr;
  justify-items: center;
}

#dialogModal.is-copy-dialog .modal-actions>button {
  width: min(320px, 72%);
  margin: 0 auto;
}

#dialogModal.is-wechat-save-dialog #closeDialogBtn {
  display: none;
}

#dialogModal.is-wechat-save-dialog .modal-body {
  padding-top: 12px;
  padding-bottom: 14px;
}

#dialogModal.is-wechat-save-dialog .dialog-panel {
  left: 18px;
  right: 18px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

#dialogModal.is-wechat-save-dialog .modal-head {
  justify-content: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(226, 232, 240, .9);
}

#dialogModal.is-wechat-save-dialog #dialogTitle {
  width: 100%;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
}

#dialogModal.is-wechat-save-dialog .modal-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(248, 250, 252, .98));
  border-top: 1px solid rgba(226, 232, 240, .95);
}

#dialogModal.is-wechat-save-dialog .modal-actions > button {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: none;
}

#dialogModal.is-wechat-save-dialog #dialogCancelBtn {
  border: 1px solid #d7dee7;
  background: #f8fafc;
  color: #475569;
}

#dialogModal.is-wechat-save-dialog #dialogConfirmBtn {
  background: linear-gradient(180deg, #1aad19, #169714);
  color: #fff;
  border: 1px solid rgba(22, 151, 20, .95);
  box-shadow: 0 8px 18px rgba(26, 173, 25, .18);
}

#dialogModal.is-wechat-save-dialog #dialogConfirmBtn:active {
  background: linear-gradient(180deg, #169714, #138311);
}

.wechat-save-guide {
  display: grid;
  gap: 0;
  justify-items: center;
}

.wechat-save-guide__image {
  display: block;
  width: 100%;
  max-height: min(64vh, 560px);
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: #f4f6f8;
}

.crop-tip {
  margin: 0 0 10px;
  color: #64748b;
  font-size: .86rem;
}

.price-editor-tip {
  margin: 0 0 10px;
  color: #64748b;
  font-size: .86rem;
}

.price-editor-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 8px 0 10px;
  border: 1px solid #d6e2ef;
  border-radius: 12px;
  background: #fff;
}

.price-editor-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: auto;
}

.price-editor-table .col-name {
  width: 24%;
}

.price-editor-table .col-mode {
  width: 20%;
}

.price-editor-table .col-value {
  width: 24%;
}

.price-editor-table .col-unit {
  width: 16%;
}

.price-editor-table .col-action {
  width: 8%;
}

.price-editor-table .col-drag {
  width: 8%;
}

.price-editor-table th,
.price-editor-table td {
  border-bottom: 1px solid #e6edf5;
  padding: 5px;
  vertical-align: middle;
  text-align: left;
}

.price-editor-table th {
  background: #f8fbff;
  color: #334155;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.price-editor-table td {
  font-size: .8rem;
}

.price-editor-table tbody tr:last-child td {
  border-bottom: none;
}

.price-editor-table input,
.price-editor-table select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 6px;
  font-size: .8rem;
  border-radius: 8px;
}

.price-editor-table td:nth-child(2),
.price-editor-table td:nth-child(4),
.price-editor-table td:nth-child(5),
.price-editor-table th:nth-child(2),
.price-editor-table th:nth-child(4),
.price-editor-table th:nth-child(5) {
  text-align: center;
}

.price-editor-table td:nth-child(5) {
  padding-left: 2px;
  padding-right: 2px;
}

.price-range-wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 3px;
}

.price-range-wrap>input {
  min-width: 0;
}

.price-range-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  min-height: 30px;
  line-height: 1;
  font-weight: 600;
  color: #334155;
}

.price-editor-add-wrap {
  margin: 8px 0 10px;
}

.price-row-remove {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #f3cad1;
  background: #fff4f6;
  color: #9f1239;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.price-row-remove svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.price-row-remove-text {
  display: none;
}

.drag-handle {
  width: 14px;
  height: 18px;
  fill: #94a3b8;
  cursor: grab;
  display: block;
}

.price-sort-handle {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.price-cell-drag,
.price-summary-drag {
  width: 24px;
  text-align: center;
  padding: 0 2px;
}

.price-summary-drag {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 40px;
}

.price-cell-drag.price-sort-handle,
.price-summary-drag.price-sort-handle {
  padding: 0 5px;
}

.sortable-ghost {
  opacity: 0.5 !important;
  background: var(--primary-surface) !important;
  border: 1px dashed var(--primary) !important;
}

.sortable-chosen {
  background: rgba(var(--primary-rgb), .15) !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
  z-index: 50;
  transform: scale(1.02);
}

.sortable-drag {
  opacity: 0.98;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2) !important;
}

#logoCropCanvas {
  width: 100%;
  max-width: 320px;
  display: block;
  margin: 0 auto 12px;
  border: 1px solid #d7e3ef;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff, #eef3fb);
  touch-action: none;
  cursor: grab;
}

#logoCropCanvas.is-dragging {
  cursor: grabbing;
}

body.no-scroll {
  overflow: hidden;
}

.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 320;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  align-items: center;
  background: transparent;
  pointer-events: none;
}

body.has-floating-select .template-manager-card {
  z-index: 240;
}

body.has-floating-select .action-bar {
  z-index: 320;
}

body.has-floating-select #templateManagerBody.template-manager-body {
  margin-bottom: 0;
}

.action-bar .pill-btn {
  width: min(300px, calc(100vw - 96px));
  min-height: 50px;
  border-radius: 999px;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 12px 24px rgba(var(--primary-rgb), .24);
  pointer-events: auto;
}

.action-bar-note {
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease, max-height .18s ease;
  font-size: .78rem;
  color: rgba(15, 23, 42, .72);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.35;
  pointer-events: auto;
}

.action-bar-note.is-visible {
  max-height: 54px;
  opacity: 1;
  transform: translateY(0);
}

.action-bar-sep {
  opacity: .5;
}

.action-bar-link {
  color: #0f4f89;
  text-decoration: none;
  border-bottom: 1px dashed rgba(15, 79, 137, .35);
  pointer-events: auto;
}

.action-bar-link:hover {
  color: #0a3a66;
  border-bottom-color: rgba(10, 58, 102, .6);
}

.action-bar-link:focus-visible {
  outline: 2px solid #0f8b76;
  outline-offset: 2px;
  border-radius: 4px;
}

.primary {
  background: linear-gradient(90deg, var(--primary-strong), var(--primary-soft));
  color: #fff;
  border: none;
}

.primary.is-success {
  background: linear-gradient(90deg, #15803d, #22c55e);
  color: #fff;
  border: none;
}

.drawer-toggle {
  display: none;
}

.preview-card:fullscreen,
.preview-card:-webkit-full-screen,
body.is-desktop-preview-focus .preview-card {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  padding: 14px;
  background: #08111f;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  z-index: 260;
}

/* 鍏ㄥ睆閫€鍑烘彁绀烘诞灞?*/
.fullscreen-exit-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

.fullscreen-exit-hint-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #e2e8f0;
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.fullscreen-exit-hint-inner svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fullscreen-exit-hint-inner kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: .72rem;
  font-family: Outfit, monospace;
  color: #cbd5e1;
  line-height: 1.5;
  font-style: normal;
}

.fullscreen-exit-hint.is-visible {
  animation: fullscreen-hint-fade 3.2s ease forwards;
}

@keyframes fullscreen-hint-fade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }

  12% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }
}

.preview-card:fullscreen .section-head,
.preview-card:-webkit-full-screen .section-head,
body.is-desktop-preview-focus .preview-card .section-head {
  margin-bottom: 10px;
}

.preview-card:fullscreen h2,
.preview-card:-webkit-full-screen h2,
body.is-desktop-preview-focus .preview-card h2 {
  color: #f1f5f9;
}

.preview-card:fullscreen #statusText,
.preview-card:-webkit-full-screen #statusText,
body.is-desktop-preview-focus .preview-card #statusText {
  color: #c7d2de;
}

.preview-card:fullscreen .preview-focus-btn,
.preview-card:-webkit-full-screen .preview-focus-btn,
body.is-desktop-preview-focus .preview-card .preview-focus-btn {
  color: #dbe5f1;
  border-color: rgba(148, 163, 184, .4);
  background: rgba(30, 41, 59, .48);
}

.preview-card:fullscreen .preview-stage,
.preview-card:-webkit-full-screen .preview-stage,
body.is-desktop-preview-focus .preview-card .preview-stage {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  border-color: rgba(148, 163, 184, .32);
  background: #0b1729;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card:fullscreen #previewImage,
.preview-card:-webkit-full-screen #previewImage,
body.is-desktop-preview-focus .preview-card #previewImage {
  object-fit: contain;
  background: #0b1729;
}

body.is-desktop-preview-focus .editor-col {
  display: none;
}

.settings-tip,
.template-manager-tip {
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .38);
  background: rgba(255, 255, 255, .78);
  color: #334155;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .14);
  backdrop-filter: blur(10px);
}

.settings-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 180;
  max-width: min(250px, calc(100vw - 24px));
  font-size: .78rem;
  line-height: 1.45;
  animation: tip-in .2s ease-out both;
}

.settings-tip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: var(--tip-arrow-right, 20px);
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, .78);
  border-left: 1px solid rgba(148, 163, 184, .38);
  border-top: 1px solid rgba(148, 163, 184, .38);
  transform: rotate(45deg);
}

.settings-tip[data-placement="top"]::before {
  top: auto;
  bottom: -6px;
  border-left: none;
  border-top: none;
  border-right: 1px solid rgba(148, 163, 184, .38);
  border-bottom: 1px solid rgba(148, 163, 184, .38);
}

.settings-tip p {
  margin: 0 0 8px;
  color: inherit;
  font-size: inherit;
}

.settings-tip-btn,
.template-manager-tip-btn {
  width: auto;
  min-height: 32px;
  margin-top: 8px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .42);
  background: rgba(255, 255, 255, .62);
  color: #334155;
  font-size: .76rem;
  font-weight: 600;
}

@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 720px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .row {
    grid-template-columns: repeat(4, 1fr);
  }

  .modal-panel {
    max-width: 760px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px;
    bottom: 24px;
    max-height: calc(100vh - 48px);
  }

  .modal-panel-sm {
    max-width: 520px;
  }

  #loginModal .modal-panel {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 48px));
    max-height: calc(100vh - 80px);
  }

  #settingsModal .modal-panel {
    left: auto;
    right: 24px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: min(760px, calc(100vw - 48px));
    height: min(860px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    animation: none;
  }

  .price-editor-table input,
  .price-editor-table select {
    min-width: 0;
  }
}

@media (min-width: 820px) {
  .price-editor-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .price-editor-table .col-name {
    width: 32%;
  }

  .price-editor-table .col-mode {
    width: 16%;
  }

  .price-editor-table .col-value {
    width: 24%;
  }

  .price-editor-table .col-unit {
    width: 16%;
  }

  .price-editor-table .col-action {
    width: 12%;
  }

  .app {
    max-width: 1320px;
    padding: 0 20px 28px;
  }

  .topbar {
    width: min(calc(100vw - 24px), 1820px);
    max-width: 1820px;
    margin-left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    margin-bottom: 8px;
    padding: 8px 14px;
    border-radius: 16px;
    z-index: 120;
  }

  .brand-shell {
    gap: 8px;
  }

  .brand-mark-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .brand-kicker {
    margin-bottom: 1px;
    font-size: .62rem;
  }

  .brand-copy h1 {
    font-size: 1.1rem;
    line-height: 1.08;
  }

  .brand-meta {
    margin-top: 1px;
    font-size: .72rem;
    line-height: 1.22;
  }

  .workspace {
    grid-template-columns: minmax(420px, 46%) minmax(520px, 54%);
    align-items: start;
    gap: 14px;
  }

  .preview-card {
    position: sticky;
    top: 16px;
  }

  .editor-col .card:last-child {
    margin-bottom: 0;
  }

  .editor-col .action-bar {
    position: fixed;
    left: calc(50% + (min(1280px, calc(100vw - 40px)) * 0.23));
    right: auto;
    bottom: 24px;
    z-index: 320;
    padding: 0;
    margin-top: 0;
    align-items: center;
    gap: 0;
    transform: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .editor-col .action-bar.is-dock-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .editor-col .action-bar .pill-btn {
    width: auto;
    min-width: 176px;
    min-height: 52px;
    padding: 0 28px;
    border-radius: 999px;
    box-shadow: 0 14px 28px rgba(var(--primary-rgb), .28);
  }

  .editor-col .action-bar-note {
    display: flex;
    position: fixed;
    left: 50%;
    bottom: clamp(8px, 1.6vh, 16px);
    width: max-content;
    max-width: calc(100vw - 24px);
    justify-content: center;
    text-align: center;
    transform: translateX(-50%) translateY(4px);
    z-index: 319;
  }

  .editor-col .action-bar.is-dock-visible .action-bar-note {
    max-height: 54px;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 560px) {
  .price-range-wrap {
    grid-template-columns: 1fr;
  }

  .price-range-sep {
    min-height: 14px;
    min-width: 100%;
    padding: 1px 0;
  }
}

@media (max-width: 819px) {
  .action-bar {
    pointer-events: auto;
  }

  #priceRowDrawerModal .price-drawer-panel {
    top: 8vh;
    bottom: auto;
    left: 8px;
    right: 8px;
    max-height: 48vh;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .2);
    animation: none;
  }

  .price-editor-table-wrap {
    border: none;
    background: transparent;
    margin-top: 6px;
    overflow: visible;
  }

  .price-editor-table {
    width: 100%;
  }

  .price-editor-table colgroup {
    display: none;
  }

  .price-editor-table thead {
    display: none;
  }

  .price-editor-table tbody {
    display: grid;
    gap: 8px;
  }

  .price-editor-table tbody tr.price-row-summary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 8px 6px;
    background: #fff;
    border: 1px solid #d6e2ef;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .05);
    min-height: 52px;
    cursor: pointer;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
  }

  .price-editor-table tbody tr.price-row-summary:focus,
  .price-editor-table tbody tr.price-row-summary:active,
  .price-editor-table tbody tr.price-row-summary:focus-visible {
    outline: none;
    background: #fff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .05);
  }

  .price-editor-table tbody tr.price-row-summary td.price-summary-drag {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 0;
  }

  .price-summary-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .price-summary-name {
    color: #0f172a;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .price-summary-meta {
    color: #64748b;
    font-size: .78rem;
    line-height: 1.1;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .price-summary-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .price-row-open {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid #cbd8e6;
    background: #f8fbff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .price-editor-table tbody td {
    min-width: 0;
    border: none;
    padding: 0;
  }

  .price-row-remove {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 9px;
    padding: 0;
    gap: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .price-row-open svg,
  .price-row-remove svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }

  .price-row-open:hover,
  .price-row-open:active {
    border-color: #9fb6cf;
    background: #eef5ff;
    color: #0f3f72;
  }

  .price-row-remove:hover,
  .price-row-remove:active {
    border-color: #f0b7c2;
    background: #fff1f4;
    color: #9f1239;
  }

  .price-row-remove-text {
    display: none;
  }

  .drawer-inline-field {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 6px;
  }

  .drawer-type-value-row .drawer-inline-field {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .drawer-field-label {
    font-size: .8rem;
  }

  .drawer-inline-field input,
  .drawer-inline-field select {
    min-height: 36px;
    padding: 7px 9px;
    font-size: .88rem;
  }

  .drawer-range-wrap {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
  }

  .drawer-range-input {
    min-height: 44px;
    padding: 10px 10px;
    font-size: .94rem;
  }

  .drawer-range-sep {
    font-size: 1.12rem;
  }

  .topbar {
    transition: padding .18s ease, margin-bottom .18s ease, border-radius .18s ease, box-shadow .18s ease;
  }

  .brand-mark-wrap,
  .brand-mark,
  .brand-copy h1 {
    transition: width .18s ease, height .18s ease, font-size .18s ease, line-height .18s ease, border-radius .18s ease;
  }

  body.is-topbar-collapsed .topbar {
    position: sticky;
    top: 6px;
    z-index: 95;
    margin-bottom: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, .06);
  }

  body.is-topbar-collapsed .topbar::after {
    opacity: 0;
  }

  body.is-topbar-collapsed .brand-shell {
    gap: 6px;
  }

  body.is-topbar-collapsed .brand-mark-wrap {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  body.is-topbar-collapsed .brand-mark {
    width: 18px;
    height: 18px;
  }

  body.is-topbar-collapsed .brand-kicker,
  body.is-topbar-collapsed .brand-meta {
    display: none;
  }

  body.is-topbar-collapsed .brand-copy h1 {
    font-size: .92rem;
    line-height: 1.08;
    max-width: 16ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 320;
  }
}

@media (max-width: 460px) {
  .settings-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow: visible;
    white-space: normal;
    padding: 0;
  }

  .settings-tab {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 8px 10px;
  }

  .action-bar .pill-btn {
    width: min(240px, calc(100vw - 120px));
    min-height: 46px;
    font-size: 1rem;
  }

  .topbar {
    gap: 10px;
    padding: 10px 10px;
    border-radius: 16px;
    align-items: stretch;
  }

  .brand-shell {
    gap: 8px;
  }

  .brand-mark-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .brand-kicker {
    font-size: .62rem;
    letter-spacing: .14em;
    margin-bottom: 1px;
  }

  .brand-copy h1 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 1.16rem;
    letter-spacing: 0;
    max-width: none;
    line-height: 1.18;
  }

  .brand-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: .78rem;
    max-width: none;
  }

  .topbar-actions {
    gap: 8px;
    flex-shrink: 0;
    justify-content: flex-end;
  }

  .ghost-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 46px;
    padding: 8px 9px;
    white-space: nowrap;
    font-size: .9rem;
    line-height: 1;
  }

  .icon-btn {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .settings-menu {
    width: min(220px, calc(100vw - 36px));
  }
}

@media (max-width: 600px) {
  .app {
    padding: 10px 12px 108px;
  }

  .topbar {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    gap: 8px;
  }

  .topbar::after {
    width: 120px;
    height: 84px;
    top: -24px;
    right: -30px;
  }

  .brand-shell {
    gap: 8px;
  }

  .brand-mark-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-mark {
    width: 20px;
    height: 20px;
  }

  .brand-kicker {
    display: none;
  }

  .brand-copy h1 {
    font-size: .98rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .icon-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .section-head {
    margin-bottom: 6px;
  }

  h2 {
    font-size: .98rem;
  }

  .card {
    padding: 10px;
  }

  .preview-tools {
    gap: 6px;
  }

  .preview-focus-btn {
    min-height: 30px;
    padding: 5px 9px;
    font-size: .72rem;
  }

  .settings-tip {
    max-width: min(220px, calc(100vw - 20px));
    font-size: .75rem;
  }

  #todayBtn,
  #tomorrowBtn {
    display: none;
  }

  .row {
    grid-template-columns: 1fr 1fr;
  }

  .brand-meta {
    display: none;
  }

  .topbar {
    align-items: center;
  }
}

@media (max-width: 819px) {
  .template-manager-tip {
    width: min(230px, calc(100vw - 38px));
  }

  .card,
  .modal-card,
  .template-manager-body .tm-select-panel,
  .settings-tabs {
    backdrop-filter: none;
  }

  .card {
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  }

  .modal-mask {
    backdrop-filter: none;
    background: rgba(15, 23, 42, .34);
  }

  .modal-panel {
    box-shadow: 0 -10px 24px rgba(15, 23, 42, .14);
  }

  body.preview-focus {
    overflow: hidden;
  }

  body.preview-focus .app {
    padding: 0 0 env(safe-area-inset-bottom);
    max-width: none;
  }

  body.preview-focus .topbar {
    display: none;
  }

  body.preview-focus .workspace {
    display: block;
  }

  body.preview-focus .preview-card {
    position: fixed;
    left: 0;
    right: 0;
    top: env(safe-area-inset-top);
    bottom: calc(58px + env(safe-area-inset-bottom));
    z-index: 110;
    margin: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 8px 10px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  body.preview-focus .preview-stage {
    flex: 1;
    min-height: 0;
    aspect-ratio: auto;
  }

  body.preview-focus .editor-col {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    max-height: 76vh;
    padding: 0 6px calc(6px + env(safe-area-inset-bottom));
    overflow: auto;
    transform: translateY(calc(100% - 52px - env(safe-area-inset-bottom)));
    transition: transform .24s ease;
  }

  body.preview-focus.editor-drawer-open .editor-col {
    transform: translateY(0);
  }

  body.preview-focus .drawer-toggle {
    position: sticky;
    top: 0;
    z-index: 3;
    display: block;
    min-height: 44px;
    margin-bottom: 8px;
    border-radius: 14px;
    border: 1px solid #cad8e8;
    background: rgba(255, 255, 255, .94);
    color: #334155;
    font-size: .86rem;
    font-weight: 600;
    box-shadow: 0 8px 14px rgba(15, 23, 42, .08);
  }

  body.preview-focus .editor-col .action-bar {
    position: static;
    padding: 0 0 6px;
    pointer-events: auto;
    align-items: stretch;
  }

  body.preview-focus .editor-col .action-bar .pill-btn {
    width: 100%;
    max-width: none;
    border-radius: 14px;
    min-height: 48px;
  }

  body.preview-focus .editor-col .action-bar-note {
    display: none;
  }
}

.loading-runway-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  --primary: rgba(var(--primary-rgb), 0.65);
  --primary-strong: rgba(var(--primary-rgb), 0.85);
  --primary-soft: rgba(var(--primary-rgb), 0.45);
}

.loading-runway {
  width: 100%;
  height: 3px;
  background: #cbd5e1;
  border-radius: 2px;
  position: relative;
  margin-top: 50px;
  margin-bottom: 24px;
}

.loading-runway::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(15, 23, 42, 0.05);
}

.forklift-group {
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 88px;
  height: auto;
  transform: translate3d(0, 0, 0);
  transition: transform 0.15s linear;
  display: flex;
  align-items: flex-end;
}

.preview-stage.is-loading .forklift-group {
  will-change: transform;
}

.forklift-svg {
  width: 100%;
  display: block;
  transform-origin: left bottom;
  transform: scaleX(0.82);
}

.preview-loading-text {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

