:root {
  --ink: #18221b;
  --ink-2: #46534a;
  --muted: #78857b;
  --line: #dce3da;
  --line-strong: #c7d1c6;
  --paper: #ffffff;
  --canvas: #f1f4ef;
  --canvas-2: #e7ece4;
  --navy: #182922;
  --green: #1c6c52;
  --green-soft: #e5f3ec;
  --lime: #d6ff79;
  --coral: #f06d4f;
  --coral-soft: #fff0ea;
  --amber: #aa6615;
  --amber-soft: #fff4df;
  --blue: #396a8d;
  --blue-soft: #eaf2f7;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 16px 44px rgba(25, 38, 30, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
  min-width: 320px;
  min-height: 100%;
  background: #dfe5dc;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(27, 38, 30, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 38, 30, 0.035) 1px, transparent 1px),
    #dfe5dc;
  background-size: 30px 30px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(214, 255, 121, 0.52);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--canvas);
  box-shadow: 0 0 0 1px rgba(24, 34, 27, 0.06), var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.merchant-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.merchant-switch img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  object-position: center 24%;
  border: 1px solid #b7c9b9;
  border-radius: 8px;
}

.merchant-switch span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.merchant-switch small {
  color: var(--muted);
  font-size: 9px;
}

.merchant-switch strong {
  overflow: hidden;
  max-width: 240px;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-switch .icon {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.local-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #c8e4d7;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.local-chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3b9a71;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.app-main {
  min-height: calc(100vh - 68px);
  padding: 14px 14px calc(88px + env(safe-area-inset-bottom));
}

.view {
  animation: view-in 180ms ease both;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64vh;
  color: var(--muted);
  text-align: center;
}

.loading-state img {
  width: 62px;
  height: 62px;
  margin-bottom: 13px;
  border-radius: 14px;
}

.loading-state strong {
  color: var(--ink);
  font-size: 15px;
}

.loading-state span {
  margin-top: 4px;
  font-size: 10px;
}

.activation-view {
  padding-top: 4px;
}

.activation-hero {
  overflow: hidden;
  padding: 21px 18px 23px;
  color: #eff6f2;
  background: var(--navy);
  border-radius: var(--radius);
}

.activation-hero .eyebrow {
  color: var(--lime);
}

.activation-hero img {
  width: 58px;
  height: 58px;
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
}

.activation-hero h1 {
  margin: 13px 0 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.2;
}

.activation-hero > p:last-child {
  max-width: 360px;
  margin: 8px 0 0;
  color: #b2c6bc;
  font-size: 11px;
  line-height: 1.65;
}

.activation-form {
  margin-top: 10px;
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.activation-code-input {
  min-height: 48px;
  font-family: Consolas, Menlo, monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.activation-error {
  margin-bottom: 10px;
  padding: 8px 9px;
  color: #a43d2a;
  background: var(--coral-soft);
  border: 1px solid #efc6bc;
  border-radius: var(--radius-sm);
  font-size: 10px;
  line-height: 1.5;
}

.activation-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.activation-demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 9px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  color: var(--muted);
  background: #e8eee6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 9px;
}

.activation-demo strong {
  color: var(--ink-2);
  font-size: 10px;
}

.activation-demo span {
  grid-column: 1;
}

.activation-demo button {
  grid-row: 1 / span 2;
  grid-column: 2;
  padding: 0;
  color: var(--green);
  background: transparent;
  border: 0;
  font-size: 9px;
  font-weight: 800;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 520px);
  min-height: calc(65px + env(safe-area-inset-bottom));
  padding: 5px 7px env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.nav-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 5px 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.nav-button .icon {
  width: 19px;
  height: 19px;
}

.nav-button.active {
  color: var(--green);
  background: var(--green-soft);
}

.create-nav {
  color: var(--ink);
}

.create-mark {
  display: grid;
  width: 38px;
  height: 38px;
  margin-top: -24px;
  place-items: center;
  color: var(--lime);
  background: var(--navy);
  border: 4px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(24, 41, 34, 0.22);
}

.create-mark .icon {
  width: 18px;
  height: 18px;
}

.create-nav.active {
  background: transparent;
}

.create-nav.active .create-mark {
  color: var(--navy);
  background: var(--lime);
}

.nav-badge {
  position: absolute;
  top: 3px;
  right: calc(50% - 20px);
  display: grid;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 8px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  color: #f2f8f4;
  background: var(--navy);
  border-radius: var(--radius);
}

.hero::after {
  position: absolute;
  right: -45px;
  bottom: -65px;
  width: 175px;
  height: 175px;
  border: 1px solid rgba(214, 255, 121, 0.14);
  border-radius: 50%;
  content: "";
}

.hero-top {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  color: var(--coral);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--lime);
}

.hero h1 {
  max-width: 330px;
  margin: 6px 0 7px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 25px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero p {
  max-width: 355px;
  margin: 0;
  color: #b8c9c0;
  font-size: 11px;
  line-height: 1.65;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 41px;
  padding: 8px 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button .icon {
  width: 16px;
  height: 16px;
}

.button.lime {
  color: #1e2c13;
  background: var(--lime);
  border-color: #b8e55c;
}

.button.dark {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.button.primary {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.button.ghost {
  color: var(--ink-2);
  background: transparent;
  border-color: var(--line-strong);
}

.button.coral {
  color: #7e2c1b;
  background: var(--coral-soft);
  border-color: #f0c4b8;
}

.button.wide {
  width: 100%;
}

.button.compact {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 11px;
}

.hero .button.lime {
  width: 100%;
}

.hero .button.ghost {
  color: #d8e4df;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.section {
  margin-top: 18px;
}

.install-banner {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px;
  background: var(--paper);
  border: 1px solid #cddbcf;
  border-radius: var(--radius);
  box-shadow: 0 7px 18px rgba(24, 34, 27, 0.05);
}

.install-banner > img {
  width: 42px;
  height: 42px;
  border-radius: 9px;
}

.install-banner > span {
  min-width: 0;
}

.install-banner strong,
.install-banner > span > span {
  display: block;
}

.install-banner strong {
  font-size: 11px;
}

.install-banner > span > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.install-banner .icon-button {
  width: 31px;
  height: 31px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 0;
  color: var(--green);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.text-action .icon {
  width: 13px;
  height: 13px;
}

.identity-strip {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
}

.identity-strip img {
  width: 52px;
  height: 62px;
  object-fit: cover;
  object-position: center 24%;
  border-radius: var(--radius-sm);
  background: var(--canvas-2);
}

.identity-strip strong,
.identity-strip span {
  display: block;
}

.identity-strip strong {
  font-size: 13px;
}

.identity-strip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.identity-strip .tag {
  justify-self: end;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #c9e2d7;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #eed5a8;
}

.tag.coral {
  color: #a5402e;
  background: var(--coral-soft);
  border-color: #f0c4b8;
}

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

.stat {
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  font-size: 19px;
  line-height: 1.2;
}

.stat span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.project-list,
.publish-list {
  display: grid;
  gap: 9px;
}

.project-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
}

.project-row > img,
.project-row > .cover {
  width: 72px;
  height: 94px;
  overflow: hidden;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--canvas-2);
}

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

.project-copy strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-meta {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
}

.project-row > .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 35px 20px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.empty-state .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 9px;
  color: var(--green);
}

.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-state span {
  margin-top: 4px;
  font-size: 10px;
}

.wizard-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.wizard-head > span {
  text-align: center;
}

.wizard-head strong,
.wizard-head small {
  display: block;
}

.wizard-head strong {
  font-size: 14px;
}

.wizard-head small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}

.wizard-progress i {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
}

.wizard-progress i.active {
  background: var(--green);
}

.wizard-title {
  margin-bottom: 14px;
}

.wizard-title h1 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: 0;
}

.wizard-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.card {
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card + .card {
  margin-top: 10px;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

.field > span,
.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 9px 10px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.textarea {
  min-height: 82px;
  line-height: 1.65;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  background: #fff;
  border-color: #a8bda9;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(28, 108, 82, 0.08);
}

.field-hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 12px;
  padding: 3px;
  background: var(--canvas-2);
  border-radius: var(--radius-sm);
}

.mode-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.mode-tabs button.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1px 4px rgba(24, 34, 27, 0.08);
}

.mode-tabs .icon {
  width: 14px;
  height: 14px;
}

.analysis-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.analysis-head strong {
  font-size: 12px;
}

.analysis-head span {
  color: var(--muted);
  font-size: 9px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  padding: 12px 13px;
}

.analysis-grid .wide {
  grid-column: 1 / -1;
}

.analysis-grid span,
.analysis-grid strong {
  display: block;
}

.analysis-grid span {
  color: var(--muted);
  font-size: 9px;
}

.analysis-grid strong {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.45;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 13px 13px;
}

.source-result {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.source-cover {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  background: var(--canvas-2);
  border-radius: var(--radius-sm);
}

.source-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-cover::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(12, 19, 15, 0.7));
  content: "";
}

.source-cover span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 1;
  padding: 3px 5px;
  color: #fff;
  background: rgba(10, 16, 12, 0.72);
  border-radius: 3px;
  font-size: 8px;
}

.source-copy {
  min-width: 0;
  padding: 3px 0;
}

.source-copy h3 {
  margin: 7px 0 4px;
  font-size: 13px;
  line-height: 1.42;
}

.source-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.source-stats {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.source-stats strong,
.source-stats span {
  display: block;
}

.source-stats strong {
  font-size: 12px;
}

.source-stats span {
  color: var(--muted);
  font-size: 8px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 10px;
  color: #6f551a;
  background: var(--amber-soft);
  border: 1px solid #ecd6ac;
  border-radius: var(--radius-sm);
  font-size: 10px;
  line-height: 1.55;
}

.notice .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.parse-progress {
  display: grid;
  grid-template-columns: 21px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #cbe4d9;
  border-radius: var(--radius-sm);
  font-size: 10px;
}

.parse-progress .icon {
  width: 17px;
  height: 17px;
}

.parse-progress .bar {
  grid-column: 2;
  overflow: hidden;
  height: 3px;
  background: #cfe8dd;
  border-radius: 3px;
}

.parse-progress .bar i {
  display: block;
  width: 12%;
  height: 100%;
  background: var(--green);
  transition: width 350ms ease;
}

.version-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.version-head strong {
  font-size: 12px;
}

.version-tabs {
  display: flex;
  gap: 3px;
}

.version-tabs button {
  width: 29px;
  height: 28px;
  padding: 0;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.version-tabs button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.script-summary {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 9px;
}

.script-count {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.meta-section {
  margin-top: 13px;
}

.meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.meta-head strong {
  font-size: 12px;
}

.title-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  color: var(--ink-2);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.title-option i {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
}

.title-option.active {
  color: var(--ink);
  background: var(--green-soft);
  border-color: #bfdfd1;
}

.title-option.active i {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.topic-chip {
  padding: 4px 7px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #ccdfe9;
  border-radius: 999px;
  font-size: 9px;
}

.owner-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.owner-card img {
  width: 74px;
  height: 92px;
  object-fit: cover;
  object-position: center 24%;
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.owner-copy strong,
.owner-copy span {
  display: block;
}

.owner-copy strong {
  font-size: 13px;
}

.owner-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.shoot-list {
  display: grid;
  gap: 0;
}

.shoot-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.shoot-card:last-child {
  border-bottom: 0;
}

.shoot-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 6px;
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
}

.shoot-card strong {
  display: block;
  font-size: 11px;
}

.shoot-card p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.55;
}

.shoot-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.media-upload-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.media-upload-row > span {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

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

.media-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.media-card video {
  width: 100%;
  aspect-ratio: 9 / 12;
  object-fit: cover;
  background: #17231d;
}

.media-actions {
  display: flex;
  gap: 2px;
  padding: 4px;
}

.media-actions button {
  min-width: 0;
  flex: 1;
  padding: 3px 2px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 8px;
}

.media-actions button.active {
  color: var(--green);
  background: var(--green-soft);
  border-color: #c8e2d6;
}

.media-actions button[data-action="delete-media"] {
  flex: 0 0 24px;
}

.media-actions .icon {
  width: 11px;
  height: 11px;
}

.media-warning,
.media-ok {
  display: block;
  overflow: hidden;
  padding: 3px 5px;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-warning {
  color: #9c5a12;
  background: var(--amber-soft);
}

.media-ok {
  color: var(--green);
  background: var(--green-soft);
}

.media-empty {
  padding: 23px 15px;
}

.preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teleprompter-toolbar {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 7px;
  margin-bottom: 10px;
}

.teleprompter-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  color: var(--ink-2);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.teleprompter-toolbar button.primary {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.teleprompter-toolbar .icon {
  width: 15px;
  height: 15px;
}

.teleprompter-text {
  max-height: 58vh;
  overflow-y: auto;
  padding: 24px 17px 45vh;
  color: #f3f8f4;
  background: var(--navy);
  border-radius: var(--radius);
  line-height: 1.8;
  scroll-behavior: smooth;
}

.teleprompter-text p {
  margin: 0 0 0.85em;
}

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 12px;
  padding: 10px;
  color: var(--ink-2);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 10px;
  line-height: 1.55;
  cursor: pointer;
}

.consent-row input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-preview {
  position: relative;
  overflow: hidden;
  width: min(100%, 250px);
  aspect-ratio: 9 / 16;
  background: var(--navy);
  border: 4px solid #1a241d;
  border-radius: 18px;
  box-shadow: 0 14px 26px rgba(24, 41, 34, 0.16);
}

.phone-preview > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.preview-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 18, 14, 0.2), transparent 25%, transparent 55%, rgba(12, 18, 14, 0.82)),
    linear-gradient(90deg, rgba(12, 18, 14, 0.12), transparent 30%, transparent 70%, rgba(12, 18, 14, 0.08));
}

.preview-topline {
  position: absolute;
  top: 9px;
  right: 9px;
  left: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-size: 8px;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  color: #f6faef;
  background: rgba(20, 28, 23, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  backdrop-filter: blur(7px);
}

.preview-chip .icon {
  width: 10px;
  height: 10px;
}

.preview-caption {
  position: absolute;
  right: 17px;
  bottom: 83px;
  left: 17px;
  z-index: 2;
  color: #fff;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.58);
}

.preview-bottom {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
}

.preview-bottom strong,
.preview-bottom span {
  display: block;
}

.preview-bottom strong {
  font-size: 10px;
}

.preview-bottom span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.63);
  font-size: 8px;
}

.preview-live {
  color: var(--lime);
  font-size: 9px;
  font-weight: 900;
}

.preview-actions {
  display: flex;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 9px;
}

.publish-copy {
  margin-top: 10px;
}

.publish-copy strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.publish-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.channel-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.channel-card + .channel-card {
  margin-top: 8px;
}

.channel-card.active {
  background: #f7fcf4;
  border-color: #b8d9ca;
  box-shadow: 0 0 0 1px rgba(28, 108, 82, 0.04);
}

.channel-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: var(--radius-sm);
}

.channel-card strong,
.channel-card span {
  display: block;
}

.channel-card strong {
  font-size: 12px;
}

.channel-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.package-summary {
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.package-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 10px;
}

.package-row:last-child {
  border-bottom: 0;
}

.package-row span {
  color: var(--muted);
}

.package-row strong {
  max-width: 68%;
  text-align: right;
}

.wizard-actions {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(160px, 1.3fr);
  gap: 8px;
  margin-top: 16px;
}

.wizard-actions .button {
  width: 100%;
}

.publish-card {
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.publish-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.publish-card-head strong {
  display: block;
  font-size: 12px;
  line-height: 1.4;
}

.publish-card-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.publish-card p {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.6;
}

.publish-card .topic-line {
  color: var(--blue);
}

.publish-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.publish-card-actions .button {
  flex: 1;
}

.profile-block {
  padding: 14px;
  color: #eaf4ef;
  background: var(--navy);
  border-radius: var(--radius);
}

.profile-block h2 {
  margin: 4px 0 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 22px;
  font-weight: 650;
}

.profile-block p {
  margin: 5px 0 0;
  color: #adc2b7;
  font-size: 10px;
}

.profile-identity {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-identity img {
  width: 62px;
  height: 72px;
  object-fit: cover;
  object-position: center 24%;
  border-radius: var(--radius-sm);
}

.profile-identity strong,
.profile-identity span {
  display: block;
}

.profile-identity strong {
  font-size: 12px;
}

.profile-identity span {
  margin-top: 3px;
  color: #acc0b6;
  font-size: 9px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row .icon {
  color: var(--green);
}

.setting-row span {
  flex: 1;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  font-size: 11px;
}

.setting-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  background: rgba(17, 24, 19, 0.46);
  backdrop-filter: blur(3px);
}

.sheet {
  width: min(100%, 500px);
  max-height: 82vh;
  overflow-y: auto;
  padding: 16px;
  background: var(--paper);
  border-radius: 12px;
}

.sheet-handle {
  width: 34px;
  height: 4px;
  margin: -7px auto 12px;
  background: var(--line-strong);
  border-radius: 999px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
}

.sheet-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.sheet-copy {
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.75;
}

.sheet-copy strong {
  color: var(--ink);
}

.toast {
  position: fixed;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 70;
  width: max-content;
  max-width: calc(100vw - 28px);
  padding: 9px 13px;
  color: #fff;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(18, 29, 22, 0.2);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.is-hidden {
  display: none !important;
}

.spin {
  animation: spin 900ms linear infinite;
}

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

@media (max-width: 380px) {
  .app-main {
    padding-right: 11px;
    padding-left: 11px;
  }

  .hero {
    padding: 15px;
  }

  .hero h1 {
    font-size: 23px;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  .merchant-switch strong {
    max-width: 185px;
  }

  .local-chip {
    display: none;
  }

  .wizard-title h1 {
    font-size: 21px;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .analysis-grid .wide {
    grid-column: auto;
  }

  .media-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 521px) {
  .app-shell {
    min-height: calc(100vh - 28px);
    margin-top: 14px;
    margin-bottom: 14px;
    border-radius: 16px;
  }

  .bottom-nav {
    bottom: 14px;
    max-width: 520px;
    border-radius: 0 0 16px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
