:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d9e0e8;
  --line-strong: #b9c4d0;
  --text: #17202a;
  --muted: #607080;
  --subtle: #8a98a8;
  --primary: #146356;
  --primary-strong: #0f4a41;
  --accent: #b84a35;
  --accent-soft: #fff0ec;
  --green-soft: #e7f4ef;
  --blue-soft: #edf4ff;
  --danger: #b4232f;
  --shadow: 0 16px 36px rgba(24, 36, 50, 0.09);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
  overscroll-behavior-y: none;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.3;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.4;
}

.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 22px;
  max-width: 1220px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 22px;
}

.workspace {
  min-width: 0;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

.rail {
  position: sticky;
  top: 22px;
  align-self: start;
  min-height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 8px;
  font-weight: 800;
}

.brand-mark.large {
  width: 54px;
  height: 54px;
  font-size: 22px;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 15px;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
}

.brand-sub,
.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

.nav a {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: var(--muted);
  border-radius: 8px;
}

.nav a.active {
  color: #fff;
  background: var(--primary);
}

.nav-count {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 12px;
}

.nav a:not(.active) .nav-count {
  color: var(--primary);
  background: var(--green-soft);
}

.rail-user {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.rail-user span {
  color: var(--muted);
  font-size: 13px;
}

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

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.lead {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar.compact {
  gap: 7px;
}

.toolbar.between {
  justify-content: space-between;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.btn:hover {
  background: var(--primary-strong);
}

.btn.secondary {
  color: var(--text);
  background: #fff;
  border-color: var(--line-strong);
}

.btn.secondary:hover {
  background: var(--panel-soft);
}

.btn.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn.light {
  color: var(--primary);
  background: #fff;
  border-color: #fff;
}

.btn:disabled {
  cursor: not-allowed;
  color: var(--subtle);
  background: #edf0f3;
  border-color: #edf0f3;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.process-step {
  min-height: 70px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.process-step span {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--primary);
  background: var(--green-soft);
  border-radius: 8px;
  font-weight: 800;
}

.process-step strong,
.process-step small {
  display: block;
}

.process-step small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.process-step.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.process-step.active span {
  color: var(--primary);
  background: #fff;
}

.process-step.active small {
  color: rgba(255, 255, 255, 0.78);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat,
.panel,
.card,
.empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat {
  padding: 14px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.empty {
  padding: 28px;
  text-align: center;
}

.empty p {
  max-width: 520px;
  margin: 8px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.products {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid > .empty {
  grid-column: 1 / -1;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 170px auto;
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 99, 86, 0.14);
}

.textarea {
  min-height: 116px;
  resize: vertical;
}

.number-input {
  max-width: 120px;
}

.product-card {
  overflow: hidden;
}

.product-card.selected {
  border-color: #9bc9bb;
  box-shadow: inset 0 0 0 1px #9bc9bb;
}

.product-media,
.share-media {
  position: relative;
  overflow: hidden;
  display: block;
  aspect-ratio: 4 / 3;
  background: #fff;
}

.detail-media {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-media img,
.share-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.product-body,
.plan-copy,
.editor-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.product-body {
  padding: 14px;
}

.card-footer {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 10px;
}

.card-footer .btn {
  width: 100%;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag.green {
  color: var(--primary);
  background: var(--green-soft);
  border-color: #c7ded5;
}

.tag.red {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #efc9bf;
}

.price {
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 12px;
}

.pool-workspace {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.pool-item,
.editor-item,
.plan-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pool-item img,
.editor-item img,
.plan-row img,
.thumb-placeholder {
  width: 92px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.item-control {
  min-width: 230px;
  display: grid;
  gap: 10px;
}

.item-subtotal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.item-subtotal strong {
  color: var(--text);
}

.inline-fields {
  display: grid;
  grid-template-columns: 100px 150px;
  gap: 10px;
}

.summary {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 12px;
  padding: 16px;
  color: #fff;
  background: var(--primary);
  border-radius: 8px;
}

.summary > span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.summary > strong {
  font-size: 28px;
  line-height: 1.2;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.kv.dark {
  border-bottom-color: var(--line);
}

.summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.package-list {
  display: grid;
  gap: 10px;
}

.package-option {
  display: grid;
  gap: 8px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.package-option.selected {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.package-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.share-shell {
  max-width: 900px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
}

.share-page {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.share-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  padding: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #eef8f4 56%, #fff3ef 100%);
  border-bottom: 1px solid var(--line);
}

.share-copy {
  display: grid;
  gap: 14px;
  align-content: start;
}

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

.mini-metric {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-metric span,
.mini-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mini-metric strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 18px;
}

.brand-box {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brand-box .kv {
  color: var(--text);
}

.share-section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}

.share-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.share-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.share-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.quote-grid {
  display: grid;
  gap: 10px;
}

.quote-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-line.total {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  font-size: 18px;
}

.admin-layout {
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
}

.admin-fields {
  grid-template-columns: minmax(0, 1fr) 120px;
}

.textarea.small {
  min-height: 88px;
}

.product-preview {
  width: 160px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-admin-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 90px auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-admin-row img {
  width: 82px;
  height: 66px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.policy-list {
  display: grid;
  gap: 10px;
}

.policy-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.policy-line span {
  color: var(--muted);
}

.policy-line strong {
  text-align: right;
}

.login-screen,
.center-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.inline-error {
  padding: 10px 12px;
  color: var(--danger);
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
}

.loading {
  padding: 18px 22px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: 360px;
  padding: 13px 16px;
  color: #fff;
  background: var(--primary-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mobile-nav {
  display: none;
}

.mobile-header {
  display: none;
}

.mobile-products-flow {
  display: none;
}

.mobile-flow {
  display: none;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 12px;
    align-content: start;
    width: 100%;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .rail {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 8px;
    z-index: 18;
    align-self: start;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 56px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(24, 36, 50, 0.08);
    backdrop-filter: blur(14px);
  }

  .mobile-brand {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
  }

  .mobile-brand strong,
  .mobile-brand small {
    display: block;
  }

  .mobile-brand strong {
    line-height: 1.15;
  }

  .mobile-brand small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-header-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    align-items: center;
  }

  .mobile-pill,
  .mobile-logout {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }

  .mobile-pill {
    color: var(--primary);
    background: var(--green-soft);
    border: 1px solid #c7ded5;
  }

  .mobile-logout {
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
  }

  .workspace {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .grid.products,
  .filters,
  .split,
  .pool-workspace,
  .share-cover,
  .share-list {
    grid-template-columns: 1fr;
  }

  .process-strip,
  .stats,
  .share-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary {
    position: static;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px rgba(24, 36, 50, 0.08);
    backdrop-filter: blur(14px);
  }

  .mobile-nav a {
    display: grid;
    place-items: center;
    min-height: 46px;
    padding: 0 2px;
    color: var(--muted);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-nav a.active {
    color: var(--primary);
    background: var(--green-soft);
  }
}

@media (max-width: 640px) {
  body {
    background: #f6f7f5;
  }

  .shell,
  .share-shell {
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .shell {
    gap: 10px;
  }

  .mobile-header {
    top: 0;
    min-height: 42px;
    padding: 2px 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .brand-mark.small {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .mobile-brand {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .mobile-brand strong {
    font-size: 15px;
  }

  .mobile-pill {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  h1 {
    font-size: 23px;
  }

  .page-head,
  .section-toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
  }

  .lead {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .process-strip {
    display: none;
  }

  .share-metrics,
  .summary-actions {
    grid-template-columns: 1fr;
  }

  .stats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -12px 12px;
    padding: 0 12px 4px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .stats::-webkit-scrollbar,
  .share-metrics::-webkit-scrollbar {
    display: none;
  }

  .stat {
    flex: 0 0 132px;
    display: grid;
    gap: 4px;
    align-content: center;
    padding: 11px 12px;
    scroll-snap-align: start;
  }

  .stat strong {
    margin-top: 0;
    font-size: 18px;
  }

  .panel {
    padding: 14px;
  }

  .toolbar,
  .card-footer {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar .btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
  }

  .filters .btn {
    width: 100%;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px;
  }

  .filters .field:first-child,
  .filters .btn {
    grid-column: 1 / -1;
  }

  .grid.products {
    gap: 10px;
  }

  .product-card {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    min-height: 154px;
  }

  .product-card .product-media {
    height: 100%;
    min-height: 154px;
    aspect-ratio: auto;
    border-right: 1px solid var(--line);
  }

  .product-body {
    gap: 8px;
    padding: 12px;
  }

  .product-body h3,
  .product-body .meta {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
  }

  .product-body h3 {
    font-size: 15px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }

  .product-body .meta {
    font-size: 12px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  .product-body .tag-row .tag:nth-child(n + 3) {
    display: none;
  }

  .tag {
    min-height: 23px;
    padding: 0 8px;
    font-size: 11px;
  }

  .product-card .toolbar.between {
    display: grid;
    justify-items: start;
    gap: 2px;
  }

  .product-card .price {
    font-size: 18px;
  }

  .card-footer {
    gap: 8px;
  }

  .product-card .card-footer {
    grid-template-columns: 1fr;
  }

  .product-card .card-footer > a.btn.secondary {
    display: none;
  }

  .product-card .btn {
    min-height: 40px;
  }

  .pool-item,
  .editor-item,
  .plan-row,
  .share-card,
  .product-admin-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .pool-item img,
  .editor-item img,
  .plan-row img,
  .product-admin-row img,
  .share-card img,
  .thumb-placeholder {
    width: 76px;
    height: 64px;
  }

  .pool-item .item-control,
  .editor-item .toolbar,
  .plan-row .toolbar,
  .product-admin-row .toolbar,
  .product-admin-row .price {
    grid-column: 1 / -1;
  }

  .item-control {
    min-width: 0;
  }

  .number-input {
    max-width: none;
  }

  .inline-fields {
    grid-template-columns: 1fr 1fr;
  }

  .share-shell {
    padding: 0;
  }

  .share-page {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .share-cover,
  .share-section {
    padding: 18px;
  }

  .share-cover {
    gap: 16px;
  }

  .share-metrics {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .mini-metric {
    flex: 1 0 120px;
  }

  .brand-box {
    padding: 14px;
  }

  .quote-line,
  .share-card-foot {
    align-items: center;
  }

  .login-screen,
  .center-screen {
    align-items: start;
    padding: 24px 12px;
    background: #fff;
  }

  .login-panel {
    padding: 10px 0;
    border: 0;
    box-shadow: none;
  }

  .toast {
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
  }

  .desktop-flow {
    display: none;
  }

  .mobile-flow {
    display: grid;
    gap: 12px;
  }

  .desktop-products-flow {
    display: none;
  }

  .mobile-products-flow {
    display: grid;
    gap: 12px;
  }

  .mobile-product-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-end;
    padding-top: 2px;
  }

  .mobile-product-head span {
    display: block;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-product-head h1 {
    margin: 2px 0 0;
    font-size: 28px;
    line-height: 1.05;
  }

  .mobile-product-head a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    color: var(--primary);
    background: var(--green-soft);
    border: 1px solid #c7ded5;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }

  .mobile-search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 6px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .mobile-search-box input {
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    color: var(--text);
    background: var(--panel-soft);
    border: 1px solid transparent;
    border-radius: 8px;
    outline: none;
  }

  .mobile-search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 99, 86, 0.12);
  }

  .mobile-search-box button,
  .mobile-card-bottom button {
    min-height: 42px;
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-weight: 800;
  }

  .mobile-filter-group {
    display: grid;
    gap: 8px;
  }

  .mobile-filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px 2px;
    scrollbar-width: none;
  }

  .mobile-filter-row::-webkit-scrollbar {
    display: none;
  }

  .mobile-filter-chip {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-filter-row.compact .mobile-filter-chip {
    min-height: 30px;
    font-size: 12px;
  }

  .mobile-filter-chip.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
  }

  .mobile-product-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-product-list {
    display: grid;
    gap: 10px;
  }

  .mobile-product-card {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 11px;
    align-items: stretch;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .mobile-product-card.selected {
    border-color: #8cc7b5;
    box-shadow: inset 0 0 0 1px #8cc7b5;
  }

  .mobile-product-image {
    min-height: 116px;
    display: block;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .mobile-product-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
  }

  .mobile-product-info {
    min-width: 0;
    display: grid;
    gap: 6px;
  }

  .mobile-card-tags {
    display: flex;
    gap: 5px;
    overflow: hidden;
  }

  .mobile-card-tags span {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    overflow: hidden;
    color: var(--primary);
    background: var(--green-soft);
    border: 1px solid #c7ded5;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-card-tags span + span {
    color: var(--muted);
    background: var(--panel-soft);
    border-color: var(--line);
  }

  .mobile-product-info h3,
  .mobile-product-info p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
  }

  .mobile-product-info h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.32;
    -webkit-line-clamp: 2;
  }

  .mobile-product-info p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
  }

  .mobile-card-bottom {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: end;
  }

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

  .mobile-card-bottom strong {
    color: var(--accent);
    font-size: 18px;
    line-height: 1.1;
  }

  .mobile-card-bottom small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
  }

  .mobile-card-bottom button {
    min-width: 58px;
    min-height: 38px;
    padding: 0 10px;
  }

  .mobile-page-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: end;
  }

  .mobile-page-head span {
    display: block;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-page-head h1 {
    margin: 2px 0 0;
    font-size: 25px;
    line-height: 1.08;
  }

  .mobile-head-action {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    color: var(--primary);
    background: var(--green-soft);
    border: 1px solid #c7ded5;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }

  .mobile-head-action.primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
  }

  .mobile-head-action:disabled {
    color: var(--subtle);
    background: #edf0f3;
    border-color: #edf0f3;
  }

  .mobile-total-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    color: #fff;
    background: var(--primary);
    border-radius: 8px;
  }

  .mobile-total-card span,
  .mobile-total-card small {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    line-height: 1.4;
  }

  .mobile-total-card strong {
    font-size: 26px;
    line-height: 1.1;
  }

  .mobile-line-list {
    display: grid;
    gap: 10px;
  }

  .mobile-line-card,
  .mobile-plan-card,
  .mobile-empty-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .mobile-line-card,
  .mobile-plan-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    align-items: start;
  }

  .mobile-line-card > img,
  .mobile-plan-card > img,
  .mobile-plan-card > .thumb-placeholder {
    width: 78px;
    height: 72px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .mobile-line-copy {
    min-width: 0;
    display: grid;
    gap: 7px;
  }

  .mobile-line-copy h3,
  .mobile-line-copy p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
  }

  .mobile-line-copy h3 {
    font-size: 15px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }

  .mobile-line-copy p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
  }

  .mobile-line-price,
  .mobile-plan-tags,
  .mobile-quick-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }

  .mobile-line-price strong {
    color: var(--accent);
    font-size: 17px;
  }

  .mobile-line-price span,
  .mobile-quick-stats span,
  .mobile-plan-tags span {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    color: var(--muted);
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-plan-tags span:last-child {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: #efc9bf;
  }

  .mobile-item-controls,
  .mobile-plan-actions {
    display: flex;
    gap: 7px;
    align-items: center;
  }

  .mobile-item-controls button,
  .mobile-plan-actions a,
  .mobile-plan-actions button,
  .mobile-more summary {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: var(--primary);
    background: var(--green-soft);
    border: 1px solid #c7ded5;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
  }

  .mobile-item-controls b {
    min-width: 28px;
    text-align: center;
  }

  .mobile-item-controls button:disabled,
  .mobile-more button:disabled {
    color: var(--subtle);
    background: #edf0f3;
    border-color: #edf0f3;
  }

  .mobile-plan-actions a,
  .mobile-plan-actions > button {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
  }

  .text-danger,
  .mobile-item-controls .text-danger,
  .mobile-more .text-danger {
    color: var(--danger);
    background: #fff1f2;
    border-color: #fecdd3;
  }

  .mobile-more {
    position: relative;
  }

  .mobile-more summary {
    list-style: none;
    cursor: pointer;
  }

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

  .mobile-more[open] {
    z-index: 3;
  }

  .mobile-more[open] summary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
  }

  .mobile-more[open] button {
    margin-top: 6px;
    margin-right: 6px;
  }

  .mobile-wide-danger {
    min-height: 42px;
    color: var(--danger);
    background: #fff;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    font-weight: 800;
  }

  .mobile-empty-panel {
    padding: 22px;
  }

  .mobile-empty-panel p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
  }
}

@media (max-width: 360px) {
  .mobile-product-card {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .mobile-product-image {
    min-height: 108px;
  }

  .mobile-card-bottom {
    align-items: center;
  }

  .mobile-card-bottom strong {
    font-size: 17px;
  }
}
