:root {
  --bg: #f2f2f2;
  --card: #ffffff;
  --text: #111111;
  --muted: #9aa3b3;
  --line: #efefef;
  --accent: #0e7a6f;
  --phone-w: 430px;
  --phone-h: 932px;
  --top-h: 98px;
  --bottom-h: 90px;
  --card-inner-pad: 22px;
  --merchant-row-h: 56px;
  --amount-wrap-w: 336px;
  --action-row-h: 44px;
  --card-side-gap: 22px;
  --card-bottom-gap: 0px;
  --notice-top-gap: 27px;
  --notice-to-amount-label-gap: 29px;
  --amount-label-to-number-gap: 16px;
  --amount-to-meta-gap: 31px;
  --meta-to-action-gap: 20px;
  --amount-text-w: 84px;
  --amount-text-h: 19px;
  --between-card-gap: 56px;
  --last-card-to-nav-gap: 11px;
  --content-text-weight: 400;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
}

.app {
  min-height: 100vh;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 460px) 1fr;
  padding: 16px;
}

.panel {
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.sub {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.card-manager {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  background: #fafafa;
}

.template-manager {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  background: #fafafa;
}

.template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.template-head strong {
  font-size: 13px;
  color: #374151;
}

.template-tools {
  display: flex;
  gap: 6px;
}

#add-template-btn,
#delete-template-btn,
#save-template-meta-btn,
#copy-template-domain-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.card-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-tools {
  display: flex;
  gap: 6px;
}

.card-manager-head strong {
  font-size: 13px;
  color: #374151;
}

#add-card-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}

#move-up-btn,
#move-down-btn {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.card-list {
  display: grid;
  gap: 6px;
}

.card-pill-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.card-pill {
  width: 100%;
  background: #fff;
  color: #1f2937;
  border: 1px solid #e6e8ec;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.card-pill:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.card-pill-delete {
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.card-pill-delete:hover {
  opacity: 1;
  background: #fee2e2;
  color: #ef4444;
}

.card-pill.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: #f0f9f8;
  box-shadow: 0 0 0 1px var(--accent);
}

.pill-amount {
  font-weight: 600;
  font-size: 12px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.form-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #fcfcfc;
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
}

.section-header {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.form-section > label,
.form-section > button {
  grid-column: span 1;
}

.form-section > .check-row {
  grid-column: span 1;
}

.form > .block-editor,
.form > .style-preset-manager,
.form > .actions,
.form > .link-box {
  grid-column: 1 / -1;
}

.block-editor,
.style-preset-manager {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
  margin-bottom: 12px;
}


.block-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.block-editor-head strong {
  font-size: 13px;
  color: #374151;
}

#add-action-item-btn,
#save-style-preset-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.action-item-list {
  display: grid;
  gap: 8px;
}

.action-item-row {
  display: grid;
  gap: 8px;
}

.action-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-item-main input[type="text"] {
  flex: 1;
}

.subpage-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #4b5563;
}

.subpage-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.subpage-config {
  display: none;
  padding: 8px;
  border: 1px dashed #dbe2ea;
  border-radius: 8px;
  background: #fff;
}

.subpage-config.is-open {
  display: grid;
  gap: 8px;
}

.subpage-config textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.subpage-avatar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subpage-avatar-tools input[type="file"] {
  flex: 1;
  padding: 6px 0;
  border: 0;
}

.style-preset-list {
  display: grid;
  gap: 8px;
}


.style-preset-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.style-preset-name {
  flex: 1;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
}

.style-preset-actions {
  display: flex;
  gap: 6px;
}

.empty-tip {
  margin: 0;
  color: #9ca3af;
  font-size: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
}

select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid #d2f4ef;
  border-color: #23a08f;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-size: 13px;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.link-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mobile-link-output {
  flex: 1;
  background: #fff;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
}

button.ghost {
  background: #e5e7eb;
  color: #111827;
}

.preview-wrap {
  display: flex;
  align-items: start;
  justify-content: flex-start;
  position: sticky;
  top: 16px;
  align-self: start;
}

.exit-preview {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
}

.enter-fullscreen {
  display: none;
  position: absolute;
  top: 8px;
  right: 72px;
  z-index: 3;
}

.phone {
  width: var(--phone-w);
  height: var(--phone-h);
  max-width: 100%;
  background: #f2f2f2;
  border-radius: 18px;
  border: 1px solid #dcdcdc;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14);
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  height: var(--top-h);
  display: grid;
  grid-template-rows: 38px 1fr;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: 0 0 var(--top-h);
  position: relative;
}

.bar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  background: #fff;
}

.topbar.use-image .bar-image.top-image {
  display: block;
}

.topbar.use-image .statusbar,
.topbar.use-image .navbar {
  visibility: hidden;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px 0;
}

.status-time {
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
}

.status-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sig-cell {
  width: 16px;
  height: 12px;
  display: inline-block;
  background: linear-gradient(to right, #111 0 20%, #111 20% 40%, #111 40% 60%, #111 60% 80%, transparent 80% 100%);
  clip-path: polygon(0 100%, 0 75%, 20% 75%, 20% 50%, 40% 50%, 40% 25%, 60% 25%, 60% 0, 80% 0, 80% 100%);
}

.sig-5g {
  font-size: 11px;
  font-weight: 600;
}

.battery {
  width: 22px;
  height: 11px;
  border: 1px solid #7f7f7f;
  border-radius: 3px;
  padding: 1px;
  position: relative;
}

.battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 3px;
  width: 2px;
  height: 4px;
  background: #7f7f7f;
  border-radius: 1px;
}

.battery-level {
  display: block;
  width: 40%;
  height: 100%;
  background: #7f7f7f;
  border-radius: 1px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 10px;
}

.back {
  background: transparent;
  color: #111111;
  font-size: 32px;
  padding: 0;
  width: 24px;
  line-height: 1;
}

.topbar strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: transparent;
  padding: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.search-btn {
  border: 2px solid #111;
  position: relative;
}

.search-btn::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  background: #111;
  right: -4px;
  bottom: -1px;
  transform: rotate(40deg);
  border-radius: 1px;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #111;
}

.time-row {
  text-align: center;
  color: #abb3bf;
  padding: 12px 0 10px;
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
}

.time-row.is-hidden {
  display: none;
}

.phone-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: var(--last-card-to-nav-gap);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.phone-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.subpage-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: #fff;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.28s ease, visibility 0s linear 0.28s;
  touch-action: pan-y;
}

.subpage-layer.is-open {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: transform 0.28s ease;
}

.subpage-nav {
  height: 92px;
  padding: 44px 16px 12px 17px;
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  border-bottom: 1px solid #f2f2f2;
  position: relative;
}

.subpage-nav-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.subpage-nav.use-image .subpage-nav-image {
  display: block;
}

.subpage-nav.use-image .subpage-close,
.subpage-nav.use-image .subpage-nav-title,
.subpage-nav.use-image .subpage-nav-right {
  visibility: hidden;
}

.subpage-close {
  background: transparent;
  color: #111;
  padding: 0;
  width: 9px;
  min-width: 9px;
  height: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 22px;
  font-weight: 400;
  justify-self: start;
  border: 0;
  overflow: visible;
}

.subpage-nav-title {
  justify-self: center;
  font-size: 16px;
  font-weight: 600;
}

.subpage-nav-right {
  font-size: 16px;
  color: #111;
}

.subpage-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 16px 0;
}

.subpage-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #fff;
  background: #40a4ff;
  font-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.subpage-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.subpage-avatar-image.is-hidden,
.subpage-action-list.is-hidden {
  display: none;
}

#sp-avatar-fallback.is-hidden {
  display: none;
}

.subpage-main-title {
  margin: 20px 0 0;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.2;
  transform: scale(0.5);
  transform-origin: top center;
  white-space: nowrap;
}

.subpage-amount {
  margin: 10px 0 0;
  font-size: 56px;
  line-height: 1;
  font-weight: 800;
  transform: scale(0.5);
  transform-origin: top center;
}

.subpage-remark {
  margin: 8px 0 0;
  font-size: 24px;
  color: #8f98a8;
  transform: scale(0.5);
  transform-origin: top center;
}

.subpage-remark.is-hidden {
  display: none;
}

.subpage-detail-list {
  width: 100%;
  margin: 12px 0 0;
  border-top: 1px solid #f3f4f6;
  padding: 10px 0 0;
}

.subpage-action-list {
  width: 100%;
  margin-top: 22px;
}

.subpage-action-list.action-list::before {
  left: 0;
  right: 0;
}

.subpage-action-list .list-item {
  padding: 0;
}

.subpage-action-list .list-item::after {
  left: 0;
  right: 0;
}

.subpage-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 7px 0;
}

.subpage-detail-row dt {
  width: 78px;
  flex: 0 0 78px;
  margin: 0;
  color: #b1b8c4;
}

.subpage-detail-row dd {
  margin: 0;
  flex: 1;
  word-break: break-all;
}

.subpage-footer {
  color: #c8ced9;
  font-size: 11px;
  text-align: center;
  padding: 14px 12px 61px;
}

.card {
  background: #fff;
  margin: 0 var(--card-side-gap) var(--card-bottom-gap);
  border-radius: 6px;
  overflow: hidden;
}

.merchant-row {
  height: var(--merchant-row-h);
  padding: 0 var(--card-inner-pad);
  display: flex;
  align-items: center;
  position: relative;
}

.merchant-row::after {
  content: "";
  position: absolute;
  left: 19px;
  right: 19px;
  bottom: 0;
  height: 1px;
  background: #f1f1f1;
}

.merchant-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.merchant-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, #71b2ff 0 34%, #2f83e3 35% 100%);
}

.merchant-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #e5e7eb;
}

.merchant-name {
  margin: 0;
  font-size: 16px;
  font-weight: var(--content-text-weight) !important;
  line-height: 1;
}

.card-main {
  padding: var(--notice-top-gap) var(--card-inner-pad) 0;
}

.card-main.no-notice {
  padding-top: 0;
}

.card-main.no-notice .amount-wrap {
  margin-top: 43px;
}

.notice-title {
  margin: 0;
  font-size: 16px;
  font-weight: var(--content-text-weight) !important;
  line-height: 1.25;
}

.amount-wrap {
  width: min(100%, var(--amount-wrap-w));
  margin: var(--notice-to-amount-label-gap) auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--amount-label-to-number-gap);
}

.small {
  margin: 0;
  color: #a8b0be;
  font-size: 15px;
  text-align: center;
  line-height: 1;
  font-weight: var(--content-text-weight);
}

.amount-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  width: 100%;
  text-align: center;
  line-height: 1;
}

.unit {
  font-size: 31px;
  margin-right: 2px;
  font-weight: 500;
}

.pv-amount {
  width: auto;
  height: auto;
  max-width: 100%;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1;
  display: inline-block;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.meta {
  margin: var(--amount-to-meta-gap) 0 0;
  padding-top: 0;
  border-top: 0;
}

.bill-quick-link {
  margin: 43px auto 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: #a8b0be;
  padding: 0;
  font-size: 15px;
  font-weight: var(--content-text-weight) !important;
  line-height: 1;
}

.bill-quick-link .arrow {
  color: #b8bfca;
  font-size: 20px;
  line-height: 1;
}

.card.no-actions.has-quick-link .bill-quick-link {
  margin-bottom: 43px;
}

.meta > div {
  display: flex;
  align-items: center;
  padding: 6px 0;
}

dt {
  width: 78px;
  color: #b1b8c4;
  font-size: 15px;
  font-weight: var(--content-text-weight) !important;
}

dd {
  margin: 0;
  font-size: 15px;
  color: #111;
  font-weight: var(--content-text-weight) !important;
}

#pv-cards {
  display: grid;
  gap: 0;
}

.action-list {
  margin-top: var(--meta-to-action-gap);
  position: relative;
}

.action-list.no-divider {
  padding-bottom: 24px;
}

.action-list.no-divider::before {
  display: none;
}

.action-list::before {
  content: "";
  position: absolute;
  left: 19px;
  right: 19px;
  top: 0;
  height: 1px;
  background: var(--line);
}

.list-item {
  width: 100%;
  background: transparent;
  color: #111;
  border-radius: 0;
  border-bottom: 0;
  padding: 0 calc(var(--card-inner-pad) + 6px) 0 var(--card-inner-pad);
  min-height: var(--action-row-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  line-height: 15px;
  position: relative;
  font-weight: var(--content-text-weight) !important;
}

.list-item::after {
  content: "";
  position: absolute;
  left: 19px;
  right: 19px;
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item:last-child::after {
  display: none;
}

.list-item.split-item {
  justify-content: space-between;
}

.list-item.center-item {
  justify-content: center;
  color: #999; /* Lighter gray to match the image */
  font-size: 15px;
  gap: 2px;
  border-top: none; /* Remove separator line */
  min-height: 52px; /* Slightly taller for better spacing */
}

.list-item.center-item .arrow {
  margin-left: 2px;
  color: #999;
}

.split-right {
  color: #888;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.split-right .arrow {
  margin-left: 4px;
}

.list-item .arrow {
  color: #b0b7c2;
  min-width: 12px;
  width: 12px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
  transform: translateY(0);
  flex: 0 0 auto;
  margin-left: 8px;
  position: relative;
}

.list-item .arrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
}

.list-item:active {
  background: #f7f8fa;
}

.bottom-time,
.between-time {
  height: var(--between-card-gap);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #b1b8c4;
  font-size: 16px;
  margin: 0;
  line-height: 1;
  font-weight: 300;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border-top: 1px solid #e9ebef;
  height: var(--bottom-h);
  flex: 0 0 var(--bottom-h);
  position: relative;
}

.bottom-nav.use-image .bar-image.bottom-image {
  display: block;
}

.bottom-nav.use-image .tab-item {
  visibility: hidden;
}

.tab-item {
  background: transparent;
  color: #2f2f2f;
  border-radius: 0;
  border-right: 1px solid #f0f2f5;
  padding: 0 10px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

.tab-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  position: relative;
  flex: 0 0 18px;
}

.tab-icon-bill {
  border: 1.8px solid #111;
  border-radius: 50%;
}

.tab-icon-bill::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #111;
}

.tab-icon-pay::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  border: 1.5px solid #808080;
}

.tab-icon-discount::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 14px;
  height: 2px;
  background: #808080;
  transform: rotate(-24deg);
}

.tab-text {
  font-size: 15px;
  line-height: 1;
  font-weight: 500;
}

.tab-item:last-child {
  border-right: 0;
}

.tab-item.is-active {
  font-weight: 500;
  color: #111;
}

.back:active,
.icon-btn:active,
.tab-item:active {
  background: #f3f4f6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(17, 17, 17, 0.86);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
  }

  .form {
    grid-template-columns: 1fr;
  }

  .preview-wrap {
    justify-content: center;
    position: relative;
    top: 0;
  }
}

.app.mobile-preview {
  grid-template-columns: 1fr;
  padding: 0;
}

.app.mobile-preview .panel {
  display: none;
}

.app.mobile-preview .preview-wrap {
  justify-content: center;
  min-height: 100vh;
  align-items: center;
}

.app.mobile-preview .exit-preview {
  display: inline-block;
}

.app.mobile-display-only {
  grid-template-columns: 1fr;
  padding: 0 !important;
  gap: 0 !important;
}

.app.mobile-display-only .panel {
  display: none !important;
}

.app.mobile-display-only .preview-wrap {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  width: 100vw;
  margin: 0;
  align-items: stretch;
  justify-content: stretch;
}

.app.mobile-display-only .phone {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none !important;
  margin: 0 !important;
}

.app.mobile-display-only .exit-preview {
  display: none;
}

.app.mobile-display-only .enter-fullscreen {
  display: none !important;
}

/* Mobile fallback: force display-only even if JS class failed */
@media (max-width: 900px) {
  .app:not(.mode-edit) {
    grid-template-columns: 1fr !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .app:not(.mode-edit) .panel {
    display: none !important;
  }

  .app:not(.mode-edit) .preview-wrap {
    position: fixed;
    inset: 0;
    min-height: 100dvh;
    width: 100vw;
    margin: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .app:not(.mode-edit) .phone {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none !important;
    margin: 0 !important;
  }

  .app:not(.mode-edit) .enter-fullscreen {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .app {
    padding: 10px;
    gap: 12px;
  }

  .panel {
    padding: 14px;
  }

  .phone {
    transform-origin: top center;
    transform: scale(0.86);
    margin-bottom: -120px;
  }
}
