:root {
  --bg: #f3f5ef;
  --surface: #ffffff;
  --surface-soft: #f8f9f5;
  --ink: #17221f;
  --muted: #69746f;
  --line: #e2e7e0;
  --green: #176b5b;
  --green-dark: #0f5144;
  --green-soft: #e7f2ed;
  --lime: #d9ef9f;
  --amber: #9b6a16;
  --amber-soft: #fff4d8;
  --red: #a53e35;
  --red-soft: #fbe9e7;
  --shadow: 0 12px 34px rgba(26, 47, 40, 0.08);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% 0, rgba(217, 239, 159, 0.35), transparent 30rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 107, 91, 0.22);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(94px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 20px 12px;
  background: rgba(243, 245, 239, 0.88);
  backdrop-filter: blur(18px);
}

.brand-button {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  position: relative;
  display: block;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 16px 16px 16px 5px;
  background: var(--green);
  box-shadow: 0 8px 20px rgba(23, 107, 91, 0.26), 0 0 0 1px rgba(23, 107, 91, 0.2);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.brand-button strong {
  font-size: 20px;
  letter-spacing: 0.08em;
}

.brand-button small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sync-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.sync-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.sync-status.online i {
  background: #2e9d69;
  box-shadow: 0 0 0 4px rgba(46, 157, 105, 0.1);
}

.sync-status.error i {
  background: var(--red);
}

.icon-button {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: white;
  background: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.main-content {
  padding: 8px 16px 24px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 9px 4px 17px;
}

.page-heading h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(28px, 8vw, 38px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.date-pill {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: white;
  background: var(--green);
  box-shadow: 0 20px 35px rgba(15, 81, 68, 0.18);
}

.hero-card::after {
  position: absolute;
  right: -42px;
  bottom: -86px;
  width: 240px;
  height: 240px;
  border: 42px solid rgba(217, 239, 159, 0.13);
  border-radius: 50%;
  content: "";
}

.hero-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  letter-spacing: 0.07em;
}

.hero-value {
  position: relative;
  z-index: 1;
  margin: 5px 0 17px;
  font-family: Georgia, serif;
  font-size: clamp(35px, 11vw, 51px);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.hero-value small {
  margin-left: 5px;
  font-family: "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.75;
}

.hero-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-footer span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.quick-actions {
  display: flex;
  gap: 8px;
}

.quick-actions button {
  padding: 9px 13px;
  border: 0;
  border-radius: 11px;
  color: var(--green-dark);
  background: var(--lime);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.quick-actions button.out {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 24px;
}

.stat-card {
  padding: 16px;
  border: 1px solid rgba(226, 231, 224, 0.8);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
}

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

.stat-card strong {
  display: block;
  margin-top: 7px;
  font-family: Georgia, serif;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.stat-card em {
  color: var(--green);
  font-size: 11px;
  font-style: normal;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 21px 3px 11px;
}

.section-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.text-button {
  padding: 5px 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.notice-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid #eee2c1;
  border-radius: var(--radius-md);
  background: var(--amber-soft);
}

.notice-icon {
  display: grid;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  color: var(--amber);
  background: rgba(255, 255, 255, 0.66);
  font-weight: 800;
}

.notice-card strong {
  display: block;
  font-size: 12px;
}

.notice-card p {
  margin: 3px 0 0;
  color: #78633d;
  font-size: 11px;
}

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

.movement-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(226, 231, 224, 0.78);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
}

.movement-sign {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 17px;
  font-weight: 800;
}

.movement-sign.out {
  color: #9d5923;
  background: #fff0df;
}

.movement-main {
  min-width: 0;
}

.movement-main strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-main span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-amount {
  text-align: right;
}

.movement-amount strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 15px;
}

.movement-amount small {
  display: block;
  max-width: 80px;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-row {
  position: sticky;
  z-index: 12;
  top: 65px;
  display: flex;
  gap: 8px;
  padding: 2px 0 11px;
  background: linear-gradient(var(--bg) 75%, transparent);
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  display: none;
  width: 28px;
  height: 28px;
  border: 0;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.filter-button {
  width: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  cursor: pointer;
}

.filter-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 1px 13px;
  scrollbar-width: none;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.product-card {
  overflow: hidden;
  border: 1px solid rgba(226, 231, 224, 0.9);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 18px rgba(24, 47, 39, 0.04);
}

.product-top {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 14px;
}

.product-thumb {
  position: relative;
  display: grid;
  width: 88px;
  height: 104px;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 80% 10%, rgba(255,255,255,.35), transparent 42%),
    var(--card-color, var(--green));
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(24, 47, 39, 0.09);
}

.product-thumb.has-image {
  background: #eef1ed;
}

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

.thumb-letter {
  position: relative;
  z-index: 1;
}

.product-thumb::after {
  position: absolute;
  right: -13px;
  bottom: -13px;
  width: 40px;
  height: 40px;
  border: 9px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
}

.product-title {
  min-width: 0;
}

.product-code {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.03em;
}

.product-title h3 {
  overflow: hidden;
  margin: 7px 0 3px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-title p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-total {
  text-align: right;
}

.product-total strong {
  font-family: Georgia, serif;
  font-size: 24px;
}

.product-total span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.product-prices {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 0 15px 12px 115px;
}

.price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-radius: 7px;
  color: #6d5200;
  background: #f7f0d5;
  font-size: 9px;
}

.price-badge.live {
  color: var(--green);
  background: var(--green-soft);
}

.size-table {
  display: grid;
  grid-template-columns: 0.62fr 0.62fr 1fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.size-cell {
  min-width: 0;
  padding: 9px 8px;
  border-right: 1px solid rgba(226, 231, 224, 0.75);
  text-align: center;
}

.size-cell:last-child {
  border-right: 0;
}

.size-head {
  padding-top: 7px;
  padding-bottom: 7px;
  color: #8a938e;
  font-size: 8px;
}

.size-cell strong,
.size-cell span {
  display: block;
}

.size-cell strong {
  font-size: 11px;
}

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

.size-cell.zero strong {
  color: #b5bbb8;
}

.size-cell.low strong {
  color: var(--amber);
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 1px;
  background: var(--line);
}

.product-actions button {
  min-height: 42px;
  border: 0;
  color: var(--green);
  background: white;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.product-actions button:nth-child(2) {
  color: #8c581f;
}

.product-actions button:last-child {
  color: var(--muted);
}

.empty-state {
  padding: 42px 20px;
  border: 1px dashed #ccd5cf;
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.45);
}

.empty-state .empty-icon {
  display: block;
  margin-bottom: 8px;
  font-size: 28px;
}

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

.empty-state p {
  margin: 7px 0 0;
  font-size: 11px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.summary-strip div {
  padding: 13px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
}

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

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

.summary-strip strong {
  margin-top: 5px;
  font-size: 16px;
}

.movement-card {
  padding: 15px;
  border: 1px solid rgba(226, 231, 224, 0.82);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
}

.movement-card.expanded {
  border-color: #b8cec5;
}

.movement-card-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.movement-card-body {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.movement-card.expanded .movement-card-body {
  display: grid;
}

.movement-detail {
  min-width: 0;
}

.movement-detail span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.movement-detail strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-card {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(226, 231, 224, 0.86);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
}

.settings-title {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.settings-title h2 {
  margin: 0;
  font-size: 14px;
}

.status-tag {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 9px;
  font-weight: 700;
}

.status-tag.good {
  color: var(--green);
  background: var(--green-soft);
}

.settings-body {
  padding: 15px 16px;
}

.settings-body p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.settings-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.settings-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.settings-action span:last-child {
  color: var(--muted);
}

.settings-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.api-contract {
  overflow-x: auto;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 11px;
  color: #dae7e1;
  background: #1b2c27;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  line-height: 1.6;
  white-space: pre;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: max(12px, calc((100vw - 736px) / 2));
  bottom: calc(10px + var(--safe-bottom));
  left: max(12px, calc((100vw - 736px) / 2));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 65px;
  padding: 7px;
  border: 1px solid rgba(224, 229, 223, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 13px 40px rgba(20, 43, 35, 0.15);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  color: #919995;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.nav-item.active {
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 700;
}

.nav-icon {
  font-size: 19px;
  line-height: 1;
}

.loading-card {
  display: grid;
  min-height: 55vh;
  place-items: center;
  align-content: center;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dce3de;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.toast {
  position: fixed;
  z-index: 100;
  bottom: calc(96px + var(--safe-bottom));
  left: 50%;
  max-width: min(88vw, 460px);
  padding: 11px 16px;
  border-radius: 12px;
  color: white;
  background: rgba(23, 34, 31, 0.94);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #873c34;
}

.modal-overlay {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 34px;
  background: rgba(16, 28, 24, 0.42);
  backdrop-filter: blur(4px);
  animation: overlay-in 0.18s ease-out;
}

@keyframes overlay-in {
  from { opacity: 0; }
}

.modal-sheet {
  width: min(100%, 720px);
  max-height: calc(100vh - 34px);
  overflow: hidden;
  border-radius: 27px 27px 0 0;
  background: var(--surface);
  box-shadow: 0 -15px 45px rgba(14, 30, 25, 0.18);
  animation: sheet-in 0.24s cubic-bezier(0.2, 0.86, 0.35, 1);
}

@keyframes sheet-in {
  from { transform: translateY(45px); opacity: 0.6; }
}

.modal-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.modal-header h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 21px;
}

.modal-close {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding: 17px 19px calc(24px + var(--safe-bottom));
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 39px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.segmented button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 9px rgba(20, 40, 34, 0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: flex;
  justify-content: space-between;
  margin: 0 2px 6px;
  color: #4e5a55;
  font-size: 10px;
  font-weight: 650;
}

.field label small {
  color: var(--muted);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #dfe4de;
  border-radius: 11px;
  color: var(--ink);
  background: #fafbf9;
  font-size: 13px;
}

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

.field input:disabled,
.field select:disabled {
  color: #8f9893;
  background: #f1f3ef;
}

.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.input-action-row button {
  padding: 0 13px;
  border: 1px solid var(--green);
  border-radius: 11px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.lookup-state {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-top: 7px;
  padding: 8px 9px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  line-height: 1.55;
}

.lookup-state.ready {
  color: var(--green);
  background: var(--green-soft);
}

.lookup-state.warning {
  color: #745a2b;
  background: var(--amber-soft);
}

.lookup-state.error {
  color: var(--red);
  background: var(--red-soft);
}

.lookup-state i,
.image-placeholder i {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.image-picker {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.image-preview {
  display: grid;
  min-height: 118px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed #bcc8c0;
  border-radius: 12px;
  color: var(--green);
  background: #fff;
  cursor: pointer;
}

.image-preview img,
.image-edit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  font-size: 23px;
  font-weight: 300;
}

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

.image-placeholder.uploading i {
  color: var(--green);
}

.image-picker-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.image-picker-copy strong {
  font-size: 11px;
}

.image-picker-copy p {
  margin: 4px 0 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.image-picker-copy input {
  width: 100%;
  min-height: 35px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  font-size: 9px;
}

.image-edit-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.image-edit-thumb {
  display: grid;
  width: 88px;
  height: 100px;
  overflow: hidden;
  place-items: center;
  border-radius: 11px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 22px;
}

.image-edit-row strong {
  display: block;
  font-size: 11px;
}

.image-edit-row p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 9px;
}

.small-upload-button {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.form-hint {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.size-editor {
  margin-top: 16px;
}

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

.size-editor-head strong {
  font-size: 11px;
}

.size-editor-head button {
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.size-editor-row {
  display: grid;
  grid-template-columns: 0.8fr 0.72fr 1fr 32px;
  gap: 7px;
  margin-bottom: 7px;
}

.size-editor-row input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbf9;
  font-size: 11px;
}

.remove-size {
  border: 0;
  border-radius: 9px;
  color: #9a7771;
  background: var(--red-soft);
  cursor: pointer;
}

.form-actions {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 9px;
  margin-top: 19px;
}

.form-actions button {
  min-height: 48px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.button-secondary {
  border: 1px solid var(--line);
  background: white;
}

.button-primary {
  border: 1px solid var(--green);
  color: white;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(23, 107, 91, 0.18);
}

.button-primary:disabled {
  border-color: #aeb8b3;
  background: #aeb8b3;
  box-shadow: none;
}

.sale-estimate {
  padding: 12px 13px;
  border-radius: 11px;
  color: #395044;
  background: var(--green-soft);
  font-size: 10px;
  line-height: 1.55;
}

.price-size-list {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.price-size-row {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) 90px;
  gap: 8px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.price-size-row strong {
  font-size: 13px;
}

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

.price-size-row input {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 11px;
}

.danger-text {
  color: var(--red);
}

.version-text {
  padding: 20px 0 8px;
  color: #9aa29e;
  font-size: 9px;
  text-align: center;
}

@media (min-width: 620px) {
  .main-content {
    padding-right: 24px;
    padding-left: 24px;
  }

  .topbar {
    padding-right: 24px;
    padding-left: 24px;
  }

  .product-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-card {
    align-self: start;
  }
}

@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;
  }
}
