* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #eef0e9;
  color: #253b32;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}
.workspace {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 72px;
  padding: 32px;
}
.intro {
  width: 320px;
}
.mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #356554;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
}
.intro h1 {
  font-size: 42px;
  margin: 24px 0 16px;
  font-weight: 650;
  letter-spacing: 2px;
}
.intro p {
  font-size: 16px;
  line-height: 1.9;
  color: #66736b;
}
.intro small {
  display: block;
  line-height: 1.8;
  color: #778278;
}
.swatches {
  display: flex;
  gap: 12px;
  margin: 30px 0;
}
.swatches i {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  border: 1px solid #dbe2d6;
}
.preview-button {
  background: #356554;
  color: white;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  font: inherit;
  margin: 4px 8px 12px 0;
}
.preview-button.secondary {
  background: transparent;
  border: 1px solid #bbc9bf;
  color: #356554;
}
#device {
  width: 390px;
  height: 844px;
  max-height: calc(100vh - 64px);
  background: #f8f7f2;
  border: 7px solid #253b32;
  border-radius: 42px;
  box-shadow: 0 25px 65px #253b3220;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}
.system-nav {
  height: 58px;
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  background: #f8f7f2;
  flex-shrink: 0;
}
.system-nav button {
  border: 0;
  background: none;
  color: #253b32;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
}
.capsule {
  border: 1px solid #253b3220;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  letter-spacing: 3px;
}
#screen {
  height: calc(100% - 58px);
  overflow: auto;
  scrollbar-width: none;
  padding: 0;
  margin: 0;
}
#screen::-webkit-scrollbar {
  display: none;
}
:where(#screen) button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
}
#screen img {
  display: inline-block;
}
:where(#screen) input,
:where(#screen) textarea,
:where(#screen) select {
  font-family: inherit;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: inherit;
  color: inherit;
}
:where(#screen) input {
  width: 100%;
}
:where(#screen) textarea {
  width: 100%;
  resize: none;
}
#screen input::placeholder,
#screen textarea::placeholder {
  color: #9aa39c;
}
#screen button::after {
  display: none;
}
#screen wx-block {
  display: contents;
}
.native-picker {
  position: relative;
}
.native-picker > input,
.native-picker > select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.001;
  cursor: pointer;
}
.native-picker input[type='date']::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  cursor: pointer;
}
.native-toast {
  position: absolute;
  bottom: 130px;
  left: 25px;
  right: 25px;
  text-align: center;
  background: #253b32ed;
  color: #fff;
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  z-index: 5000;
  box-shadow: 0 4px 20px #0002;
}
.desktop-note {
  display: none;
}
@media (max-width: 800px) {
  .workspace {
    padding: 0;
    min-height: 100dvh;
  }
  .intro {
    display: none;
  }
  #device {
    border: 0;
    border-radius: 0;
    width: 100%;
    height: 100dvh;
    max-height: none;
    box-shadow: none;
  }
  .system-nav {
    height: 50px;
  }
  #screen {
    height: calc(100% - 50px);
  }
}

/* Standalone H5: safe areas and a reading-width layout, no simulated device. */
html,
body {
  height: 100%;
  overscroll-behavior: none;
}
body {
  background: #eef0e9;
}
.workspace {
  padding: 0;
  min-height: 100%;
  display: block;
}
.intro {
  display: none;
}
#device {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 60px #253b3210;
  margin: auto;
  transform: translateZ(0);
  display: flex;
  flex-direction: column;
}
.system-nav {
  height: auto;
  min-height: 54px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  gap: 12px;
}
.system-nav #nav-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}
#screen {
  height: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}
#offline-badge {
  width: auto;
  flex-shrink: 0;
  border: 0;
  background: #e8efe7;
  color: #356554;
  border-radius: 30px;
  padding: 7px 11px;
  font-size: 11px;
  white-space: nowrap;
}
.keyboard-open #tab-root {
  display: none;
}
.native-toast {
  bottom: calc(90px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.web-dialog-backdrop,
.image-overlay {
  position: absolute;
  inset: 0;
  background: #172b2466;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.web-dialog {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  max-height: 85%;
  overflow: auto;
  width: 100%;
  box-shadow: 0 15px 60px #172b2440;
}
.web-dialog h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
.web-dialog p {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.web-dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.web-dialog button {
  border: 0;
  border-radius: 12px;
  background: #356554;
  color: #fff;
  min-height: 48px;
  flex: 1;
  font-size: 16px;
}
.web-dialog button.secondary {
  background: #e8efe7;
  color: #356554;
}
.web-dialog input,
.backup-text {
  width: 100%;
  border: 1px solid #cad5c9;
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
  font: inherit;
}
.backup-text {
  height: 220px;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
}
.image-overlay {
  background: #14241eed;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}
.image-overlay img {
  max-width: 100%;
  max-height: 75%;
  object-fit: contain;
}
.image-overlay button {
  background: #fff;
  color: #253b32;
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 18px;
}
.image-overlay-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: #fff;
}
.image-missing {
  background: #f2d9b5;
  outline: 1px dashed #9b7950;
}
.loading-card {
  padding: 40px 24px;
  color: #66736b;
  line-height: 1.8;
}
.fatal {
  padding: 30px;
  line-height: 1.8;
}
.fatal button {
  background: #356554;
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
}
.fatal label {
  display: block;
  margin-top: 18px;
}
.fatal textarea {
  margin: 10px 0;
}
.web-install-note {
  line-height: 1.8;
}
.busy-curtain {
  position: absolute;
  inset: 54px 0 0;
  z-index: 600;
  background: #f8f7f2d9;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-size: 16px;
}
.backup-result .btn {
  margin-top: 8px;
}
.backup-summary {
  line-height: 1.9;
  font-size: 14px;
  white-space: pre-line;
}
.backup-text-field {
  font-size: 12px;
  min-height: 130px;
}
.web-status {
  padding: 12px;
  background: #e8efe7;
  border-radius: 10px;
  margin: 10px 0;
}
.web-status text {
  display: block;
}
.web-section-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.web-section-actions button {
  flex: 1;
  min-width: 90px;
}
.web-section-actions .btn {
  font-size: 13px;
  padding: 9px;
}
.web-file-note {
  overflow-wrap: anywhere;
}
.web-link {
  color: #356554;
  text-decoration: underline;
}
#screen textarea {
  height: auto;
  min-height: 120px;
}
#screen [hidden] {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
@media (min-width: 801px) {
  #device {
    border-left: 1px solid #e1e7dc;
    border-right: 1px solid #e1e7dc;
  }
}
